svamp-cli 0.2.74 → 0.2.75

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--SLXTrkN.mjs');
151
+ const { connectAndGetMachine } = await import('./commands-CcvnCzKs.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--SLXTrkN.mjs');
168
+ const { resolveSessionId } = await import('./commands-CcvnCzKs.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-Br90om8R.mjs';
1
+ import { s as startDaemon, b as stopDaemon, d as daemonStatus } from './run-CkvOV7Es.mjs';
2
2
  import 'os';
3
3
  import 'fs/promises';
4
4
  import 'fs';
@@ -44,7 +44,7 @@ async function main() {
44
44
  console.error(`svamp daemon restart: ${err.message || err}`);
45
45
  process.exit(1);
46
46
  }
47
- const { restartDaemon } = await import('./run-Br90om8R.mjs').then(function (n) { return n.u; });
47
+ const { restartDaemon } = await import('./run-CkvOV7Es.mjs').then(function (n) { return n.u; });
48
48
  await restartDaemon();
49
49
  process.exit(0);
50
50
  }
@@ -287,7 +287,7 @@ async function main() {
287
287
  console.error("svamp service: Service commands are not available in sandboxed sessions.");
288
288
  process.exit(1);
289
289
  }
290
- const { handleServiceCommand } = await import('./commands-yzpViN29.mjs');
290
+ const { handleServiceCommand } = await import('./commands-cFKd_azq.mjs');
291
291
  await handleServiceCommand();
