@yemi33/minions 0.1.110 → 0.1.111
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/CHANGELOG.md +5 -0
- package/dashboard.js +36 -38
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dashboard.js
CHANGED
|
@@ -1453,55 +1453,53 @@ const server = http.createServer(async (req, res) => {
|
|
|
1453
1453
|
manifest.push({ category: e.cat, file: e.file, title: e.title, agent: e.agent, date: e.date, content: content.slice(0, 3000) });
|
|
1454
1454
|
}
|
|
1455
1455
|
|
|
1456
|
-
const
|
|
1456
|
+
const { callLLM, trackEngineUsage } = require('./engine/llm');
|
|
1457
|
+
const BATCH_SIZE = 80; // ~80 entries per batch to stay within Haiku context
|
|
1458
|
+
const batches = [];
|
|
1459
|
+
for (let i = 0; i < manifest.length; i += BATCH_SIZE) {
|
|
1460
|
+
batches.push(manifest.slice(i, i + BATCH_SIZE));
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
const plan = { duplicates: [], reclassify: [], remove: [] };
|
|
1464
|
+
for (let b = 0; b < batches.length; b++) {
|
|
1465
|
+
const batch = batches[b];
|
|
1466
|
+
const offset = b * BATCH_SIZE;
|
|
1467
|
+
const prompt = `You are a knowledge base curator. Analyze these ${batch.length} entries (batch ${b + 1}/${batches.length}, indices ${offset}-${offset + batch.length - 1}) and produce a cleanup plan.
|
|
1457
1468
|
|
|
1458
1469
|
## Entries
|
|
1459
1470
|
|
|
1460
|
-
${
|
|
1471
|
+
${batch.map((m, i) => `<entry index="${offset + i}" category="${m.category}" file="${m.file}" date="${m.date}" agent="${m.agent || 'unknown'}">
|
|
1461
1472
|
${m.title}
|
|
1462
|
-
${m.content.slice(0,
|
|
1473
|
+
${m.content.slice(0, 800)}
|
|
1463
1474
|
</entry>`).join('\n\n')}
|
|
1464
1475
|
|
|
1465
1476
|
## Instructions
|
|
1466
1477
|
|
|
1467
|
-
1. **Find duplicates**: entries with substantially the same content
|
|
1468
|
-
|
|
1469
|
-
|
|
1478
|
+
1. **Find duplicates**: entries with substantially the same content (same findings, different agents/runs). List pairs by index. Prefer keeping the more recent entry.
|
|
1479
|
+
2. **Find misclassified**: entries in the wrong category.
|
|
1480
|
+
3. **Find stale/empty**: entries with no actionable content (boilerplate, bail-out notes, "no changes needed").
|
|
1470
1481
|
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
## Output Format
|
|
1474
|
-
|
|
1475
|
-
Respond with ONLY valid JSON (no markdown fences, no preamble):
|
|
1476
|
-
|
|
1477
|
-
{
|
|
1478
|
-
"duplicates": [
|
|
1479
|
-
{ "keep": 0, "remove": [1, 5], "reason": "same PR review findings" }
|
|
1480
|
-
],
|
|
1481
|
-
"reclassify": [
|
|
1482
|
-
{ "index": 3, "from": "conventions", "to": "build-reports", "reason": "..." }
|
|
1483
|
-
],
|
|
1484
|
-
"remove": [
|
|
1485
|
-
{ "index": 7, "reason": "empty bail-out note" }
|
|
1486
|
-
]
|
|
1487
|
-
}
|
|
1482
|
+
Respond with ONLY valid JSON: { "duplicates": [{ "keep": N, "remove": [N], "reason": "..." }], "reclassify": [{ "index": N, "from": "cat", "to": "cat", "reason": "..." }], "remove": [{ "index": N, "reason": "..." }] }
|
|
1483
|
+
If nothing to do: { "duplicates": [], "reclassify": [], "remove": [] }`;
|
|
1488
1484
|
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
timeout: 180000, label: 'kb-sweep', model: 'haiku', maxTurns: 1
|
|
1494
|
-
});
|
|
1495
|
-
trackEngineUsage('kb-sweep', result.usage);
|
|
1485
|
+
const result = await callLLM(prompt, 'Output only JSON.', {
|
|
1486
|
+
timeout: 120000, label: 'kb-sweep', model: 'haiku', maxTurns: 1
|
|
1487
|
+
});
|
|
1488
|
+
trackEngineUsage('kb-sweep', result.usage);
|
|
1496
1489
|
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1490
|
+
let batchPlan;
|
|
1491
|
+
try {
|
|
1492
|
+
let jsonStr = (result.text || '').trim();
|
|
1493
|
+
const fenceMatch = jsonStr.match(/```(?:json)?\s*([\s\S]*?)```/);
|
|
1494
|
+
if (fenceMatch) jsonStr = fenceMatch[1].trim();
|
|
1495
|
+
batchPlan = JSON.parse(jsonStr);
|
|
1496
|
+
} catch {
|
|
1497
|
+
console.log(`[kb-sweep] batch ${b + 1}/${batches.length} returned invalid JSON, skipping`);
|
|
1498
|
+
continue;
|
|
1499
|
+
}
|
|
1500
|
+
if (batchPlan.duplicates) plan.duplicates.push(...batchPlan.duplicates);
|
|
1501
|
+
if (batchPlan.reclassify) plan.reclassify.push(...batchPlan.reclassify);
|
|
1502
|
+
if (batchPlan.remove) plan.remove.push(...batchPlan.remove);
|
|
1505
1503
|
}
|
|
1506
1504
|
|
|
1507
1505
|
let removed = 0, reclassified = 0, merged = 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yemi33/minions",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.111",
|
|
4
4
|
"description": "Multi-agent AI dev team that runs from ~/.minions/ — five autonomous agents share a single engine, dashboard, and knowledge base",
|
|
5
5
|
"bin": {
|
|
6
6
|
"minions": "bin/minions.js"
|