opencode-swarm-plugin 0.40.0 → 0.42.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/.hive/analysis/eval-failure-analysis-2025-12-25.md +331 -0
- package/.hive/analysis/session-data-quality-audit.md +320 -0
- package/.hive/eval-results.json +481 -24
- package/.hive/issues.jsonl +67 -16
- package/.hive/memories.jsonl +159 -1
- package/.opencode/eval-history.jsonl +315 -0
- package/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +165 -0
- package/README.md +2 -0
- package/SCORER-ANALYSIS.md +598 -0
- package/bin/eval-gate.test.ts +158 -0
- package/bin/eval-gate.ts +74 -0
- package/bin/swarm.serve.test.ts +46 -0
- package/bin/swarm.test.ts +661 -732
- package/bin/swarm.ts +335 -0
- package/dist/compaction-hook.d.ts +7 -5
- package/dist/compaction-hook.d.ts.map +1 -1
- package/dist/compaction-prompt-scoring.d.ts +1 -0
- package/dist/compaction-prompt-scoring.d.ts.map +1 -1
- package/dist/eval-runner.d.ts +134 -0
- package/dist/eval-runner.d.ts.map +1 -0
- package/dist/hive.d.ts.map +1 -1
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +99741 -58858
- package/dist/memory-tools.d.ts +70 -2
- package/dist/memory-tools.d.ts.map +1 -1
- package/dist/memory.d.ts +37 -0
- package/dist/memory.d.ts.map +1 -1
- package/dist/observability-tools.d.ts +64 -0
- package/dist/observability-tools.d.ts.map +1 -1
- package/dist/plugin.js +99356 -58318
- package/dist/swarm-orchestrate.d.ts.map +1 -1
- package/dist/swarm-prompts.d.ts +32 -1
- package/dist/swarm-prompts.d.ts.map +1 -1
- package/docs/planning/ADR-009-oh-my-opencode-patterns.md +353 -0
- package/evals/ARCHITECTURE.md +1189 -0
- package/evals/example.eval.ts +3 -4
- package/evals/fixtures/compaction-prompt-cases.ts +6 -0
- package/evals/scorers/coordinator-discipline.evalite-test.ts +1 -162
- package/evals/scorers/coordinator-discipline.ts +0 -323
- package/evals/swarm-decomposition.eval.ts +4 -2
- package/package.json +4 -3
- package/src/compaction-prompt-scorers.test.ts +185 -9
- package/src/compaction-prompt-scoring.ts +7 -5
- package/src/eval-runner.test.ts +128 -1
- package/src/eval-runner.ts +46 -0
- package/src/hive.ts +43 -42
- package/src/memory-tools.test.ts +84 -0
- package/src/memory-tools.ts +68 -3
- package/src/memory.test.ts +2 -112
- package/src/memory.ts +88 -49
- package/src/observability-tools.test.ts +13 -0
- package/src/observability-tools.ts +277 -0
- package/src/swarm-orchestrate.test.ts +162 -0
- package/src/swarm-orchestrate.ts +7 -5
- package/src/swarm-prompts.test.ts +168 -4
- package/src/swarm-prompts.ts +228 -7
- package/.env +0 -2
- package/.turbo/turbo-test.log +0 -481
- package/.turbo/turbo-typecheck.log +0 -1
package/bin/swarm.ts
CHANGED
|
@@ -2518,8 +2518,12 @@ ${cyan("Commands:")}
|
|
|
2518
2518
|
swarm config Show paths to generated config files
|
|
2519
2519
|
swarm agents Update AGENTS.md with skill awareness
|
|
2520
2520
|
swarm migrate Migrate PGlite database to libSQL
|
|
2521
|
+
swarm serve Start SSE server for real-time event streaming
|
|
2522
|
+
--port <n> Port to listen on (default: 3001)
|
|
2521
2523
|
swarm cells List or get cells from database (replaces 'swarm tool hive_query')
|
|
2522
2524
|
swarm log View swarm logs with filtering
|
|
2525
|
+
swarm stats Show swarm health metrics and success rates
|
|
2526
|
+
swarm history Show recent swarm activity timeline
|
|
2523
2527
|
swarm eval Eval-driven development commands
|
|
2524
2528
|
swarm update Update to latest version
|
|
2525
2529
|
swarm version Show version and banner
|
|
@@ -2554,6 +2558,16 @@ ${cyan("Log Viewing:")}
|
|
|
2554
2558
|
swarm log sessions --type <type> Filter by event type (DECISION, VIOLATION, OUTCOME, COMPACTION)
|
|
2555
2559
|
swarm log sessions --json Raw JSON output for jq
|
|
2556
2560
|
|
|
2561
|
+
${cyan("Stats & History:")}
|
|
2562
|
+
swarm stats Show swarm health metrics (last 7 days)
|
|
2563
|
+
swarm stats --since 24h Show stats for custom time period
|
|
2564
|
+
swarm stats --json Output as JSON for scripting
|
|
2565
|
+
swarm history Show recent swarms (last 10)
|
|
2566
|
+
swarm history --limit 20 Show more swarms
|
|
2567
|
+
swarm history --status success Filter by success/failed/in_progress
|
|
2568
|
+
swarm history --strategy file-based Filter by decomposition strategy
|
|
2569
|
+
swarm history --verbose Show detailed subtask information
|
|
2570
|
+
|
|
2557
2571
|
${cyan("Eval Commands:")}
|
|
2558
2572
|
swarm eval status [eval-name] Show current phase, thresholds, recent scores
|
|
2559
2573
|
swarm eval history Show eval run history with trends
|
|
@@ -4013,6 +4027,262 @@ function formatEvalRunResultOutput(result: {
|
|
|
4013
4027
|
p.log.message(result.message);
|
|
4014
4028
|
}
|
|
4015
4029
|
|
|
4030
|
+
// ============================================================================
|
|
4031
|
+
// Stats Command - Swarm Health Metrics
|
|
4032
|
+
// ============================================================================
|
|
4033
|
+
|
|
4034
|
+
async function stats() {
|
|
4035
|
+
const { getSwarmMailLibSQL } = await import("swarm-mail");
|
|
4036
|
+
const { formatSwarmStats, parseTimePeriod, aggregateByStrategy } = await import(
|
|
4037
|
+
"../src/observability-tools"
|
|
4038
|
+
);
|
|
4039
|
+
|
|
4040
|
+
p.intro("swarm stats");
|
|
4041
|
+
|
|
4042
|
+
// Parse args
|
|
4043
|
+
const args = process.argv.slice(3);
|
|
4044
|
+
let period = "7d"; // default to 7 days
|
|
4045
|
+
let format: "text" | "json" = "text";
|
|
4046
|
+
|
|
4047
|
+
for (let i = 0; i < args.length; i++) {
|
|
4048
|
+
if (args[i] === "--since" || args[i] === "-s") {
|
|
4049
|
+
period = args[i + 1] || "7d";
|
|
4050
|
+
i++;
|
|
4051
|
+
} else if (args[i] === "--json") {
|
|
4052
|
+
format = "json";
|
|
4053
|
+
}
|
|
4054
|
+
}
|
|
4055
|
+
|
|
4056
|
+
try {
|
|
4057
|
+
const projectPath = process.cwd();
|
|
4058
|
+
const swarmMail = await getSwarmMailLibSQL(projectPath);
|
|
4059
|
+
const db = await swarmMail.getDatabase();
|
|
4060
|
+
|
|
4061
|
+
// Calculate since timestamp
|
|
4062
|
+
const since = parseTimePeriod(period);
|
|
4063
|
+
const periodMatch = period.match(/^(\d+)([dhm])$/);
|
|
4064
|
+
const periodDays = periodMatch ?
|
|
4065
|
+
(periodMatch[2] === "d" ? Number.parseInt(periodMatch[1]) :
|
|
4066
|
+
periodMatch[2] === "h" ? Number.parseInt(periodMatch[1]) / 24 :
|
|
4067
|
+
Number.parseInt(periodMatch[1]) / (24 * 60)) : 7;
|
|
4068
|
+
|
|
4069
|
+
// Query overall stats
|
|
4070
|
+
const overallResult = await db.query(
|
|
4071
|
+
`SELECT
|
|
4072
|
+
COUNT(DISTINCT json_extract(data, '$.epic_id')) as total_swarms,
|
|
4073
|
+
SUM(CASE WHEN json_extract(data, '$.success') = 'true' THEN 1 ELSE 0 END) as successes,
|
|
4074
|
+
COUNT(*) as total_outcomes,
|
|
4075
|
+
CAST(AVG(CAST(json_extract(data, '$.duration_ms') AS REAL)) / 60000 AS REAL) as avg_duration_min
|
|
4076
|
+
FROM events
|
|
4077
|
+
WHERE type = 'subtask_outcome'
|
|
4078
|
+
AND timestamp >= ?`,
|
|
4079
|
+
[since],
|
|
4080
|
+
);
|
|
4081
|
+
|
|
4082
|
+
const overall = overallResult.rows[0] as {
|
|
4083
|
+
total_swarms: number;
|
|
4084
|
+
successes: number;
|
|
4085
|
+
total_outcomes: number;
|
|
4086
|
+
avg_duration_min: number;
|
|
4087
|
+
} || { total_swarms: 0, successes: 0, total_outcomes: 0, avg_duration_min: 0 };
|
|
4088
|
+
|
|
4089
|
+
// Query strategy breakdown
|
|
4090
|
+
const strategyResult = await db.query(
|
|
4091
|
+
`SELECT
|
|
4092
|
+
json_extract(data, '$.strategy') as strategy,
|
|
4093
|
+
json_extract(data, '$.success') as success
|
|
4094
|
+
FROM events
|
|
4095
|
+
WHERE type = 'subtask_outcome'
|
|
4096
|
+
AND timestamp >= ?`,
|
|
4097
|
+
[since],
|
|
4098
|
+
);
|
|
4099
|
+
|
|
4100
|
+
const strategies = aggregateByStrategy(
|
|
4101
|
+
(strategyResult.rows as Array<{ strategy: string | null; success: string }>).map(
|
|
4102
|
+
(row) => ({
|
|
4103
|
+
strategy: row.strategy,
|
|
4104
|
+
success: row.success === "true",
|
|
4105
|
+
}),
|
|
4106
|
+
),
|
|
4107
|
+
);
|
|
4108
|
+
|
|
4109
|
+
// Query coordinator stats from sessions
|
|
4110
|
+
const sessionsPath = join(
|
|
4111
|
+
homedir(),
|
|
4112
|
+
".config",
|
|
4113
|
+
"swarm-tools",
|
|
4114
|
+
"sessions",
|
|
4115
|
+
);
|
|
4116
|
+
let coordinatorStats = {
|
|
4117
|
+
violationRate: 0,
|
|
4118
|
+
spawnEfficiency: 0,
|
|
4119
|
+
reviewThoroughness: 0,
|
|
4120
|
+
};
|
|
4121
|
+
|
|
4122
|
+
if (existsSync(sessionsPath)) {
|
|
4123
|
+
const sessionFiles = readdirSync(sessionsPath).filter(
|
|
4124
|
+
(f) => f.endsWith(".jsonl") && statSync(join(sessionsPath, f)).mtimeMs >= since,
|
|
4125
|
+
);
|
|
4126
|
+
|
|
4127
|
+
let totalViolations = 0;
|
|
4128
|
+
let totalSpawns = 0;
|
|
4129
|
+
let totalReviews = 0;
|
|
4130
|
+
let totalSwarms = 0;
|
|
4131
|
+
|
|
4132
|
+
for (const file of sessionFiles) {
|
|
4133
|
+
try {
|
|
4134
|
+
const content = readFileSync(join(sessionsPath, file), "utf-8");
|
|
4135
|
+
const lines = content.trim().split("\n");
|
|
4136
|
+
|
|
4137
|
+
let violations = 0;
|
|
4138
|
+
let spawns = 0;
|
|
4139
|
+
let reviews = 0;
|
|
4140
|
+
|
|
4141
|
+
for (const line of lines) {
|
|
4142
|
+
try {
|
|
4143
|
+
const event = JSON.parse(line);
|
|
4144
|
+
if (event.type === "VIOLATION") violations++;
|
|
4145
|
+
if (event.type === "DECISION" && event.action === "spawn") spawns++;
|
|
4146
|
+
if (event.type === "DECISION" && event.action === "review") reviews++;
|
|
4147
|
+
} catch {
|
|
4148
|
+
// Skip invalid lines
|
|
4149
|
+
}
|
|
4150
|
+
}
|
|
4151
|
+
|
|
4152
|
+
if (spawns > 0 || violations > 0) {
|
|
4153
|
+
totalViolations += violations;
|
|
4154
|
+
totalSpawns += spawns;
|
|
4155
|
+
totalReviews += reviews;
|
|
4156
|
+
totalSwarms++;
|
|
4157
|
+
}
|
|
4158
|
+
} catch {
|
|
4159
|
+
// Skip unreadable files
|
|
4160
|
+
}
|
|
4161
|
+
}
|
|
4162
|
+
|
|
4163
|
+
coordinatorStats = {
|
|
4164
|
+
violationRate: totalSwarms > 0 ? (totalViolations / totalSwarms) * 100 : 0,
|
|
4165
|
+
spawnEfficiency: totalSwarms > 0 ? (totalSpawns / totalSwarms) * 100 : 0,
|
|
4166
|
+
reviewThoroughness: totalSpawns > 0 ? (totalReviews / totalSpawns) * 100 : 0,
|
|
4167
|
+
};
|
|
4168
|
+
}
|
|
4169
|
+
|
|
4170
|
+
// Build stats data
|
|
4171
|
+
const stats = {
|
|
4172
|
+
overall: {
|
|
4173
|
+
totalSwarms: overall.total_swarms,
|
|
4174
|
+
successRate:
|
|
4175
|
+
overall.total_outcomes > 0
|
|
4176
|
+
? (overall.successes / overall.total_outcomes) * 100
|
|
4177
|
+
: 0,
|
|
4178
|
+
avgDurationMin: overall.avg_duration_min || 0,
|
|
4179
|
+
},
|
|
4180
|
+
byStrategy: strategies,
|
|
4181
|
+
coordinator: coordinatorStats,
|
|
4182
|
+
recentDays: Math.round(periodDays * 10) / 10,
|
|
4183
|
+
};
|
|
4184
|
+
|
|
4185
|
+
// Output
|
|
4186
|
+
if (format === "json") {
|
|
4187
|
+
console.log(JSON.stringify(stats, null, 2));
|
|
4188
|
+
} else {
|
|
4189
|
+
console.log();
|
|
4190
|
+
console.log(formatSwarmStats(stats));
|
|
4191
|
+
console.log();
|
|
4192
|
+
}
|
|
4193
|
+
|
|
4194
|
+
p.outro("Stats ready!");
|
|
4195
|
+
} catch (error) {
|
|
4196
|
+
p.log.error(error instanceof Error ? error.message : String(error));
|
|
4197
|
+
p.outro("Failed to load stats");
|
|
4198
|
+
process.exit(1);
|
|
4199
|
+
}
|
|
4200
|
+
}
|
|
4201
|
+
|
|
4202
|
+
// ============================================================================
|
|
4203
|
+
// History Command
|
|
4204
|
+
// ============================================================================
|
|
4205
|
+
|
|
4206
|
+
async function swarmHistory() {
|
|
4207
|
+
const {
|
|
4208
|
+
querySwarmHistory,
|
|
4209
|
+
formatSwarmHistory,
|
|
4210
|
+
} = await import("../src/observability-tools.js");
|
|
4211
|
+
|
|
4212
|
+
p.intro("swarm history");
|
|
4213
|
+
|
|
4214
|
+
// Parse args
|
|
4215
|
+
const args = process.argv.slice(3);
|
|
4216
|
+
let limit = 10;
|
|
4217
|
+
let status: "success" | "failed" | "in_progress" | undefined;
|
|
4218
|
+
let strategy: "file-based" | "feature-based" | "risk-based" | undefined;
|
|
4219
|
+
let verbose = false;
|
|
4220
|
+
|
|
4221
|
+
for (let i = 0; i < args.length; i++) {
|
|
4222
|
+
const arg = args[i];
|
|
4223
|
+
|
|
4224
|
+
if (arg === "--limit" || arg === "-n") {
|
|
4225
|
+
const limitStr = args[i + 1];
|
|
4226
|
+
if (limitStr && !Number.isNaN(Number(limitStr))) {
|
|
4227
|
+
limit = Number(limitStr);
|
|
4228
|
+
i++;
|
|
4229
|
+
}
|
|
4230
|
+
} else if (arg === "--status") {
|
|
4231
|
+
const statusStr = args[i + 1];
|
|
4232
|
+
if (
|
|
4233
|
+
statusStr &&
|
|
4234
|
+
["success", "failed", "in_progress"].includes(statusStr)
|
|
4235
|
+
) {
|
|
4236
|
+
status = statusStr as "success" | "failed" | "in_progress";
|
|
4237
|
+
i++;
|
|
4238
|
+
}
|
|
4239
|
+
} else if (arg === "--strategy") {
|
|
4240
|
+
const strategyStr = args[i + 1];
|
|
4241
|
+
if (
|
|
4242
|
+
strategyStr &&
|
|
4243
|
+
["file-based", "feature-based", "risk-based"].includes(strategyStr)
|
|
4244
|
+
) {
|
|
4245
|
+
strategy = strategyStr as "file-based" | "feature-based" | "risk-based";
|
|
4246
|
+
i++;
|
|
4247
|
+
}
|
|
4248
|
+
} else if (arg === "--verbose" || arg === "-v") {
|
|
4249
|
+
verbose = true;
|
|
4250
|
+
}
|
|
4251
|
+
}
|
|
4252
|
+
|
|
4253
|
+
try {
|
|
4254
|
+
const projectPath = process.cwd();
|
|
4255
|
+
const records = await querySwarmHistory(projectPath, {
|
|
4256
|
+
limit,
|
|
4257
|
+
status,
|
|
4258
|
+
strategy,
|
|
4259
|
+
});
|
|
4260
|
+
|
|
4261
|
+
console.log();
|
|
4262
|
+
console.log(formatSwarmHistory(records));
|
|
4263
|
+
console.log();
|
|
4264
|
+
|
|
4265
|
+
if (verbose && records.length > 0) {
|
|
4266
|
+
console.log("Details:");
|
|
4267
|
+
for (const record of records) {
|
|
4268
|
+
console.log(
|
|
4269
|
+
` ${record.epic_id}: ${record.epic_title} (${record.strategy})`,
|
|
4270
|
+
);
|
|
4271
|
+
console.log(
|
|
4272
|
+
` Tasks: ${record.completed_count}/${record.task_count}, Success: ${record.overall_success ? "✅" : "❌"}`,
|
|
4273
|
+
);
|
|
4274
|
+
}
|
|
4275
|
+
console.log();
|
|
4276
|
+
}
|
|
4277
|
+
|
|
4278
|
+
p.outro("History ready!");
|
|
4279
|
+
} catch (error) {
|
|
4280
|
+
p.log.error(error instanceof Error ? error.message : String(error));
|
|
4281
|
+
p.outro("Failed to load history");
|
|
4282
|
+
process.exit(1);
|
|
4283
|
+
}
|
|
4284
|
+
}
|
|
4285
|
+
|
|
4016
4286
|
// ============================================================================
|
|
4017
4287
|
// Eval Command
|
|
4018
4288
|
// ============================================================================
|
|
@@ -4220,6 +4490,62 @@ async function evalRun() {
|
|
|
4220
4490
|
}
|
|
4221
4491
|
}
|
|
4222
4492
|
|
|
4493
|
+
// ============================================================================
|
|
4494
|
+
// Serve Command - Start SSE Server
|
|
4495
|
+
// ============================================================================
|
|
4496
|
+
|
|
4497
|
+
async function serve() {
|
|
4498
|
+
p.intro("swarm serve v" + VERSION);
|
|
4499
|
+
|
|
4500
|
+
// Parse --port flag (default 3001)
|
|
4501
|
+
const portFlagIndex = process.argv.indexOf("--port");
|
|
4502
|
+
const port = portFlagIndex !== -1
|
|
4503
|
+
? Number.parseInt(process.argv[portFlagIndex + 1]) || 3001
|
|
4504
|
+
: 3001;
|
|
4505
|
+
|
|
4506
|
+
const projectPath = process.cwd();
|
|
4507
|
+
|
|
4508
|
+
p.log.step("Starting DurableStreamServer...");
|
|
4509
|
+
p.log.message(dim(` Project: ${projectPath}`));
|
|
4510
|
+
p.log.message(dim(` Port: ${port}`));
|
|
4511
|
+
|
|
4512
|
+
try {
|
|
4513
|
+
// Import dependencies
|
|
4514
|
+
const { getSwarmMailLibSQL } = await import("swarm-mail");
|
|
4515
|
+
const { createDurableStreamAdapter, createDurableStreamServer } = await import("swarm-mail");
|
|
4516
|
+
|
|
4517
|
+
// Get swarm-mail adapter
|
|
4518
|
+
const swarmMail = await getSwarmMailLibSQL(projectPath);
|
|
4519
|
+
|
|
4520
|
+
// Create stream adapter
|
|
4521
|
+
const streamAdapter = createDurableStreamAdapter(swarmMail, projectPath);
|
|
4522
|
+
|
|
4523
|
+
// Create and start server
|
|
4524
|
+
const server = createDurableStreamServer({
|
|
4525
|
+
adapter: streamAdapter,
|
|
4526
|
+
port,
|
|
4527
|
+
projectKey: projectPath,
|
|
4528
|
+
});
|
|
4529
|
+
|
|
4530
|
+
await server.start();
|
|
4531
|
+
|
|
4532
|
+
p.log.success("Server started!");
|
|
4533
|
+
p.log.message("");
|
|
4534
|
+
p.log.message(cyan(" Dashboard: http://localhost:5173"));
|
|
4535
|
+
p.log.message(cyan(` SSE Endpoint: ${server.url}/streams/${encodeURIComponent(projectPath)}`));
|
|
4536
|
+
p.log.message("");
|
|
4537
|
+
p.log.message(dim(" Press Ctrl+C to stop"));
|
|
4538
|
+
|
|
4539
|
+
// Keep process alive
|
|
4540
|
+
await new Promise(() => {});
|
|
4541
|
+
} catch (error) {
|
|
4542
|
+
p.log.error("Failed to start server");
|
|
4543
|
+
p.log.message(error instanceof Error ? error.message : String(error));
|
|
4544
|
+
p.outro("Aborted");
|
|
4545
|
+
process.exit(1);
|
|
4546
|
+
}
|
|
4547
|
+
}
|
|
4548
|
+
|
|
4223
4549
|
// ============================================================================
|
|
4224
4550
|
// Main
|
|
4225
4551
|
// ============================================================================
|
|
@@ -4242,6 +4568,9 @@ switch (command) {
|
|
|
4242
4568
|
case "config":
|
|
4243
4569
|
config();
|
|
4244
4570
|
break;
|
|
4571
|
+
case "serve":
|
|
4572
|
+
await serve();
|
|
4573
|
+
break;
|
|
4245
4574
|
case "update":
|
|
4246
4575
|
await update();
|
|
4247
4576
|
break;
|
|
@@ -4274,6 +4603,12 @@ switch (command) {
|
|
|
4274
4603
|
case "logs":
|
|
4275
4604
|
await logs();
|
|
4276
4605
|
break;
|
|
4606
|
+
case "stats":
|
|
4607
|
+
await stats();
|
|
4608
|
+
break;
|
|
4609
|
+
case "history":
|
|
4610
|
+
await swarmHistory();
|
|
4611
|
+
break;
|
|
4277
4612
|
case "eval":
|
|
4278
4613
|
await evalCommand();
|
|
4279
4614
|
break;
|
|
@@ -40,12 +40,14 @@
|
|
|
40
40
|
*
|
|
41
41
|
* Structure optimized for eval scores:
|
|
42
42
|
* 1. ASCII header (visual anchor, coordinatorIdentity scorer)
|
|
43
|
-
* 2.
|
|
44
|
-
* 3.
|
|
45
|
-
* 4.
|
|
46
|
-
* 5.
|
|
43
|
+
* 2. What Good Looks Like (behavioral examples, outcome-focused)
|
|
44
|
+
* 3. Immediate actions (actionable tool calls, postCompactionDiscipline scorer)
|
|
45
|
+
* 4. Forbidden tools (explicit list, forbiddenToolsPresent scorer)
|
|
46
|
+
* 5. Mandatory behaviors (inbox, skills, review)
|
|
47
|
+
* 6. Role & mandates (strong language, coordinatorIdentity scorer)
|
|
48
|
+
* 7. Reference sections (supporting material)
|
|
47
49
|
*/
|
|
48
|
-
export declare const SWARM_COMPACTION_CONTEXT = "\n\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 \u2502\n\u2502 \uD83D\uDC1D YOU ARE THE COORDINATOR \uD83D\uDC1D \u2502\n\u2502 \u2502\n\u2502 NOT A WORKER. NOT AN IMPLEMENTER. \u2502\n\u2502 YOU ORCHESTRATE. \u2502\n\u2502 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\nContext was compacted but the swarm is still running. **YOU ARE THE COORDINATOR.**\n\nYour role is ORCHESTRATION, not implementation. The resume steps above (if present) tell you exactly what to do first.\n\n---\n\n## \uD83D\uDEAB FORBIDDEN TOOLS (NEVER Use These Directly)\n\nCoordinators do NOT do implementation work. These tools are **FORBIDDEN**:\n\n### File Modification (ALWAYS spawn workers instead)\n- `Edit` - SPAWN A WORKER\n- `Write` - SPAWN A WORKER\n- `bash` (for file modifications) - SPAWN A WORKER\n- `swarmmail_reserve` - Workers reserve their own files\n- `git commit` - Workers commit their own changes\n\n### External Data Fetching (SPAWN A RESEARCHER instead)\n\n**Repository fetching:**\n- `repo-crawl_file`, `repo-crawl_readme`, `repo-crawl_search`, `repo-crawl_structure`, `repo-crawl_tree`\n- `repo-autopsy_*` (all repo-autopsy tools)\n\n**Web/documentation fetching:**\n- `webfetch`, `fetch_fetch`\n- `context7_resolve-library-id`, `context7_get-library-docs`\n\n**Knowledge base:**\n- `pdf-brain_search`, `pdf-brain_read`\n\n**Instead:** Use `swarm_spawn_researcher` with a clear research task. The researcher will fetch, summarize, and return findings.\n\n---\n\n## \uD83D\uDCBC YOUR ROLE (Non-Negotiable)\n\nYou are the **COORDINATOR**. Your job is ORCHESTRATION, not implementation.\n\n### What Coordinators Do:\n- \u2705 Spawn workers for implementation tasks\n- \u2705 Monitor worker progress via `swarm_status` and `swarmmail_inbox`\n- \u2705 Review completed work with `swarm_review`\n- \u2705 Unblock dependencies and resolve conflicts\n- \u2705 Close the loop when epics complete\n\n### What Coordinators NEVER Do:\n- \u274C **NEVER** edit or write files directly\n- \u274C **NEVER** run tests with `bash`\n- \u274C **NEVER** \"just do it myself to save time\"\n- \u274C **NEVER** reserve files (workers reserve)\n- \u274C **NEVER** fetch external data directly (spawn researchers)\n\n**If you catch yourself about to edit a file, STOP. Use `swarm_spawn_subtask` instead.**\n\n### Strong Mandates:\n- **ALWAYS** spawn workers for implementation tasks\n- **ALWAYS** check status and inbox before decisions\n- **ALWAYS** review worker output before accepting\n- **NON-NEGOTIABLE:** You orchestrate. You do NOT implement.\n\n---\n\n## \uD83D\uDCDD SUMMARY FORMAT (Preserve This State)\n\nWhen compaction occurs, extract and preserve this structure:\n\n```\n## \uD83D\uDC1D Swarm State\n\n**Epic:** CELL_ID - TITLE\n**Project:** PROJECT_PATH\n**Progress:** X/Y subtasks complete\n\n**Active:**\n- CELL_ID: TITLE [in_progress] \u2192 AGENT working on FILES\n\n**Blocked:**\n- CELL_ID: TITLE - BLOCKED: REASON\n\n**Completed:**\n- CELL_ID: TITLE \u2713\n\n**Ready to Spawn:**\n- CELL_ID: TITLE (files: FILES)\n```\n\n### What to Extract:\n1. **Epic & Subtasks** - IDs, titles, status, file assignments\n2. **What's Running** - Active agents and their current work\n3. **What's Blocked** - Blockers and what's needed to unblock\n4. **What's Done** - Completed work and follow-ups\n5. **What's Next** - Pending subtasks ready to spawn\n\n---\n\n## \uD83D\uDCCB REFERENCE: Full Coordinator Workflow\n\nYou are ALWAYS swarming. Use this workflow for any new work:\n\n### Phase 1.5: Research (For Complex Tasks)\n\nIf the task requires unfamiliar technologies, spawn a researcher FIRST:\n\n```\nswarm_spawn_researcher(\n research_id=\"research-TOPIC\",\n epic_id=\"mjkw...\", # your epic ID\n tech_stack=[\"TECHNOLOGY\"],\n project_path=\"PROJECT_PATH\"\n)\n// Then spawn with Task(subagent_type=\"swarm/researcher\", prompt=\"...\")\n```\n\n### Phase 2: Knowledge Gathering\n\n```\nsemantic-memory_find(query=\"TASK_KEYWORDS\", limit=5) # Past learnings\ncass_search(query=\"TASK_DESCRIPTION\", limit=5) # Similar past tasks\nskills_list() # Available skills\n```\n\n### Phase 3: Decompose\n\n```\nswarm_select_strategy(task=\"TASK\")\nswarm_plan_prompt(task=\"TASK\", context=\"KNOWLEDGE\")\nswarm_validate_decomposition(response=\"CELLTREE_JSON\")\n```\n\n### Phase 4: Create Cells\n\n`hive_create_epic(epic_title=\"TASK\", subtasks=[...])`\n\n### Phase 5: File Reservations\n\n> **\u26A0\uFE0F Coordinator NEVER reserves files.** Workers reserve their own files with `swarmmail_reserve`.\n\n### Phase 6: Spawn Workers\n\n```\nswarm_spawn_subtask(bead_id, epic_id, title, files, shared_context, project_path)\nTask(subagent_type=\"swarm/worker\", prompt=\"GENERATED_PROMPT\")\n```\n\n### Phase 7: Review Loop (MANDATORY)\n\n**AFTER EVERY Task() RETURNS:**\n\n1. `swarmmail_inbox()` - Check for messages\n2. `swarm_review(project_key, epic_id, task_id, files_touched)` - Generate review\n3. Evaluate against epic goals\n4. `swarm_review_feedback(project_key, task_id, worker_id, status, issues)`\n\n**If needs_changes:**\n```\nswarm_spawn_retry(bead_id, epic_id, original_prompt, attempt, issues, diff, files, project_path)\n// Spawn NEW worker with Task() using retry prompt\n// Max 3 attempts before marking task blocked\n```\n\n### Phase 8: Complete\n\n`hive_sync()` - Sync all cells to git\n\n---\n\n## \uD83D\uDCCA REFERENCE: Decomposition Strategies\n\n| Strategy | Best For | Keywords |\n| -------------- | ------------------------ | -------------------------------------- |\n| file-based | Refactoring, migrations | refactor, migrate, rename, update all |\n| feature-based | New features | add, implement, build, create, feature |\n| risk-based | Bug fixes, security | fix, bug, security, critical, urgent |\n\n---\n\n**You are the COORDINATOR. You orchestrate. You do NOT implement. Spawn workers.**\n";
|
|
50
|
+
export declare const SWARM_COMPACTION_CONTEXT = "\n\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 \u2502\n\u2502 \uD83D\uDC1D YOU ARE THE COORDINATOR \uD83D\uDC1D \u2502\n\u2502 \u2502\n\u2502 NOT A WORKER. NOT AN IMPLEMENTER. \u2502\n\u2502 YOU ORCHESTRATE. \u2502\n\u2502 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\nContext was compacted but the swarm is still running. **YOU ARE THE COORDINATOR.**\n\nYour role is ORCHESTRATION, not implementation. The resume steps above (if present) tell you exactly what to do first.\n\n---\n\n## \uD83C\uDFAF WHAT GOOD LOOKS LIKE (Behavioral Examples)\n\n**\u2705 GOOD Coordinator Behavior:**\n- Spawned researcher for unfamiliar tech \u2192 got summary \u2192 stored in semantic-memory\n- Loaded `skills_use(name=\"testing-patterns\")` BEFORE spawning test workers\n- Checked `swarmmail_inbox()` every 5-10 minutes \u2192 caught blocked worker \u2192 unblocked in 2min\n- Delegated planning to swarm/planner subagent \u2192 main context stayed clean\n- Workers reserved their OWN files \u2192 no conflicts\n- Reviewed all worker output with `swarm_review` \u2192 caught integration issue before merge\n\n**\u274C COMMON MISTAKES (Avoid These):**\n- Called context7/pdf-brain directly \u2192 dumped 50KB into thread \u2192 context exhaustion\n- Skipped skill loading \u2192 workers reinvented patterns already in skills\n- Never checked inbox \u2192 worker stuck 25 minutes \u2192 silent failure\n- Reserved files as coordinator \u2192 workers blocked \u2192 swarm stalled\n- Closed cells when workers said \"done\" \u2192 skipped review \u2192 shipped broken code\n\n---\n\n## \uD83D\uDEAB FORBIDDEN TOOLS (NEVER Use These Directly)\n\nCoordinators do NOT do implementation work. These tools are **FORBIDDEN**:\n\n### File Modification (ALWAYS spawn workers instead)\n- `Edit` - SPAWN A WORKER\n- `Write` - SPAWN A WORKER\n- `bash` (for file modifications) - SPAWN A WORKER\n- `swarmmail_reserve` - Workers reserve their own files\n- `git commit` - Workers commit their own changes\n\n### External Data Fetching (SPAWN A RESEARCHER instead)\n\n**Repository fetching:**\n- `repo-crawl_file`, `repo-crawl_readme`, `repo-crawl_search`, `repo-crawl_structure`, `repo-crawl_tree`\n- `repo-autopsy_*` (all repo-autopsy tools)\n\n**Web/documentation fetching:**\n- `webfetch`, `fetch_fetch`\n- `context7_resolve-library-id`, `context7_get-library-docs`\n\n**Knowledge base:**\n- `pdf-brain_search`, `pdf-brain_read`\n\n**Instead:** Use `swarm_spawn_researcher` with a clear research task. The researcher will fetch, summarize, and return findings.\n\n---\n\n## \uD83D\uDCBC YOUR ROLE (Non-Negotiable)\n\nYou are the **COORDINATOR**. Your job is ORCHESTRATION, not implementation.\n\n### What Coordinators Do:\n- \u2705 Spawn workers for implementation tasks\n- \u2705 Monitor worker progress via `swarm_status` and `swarmmail_inbox`\n- \u2705 Review completed work with `swarm_review`\n- \u2705 Unblock dependencies and resolve conflicts\n- \u2705 Close the loop when epics complete\n\n### What Coordinators NEVER Do:\n- \u274C **NEVER** edit or write files directly\n- \u274C **NEVER** run tests with `bash`\n- \u274C **NEVER** \"just do it myself to save time\"\n- \u274C **NEVER** reserve files (workers reserve)\n- \u274C **NEVER** fetch external data directly (spawn researchers)\n\n**If you catch yourself about to edit a file, STOP. Use `swarm_spawn_subtask` instead.**\n\n### Strong Mandates:\n- **ALWAYS** spawn workers for implementation tasks\n- **ALWAYS** check status and inbox before decisions\n- **ALWAYS** review worker output before accepting\n- **NON-NEGOTIABLE:** You orchestrate. You do NOT implement.\n\n---\n\n## \uD83D\uDCCB MANDATORY BEHAVIORS (Post-Compaction Checklist)\n\n### 1. Inbox Monitoring (EVERY 5-10 MINUTES)\n```\nswarmmail_inbox(limit=5) # Check for messages\nswarmmail_read_message(message_id=N) # Read urgent ones\nswarm_status(epic_id, project_key) # Overall progress\n```\n**Intervention triggers:** Worker blocked >5min, file conflict, scope creep\n\n### 2. Skill Loading (BEFORE spawning workers)\n```\nskills_use(name=\"swarm-coordination\") # ALWAYS for swarms\nskills_use(name=\"testing-patterns\") # If task involves tests\nskills_use(name=\"system-design\") # If architectural decisions\n```\n**Include skill recommendations in shared_context for workers.**\n\n### 3. Worker Review (AFTER EVERY worker returns)\n```\nswarm_review(project_key, epic_id, task_id, files_touched)\n# Evaluate: Does it fulfill requirements? Enable downstream tasks? Type safe?\nswarm_review_feedback(project_key, task_id, worker_id, status, issues)\n```\n**3-Strike Rule:** After 3 rejections \u2192 mark blocked \u2192 escalate to human.\n\n### 4. Research Spawning (For unfamiliar tech)\n```\nTask(subagent_type=\"swarm-researcher\", prompt=\"Research <topic>...\")\n```\n**NEVER call context7, pdf-brain, webfetch directly.** Spawn a researcher.\n\n---\n\n## \uD83D\uDCDD SUMMARY FORMAT (Preserve This State)\n\nWhen compaction occurs, extract and preserve this structure:\n\n```\n## \uD83D\uDC1D Swarm State\n\n**Epic:** CELL_ID - TITLE\n**Project:** PROJECT_PATH\n**Progress:** X/Y subtasks complete\n\n**Active:**\n- CELL_ID: TITLE [in_progress] \u2192 AGENT working on FILES\n\n**Blocked:**\n- CELL_ID: TITLE - BLOCKED: REASON\n\n**Completed:**\n- CELL_ID: TITLE \u2713\n\n**Ready to Spawn:**\n- CELL_ID: TITLE (files: FILES)\n```\n\n### What to Extract:\n1. **Epic & Subtasks** - IDs, titles, status, file assignments\n2. **What's Running** - Active agents and their current work\n3. **What's Blocked** - Blockers and what's needed to unblock\n4. **What's Done** - Completed work and follow-ups\n5. **What's Next** - Pending subtasks ready to spawn\n\n---\n\n## \uD83D\uDCCB REFERENCE: Full Coordinator Workflow\n\nYou are ALWAYS swarming. Use this workflow for any new work:\n\n### Phase 1.5: Research (For Complex Tasks)\n\nIf the task requires unfamiliar technologies, spawn a researcher FIRST:\n\n```\nswarm_spawn_researcher(\n research_id=\"research-TOPIC\",\n epic_id=\"mjkw...\", # your epic ID\n tech_stack=[\"TECHNOLOGY\"],\n project_path=\"PROJECT_PATH\"\n)\n// Then spawn with Task(subagent_type=\"swarm/researcher\", prompt=\"...\")\n```\n\n### Phase 2: Knowledge Gathering\n\n```\nsemantic-memory_find(query=\"TASK_KEYWORDS\", limit=5) # Past learnings\ncass_search(query=\"TASK_DESCRIPTION\", limit=5) # Similar past tasks\nskills_list() # Available skills\n```\n\n### Phase 3: Decompose\n\n```\nswarm_select_strategy(task=\"TASK\")\nswarm_plan_prompt(task=\"TASK\", context=\"KNOWLEDGE\")\nswarm_validate_decomposition(response=\"CELLTREE_JSON\")\n```\n\n### Phase 4: Create Cells\n\n`hive_create_epic(epic_title=\"TASK\", subtasks=[...])`\n\n### Phase 5: File Reservations\n\n> **\u26A0\uFE0F Coordinator NEVER reserves files.** Workers reserve their own files with `swarmmail_reserve`.\n\n### Phase 6: Spawn Workers\n\n```\nswarm_spawn_subtask(bead_id, epic_id, title, files, shared_context, project_path)\nTask(subagent_type=\"swarm/worker\", prompt=\"GENERATED_PROMPT\")\n```\n\n### Phase 7: Review Loop (MANDATORY)\n\n**AFTER EVERY Task() RETURNS:**\n\n1. `swarmmail_inbox()` - Check for messages\n2. `swarm_review(project_key, epic_id, task_id, files_touched)` - Generate review\n3. Evaluate against epic goals\n4. `swarm_review_feedback(project_key, task_id, worker_id, status, issues)`\n\n**If needs_changes:**\n```\nswarm_spawn_retry(bead_id, epic_id, original_prompt, attempt, issues, diff, files, project_path)\n// Spawn NEW worker with Task() using retry prompt\n// Max 3 attempts before marking task blocked\n```\n\n### Phase 8: Complete\n\n`hive_sync()` - Sync all cells to git\n\n---\n\n## \uD83D\uDCCA REFERENCE: Decomposition Strategies\n\n| Strategy | Best For | Keywords |\n| -------------- | ------------------------ | -------------------------------------- |\n| file-based | Refactoring, migrations | refactor, migrate, rename, update all |\n| feature-based | New features | add, implement, build, create, feature |\n| risk-based | Bug fixes, security | fix, bug, security, critical, urgent |\n\n---\n\n**You are the COORDINATOR. You orchestrate. You do NOT implement. Spawn workers.**\n";
|
|
49
51
|
/**
|
|
50
52
|
* Fallback detection prompt - tells the compactor what to look for
|
|
51
53
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compaction-hook.d.ts","sourceRoot":"","sources":["../src/compaction-hook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAwCH
|
|
1
|
+
{"version":3,"file":"compaction-hook.d.ts","sourceRoot":"","sources":["../src/compaction-hook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;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
100
|
* 3. swarmmail_reserve (only workers reserve)
|
|
101
101
|
* 4. git commit (workers commit)
|
|
102
|
+
* 5. bash (for file modifications)
|
|
102
103
|
*
|
|
103
104
|
* @returns ratio of forbidden tools mentioned (0.0 to 1.0)
|
|
104
105
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compaction-prompt-scoring.d.ts","sourceRoot":"","sources":["../src/compaction-prompt-scoring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,OAAO,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CAChB;AAID,iEAAiE;AACjE,eAAO,MAAM,YAAY,QAAqB,CAAC;AAE/C,0CAA0C;AAC1C,eAAO,MAAM,YAAY,UAKxB,CAAC;AAEF,yDAAyD;AACzD,eAAO,MAAM,SAAS,QAAiB,CAAC;AAExC,sCAAsC;AACtC,eAAO,MAAM,eAAe,UAAoD,CAAC;AAIjF;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,GAAG,YAAY,CAuB7E;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,GAAG,YAAY,CA+BzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,gBAAgB,GACtB,YAAY,CA6Bd;AAED
|
|
1
|
+
{"version":3,"file":"compaction-prompt-scoring.d.ts","sourceRoot":"","sources":["../src/compaction-prompt-scoring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,OAAO,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CAChB;AAID,iEAAiE;AACjE,eAAO,MAAM,YAAY,QAAqB,CAAC;AAE/C,0CAA0C;AAC1C,eAAO,MAAM,YAAY,UAKxB,CAAC;AAEF,yDAAyD;AACzD,eAAO,MAAM,SAAS,QAAiB,CAAC;AAExC,sCAAsC;AACtC,eAAO,MAAM,eAAe,UAAoD,CAAC;AAIjF;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,GAAG,YAAY,CAuB7E;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,GAAG,YAAY,CA+BzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,gBAAgB,GACtB,YAAY,CA6Bd;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CACzC,MAAM,EAAE,gBAAgB,GACtB,YAAY,CAkCd;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,6BAA6B,CAC5C,MAAM,EAAE,gBAAgB,GACtB,YAAY,CAiCd"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Programmatic Evalite Runner
|
|
3
|
+
*
|
|
4
|
+
* Provides a type-safe API for running evalite evals programmatically.
|
|
5
|
+
* Wraps evalite's runEvalite function with structured result parsing.
|
|
6
|
+
*
|
|
7
|
+
* @module eval-runner
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Options for running evals programmatically
|
|
11
|
+
*/
|
|
12
|
+
export interface RunEvalsOptions {
|
|
13
|
+
/**
|
|
14
|
+
* Working directory containing eval files (defaults to process.cwd())
|
|
15
|
+
*/
|
|
16
|
+
cwd?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Optional filter to run specific eval suites (e.g., "coordinator", "compaction")
|
|
19
|
+
* Matches against eval file paths using substring matching
|
|
20
|
+
*/
|
|
21
|
+
suiteFilter?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Minimum average score threshold (0-100)
|
|
24
|
+
* If average score falls below this, result.success will be false
|
|
25
|
+
*/
|
|
26
|
+
scoreThreshold?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Optional path to write raw evalite JSON output
|
|
29
|
+
*/
|
|
30
|
+
outputPath?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Structured suite result with scores
|
|
34
|
+
*/
|
|
35
|
+
export interface SuiteResult {
|
|
36
|
+
/** Suite name from evalite() call */
|
|
37
|
+
name: string;
|
|
38
|
+
/** Absolute path to eval file */
|
|
39
|
+
filepath: string;
|
|
40
|
+
/** Suite status: success, fail, or running */
|
|
41
|
+
status: "success" | "fail" | "running";
|
|
42
|
+
/** Total duration in milliseconds */
|
|
43
|
+
duration: number;
|
|
44
|
+
/** Average score across all evals in suite (0-1 scale) */
|
|
45
|
+
averageScore: number;
|
|
46
|
+
/** Number of evals in this suite */
|
|
47
|
+
evalCount: number;
|
|
48
|
+
/** Individual eval results (optional, can be large) */
|
|
49
|
+
evals?: Array<{
|
|
50
|
+
input: unknown;
|
|
51
|
+
output: unknown;
|
|
52
|
+
expected?: unknown;
|
|
53
|
+
scores: Array<{
|
|
54
|
+
name: string;
|
|
55
|
+
score: number;
|
|
56
|
+
description?: string;
|
|
57
|
+
}>;
|
|
58
|
+
}>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Structured result from running evals
|
|
62
|
+
*/
|
|
63
|
+
export interface RunEvalsResult {
|
|
64
|
+
/** Whether the run succeeded (all evals passed threshold) */
|
|
65
|
+
success: boolean;
|
|
66
|
+
/** Total number of suites executed */
|
|
67
|
+
totalSuites: number;
|
|
68
|
+
/** Total number of individual evals executed */
|
|
69
|
+
totalEvals: number;
|
|
70
|
+
/** Average score across all suites (0-1 scale) */
|
|
71
|
+
averageScore: number;
|
|
72
|
+
/** Individual suite results */
|
|
73
|
+
suites: SuiteResult[];
|
|
74
|
+
/** Error message if run failed */
|
|
75
|
+
error?: string;
|
|
76
|
+
/** Gate check results per suite */
|
|
77
|
+
gateResults?: Array<{
|
|
78
|
+
suite: string;
|
|
79
|
+
passed: boolean;
|
|
80
|
+
phase: string;
|
|
81
|
+
message: string;
|
|
82
|
+
baseline?: number;
|
|
83
|
+
currentScore: number;
|
|
84
|
+
regressionPercent?: number;
|
|
85
|
+
}>;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Run evalite evals programmatically
|
|
89
|
+
*
|
|
90
|
+
* @param options - Configuration for eval run
|
|
91
|
+
* @returns Structured results with scores per suite
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* // Run all evals
|
|
96
|
+
* const result = await runEvals({ cwd: "/path/to/project" });
|
|
97
|
+
* console.log(`Average score: ${result.averageScore}`);
|
|
98
|
+
*
|
|
99
|
+
* // Run specific suite
|
|
100
|
+
* const coordResult = await runEvals({
|
|
101
|
+
* cwd: "/path/to/project",
|
|
102
|
+
* suiteFilter: "coordinator"
|
|
103
|
+
* });
|
|
104
|
+
*
|
|
105
|
+
* // Enforce score threshold
|
|
106
|
+
* const gatedResult = await runEvals({
|
|
107
|
+
* cwd: "/path/to/project",
|
|
108
|
+
* scoreThreshold: 80
|
|
109
|
+
* });
|
|
110
|
+
* if (!gatedResult.success) {
|
|
111
|
+
* throw new Error(`Evals failed threshold: ${gatedResult.averageScore}`);
|
|
112
|
+
* }
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
export declare function runEvals(options?: RunEvalsOptions): Promise<RunEvalsResult>;
|
|
116
|
+
/**
|
|
117
|
+
* All eval tools exported for registration
|
|
118
|
+
*/
|
|
119
|
+
export declare const evalTools: {
|
|
120
|
+
readonly eval_run: {
|
|
121
|
+
description: string;
|
|
122
|
+
args: {
|
|
123
|
+
suiteFilter: import("zod").ZodOptional<import("zod").ZodString>;
|
|
124
|
+
scoreThreshold: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
125
|
+
includeDetailedResults: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
126
|
+
};
|
|
127
|
+
execute(args: {
|
|
128
|
+
suiteFilter?: string | undefined;
|
|
129
|
+
scoreThreshold?: number | undefined;
|
|
130
|
+
includeDetailedResults?: boolean | undefined;
|
|
131
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
//# sourceMappingURL=eval-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval-runner.d.ts","sourceRoot":"","sources":["../src/eval-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAaH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IAEb,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;IAEjB,8CAA8C;IAC9C,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;IAEvC,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAC;IAEjB,0DAA0D;IAC1D,YAAY,EAAE,MAAM,CAAC;IAErB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAElB,uDAAuD;IACvD,KAAK,CAAC,EAAE,KAAK,CAAC;QACZ,KAAK,EAAE,OAAO,CAAC;QACf,MAAM,EAAE,OAAO,CAAC;QAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,MA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EG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;CAMtB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;CAMvB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;CAMtB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;CAMtB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;;;;CAMtB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;CAMrB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;CAM5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUtB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -147,6 +147,9 @@ export declare const allTools: {
|
|
|
147
147
|
tags: import("zod").ZodOptional<import("zod").ZodString>;
|
|
148
148
|
metadata: import("zod").ZodOptional<import("zod").ZodString>;
|
|
149
149
|
confidence: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
150
|
+
autoTag: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
151
|
+
autoLink: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
152
|
+
extractEntities: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
150
153
|
};
|
|
151
154
|
execute(args: {
|
|
152
155
|
information: string;
|
|
@@ -154,6 +157,9 @@ export declare const allTools: {
|
|
|
154
157
|
tags?: string | undefined;
|
|
155
158
|
metadata?: string | undefined;
|
|
156
159
|
confidence?: number | undefined;
|
|
160
|
+
autoTag?: boolean | undefined;
|
|
161
|
+
autoLink?: boolean | undefined;
|
|
162
|
+
extractEntities?: boolean | undefined;
|
|
157
163
|
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
158
164
|
};
|
|
159
165
|
readonly "semantic-memory_find": {
|
|
@@ -219,6 +225,29 @@ export declare const allTools: {
|
|
|
219
225
|
args: {};
|
|
220
226
|
execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
221
227
|
};
|
|
228
|
+
readonly "semantic-memory_upsert": {
|
|
229
|
+
description: string;
|
|
230
|
+
args: {
|
|
231
|
+
information: import("zod").ZodString;
|
|
232
|
+
collection: import("zod").ZodOptional<import("zod").ZodString>;
|
|
233
|
+
tags: import("zod").ZodOptional<import("zod").ZodString>;
|
|
234
|
+
metadata: import("zod").ZodOptional<import("zod").ZodString>;
|
|
235
|
+
confidence: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
236
|
+
autoTag: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
237
|
+
autoLink: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
238
|
+
extractEntities: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
239
|
+
};
|
|
240
|
+
execute(args: {
|
|
241
|
+
information: string;
|
|
242
|
+
collection?: string | undefined;
|
|
243
|
+
tags?: string | undefined;
|
|
244
|
+
metadata?: string | undefined;
|
|
245
|
+
confidence?: number | undefined;
|
|
246
|
+
autoTag?: boolean | undefined;
|
|
247
|
+
autoLink?: boolean | undefined;
|
|
248
|
+
extractEntities?: boolean | undefined;
|
|
249
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
250
|
+
};
|
|
222
251
|
readonly mandate_file: {
|
|
223
252
|
description: string;
|
|
224
253
|
args: {
|