@volter/supercode-terminal 0.2.64 → 0.2.66

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/index.mjs +9 -1
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1723,9 +1723,15 @@ const COMPOSER_READY = Object.freeze({
1723
1723
  * and anchoring on column 0 instead would read a drawn-in prompt as absent.
1724
1724
  */
1725
1725
  function composerLine(screen, caret) {
1726
- return screen.split('\n').some((line) => caret.test(line.trim()));
1726
+ // Read as text: a capture keeps its escapes (the daemon's readiness wait reads one), and Grok draws its composer
1727
+ // line after a reset (`ESC[0m❯`), so a caret test on the raw line never matched and Grok never read as ready
1728
+ // (yuerans, 2026-10-06: `open --new grok --input` dropped its brief; mail to an idle Grok waited for ever).
1729
+ return screen.split('\n').some((line) => caret.test(line.replace(ANSI_SEQUENCE, '').trim()));
1727
1730
  }
1728
1731
 
1732
+ /** A terminal escape sequence: CSI (`ESC[…x`), OSC (`ESC]…BEL` or `ESC]…ESC\\`), or a two-character escape. */
1733
+ const ANSI_SEQUENCE = /\u001b\[[0-?]*[ -\/]*[@-~]|\u001b\][^\u0007\u001b]*(?:\u0007|\u001b\\)|\u001b[@-Z\\-_]/gu;
1734
+
1729
1735
  /**
1730
1736
  * Is the program of this kind showing its idle composer — ready to be given a
1731
1737
  * first message — on this captured screen?
@@ -1744,6 +1750,8 @@ function composerLine(screen, caret) {
1744
1750
  export function composerReadyForInput(kind, screen) {
1745
1751
  if (!Object.hasOwn(COMPOSER_READY, kind)) return null;
1746
1752
  if (kind === 'claude-code' || kind === 'codex') return composerText(kind, screen) === '';
1753
+ // gemini and grok: their composer is drawn, which is all a caret line says. A draft already typed in it is not
1754
+ // read (no composerText for them), so for these two `true` means a composer present, not an empty one.
1747
1755
  return COMPOSER_READY[kind](String(screen ?? ''));
1748
1756
  }
1749
1757
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-terminal",
3
- "version": "0.2.64",
3
+ "version": "0.2.66",
4
4
  "type": "module",
5
5
  "description": "Optional leak-safe terminal and tmux host adapter for Volter Harness frontends",
6
6
  "exports": {