svamp-cli 0.1.82 → 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-BkDj4wWg.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-BkDj4wWg.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
@@ -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-D6pOaahW.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-B9nxDOIr.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}`);
@@ -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-BkDj4wWg.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-BkDj4wWg.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-BkDj4wWg.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-BkDj4wWg.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-DJQZraQK.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-DJQZraQK.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-DJQZraQK.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-DJQZraQK.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-DJQZraQK.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-DJQZraQK.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-DJQZraQK.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-DJQZraQK.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-BkDj4wWg.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-BkDj4wWg.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-BkDj4wWg.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-DJQZraQK.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-BkDj4wWg.mjs');
830
+ const { machineLs } = await import('./commands-BmJzcTEC.mjs');
831
831
  let machineId;
832
832
  let showHidden = false;
833
833
  let path;
@@ -1,6 +1,6 @@
1
1
  import { writeFileSync, readFileSync } from 'fs';
2
2
  import { resolve } from 'path';
3
- import { connectAndGetMachine } from './commands-BkDj4wWg.mjs';
3
+ import { connectAndGetMachine } from './commands-BmJzcTEC.mjs';
4
4
  import 'node:fs';
5
5
  import 'node:child_process';
6
6
  import 'node:path';
@@ -671,7 +671,7 @@ async function waitForIdle(machine, sessionId, timeoutMs) {
671
671
  const pollInterval = 2e3;
672
672
  const deadline = Date.now() + timeoutMs;
673
673
  while (Date.now() < deadline) {
674
- const activity = await machine.sessionRPC(sessionId, "getActivityState", []);
674
+ const activity = await machine.sessionRPC(sessionId, "getActivityState", {});
675
675
  if (activity?.pendingPermissions?.length > 0) {
676
676
  return { idle: false, pendingPermissions: activity.pendingPermissions };
677
677
  }
@@ -688,7 +688,7 @@ async function waitForBusyThenIdle(machine, sessionId, timeoutMs = 3e5, busyTime
688
688
  const busyDeadline = Date.now() + busyTimeoutMs;
689
689
  let sawBusy = false;
690
690
  while (Date.now() < deadline) {
691
- const activity = await machine.sessionRPC(sessionId, "getActivityState", []);
691
+ const activity = await machine.sessionRPC(sessionId, "getActivityState", {});
692
692
  if (activity?.pendingPermissions?.length > 0) {
693
693
  return { idle: false, pendingPermissions: activity.pendingPermissions };
694
694
  }
@@ -1325,7 +1325,7 @@ async function sessionSend(sessionId, message, machineId, opts) {
1325
1325
  subject: opts?.subject,
1326
1326
  urgency: opts?.urgency || "urgent"
1327
1327
  };
1328
- const result = await machine.sessionRPC(fullId, "sendInboxMessage", [inboxMessage]);
1328
+ const result = await machine.sessionRPC(fullId, "sendInboxMessage", { message: inboxMessage });
1329
1329
  let waitResult;
1330
1330
  if (opts?.wait) {
1331
1331
  const timeoutMs = (opts.timeout || 300) * 1e3;
@@ -1775,7 +1775,7 @@ async function sessionInboxSend(sessionIdPartial, body, machineId, opts) {
1775
1775
  replyTo: opts?.replyTo,
1776
1776
  threadId: opts?.threadId
1777
1777
  };
1778
- const result = await machine.sessionRPC(fullId, "sendInboxMessage", [message]);
1778
+ const result = await machine.sessionRPC(fullId, "sendInboxMessage", { message });
1779
1779
  if (opts?.json) {
1780
1780
  console.log(formatJson({ sessionId: fullId, messageId: result.messageId, sent: true }));
1781
1781
  } else {
@@ -1791,7 +1791,7 @@ async function sessionInboxList(sessionIdPartial, machineId, opts) {
1791
1791
  const sessions = await machine.listSessions();
1792
1792
  const match = resolveSessionId(sessions, sessionIdPartial);
1793
1793
  const fullId = match.sessionId;
1794
- 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 } });
1795
1795
  const messages = result.messages;
1796
1796
  if (opts?.json) {
1797
1797
  console.log(formatJson({ sessionId: fullId, messages }));
@@ -1826,14 +1826,14 @@ async function sessionInboxRead(sessionIdPartial, messageId, machineId) {
1826
1826
  const sessions = await machine.listSessions();
1827
1827
  const match = resolveSessionId(sessions, sessionIdPartial);
1828
1828
  const fullId = match.sessionId;
1829
- const result = await machine.sessionRPC(fullId, "getInbox", []);
1829
+ const result = await machine.sessionRPC(fullId, "getInbox", {});
1830
1830
  const msg = result.messages.find((m) => m.messageId === messageId || m.messageId.startsWith(messageId));
1831
1831
  if (!msg) {
1832
1832
  console.error(`Message ${messageId} not found in inbox.`);
1833
1833
  process.exit(1);
1834
1834
  }
1835
1835
  if (!msg.read) {
1836
- await machine.sessionRPC(fullId, "markInboxRead", [msg.messageId]);
1836
+ await machine.sessionRPC(fullId, "markInboxRead", { messageId: msg.messageId });
1837
1837
  }
1838
1838
  console.log(`From: ${msg.from || "(unknown)"}`);
1839
1839
  if (msg.subject) console.log(`Subject: ${msg.subject}`);
@@ -1853,7 +1853,7 @@ async function sessionInboxReply(sessionIdPartial, messageId, body, machineId) {
1853
1853
  const sessions = await machine.listSessions();
1854
1854
  const match = resolveSessionId(sessions, sessionIdPartial);
1855
1855
  const fullId = match.sessionId;
1856
- const result = await machine.sessionRPC(fullId, "getInbox", []);
1856
+ const result = await machine.sessionRPC(fullId, "getInbox", {});
1857
1857
  const original = result.messages.find((m) => m.messageId === messageId || m.messageId.startsWith(messageId));
1858
1858
  if (!original) {
1859
1859
  console.error(`Message ${messageId} not found in inbox.`);
@@ -1877,7 +1877,7 @@ async function sessionInboxReply(sessionIdPartial, messageId, body, machineId) {
1877
1877
  replyTo: original.messageId,
1878
1878
  threadId: original.threadId || original.messageId
1879
1879
  };
1880
- const sendResult = await machine.sessionRPC(original.fromSession, "sendInboxMessage", [reply]);
1880
+ const sendResult = await machine.sessionRPC(original.fromSession, "sendInboxMessage", { message: reply });
1881
1881
  console.log(`Reply sent to session ${original.fromSession.slice(0, 8)} (id: ${sendResult.messageId.slice(0, 8)})`);
1882
1882
  } finally {
1883
1883
  await server.disconnect();
@@ -1889,7 +1889,7 @@ async function sessionInboxClear(sessionIdPartial, machineId, opts) {
1889
1889
  const sessions = await machine.listSessions();
1890
1890
  const match = resolveSessionId(sessions, sessionIdPartial);
1891
1891
  const fullId = match.sessionId;
1892
- const result = await machine.sessionRPC(fullId, "clearInbox", [{ all: opts?.all }]);
1892
+ const result = await machine.sessionRPC(fullId, "clearInbox", { opts: { all: opts?.all } });
1893
1893
  console.log(`Cleared inbox on session ${fullId.slice(0, 8)} (${result.remaining} remaining)`);
1894
1894
  } finally {
1895
1895
  await server.disconnect();
@@ -1,5 +1,5 @@
1
1
  var name = "svamp-cli";
2
- var version = "0.1.82";
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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svamp-cli",
3
- "version": "0.1.82",
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",