dual-brain 0.1.20 → 0.1.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 +17 -12
- package/package.json +1 -1
package/bin/dual-brain.mjs
CHANGED
|
@@ -1483,7 +1483,7 @@ function detectInterruptedWork(sessions, cwd) {
|
|
|
1483
1483
|
* Shows: "● Claude ● OpenAI ⚖️ Balanced"
|
|
1484
1484
|
* Uses ANSI color codes for the dots — no dollar amounts or usage bars.
|
|
1485
1485
|
*/
|
|
1486
|
-
function buildProviderStatusLine(profile, auth) {
|
|
1486
|
+
function buildProviderStatusLine(profile, auth, maxWidth = 54) {
|
|
1487
1487
|
const GREEN = '[32m●[0m';
|
|
1488
1488
|
const RED = '[31m●[0m';
|
|
1489
1489
|
|
|
@@ -1499,18 +1499,27 @@ function buildProviderStatusLine(profile, auth) {
|
|
|
1499
1499
|
'solo-openai': '⚡ Fast',
|
|
1500
1500
|
};
|
|
1501
1501
|
const WORK_STYLE_TIPS = {
|
|
1502
|
-
'auto': 'adapts routing
|
|
1503
|
-
'cost-saver': '
|
|
1504
|
-
'balanced': 'smart routing, reviews
|
|
1505
|
-
'quality-first': 'dual-brain
|
|
1502
|
+
'auto': 'adapts routing by task risk',
|
|
1503
|
+
'cost-saver': 'single model, minimal reviews',
|
|
1504
|
+
'balanced': 'smart routing, reviews when needed',
|
|
1505
|
+
'quality-first': 'dual-brain on everything important',
|
|
1506
1506
|
'solo-claude': 'Claude only, no GPT dispatch',
|
|
1507
1507
|
'solo-openai': 'OpenAI only, no Claude dispatch',
|
|
1508
1508
|
};
|
|
1509
1509
|
const bias = profile?.bias || profile?.mode || 'balanced';
|
|
1510
1510
|
const label = WORK_STYLE_LABELS[bias] || '⚖️ Balanced';
|
|
1511
|
-
const
|
|
1511
|
+
const fullTip = WORK_STYLE_TIPS[bias] || 'smart routing, reviews when needed';
|
|
1512
|
+
|
|
1513
|
+
// Trim tip to fit within box width (measure visible chars: strip ANSI + variation selectors)
|
|
1514
|
+
const labelPlain = label.replace(/[︀-️]/g, '').replace(/[[0-9;]*m/g, '');
|
|
1515
|
+
const prefixLen = ('● Claude ● OpenAI ' + labelPlain + ' — ').length;
|
|
1516
|
+
const tipMax = maxWidth - prefixLen;
|
|
1517
|
+
const tip = tipMax >= 6
|
|
1518
|
+
? (fullTip.length > tipMax ? fullTip.slice(0, tipMax - 1) + '…' : fullTip)
|
|
1519
|
+
: '';
|
|
1512
1520
|
|
|
1513
|
-
|
|
1521
|
+
const suffix = tip ? `[2m — ${tip}[0m` : '';
|
|
1522
|
+
return `${claudeDot} Claude ${openaiDot} OpenAI ${label}${suffix}`;
|
|
1514
1523
|
}
|
|
1515
1524
|
|
|
1516
1525
|
/**
|
|
@@ -1698,7 +1707,7 @@ async function mainScreen(rl, ask) {
|
|
|
1698
1707
|
}
|
|
1699
1708
|
|
|
1700
1709
|
// ── Status section ────────────────────────────────────────────────────────
|
|
1701
|
-
const providerLine = buildProviderStatusLine(profile, auth);
|
|
1710
|
+
const providerLine = buildProviderStatusLine(profile, auth, W);
|
|
1702
1711
|
|
|
1703
1712
|
const statusRows = [row(providerLine)];
|
|
1704
1713
|
if (dtVersion) {
|
|
@@ -1796,10 +1805,6 @@ async function mainScreen(rl, ask) {
|
|
|
1796
1805
|
badges.push('\x1b[32m[active]\x1b[0m');
|
|
1797
1806
|
badgeVisible.push('[active]'.length);
|
|
1798
1807
|
}
|
|
1799
|
-
if (sess.source === 'replit-tools' || sess.source === 'data-tools') {
|
|
1800
|
-
badges.push('\x1b[36m[dt]\x1b[0m');
|
|
1801
|
-
badgeVisible.push('[dt]'.length);
|
|
1802
|
-
}
|
|
1803
1808
|
const ageMs = sess.lastActive ? Date.now() - new Date(sess.lastActive).getTime() : 0;
|
|
1804
1809
|
if (ageMs > 7 * 24 * 3600 * 1000) {
|
|
1805
1810
|
badges.push('\x1b[2m[stale]\x1b[0m');
|
package/package.json
CHANGED