svamp-cli 0.2.68 → 0.2.71
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.
- package/dist/{agentCommands-QnPGJFY-.mjs → agentCommands-COEbsMuw.mjs} +2 -2
- package/dist/cli.mjs +127 -68
- package/dist/{commands-D5kCHCfX.mjs → commands-B0zqVia0.mjs} +374 -46
- package/dist/{commands-Cxb6tsha.mjs → commands-Cc8AE2jl.mjs} +3 -3
- package/dist/{commands-tUjBdy54.mjs → commands-Kztc20Nx.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{package-DhOTD1Ln.mjs → package-CDSBvCp_.mjs} +2 -2
- package/dist/{run-BvcwFt_g.mjs → run-B_bKTQ8M.mjs} +3 -3
- package/dist/{run-HuBXfVSz.mjs → run-h-QVSVFd.mjs} +211 -49
- package/dist/{serveCommands-DDlHXpPe.mjs → serveCommands-CM17DByZ.mjs} +5 -5
- package/dist/{serveManager-DWQtF8NK.mjs → serveManager-Bzjw2bO6.mjs} +1 -1
- package/package.json +2 -2
|
@@ -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-
|
|
151
|
+
const { connectAndGetMachine } = await import('./commands-B0zqVia0.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-
|
|
168
|
+
const { resolveSessionId } = await import('./commands-B0zqVia0.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-
|
|
1
|
+
import { s as startDaemon, b as stopDaemon, d as daemonStatus } from './run-h-QVSVFd.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-
|
|
47
|
+
const { restartDaemon } = await import('./run-h-QVSVFd.mjs').then(function (n) { return n.u; });
|
|
48
48
|
await restartDaemon();
|
|
49
49
|
process.exit(0);
|
|
50
50
|
}
|
|
@@ -280,7 +280,7 @@ async function main() {
|
|
|
280
280
|
console.error("svamp service: Service commands are not available in sandboxed sessions.");
|
|
281
281
|
process.exit(1);
|
|
282
282
|
}
|
|
283
|
-
const { handleServiceCommand } = await import('./commands-
|
|
283
|
+
const { handleServiceCommand } = await import('./commands-Cc8AE2jl.mjs');
|
|
284
284
|
await handleServiceCommand();
|
|
285
285
|
} else if (subcommand === "serve") {
|
|
286
286
|
const { isSandboxed: isSandboxedServe } = await import('./sandboxDetect-DNTcbgWD.mjs');
|
|
@@ -288,7 +288,7 @@ async function main() {
|
|
|
288
288
|
console.error("svamp serve: Serve commands are not available in sandboxed sessions.");
|
|
289
289
|
process.exit(1);
|
|
290
290
|
}
|
|
291
|
-
const { handleServeCommand } = await import('./serveCommands-
|
|
291
|
+
const { handleServeCommand } = await import('./serveCommands-CM17DByZ.mjs');
|
|
292
292
|
await handleServeCommand();
|
|
293
293
|
process.exit(0);
|
|
294
294
|
} else if (subcommand === "process" || subcommand === "proc") {
|
|
@@ -297,7 +297,7 @@ async function main() {
|
|
|
297
297
|
console.error("svamp process: Process commands are not available in sandboxed sessions.");
|
|
298
298
|
process.exit(1);
|
|
299
299
|
}
|
|
300
|
-
const { processCommand } = await import('./commands-
|
|
300
|
+
const { processCommand } = await import('./commands-Kztc20Nx.mjs');
|
|
301
301
|
let machineId;
|
|
302
302
|
const processArgs = args.slice(1);
|
|
303
303
|
const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
|
|
@@ -315,7 +315,7 @@ async function main() {
|
|
|
315
315
|
} else if (!subcommand || subcommand === "start") {
|
|
316
316
|
await handleInteractiveCommand();
|
|
317
317
|
} else if (subcommand === "--version" || subcommand === "-v") {
|
|
318
|
-
const pkg = await import('./package-
|
|
318
|
+
const pkg = await import('./package-CDSBvCp_.mjs').catch(() => ({ default: { version: "unknown" } }));
|
|
319
319
|
console.log(`svamp version: ${pkg.default.version}`);
|
|
320
320
|
} else {
|
|
321
321
|
console.error(`Unknown command: ${subcommand}`);
|
|
@@ -324,7 +324,7 @@ async function main() {
|
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
async function handleInteractiveCommand() {
|
|
327
|
-
const { runInteractive } = await import('./run-
|
|
327
|
+
const { runInteractive } = await import('./run-B_bKTQ8M.mjs');
|
|
328
328
|
const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
|
|
329
329
|
let directory = process.cwd();
|
|
330
330
|
let resumeSessionId;
|
|
@@ -369,7 +369,7 @@ async function handleAgentCommand() {
|
|
|
369
369
|
return;
|
|
370
370
|
}
|
|
371
371
|
if (agentArgs[0] === "list") {
|
|
372
|
-
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-
|
|
372
|
+
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-h-QVSVFd.mjs').then(function (n) { return n.p; });
|
|
373
373
|
console.log("Known agents:");
|
|
374
374
|
for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
|
|
375
375
|
console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
|
|
@@ -381,7 +381,7 @@ async function handleAgentCommand() {
|
|
|
381
381
|
console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
|
|
382
382
|
return;
|
|
383
383
|
}
|
|
384
|
-
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-
|
|
384
|
+
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-h-QVSVFd.mjs').then(function (n) { return n.p; });
|
|
385
385
|
let cwd = process.cwd();
|
|
386
386
|
const filteredArgs = [];
|
|
387
387
|
for (let i = 0; i < agentArgs.length; i++) {
|
|
@@ -405,12 +405,12 @@ async function handleAgentCommand() {
|
|
|
405
405
|
console.log(`Starting ${config.agentName} agent in ${cwd}...`);
|
|
406
406
|
let backend;
|
|
407
407
|
if (KNOWN_MCP_AGENTS[config.agentName]) {
|
|
408
|
-
const { CodexMcpBackend } = await import('./run-
|
|
408
|
+
const { CodexMcpBackend } = await import('./run-h-QVSVFd.mjs').then(function (n) { return n.q; });
|
|
409
409
|
backend = new CodexMcpBackend({ cwd, log: logFn });
|
|
410
410
|
} else {
|
|
411
|
-
const { AcpBackend } = await import('./run-
|
|
412
|
-
const { GeminiTransport } = await import('./run-
|
|
413
|
-
const { DefaultTransport } = await import('./run-
|
|
411
|
+
const { AcpBackend } = await import('./run-h-QVSVFd.mjs').then(function (n) { return n.o; });
|
|
412
|
+
const { GeminiTransport } = await import('./run-h-QVSVFd.mjs').then(function (n) { return n.G; });
|
|
413
|
+
const { DefaultTransport } = await import('./run-h-QVSVFd.mjs').then(function (n) { return n.D; });
|
|
414
414
|
const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
|
|
415
415
|
backend = new AcpBackend({
|
|
416
416
|
agentName: config.agentName,
|
|
@@ -537,7 +537,7 @@ async function handleSessionCommand() {
|
|
|
537
537
|
process.exit(1);
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
|
-
const { sessionList, sessionSpawn,
|
|
540
|
+
const { sessionList, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-B0zqVia0.mjs');
|
|
541
541
|
const parseFlagStr = (flag, shortFlag) => {
|
|
542
542
|
for (let i = 1; i < sessionArgs.length; i++) {
|
|
543
543
|
if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
|
|
@@ -573,7 +573,13 @@ async function handleSessionCommand() {
|
|
|
573
573
|
const wait = hasFlag("--wait");
|
|
574
574
|
const worktree = hasFlag("--worktree");
|
|
575
575
|
const isolate = hasFlag("--isolate");
|
|
576
|
-
|
|
576
|
+
let permissionMode = parseFlagStr("--permission-mode") || parseFlagStr("-p");
|
|
577
|
+
if (!permissionMode && hasFlag("--require-approval")) {
|
|
578
|
+
permissionMode = "default";
|
|
579
|
+
}
|
|
580
|
+
if (!permissionMode) {
|
|
581
|
+
permissionMode = "bypassPermissions";
|
|
582
|
+
}
|
|
577
583
|
const securityContextPath = parseFlagStr("--security-context");
|
|
578
584
|
const denyNetwork = hasFlag("--deny-network");
|
|
579
585
|
const parentSessionId = parseFlagStr("--parent");
|
|
@@ -597,7 +603,7 @@ async function handleSessionCommand() {
|
|
|
597
603
|
allowDomain.push(sessionArgs[++i]);
|
|
598
604
|
}
|
|
599
605
|
}
|
|
600
|
-
const { parseShareArg } = await import('./commands-
|
|
606
|
+
const { parseShareArg } = await import('./commands-B0zqVia0.mjs');
|
|
601
607
|
const shareEntries = share.map((s) => parseShareArg(s));
|
|
602
608
|
await sessionSpawn(agent, dir, targetMachineId, {
|
|
603
609
|
message,
|
|
@@ -614,12 +620,24 @@ async function handleSessionCommand() {
|
|
|
614
620
|
tags: tags.length > 0 ? tags : void 0,
|
|
615
621
|
parentSessionId
|
|
616
622
|
});
|
|
617
|
-
} else if (sessionSubcommand === "
|
|
623
|
+
} else if (sessionSubcommand === "archive") {
|
|
624
|
+
if (!sessionArgs[1]) {
|
|
625
|
+
console.error("Usage: svamp session archive <session-id>");
|
|
626
|
+
process.exit(1);
|
|
627
|
+
}
|
|
628
|
+
await sessionArchive(sessionArgs[1], targetMachineId);
|
|
629
|
+
} else if (sessionSubcommand === "resume") {
|
|
630
|
+
if (!sessionArgs[1]) {
|
|
631
|
+
console.error("Usage: svamp session resume <session-id>");
|
|
632
|
+
process.exit(1);
|
|
633
|
+
}
|
|
634
|
+
await sessionResume(sessionArgs[1], targetMachineId);
|
|
635
|
+
} else if (sessionSubcommand === "delete" || sessionSubcommand === "rm") {
|
|
618
636
|
if (!sessionArgs[1]) {
|
|
619
|
-
console.error("Usage: svamp session
|
|
637
|
+
console.error("Usage: svamp session delete <session-id>");
|
|
620
638
|
process.exit(1);
|
|
621
639
|
}
|
|
622
|
-
await
|
|
640
|
+
await sessionDelete(sessionArgs[1], targetMachineId);
|
|
623
641
|
} else if (sessionSubcommand === "info") {
|
|
624
642
|
if (!sessionArgs[1]) {
|
|
625
643
|
console.error("Usage: svamp session info <session-id>");
|
|
@@ -648,16 +666,35 @@ async function handleSessionCommand() {
|
|
|
648
666
|
await sessionAttach(sessionArgs[1], targetMachineId);
|
|
649
667
|
} else if (sessionSubcommand === "send") {
|
|
650
668
|
if (!sessionArgs[1] || !sessionArgs[2]) {
|
|
651
|
-
console.error('Usage: svamp session send <session-id> <message> [--subject "..."] [--urgency urgent|normal] [--wait] [--timeout N] [--json]');
|
|
669
|
+
console.error('Usage: svamp session send <session-id> <message> [--subject "..."] [--urgency urgent|normal] [--wait] [--response] [--btw] [--require-approval] [--timeout N] [--json]');
|
|
652
670
|
process.exit(1);
|
|
653
671
|
}
|
|
654
672
|
await sessionSend(sessionArgs[1], sessionArgs[2], targetMachineId, {
|
|
655
673
|
wait: hasFlag("--wait"),
|
|
674
|
+
response: hasFlag("--response"),
|
|
675
|
+
btw: hasFlag("--btw"),
|
|
676
|
+
requireApproval: hasFlag("--require-approval"),
|
|
656
677
|
timeout: parseFlagInt("--timeout"),
|
|
657
678
|
json: hasFlag("--json"),
|
|
658
679
|
subject: parseFlagStr("--subject"),
|
|
659
680
|
urgency: parseFlagStr("--urgency")
|
|
660
681
|
});
|
|
682
|
+
} else if (sessionSubcommand === "query") {
|
|
683
|
+
const dir = sessionArgs[1];
|
|
684
|
+
const prompt = sessionArgs[2];
|
|
685
|
+
if (!dir || !prompt) {
|
|
686
|
+
console.error("Usage: svamp session query <directory> <prompt> [--timeout N] [--keep] [--json] [--permission-mode MODE] [--tag NAME]");
|
|
687
|
+
console.error(" Spawns a stateless Claude session in <directory>, sends <prompt>, prints the answer, then deletes the session.");
|
|
688
|
+
process.exit(1);
|
|
689
|
+
}
|
|
690
|
+
const { sessionQuery } = await import('./commands-B0zqVia0.mjs');
|
|
691
|
+
await sessionQuery(dir, prompt, targetMachineId, {
|
|
692
|
+
timeout: parseFlagInt("--timeout"),
|
|
693
|
+
json: hasFlag("--json"),
|
|
694
|
+
keep: hasFlag("--keep"),
|
|
695
|
+
permissionMode: parseFlagStr("--permission-mode"),
|
|
696
|
+
tag: parseFlagStr("--tag")
|
|
697
|
+
});
|
|
661
698
|
} else if (sessionSubcommand === "wait") {
|
|
662
699
|
if (!sessionArgs[1]) {
|
|
663
700
|
console.error("Usage: svamp session wait <session-id> [--timeout N] [--json]");
|
|
@@ -683,7 +720,7 @@ async function handleSessionCommand() {
|
|
|
683
720
|
console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
|
|
684
721
|
process.exit(1);
|
|
685
722
|
}
|
|
686
|
-
const { sessionApprove } = await import('./commands-
|
|
723
|
+
const { sessionApprove } = await import('./commands-B0zqVia0.mjs');
|
|
687
724
|
const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
688
725
|
await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
|
|
689
726
|
json: hasFlag("--json")
|
|
@@ -693,7 +730,7 @@ async function handleSessionCommand() {
|
|
|
693
730
|
console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
|
|
694
731
|
process.exit(1);
|
|
695
732
|
}
|
|
696
|
-
const { sessionDeny } = await import('./commands-
|
|
733
|
+
const { sessionDeny } = await import('./commands-B0zqVia0.mjs');
|
|
697
734
|
const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
698
735
|
await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
|
|
699
736
|
json: hasFlag("--json")
|
|
@@ -729,7 +766,7 @@ async function handleSessionCommand() {
|
|
|
729
766
|
console.error("Usage: svamp session set-title <title>");
|
|
730
767
|
process.exit(1);
|
|
731
768
|
}
|
|
732
|
-
const { sessionSetTitle } = await import('./agentCommands-
|
|
769
|
+
const { sessionSetTitle } = await import('./agentCommands-COEbsMuw.mjs');
|
|
733
770
|
await sessionSetTitle(title);
|
|
734
771
|
} else if (sessionSubcommand === "set-link") {
|
|
735
772
|
const url = sessionArgs[1];
|
|
@@ -738,7 +775,7 @@ async function handleSessionCommand() {
|
|
|
738
775
|
process.exit(1);
|
|
739
776
|
}
|
|
740
777
|
const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
741
|
-
const { sessionSetLink } = await import('./agentCommands-
|
|
778
|
+
const { sessionSetLink } = await import('./agentCommands-COEbsMuw.mjs');
|
|
742
779
|
await sessionSetLink(url, label);
|
|
743
780
|
} else if (sessionSubcommand === "notify") {
|
|
744
781
|
const message = sessionArgs[1];
|
|
@@ -747,7 +784,7 @@ async function handleSessionCommand() {
|
|
|
747
784
|
process.exit(1);
|
|
748
785
|
}
|
|
749
786
|
const level = parseFlagStr("--level") || "info";
|
|
750
|
-
const { sessionNotify } = await import('./agentCommands-
|
|
787
|
+
const { sessionNotify } = await import('./agentCommands-COEbsMuw.mjs');
|
|
751
788
|
await sessionNotify(message, level);
|
|
752
789
|
} else if (sessionSubcommand === "broadcast") {
|
|
753
790
|
const action = sessionArgs[1];
|
|
@@ -755,7 +792,7 @@ async function handleSessionCommand() {
|
|
|
755
792
|
console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
|
|
756
793
|
process.exit(1);
|
|
757
794
|
}
|
|
758
|
-
const { sessionBroadcast } = await import('./agentCommands-
|
|
795
|
+
const { sessionBroadcast } = await import('./agentCommands-COEbsMuw.mjs');
|
|
759
796
|
await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
|
|
760
797
|
} else if (sessionSubcommand === "inbox") {
|
|
761
798
|
const inboxSubcmd = sessionArgs[1];
|
|
@@ -766,7 +803,7 @@ async function handleSessionCommand() {
|
|
|
766
803
|
process.exit(1);
|
|
767
804
|
}
|
|
768
805
|
if (agentSessionId) {
|
|
769
|
-
const { inboxSend } = await import('./agentCommands-
|
|
806
|
+
const { inboxSend } = await import('./agentCommands-COEbsMuw.mjs');
|
|
770
807
|
await inboxSend(sessionArgs[2], {
|
|
771
808
|
body: sessionArgs[3],
|
|
772
809
|
subject: parseFlagStr("--subject"),
|
|
@@ -781,7 +818,7 @@ async function handleSessionCommand() {
|
|
|
781
818
|
}
|
|
782
819
|
} else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
|
|
783
820
|
if (agentSessionId && !sessionArgs[2]) {
|
|
784
|
-
const { inboxList } = await import('./agentCommands-
|
|
821
|
+
const { inboxList } = await import('./agentCommands-COEbsMuw.mjs');
|
|
785
822
|
await inboxList({
|
|
786
823
|
unread: hasFlag("--unread"),
|
|
787
824
|
limit: parseFlagInt("--limit"),
|
|
@@ -803,7 +840,7 @@ async function handleSessionCommand() {
|
|
|
803
840
|
process.exit(1);
|
|
804
841
|
}
|
|
805
842
|
if (agentSessionId && !sessionArgs[3]) {
|
|
806
|
-
const { inboxList } = await import('./agentCommands-
|
|
843
|
+
const { inboxList } = await import('./agentCommands-COEbsMuw.mjs');
|
|
807
844
|
await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
|
|
808
845
|
} else if (sessionArgs[3]) {
|
|
809
846
|
await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
|
|
@@ -813,7 +850,7 @@ async function handleSessionCommand() {
|
|
|
813
850
|
}
|
|
814
851
|
} else if (inboxSubcmd === "reply") {
|
|
815
852
|
if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
|
|
816
|
-
const { inboxReply } = await import('./agentCommands-
|
|
853
|
+
const { inboxReply } = await import('./agentCommands-COEbsMuw.mjs');
|
|
817
854
|
await inboxReply(sessionArgs[2], sessionArgs[3]);
|
|
818
855
|
} else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
|
|
819
856
|
await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
|
|
@@ -849,7 +886,7 @@ async function handleMachineCommand() {
|
|
|
849
886
|
return;
|
|
850
887
|
}
|
|
851
888
|
if (machineSubcommand === "share") {
|
|
852
|
-
const { machineShare } = await import('./commands-
|
|
889
|
+
const { machineShare } = await import('./commands-B0zqVia0.mjs');
|
|
853
890
|
let machineId;
|
|
854
891
|
const shareArgs = [];
|
|
855
892
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
@@ -879,7 +916,7 @@ async function handleMachineCommand() {
|
|
|
879
916
|
}
|
|
880
917
|
await machineShare(machineId, { add, remove, list, configPath, showConfig });
|
|
881
918
|
} else if (machineSubcommand === "exec") {
|
|
882
|
-
const { machineExec } = await import('./commands-
|
|
919
|
+
const { machineExec } = await import('./commands-B0zqVia0.mjs');
|
|
883
920
|
let machineId;
|
|
884
921
|
let cwd;
|
|
885
922
|
const cmdParts = [];
|
|
@@ -899,7 +936,7 @@ async function handleMachineCommand() {
|
|
|
899
936
|
}
|
|
900
937
|
await machineExec(machineId, command, cwd);
|
|
901
938
|
} else if (machineSubcommand === "info") {
|
|
902
|
-
const { machineInfo } = await import('./commands-
|
|
939
|
+
const { machineInfo } = await import('./commands-B0zqVia0.mjs');
|
|
903
940
|
let machineId;
|
|
904
941
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
905
942
|
if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
|
|
@@ -919,10 +956,10 @@ async function handleMachineCommand() {
|
|
|
919
956
|
level = machineArgs[++i];
|
|
920
957
|
}
|
|
921
958
|
}
|
|
922
|
-
const { machineNotify } = await import('./agentCommands-
|
|
959
|
+
const { machineNotify } = await import('./agentCommands-COEbsMuw.mjs');
|
|
923
960
|
await machineNotify(message, level);
|
|
924
961
|
} else if (machineSubcommand === "ls") {
|
|
925
|
-
const { machineLs } = await import('./commands-
|
|
962
|
+
const { machineLs } = await import('./commands-B0zqVia0.mjs');
|
|
926
963
|
let machineId;
|
|
927
964
|
let showHidden = false;
|
|
928
965
|
let path;
|
|
@@ -1295,12 +1332,12 @@ function printHelp() {
|
|
|
1295
1332
|
console.log(`
|
|
1296
1333
|
svamp \u2014 AI workspace on Hypha Cloud
|
|
1297
1334
|
|
|
1298
|
-
Quick start \u2014 spawn an agent to do a task (
|
|
1299
|
-
svamp session spawn claude -d ./project
|
|
1335
|
+
Quick start \u2014 spawn an agent to do a task (autonomous by default):
|
|
1336
|
+
svamp session spawn claude -d ./project --message "fix tests" --wait
|
|
1300
1337
|
|
|
1301
|
-
Note:
|
|
1302
|
-
|
|
1303
|
-
|
|
1338
|
+
Note: as of 0.2.69 spawn defaults to permission mode "bypassPermissions" so the
|
|
1339
|
+
child agent doesn't get stuck on tool-approval prompts. Pass --require-approval
|
|
1340
|
+
(or -p default / -p acceptEdits) when you want a human to gate tool use.
|
|
1304
1341
|
|
|
1305
1342
|
Commands:
|
|
1306
1343
|
svamp Start interactive Claude session (synced to cloud)
|
|
@@ -1312,12 +1349,15 @@ Commands:
|
|
|
1312
1349
|
|
|
1313
1350
|
Session management (requires daemon running):
|
|
1314
1351
|
svamp session spawn <agent> [opts] Spawn a new agent session (agents: claude, gemini, codex)
|
|
1315
|
-
svamp session send <id> <message> Send message to a session (--wait
|
|
1352
|
+
svamp session send <id> <message> Send message to a session (--wait, --response, --btw)
|
|
1353
|
+
svamp session query <dir> <prompt> Stateless one-shot: spawn \u2192 ask \u2192 answer \u2192 delete
|
|
1316
1354
|
svamp session wait <id> Wait for agent to become idle
|
|
1317
1355
|
svamp session messages <id> Show message history (--last N, --json, --raw)
|
|
1318
1356
|
svamp session info <id> Show session status & pending permissions
|
|
1319
1357
|
svamp session list List sessions
|
|
1320
|
-
svamp session
|
|
1358
|
+
svamp session archive <id> Archive a session (preserves history, resumable later)
|
|
1359
|
+
svamp session resume <id> Resume an archived session
|
|
1360
|
+
svamp session delete <id> Permanently delete a session (cannot be undone)
|
|
1321
1361
|
svamp session attach <id> Attach interactive terminal (stdin/stdout)
|
|
1322
1362
|
svamp session approve/deny <id> Approve or deny pending permission requests
|
|
1323
1363
|
svamp session --help Show ALL session commands and detailed options
|
|
@@ -1389,7 +1429,7 @@ async function applyClaudeAuthFlags(argv) {
|
|
|
1389
1429
|
"--use-hypha-proxy, --use-claude-login, and --anthropic-base-url/--anthropic-api-key are mutually exclusive"
|
|
1390
1430
|
);
|
|
1391
1431
|
}
|
|
1392
|
-
const mod = await import('./run-
|
|
1432
|
+
const mod = await import('./run-h-QVSVFd.mjs').then(function (n) { return n.t; });
|
|
1393
1433
|
if (hasHypha) {
|
|
1394
1434
|
mod.setClaudeAuthHyphaProxy();
|
|
1395
1435
|
console.log("Claude auth configured: hypha-proxy (uses HYPHA_TOKEN live at each spawn).");
|
|
@@ -1427,7 +1467,7 @@ async function applyDaemonShareFlag(argv) {
|
|
|
1427
1467
|
}
|
|
1428
1468
|
}
|
|
1429
1469
|
if (collected.length === 0) return;
|
|
1430
|
-
const { updateEnvFile } = await import('./run-
|
|
1470
|
+
const { updateEnvFile } = await import('./run-h-QVSVFd.mjs').then(function (n) { return n.t; });
|
|
1431
1471
|
const seen = /* @__PURE__ */ new Set();
|
|
1432
1472
|
const deduped = collected.filter((e) => {
|
|
1433
1473
|
const k = e.toLowerCase();
|
|
@@ -1440,7 +1480,7 @@ async function applyDaemonShareFlag(argv) {
|
|
|
1440
1480
|
}
|
|
1441
1481
|
async function handleDaemonAuthCommand(argv) {
|
|
1442
1482
|
const sub = (argv[0] || "status").toLowerCase();
|
|
1443
|
-
const mod = await import('./run-
|
|
1483
|
+
const mod = await import('./run-h-QVSVFd.mjs').then(function (n) { return n.t; });
|
|
1444
1484
|
if (sub === "--help" || sub === "-h" || sub === "help") {
|
|
1445
1485
|
console.log(`
|
|
1446
1486
|
svamp daemon auth \u2014 Configure how Claude subprocesses authenticate
|
|
@@ -1506,14 +1546,14 @@ svamp session \u2014 Spawn and manage AI agent sessions
|
|
|
1506
1546
|
|
|
1507
1547
|
QUICK START \u2014 Spawn a session, give it a task, get results:
|
|
1508
1548
|
|
|
1509
|
-
# One-liner: spawn agent, send task, wait for completion
|
|
1510
|
-
svamp session spawn claude -d ./my-project
|
|
1511
|
-
--message "fix the failing tests" --wait
|
|
1549
|
+
# One-liner: spawn agent, send task, wait for completion (autonomous by default)
|
|
1550
|
+
svamp session spawn claude -d ./my-project --message "fix the failing tests" --wait
|
|
1512
1551
|
|
|
1513
1552
|
# The command prints the session ID (e.g., "abc12345-..."). Use it to:
|
|
1514
1553
|
svamp session messages abc1 --last 10 # read output (prefix match on ID)
|
|
1515
1554
|
svamp session send abc1 "now run lint" --wait # send follow-up, wait for done
|
|
1516
|
-
svamp session
|
|
1555
|
+
svamp session archive abc1 # archive when finished (resumable)
|
|
1556
|
+
svamp session resume abc1 # bring an archived session back
|
|
1517
1557
|
|
|
1518
1558
|
# Spawn on a remote/cloud machine:
|
|
1519
1559
|
svamp session spawn claude -d /workspace -m cloud-box --message "deploy" --wait
|
|
@@ -1530,14 +1570,32 @@ COMMANDS:
|
|
|
1530
1570
|
|
|
1531
1571
|
Lifecycle:
|
|
1532
1572
|
spawn <agent> [-d <path>] [options] Spawn a new agent session
|
|
1533
|
-
|
|
1573
|
+
archive <id> Archive a session (resumable; preserves --resume token)
|
|
1574
|
+
resume <id> Resume an archived session (spawns agent with --resume)
|
|
1575
|
+
delete <id> Permanently delete a session (cannot be undone)
|
|
1534
1576
|
list [--active] [--json] List sessions (alias: ls)
|
|
1535
1577
|
machines List discoverable machines
|
|
1536
1578
|
info <id> [--json] Show status & pending permissions
|
|
1537
1579
|
|
|
1538
1580
|
Communicate:
|
|
1539
|
-
send <id> <message> [--wait] [--timeout N] [--json]
|
|
1540
|
-
Send a message to a running session
|
|
1581
|
+
send <id> <message> [--wait] [--response] [--btw] [--require-approval] [--timeout N] [--json]
|
|
1582
|
+
Send a message to a running session.
|
|
1583
|
+
--wait block until the agent goes idle
|
|
1584
|
+
--response block AND print the agent's
|
|
1585
|
+
text answer (implies --wait)
|
|
1586
|
+
--btw side-channel one-shot query via
|
|
1587
|
+
/btw \u2014 does NOT touch the
|
|
1588
|
+
running session's context window
|
|
1589
|
+
--require-approval do NOT pre-flight the target to
|
|
1590
|
+
bypassPermissions. Without this,
|
|
1591
|
+
send with --wait/--response auto-
|
|
1592
|
+
ensures bypass so the agent does
|
|
1593
|
+
not stall on tool prompts.
|
|
1594
|
+
query <directory> <prompt> [--timeout N] [--keep] [--json] [--permission-mode MODE] [--tag NAME]
|
|
1595
|
+
Stateless one-shot: spawn fresh Claude in
|
|
1596
|
+
<directory>, send <prompt>, print answer,
|
|
1597
|
+
delete the session. No existing session is
|
|
1598
|
+
affected. Use for reproducible Q&A.
|
|
1541
1599
|
messages <id> [--last N] [--json] Read message history (alias: msgs)
|
|
1542
1600
|
wait <id> [--timeout N] [--json] Wait for agent to become idle
|
|
1543
1601
|
attach <id> Attach interactive terminal (stdin/stdout)
|
|
@@ -1566,7 +1624,9 @@ COMMANDS:
|
|
|
1566
1624
|
|
|
1567
1625
|
SPAWN OPTIONS:
|
|
1568
1626
|
-d, --directory <path> Working directory (REQUIRED for meaningful work)
|
|
1569
|
-
-p, --permission-mode <mode> Permission mode (see below). Default: "
|
|
1627
|
+
-p, --permission-mode <mode> Permission mode (see below). Default: "bypassPermissions"
|
|
1628
|
+
--require-approval Opt into human-in-the-loop approval (alias for -p default).
|
|
1629
|
+
Without this flag, the agent runs autonomously.
|
|
1570
1630
|
--message <msg> Send this message to the agent immediately after spawn
|
|
1571
1631
|
--wait Block until agent finishes (idle). Combine with --message
|
|
1572
1632
|
for fire-and-forget: spawn \u2192 task \u2192 wait \u2192 done.
|
|
@@ -1576,15 +1636,14 @@ SPAWN OPTIONS:
|
|
|
1576
1636
|
--parent <sessionId> Set parent session (auto-set from SVAMP_SESSION_ID env)
|
|
1577
1637
|
|
|
1578
1638
|
PERMISSION MODES:
|
|
1639
|
+
bypassPermissions \u2605 Default. Auto-approve everything. No prompts, no pauses.
|
|
1640
|
+
Right choice for automation, CI, agent-spawning-agent.
|
|
1641
|
+
acceptEdits Auto-approve file edits. Still pauses for bash & dangerous tools.
|
|
1579
1642
|
default \u26A0 Agent PAUSES and waits for human approval before each tool use.
|
|
1580
1643
|
The agent will be stuck (exit code 2) until you run approve/deny.
|
|
1581
|
-
|
|
1582
|
-
acceptEdits Auto-approve file edits. Still pauses for bash & dangerous tools.
|
|
1583
|
-
bypassPermissions Auto-approve everything. No prompts, no pauses. Fully autonomous.
|
|
1584
|
-
Use this for automation, CI, or when spawning from another agent.
|
|
1644
|
+
Use only when a human is actively watching the session.
|
|
1585
1645
|
|
|
1586
|
-
|
|
1587
|
-
monitoring the session who can approve/deny tool requests in real time.
|
|
1646
|
+
Tip: pass --require-approval (or -p default) when you want a human gate.
|
|
1588
1647
|
|
|
1589
1648
|
PERMISSION WORKFLOW (only relevant for "default" and "acceptEdits" modes):
|
|
1590
1649
|
1. svamp session wait <id> --json \u2192 exit code 2 means permission pending
|
|
@@ -1635,32 +1694,32 @@ ID MATCHING:
|
|
|
1635
1694
|
EXAMPLES:
|
|
1636
1695
|
|
|
1637
1696
|
# === Common: Spawn agent to do a task and wait ===
|
|
1638
|
-
|
|
1697
|
+
# Default is bypassPermissions \u2014 no -p flag needed for autonomous runs.
|
|
1698
|
+
svamp session spawn claude -d ./my-project \\
|
|
1639
1699
|
--message "fix all TypeScript errors, run tsc to verify" --wait
|
|
1640
1700
|
|
|
1641
1701
|
# === Multi-step: Spawn, then send messages interactively ===
|
|
1642
|
-
ID=$(svamp session spawn claude -d ./proj
|
|
1702
|
+
ID=$(svamp session spawn claude -d ./proj)
|
|
1643
1703
|
svamp session send $ID "first, read the README" --wait
|
|
1644
1704
|
svamp session send $ID "now implement the feature described there" --wait
|
|
1645
1705
|
svamp session messages $ID --last 20
|
|
1646
1706
|
|
|
1647
1707
|
# === Spawn child session from another agent (e.g., in a bash tool) ===
|
|
1648
|
-
#
|
|
1649
|
-
|
|
1650
|
-
svamp session spawn claude -d /tmp/test-project -p bypassPermissions \\
|
|
1708
|
+
# bypassPermissions is the default; --wait blocks until done.
|
|
1709
|
+
svamp session spawn claude -d /tmp/test-project \\
|
|
1651
1710
|
--message "run the test suite and report results" --wait
|
|
1652
|
-
# Then read the child's output:
|
|
1653
1711
|
svamp session messages <child-id> --last 5
|
|
1654
1712
|
|
|
1655
|
-
# ===
|
|
1656
|
-
svamp session spawn claude -d ./proj --
|
|
1713
|
+
# === Human-in-the-loop: require approval for every tool ===
|
|
1714
|
+
svamp session spawn claude -d ./proj --require-approval \\
|
|
1715
|
+
--message "refactor auth module"
|
|
1657
1716
|
svamp session wait abc1 --json # exit code 2 = permission pending
|
|
1658
1717
|
svamp session approve abc1 # approve all pending
|
|
1659
1718
|
svamp session wait abc1 # wait for completion
|
|
1660
1719
|
|
|
1661
1720
|
# === Spawn on a remote machine ===
|
|
1662
1721
|
svamp session spawn claude -d /workspace -m my-cloud-box \\
|
|
1663
|
-
|
|
1722
|
+
--message "deploy to staging" --wait
|
|
1664
1723
|
|
|
1665
1724
|
# === Isolated session with network restrictions ===
|
|
1666
1725
|
svamp session spawn claude -d /tmp/sandbox --isolate --deny-network
|