opencode-swarm 6.35.2 → 6.35.4

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
@@ -36085,6 +36085,10 @@ function detectAdditionalLinter(cwd) {
36085
36085
  }
36086
36086
  async function detectAvailableLinter(directory) {
36087
36087
  const _DETECT_TIMEOUT = 2000;
36088
+ if (!directory)
36089
+ return null;
36090
+ if (!fs6.existsSync(directory))
36091
+ return null;
36088
36092
  const projectDir = directory;
36089
36093
  const isWindows = process.platform === "win32";
36090
36094
  const biomeBin = isWindows ? path17.join(projectDir, "node_modules", ".bin", "biome.EXE") : path17.join(projectDir, "node_modules", ".bin", "biome");
package/dist/index.js CHANGED
@@ -33873,6 +33873,10 @@ function detectAdditionalLinter(cwd) {
33873
33873
  }
33874
33874
  async function detectAvailableLinter(directory) {
33875
33875
  const _DETECT_TIMEOUT = 2000;
33876
+ if (!directory)
33877
+ return null;
33878
+ if (!fs12.existsSync(directory))
33879
+ return null;
33876
33880
  const projectDir = directory;
33877
33881
  const isWindows = process.platform === "win32";
33878
33882
  const biomeBin = isWindows ? path23.join(projectDir, "node_modules", ".bin", "biome.EXE") : path23.join(projectDir, "node_modules", ".bin", "biome");
@@ -40820,7 +40824,7 @@ For complex tasks, make a second explorer call focused on risk/gap analysis:
40820
40824
  After explorer returns:
40821
40825
  - Run \`symbols\` tool on key files identified by explorer to understand public API surfaces
40822
40826
  - Run \`complexity_hotspots\` if not already run in Phase 0 (check context.md for existing analysis). Note modules with recommendation "security_review" or "full_gates" in context.md.
40823
- - Check for project governance files using the \`glob\` tool with patterns \`project-instructions.md\`, \`docs/project-instructions.md\`, and \`INSTRUCTIONS.md\` (checked in that priority order \u2014 first match wins). If a file is found: read it and extract all MUST (mandatory constraints) and SHOULD (recommended practices) rules. Write the extracted rules as a summary to \`.swarm/context.md\` under a \`## Project Governance\` section \u2014 append if the section already exists, create it if not. If no MUST or SHOULD rules are found in the file, skip writing. If no governance file is found: skip silently. Existing DISCOVER steps are unchanged.
40827
+ - Check for project governance files using the \`glob\` tool with patterns \`project-instructions.md\`, \`docs/project-instructions.md\`, \`CONTRIBUTING.md\`, and \`INSTRUCTIONS.md\` (checked in that priority order \u2014 first match wins). If a file is found: read it and extract all MUST (mandatory constraints) and SHOULD (recommended practices) rules. Write the extracted rules as a summary to \`.swarm/context.md\` under a \`## Project Governance\` section \u2014 append if the section already exists, create it if not. If no MUST or SHOULD rules are found in the file, skip writing. If no governance file is found: skip silently. Existing DISCOVER steps are unchanged.
40824
40828
 
40825
40829
  ### MODE: CONSULT
40826
40830
  Check .swarm/context.md for cached guidance first.
@@ -54144,7 +54148,9 @@ async function readMergedKnowledge(directory, config3, context) {
54144
54148
  finalScore: 0
54145
54149
  });
54146
54150
  }
54147
- const ranked = merged.map((entry) => {
54151
+ const scopeFilter = config3.scope_filter ?? ["global"];
54152
+ const filtered = merged.filter((entry) => scopeFilter.some((pattern) => (entry.scope ?? "global") === pattern));
54153
+ const ranked = filtered.map((entry) => {
54148
54154
  let categoryScore = 0;
54149
54155
  if (context?.currentPhase) {
54150
54156
  const phaseCategories = inferCategoriesFromPhase(context.currentPhase);
@@ -54909,9 +54915,7 @@ function createKnowledgeInjectorHook(directory, config3) {
54909
54915
  if (!output.messages || output.messages.length === 0)
54910
54916
  return;
54911
54917
  const plan = await loadPlan(directory);
54912
- if (!plan)
54913
- return;
54914
- const currentPhase = plan.current_phase ?? 1;
54918
+ const currentPhase = plan?.current_phase ?? 1;
54915
54919
  const totalChars = output.messages.reduce((sum, msg) => {
54916
54920
  return sum + (msg.parts?.reduce((s, p) => s + (p.text?.length ?? 0), 0) ?? 0);
54917
54921
  }, 0);
@@ -54921,19 +54925,16 @@ function createKnowledgeInjectorHook(directory, config3) {
54921
54925
  const agentName = systemMsg?.info?.agent;
54922
54926
  if (!agentName || !isOrchestratorAgent(agentName))
54923
54927
  return;
54924
- if (lastSeenPhase === null) {
54925
- lastSeenPhase = currentPhase;
54926
- return;
54927
- } else if (currentPhase === lastSeenPhase && cachedInjectionText !== null) {
54928
+ if (currentPhase === lastSeenPhase && cachedInjectionText !== null) {
54928
54929
  injectKnowledgeMessage(output, cachedInjectionText);
54929
54930
  return;
54930
54931
  } else if (currentPhase !== lastSeenPhase) {
54931
54932
  lastSeenPhase = currentPhase;
54932
54933
  cachedInjectionText = null;
54933
54934
  }
54934
- const phaseDescription = extractCurrentPhaseFromPlan2(plan) ?? `Phase ${currentPhase}`;
54935
+ const phaseDescription = plan ? extractCurrentPhaseFromPlan2(plan) ?? `Phase ${currentPhase}` : "Phase 0";
54935
54936
  const context = {
54936
- projectName: plan.title,
54937
+ projectName: plan?.title ?? "unknown",
54937
54938
  currentPhase: phaseDescription
54938
54939
  };
54939
54940
  const entries = await readMergedKnowledge(directory, config3, context);
@@ -58261,6 +58262,7 @@ var imports = createSwarmTool({
58261
58262
  });
58262
58263
  // src/tools/knowledge-add.ts
58263
58264
  init_dist();
58265
+ init_manager2();
58264
58266
  init_create_tool();
58265
58267
  var VALID_CATEGORIES2 = [
58266
58268
  "process",
@@ -58328,6 +58330,11 @@ var knowledgeAdd = createSwarmTool({
58328
58330
  }
58329
58331
  }
58330
58332
  const scope = typeof scopeInput === "string" && scopeInput.length > 0 ? scopeInput : "global";
58333
+ let project_name = "";
58334
+ try {
58335
+ const plan = await loadPlan(directory);
58336
+ project_name = plan?.title ?? "";
58337
+ } catch {}
58331
58338
  const entry = {
58332
58339
  id: crypto.randomUUID(),
58333
58340
  tier: "swarm",
@@ -58338,7 +58345,7 @@ var knowledgeAdd = createSwarmTool({
58338
58345
  confidence: 0.5,
58339
58346
  status: "candidate",
58340
58347
  confirmed_by: [],
58341
- project_name: "",
58348
+ project_name,
58342
58349
  retrieval_outcomes: {
58343
58350
  applied_count: 0,
58344
58351
  succeeded_after_count: 0,
@@ -65979,6 +65986,8 @@ var OpenCodeSwarm = async (ctx) => {
65979
65986
  knowledgeRecall,
65980
65987
  knowledgeRemove,
65981
65988
  detect_domains,
65989
+ doc_extract,
65990
+ doc_scan,
65982
65991
  evidence_check,
65983
65992
  extract_code_blocks,
65984
65993
  gitingest,
@@ -66280,6 +66289,11 @@ var OpenCodeSwarm = async (ctx) => {
66280
66289
  taskSession.delegationActive = false;
66281
66290
  taskSession.lastAgentEventTime = Date.now();
66282
66291
  telemetry.delegationEnd(sessionId, agentName, taskSession.currentTaskId || "", "completed");
66292
+ const baseAgentName = stripKnownSwarmPrefix(agentName);
66293
+ if (baseAgentName === "reviewer" || baseAgentName === "test_engineer" || baseAgentName === "critic" || baseAgentName === "critic_sounding_board") {
66294
+ taskSession.pendingAdvisoryMessages ??= [];
66295
+ taskSession.pendingAdvisoryMessages.push(`[PIPELINE] ${baseAgentName} delegation complete for task ${taskSession.currentTaskId ?? "unknown"}. ` + `Resume the QA gate pipeline \u2014 check your task pipeline steps for the next required action. ` + `Do not stop here.`);
66296
+ }
66283
66297
  }
66284
66298
  if (_dbg)
66285
66299
  console.error(`[DIAG] Task handoff DONE session=${sessionId} activeAgent=${swarmState.activeAgent.get(sessionId)}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "6.35.2",
3
+ "version": "6.35.4",
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",