292
292
  } else if (subcommand === "serve") {
293
293
  const { isSandboxed: isSandboxedServe } = await import('./sandboxDetect-DNTcbgWD.mjs');
@@ -295,7 +295,7 @@ async function main() {
295
295
  console.error("svamp serve: Serve commands are not available in sandboxed sessions.");
296
296
  process.exit(1);
297
297
  }
298
- const { handleServeCommand } = await import('./serveCommands-Cu_2l3vg.mjs');
298
+ const { handleServeCommand } = await import('./serveCommands-tj6SKTIA.mjs');
299
299
  await handleServeCommand();
300
300
  process.exit(0);
301
301
  } else if (subcommand === "process" || subcommand === "proc") {
@@ -304,7 +304,7 @@ async function main() {
304
304
  console.error("svamp process: Process commands are not available in sandboxed sessions.");
305
305
  process.exit(1);
306
306
  }
307
- const { processCommand } = await import('./commands-BTZCHV-Z.mjs');
307
+ const { processCommand } = await import('./commands-DCzBADtv.mjs');
308
308
  let machineId;
309
309
  const processArgs = args.slice(1);
310
310
  const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
@@ -322,7 +322,7 @@ async function main() {
322
322
  } else if (!subcommand || subcommand === "start") {
323
323
  await handleInteractiveCommand();
324
324
  } else if (subcommand === "--version" || subcommand === "-v") {
325
- const pkg = await import('./package-C__x7TGc.mjs').catch(() => ({ default: { version: "unknown" } }));
325
+ const pkg = await import('./package-DJHPDxb-.mjs').catch(() => ({ default: { version: "unknown" } }));
326
326
  console.log(`svamp version: ${pkg.default.version}`);
327
327
  } else {
328
328
  console.error(`Unknown command: ${subcommand}`);
@@ -331,7 +331,7 @@ async function main() {
331
331
  }
332
332
  }
333
333
  async function handleInteractiveCommand() {
334
- const { runInteractive } = await import('./run-DO_Axr2M.mjs');
334
+ const { runInteractive } = await import('./run-CvE64mcK.mjs');
335
335
  const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
336
336
  let directory = process.cwd();
337
337
  let resumeSessionId;
@@ -376,7 +376,7 @@ async function handleAgentCommand() {
376
376
  return;
377
377
  }
378
378
  if (agentArgs[0] === "list") {
379
- const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-Br90om8R.mjs').then(function (n) { return n.p; });
379
+ const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-CkvOV7Es.mjs').then(function (n) { return n.p; });
380
380
  console.log("Known agents:");
381
381
  for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
382
382
  console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
@@ -388,7 +388,7 @@ async function handleAgentCommand() {
388
388
  console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
389
389
  return;
390
390
  }
391
- const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-Br90om8R.mjs').then(function (n) { return n.p; });
391
+ const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-CkvOV7Es.mjs').then(function (n) { return n.p; });
392
392
  let cwd = process.cwd();
393
393
  const filteredArgs = [];
394
394
  for (let i = 0; i < agentArgs.length; i++) {
@@ -412,12 +412,12 @@ async function handleAgentCommand() {
412
412
  console.log(`Starting ${config.agentName} agent in ${cwd}...`);
413
413
  let backend;
414
414
  if (KNOWN_MCP_AGENTS[config.agentName]) {
415
- const { CodexMcpBackend } = await import('./run-Br90om8R.mjs').then(function (n) { return n.q; });
415
+ const { CodexMcpBackend } = await import('./run-CkvOV7Es.mjs').then(function (n) { return n.q; });
416
416
  backend = new CodexMcpBackend({ cwd, log: logFn });
417
417
  } else {
418
- const { AcpBackend } = await import('./run-Br90om8R.mjs').then(function (n) { return n.o; });
419
- const { GeminiTransport } = await import('./run-Br90om8R.mjs').then(function (n) { return n.G; });
420
- const { DefaultTransport } = await import('./run-Br90om8R.mjs').then(function (n) { return n.D; });
418
+ const { AcpBackend } = await import('./run-CkvOV7Es.mjs').then(function (n) { return n.o; });
419
+ const { GeminiTransport } = await import('./run-CkvOV7Es.mjs').then(function (n) { return n.G; });
420
+ const { DefaultTransport } = await import('./run-CkvOV7Es.mjs').then(function (n) { return n.D; });
421
421
  const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
422
422
  backend = new AcpBackend({
423
423
  agentName: config.agentName,
@@ -544,7 +544,7 @@ async function handleSessionCommand() {
544
544
  process.exit(1);
545
545
  }
546
546
  }
547
- const { sessionList, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands--SLXTrkN.mjs');
547
+ const { sessionList, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-CcvnCzKs.mjs');
548
548
  const parseFlagStr = (flag, shortFlag) => {
549
549
  for (let i = 1; i < sessionArgs.length; i++) {
550
550
  if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
@@ -610,7 +610,7 @@ async function handleSessionCommand() {
610
610
  allowDomain.push(sessionArgs[++i]);
611
611
  }
612
612
  }
613
- const { parseShareArg } = await import('./commands--SLXTrkN.mjs');
613
+ const { parseShareArg } = await import('./commands-CcvnCzKs.mjs');
614
614
  const shareEntries = share.map((s) => parseShareArg(s));
615
615
  await sessionSpawn(agent, dir, targetMachineId, {
616
616
  message,
@@ -673,7 +673,8 @@ async function handleSessionCommand() {
673
673
  await sessionAttach(sessionArgs[1], targetMachineId);
674
674
  } else if (sessionSubcommand === "send") {
675
675
  if (!sessionArgs[1] || !sessionArgs[2]) {
676
- console.error('Usage: svamp session send <session-id> <message> [--subject "..."] [--urgency urgent|normal] [--wait] [--response] [--btw] [--require-approval] [--timeout N] [--json]');
676
+ console.error('Usage: svamp session send <session-id> <message> [--model <id>] [--subject "..."] [--urgency urgent|normal] [--wait] [--response] [--btw] [--require-approval] [--timeout N] [--json]');
677
+ console.error(" --model <id> Switch the session model (e.g. claude-opus-4-7, claude-sonnet-4-6) before delivering the message \u2014 forces a respawn.");
677
678
  process.exit(1);
678
679
  }
679
680
  await sessionSend(sessionArgs[1], sessionArgs[2], targetMachineId, {
@@ -684,7 +685,8 @@ async function handleSessionCommand() {
684
685
  timeout: parseFlagInt("--timeout"),
685
686
  json: hasFlag("--json"),
686
687
  subject: parseFlagStr("--subject"),
687
- urgency: parseFlagStr("--urgency")
688
+ urgency: parseFlagStr("--urgency"),
689
+ model: parseFlagStr("--model")
688
690
  });
689
691
  } else if (sessionSubcommand === "query") {
690
692
  const dir = sessionArgs[1];
@@ -694,7 +696,7 @@ async function handleSessionCommand() {
694
696
  console.error(" Spawns a stateless Claude session in <directory>, sends <prompt>, prints the answer, then deletes the session.");
695
697
  process.exit(1);
696
698
  }
697
- const { sessionQuery } = await import('./commands--SLXTrkN.mjs');
699
+ const { sessionQuery } = await import('./commands-CcvnCzKs.mjs');
698
700
  await sessionQuery(dir, prompt, targetMachineId, {
699
701
  timeout: parseFlagInt("--timeout"),
700
702
  json: hasFlag("--json"),
@@ -727,7 +729,7 @@ async function handleSessionCommand() {
727
729
  console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
728
730
  process.exit(1);
729
731
  }
730
- const { sessionApprove } = await import('./commands--SLXTrkN.mjs');
732
+ const { sessionApprove } = await import('./commands-CcvnCzKs.mjs');
731
733
  const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
732
734
  await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
733
735
  json: hasFlag("--json")
@@ -737,7 +739,7 @@ async function handleSessionCommand() {
737
739
  console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
738
740
  process.exit(1);
739
741
  }
740
- const { sessionDeny } = await import('./commands--SLXTrkN.mjs');
742
+ const { sessionDeny } = await import('./commands-CcvnCzKs.mjs');
741
743
  const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
742
744
  await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
743
745
  json: hasFlag("--json")
@@ -773,7 +775,7 @@ async function handleSessionCommand() {
773
775
  console.error("Usage: svamp session set-title <title>");
774
776
  process.exit(1);
775
777
  }
776
- const { sessionSetTitle } = await import('./agentCommands-BXQNGfyi.mjs');
778
+ const { sessionSetTitle } = await import('./agentCommands-CBTQqVTf.mjs');
777
779
  await sessionSetTitle(title);
778
780
  } else if (sessionSubcommand === "set-link") {
779
781
  const url = sessionArgs[1];
@@ -782,7 +784,7 @@ async function handleSessionCommand() {
782
784
  process.exit(1);
783
785
  }
784
786
  const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
785
- const { sessionSetLink } = await import('./agentCommands-BXQNGfyi.mjs');
787
+ const { sessionSetLink } = await import('./agentCommands-CBTQqVTf.mjs');
786
788
  await sessionSetLink(url, label);
787
789
  } else if (sessionSubcommand === "notify") {
788
790
  const message = sessionArgs[1];
@@ -791,7 +793,7 @@ async function handleSessionCommand() {
791
793
  process.exit(1);
792
794
  }
793
795
  const level = parseFlagStr("--level") || "info";
794
- const { sessionNotify } = await import('./agentCommands-BXQNGfyi.mjs');
796
+ const { sessionNotify } = await import('./agentCommands-CBTQqVTf.mjs');
795
797
  await sessionNotify(message, level);
796
798
  } else if (sessionSubcommand === "broadcast") {
797
799
  const action = sessionArgs[1];
@@ -799,7 +801,7 @@ async function handleSessionCommand() {
799
801
  console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
800
802
  process.exit(1);
801
803
  }
802
- const { sessionBroadcast } = await import('./agentCommands-BXQNGfyi.mjs');
804
+ const { sessionBroadcast } = await import('./agentCommands-CBTQqVTf.mjs');
803
805
  await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
804
806
  } else if (sessionSubcommand === "inbox") {
805
807
  const inboxSubcmd = sessionArgs[1];
@@ -810,7 +812,7 @@ async function handleSessionCommand() {
810
812
  process.exit(1);
811
813
  }
812
814
  if (agentSessionId) {
813
- const { inboxSend } = await import('./agentCommands-BXQNGfyi.mjs');
815
+ const { inboxSend } = await import('./agentCommands-CBTQqVTf.mjs');
814
816
  await inboxSend(sessionArgs[2], {
815
817
  body: sessionArgs[3],
816
818
  subject: parseFlagStr("--subject"),
@@ -825,7 +827,7 @@ async function handleSessionCommand() {
825
827
  }
826
828
  } else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
827
829
  if (agentSessionId && !sessionArgs[2]) {
828
- const { inboxList } = await import('./agentCommands-BXQNGfyi.mjs');
830
+ const { inboxList } = await import('./agentCommands-CBTQqVTf.mjs');
829
831
  await inboxList({
830
832
  unread: hasFlag("--unread"),
831
833
  limit: parseFlagInt("--limit"),
@@ -847,7 +849,7 @@ async function handleSessionCommand() {
847
849
  process.exit(1);
848
850
  }
849
851
  if (agentSessionId && !sessionArgs[3]) {
850
- const { inboxList } = await import('./agentCommands-BXQNGfyi.mjs');
852
+ const { inboxList } = await import('./agentCommands-CBTQqVTf.mjs');
851
853
  await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
852
854
  } else if (sessionArgs[3]) {
853
855
  await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
@@ -857,7 +859,7 @@ async function handleSessionCommand() {
857
859
  }
858
860
  } else if (inboxSubcmd === "reply") {
859
861
  if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
860
- const { inboxReply } = await import('./agentCommands-BXQNGfyi.mjs');
862
+ const { inboxReply } = await import('./agentCommands-CBTQqVTf.mjs');
861
863
  await inboxReply(sessionArgs[2], sessionArgs[3]);
862
864
  } else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
863
865
  await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
@@ -893,7 +895,7 @@ async function handleMachineCommand() {
893
895
  return;
894
896
  }
895
897
  if (machineSubcommand === "share") {
896
- const { machineShare } = await import('./commands--SLXTrkN.mjs');
898
+ const { machineShare } = await import('./commands-CcvnCzKs.mjs');
897
899
  let machineId;
898
900
  const shareArgs = [];
899
901
  for (let i = 1; i < machineArgs.length; i++) {
@@ -923,7 +925,7 @@ async function handleMachineCommand() {
923
925
  }
924
926
  await machineShare(machineId, { add, remove, list, configPath, showConfig });
925
927
  } else if (machineSubcommand === "exec") {
926
- const { machineExec } = await import('./commands--SLXTrkN.mjs');
928
+ const { machineExec } = await import('./commands-CcvnCzKs.mjs');
927
929
  let machineId;
928
930
  let cwd;
929
931
  const cmdParts = [];
@@ -943,7 +945,7 @@ async function handleMachineCommand() {
943
945
  }
944
946
  await machineExec(machineId, command, cwd);
945
947
  } else if (machineSubcommand === "info") {
946
- const { machineInfo } = await import('./commands--SLXTrkN.mjs');
948
+ const { machineInfo } = await import('./commands-CcvnCzKs.mjs');
947
949
  let machineId;
948
950
  for (let i = 1; i < machineArgs.length; i++) {
949
951
  if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
@@ -963,10 +965,10 @@ async function handleMachineCommand() {
963
965
  level = machineArgs[++i];
964
966
  }
965
967
  }
966
- const { machineNotify } = await import('./agentCommands-BXQNGfyi.mjs');
968
+ const { machineNotify } = await import('./agentCommands-CBTQqVTf.mjs');
967
969
  await machineNotify(message, level);
968
970
  } else if (machineSubcommand === "ls") {
969
- const { machineLs } = await import('./commands--SLXTrkN.mjs');
971
+ const { machineLs } = await import('./commands-CcvnCzKs.mjs');
970
972
  let machineId;
971
973
  let showHidden = false;
972
974
  let path;
@@ -1020,24 +1022,24 @@ Examples:
1020
1022
  };
1021
1023
  const hasFlag = (name) => fleetArgs.includes(`--${name}`);
1022
1024
  if (sub === "status") {
1023
- const { fleetStatus } = await import('./fleet-DMajjqRV.mjs');
1025
+ const { fleetStatus } = await import('./fleet-BedfiKQA.mjs');
1024
1026
  await fleetStatus();
1025
1027
  } else if (sub === "exec") {
1026
1028
  const command = fleetArgs.slice(1).filter((a) => !a.startsWith("--")).join(" ");
1027
- const { fleetExec } = await import('./fleet-DMajjqRV.mjs');
1029
+ const { fleetExec } = await import('./fleet-BedfiKQA.mjs');
1028
1030
  await fleetExec(command, { cwd: flag("cwd") });
1029
1031
  } else if (sub === "upgrade-claude") {
1030
- const { fleetUpgradeClaude } = await import('./fleet-DMajjqRV.mjs');
1032
+ const { fleetUpgradeClaude } = await import('./fleet-BedfiKQA.mjs');
1031
1033
  await fleetUpgradeClaude({ version: flag("version", "-v") });
1032
1034
  } else if (sub === "upgrade-svamp") {
1033
- const { fleetUpgradeSvamp } = await import('./fleet-DMajjqRV.mjs');
1035
+ const { fleetUpgradeSvamp } = await import('./fleet-BedfiKQA.mjs');
1034
1036
  await fleetUpgradeSvamp({ version: flag("version", "-v") });
1035
1037
  } else if (sub === "daemon-restart") {
1036
- const { fleetDaemonRestart } = await import('./fleet-DMajjqRV.mjs');
1038
+ const { fleetDaemonRestart } = await import('./fleet-BedfiKQA.mjs');
1037
1039
  await fleetDaemonRestart({ graceful: !hasFlag("cleanup") });
1038
1040
  } else if (sub === "push-skill") {
1039
1041
  const name = fleetArgs[1];
1040
- const { fleetPushSkill } = await import('./fleet-DMajjqRV.mjs');
1042
+ const { fleetPushSkill } = await import('./fleet-BedfiKQA.mjs');
1041
1043
  await fleetPushSkill(name);
1042
1044
  } else {
1043
1045
  console.error(`Unknown fleet subcommand: ${sub}`);
@@ -1496,7 +1498,7 @@ async function applyClaudeAuthFlags(argv) {
1496
1498
  "--use-hypha-proxy, --use-claude-login, and --anthropic-base-url/--anthropic-api-key are mutually exclusive"
1497
1499
  );
1498
1500
  }
1499
- const mod = await import('./run-Br90om8R.mjs').then(function (n) { return n.t; });
1501
+ const mod = await import('./run-CkvOV7Es.mjs').then(function (n) { return n.t; });
1500
1502
  if (hasHypha) {
1501
1503
  mod.setClaudeAuthHyphaProxy();
1502
1504
  console.log("Claude auth configured: hypha-proxy (uses HYPHA_TOKEN live at each spawn).");
@@ -1534,7 +1536,7 @@ async function applyDaemonShareFlag(argv) {
1534
1536
  }
1535
1537
  }
1536
1538
  if (collected.length === 0) return;
1537
- const { updateEnvFile } = await import('./run-Br90om8R.mjs').then(function (n) { return n.t; });
1539
+ const { updateEnvFile } = await import('./run-CkvOV7Es.mjs').then(function (n) { return n.t; });
1538
1540
  const seen = /* @__PURE__ */ new Set();
1539
1541
  const deduped = collected.filter((e) => {
1540
1542
  const k = e.toLowerCase();
@@ -1547,7 +1549,7 @@ async function applyDaemonShareFlag(argv) {
1547
1549
  }
1548
1550
  async function handleDaemonAuthCommand(argv) {
1549
1551
  const sub = (argv[0] || "status").toLowerCase();
1550
- const mod = await import('./run-Br90om8R.mjs').then(function (n) { return n.t; });
1552
+ const mod = await import('./run-CkvOV7Es.mjs').then(function (n) { return n.t; });
1551
1553
  if (sub === "--help" || sub === "-h" || sub === "help") {
1552
1554
  console.log(`
1553
1555
  svamp daemon auth \u2014 Configure how Claude subprocesses authenticate
@@ -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 { n as normalizeAllowedUser, l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha, i as buildSessionShareUrl, j as buildMachineShareUrl } from './run-Br90om8R.mjs';
5
+ import { n as normalizeAllowedUser, l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha, i as buildSessionShareUrl, j as buildMachineShareUrl } from './run-CkvOV7Es.mjs';
6
6
  import 'os';
7
7
  import 'fs/promises';
8
8
  import 'fs';
@@ -1123,9 +1123,14 @@ async function sessionMessages(sessionId, machineId, opts) {
1123
1123
  const { server, machine, fullId } = await connectAndResolveSession(sessionId, machineId);
1124
1124
  try {
1125
1125
  const svc = getSessionProxy(machine, fullId);
1126
- const afterSeq = opts?.after ?? 0;
1127
- const apiLimit = opts?.limit ?? 1e3;
1128
- const { messages } = await svc.getMessages(afterSeq, apiLimit);
1126
+ let messages;
1127
+ if (opts?.after !== void 0) {
1128
+ const apiLimit = opts?.limit ?? 500;
1129
+ ({ messages } = await svc.getMessages(opts.after, apiLimit));
1130
+ } else {
1131
+ const tailCount = Math.min(opts?.last ?? opts?.limit ?? 50, 500);
1132
+ ({ messages } = await svc.getLatestMessages(void 0, tailCount));
1133
+ }
1129
1134
  const toShow = opts?.last ? messages.slice(-opts.last) : messages;
1130
1135
  if (toShow.length === 0) {
1131
1136
  if (opts?.json) {
@@ -1428,6 +1433,7 @@ function validateSendOptions(opts) {
1428
1433
  if (opts.urgency) incompatible.push("--urgency");
1429
1434
  if (opts.wait) incompatible.push("--wait");
1430
1435
  if (opts.response) incompatible.push("--response");
1436
+ if (opts.model) incompatible.push("--model");
1431
1437
  return incompatible;
1432
1438
  }
1433
1439
  async function sendCore(machine, fullId, message, opts) {
@@ -1454,6 +1460,55 @@ async function sendCore(machine, fullId, message, opts) {
1454
1460
  }
1455
1461
  const wantResponse = !!opts?.response;
1456
1462
  const shouldWait = !!opts?.wait || wantResponse;
1463
+ if (opts?.model) {
1464
+ const { randomUUID: ruuid } = await import('node:crypto');
1465
+ if (shouldWait && !opts?.requireApproval) {
1466
+ try {
1467
+ await machine.sessionRPC(fullId, "switchMode", { mode: "bypassPermissions" });
1468
+ } catch {
1469
+ }
1470
+ }
1471
+ try {
1472
+ await machine.sessionRPC(fullId, "abort", {});
1473
+ } catch {
1474
+ }
1475
+ await new Promise((r) => setTimeout(r, 2e3));
1476
+ const meta = { model: opts.model, sentFrom: "svamp-cli" };
1477
+ const contentStr = JSON.stringify({ role: "user", content: { type: "text", text: message }, meta });
1478
+ const sendRes = await machine.sessionRPC(fullId, "sendMessage", {
1479
+ content: contentStr,
1480
+ localId: ruuid(),
1481
+ meta
1482
+ });
1483
+ let mWait;
1484
+ if (shouldWait) {
1485
+ mWait = await waitForBusyThenIdle(machine, fullId, (opts?.timeout || 300) * 1e3);
1486
+ }
1487
+ if (mWait?.pendingPermissions?.length) {
1488
+ return {
1489
+ sessionId: fullId,
1490
+ mode: "send",
1491
+ sent: true,
1492
+ messageId: sendRes?.id,
1493
+ waited: true,
1494
+ status: "permission-pending",
1495
+ pendingPermissions: mWait.pendingPermissions
1496
+ };
1497
+ }
1498
+ let mResponse;
1499
+ if (wantResponse) {
1500
+ mResponse = await collectAssistantResponse(machine, fullId, 0);
1501
+ }
1502
+ return {
1503
+ sessionId: fullId,
1504
+ mode: "send",
1505
+ sent: true,
1506
+ messageId: sendRes?.id,
1507
+ waited: shouldWait,
1508
+ status: shouldWait ? "idle" : "sent",
1509
+ ...wantResponse && mResponse ? { response: mResponse.text, responseSeqs: mResponse.messageSeqs } : {}
1510
+ };
1511
+ }
1457
1512
  let bypassEnsured = false;
1458
1513
  if (shouldWait && !opts?.requireApproval) {
1459
1514
  try {
@@ -1,11 +1,11 @@
1
1
  import { writeFileSync, readFileSync } from 'fs';
2
2
  import { resolve } from 'path';
3
- import { connectAndGetMachine } from './commands--SLXTrkN.mjs';
3
+ import { connectAndGetMachine } from './commands-CcvnCzKs.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-Br90om8R.mjs';
8
+ import './run-CkvOV7Es.mjs';
9
9
  import 'os';
10
10
  import 'fs/promises';
11
11
  import 'url';
@@ -68,7 +68,7 @@ async function serviceExpose(args) {
68
68
  });
69
69
  return;
70
70
  }
71
- const { connectAndGetMachine } = await import('./commands--SLXTrkN.mjs');
71
+ const { connectAndGetMachine } = await import('./commands-CcvnCzKs.mjs');
72
72
  const { server, machine } = await connectAndGetMachine();
73
73
  try {
74
74
  const status = await machine.tunnelStart({
@@ -132,7 +132,7 @@ async function serviceServe(args) {
132
132
  }
133
133
  async function serviceList(_args) {
134
134
  try {
135
- const { connectAndGetMachine } = await import('./commands--SLXTrkN.mjs');
135
+ const { connectAndGetMachine } = await import('./commands-CcvnCzKs.mjs');
136
136
  const { server, machine } = await connectAndGetMachine();
137
137
  try {
138
138
  const tunnels = await machine.tunnelList({});
@@ -161,7 +161,7 @@ async function serviceDelete(args) {
161
161
  process.exit(1);
162
162
  }
163
163
  try {
164
- const { connectAndGetMachine } = await import('./commands--SLXTrkN.mjs');
164
+ const { connectAndGetMachine } = await import('./commands-CcvnCzKs.mjs');
165
165
  const { server, machine } = await connectAndGetMachine();
166
166
  try {
167
167
  await machine.tunnelStop({ name });
@@ -1,7 +1,7 @@
1
1
  import { existsSync, readFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
3
  import os from 'node:os';
4
- import { c as connectToHypha } from './run-Br90om8R.mjs';
4
+ import { c as connectToHypha } from './run-CkvOV7Es.mjs';
5
5
  import { PINNED_CLAUDE_CODE_VERSION } from './pinnedClaudeCode-HydRNEt7.mjs';
6
6
  import 'os';
7
7
  import 'fs/promises';
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-Br90om8R.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-CkvOV7Es.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.74";
2
+ var version = "0.2.75";
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";
@@ -6758,6 +6758,43 @@ function checkTruncation(format, tail, fileSize, head) {
6758
6758
  const __filename$1 = fileURLToPath(import.meta.url);
6759
6759
  const __dirname$1 = dirname(__filename$1);
6760
6760
  const CLAUDE_SKILLS_DIR = join(os$1.homedir(), ".claude", "skills");
6761
+ function looksLikeClaudeError(line) {
6762
+ const l = line.toLowerCase();
6763
+ return l.includes("api error") || l.includes("request rejected") || l.includes("error:") || l.includes("overloaded") || l.includes("rate limit") || l.includes("unauthorized") || l.includes("forbidden") || /\b(4\d\d|5\d\d)\b/.test(l) && (l.includes("status") || l.includes("error") || l.includes("rejected"));
6764
+ }
6765
+ function dedupeLines(lines) {
6766
+ const seen = /* @__PURE__ */ new Set();
6767
+ const out = [];
6768
+ for (const raw of lines) {
6769
+ const line = raw.trim();
6770
+ if (!line || seen.has(line)) continue;
6771
+ seen.add(line);
6772
+ out.push(line);
6773
+ }
6774
+ return out;
6775
+ }
6776
+ function buildClaudeErrorHint(text, apiErrorStatus) {
6777
+ const lower = (text || "").toLowerCase();
6778
+ const isOverload = apiErrorStatus === 529 || lower.includes("529") || lower.includes("overload");
6779
+ const isResumeIssue = lower.includes("tool_use.name") || lower.includes("invalid_request") || lower.includes("messages.");
6780
+ const isBillingIssue = lower.includes("credit") || lower.includes("balance") || lower.includes("billing") || lower.includes("quota") || lower.includes("subscription") || lower.includes("payment") || lower.includes("1m-context") || lower.includes("1m context");
6781
+ const isLoginIssue = lower.includes("login") || lower.includes("logged in") || lower.includes("auth") || lower.includes("api key") || lower.includes("unauthorized");
6782
+ if (isOverload) {
6783
+ const onHyphaProxy = (process.env.SVAMP_CLAUDE_PROXY || "").toLowerCase() === "hypha";
6784
+ const proxyHint = onHyphaProxy ? "" : "\n\u2022 Switch the daemon to the Hypha proxy (rotates across accounts on 529): `svamp daemon auth use-hypha-proxy && svamp daemon restart`";
6785
+ return "\n\nAnthropic returned HTTP 529 Overloaded \u2014 server-side capacity, not your account. This session may be pinned to a hot backend shard.\n\u2022 Start a fresh session (different conversation id \u2192 different shard).\n\u2022 Wait a minute and resend.\n\u2022 Check https://status.claude.com." + proxyHint;
6786
+ }
6787
+ if (isBillingIssue) {
6788
+ return "\n\nThis looks like an account/plan limit (credits, quota, or context size not covered by your subscription). Switch the session to a standard 200K-context model (e.g. `claude-opus-4-7` / `claude-sonnet-4-6`), or check your Claude account credits/subscription at https://console.anthropic.com.";
6789
+ }
6790
+ if (isLoginIssue) {
6791
+ return "\n\nRun `claude login` in your terminal on the machine running the daemon to re-authenticate.";
6792
+ }
6793
+ if (isResumeIssue) {
6794
+ return "\n\nThe conversation history may be corrupted. Try starting a fresh session.";
6795
+ }
6796
+ return "\n\nCheck that the Claude Code CLI is properly installed and configured.";
6797
+ }
6761
6798
  function readSkillVersion(skillDir) {
6762
6799
  try {
6763
6800
  const md = readFileSync$1(join(skillDir, "SKILL.md"), "utf-8");
@@ -7885,7 +7922,7 @@ async function startDaemon(options) {
7885
7922
  const list = loadExposedTunnels().filter((t) => t.name !== name);
7886
7923
  saveExposedTunnels(list);
7887
7924
  }
7888
- const { ServeManager } = await import('./serveManager-ClzowUXI.mjs');
7925
+ const { ServeManager } = await import('./serveManager-BRRy7m0U.mjs');
7889
7926
  const serveManager = new ServeManager(SVAMP_HOME, (msg) => logger.log(`[SERVE] ${msg}`), hyphaServerUrl);
7890
7927
  ensureAutoInstalledSkills(logger).catch(() => {
7891
7928
  });
@@ -8106,6 +8143,7 @@ async function startDaemon(options) {
8106
8143
  let startupFailureRetryPending = false;
8107
8144
  let startupRetryMessage;
8108
8145
  let startupNonJsonLines = [];
8146
+ let errorOutputLines = [];
8109
8147
  const STUCK_PROCESS_TIMEOUT_MS = 30 * 60 * 1e3;
8110
8148
  const STUCK_CHECK_INTERVAL_MS = 2 * 60 * 1e3;
8111
8149
  let lastOutputTime = Date.now();
@@ -8224,6 +8262,7 @@ async function startDaemon(options) {
8224
8262
  const spawnClaude = (initialMessage, meta) => {
8225
8263
  const effectiveMeta = { ...lastSpawnMeta, ...meta };
8226
8264
  startupNonJsonLines = [];
8265
+ errorOutputLines = [];
8227
8266
  startupRetryMessage = initialMessage;
8228
8267
  let rawPermissionMode = effectiveMeta.permissionMode || agentConfig.default_permission_mode || currentPermissionMode;
8229
8268
  if (options2.forceIsolation || sessionMetadata.sharing?.enabled) {
@@ -8469,18 +8508,8 @@ async function startDaemon(options) {
8469
8508
  lastErrorMessagePushed = true;
8470
8509
  } else {
8471
8510
  const lower = resultText.toLowerCase();
8472
- const isOverload = msg.api_error_status === 529 || lower.includes("529") || lower.includes("overload");
8473
8511
  const isLoginIssue = lower.includes("login") || lower.includes("logged in") || lower.includes("auth") || lower.includes("api key") || lower.includes("unauthorized");
8474
- const isResumeIssue = lower.includes("tool_use.name") || lower.includes("invalid_request") || lower.includes("messages.");
8475
- const isBillingIssue = lower.includes("credit") || lower.includes("balance") || lower.includes("billing") || lower.includes("quota") || lower.includes("subscription") || lower.includes("payment");
8476
- let hint = "";
8477
- if (isOverload) {
8478
- const onHyphaProxy = (process.env.SVAMP_CLAUDE_PROXY || "").toLowerCase() === "hypha";
8479
- const proxyHint = onHyphaProxy ? "" : "\n\u2022 Switch the daemon to the Hypha proxy (rotates across accounts on 529): `svamp daemon auth use-hypha-proxy && svamp daemon restart`";
8480
- hint = "\n\nAnthropic returned HTTP 529 Overloaded \u2014 server-side capacity, not your account. This session may be pinned to a hot backend shard.\n\u2022 Start a fresh session (different conversation id \u2192 different shard).\n\u2022 Wait a minute and resend.\n\u2022 Check https://status.claude.com." + proxyHint;
8481
- } else if (isBillingIssue) {
8482
- hint = "\n\nCheck your Claude account credits or subscription at https://console.anthropic.com.";
8483
- } else if (isLoginIssue) {
8512
+ if (isLoginIssue) {
8484
8513
  checkAndRefreshOAuthToken(true, logger).then((r) => {
8485
8514
  if (r.refreshed) {
8486
8515
  logger.log(`[Session ${sessionId}] OAuth token refreshed after auth error \u2014 retrying on next message`);
@@ -8489,12 +8518,8 @@ async function startDaemon(options) {
8489
8518
  }).catch((err) => {
8490
8519
  logger.log(`[Session ${sessionId}] Reactive OAuth refresh failed: ${err.message}`);
8491
8520
  });
8492
- hint = "\n\nRun `claude login` in your terminal on the machine running the daemon to re-authenticate.";
8493
- } else if (isResumeIssue) {
8494
- hint = "\n\nThe conversation history may be corrupted. Try starting a fresh session.";
8495
- } else {
8496
- hint = "\n\nCheck that the Claude Code CLI is properly installed and configured.";
8497
8521
  }
8522
+ const hint = buildClaudeErrorHint(resultText, msg.api_error_status);
8498
8523
  const displayMsg = resultText || "Claude Code exited with an error.";
8499
8524
  let contextInfo = "";
8500
8525
  if (startupNonJsonLines.length > 0) {
@@ -8867,6 +8892,9 @@ The automated loop has finished. Review the progress above and let me know if yo
8867
8892
  if (!spawnHasReceivedInit) {
8868
8893
  startupNonJsonLines.push(line.slice(0, 500));
8869
8894
  }
8895
+ if (looksLikeClaudeError(line)) {
8896
+ errorOutputLines.push(line.slice(0, 500));
8897
+ }
8870
8898
  }
8871
8899
  }
8872
8900
  });
@@ -8888,6 +8916,11 @@ The automated loop has finished. Review the progress above and let me know if yo
8888
8916
  const text = chunk.toString();
8889
8917
  logger.log(`[Session ${sessionId}] Claude stderr: ${text.trim()}`);
8890
8918
  stderrBuffer += text;
8919
+ for (const line of text.split("\n")) {
8920
+ if (looksLikeClaudeError(line)) {
8921
+ errorOutputLines.push(line.trim().slice(0, 500));
8922
+ }
8923
+ }
8891
8924
  });
8892
8925
  child.on("exit", (code, signal) => {
8893
8926
  logger.log(`[Session ${sessionId}] Claude exited: code=${code}, signal=${signal}`);
@@ -8903,10 +8936,18 @@ The automated loop has finished. Review the progress above and let me know if yo
8903
8936
  }
8904
8937
  pendingPermissions.clear();
8905
8938
  if (code !== 0 && code !== null && !lastErrorMessagePushed) {
8939
+ const capturedError = dedupeLines(errorOutputLines).join("\n").trim();
8940
+ let exitMsg = `Agent process exited unexpectedly (code ${code}${signal ? `, signal: ${signal}` : ""})`;
8941
+ if (capturedError) {
8942
+ exitMsg += `
8943
+
8944
+ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
8945
+ }
8906
8946
  sessionService.pushMessage(
8907
- { type: "message", message: `Agent process exited unexpectedly (code ${code}${signal ? `, signal: ${signal}` : ""})` },
8947
+ { type: "message", message: exitMsg, level: "error" },
8908
8948
  "event"
8909
8949
  );
8950
+ lastErrorMessagePushed = true;
8910
8951
  }
8911
8952
  lastErrorMessagePushed = false;
8912
8953
  sessionMetadata = { ...sessionMetadata, lifecycleState: claudeResumeId ? "idle" : "stopped" };
@@ -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 { resolve, join } from 'node:path';
4
4
  import { existsSync, readFileSync, watch } from 'node:fs';
5
- import { c as connectToHypha, a as registerSessionService, k as generateHookSettings } from './run-Br90om8R.mjs';
5
+ import { c as connectToHypha, a as registerSessionService, k as generateHookSettings } from './run-CkvOV7Es.mjs';
6
6
  import { createServer } from 'node:http';
7
7
  import { spawn } from 'node:child_process';
8
8
  import { createInterface } from 'node:readline';
@@ -54,7 +54,7 @@ async function handleServeCommand() {
54
54
  }
55
55
  }
56
56
  async function serveAdd(args, machineId) {
57
- const { connectAndGetMachine } = await import('./commands--SLXTrkN.mjs');
57
+ const { connectAndGetMachine } = await import('./commands-CcvnCzKs.mjs');
58
58
  const pos = positionalArgs(args);
59
59
  const name = pos[0];
60
60
  if (!name) {
@@ -93,7 +93,7 @@ async function serveAdd(args, machineId) {
93
93
  }
94
94
  }
95
95
  async function serveApply(args, machineId) {
96
- const { connectAndGetMachine } = await import('./commands--SLXTrkN.mjs');
96
+ const { connectAndGetMachine } = await import('./commands-CcvnCzKs.mjs');
97
97
  const fs = await import('fs');
98
98
  const yaml = await import('yaml');
99
99
  const file = positionalArgs(args)[0];
@@ -182,7 +182,7 @@ async function serveApply(args, machineId) {
182
182
  }
183
183
  }
184
184
  async function serveRemove(args, machineId) {
185
- const { connectAndGetMachine } = await import('./commands--SLXTrkN.mjs');
185
+ const { connectAndGetMachine } = await import('./commands-CcvnCzKs.mjs');
186
186
  const pos = positionalArgs(args);
187
187
  const name = pos[0];
188
188
  if (!name) {
@@ -202,7 +202,7 @@ async function serveRemove(args, machineId) {
202
202
  }
203
203
  }
204
204
  async function serveList(args, machineId) {
205
- const { connectAndGetMachine } = await import('./commands--SLXTrkN.mjs');
205
+ const { connectAndGetMachine } = await import('./commands-CcvnCzKs.mjs');
206
206
  const all = hasFlag(args, "--all", "-a");
207
207
  const json = hasFlag(args, "--json");
208
208
  const sessionId = getFlag(args, "--session");
@@ -235,7 +235,7 @@ async function serveList(args, machineId) {
235
235
  }
236
236
  }
237
237
  async function serveInfo(machineId) {
238
- const { connectAndGetMachine } = await import('./commands--SLXTrkN.mjs');
238
+ const { connectAndGetMachine } = await import('./commands-CcvnCzKs.mjs');
239
239
  const { machine, server } = await connectAndGetMachine(machineId);
240
240
  try {
241
241
  const info = await machine.serveInfo();
@@ -4,7 +4,7 @@ import * as fs from 'fs';
4
4
  import * as http from 'http';
5
5
  import * as net from 'net';
6
6
  import * as path from 'path';
7
- import { S as ServeAuth, h as hasCookieToken } from './run-Br90om8R.mjs';
7
+ import { S as ServeAuth, h as hasCookieToken } from './run-CkvOV7Es.mjs';
8
8
  import 'os';
9
9
  import 'fs/promises';
10
10
  import 'url';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svamp-cli",
3
- "version": "0.2.74",
3
+ "version": "0.2.75",
4
4
  "description": "Svamp CLI — AI workspace daemon on Hypha Cloud",
5
5
  "author": "Amun AI AB",
6
6
  "license": "SEE LICENSE IN LICENSE",