traderclaw-cli 1.0.110 → 1.0.111

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.
@@ -3596,7 +3596,10 @@ async function cmdInstall(args) {
3596
3596
 
3597
3597
  /** Guided Codex OAuth sessions keyed by sessionId. */
3598
3598
  const oauthSessions = new Map();
3599
- const OPENAI_OAUTH_AUTHORIZE_RE = /https:\/\/auth\.openai\.com\/oauth\/authorize\S*/;
3599
+ // Matches the OAuth authorize URL from OpenClaw's output.
3600
+ // The \S+ (non-whitespace) tail captures the full query string; see trySendUrl()
3601
+ // for why we run this against a stripAnsi+CR-stripped copy of the output.
3602
+ const OPENAI_OAUTH_AUTHORIZE_RE = /https:\/\/auth\.openai\.com\/(?:oauth\/authorize|authorize)[^\s"]*/;
3600
3603
  const oauthSessionTtlMs = 15 * 60 * 1000;
3601
3604
 
3602
3605
  // Long-lived callback proxy on port 1455. Bound at wizard startup so
@@ -3837,12 +3840,20 @@ async function cmdInstall(args) {
3837
3840
  message:
3838
3841
  "OpenClaw did not provide a ChatGPT sign-in URL in time. Try again.",
3839
3842
  });
3840
- }, 45_000);
3843
+ }, 75_000);
3841
3844
 
3842
3845
  const trySendUrl = () => {
3843
3846
  if (responded) return;
3844
- const m = combined.match(OPENAI_OAUTH_AUTHORIZE_RE);
3847
+ // Strip ANSI escape codes and carriage returns before matching.
3848
+ // Newer OpenClaw uses rich terminal output (spinners, colors) and PTY
3849
+ // column-wrapping inserts \r\n in the middle of long OAuth URLs, causing
3850
+ // the regex to fail on the raw byte stream. Clean first, then match.
3851
+ const cleanedForUrl = stripAnsi(combined).replace(/\r/g, "");
3852
+ const m = cleanedForUrl.match(OPENAI_OAUTH_AUTHORIZE_RE);
3845
3853
  if (!m || !m[0]) return;
3854
+ // Strip any trailing ANSI remnants that slipped through (e.g. \x1b[0m appended by colour reset)
3855
+ const authUrl = m[0].replace(/\x1b[^a-zA-Z]*[a-zA-Z]?$/g, "").trim();
3856
+ if (!authUrl.startsWith("https://")) return;
3846
3857
  clearTimeout(urlTimeout);
3847
3858
  responded = true;
3848
3859
  oauthSessions.set(sessionId, {
@@ -3850,13 +3861,13 @@ async function cmdInstall(args) {
3850
3861
  createdAt: Date.now(),
3851
3862
  updatedAt: Date.now(),
3852
3863
  status: "awaiting_browser_callback",
3853
- authUrl: m[0],
3864
+ authUrl,
3854
3865
  message: "Sign in in this same browser. OpenClaw is waiting for callback...",
3855
3866
  detail: "",
3856
3867
  exitCode: null,
3857
3868
  submitted: false,
3858
3869
  });
3859
- respondJson(200, { ok: true, sessionId, authUrl: m[0] });
3870
+ respondJson(200, { ok: true, sessionId, authUrl });
3860
3871
  };
3861
3872
 
3862
3873
  child.stdout?.on("data", (d) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "traderclaw-cli",
3
- "version": "1.0.110",
3
+ "version": "1.0.111",
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.110"
20
+ "solana-traderclaw": "^1.0.111"
21
21
  },
22
22
  "keywords": [
23
23
  "traderclaw",