svamp-cli 0.2.44 → 0.2.45

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-vzP5AWB0.mjs');
151
+ const { connectAndGetMachine } = await import('./commands-Cd_I1MXo.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-vzP5AWB0.mjs');
168
+ const { resolveSessionId } = await import('./commands-Cd_I1MXo.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-DwnThKiy.mjs';
1
+ import { s as startDaemon, b as stopDaemon, d as daemonStatus } from './run-D59qJKn_.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-DwnThKiy.mjs').then(function (n) { return n.n; });
45
+ const { restartDaemon } = await import('./run-D59qJKn_.mjs').then(function (n) { return n.n; });
46
46
  await restartDaemon();
47
47
  process.exit(0);
48
48
  }
@@ -54,6 +54,14 @@ async function main() {
54
54
  process.exit(1);
55
55
  }
56
56
  const { spawn } = await import('child_process');
57
+ const { existsSync, mkdirSync, openSync, closeSync, statSync } = await import('fs');
58
+ const { join } = await import('path');
59
+ const os = await import('os');
60
+ const svampHome = process.env.SVAMP_HOME || join(os.homedir(), ".svamp");
61
+ const logsDir = join(svampHome, "logs");
62
+ mkdirSync(logsDir, { recursive: true });
63
+ const bootLogPath = join(logsDir, "daemon-boot.log");
64
+ const bootFd = openSync(bootLogPath, "a");
57
65
  const extraArgs = [];
58
66
  if (args.includes("--no-auto-continue")) extraArgs.push("--no-auto-continue");
