svamp-cli 0.2.41 → 0.2.42
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-BvmStLoh.mjs → agentCommands-BYVKsV4A.mjs} +2 -2
- package/dist/cli.mjs +32 -32
- package/dist/{commands-DjeK7-E9.mjs → commands-BRVmRucU.mjs} +43 -3
- package/dist/{commands-DNT-V_p6.mjs → commands-C0-rJNmP.mjs} +6 -4
- package/dist/{commands-CWKFZm9s.mjs → commands-Cq0BNIoM.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{package-CZ43ufBM.mjs → package-CUmp9KnH.mjs} +1 -1
- package/dist/{run--6SzG2CH.mjs → run-Bzj6KYrq.mjs} +1 -1
- package/dist/{run-CRwkPQDW.mjs → run-Cvrrcm0a.mjs} +2 -2
- package/dist/{serveCommands-B9Dq2loo.mjs → serveCommands-BFm4z9G0.mjs} +4 -4
- 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-Cq0BNIoM.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-Cq0BNIoM.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-Cvrrcm0a.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -42,7 +42,7 @@ async function main() {
|
|
|
42
42
|
console.error(`svamp daemon restart: ${err.message || err}`);
|
|
43
43
|
process.exit(1);
|
|
44
44
|
}
|
|
45
|
-
const { restartDaemon } = await import('./run-
|
|
45
|
+
const { restartDaemon } = await import('./run-Cvrrcm0a.mjs').then(function (n) { return n.n; });
|
|
46
46
|
await restartDaemon();
|
|
47
47
|
process.exit(0);
|
|
48
48
|
}
|
|
@@ -264,7 +264,7 @@ async function main() {
|
|
|
264
264
|
console.error("svamp service: Service commands are not available in sandboxed sessions.");
|
|
265
265
|
process.exit(1);
|
|
266
266
|
}
|
|
267
|
-
const { handleServiceCommand } = await import('./commands-
|
|
267
|
+
const { handleServiceCommand } = await import('./commands-BRVmRucU.mjs');
|
|
268
268
|
await handleServiceCommand();
|
|
269
269
|
} else if (subcommand === "serve") {
|
|
270
270
|
const { isSandboxed: isSandboxedServe } = await import('./sandboxDetect-DNTcbgWD.mjs');
|
|
@@ -272,7 +272,7 @@ async function main() {
|
|
|
272
272
|
console.error("svamp serve: Serve commands are not available in sandboxed sessions.");
|
|
273
273
|
process.exit(1);
|
|
274
274
|
}
|
|
275
|
-
const { handleServeCommand } = await import('./serveCommands-
|
|
275
|
+
const { handleServeCommand } = await import('./serveCommands-BFm4z9G0.mjs');
|
|
276
276
|
await handleServeCommand();
|
|
277
277
|
process.exit(0);
|
|
278
278
|
} else if (subcommand === "process" || subcommand === "proc") {
|
|
@@ -281,7 +281,7 @@ async function main() {
|
|
|
281
281
|
console.error("svamp process: Process commands are not available in sandboxed sessions.");
|
|
282
282
|
process.exit(1);
|
|
283
283
|
}
|
|
284
|
-
const { processCommand } = await import('./commands-
|
|
284
|
+
const { processCommand } = await import('./commands-C0-rJNmP.mjs');
|
|
285
285
|
let machineId;
|
|
286
286
|
const processArgs = args.slice(1);
|
|
287
287
|
const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
|
|
@@ -299,7 +299,7 @@ async function main() {
|
|
|
299
299
|
} else if (!subcommand || subcommand === "start") {
|
|
300
300
|
await handleInteractiveCommand();
|
|
301
301
|
} else if (subcommand === "--version" || subcommand === "-v") {
|
|
302
|
-
const pkg = await import('./package-
|
|
302
|
+
const pkg = await import('./package-CUmp9KnH.mjs').catch(() => ({ default: { version: "unknown" } }));
|
|
303
303
|
console.log(`svamp version: ${pkg.default.version}`);
|
|
304
304
|
} else {
|
|
305
305
|
console.error(`Unknown command: ${subcommand}`);
|
|
@@ -308,7 +308,7 @@ async function main() {
|
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
async function handleInteractiveCommand() {
|
|
311
|
-
const { runInteractive } = await import('./run
|
|
311
|
+
const { runInteractive } = await import('./run-Bzj6KYrq.mjs');
|
|
312
312
|
const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
|
|
313
313
|
let directory = process.cwd();
|
|
314
314
|
let resumeSessionId;
|
|
@@ -353,7 +353,7 @@ async function handleAgentCommand() {
|
|
|
353
353
|
return;
|
|
354
354
|
}
|
|
355
355
|
if (agentArgs[0] === "list") {
|
|
356
|
-
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-
|
|
356
|
+
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-Cvrrcm0a.mjs').then(function (n) { return n.i; });
|
|
357
357
|
console.log("Known agents:");
|
|
358
358
|
for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
|
|
359
359
|
console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
|
|
@@ -365,7 +365,7 @@ async function handleAgentCommand() {
|
|
|
365
365
|
console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
|
|
366
366
|
return;
|
|
367
367
|
}
|
|
368
|
-
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-
|
|
368
|
+
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-Cvrrcm0a.mjs').then(function (n) { return n.i; });
|
|
369
369
|
let cwd = process.cwd();
|
|
370
370
|
const filteredArgs = [];
|
|
371
371
|
for (let i = 0; i < agentArgs.length; i++) {
|
|
@@ -389,12 +389,12 @@ async function handleAgentCommand() {
|
|
|
389
389
|
console.log(`Starting ${config.agentName} agent in ${cwd}...`);
|
|
390
390
|
let backend;
|
|
391
391
|
if (KNOWN_MCP_AGENTS[config.agentName]) {
|
|
392
|
-
const { CodexMcpBackend } = await import('./run-
|
|
392
|
+
const { CodexMcpBackend } = await import('./run-Cvrrcm0a.mjs').then(function (n) { return n.j; });
|
|
393
393
|
backend = new CodexMcpBackend({ cwd, log: logFn });
|
|
394
394
|
} else {
|
|
395
|
-
const { AcpBackend } = await import('./run-
|
|
396
|
-
const { GeminiTransport } = await import('./run-
|
|
397
|
-
const { DefaultTransport } = await import('./run-
|
|
395
|
+
const { AcpBackend } = await import('./run-Cvrrcm0a.mjs').then(function (n) { return n.h; });
|
|
396
|
+
const { GeminiTransport } = await import('./run-Cvrrcm0a.mjs').then(function (n) { return n.G; });
|
|
397
|
+
const { DefaultTransport } = await import('./run-Cvrrcm0a.mjs').then(function (n) { return n.D; });
|
|
398
398
|
const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
|
|
399
399
|
backend = new AcpBackend({
|
|
400
400
|
agentName: config.agentName,
|
|
@@ -521,7 +521,7 @@ async function handleSessionCommand() {
|
|
|
521
521
|
process.exit(1);
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
|
-
const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-
|
|
524
|
+
const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-Cq0BNIoM.mjs');
|
|
525
525
|
const parseFlagStr = (flag, shortFlag) => {
|
|
526
526
|
for (let i = 1; i < sessionArgs.length; i++) {
|
|
527
527
|
if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
|
|
@@ -581,7 +581,7 @@ async function handleSessionCommand() {
|
|
|
581
581
|
allowDomain.push(sessionArgs[++i]);
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
const { parseShareArg } = await import('./commands-
|
|
584
|
+
const { parseShareArg } = await import('./commands-Cq0BNIoM.mjs');
|
|
585
585
|
const shareEntries = share.map((s) => parseShareArg(s));
|
|
586
586
|
await sessionSpawn(agent, dir, targetMachineId, {
|
|
587
587
|
message,
|
|
@@ -667,7 +667,7 @@ async function handleSessionCommand() {
|
|
|
667
667
|
console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
|
|
668
668
|
process.exit(1);
|
|
669
669
|
}
|
|
670
|
-
const { sessionApprove } = await import('./commands-
|
|
670
|
+
const { sessionApprove } = await import('./commands-Cq0BNIoM.mjs');
|
|
671
671
|
const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
672
672
|
await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
|
|
673
673
|
json: hasFlag("--json")
|
|
@@ -677,7 +677,7 @@ async function handleSessionCommand() {
|
|
|
677
677
|
console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
|
|
678
678
|
process.exit(1);
|
|
679
679
|
}
|
|
680
|
-
const { sessionDeny } = await import('./commands-
|
|
680
|
+
const { sessionDeny } = await import('./commands-Cq0BNIoM.mjs');
|
|
681
681
|
const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
682
682
|
await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
|
|
683
683
|
json: hasFlag("--json")
|
|
@@ -713,7 +713,7 @@ async function handleSessionCommand() {
|
|
|
713
713
|
console.error("Usage: svamp session set-title <title>");
|
|
714
714
|
process.exit(1);
|
|
715
715
|
}
|
|
716
|
-
const { sessionSetTitle } = await import('./agentCommands-
|
|
716
|
+
const { sessionSetTitle } = await import('./agentCommands-BYVKsV4A.mjs');
|
|
717
717
|
await sessionSetTitle(title);
|
|
718
718
|
} else if (sessionSubcommand === "set-link") {
|
|
719
719
|
const url = sessionArgs[1];
|
|
@@ -722,7 +722,7 @@ async function handleSessionCommand() {
|
|
|
722
722
|
process.exit(1);
|
|
723
723
|
}
|
|
724
724
|
const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
725
|
-
const { sessionSetLink } = await import('./agentCommands-
|
|
725
|
+
const { sessionSetLink } = await import('./agentCommands-BYVKsV4A.mjs');
|
|
726
726
|
await sessionSetLink(url, label);
|
|
727
727
|
} else if (sessionSubcommand === "notify") {
|
|
728
728
|
const message = sessionArgs[1];
|
|
@@ -731,7 +731,7 @@ async function handleSessionCommand() {
|
|
|
731
731
|
process.exit(1);
|
|
732
732
|
}
|
|
733
733
|
const level = parseFlagStr("--level") || "info";
|
|
734
|
-
const { sessionNotify } = await import('./agentCommands-
|
|
734
|
+
const { sessionNotify } = await import('./agentCommands-BYVKsV4A.mjs');
|
|
735
735
|
await sessionNotify(message, level);
|
|
736
736
|
} else if (sessionSubcommand === "broadcast") {
|
|
737
737
|
const action = sessionArgs[1];
|
|
@@ -739,7 +739,7 @@ async function handleSessionCommand() {
|
|
|
739
739
|
console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
|
|
740
740
|
process.exit(1);
|
|
741
741
|
}
|
|
742
|
-
const { sessionBroadcast } = await import('./agentCommands-
|
|
742
|
+
const { sessionBroadcast } = await import('./agentCommands-BYVKsV4A.mjs');
|
|
743
743
|
await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
|
|
744
744
|
} else if (sessionSubcommand === "inbox") {
|
|
745
745
|
const inboxSubcmd = sessionArgs[1];
|
|
@@ -750,7 +750,7 @@ async function handleSessionCommand() {
|
|
|
750
750
|
process.exit(1);
|
|
751
751
|
}
|
|
752
752
|
if (agentSessionId) {
|
|
753
|
-
const { inboxSend } = await import('./agentCommands-
|
|
753
|
+
const { inboxSend } = await import('./agentCommands-BYVKsV4A.mjs');
|
|
754
754
|
await inboxSend(sessionArgs[2], {
|
|
755
755
|
body: sessionArgs[3],
|
|
756
756
|
subject: parseFlagStr("--subject"),
|
|
@@ -765,7 +765,7 @@ async function handleSessionCommand() {
|
|
|
765
765
|
}
|
|
766
766
|
} else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
|
|
767
767
|
if (agentSessionId && !sessionArgs[2]) {
|
|
768
|
-
const { inboxList } = await import('./agentCommands-
|
|
768
|
+
const { inboxList } = await import('./agentCommands-BYVKsV4A.mjs');
|
|
769
769
|
await inboxList({
|
|
770
770
|
unread: hasFlag("--unread"),
|
|
771
771
|
limit: parseFlagInt("--limit"),
|
|
@@ -787,7 +787,7 @@ async function handleSessionCommand() {
|
|
|
787
787
|
process.exit(1);
|
|
788
788
|
}
|
|
789
789
|
if (agentSessionId && !sessionArgs[3]) {
|
|
790
|
-
const { inboxList } = await import('./agentCommands-
|
|
790
|
+
const { inboxList } = await import('./agentCommands-BYVKsV4A.mjs');
|
|
791
791
|
await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
|
|
792
792
|
} else if (sessionArgs[3]) {
|
|
793
793
|
await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
|
|
@@ -797,7 +797,7 @@ async function handleSessionCommand() {
|
|
|
797
797
|
}
|
|
798
798
|
} else if (inboxSubcmd === "reply") {
|
|
799
799
|
if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
|
|
800
|
-
const { inboxReply } = await import('./agentCommands-
|
|
800
|
+
const { inboxReply } = await import('./agentCommands-BYVKsV4A.mjs');
|
|
801
801
|
await inboxReply(sessionArgs[2], sessionArgs[3]);
|
|
802
802
|
} else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
|
|
803
803
|
await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
|
|
@@ -833,7 +833,7 @@ async function handleMachineCommand() {
|
|
|
833
833
|
return;
|
|
834
834
|
}
|
|
835
835
|
if (machineSubcommand === "share") {
|
|
836
|
-
const { machineShare } = await import('./commands-
|
|
836
|
+
const { machineShare } = await import('./commands-Cq0BNIoM.mjs');
|
|
837
837
|
let machineId;
|
|
838
838
|
const shareArgs = [];
|
|
839
839
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
@@ -863,7 +863,7 @@ async function handleMachineCommand() {
|
|
|
863
863
|
}
|
|
864
864
|
await machineShare(machineId, { add, remove, list, configPath, showConfig });
|
|
865
865
|
} else if (machineSubcommand === "exec") {
|
|
866
|
-
const { machineExec } = await import('./commands-
|
|
866
|
+
const { machineExec } = await import('./commands-Cq0BNIoM.mjs');
|
|
867
867
|
let machineId;
|
|
868
868
|
let cwd;
|
|
869
869
|
const cmdParts = [];
|
|
@@ -883,7 +883,7 @@ async function handleMachineCommand() {
|
|
|
883
883
|
}
|
|
884
884
|
await machineExec(machineId, command, cwd);
|
|
885
885
|
} else if (machineSubcommand === "info") {
|
|
886
|
-
const { machineInfo } = await import('./commands-
|
|
886
|
+
const { machineInfo } = await import('./commands-Cq0BNIoM.mjs');
|
|
887
887
|
let machineId;
|
|
888
888
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
889
889
|
if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
|
|
@@ -903,10 +903,10 @@ async function handleMachineCommand() {
|
|
|
903
903
|
level = machineArgs[++i];
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
|
-
const { machineNotify } = await import('./agentCommands-
|
|
906
|
+
const { machineNotify } = await import('./agentCommands-BYVKsV4A.mjs');
|
|
907
907
|
await machineNotify(message, level);
|
|
908
908
|
} else if (machineSubcommand === "ls") {
|
|
909
|
-
const { machineLs } = await import('./commands-
|
|
909
|
+
const { machineLs } = await import('./commands-Cq0BNIoM.mjs');
|
|
910
910
|
let machineId;
|
|
911
911
|
let showHidden = false;
|
|
912
912
|
let path;
|
|
@@ -1368,7 +1368,7 @@ async function applyClaudeAuthFlags(argv) {
|
|
|
1368
1368
|
"--use-hypha-proxy, --use-claude-login, and --anthropic-base-url/--anthropic-api-key are mutually exclusive"
|
|
1369
1369
|
);
|
|
1370
1370
|
}
|
|
1371
|
-
const mod = await import('./run-
|
|
1371
|
+
const mod = await import('./run-Cvrrcm0a.mjs').then(function (n) { return n.k; });
|
|
1372
1372
|
if (hasHypha) {
|
|
1373
1373
|
mod.setClaudeAuthHyphaProxy();
|
|
1374
1374
|
console.log("Claude auth configured: hypha-proxy (uses HYPHA_TOKEN live at each spawn).");
|
|
@@ -1391,7 +1391,7 @@ async function applyClaudeAuthFlags(argv) {
|
|
|
1391
1391
|
}
|
|
1392
1392
|
async function handleDaemonAuthCommand(argv) {
|
|
1393
1393
|
const sub = (argv[0] || "status").toLowerCase();
|
|
1394
|
-
const mod = await import('./run-
|
|
1394
|
+
const mod = await import('./run-Cvrrcm0a.mjs').then(function (n) { return n.k; });
|
|
1395
1395
|
if (sub === "--help" || sub === "-h" || sub === "help") {
|
|
1396
1396
|
console.log(`
|
|
1397
1397
|
svamp daemon auth \u2014 Configure how Claude subprocesses authenticate
|
|
@@ -96,8 +96,27 @@ async function serviceServe(args) {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
async function serviceList(_args) {
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
try {
|
|
100
|
+
const { connectAndGetMachine } = await import('./commands-Cq0BNIoM.mjs');
|
|
101
|
+
const { server, machine } = await connectAndGetMachine();
|
|
102
|
+
try {
|
|
103
|
+
const tunnels = await machine.tunnelList({});
|
|
104
|
+
if (!tunnels || tunnels.length === 0) {
|
|
105
|
+
console.log("No active daemon-managed tunnels.");
|
|
106
|
+
console.log("Standalone foreground tunnels (from `svamp service expose`) are not listed here \u2014 check `pgrep -af frpc`.");
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
console.log("Active daemon-managed tunnels:");
|
|
110
|
+
for (const t of tunnels) {
|
|
111
|
+
console.log(` ${t.name} \u2014 ${t.connected ? "connected" : "disconnected"}`);
|
|
112
|
+
}
|
|
113
|
+
} finally {
|
|
114
|
+
await server.disconnect();
|
|
115
|
+
}
|
|
116
|
+
} catch (err) {
|
|
117
|
+
console.error(`Error listing tunnels: ${err.message}`);
|
|
118
|
+
process.exit(1);
|
|
119
|
+
}
|
|
101
120
|
}
|
|
102
121
|
async function serviceDelete(args) {
|
|
103
122
|
const positional = positionalArgs(args);
|
|
@@ -106,7 +125,28 @@ async function serviceDelete(args) {
|
|
|
106
125
|
console.error("Usage: svamp service delete <name>");
|
|
107
126
|
process.exit(1);
|
|
108
127
|
}
|
|
109
|
-
|
|
128
|
+
try {
|
|
129
|
+
const { connectAndGetMachine } = await import('./commands-Cq0BNIoM.mjs');
|
|
130
|
+
const { server, machine } = await connectAndGetMachine();
|
|
131
|
+
try {
|
|
132
|
+
await machine.tunnelStop({ name });
|
|
133
|
+
console.log(`Stopped tunnel '${name}'.`);
|
|
134
|
+
} catch (err) {
|
|
135
|
+
if (/not found/i.test(err.message)) {
|
|
136
|
+
console.error(`No daemon-managed tunnel named '${name}'.`);
|
|
137
|
+
console.error("If this was a standalone foreground tunnel (from `svamp service expose`), the daemon can't stop it.");
|
|
138
|
+
console.error(`Kill the frpc process directly: pkill -f 'frpc.*${name}'`);
|
|
139
|
+
} else {
|
|
140
|
+
console.error(`Error stopping tunnel: ${err.message}`);
|
|
141
|
+
}
|
|
142
|
+
process.exit(1);
|
|
143
|
+
} finally {
|
|
144
|
+
await server.disconnect();
|
|
145
|
+
}
|
|
146
|
+
} catch (err) {
|
|
147
|
+
console.error(`Error: ${err.message}`);
|
|
148
|
+
process.exit(1);
|
|
149
|
+
}
|
|
110
150
|
}
|
|
111
151
|
async function handleServiceCommand() {
|
|
112
152
|
const args = process.argv.slice(2);
|
|
@@ -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-Cq0BNIoM.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-Cvrrcm0a.mjs';
|
|
9
9
|
import 'os';
|
|
10
10
|
import 'fs/promises';
|
|
11
11
|
import 'url';
|
|
@@ -166,7 +166,8 @@ function normalizeSpec(raw) {
|
|
|
166
166
|
keepAlive: Boolean(raw.keepAlive ?? false),
|
|
167
167
|
maxRestarts: Number(raw.maxRestarts ?? 0),
|
|
168
168
|
restartDelay: Number(raw.restartDelay ?? 2),
|
|
169
|
-
ttl:
|
|
169
|
+
// ttl: 0 / negative / missing all mean "no TTL, run forever". Any positive value is seconds.
|
|
170
|
+
ttl: raw.ttl !== void 0 && Number(raw.ttl) > 0 ? Number(raw.ttl) : void 0,
|
|
170
171
|
serviceGroup: raw.serviceGroup,
|
|
171
172
|
ports: Array.isArray(raw.ports) ? raw.ports.map(Number) : void 0
|
|
172
173
|
};
|
|
@@ -400,7 +401,8 @@ async function startCommand(args, machineId) {
|
|
|
400
401
|
const maxRestarts = parseIntFlag(flagArgs, "--max-restarts", 0);
|
|
401
402
|
const restartDelay = parseIntFlag(flagArgs, "--restart-delay", 2);
|
|
402
403
|
const ttlRaw = getFlag(flagArgs, "--ttl");
|
|
403
|
-
const
|
|
404
|
+
const ttlParsed = ttlRaw !== void 0 ? parseInt(ttlRaw, 10) : void 0;
|
|
405
|
+
const ttl = ttlParsed !== void 0 && ttlParsed > 0 ? ttlParsed : void 0;
|
|
404
406
|
const probePortRaw = getFlag(flagArgs, "--probe-port");
|
|
405
407
|
let probe;
|
|
406
408
|
if (probePortRaw !== void 0) {
|
|
@@ -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-Cvrrcm0a.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
8
8
|
import 'fs';
|
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-Cvrrcm0a.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-Cvrrcm0a.mjs';
|
|
6
6
|
import { createServer } from 'node:http';
|
|
7
7
|
import { spawn } from 'node:child_process';
|
|
8
8
|
import { createInterface } from 'node:readline';
|
|
@@ -5348,7 +5348,7 @@ class ProcessSupervisor {
|
|
|
5348
5348
|
// ── Process spawning ──────────────────────────────────────────────────────
|
|
5349
5349
|
async startEntry(entry, onRestore) {
|
|
5350
5350
|
const { spec } = entry;
|
|
5351
|
-
if (spec.ttl !== void 0 && onRestore) {
|
|
5351
|
+
if (spec.ttl !== void 0 && spec.ttl > 0 && onRestore) {
|
|
5352
5352
|
const elapsedS = (Date.now() - spec.createdAt) / 1e3;
|
|
5353
5353
|
if (elapsedS >= spec.ttl) {
|
|
5354
5354
|
console.log(`[SUPERVISOR] Process '${spec.name}' TTL expired on restore, removing`);
|
|
@@ -5394,7 +5394,7 @@ class ProcessSupervisor {
|
|
|
5394
5394
|
this.onProcessExit(entry, code, signal);
|
|
5395
5395
|
});
|
|
5396
5396
|
if (spec.probe) this.setupProbe(entry);
|
|
5397
|
-
if (spec.ttl !== void 0) this.setupTTL(entry);
|
|
5397
|
+
if (spec.ttl !== void 0 && spec.ttl > 0) this.setupTTL(entry);
|
|
5398
5398
|
console.log(`[SUPERVISOR] Started '${spec.name}' pid=${child.pid}`);
|
|
5399
5399
|
} catch (err) {
|
|
5400
5400
|
state.status = "failed";
|
|
@@ -52,7 +52,7 @@ async function handleServeCommand() {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
async function serveAdd(args, machineId) {
|
|
55
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
55
|
+
const { connectAndGetMachine } = await import('./commands-Cq0BNIoM.mjs');
|
|
56
56
|
const pos = positionalArgs(args);
|
|
57
57
|
const name = pos[0];
|
|
58
58
|
if (!name) {
|
|
@@ -84,7 +84,7 @@ async function serveAdd(args, machineId) {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
async function serveRemove(args, machineId) {
|
|
87
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
87
|
+
const { connectAndGetMachine } = await import('./commands-Cq0BNIoM.mjs');
|
|
88
88
|
const pos = positionalArgs(args);
|
|
89
89
|
const name = pos[0];
|
|
90
90
|
if (!name) {
|
|
@@ -104,7 +104,7 @@ async function serveRemove(args, machineId) {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
async function serveList(args, machineId) {
|
|
107
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
107
|
+
const { connectAndGetMachine } = await import('./commands-Cq0BNIoM.mjs');
|
|
108
108
|
const all = hasFlag(args, "--all", "-a");
|
|
109
109
|
const json = hasFlag(args, "--json");
|
|
110
110
|
const sessionId = getFlag(args, "--session");
|
|
@@ -137,7 +137,7 @@ async function serveList(args, machineId) {
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
async function serveInfo(machineId) {
|
|
140
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
140
|
+
const { connectAndGetMachine } = await import('./commands-Cq0BNIoM.mjs');
|
|
141
141
|
const { machine, server } = await connectAndGetMachine(machineId);
|
|
142
142
|
try {
|
|
143
143
|
const info = await machine.serveInfo();
|