arisa 2.3.40 → 2.3.41
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 +14 -4
package/package.json
CHANGED
package/src/daemon/setup.ts
CHANGED
|
@@ -356,17 +356,27 @@ async function runInteractiveLogin(cli: AgentCliName, vars: Record<string, strin
|
|
|
356
356
|
// `claude setup-token` prints a long-lived (1 year) token but does NOT
|
|
357
357
|
// store it. Extract from captured output and save to .env.
|
|
358
358
|
if (isClaudeSetupToken) {
|
|
359
|
-
//
|
|
359
|
+
// Token lines are purely [A-Za-z0-9_-] with no spaces.
|
|
360
|
+
// Stop collecting when we hit a line with spaces (e.g. "Store this token...")
|
|
360
361
|
const idx = output.indexOf("sk-ant-");
|
|
361
362
|
if (idx >= 0) {
|
|
362
|
-
const
|
|
363
|
-
|
|
363
|
+
const lines = output.substring(idx).split("\n");
|
|
364
|
+
let token = "";
|
|
365
|
+
for (const line of lines) {
|
|
366
|
+
const trimmed = line.trim();
|
|
367
|
+
if (trimmed && /^[A-Za-z0-9_-]+$/.test(trimmed)) {
|
|
368
|
+
token += trimmed;
|
|
369
|
+
} else {
|
|
370
|
+
break;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
if (token.startsWith("sk-ant-") && token.length > 80) {
|
|
364
374
|
vars.CLAUDE_CODE_OAUTH_TOKEN = token;
|
|
365
375
|
process.env.CLAUDE_CODE_OAUTH_TOKEN = token;
|
|
366
376
|
saveEnv(vars);
|
|
367
377
|
console.log(` ✓ token saved to .env (${token.length} chars)`);
|
|
368
378
|
} else {
|
|
369
|
-
console.log(` ⚠ token looks
|
|
379
|
+
console.log(` ⚠ token looks invalid (${token.length} chars) — set CLAUDE_CODE_OAUTH_TOKEN manually in ~/.arisa/.env`);
|
|
370
380
|
}
|
|
371
381
|
} else {
|
|
372
382
|
console.log(" ⚠ could not find token in output — set CLAUDE_CODE_OAUTH_TOKEN manually in ~/.arisa/.env");
|