svamp-cli 0.2.80 → 0.2.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-CcNJ1dcR.mjs → agentCommands-B0x3og03.mjs} +2 -2
- package/dist/cli.mjs +92 -52
- package/dist/{commands-BKJNCTjq.mjs → commands-BRmDFn7e.mjs} +2 -2
- package/dist/{commands-iCbgYseB.mjs → commands-DG48QiE-.mjs} +3 -3
- package/dist/{commands-C6lrExeN.mjs → commands-v4NWBPB2.mjs} +1 -1
- package/dist/{fleet-BdWjugcV.mjs → fleet-BPLL0ecA.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{package-C4KoS6-F.mjs → package-D2aOg03L.mjs} +1 -1
- package/dist/{run-DamsNf6r.mjs → run-C-w9-q8d.mjs} +1 -1
- package/dist/{run-W8JZkXIf.mjs → run-ChG07q23.mjs} +58 -20
- package/dist/{serveCommands-DEik3hcu.mjs → serveCommands-CLxYFLiG.mjs} +5 -5
- package/dist/{serveManager-DTR_TDIp.mjs → serveManager-CLezyS3P.mjs} +1 -1
- package/package.json +1 -1
|
@@ -148,7 +148,7 @@ async function sessionBroadcast(action, args) {
|
|
|
148
148
|
console.log(`Broadcast sent: ${action}`);
|
|
149
149
|
}
|
|
150
150
|
async function connectToMachineService() {
|
|
151
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
151
|
+
const { connectAndGetMachine } = await import('./commands-v4NWBPB2.mjs');
|
|
152
152
|
return connectAndGetMachine();
|
|
153
153
|
}
|
|
154
154
|
async function inboxSend(targetSessionId, opts) {
|
|
@@ -165,7 +165,7 @@ async function inboxSend(targetSessionId, opts) {
|
|
|
165
165
|
}
|
|
166
166
|
const { server, machine } = await connectToMachineService();
|
|
167
167
|
try {
|
|
168
|
-
const { resolveSessionId } = await import('./commands-
|
|
168
|
+
const { resolveSessionId } = await import('./commands-v4NWBPB2.mjs');
|
|
169
169
|
const sessions = await machine.listSessions();
|
|
170
170
|
const match = resolveSessionId(sessions, targetSessionId);
|
|
171
171
|
const fullTargetId = match.sessionId;
|
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as startDaemon, b as stopDaemon, d as daemonStatus } from './run-
|
|
1
|
+
import { s as startDaemon, b as stopDaemon, d as daemonStatus } from './run-ChG07q23.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -44,7 +44,7 @@ async function main() {
|
|
|
44
44
|
console.error(`svamp daemon restart: ${err.message || err}`);
|
|
45
45
|
process.exit(1);
|
|
46
46
|
}
|
|
47
|
-
const { restartDaemon } = await import('./run-
|
|
47
|
+
const { restartDaemon } = await import('./run-ChG07q23.mjs').then(function (n) { return n.u; });
|
|
48
48
|
await restartDaemon();
|
|
49
49
|
process.exit(0);
|
|
50
50
|
}
|
|
@@ -86,12 +86,21 @@ async function main() {
|
|
|
86
86
|
}
|
|
87
87
|
child.unref();
|
|
88
88
|
const stateFile = join(svampHome, "daemon.state.json");
|
|
89
|
+
let beforeMtimeMs = -1;
|
|
90
|
+
try {
|
|
91
|
+
beforeMtimeMs = statSync(stateFile).mtimeMs;
|
|
92
|
+
} catch {
|
|
93
|
+
}
|
|
89
94
|
let started = false;
|
|
90
|
-
for (let i = 0; i <
|
|
95
|
+
for (let i = 0; i < 600; i++) {
|
|
91
96
|
await new Promise((r) => setTimeout(r, 100));
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
97
|
+
try {
|
|
98
|
+
const st = statSync(stateFile);
|
|
99
|
+
if (st.mtimeMs > beforeMtimeMs) {
|
|
100
|
+
started = true;
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
} catch {
|
|
95
104
|
}
|
|
96
105
|
}
|
|
97
106
|
if (started) {
|
|
@@ -287,7 +296,7 @@ async function main() {
|
|
|
287
296
|
console.error("svamp service: Service commands are not available in sandboxed sessions.");
|
|
288
297
|
process.exit(1);
|
|
289
298
|
}
|
|
290
|
-
const { handleServiceCommand } = await import('./commands-
|
|
299
|
+
const { handleServiceCommand } = await import('./commands-DG48QiE-.mjs');
|
|
291
300
|
await handleServiceCommand();
|
|
292
301
|
} else if (subcommand === "serve") {
|
|
293
302
|
const { isSandboxed: isSandboxedServe } = await import('./sandboxDetect-DNTcbgWD.mjs');
|
|
@@ -295,7 +304,7 @@ async function main() {
|
|
|
295
304
|
console.error("svamp serve: Serve commands are not available in sandboxed sessions.");
|
|
296
305
|
process.exit(1);
|
|
297
306
|
}
|
|
298
|
-
const { handleServeCommand } = await import('./serveCommands-
|
|
307
|
+
const { handleServeCommand } = await import('./serveCommands-CLxYFLiG.mjs');
|
|
299
308
|
await handleServeCommand();
|
|
300
309
|
process.exit(0);
|
|
301
310
|
} else if (subcommand === "process" || subcommand === "proc") {
|
|
@@ -304,7 +313,7 @@ async function main() {
|
|
|
304
313
|
console.error("svamp process: Process commands are not available in sandboxed sessions.");
|
|
305
314
|
process.exit(1);
|
|
306
315
|
}
|
|
307
|
-
const { processCommand } = await import('./commands-
|
|
316
|
+
const { processCommand } = await import('./commands-BRmDFn7e.mjs');
|
|
308
317
|
let machineId;
|
|
309
318
|
const processArgs = args.slice(1);
|
|
310
319
|
const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
|
|
@@ -322,7 +331,7 @@ async function main() {
|
|
|
322
331
|
} else if (!subcommand || subcommand === "start") {
|
|
323
332
|
await handleInteractiveCommand();
|
|
324
333
|
} else if (subcommand === "--version" || subcommand === "-v") {
|
|
325
|
-
const pkg = await import('./package-
|
|
334
|
+
const pkg = await import('./package-D2aOg03L.mjs').catch(() => ({ default: { version: "unknown" } }));
|
|
326
335
|
console.log(`svamp version: ${pkg.default.version}`);
|
|
327
336
|
} else {
|
|
328
337
|
console.error(`Unknown command: ${subcommand}`);
|
|
@@ -331,7 +340,7 @@ async function main() {
|
|
|
331
340
|
}
|
|
332
341
|
}
|
|
333
342
|
async function handleInteractiveCommand() {
|
|
334
|
-
const { runInteractive } = await import('./run-
|
|
343
|
+
const { runInteractive } = await import('./run-C-w9-q8d.mjs');
|
|
335
344
|
const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
|
|
336
345
|
let directory = process.cwd();
|
|
337
346
|
let resumeSessionId;
|
|
@@ -376,7 +385,7 @@ async function handleAgentCommand() {
|
|
|
376
385
|
return;
|
|
377
386
|
}
|
|
378
387
|
if (agentArgs[0] === "list") {
|
|
379
|
-
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-
|
|
388
|
+
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-ChG07q23.mjs').then(function (n) { return n.p; });
|
|
380
389
|
console.log("Known agents:");
|
|
381
390
|
for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
|
|
382
391
|
console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
|
|
@@ -388,7 +397,7 @@ async function handleAgentCommand() {
|
|
|
388
397
|
console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
|
|
389
398
|
return;
|
|
390
399
|
}
|
|
391
|
-
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-
|
|
400
|
+
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-ChG07q23.mjs').then(function (n) { return n.p; });
|
|
392
401
|
let cwd = process.cwd();
|
|
393
402
|
const filteredArgs = [];
|
|
394
403
|
for (let i = 0; i < agentArgs.length; i++) {
|
|
@@ -412,12 +421,12 @@ async function handleAgentCommand() {
|
|
|
412
421
|
console.log(`Starting ${config.agentName} agent in ${cwd}...`);
|
|
413
422
|
let backend;
|
|
414
423
|
if (KNOWN_MCP_AGENTS[config.agentName]) {
|
|
415
|
-
const { CodexMcpBackend } = await import('./run-
|
|
424
|
+
const { CodexMcpBackend } = await import('./run-ChG07q23.mjs').then(function (n) { return n.q; });
|
|
416
425
|
backend = new CodexMcpBackend({ cwd, log: logFn });
|
|
417
426
|
} else {
|
|
418
|
-
const { AcpBackend } = await import('./run-
|
|
419
|
-
const { GeminiTransport } = await import('./run-
|
|
420
|
-
const { DefaultTransport } = await import('./run-
|
|
427
|
+
const { AcpBackend } = await import('./run-ChG07q23.mjs').then(function (n) { return n.o; });
|
|
428
|
+
const { GeminiTransport } = await import('./run-ChG07q23.mjs').then(function (n) { return n.G; });
|
|
429
|
+
const { DefaultTransport } = await import('./run-ChG07q23.mjs').then(function (n) { return n.D; });
|
|
421
430
|
const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
|
|
422
431
|
backend = new AcpBackend({
|
|
423
432
|
agentName: config.agentName,
|
|
@@ -544,7 +553,7 @@ async function handleSessionCommand() {
|
|
|
544
553
|
process.exit(1);
|
|
545
554
|
}
|
|
546
555
|
}
|
|
547
|
-
const { sessionList, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-
|
|
556
|
+
const { sessionList, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-v4NWBPB2.mjs');
|
|
548
557
|
const parseFlagStr = (flag, shortFlag) => {
|
|
549
558
|
for (let i = 1; i < sessionArgs.length; i++) {
|
|
550
559
|
if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
|
|
@@ -610,7 +619,7 @@ async function handleSessionCommand() {
|
|
|
610
619
|
allowDomain.push(sessionArgs[++i]);
|
|
611
620
|
}
|
|
612
621
|
}
|
|
613
|
-
const { parseShareArg } = await import('./commands-
|
|
622
|
+
const { parseShareArg } = await import('./commands-v4NWBPB2.mjs');
|
|
614
623
|
const shareEntries = share.map((s) => parseShareArg(s));
|
|
615
624
|
await sessionSpawn(agent, dir, targetMachineId, {
|
|
616
625
|
message,
|
|
@@ -696,7 +705,7 @@ async function handleSessionCommand() {
|
|
|
696
705
|
console.error(" Spawns a stateless Claude session in <directory>, sends <prompt>, prints the answer, then deletes the session.");
|
|
697
706
|
process.exit(1);
|
|
698
707
|
}
|
|
699
|
-
const { sessionQuery } = await import('./commands-
|
|
708
|
+
const { sessionQuery } = await import('./commands-v4NWBPB2.mjs');
|
|
700
709
|
await sessionQuery(dir, prompt, targetMachineId, {
|
|
701
710
|
timeout: parseFlagInt("--timeout"),
|
|
702
711
|
json: hasFlag("--json"),
|
|
@@ -729,7 +738,7 @@ async function handleSessionCommand() {
|
|
|
729
738
|
console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
|
|
730
739
|
process.exit(1);
|
|
731
740
|
}
|
|
732
|
-
const { sessionApprove } = await import('./commands-
|
|
741
|
+
const { sessionApprove } = await import('./commands-v4NWBPB2.mjs');
|
|
733
742
|
const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
734
743
|
await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
|
|
735
744
|
json: hasFlag("--json")
|
|
@@ -739,7 +748,7 @@ async function handleSessionCommand() {
|
|
|
739
748
|
console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
|
|
740
749
|
process.exit(1);
|
|
741
750
|
}
|
|
742
|
-
const { sessionDeny } = await import('./commands-
|
|
751
|
+
const { sessionDeny } = await import('./commands-v4NWBPB2.mjs');
|
|
743
752
|
const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
744
753
|
await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
|
|
745
754
|
json: hasFlag("--json")
|
|
@@ -775,7 +784,7 @@ async function handleSessionCommand() {
|
|
|
775
784
|
console.error("Usage: svamp session set-title <title>");
|
|
776
785
|
process.exit(1);
|
|
777
786
|
}
|
|
778
|
-
const { sessionSetTitle } = await import('./agentCommands-
|
|
787
|
+
const { sessionSetTitle } = await import('./agentCommands-B0x3og03.mjs');
|
|
779
788
|
await sessionSetTitle(title);
|
|
780
789
|
} else if (sessionSubcommand === "set-link") {
|
|
781
790
|
const url = sessionArgs[1];
|
|
@@ -784,7 +793,7 @@ async function handleSessionCommand() {
|
|
|
784
793
|
process.exit(1);
|
|
785
794
|
}
|
|
786
795
|
const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
787
|
-
const { sessionSetLink } = await import('./agentCommands-
|
|
796
|
+
const { sessionSetLink } = await import('./agentCommands-B0x3og03.mjs');
|
|
788
797
|
await sessionSetLink(url, label);
|
|
789
798
|
} else if (sessionSubcommand === "notify") {
|
|
790
799
|
const message = sessionArgs[1];
|
|
@@ -793,7 +802,7 @@ async function handleSessionCommand() {
|
|
|
793
802
|
process.exit(1);
|
|
794
803
|
}
|
|
795
804
|
const level = parseFlagStr("--level") || "info";
|
|
796
|
-
const { sessionNotify } = await import('./agentCommands-
|
|
805
|
+
const { sessionNotify } = await import('./agentCommands-B0x3og03.mjs');
|
|
797
806
|
await sessionNotify(message, level);
|
|
798
807
|
} else if (sessionSubcommand === "broadcast") {
|
|
799
808
|
const action = sessionArgs[1];
|
|
@@ -801,7 +810,7 @@ async function handleSessionCommand() {
|
|
|
801
810
|
console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
|
|
802
811
|
process.exit(1);
|
|
803
812
|
}
|
|
804
|
-
const { sessionBroadcast } = await import('./agentCommands-
|
|
813
|
+
const { sessionBroadcast } = await import('./agentCommands-B0x3og03.mjs');
|
|
805
814
|
await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
|
|
806
815
|
} else if (sessionSubcommand === "inbox") {
|
|
807
816
|
const inboxSubcmd = sessionArgs[1];
|
|
@@ -812,7 +821,7 @@ async function handleSessionCommand() {
|
|
|
812
821
|
process.exit(1);
|
|
813
822
|
}
|
|
814
823
|
if (agentSessionId) {
|
|
815
|
-
const { inboxSend } = await import('./agentCommands-
|
|
824
|
+
const { inboxSend } = await import('./agentCommands-B0x3og03.mjs');
|
|
816
825
|
await inboxSend(sessionArgs[2], {
|
|
817
826
|
body: sessionArgs[3],
|
|
818
827
|
subject: parseFlagStr("--subject"),
|
|
@@ -827,7 +836,7 @@ async function handleSessionCommand() {
|
|
|
827
836
|
}
|
|
828
837
|
} else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
|
|
829
838
|
if (agentSessionId && !sessionArgs[2]) {
|
|
830
|
-
const { inboxList } = await import('./agentCommands-
|
|
839
|
+
const { inboxList } = await import('./agentCommands-B0x3og03.mjs');
|
|
831
840
|
await inboxList({
|
|
832
841
|
unread: hasFlag("--unread"),
|
|
833
842
|
limit: parseFlagInt("--limit"),
|
|
@@ -849,7 +858,7 @@ async function handleSessionCommand() {
|
|
|
849
858
|
process.exit(1);
|
|
850
859
|
}
|
|
851
860
|
if (agentSessionId && !sessionArgs[3]) {
|
|
852
|
-
const { inboxList } = await import('./agentCommands-
|
|
861
|
+
const { inboxList } = await import('./agentCommands-B0x3og03.mjs');
|
|
853
862
|
await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
|
|
854
863
|
} else if (sessionArgs[3]) {
|
|
855
864
|
await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
|
|
@@ -859,7 +868,7 @@ async function handleSessionCommand() {
|
|
|
859
868
|
}
|
|
860
869
|
} else if (inboxSubcmd === "reply") {
|
|
861
870
|
if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
|
|
862
|
-
const { inboxReply } = await import('./agentCommands-
|
|
871
|
+
const { inboxReply } = await import('./agentCommands-B0x3og03.mjs');
|
|
863
872
|
await inboxReply(sessionArgs[2], sessionArgs[3]);
|
|
864
873
|
} else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
|
|
865
874
|
await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
|
|
@@ -895,7 +904,7 @@ async function handleMachineCommand() {
|
|
|
895
904
|
return;
|
|
896
905
|
}
|
|
897
906
|
if (machineSubcommand === "share") {
|
|
898
|
-
const { machineShare } = await import('./commands-
|
|
907
|
+
const { machineShare } = await import('./commands-v4NWBPB2.mjs');
|
|
899
908
|
let machineId;
|
|
900
909
|
const shareArgs = [];
|
|
901
910
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
@@ -925,7 +934,7 @@ async function handleMachineCommand() {
|
|
|
925
934
|
}
|
|
926
935
|
await machineShare(machineId, { add, remove, list, configPath, showConfig });
|
|
927
936
|
} else if (machineSubcommand === "exec") {
|
|
928
|
-
const { machineExec } = await import('./commands-
|
|
937
|
+
const { machineExec } = await import('./commands-v4NWBPB2.mjs');
|
|
929
938
|
let machineId;
|
|
930
939
|
let cwd;
|
|
931
940
|
const cmdParts = [];
|
|
@@ -945,7 +954,7 @@ async function handleMachineCommand() {
|
|
|
945
954
|
}
|
|
946
955
|
await machineExec(machineId, command, cwd);
|
|
947
956
|
} else if (machineSubcommand === "info") {
|
|
948
|
-
const { machineInfo } = await import('./commands-
|
|
957
|
+
const { machineInfo } = await import('./commands-v4NWBPB2.mjs');
|
|
949
958
|
let machineId;
|
|
950
959
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
951
960
|
if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
|
|
@@ -965,10 +974,10 @@ async function handleMachineCommand() {
|
|
|
965
974
|
level = machineArgs[++i];
|
|
966
975
|
}
|
|
967
976
|
}
|
|
968
|
-
const { machineNotify } = await import('./agentCommands-
|
|
977
|
+
const { machineNotify } = await import('./agentCommands-B0x3og03.mjs');
|
|
969
978
|
await machineNotify(message, level);
|
|
970
979
|
} else if (machineSubcommand === "ls") {
|
|
971
|
-
const { machineLs } = await import('./commands-
|
|
980
|
+
const { machineLs } = await import('./commands-v4NWBPB2.mjs');
|
|
972
981
|
let machineId;
|
|
973
982
|
let showHidden = false;
|
|
974
983
|
let path;
|
|
@@ -1026,24 +1035,24 @@ Examples:
|
|
|
1026
1035
|
};
|
|
1027
1036
|
const hasFlag = (name) => fleetArgs.includes(`--${name}`);
|
|
1028
1037
|
if (sub === "status") {
|
|
1029
|
-
const { fleetStatus } = await import('./fleet-
|
|
1038
|
+
const { fleetStatus } = await import('./fleet-BPLL0ecA.mjs');
|
|
1030
1039
|
await fleetStatus();
|
|
1031
1040
|
} else if (sub === "exec") {
|
|
1032
1041
|
const command = fleetArgs.slice(1).filter((a) => !a.startsWith("--")).join(" ");
|
|
1033
|
-
const { fleetExec } = await import('./fleet-
|
|
1042
|
+
const { fleetExec } = await import('./fleet-BPLL0ecA.mjs');
|
|
1034
1043
|
await fleetExec(command, { cwd: flag("cwd") });
|
|
1035
1044
|
} else if (sub === "upgrade-claude") {
|
|
1036
|
-
const { fleetUpgradeClaude } = await import('./fleet-
|
|
1045
|
+
const { fleetUpgradeClaude } = await import('./fleet-BPLL0ecA.mjs');
|
|
1037
1046
|
await fleetUpgradeClaude({ version: flag("version", "-v") });
|
|
1038
1047
|
} else if (sub === "upgrade-svamp") {
|
|
1039
|
-
const { fleetUpgradeSvamp } = await import('./fleet-
|
|
1048
|
+
const { fleetUpgradeSvamp } = await import('./fleet-BPLL0ecA.mjs');
|
|
1040
1049
|
await fleetUpgradeSvamp({ version: flag("version", "-v"), excludeSelf: hasFlag("exclude-self") });
|
|
1041
1050
|
} else if (sub === "daemon-restart") {
|
|
1042
|
-
const { fleetDaemonRestart } = await import('./fleet-
|
|
1051
|
+
const { fleetDaemonRestart } = await import('./fleet-BPLL0ecA.mjs');
|
|
1043
1052
|
await fleetDaemonRestart({ graceful: !hasFlag("cleanup") });
|
|
1044
1053
|
} else if (sub === "push-skill") {
|
|
1045
1054
|
const name = fleetArgs[1];
|
|
1046
|
-
const { fleetPushSkill } = await import('./fleet-
|
|
1055
|
+
const { fleetPushSkill } = await import('./fleet-BPLL0ecA.mjs');
|
|
1047
1056
|
await fleetPushSkill(name);
|
|
1048
1057
|
} else {
|
|
1049
1058
|
console.error(`Unknown fleet subcommand: ${sub}`);
|
|
@@ -1474,12 +1483,15 @@ Usage:
|
|
|
1474
1483
|
svamp daemon install Install as login service (macOS/Linux) \u2014 auto-start at login
|
|
1475
1484
|
svamp daemon uninstall Remove login service
|
|
1476
1485
|
svamp daemon auth Show Claude API auth mode used for spawned sessions
|
|
1477
|
-
svamp daemon auth use-hypha-proxy
|
|
1486
|
+
svamp daemon auth use-hypha-proxy <URL>
|
|
1487
|
+
Route Claude through the Hypha LLM proxy with HYPHA_TOKEN.
|
|
1488
|
+
URL is required (no default) \u2014 e.g. https://proxy.hypha.aicell.io
|
|
1489
|
+
for the hypha-cloud cluster, or your own deployment's proxy.
|
|
1478
1490
|
svamp daemon auth use-login Use ~/.claude credentials (run "claude login" to set them)
|
|
1479
1491
|
svamp daemon auth set <URL> <KEY> Use a custom Anthropic gateway (base URL must not end in /v1)
|
|
1480
1492
|
|
|
1481
1493
|
Claude auth flags (take effect on next start/restart):
|
|
1482
|
-
svamp daemon start --use-hypha-proxy
|
|
1494
|
+
svamp daemon start --use-hypha-proxy <URL> (or --hypha-proxy-url URL)
|
|
1483
1495
|
svamp daemon start --use-claude-login
|
|
1484
1496
|
svamp daemon start --anthropic-base-url URL --anthropic-api-key KEY
|
|
1485
1497
|
|
|
@@ -1502,10 +1514,26 @@ async function applyClaudeAuthFlags(argv) {
|
|
|
1502
1514
|
"--use-hypha-proxy, --use-claude-login, and --anthropic-base-url/--anthropic-api-key are mutually exclusive"
|
|
1503
1515
|
);
|
|
1504
1516
|
}
|
|
1505
|
-
const mod = await import('./run-
|
|
1517
|
+
const mod = await import('./run-ChG07q23.mjs').then(function (n) { return n.t; });
|
|
1506
1518
|
if (hasHypha) {
|
|
1507
|
-
|
|
1508
|
-
|
|
1519
|
+
let url;
|
|
1520
|
+
const hyphaIdx = argv.indexOf("--use-hypha-proxy");
|
|
1521
|
+
if (hyphaIdx !== -1 && argv[hyphaIdx + 1] && !argv[hyphaIdx + 1].startsWith("-")) {
|
|
1522
|
+
url = argv[hyphaIdx + 1];
|
|
1523
|
+
}
|
|
1524
|
+
const urlFlagIdx = argv.indexOf("--hypha-proxy-url");
|
|
1525
|
+
if (urlFlagIdx !== -1) {
|
|
1526
|
+
const v = argv[urlFlagIdx + 1];
|
|
1527
|
+
if (!v || v.startsWith("-")) throw new Error("--hypha-proxy-url requires a value");
|
|
1528
|
+
url = v;
|
|
1529
|
+
}
|
|
1530
|
+
if (!url) {
|
|
1531
|
+
throw new Error(
|
|
1532
|
+
`--use-hypha-proxy requires a proxy URL (no default). Pass it as \`--use-hypha-proxy ${mod.EXAMPLE_HYPHA_PROXY_URL}\` or \`--hypha-proxy-url ${mod.EXAMPLE_HYPHA_PROXY_URL}\`.`
|
|
1533
|
+
);
|
|
1534
|
+
}
|
|
1535
|
+
mod.setClaudeAuthHyphaProxy(url);
|
|
1536
|
+
console.log(`Claude auth configured: hypha-proxy (${url}; uses HYPHA_TOKEN live at each spawn).`);
|
|
1509
1537
|
return;
|
|
1510
1538
|
}
|
|
1511
1539
|
if (hasLogin) {
|
|
@@ -1540,7 +1568,7 @@ async function applyDaemonShareFlag(argv) {
|
|
|
1540
1568
|
}
|
|
1541
1569
|
}
|
|
1542
1570
|
if (collected.length === 0) return;
|
|
1543
|
-
const { updateEnvFile } = await import('./run-
|
|
1571
|
+
const { updateEnvFile } = await import('./run-ChG07q23.mjs').then(function (n) { return n.t; });
|
|
1544
1572
|
const seen = /* @__PURE__ */ new Set();
|
|
1545
1573
|
const deduped = collected.filter((e) => {
|
|
1546
1574
|
const k = e.toLowerCase();
|
|
@@ -1553,15 +1581,18 @@ async function applyDaemonShareFlag(argv) {
|
|
|
1553
1581
|
}
|
|
1554
1582
|
async function handleDaemonAuthCommand(argv) {
|
|
1555
1583
|
const sub = (argv[0] || "status").toLowerCase();
|
|
1556
|
-
const mod = await import('./run-
|
|
1584
|
+
const mod = await import('./run-ChG07q23.mjs').then(function (n) { return n.t; });
|
|
1557
1585
|
if (sub === "--help" || sub === "-h" || sub === "help") {
|
|
1558
1586
|
console.log(`
|
|
1559
1587
|
svamp daemon auth \u2014 Configure how Claude subprocesses authenticate
|
|
1560
1588
|
|
|
1561
1589
|
Subcommands:
|
|
1562
1590
|
svamp daemon auth Show current mode + base URL + redacted API key
|
|
1563
|
-
svamp daemon auth use-hypha-proxy
|
|
1564
|
-
|
|
1591
|
+
svamp daemon auth use-hypha-proxy <URL>
|
|
1592
|
+
Route Claude through the Hypha LLM proxy using HYPHA_TOKEN.
|
|
1593
|
+
URL is REQUIRED \u2014 there is no hardcoded default. Use
|
|
1594
|
+
https://proxy.hypha.aicell.io for the hypha-cloud cluster, or
|
|
1595
|
+
your own deployment's proxy. Persisted as SVAMP_HYPHA_PROXY_URL.
|
|
1565
1596
|
Token is resolved live at each spawn, so a
|
|
1566
1597
|
\`svamp login\` refresh takes effect immediately.
|
|
1567
1598
|
svamp daemon auth use-login Use ~/.claude credentials written by \`claude login\`.
|
|
@@ -1583,14 +1614,23 @@ one step: --use-hypha-proxy / --use-claude-login / --anthropic-base-url URL --an
|
|
|
1583
1614
|
if (s.mode === "login") {
|
|
1584
1615
|
console.log(' (Claude subprocesses will use credentials from ~/.claude \u2014 run "claude login" to set them.)');
|
|
1585
1616
|
}
|
|
1617
|
+
if (s.hyphaProxyUrlMissing) {
|
|
1618
|
+
console.log(` WARNING: mode=hypha but no proxy URL configured \u2014 run "svamp daemon auth use-hypha-proxy <URL>" (e.g. ${mod.EXAMPLE_HYPHA_PROXY_URL}).`);
|
|
1619
|
+
}
|
|
1586
1620
|
if (s.hyphaTokenMissing) {
|
|
1587
1621
|
console.log(' WARNING: mode=hypha but HYPHA_TOKEN is not set \u2014 run "svamp login" first.');
|
|
1588
1622
|
}
|
|
1589
1623
|
return;
|
|
1590
1624
|
}
|
|
1591
1625
|
if (sub === "use-hypha-proxy") {
|
|
1592
|
-
|
|
1593
|
-
|
|
1626
|
+
const url = argv[1] && !argv[1].startsWith("-") ? argv[1] : void 0;
|
|
1627
|
+
if (!url) {
|
|
1628
|
+
console.error("Usage: svamp daemon auth use-hypha-proxy <URL>");
|
|
1629
|
+
console.error(` A proxy URL is required (no default). Example: svamp daemon auth use-hypha-proxy ${mod.EXAMPLE_HYPHA_PROXY_URL}`);
|
|
1630
|
+
process.exit(1);
|
|
1631
|
+
}
|
|
1632
|
+
mod.setClaudeAuthHyphaProxy(url);
|
|
1633
|
+
console.log(`Claude auth set to hypha-proxy (${url}). Run "svamp daemon restart" to apply.`);
|
|
1594
1634
|
return;
|
|
1595
1635
|
}
|
|
1596
1636
|
if (sub === "use-login" || sub === "use-claude-login") {
|
|
@@ -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-v4NWBPB2.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-ChG07q23.mjs';
|
|
9
9
|
import 'os';
|
|
10
10
|
import 'fs/promises';
|
|
11
11
|
import 'url';
|
|
@@ -68,7 +68,7 @@ async function serviceExpose(args) {
|
|
|
68
68
|
});
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
71
|
+
const { connectAndGetMachine } = await import('./commands-v4NWBPB2.mjs');
|
|
72
72
|
const { server, machine } = await connectAndGetMachine();
|
|
73
73
|
try {
|
|
74
74
|
const status = await machine.tunnelStart({
|
|
@@ -132,7 +132,7 @@ async function serviceServe(args) {
|
|
|
132
132
|
}
|
|
133
133
|
async function serviceList(_args) {
|
|
134
134
|
try {
|
|
135
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
135
|
+
const { connectAndGetMachine } = await import('./commands-v4NWBPB2.mjs');
|
|
136
136
|
const { server, machine } = await connectAndGetMachine();
|
|
137
137
|
try {
|
|
138
138
|
const tunnels = await machine.tunnelList({});
|
|
@@ -161,7 +161,7 @@ async function serviceDelete(args) {
|
|
|
161
161
|
process.exit(1);
|
|
162
162
|
}
|
|
163
163
|
try {
|
|
164
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
164
|
+
const { connectAndGetMachine } = await import('./commands-v4NWBPB2.mjs');
|
|
165
165
|
const { server, machine } = await connectAndGetMachine();
|
|
166
166
|
try {
|
|
167
167
|
await machine.tunnelStop({ name });
|
|
@@ -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 { n as normalizeAllowedUser, l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha, i as buildSessionShareUrl, j as buildMachineShareUrl } from './run-
|
|
5
|
+
import { n as normalizeAllowedUser, l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha, i as buildSessionShareUrl, j as buildMachineShareUrl } from './run-ChG07q23.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
8
8
|
import 'fs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import os from 'node:os';
|
|
4
|
-
import { c as connectToHypha } from './run-
|
|
4
|
+
import { c as connectToHypha } from './run-ChG07q23.mjs';
|
|
5
5
|
import { PINNED_CLAUDE_CODE_VERSION } from './pinnedClaudeCode-HydRNEt7.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
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-ChG07q23.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 { resolve, join } from 'node:path';
|
|
4
4
|
import { existsSync, readFileSync, watch } from 'node:fs';
|
|
5
|
-
import { c as connectToHypha, a as registerSessionService, k as generateHookSettings } from './run-
|
|
5
|
+
import { c as connectToHypha, a as registerSessionService, k as generateHookSettings } from './run-ChG07q23.mjs';
|
|
6
6
|
import { createServer } from 'node:http';
|
|
7
7
|
import { spawn } from 'node:child_process';
|
|
8
8
|
import { createInterface } from 'node:readline';
|
|
@@ -5350,13 +5350,33 @@ function shouldIsolate(input) {
|
|
|
5350
5350
|
return input.optionsSecurityContext !== null && input.optionsSecurityContext !== void 0;
|
|
5351
5351
|
}
|
|
5352
5352
|
|
|
5353
|
-
const
|
|
5353
|
+
const EXAMPLE_HYPHA_PROXY_URL = "https://proxy.hypha.aicell.io";
|
|
5354
5354
|
const MODE_KEY = "SVAMP_CLAUDE_PROXY";
|
|
5355
|
+
const HYPHA_PROXY_URL_KEY = "SVAMP_HYPHA_PROXY_URL";
|
|
5355
5356
|
const MANAGED_KEYS = /* @__PURE__ */ new Set([
|
|
5356
5357
|
MODE_KEY,
|
|
5358
|
+
HYPHA_PROXY_URL_KEY,
|
|
5357
5359
|
"ANTHROPIC_BASE_URL",
|
|
5358
5360
|
"ANTHROPIC_API_KEY"
|
|
5359
5361
|
]);
|
|
5362
|
+
function normalizeProxyUrl(raw) {
|
|
5363
|
+
const trimmed = raw.trim().replace(/\/+$/, "");
|
|
5364
|
+
if (trimmed.endsWith("/v1")) {
|
|
5365
|
+
throw new Error(
|
|
5366
|
+
"Hypha proxy URL must not end in /v1 \u2014 the SDK appends it, producing double /v1/v1/messages"
|
|
5367
|
+
);
|
|
5368
|
+
}
|
|
5369
|
+
return trimmed;
|
|
5370
|
+
}
|
|
5371
|
+
function resolveHyphaProxyUrl() {
|
|
5372
|
+
const configured = (process.env[HYPHA_PROXY_URL_KEY] || "").trim();
|
|
5373
|
+
if (!configured) return void 0;
|
|
5374
|
+
try {
|
|
5375
|
+
return normalizeProxyUrl(configured);
|
|
5376
|
+
} catch {
|
|
5377
|
+
return void 0;
|
|
5378
|
+
}
|
|
5379
|
+
}
|
|
5360
5380
|
function envFilePath() {
|
|
5361
5381
|
const svampHome = process.env.SVAMP_HOME || join$1(homedir(), ".svamp");
|
|
5362
5382
|
return join$1(svampHome, ".env");
|
|
@@ -5417,11 +5437,13 @@ function getClaudeAuthStatus() {
|
|
|
5417
5437
|
const mode = currentMode();
|
|
5418
5438
|
if (mode === "hypha") {
|
|
5419
5439
|
const token = process.env.HYPHA_TOKEN;
|
|
5440
|
+
const proxyUrl = resolveHyphaProxyUrl();
|
|
5420
5441
|
return {
|
|
5421
5442
|
mode,
|
|
5422
|
-
baseUrl:
|
|
5443
|
+
baseUrl: proxyUrl,
|
|
5423
5444
|
apiKeyPreview: redactKey(token),
|
|
5424
|
-
hyphaTokenMissing: !token
|
|
5445
|
+
hyphaTokenMissing: !token,
|
|
5446
|
+
hyphaProxyUrlMissing: !proxyUrl
|
|
5425
5447
|
};
|
|
5426
5448
|
}
|
|
5427
5449
|
if (mode === "custom") {
|
|
@@ -5433,9 +5455,15 @@ function getClaudeAuthStatus() {
|
|
|
5433
5455
|
}
|
|
5434
5456
|
return { mode: "login" };
|
|
5435
5457
|
}
|
|
5436
|
-
function setClaudeAuthHyphaProxy() {
|
|
5458
|
+
function setClaudeAuthHyphaProxy(url) {
|
|
5459
|
+
if (!url || !url.trim()) {
|
|
5460
|
+
throw new Error(
|
|
5461
|
+
`A Hypha proxy URL is required (no default). Example: svamp daemon auth use-hypha-proxy ${EXAMPLE_HYPHA_PROXY_URL}`
|
|
5462
|
+
);
|
|
5463
|
+
}
|
|
5437
5464
|
updateEnvFile({
|
|
5438
5465
|
[MODE_KEY]: "hypha",
|
|
5466
|
+
[HYPHA_PROXY_URL_KEY]: normalizeProxyUrl(url),
|
|
5439
5467
|
// Hypha mode resolves token live at spawn — no stored copy.
|
|
5440
5468
|
ANTHROPIC_BASE_URL: void 0,
|
|
5441
5469
|
ANTHROPIC_API_KEY: void 0
|
|
@@ -5444,6 +5472,7 @@ function setClaudeAuthHyphaProxy() {
|
|
|
5444
5472
|
function setClaudeAuthLogin() {
|
|
5445
5473
|
updateEnvFile({
|
|
5446
5474
|
[MODE_KEY]: void 0,
|
|
5475
|
+
[HYPHA_PROXY_URL_KEY]: void 0,
|
|
5447
5476
|
ANTHROPIC_BASE_URL: void 0,
|
|
5448
5477
|
ANTHROPIC_API_KEY: void 0
|
|
5449
5478
|
});
|
|
@@ -5459,6 +5488,7 @@ function setClaudeAuthCustom(baseUrl, apiKey) {
|
|
|
5459
5488
|
}
|
|
5460
5489
|
updateEnvFile({
|
|
5461
5490
|
[MODE_KEY]: "custom",
|
|
5491
|
+
[HYPHA_PROXY_URL_KEY]: void 0,
|
|
5462
5492
|
ANTHROPIC_BASE_URL: trimmed,
|
|
5463
5493
|
ANTHROPIC_API_KEY: apiKey
|
|
5464
5494
|
});
|
|
@@ -5466,15 +5496,21 @@ function setClaudeAuthCustom(baseUrl, apiKey) {
|
|
|
5466
5496
|
function applyClaudeProxyEnv(spawnEnv) {
|
|
5467
5497
|
const mode = currentMode();
|
|
5468
5498
|
if (mode === "hypha") {
|
|
5499
|
+
const proxyUrl = resolveHyphaProxyUrl();
|
|
5500
|
+
if (!proxyUrl) {
|
|
5501
|
+
delete spawnEnv.ANTHROPIC_BASE_URL;
|
|
5502
|
+
delete spawnEnv.ANTHROPIC_API_KEY;
|
|
5503
|
+
return `hypha mode but ${HYPHA_PROXY_URL_KEY} not configured \u2014 run \`svamp daemon auth use-hypha-proxy <URL>\`; falling back to login`;
|
|
5504
|
+
}
|
|
5469
5505
|
const token = process.env.HYPHA_TOKEN;
|
|
5470
5506
|
if (!token) {
|
|
5471
5507
|
delete spawnEnv.ANTHROPIC_BASE_URL;
|
|
5472
5508
|
delete spawnEnv.ANTHROPIC_API_KEY;
|
|
5473
5509
|
return "hypha mode but HYPHA_TOKEN missing \u2014 falling back to login";
|
|
5474
5510
|
}
|
|
5475
|
-
spawnEnv.ANTHROPIC_BASE_URL =
|
|
5511
|
+
spawnEnv.ANTHROPIC_BASE_URL = proxyUrl;
|
|
5476
5512
|
spawnEnv.ANTHROPIC_API_KEY = token;
|
|
5477
|
-
return `hypha proxy (${
|
|
5513
|
+
return `hypha proxy (${proxyUrl})`;
|
|
5478
5514
|
}
|
|
5479
5515
|
if (mode === "custom") {
|
|
5480
5516
|
const url = process.env.ANTHROPIC_BASE_URL;
|
|
@@ -5496,10 +5532,11 @@ const MANAGED_ENV_KEYS = Array.from(MANAGED_KEYS);
|
|
|
5496
5532
|
|
|
5497
5533
|
var claudeAuth = /*#__PURE__*/Object.freeze({
|
|
5498
5534
|
__proto__: null,
|
|
5499
|
-
|
|
5535
|
+
EXAMPLE_HYPHA_PROXY_URL: EXAMPLE_HYPHA_PROXY_URL,
|
|
5500
5536
|
MANAGED_ENV_KEYS: MANAGED_ENV_KEYS,
|
|
5501
5537
|
applyClaudeProxyEnv: applyClaudeProxyEnv,
|
|
5502
5538
|
getClaudeAuthStatus: getClaudeAuthStatus,
|
|
5539
|
+
resolveHyphaProxyUrl: resolveHyphaProxyUrl,
|
|
5503
5540
|
setClaudeAuthCustom: setClaudeAuthCustom,
|
|
5504
5541
|
setClaudeAuthHyphaProxy: setClaudeAuthHyphaProxy,
|
|
5505
5542
|
setClaudeAuthLogin: setClaudeAuthLogin,
|
|
@@ -7976,7 +8013,7 @@ async function startDaemon(options) {
|
|
|
7976
8013
|
const list = loadExposedTunnels().filter((t) => t.name !== name);
|
|
7977
8014
|
saveExposedTunnels(list);
|
|
7978
8015
|
}
|
|
7979
|
-
const { ServeManager } = await import('./serveManager-
|
|
8016
|
+
const { ServeManager } = await import('./serveManager-CLezyS3P.mjs');
|
|
7980
8017
|
const serveManager = new ServeManager(SVAMP_HOME, (msg) => logger.log(`[SERVE] ${msg}`), hyphaServerUrl);
|
|
7981
8018
|
ensureAutoInstalledSkills(logger).catch(() => {
|
|
7982
8019
|
});
|
|
@@ -10601,6 +10638,19 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
10601
10638
|
// Legacy; debug service uses session index now
|
|
10602
10639
|
});
|
|
10603
10640
|
logger.log(`Debug service registered: svamp-debug-${machineId}`);
|
|
10641
|
+
const supervised = process.env.SVAMP_SUPERVISED === "1";
|
|
10642
|
+
const localState = {
|
|
10643
|
+
pid: process.pid,
|
|
10644
|
+
startTime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
10645
|
+
version: DAEMON_VERSION,
|
|
10646
|
+
hyphaServerUrl,
|
|
10647
|
+
workspace: server.config.workspace,
|
|
10648
|
+
machineId,
|
|
10649
|
+
hyphaClientId: server.config.client_id,
|
|
10650
|
+
supervised
|
|
10651
|
+
};
|
|
10652
|
+
writeDaemonStateFile(localState);
|
|
10653
|
+
logger.log("Daemon state file written \u2014 daemon is up; restoring mounts/sessions in background");
|
|
10604
10654
|
await serveManager.restore();
|
|
10605
10655
|
const persistedSessions = loadPersistedSessions();
|
|
10606
10656
|
try {
|
|
@@ -10762,18 +10812,6 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
10762
10812
|
} catch (err) {
|
|
10763
10813
|
logger.log("Could not generate token (server may not support it):", err);
|
|
10764
10814
|
}
|
|
10765
|
-
const supervised = process.env.SVAMP_SUPERVISED === "1";
|
|
10766
|
-
const localState = {
|
|
10767
|
-
pid: process.pid,
|
|
10768
|
-
startTime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
10769
|
-
version: DAEMON_VERSION,
|
|
10770
|
-
hyphaServerUrl,
|
|
10771
|
-
workspace: server.config.workspace,
|
|
10772
|
-
machineId,
|
|
10773
|
-
hyphaClientId: server.config.client_id,
|
|
10774
|
-
supervised
|
|
10775
|
-
};
|
|
10776
|
-
writeDaemonStateFile(localState);
|
|
10777
10815
|
console.log("Svamp daemon started successfully!");
|
|
10778
10816
|
console.log(` Machine ID: ${machineId}`);
|
|
10779
10817
|
console.log(` Hypha server: ${hyphaServerUrl}`);
|
|
@@ -54,7 +54,7 @@ async function handleServeCommand() {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
async function serveAdd(args, machineId) {
|
|
57
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
57
|
+
const { connectAndGetMachine } = await import('./commands-v4NWBPB2.mjs');
|
|
58
58
|
const pos = positionalArgs(args);
|
|
59
59
|
const name = pos[0];
|
|
60
60
|
if (!name) {
|
|
@@ -93,7 +93,7 @@ async function serveAdd(args, machineId) {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
async function serveApply(args, machineId) {
|
|
96
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
96
|
+
const { connectAndGetMachine } = await import('./commands-v4NWBPB2.mjs');
|
|
97
97
|
const fs = await import('fs');
|
|
98
98
|
const yaml = await import('yaml');
|
|
99
99
|
const file = positionalArgs(args)[0];
|
|
@@ -182,7 +182,7 @@ async function serveApply(args, machineId) {
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
async function serveRemove(args, machineId) {
|
|
185
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
185
|
+
const { connectAndGetMachine } = await import('./commands-v4NWBPB2.mjs');
|
|
186
186
|
const pos = positionalArgs(args);
|
|
187
187
|
const name = pos[0];
|
|
188
188
|
if (!name) {
|
|
@@ -202,7 +202,7 @@ async function serveRemove(args, machineId) {
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
async function serveList(args, machineId) {
|
|
205
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
205
|
+
const { connectAndGetMachine } = await import('./commands-v4NWBPB2.mjs');
|
|
206
206
|
const all = hasFlag(args, "--all", "-a");
|
|
207
207
|
const json = hasFlag(args, "--json");
|
|
208
208
|
const sessionId = getFlag(args, "--session");
|
|
@@ -235,7 +235,7 @@ async function serveList(args, machineId) {
|
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
async function serveInfo(machineId) {
|
|
238
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
238
|
+
const { connectAndGetMachine } = await import('./commands-v4NWBPB2.mjs');
|
|
239
239
|
const { machine, server } = await connectAndGetMachine(machineId);
|
|
240
240
|
try {
|
|
241
241
|
const info = await machine.serveInfo();
|
|
@@ -4,7 +4,7 @@ import * as fs from 'fs';
|
|
|
4
4
|
import * as http from 'http';
|
|
5
5
|
import * as net from 'net';
|
|
6
6
|
import * as path from 'path';
|
|
7
|
-
import { S as ServeAuth, h as hasCookieToken } from './run-
|
|
7
|
+
import { S as ServeAuth, h as hasCookieToken } from './run-ChG07q23.mjs';
|
|
8
8
|
import 'os';
|
|
9
9
|
import 'fs/promises';
|
|
10
10
|
import 'url';
|