@yemi33/minions 0.1.312 → 0.1.313

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.313 (2026-04-03)
4
+
5
+ ### Other
6
+ - perf: CC message handling — debounce localStorage, cap array, batch scroll
7
+
3
8
  ## 0.1.312 (2026-04-03)
4
9
 
5
10
  ### Fixes
@@ -72,13 +72,20 @@ function ccRestoreMessages() {
72
72
  } catch {}
73
73
  }
74
74
 
75
+ let _ccSaveDebounce = null;
75
76
  function ccSaveState() {
76
- try {
77
- if (_ccSessionId) localStorage.setItem('cc-session-id', _ccSessionId);
78
- // Keep last 30 messages for display
79
- const toSave = _ccMessages.slice(-30);
80
- localStorage.setItem('cc-messages', JSON.stringify(toSave));
81
- } catch { /* localStorage might be full */ }
77
+ // Trim in-memory array to prevent unbounded growth
78
+ if (_ccMessages.length > 100) _ccMessages = _ccMessages.slice(-100);
79
+ // Debounce localStorage writes no need to serialize on every message during streaming
80
+ if (_ccSaveDebounce) return;
81
+ _ccSaveDebounce = setTimeout(() => {
82
+ _ccSaveDebounce = null;
83
+ try {
84
+ if (_ccSessionId) localStorage.setItem('cc-session-id', _ccSessionId);
85
+ const toSave = _ccMessages.slice(-30);
86
+ localStorage.setItem('cc-messages', JSON.stringify(toSave));
87
+ } catch { /* localStorage might be full */ }
88
+ }, 500);
82
89
  }
83
90
 
84
91
  function ccUpdateSessionIndicator() {
@@ -104,7 +111,7 @@ function ccAddMessage(role, html, skipSave) {
104
111
  (isUser ? 'background:var(--blue);color:#fff;align-self:flex-end' : 'background:var(--surface2);color:var(--text);align-self:flex-start;border:1px solid var(--border);position:relative');
105
112
  div.innerHTML = (isAssistant && !html.includes('color:var(--red)') && !html.includes('cc-queued-pill') ? llmCopyBtn() : '') + html;
106
113
  el.appendChild(div);
107
- el.scrollTop = el.scrollHeight;
114
+ requestAnimationFrame(() => { el.scrollTop = el.scrollHeight; });
108
115
  if (!skipSave) {
109
116
  _ccMessages.push({ role, html });
110
117
  ccSaveState();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.312",
3
+ "version": "0.1.313",
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"