@yemi33/minions 0.1.733 → 0.1.734

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,8 +1,9 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.733 (2026-04-09)
3
+ ## 0.1.734 (2026-04-09)
4
4
 
5
5
  ### Fixes
6
+ - prevent sync from overwriting pins during in-flight write
6
7
  - merge localStorage pins to server on migration, always sync cache
7
8
 
8
9
  ## 0.1.732 (2026-04-09)
@@ -18,13 +18,15 @@ function getPinnedItems() {
18
18
  return _pinsCache;
19
19
  }
20
20
  function isPinned(key) { return getPinnedItems().includes(key); }
21
+ var _pinWriteInFlight = false;
21
22
  function togglePin(key) {
22
23
  const pins = getPinnedItems();
23
24
  const idx = pins.indexOf(key);
24
25
  if (idx >= 0) pins.splice(idx, 1); else pins.unshift(key);
25
26
  _pinsCache = pins;
26
- // Persist to server (fire-and-forget)
27
- fetch('/api/kb-pins', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ pins }) }).catch(function() {});
27
+ _pinWriteInFlight = true;
28
+ fetch('/api/kb-pins', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ pins }) })
29
+ .finally(function() { _pinWriteInFlight = false; });
28
30
  return idx < 0; // true if now pinned
29
31
  }
30
32
  function _syncPinsFromServer() {
@@ -45,7 +47,7 @@ function _syncPinsFromServer() {
45
47
  }
46
48
  localStorage.removeItem('minions-pinned-items');
47
49
  }
48
- _pinsCache = serverPins;
50
+ if (!_pinWriteInFlight) _pinsCache = serverPins;
49
51
  }).catch(function() {});
50
52
  }
51
53
  function inboxPinKey(name) { return 'notes/inbox/' + name; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.733",
3
+ "version": "0.1.734",
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"