svamp-cli 0.1.79 → 0.1.81
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/dist/{agentCommands-uNFhhdN1.mjs → agentCommands-BnAlpm77.mjs} +2 -2
- package/dist/cli.mjs +27 -27
- package/dist/{commands-B6FEeZeP.mjs → commands-6PO-ky9k.mjs} +82 -79
- package/dist/{commands-Cf3mXxPZ.mjs → commands-B41tMO2x.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{package-B-yM5uv2.mjs → package-BoA_DXNG.mjs} +1 -1
- package/dist/{run-DqvxMsWh.mjs → run-BDAinUvU.mjs} +1 -1
- package/dist/{run-DsXDjwLW.mjs → run-kLd-u7KD.mjs} +67 -62
- package/package.json +1 -1
|
@@ -145,7 +145,7 @@ async function sessionBroadcast(action, args) {
|
|
|
145
145
|
console.log(`Broadcast sent: ${action}`);
|
|
146
146
|
}
|
|
147
147
|
async function connectToMachineService() {
|
|
148
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
148
|
+
const { connectAndGetMachine } = await import('./commands-6PO-ky9k.mjs');
|
|
149
149
|
return connectAndGetMachine();
|
|
150
150
|
}
|
|
151
151
|
async function inboxSend(targetSessionId, opts) {
|
|
@@ -161,7 +161,7 @@ async function inboxSend(targetSessionId, opts) {
|
|
|
161
161
|
}
|
|
162
162
|
const { server, machine } = await connectToMachineService();
|
|
163
163
|
try {
|
|
164
|
-
const { resolveSessionId } = await import('./commands-
|
|
164
|
+
const { resolveSessionId } = await import('./commands-6PO-ky9k.mjs');
|
|
165
165
|
const sessions = await machine.listSessions();
|
|
166
166
|
const match = resolveSessionId(sessions, targetSessionId);
|
|
167
167
|
const fullTargetId = match.sessionId;
|
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as stopDaemon, s as startDaemon, d as daemonStatus } from './run-
|
|
1
|
+
import { b as stopDaemon, s as startDaemon, d as daemonStatus } from './run-kLd-u7KD.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -211,7 +211,7 @@ async function main() {
|
|
|
211
211
|
const { handleServiceCommand } = await import('./commands-BYbuedOK.mjs');
|
|
212
212
|
await handleServiceCommand();
|
|
213
213
|
} else if (subcommand === "process" || subcommand === "proc") {
|
|
214
|
-
const { processCommand } = await import('./commands-
|
|
214
|
+
const { processCommand } = await import('./commands-B41tMO2x.mjs');
|
|
215
215
|
let machineId;
|
|
216
216
|
const processArgs = args.slice(1);
|
|
217
217
|
const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
|
|
@@ -229,7 +229,7 @@ async function main() {
|
|
|
229
229
|
} else if (!subcommand || subcommand === "start") {
|
|
230
230
|
await handleInteractiveCommand();
|
|
231
231
|
} else if (subcommand === "--version" || subcommand === "-v") {
|
|
232
|
-
const pkg = await import('./package-
|
|
232
|
+
const pkg = await import('./package-BoA_DXNG.mjs').catch(() => ({ default: { version: "unknown" } }));
|
|
233
233
|
console.log(`svamp version: ${pkg.default.version}`);
|
|
234
234
|
} else {
|
|
235
235
|
console.error(`Unknown command: ${subcommand}`);
|
|
@@ -238,7 +238,7 @@ async function main() {
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
async function handleInteractiveCommand() {
|
|
241
|
-
const { runInteractive } = await import('./run-
|
|
241
|
+
const { runInteractive } = await import('./run-BDAinUvU.mjs');
|
|
242
242
|
const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
|
|
243
243
|
let directory = process.cwd();
|
|
244
244
|
let resumeSessionId;
|
|
@@ -283,7 +283,7 @@ async function handleAgentCommand() {
|
|
|
283
283
|
return;
|
|
284
284
|
}
|
|
285
285
|
if (agentArgs[0] === "list") {
|
|
286
|
-
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-
|
|
286
|
+
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-kLd-u7KD.mjs').then(function (n) { return n.i; });
|
|
287
287
|
console.log("Known agents:");
|
|
288
288
|
for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
|
|
289
289
|
console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
|
|
@@ -295,7 +295,7 @@ async function handleAgentCommand() {
|
|
|
295
295
|
console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-
|
|
298
|
+
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-kLd-u7KD.mjs').then(function (n) { return n.i; });
|
|
299
299
|
let cwd = process.cwd();
|
|
300
300
|
const filteredArgs = [];
|
|
301
301
|
for (let i = 0; i < agentArgs.length; i++) {
|
|
@@ -319,12 +319,12 @@ async function handleAgentCommand() {
|
|
|
319
319
|
console.log(`Starting ${config.agentName} agent in ${cwd}...`);
|
|
320
320
|
let backend;
|
|
321
321
|
if (KNOWN_MCP_AGENTS[config.agentName]) {
|
|
322
|
-
const { CodexMcpBackend } = await import('./run-
|
|
322
|
+
const { CodexMcpBackend } = await import('./run-kLd-u7KD.mjs').then(function (n) { return n.j; });
|
|
323
323
|
backend = new CodexMcpBackend({ cwd, log: logFn });
|
|
324
324
|
} else {
|
|
325
|
-
const { AcpBackend } = await import('./run-
|
|
326
|
-
const { GeminiTransport } = await import('./run-
|
|
327
|
-
const { DefaultTransport } = await import('./run-
|
|
325
|
+
const { AcpBackend } = await import('./run-kLd-u7KD.mjs').then(function (n) { return n.h; });
|
|
326
|
+
const { GeminiTransport } = await import('./run-kLd-u7KD.mjs').then(function (n) { return n.G; });
|
|
327
|
+
const { DefaultTransport } = await import('./run-kLd-u7KD.mjs').then(function (n) { return n.D; });
|
|
328
328
|
const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
|
|
329
329
|
backend = new AcpBackend({
|
|
330
330
|
agentName: config.agentName,
|
|
@@ -442,7 +442,7 @@ async function handleSessionCommand() {
|
|
|
442
442
|
printSessionHelp();
|
|
443
443
|
return;
|
|
444
444
|
}
|
|
445
|
-
const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-
|
|
445
|
+
const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-6PO-ky9k.mjs');
|
|
446
446
|
const parseFlagStr = (flag, shortFlag) => {
|
|
447
447
|
for (let i = 1; i < sessionArgs.length; i++) {
|
|
448
448
|
if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
|
|
@@ -502,7 +502,7 @@ async function handleSessionCommand() {
|
|
|
502
502
|
allowDomain.push(sessionArgs[++i]);
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
const { parseShareArg } = await import('./commands-
|
|
505
|
+
const { parseShareArg } = await import('./commands-6PO-ky9k.mjs');
|
|
506
506
|
const shareEntries = share.map((s) => parseShareArg(s));
|
|
507
507
|
await sessionSpawn(agent, dir, targetMachineId, {
|
|
508
508
|
message,
|
|
@@ -588,7 +588,7 @@ async function handleSessionCommand() {
|
|
|
588
588
|
console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
|
|
589
589
|
process.exit(1);
|
|
590
590
|
}
|
|
591
|
-
const { sessionApprove } = await import('./commands-
|
|
591
|
+
const { sessionApprove } = await import('./commands-6PO-ky9k.mjs');
|
|
592
592
|
const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
593
593
|
await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
|
|
594
594
|
json: hasFlag("--json")
|
|
@@ -598,7 +598,7 @@ async function handleSessionCommand() {
|
|
|
598
598
|
console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
|
|
599
599
|
process.exit(1);
|
|
600
600
|
}
|
|
601
|
-
const { sessionDeny } = await import('./commands-
|
|
601
|
+
const { sessionDeny } = await import('./commands-6PO-ky9k.mjs');
|
|
602
602
|
const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
603
603
|
await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
|
|
604
604
|
json: hasFlag("--json")
|
|
@@ -634,7 +634,7 @@ async function handleSessionCommand() {
|
|
|
634
634
|
console.error("Usage: svamp session set-title <title>");
|
|
635
635
|
process.exit(1);
|
|
636
636
|
}
|
|
637
|
-
const { sessionSetTitle } = await import('./agentCommands-
|
|
637
|
+
const { sessionSetTitle } = await import('./agentCommands-BnAlpm77.mjs');
|
|
638
638
|
await sessionSetTitle(title);
|
|
639
639
|
} else if (sessionSubcommand === "set-link") {
|
|
640
640
|
const url = sessionArgs[1];
|
|
@@ -643,7 +643,7 @@ async function handleSessionCommand() {
|
|
|
643
643
|
process.exit(1);
|
|
644
644
|
}
|
|
645
645
|
const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
646
|
-
const { sessionSetLink } = await import('./agentCommands-
|
|
646
|
+
const { sessionSetLink } = await import('./agentCommands-BnAlpm77.mjs');
|
|
647
647
|
await sessionSetLink(url, label);
|
|
648
648
|
} else if (sessionSubcommand === "notify") {
|
|
649
649
|
const message = sessionArgs[1];
|
|
@@ -652,7 +652,7 @@ async function handleSessionCommand() {
|
|
|
652
652
|
process.exit(1);
|
|
653
653
|
}
|
|
654
654
|
const level = parseFlagStr("--level") || "info";
|
|
655
|
-
const { sessionNotify } = await import('./agentCommands-
|
|
655
|
+
const { sessionNotify } = await import('./agentCommands-BnAlpm77.mjs');
|
|
656
656
|
await sessionNotify(message, level);
|
|
657
657
|
} else if (sessionSubcommand === "broadcast") {
|
|
658
658
|
const action = sessionArgs[1];
|
|
@@ -660,7 +660,7 @@ async function handleSessionCommand() {
|
|
|
660
660
|
console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
|
|
661
661
|
process.exit(1);
|
|
662
662
|
}
|
|
663
|
-
const { sessionBroadcast } = await import('./agentCommands-
|
|
663
|
+
const { sessionBroadcast } = await import('./agentCommands-BnAlpm77.mjs');
|
|
664
664
|
await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
|
|
665
665
|
} else if (sessionSubcommand === "inbox") {
|
|
666
666
|
const inboxSubcmd = sessionArgs[1];
|
|
@@ -671,7 +671,7 @@ async function handleSessionCommand() {
|
|
|
671
671
|
process.exit(1);
|
|
672
672
|
}
|
|
673
673
|
if (agentSessionId) {
|
|
674
|
-
const { inboxSend } = await import('./agentCommands-
|
|
674
|
+
const { inboxSend } = await import('./agentCommands-BnAlpm77.mjs');
|
|
675
675
|
await inboxSend(sessionArgs[2], {
|
|
676
676
|
body: sessionArgs[3],
|
|
677
677
|
subject: parseFlagStr("--subject"),
|
|
@@ -686,7 +686,7 @@ async function handleSessionCommand() {
|
|
|
686
686
|
}
|
|
687
687
|
} else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
|
|
688
688
|
if (agentSessionId && !sessionArgs[2]) {
|
|
689
|
-
const { inboxList } = await import('./agentCommands-
|
|
689
|
+
const { inboxList } = await import('./agentCommands-BnAlpm77.mjs');
|
|
690
690
|
await inboxList({
|
|
691
691
|
unread: hasFlag("--unread"),
|
|
692
692
|
limit: parseFlagInt("--limit"),
|
|
@@ -708,7 +708,7 @@ async function handleSessionCommand() {
|
|
|
708
708
|
process.exit(1);
|
|
709
709
|
}
|
|
710
710
|
if (agentSessionId && !sessionArgs[3]) {
|
|
711
|
-
const { inboxList } = await import('./agentCommands-
|
|
711
|
+
const { inboxList } = await import('./agentCommands-BnAlpm77.mjs');
|
|
712
712
|
await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
|
|
713
713
|
} else if (sessionArgs[3]) {
|
|
714
714
|
await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
|
|
@@ -718,7 +718,7 @@ async function handleSessionCommand() {
|
|
|
718
718
|
}
|
|
719
719
|
} else if (inboxSubcmd === "reply") {
|
|
720
720
|
if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
|
|
721
|
-
const { inboxReply } = await import('./agentCommands-
|
|
721
|
+
const { inboxReply } = await import('./agentCommands-BnAlpm77.mjs');
|
|
722
722
|
await inboxReply(sessionArgs[2], sessionArgs[3]);
|
|
723
723
|
} else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
|
|
724
724
|
await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
|
|
@@ -754,7 +754,7 @@ async function handleMachineCommand() {
|
|
|
754
754
|
return;
|
|
755
755
|
}
|
|
756
756
|
if (machineSubcommand === "share") {
|
|
757
|
-
const { machineShare } = await import('./commands-
|
|
757
|
+
const { machineShare } = await import('./commands-6PO-ky9k.mjs');
|
|
758
758
|
let machineId;
|
|
759
759
|
const shareArgs = [];
|
|
760
760
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
@@ -784,7 +784,7 @@ async function handleMachineCommand() {
|
|
|
784
784
|
}
|
|
785
785
|
await machineShare(machineId, { add, remove, list, configPath, showConfig });
|
|
786
786
|
} else if (machineSubcommand === "exec") {
|
|
787
|
-
const { machineExec } = await import('./commands-
|
|
787
|
+
const { machineExec } = await import('./commands-6PO-ky9k.mjs');
|
|
788
788
|
let machineId;
|
|
789
789
|
let cwd;
|
|
790
790
|
const cmdParts = [];
|
|
@@ -804,7 +804,7 @@ async function handleMachineCommand() {
|
|
|
804
804
|
}
|
|
805
805
|
await machineExec(machineId, command, cwd);
|
|
806
806
|
} else if (machineSubcommand === "info") {
|
|
807
|
-
const { machineInfo } = await import('./commands-
|
|
807
|
+
const { machineInfo } = await import('./commands-6PO-ky9k.mjs');
|
|
808
808
|
let machineId;
|
|
809
809
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
810
810
|
if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
|
|
@@ -824,10 +824,10 @@ async function handleMachineCommand() {
|
|
|
824
824
|
level = machineArgs[++i];
|
|
825
825
|
}
|
|
826
826
|
}
|
|
827
|
-
const { machineNotify } = await import('./agentCommands-
|
|
827
|
+
const { machineNotify } = await import('./agentCommands-BnAlpm77.mjs');
|
|
828
828
|
await machineNotify(message, level);
|
|
829
829
|
} else if (machineSubcommand === "ls") {
|
|
830
|
-
const { machineLs } = await import('./commands-
|
|
830
|
+
const { machineLs } = await import('./commands-6PO-ky9k.mjs');
|
|
831
831
|
let machineId;
|
|
832
832
|
let showHidden = false;
|
|
833
833
|
let path;
|
|
@@ -2,7 +2,7 @@ import { existsSync, readFileSync } from 'node:fs';
|
|
|
2
2
|
import { execSync } from 'node:child_process';
|
|
3
3
|
import { resolve, join } from 'node:path';
|
|
4
4
|
import os from 'node:os';
|
|
5
|
-
import { l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha } from './run-
|
|
5
|
+
import { l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha } from './run-kLd-u7KD.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
8
8
|
import 'fs';
|
|
@@ -70,6 +70,13 @@ function formatJson(data) {
|
|
|
70
70
|
return JSON.stringify(data, null, 2);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
function getSessionProxy(machine, sessionId) {
|
|
74
|
+
return new Proxy({}, {
|
|
75
|
+
get(_target, method) {
|
|
76
|
+
return (...args) => machine.sessionRPC(sessionId, method, args);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
73
80
|
const SVAMP_HOME = process.env.SVAMP_HOME || join(os.homedir(), ".svamp");
|
|
74
81
|
const DAEMON_STATE_FILE = join(SVAMP_HOME, "daemon.state.json");
|
|
75
82
|
const ENV_FILE = join(SVAMP_HOME, ".env");
|
|
@@ -318,12 +325,11 @@ async function connectAndGetAllMachines() {
|
|
|
318
325
|
const machines = [];
|
|
319
326
|
try {
|
|
320
327
|
const services = await server.listServices({ query: { type: "svamp-machine" }, include_unlisted: true, _rkwargs: true });
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
}
|
|
328
|
+
const results = await Promise.allSettled(
|
|
329
|
+
services.map((svc) => server.getService(svc.id || svc.name))
|
|
330
|
+
);
|
|
331
|
+
for (const r of results) {
|
|
332
|
+
if (r.status === "fulfilled") machines.push(r.value);
|
|
327
333
|
}
|
|
328
334
|
} catch (err) {
|
|
329
335
|
restoreConsole();
|
|
@@ -402,34 +408,37 @@ async function sessionMachines() {
|
|
|
402
408
|
console.log("No machines found.");
|
|
403
409
|
return;
|
|
404
410
|
}
|
|
405
|
-
const machines =
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
411
|
+
const machines = await Promise.all(
|
|
412
|
+
services.map(async (svc) => {
|
|
413
|
+
const svcId = svc.id || svc.name;
|
|
414
|
+
try {
|
|
415
|
+
const machineSvc = await server.getService(svcId);
|
|
416
|
+
const [info, sessions] = await Promise.all([
|
|
417
|
+
machineSvc.getMachineInfo(),
|
|
418
|
+
machineSvc.listSessions()
|
|
419
|
+
]);
|
|
420
|
+
return {
|
|
421
|
+
serviceId: svcId,
|
|
422
|
+
machineId: info.machineId || svcId,
|
|
423
|
+
displayName: info.metadata?.displayName || info.metadata?.host || "-",
|
|
424
|
+
platform: info.metadata?.platform || "-",
|
|
425
|
+
host: info.metadata?.host || "-",
|
|
426
|
+
sessions: sessions.length,
|
|
427
|
+
status: info.daemonState?.status || "unknown"
|
|
428
|
+
};
|
|
429
|
+
} catch {
|
|
430
|
+
return {
|
|
431
|
+
serviceId: svcId,
|
|
432
|
+
machineId: svcId,
|
|
433
|
+
displayName: "-",
|
|
434
|
+
platform: "-",
|
|
435
|
+
host: "-",
|
|
436
|
+
sessions: -1,
|
|
437
|
+
status: "unreachable"
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
})
|
|
441
|
+
);
|
|
433
442
|
const header = `${"MACHINE ID".padEnd(20)} ${"NAME".padEnd(20)} ${"PLATFORM".padEnd(12)} ${"HOST".padEnd(25)} ${"SESSIONS".padEnd(10)} ${"STATUS"}`;
|
|
434
443
|
console.log(header);
|
|
435
444
|
console.log("-".repeat(header.length));
|
|
@@ -672,18 +681,23 @@ async function sessionList(machineId, opts) {
|
|
|
672
681
|
}
|
|
673
682
|
}
|
|
674
683
|
}
|
|
675
|
-
async function listSessionsFromMachines(
|
|
684
|
+
async function listSessionsFromMachines(_server, machines, opts) {
|
|
676
685
|
const allSessions = [];
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
const info = await
|
|
680
|
-
|
|
686
|
+
const machineResults = await Promise.allSettled(
|
|
687
|
+
machines.map(async (machine) => {
|
|
688
|
+
const [info, sessions] = await Promise.all([
|
|
689
|
+
machine.getMachineInfo(),
|
|
690
|
+
machine.listSessions()
|
|
691
|
+
]);
|
|
692
|
+
const host = info.metadata?.displayName || info.metadata?.host || info.machineId;
|
|
681
693
|
for (const s of sessions) {
|
|
682
|
-
s.machineHost =
|
|
694
|
+
s.machineHost = host;
|
|
683
695
|
}
|
|
684
|
-
|
|
685
|
-
}
|
|
686
|
-
|
|
696
|
+
return sessions;
|
|
697
|
+
})
|
|
698
|
+
);
|
|
699
|
+
for (const r of machineResults) {
|
|
700
|
+
if (r.status === "fulfilled") allSessions.push(...r.value);
|
|
687
701
|
}
|
|
688
702
|
const filtered = opts?.active ? allSessions.filter((s) => s.active) : allSessions;
|
|
689
703
|
if (filtered.length === 0) {
|
|
@@ -694,29 +708,16 @@ async function listSessionsFromMachines(server, machines, opts) {
|
|
|
694
708
|
}
|
|
695
709
|
return;
|
|
696
710
|
}
|
|
697
|
-
const enriched =
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
if (s.active) {
|
|
708
|
-
try {
|
|
709
|
-
const svc = await server.getService(`svamp-session-${s.sessionId}`);
|
|
710
|
-
const { metadata } = await svc.getMetadata();
|
|
711
|
-
flavor = metadata?.flavor || flavor;
|
|
712
|
-
name = metadata?.name || name;
|
|
713
|
-
path = metadata?.path || path;
|
|
714
|
-
host = metadata?.host || host;
|
|
715
|
-
} catch {
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
enriched.push({ ...s, flavor, name, path, host });
|
|
719
|
-
}
|
|
711
|
+
const enriched = filtered.map((s) => {
|
|
712
|
+
const m = s.metadata || {};
|
|
713
|
+
return {
|
|
714
|
+
...s,
|
|
715
|
+
flavor: m.flavor || "claude",
|
|
716
|
+
name: m.name || "",
|
|
717
|
+
path: m.path || s.directory || "",
|
|
718
|
+
host: m.host || s.machineHost || ""
|
|
719
|
+
};
|
|
720
|
+
});
|
|
720
721
|
if (opts?.json) {
|
|
721
722
|
console.log(formatJson(enriched.map((s) => ({
|
|
722
723
|
sessionId: s.sessionId,
|
|
@@ -874,12 +875,14 @@ async function sessionSpawn(agent, directory, machineId, opts) {
|
|
|
874
875
|
let effectiveParentSessionId = opts?.parentSessionId || process.env.SVAMP_SESSION_ID || void 0;
|
|
875
876
|
if (effectiveParentSessionId) {
|
|
876
877
|
try {
|
|
878
|
+
const sessions = await machine.listSessions();
|
|
877
879
|
if (opts?.parentSessionId) {
|
|
878
|
-
const sessions = await machine.listSessions();
|
|
879
880
|
const match = resolveSessionId(sessions, effectiveParentSessionId);
|
|
880
881
|
effectiveParentSessionId = match.sessionId;
|
|
882
|
+
} else {
|
|
883
|
+
const found = sessions.find((s) => s.sessionId === effectiveParentSessionId);
|
|
884
|
+
if (!found) throw new Error("not found");
|
|
881
885
|
}
|
|
882
|
-
await server.getService(`svamp-session-${effectiveParentSessionId}`);
|
|
883
886
|
} catch (err) {
|
|
884
887
|
const source = opts?.parentSessionId ? "--parent" : "SVAMP_SESSION_ID";
|
|
885
888
|
console.error(`Error: Parent session ${effectiveParentSessionId} not found (from ${source}).`);
|
|
@@ -921,7 +924,7 @@ async function sessionSpawn(agent, directory, machineId, opts) {
|
|
|
921
924
|
console.log(`\x1B[33m Use -p bypassPermissions to run without approval prompts.\x1B[0m`);
|
|
922
925
|
}
|
|
923
926
|
if (opts?.message && result.sessionId) {
|
|
924
|
-
const svc =
|
|
927
|
+
const svc = getSessionProxy(machine, result.sessionId);
|
|
925
928
|
const sendResult = await svc.sendMessage(
|
|
926
929
|
JSON.stringify({
|
|
927
930
|
role: "user",
|
|
@@ -972,7 +975,7 @@ async function sessionInfo(sessionId, machineId, opts) {
|
|
|
972
975
|
let metadata = {};
|
|
973
976
|
let activity = {};
|
|
974
977
|
try {
|
|
975
|
-
const svc =
|
|
978
|
+
const svc = getSessionProxy(machine, fullId);
|
|
976
979
|
const metaResult = await svc.getMetadata();
|
|
977
980
|
metadata = metaResult.metadata || {};
|
|
978
981
|
activity = await svc.getActivityState();
|
|
@@ -1012,7 +1015,7 @@ async function sessionMessages(sessionId, machineId, opts) {
|
|
|
1012
1015
|
const sessions = await machine.listSessions();
|
|
1013
1016
|
const match = resolveSessionId(sessions, sessionId);
|
|
1014
1017
|
const fullId = match.sessionId;
|
|
1015
|
-
const svc =
|
|
1018
|
+
const svc = getSessionProxy(machine, fullId);
|
|
1016
1019
|
const afterSeq = opts?.after ?? 0;
|
|
1017
1020
|
const apiLimit = opts?.limit ?? 1e3;
|
|
1018
1021
|
const { messages } = await svc.getMessages(afterSeq, apiLimit);
|
|
@@ -1052,7 +1055,7 @@ async function sessionApprove(sessionId, requestId, machineId, opts) {
|
|
|
1052
1055
|
const sessions = await machine.listSessions();
|
|
1053
1056
|
const match = resolveSessionId(sessions, sessionId);
|
|
1054
1057
|
const fullId = match.sessionId;
|
|
1055
|
-
const svc =
|
|
1058
|
+
const svc = getSessionProxy(machine, fullId);
|
|
1056
1059
|
if (requestId) {
|
|
1057
1060
|
const activity = await svc.getActivityState();
|
|
1058
1061
|
const pending = activity.pendingPermissions || [];
|
|
@@ -1101,7 +1104,7 @@ async function sessionDeny(sessionId, requestId, machineId, opts) {
|
|
|
1101
1104
|
const sessions = await machine.listSessions();
|
|
1102
1105
|
const match = resolveSessionId(sessions, sessionId);
|
|
1103
1106
|
const fullId = match.sessionId;
|
|
1104
|
-
const svc =
|
|
1107
|
+
const svc = getSessionProxy(machine, fullId);
|
|
1105
1108
|
if (requestId) {
|
|
1106
1109
|
const activity = await svc.getActivityState();
|
|
1107
1110
|
const pending = activity.pendingPermissions || [];
|
|
@@ -1151,7 +1154,7 @@ async function sessionAttach(sessionId, machineId) {
|
|
|
1151
1154
|
const fullId = match.sessionId;
|
|
1152
1155
|
let svc;
|
|
1153
1156
|
try {
|
|
1154
|
-
svc =
|
|
1157
|
+
svc = getSessionProxy(machine, fullId);
|
|
1155
1158
|
} catch (err) {
|
|
1156
1159
|
console.error(`Could not find session service: ${err.message}`);
|
|
1157
1160
|
await server.disconnect();
|
|
@@ -1369,7 +1372,7 @@ async function sessionShare(sessionIdPartial, machineId, opts) {
|
|
|
1369
1372
|
const sessions = await machine.listSessions();
|
|
1370
1373
|
const match = resolveSessionId(sessions, sessionIdPartial);
|
|
1371
1374
|
const fullId = match.sessionId;
|
|
1372
|
-
const svc =
|
|
1375
|
+
const svc = getSessionProxy(machine, fullId);
|
|
1373
1376
|
if (opts.list) {
|
|
1374
1377
|
const metaResult = await svc.getMetadata();
|
|
1375
1378
|
const sharing = metaResult.metadata?.sharing;
|
|
@@ -1638,7 +1641,7 @@ async function sessionRalphStart(sessionIdPartial, task, machineId, opts) {
|
|
|
1638
1641
|
const sessions = await machine.listSessions();
|
|
1639
1642
|
const match = resolveSessionId(sessions, sessionIdPartial);
|
|
1640
1643
|
const fullId = match.sessionId;
|
|
1641
|
-
const svc =
|
|
1644
|
+
const svc = getSessionProxy(machine, fullId);
|
|
1642
1645
|
const { metadata } = await svc.getMetadata();
|
|
1643
1646
|
if (metadata?.ralphLoop?.active) {
|
|
1644
1647
|
console.error(`Ralph loop is already active (iteration ${metadata.ralphLoop.currentIteration}). Cancel it first with: svamp session ralph-cancel ${sessionIdPartial}`);
|
|
@@ -1672,7 +1675,7 @@ async function sessionRalphCancel(sessionIdPartial, machineId) {
|
|
|
1672
1675
|
const sessions = await machine.listSessions();
|
|
1673
1676
|
const match = resolveSessionId(sessions, sessionIdPartial);
|
|
1674
1677
|
const fullId = match.sessionId;
|
|
1675
|
-
const svc =
|
|
1678
|
+
const svc = getSessionProxy(machine, fullId);
|
|
1676
1679
|
const { metadata } = await svc.getMetadata();
|
|
1677
1680
|
if (!metadata?.ralphLoop?.active) {
|
|
1678
1681
|
console.log("No active Ralph loop on this session.");
|
|
@@ -1691,7 +1694,7 @@ async function sessionRalphStatus(sessionIdPartial, machineId) {
|
|
|
1691
1694
|
const sessions = await machine.listSessions();
|
|
1692
1695
|
const match = resolveSessionId(sessions, sessionIdPartial);
|
|
1693
1696
|
const fullId = match.sessionId;
|
|
1694
|
-
const svc =
|
|
1697
|
+
const svc = getSessionProxy(machine, fullId);
|
|
1695
1698
|
const { metadata } = await svc.getMetadata();
|
|
1696
1699
|
const ralph = metadata?.ralphLoop;
|
|
1697
1700
|
if (!ralph || !ralph.active) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { writeFileSync, readFileSync } from 'fs';
|
|
2
2
|
import { resolve } from 'path';
|
|
3
|
-
import { connectAndGetMachine } from './commands-
|
|
3
|
+
import { connectAndGetMachine } from './commands-6PO-ky9k.mjs';
|
|
4
4
|
import 'node:fs';
|
|
5
5
|
import 'node:child_process';
|
|
6
6
|
import 'node:path';
|
|
7
7
|
import 'node:os';
|
|
8
|
-
import './run-
|
|
8
|
+
import './run-kLd-u7KD.mjs';
|
|
9
9
|
import 'os';
|
|
10
10
|
import 'fs/promises';
|
|
11
11
|
import 'url';
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as connectToHypha, d as daemonStatus, g as getHyphaServerUrl, r as registerMachineService, a as registerSessionService, s as startDaemon, b as stopDaemon } from './run-
|
|
1
|
+
export { c as connectToHypha, d as daemonStatus, g as getHyphaServerUrl, r as registerMachineService, a as registerSessionService, s as startDaemon, b as stopDaemon } from './run-kLd-u7KD.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -2,7 +2,7 @@ import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(im
|
|
|
2
2
|
import os from 'node:os';
|
|
3
3
|
import { join, resolve } from 'node:path';
|
|
4
4
|
import { mkdirSync, writeFileSync, existsSync, unlinkSync, readFileSync, watch } from 'node:fs';
|
|
5
|
-
import { c as connectToHypha, a as registerSessionService } from './run-
|
|
5
|
+
import { c as connectToHypha, a as registerSessionService } from './run-kLd-u7KD.mjs';
|
|
6
6
|
import { createServer } from 'node:http';
|
|
7
7
|
import { spawn } from 'node:child_process';
|
|
8
8
|
import { createInterface } from 'node:readline';
|
|
@@ -1604,6 +1604,7 @@ function createSessionStore(server, sessionId, initialMetadata, initialAgentStat
|
|
|
1604
1604
|
const store = {
|
|
1605
1605
|
serviceInfo: { id: `svamp-session-${sessionId}` },
|
|
1606
1606
|
pushMessage,
|
|
1607
|
+
getMetadata: () => ({ ...metadata }),
|
|
1607
1608
|
get _agentState() {
|
|
1608
1609
|
return agentState;
|
|
1609
1610
|
},
|
|
@@ -5577,8 +5578,7 @@ async function startDaemon(options) {
|
|
|
5577
5578
|
process.on("SIGUSR1", () => requestShutdown("os-signal-cleanup"));
|
|
5578
5579
|
process.on("uncaughtException", (error) => {
|
|
5579
5580
|
if (shutdownRequested) return;
|
|
5580
|
-
logger.error("Uncaught exception:", error);
|
|
5581
|
-
requestShutdown("exception", error.message);
|
|
5581
|
+
logger.error("Uncaught exception (non-fatal, daemon continues):", error);
|
|
5582
5582
|
});
|
|
5583
5583
|
const TRANSIENT_REJECTION_PATTERNS = [
|
|
5584
5584
|
"_rintf",
|
|
@@ -5609,8 +5609,12 @@ async function startDaemon(options) {
|
|
|
5609
5609
|
// Fetch API errors during reconnect
|
|
5610
5610
|
"already exists in the cache store",
|
|
5611
5611
|
// hypha-rpc: stale in-flight RPC calls after reconnect try to resolve with duplicate message keys
|
|
5612
|
-
"Failed to send the request when calling method"
|
|
5612
|
+
"Failed to send the request when calling method",
|
|
5613
5613
|
// hypha-rpc: RPC call failed after reconnect (often wraps the cache store error)
|
|
5614
|
+
"Rate limit",
|
|
5615
|
+
// Hypha server 429 rate limiting — transient, will resolve on its own
|
|
5616
|
+
"status 429"
|
|
5617
|
+
// HTTP 429 status code
|
|
5614
5618
|
];
|
|
5615
5619
|
let unhandledRejectionCount = 0;
|
|
5616
5620
|
let unhandledRejectionResetTimer = null;
|
|
@@ -5633,10 +5637,9 @@ async function startDaemon(options) {
|
|
|
5633
5637
|
}, UNHANDLED_REJECTION_WINDOW_MS);
|
|
5634
5638
|
}
|
|
5635
5639
|
if (unhandledRejectionCount >= UNHANDLED_REJECTION_THRESHOLD) {
|
|
5636
|
-
logger.log(`Too many unhandled rejections (${unhandledRejectionCount} in ${UNHANDLED_REJECTION_WINDOW_MS / 1e3}s),
|
|
5637
|
-
requestShutdown("exception", msg);
|
|
5640
|
+
logger.log(`Too many unhandled rejections (${unhandledRejectionCount} in ${UNHANDLED_REJECTION_WINDOW_MS / 1e3}s) \u2014 logging only, daemon continues`);
|
|
5638
5641
|
} else {
|
|
5639
|
-
logger.log(`Unhandled rejection ${unhandledRejectionCount}/${UNHANDLED_REJECTION_THRESHOLD}
|
|
5642
|
+
logger.log(`Unhandled rejection ${unhandledRejectionCount}/${UNHANDLED_REJECTION_THRESHOLD}: ${msg.slice(0, 200)}`);
|
|
5640
5643
|
}
|
|
5641
5644
|
});
|
|
5642
5645
|
if (isDaemonAlive()) {
|
|
@@ -5718,8 +5721,7 @@ async function startDaemon(options) {
|
|
|
5718
5721
|
});
|
|
5719
5722
|
logger.log(`Connected to Hypha (workspace: ${server.config.workspace})`);
|
|
5720
5723
|
server.on("disconnected", (reason) => {
|
|
5721
|
-
logger.log(`Hypha connection permanently lost: ${reason}
|
|
5722
|
-
requestShutdown("hypha-disconnected", String(reason));
|
|
5724
|
+
logger.log(`Hypha connection permanently lost: ${reason}. Daemon continues running \u2014 restart manually to reconnect.`);
|
|
5723
5725
|
});
|
|
5724
5726
|
const pidToTrackedSession = /* @__PURE__ */ new Map();
|
|
5725
5727
|
server.on("services_registered", () => {
|
|
@@ -5730,13 +5732,33 @@ async function startDaemon(options) {
|
|
|
5730
5732
|
}
|
|
5731
5733
|
});
|
|
5732
5734
|
const getCurrentChildren = () => {
|
|
5733
|
-
return Array.from(pidToTrackedSession.values()).map((s) =>
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5735
|
+
return Array.from(pidToTrackedSession.values()).map((s) => {
|
|
5736
|
+
const active = !s.stopped && s.hyphaService != null;
|
|
5737
|
+
let metadata;
|
|
5738
|
+
if (active && s.hyphaService) {
|
|
5739
|
+
try {
|
|
5740
|
+
const m = s.hyphaService.getMetadata();
|
|
5741
|
+
metadata = {
|
|
5742
|
+
flavor: m.flavor,
|
|
5743
|
+
name: m.name,
|
|
5744
|
+
path: m.path,
|
|
5745
|
+
host: m.host,
|
|
5746
|
+
lifecycleState: m.lifecycleState,
|
|
5747
|
+
parentSessionId: m.parentSessionId,
|
|
5748
|
+
tags: m.tags
|
|
5749
|
+
};
|
|
5750
|
+
} catch {
|
|
5751
|
+
}
|
|
5752
|
+
}
|
|
5753
|
+
return {
|
|
5754
|
+
sessionId: s.svampSessionId || `PID-${s.pid}`,
|
|
5755
|
+
pid: s.pid,
|
|
5756
|
+
startedBy: s.startedBy,
|
|
5757
|
+
directory: s.directory,
|
|
5758
|
+
active,
|
|
5759
|
+
metadata
|
|
5760
|
+
};
|
|
5761
|
+
});
|
|
5740
5762
|
};
|
|
5741
5763
|
let machineServiceRef = null;
|
|
5742
5764
|
const spawnSession = async (options2) => {
|
|
@@ -7684,7 +7706,9 @@ The automated loop has finished. Review the progress above and let me know if yo
|
|
|
7684
7706
|
spawnSession,
|
|
7685
7707
|
stopSession,
|
|
7686
7708
|
restartSession,
|
|
7687
|
-
requestShutdown: () =>
|
|
7709
|
+
requestShutdown: () => {
|
|
7710
|
+
logger.log("Shutdown requested via hypha-app (ignored \u2014 daemon never self-terminates)");
|
|
7711
|
+
},
|
|
7688
7712
|
getTrackedSessions: getCurrentChildren,
|
|
7689
7713
|
getSessionRPCHandlers: (sessionId) => {
|
|
7690
7714
|
for (const [, session] of pidToTrackedSession) {
|
|
@@ -7790,20 +7814,16 @@ The automated loop has finished. Review the progress above and let me know if yo
|
|
|
7790
7814
|
for (const sessionId of sessionsToAutoContinue) {
|
|
7791
7815
|
setTimeout(async () => {
|
|
7792
7816
|
try {
|
|
7793
|
-
const
|
|
7794
|
-
|
|
7795
|
-
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
})
|
|
7804
|
-
),
|
|
7805
|
-
new Promise((_, reject) => setTimeout(() => reject(new Error("sendMessage timeout")), 3e4))
|
|
7806
|
-
]);
|
|
7817
|
+
const tracked = Array.from(pidToTrackedSession.values()).find((s) => s.svampSessionId === sessionId);
|
|
7818
|
+
const rpc = tracked?.sessionRPCHandlers;
|
|
7819
|
+
if (!rpc) throw new Error(`Session ${sessionId} RPC handlers not found`);
|
|
7820
|
+
await rpc.sendMessage(
|
|
7821
|
+
JSON.stringify({
|
|
7822
|
+
role: "user",
|
|
7823
|
+
content: { type: "text", text: 'The svamp daemon was restarted, which interrupted this session. Please continue where you left off. IMPORTANT: Do not run any command that would stop or restart the svamp daemon (e.g. "svamp daemon stop") \u2014 that would interrupt the session again.' },
|
|
7824
|
+
meta: { sentFrom: "svamp-daemon-auto-continue" }
|
|
7825
|
+
})
|
|
7826
|
+
);
|
|
7807
7827
|
logger.log(`Auto-continued session ${sessionId}`);
|
|
7808
7828
|
} catch (err) {
|
|
7809
7829
|
logger.log(`Failed to auto-continue session ${sessionId}: ${err.message}`);
|
|
@@ -7817,10 +7837,12 @@ The automated loop has finished. Review the progress above and let me know if yo
|
|
|
7817
7837
|
logger.log(`Resuming Ralph loop for ${sessionsToRalphResume.length} session(s)...`);
|
|
7818
7838
|
for (const { sessionId, directory: sessDir } of sessionsToRalphResume) {
|
|
7819
7839
|
try {
|
|
7820
|
-
const
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7840
|
+
const tracked = Array.from(pidToTrackedSession.values()).find((s) => s.svampSessionId === sessionId);
|
|
7841
|
+
const rpc = tracked?.sessionRPCHandlers;
|
|
7842
|
+
if (!rpc) {
|
|
7843
|
+
logger.log(`Session ${sessionId} RPC handlers not found for Ralph resume`);
|
|
7844
|
+
continue;
|
|
7845
|
+
}
|
|
7824
7846
|
const rlState = readRalphState(getRalphStateFilePath(sessDir, sessionId));
|
|
7825
7847
|
if (!rlState) continue;
|
|
7826
7848
|
const initDelayMs = 2e3;
|
|
@@ -7841,20 +7863,17 @@ The automated loop has finished. Review the progress above and let me know if yo
|
|
|
7841
7863
|
const progressRelPath = `.svamp/${sessionId}/ralph-progress.md`;
|
|
7842
7864
|
const prompt = buildRalphPrompt(currentState.task, currentState);
|
|
7843
7865
|
const ralphSysPrompt = buildRalphSystemPrompt(currentState, progressRelPath);
|
|
7844
|
-
await
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
),
|
|
7856
|
-
new Promise((_, reject) => setTimeout(() => reject(new Error("sendMessage timeout")), 3e4))
|
|
7857
|
-
]);
|
|
7866
|
+
await rpc.sendMessage(
|
|
7867
|
+
JSON.stringify({
|
|
7868
|
+
role: "user",
|
|
7869
|
+
content: { type: "text", text: prompt },
|
|
7870
|
+
meta: {
|
|
7871
|
+
sentFrom: "svamp-daemon-ralph-resume",
|
|
7872
|
+
appendSystemPrompt: ralphSysPrompt,
|
|
7873
|
+
...isFreshMode ? { ralphFreshContext: true } : {}
|
|
7874
|
+
}
|
|
7875
|
+
})
|
|
7876
|
+
);
|
|
7858
7877
|
logger.log(`Resumed Ralph loop for session ${sessionId} at iteration ${currentState.iteration} (${isFreshMode ? "fresh" : "continue"})`);
|
|
7859
7878
|
} catch (err) {
|
|
7860
7879
|
logger.log(`Failed to resume Ralph loop for session ${sessionId}: ${err.message}`);
|
|
@@ -7918,20 +7937,6 @@ The automated loop has finished. Review the progress above and let me know if yo
|
|
|
7918
7937
|
}
|
|
7919
7938
|
} catch {
|
|
7920
7939
|
}
|
|
7921
|
-
try {
|
|
7922
|
-
const installedVersion = readPackageVersion();
|
|
7923
|
-
if (installedVersion !== "unknown" && installedVersion !== DAEMON_VERSION) {
|
|
7924
|
-
const supervised2 = process.env.SVAMP_SUPERVISED === "1";
|
|
7925
|
-
if (supervised2) {
|
|
7926
|
-
logger.log(`svamp-cli version changed on disk: ${DAEMON_VERSION} \u2192 ${installedVersion}. Exiting for launchd restart...`);
|
|
7927
|
-
requestShutdown("version-update", `Updated ${DAEMON_VERSION} \u2192 ${installedVersion}`);
|
|
7928
|
-
return;
|
|
7929
|
-
} else {
|
|
7930
|
-
logger.log(`svamp-cli version changed on disk: ${DAEMON_VERSION} \u2192 ${installedVersion}. Run 'svamp daemon stop && svamp daemon start' to apply the update.`);
|
|
7931
|
-
}
|
|
7932
|
-
}
|
|
7933
|
-
} catch {
|
|
7934
|
-
}
|
|
7935
7940
|
for (const [key, session] of pidToTrackedSession) {
|
|
7936
7941
|
const child = session.childProcess;
|
|
7937
7942
|
if (child && child.pid) {
|