svamp-cli 0.1.68 → 0.1.70
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/cli.mjs +185 -172
- package/dist/{commands-D4_QgXrS.mjs → commands-BodoXVL9.mjs} +1 -1
- package/dist/{commands-BwT-PFl4.mjs → commands-CIgrbviM.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{package-CHfluhvW.mjs → package-B0d2rUXI.mjs} +1 -1
- package/dist/{run-DWFTrXVF.mjs → run-C7CEDmD4.mjs} +479 -354
- package/dist/{run-BYtrsPjt.mjs → run-CgSj6KtU.mjs} +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as stopDaemon, s as startDaemon, d as daemonStatus } from './run-
|
|
1
|
+
import { b as stopDaemon, s as startDaemon, d as daemonStatus } from './run-C7CEDmD4.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -109,7 +109,7 @@ async function main() {
|
|
|
109
109
|
const { handleServiceCommand } = await import('./commands-CF32XIau.mjs');
|
|
110
110
|
await handleServiceCommand();
|
|
111
111
|
} else if (subcommand === "process" || subcommand === "proc") {
|
|
112
|
-
const { processCommand } = await import('./commands-
|
|
112
|
+
const { processCommand } = await import('./commands-CIgrbviM.mjs');
|
|
113
113
|
let machineId;
|
|
114
114
|
const processArgs = args.slice(1);
|
|
115
115
|
const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
|
|
@@ -127,7 +127,7 @@ async function main() {
|
|
|
127
127
|
} else if (!subcommand || subcommand === "start") {
|
|
128
128
|
await handleInteractiveCommand();
|
|
129
129
|
} else if (subcommand === "--version" || subcommand === "-v") {
|
|
130
|
-
const pkg = await import('./package-
|
|
130
|
+
const pkg = await import('./package-B0d2rUXI.mjs').catch(() => ({ default: { version: "unknown" } }));
|
|
131
131
|
console.log(`svamp version: ${pkg.default.version}`);
|
|
132
132
|
} else {
|
|
133
133
|
console.error(`Unknown command: ${subcommand}`);
|
|
@@ -136,7 +136,7 @@ async function main() {
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
async function handleInteractiveCommand() {
|
|
139
|
-
const { runInteractive } = await import('./run-
|
|
139
|
+
const { runInteractive } = await import('./run-CgSj6KtU.mjs');
|
|
140
140
|
const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
|
|
141
141
|
let directory = process.cwd();
|
|
142
142
|
let resumeSessionId;
|
|
@@ -181,7 +181,7 @@ async function handleAgentCommand() {
|
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
183
183
|
if (agentArgs[0] === "list") {
|
|
184
|
-
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-
|
|
184
|
+
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-C7CEDmD4.mjs').then(function (n) { return n.i; });
|
|
185
185
|
console.log("Known agents:");
|
|
186
186
|
for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
|
|
187
187
|
console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
|
|
@@ -193,7 +193,7 @@ async function handleAgentCommand() {
|
|
|
193
193
|
console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
|
-
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-
|
|
196
|
+
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-C7CEDmD4.mjs').then(function (n) { return n.i; });
|
|
197
197
|
let cwd = process.cwd();
|
|
198
198
|
const filteredArgs = [];
|
|
199
199
|
for (let i = 0; i < agentArgs.length; i++) {
|
|
@@ -217,12 +217,12 @@ async function handleAgentCommand() {
|
|
|
217
217
|
console.log(`Starting ${config.agentName} agent in ${cwd}...`);
|
|
218
218
|
let backend;
|
|
219
219
|
if (KNOWN_MCP_AGENTS[config.agentName]) {
|
|
220
|
-
const { CodexMcpBackend } = await import('./run-
|
|
220
|
+
const { CodexMcpBackend } = await import('./run-C7CEDmD4.mjs').then(function (n) { return n.j; });
|
|
221
221
|
backend = new CodexMcpBackend({ cwd, log: logFn });
|
|
222
222
|
} else {
|
|
223
|
-
const { AcpBackend } = await import('./run-
|
|
224
|
-
const { GeminiTransport } = await import('./run-
|
|
225
|
-
const { DefaultTransport } = await import('./run-
|
|
223
|
+
const { AcpBackend } = await import('./run-C7CEDmD4.mjs').then(function (n) { return n.h; });
|
|
224
|
+
const { GeminiTransport } = await import('./run-C7CEDmD4.mjs').then(function (n) { return n.G; });
|
|
225
|
+
const { DefaultTransport } = await import('./run-C7CEDmD4.mjs').then(function (n) { return n.D; });
|
|
226
226
|
const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
|
|
227
227
|
backend = new AcpBackend({
|
|
228
228
|
agentName: config.agentName,
|
|
@@ -340,7 +340,7 @@ async function handleSessionCommand() {
|
|
|
340
340
|
printSessionHelp();
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionQueueAdd, sessionQueueList, sessionQueueClear } = await import('./commands-
|
|
343
|
+
const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionQueueAdd, sessionQueueList, sessionQueueClear } = await import('./commands-BodoXVL9.mjs');
|
|
344
344
|
const parseFlagStr = (flag, shortFlag) => {
|
|
345
345
|
for (let i = 1; i < sessionArgs.length; i++) {
|
|
346
346
|
if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
|
|
@@ -400,7 +400,7 @@ async function handleSessionCommand() {
|
|
|
400
400
|
allowDomain.push(sessionArgs[++i]);
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
-
const { parseShareArg } = await import('./commands-
|
|
403
|
+
const { parseShareArg } = await import('./commands-BodoXVL9.mjs');
|
|
404
404
|
const shareEntries = share.map((s) => parseShareArg(s));
|
|
405
405
|
await sessionSpawn(agent, dir, targetMachineId, {
|
|
406
406
|
message,
|
|
@@ -484,7 +484,7 @@ async function handleSessionCommand() {
|
|
|
484
484
|
console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
|
|
485
485
|
process.exit(1);
|
|
486
486
|
}
|
|
487
|
-
const { sessionApprove } = await import('./commands-
|
|
487
|
+
const { sessionApprove } = await import('./commands-BodoXVL9.mjs');
|
|
488
488
|
const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
489
489
|
await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
|
|
490
490
|
json: hasFlag("--json")
|
|
@@ -494,7 +494,7 @@ async function handleSessionCommand() {
|
|
|
494
494
|
console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
|
|
495
495
|
process.exit(1);
|
|
496
496
|
}
|
|
497
|
-
const { sessionDeny } = await import('./commands-
|
|
497
|
+
const { sessionDeny } = await import('./commands-BodoXVL9.mjs');
|
|
498
498
|
const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
499
499
|
await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
|
|
500
500
|
json: hasFlag("--json")
|
|
@@ -597,7 +597,7 @@ async function handleMachineCommand() {
|
|
|
597
597
|
return;
|
|
598
598
|
}
|
|
599
599
|
if (machineSubcommand === "share") {
|
|
600
|
-
const { machineShare } = await import('./commands-
|
|
600
|
+
const { machineShare } = await import('./commands-BodoXVL9.mjs');
|
|
601
601
|
let machineId;
|
|
602
602
|
const shareArgs = [];
|
|
603
603
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
@@ -627,7 +627,7 @@ async function handleMachineCommand() {
|
|
|
627
627
|
}
|
|
628
628
|
await machineShare(machineId, { add, remove, list, configPath, showConfig });
|
|
629
629
|
} else if (machineSubcommand === "exec") {
|
|
630
|
-
const { machineExec } = await import('./commands-
|
|
630
|
+
const { machineExec } = await import('./commands-BodoXVL9.mjs');
|
|
631
631
|
let machineId;
|
|
632
632
|
let cwd;
|
|
633
633
|
const cmdParts = [];
|
|
@@ -647,7 +647,7 @@ async function handleMachineCommand() {
|
|
|
647
647
|
}
|
|
648
648
|
await machineExec(machineId, command, cwd);
|
|
649
649
|
} else if (machineSubcommand === "info") {
|
|
650
|
-
const { machineInfo } = await import('./commands-
|
|
650
|
+
const { machineInfo } = await import('./commands-BodoXVL9.mjs');
|
|
651
651
|
let machineId;
|
|
652
652
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
653
653
|
if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
|
|
@@ -670,7 +670,7 @@ async function handleMachineCommand() {
|
|
|
670
670
|
const { machineNotify } = await import('./agentCommands-C6iGblcL.mjs');
|
|
671
671
|
await machineNotify(message, level);
|
|
672
672
|
} else if (machineSubcommand === "ls") {
|
|
673
|
-
const { machineLs } = await import('./commands-
|
|
673
|
+
const { machineLs } = await import('./commands-BodoXVL9.mjs');
|
|
674
674
|
let machineId;
|
|
675
675
|
let showHidden = false;
|
|
676
676
|
let path;
|
|
@@ -1044,50 +1044,42 @@ function printHelp() {
|
|
|
1044
1044
|
console.log(`
|
|
1045
1045
|
svamp \u2014 AI workspace on Hypha Cloud
|
|
1046
1046
|
|
|
1047
|
-
|
|
1048
|
-
svamp
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
svamp
|
|
1056
|
-
svamp
|
|
1057
|
-
svamp
|
|
1058
|
-
svamp
|
|
1059
|
-
svamp
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
svamp session
|
|
1063
|
-
svamp session
|
|
1064
|
-
svamp session
|
|
1065
|
-
svamp session
|
|
1066
|
-
svamp session
|
|
1067
|
-
svamp
|
|
1068
|
-
svamp
|
|
1069
|
-
svamp
|
|
1070
|
-
svamp
|
|
1071
|
-
svamp
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
svamp
|
|
1075
|
-
svamp
|
|
1076
|
-
svamp
|
|
1077
|
-
svamp
|
|
1078
|
-
svamp
|
|
1079
|
-
svamp service --help Show all service commands
|
|
1080
|
-
svamp agent list List known agents
|
|
1081
|
-
svamp agent <name> Start local agent session (gemini, codex)
|
|
1082
|
-
svamp --version Show version
|
|
1083
|
-
svamp --help Show this help
|
|
1047
|
+
Quick start \u2014 spawn an agent to do a task (use -p bypassPermissions to run autonomously):
|
|
1048
|
+
svamp session spawn claude -d ./project -p bypassPermissions --message "fix tests" --wait
|
|
1049
|
+
|
|
1050
|
+
Note: without -p bypassPermissions the agent PAUSES waiting for human approval of each
|
|
1051
|
+
tool use. This will cause it to hang in automated/agent contexts. Use bypassPermissions
|
|
1052
|
+
for autonomous work, or "default" only when a human is actively watching.
|
|
1053
|
+
|
|
1054
|
+
Commands:
|
|
1055
|
+
svamp Start interactive Claude session (synced to cloud)
|
|
1056
|
+
svamp login [url] Login to Hypha (opens browser, stores token)
|
|
1057
|
+
svamp daemon start Start the background daemon (required for sessions)
|
|
1058
|
+
svamp daemon status Show daemon status
|
|
1059
|
+
svamp daemon --help Show all daemon commands
|
|
1060
|
+
|
|
1061
|
+
Session management (requires daemon running):
|
|
1062
|
+
svamp session spawn <agent> [opts] Spawn a new agent session (agents: claude, gemini, codex)
|
|
1063
|
+
svamp session send <id> <message> Send message to a session (--wait to block until done)
|
|
1064
|
+
svamp session wait <id> Wait for agent to become idle
|
|
1065
|
+
svamp session messages <id> Show message history (--last N, --json, --raw)
|
|
1066
|
+
svamp session info <id> Show session status & pending permissions
|
|
1067
|
+
svamp session list List sessions
|
|
1068
|
+
svamp session stop <id> Stop a session
|
|
1069
|
+
svamp session attach <id> Attach interactive terminal (stdin/stdout)
|
|
1070
|
+
svamp session approve/deny <id> Approve or deny pending permission requests
|
|
1071
|
+
svamp session --help Show ALL session commands and detailed options
|
|
1072
|
+
|
|
1073
|
+
Other:
|
|
1074
|
+
svamp machine --help Machine sharing & security contexts
|
|
1075
|
+
svamp skills --help Skills marketplace (find, install, publish)
|
|
1076
|
+
svamp service --help Service exposure (HTTP services from sandboxes)
|
|
1077
|
+
svamp agent <name> Start local agent session (no daemon needed)
|
|
1078
|
+
svamp --version Show version
|
|
1084
1079
|
|
|
1085
1080
|
Interactive mode:
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
it's visible in the web app. When a message arrives from the web app,
|
|
1089
|
-
svamp switches to remote mode to process it, then you can press
|
|
1090
|
-
Space-Space to return to local mode.
|
|
1081
|
+
Run 'svamp' with no arguments to start Claude in your terminal with cloud sync.
|
|
1082
|
+
Messages from the web app auto-switch to remote mode. Space-Space returns to local.
|
|
1091
1083
|
|
|
1092
1084
|
Environment variables:
|
|
1093
1085
|
HYPHA_SERVER_URL Hypha server URL (required for cloud sync)
|
|
@@ -1113,149 +1105,170 @@ Usage:
|
|
|
1113
1105
|
}
|
|
1114
1106
|
function printSessionHelp() {
|
|
1115
1107
|
console.log(`
|
|
1116
|
-
svamp session \u2014
|
|
1108
|
+
svamp session \u2014 Spawn and manage AI agent sessions
|
|
1117
1109
|
|
|
1118
|
-
|
|
1119
|
-
svamp session list [--active] [--json] List sessions (alias: ls)
|
|
1120
|
-
svamp session machines List discoverable machines
|
|
1121
|
-
svamp session spawn <agent> [-d <path>] [options] Spawn a new session
|
|
1122
|
-
svamp session stop <id> Stop a session
|
|
1123
|
-
svamp session info <id> [--json] Show status, activity & pending permissions
|
|
1124
|
-
svamp session send <id> <message> [--wait] [--timeout N] [--json]
|
|
1125
|
-
Send a message to a session
|
|
1126
|
-
svamp session wait <id> [--timeout N] [--json] Wait for agent to become idle
|
|
1127
|
-
svamp session messages <id> [--last N] [--json] [--raw] [--after N] [--limit N]
|
|
1128
|
-
Show messages (alias: msgs)
|
|
1129
|
-
svamp session attach <id> Attach to session (interactive terminal)
|
|
1130
|
-
svamp session approve <id> [request-id] [--json] Approve pending permission(s)
|
|
1131
|
-
svamp session deny <id> [request-id] [--json] Deny pending permission(s)
|
|
1110
|
+
QUICK START \u2014 Spawn a session, give it a task, get results:
|
|
1132
1111
|
|
|
1133
|
-
|
|
1134
|
-
-d
|
|
1135
|
-
|
|
1136
|
-
--message <msg> Send initial message after spawn
|
|
1137
|
-
--wait Wait for agent to become idle before returning
|
|
1138
|
-
--worktree Create a git worktree branch (at .dev/worktree/<name>)
|
|
1139
|
-
--isolate Force OS-level sandbox isolation
|
|
1140
|
-
--security-context <path> Apply security context config (JSON file)
|
|
1141
|
-
--share <email>[:<role>] Share with user (repeatable). Role: view, interact, admin
|
|
1142
|
-
--deny-network Block all network access
|
|
1143
|
-
--deny-read <path> Deny reading path (repeatable)
|
|
1144
|
-
--allow-write <path> Allow writing path (repeatable)
|
|
1145
|
-
--allow-domain <domain> Allow network domain (repeatable)
|
|
1112
|
+
# One-liner: spawn agent, send task, wait for completion
|
|
1113
|
+
svamp session spawn claude -d ./my-project -p bypassPermissions \\
|
|
1114
|
+
--message "fix the failing tests" --wait
|
|
1146
1115
|
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1116
|
+
# The command prints the session ID (e.g., "abc12345-..."). Use it to:
|
|
1117
|
+
svamp session messages abc1 --last 10 # read output (prefix match on ID)
|
|
1118
|
+
svamp session send abc1 "now run lint" --wait # send follow-up, wait for done
|
|
1119
|
+
svamp session stop abc1 # stop when finished
|
|
1151
1120
|
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
when it needs to use a tool that requires approval. Use these commands to manage:
|
|
1121
|
+
# Spawn on a remote/cloud machine:
|
|
1122
|
+
svamp session spawn claude -d /workspace -m cloud-box --message "deploy" --wait
|
|
1155
1123
|
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
3. Approve: svamp session approve <id> (approve all pending)
|
|
1161
|
-
svamp session approve <id> <rid> (approve specific request)
|
|
1162
|
-
4. Deny: svamp session deny <id> (deny all pending)
|
|
1163
|
-
svamp session deny <id> <rid> (deny specific request)
|
|
1124
|
+
AGENTS:
|
|
1125
|
+
claude Claude Code \u2014 full coding agent (default)
|
|
1126
|
+
gemini Google Gemini via ACP protocol
|
|
1127
|
+
codex OpenAI Codex via MCP protocol
|
|
1164
1128
|
|
|
1165
|
-
|
|
1129
|
+
Usage: svamp session spawn <agent> [options]
|
|
1130
|
+
The <agent> argument is required. Use "claude" if unsure.
|
|
1166
1131
|
|
|
1167
|
-
|
|
1168
|
-
--last N Show only the last N messages
|
|
1169
|
-
--after N Start after sequence number N
|
|
1170
|
-
--limit N Max messages to fetch from server (default: 1000, cap: 500 per page)
|
|
1171
|
-
--json Output as JSON (FormattedMessage: id, seq, role, text, createdAt)
|
|
1172
|
-
--raw With --json: output full raw message objects (includes tool_use args,
|
|
1173
|
-
tool_result content, thinking blocks \u2014 use for programmatic parsing)
|
|
1132
|
+
COMMANDS:
|
|
1174
1133
|
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1134
|
+
Lifecycle:
|
|
1135
|
+
spawn <agent> [-d <path>] [options] Spawn a new agent session
|
|
1136
|
+
stop <id> Stop a running session
|
|
1137
|
+
list [--active] [--json] List sessions (alias: ls)
|
|
1138
|
+
machines List discoverable machines
|
|
1139
|
+
info <id> [--json] Show status & pending permissions
|
|
1179
1140
|
|
|
1180
|
-
|
|
1181
|
-
|
|
1141
|
+
Communicate:
|
|
1142
|
+
send <id> <message> [--wait] [--timeout N] [--json]
|
|
1143
|
+
Send a message to a running session
|
|
1144
|
+
messages <id> [--last N] [--json] Read message history (alias: msgs)
|
|
1145
|
+
wait <id> [--timeout N] [--json] Wait for agent to become idle
|
|
1146
|
+
attach <id> Attach interactive terminal (stdin/stdout)
|
|
1182
1147
|
|
|
1183
|
-
|
|
1184
|
-
|
|
1148
|
+
Permissions (when agent pauses for approval):
|
|
1149
|
+
approve <id> [request-id] [--json] Approve pending tool permission(s)
|
|
1150
|
+
deny <id> [request-id] [--json] Deny pending tool permission(s)
|
|
1185
1151
|
|
|
1186
|
-
Sharing:
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1152
|
+
Sharing:
|
|
1153
|
+
share <id> --list List shared users
|
|
1154
|
+
share <id> --add <email>[:<role>] Share with user (role: view|interact|admin)
|
|
1155
|
+
share <id> --remove <email> Remove shared user
|
|
1156
|
+
share <id> --public <view|interact|off> Set public link access
|
|
1191
1157
|
|
|
1192
|
-
|
|
1193
|
-
|
|
1158
|
+
Ralph Loop (iterative automation):
|
|
1159
|
+
ralph-start <id> "<task>" [options] Start iterative loop
|
|
1160
|
+
ralph-cancel <id> Cancel loop
|
|
1161
|
+
ralph-status <id> Show loop status
|
|
1162
|
+
|
|
1163
|
+
Message Queue:
|
|
1164
|
+
queue add <id> "<message>" Queue a message for later
|
|
1165
|
+
queue list <id> List queued messages
|
|
1166
|
+
queue clear <id> Clear queue
|
|
1167
|
+
|
|
1168
|
+
SPAWN OPTIONS:
|
|
1169
|
+
-d, --directory <path> Working directory (REQUIRED for meaningful work)
|
|
1170
|
+
-p, --permission-mode <mode> Permission mode (see below). Default: "default"
|
|
1171
|
+
--message <msg> Send this message to the agent immediately after spawn
|
|
1172
|
+
--wait Block until agent finishes (idle). Combine with --message
|
|
1173
|
+
for fire-and-forget: spawn \u2192 task \u2192 wait \u2192 done.
|
|
1174
|
+
--timeout <sec> Timeout for --wait (default: no timeout)
|
|
1175
|
+
--worktree Create isolated git worktree branch (.dev/worktree/<name>)
|
|
1176
|
+
--tags <tag1,tag2> Comma-separated tags for session grouping
|
|
1177
|
+
--parent <sessionId> Set parent session (auto-set from SVAMP_SESSION_ID env)
|
|
1194
1178
|
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1179
|
+
PERMISSION MODES:
|
|
1180
|
+
default \u26A0 Agent PAUSES and waits for human approval before each tool use.
|
|
1181
|
+
The agent will be stuck (exit code 2) until you run approve/deny.
|
|
1182
|
+
DO NOT use default mode in automated pipelines \u2014 the agent will hang.
|
|
1183
|
+
acceptEdits Auto-approve file edits. Still pauses for bash & dangerous tools.
|
|
1184
|
+
bypassPermissions Auto-approve everything. No prompts, no pauses. Fully autonomous.
|
|
1185
|
+
Use this for automation, CI, or when spawning from another agent.
|
|
1198
1186
|
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
--security-context <path> Path to security context JSON config file
|
|
1202
|
-
--isolate Force OS-level isolation even without sharing
|
|
1203
|
-
--deny-read <path> Deny read access to path (repeatable)
|
|
1204
|
-
--allow-write <path> Allow write access to path (repeatable)
|
|
1205
|
-
--deny-network Deny all network access
|
|
1206
|
-
--allow-domain <domain> Allow network access to domain (repeatable)
|
|
1187
|
+
\u26A1 For agents/scripts: ALWAYS pass -p bypassPermissions unless you have a human
|
|
1188
|
+
monitoring the session who can approve/deny tool requests in real time.
|
|
1207
1189
|
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1190
|
+
PERMISSION WORKFLOW (only relevant for "default" and "acceptEdits" modes):
|
|
1191
|
+
1. svamp session wait <id> --json \u2192 exit code 2 means permission pending
|
|
1192
|
+
2. svamp session info <id> --json \u2192 shows pendingPermissions array
|
|
1193
|
+
3. svamp session approve <id> \u2192 approve all pending (or approve <id> <rid>)
|
|
1194
|
+
4. svamp session deny <id> \u2192 deny all pending (or deny <id> <rid>)
|
|
1195
|
+
|
|
1196
|
+
ISOLATION & SHARING OPTIONS (for spawn):
|
|
1197
|
+
--isolate Force OS-level sandbox (even without sharing)
|
|
1198
|
+
--security-context <path> Apply security context config (JSON file)
|
|
1199
|
+
--share <email>[:<role>] Share session (repeatable). Role: view|interact|admin
|
|
1200
|
+
--deny-network Block all network access
|
|
1201
|
+
--deny-read <path> Deny reading path (repeatable)
|
|
1202
|
+
--allow-write <path> Allow writing path (repeatable)
|
|
1203
|
+
--allow-domain <domain> Allow network domain (repeatable)
|
|
1211
1204
|
|
|
1212
|
-
|
|
1205
|
+
MESSAGES OPTIONS:
|
|
1206
|
+
--last N Show last N messages only
|
|
1207
|
+
--after N Start after sequence number N (for pagination)
|
|
1208
|
+
--limit N Max messages to fetch (default: 1000)
|
|
1209
|
+
--json Output as JSON array of {id, seq, role, text, createdAt}
|
|
1210
|
+
--raw With --json: include full raw objects (tool_use, tool_result, thinking)
|
|
1213
1211
|
|
|
1214
|
-
|
|
1212
|
+
RALPH LOOP OPTIONS (for ralph-start):
|
|
1213
|
+
--context-mode <mode> fresh (new process each iteration) or continue (same process)
|
|
1214
|
+
--completion-promise <text> Completion signal text (default: DONE)
|
|
1215
|
+
--max-iterations <n> Max iterations (default: 10)
|
|
1216
|
+
--cooldown <sec> Delay between iterations (default: 1)
|
|
1215
1217
|
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1218
|
+
EXIT CODES (for wait, send --wait, spawn --wait):
|
|
1219
|
+
0 Agent is idle (task completed successfully)
|
|
1220
|
+
1 Error (timeout, connection failure, session not found)
|
|
1221
|
+
2 Agent is waiting for permission approval \u2014 use approve/deny to unblock
|
|
1219
1222
|
|
|
1220
|
-
|
|
1223
|
+
ATTACH COMMANDS (inside an attached session):
|
|
1221
1224
|
/quit, /detach Detach (session keeps running)
|
|
1222
1225
|
/abort, /cancel Cancel current agent turn
|
|
1223
|
-
/kill Stop the session
|
|
1226
|
+
/kill Stop the session entirely
|
|
1224
1227
|
/info Show session status
|
|
1225
1228
|
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
svamp session ralph-cancel <id>
|
|
1229
|
-
svamp session ralph-status <id>
|
|
1230
|
-
(alias: svamp session ralph <id> "<task>" ...)
|
|
1229
|
+
GLOBAL OPTIONS:
|
|
1230
|
+
--machine <id>, -m <id> Target a specific machine (prefix match supported)
|
|
1231
1231
|
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
svamp session queue clear <id>
|
|
1232
|
+
ID MATCHING:
|
|
1233
|
+
Session and machine IDs support prefix matching.
|
|
1234
|
+
"abc1" matches "abc12345-6789-..." \u2014 you only need enough characters to be unique.
|
|
1236
1235
|
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1236
|
+
EXAMPLES:
|
|
1237
|
+
|
|
1238
|
+
# === Common: Spawn agent to do a task and wait ===
|
|
1239
|
+
svamp session spawn claude -d ./my-project -p bypassPermissions \\
|
|
1240
|
+
--message "fix all TypeScript errors, run tsc to verify" --wait
|
|
1241
|
+
|
|
1242
|
+
# === Multi-step: Spawn, then send messages interactively ===
|
|
1243
|
+
ID=$(svamp session spawn claude -d ./proj -p bypassPermissions)
|
|
1244
|
+
svamp session send $ID "first, read the README" --wait
|
|
1245
|
+
svamp session send $ID "now implement the feature described there" --wait
|
|
1246
|
+
svamp session messages $ID --last 20
|
|
1240
1247
|
|
|
1241
|
-
# Spawn
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
svamp session
|
|
1245
|
-
|
|
1248
|
+
# === Spawn child session from another agent (e.g., in a bash tool) ===
|
|
1249
|
+
# Use -p bypassPermissions so the child doesn't get stuck on approvals.
|
|
1250
|
+
# Use --wait so your script blocks until the child finishes.
|
|
1251
|
+
svamp session spawn claude -d /tmp/test-project -p bypassPermissions \\
|
|
1252
|
+
--message "run the test suite and report results" --wait
|
|
1253
|
+
# Then read the child's output:
|
|
1254
|
+
svamp session messages <child-id> --last 5
|
|
1246
1255
|
|
|
1247
|
-
# Monitor
|
|
1248
|
-
svamp session
|
|
1256
|
+
# === Monitor with permissions (default mode) ===
|
|
1257
|
+
svamp session spawn claude -d ./proj --message "refactor auth module"
|
|
1258
|
+
svamp session wait abc1 --json # exit code 2 = permission pending
|
|
1259
|
+
svamp session approve abc1 # approve all pending
|
|
1260
|
+
svamp session wait abc1 # wait for completion
|
|
1249
1261
|
|
|
1250
|
-
#
|
|
1251
|
-
svamp session
|
|
1262
|
+
# === Spawn on a remote machine ===
|
|
1263
|
+
svamp session spawn claude -d /workspace -m my-cloud-box \\
|
|
1264
|
+
-p bypassPermissions --message "deploy to staging" --wait
|
|
1252
1265
|
|
|
1253
|
-
#
|
|
1266
|
+
# === Isolated session with network restrictions ===
|
|
1254
1267
|
svamp session spawn claude -d /tmp/sandbox --isolate --deny-network
|
|
1255
|
-
svamp session spawn claude -d /tmp/proj --share alice@example.com:admin
|
|
1256
1268
|
|
|
1257
|
-
# Ralph Loop
|
|
1258
|
-
svamp session ralph-start abc1 "Fix all linting errors"
|
|
1269
|
+
# === Ralph Loop: iterative task automation ===
|
|
1270
|
+
svamp session ralph-start abc1 "Fix all linting errors" \\
|
|
1271
|
+
--context-mode fresh --max-iterations 10
|
|
1259
1272
|
`);
|
|
1260
1273
|
}
|
|
1261
1274
|
function printMachineHelp() {
|
|
@@ -2,7 +2,7 @@ import { existsSync, readFileSync } from 'node:fs';
|
|
|
2
2
|
import { execSync } from 'node:child_process';
|
|
3
3
|
import { resolve, join } from 'node:path';
|
|
4
4
|
import os from 'node:os';
|
|
5
|
-
import { l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha } from './run-
|
|
5
|
+
import { l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha } from './run-C7CEDmD4.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
8
8
|
import 'fs';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { writeFileSync, readFileSync } from 'fs';
|
|
2
2
|
import { resolve } from 'path';
|
|
3
|
-
import { connectAndGetMachine } from './commands-
|
|
3
|
+
import { connectAndGetMachine } from './commands-BodoXVL9.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-
|
|
8
|
+
import './run-C7CEDmD4.mjs';
|
|
9
9
|
import 'os';
|
|
10
10
|
import 'fs/promises';
|
|
11
11
|
import 'url';
|
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-
|
|
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-C7CEDmD4.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|