arisa 2.3.42 → 2.3.44

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/daemon/setup.ts +18 -45
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arisa",
3
- "version": "2.3.42",
3
+ "version": "2.3.44",
4
4
  "description": "Arisa - dynamic agent runtime with daemon/core architecture that evolves through user interaction",
5
5
  "keywords": [
6
6
  "tinyclaw",
@@ -320,30 +320,12 @@ async function runInteractiveLogin(cli: AgentCliName, vars: Record<string, strin
320
320
  console.log(`Starting ${cli} login...`);
321
321
 
322
322
  try {
323
- const isClaudeSetupToken = cli === "claude";
324
-
325
- // For claude setup-token: pipe stdout to capture token while echoing to terminal.
326
- // For others (codex): inherit stdout for full native rendering.
327
323
  const proc = Bun.spawn(buildBunWrappedAgentCliCommand(cli, args, { skipPreload: true }), {
328
324
  stdin: "inherit",
329
- stdout: isClaudeSetupToken ? "pipe" : "inherit",
325
+ stdout: "inherit",
330
326
  stderr: "inherit",
331
- env: isClaudeSetupToken ? { ...process.env, NO_COLOR: "1" } : undefined,
332
327
  });
333
328
 
334
- let output = "";
335
- if (isClaudeSetupToken) {
336
- const reader = (proc.stdout as ReadableStream<Uint8Array>).getReader();
337
- const decoder = new TextDecoder();
338
- while (true) {
339
- const { done, value } = await reader.read();
340
- if (done) break;
341
- const chunk = decoder.decode(value, { stream: true });
342
- process.stdout.write(chunk);
343
- output += chunk;
344
- }
345
- }
346
-
347
329
  const exitCode = await proc.exited;
348
330
 
349
331
  if (exitCode !== 0) {
@@ -353,33 +335,24 @@ async function runInteractiveLogin(cli: AgentCliName, vars: Record<string, strin
353
335
 
354
336
  console.log(` ✓ ${cli} login successful`);
355
337
 
356
- // `claude setup-token` prints a long-lived (1 year) token but does NOT
357
- // store it. Extract from captured output and save to .env.
358
- if (isClaudeSetupToken) {
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...")
361
- const idx = output.indexOf("sk-ant-");
362
- if (idx >= 0) {
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) {
374
- vars.CLAUDE_CODE_OAUTH_TOKEN = token;
375
- process.env.CLAUDE_CODE_OAUTH_TOKEN = token;
376
- saveEnv(vars);
377
- console.log(` ✓ token saved to .env (${token.length} chars)`);
378
- } else {
379
- console.log(` ⚠ token looks invalid (${token.length} chars) — set CLAUDE_CODE_OAUTH_TOKEN manually in ~/.arisa/.env`);
380
- }
338
+ // `claude setup-token` prints a token but does NOT store it.
339
+ // Ask the user to paste it.
340
+ if (cli === "claude") {
341
+ console.log("\n Paste the token shown above (starts with sk-ant-):");
342
+ const token = (await readLine(" > ")).trim();
343
+ if (token.startsWith("sk-ant-") && token.length > 80) {
344
+ vars.CLAUDE_CODE_OAUTH_TOKEN = token;
345
+ process.env.CLAUDE_CODE_OAUTH_TOKEN = token;
346
+ saveEnv(vars);
347
+ console.log(` ✓ token saved to .env (${token.length} chars)`);
348
+ } else if (token) {
349
+ // Save it anyway, user knows best
350
+ vars.CLAUDE_CODE_OAUTH_TOKEN = token;
351
+ process.env.CLAUDE_CODE_OAUTH_TOKEN = token;
352
+ saveEnv(vars);
353
+ console.log(` ⚠ token saved (${token.length} chars) — verify it works`);
381
354
  } else {
382
- console.log(" ⚠ could not find token in output — set CLAUDE_CODE_OAUTH_TOKEN manually in ~/.arisa/.env");
355
+ console.log(" ⚠ no token — set CLAUDE_CODE_OAUTH_TOKEN in ~/.arisa/.env");
383
356
  }
384
357
  }
385
358