dual-brain 0.2.20 → 0.2.21

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.
Files changed (2) hide show
  1. package/bin/dual-brain.mjs +24 -14
  2. package/package.json +1 -1
@@ -2755,18 +2755,23 @@ async function mainScreen(rl, ask) {
2755
2755
  const recentWorkItems = [];
2756
2756
  // Add awareness observations as recent work if meaningful
2757
2757
  if (awarenessLine1 && !awarenessLine1.includes('Ready to work')) {
2758
- const plainAware1 = awarenessLine1.replace(/\x1b\[[0-9;]*m/g, '').replace(/[︀-️]/g, '').trim();
2759
- if (plainAware1) recentWorkItems.push({ ok: !plainAware1.startsWith('⚠') && !plainAware1.startsWith('🔴'), text: plainAware1.replace(/^[🔴🟡💡]\s*/, '') });
2758
+ const plainAware1 = awarenessLine1.replace(/\x1b\[[0-9;]*m/g, '').replace(/[︀-️‍]/g, '').trim();
2759
+ if (plainAware1) {
2760
+ const isWarning = /uncommitted|stale|failure|expired|old|⚠/.test(plainAware1);
2761
+ recentWorkItems.push({ ok: !isWarning, text: plainAware1.replace(/^[🔴🟡💡⚠]\s*/, '') });
2762
+ }
2760
2763
  }
2761
2764
  // Add last commit as a recent work item
2762
2765
  if (gitLastMsg) {
2763
- recentWorkItems.push({ ok: true, text: `${gitLastMsg} (${gitLastAgo})` });
2766
+ const isStale = /\d+d ago|\d{2,}h ago/.test(gitLastAgo);
2767
+ recentWorkItems.push({ ok: !isStale, text: `${gitLastMsg} (${gitLastAgo})` });
2764
2768
  }
2765
2769
  // Fill from sessions if still room
2766
2770
  if (recentWorkItems.length < 3 && recentSessions.length > 0) {
2767
2771
  const sess = recentSessions[0];
2768
2772
  let rawName = sess.name || '';
2769
- if (/^Session [0-9a-f]{8,}$/i.test(rawName)) rawName = sess.id.slice(0, 8);
2773
+ if (/^Session [0-9a-f]{8,}$/i.test(rawName)) rawName = '';
2774
+ if (/^[0-9a-f]{6,}$/i.test(rawName)) rawName = '';
2770
2775
  if (rawName) recentWorkItems.push({ ok: true, text: rawName.slice(0, 50) });
2771
2776
  }
2772
2777
 
@@ -2921,17 +2926,22 @@ async function mainScreen(rl, ask) {
2921
2926
  }
2922
2927
 
2923
2928
  // Shortcut bar — always visible so the user never has to guess
2924
- const autoLabel = profile.automode ? `\x1b[32m⚡auto\x1b[0m` : `${DIM}auto${RST}`;
2925
- const shortcutItems = [
2926
- `${CYAN}Enter${RST} resume`,
2927
- `${CYAN}n${RST} new`,
2928
- `${CYAN}/${RST} search`,
2929
- `${CYAN}s${RST} settings`,
2930
- `${CYAN}d${RST} doctor`,
2931
- autoLabel,
2932
- `${CYAN}q${RST} quit`,
2929
+ const shortcuts = [
2930
+ [`Enter`, isReturning ? 'resume last session' : 'start working'],
2931
+ [`n`, 'new session'],
2932
+ [`/`, 'search sessions'],
2933
+ [`s`, 'settings & profiles'],
2934
+ [`d`, 'doctor (diagnose issues)'],
2935
+ [`a`, profile.automode ? 'auto mode ⚡ on' : 'auto mode'],
2936
+ [`q`, 'quit'],
2933
2937
  ];
2934
- process.stdout.write(` ${DIM}${shortcutItems.join(' ')}${RST}\n\n`);
2938
+ process.stdout.write('\n');
2939
+ for (const [key, label] of shortcuts) {
2940
+ const keyStr = key === 'Enter' ? `${CYAN}Enter${RST}` : ` ${CYAN}${key}${RST} `;
2941
+ const padded = key === 'Enter' ? ' ' : ' ';
2942
+ process.stdout.write(` ${keyStr}${padded}${DIM}${label}${RST}\n`);
2943
+ }
2944
+ process.stdout.write('\n');
2935
2945
 
2936
2946
  // Input bar — rendered below shortcut bar
2937
2947
  const inputLeft = tuiPrompt('task or command...');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dual-brain",
3
- "version": "0.2.20",
3
+ "version": "0.2.21",
4
4
  "description": "AI orchestration across Claude + OpenAI subscriptions — smart routing, budget awareness, and dual-brain collaboration",
5
5
  "type": "module",
6
6
  "bin": {