arisa 2.3.40 → 2.3.42

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arisa",
3
- "version": "2.3.40",
3
+ "version": "2.3.42",
4
4
  "description": "Arisa - dynamic agent runtime with daemon/core architecture that evolves through user interaction",
5
5
  "keywords": [
6
6
  "tinyclaw",
@@ -328,7 +328,7 @@ async function runInteractiveLogin(cli: AgentCliName, vars: Record<string, strin
328
328
  stdin: "inherit",
329
329
  stdout: isClaudeSetupToken ? "pipe" : "inherit",
330
330
  stderr: "inherit",
331
- env: isClaudeSetupToken ? { ...process.env, FORCE_COLOR: "1" } : undefined,
331
+ env: isClaudeSetupToken ? { ...process.env, NO_COLOR: "1" } : undefined,
332
332
  });
333
333
 
334
334
  let output = "";
@@ -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
- // Grab everything from "sk-ant-" onwards, strip whitespace, extract full token
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 token = output.substring(idx).split(/\n\n/)[0].replace(/\s+/g, "");
363
- if (token.length > 80) {
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 short (${token.length} chars) — set CLAUDE_CODE_OAUTH_TOKEN manually in ~/.arisa/.env`);
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");