@yemi33/minions 0.1.633 → 0.1.635

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,10 +1,18 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.633 (2026-04-08)
3
+ ## 0.1.635 (2026-04-08)
4
+
5
+ ### Other
6
+ - perf: extend caches, skip doc re-send on session resume
7
+
8
+ ## 0.1.634 (2026-04-08)
4
9
 
5
10
  ### Fixes
6
11
  - spread pending mutations into dispatch meta.item snapshot
7
12
 
13
+ ### Other
14
+ - simplify: remove unused hasOutput variable in plan-to-prd check
15
+
8
16
  ## 0.1.632 (2026-04-08)
9
17
 
10
18
  ### Features
package/dashboard.js CHANGED
@@ -548,7 +548,7 @@ const _ccPromptHash = require('crypto').createHash('md5').update(CC_STATIC_SYSTE
548
548
 
549
549
  let _preambleCache = null;
550
550
  let _preambleCacheTs = 0;
551
- const PREAMBLE_TTL = 10000; // 10ssame as status cache
551
+ const PREAMBLE_TTL = 30000; // 30slonger TTL since preamble is lightweight orientation, not real-time data
552
552
 
553
553
  function buildCCStatePreamble() {
554
554
  const now = Date.now();
@@ -676,6 +676,7 @@ function updateSession(store, key, sessionId, existing) {
676
676
  sessionId,
677
677
  lastActiveAt: now,
678
678
  turnCount: (existing && prev ? prev.turnCount : 0) + 1,
679
+ _docHash: prev?._docHash || null,
679
680
  });
680
681
  persistDocSessions();
681
682
  }
@@ -772,15 +773,32 @@ async function ccCall(message, { store = 'cc', sessionKey, extraContext, label =
772
773
 
773
774
  // Doc-specific wrapper — adds document context, parses ---DOCUMENT---
774
775
  async function ccDocCall({ message, document, title, filePath, selection, canEdit, isJson, model }) {
775
- const docContext = `## Document Context\n**${title || 'Document'}**${filePath ? ' (`' + filePath + '`)' : ''}${isJson ? ' (JSON)' : ''}\n${selection ? '\n**Selected text:**\n> ' + selection.slice(0, 1500) + '\n' : ''}\n\`\`\`\n${document.slice(0, 20000)}\n\`\`\`\n${canEdit ? '\nIf editing: respond with your explanation, then `---DOCUMENT---` on its own line, then the COMPLETE updated file.' : '\n(Read-only — answer questions only.)'}`;
776
-
777
- // Session key: filePath is stable and unique; title is the fallback for read-only Q&A
778
776
  const sessionKey = filePath || title;
777
+ const docSlice = document.slice(0, 20000);
778
+
779
+ // Skip re-sending full document on session resume if content unchanged
780
+ const docHash = require('crypto').createHash('md5').update(docSlice).digest('hex').slice(0, 8);
781
+ const existing = resolveSession('doc', sessionKey);
782
+ const docUnchanged = existing?.sessionId && existing._docHash === docHash;
783
+
784
+ let docContext;
785
+ if (docUnchanged) {
786
+ // Session has the document — only send selection and edit instructions
787
+ docContext = `## Document: ${title || 'Document'}${filePath ? ' (`' + filePath + '`)' : ''}${selection ? '\n**Selected text:**\n> ' + selection.slice(0, 1500) : ''}${canEdit ? '\nIf editing: respond with your explanation, then `---DOCUMENT---` on its own line, then the COMPLETE updated file.' : ''}`;
788
+ } else {
789
+ docContext = `## Document Context\n**${title || 'Document'}**${filePath ? ' (`' + filePath + '`)' : ''}${isJson ? ' (JSON)' : ''}\n${selection ? '\n**Selected text:**\n> ' + selection.slice(0, 1500) + '\n' : ''}\n\`\`\`\n${docSlice}\n\`\`\`\n${canEdit ? '\nIf editing: respond with your explanation, then `---DOCUMENT---` on its own line, then the COMPLETE updated file.' : '\n(Read-only — answer questions only.)'}`;
790
+ }
791
+
779
792
  const result = await ccCall(message, {
780
793
  store: 'doc', sessionKey,
781
794
  extraContext: docContext, label: 'doc-chat',
782
795
  ...(model ? { model } : {}),
783
796
  });
797
+ // Store doc hash for next call's unchanged check
798
+ if (result.code === 0 && result.sessionId) {
799
+ const session = resolveSession('doc', sessionKey);
800
+ if (session) session._docHash = docHash;
801
+ }
784
802
 
785
803
  if (result.code !== 0 || !result.text) {
786
804
  console.error(`[doc-chat] Failed: code=${result.code}, empty=${!result.text}, filePath=${filePath}, stderr=${(result.stderr || '').slice(0, 200)}`);
@@ -1367,7 +1367,6 @@ async function runPostCompletionHooks(dispatchItem, agentId, code, stdout, confi
1367
1367
  } catch {}
1368
1368
  }
1369
1369
  if (!prdFound) {
1370
- const hasOutput = stdout && stdout.length > 500;
1371
1370
  const wiPath = resolveWorkItemPath(meta);
1372
1371
  if (wiPath) {
1373
1372
  mutateJsonFileLocked(wiPath, data => {
package/engine/llm.js CHANGED
@@ -50,7 +50,7 @@ function trackEngineUsage(category, usage) {
50
50
 
51
51
  let _claudeBinCache = null;
52
52
  let _claudeBinCacheTs = 0;
53
- const _CLAUDE_BIN_TTL = 300000; // 5 min — re-validate binary exists periodically
53
+ const _CLAUDE_BIN_TTL = 1800000; // 30 min — binary path rarely changes during a session
54
54
  function _resolveClaudeBin() {
55
55
  if (_claudeBinCache && Date.now() - _claudeBinCacheTs < _CLAUDE_BIN_TTL) return _claudeBinCache;
56
56
  _claudeBinCache = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.633",
3
+ "version": "0.1.635",
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"