arisa 2.3.3 → 2.3.5
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 +3 -3
- package/src/shared/ai-cli.ts +5 -3
package/package.json
CHANGED
package/src/daemon/setup.ts
CHANGED
|
@@ -276,10 +276,10 @@ async function runInteractiveLogin(cli: AgentCliName, vars: Record<string, strin
|
|
|
276
276
|
|
|
277
277
|
const exitCode = await proc.exited;
|
|
278
278
|
if (exitCode === 0) {
|
|
279
|
-
// Extract token (sk-ant-oat01-...)
|
|
280
|
-
const tokenMatch = output.match(/
|
|
279
|
+
// Extract token (sk-ant-oat01-...) — may span multiple lines due to terminal wrapping
|
|
280
|
+
const tokenMatch = output.match(/sk-ant-[A-Za-z0-9_-]+(?:\n[A-Za-z0-9_-]+)*/);
|
|
281
281
|
if (tokenMatch) {
|
|
282
|
-
vars.CLAUDE_CODE_OAUTH_TOKEN = tokenMatch[
|
|
282
|
+
vars.CLAUDE_CODE_OAUTH_TOKEN = tokenMatch[0].replace(/\n/g, "");
|
|
283
283
|
saveEnv(vars);
|
|
284
284
|
console.log(" ✓ claude token saved to .env");
|
|
285
285
|
}
|
package/src/shared/ai-cli.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module shared/ai-cli
|
|
3
3
|
* @role Resolve agent CLI binaries and execute them via Bun runtime.
|
|
4
|
-
* When running as root, wraps calls with su
|
|
4
|
+
* When running as root, wraps calls with su arisa to satisfy
|
|
5
5
|
* Claude CLI's non-root requirement.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -12,7 +12,8 @@ export type AgentCliName = "claude" | "codex";
|
|
|
12
12
|
|
|
13
13
|
const ARISA_USER_BUN = "/home/arisa/.bun/bin";
|
|
14
14
|
const ARISA_INK_SHIM = "/home/arisa/.arisa-ink-shim.js";
|
|
15
|
-
const
|
|
15
|
+
const ARISA_HOME = "/home/arisa";
|
|
16
|
+
const ARISA_BUN_ENV = `export HOME=${ARISA_HOME} && export BUN_INSTALL=${ARISA_HOME}/.bun && export PATH=${ARISA_USER_BUN}:$PATH`;
|
|
16
17
|
|
|
17
18
|
export function isRunningAsRoot(): boolean {
|
|
18
19
|
return process.getuid?.() === 0;
|
|
@@ -100,7 +101,8 @@ export function buildBunWrappedAgentCliCommand(cli: AgentCliName, args: string[]
|
|
|
100
101
|
const cliPath = resolveAgentCliPath(cli) || join(ARISA_USER_BUN, cli);
|
|
101
102
|
const shimPath = existsSync(ARISA_INK_SHIM) ? ARISA_INK_SHIM : INK_SHIM;
|
|
102
103
|
const inner = ["bun", "--preload", shimPath, cliPath, ...args].map(shellEscape).join(" ");
|
|
103
|
-
|
|
104
|
+
// su without "-" preserves parent env (tokens, keys); explicit HOME/PATH for arisa
|
|
105
|
+
return ["su", "arisa", "-s", "/bin/bash", "-c", `${ARISA_BUN_ENV} && ${buildEnvExports()}${inner}`];
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
const cliPath = resolveAgentCliPath(cli);
|