arisa 2.3.23 → 2.3.25
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 +9 -7
- package/package.json +1 -1
- package/src/daemon/index.ts +4 -4
- package/src/daemon/lifecycle.ts +1 -1
package/bin/arisa.js
CHANGED
|
@@ -533,16 +533,18 @@ switch (command) {
|
|
|
533
533
|
if (isDefaultInvocation) {
|
|
534
534
|
printForegroundNotice();
|
|
535
535
|
}
|
|
536
|
-
|
|
537
|
-
|
|
536
|
+
// Run daemon in-process — avoids an extra bun child (~150MB saved)
|
|
537
|
+
await import(daemonEntry);
|
|
538
|
+
break;
|
|
539
|
+
}
|
|
540
|
+
case "core": {
|
|
541
|
+
// Run core in-process
|
|
542
|
+
await import(coreEntry);
|
|
543
|
+
break;
|
|
538
544
|
}
|
|
539
|
-
case "core":
|
|
540
|
-
{
|
|
541
|
-
const child = runWithBun([coreEntry, ...rest]);
|
|
542
|
-
process.exit(child.status === null ? 1 : child.status);
|
|
543
|
-
}
|
|
544
545
|
case "dev":
|
|
545
546
|
{
|
|
547
|
+
// dev needs --watch which is a bun CLI flag, so child process required
|
|
546
548
|
const child = runWithBun(["--watch", coreEntry, ...rest]);
|
|
547
549
|
process.exit(child.status === null ? 1 : child.status);
|
|
548
550
|
}
|
package/package.json
CHANGED
package/src/daemon/index.ts
CHANGED
|
@@ -32,7 +32,7 @@ const { createLogger } = await import("../shared/logger");
|
|
|
32
32
|
const { serveWithRetry, claimProcess, releaseProcess, cleanupSocket } = await import("../shared/ports");
|
|
33
33
|
const { TelegramChannel } = await import("./channels/telegram");
|
|
34
34
|
const { sendToCore } = await import("./bridge");
|
|
35
|
-
const { startCore, stopCore, setLifecycleNotify } = await import("./lifecycle");
|
|
35
|
+
const { startCore, stopCore, setLifecycleNotify, waitForCoreReady } = await import("./lifecycle");
|
|
36
36
|
const { setAutoFixNotify } = await import("./autofix");
|
|
37
37
|
const { maybeStartCodexDeviceAuth, setCodexLoginNotify } = await import("./codex-login");
|
|
38
38
|
const { maybeStartClaudeSetupToken, maybeFeedClaudeCode, setClaudeLoginNotify, isClaudeLoginPending } = await import("./claude-login");
|
|
@@ -256,12 +256,12 @@ const pushServer = await serveWithRetry({
|
|
|
256
256
|
|
|
257
257
|
log.info(`Daemon push server listening on ${config.daemonSocket}`);
|
|
258
258
|
|
|
259
|
-
// --- Auto-install missing CLIs (non-blocking) ---
|
|
260
|
-
void autoInstallMissingClis();
|
|
261
|
-
|
|
262
259
|
// --- Start Core process ---
|
|
263
260
|
startCore();
|
|
264
261
|
|
|
262
|
+
// --- Auto-install missing CLIs (after Core is up to avoid OOM on low-RAM VPS) ---
|
|
263
|
+
waitForCoreReady(30_000).then(() => void autoInstallMissingClis());
|
|
264
|
+
|
|
265
265
|
// --- Connect Telegram (with retry for 409 conflict from stale polling sessions) ---
|
|
266
266
|
(async function connectTelegram(maxRetries = 5) {
|
|
267
267
|
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
package/src/daemon/lifecycle.ts
CHANGED
|
@@ -134,7 +134,7 @@ export function startCore() {
|
|
|
134
134
|
const bunEnv = "export HOME=/home/arisa && export BUN_INSTALL=/home/arisa/.bun && export PATH=/home/arisa/.bun/bin:$PATH";
|
|
135
135
|
const inner = `${bunEnv} && cd ${config.projectDir} && exec bun --watch ${coreEntry}`;
|
|
136
136
|
cmd = ["su", "arisa", "-s", "/bin/bash", "-c", inner];
|
|
137
|
-
log.info(`Starting Core as arisa
|
|
137
|
+
log.info(`Starting Core as arisa: bun --watch ${coreEntry}`);
|
|
138
138
|
} else {
|
|
139
139
|
cmd = ["bun", "--watch", coreEntry];
|
|
140
140
|
log.info(`Starting Core: bun --watch ${coreEntry}`);
|