@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 CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.111 (2026-04-01)
4
+
5
+ ### Dashboard
6
+ - dashboard.js
7
+
3
8
  ## 0.1.110 (2026-04-01)
4
9
 
5
10
  ### Dashboard
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 prompt = `You are a knowledge base curator. Analyze these ${manifest.length} knowledge base entries and produce a cleanup plan.
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
- ${manifest.map((m, i) => `<entry index="${i}" category="${m.category}" file="${m.file}" date="${m.date}" agent="${m.agent || 'unknown'}">
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, 1500)}
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 or insights (same findings from different agents or dispatch runs). List pairs/groups by index. When choosing which to keep, prefer the more recent entry (later date) as it likely reflects the current state of the codebase.
1468
-
1469
- 2. **Find misclassified**: entries in the wrong category. Common: build reports in conventions, reviews in architecture.
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
- 3. **Find stale/empty**: entries with no actionable content (boilerplate, "no changes needed", bail-out notes).
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
- If nothing to do, return: { "duplicates": [], "reclassify": [], "remove": [] }`;
1490
-
1491
- const { callLLM, trackEngineUsage } = require('./engine/llm');
1492
- const result = await callLLM(prompt, 'You are a concise knowledge curator. Output only JSON.', {
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
- let plan;
1498
- try {
1499
- let jsonStr = result.text.trim();
1500
- const fenceMatch = jsonStr.match(/```(?:json)?\s*([\s\S]*?)```/);
1501
- if (fenceMatch) jsonStr = fenceMatch[1].trim();
1502
- plan = JSON.parse(jsonStr);
1503
- } catch {
1504
- return jsonReply(res, 200, { ok: false, error: 'LLM returned invalid JSON', raw: result.text.slice(0, 500) });
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.110",
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"