opencode-swarm 7.17.4 → 7.18.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,11 @@
1
+ import type { PluginConfig } from '../config';
2
+ export type StandardParallelizationRuntimeConfig = {
3
+ stageBParallelEnabled: boolean;
4
+ taskFanoutEnabled: boolean;
5
+ maxConcurrentTasks: number;
6
+ maxConcurrentCoders: number;
7
+ maxConcurrentStageBGroups: number;
8
+ evidenceLockTimeoutMs: number;
9
+ source: 'current-default' | 'global-config' | 'locked-profile';
10
+ };
11
+ export declare function resolveStandardParallelizationConfig(config: PluginConfig | undefined, directory: string): StandardParallelizationRuntimeConfig;
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * AgentRunContext — typed per-run state container.
3
3
  *
4
- * Holds the subset of swarmState needed for future per-run isolation:
4
+ * Holds the subset of swarmState used by run-scoped orchestration:
5
5
  * activeToolCalls, activeAgent, delegationChains, agentSessions,
6
6
  * environmentProfiles, and a shared reference to process-global toolAggregates.
7
7
  *
8
- * PR 1 (dark foundation): the class exists and is instantiated for the default
9
- * single-run path only. No runtime behavior is changed.
10
- * PR 2 will wire distinct contexts to parallel dispatcher slots.
8
+ * The default context preserves existing single-run behavior. Distinct contexts
9
+ * remain available for dispatcher-slot isolation as the standard parallel path
10
+ * grows beyond current task and Stage B gate coordination.
11
11
  *
12
12
  * Generic type parameters let state.ts bind concrete internal types without
13
13
  * creating a circular import.
package/dist/state.d.ts CHANGED
@@ -50,6 +50,7 @@ export type DelegationReason = 'normal_delegation' | 'review_rejected' | 'critic
50
50
  * Transitions must be forward-only: idle → coder_delegated → pre_check_passed → reviewer_run → tests_run → complete
51
51
  */
52
52
  export type TaskWorkflowState = 'idle' | 'coder_delegated' | 'pre_check_passed' | 'reviewer_run' | 'tests_run' | 'complete';
53
+ export type StageBGate = 'reviewer' | 'test_engineer' | 'adversarial_test_engineer';
53
54
  /**
54
55
  * Represents per-session state for guardrail tracking.
55
56
  * Budget fields (toolCallCount, consecutiveErrors, etc.) have moved to InvocationWindow.
@@ -111,7 +112,9 @@ export interface AgentSessionState {
111
112
  * When both are present, the task may advance to tests_run regardless of order.
112
113
  * Always populated — Stage B is unconditionally parallel.
113
114
  */
114
- stageBCompletion?: Map<string, Set<'reviewer' | 'test_engineer'>>;
115
+ stageBCompletion?: Map<string, Set<StageBGate>>;
116
+ /** Per-task required Stage B gates. Optional gates are added when dispatched. */
117
+ requiredStageBGates?: Map<string, Set<StageBGate>>;
115
118
  /** v6.71+ Council mode: per-task council verdict, recorded by delegation-gate when submit_council_verdicts resolves. */
116
119
  taskCouncilApproved?: Map<string, {
117
120
  verdict: 'APPROVE' | 'REJECT' | 'CONCERNS';
@@ -448,19 +451,11 @@ export declare function advanceTaskStateAndPersist(session: AgentSessionState, t
448
451
  * @returns Current task workflow state
449
452
  */
450
453
  export declare function getTaskState(session: AgentSessionState, taskId: string): TaskWorkflowState;
454
+ export declare function requireStageBGate(session: AgentSessionState, taskId: string, gate: StageBGate): void;
455
+ export declare function recordStageBCompletion(session: AgentSessionState, taskId: string, agent: StageBGate): void;
451
456
  /**
452
- * PR 2 Stage B barrier: record that a Stage B agent has completed for a task.
453
- * Order-independent either 'reviewer' or 'test_engineer' may complete first.
454
- * Initializes the per-task set on first write.
455
- *
456
- * @param session - The agent session state
457
- * @param taskId - The task identifier
458
- * @param agent - Which Stage B agent completed ('reviewer' or 'test_engineer')
459
- */
460
- export declare function recordStageBCompletion(session: AgentSessionState, taskId: string, agent: 'reviewer' | 'test_engineer'): void;
461
- /**
462
- * PR 2 Stage B barrier: returns true iff both 'reviewer' and 'test_engineer' have
463
- * been recorded for the given task in this session.
457
+ * PR 2 Stage B barrier: returns true iff every required Stage B gate has been
458
+ * recorded for the given task in this session.
464
459
  *
465
460
  * @param session - The agent session state
466
461
  * @param taskId - The task identifier
@@ -57,7 +57,7 @@ export declare function checkReviewerGate(taskId: string, workingDirectory?: str
57
57
  /**
58
58
  * Wrapper around checkReviewerGate that appends a diff-scope advisory warning.
59
59
  * Keeps checkReviewerGate synchronous for backward compatibility.
60
- * Stage B parallel is hardcoded (not config-driven).
60
+ * Stage B parallel is resolved from standard parallelization config.
61
61
  * @param taskId - The task ID to check gate state for
62
62
  * @param workingDirectory - Optional working directory for plan.json fallback
63
63
  * @param sessionID - Optional session ID to scope Lean Turbo bypass to the current tool-execution context
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.17.4",
3
+ "version": "7.18.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",