traderclaw-cli 1.0.113 → 1.0.115

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.
@@ -1840,11 +1840,18 @@ export function spawnOpenClawCodexAuthLoginChild() {
1840
1840
  return spawn("unbuffer", ["openclaw", ...argv], { stdio: ["pipe", "pipe", "pipe"], shell: false });
1841
1841
  }
1842
1842
  if (commandExists("script")) {
1843
- const cmdline = "openclaw models auth login --provider openai-codex";
1844
- // --return propagates the inner command's exit code (util-linux 2.38+).
1845
- // Without it, script may exit 0 even if openclaw fails.
1846
- return spawn("script", ["--return", "-q", "-c", cmdline, "/dev/null"], {
1843
+ // stty cols 32767: set an extremely wide PTY column so OpenClaw/Clack never
1844
+ // wraps the OAuth URL across lines (default PTY width when spawned via pipe is 80).
1845
+ // A wrapped URL causes the wizard's regex to only capture the first segment.
1846
+ // --return propagates openclaw's exit code (util-linux 2.38+).
1847
+ // -f/--flush: force immediate forwarding of each PTY write to the pipe so the
1848
+ // wizard sees the URL as soon as OpenClaw prints it (default is block-buffered).
1849
+ const cmdline = "stty cols 32767 rows 50 2>/dev/null; openclaw models auth login --provider openai-codex";
1850
+ return spawn("script", ["--return", "-f", "-q", "-c", cmdline, "/dev/null"], {
1847
1851
  stdio: ["pipe", "pipe", "pipe"],
1852
+ // COLUMNS/LINES: belt-and-suspenders env fallback for programs that read env
1853
+ // instead of ioctl(TIOCGWINSZ) to determine terminal dimensions.
1854
+ env: { ...process.env, COLUMNS: "32767", LINES: "50" },
1848
1855
  shell: false,
1849
1856
  });
1850
1857
  }
@@ -3869,19 +3869,29 @@ async function cmdInstall(args) {
3869
3869
  message:
3870
3870
  "OpenClaw did not provide a ChatGPT sign-in URL in time. Try again.",
3871
3871
  });
3872
- }, 75_000);
3872
+ }, 120_000);
3873
3873
 
3874
3874
  const trySendUrl = () => {
3875
3875
  if (responded) return;
3876
- // Strip ANSI escape codes and carriage returns before matching.
3877
- // Newer OpenClaw uses rich terminal output (spinners, colors) and PTY
3878
- // column-wrapping inserts \r\n in the middle of long OAuth URLs, causing
3879
- // the regex to fail on the raw byte stream. Clean first, then match.
3880
- const cleanedForUrl = stripAnsi(combined).replace(/\r/g, "");
3881
- const m = cleanedForUrl.match(OPENAI_OAUTH_AUTHORIZE_RE);
3876
+ // Layer 1: strip ANSI codes and carriage returns, then join any URL continuation
3877
+ // lines caused by PTY column-wrapping (e.g. at 80-col default). When the URL is
3878
+ // split across lines the [^\s] tail of the regex stops at the newline and only the
3879
+ // first fragment is captured. Removing newlines that are sandwiched between URL-safe
3880
+ // characters reconnects all fragments before matching.
3881
+ const cleanedForUrl = stripAnsi(combined)
3882
+ .replace(/\r/g, "")
3883
+ .replace(/([A-Za-z0-9%&=+?#:/@._~!$'()*,;-])\n([A-Za-z0-9%&=+?#:/@._~!$'()*,;-])/g, "$1$2");
3884
+ let m = cleanedForUrl.match(OPENAI_OAUTH_AUTHORIZE_RE);
3885
+ // Layer 2: try the raw combined buffer in case stripAnsi dropped a character that
3886
+ // broke the URL detection (raw ANSI seqs don't include space so regex still works).
3887
+ if (!m || !m[0]) {
3888
+ const rawCleaned = combined.replace(/\r/g, "")
3889
+ .replace(/([A-Za-z0-9%&=+?#:/@._~!$'()*,;-])\n([A-Za-z0-9%&=+?#:/@._~!$'()*,;-])/g, "$1$2");
3890
+ m = rawCleaned.match(OPENAI_OAUTH_AUTHORIZE_RE);
3891
+ }
3882
3892
  if (!m || !m[0]) return;
3883
- // Strip any trailing ANSI remnants that slipped through (e.g. \x1b[0m appended by colour reset)
3884
- const authUrl = m[0].replace(/\x1b[^a-zA-Z]*[a-zA-Z]?$/g, "").trim();
3893
+ // Strip any trailing ANSI remnants (e.g. \x1b[0m appended by colour reset)
3894
+ const authUrl = stripAnsi(m[0]).replace(/\r/g, "").trim();
3885
3895
  if (!authUrl.startsWith("https://")) return;
3886
3896
  clearTimeout(urlTimeout);
3887
3897
  responded = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "traderclaw-cli",
3
- "version": "1.0.113",
3
+ "version": "1.0.115",
4
4
  "description": "Global TraderClaw CLI (install --wizard, setup, precheck). Installs solana-traderclaw as a dependency for OpenClaw plugin files.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -17,7 +17,7 @@
17
17
  "node": ">=22"
18
18
  },
19
19
  "dependencies": {
20
- "solana-traderclaw": "^1.0.113"
20
+ "solana-traderclaw": "^1.0.115"
21
21
  },
22
22
  "keywords": [
23
23
  "traderclaw",