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.
- package/bin/dual-brain.mjs +24 -14
- package/package.json +1 -1
package/bin/dual-brain.mjs
CHANGED
|
@@ -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(/[
|
|
2759
|
-
if (plainAware1)
|
|
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
|
-
|
|
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 =
|
|
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
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
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(
|
|
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