svamp-cli 0.1.81 → 0.1.83

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.
@@ -145,7 +145,7 @@ async function sessionBroadcast(action, args) {
145
145
  console.log(`Broadcast sent: ${action}`);
146
146
  }
147
147
  async function connectToMachineService() {
148
- const { connectAndGetMachine } = await import('./commands-6PO-ky9k.mjs');
148
+ const { connectAndGetMachine } = await import('./commands-BmJzcTEC.mjs');
149
149
  return connectAndGetMachine();
150
150
  }
151
151
  async function inboxSend(targetSessionId, opts) {
@@ -161,7 +161,7 @@ async function inboxSend(targetSessionId, opts) {
161
161
  }
162
162
  const { server, machine } = await connectToMachineService();
163
163
  try {
164
- const { resolveSessionId } = await import('./commands-6PO-ky9k.mjs');
164
+ const { resolveSessionId } = await import('./commands-BmJzcTEC.mjs');
165
165
  const sessions = await machine.listSessions();
166
166
  const match = resolveSessionId(sessions, targetSessionId);
167
167
  const fullTargetId = match.sessionId;
@@ -177,7 +177,7 @@ async function inboxSend(targetSessionId, opts) {
177
177
  subject: opts?.subject,
178
178
  urgency: opts?.urgency || "normal"
179
179
  };
180
- const result = await machine.sessionRPC(fullTargetId, "sendInboxMessage", [message]);
180
+ const result = await machine.sessionRPC(fullTargetId, "sendInboxMessage", { message });
181
181
  console.log(`Inbox message sent to ${fullTargetId.slice(0, 8)} (id: ${result.messageId.slice(0, 8)})`);
182
182
  } finally {
183
183
  await server.disconnect();
@@ -191,7 +191,7 @@ async function inboxList(opts) {
191
191
  }
192
192
  const { server, machine } = await connectToMachineService();
193
193
  try {
194
- const result = await machine.sessionRPC(sessionId, "getInbox", [{ unread: opts?.unread, limit: opts?.limit }]);
194
+ const result = await machine.sessionRPC(sessionId, "getInbox", { opts: { unread: opts?.unread, limit: opts?.limit } });
195
195
  const messages = result.messages;
196
196
  if (opts?.json) {
197
197
  console.log(JSON.stringify({ messages }, null, 2));
@@ -221,7 +221,7 @@ async function inboxReply(messageId, body) {
221
221
  }
222
222
  const { server, machine } = await connectToMachineService();
223
223
  try {
224
- const result = await machine.sessionRPC(sessionId, "getInbox", []);
224
+ const result = await machine.sessionRPC(sessionId, "getInbox", {});
225
225
  const original = result.messages.find((m) => m.messageId === messageId || m.messageId.startsWith(messageId));
226
226
  if (!original) {
227
227
  console.error(`Message ${messageId} not found in inbox.`);
@@ -245,7 +245,7 @@ async function inboxReply(messageId, body) {
245
245
  replyTo: original.messageId,
246
246
  threadId: original.threadId || original.messageId
247
247
  };
248
- const sendResult = await machine.sessionRPC(original.fromSession, "sendInboxMessage", [reply]);
248
+ const sendResult = await machine.sessionRPC(original.fromSession, "sendInboxMessage", { message: reply });
249
249
  console.log(`Reply sent to ${original.fromSession.slice(0, 8)} (id: ${sendResult.messageId.slice(0, 8)})`);
250
250
  } finally {
251
251
  await server.disconnect();
package/dist/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { b as stopDaemon, s as startDaemon, d as daemonStatus } from './run-kLd-u7KD.mjs';
1
+ import { b as stopDaemon, s as startDaemon, d as daemonStatus } from './run-RO50yndI.mjs';
2
2
  import 'os';
3
3
  import 'fs/promises';
4
4
  import 'fs';
@@ -211,7 +211,7 @@ async function main() {
211
211
  const { handleServiceCommand } = await import('./commands-BYbuedOK.mjs');
212
212
  await handleServiceCommand();
213
213
  } else if (subcommand === "process" || subcommand === "proc") {
214
- const { processCommand } = await import('./commands-B41tMO2x.mjs');
214
+ const { processCommand } = await import('./commands-BKx7KLJM.mjs');
215
215
  let machineId;
216
216
  const processArgs = args.slice(1);
217
217
  const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
@@ -229,7 +229,7 @@ async function main() {
229
229
  } else if (!subcommand || subcommand === "start") {
230
230
  await handleInteractiveCommand();
231
231
  } else if (subcommand === "--version" || subcommand === "-v") {
232
- const pkg = await import('./package-BoA_DXNG.mjs').catch(() => ({ default: { version: "unknown" } }));
232
+ const pkg = await import('./package-CMGWXHEC.mjs').catch(() => ({ default: { version: "unknown" } }));
233
233
  console.log(`svamp version: ${pkg.default.version}`);
234
234
  } else {
235
235
  console.error(`Unknown command: ${subcommand}`);
@@ -238,7 +238,7 @@ async function main() {
238
238
  }
239
239
  }
240
240
  async function handleInteractiveCommand() {
241
- const { runInteractive } = await import('./run-BDAinUvU.mjs');
241
+ const { runInteractive } = await import('./run-Ceop6nDB.mjs');
242
242
  const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
243
243
  let directory = process.cwd();
244
244
  let resumeSessionId;
@@ -283,7 +283,7 @@ async function handleAgentCommand() {
283
283
  return;
284
284
  }
285
285
  if (agentArgs[0] === "list") {
286
- const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-kLd-u7KD.mjs').then(function (n) { return n.i; });
286
+ const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-RO50yndI.mjs').then(function (n) { return n.i; });
287
287
  console.log("Known agents:");
288
288
  for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
289
289
  console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
@@ -295,7 +295,7 @@ async function handleAgentCommand() {
295
295
  console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
296
296
  return;
297
297
  }
298
- const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-kLd-u7KD.mjs').then(function (n) { return n.i; });
298
+ const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-RO50yndI.mjs').then(function (n) { return n.i; });
299
299
  let cwd = process.cwd();
300
300
  const filteredArgs = [];
301
301
  for (let i = 0; i < agentArgs.length; i++) {
@@ -319,12 +319,12 @@ async function handleAgentCommand() {
319
319
  console.log(`Starting ${config.agentName} agent in ${cwd}...`);
320
320
  let backend;
321
321
  if (KNOWN_MCP_AGENTS[config.agentName]) {
322
- const { CodexMcpBackend } = await import('./run-kLd-u7KD.mjs').then(function (n) { return n.j; });
322
+ const { CodexMcpBackend } = await import('./run-RO50yndI.mjs').then(function (n) { return n.j; });
323
323
  backend = new CodexMcpBackend({ cwd, log: logFn });
324
324
  } else {
325
- const { AcpBackend } = await import('./run-kLd-u7KD.mjs').then(function (n) { return n.h; });
326
- const { GeminiTransport } = await import('./run-kLd-u7KD.mjs').then(function (n) { return n.G; });
327
- const { DefaultTransport } = await import('./run-kLd-u7KD.mjs').then(function (n) { return n.D; });
325
+ const { AcpBackend } = await import('./run-RO50yndI.mjs').then(function (n) { return n.h; });
326
+ const { GeminiTransport } = await import('./run-RO50yndI.mjs').then(function (n) { return n.G; });
327
+ const { DefaultTransport } = await import('./run-RO50yndI.mjs').then(function (n) { return n.D; });
328
328
  const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
329
329
  backend = new AcpBackend({
330
330
  agentName: config.agentName,
@@ -442,7 +442,7 @@ async function handleSessionCommand() {
442
442
  printSessionHelp();
443
443
  return;
444
444
  }
445
- const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-6PO-ky9k.mjs');
445
+ const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-BmJzcTEC.mjs');
446
446
  const parseFlagStr = (flag, shortFlag) => {
447
447
  for (let i = 1; i < sessionArgs.length; i++) {
448
448
  if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
@@ -502,7 +502,7 @@ async function handleSessionCommand() {
502
502
  allowDomain.push(sessionArgs[++i]);
503
503
  }
504
504
  }
505
- const { parseShareArg } = await import('./commands-6PO-ky9k.mjs');
505
+ const { parseShareArg } = await import('./commands-BmJzcTEC.mjs');
506
506
  const shareEntries = share.map((s) => parseShareArg(s));
507
507
  await sessionSpawn(agent, dir, targetMachineId, {
508
508
  message,
@@ -588,7 +588,7 @@ async function handleSessionCommand() {
588
588
  console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
589
589
  process.exit(1);
590
590
  }
591
- const { sessionApprove } = await import('./commands-6PO-ky9k.mjs');
591
+ const { sessionApprove } = await import('./commands-BmJzcTEC.mjs');
592
592
  const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
593
593
  await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
594
594
  json: hasFlag("--json")
@@ -598,7 +598,7 @@ async function handleSessionCommand() {
598
598
  console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
599
599
  process.exit(1);
600
600
  }
601
- const { sessionDeny } = await import('./commands-6PO-ky9k.mjs');
601
+ const { sessionDeny } = await import('./commands-BmJzcTEC.mjs');
602
602
  const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
603
603
  await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
604
604
  json: hasFlag("--json")
@@ -634,7 +634,7 @@ async function handleSessionCommand() {
634
634
  console.error("Usage: svamp session set-title <title>");
635
635
  process.exit(1);
636
636
  }
637
- const { sessionSetTitle } = await import('./agentCommands-BnAlpm77.mjs');
637
+ const { sessionSetTitle } = await import('./agentCommands-DLJ2QNf3.mjs');
638
638
  await sessionSetTitle(title);
639
639
  } else if (sessionSubcommand === "set-link") {
640
640
  const url = sessionArgs[1];
@@ -643,7 +643,7 @@ async function handleSessionCommand() {
643
643
  process.exit(1);
644
644
  }
645
645
  const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
646
- const { sessionSetLink } = await import('./agentCommands-BnAlpm77.mjs');
646
+ const { sessionSetLink } = await import('./agentCommands-DLJ2QNf3.mjs');
647
647
  await sessionSetLink(url, label);
648
648
  } else if (sessionSubcommand === "notify") {
649
649
  const message = sessionArgs[1];
@@ -652,7 +652,7 @@ async function handleSessionCommand() {
652
652
  process.exit(1);
653
653
  }
654
654
  const level = parseFlagStr("--level") || "info";
655
- const { sessionNotify } = await import('./agentCommands-BnAlpm77.mjs');
655
+ const { sessionNotify } = await import('./agentCommands-DLJ2QNf3.mjs');
656
656
  await sessionNotify(message, level);
657
657
  } else if (sessionSubcommand === "broadcast") {
658
658
  const action = sessionArgs[1];
@@ -660,7 +660,7 @@ async function handleSessionCommand() {
660
660
  console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
661
661
  process.exit(1);
662
662
  }
663
- const { sessionBroadcast } = await import('./agentCommands-BnAlpm77.mjs');
663
+ const { sessionBroadcast } = await import('./agentCommands-DLJ2QNf3.mjs');
664
664
  await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
665
665
  } else if (sessionSubcommand === "inbox") {
666
666
  const inboxSubcmd = sessionArgs[1];
@@ -671,7 +671,7 @@ async function handleSessionCommand() {
671
671
  process.exit(1);
672
672
  }
673
673
  if (agentSessionId) {
674
- const { inboxSend } = await import('./agentCommands-BnAlpm77.mjs');
674
+ const { inboxSend } = await import('./agentCommands-DLJ2QNf3.mjs');
675
675
  await inboxSend(sessionArgs[2], {
676
676
  body: sessionArgs[3],
677
677
  subject: parseFlagStr("--subject"),
@@ -686,7 +686,7 @@ async function handleSessionCommand() {
686
686
  }
687
687
  } else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
688
688
  if (agentSessionId && !sessionArgs[2]) {
689
- const { inboxList } = await import('./agentCommands-BnAlpm77.mjs');
689
+ const { inboxList } = await import('./agentCommands-DLJ2QNf3.mjs');
690
690
  await inboxList({
691
691
  unread: hasFlag("--unread"),
692
692
  limit: parseFlagInt("--limit"),
@@ -708,7 +708,7 @@ async function handleSessionCommand() {
708
708
  process.exit(1);
709
709
  }
710
710
  if (agentSessionId && !sessionArgs[3]) {
711
- const { inboxList } = await import('./agentCommands-BnAlpm77.mjs');
711
+ const { inboxList } = await import('./agentCommands-DLJ2QNf3.mjs');
712
712
  await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
713
713
  } else if (sessionArgs[3]) {
714
714
  await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
@@ -718,7 +718,7 @@ async function handleSessionCommand() {
718
718
  }
719
719
  } else if (inboxSubcmd === "reply") {
720
720
  if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
721
- const { inboxReply } = await import('./agentCommands-BnAlpm77.mjs');
721
+ const { inboxReply } = await import('./agentCommands-DLJ2QNf3.mjs');
722
722
  await inboxReply(sessionArgs[2], sessionArgs[3]);
723
723
  } else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
724
724
  await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
@@ -754,7 +754,7 @@ async function handleMachineCommand() {
754
754
  return;
755
755
  }
756
756
  if (machineSubcommand === "share") {
757
- const { machineShare } = await import('./commands-6PO-ky9k.mjs');
757
+ const { machineShare } = await import('./commands-BmJzcTEC.mjs');
758
758
  let machineId;
759
759
  const shareArgs = [];
760
760
  for (let i = 1; i < machineArgs.length; i++) {
@@ -784,7 +784,7 @@ async function handleMachineCommand() {
784
784
  }
785
785
  await machineShare(machineId, { add, remove, list, configPath, showConfig });
786
786
  } else if (machineSubcommand === "exec") {
787
- const { machineExec } = await import('./commands-6PO-ky9k.mjs');
787
+ const { machineExec } = await import('./commands-BmJzcTEC.mjs');
788
788
  let machineId;
789
789
  let cwd;
790
790
  const cmdParts = [];
@@ -804,7 +804,7 @@ async function handleMachineCommand() {
804
804
  }
805
805
  await machineExec(machineId, command, cwd);
806
806
  } else if (machineSubcommand === "info") {
807
- const { machineInfo } = await import('./commands-6PO-ky9k.mjs');
807
+ const { machineInfo } = await import('./commands-BmJzcTEC.mjs');
808
808
  let machineId;
809
809
  for (let i = 1; i < machineArgs.length; i++) {
810
810
  if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
@@ -824,10 +824,10 @@ async function handleMachineCommand() {
824
824
  level = machineArgs[++i];
825
825
  }
826
826
  }
827
- const { machineNotify } = await import('./agentCommands-BnAlpm77.mjs');
827
+ const { machineNotify } = await import('./agentCommands-DLJ2QNf3.mjs');
828
828
  await machineNotify(message, level);
829
829
  } else if (machineSubcommand === "ls") {
830
- const { machineLs } = await import('./commands-6PO-ky9k.mjs');
830
+ const { machineLs } = await import('./commands-BmJzcTEC.mjs');
831
831
  let machineId;
832
832
  let showHidden = false;
833
833
  let path;
@@ -1,11 +1,11 @@
1
1
  import { writeFileSync, readFileSync } from 'fs';
2
2
  import { resolve } from 'path';
3
- import { connectAndGetMachine } from './commands-6PO-ky9k.mjs';
3
+ import { connectAndGetMachine } from './commands-BmJzcTEC.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-kLd-u7KD.mjs';
8
+ import './run-RO50yndI.mjs';
9
9
  import 'os';
10
10
  import 'fs/promises';
11
11
  import 'url';
@@ -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-kLd-u7KD.mjs';
5
+ import { l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha } from './run-RO50yndI.mjs';
6
6
  import 'os';
7
7
  import 'fs/promises';
8
8
  import 'fs';
@@ -70,10 +70,55 @@ function formatJson(data) {
70
70
  return JSON.stringify(data, null, 2);
71
71
  }
72
72
 
73
+ const SESSION_RPC_PARAMS = {
74
+ getMessages: ["afterSeq", "limit"],
75
+ sendMessage: ["content", "localId", "meta"],
76
+ getMetadata: [],
77
+ updateMetadata: ["newMetadata", "expectedVersion"],
78
+ updateConfig: ["patch"],
79
+ getAgentState: [],
80
+ updateAgentState: ["newState", "expectedVersion"],
81
+ abort: [],
82
+ permissionResponse: ["params"],
83
+ switchMode: ["mode"],
84
+ restartClaude: [],
85
+ killSession: [],
86
+ keepAlive: ["thinking", "mode"],
87
+ sessionEnd: [],
88
+ getActivityState: [],
89
+ readFile: ["path"],
90
+ writeFile: ["path", "content"],
91
+ listDirectory: ["path"],
92
+ bash: ["command", "cwd", "timeout"],
93
+ ripgrep: ["args", "cwd"],
94
+ getDirectoryTree: ["path", "maxDepth"],
95
+ getSharing: [],
96
+ getEffectiveRole: [],
97
+ updateSharing: ["newSharing"],
98
+ updateSecurityContext: ["newSecurityContext"],
99
+ applySystemPrompt: ["prompt"],
100
+ sendInboxMessage: ["message"],
101
+ getInbox: ["opts"],
102
+ markInboxRead: ["messageId"],
103
+ clearInbox: ["opts"],
104
+ registerListener: ["callback"]
105
+ };
73
106
  function getSessionProxy(machine, sessionId) {
74
107
  return new Proxy({}, {
75
108
  get(_target, method) {
76
- return (...args) => machine.sessionRPC(sessionId, method, args);
109
+ return (...args) => {
110
+ const paramNames = SESSION_RPC_PARAMS[method];
111
+ if (paramNames) {
112
+ const kwargs = {};
113
+ for (let i = 0; i < paramNames.length && i < args.length; i++) {
114
+ if (args[i] !== void 0) {
115
+ kwargs[paramNames[i]] = args[i];
116
+ }
117
+ }
118
+ return machine.sessionRPC(sessionId, method, kwargs);
119
+ }
120
+ return machine.sessionRPC(sessionId, method, {});
121
+ };
77
122
  }
78
123
  });
79
124
  }
@@ -626,7 +671,7 @@ async function waitForIdle(machine, sessionId, timeoutMs) {
626
671
  const pollInterval = 2e3;
627
672
  const deadline = Date.now() + timeoutMs;
628
673
  while (Date.now() < deadline) {
629
- const activity = await machine.sessionRPC(sessionId, "getActivityState", []);
674
+ const activity = await machine.sessionRPC(sessionId, "getActivityState", {});
630
675
  if (activity?.pendingPermissions?.length > 0) {
631
676
  return { idle: false, pendingPermissions: activity.pendingPermissions };
632
677
  }
@@ -643,7 +688,7 @@ async function waitForBusyThenIdle(machine, sessionId, timeoutMs = 3e5, busyTime
643
688
  const busyDeadline = Date.now() + busyTimeoutMs;
644
689
  let sawBusy = false;
645
690
  while (Date.now() < deadline) {
646
- const activity = await machine.sessionRPC(sessionId, "getActivityState", []);
691
+ const activity = await machine.sessionRPC(sessionId, "getActivityState", {});
647
692
  if (activity?.pendingPermissions?.length > 0) {
648
693
  return { idle: false, pendingPermissions: activity.pendingPermissions };
649
694
  }
@@ -1280,7 +1325,7 @@ async function sessionSend(sessionId, message, machineId, opts) {
1280
1325
  subject: opts?.subject,
1281
1326
  urgency: opts?.urgency || "urgent"
1282
1327
  };
1283
- const result = await machine.sessionRPC(fullId, "sendInboxMessage", [inboxMessage]);
1328
+ const result = await machine.sessionRPC(fullId, "sendInboxMessage", { message: inboxMessage });
1284
1329
  let waitResult;
1285
1330
  if (opts?.wait) {
1286
1331
  const timeoutMs = (opts.timeout || 300) * 1e3;
@@ -1730,7 +1775,7 @@ async function sessionInboxSend(sessionIdPartial, body, machineId, opts) {
1730
1775
  replyTo: opts?.replyTo,
1731
1776
  threadId: opts?.threadId
1732
1777
  };
1733
- const result = await machine.sessionRPC(fullId, "sendInboxMessage", [message]);
1778
+ const result = await machine.sessionRPC(fullId, "sendInboxMessage", { message });
1734
1779
  if (opts?.json) {
1735
1780
  console.log(formatJson({ sessionId: fullId, messageId: result.messageId, sent: true }));
1736
1781
  } else {
@@ -1746,7 +1791,7 @@ async function sessionInboxList(sessionIdPartial, machineId, opts) {
1746
1791
  const sessions = await machine.listSessions();
1747
1792
  const match = resolveSessionId(sessions, sessionIdPartial);
1748
1793
  const fullId = match.sessionId;
1749
- const result = await machine.sessionRPC(fullId, "getInbox", [{ unread: opts?.unread, limit: opts?.limit }]);
1794
+ const result = await machine.sessionRPC(fullId, "getInbox", { opts: { unread: opts?.unread, limit: opts?.limit } });
1750
1795
  const messages = result.messages;
1751
1796
  if (opts?.json) {
1752
1797
  console.log(formatJson({ sessionId: fullId, messages }));
@@ -1781,14 +1826,14 @@ async function sessionInboxRead(sessionIdPartial, messageId, machineId) {
1781
1826
  const sessions = await machine.listSessions();
1782
1827
  const match = resolveSessionId(sessions, sessionIdPartial);
1783
1828
  const fullId = match.sessionId;
1784
- const result = await machine.sessionRPC(fullId, "getInbox", []);
1829
+ const result = await machine.sessionRPC(fullId, "getInbox", {});
1785
1830
  const msg = result.messages.find((m) => m.messageId === messageId || m.messageId.startsWith(messageId));
1786
1831
  if (!msg) {
1787
1832
  console.error(`Message ${messageId} not found in inbox.`);
1788
1833
  process.exit(1);
1789
1834
  }
1790
1835
  if (!msg.read) {
1791
- await machine.sessionRPC(fullId, "markInboxRead", [msg.messageId]);
1836
+ await machine.sessionRPC(fullId, "markInboxRead", { messageId: msg.messageId });
1792
1837
  }
1793
1838
  console.log(`From: ${msg.from || "(unknown)"}`);
1794
1839
  if (msg.subject) console.log(`Subject: ${msg.subject}`);
@@ -1808,7 +1853,7 @@ async function sessionInboxReply(sessionIdPartial, messageId, body, machineId) {
1808
1853
  const sessions = await machine.listSessions();
1809
1854
  const match = resolveSessionId(sessions, sessionIdPartial);
1810
1855
  const fullId = match.sessionId;
1811
- const result = await machine.sessionRPC(fullId, "getInbox", []);
1856
+ const result = await machine.sessionRPC(fullId, "getInbox", {});
1812
1857
  const original = result.messages.find((m) => m.messageId === messageId || m.messageId.startsWith(messageId));
1813
1858
  if (!original) {
1814
1859
  console.error(`Message ${messageId} not found in inbox.`);
@@ -1832,7 +1877,7 @@ async function sessionInboxReply(sessionIdPartial, messageId, body, machineId) {
1832
1877
  replyTo: original.messageId,
1833
1878
  threadId: original.threadId || original.messageId
1834
1879
  };
1835
- const sendResult = await machine.sessionRPC(original.fromSession, "sendInboxMessage", [reply]);
1880
+ const sendResult = await machine.sessionRPC(original.fromSession, "sendInboxMessage", { message: reply });
1836
1881
  console.log(`Reply sent to session ${original.fromSession.slice(0, 8)} (id: ${sendResult.messageId.slice(0, 8)})`);
1837
1882
  } finally {
1838
1883
  await server.disconnect();
@@ -1844,7 +1889,7 @@ async function sessionInboxClear(sessionIdPartial, machineId, opts) {
1844
1889
  const sessions = await machine.listSessions();
1845
1890
  const match = resolveSessionId(sessions, sessionIdPartial);
1846
1891
  const fullId = match.sessionId;
1847
- const result = await machine.sessionRPC(fullId, "clearInbox", [{ all: opts?.all }]);
1892
+ const result = await machine.sessionRPC(fullId, "clearInbox", { opts: { all: opts?.all } });
1848
1893
  console.log(`Cleared inbox on session ${fullId.slice(0, 8)} (${result.remaining} remaining)`);
1849
1894
  } finally {
1850
1895
  await server.disconnect();
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-kLd-u7KD.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-RO50yndI.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.81";
2
+ var version = "0.1.83";
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";
@@ -19,7 +19,7 @@ var exports$1 = {
19
19
  var scripts = {
20
20
  build: "rm -rf dist && tsc --noEmit && pkgroll",
21
21
  typecheck: "tsc --noEmit",
22
- test: "npx tsx test/test-authorize.mjs && npx tsx test/test-session-helpers.mjs && npx tsx test/test-cli-routing.mjs && npx tsx test/test-security-context.mjs && npx tsx test/test-ralph-loop.mjs && npx tsx test/test-message-helpers.mjs && npx tsx test/test-agent-config.mjs && npx tsx test/test-wrap-command.mjs && npx tsx test/test-credential-staging.mjs && npx tsx test/test-output-formatters.mjs && npx tsx test/test-agent-types.mjs && npx tsx test/test-transport.mjs && npx tsx test/test-session-update-handlers.mjs && npx tsx test/test-session-scanner.mjs && npx tsx test/test-hypha-client.mjs && npx tsx test/test-hook-settings.mjs && npx tsx test/test-session-service-logic.mjs && npx tsx test/test-daemon-persistence.mjs && npx tsx test/test-detect-isolation.mjs && npx tsx test/test-machine-service-logic.mjs && npx tsx test/test-interactive-helpers.mjs && npx tsx test/test-codex-backend.mjs && npx tsx test/test-acp-backend.mjs && npx tsx test/test-acp-bridge.mjs && npx tsx test/test-hook-server.mjs && npx tsx test/test-session-commands.mjs && npx tsx test/test-interactive-console.mjs && npx tsx test/test-session-messages.mjs && npx tsx test/test-skills.mjs && npx tsx test/test-agent-grouping.mjs && npx tsx test/test-ralph-loop-integration.mjs && npx tsx test/test-ralph-loop-modes.mjs && npx tsx test/test-machine-list-directory.mjs && npx tsx test/test-service-commands.mjs && npx tsx test/test-supervisor.mjs && npx tsx test/test-clear-detection.mjs && npx tsx test/test-session-consolidation.mjs && npx tsx test/test-inbox.mjs",
22
+ test: "npx tsx test/test-authorize.mjs && npx tsx test/test-session-helpers.mjs && npx tsx test/test-cli-routing.mjs && npx tsx test/test-security-context.mjs && npx tsx test/test-ralph-loop.mjs && npx tsx test/test-message-helpers.mjs && npx tsx test/test-agent-config.mjs && npx tsx test/test-wrap-command.mjs && npx tsx test/test-credential-staging.mjs && npx tsx test/test-output-formatters.mjs && npx tsx test/test-agent-types.mjs && npx tsx test/test-transport.mjs && npx tsx test/test-session-update-handlers.mjs && npx tsx test/test-session-scanner.mjs && npx tsx test/test-hypha-client.mjs && npx tsx test/test-hook-settings.mjs && npx tsx test/test-session-service-logic.mjs && npx tsx test/test-daemon-persistence.mjs && npx tsx test/test-detect-isolation.mjs && npx tsx test/test-machine-service-logic.mjs && npx tsx test/test-interactive-helpers.mjs && npx tsx test/test-codex-backend.mjs && npx tsx test/test-acp-backend.mjs && npx tsx test/test-acp-bridge.mjs && npx tsx test/test-hook-server.mjs && npx tsx test/test-session-commands.mjs && npx tsx test/test-interactive-console.mjs && npx tsx test/test-session-messages.mjs && npx tsx test/test-skills.mjs && npx tsx test/test-agent-grouping.mjs && npx tsx test/test-ralph-loop-integration.mjs && npx tsx test/test-ralph-loop-modes.mjs && npx tsx test/test-machine-list-directory.mjs && npx tsx test/test-service-commands.mjs && npx tsx test/test-supervisor.mjs && npx tsx test/test-clear-detection.mjs && npx tsx test/test-session-consolidation.mjs && npx tsx test/test-inbox.mjs && npx tsx test/test-session-rpc-dispatch.mjs",
23
23
  "test:hypha": "node --no-warnings test/test-hypha-service.mjs",
24
24
  dev: "tsx src/cli.ts",
25
25
  "dev:daemon": "tsx src/cli.ts daemon start-sync",
@@ -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 { join, resolve } from 'node:path';
4
4
  import { mkdirSync, writeFileSync, existsSync, unlinkSync, readFileSync, watch } from 'node:fs';
5
- import { c as connectToHypha, a as registerSessionService } from './run-kLd-u7KD.mjs';
5
+ import { c as connectToHypha, a as registerSessionService } from './run-RO50yndI.mjs';
6
6
  import { createServer } from 'node:http';
7
7
  import { spawn } from 'node:child_process';
8
8
  import { createInterface } from 'node:readline';
@@ -294,6 +294,12 @@ function applySecurityContext(baseConfig, context) {
294
294
  return config;
295
295
  }
296
296
 
297
+ function getParamNames(fn) {
298
+ const src = fn.toString();
299
+ const match = src.match(/^(?:async\s+)?(?:function\s*\w*)?\s*\(([^)]*)\)/);
300
+ if (!match) return [];
301
+ return match[1].split(",").map((p) => p.trim().replace(/\s*=.*$/, "").replace(/^\.\.\.\s*/, "")).filter(Boolean);
302
+ }
297
303
  const terminalSessions = /* @__PURE__ */ new Map();
298
304
  let ptyModule = null;
299
305
  async function getPtyModule() {
@@ -439,7 +445,7 @@ async function registerMachineService(server, machineId, metadata, daemonState,
439
445
  * This consolidates all session RPCs through the machine service,
440
446
  * eliminating the need for per-session Hypha service registration.
441
447
  */
442
- sessionRPC: async (sessionId, method, args, context) => {
448
+ sessionRPC: async (sessionId, method, kwargs, context) => {
443
449
  authorizeRequest(context, currentMetadata.sharing, "view");
444
450
  const rpc = handlers.getSessionRPCHandlers?.(sessionId);
445
451
  if (!rpc) {
@@ -449,8 +455,11 @@ async function registerMachineService(server, machineId, metadata, daemonState,
449
455
  if (typeof handler !== "function") {
450
456
  throw new Error(`Unknown session method: ${method}`);
451
457
  }
452
- const argArray = Array.isArray(args) ? args : args !== void 0 ? [args] : [];
453
- return await handler(...argArray, context);
458
+ const paramNames = getParamNames(handler);
459
+ const callArgs = paramNames.map(
460
+ (name) => name === "context" ? context : kwargs?.[name] ?? void 0
461
+ );
462
+ return await handler(...callArgs);
454
463
  },
455
464
  /**
456
465
  * Register a listener for a specific session's real-time updates.
@@ -6794,6 +6803,10 @@ The automated loop has finished. Review the progress above and let me know if yo
6794
6803
  if (message.urgency === "urgent") {
6795
6804
  const formatted = formatInboxMessageXml(message);
6796
6805
  logger.log(`[Session ${sessionId}] Delivering urgent inbox message to agent`);
6806
+ sessionService.pushMessage(
6807
+ { role: "user", content: { type: "text", text: formatted } },
6808
+ "user"
6809
+ );
6797
6810
  if (!claudeProcess || claudeProcess.exitCode !== null) {
6798
6811
  spawnClaude(formatted);
6799
6812
  } else {
@@ -7218,6 +7231,10 @@ The automated loop has finished. Review the progress above and let me know if yo
7218
7231
  if (message.urgency === "urgent" && acpBackendReady) {
7219
7232
  const formatted = formatInboxMessageXml(message);
7220
7233
  logger.log(`[${agentName} Session ${sessionId}] Delivering urgent inbox message to agent`);
7234
+ sessionService.pushMessage(
7235
+ { role: "user", content: { type: "text", text: formatted } },
7236
+ "user"
7237
+ );
7221
7238
  sessionMetadata = { ...sessionMetadata, lifecycleState: "running" };
7222
7239
  sessionService.updateMetadata(sessionMetadata);
7223
7240
  sessionService.sendKeepAlive(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svamp-cli",
3
- "version": "0.1.81",
3
+ "version": "0.1.83",
4
4
  "description": "Svamp CLI — AI workspace daemon on Hypha Cloud",
5
5
  "author": "Amun AI AB",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -20,7 +20,7 @@
20
20
  "scripts": {
21
21
  "build": "rm -rf dist && tsc --noEmit && pkgroll",
22
22
  "typecheck": "tsc --noEmit",
23
- "test": "npx tsx test/test-authorize.mjs && npx tsx test/test-session-helpers.mjs && npx tsx test/test-cli-routing.mjs && npx tsx test/test-security-context.mjs && npx tsx test/test-ralph-loop.mjs && npx tsx test/test-message-helpers.mjs && npx tsx test/test-agent-config.mjs && npx tsx test/test-wrap-command.mjs && npx tsx test/test-credential-staging.mjs && npx tsx test/test-output-formatters.mjs && npx tsx test/test-agent-types.mjs && npx tsx test/test-transport.mjs && npx tsx test/test-session-update-handlers.mjs && npx tsx test/test-session-scanner.mjs && npx tsx test/test-hypha-client.mjs && npx tsx test/test-hook-settings.mjs && npx tsx test/test-session-service-logic.mjs && npx tsx test/test-daemon-persistence.mjs && npx tsx test/test-detect-isolation.mjs && npx tsx test/test-machine-service-logic.mjs && npx tsx test/test-interactive-helpers.mjs && npx tsx test/test-codex-backend.mjs && npx tsx test/test-acp-backend.mjs && npx tsx test/test-acp-bridge.mjs && npx tsx test/test-hook-server.mjs && npx tsx test/test-session-commands.mjs && npx tsx test/test-interactive-console.mjs && npx tsx test/test-session-messages.mjs && npx tsx test/test-skills.mjs && npx tsx test/test-agent-grouping.mjs && npx tsx test/test-ralph-loop-integration.mjs && npx tsx test/test-ralph-loop-modes.mjs && npx tsx test/test-machine-list-directory.mjs && npx tsx test/test-service-commands.mjs && npx tsx test/test-supervisor.mjs && npx tsx test/test-clear-detection.mjs && npx tsx test/test-session-consolidation.mjs && npx tsx test/test-inbox.mjs",
23
+ "test": "npx tsx test/test-authorize.mjs && npx tsx test/test-session-helpers.mjs && npx tsx test/test-cli-routing.mjs && npx tsx test/test-security-context.mjs && npx tsx test/test-ralph-loop.mjs && npx tsx test/test-message-helpers.mjs && npx tsx test/test-agent-config.mjs && npx tsx test/test-wrap-command.mjs && npx tsx test/test-credential-staging.mjs && npx tsx test/test-output-formatters.mjs && npx tsx test/test-agent-types.mjs && npx tsx test/test-transport.mjs && npx tsx test/test-session-update-handlers.mjs && npx tsx test/test-session-scanner.mjs && npx tsx test/test-hypha-client.mjs && npx tsx test/test-hook-settings.mjs && npx tsx test/test-session-service-logic.mjs && npx tsx test/test-daemon-persistence.mjs && npx tsx test/test-detect-isolation.mjs && npx tsx test/test-machine-service-logic.mjs && npx tsx test/test-interactive-helpers.mjs && npx tsx test/test-codex-backend.mjs && npx tsx test/test-acp-backend.mjs && npx tsx test/test-acp-bridge.mjs && npx tsx test/test-hook-server.mjs && npx tsx test/test-session-commands.mjs && npx tsx test/test-interactive-console.mjs && npx tsx test/test-session-messages.mjs && npx tsx test/test-skills.mjs && npx tsx test/test-agent-grouping.mjs && npx tsx test/test-ralph-loop-integration.mjs && npx tsx test/test-ralph-loop-modes.mjs && npx tsx test/test-machine-list-directory.mjs && npx tsx test/test-service-commands.mjs && npx tsx test/test-supervisor.mjs && npx tsx test/test-clear-detection.mjs && npx tsx test/test-session-consolidation.mjs && npx tsx test/test-inbox.mjs && npx tsx test/test-session-rpc-dispatch.mjs",
24
24
  "test:hypha": "node --no-warnings test/test-hypha-service.mjs",
25
25
  "dev": "tsx src/cli.ts",
26
26
  "dev:daemon": "tsx src/cli.ts daemon start-sync",