opencode-swarm 3.2.1 → 3.3.1

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,2 @@
1
+ import type { SMEDomainConfig } from './base';
2
+ export declare const aiSMEConfig: SMEDomainConfig;
@@ -1,9 +1,9 @@
1
- export declare const SME_AGENTS: readonly ["sme_windows", "sme_powershell", "sme_python", "sme_oracle", "sme_network", "sme_security", "sme_linux", "sme_vmware", "sme_azure", "sme_active_directory", "sme_ui_ux", "sme_web", "sme_database", "sme_devops", "sme_api"];
1
+ export declare const SME_AGENTS: readonly ["sme_windows", "sme_powershell", "sme_python", "sme_oracle", "sme_network", "sme_security", "sme_linux", "sme_vmware", "sme_azure", "sme_active_directory", "sme_ui_ux", "sme_web", "sme_database", "sme_devops", "sme_api", "sme_ai"];
2
2
  export declare const QA_AGENTS: readonly ["security_reviewer", "auditor"];
3
3
  export declare const PIPELINE_AGENTS: readonly ["explorer", "coder", "test_engineer"];
4
4
  export declare const ORCHESTRATOR_NAME: "architect";
5
- export declare const ALL_SUBAGENT_NAMES: readonly ["sme_windows", "sme_powershell", "sme_python", "sme_oracle", "sme_network", "sme_security", "sme_linux", "sme_vmware", "sme_azure", "sme_active_directory", "sme_ui_ux", "sme_web", "sme_database", "sme_devops", "sme_api", "security_reviewer", "auditor", "explorer", "coder", "test_engineer"];
6
- export declare const ALL_AGENT_NAMES: readonly ["architect", "sme_windows", "sme_powershell", "sme_python", "sme_oracle", "sme_network", "sme_security", "sme_linux", "sme_vmware", "sme_azure", "sme_active_directory", "sme_ui_ux", "sme_web", "sme_database", "sme_devops", "sme_api", "security_reviewer", "auditor", "explorer", "coder", "test_engineer"];
5
+ export declare const ALL_SUBAGENT_NAMES: readonly ["sme_windows", "sme_powershell", "sme_python", "sme_oracle", "sme_network", "sme_security", "sme_linux", "sme_vmware", "sme_azure", "sme_active_directory", "sme_ui_ux", "sme_web", "sme_database", "sme_devops", "sme_api", "sme_ai", "security_reviewer", "auditor", "explorer", "coder", "test_engineer"];
6
+ export declare const ALL_AGENT_NAMES: readonly ["architect", "sme_windows", "sme_powershell", "sme_python", "sme_oracle", "sme_network", "sme_security", "sme_linux", "sme_vmware", "sme_azure", "sme_active_directory", "sme_ui_ux", "sme_web", "sme_database", "sme_devops", "sme_api", "sme_ai", "security_reviewer", "auditor", "explorer", "coder", "test_engineer"];
7
7
  export type SMEAgentName = (typeof SME_AGENTS)[number];
8
8
  export type QAAgentName = (typeof QA_AGENTS)[number];
9
9
  export type PipelineAgentName = (typeof PIPELINE_AGENTS)[number];
@@ -29,6 +29,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
29
29
  }, z.core.$strip>>>;
30
30
  }, z.core.$strip>>>;
31
31
  max_iterations: z.ZodDefault<z.ZodNumber>;
32
+ qa_retry_limit: z.ZodDefault<z.ZodNumber>;
32
33
  multi_domain_sme: z.ZodDefault<z.ZodBoolean>;
33
34
  auto_detect_domains: z.ZodDefault<z.ZodBoolean>;
34
35
  inject_phase_reminders: z.ZodDefault<z.ZodBoolean>;
package/dist/index.js CHANGED
@@ -26,7 +26,8 @@ var SME_AGENTS = [
26
26
  "sme_web",
27
27
  "sme_database",
28
28
  "sme_devops",
29
- "sme_api"
29
+ "sme_api",
30
+ "sme_ai"
30
31
  ];
31
32
  var QA_AGENTS = ["security_reviewer", "auditor"];
32
33
  var PIPELINE_AGENTS = ["explorer", "coder", "test_engineer"];
@@ -45,13 +46,13 @@ var CATEGORY_PREFIXES = {
45
46
  qa: "_qa"
46
47
  };
47
48
  var DEFAULT_MODELS = {
48
- architect: "anthropic/claude-sonnet-4-5",
49
- explorer: "google/gemini-2.0-flash",
50
- coder: "anthropic/claude-sonnet-4-5",
51
- test_engineer: "google/gemini-2.0-flash",
52
- _sme: "google/gemini-2.0-flash",
53
- _qa: "google/gemini-2.0-flash",
54
- default: "google/gemini-2.0-flash"
49
+ architect: "kimi-for-coding/k2p5",
50
+ explorer: "opencode/gpt-5-nano",
51
+ coder: "zai-coding-plan/glm-4.7",
52
+ test_engineer: "zai-coding-plan/glm-4.7-flash",
53
+ _sme: "nvidia/openai/gpt-oss-120b",
54
+ _qa: "nvidia/openai/gpt-oss-120b",
55
+ default: "google/gemini-2.5-flash"
55
56
  };
