arisa 2.3.5 → 2.3.6
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/package.json +1 -1
- package/src/daemon/setup.ts +6 -3
package/package.json
CHANGED
package/src/daemon/setup.ts
CHANGED
|
@@ -261,6 +261,7 @@ async function runInteractiveLogin(cli: AgentCliName, vars: Record<string, strin
|
|
|
261
261
|
stdin: "inherit",
|
|
262
262
|
stdout: "pipe",
|
|
263
263
|
stderr: "inherit",
|
|
264
|
+
env: { ...process.env, COLUMNS: "500" },
|
|
264
265
|
});
|
|
265
266
|
|
|
266
267
|
let output = "";
|
|
@@ -276,10 +277,12 @@ async function runInteractiveLogin(cli: AgentCliName, vars: Record<string, strin
|
|
|
276
277
|
|
|
277
278
|
const exitCode = await proc.exited;
|
|
278
279
|
if (exitCode === 0) {
|
|
279
|
-
//
|
|
280
|
-
|
|
280
|
+
// Strip ANSI escape codes, then extract token
|
|
281
|
+
// COLUMNS=500 prevents wrapping, but handle it as fallback
|
|
282
|
+
const clean = output.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, "");
|
|
283
|
+
const tokenMatch = clean.match(/sk-ant-[A-Za-z0-9_-]+(?:\s*\n\s*[A-Za-z0-9_-]+)*/);
|
|
281
284
|
if (tokenMatch) {
|
|
282
|
-
vars.CLAUDE_CODE_OAUTH_TOKEN = tokenMatch[0].replace(/\
|
|
285
|
+
vars.CLAUDE_CODE_OAUTH_TOKEN = tokenMatch[0].replace(/\s+/g, "");
|
|
283
286
|
saveEnv(vars);
|
|
284
287
|
console.log(" ✓ claude token saved to .env");
|
|
285
288
|
}
|