svamp-cli 0.2.17 → 0.2.19

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-D7JEuzau.mjs');
151
+ const { connectAndGetMachine } = await import('./commands-Bz4ax0Fl.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-D7JEuzau.mjs');
168
+ const { resolveSessionId } = await import('./commands-Bz4ax0Fl.mjs');
169
169
  const sessions = await machine.listSessions();
170
170
  const match = resolveSessionId(sessions, targetSessionId);
171
171
  const fullTargetId = match.sessionId;
@@ -0,0 +1,325 @@
1
+ import { spawn, execSync } from 'child_process';
2
+ import { mkdirSync, existsSync, statSync, writeFileSync, chmodSync, unlinkSync } from 'fs';
3
+ import { join } from 'path';
4
+ import { homedir, platform, arch } from 'os';
5
+
6
+ const CADDY_VERSION = "2.9.1";
7
+ const BIN_DIR = join(homedir(), ".svamp", "bin");
8
+ const CADDY_BIN = join(BIN_DIR, platform() === "win32" ? "caddy.exe" : "caddy");
9
+ const ADMIN_PORT = 2019;
10
+ const DEFAULT_LISTEN_PORT = 18080;
11
+ function getCaddyDownloadUrl() {
12
+ const os = platform();
13
+ const a = arch();
14
+ let osStr;
15
+ let archStr;
16
+ switch (os) {
17
+ case "darwin":
18
+ osStr = "mac";
19
+ break;
20
+ case "linux":
21
+ osStr = "linux";
22
+ break;
23
+ case "win32":
24
+ osStr = "windows";
25
+ break;
26
+ default:
27
+ throw new Error(`Unsupported platform: ${os}`);
28
+ }
29
+ switch (a) {
30
+ case "x64":
31
+ archStr = "amd64";
32
+ break;
33
+ case "arm64":
34
+ archStr = "arm64";
35
+ break;
36
+ default:
37
+ throw new Error(`Unsupported architecture: ${a}`);
38
+ }
39
+ const ext = os === "win32" ? "zip" : "tar.gz";
40
+ return `https://github.com/caddyserver/caddy/releases/download/v${CADDY_VERSION}/caddy_${CADDY_VERSION}_${osStr}_${archStr}.${ext}`;
41
+ }
42
+ function isCaddyAvailable() {
43
+ if (existsSync(CADDY_BIN)) return true;
44
+ try {
45
+ execSync("caddy version", { stdio: "ignore" });
46
+ return true;
47
+ } catch {
48
+ return false;
49
+ }
50
+ }
51
+ function getCaddyPath() {
52
+ if (existsSync(CADDY_BIN)) return CADDY_BIN;
53
+ return "caddy";
54
+ }
55
+ async function ensureCaddy(log) {
56
+ if (existsSync(CADDY_BIN)) return CADDY_BIN;
57
+ const logger = log || console.log;
58
+ mkdirSync(BIN_DIR, { recursive: true });
59
+ const url = getCaddyDownloadUrl();
60
+ logger(`Downloading Caddy ${CADDY_VERSION} from ${url}...`);
61
+ const response = await fetch(url);
62
+ if (!response.ok) {
63
+ throw new Error(`Failed to download Caddy: ${response.status} ${response.statusText}`);
64
+ }
65
+ const buffer = Buffer.from(await response.arrayBuffer());
66
+ if (platform() === "win32") {
67
+ throw new Error("Windows ZIP extraction not implemented \u2014 please install caddy manually");
68
+ }
69
+ const tmpTar = join(BIN_DIR, `caddy-${CADDY_VERSION}.tar.gz`);
70
+ writeFileSync(tmpTar, buffer);
71
+ try {
72
+ execSync(
73
+ `tar -xzf "${tmpTar}" -C "${BIN_DIR}" caddy`,
74
+ { stdio: "pipe" }
75
+ );
76
+ chmodSync(CADDY_BIN, 493);
77
+ logger(`Caddy installed at ${CADDY_BIN}`);
78
+ } finally {
79
+ try {
80
+ unlinkSync(tmpTar);
81
+ } catch {
82
+ }
83
+ }
84
+ return CADDY_BIN;
85
+ }
86
+ const CORS_HEADERS_HANDLER = {
87
+ handler: "headers",
88
+ response: {
89
+ set: {
90
+ "Access-Control-Allow-Origin": ["*"],
91
+ "Access-Control-Allow-Methods": ["GET, POST, PUT, DELETE, OPTIONS"],
92
+ "Access-Control-Allow-Headers": ["*"]
93
+ }
94
+ }
95
+ };
96
+ function generateCaddyConfig(listenPort, mounts, adminPort = ADMIN_PORT) {
97
+ const routes = [];
98
+ for (const mount of mounts) {
99
+ if (mount.isFile) {
100
+ const parentDir = mount.directory.replace(/[\\/][^\\/]+$/, "") || "/";
101
+ const fileName = mount.directory.replace(/.*[\\/]/, "");
102
+ routes.push({
103
+ match: [{ path: [`/${mount.name}`] }],
104
+ handle: [
105
+ CORS_HEADERS_HANDLER,
106
+ { handler: "rewrite", uri: `/${fileName}` },
107
+ { handler: "file_server", root: parentDir }
108
+ ]
109
+ });
110
+ } else {
111
+ const fileServerHandler = { handler: "file_server", root: mount.directory };
112
+ if (mount.browse !== false) fileServerHandler.browse = {};
113
+ routes.push({
114
+ match: [{ path: [`/${mount.name}/*`, `/${mount.name}`] }],
115
+ handle: [
116
+ CORS_HEADERS_HANDLER,
117
+ { handler: "rewrite", strip_path_prefix: `/${mount.name}` },
118
+ fileServerHandler
119
+ ]
120
+ });
121
+ }
122
+ }
123
+ routes.push({
124
+ match: [{ path: ["/"] }],
125
+ handle: [
126
+ CORS_HEADERS_HANDLER,
127
+ {
128
+ handler: "static_response",
129
+ status_code: 200,
130
+ headers: { "Content-Type": ["text/html; charset=utf-8"] },
131
+ body: generateMountListHtml(mounts)
132
+ }
133
+ ]
134
+ });
135
+ routes.push({
136
+ handle: [
137
+ CORS_HEADERS_HANDLER,
138
+ { handler: "static_response", status_code: 404, body: "Not Found" }
139
+ ]
140
+ });
141
+ return {
142
+ admin: {
143
+ listen: `127.0.0.1:${adminPort}`
144
+ },
145
+ apps: {
146
+ http: {
147
+ servers: {
148
+ srv0: {
149
+ listen: [`127.0.0.1:${listenPort}`],
150
+ routes
151
+ }
152
+ }
153
+ }
154
+ }
155
+ };
156
+ }
157
+ function generateMountListHtml(mounts) {
158
+ const items = mounts.map(
159
+ (m) => `<li><a href="/${m.name}/">${m.name}</a> \u2014 ${m.directory}</li>`
160
+ ).join("\n");
161
+ return `<!DOCTYPE html>
162
+ <html><head><meta charset="utf-8"><title>Svamp File Server</title>
163
+ <style>
164
+ body{font-family:system-ui,sans-serif;max-width:700px;margin:40px auto;padding:0 20px;color:#333}
165
+ h1{font-size:1.3rem}
166
+ ul{list-style:none;padding:0}
167
+ li{padding:8px 0;border-bottom:1px solid #eee}
168
+ a{color:#0969da;text-decoration:none;font-weight:500}
169
+ a:hover{text-decoration:underline}
170
+ </style>
171
+ </head><body>
172
+ <h1>Svamp File Server</h1>
173
+ <ul>${items || "<li>No mounts registered.</li>"}</ul>
174
+ </body></html>`;
175
+ }
176
+ class CaddyManager {
177
+ process = null;
178
+ mounts = /* @__PURE__ */ new Map();
179
+ listenPort;
180
+ adminPort;
181
+ log;
182
+ configPath;
183
+ constructor(options = {}) {
184
+ this.listenPort = options.listenPort || DEFAULT_LISTEN_PORT;
185
+ this.adminPort = options.adminPort || ADMIN_PORT;
186
+ this.log = options.log || ((msg) => console.log(`[CADDY] ${msg}`));
187
+ const configDir = options.configDir || join(homedir(), ".svamp", "caddy");
188
+ mkdirSync(configDir, { recursive: true });
189
+ this.configPath = join(configDir, "config.json");
190
+ }
191
+ /** Start Caddy if not already running. */
192
+ async start() {
193
+ if (this.process) return;
194
+ const caddyPath = await ensureCaddy(this.log);
195
+ this.writeConfig();
196
+ return new Promise((resolve, reject) => {
197
+ const child = spawn(caddyPath, ["run", "--config", this.configPath], {
198
+ stdio: ["ignore", "pipe", "pipe"],
199
+ env: { ...process.env }
200
+ });
201
+ this.process = child;
202
+ let resolved = false;
203
+ const onOutput = (data) => {
204
+ const text = data.toString().trim();
205
+ if (!text) return;
206
+ if (text.includes("serving initial configuration")) {
207
+ if (!resolved) {
208
+ resolved = true;
209
+ this.log(`Caddy started on 127.0.0.1:${this.listenPort}`);
210
+ resolve();
211
+ }
212
+ }
213
+ if (text.includes('"level":"error"')) {
214
+ this.log(`Caddy error: ${text}`);
215
+ }
216
+ };
217
+ child.stdout?.on("data", onOutput);
218
+ child.stderr?.on("data", onOutput);
219
+ child.on("error", (err) => {
220
+ if (!resolved) {
221
+ resolved = true;
222
+ reject(err);
223
+ }
224
+ });
225
+ child.on("exit", (code) => {
226
+ this.process = null;
227
+ if (!resolved) {
228
+ resolved = true;
229
+ reject(new Error(`Caddy exited with code ${code}`));
230
+ }
231
+ });
232
+ setTimeout(() => {
233
+ if (!resolved) {
234
+ resolved = true;
235
+ resolve();
236
+ }
237
+ }, 1e4);
238
+ });
239
+ }
240
+ /** Stop the Caddy process. */
241
+ async stop() {
242
+ if (!this.process) return;
243
+ try {
244
+ await fetch(`http://127.0.0.1:${this.adminPort}/stop`, { method: "POST" });
245
+ } catch {
246
+ this.process.kill("SIGTERM");
247
+ }
248
+ await new Promise((resolve) => {
249
+ if (!this.process) {
250
+ resolve();
251
+ return;
252
+ }
253
+ const timeout = setTimeout(() => {
254
+ try {
255
+ this.process?.kill("SIGKILL");
256
+ } catch {
257
+ }
258
+ resolve();
259
+ }, 5e3);
260
+ this.process.on("exit", () => {
261
+ clearTimeout(timeout);
262
+ resolve();
263
+ });
264
+ });
265
+ this.process = null;
266
+ this.log("Caddy stopped");
267
+ }
268
+ /** Add a mount and reload config. */
269
+ async addMount(name, directory, browse = true) {
270
+ const isFile = existsSync(directory) && statSync(directory).isFile();
271
+ this.mounts.set(name, { name, directory, browse, isFile });
272
+ await this.reloadConfig();
273
+ this.log(`Mount added: ${name} \u2192 ${directory}`);
274
+ }
275
+ /** Remove a mount and reload config. */
276
+ async removeMount(name) {
277
+ if (!this.mounts.has(name)) {
278
+ throw new Error(`Mount '${name}' not found`);
279
+ }
280
+ this.mounts.delete(name);
281
+ await this.reloadConfig();
282
+ this.log(`Mount removed: ${name}`);
283
+ }
284
+ /** Get all current mounts. */
285
+ getMounts() {
286
+ return Array.from(this.mounts.values());
287
+ }
288
+ /** Whether Caddy is running. */
289
+ get isRunning() {
290
+ return this.process !== null;
291
+ }
292
+ /** The port Caddy listens on. */
293
+ get port() {
294
+ return this.listenPort;
295
+ }
296
+ // ── Internal ─────────────────────────────────────────────────────
297
+ writeConfig() {
298
+ const config = generateCaddyConfig(this.listenPort, Array.from(this.mounts.values()), this.adminPort);
299
+ writeFileSync(this.configPath, JSON.stringify(config, null, 2));
300
+ }
301
+ async reloadConfig() {
302
+ this.writeConfig();
303
+ if (!this.process) return;
304
+ try {
305
+ const config = generateCaddyConfig(this.listenPort, Array.from(this.mounts.values()), this.adminPort);
306
+ const resp = await fetch(`http://127.0.0.1:${this.adminPort}/load`, {
307
+ method: "POST",
308
+ headers: { "Content-Type": "application/json" },
309
+ body: JSON.stringify(config)
310
+ });
311
+ if (!resp.ok) {
312
+ const body = await resp.text();
313
+ this.log(`Config reload failed: ${resp.status} ${body}`);
314
+ await this.stop();
315
+ await this.start();
316
+ }
317
+ } catch (err) {
318
+ this.log(`Config reload error: ${err.message} \u2014 restarting Caddy`);
319
+ await this.stop();
320
+ await this.start();
321
+ }
322
+ }
323
+ }
324
+
325
+ export { CaddyManager, ensureCaddy, generateCaddyConfig, getCaddyPath, isCaddyAvailable };
package/dist/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { s as startDaemon, b as stopDaemon, d as daemonStatus } from './run-CjIqQldq.mjs';
1
+ import { s as startDaemon, b as stopDaemon, d as daemonStatus } from './run-RmC13Tl0.mjs';
2
2
  import 'os';
