svamp-cli 0.2.246 → 0.2.248

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.
Files changed (26) hide show
  1. package/dist/{agentCommands-wOdV4Do1.mjs → agentCommands-B_ozIVKT.mjs} +28 -11
  2. package/dist/{auth-Bg0Z_bP-.mjs → auth-BLDmT7XN.mjs} +2 -1
  3. package/dist/cli.mjs +83 -68
  4. package/dist/{commands-BhLGBhBS.mjs → commands-C3TQOYUo.mjs} +2 -1
  5. package/dist/{commands-Z8Ki8iA9.mjs → commands-CL8YI8k5.mjs} +2 -1
  6. package/dist/{commands-Bi_LZXPe.mjs → commands-CRMQUQZG.mjs} +2 -1
  7. package/dist/{commands-CudvGpEz.mjs → commands-Cs2fNd-_.mjs} +7 -7
  8. package/dist/{commands-CniwP5Tm.mjs → commands-DS4i8ohA.mjs} +10 -6
  9. package/dist/{commands-CkduYG4a.mjs → commands-Djvi1cZ2.mjs} +3 -2
  10. package/dist/{commands-D9khoYtI.mjs → commands-DwhA-iV3.mjs} +3 -2
  11. package/dist/{fleet-DCMPBC7b.mjs → fleet-CJZOVjOY.mjs} +13 -4
  12. package/dist/{frpc-nvGz8fWs.mjs → frpc-CsjEXBuS.mjs} +2 -1
  13. package/dist/{headlessCli-d6XjdG6n.mjs → headlessCli-qBontdlf.mjs} +3 -2
  14. package/dist/index.mjs +2 -1
  15. package/dist/{package-CUTX-CB-.mjs → package-B7z6GsNX.mjs} +2 -2
  16. package/dist/{rpc-CDI7i151.mjs → rpc-BGFgegj5.mjs} +1 -3
  17. package/dist/{rpc-s_Hibfpl.mjs → rpc-C1DI7HfZ.mjs} +2 -1
  18. package/dist/{run-DRR6psuh.mjs → run-C61rsl7r.mjs} +2 -1
  19. package/dist/{run-BPZ_1RCI.mjs → run-CHIppB2r.mjs} +739 -35
  20. package/dist/{scheduler-E1Bw4HUY.mjs → scheduler-Csp21zzg.mjs} +1 -3
  21. package/dist/{serveCommands-Af_7qqzA.mjs → serveCommands-BYHk72ZO.mjs} +5 -5
  22. package/dist/{serveManager-DGRpRAFM.mjs → serveManager-Di3xrvG2.mjs} +3 -2
  23. package/dist/{sideband-C-0cCNeL.mjs → sideband-Cs-kNLye.mjs} +2 -1
  24. package/package.json +2 -2
  25. package/dist/runStore-DKC_bMSi.mjs +0 -239
  26. package/dist/store-BTs0H_y0.mjs +0 -148
@@ -2,7 +2,7 @@ import { existsSync, readFileSync, mkdirSync, writeFileSync, renameSync } from '
2
2
  import { join, dirname } from 'node:path';
3
3
  import os from 'node:os';
4
4
  import { requireNotSandboxed } from './sandboxDetect-DNTcbgWD.mjs';
5
- import { A as shortId } from './run-BPZ_1RCI.mjs';
5
+ import { k as shortId } from './run-CHIppB2r.mjs';
6
6
  import 'os';
7
7
  import 'fs/promises';
8
8
  import 'fs';
@@ -21,6 +21,7 @@ import '@modelcontextprotocol/sdk/types.js';
21
21
  import 'zod';
22
22
  import 'node:fs/promises';
23
23
  import 'node:util';
24
+ import 'yaml';
24
25
 
25
26
  const SVAMP_HOME = process.env.SVAMP_HOME || join(os.homedir(), ".svamp");
26
27
  function getConfigPath(sessionId) {
@@ -96,7 +97,7 @@ async function sessionSetTitle(title) {
96
97
  }
97
98
  async function sessionSetProjectDescription(description) {
98
99
  const dir = process.cwd();
99
- const { projectName, writeProjectInfo, sanitizeDescription, projectInfoPath } = await import('./run-BPZ_1RCI.mjs').then(function (n) { return n.a9; });
100
+ const { projectName, writeProjectInfo, sanitizeDescription, projectInfoPath } = await import('./run-CHIppB2r.mjs').then(function (n) { return n.al; });
100
101
  const desc = sanitizeDescription(description, 240);
101
102
  if (!desc) {
102
103
  console.error("Project description is empty.");
@@ -143,7 +144,8 @@ function readSessionLinks(config) {
143
144
  id: String(l.id || shortLinkId()),
144
145
  label: String(l.label || ""),
145
146
  url: String(l.url),
146
- ...l.icon ? { icon: String(l.icon) } : {}
147
+ ...l.icon ? { icon: String(l.icon) } : {},
148
+ ...l.service && typeof l.service.name === "string" && (l.service.kind === "tunnel" || l.service.kind === "process") ? { service: { kind: l.service.kind, name: String(l.service.name) } } : {}
147
149
  }));
148
150
  }
