arisa 2.3.10 → 2.3.11

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.10",
3
+ "version": "2.3.11",
4
4
  "description": "Arisa - dynamic agent runtime with daemon/core architecture that evolves through user interaction",
5
5
  "preferGlobal": true,
6
6
  "bin": {
@@ -108,12 +108,20 @@ export async function probeCliAuth(): Promise<void> {
108
108
  if (!isAgentCliInstalled(cli)) continue;
109
109
 
110
110
  log.info(`Auth probe: testing ${cli}...`);
111
+ if (cli === "claude") {
112
+ const hasToken = !!process.env.CLAUDE_CODE_OAUTH_TOKEN;
113
+ const tokenPreview = hasToken ? `${process.env.CLAUDE_CODE_OAUTH_TOKEN!.slice(0, 15)}...` : "NOT SET";
114
+ log.info(`Auth probe: CLAUDE_CODE_OAUTH_TOKEN=${tokenPreview}`);
115
+ }
111
116
  try {
112
117
  const args = cli === "claude"
113
118
  ? ["-p", "say ok", "--model", "haiku", "--dangerously-skip-permissions"]
114
119
  : ["exec", "--dangerously-bypass-approvals-and-sandbox", "echo ok"];
115
120
 
116
- const proc = Bun.spawn(buildBunWrappedAgentCliCommand(cli, args), {
121
+ const cmd = buildBunWrappedAgentCliCommand(cli, args);
122
+ log.info(`Auth probe cmd: ${cmd.map(c => c.length > 80 ? c.slice(0, 80) + "..." : c).join(" ")}`);
123
+
124
+ const proc = Bun.spawn(cmd, {
117
125
  stdout: "pipe",
118
126
  stderr: "pipe",
119
127
  env: { ...process.env },
@@ -300,11 +300,32 @@ async function runInteractiveLogin(cli: AgentCliName, vars: Record<string, strin
300
300
  if (token && token.startsWith("sk-ant-") && token.length > 50 && token.length < 150) {
301
301
  console.log(` [token] ${token.slice(0, 20)}...${token.slice(-6)} (${token.length} chars)`);
302
302
  vars.CLAUDE_CODE_OAUTH_TOKEN = token;
303
+ process.env.CLAUDE_CODE_OAUTH_TOKEN = token;
303
304
  saveEnv(vars);
304
305
  console.log(" ✓ claude token saved to .env");
306
+
307
+ // Also write credentials file for arisa user (belt + suspenders)
308
+ const claudeDir = isRunningAsRoot() ? "/home/arisa/.claude" : join(process.env.HOME || "~", ".claude");
309
+ try {
310
+ if (!existsSync(claudeDir)) mkdirSync(claudeDir, { recursive: true });
311
+ const credsPath = join(claudeDir, ".credentials.json");
312
+ const creds = {
313
+ claudeAiOauth: {
314
+ accessToken: token,
315
+ expiresAt: Date.now() + 365 * 24 * 60 * 60 * 1000,
316
+ scopes: ["user:inference", "user:profile"],
317
+ },
318
+ };
319
+ writeFileSync(credsPath, JSON.stringify(creds, null, 2) + "\n");
320
+ if (isRunningAsRoot()) {
321
+ Bun.spawnSync(["chown", "-R", "arisa:arisa", claudeDir]);
322
+ }
323
+ console.log(` ✓ credentials written to ${credsPath}`);
324
+ } catch (e) {
325
+ console.log(` ⚠ could not write credentials file: ${e}`);
326
+ }
305
327
  } else {
306
328
  console.log(` ⚠ token extraction failed (indexOf=${startIdx}, len=${token.length})`);
307
- // Show what the cleaned text looks like around the token
308
329
  if (startIdx >= 0) {
309
330
  console.log(` [clean] ${clean.substring(startIdx, startIdx + 150).replace(/\n/g, "\\n")}`);
310
331
  }