3
3
  import 'fs/promises';
4
4
  import 'fs';
@@ -36,7 +36,7 @@ async function main() {
36
36
  await logoutFromHypha();
37
37
  } else if (subcommand === "daemon") {
38
38
  if (daemonSubcommand === "restart") {
39
- const { restartDaemon } = await import('./run-CjIqQldq.mjs').then(function (n) { return n.k; });
39
+ const { restartDaemon } = await import('./run-RmC13Tl0.mjs').then(function (n) { return n.k; });
40
40
  await restartDaemon();
41
41
  process.exit(0);
42
42
  }
@@ -238,7 +238,7 @@ async function main() {
238
238
  console.error("svamp service: Service commands are not available in sandboxed sessions.");
239
239
  process.exit(1);
240
240
  }
241
- const { handleServiceCommand } = await import('./commands-BJJTEZD4.mjs');
241
+ const { handleServiceCommand } = await import('./commands-nqemVu6x.mjs');
242
242
  await handleServiceCommand();
243
243
  } else if (subcommand === "serve") {
244
244
  const { isSandboxed: isSandboxedServe } = await import('./sandboxDetect-DNTcbgWD.mjs');
@@ -246,7 +246,7 @@ async function main() {
246
246
  console.error("svamp serve: Serve commands are not available in sandboxed sessions.");
247
247
  process.exit(1);
248
248
  }
249
- const { handleServeCommand } = await import('./serveCommands-DDcqg1UE.mjs');
249
+ const { handleServeCommand } = await import('./serveCommands-DjrDHb1P.mjs');
250
250
  await handleServeCommand();
251
251
  process.exit(0);
252
252
  } else if (subcommand === "process" || subcommand === "proc") {
@@ -255,7 +255,7 @@ async function main() {
255
255
  console.error("svamp process: Process commands are not available in sandboxed sessions.");
256
256
  process.exit(1);
257
257
  }
258
- const { processCommand } = await import('./commands-CClggVP2.mjs');
258
+ const { processCommand } = await import('./commands-BLKQjEXZ.mjs');
259
259
  let machineId;
260
260
  const processArgs = args.slice(1);
261
261
  const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
@@ -273,7 +273,7 @@ async function main() {
273
273
  } else if (!subcommand || subcommand === "start") {
274
274
  await handleInteractiveCommand();
275
275
  } else if (subcommand === "--version" || subcommand === "-v") {
276
- const pkg = await import('./package-CUYYyFK6.mjs').catch(() => ({ default: { version: "unknown" } }));
276
+ const pkg = await import('./package-DqW3pzdH.mjs').catch(() => ({ default: { version: "unknown" } }));
277
277
  console.log(`svamp version: ${pkg.default.version}`);
278
278
  } else {
279
279
  console.error(`Unknown command: ${subcommand}`);
@@ -282,7 +282,7 @@ async function main() {
282
282
  }
283
283
  }
284
284
  async function handleInteractiveCommand() {
285
- const { runInteractive } = await import('./run-Dj5-JlUt.mjs');
285
+ const { runInteractive } = await import('./run-DpjvWCbf.mjs');
286
286
  const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
287
287
  let directory = process.cwd();
288
288
  let resumeSessionId;
@@ -327,7 +327,7 @@ async function handleAgentCommand() {
327
327
  return;
328
328
  }
329
329
  if (agentArgs[0] === "list") {
330
- const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-CjIqQldq.mjs').then(function (n) { return n.i; });
330
+ const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-RmC13Tl0.mjs').then(function (n) { return n.i; });
331
331
  console.log("Known agents:");
332
332
  for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
333
333
  console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
@@ -339,7 +339,7 @@ async function handleAgentCommand() {
339
339
  console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
340
340
  return;
341
341
  }
342
- const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-CjIqQldq.mjs').then(function (n) { return n.i; });
342
+ const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-RmC13Tl0.mjs').then(function (n) { return n.i; });
343
343
  let cwd = process.cwd();
344
344
  const filteredArgs = [];
345
345
  for (let i = 0; i < agentArgs.length; i++) {
@@ -363,12 +363,12 @@ async function handleAgentCommand() {
363
363
  console.log(`Starting ${config.agentName} agent in ${cwd}...`);
364
364
  let backend;
365
365
  if (KNOWN_MCP_AGENTS[config.agentName]) {
366
- const { CodexMcpBackend } = await import('./run-CjIqQldq.mjs').then(function (n) { return n.j; });
366
+ const { CodexMcpBackend } = await import('./run-RmC13Tl0.mjs').then(function (n) { return n.j; });
367
367
  backend = new CodexMcpBackend({ cwd, log: logFn });
368
368
  } else {
369
- const { AcpBackend } = await import('./run-CjIqQldq.mjs').then(function (n) { return n.h; });
370
- const { GeminiTransport } = await import('./run-CjIqQldq.mjs').then(function (n) { return n.G; });
371
- const { DefaultTransport } = await import('./run-CjIqQldq.mjs').then(function (n) { return n.D; });
369
+ const { AcpBackend } = await import('./run-RmC13Tl0.mjs').then(function (n) { return n.h; });
370
+ const { GeminiTransport } = await import('./run-RmC13Tl0.mjs').then(function (n) { return n.G; });
371
+ const { DefaultTransport } = await import('./run-RmC13Tl0.mjs').then(function (n) { return n.D; });
372
372
  const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
373
373
  backend = new AcpBackend({
374
374
  agentName: config.agentName,
@@ -495,7 +495,7 @@ async function handleSessionCommand() {
495
495
  process.exit(1);
496
496
  }
497
497
  }
498
- const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-D7JEuzau.mjs');
498
+ const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-Bz4ax0Fl.mjs');
499
499
  const parseFlagStr = (flag, shortFlag) => {
500
500
  for (let i = 1; i < sessionArgs.length; i++) {
501
501
  if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
@@ -555,7 +555,7 @@ async function handleSessionCommand() {
555
555
  allowDomain.push(sessionArgs[++i]);
556
556
  }
557
557
  }
558
- const { parseShareArg } = await import('./commands-D7JEuzau.mjs');
558
+ const { parseShareArg } = await import('./commands-Bz4ax0Fl.mjs');
559
559
  const shareEntries = share.map((s) => parseShareArg(s));
560
560
  await sessionSpawn(agent, dir, targetMachineId, {
561
561
  message,
@@ -641,7 +641,7 @@ async function handleSessionCommand() {
641
641
  console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
642
642
  process.exit(1);
643
643
  }
644
- const { sessionApprove } = await import('./commands-D7JEuzau.mjs');
644
+ const { sessionApprove } = await import('./commands-Bz4ax0Fl.mjs');
645
645
  const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
646
646
  await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
647
647
  json: hasFlag("--json")
@@ -651,7 +651,7 @@ async function handleSessionCommand() {
651
651
  console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
652
652
  process.exit(1);
653
653
  }
654
- const { sessionDeny } = await import('./commands-D7JEuzau.mjs');
654
+ const { sessionDeny } = await import('./commands-Bz4ax0Fl.mjs');
655
655
  const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
656
656
  await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
657
657
  json: hasFlag("--json")
@@ -687,7 +687,7 @@ async function handleSessionCommand() {
687
687
  console.error("Usage: svamp session set-title <title>");
688
688
  process.exit(1);
689
689
  }
690
- const { sessionSetTitle } = await import('./agentCommands-Db074BKd.mjs');
690
+ const { sessionSetTitle } = await import('./agentCommands-BVCrgVdi.mjs');
691
691
  await sessionSetTitle(title);
692
692
  } else if (sessionSubcommand === "set-link") {
693
693
  const url = sessionArgs[1];
@@ -696,7 +696,7 @@ async function handleSessionCommand() {
696
696
  process.exit(1);
697
697
  }
698
698
  const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
699
- const { sessionSetLink } = await import('./agentCommands-Db074BKd.mjs');
699
+ const { sessionSetLink } = await import('./agentCommands-BVCrgVdi.mjs');
700
700
  await sessionSetLink(url, label);
701
701
  } else if (sessionSubcommand === "notify") {
702
702
  const message = sessionArgs[1];
@@ -705,7 +705,7 @@ async function handleSessionCommand() {
705
705
  process.exit(1);
706
706
  }
707
707
  const level = parseFlagStr("--level") || "info";
708
- const { sessionNotify } = await import('./agentCommands-Db074BKd.mjs');
708
+ const { sessionNotify } = await import('./agentCommands-BVCrgVdi.mjs');
709
709
  await sessionNotify(message, level);
710
710
  } else if (sessionSubcommand === "broadcast") {
711
711
  const action = sessionArgs[1];
@@ -713,7 +713,7 @@ async function handleSessionCommand() {
713
713
  console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
714
714
  process.exit(1);
715
715
  }
716
- const { sessionBroadcast } = await import('./agentCommands-Db074BKd.mjs');
716
+ const { sessionBroadcast } = await import('./agentCommands-BVCrgVdi.mjs');
717
717
  await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
718
718
  } else if (sessionSubcommand === "inbox") {
719
719
  const inboxSubcmd = sessionArgs[1];
@@ -724,7 +724,7 @@ async function handleSessionCommand() {
724
724
  process.exit(1);
725
725
  }
726
726
  if (agentSessionId) {
727
- const { inboxSend } = await import('./agentCommands-Db074BKd.mjs');
727
+ const { inboxSend } = await import('./agentCommands-BVCrgVdi.mjs');
728
728
  await inboxSend(sessionArgs[2], {
729
729
  body: sessionArgs[3],
730
730
  subject: parseFlagStr("--subject"),
@@ -739,7 +739,7 @@ async function handleSessionCommand() {
739
739
  }
740
740
  } else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
741
741
  if (agentSessionId && !sessionArgs[2]) {
742
- const { inboxList } = await import('./agentCommands-Db074BKd.mjs');
742
+ const { inboxList } = await import('./agentCommands-BVCrgVdi.mjs');
743
743
  await inboxList({
744
744
  unread: hasFlag("--unread"),
745
745
  limit: parseFlagInt("--limit"),
@@ -761,7 +761,7 @@ async function handleSessionCommand() {
761
761
  process.exit(1);
762
762
  }
763
763
  if (agentSessionId && !sessionArgs[3]) {
764
- const { inboxList } = await import('./agentCommands-Db074BKd.mjs');
764
+ const { inboxList } = await import('./agentCommands-BVCrgVdi.mjs');
765
765
  await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
766
766
  } else if (sessionArgs[3]) {
767
767
  await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
@@ -771,7 +771,7 @@ async function handleSessionCommand() {
771
771
  }
772
772
  } else if (inboxSubcmd === "reply") {
773
773
  if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
774
- const { inboxReply } = await import('./agentCommands-Db074BKd.mjs');
774
+ const { inboxReply } = await import('./agentCommands-BVCrgVdi.mjs');
775
775
  await inboxReply(sessionArgs[2], sessionArgs[3]);
776
776
  } else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
777
777
  await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
@@ -807,7 +807,7 @@ async function handleMachineCommand() {
807
807
  return;
808
808
  }
809
809
  if (machineSubcommand === "share") {
810
- const { machineShare } = await import('./commands-D7JEuzau.mjs');
810
+ const { machineShare } = await import('./commands-Bz4ax0Fl.mjs');
811
811
  let machineId;
812
812
  const shareArgs = [];
813
813
  for (let i = 1; i < machineArgs.length; i++) {
@@ -837,7 +837,7 @@ async function handleMachineCommand() {
837
837
  }
838
838
  await machineShare(machineId, { add, remove, list, configPath, showConfig });
839
839
  } else if (machineSubcommand === "exec") {
840
- const { machineExec } = await import('./commands-D7JEuzau.mjs');
840
+ const { machineExec } = await import('./commands-Bz4ax0Fl.mjs');
841
841
  let machineId;
842
842
  let cwd;
843
843
  const cmdParts = [];
@@ -857,7 +857,7 @@ async function handleMachineCommand() {
857
857
  }
858
858
  await machineExec(machineId, command, cwd);
859
859
  } else if (machineSubcommand === "info") {
860
- const { machineInfo } = await import('./commands-D7JEuzau.mjs');
860
+ const { machineInfo } = await import('./commands-Bz4ax0Fl.mjs');
861
861
  let machineId;
862
862
  for (let i = 1; i < machineArgs.length; i++) {
863
863
  if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
@@ -877,10 +877,10 @@ async function handleMachineCommand() {
877
877
  level = machineArgs[++i];
878
878
  }
879
879
  }
880
- const { machineNotify } = await import('./agentCommands-Db074BKd.mjs');
880
+ const { machineNotify } = await import('./agentCommands-BVCrgVdi.mjs');
881
881
  await machineNotify(message, level);
882
882
  } else if (machineSubcommand === "ls") {
883
- const { machineLs } = await import('./commands-D7JEuzau.mjs');
883
+ const { machineLs } = await import('./commands-Bz4ax0Fl.mjs');
884
884
  let machineId;
885
885
  let showHidden = false;
886
886
  let path;
@@ -908,7 +908,7 @@ async function handleSkillsCommand() {
908
908
  printSkillsHelp();
909
909
  return;
910
910
  }
911
- const { skillsFind, skillsInstall, skillsList, skillsRemove, skillsPublish } = await import('./commands-DJoYOM_1.mjs');
911
+ const { skillsFind, skillsInstall, skillsList, skillsRemove, skillsPublish } = await import('./commands-GMLad6_u.mjs');
912
912
  if (skillsSubcommand === "find" || skillsSubcommand === "search") {
913
913
  const query = skillsArgs.slice(1).filter((a) => !a.startsWith("--")).join(" ");
914
914
  if (!query) {
@@ -1,11 +1,11 @@
1
1
  import { writeFileSync, readFileSync } from 'fs';
2
2
  import { resolve } from 'path';
3
- import { connectAndGetMachine } from './commands-D7JEuzau.mjs';
3
+ import { connectAndGetMachine } from './commands-Bz4ax0Fl.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-CjIqQldq.mjs';
8
+ import './run-RmC13Tl0.mjs';
9
9
  import 'os';
10
10
  import 'fs/promises';
11
11
  import 'url';
@@ -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-CjIqQldq.mjs';
5
+ import { l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha } from './run-RmC13Tl0.mjs';
6
6
  import 'os';
7
7
  import 'fs/promises';
8
8
  import 'fs';
@@ -1,11 +1,11 @@
1
- import os__default from 'os';
1
+ import os from 'os';
2
2
  import fs__default from 'fs';
3
3
  import { join, resolve, relative } from 'path';
4
4
 
5
5
  const SKILLS_SERVER = process.env.HYPHA_SKILLS_SERVER || "https://hypha.aicell.io";
6
6
  const SKILLS_WORKSPACE = process.env.HYPHA_SKILLS_WORKSPACE || "hypha-cloud";
7
7
  const SKILLS_COLLECTION = process.env.HYPHA_SKILLS_COLLECTION || "marketplace";
8
- const SKILLS_DIR = join(os__default.homedir(), ".claude", "skills");
8
+ const SKILLS_DIR = join(os.homedir(), ".claude", "skills");
9
9
  function getArtifactBaseUrl() {
10
10
  return `${SKILLS_SERVER}/${SKILLS_WORKSPACE}/artifacts`;
11
11
  }
@@ -125,7 +125,7 @@ function normalizeSkill(item) {
125
125
  };
126
126
  }
127
127
 
128
- const SVAMP_HOME = process.env.SVAMP_HOME || join(os__default.homedir(), ".svamp");
128
+ const SVAMP_HOME = process.env.SVAMP_HOME || join(os.homedir(), ".svamp");
129
129
  const ENV_FILE = join(SVAMP_HOME, ".env");
130
130
  function loadDotEnv() {
131
131
  if (!fs__default.existsSync(ENV_FILE)) return;