svamp-cli 0.1.91 → 0.1.93

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-B6aL2aDs.mjs');
148
+ const { connectAndGetMachine } = await import('./commands-DylpeBgj.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-B6aL2aDs.mjs');
164
+ const { resolveSessionId } = await import('./commands-DylpeBgj.mjs');
165
165
  const sessions = await machine.listSessions();
166
166
  const match = resolveSessionId(sessions, targetSessionId);
167
167
  const fullTargetId = match.sessionId;
package/dist/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { b as stopDaemon, s as startDaemon, d as daemonStatus } from './run-D_CTA8Rm.mjs';
1
+ import { b as stopDaemon, s as startDaemon, d as daemonStatus } from './run-BlBz7vxv.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-DLLMNw6Y.mjs');
214
+ const { processCommand } = await import('./commands-D_NMjiUu.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-CtoHugXZ.mjs').catch(() => ({ default: { version: "unknown" } }));
232
+ const pkg = await import('./package-D0XFDYwt.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-yAB4c7Ng.mjs');
241
+ const { runInteractive } = await import('./run-DynqZlaK.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-D_CTA8Rm.mjs').then(function (n) { return n.i; });
286
+ const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-BlBz7vxv.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-D_CTA8Rm.mjs').then(function (n) { return n.i; });
298
+ const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-BlBz7vxv.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-D_CTA8Rm.mjs').then(function (n) { return n.j; });
322
+ const { CodexMcpBackend } = await import('./run-BlBz7vxv.mjs').then(function (n) { return n.j; });
323
323
  backend = new CodexMcpBackend({ cwd, log: logFn });
