@yemi33/minions 0.1.1644 → 0.1.1645

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.1645 (2026-04-30)
4
+
5
+ ### Other
6
+ - test(queries): add unit tests for timeSince, readHeadTail, detectInFlightTool, getInboxFiles (#1903)
7
+
3
8
  ## 0.1.1644 (2026-04-30)
4
9
 
5
10
  ### Fixes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "runtime": "copilot",
3
3
  "models": null,
4
- "cachedAt": "2026-04-30T21:06:17.577Z"
4
+ "cachedAt": "2026-04-30T21:17:34.210Z"
5
5
  }
package/engine/queries.js CHANGED
@@ -49,7 +49,7 @@ function readHeadTail(filePath, bytes = 1024) {
49
49
  * Returns { description, taskId } for the most recent in-flight tool, or null.
50
50
  */
51
51
  function detectInFlightTool(tail) {
52
- if (!tail) return null;
52
+ if (typeof tail !== 'string' || !tail) return null;
53
53
  const lines = tail.split('\n');
54
54
  const completed = new Set();
55
55
 
@@ -92,10 +92,12 @@ const NOTES_PATH = path.join(MINIONS_DIR, 'notes.md');
92
92
  // ── Helpers ─────────────────────────────────────────────────────────────────
93
93
 
94
94
  function timeSince(ms) {
95
- const s = Math.floor((Date.now() - ms) / 1000);
95
+ if (typeof ms !== 'number' || !Number.isFinite(ms)) return 'unknown';
96
+ const s = Math.floor(Math.max(0, Date.now() - ms) / 1000);
96
97
  if (s < 60) return `${s}s ago`;
97
98
  if (s < 3600) return `${Math.floor(s / 60)}m ago`;
98
- return `${Math.floor(s / 3600)}h ago`;
99
+ if (s < 86400) return `${Math.floor(s / 3600)}h ago`;
100
+ return `${Math.floor(s / 86400)}d ago`;
99
101
  }
100
102
 
101
103
  function readJsonNoRestore(filePath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.1644",
3
+ "version": "0.1.1645",
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"