arisa 2.3.17 → 2.3.18

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/bin/arisa.js CHANGED
@@ -428,7 +428,7 @@ const ARISA_BUN_ENV = 'export BUN_INSTALL=/home/arisa/.bun && export PATH=/home/
428
428
  function provisionArisaUser() {
429
429
  process.stdout.write("Creating user 'arisa' for Claude/Codex CLI execution...\n");
430
430
 
431
- // 1. Create user
431
+ // 1. Create user with sudo access
432
432
  const useradd = spawnSync("useradd", ["-m", "-s", "/bin/bash", "arisa"], { stdio: "pipe" });
433
433
  if (useradd.status !== 0) {
434
434
  step(false, `Failed to create user: ${(useradd.stderr || "").toString().trim()}`);
@@ -436,7 +436,16 @@ function provisionArisaUser() {
436
436
  }
437
437
  step(true, "User arisa created");
438
438
 
439
- // 2. Install bun for arisa (curl lightweight, no bun child process)
439
+ // 2. Grant passwordless sudo (needed for full tool execution in Claude/Codex)
440
+ try {
441
+ writeFileSync("/etc/sudoers.d/arisa", "arisa ALL=(ALL) NOPASSWD: ALL\n", { mode: 0o440 });
442
+ step(true, "Passwordless sudo granted");
443
+ } catch (e) {
444
+ // Not fatal — sudo may not be installed in minimal containers
445
+ step(false, `Sudo setup skipped: ${e.message || e}`);
446
+ }
447
+
448
+ // 3. Install bun for arisa (curl — lightweight, no bun child process)
440
449
  process.stdout.write(" Installing bun for arisa (this may take a minute)...\n");
441
450
  const bunInstall = spawnSync("su", ["-", "arisa", "-c", "curl -fsSL https://bun.sh/install | bash"], {
442
451
  stdio: "inherit",
@@ -448,7 +457,7 @@ function provisionArisaUser() {
448
457
  }
449
458
  step(true, "Bun installed for arisa");
450
459
 
451
- // 3. Write ink-shim for non-TTY execution (prevents Ink setRawMode crash)
460
+ // 4. Write ink-shim for non-TTY execution (prevents Ink setRawMode crash)
452
461
  const shimPath = "/home/arisa/.arisa-ink-shim.js";
453
462
  writeFileSync(shimPath, 'if(process.stdin&&!process.stdin.isTTY){process.stdin.setRawMode=()=>process.stdin;process.stdin.isTTY=true;}\n');
454
463
  spawnSync("chown", ["arisa:arisa", shimPath], { stdio: "ignore" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arisa",
3
- "version": "2.3.17",
3
+ "version": "2.3.18",
4
4
  "description": "Arisa - dynamic agent runtime with daemon/core architecture that evolves through user interaction",
5
5
  "keywords": [
6
6
  "tinyclaw",
package/src/core/media.ts CHANGED
@@ -60,7 +60,7 @@ export async function transcribeAudio(base64: string, filename: string): Promise
60
60
  const file = Bun.file(tempPath);
61
61
  const transcription = await client.audio.transcriptions.create({
62
62
  file: file,
63
- model: "whisper-1",
63
+ model: "gpt-4o-mini-transcribe",
64
64
  });
65
65
  log.info(`Transcribed audio: "${transcription.text.substring(0, 80)}..."`);
66
66
  return transcription.text;
@@ -10,7 +10,7 @@
10
10
  */
11
11
 
12
12
  import { createLogger } from "../shared/logger";
13
- import { isAgentCliInstalled, buildBunWrappedAgentCliCommand, type AgentCliName } from "../shared/ai-cli";
13
+ import { isAgentCliInstalled, isRunningAsRoot, buildBunWrappedAgentCliCommand, type AgentCliName } from "../shared/ai-cli";
14
14
 
15
15
  const log = createLogger("daemon");
16
16
 
@@ -19,6 +19,7 @@ const CLI_PACKAGES: Record<AgentCliName, string> = {
19
19
  codex: "@openai/codex",
20
20
  };
21
21
 
22
+ const ARISA_BUN_ENV = 'export BUN_INSTALL=/home/arisa/.bun && export PATH=/home/arisa/.bun/bin:$PATH';
22
23
  const INSTALL_TIMEOUT = 120_000; // 2min
23
24
 
24
25
  type NotifyFn = (text: string) => Promise<void>;
@@ -33,7 +34,12 @@ async function installCli(cli: AgentCliName): Promise<boolean> {
33
34
  log.info(`Auto-install: installing ${cli} (${pkg})...`);
34
35
 
35
36
  try {
36
- const proc = Bun.spawn(["bun", "add", "-g", pkg], {
37
+ // When running as root, install into arisa user's bun (consistent with setup.ts)
38
+ const cmd = isRunningAsRoot()
39
+ ? ["su", "-", "arisa", "-c", `${ARISA_BUN_ENV} && bun add -g ${pkg}`]
40
+ : ["bun", "add", "-g", pkg];
41
+
42
+ const proc = Bun.spawn(cmd, {
37
43
  stdout: "pipe",
38
44
  stderr: "pipe",
39
45
  env: { ...process.env },
@@ -100,7 +100,7 @@ export function buildBunWrappedAgentCliCommand(cli: AgentCliName, args: string[]
100
100
  // Run as arisa user — Claude CLI refuses to run as root
101
101
  const cliPath = resolveAgentCliPath(cli) || join(ARISA_USER_BUN, cli);
102
102
  const shimPath = existsSync(ARISA_INK_SHIM) ? ARISA_INK_SHIM : INK_SHIM;
103
- const inner = ["bun", "--bun", "--preload", shimPath, cliPath, ...args].map(shellEscape).join(" ");
103
+ const inner = ["bun", "--bun", shimPath, cliPath, ...args].map(shellEscape).join(" ");
104
104
  // su without "-" preserves parent env (tokens, keys); explicit HOME/PATH for arisa
105
105
  return ["su", "arisa", "-s", "/bin/bash", "-c", `${ARISA_BUN_ENV} && ${buildEnvExports()}${inner}`];
106
106
  }
@@ -111,5 +111,5 @@ export function buildBunWrappedAgentCliCommand(cli: AgentCliName, args: string[]
111
111
  }
112
112
  // Preload shim that patches process.stdin.setRawMode to prevent Ink crash
113
113
  // when running without a TTY (systemd, su -c, etc.)
114
- return ["bun", "--bun", "--preload", INK_SHIM, cliPath, ...args];
114
+ return ["bun", "--bun", INK_SHIM, cliPath, ...args];
115
115
  }