@yemi33/minions 0.1.732 → 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 +6 -0
- package/dashboard/js/utils.js +19 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dashboard/js/utils.js
CHANGED
|
@@ -18,22 +18,36 @@ 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
|
-
|
|
27
|
-
fetch('/api/kb-pins', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ pins }) })
|
|
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() {
|
|
31
33
|
fetch('/api/kb-pins').then(function(r) { return r.json(); }).then(function(d) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
var serverPins = Array.isArray(d.pins) ? d.pins : [];
|
|
35
|
+
// Migrate: merge localStorage pins into server if not already there
|
|
36
|
+
var localPins = [];
|
|
37
|
+
try { localPins = JSON.parse(localStorage.getItem('minions-pinned-items') || '[]'); } catch {}
|
|
38
|
+
if (localPins.length > 0) {
|
|
39
|
+
var merged = serverPins.slice();
|
|
40
|
+
var changed = false;
|
|
41
|
+
for (var i = 0; i < localPins.length; i++) {
|
|
42
|
+
if (merged.indexOf(localPins[i]) < 0) { merged.unshift(localPins[i]); changed = true; }
|
|
43
|
+
}
|
|
44
|
+
if (changed) {
|
|
45
|
+
fetch('/api/kb-pins', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ pins: merged }) }).catch(function() {});
|
|
46
|
+
serverPins = merged;
|
|
47
|
+
}
|
|
35
48
|
localStorage.removeItem('minions-pinned-items');
|
|
36
49
|
}
|
|
50
|
+
if (!_pinWriteInFlight) _pinsCache = serverPins;
|
|
37
51
|
}).catch(function() {});
|
|
38
52
|
}
|
|
39
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.
|
|
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"
|