opencode-swarm 6.21.1 → 6.21.2
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 +9 -2
- package/dist/index.js +41 -12
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -35666,7 +35666,7 @@ var HELP_TEXT = [
|
|
|
35666
35666
|
|
|
35667
35667
|
// src/cli/index.ts
|
|
35668
35668
|
var CONFIG_DIR = path14.join(process.env.XDG_CONFIG_HOME || path14.join(os2.homedir(), ".config"), "opencode");
|
|
35669
|
-
var OPENCODE_CONFIG_PATH = path14.join(CONFIG_DIR, "
|
|
35669
|
+
var OPENCODE_CONFIG_PATH = path14.join(CONFIG_DIR, "opencode.json");
|
|
35670
35670
|
var PLUGIN_CONFIG_PATH = path14.join(CONFIG_DIR, "opencode-swarm.json");
|
|
35671
35671
|
var PROMPTS_DIR = path14.join(CONFIG_DIR, "opencode-swarm");
|
|
35672
35672
|
function ensureDir(dir) {
|
|
@@ -35692,9 +35692,16 @@ async function install() {
|
|
|
35692
35692
|
`);
|
|
35693
35693
|
ensureDir(CONFIG_DIR);
|
|
35694
35694
|
ensureDir(PROMPTS_DIR);
|
|
35695
|
+
const LEGACY_CONFIG_PATH = path14.join(CONFIG_DIR, "config.json");
|
|
35695
35696
|
let opencodeConfig = loadJson(OPENCODE_CONFIG_PATH);
|
|
35696
35697
|
if (!opencodeConfig) {
|
|
35697
|
-
|
|
35698
|
+
const legacyConfig = loadJson(LEGACY_CONFIG_PATH);
|
|
35699
|
+
if (legacyConfig) {
|
|
35700
|
+
console.log("\u26A0 Migrating existing config from config.json to opencode.json...");
|
|
35701
|
+
opencodeConfig = legacyConfig;
|
|
35702
|
+
} else {
|
|
35703
|
+
opencodeConfig = {};
|
|
35704
|
+
}
|
|
35698
35705
|
}
|
|
35699
35706
|
if (!opencodeConfig.plugin) {
|
|
35700
35707
|
opencodeConfig.plugin = [];
|
package/dist/index.js
CHANGED
|
@@ -38317,7 +38317,8 @@ var KNOWN_SWARM_PREFIXES = [
|
|
|
38317
38317
|
"custom",
|
|
38318
38318
|
"team",
|
|
38319
38319
|
"project",
|
|
38320
|
-
"swarm"
|
|
38320
|
+
"swarm",
|
|
38321
|
+
"synthetic"
|
|
38321
38322
|
];
|
|
38322
38323
|
var SEPARATORS = ["_", "-", " "];
|
|
38323
38324
|
function stripKnownSwarmPrefix(agentName) {
|
|
@@ -47268,15 +47269,23 @@ function createDelegationGateHook(config3) {
|
|
|
47268
47269
|
session.qaSkipCount = 0;
|
|
47269
47270
|
session.qaSkipTaskIds = [];
|
|
47270
47271
|
}
|
|
47271
|
-
if (hasReviewer && session.
|
|
47272
|
-
|
|
47273
|
-
|
|
47274
|
-
|
|
47272
|
+
if (hasReviewer && session.taskWorkflowStates) {
|
|
47273
|
+
for (const [taskId, state] of session.taskWorkflowStates) {
|
|
47274
|
+
if (state === "coder_delegated" || state === "pre_check_passed") {
|
|
47275
|
+
try {
|
|
47276
|
+
advanceTaskState(session, taskId, "reviewer_run");
|
|
47277
|
+
} catch {}
|
|
47278
|
+
}
|
|
47279
|
+
}
|
|
47275
47280
|
}
|
|
47276
|
-
if (hasReviewer && hasTestEngineer && session.
|
|
47277
|
-
|
|
47278
|
-
|
|
47279
|
-
|
|
47281
|
+
if (hasReviewer && hasTestEngineer && session.taskWorkflowStates) {
|
|
47282
|
+
for (const [taskId, state] of session.taskWorkflowStates) {
|
|
47283
|
+
if (state === "reviewer_run") {
|
|
47284
|
+
try {
|
|
47285
|
+
advanceTaskState(session, taskId, "tests_run");
|
|
47286
|
+
} catch {}
|
|
47287
|
+
}
|
|
47288
|
+
}
|
|
47280
47289
|
}
|
|
47281
47290
|
}
|
|
47282
47291
|
}
|
|
@@ -47586,7 +47595,9 @@ function createDelegationTrackerHook(config3, guardrailsEnabled = true) {
|
|
|
47586
47595
|
if (!isArchitect && guardrailsEnabled) {
|
|
47587
47596
|
beginInvocation(input.sessionID, agentName);
|
|
47588
47597
|
}
|
|
47589
|
-
|
|
47598
|
+
const delegationTrackerEnabled = config3.hooks?.delegation_tracker === true;
|
|
47599
|
+
const delegationGateEnabled = config3.hooks?.delegation_gate !== false;
|
|
47600
|
+
if ((delegationTrackerEnabled || delegationGateEnabled) && previousAgent && previousAgent !== agentName) {
|
|
47590
47601
|
const entry = {
|
|
47591
47602
|
from: previousAgent,
|
|
47592
47603
|
to: agentName,
|
|
@@ -47597,7 +47608,9 @@ function createDelegationTrackerHook(config3, guardrailsEnabled = true) {
|
|
|
47597
47608
|
}
|
|
47598
47609
|
const chain = swarmState.delegationChains.get(input.sessionID);
|
|
47599
47610
|
chain?.push(entry);
|
|
47600
|
-
|
|
47611
|
+
if (delegationTrackerEnabled) {
|
|
47612
|
+
swarmState.pendingEvents++;
|
|
47613
|
+
}
|
|
47601
47614
|
}
|
|
47602
47615
|
};
|
|
47603
47616
|
}
|
|
@@ -59463,9 +59476,15 @@ function checkReviewerGate(taskId) {
|
|
|
59463
59476
|
return { blocked: false, reason: "" };
|
|
59464
59477
|
}
|
|
59465
59478
|
}
|
|
59479
|
+
const stateEntries = [];
|
|
59480
|
+
for (const [sessionId, session] of swarmState.agentSessions) {
|
|
59481
|
+
const state = getTaskState(session, taskId);
|
|
59482
|
+
stateEntries.push(`${sessionId}: ${state}`);
|
|
59483
|
+
}
|
|
59484
|
+
const currentStateStr = stateEntries.length > 0 ? stateEntries.join(", ") : "no active sessions";
|
|
59466
59485
|
return {
|
|
59467
59486
|
blocked: true,
|
|
59468
|
-
reason: `Task ${taskId} has not passed QA gates
|
|
59487
|
+
reason: `Task ${taskId} has not passed QA gates. Current state: [${currentStateStr}]. Required state: tests_run or complete. Do not write directly to plan files \u2014 use update_task_status after running mega_reviewer and mega_test_engineer.`
|
|
59469
59488
|
};
|
|
59470
59489
|
} catch {
|
|
59471
59490
|
return { blocked: false, reason: "" };
|
|
@@ -59488,6 +59507,16 @@ async function executeUpdateTaskStatus(args2, fallbackDir) {
|
|
|
59488
59507
|
errors: [taskIdError]
|
|
59489
59508
|
};
|
|
59490
59509
|
}
|
|
59510
|
+
if (args2.status === "in_progress") {
|
|
59511
|
+
for (const [_sessionId, session] of swarmState.agentSessions) {
|
|
59512
|
+
const currentState = getTaskState(session, args2.task_id);
|
|
59513
|
+
if (currentState === "idle") {
|
|
59514
|
+
try {
|
|
59515
|
+
advanceTaskState(session, args2.task_id, "coder_delegated");
|
|
59516
|
+
} catch {}
|
|
59517
|
+
}
|
|
59518
|
+
}
|
|
59519
|
+
}
|
|
59491
59520
|
if (args2.status === "completed") {
|
|
59492
59521
|
const reviewerCheck = checkReviewerGate(args2.task_id);
|
|
59493
59522
|
if (reviewerCheck.blocked) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "6.21.
|
|
3
|
+
"version": "6.21.2",
|
|
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",
|