opencode-swarm 6.35.3 → 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/index.js +22 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -40824,7 +40824,7 @@ For complex tasks, make a second explorer call focused on risk/gap analysis:
|
|
|
40824
40824
|
After explorer returns:
|
|
40825
40825
|
- Run \`symbols\` tool on key files identified by explorer to understand public API surfaces
|
|
40826
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.
|
|
40827
|
-
- 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.
|
|
40828
40828
|
|
|
40829
40829
|
### MODE: CONSULT
|
|
40830
40830
|
Check .swarm/context.md for cached guidance first.
|
|
@@ -54148,7 +54148,9 @@ async function readMergedKnowledge(directory, config3, context) {
|
|
|
54148
54148
|
finalScore: 0
|
|
54149
54149
|
});
|
|
54150
54150
|
}
|
|
54151
|
-
const
|
|
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) => {
|
|
54152
54154
|
let categoryScore = 0;
|
|
54153
54155
|
if (context?.currentPhase) {
|
|
54154
54156
|
const phaseCategories = inferCategoriesFromPhase(context.currentPhase);
|
|
@@ -54913,9 +54915,7 @@ function createKnowledgeInjectorHook(directory, config3) {
|
|
|
54913
54915
|
if (!output.messages || output.messages.length === 0)
|
|
54914
54916
|
return;
|
|
54915
54917
|
const plan = await loadPlan(directory);
|
|
54916
|
-
|
|
54917
|
-
return;
|
|
54918
|
-
const currentPhase = plan.current_phase ?? 1;
|
|
54918
|
+
const currentPhase = plan?.current_phase ?? 1;
|
|
54919
54919
|
const totalChars = output.messages.reduce((sum, msg) => {
|
|
54920
54920
|
return sum + (msg.parts?.reduce((s, p) => s + (p.text?.length ?? 0), 0) ?? 0);
|
|
54921
54921
|
}, 0);
|
|
@@ -54925,19 +54925,16 @@ function createKnowledgeInjectorHook(directory, config3) {
|
|
|
54925
54925
|
const agentName = systemMsg?.info?.agent;
|
|
54926
54926
|
if (!agentName || !isOrchestratorAgent(agentName))
|
|
54927
54927
|
return;
|
|
54928
|
-
if (
|
|
54929
|
-
lastSeenPhase = currentPhase;
|
|
54930
|
-
return;
|
|
54931
|
-
} else if (currentPhase === lastSeenPhase && cachedInjectionText !== null) {
|
|
54928
|
+
if (currentPhase === lastSeenPhase && cachedInjectionText !== null) {
|
|
54932
54929
|
injectKnowledgeMessage(output, cachedInjectionText);
|
|
54933
54930
|
return;
|
|
54934
54931
|
} else if (currentPhase !== lastSeenPhase) {
|
|
54935
54932
|
lastSeenPhase = currentPhase;
|
|
54936
54933
|
cachedInjectionText = null;
|
|
54937
54934
|
}
|
|
54938
|
-
const phaseDescription = extractCurrentPhaseFromPlan2(plan) ?? `Phase ${currentPhase}
|
|
54935
|
+
const phaseDescription = plan ? extractCurrentPhaseFromPlan2(plan) ?? `Phase ${currentPhase}` : "Phase 0";
|
|
54939
54936
|
const context = {
|
|
54940
|
-
projectName: plan
|
|
54937
|
+
projectName: plan?.title ?? "unknown",
|
|
54941
54938
|
currentPhase: phaseDescription
|
|
54942
54939
|
};
|
|
54943
54940
|
const entries = await readMergedKnowledge(directory, config3, context);
|
|
@@ -58265,6 +58262,7 @@ var imports = createSwarmTool({
|
|
|
58265
58262
|
});
|
|
58266
58263
|
// src/tools/knowledge-add.ts
|
|
58267
58264
|
init_dist();
|
|
58265
|
+
init_manager2();
|
|
58268
58266
|
init_create_tool();
|
|
58269
58267
|
var VALID_CATEGORIES2 = [
|
|
58270
58268
|
"process",
|
|
@@ -58332,6 +58330,11 @@ var knowledgeAdd = createSwarmTool({
|
|
|
58332
58330
|
}
|
|
58333
58331
|
}
|
|
58334
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 {}
|
|
58335
58338
|
const entry = {
|
|
58336
58339
|
id: crypto.randomUUID(),
|
|
58337
58340
|
tier: "swarm",
|
|
@@ -58342,7 +58345,7 @@ var knowledgeAdd = createSwarmTool({
|
|
|
58342
58345
|
confidence: 0.5,
|
|
58343
58346
|
status: "candidate",
|
|
58344
58347
|
confirmed_by: [],
|
|
58345
|
-
project_name
|
|
58348
|
+
project_name,
|
|
58346
58349
|
retrieval_outcomes: {
|
|
58347
58350
|
applied_count: 0,
|
|
58348
58351
|
succeeded_after_count: 0,
|
|
@@ -65983,6 +65986,8 @@ var OpenCodeSwarm = async (ctx) => {
|
|
|
65983
65986
|
knowledgeRecall,
|
|
65984
65987
|
knowledgeRemove,
|
|
65985
65988
|
detect_domains,
|
|
65989
|
+
doc_extract,
|
|
65990
|
+
doc_scan,
|
|
65986
65991
|
evidence_check,
|
|
65987
65992
|
extract_code_blocks,
|
|
65988
65993
|
gitingest,
|
|
@@ -66284,6 +66289,11 @@ var OpenCodeSwarm = async (ctx) => {
|
|
|
66284
66289
|
taskSession.delegationActive = false;
|
|
66285
66290
|
taskSession.lastAgentEventTime = Date.now();
|
|
66286
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
|
+
}
|
|
66287
66297
|
}
|
|
66288
66298
|
if (_dbg)
|
|
66289
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.
|
|
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",
|