324
324
  } else {
325
- const { AcpBackend } = await import('./run-D_CTA8Rm.mjs').then(function (n) { return n.h; });
326
- const { GeminiTransport } = await import('./run-D_CTA8Rm.mjs').then(function (n) { return n.G; });
327
- const { DefaultTransport } = await import('./run-D_CTA8Rm.mjs').then(function (n) { return n.D; });
325
+ const { AcpBackend } = await import('./run-BlBz7vxv.mjs').then(function (n) { return n.h; });
326
+ const { GeminiTransport } = await import('./run-BlBz7vxv.mjs').then(function (n) { return n.G; });
327
+ const { DefaultTransport } = await import('./run-BlBz7vxv.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-B6aL2aDs.mjs');
445
+ const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-DylpeBgj.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-B6aL2aDs.mjs');
505
+ const { parseShareArg } = await import('./commands-DylpeBgj.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-B6aL2aDs.mjs');
591
+ const { sessionApprove } = await import('./commands-DylpeBgj.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-B6aL2aDs.mjs');
601
+ const { sessionDeny } = await import('./commands-DylpeBgj.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-GOEGZTZk.mjs');
637
+ const { sessionSetTitle } = await import('./agentCommands-CZSML2Yn.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-GOEGZTZk.mjs');
646
+ const { sessionSetLink } = await import('./agentCommands-CZSML2Yn.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-GOEGZTZk.mjs');
655
+ const { sessionNotify } = await import('./agentCommands-CZSML2Yn.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-GOEGZTZk.mjs');
663
+ const { sessionBroadcast } = await import('./agentCommands-CZSML2Yn.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-GOEGZTZk.mjs');
674
+ const { inboxSend } = await import('./agentCommands-CZSML2Yn.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-GOEGZTZk.mjs');
689
+ const { inboxList } = await import('./agentCommands-CZSML2Yn.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-GOEGZTZk.mjs');
711
+ const { inboxList } = await import('./agentCommands-CZSML2Yn.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-GOEGZTZk.mjs');
721
+ const { inboxReply } = await import('./agentCommands-CZSML2Yn.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-B6aL2aDs.mjs');
757
+ const { machineShare } = await import('./commands-DylpeBgj.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-B6aL2aDs.mjs');
787
+ const { machineExec } = await import('./commands-DylpeBgj.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-B6aL2aDs.mjs');
807
+ const { machineInfo } = await import('./commands-DylpeBgj.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-GOEGZTZk.mjs');
827
+ const { machineNotify } = await import('./agentCommands-CZSML2Yn.mjs');
828
828
  await machineNotify(message, level);
829
829
  } else if (machineSubcommand === "ls") {
830
- const { machineLs } = await import('./commands-B6aL2aDs.mjs');
830
+ const { machineLs } = await import('./commands-DylpeBgj.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-B6aL2aDs.mjs';
3
+ import { connectAndGetMachine } from './commands-DylpeBgj.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-D_CTA8Rm.mjs';
8
+ import './run-BlBz7vxv.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-D_CTA8Rm.mjs';
5
+ import { l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha } from './run-BlBz7vxv.mjs';
6
6
  import 'os';
7
7
  import 'fs/promises';
8
8
  import 'fs';
@@ -503,6 +503,13 @@ ${machines.length} machine(s) found.`);
503
503
  await server.disconnect();
504
504
  }
505
505
  }
506
+ function findSessionMatch(sessions, partial) {
507
+ const exact = sessions.find((s) => s.sessionId === partial);
508
+ if (exact) return exact;
509
+ const matches = sessions.filter((s) => s.sessionId.startsWith(partial));
510
+ if (matches.length === 1) return matches[0];
511
+ return void 0;
512
+ }
506
513
  function resolveSessionId(sessions, partial) {
507
514
  const exact = sessions.find((s) => s.sessionId === partial);
508
515
  if (exact) return exact;
@@ -1309,11 +1316,47 @@ async function sessionAttach(sessionId, machineId) {
1309
1316
  });
1310
1317
  }
1311
1318
  async function sessionSend(sessionId, message, machineId, opts) {
1312
- const { server, machine } = await connectAndGetMachine(machineId);
1319
+ let server;
1320
+ let machine;
1321
+ let fullId = "";
1322
+ const localConn = await connectAndGetMachine(machineId);
1323
+ server = localConn.server;
1324
+ machine = localConn.machine;
1325
+ const sessions = await machine.listSessions();
1326
+ const localMatch = findSessionMatch(sessions, sessionId);
1327
+ if (localMatch) {
1328
+ fullId = localMatch.sessionId;
1329
+ } else if (!machineId) {
1330
+ let found = false;
1331
+ try {
1332
+ const { server: allServer, machines } = await connectAndGetAllMachines();
1333
+ for (const m of machines) {
1334
+ try {
1335
+ const mSessions = await m.listSessions();
1336
+ const mMatch = findSessionMatch(mSessions, sessionId);
1337
+ if (mMatch) {
1338
+ await server.disconnect();
1339
+ server = allServer;
1340
+ machine = m;
1341
+ fullId = mMatch.sessionId;
1342
+ found = true;
1343
+ break;
1344
+ }
1345
+ } catch {
1346
+ }
1347
+ }
1348
+ if (!found) await allServer.disconnect();
1349
+ } catch {
1350
+ }
1351
+ if (!found) {
1352
+ resolveSessionId(sessions, sessionId);
1353
+ return;
1354
+ }
1355
+ } else {
1356
+ resolveSessionId(sessions, sessionId);
1357
+ return;
1358
+ }
1313
1359
  try {
1314
- const sessions = await machine.listSessions();
1315
- const match = resolveSessionId(sessions, sessionId);
1316
- const fullId = match.sessionId;
1317
1360
  const { randomUUID } = await import('node:crypto');
1318
1361
  const inboxMessage = {
1319
1362
  messageId: randomUUID(),
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-D_CTA8Rm.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-BlBz7vxv.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.91";
2
+ var version = "0.1.93";
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";
@@ -456,16 +456,8 @@ async function registerMachineService(server, machineId, metadata, daemonState,
456
456
  throw new Error(`Unknown session method: ${method}`);
457
457
  }
458
458
  const paramNames = getParamNames(handler);
459
- let effectiveKwargs = kwargs;
460
- if (Array.isArray(kwargs)) {
461
- effectiveKwargs = {};
462
- const nonContextParams = paramNames.filter((n) => n !== "context");
463
- for (let i = 0; i < nonContextParams.length && i < kwargs.length; i++) {
464
- effectiveKwargs[nonContextParams[i]] = kwargs[i];
465
- }
466
- }
467
459
  const callArgs = paramNames.map(
468
- (name) => name === "context" ? context : effectiveKwargs?.[name] ?? void 0
460
+ (name) => name === "context" ? context : kwargs?.[name] ?? void 0
469
461
  );
470
462
  return await handler(...callArgs);
471
463
  },
@@ -1700,6 +1692,13 @@ function createSessionStore(server, sessionId, initialMetadata, initialAgentStat
1700
1692
  sessionId
1701
1693
  });
1702
1694
  },
1695
+ markInboxRead: (messageId) => {
1696
+ const msg = inbox.find((m) => m.messageId === messageId);
1697
+ if (msg && !msg.read) {
1698
+ msg.read = true;
1699
+ syncInboxToMetadata();
1700
+ }
1701
+ },
1703
1702
  disconnect: async () => {
1704
1703
  const toRemove = [...listeners];
1705
1704
  for (const listener of toRemove) {
@@ -6833,25 +6832,10 @@ The automated loop has finished. Review the progress above and let me know if yo
6833
6832
  },
6834
6833
  onInboxMessage: (message) => {
6835
6834
  if (trackedSession?.stopped) return;
6836
- const isUrgent = message.urgency === "urgent";
6837
6835
  logger.log(`[Session ${sessionId}] Inbox message received (urgency: ${message.urgency || "normal"}, from: ${message.from || "unknown"})`);
6838
6836
  const formatted = formatInboxMessageXml(message);
6839
- const existingQueue = sessionMetadata.messageQueue || [];
6840
- const queueItem = { id: message.messageId, text: formatted, createdAt: Date.now() };
6841
- sessionMetadata = {
6842
- ...sessionMetadata,
6843
- messageQueue: [...existingQueue, queueItem]
6844
- };
6845
- sessionService.updateMetadata(sessionMetadata);
6846
- logger.log(`[Session ${sessionId}] Inbox message queued (queue length: ${existingQueue.length + 1})`);
6847
- if (isUrgent) {
6848
- const queue = sessionMetadata.messageQueue || [];
6849
- sessionMetadata = {
6850
- ...sessionMetadata,
6851
- messageQueue: queue.filter((q) => q.id !== message.messageId)
6852
- };
6853
- sessionService.updateMetadata(sessionMetadata);
6854
- sessionService.pushMessage(formatted, "user");
6837
+ sessionService.pushMessage(formatted, "user");
6838
+ if (message.urgency === "urgent") {
6855
6839
  logger.log(`[Session ${sessionId}] Delivering urgent inbox message to agent`);
6856
6840
  if (!claudeProcess || claudeProcess.exitCode !== null) {
6857
6841
  spawnClaude(formatted);
@@ -6864,10 +6848,6 @@ The automated loop has finished. Review the progress above and let me know if yo
6864
6848
  }
6865
6849
  signalProcessing(true);
6866
6850
  sessionWasProcessing = true;
6867
- } else {
6868
- if (!sessionWasProcessing) {
6869
- setTimeout(() => processMessageQueueRef?.(), 200);
6870
- }
6871
6851
  }
6872
6852
  },
6873
6853
  onMetadataUpdate: (newMeta) => {
@@ -7277,25 +7257,10 @@ The automated loop has finished. Review the progress above and let me know if yo
7277
7257
  },
7278
7258
  onInboxMessage: (message) => {
7279
7259
  if (acpStopped) return;
7280
- const isUrgent = message.urgency === "urgent";
7281
7260
  logger.log(`[${agentName} Session ${sessionId}] Inbox message received (urgency: ${message.urgency || "normal"}, from: ${message.from || "unknown"})`);
7282
7261
  const formatted = formatInboxMessageXml(message);
7283
- const existingQueue = sessionMetadata.messageQueue || [];
7284
- const queueItem = { id: message.messageId, text: formatted, createdAt: Date.now() };
7285
- sessionMetadata = {
7286
- ...sessionMetadata,
7287
- messageQueue: [...existingQueue, queueItem]
7288
- };
7289
- sessionService.updateMetadata(sessionMetadata);
7290
- logger.log(`[${agentName} Session ${sessionId}] Inbox message queued (queue length: ${existingQueue.length + 1})`);
7291
- if (isUrgent && acpBackendReady) {
7292
- const queue = sessionMetadata.messageQueue || [];
7293
- sessionMetadata = {
7294
- ...sessionMetadata,
7295
- messageQueue: queue.filter((q) => q.id !== message.messageId)
7296
- };
7297
- sessionService.updateMetadata(sessionMetadata);
7298
- sessionService.pushMessage(formatted, "user");
7262
+ sessionService.pushMessage(formatted, "user");
7263
+ if (message.urgency === "urgent" && acpBackendReady) {
7299
7264
  logger.log(`[${agentName} Session ${sessionId}] Delivering urgent inbox message to agent`);
7300
7265
  sessionMetadata = { ...sessionMetadata, lifecycleState: "running" };
7301
7266
  sessionService.updateMetadata(sessionMetadata);
@@ -7308,29 +7273,6 @@ The automated loop has finished. Review the progress above and let me know if yo
7308
7273
  sessionService.sendSessionEnd();
7309
7274
  }
7310
7275
  });
7311
- } else {
7312
- if (sessionMetadata.lifecycleState === "idle" && acpBackendReady) {
7313
- setTimeout(() => {
7314
- if (acpStopped) return;
7315
- const queue = sessionMetadata.messageQueue;
7316
- if (queue && queue.length > 0 && sessionMetadata.lifecycleState === "idle") {
7317
- const next = queue[0];
7318
- const remaining = queue.slice(1);
7319
- sessionMetadata = { ...sessionMetadata, messageQueue: remaining.length > 0 ? remaining : void 0, lifecycleState: "running" };
7320
- sessionService.updateMetadata(sessionMetadata);
7321
- sessionService.pushMessage(next.text, "user");
7322
- sessionService.sendKeepAlive(true);
7323
- agentBackend.sendPrompt(sessionId, next.text).catch((err) => {
7324
- logger.error(`[${agentName} Session ${sessionId}] Error processing queued inbox message: ${err.message}`);
7325
- if (!acpStopped) {
7326
- sessionMetadata = { ...sessionMetadata, lifecycleState: "idle" };
7327
- sessionService.updateMetadata(sessionMetadata);
7328
- sessionService.sendSessionEnd();
7329
- }
7330
- });
7331
- }
7332
- }, 200);
7333
- }
7334
7276
  }
7335
7277
  },
7336
7278
  onMetadataUpdate: (newMeta) => {
@@ -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-D_CTA8Rm.mjs';
5
+ import { c as connectToHypha, a as registerSessionService } from './run-BlBz7vxv.mjs';
6
6
  import { createServer } from 'node:http';
7
7
  import { spawn } from 'node:child_process';
8
8
  import { createInterface } from 'node:readline';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svamp-cli",
3
- "version": "0.1.91",
3
+ "version": "0.1.93",
4
4
  "description": "Svamp CLI — AI workspace daemon on Hypha Cloud",
5
5
  "author": "Amun AI AB",
6
6
  "license": "SEE LICENSE IN LICENSE",