opencode-swarm-plugin 0.44.2 → 0.45.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.
- package/README.md +277 -54
- package/bin/swarm.ts +156 -29
- package/dist/bin/swarm.js +125212 -0
- package/dist/decision-trace-integration.d.ts +204 -0
- package/dist/decision-trace-integration.d.ts.map +1 -0
- package/dist/hive.d.ts.map +1 -1
- package/dist/hive.js +9 -9
- package/dist/index.d.ts +32 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +535 -27
- package/dist/plugin.js +295 -27
- package/dist/query-tools.d.ts +20 -12
- package/dist/query-tools.d.ts.map +1 -1
- package/dist/swarm-decompose.d.ts +4 -4
- package/dist/swarm-decompose.d.ts.map +1 -1
- package/dist/swarm-prompts.d.ts.map +1 -1
- package/dist/swarm-prompts.js +220 -22
- package/dist/swarm-review.d.ts.map +1 -1
- package/dist/swarm-signature.d.ts +106 -0
- package/dist/swarm-signature.d.ts.map +1 -0
- package/dist/swarm-strategies.d.ts +16 -3
- package/dist/swarm-strategies.d.ts.map +1 -1
- package/dist/swarm.d.ts +4 -2
- package/dist/swarm.d.ts.map +1 -1
- package/examples/commands/swarm.md +745 -0
- package/examples/plugin-wrapper-template.ts +2892 -0
- package/examples/skills/hive-workflow/SKILL.md +212 -0
- package/examples/skills/skill-creator/SKILL.md +223 -0
- package/examples/skills/swarm-coordination/SKILL.md +292 -0
- package/global-skills/cli-builder/SKILL.md +344 -0
- package/global-skills/cli-builder/references/advanced-patterns.md +244 -0
- package/global-skills/learning-systems/SKILL.md +644 -0
- package/global-skills/skill-creator/LICENSE.txt +202 -0
- package/global-skills/skill-creator/SKILL.md +352 -0
- package/global-skills/skill-creator/references/output-patterns.md +82 -0
- package/global-skills/skill-creator/references/workflows.md +28 -0
- package/global-skills/swarm-coordination/SKILL.md +995 -0
- package/global-skills/swarm-coordination/references/coordinator-patterns.md +235 -0
- package/global-skills/swarm-coordination/references/strategies.md +138 -0
- package/global-skills/system-design/SKILL.md +213 -0
- package/global-skills/testing-patterns/SKILL.md +430 -0
- package/global-skills/testing-patterns/references/dependency-breaking-catalog.md +586 -0
- package/package.json +6 -3
package/dist/swarm-prompts.js
CHANGED
|
@@ -18332,7 +18332,7 @@ __export(exports_swarm_strategies, {
|
|
|
18332
18332
|
NEGATIVE_MARKERS: () => NEGATIVE_MARKERS,
|
|
18333
18333
|
DecompositionStrategySchema: () => DecompositionStrategySchema2
|
|
18334
18334
|
});
|
|
18335
|
-
function selectStrategy(task) {
|
|
18335
|
+
async function selectStrategy(task, projectKey) {
|
|
18336
18336
|
const taskLower = task.toLowerCase();
|
|
18337
18337
|
const scores = {
|
|
18338
18338
|
"file-based": 0,
|
|
@@ -18360,7 +18360,8 @@ function selectStrategy(task) {
|
|
|
18360
18360
|
const [winner, winnerScore] = entries2[0];
|
|
18361
18361
|
const [, runnerUpScore] = entries2[1] || [null, 0];
|
|
18362
18362
|
const totalScore = entries2.reduce((sum2, [, score]) => sum2 + score, 0);
|
|
18363
|
-
|
|
18363
|
+
let confidence = totalScore > 0 ? Math.min(0.95, 0.5 + (winnerScore - runnerUpScore) / totalScore) : 0.5;
|
|
18364
|
+
const finalStrategy = winnerScore === 0 ? "feature-based" : winner;
|
|
18364
18365
|
let reasoning;
|
|
18365
18366
|
if (winnerScore === 0) {
|
|
18366
18367
|
reasoning = `No strong keyword signals. Defaulting to feature-based as it's most versatile.`;
|
|
@@ -18368,12 +18369,73 @@ function selectStrategy(task) {
|
|
|
18368
18369
|
const matchedKeywords = STRATEGIES[winner].keywords.filter((k) => taskLower.includes(k));
|
|
18369
18370
|
reasoning = `Matched keywords: ${matchedKeywords.join(", ")}. ${STRATEGIES[winner].description}`;
|
|
18370
18371
|
}
|
|
18371
|
-
|
|
18372
|
+
let precedent;
|
|
18373
|
+
if (projectKey) {
|
|
18374
|
+
try {
|
|
18375
|
+
const {
|
|
18376
|
+
createLibSQLAdapter: createLibSQLAdapter2,
|
|
18377
|
+
getDatabasePath: getDatabasePath2,
|
|
18378
|
+
findSimilarDecisions,
|
|
18379
|
+
getStrategySuccessRates
|
|
18380
|
+
} = await import("swarm-mail");
|
|
18381
|
+
const dbPath = getDatabasePath2(projectKey);
|
|
18382
|
+
const db = await createLibSQLAdapter2({ url: `file:${dbPath}` });
|
|
18383
|
+
const similarDecisions = await findSimilarDecisions(db, task, 5);
|
|
18384
|
+
const successRates = await getStrategySuccessRates(db);
|
|
18385
|
+
precedent = {
|
|
18386
|
+
similar_decisions: similarDecisions.length
|
|
18387
|
+
};
|
|
18388
|
+
if (similarDecisions.length > 0) {
|
|
18389
|
+
const epicIds = [];
|
|
18390
|
+
for (const decision of similarDecisions) {
|
|
18391
|
+
try {
|
|
18392
|
+
const decisionData = typeof decision.decision === "string" ? JSON.parse(decision.decision) : decision.decision;
|
|
18393
|
+
if (decisionData.epic_id) {
|
|
18394
|
+
epicIds.push(decisionData.epic_id);
|
|
18395
|
+
}
|
|
18396
|
+
} catch {}
|
|
18397
|
+
}
|
|
18398
|
+
if (epicIds.length > 0) {
|
|
18399
|
+
precedent.cited_epics = epicIds;
|
|
18400
|
+
}
|
|
18401
|
+
const precedentStrategies = similarDecisions.map((d) => {
|
|
18402
|
+
try {
|
|
18403
|
+
const data = typeof d.decision === "string" ? JSON.parse(d.decision) : d.decision;
|
|
18404
|
+
return data.strategy;
|
|
18405
|
+
} catch {
|
|
18406
|
+
return null;
|
|
18407
|
+
}
|
|
18408
|
+
}).filter(Boolean);
|
|
18409
|
+
const agreesWithKeywords = precedentStrategies.includes(finalStrategy);
|
|
18410
|
+
if (agreesWithKeywords) {
|
|
18411
|
+
confidence = Math.min(0.95, confidence + 0.1);
|
|
18412
|
+
reasoning += ` Precedent confirms: ${precedent.similar_decisions} similar decision(s) also chose ${finalStrategy}.`;
|
|
18413
|
+
}
|
|
18414
|
+
}
|
|
18415
|
+
const strategyRate = successRates.find((r) => r.strategy === finalStrategy);
|
|
18416
|
+
if (strategyRate) {
|
|
18417
|
+
precedent.strategy_success_rate = strategyRate.success_rate;
|
|
18418
|
+
if (strategyRate.success_rate >= 0.7) {
|
|
18419
|
+
confidence = Math.min(0.95, confidence + 0.05);
|
|
18420
|
+
reasoning += ` ${finalStrategy} has ${Math.round(strategyRate.success_rate * 100)}% success rate.`;
|
|
18421
|
+
} else if (strategyRate.success_rate < 0.3) {
|
|
18422
|
+
confidence = Math.max(0.1, confidence - 0.1);
|
|
18423
|
+
reasoning += ` Warning: ${finalStrategy} has low success rate (${Math.round(strategyRate.success_rate * 100)}%).`;
|
|
18424
|
+
}
|
|
18425
|
+
}
|
|
18426
|
+
if (db.close) {
|
|
18427
|
+
await db.close();
|
|
18428
|
+
}
|
|
18429
|
+
} catch (error45) {
|
|
18430
|
+
console.warn("Failed to query precedent data:", error45);
|
|
18431
|
+
}
|
|
18432
|
+
}
|
|
18372
18433
|
return {
|
|
18373
18434
|
strategy: finalStrategy,
|
|
18374
18435
|
confidence,
|
|
18375
18436
|
reasoning,
|
|
18376
|
-
alternatives: entries2.filter(([s]) => s !== finalStrategy).map(([strategy, score]) => ({ strategy, score }))
|
|
18437
|
+
alternatives: entries2.filter(([s]) => s !== finalStrategy).map(([strategy, score]) => ({ strategy, score })),
|
|
18438
|
+
precedent
|
|
18377
18439
|
};
|
|
18378
18440
|
}
|
|
18379
18441
|
function formatStrategyGuidelines(strategy) {
|
|
@@ -18582,13 +18644,14 @@ var init_swarm_strategies = __esm(() => {
|
|
|
18582
18644
|
}
|
|
18583
18645
|
};
|
|
18584
18646
|
swarm_select_strategy = tool({
|
|
18585
|
-
description: "Analyze task and recommend decomposition strategy (file-based, feature-based, or risk-based)",
|
|
18647
|
+
description: "Analyze task and recommend decomposition strategy (file-based, feature-based, or risk-based) with optional precedent data",
|
|
18586
18648
|
args: {
|
|
18587
18649
|
task: tool.schema.string().min(1).describe("Task description to analyze"),
|
|
18588
|
-
codebase_context: tool.schema.string().optional().describe("Optional codebase context (file structure, tech stack, etc.)")
|
|
18650
|
+
codebase_context: tool.schema.string().optional().describe("Optional codebase context (file structure, tech stack, etc.)"),
|
|
18651
|
+
projectKey: tool.schema.string().optional().describe("Optional project path for precedent-aware strategy selection")
|
|
18589
18652
|
},
|
|
18590
18653
|
async execute(args2) {
|
|
18591
|
-
const result = selectStrategy(args2.task);
|
|
18654
|
+
const result = await selectStrategy(args2.task, args2.projectKey);
|
|
18592
18655
|
let enhancedReasoning = result.reasoning;
|
|
18593
18656
|
if (args2.codebase_context) {
|
|
18594
18657
|
enhancedReasoning += `
|
|
@@ -18606,7 +18669,8 @@ Codebase context considered: ${args2.codebase_context.slice(0, 200)}...`;
|
|
|
18606
18669
|
strategy: alt.strategy,
|
|
18607
18670
|
description: STRATEGIES[alt.strategy].description,
|
|
18608
18671
|
score: alt.score
|
|
18609
|
-
}))
|
|
18672
|
+
})),
|
|
18673
|
+
precedent: result.precedent
|
|
18610
18674
|
}, null, 2);
|
|
18611
18675
|
}
|
|
18612
18676
|
});
|
|
@@ -20869,7 +20933,8 @@ import {
|
|
|
20869
20933
|
importFromJSONL,
|
|
20870
20934
|
syncMemories,
|
|
20871
20935
|
getSwarmMailLibSQL,
|
|
20872
|
-
resolvePartialId
|
|
20936
|
+
resolvePartialId,
|
|
20937
|
+
findCellsByPartialId
|
|
20873
20938
|
} from "swarm-mail";
|
|
20874
20939
|
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
|
|
20875
20940
|
import { join as join2 } from "node:path";
|
|
@@ -21455,13 +21520,12 @@ PREFER THIS OVER hive_query when you need to:
|
|
|
21455
21520
|
const adapter = await getHiveAdapter(projectKey);
|
|
21456
21521
|
try {
|
|
21457
21522
|
if (args.id) {
|
|
21458
|
-
const
|
|
21459
|
-
|
|
21460
|
-
if (!cell) {
|
|
21523
|
+
const matchingCells = await findCellsByPartialId(adapter, projectKey, args.id);
|
|
21524
|
+
if (matchingCells.length === 0) {
|
|
21461
21525
|
throw new HiveError(`No cell found matching ID '${args.id}'`, "hive_cells");
|
|
21462
21526
|
}
|
|
21463
|
-
const formatted2 = formatCellForOutput(
|
|
21464
|
-
return JSON.stringify(
|
|
21527
|
+
const formatted2 = matchingCells.map((c) => formatCellForOutput(c));
|
|
21528
|
+
return JSON.stringify(formatted2, null, 2);
|
|
21465
21529
|
}
|
|
21466
21530
|
if (args.ready) {
|
|
21467
21531
|
const ready = await adapter.getNextReadyCell(projectKey);
|
|
@@ -21480,10 +21544,10 @@ PREFER THIS OVER hive_query when you need to:
|
|
|
21480
21544
|
const formatted = cells.map((c) => formatCellForOutput(c));
|
|
21481
21545
|
return JSON.stringify(formatted, null, 2);
|
|
21482
21546
|
} catch (error45) {
|
|
21483
|
-
|
|
21484
|
-
|
|
21485
|
-
throw new HiveError(`Ambiguous ID '${args.id}': multiple cells match. Please provide more characters.`, "hive_cells");
|
|
21547
|
+
if (error45 instanceof HiveError) {
|
|
21548
|
+
throw error45;
|
|
21486
21549
|
}
|
|
21550
|
+
const message = error45 instanceof Error ? error45.message : String(error45);
|
|
21487
21551
|
if (message.includes("Bead not found") || message.includes("Cell not found")) {
|
|
21488
21552
|
throw new HiveError(`No cell found matching ID '${args.id || "unknown"}'`, "hive_cells");
|
|
21489
21553
|
}
|
|
@@ -21992,6 +22056,90 @@ init_dist();
|
|
|
21992
22056
|
init_zod();
|
|
21993
22057
|
import { sendSwarmMessage } from "swarm-mail";
|
|
21994
22058
|
init_eval_capture();
|
|
22059
|
+
|
|
22060
|
+
// src/decision-trace-integration.ts
|
|
22061
|
+
import {
|
|
22062
|
+
createDecisionTrace,
|
|
22063
|
+
createEntityLink
|
|
22064
|
+
} from "swarm-mail";
|
|
22065
|
+
import { createLibSQLAdapter } from "swarm-mail";
|
|
22066
|
+
import { getDatabasePath } from "swarm-mail";
|
|
22067
|
+
async function getTraceDb(projectPath) {
|
|
22068
|
+
const dbPath = getDatabasePath(projectPath);
|
|
22069
|
+
return createLibSQLAdapter({ url: `file:${dbPath}` });
|
|
22070
|
+
}
|
|
22071
|
+
async function traceWorkerSpawn(input) {
|
|
22072
|
+
try {
|
|
22073
|
+
const db = await getTraceDb(input.projectKey);
|
|
22074
|
+
const trace = await createDecisionTrace(db, {
|
|
22075
|
+
decision_type: "worker_spawn",
|
|
22076
|
+
epic_id: input.epicId,
|
|
22077
|
+
bead_id: input.beadId,
|
|
22078
|
+
agent_name: input.agentName,
|
|
22079
|
+
project_key: input.projectKey,
|
|
22080
|
+
decision: {
|
|
22081
|
+
worker: input.workerName || "worker",
|
|
22082
|
+
subtask_title: input.subtaskTitle,
|
|
22083
|
+
files: input.files,
|
|
22084
|
+
model: input.model,
|
|
22085
|
+
spawn_order: input.spawnOrder,
|
|
22086
|
+
is_parallel: input.isParallel
|
|
22087
|
+
},
|
|
22088
|
+
rationale: input.rationale || `Spawning worker for: ${input.subtaskTitle}`
|
|
22089
|
+
});
|
|
22090
|
+
for (const file2 of input.files) {
|
|
22091
|
+
await createEntityLink(db, {
|
|
22092
|
+
source_decision_id: trace.id,
|
|
22093
|
+
target_entity_type: "file",
|
|
22094
|
+
target_entity_id: file2,
|
|
22095
|
+
link_type: "assigns_file",
|
|
22096
|
+
strength: 1,
|
|
22097
|
+
context: `File assigned to worker ${input.workerName || "worker"}`
|
|
22098
|
+
});
|
|
22099
|
+
}
|
|
22100
|
+
await db.close?.();
|
|
22101
|
+
return trace.id;
|
|
22102
|
+
} catch (error45) {
|
|
22103
|
+
console.warn("[decision-trace] Failed to trace worker_spawn:", error45);
|
|
22104
|
+
return "";
|
|
22105
|
+
}
|
|
22106
|
+
}
|
|
22107
|
+
async function traceReviewDecision(input) {
|
|
22108
|
+
try {
|
|
22109
|
+
const db = await getTraceDb(input.projectKey);
|
|
22110
|
+
const trace = await createDecisionTrace(db, {
|
|
22111
|
+
decision_type: "review_decision",
|
|
22112
|
+
epic_id: input.epicId,
|
|
22113
|
+
bead_id: input.beadId,
|
|
22114
|
+
agent_name: input.agentName,
|
|
22115
|
+
project_key: input.projectKey,
|
|
22116
|
+
decision: {
|
|
22117
|
+
status: input.status,
|
|
22118
|
+
worker_id: input.workerId,
|
|
22119
|
+
issues_count: input.issues?.length || 0,
|
|
22120
|
+
attempt_number: input.attemptNumber,
|
|
22121
|
+
remaining_attempts: input.remainingAttempts
|
|
22122
|
+
},
|
|
22123
|
+
rationale: input.rationale || input.summary || `Review ${input.status}`,
|
|
22124
|
+
inputs_gathered: input.issues ? [{ source: "code_review", issues: input.issues }] : undefined
|
|
22125
|
+
});
|
|
22126
|
+
await createEntityLink(db, {
|
|
22127
|
+
source_decision_id: trace.id,
|
|
22128
|
+
target_entity_type: "agent",
|
|
22129
|
+
target_entity_id: input.workerId,
|
|
22130
|
+
link_type: "reviewed_work_by",
|
|
22131
|
+
strength: 1,
|
|
22132
|
+
context: `Review ${input.status} for ${input.workerId}`
|
|
22133
|
+
});
|
|
22134
|
+
await db.close?.();
|
|
22135
|
+
return trace.id;
|
|
22136
|
+
} catch (error45) {
|
|
22137
|
+
console.warn("[decision-trace] Failed to trace review_decision:", error45);
|
|
22138
|
+
return "";
|
|
22139
|
+
}
|
|
22140
|
+
}
|
|
22141
|
+
|
|
22142
|
+
// src/swarm-review.ts
|
|
21995
22143
|
var ReviewIssueSchema = exports_external.object({
|
|
21996
22144
|
file: exports_external.string(),
|
|
21997
22145
|
line: exports_external.number().optional(),
|
|
@@ -22266,6 +22414,22 @@ var swarm_review_feedback = tool({
|
|
|
22266
22414
|
} catch (error45) {
|
|
22267
22415
|
console.warn("[swarm_review_feedback] Failed to capture review_completed:", error45);
|
|
22268
22416
|
}
|
|
22417
|
+
try {
|
|
22418
|
+
await traceReviewDecision({
|
|
22419
|
+
projectKey: args.project_key,
|
|
22420
|
+
agentName: "coordinator",
|
|
22421
|
+
epicId,
|
|
22422
|
+
beadId: args.task_id,
|
|
22423
|
+
workerId: args.worker_id,
|
|
22424
|
+
status: "approved",
|
|
22425
|
+
summary: args.summary,
|
|
22426
|
+
attemptNumber: 1,
|
|
22427
|
+
remainingAttempts: MAX_REVIEW_ATTEMPTS,
|
|
22428
|
+
rationale: args.summary || "Review approved"
|
|
22429
|
+
});
|
|
22430
|
+
} catch (error45) {
|
|
22431
|
+
console.warn("[swarm_review_feedback] Failed to trace review_decision:", error45);
|
|
22432
|
+
}
|
|
22269
22433
|
try {
|
|
22270
22434
|
const { createEvent: createEvent2, appendEvent: appendEvent2 } = await import("swarm-mail");
|
|
22271
22435
|
const attempt = getReviewStatus(args.task_id).attempt_count || 1;
|
|
@@ -22320,6 +22484,23 @@ You may now complete the task with \`swarm_complete\`.`,
|
|
|
22320
22484
|
} catch (error45) {
|
|
22321
22485
|
console.warn("[swarm_review_feedback] Failed to capture review_completed:", error45);
|
|
22322
22486
|
}
|
|
22487
|
+
try {
|
|
22488
|
+
await traceReviewDecision({
|
|
22489
|
+
projectKey: args.project_key,
|
|
22490
|
+
agentName: "coordinator",
|
|
22491
|
+
epicId,
|
|
22492
|
+
beadId: args.task_id,
|
|
22493
|
+
workerId: args.worker_id,
|
|
22494
|
+
status: "needs_changes",
|
|
22495
|
+
summary: args.summary,
|
|
22496
|
+
issues: parsedIssues,
|
|
22497
|
+
attemptNumber,
|
|
22498
|
+
remainingAttempts: remaining,
|
|
22499
|
+
rationale: args.summary || `Review rejected: ${parsedIssues.length} issue(s) found`
|
|
22500
|
+
});
|
|
22501
|
+
} catch (error45) {
|
|
22502
|
+
console.warn("[swarm_review_feedback] Failed to trace review_decision:", error45);
|
|
22503
|
+
}
|
|
22323
22504
|
try {
|
|
22324
22505
|
const { createEvent: createEvent2, appendEvent: appendEvent2 } = await import("swarm-mail");
|
|
22325
22506
|
const status = remaining <= 0 ? "blocked" : "needs_changes";
|
|
@@ -38822,9 +39003,9 @@ async function getPromptInsights(options2) {
|
|
|
38822
39003
|
}
|
|
38823
39004
|
async function getCoordinatorInsights(project_key) {
|
|
38824
39005
|
try {
|
|
38825
|
-
const { createLibSQLAdapter, createSwarmMailAdapter: createSwarmMailAdapter2 } = await import("swarm-mail");
|
|
39006
|
+
const { createLibSQLAdapter: createLibSQLAdapter2, createSwarmMailAdapter: createSwarmMailAdapter2 } = await import("swarm-mail");
|
|
38826
39007
|
const { getStrategyInsights: getStrategyInsights2, getPatternInsights: getPatternInsights2, formatInsightsForPrompt: formatInsightsForPrompt2 } = await Promise.resolve().then(() => (init_swarm_insights(), exports_swarm_insights));
|
|
38827
|
-
const dbAdapter = await
|
|
39008
|
+
const dbAdapter = await createLibSQLAdapter2({ url: "file:./.swarm-mail/streams.db" });
|
|
38828
39009
|
const adapter = createSwarmMailAdapter2(dbAdapter, project_key || "default");
|
|
38829
39010
|
const [strategies, patterns] = await Promise.all([
|
|
38830
39011
|
getStrategyInsights2(adapter, ""),
|
|
@@ -38852,7 +39033,7 @@ ${formatted}
|
|
|
38852
39033
|
}
|
|
38853
39034
|
async function getWorkerInsights(files, domain2) {
|
|
38854
39035
|
try {
|
|
38855
|
-
const { createLibSQLAdapter, createSwarmMailAdapter: createSwarmMailAdapter2 } = await import("swarm-mail");
|
|
39036
|
+
const { createLibSQLAdapter: createLibSQLAdapter2, createSwarmMailAdapter: createSwarmMailAdapter2 } = await import("swarm-mail");
|
|
38856
39037
|
const { getFileInsights: getFileInsights2, formatInsightsForPrompt: formatInsightsForPrompt2 } = await Promise.resolve().then(() => (init_swarm_insights(), exports_swarm_insights));
|
|
38857
39038
|
const memoryAdapter = await getMemoryAdapter();
|
|
38858
39039
|
let query = "";
|
|
@@ -38869,7 +39050,7 @@ async function getWorkerInsights(files, domain2) {
|
|
|
38869
39050
|
if (!files || files.length === 0)
|
|
38870
39051
|
return [];
|
|
38871
39052
|
try {
|
|
38872
|
-
const dbAdapter = await
|
|
39053
|
+
const dbAdapter = await createLibSQLAdapter2({ url: "file:./.swarm-mail/streams.db" });
|
|
38873
39054
|
const swarmMail = createSwarmMailAdapter2(dbAdapter, "default");
|
|
38874
39055
|
return await getFileInsights2(swarmMail, files);
|
|
38875
39056
|
} catch (e) {
|
|
@@ -39081,6 +39262,23 @@ var swarm_spawn_subtask = tool({
|
|
|
39081
39262
|
} catch (error45) {
|
|
39082
39263
|
console.warn("[swarm_spawn_subtask] Failed to capture worker_spawned:", error45);
|
|
39083
39264
|
}
|
|
39265
|
+
try {
|
|
39266
|
+
await traceWorkerSpawn({
|
|
39267
|
+
projectKey: args2.project_path || process.cwd(),
|
|
39268
|
+
agentName: "coordinator",
|
|
39269
|
+
epicId: args2.epic_id,
|
|
39270
|
+
beadId: args2.bead_id,
|
|
39271
|
+
workerName: "worker",
|
|
39272
|
+
subtaskTitle: args2.subtask_title,
|
|
39273
|
+
files: args2.files,
|
|
39274
|
+
model: selectedModel,
|
|
39275
|
+
spawnOrder: 0,
|
|
39276
|
+
isParallel: false,
|
|
39277
|
+
rationale: args2.subtask_description || `Spawning worker for: ${args2.subtask_title}`
|
|
39278
|
+
});
|
|
39279
|
+
} catch (error45) {
|
|
39280
|
+
console.warn("[swarm_spawn_subtask] Failed to trace worker_spawn:", error45);
|
|
39281
|
+
}
|
|
39084
39282
|
if (args2.project_path) {
|
|
39085
39283
|
try {
|
|
39086
39284
|
const { createEvent: createEvent3, appendEvent: appendEvent3 } = await import("swarm-mail");
|
|
@@ -39310,7 +39508,7 @@ var swarm_plan_prompt = tool({
|
|
|
39310
39508
|
selectedStrategy = args2.strategy;
|
|
39311
39509
|
strategyReasoning = `User-specified strategy: ${selectedStrategy}`;
|
|
39312
39510
|
} else {
|
|
39313
|
-
const selection = selectStrategy2(args2.task);
|
|
39511
|
+
const selection = await selectStrategy2(args2.task);
|
|
39314
39512
|
selectedStrategy = selection.strategy;
|
|
39315
39513
|
strategyReasoning = selection.reasoning;
|
|
39316
39514
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swarm-review.d.ts","sourceRoot":"","sources":["../src/swarm-review.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"swarm-review.d.ts","sourceRoot":"","sources":["../src/swarm-review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AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAsGzE;AAmED;;;;;GAKG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;CA+HvB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;CA2PhC,CAAC;AAMH;;GAEG;AACH,UAAU,gBAAgB;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAOD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAGvD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAGxD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAQhE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAGtD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvD;AAMD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGvB,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swarm Signature Detection
|
|
3
|
+
*
|
|
4
|
+
* Deterministic, algorithmic detection of swarm coordination from session events.
|
|
5
|
+
* No heuristics, no confidence levels - a swarm either exists or it doesn't.
|
|
6
|
+
*
|
|
7
|
+
* A SWARM is defined by this event sequence:
|
|
8
|
+
* 1. hive_create_epic(epic_title, subtasks[]) → epic_id
|
|
9
|
+
* 2. swarm_spawn_subtask(bead_id, epic_id, ...) → prompt (at least one)
|
|
10
|
+
*
|
|
11
|
+
* The projection folds over events to produce ground truth state:
|
|
12
|
+
* - Which epic is being coordinated
|
|
13
|
+
* - Which subtasks exist and their lifecycle status
|
|
14
|
+
* - What files are assigned to each subtask
|
|
15
|
+
*
|
|
16
|
+
* @module swarm-signature
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Subtask lifecycle status derived from events
|
|
20
|
+
*/
|
|
21
|
+
export type SubtaskStatus = "created" | "spawned" | "in_progress" | "completed" | "closed";
|
|
22
|
+
/**
|
|
23
|
+
* Subtask state projected from events
|
|
24
|
+
*/
|
|
25
|
+
export interface SubtaskState {
|
|
26
|
+
id: string;
|
|
27
|
+
title: string;
|
|
28
|
+
status: SubtaskStatus;
|
|
29
|
+
files: string[];
|
|
30
|
+
worker?: string;
|
|
31
|
+
spawnedAt?: number;
|
|
32
|
+
completedAt?: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Epic state projected from events
|
|
36
|
+
*/
|
|
37
|
+
export interface EpicState {
|
|
38
|
+
id: string;
|
|
39
|
+
title: string;
|
|
40
|
+
status: "open" | "in_progress" | "closed";
|
|
41
|
+
createdAt: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Complete swarm state projected from session events
|
|
45
|
+
*/
|
|
46
|
+
export interface SwarmProjection {
|
|
47
|
+
/** Whether a valid swarm signature was detected */
|
|
48
|
+
isSwarm: boolean;
|
|
49
|
+
/** Epic being coordinated (if any) */
|
|
50
|
+
epic?: EpicState;
|
|
51
|
+
/** Subtasks by ID */
|
|
52
|
+
subtasks: Map<string, SubtaskState>;
|
|
53
|
+
/** Project path from swarmmail_init */
|
|
54
|
+
projectPath?: string;
|
|
55
|
+
/** Coordinator agent name from swarmmail_init */
|
|
56
|
+
coordinatorName?: string;
|
|
57
|
+
/** Last event timestamp */
|
|
58
|
+
lastEventAt?: number;
|
|
59
|
+
/** Summary counts for quick access */
|
|
60
|
+
counts: {
|
|
61
|
+
total: number;
|
|
62
|
+
created: number;
|
|
63
|
+
spawned: number;
|
|
64
|
+
inProgress: number;
|
|
65
|
+
completed: number;
|
|
66
|
+
closed: number;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Tool call event extracted from session messages
|
|
71
|
+
*/
|
|
72
|
+
export interface ToolCallEvent {
|
|
73
|
+
tool: string;
|
|
74
|
+
input: Record<string, unknown>;
|
|
75
|
+
output: string;
|
|
76
|
+
timestamp: number;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Project swarm state from session tool call events
|
|
80
|
+
*
|
|
81
|
+
* This is a pure fold over events - deterministic and side-effect free.
|
|
82
|
+
* The resulting state is the ground truth for swarm coordination.
|
|
83
|
+
*
|
|
84
|
+
* @param events - Tool call events from session messages (chronological order)
|
|
85
|
+
* @returns Projected swarm state
|
|
86
|
+
*/
|
|
87
|
+
export declare function projectSwarmState(events: ToolCallEvent[]): SwarmProjection;
|
|
88
|
+
/**
|
|
89
|
+
* Check if events contain a valid swarm signature
|
|
90
|
+
*
|
|
91
|
+
* A swarm signature requires:
|
|
92
|
+
* 1. hive_create_epic call
|
|
93
|
+
* 2. At least one swarm_spawn_subtask call
|
|
94
|
+
*
|
|
95
|
+
* This is a quick check without full projection.
|
|
96
|
+
*/
|
|
97
|
+
export declare function hasSwarmSignature(events: ToolCallEvent[]): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Check if swarm is still active (has pending work)
|
|
100
|
+
*/
|
|
101
|
+
export declare function isSwarmActive(projection: SwarmProjection): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Get human-readable swarm status summary
|
|
104
|
+
*/
|
|
105
|
+
export declare function getSwarmSummary(projection: SwarmProjection): string;
|
|
106
|
+
//# sourceMappingURL=swarm-signature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swarm-signature.d.ts","sourceRoot":"","sources":["../src/swarm-signature.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH;;GAEG;AACH,MAAM,MA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OAAO,CAAC,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,eAAe,CAiO1E;AA0CD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAkBlE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,eAAe,GAAG,OAAO,CAYlE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,eAAe,GAAG,MAAM,CAuBnE"}
|
|
@@ -52,9 +52,10 @@ export declare const STRATEGIES: Record<Exclude<DecompositionStrategy, "auto">,
|
|
|
52
52
|
* Analyze task description and select best decomposition strategy
|
|
53
53
|
*
|
|
54
54
|
* @param task - Task description
|
|
55
|
-
* @
|
|
55
|
+
* @param projectKey - Optional project path for precedent-aware selection
|
|
56
|
+
* @returns Selected strategy with reasoning and optional precedent data
|
|
56
57
|
*/
|
|
57
|
-
export declare function selectStrategy(task: string): {
|
|
58
|
+
export declare function selectStrategy(task: string, projectKey?: string): Promise<{
|
|
58
59
|
strategy: Exclude<DecompositionStrategy, "auto">;
|
|
59
60
|
confidence: number;
|
|
60
61
|
reasoning: string;
|
|
@@ -62,7 +63,12 @@ export declare function selectStrategy(task: string): {
|
|
|
62
63
|
strategy: Exclude<DecompositionStrategy, "auto">;
|
|
63
64
|
score: number;
|
|
64
65
|
}>;
|
|
65
|
-
|
|
66
|
+
precedent?: {
|
|
67
|
+
similar_decisions: number;
|
|
68
|
+
strategy_success_rate?: number;
|
|
69
|
+
cited_epics?: string[];
|
|
70
|
+
};
|
|
71
|
+
}>;
|
|
66
72
|
/**
|
|
67
73
|
* Format strategy-specific guidelines for the decomposition prompt
|
|
68
74
|
*/
|
|
@@ -72,16 +78,21 @@ export declare function formatStrategyGuidelines(strategy: Exclude<Decomposition
|
|
|
72
78
|
*
|
|
73
79
|
* Analyzes task description and recommends a strategy with reasoning.
|
|
74
80
|
* Use this before swarm_plan_prompt to understand the recommended approach.
|
|
81
|
+
*
|
|
82
|
+
* When projectKey is provided, queries past strategy decisions and success rates
|
|
83
|
+
* to provide precedent-aware recommendations with adjusted confidence.
|
|
75
84
|
*/
|
|
76
85
|
export declare const swarm_select_strategy: {
|
|
77
86
|
description: string;
|
|
78
87
|
args: {
|
|
79
88
|
task: z.ZodString;
|
|
80
89
|
codebase_context: z.ZodOptional<z.ZodString>;
|
|
90
|
+
projectKey: z.ZodOptional<z.ZodString>;
|
|
81
91
|
};
|
|
82
92
|
execute(args: {
|
|
83
93
|
task: string;
|
|
84
94
|
codebase_context?: string | undefined;
|
|
95
|
+
projectKey?: string | undefined;
|
|
85
96
|
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
86
97
|
};
|
|
87
98
|
export declare const strategyTools: {
|
|
@@ -90,10 +101,12 @@ export declare const strategyTools: {
|
|
|
90
101
|
args: {
|
|
91
102
|
task: z.ZodString;
|
|
92
103
|
codebase_context: z.ZodOptional<z.ZodString>;
|
|
104
|
+
projectKey: z.ZodOptional<z.ZodString>;
|
|
93
105
|
};
|
|
94
106
|
execute(args: {
|
|
95
107
|
task: string;
|
|
96
108
|
codebase_context?: string | undefined;
|
|
109
|
+
projectKey?: string | undefined;
|
|
97
110
|
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
98
111
|
};
|
|
99
112
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swarm-strategies.d.ts","sourceRoot":"","sources":["../src/swarm-strategies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC7B,YAAY,GACZ,eAAe,GACf,YAAY,GACZ,gBAAgB,GAChB,MAAM,CAAC;AAEX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AEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAC7B,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,EACtC,kBAAkB,CAgKnB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC;IACT,QAAQ,EAAE,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,KAAK,CAAC;QAClB,QAAQ,EAAE,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;QACjD,KAAK,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;IACH,SAAS,CAAC,EAAE;QACV,iBAAiB,EAAE,MAAM,CAAC;QAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAC/B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;KACxB,CAAC;CACH,CAAC,CAwKD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,GAC/C,MAAM,CAmBR;AAMD;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;CA0ChC,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;CAEzB,CAAC"}
|
package/dist/swarm.d.ts
CHANGED
|
@@ -546,8 +546,8 @@ export declare const swarmTools: {
|
|
|
546
546
|
user_response: import("zod").ZodOptional<import("zod").ZodString>;
|
|
547
547
|
phase: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
548
548
|
ready: "ready";
|
|
549
|
-
questioning: "questioning";
|
|
550
549
|
alternatives: "alternatives";
|
|
550
|
+
questioning: "questioning";
|
|
551
551
|
recommendation: "recommendation";
|
|
552
552
|
}>>;
|
|
553
553
|
};
|
|
@@ -556,7 +556,7 @@ export declare const swarmTools: {
|
|
|
556
556
|
mode: "auto" | "socratic" | "fast" | "confirm-only";
|
|
557
557
|
context?: string | undefined;
|
|
558
558
|
user_response?: string | undefined;
|
|
559
|
-
phase?: "ready" | "
|
|
559
|
+
phase?: "ready" | "alternatives" | "questioning" | "recommendation" | undefined;
|
|
560
560
|
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
561
561
|
};
|
|
562
562
|
swarm_select_strategy: {
|
|
@@ -564,10 +564,12 @@ export declare const swarmTools: {
|
|
|
564
564
|
args: {
|
|
565
565
|
task: import("zod").ZodString;
|
|
566
566
|
codebase_context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
567
|
+
projectKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
567
568
|
};
|
|
568
569
|
execute(args: {
|
|
569
570
|
task: string;
|
|
570
571
|
codebase_context?: string | undefined;
|
|
572
|
+
projectKey?: string | undefined;
|
|
571
573
|
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
572
574
|
};
|
|
573
575
|
};
|
package/dist/swarm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swarm.d.ts","sourceRoot":"","sources":["../src/swarm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AASjC;;;GAGG;AACH,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"swarm.d.ts","sourceRoot":"","sources":["../src/swarm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AASjC;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMtB,CAAC"}
|