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 CHANGED
@@ -1,4 +1,4 @@
1
- import { b as stopDaemon, s as startDaemon, d as daemonStatus } from './run-DWFTrXVF.mjs';
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-BwT-PFl4.mjs');
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-CHfluhvW.mjs').catch(() => ({ default: { version: "unknown" } }));
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-BYtrsPjt.mjs');
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-DWFTrXVF.mjs').then(function (n) { return n.i; });
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-DWFTrXVF.mjs').then(function (n) { return n.i; });
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-DWFTrXVF.mjs').then(function (n) { return n.j; });
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-DWFTrXVF.mjs').then(function (n) { return n.h; });
224
- const { GeminiTransport } = await import('./run-DWFTrXVF.mjs').then(function (n) { return n.G; });
225
- const { DefaultTransport } = await import('./run-DWFTrXVF.mjs').then(function (n) { return n.D; });
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-D4_QgXrS.mjs');
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-D4_QgXrS.mjs');
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-D4_QgXrS.mjs');
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-D4_QgXrS.mjs');
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-D4_QgXrS.mjs');
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-D4_QgXrS.mjs');
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-D4_QgXrS.mjs');
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-D4_QgXrS.mjs');
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
- Usage:
1048
- svamp Start interactive Claude session (synced to cloud)
1049
- svamp start [-d <path>] Same as above, with explicit directory
1050
- svamp login [url] Login to Hypha (opens browser, stores token)
1051
- svamp daemon start Start the daemon (detached)
1052
- svamp daemon stop Stop the daemon (sessions preserved for restart)
1053
- svamp daemon restart Restart the daemon (sessions resume seamlessly)
1054
- svamp daemon status Show daemon status
1055
- svamp daemon install Install as system service (launchd/systemd/wrapper)
1056
- svamp session list List active sessions
1057
- svamp session spawn Spawn a new session on the daemon
1058
- svamp session send <id> <m> Send message to a session
1059
- svamp session wait <id> Wait for agent to become idle
1060
- svamp session info <id> Show session status & pending permissions
1061
- svamp session messages <id> Show message history
1062
- svamp session approve <id> Approve pending permission request
1063
- svamp session deny <id> Deny pending permission request
1064
- svamp session attach <id> Attach to a session (interactive terminal)
1065
- svamp session share <id> Manage session sharing
1066
- svamp session --help Show all session commands
1067
- svamp machine share Manage machine sharing & security contexts
1068
- svamp machine --help Show all machine commands
1069
- svamp skills find <query> Search the skills marketplace
1070
- svamp skills install <n> Install a skill from the marketplace
1071
- svamp skills --help Show all skill commands
1072
- svamp process apply <f.yaml> Create/update a supervised process (idempotent)
1073
- svamp process list List supervised processes
1074
- svamp process start <name> Start or create a process
1075
- svamp process logs <name> Show process log output
1076
- svamp process --help Show all process commands
1077
- svamp service expose <name> Expose a service from this sandbox
1078
- svamp service list List service groups
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
- When you run 'svamp' with no arguments, Claude starts in your terminal
1087
- with full interactive access. Your session is synced to Hypha Cloud so
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 Manage daemon sessions (Claude, Gemini, Codex)
1108
+ svamp session \u2014 Spawn and manage AI agent sessions
1117
1109
 
1118
- Commands:
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
- Spawn options:
1134
- -d, --directory <path> Working directory (default: cwd)
1135
- -p, --permission-mode <mode> Agent permission mode (see "Permission modes" below)
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
- Permission modes (-p, --permission-mode):
1148
- default Prompt for each tool use (default)
1149
- acceptEdits Auto-approve file edits, prompt for bash/dangerous tools
1150
- bypassPermissions Auto-approve all tools (no prompts)
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
- Permission workflow:
1153
- When an agent runs with 'default' or 'acceptEdits' permission mode, it pauses
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
- 1. Check status: svamp session info <id> --json
1157
- \u2192 shows pendingPermissions array when agent is blocked
1158
- 2. Wait & detect: svamp session wait <id> --json
1159
- \u2192 exits with code 2 if permission pending (see exit codes)
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
- Request IDs support prefix matching (e.g., "abc1" matches "abc12345-...").
1129
+ Usage: svamp session spawn <agent> [options]
1130
+ The <agent> argument is required. Use "claude" if unsure.
1166
1131
 
1167
- Messages options:
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
- Exit codes (wait, send --wait, spawn --wait):
1176
- 0 Agent is idle (task completed)
1177
- 1 Error (timeout, connection failure, session not found)
1178
- 2 Agent is waiting for permission approval \u2014 use approve/deny to continue
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
- Global options:
1181
- --machine <id>, -m <id> Target a specific machine (prefix match supported)
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
- Agents: claude (default), gemini, codex
1184
- Session and machine IDs support prefix matching (e.g., "abc1" matches "abc12345-...").
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
- svamp session share <id> --list List shared users
1188
- svamp session share <id> --add <email>[:<role>] Share with user
1189
- svamp session share <id> --remove <email> Remove shared user
1190
- svamp session share <id> --public <view|interact|off> Set public link access
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
- Options:
1193
- --machine <id>, -m <id> Target a specific machine (prefix match supported)
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
- Spawn options:
1196
- -p, --permission-mode <mode> Agent permission mode: default, acceptEdits, bypassPermissions
1197
- --worktree Create a git worktree branch as working directory
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
- Spawn isolation options:
1200
- --share <email>[:<role>] Share session (repeatable). Role: view, interact, admin
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
- Spawn grouping options:
1209
- --tags <tag1,tag2> Comma-separated tags
1210
- --parent <sessionId> Set parent session (auto-detected from SVAMP_SESSION_ID)
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
- Agents: claude (default), gemini, codex
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
- Session and machine IDs can be abbreviated (prefix match, like Docker).
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
- NOTE: By default, spawned agents run with 'default' permission mode, which means
1217
- the agent may pause to request permission for tool use (file edits, bash, etc.).
1218
- Use -p bypassPermissions to run without approval prompts.
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
- Attach commands:
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
- Ralph Loop (iterative task automation):
1227
- svamp session ralph-start <id> "<task>" [--context-mode fresh|continue] [--completion-promise TEXT] [--max-iterations N] [--cooldown N]
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
- Message Queue:
1233
- svamp session queue add <id> "<message>"
1234
- svamp session queue list <id>
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
- Examples:
1238
- # Spawn with bypassed permissions (no prompts)
1239
- svamp session spawn claude -d ./proj -p bypassPermissions --message "fix tests" --wait
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 with default permissions, handle approval via CLI
1242
- svamp session spawn claude -d ./proj --message "refactor auth"
1243
- svamp session wait abc1 --json # exits with code 2 if permission pending
1244
- svamp session approve abc1 # approve all pending permissions
1245
- svamp session wait abc1 # wait for completion
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 session messages (raw for full tool details)
1248
- svamp session messages abc1 --last 10 --json --raw
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
- # Send message and wait for completion
1251
- svamp session send abc1 "run the tests" --wait --json
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
- # Isolation & sharing
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" --context-mode fresh --max-iterations 10
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-DWFTrXVF.mjs';
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-D4_QgXrS.mjs';
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-DWFTrXVF.mjs';
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-DWFTrXVF.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-C7CEDmD4.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.1.68";
2
+ var version = "0.1.70";
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";