opencode-swarm 6.22.4 → 6.22.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 CHANGED
@@ -8,7 +8,11 @@ OpenCode Swarm is a plugin for [OpenCode](https://opencode.ai) that turns a sing
8
8
 
9
9
  You do **not** manually switch between Swarm's internal agents during normal use.
10
10
 
11
- You continue talking to OpenCode normally. Swarm intercepts the session, the **architect** coordinates the internal pipeline behind the scenes, and all project state is persisted to `.swarm/` so work can resume later.
11
+ You must **explicitly choose a Swarm architect** in the OpenCode GUI before starting. The architect name shown in OpenCode is config-driven you can define multiple architects with different model assignments in your configuration, and those custom names will appear in the GUI dropdown.
12
+
13
+ If you use OpenCode's default `Build` / `Plan` options instead of selecting a Swarm architect, the plugin is bypassed entirely.
14
+
15
+ Once you select a Swarm architect, that architect coordinates the internal pipeline behind the scenes, and all project state is persisted to `.swarm/` so work can resume later.
12
16
 
13
17
  ```bash
14
18
  npm install -g opencode-swarm
@@ -93,15 +97,16 @@ What they tell you:
93
97
  * `/swarm agents` shows the registered internal agents and model assignments
94
98
  * `/swarm config` shows the resolved configuration currently in effect
95
99
 
96
- ### 4. Start normally
100
+ ### 4. Select a Swarm architect and start
97
101
 
98
- Just tell OpenCode what you want to build.
102
+ 1. **Choose a Swarm architect** in the OpenCode GUI (the exact name depends on your configuration — you can define multiple architects with different model assignments)
103
+ 2. Then describe what you want to build.
99
104
 
100
105
  ```text
101
106
  Build a REST API with user registration, login, and JWT auth.
102
107
  ```
103
108
 
104
- You do **not** manually choose `architect`, `coder`, `reviewer`, `critic`, or other internal agents. The **architect** coordinates them automatically.
109
+ You do **not** manually choose `coder`, `reviewer`, `critic`, or other internal agents. The **architect** coordinates them automatically after you select it.
105
110
 
106
111
  ### 5. Understand first run vs later runs
107
112
 
@@ -152,9 +157,11 @@ You only need to specify the agents you want to override.
152
157
 
153
158
  ## Common First-Run Questions
154
159
 
155
- ### "Do I need to use the Architect agent specifically?"
160
+ ### "Do I need to select a Swarm architect?"
161
+
162
+ **Yes.** You must explicitly choose a Swarm architect agent in the OpenCode GUI before starting your session. The architect name shown in OpenCode is config-driven — you can define multiple architects with different model assignments in your configuration.
156
163
 
157
- No. In normal use, you just use OpenCode. Swarm's architect runs inside the plugin and coordinates the other internal agents automatically.
164
+ If you use the default OpenCode `Build` / `Plan` options without selecting a Swarm architect, the plugin is bypassed entirely.
158
165
 
159
166
  ### "Why did the second run start coding immediately?"
160
167
 
@@ -1156,8 +1163,11 @@ Upcoming: v6.22 focuses on further context optimization and agent coordination i
1156
1163
 
1157
1164
  ## FAQ
1158
1165
 
1159
- ### Do I need to use the Architect agent specifically?
1160
- No. In normal use, you just use OpenCode. Swarm's architect runs inside the plugin and coordinates the other internal agents automatically.
1166
+ ### Do I need to select a Swarm architect?
1167
+
1168
+ **Yes.** You must explicitly choose a Swarm architect agent in the OpenCode GUI before starting your session. The architect name shown in OpenCode is config-driven — you can define multiple architects with different model assignments in your configuration.
1169
+
1170
+ If you use the default OpenCode `Build` / `Plan` options without selecting a Swarm architect, the plugin is bypassed entirely.
1161
1171
 
1162
1172
  ### Why did Swarm start coding immediately on my second run?
1163
1173
  Because Swarm resumes from `.swarm/` state when it exists. Check `/swarm status` to see the current mode.
@@ -47,6 +47,7 @@ export declare function createDelegationGateHook(config: PluginConfig): {
47
47
  tool: string;
48
48
  sessionID: string;
49
49
  callID: string;
50
+ args?: Record<string, unknown>;
50
51
  }, output: unknown) => Promise<void>;
51
52
  };
52
53
  export {};
@@ -44,6 +44,7 @@ export declare function createGuardrailsHooks(directoryOrConfig?: string | Guard
44
44
  tool: string;
45
45
  sessionID: string;
46
46
  callID: string;
47
+ args?: Record<string, unknown>;
47
48
  }, output: {
48
49
  title: string;
49
50
  output: string;
package/dist/index.js CHANGED
@@ -47774,7 +47774,7 @@ function createGuardrailsHooks(directoryOrConfig, config3) {
47774
47774
  }
47775
47775
  }
47776
47776
  }
47777
- const inputArgs = getStoredInputArgs(input.callID);
47777
+ const inputArgs = input.args ?? getStoredInputArgs(input.callID);
47778
47778
  const delegation = isAgentDelegation(input.tool, inputArgs);
47779
47779
  if (delegation.isDelegation && (delegation.targetAgent === "reviewer" || delegation.targetAgent === "test_engineer")) {
47780
47780
  let currentPhase = 1;
@@ -48019,10 +48019,10 @@ function createDelegationGateHook(config3) {
48019
48019
  console.log(`[swarm-debug-task] delegation-gate.toolAfter | session=${input.sessionID} callID=${input.callID} tool=${input.tool}`);
48020
48020
  const normalized = input.tool.replace(/^[^:]+[:.]/, "");
48021
48021
  if (normalized === "Task" || normalized === "task") {
48022
+ const directArgs = input.args;
48022
48023
  const storedArgs = getStoredInputArgs(input.callID);
48023
- const argsObj = storedArgs;
48024
- const subagentType = argsObj?.subagent_type;
48025
- console.log(`[swarm-debug-task] delegation-gate.taskDetected | session=${input.sessionID} subagent_type=${subagentType ?? "(none)"} currentStates=[${statesSummary}]`);
48024
+ const subagentType = directArgs?.subagent_type ?? storedArgs?.subagent_type;
48025
+ console.log(`[swarm-debug-task] delegation-gate.taskDetected | session=${input.sessionID} subagent_type=${subagentType ?? "(none)"} source=${directArgs?.subagent_type ? "input.args" : storedArgs?.subagent_type ? "storedArgs" : "none"} currentStates=[${statesSummary}]`);
48026
48026
  let hasReviewer = false;
48027
48027
  let hasTestEngineer = false;
48028
48028
  if (typeof subagentType === "string") {
@@ -48076,7 +48076,7 @@ function createDelegationGateHook(config3) {
48076
48076
  }
48077
48077
  }
48078
48078
  }
48079
- if (argsObj !== undefined) {
48079
+ if (storedArgs !== undefined) {
48080
48080
  deleteStoredInputArgs(input.callID);
48081
48081
  }
48082
48082
  if (!subagentType || !hasReviewer) {
@@ -60922,7 +60922,8 @@ var OpenCodeSwarm = async (ctx) => {
60922
60922
  }
60923
60923
  }
60924
60924
  }
60925
- if (input.tool === "task") {
60925
+ const normalizedTool = input.tool.replace(/^[^:]+[:.]/, "");
60926
+ if (normalizedTool === "Task" || normalizedTool === "task") {
60926
60927
  const sessionId = input.sessionID;
60927
60928
  const beforeSession = swarmState.agentSessions.get(sessionId);
60928
60929
  const beforeStates = beforeSession?.taskWorkflowStates ? Object.entries(beforeSession.taskWorkflowStates).map(([k, v]) => `${k}=${v}`).join(",") : "(none)";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "6.22.4",
3
+ "version": "6.22.6",
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",