59
67
  const child = spawn(process.execPath, [
@@ -66,17 +74,15 @@ async function main() {
66
74
  ...extraArgs
67
75
  ], {
68
76
  detached: true,
69
- stdio: "ignore",
77
+ stdio: ["ignore", bootFd, bootFd],
70
78
  env: process.env
71
79
  });
80
+ try {
81
+ closeSync(bootFd);
82
+ } catch {
83
+ }
72
84
  child.unref();
73
- const { existsSync } = await import('fs');
74
- const { join } = await import('path');
75
- const os = await import('os');
76
- const stateFile = join(
77
- process.env.SVAMP_HOME || join(os.homedir(), ".svamp"),
78
- "daemon.state.json"
79
- );
85
+ const stateFile = join(svampHome, "daemon.state.json");
80
86
  let started = false;
81
87
  for (let i = 0; i < 100; i++) {
82
88
  await new Promise((r) => setTimeout(r, 100));
@@ -88,7 +94,14 @@ async function main() {
88
94
  if (started) {
89
95
  console.log("Daemon started successfully");
90
96
  } else {
91
- console.error("Failed to start daemon (timeout waiting for state file)");
97
+ let bootHint = "";
98
+ try {
99
+ const st = statSync(bootLogPath);
100
+ if (st.size > 0) bootHint = `
101
+ Check boot log for errors: ${bootLogPath}`;
102
+ } catch {
103
+ }
104
+ console.error(`Failed to start daemon (timeout waiting for state file)${bootHint}`);
92
105
  process.exit(1);
93
106
  }
94
107
  process.exit(0);
@@ -115,7 +128,7 @@ async function main() {
115
128
  releaseSupervisorLock,
116
129
  findOrphanedSyncPids,
117
130
  killOrphanedSyncs
118
- } = await import('./supervisorLock-DwNAn0VN.mjs');
131
+ } = await import('./supervisorLock-DmfzJx7B.mjs');
119
132
  const supervisorPidFile = pathJoin(svampHome, "supervisor.pid");
120
133
  const lock = acquireSupervisorLockWithRetry(supervisorPidFile, process.pid);
121
134
  if (!lock.acquired) {
@@ -264,7 +277,7 @@ async function main() {
264
277
  console.error("svamp service: Service commands are not available in sandboxed sessions.");
265
278
  process.exit(1);
266
279
  }
267
- const { handleServiceCommand } = await import('./commands-DcHNe0bC.mjs');
280
+ const { handleServiceCommand } = await import('./commands-C6D6TMSl.mjs');
268
281
  await handleServiceCommand();
269
282
  } else if (subcommand === "serve") {
270
283
  const { isSandboxed: isSandboxedServe } = await import('./sandboxDetect-DNTcbgWD.mjs');
@@ -272,7 +285,7 @@ async function main() {
272
285
  console.error("svamp serve: Serve commands are not available in sandboxed sessions.");
273
286
  process.exit(1);
274
287
  }
275
- const { handleServeCommand } = await import('./serveCommands-By_bSGUl.mjs');
288
+ const { handleServeCommand } = await import('./serveCommands-DtKlt1DY.mjs');
276
289
  await handleServeCommand();
277
290
  process.exit(0);
278
291
  } else if (subcommand === "process" || subcommand === "proc") {
@@ -281,7 +294,7 @@ async function main() {
281
294
  console.error("svamp process: Process commands are not available in sandboxed sessions.");
282
295
  process.exit(1);
283
296
  }
284
- const { processCommand } = await import('./commands-DYNzHqj8.mjs');
297
+ const { processCommand } = await import('./commands-0xDVhPKr.mjs');
285
298
  let machineId;
286
299
  const processArgs = args.slice(1);
287
300
  const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
@@ -299,7 +312,7 @@ async function main() {
299
312
  } else if (!subcommand || subcommand === "start") {
300
313
  await handleInteractiveCommand();
301
314
  } else if (subcommand === "--version" || subcommand === "-v") {
302
- const pkg = await import('./package-bycncAEw.mjs').catch(() => ({ default: { version: "unknown" } }));
315
+ const pkg = await import('./package-Cx2tEoke.mjs').catch(() => ({ default: { version: "unknown" } }));
303
316
  console.log(`svamp version: ${pkg.default.version}`);
304
317
  } else {
305
318
  console.error(`Unknown command: ${subcommand}`);
@@ -308,7 +321,7 @@ async function main() {
308
321
  }
309
322
  }
310
323
  async function handleInteractiveCommand() {
311
- const { runInteractive } = await import('./run-DBqJkrp6.mjs');
324
+ const { runInteractive } = await import('./run-DZhogQUH.mjs');
312
325
  const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
313
326
  let directory = process.cwd();
314
327
  let resumeSessionId;
@@ -353,7 +366,7 @@ async function handleAgentCommand() {
353
366
  return;
354
367
  }
355
368
  if (agentArgs[0] === "list") {
356
- const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-DwnThKiy.mjs').then(function (n) { return n.i; });
369
+ const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-D59qJKn_.mjs').then(function (n) { return n.i; });
357
370
  console.log("Known agents:");
358
371
  for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
359
372
  console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
@@ -365,7 +378,7 @@ async function handleAgentCommand() {
365
378
  console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
366
379
  return;
367
380
  }
368
- const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-DwnThKiy.mjs').then(function (n) { return n.i; });
381
+ const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-D59qJKn_.mjs').then(function (n) { return n.i; });
369
382
  let cwd = process.cwd();
370
383
  const filteredArgs = [];
371
384
  for (let i = 0; i < agentArgs.length; i++) {
@@ -389,12 +402,12 @@ async function handleAgentCommand() {
389
402
  console.log(`Starting ${config.agentName} agent in ${cwd}...`);
390
403
  let backend;
391
404
  if (KNOWN_MCP_AGENTS[config.agentName]) {
392
- const { CodexMcpBackend } = await import('./run-DwnThKiy.mjs').then(function (n) { return n.j; });
405
+ const { CodexMcpBackend } = await import('./run-D59qJKn_.mjs').then(function (n) { return n.j; });
393
406
  backend = new CodexMcpBackend({ cwd, log: logFn });
394
407
  } else {
395
- const { AcpBackend } = await import('./run-DwnThKiy.mjs').then(function (n) { return n.h; });
396
- const { GeminiTransport } = await import('./run-DwnThKiy.mjs').then(function (n) { return n.G; });
397
- const { DefaultTransport } = await import('./run-DwnThKiy.mjs').then(function (n) { return n.D; });
408
+ const { AcpBackend } = await import('./run-D59qJKn_.mjs').then(function (n) { return n.h; });
409
+ const { GeminiTransport } = await import('./run-D59qJKn_.mjs').then(function (n) { return n.G; });
410
+ const { DefaultTransport } = await import('./run-D59qJKn_.mjs').then(function (n) { return n.D; });
398
411
  const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
399
412
  backend = new AcpBackend({
400
413
  agentName: config.agentName,
@@ -521,7 +534,7 @@ async function handleSessionCommand() {
521
534
  process.exit(1);
522
535
  }
523
536
  }
524
- const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-vzP5AWB0.mjs');
537
+ const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-Cd_I1MXo.mjs');
525
538
  const parseFlagStr = (flag, shortFlag) => {
526
539
  for (let i = 1; i < sessionArgs.length; i++) {
527
540
  if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
@@ -581,7 +594,7 @@ async function handleSessionCommand() {
581
594
  allowDomain.push(sessionArgs[++i]);
582
595
  }
583
596
  }
584
- const { parseShareArg } = await import('./commands-vzP5AWB0.mjs');
597
+ const { parseShareArg } = await import('./commands-Cd_I1MXo.mjs');
585
598
  const shareEntries = share.map((s) => parseShareArg(s));
586
599
  await sessionSpawn(agent, dir, targetMachineId, {
587
600
  message,
@@ -667,7 +680,7 @@ async function handleSessionCommand() {
667
680
  console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
668
681
  process.exit(1);
669
682
  }
670
- const { sessionApprove } = await import('./commands-vzP5AWB0.mjs');
683
+ const { sessionApprove } = await import('./commands-Cd_I1MXo.mjs');
671
684
  const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
672
685
  await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
673
686
  json: hasFlag("--json")
@@ -677,7 +690,7 @@ async function handleSessionCommand() {
677
690
  console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
678
691
  process.exit(1);
679
692
  }
680
- const { sessionDeny } = await import('./commands-vzP5AWB0.mjs');
693
+ const { sessionDeny } = await import('./commands-Cd_I1MXo.mjs');
681
694
  const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
682
695
  await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
683
696
  json: hasFlag("--json")
@@ -713,7 +726,7 @@ async function handleSessionCommand() {
713
726
  console.error("Usage: svamp session set-title <title>");
714
727
  process.exit(1);
715
728
  }
716
- const { sessionSetTitle } = await import('./agentCommands-Dlqk61bM.mjs');
729
+ const { sessionSetTitle } = await import('./agentCommands-dlpOoDcq.mjs');
717
730
  await sessionSetTitle(title);
718
731
  } else if (sessionSubcommand === "set-link") {
719
732
  const url = sessionArgs[1];
@@ -722,7 +735,7 @@ async function handleSessionCommand() {
722
735
  process.exit(1);
723
736
  }
724
737
  const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
725
- const { sessionSetLink } = await import('./agentCommands-Dlqk61bM.mjs');
738
+ const { sessionSetLink } = await import('./agentCommands-dlpOoDcq.mjs');
726
739
  await sessionSetLink(url, label);
727
740
  } else if (sessionSubcommand === "notify") {
728
741
  const message = sessionArgs[1];
@@ -731,7 +744,7 @@ async function handleSessionCommand() {
731
744
  process.exit(1);
732
745
  }
733
746
  const level = parseFlagStr("--level") || "info";
734
- const { sessionNotify } = await import('./agentCommands-Dlqk61bM.mjs');
747
+ const { sessionNotify } = await import('./agentCommands-dlpOoDcq.mjs');
735
748
  await sessionNotify(message, level);
736
749
  } else if (sessionSubcommand === "broadcast") {
737
750
  const action = sessionArgs[1];
@@ -739,7 +752,7 @@ async function handleSessionCommand() {
739
752
  console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
740
753
  process.exit(1);
741
754
  }
742
- const { sessionBroadcast } = await import('./agentCommands-Dlqk61bM.mjs');
755
+ const { sessionBroadcast } = await import('./agentCommands-dlpOoDcq.mjs');
743
756
  await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
744
757
  } else if (sessionSubcommand === "inbox") {
745
758
  const inboxSubcmd = sessionArgs[1];
@@ -750,7 +763,7 @@ async function handleSessionCommand() {
750
763
  process.exit(1);
751
764
  }
752
765
  if (agentSessionId) {
753
- const { inboxSend } = await import('./agentCommands-Dlqk61bM.mjs');
766
+ const { inboxSend } = await import('./agentCommands-dlpOoDcq.mjs');
754
767
  await inboxSend(sessionArgs[2], {
755
768
  body: sessionArgs[3],
756
769
  subject: parseFlagStr("--subject"),
@@ -765,7 +778,7 @@ async function handleSessionCommand() {
765
778
  }
766
779
  } else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
767
780
  if (agentSessionId && !sessionArgs[2]) {
768
- const { inboxList } = await import('./agentCommands-Dlqk61bM.mjs');
781
+ const { inboxList } = await import('./agentCommands-dlpOoDcq.mjs');
769
782
  await inboxList({
770
783
  unread: hasFlag("--unread"),
771
784
  limit: parseFlagInt("--limit"),
@@ -787,7 +800,7 @@ async function handleSessionCommand() {
787
800
  process.exit(1);
788
801
  }
789
802
  if (agentSessionId && !sessionArgs[3]) {
790
- const { inboxList } = await import('./agentCommands-Dlqk61bM.mjs');
803
+ const { inboxList } = await import('./agentCommands-dlpOoDcq.mjs');
791
804
  await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
792
805
  } else if (sessionArgs[3]) {
793
806
  await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
@@ -797,7 +810,7 @@ async function handleSessionCommand() {
797
810
  }
798
811
  } else if (inboxSubcmd === "reply") {
799
812
  if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
800
- const { inboxReply } = await import('./agentCommands-Dlqk61bM.mjs');
813
+ const { inboxReply } = await import('./agentCommands-dlpOoDcq.mjs');
801
814
  await inboxReply(sessionArgs[2], sessionArgs[3]);
802
815
  } else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
803
816
  await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
@@ -833,7 +846,7 @@ async function handleMachineCommand() {
833
846
  return;
834
847
  }
835
848
  if (machineSubcommand === "share") {
836
- const { machineShare } = await import('./commands-vzP5AWB0.mjs');
849
+ const { machineShare } = await import('./commands-Cd_I1MXo.mjs');
837
850
  let machineId;
838
851
  const shareArgs = [];
839
852
  for (let i = 1; i < machineArgs.length; i++) {
@@ -863,7 +876,7 @@ async function handleMachineCommand() {
863
876
  }
864
877
  await machineShare(machineId, { add, remove, list, configPath, showConfig });
865
878
  } else if (machineSubcommand === "exec") {
866
- const { machineExec } = await import('./commands-vzP5AWB0.mjs');
879
+ const { machineExec } = await import('./commands-Cd_I1MXo.mjs');
867
880
  let machineId;
868
881
  let cwd;
869
882
  const cmdParts = [];
@@ -883,7 +896,7 @@ async function handleMachineCommand() {
883
896
  }
884
897
  await machineExec(machineId, command, cwd);
885
898
  } else if (machineSubcommand === "info") {
886
- const { machineInfo } = await import('./commands-vzP5AWB0.mjs');
899
+ const { machineInfo } = await import('./commands-Cd_I1MXo.mjs');
887
900
  let machineId;
888
901
  for (let i = 1; i < machineArgs.length; i++) {
889
902
  if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
@@ -903,10 +916,10 @@ async function handleMachineCommand() {
903
916
  level = machineArgs[++i];
904
917
  }
905
918
  }
906
- const { machineNotify } = await import('./agentCommands-Dlqk61bM.mjs');
919
+ const { machineNotify } = await import('./agentCommands-dlpOoDcq.mjs');
907
920
  await machineNotify(message, level);
908
921
  } else if (machineSubcommand === "ls") {
909
- const { machineLs } = await import('./commands-vzP5AWB0.mjs');
922
+ const { machineLs } = await import('./commands-Cd_I1MXo.mjs');
910
923
  let machineId;
911
924
  let showHidden = false;
912
925
  let path;
@@ -1368,7 +1381,7 @@ async function applyClaudeAuthFlags(argv) {
1368
1381
  "--use-hypha-proxy, --use-claude-login, and --anthropic-base-url/--anthropic-api-key are mutually exclusive"
1369
1382
  );
1370
1383
  }
1371
- const mod = await import('./run-DwnThKiy.mjs').then(function (n) { return n.k; });
1384
+ const mod = await import('./run-D59qJKn_.mjs').then(function (n) { return n.k; });
1372
1385
  if (hasHypha) {
1373
1386
  mod.setClaudeAuthHyphaProxy();
1374
1387
  console.log("Claude auth configured: hypha-proxy (uses HYPHA_TOKEN live at each spawn).");
@@ -1391,7 +1404,7 @@ async function applyClaudeAuthFlags(argv) {
1391
1404
  }
1392
1405
  async function handleDaemonAuthCommand(argv) {
1393
1406
  const sub = (argv[0] || "status").toLowerCase();
1394
- const mod = await import('./run-DwnThKiy.mjs').then(function (n) { return n.k; });
1407
+ const mod = await import('./run-D59qJKn_.mjs').then(function (n) { return n.k; });
1395
1408
  if (sub === "--help" || sub === "-h" || sub === "help") {
1396
1409
  console.log(`
1397
1410
  svamp daemon auth \u2014 Configure how Claude subprocesses authenticate
@@ -1,11 +1,11 @@
1
1
  import { writeFileSync, readFileSync } from 'fs';
2
2
  import { resolve } from 'path';
3
- import { connectAndGetMachine } from './commands-vzP5AWB0.mjs';
3
+ import { connectAndGetMachine } from './commands-Cd_I1MXo.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-DwnThKiy.mjs';
8
+ import './run-D59qJKn_.mjs';
9
9
  import 'os';
10
10
  import 'fs/promises';
11
11
  import 'url';
@@ -97,7 +97,7 @@ async function serviceServe(args) {
97
97
  }
98
98
  async function serviceList(_args) {
99
99
  try {
100
- const { connectAndGetMachine } = await import('./commands-vzP5AWB0.mjs');
100
+ const { connectAndGetMachine } = await import('./commands-Cd_I1MXo.mjs');
101
101
  const { server, machine } = await connectAndGetMachine();
102
102
  try {
103
103
  const tunnels = await machine.tunnelList({});
@@ -126,7 +126,7 @@ async function serviceDelete(args) {
126
126
  process.exit(1);
127
127
  }
128
128
  try {
129
- const { connectAndGetMachine } = await import('./commands-vzP5AWB0.mjs');
129
+ const { connectAndGetMachine } = await import('./commands-Cd_I1MXo.mjs');
130
130
  const { server, machine } = await connectAndGetMachine();
131
131
  try {
132
132
  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 { l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha } from './run-DwnThKiy.mjs';
5
+ import { l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha } from './run-D59qJKn_.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-DwnThKiy.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-D59qJKn_.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.44";
2
+ var version = "0.2.45";
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";
@@ -6464,7 +6464,7 @@ async function startDaemon(options) {
6464
6464
  process.on("SIGINT", () => requestShutdown("os-signal"));
6465
6465
  process.on("SIGTERM", () => requestShutdown("os-signal"));
6466
6466
  process.on("SIGUSR1", () => requestShutdown("os-signal-cleanup"));
6467
- const { watchParentLiveness } = await import('./supervisorLock-DwNAn0VN.mjs');
6467
+ const { watchParentLiveness } = await import('./supervisorLock-DmfzJx7B.mjs');
6468
6468
  const cancelParentWatchdog = watchParentLiveness({
6469
6469
  intervalMs: 5e3,
6470
6470
  onParentDeath: () => {
@@ -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-DwnThKiy.mjs';
5
+ import { c as connectToHypha, a as registerSessionService } from './run-D59qJKn_.mjs';
6
6
  import { createServer } from 'node:http';
7
7
  import { spawn } from 'node:child_process';
8
8
  import { createInterface } from 'node:readline';
@@ -52,7 +52,7 @@ async function handleServeCommand() {
52
52
  }
53
53
  }
54
54
  async function serveAdd(args, machineId) {
55
- const { connectAndGetMachine } = await import('./commands-vzP5AWB0.mjs');
55
+ const { connectAndGetMachine } = await import('./commands-Cd_I1MXo.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-vzP5AWB0.mjs');
87
+ const { connectAndGetMachine } = await import('./commands-Cd_I1MXo.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-vzP5AWB0.mjs');
107
+ const { connectAndGetMachine } = await import('./commands-Cd_I1MXo.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-vzP5AWB0.mjs');
140
+ const { connectAndGetMachine } = await import('./commands-Cd_I1MXo.mjs');
141
141
  const { machine, server } = await connectAndGetMachine(machineId);
142
142
  try {
143
143
  const info = await machine.serveInfo();
@@ -54,15 +54,17 @@ function isPidAlive(pid) {
54
54
  try {
55
55
  process.kill(pid, 0);
56
56
  return true;
57
- } catch {
58
- return false;
57
+ } catch (err) {
58
+ return err?.code === "EPERM";
59
59
  }
60
60
  }
61
61
  function findOrphanedSyncPids(currentSupervisorPid = process.pid) {
62
62
  if (process.platform === "win32") return [];
63
63
  const pids = [];
64
64
  try {
65
- const output = execFileSync("pgrep", ["-af", "svamp daemon start-sync"], {
65
+ const uid = typeof process.getuid === "function" ? process.getuid() : void 0;
66
+ const pgrepArgs = uid !== void 0 ? ["-u", String(uid), "-af", "svamp daemon start-sync"] : ["-af", "svamp daemon start-sync"];
67
+ const output = execFileSync("pgrep", pgrepArgs, {
66
68
  encoding: "utf-8",
67
69
  timeout: 5e3
68
70
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svamp-cli",
3
- "version": "0.2.44",
3
+ "version": "0.2.45",
4
4
  "description": "Svamp CLI — AI workspace daemon on Hypha Cloud",
5
5
  "author": "Amun AI AB",
6
6
  "license": "SEE LICENSE IN LICENSE",