@volter/supercode-terminal 0.2.35 → 0.2.36
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/index.mjs +10 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1456,7 +1456,8 @@ const COMPOSER_READY = Object.freeze({
|
|
|
1456
1456
|
// question here: not "is there a caret" but "is it waiting for a first
|
|
1457
1457
|
// message". A composer already holding a draft does not show it.
|
|
1458
1458
|
codex: (screen) => screen.includes('› Ask Codex to do anything'),
|
|
1459
|
-
|
|
1459
|
+
// Claude draws `❯`, or on Windows `>` and a no-break space (captured from a ConPTY pane on volter-desktop).
|
|
1460
|
+
'claude-code': (screen) => composerLine(screen, /^[❯>](?:\s|$)/u),
|
|
1460
1461
|
// gemini draws its idle input caret as a bare ASCII `>` opening a line. The
|
|
1461
1462
|
// pattern is transcribed from substrate/session-lifecycle.js's isGeminiIdle,
|
|
1462
1463
|
// which derived it from real `gemini` captures, rather than invented here.
|
|
@@ -1511,14 +1512,15 @@ export function composerReadyForInput(kind, screen) {
|
|
|
1511
1512
|
* The caret is the kind's own, the one `composerReadyForInput` reads.
|
|
1512
1513
|
*/
|
|
1513
1514
|
export function composerHoldsDraft(kind, screen) {
|
|
1514
|
-
const
|
|
1515
|
-
if (!
|
|
1515
|
+
const carets = COMPOSER_CARETS[kind];
|
|
1516
|
+
if (!carets) return null;
|
|
1516
1517
|
const lines = String(screen ?? '').split('\n');
|
|
1517
1518
|
for (let index = lines.length - 1; index >= 0; index -= 1) {
|
|
1518
1519
|
const cells = styledCells(lines[index]);
|
|
1519
1520
|
const text = cells.map((cell) => cell.char).join('');
|
|
1520
1521
|
const start = text.length - text.trimStart().length;
|
|
1521
|
-
|
|
1522
|
+
const caret = carets.find((candidate) => text.trimStart().startsWith(candidate));
|
|
1523
|
+
if (!caret) continue;
|
|
1522
1524
|
const typed = cells
|
|
1523
1525
|
.slice(start + caret.length)
|
|
1524
1526
|
.filter((cell) => !cell.placeholder)
|
|
@@ -1526,13 +1528,15 @@ export function composerHoldsDraft(kind, screen) {
|
|
|
1526
1528
|
.join('')
|
|
1527
1529
|
.trim();
|
|
1528
1530
|
if (kind === 'codex' && typed.startsWith('Ask Codex to do anything')) return false;
|
|
1531
|
+
// Claude's own suggestion (`Try "fix typecheck errors"`), when the capture carries no styling to mark it dim.
|
|
1532
|
+
if (kind === 'claude-code' && /^Try ".*"$/u.test(typed)) return false;
|
|
1529
1533
|
return typed.length > 0;
|
|
1530
1534
|
}
|
|
1531
1535
|
return null;
|
|
1532
1536
|
}
|
|
1533
1537
|
|
|
1534
|
-
/** The
|
|
1535
|
-
const COMPOSER_CARETS = Object.freeze({ 'claude-code': '❯', codex: '›', gemini: '>', grok: '❯' });
|
|
1538
|
+
/** The carets each kind draws at the start of its composer line (Claude on Windows draws `>`). */
|
|
1539
|
+
const COMPOSER_CARETS = Object.freeze({ 'claude-code': ['❯', '>'], codex: ['›'], gemini: ['>'], grok: ['❯'] });
|
|
1536
1540
|
|
|
1537
1541
|
/**
|
|
1538
1542
|
* The visible characters of one captured line, each marked as placeholder
|