opencode-swarm 7.51.3 → 7.51.5

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
@@ -52,7 +52,7 @@ var package_default;
52
52
  var init_package = __esm(() => {
53
53
  package_default = {
54
54
  name: "opencode-swarm",
55
- version: "7.51.3",
55
+ version: "7.51.5",
56
56
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
57
57
  main: "dist/index.js",
58
58
  types: "dist/index.d.ts",
package/dist/index.js CHANGED
@@ -69,7 +69,7 @@ var package_default;
69
69
  var init_package = __esm(() => {
70
70
  package_default = {
71
71
  name: "opencode-swarm",
72
- version: "7.51.3",
72
+ version: "7.51.5",
73
73
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
74
74
  main: "dist/index.js",
75
75
  types: "dist/index.d.ts",
@@ -86511,20 +86511,34 @@ If you call @coder instead of @${swarmId}_coder, the call will FAIL or go to the
86511
86511
  agents.push(applyOverrides(testEngineer, swarmAgents, swarmPrefix, quiet));
86512
86512
  }
86513
86513
  if (pluginConfig?.council?.general?.enabled === true) {
86514
+ let councilAgentsCreated = 0;
86514
86515
  if (!isAgentDisabled("reviewer", swarmAgents, swarmPrefix)) {
86515
86516
  const councilGeneralist = createReviewerAgent(getModel("reviewer"), GENERALIST_COUNCIL_PROMPT);
86516
86517
  councilGeneralist.name = prefixName("council_generalist");
86517
86518
  agents.push(applyOverrides(councilGeneralist, swarmAgents, swarmPrefix, quiet));
86519
+ councilAgentsCreated++;
86518
86520
  }
86519
86521
  if (!isAgentDisabled("critic", swarmAgents, swarmPrefix)) {
86520
86522
  const councilSkeptic = createCriticAgent(getModel("critic"), SKEPTIC_COUNCIL_PROMPT);
86521
86523
  councilSkeptic.name = prefixName("council_skeptic");
86522
86524
  agents.push(applyOverrides(councilSkeptic, swarmAgents, swarmPrefix, quiet));
86525
+ councilAgentsCreated++;
86523
86526
  }
86524
86527
  if (!isAgentDisabled("sme", swarmAgents, swarmPrefix)) {
86525
86528
  const councilDomainExpert = createSMEAgent(getModel("sme"), DOMAIN_EXPERT_COUNCIL_PROMPT);
86526
86529
  councilDomainExpert.name = prefixName("council_domain_expert");
86527
86530
  agents.push(applyOverrides(councilDomainExpert, swarmAgents, swarmPrefix, quiet));
86531
+ councilAgentsCreated++;
86532
+ }
86533
+ if (councilAgentsCreated < 3) {
86534
+ const missing = [];
86535
+ if (isAgentDisabled("reviewer", swarmAgents, swarmPrefix))
86536
+ missing.push("council_generalist (requires reviewer)");
86537
+ if (isAgentDisabled("critic", swarmAgents, swarmPrefix))
86538
+ missing.push("council_skeptic (requires critic)");
86539
+ if (isAgentDisabled("sme", swarmAgents, swarmPrefix))
86540
+ missing.push("council_domain_expert (requires sme)");
86541
+ addDeferredWarning(`[opencode-swarm] council.general.enabled is true but only ${councilAgentsCreated}/3 council agents could be registered because the following base agents are disabled: ${missing.join(", ")}. Re-enable those agents or accept a reduced council.`);
86528
86542
  }
86529
86543
  if (pluginConfig?.council?.general?.moderatorModel !== undefined) {
86530
86544
  addDeferredWarning("[opencode-swarm] council.general.moderatorModel is deprecated and ignored. The architect now synthesizes the final answer directly using inline output rules. Remove this field (and council.general.moderator if set) from opencode-swarm.json to silence this warning.");
@@ -91101,6 +91115,7 @@ ${JSON.stringify(symbolNames, null, 2)}`);
91101
91115
  // src/lang/runtime.ts
91102
91116
  var exports_runtime = {};
91103
91117
  __export(exports_runtime, {
91118
+ resolveGrammarsDir: () => resolveGrammarsDir,
91104
91119
  parserCache: () => parserCache,
91105
91120
  loadGrammar: () => loadGrammar,
91106
91121
  isGrammarAvailable: () => isGrammarAvailable,
@@ -91147,13 +91162,16 @@ function getWasmFileName(languageId) {
91147
91162
  }
91148
91163
  return `tree-sitter-${sanitized}.wasm`;
91149
91164
  }
91150
- function getGrammarsDirAbsolute() {
91151
- const thisDir = path92.dirname(fileURLToPath4(import.meta.url));
91165
+ function resolveGrammarsDir(thisDir) {
91152
91166
  const normalized = thisDir.replace(/\\/g, "/");
91153
91167
  const isSource = normalized.endsWith("/src/lang");
91154
91168
  const isCliBundle = normalized.endsWith("/cli");
91155
91169
  return isSource ? path92.join(thisDir, "grammars") : isCliBundle ? path92.join(thisDir, "..", "lang", "grammars") : path92.join(thisDir, "lang", "grammars");
91156
91170
  }
91171
+ function getGrammarsDirAbsolute() {
91172
+ const thisDir = path92.dirname(fileURLToPath4(import.meta.url));
91173
+ return resolveGrammarsDir(thisDir);
91174
+ }
91157
91175
  async function loadGrammar(languageId) {
91158
91176
  if (typeof languageId !== "string" || languageId.length > 100) {
91159
91177
  throw new Error(`Invalid languageId: must be a string of at most 100 characters`);
@@ -99988,6 +100006,7 @@ function createSystemEnhancerHook(config3, directory) {
99988
100006
  let tryInject = function(text) {
99989
100007
  const tokens = estimateTokens(text);
99990
100008
  if (injectedTokens + tokens > maxInjectionTokens) {
100009
+ warn(`system-enhancer: injection budget exceeded (${injectedTokens + tokens} > ${maxInjectionTokens} tokens) — truncating system prompt content`);
99991
100010
  return;
99992
100011
  }
99993
100012
  output.system.push(text);
@@ -112544,6 +112563,7 @@ init_config();
112544
112563
  init_knowledge_store();
112545
112564
  init_knowledge_validator();
112546
112565
  init_manager();
112566
+ init_utils();
112547
112567
  init_create_tool();
112548
112568
  import { randomUUID as randomUUID13 } from "node:crypto";
112549
112569
  var VALID_CATEGORIES2 = [
@@ -112666,7 +112686,9 @@ var knowledge_add = createSwarmTool({
112666
112686
  message: "near-duplicate of existing entry"
112667
112687
  });
112668
112688
  }
112669
- } catch {}
112689
+ } catch (err2) {
112690
+ warn("knowledge_add: dedup check failed — skipping near-duplicate detection", err2);
112691
+ }
112670
112692
  try {
112671
112693
  await appendKnowledge(resolveSwarmKnowledgePath(directory), entry);
112672
112694
  } catch (err2) {
@@ -14,6 +14,14 @@ export declare const _internals: {
14
14
  locateFile: (scriptName: string) => string;
15
15
  }) => Promise<void>;
16
16
  };
17
+ /**
18
+ * Pure path resolver for the grammars directory given a base directory.
19
+ * Exported for unit testing; production code uses getGrammarsDirAbsolute().
20
+ *
21
+ * @param thisDir - The directory to resolve from (typically dirname of the module file)
22
+ * @returns Absolute path to the grammars directory
23
+ */
24
+ export declare function resolveGrammarsDir(thisDir: string): string;
17
25
  /**
18
26
  * Initialize a parser for the given language
19
27
  * Loads WASM from dist/lang/grammars/ (copied during build)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.51.3",
3
+ "version": "7.51.5",
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",