svamp-cli 0.2.40 → 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.
@@ -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-CWKFZm9s.mjs');
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-CWKFZm9s.mjs');
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-CRwkPQDW.mjs';
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-CRwkPQDW.mjs').then(function (n) { return n.n; });
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-DjeK7-E9.mjs');
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-B9Dq2loo.mjs');
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-DVXppwx2.mjs');
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-DwO5YX9e.mjs').catch(() => ({ default: { version: "unknown" } }));
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--6SzG2CH.mjs');
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-CRwkPQDW.mjs').then(function (n) { return n.i; });
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-CRwkPQDW.mjs').then(function (n) { return n.i; });
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-CRwkPQDW.mjs').then(function (n) { return n.j; });
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-CRwkPQDW.mjs').then(function (n) { return n.h; });
396
- const { GeminiTransport } = await import('./run-CRwkPQDW.mjs').then(function (n) { return n.G; });
397
- const { DefaultTransport } = await import('./run-CRwkPQDW.mjs').then(function (n) { return n.D; });
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-CWKFZm9s.mjs');
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-CWKFZm9s.mjs');
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-CWKFZm9s.mjs');
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-CWKFZm9s.mjs');
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-BvmStLoh.mjs');
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-BvmStLoh.mjs');
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-BvmStLoh.mjs');
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-BvmStLoh.mjs');
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-BvmStLoh.mjs');
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-BvmStLoh.mjs');
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-BvmStLoh.mjs');
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-BvmStLoh.mjs');
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-CWKFZm9s.mjs');
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-CWKFZm9s.mjs');
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-CWKFZm9s.mjs');
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-BvmStLoh.mjs');
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-CWKFZm9s.mjs');
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-CRwkPQDW.mjs').then(function (n) { return n.k; });
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-CRwkPQDW.mjs').then(function (n) { return n.k; });
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
- console.log("Active tunnels are managed by the svamp daemon.");
100
- console.log('Use "svamp service expose" to start a tunnel in the foreground.');
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
- console.log(`Tunnel '${name}' can only be stopped via the daemon (tunnelStop RPC).`);
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-CWKFZm9s.mjs';
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-CRwkPQDW.mjs';
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: raw.ttl !== void 0 ? Number(raw.ttl) : void 0,
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
  };
@@ -302,7 +303,7 @@ async function applyCommand(args, machineId) {
302
303
  const spec = await readSpecFile(filePath);
303
304
  const { server, machine } = await connectAndGetMachine(machineId);
304
305
  try {
305
- const result = await machine.processApply({ spec, _rkwargs: true });
306
+ const result = await machine.processApply({ spec });
306
307
  const { action, info } = result;
307
308
  if (action === "no-change") {
308
309
  console.log(`process/${info.spec.name} unchanged`);
@@ -326,7 +327,7 @@ async function listCommand(args, machineId) {
326
327
  const json = hasFlag(args, "--json");
327
328
  const { server, machine } = await connectAndGetMachine(machineId);
328
329
  try {
329
- const processes = await machine.processList({ _rkwargs: true });
330
+ const processes = await machine.processList({});
330
331
  if (json) {
331
332
  console.log(JSON.stringify(processes, null, 2));
332
333
  } else {
@@ -346,7 +347,7 @@ async function getCommand(args, machineId) {
346
347
  const outFile = getFlag(args, "--save");
347
348
  const { server, machine } = await connectAndGetMachine(machineId);
348
349
  try {
349
- const info = await machine.processGet({ idOrName, _rkwargs: true });
350
+ const info = await machine.processGet({ idOrName });
350
351
  if (!info) {
351
352
  console.error(`Error: process '${idOrName}' not found`);
352
353
  process.exit(1);
@@ -386,7 +387,7 @@ async function startCommand(args, machineId) {
386
387
  if (cmdArgs.length === 0) {
387
388
  const { server: server2, machine: machine2 } = await connectAndGetMachine(machineId);
388
389
  try {
389
- await machine2.processStart({ idOrName, _rkwargs: true });
390
+ await machine2.processStart({ idOrName });
390
391
  console.log(`Started '${idOrName}'`);
391
392
  } finally {
392
393
  await server2.disconnect();
@@ -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 ttl = ttlRaw !== void 0 ? parseInt(ttlRaw, 10) : void 0;
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) {
@@ -443,7 +445,7 @@ async function startCommand(args, machineId) {
443
445
  const saveFile = getFlag(flagArgs, "--save");
444
446
  const { server, machine } = await connectAndGetMachine(machineId);
445
447
  try {
446
- const result = await machine.processApply({ spec, _rkwargs: true });
448
+ const result = await machine.processApply({ spec });
447
449
  const { info } = result;
448
450
  console.log(`Started '${info.spec.name}' (id: ${info.spec.id}, pid: ${info.state.pid ?? "\u2014"})`);
449
451
  if (keepAlive) console.log(" Keep-alive: enabled");
@@ -465,7 +467,7 @@ async function stopCommand(args, machineId) {
465
467
  }
466
468
  const { server, machine } = await connectAndGetMachine(machineId);
467
469
  try {
468
- await machine.processStop({ idOrName, _rkwargs: true });
470
+ await machine.processStop({ idOrName });
469
471
  console.log(`Stopped '${idOrName}'`);
470
472
  } finally {
471
473
  await server.disconnect();
@@ -479,7 +481,7 @@ async function restartCommand(args, machineId) {
479
481
  }
480
482
  const { server, machine } = await connectAndGetMachine(machineId);
481
483
  try {
482
- await machine.processRestart({ idOrName, _rkwargs: true });
484
+ await machine.processRestart({ idOrName });
483
485
  console.log(`Restarted '${idOrName}'`);
484
486
  } finally {
485
487
  await server.disconnect();
@@ -493,7 +495,7 @@ async function deleteCommand(args, machineId) {
493
495
  }
494
496
  const { server, machine } = await connectAndGetMachine(machineId);
495
497
  try {
496
- await machine.processRemove({ idOrName, _rkwargs: true });
498
+ await machine.processRemove({ idOrName });
497
499
  console.log(`Deleted '${idOrName}'`);
498
500
  } finally {
499
501
  await server.disconnect();
@@ -508,7 +510,7 @@ async function logsCommand(args, machineId) {
508
510
  const last = parseIntFlag(args, "--last", 50);
509
511
  const { server, machine } = await connectAndGetMachine(machineId);
510
512
  try {
511
- const lines = await machine.processLogs({ idOrName, last, _rkwargs: true });
513
+ const lines = await machine.processLogs({ idOrName, last });
512
514
  if (lines.length === 0) console.log("(no output yet)");
513
515
  else console.log(lines.join("\n"));
514
516
  } finally {
@@ -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-CRwkPQDW.mjs';
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-CRwkPQDW.mjs';
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';
@@ -1,5 +1,5 @@
1
1
  var name = "svamp-cli";
2
- var version = "0.2.40";
2
+ var version = "0.2.42";
3
3
  var description = "Svamp CLI — AI workspace daemon on Hypha Cloud";
4
4
  var author = "Amun AI AB";
5
5
  var license = "SEE LICENSE IN LICENSE";
@@ -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-CRwkPQDW.mjs';
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-CWKFZm9s.mjs');
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-CWKFZm9s.mjs');
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-CWKFZm9s.mjs');
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-CWKFZm9s.mjs');
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svamp-cli",
3
- "version": "0.2.40",
3
+ "version": "0.2.42",
4
4
  "description": "Svamp CLI — AI workspace daemon on Hypha Cloud",
5
5
  "author": "Amun AI AB",
6
6
  "license": "SEE LICENSE IN LICENSE",