149
151
  if (config.session_link && typeof config.session_link.url === "string") {
@@ -183,32 +185,47 @@ function upsertSessionLink(links, incoming) {
183
185
  const next = links.slice();
184
186
  const idx = next.findIndex((l) => linkDedupKey(l.url) === key);
185
187
  const icon = incoming.icon?.trim();
188
+ const service = incoming.service ?? (idx >= 0 ? next[idx].service : void 0);
186
189
  if (idx >= 0) {
187
190
  const existing = next[idx];
188
191
  next[idx] = {
189
192
  id: existing.id,
190
193
  url,
191
194
  label: labelFor(url, incoming.label),
192
- ...icon ? { icon } : existing.icon ? { icon: existing.icon } : {}
195
+ ...icon ? { icon } : existing.icon ? { icon: existing.icon } : {},
196
+ ...service ? { service } : {}
193
197
  };
194
198
  } else {
195
- next.push({ id: shortLinkId(), url, label: labelFor(url, incoming.label), ...icon ? { icon } : {} });
199
+ next.push({ id: shortLinkId(), url, label: labelFor(url, incoming.label), ...icon ? { icon } : {}, ...service ? { service } : {} });
196
200
  }
197
201
  return next;
198
202
  }
199
- function autoAddSessionLink(url, label, icon) {
203
+ function autoAddSessionLink(url, label, icon, service) {
200
204
  const sessionId = process.env.SVAMP_SESSION_ID;
201
205
  if (!sessionId || !url || !url.trim()) return false;
202
206
  try {
203
207
  const configPath = getConfigPath(sessionId);
204
208
  const config = readConfig(configPath);
205
- const next = upsertSessionLink(readSessionLinks(config), { url, label, icon });
209
+ const next = upsertSessionLink(readSessionLinks(config), { url, label, icon, service });
206
210
  writeSessionLinks(configPath, config, next);
207
211
  return true;
208
212
  } catch {
209
213
  return false;
210
214
  }
211
215
  }
216
+ function reconcileServiceLinks(config, incoming) {
217
+ const before = readSessionLinks(config);
218
+ let links = before;
219
+ for (const item of incoming) {
220
+ if (!item.url || !item.url.trim()) continue;
221
+ links = upsertSessionLink(links, item);
222
+ }
223
+ const canon = (ls) => JSON.stringify(ls.map((l) => [l.id, l.label, l.url, l.icon || "", l.service ? `${l.service.kind}:${l.service.name}` : ""]));
224
+ if (canon(links) === canon(before)) return false;
225
+ config.session_links = links;
226
+ config.session_link = links[0] ? { url: links[0].url, label: links[0].label } : void 0;
227
+ return true;
228
+ }
212
229
  function requireSessionId() {
213
230
  const sessionId = process.env.SVAMP_SESSION_ID;
214
231
  if (!sessionId) {
@@ -327,7 +344,7 @@ async function sessionBroadcast(action, args) {
327
344
  console.log(`Broadcast sent: ${action}`);
328
345
  }
329
346
  async function connectToMachineService() {
330
- const { connectAndGetMachine } = await import('./commands-BhLGBhBS.mjs');
347
+ const { connectAndGetMachine } = await import('./commands-C3TQOYUo.mjs');
331
348
  return connectAndGetMachine();
332
349
  }
333
350
  function buildInboxMessage(args) {
@@ -405,7 +422,7 @@ async function inboxSend(targetSessionId, opts) {
405
422
  console.error("Message body is required.");
406
423
  process.exit(1);
407
424
  }
408
- const { connectAndResolveSession } = await import('./commands-BhLGBhBS.mjs');
425
+ const { connectAndResolveSession } = await import('./commands-C3TQOYUo.mjs');
409
426
  let server;
410
427
  try {
411
428
  const { targetId, messageId } = await inboxSendCore(
@@ -459,7 +476,7 @@ async function inboxReply(messageId, body) {
459
476
  console.error("SVAMP_SESSION_ID not set. This command must be run inside a Svamp session.");
460
477
  process.exit(1);
461
478
  }
462
- const { connectAndResolveSession } = await import('./commands-BhLGBhBS.mjs');
479
+ const { connectAndResolveSession } = await import('./commands-C3TQOYUo.mjs');
463
480
  const { server: localServer, machine: localMachine } = await connectToMachineService();
464
481
  let localDisconnected = false;
465
482
  const disconnectLocal = async () => {
@@ -523,4 +540,4 @@ async function machineNotify(message, level = "info") {
523
540
  console.log(`Machine notification sent [${level}]: ${message}`);
524
541
  }
525
542
 
526
- export { autoAddSessionLink, buildInboxMessage, inboxList, inboxReply, inboxReplyCore, inboxSend, inboxSendCore, linkDedupKey, machineNotify, sessionBroadcast, sessionLinkAdd, sessionLinkList, sessionLinkRemove, sessionLinkUpdate, sessionNotify, sessionSetLink, sessionSetProjectDescription, sessionSetTitle, upsertSessionLink };
543
+ export { autoAddSessionLink, buildInboxMessage, inboxList, inboxReply, inboxReplyCore, inboxSend, inboxSendCore, linkDedupKey, machineNotify, reconcileServiceLinks, sessionBroadcast, sessionLinkAdd, sessionLinkList, sessionLinkRemove, sessionLinkUpdate, sessionNotify, sessionSetLink, sessionSetProjectDescription, sessionSetTitle, upsertSessionLink };
@@ -1,4 +1,4 @@
1
- import { P as resolveModel } from './run-BPZ_1RCI.mjs';
1
+ import { a1 as resolveModel } from './run-CHIppB2r.mjs';
2
2
  import 'os';
3
3
  import 'fs/promises';
4
4
  import 'fs';
@@ -20,6 +20,7 @@ import '@modelcontextprotocol/sdk/types.js';
20
20
  import 'zod';
21
21
  import 'node:fs/promises';
22
22
  import 'node:util';
23
+ import 'yaml';
23
24
 
24
25
  function buildWiseAgentEnvUpdates(action) {
25
26
  switch (action.kind) {
package/dist/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { e as clearStopMarker, f as stopMarkerExists, s as startDaemon, b as stopDaemon, d as daemonStatus } from './run-BPZ_1RCI.mjs';
1
+ import { e as clearStopMarker, f as stopMarkerExists, s as startDaemon, b as stopDaemon, d as daemonStatus } from './run-CHIppB2r.mjs';
2
2
  import { ensureSupervisorViaServiceManager, LAUNCHD_LABEL } from './serviceManager-hlOVxkhW.mjs';
3
3
  import 'os';
4
4
  import 'fs/promises';
@@ -21,6 +21,7 @@ import '@modelcontextprotocol/sdk/types.js';
21
21
  import 'zod';
22
22
  import 'node:fs/promises';
23
23
  import 'node:util';
24
+ import 'yaml';
24
25
 
25
26
  const nodeMajor = parseInt(process.versions.node.split(".")[0], 10);
26
27
  if (nodeMajor < 22) {
@@ -34,7 +35,7 @@ const subcommand = args[0];
34
35
  let daemonSubcommand = args[1];
35
36
  async function main() {
36
37
  try {
37
- const { getLoadedConfig } = await import('./run-BPZ_1RCI.mjs').then(function (n) { return n.af; });
38
+ const { getLoadedConfig } = await import('./run-CHIppB2r.mjs').then(function (n) { return n.ar; });
38
39
  getLoadedConfig();
39
40
  } catch {
40
41
  }
@@ -51,8 +52,18 @@ async function main() {
51
52
  console.error(`svamp daemon restart: ${err.message || err}`);
52
53
  process.exit(1);
53
54
  }
54
- const { restartDaemon } = await import('./run-BPZ_1RCI.mjs').then(function (n) { return n.ah; });
55
- await restartDaemon();
55
+ const whenIdle = args.includes("--when-idle");
56
+ const force = args.includes("--force");
57
+ const mod = await import('./run-CHIppB2r.mjs').then(function (n) { return n.at; });
58
+ if (whenIdle && !force) {
59
+ if (mod.isDaemonAlive()) {
60
+ mod.writePendingRestart({ reason: "svamp daemon restart --when-idle" });
61
+ console.log("\u2713 Scheduled a graceful restart \u2014 the daemon will restart when no session is actively thinking (max wait 1h).");
62
+ process.exit(0);
63
+ }
64
+ console.log("Daemon not running \u2014 restarting immediately.");
65
+ }
66
+ await mod.restartDaemon();
56
67
  process.exit(0);
57
68
  }
58
69
  if (daemonSubcommand === "start") {
@@ -344,7 +355,7 @@ async function main() {
344
355
  console.error("svamp service: Service commands are not available in sandboxed sessions.");
345
356
  process.exit(1);
346
357
  }
347
- const { handleServiceCommand } = await import('./commands-CudvGpEz.mjs');
358
+ const { handleServiceCommand } = await import('./commands-Cs2fNd-_.mjs');
348
359
  await handleServiceCommand();
349
360
  } else if (subcommand === "serve") {
350
361
  const { isSandboxed: isSandboxedServe } = await import('./sandboxDetect-DNTcbgWD.mjs');
@@ -352,7 +363,7 @@ async function main() {
352
363
  console.error("svamp serve: Serve commands are not available in sandboxed sessions.");
353
364
  process.exit(1);
354
365
  }
355
- const { handleServeCommand } = await import('./serveCommands-Af_7qqzA.mjs');
366
+ const { handleServeCommand } = await import('./serveCommands-BYHk72ZO.mjs');
356
367
  await handleServeCommand();
357
368
  process.exit(0);
358
369
  } else if (subcommand === "process" || subcommand === "proc") {
@@ -361,7 +372,7 @@ async function main() {
361
372
  console.error("svamp process: Process commands are not available in sandboxed sessions.");
362
373
  process.exit(1);
363
374
  }
364
- const { processCommand } = await import('./commands-CkduYG4a.mjs');
375
+ const { processCommand } = await import('./commands-Djvi1cZ2.mjs');
365
376
  let machineId;
366
377
  const processArgs = args.slice(1);
367
378
  const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
@@ -375,18 +386,18 @@ async function main() {
375
386
  }), machineId);
376
387
  process.exit(0);
377
388
  } else if (subcommand === "issue" || subcommand === "issues") {
378
- const { issueCommand } = await import('./commands-Bi_LZXPe.mjs');
389
+ const { issueCommand } = await import('./commands-CRMQUQZG.mjs');
379
390
  await issueCommand(args.slice(1));
380
391
  process.exit(0);
381
392
  } else if (subcommand === "workflow" || subcommand === "workflows") {
382
- const { workflowCommand } = await import('./commands-CniwP5Tm.mjs');
393
+ const { workflowCommand } = await import('./commands-DS4i8ohA.mjs');
383
394
  await workflowCommand(args.slice(1));
384
395
  process.exit(0);
385
396
  } else if (subcommand === "wise-agent" || subcommand === "wise") {
386
397
  await handleWiseAgentCommand(args.slice(1));
387
398
  process.exit(0);
388
399
  } else if (subcommand === "feature" || subcommand === "crew") {
389
- const { crewCommand } = await import('./commands-D9khoYtI.mjs');
400
+ const { crewCommand } = await import('./commands-DwhA-iV3.mjs');
390
401
  await crewCommand(args.slice(1));
391
402
  process.exit(0);
392
403
  } else if (subcommand === "--help" || subcommand === "-h") {
@@ -394,7 +405,7 @@ async function main() {
394
405
  } else if (!subcommand || subcommand === "start") {
395
406
  await handleInteractiveCommand();
396
407
  } else if (subcommand === "--version" || subcommand === "-v") {
397
- const pkg = await import('./package-CUTX-CB-.mjs').catch(() => ({ default: { version: "unknown" } }));
408
+ const pkg = await import('./package-B7z6GsNX.mjs').catch(() => ({ default: { version: "unknown" } }));
398
409
  console.log(`svamp version: ${pkg.default.version}`);
399
410
  } else {
400
411
  console.error(`Unknown command: ${subcommand}`);
@@ -403,7 +414,7 @@ async function main() {
403
414
  }
404
415
  }
405
416
  async function handleInteractiveCommand() {
406
- const { runInteractive } = await import('./run-DRR6psuh.mjs');
417
+ const { runInteractive } = await import('./run-C61rsl7r.mjs');
407
418
  const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
408
419
  let directory = process.cwd();
409
420
  let resumeSessionId;
@@ -448,7 +459,7 @@ async function handleAgentCommand() {
448
459
  return;
449
460
  }
450
461
  if (agentArgs[0] === "list") {
451
- const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-BPZ_1RCI.mjs').then(function (n) { return n.ac; });
462
+ const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-CHIppB2r.mjs').then(function (n) { return n.ao; });
452
463
  console.log("Known agents:");
453
464
  for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
454
465
  console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
@@ -460,7 +471,7 @@ async function handleAgentCommand() {
460
471
  console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
461
472
  return;
462
473
  }
463
- const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-BPZ_1RCI.mjs').then(function (n) { return n.ac; });
474
+ const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-CHIppB2r.mjs').then(function (n) { return n.ao; });
464
475
  let cwd = process.cwd();
465
476
  const filteredArgs = [];
466
477
  for (let i = 0; i < agentArgs.length; i++) {
@@ -484,12 +495,12 @@ async function handleAgentCommand() {
484
495
  console.log(`Starting ${config.agentName} agent in ${cwd}...`);
485
496
  let backend;
486
497
  if (KNOWN_MCP_AGENTS[config.agentName]) {
487
- const { CodexMcpBackend } = await import('./run-BPZ_1RCI.mjs').then(function (n) { return n.ad; });
498
+ const { CodexMcpBackend } = await import('./run-CHIppB2r.mjs').then(function (n) { return n.ap; });
488
499
  backend = new CodexMcpBackend({ cwd, log: logFn });
489
500
  } else {
490
- const { AcpBackend } = await import('./run-BPZ_1RCI.mjs').then(function (n) { return n.ab; });
491
- const { GeminiTransport } = await import('./run-BPZ_1RCI.mjs').then(function (n) { return n.ae; });
492
- const { DefaultTransport } = await import('./run-BPZ_1RCI.mjs').then(function (n) { return n.aa; });
501
+ const { AcpBackend } = await import('./run-CHIppB2r.mjs').then(function (n) { return n.an; });
502
+ const { GeminiTransport } = await import('./run-CHIppB2r.mjs').then(function (n) { return n.aq; });
503
+ const { DefaultTransport } = await import('./run-CHIppB2r.mjs').then(function (n) { return n.am; });
493
504
  const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
494
505
  backend = new AcpBackend({
495
506
  agentName: config.agentName,
@@ -616,7 +627,7 @@ async function handleSessionCommand() {
616
627
  process.exit(1);
617
628
  }
618
629
  }
619
- const { sessionList, sessionWhoami, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionLoopStart, sessionLoopCancel, sessionLoopStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-BhLGBhBS.mjs');
630
+ const { sessionList, sessionWhoami, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionLoopStart, sessionLoopCancel, sessionLoopStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-C3TQOYUo.mjs');
620
631
  const parseFlagStr = (flag, shortFlag) => {
621
632
  for (let i = 1; i < sessionArgs.length; i++) {
622
633
  if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
@@ -684,7 +695,7 @@ async function handleSessionCommand() {
684
695
  allowDomain.push(sessionArgs[++i]);
685
696
  }
686
697
  }
687
- const { parseShareArg } = await import('./commands-BhLGBhBS.mjs');
698
+ const { parseShareArg } = await import('./commands-C3TQOYUo.mjs');
688
699
  const shareEntries = share.map((s) => parseShareArg(s));
689
700
  await sessionSpawn(agent, dir, targetMachineId, {
690
701
  message,
@@ -772,7 +783,7 @@ async function handleSessionCommand() {
772
783
  console.error(" Rewinds history: rewrites the message + drops everything after it, then restarts Claude.");
773
784
  process.exit(1);
774
785
  }
775
- const { sessionEditMessage } = await import('./commands-BhLGBhBS.mjs');
786
+ const { sessionEditMessage } = await import('./commands-C3TQOYUo.mjs');
776
787
  await sessionEditMessage(sessionArgs[1], sessionArgs[2], sessionArgs[3], targetMachineId);
777
788
  } else if (sessionSubcommand === "refine") {
778
789
  if (!sessionArgs[1] || !sessionArgs[2]) {
@@ -780,7 +791,7 @@ async function handleSessionCommand() {
780
791
  console.error(" Asks the agent to revise its latest reply in place (no extra round).");
781
792
  process.exit(1);
782
793
  }
783
- const { sessionRefineLastReply } = await import('./commands-BhLGBhBS.mjs');
794
+ const { sessionRefineLastReply } = await import('./commands-C3TQOYUo.mjs');
784
795
  await sessionRefineLastReply(sessionArgs[1], sessionArgs[2], targetMachineId);
785
796
  } else if (sessionSubcommand === "undo-edit" || sessionSubcommand === "undo") {
786
797
  if (!sessionArgs[1]) {
@@ -788,7 +799,7 @@ async function handleSessionCommand() {
788
799
  console.error(" Reverts the most recent edit/refine, restoring the pre-edit history.");
789
800
  process.exit(1);
790
801
  }
791
- const { sessionUndoEdit } = await import('./commands-BhLGBhBS.mjs');
802
+ const { sessionUndoEdit } = await import('./commands-C3TQOYUo.mjs');
792
803
  await sessionUndoEdit(sessionArgs[1], targetMachineId);
793
804
  } else if (sessionSubcommand === "query") {
794
805
  const dir = sessionArgs[1];
@@ -798,7 +809,7 @@ async function handleSessionCommand() {
798
809
  console.error(" Spawns a stateless Claude session in <directory>, sends <prompt>, prints the answer, then deletes the session.");
799
810
  process.exit(1);
800
811
  }
801
- const { sessionQuery } = await import('./commands-BhLGBhBS.mjs');
812
+ const { sessionQuery } = await import('./commands-C3TQOYUo.mjs');
802
813
  await sessionQuery(dir, prompt, targetMachineId, {
803
814
  timeout: parseFlagInt("--timeout"),
804
815
  json: hasFlag("--json"),
@@ -831,7 +842,7 @@ async function handleSessionCommand() {
831
842
  console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
832
843
  process.exit(1);
833
844
  }
834
- const { sessionApprove } = await import('./commands-BhLGBhBS.mjs');
845
+ const { sessionApprove } = await import('./commands-C3TQOYUo.mjs');
835
846
  const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
836
847
  await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
837
848
  json: hasFlag("--json")
@@ -841,7 +852,7 @@ async function handleSessionCommand() {
841
852
  console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
842
853
  process.exit(1);
843
854
  }
844
- const { sessionDeny } = await import('./commands-BhLGBhBS.mjs');
855
+ const { sessionDeny } = await import('./commands-C3TQOYUo.mjs');
845
856
  const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
846
857
  await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
847
858
  json: hasFlag("--json")
@@ -886,7 +897,7 @@ async function handleSessionCommand() {
886
897
  console.error("Usage: svamp session set-title <title>");
887
898
  process.exit(1);
888
899
  }
889
- const { sessionSetTitle } = await import('./agentCommands-wOdV4Do1.mjs');
900
+ const { sessionSetTitle } = await import('./agentCommands-B_ozIVKT.mjs');
890
901
  await sessionSetTitle(title);
891
902
  } else if (sessionSubcommand === "set-project-description" || sessionSubcommand === "set-project") {
892
903
  const desc = sessionArgs.slice(1).filter((a) => !a.startsWith("--")).join(" ");
@@ -894,7 +905,7 @@ async function handleSessionCommand() {
894
905
  console.error("Usage: svamp session set-project-description <text>");
895
906
  process.exit(1);
896
907
  }
897
- const { sessionSetProjectDescription } = await import('./agentCommands-wOdV4Do1.mjs');
908
+ const { sessionSetProjectDescription } = await import('./agentCommands-B_ozIVKT.mjs');
898
909
  await sessionSetProjectDescription(desc);
899
910
  } else if (sessionSubcommand === "set-link") {
900
911
  const url = sessionArgs[1];
@@ -903,11 +914,11 @@ async function handleSessionCommand() {
903
914
  process.exit(1);
904
915
  }
905
916
  const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
906
- const { sessionSetLink } = await import('./agentCommands-wOdV4Do1.mjs');
917
+ const { sessionSetLink } = await import('./agentCommands-B_ozIVKT.mjs');
907
918
  await sessionSetLink(url, label);
908
919
  } else if (sessionSubcommand === "link") {
909
920
  const op = sessionArgs[1];
910
- const lm = await import('./agentCommands-wOdV4Do1.mjs');
921
+ const lm = await import('./agentCommands-B_ozIVKT.mjs');
911
922
  if (op === "add") {
912
923
  const url = sessionArgs[2];
913
924
  if (!url || url.startsWith("--")) {
@@ -942,7 +953,7 @@ async function handleSessionCommand() {
942
953
  process.exit(1);
943
954
  }
944
955
  const level = parseFlagStr("--level") || "info";
945
- const { sessionNotify } = await import('./agentCommands-wOdV4Do1.mjs');
956
+ const { sessionNotify } = await import('./agentCommands-B_ozIVKT.mjs');
946
957
  await sessionNotify(message, level);
947
958
  } else if (sessionSubcommand === "broadcast") {
948
959
  const action = sessionArgs[1];
@@ -950,7 +961,7 @@ async function handleSessionCommand() {
950
961
  console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
951
962
  process.exit(1);
952
963
  }
953
- const { sessionBroadcast } = await import('./agentCommands-wOdV4Do1.mjs');
964
+ const { sessionBroadcast } = await import('./agentCommands-B_ozIVKT.mjs');
954
965
  await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
955
966
  } else if (sessionSubcommand === "inbox") {
956
967
  const inboxSubcmd = sessionArgs[1];
@@ -961,7 +972,7 @@ async function handleSessionCommand() {
961
972
  process.exit(1);
962
973
  }
963
974
  if (agentSessionId) {
964
- const { inboxSend } = await import('./agentCommands-wOdV4Do1.mjs');
975
+ const { inboxSend } = await import('./agentCommands-B_ozIVKT.mjs');
965
976
  await inboxSend(sessionArgs[2], {
966
977
  body: sessionArgs[3],
967
978
  subject: parseFlagStr("--subject"),
@@ -976,7 +987,7 @@ async function handleSessionCommand() {
976
987
  }
977
988
  } else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
978
989
  if (agentSessionId && !sessionArgs[2]) {
979
- const { inboxList } = await import('./agentCommands-wOdV4Do1.mjs');
990
+ const { inboxList } = await import('./agentCommands-B_ozIVKT.mjs');
980
991
  await inboxList({
981
992
  unread: hasFlag("--unread"),
982
993
  limit: parseFlagInt("--limit"),
@@ -998,7 +1009,7 @@ async function handleSessionCommand() {
998
1009
  process.exit(1);
999
1010
  }
1000
1011
  if (agentSessionId && !sessionArgs[3]) {
1001
- const { inboxList } = await import('./agentCommands-wOdV4Do1.mjs');
1012
+ const { inboxList } = await import('./agentCommands-B_ozIVKT.mjs');
1002
1013
  await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
1003
1014
  } else if (sessionArgs[3]) {
1004
1015
  await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
@@ -1008,7 +1019,7 @@ async function handleSessionCommand() {
1008
1019
  }
1009
1020
  } else if (inboxSubcmd === "reply") {
1010
1021
  if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
1011
- const { inboxReply } = await import('./agentCommands-wOdV4Do1.mjs');
1022
+ const { inboxReply } = await import('./agentCommands-B_ozIVKT.mjs');
1012
1023
  await inboxReply(sessionArgs[2], sessionArgs[3]);
1013
1024
  } else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
1014
1025
  await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
@@ -1046,7 +1057,7 @@ async function handleMachineCommand() {
1046
1057
  return;
1047
1058
  }
1048
1059
  if (machineSubcommand === "share") {
1049
- const { machineShare } = await import('./commands-BhLGBhBS.mjs');
1060
+ const { machineShare } = await import('./commands-C3TQOYUo.mjs');
1050
1061
  let machineId;
1051
1062
  const shareArgs = [];
1052
1063
  for (let i = 1; i < machineArgs.length; i++) {
@@ -1097,14 +1108,14 @@ async function handleMachineCommand() {
1097
1108
  process.exit(1);
1098
1109
  }
1099
1110
  if (all) {
1100
- const { fleetExec } = await import('./fleet-DCMPBC7b.mjs');
1111
+ const { fleetExec } = await import('./fleet-CJZOVjOY.mjs');
1101
1112
  await fleetExec(command, { cwd });
1102
1113
  } else {
1103
- const { machineExec } = await import('./commands-BhLGBhBS.mjs');
1114
+ const { machineExec } = await import('./commands-C3TQOYUo.mjs');
1104
1115
  await machineExec(machineId, command, cwd);
1105
1116
  }
1106
1117
  } else if (machineSubcommand === "info") {
1107
- const { machineInfo } = await import('./commands-BhLGBhBS.mjs');
1118
+ const { machineInfo } = await import('./commands-C3TQOYUo.mjs');
1108
1119
  let machineId;
1109
1120
  for (let i = 1; i < machineArgs.length; i++) {
1110
1121
  if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
@@ -1124,10 +1135,10 @@ async function handleMachineCommand() {
1124
1135
  level = machineArgs[++i];
1125
1136
  }
1126
1137
  }
1127
- const { machineNotify } = await import('./agentCommands-wOdV4Do1.mjs');
1138
+ const { machineNotify } = await import('./agentCommands-B_ozIVKT.mjs');
1128
1139
  await machineNotify(message, level);
1129
1140
  } else if (machineSubcommand === "ls") {
1130
- const { machineLs } = await import('./commands-BhLGBhBS.mjs');
1141
+ const { machineLs } = await import('./commands-C3TQOYUo.mjs');
1131
1142
  let machineId;
1132
1143
  let showHidden = false;
1133
1144
  let path;
@@ -1157,10 +1168,13 @@ async function handleFleetCommand() {
1157
1168
  Subcommands (fan out across every machine in your workspace):
1158
1169
  status Show svamp + claude-code version per machine
1159
1170
  upgrade-claude [-v X] Install Claude Code (defaults to svamp-cli's pinned version)
1160
- upgrade-svamp [-v X] [--exclude-self]
1161
- npm install -g svamp-cli@X + svamp daemon restart
1162
- (--exclude-self skips this machine to avoid
1163
- interrupting the current session)
1171
+ upgrade-svamp [-v X] [--exclude-self] [--force]
1172
+ npm install -g svamp-cli@X, then restart each daemon.
1173
+ DEFAULT is graceful: each daemon restarts itself only
1174
+ when it has no actively-thinking session (never cuts an
1175
+ in-flight turn; 1h max-wait backstop). --force restarts
1176
+ immediately. --exclude-self skips this machine.
1177
+ (First roll onto a graceful-capable build needs --force.)
1164
1178
  daemon-restart [--cleanup] Restart daemons (default graceful)
1165
1179
  push-skill <name> Install/force-refresh a skill on all machines
1166
1180
 
@@ -1183,20 +1197,20 @@ Examples:
1183
1197
  };
1184
1198
  const hasFlag = (name) => fleetArgs.includes(`--${name}`);
1185
1199
  if (sub === "status") {
1186
- const { fleetStatus } = await import('./fleet-DCMPBC7b.mjs');
1200
+ const { fleetStatus } = await import('./fleet-CJZOVjOY.mjs');
1187
1201
  await fleetStatus();
1188
1202
  } else if (sub === "upgrade-claude") {
1189
- const { fleetUpgradeClaude } = await import('./fleet-DCMPBC7b.mjs');
1203
+ const { fleetUpgradeClaude } = await import('./fleet-CJZOVjOY.mjs');
1190
1204
  await fleetUpgradeClaude({ version: flag("version", "-v") });
1191
1205
  } else if (sub === "upgrade-svamp") {
1192
- const { fleetUpgradeSvamp } = await import('./fleet-DCMPBC7b.mjs');
1193
- await fleetUpgradeSvamp({ version: flag("version", "-v"), excludeSelf: hasFlag("exclude-self") });
1206
+ const { fleetUpgradeSvamp } = await import('./fleet-CJZOVjOY.mjs');
1207
+ await fleetUpgradeSvamp({ version: flag("version", "-v"), excludeSelf: hasFlag("exclude-self"), force: hasFlag("force") });
1194
1208
  } else if (sub === "daemon-restart") {
1195
- const { fleetDaemonRestart } = await import('./fleet-DCMPBC7b.mjs');
1209
+ const { fleetDaemonRestart } = await import('./fleet-CJZOVjOY.mjs');
1196
1210
  await fleetDaemonRestart({ graceful: !hasFlag("cleanup") });
1197
1211
  } else if (sub === "push-skill") {
1198
1212
  const name = fleetArgs[1];
1199
- const { fleetPushSkill } = await import('./fleet-DCMPBC7b.mjs');
1213
+ const { fleetPushSkill } = await import('./fleet-CJZOVjOY.mjs');
1200
1214
  await fleetPushSkill(name);
1201
1215
  } else {
1202
1216
  console.error(`Unknown fleet subcommand: ${sub}`);
@@ -1212,7 +1226,7 @@ async function handleSkillsCommand() {
1212
1226
  await printSkillsHelp();
1213
1227
  return;
1214
1228
  }
1215
- const { skillsFind, skillsInstall, skillsList, skillsRemove, skillsPublish } = await import('./commands-Z8Ki8iA9.mjs');
1229
+ const { skillsFind, skillsInstall, skillsList, skillsRemove, skillsPublish } = await import('./commands-CL8YI8k5.mjs');
1216
1230
  if (skillsSubcommand === "find" || skillsSubcommand === "search") {
1217
1231
  const query = skillsArgs.slice(1).filter((a) => !a.startsWith("--")).join(" ");
1218
1232
  if (!query) {
@@ -1259,7 +1273,7 @@ async function loginToHypha() {
1259
1273
  process.exit(1);
1260
1274
  }
1261
1275
  const anchor = anchorArg.replace(/\/+$/, "");
1262
- const { loadInstanceConfig } = await import('./run-BPZ_1RCI.mjs').then(function (n) { return n.af; });
1276
+ const { loadInstanceConfig } = await import('./run-CHIppB2r.mjs').then(function (n) { return n.ar; });
1263
1277
  let cfg = null;
1264
1278
  try {
1265
1279
  cfg = await loadInstanceConfig({ anchor, force: true });
@@ -1370,7 +1384,7 @@ async function logoutFromHypha() {
1370
1384
  } catch {
1371
1385
  }
1372
1386
  try {
1373
- const { clearInstanceConfigCache } = await import('./run-BPZ_1RCI.mjs').then(function (n) { return n.af; });
1387
+ const { clearInstanceConfigCache } = await import('./run-CHIppB2r.mjs').then(function (n) { return n.ar; });
1374
1388
  clearInstanceConfigCache();
1375
1389
  } catch {
1376
1390
  }
@@ -1672,7 +1686,8 @@ Usage:
1672
1686
  svamp daemon start --no-auto-continue Start without auto-continuing interrupted sessions
1673
1687
  svamp daemon stop Stop the daemon (sessions preserved for restart)
1674
1688
  svamp daemon stop --cleanup Stop and mark all sessions as stopped
1675
- svamp daemon restart Graceful restart \u2014 picks up new binary, sessions resume seamlessly
1689
+ svamp daemon restart Restart now \u2014 picks up new binary, sessions resume seamlessly
1690
+ svamp daemon restart --when-idle Restart only once no session is actively thinking (deferred; 1h max-wait)
1676
1691
  svamp daemon status Show daemon status
1677
1692
  svamp daemon install Install as login service (macOS/Linux) \u2014 auto-start at login
1678
1693
  svamp daemon uninstall Remove login service
@@ -1708,7 +1723,7 @@ async function applyClaudeAuthFlags(argv) {
1708
1723
  "--use-hypha-proxy, --use-claude-login, and --anthropic-base-url/--anthropic-api-key are mutually exclusive"
1709
1724
  );
1710
1725
  }
1711
- const mod = await import('./run-BPZ_1RCI.mjs').then(function (n) { return n.a8; });
1726
+ const mod = await import('./run-CHIppB2r.mjs').then(function (n) { return n.ak; });
1712
1727
  if (hasHypha) {
1713
1728
  let url;
1714
1729
  const hyphaIdx = argv.indexOf("--use-hypha-proxy");
@@ -1762,7 +1777,7 @@ async function applyDaemonShareFlag(argv) {
1762
1777
  }
1763
1778
  }
1764
1779
  if (collected.length === 0) return;
1765
- const { updateEnvFile } = await import('./run-BPZ_1RCI.mjs').then(function (n) { return n.a8; });
1780
+ const { updateEnvFile } = await import('./run-CHIppB2r.mjs').then(function (n) { return n.ak; });
1766
1781
  const seen = /* @__PURE__ */ new Set();
1767
1782
  const deduped = collected.filter((e) => {
1768
1783
  const k = e.toLowerCase();
@@ -1795,7 +1810,7 @@ async function handleWiseAgentCommand(rest) {
1795
1810
  }
1796
1811
  });
1797
1812
  const message = rest.slice(1).map((a, idx) => ({ a, idx: idx + 1 })).filter(({ a, idx }) => !a.startsWith("-") && !consumed.has(String(idx))).map(({ a }) => a).join(" ");
1798
- const { wiseAskCli } = await import('./commands-BhLGBhBS.mjs');
1813
+ const { wiseAskCli } = await import('./commands-C3TQOYUo.mjs');
1799
1814
  await wiseAskCli(machineId, message, sessionId, { json });
1800
1815
  return;
1801
1816
  }
@@ -1807,7 +1822,7 @@ async function handleWiseAgentCommand(rest) {
1807
1822
  }
1808
1823
  return void 0;
1809
1824
  };
1810
- const { runWiseVoiceCli } = await import('./headlessCli-d6XjdG6n.mjs');
1825
+ const { runWiseVoiceCli } = await import('./headlessCli-qBontdlf.mjs');
1811
1826
  await runWiseVoiceCli({ voice: valueOf(["--voice"]), wakeKeywordPath: valueOf(["--wake"]), model: valueOf(["--model"]) });
1812
1827
  return;
1813
1828
  }
@@ -1825,7 +1840,7 @@ async function handleWiseAgentCommand(rest) {
1825
1840
  const mode = valueOf(["--mode"]);
1826
1841
  const mission = valueOf(["--mission"]);
1827
1842
  const url = rest.slice(1).find((a) => /^https?:\/\//.test(a)) || "";
1828
- const { wiseJoinMeetingCli } = await import('./commands-BhLGBhBS.mjs');
1843
+ const { wiseJoinMeetingCli } = await import('./commands-C3TQOYUo.mjs');
1829
1844
  await wiseJoinMeetingCli(machineId, url, sessionId, { json, mode, mission });
1830
1845
  return;
1831
1846
  }
@@ -1837,7 +1852,7 @@ async function handleWiseAgentCommand(rest) {
1837
1852
  }
1838
1853
  return void 0;
1839
1854
  };
1840
- const { wiseLeaveMeetingCli } = await import('./commands-BhLGBhBS.mjs');
1855
+ const { wiseLeaveMeetingCli } = await import('./commands-C3TQOYUo.mjs');
1841
1856
  await wiseLeaveMeetingCli(valueOf(["--machine", "-m"]), valueOf(["--session", "-s"]), { json: rest.includes("--json") });
1842
1857
  return;
1843
1858
  }
@@ -1861,7 +1876,7 @@ async function handleWiseAgentCommand(rest) {
1861
1876
  }
1862
1877
  });
1863
1878
  const text = rest.slice(1).map((a, idx) => ({ a, idx: idx + 1 })).filter(({ a, idx }) => !a.startsWith("-") && !consumed.has(String(idx))).map(({ a }) => a).join(" ");
1864
- const { wiseAnnounceCli } = await import('./commands-BhLGBhBS.mjs');
1879
+ const { wiseAnnounceCli } = await import('./commands-C3TQOYUo.mjs');
1865
1880
  await wiseAnnounceCli(machineId, text, sessionId, { json });
1866
1881
  return;
1867
1882
  }
@@ -1873,7 +1888,7 @@ async function handleWiseAgentCommand(rest) {
1873
1888
  }
1874
1889
  return void 0;
1875
1890
  };
1876
- const { wiseMeetingsCli } = await import('./commands-BhLGBhBS.mjs');
1891
+ const { wiseMeetingsCli } = await import('./commands-C3TQOYUo.mjs');
1877
1892
  await wiseMeetingsCli(valueOf(["--machine", "-m"]), { json: rest.includes("--json") });
1878
1893
  return;
1879
1894
  }
@@ -1923,7 +1938,7 @@ If none is set, hitting a WISE Agent channel returns a clear "not configured" er
1923
1938
  return;
1924
1939
  }
1925
1940
  const authArgs = rest.slice(1);
1926
- const mod = await import('./auth-Bg0Z_bP-.mjs');
1941
+ const mod = await import('./auth-BLDmT7XN.mjs');
1927
1942
  let action;
1928
1943
  try {
1929
1944
  action = mod.parseWiseAgentAuthArgs(authArgs);
@@ -1933,7 +1948,7 @@ If none is set, hitting a WISE Agent channel returns a clear "not configured" er
1933
1948
  return;
1934
1949
  }
1935
1950
  if (action) {
1936
- const { updateEnvFile } = await import('./run-BPZ_1RCI.mjs').then(function (n) { return n.a8; });
1951
+ const { updateEnvFile } = await import('./run-CHIppB2r.mjs').then(function (n) { return n.ak; });
1937
1952
  const updates = mod.buildWiseAgentEnvUpdates(action);
1938
1953
  updateEnvFile(updates);
1939
1954
  for (const [k, v] of Object.entries(updates)) {
@@ -1947,7 +1962,7 @@ If none is set, hitting a WISE Agent channel returns a clear "not configured" er
1947
1962
  }
1948
1963
  async function handleDaemonAuthCommand(argv) {
1949
1964
  const sub = (argv[0] || "status").toLowerCase();
1950
- const mod = await import('./run-BPZ_1RCI.mjs').then(function (n) { return n.a8; });
1965
+ const mod = await import('./run-CHIppB2r.mjs').then(function (n) { return n.ak; });
1951
1966
  if (sub === "--help" || sub === "-h" || sub === "help") {
1952
1967
  console.log(`
1953
1968
  svamp daemon auth \u2014 Configure how Claude subprocesses authenticate
@@ -2261,7 +2276,7 @@ Examples:
2261
2276
  async function printSkillsHelp() {
2262
2277
  let browseUrl = "<HYPHA_SERVER_URL>/<workspace>/artifacts/marketplace (set HYPHA_SERVER_URL)";
2263
2278
  try {
2264
- const { getArtifactBaseUrl, getSkillsCollectionName } = await import('./run-BPZ_1RCI.mjs').then(function (n) { return n.ag; });
2279
+ const { getArtifactBaseUrl, getSkillsCollectionName } = await import('./run-CHIppB2r.mjs').then(function (n) { return n.as; });
2265
2280
  browseUrl = `${getArtifactBaseUrl()}/${getSkillsCollectionName()}`;
2266
2281
  } catch {
2267
2282
  }