56
57
  var DOMAIN_PATTERNS = {
57
58
  windows: [
@@ -13759,9 +13760,10 @@ var PluginConfigSchema = exports_external.object({
13759
13760
  agents: exports_external.record(exports_external.string(), AgentOverrideConfigSchema).optional(),
13760
13761
  swarms: exports_external.record(exports_external.string(), SwarmConfigSchema).optional(),
13761
13762
  max_iterations: exports_external.number().min(1).max(10).default(5),
13763
+ qa_retry_limit: exports_external.number().min(1).max(10).default(3),
13762
13764
  multi_domain_sme: exports_external.boolean().default(true),
13763
13765
  auto_detect_domains: exports_external.boolean().default(true),
13764
- inject_phase_reminders: exports_external.boolean().default(false)
13766
+ inject_phase_reminders: exports_external.boolean().default(true)
13765
13767
  });
13766
13768
  // src/config/loader.ts
13767
13769
  import * as fs from "fs";
@@ -13812,9 +13814,10 @@ function loadPluginConfig(directory) {
13812
13814
  const projectConfigPath = path.join(directory, ".opencode", CONFIG_FILENAME);
13813
13815
  let config2 = loadConfigFromPath(userConfigPath) ?? {
13814
13816
  max_iterations: 5,
13817
+ qa_retry_limit: 3,
13815
13818
  multi_domain_sme: true,
13816
13819
  auto_detect_domains: true,
13817
- inject_phase_reminders: false
13820
+ inject_phase_reminders: true
13818
13821
  };
13819
13822
  const projectConfig = loadConfigFromPath(projectConfigPath);
13820
13823
  if (projectConfig) {
@@ -13868,12 +13871,12 @@ You THINK. Subagents DO. You have the largest context window and strongest reaso
13868
13871
  1. DELEGATE all coding to @{{AGENT_PREFIX}}coder. You do NOT write code.
13869
13872
  2. ONE agent per message. Send, STOP, wait for response.
13870
13873
  3. ONE task per @{{AGENT_PREFIX}}coder call. Never batch.
13871
- 4. Fallback: Only code yourself after 3 @{{AGENT_PREFIX}}coder failures on same task.
13874
+ 4. Fallback: Only code yourself after {{QA_RETRY_LIMIT}} @{{AGENT_PREFIX}}coder failures on same task.
13872
13875
 
13873
13876
  ## AGENTS
13874
13877
 
13875
13878
  @{{AGENT_PREFIX}}explorer - Codebase analysis
13876
- @{{AGENT_PREFIX}}sme_[domain] - Domain expertise (windows, powershell, python, oracle, network, security, linux, vmware, azure, active_directory, ui_ux, web, database, devops, api)
13879
+ @{{AGENT_PREFIX}}sme_[domain] - Domain expertise (windows, powershell, python, oracle, network, security, linux, vmware, azure, active_directory, ui_ux, web, database, devops, api, ai)
13877
13880
  @{{AGENT_PREFIX}}coder - Implementation (one task at a time)
13878
13881
  @{{AGENT_PREFIX}}test_engineer - Test generation
13879
13882
  @{{AGENT_PREFIX}}security_reviewer - Vulnerability review
@@ -13969,8 +13972,8 @@ For each task (respecting dependencies):
13969
13972
  5c. @{{AGENT_PREFIX}}auditor - Verify
13970
13973
  5d. Result:
13971
13974
  - APPROVED \u2192 5e
13972
- - REJECTED (attempt 1-2) \u2192 Feedback to @{{AGENT_PREFIX}}coder, retry
13973
- - REJECTED (attempt 3) \u2192 Escalate, handle directly
13975
+ - REJECTED (attempt < {{QA_RETRY_LIMIT}}) \u2192 Feedback to @{{AGENT_PREFIX}}coder, retry
13976
+ - REJECTED (attempt {{QA_RETRY_LIMIT}}) \u2192 Escalate, handle directly
13974
13977
  5e. @{{AGENT_PREFIX}}test_engineer - Generate tests
13975
13978
  5f. Update plan.md [x], proceed to next task
13976
13979
 
@@ -14348,6 +14351,20 @@ var activeDirectorySMEConfig = {
14348
14351
  - ADSI/DirectoryServices .NET`
14349
14352
  };
14350
14353
 
14354
+ // src/agents/sme/ai.ts
14355
+ var aiSMEConfig = {
14356
+ domain: "ai",
14357
+ description: "AI/LLM systems and prompt engineering",
14358
+ guidance: `- Prompt engineering (CoT, few-shot, structured output)
14359
+ - Context window management, token optimization
14360
+ - Model selection tradeoffs (cost, latency, capability)
14361
+ - Agent orchestration patterns (delegation, handoff)
14362
+ - RAG architectures, embedding strategies
14363
+ - Fine-tuning vs prompting decisions
14364
+ - Safety/alignment considerations
14365
+ - Tool use and function calling patterns`
14366
+ };
14367
+
14351
14368
  // src/agents/sme/api.ts
14352
14369
  var apiSMEConfig = {
14353
14370
  domain: "api",
@@ -14561,7 +14578,8 @@ var SME_CONFIGS = {
14561
14578
  web: webSMEConfig,
14562
14579
  database: databaseSMEConfig,
14563
14580
  devops: devopsSMEConfig,
14564
- api: apiSMEConfig
14581
+ api: apiSMEConfig,
14582
+ ai: aiSMEConfig
14565
14583
  };
14566
14584
  var AGENT_TO_DOMAIN = {
14567
14585
  sme_windows: "windows",
@@ -14578,7 +14596,8 @@ var AGENT_TO_DOMAIN = {
14578
14596
  sme_web: "web",
14579
14597
  sme_database: "database",
14580
14598
  sme_devops: "devops",
14581
- sme_api: "api"
14599
+ sme_api: "api",
14600
+ sme_ai: "ai"
14582
14601
  };
14583
14602
  function createAllSMEAgents(getModel, loadPrompt) {
14584
14603
  return Object.entries(AGENT_TO_DOMAIN).map(([agentName, domain2]) => {
@@ -14633,11 +14652,12 @@ function applyOverrides(agent, swarmAgents, swarmPrefix) {
14633
14652
  }
14634
14653
  return agent;
14635
14654
  }
14636
- function createSwarmAgents(swarmId, swarmConfig, isDefault) {
14655
+ function createSwarmAgents(swarmId, swarmConfig, isDefault, pluginConfig) {
14637
14656
  const agents = [];
14638
14657
  const swarmAgents = swarmConfig.agents;
14639
14658
  const prefix = isDefault ? "" : `${swarmId}_`;
14640
14659
  const swarmPrefix = isDefault ? undefined : swarmId;
14660
+ const qaRetryLimit = pluginConfig?.qa_retry_limit ?? 3;
14641
14661
  const getModel = (baseName) => getModelForAgent(baseName, swarmAgents, swarmPrefix);
14642
14662
  const getPrompts = (name) => loadAgentPrompt(name);
14643
14663
  const prefixName = (name) => `${prefix}${name}`;
@@ -14649,7 +14669,7 @@ function createSwarmAgents(swarmId, swarmConfig, isDefault) {
14649
14669
  const swarmName = swarmConfig.name || swarmId;
14650
14670
  const swarmIdentity = isDefault ? "default" : swarmId;
14651
14671
  const agentPrefix = prefix;
14652
- architect.config.prompt = architect.config.prompt?.replace(/\{\{SWARM_ID\}\}/g, swarmIdentity).replace(/\{\{AGENT_PREFIX\}\}/g, agentPrefix);
14672
+ architect.config.prompt = architect.config.prompt?.replace(/\{\{SWARM_ID\}\}/g, swarmIdentity).replace(/\{\{AGENT_PREFIX\}\}/g, agentPrefix).replace(/\{\{QA_RETRY_LIMIT\}\}/g, String(qaRetryLimit));
14653
14673
  if (!isDefault) {
14654
14674
  architect.description = `[${swarmName}] ${architect.description}`;
14655
14675
  const swarmHeader = `## \u26A0\uFE0F YOU ARE THE ${swarmName.toUpperCase()} SWARM ARCHITECT
@@ -14711,7 +14731,7 @@ function createAgents(config2) {
14711
14731
  for (const swarmId of swarmIds) {
14712
14732
  const swarmConfig = swarms[swarmId];
14713
14733
  const isDefault = swarmId === defaultSwarmId;
14714
- const swarmAgents = createSwarmAgents(swarmId, swarmConfig, isDefault);
14734
+ const swarmAgents = createSwarmAgents(swarmId, swarmConfig, isDefault, config2);
14715
14735
  allAgents.push(...swarmAgents);
14716
14736
  }
14717
14737
  } else {
@@ -14719,7 +14739,7 @@ function createAgents(config2) {
14719
14739
  name: "Default",
14720
14740
  agents: config2?.agents
14721
14741
  };
14722
- const swarmAgents = createSwarmAgents("default", legacySwarmConfig, true);
14742
+ const swarmAgents = createSwarmAgents("default", legacySwarmConfig, true, config2);
14723
14743
  allAgents.push(...swarmAgents);
14724
14744
  }
14725
14745
  return allAgents;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "3.2.1",
3
+ "version": "3.3.1",
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",