svamp-cli 0.2.356 → 0.2.358

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.
Files changed (26) hide show
  1. package/dist/{agentCommands-D91RcjqQ.mjs → agentCommands-C_KvvYFp.mjs} +5 -5
  2. package/dist/{claudeAuth-C0wc1GTM.mjs → claudeAuth-DMDvPNhO.mjs} +11 -6
  3. package/dist/cli.mjs +136 -67
  4. package/dist/{commands-CoOc4qiw.mjs → commands-B19lVZjm.mjs} +10 -3
  5. package/dist/{commands-C13-yE2R.mjs → commands-Bmoy6Rlw.mjs} +5 -4
  6. package/dist/{commands-sPvRcG3J.mjs → commands-CFBKkfX8.mjs} +9 -9
  7. package/dist/{commands-B-yczgz_.mjs → commands-CcdoQIkb.mjs} +114 -17
  8. package/dist/{commands-BMeDrpSv.mjs → commands-DH_YQrAP.mjs} +5 -21
  9. package/dist/{commands-BbmypSgx.mjs → commands-DRxANaS5.mjs} +61 -18
  10. package/dist/{commands-BkdbelFo.mjs → commands-nkvTnUJj.mjs} +6 -5
  11. package/dist/friendlyName-B-OEwt0t.mjs +341 -0
  12. package/dist/{headlessCli-C8HzQvis.mjs → headlessCli-BpTXz6FD.mjs} +24 -16
  13. package/dist/{hookSettings-FFc1pi8j.mjs → hookSettings-CvvUhwCK.mjs} +122 -30
  14. package/dist/{friendlyName-1UZcyDhu.mjs → inboxGuard-CDqmIypF.mjs} +32 -347
  15. package/dist/index.mjs +7 -6
  16. package/dist/{loopVerify-DALtTk2V.mjs → loopVerify-CxAKJB5a.mjs} +1 -1
  17. package/dist/package-DTTWvJbp.mjs +64 -0
  18. package/dist/{rpc-ccY7xvlo.mjs → rpc-CAlAHQAy.mjs} +3 -1
  19. package/dist/{rpc-CBkSkzsI.mjs → rpc-CacreLQ8.mjs} +10 -6
  20. package/dist/{run-DCq3aEiF.mjs → run-Bc81iurl.mjs} +26 -7
  21. package/dist/{run-DDmeV9K3.mjs → run-DKOND4dO.mjs} +48 -30
  22. package/dist/{scheduler-BkVJ27Ki.mjs → scheduler-IyLWBF8T.mjs} +25 -7
  23. package/dist/{serveCommands-CLhkccJM.mjs → serveCommands-B-Ym_QXc.mjs} +8 -8
  24. package/dist/{store-B4E6NzG6.mjs → store-D8dok6_d.mjs} +53 -14
  25. package/package.json +3 -3
  26. package/dist/package-BrsiNutS.mjs +0 -64
package/dist/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { c as clearStopMarker, b as stopMarkerExists, s as startDaemon, a as stopDaemon, d as daemonStatus } from './run-DDmeV9K3.mjs';
1
+ import { c as clearStopMarker, b as stopMarkerExists, s as startDaemon, a as stopDaemon, d as daemonStatus } from './run-DKOND4dO.mjs';
2
2
  import { ensureSupervisorViaServiceManager, LAUNCHD_LABEL } from './serviceManager-hlOVxkhW.mjs';
3
3
  import { f as flushStdout, a as flushAndExit } from './flushExit-C-i6SGjj.mjs';
4
4
  import { w as wantsHelp } from './wantsHelp-6bMOeNUz.mjs';
@@ -9,7 +9,7 @@ import 'path';
9
9
  import 'url';
10
10
  import 'child_process';
11
11
  import 'crypto';
12
- import './hookSettings-FFc1pi8j.mjs';
12
+ import './hookSettings-CvvUhwCK.mjs';
13
13
  import 'node:crypto';
14
14
  import './types-57J3Re0n.mjs';
15
15
  import './securityContext-Cm5UTCuD.mjs';
@@ -25,12 +25,13 @@ import './serveAuth-4M0vwMyj.mjs';
25
25
  import 'node:os';
26
26
  import 'node:path';
27
27
  import './envFlag-COOuJ3AH.mjs';
28
- import './claudeAuth-C0wc1GTM.mjs';
28
+ import './claudeAuth-DMDvPNhO.mjs';
29
29
  import './fileLock-BMPwCrB6.mjs';
30
30
  import './codexProvider-BtxYc5Rj.mjs';
31
- import './friendlyName-1UZcyDhu.mjs';
31
+ import './inboxGuard-CDqmIypF.mjs';
32
32
  import 'node:events';
33
33
  import './cron-hHGdb5kU.mjs';
34
+ import './friendlyName-B-OEwt0t.mjs';
34
35
  import './hyphaClient-ybivOjZo.mjs';
35
36
  import './sharingNotificationSync-qGIQ-3yf.mjs';
36
37
  import './acpBackend-UaBD4zL3.mjs';
@@ -50,8 +51,8 @@ import './detectIsolation-CrV8IFDv.mjs';
50
51
  import 'node:fs/promises';
51
52
  import './pinnedNono-5ZHb6328.mjs';
52
53
  import './bootStatus-DqtNgJch.mjs';
53
- import './loopVerify-DALtTk2V.mjs';
54
- import './store-B4E6NzG6.mjs';
54
+ import './loopVerify-CxAKJB5a.mjs';
55
+ import './store-D8dok6_d.mjs';
55
56
  import './api-BHjyC0Ph.mjs';
56
57
  import './store-fi0f-ff1.mjs';
57
58
  import 'yaml';
@@ -89,7 +90,7 @@ async function main() {
89
90
  }
90
91
  const whenIdle = args.includes("--when-idle");
91
92
  const force = args.includes("--force");
92
- const mod = await import('./run-DDmeV9K3.mjs').then(function (n) { return n.h; });
93
+ const mod = await import('./run-DKOND4dO.mjs').then(function (n) { return n.i; });
93
94
  if (whenIdle && !force) {
94
95
  if (mod.isDaemonAlive()) {
95
96
  mod.writePendingRestart({ reason: "svamp daemon restart --when-idle" });
@@ -255,7 +256,7 @@ async function main() {
255
256
  releaseSupervisorLock,
256
257
  findOrphanedSyncPids,
257
258
  killOrphanedSyncs
258
- } = await import('./run-DDmeV9K3.mjs').then(function (n) { return n.f; });
259
+ } = await import('./run-DKOND4dO.mjs').then(function (n) { return n.h; });
259
260
  const supervisorPidFile = pathJoin(svampHome, "supervisor.pid");
260
261
  const lock = acquireSupervisorLockWithRetry(supervisorPidFile, process.pid);
261
262
  if (!lock.acquired) {
@@ -473,7 +474,7 @@ async function main() {
473
474
  await flushStdout();
474
475
  process.exit(1);
475
476
  }
476
- const { handleServiceCommand } = await import('./commands-sPvRcG3J.mjs');
477
+ const { handleServiceCommand } = await import('./commands-CFBKkfX8.mjs');
477
478
  await handleServiceCommand();
478
479
  } else if (subcommand === "serve") {
479
480
  const { isSandboxed: isSandboxedServe } = await import('./sandboxDetect-Cdzsj5TC.mjs');
@@ -482,7 +483,7 @@ async function main() {
482
483
  await flushStdout();
483
484
  process.exit(1);
484
485
  }
485
- const { handleServeCommand } = await import('./serveCommands-CLhkccJM.mjs');
486
+ const { handleServeCommand } = await import('./serveCommands-B-Ym_QXc.mjs');
486
487
  await handleServeCommand();
487
488
  await flushStdout();
488
489
  process.exit(0);
@@ -493,7 +494,7 @@ async function main() {
493
494
  await flushStdout();
494
495
  process.exit(1);
495
496
  }
496
- const { processCommand } = await import('./commands-BMeDrpSv.mjs');
497
+ const { processCommand } = await import('./commands-DH_YQrAP.mjs');
497
498
  let machineId;
498
499
  const processArgs = args.slice(1);
499
500
  const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
@@ -508,16 +509,16 @@ async function main() {
508
509
  await flushStdout();
509
510
  process.exit(0);
510
511
  } else if (subcommand === "outpost") {
511
- const { outpostCommand } = await import('./commands-C13-yE2R.mjs');
512
+ const { outpostCommand } = await import('./commands-Bmoy6Rlw.mjs');
512
513
  await outpostCommand(args.slice(1));
513
514
  await flushStdout();
514
515
  process.exit(0);
515
516
  } else if (subcommand === "issue" || subcommand === "issues") {
516
- const { issueCommand } = await import('./commands-BbmypSgx.mjs');
517
+ const { issueCommand } = await import('./commands-DRxANaS5.mjs');
517
518
  await issueCommand(args.slice(1));
518
519
  await flushAndExit(0);
519
520
  } else if (subcommand === "workflow" || subcommand === "workflows") {
520
- const { workflowCommand } = await import('./commands-CoOc4qiw.mjs');
521
+ const { workflowCommand } = await import('./commands-B19lVZjm.mjs');
521
522
  await workflowCommand(args.slice(1));
522
523
  await flushAndExit(0);
523
524
  } else if (subcommand === "wise-agent" || subcommand === "wise") {
@@ -525,7 +526,7 @@ async function main() {
525
526
  await flushStdout();
526
527
  process.exit(0);
527
528
  } else if (subcommand === "feature" || subcommand === "crew") {
528
- const { crewCommand } = await import('./commands-BkdbelFo.mjs');
529
+ const { crewCommand } = await import('./commands-nkvTnUJj.mjs');
529
530
  await crewCommand(args.slice(1));
530
531
  await flushStdout();
531
532
  process.exit(0);
@@ -592,7 +593,7 @@ async function main() {
592
593
  } else if (!subcommand || subcommand === "start") {
593
594
  await handleInteractiveCommand();
594
595
  } else if (subcommand === "--version" || subcommand === "-v") {
595
- const pkg = await import('./package-BrsiNutS.mjs').catch(() => ({ default: { version: "unknown" } }));
596
+ const pkg = await import('./package-DTTWvJbp.mjs').catch(() => ({ default: { version: "unknown" } }));
596
597
  console.log(`svamp version: ${pkg.default.version}`);
597
598
  } else {
598
599
  console.error(`Unknown command: ${subcommand}`);
@@ -602,7 +603,7 @@ async function main() {
602
603
  }
603
604
  }
604
605
  async function handleInteractiveCommand() {
605
- const { runInteractive } = await import('./run-DCq3aEiF.mjs');
606
+ const { runInteractive } = await import('./run-Bc81iurl.mjs');
606
607
  const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
607
608
  let directory = process.cwd();
608
609
  let resumeSessionId;
@@ -657,15 +658,19 @@ async function handleAgentCommand() {
657
658
  }
658
659
  console.log('\nUse "svamp agent <name>" to start an interactive session.');
659
660
  console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
661
+ console.log("Tool calls are prompted on a terminal; add --auto-approve (-y) to allow them unattended.");
660
662
  return;
661
663
  }
662
664
  const { resolveAcpAgentConfig, KNOWN_CODEX_AGENTS } = await import('./acpAgentConfig-CObOPlA8.mjs');
663
665
  let cwd = process.cwd();
666
+ let autoApprove = false;
664
667
  const filteredArgs = [];
665
668
  for (let i = 0; i < agentArgs.length; i++) {
666
669
  if ((agentArgs[i] === "-d" || agentArgs[i] === "--directory") && i + 1 < agentArgs.length) {
667
670
  cwd = agentArgs[i + 1];
668
671
  i++;
672
+ } else if (agentArgs[i] === "--auto-approve" || agentArgs[i] === "--yes" || agentArgs[i] === "-y") {
673
+ autoApprove = true;
669
674
  } else {
670
675
  filteredArgs.push(agentArgs[i]);
671
676
  }
@@ -682,6 +687,48 @@ async function handleAgentCommand() {
682
687
  if (process.env.DEBUG) console.error("[debug]", ...logArgs);
683
688
  };
684
689
  console.log(`Starting ${config.agentName} agent in ${cwd}...`);
690
+ let replRl = null;
691
+ const stdinIsTty = Boolean(process.stdin.isTTY);
692
+ let approveAllForSession = autoApprove;
693
+ const permissionHandler = {
694
+ async handleToolCall(_toolCallId, toolName, input) {
695
+ if (approveAllForSession) {
696
+ return { decision: "approved" };
697
+ }
698
+ if (!stdinIsTty || !replRl) {
699
+ console.error(
700
+ `
701
+ [permission] DENIED ${toolName}: no terminal to ask on. Re-run with --auto-approve to allow tool calls unattended, or use \`svamp session spawn ${config.agentName}\` for a managed session.`
702
+ );
703
+ return { decision: "denied" };
704
+ }
705
+ const preview = (() => {
706
+ try {
707
+ const j = JSON.stringify(input);
708
+ return j && j.length > 200 ? j.slice(0, 200) + "\u2026" : j || "";
709
+ } catch {
710
+ return "";
711
+ }
712
+ })();
713
+ const answer = await new Promise((resolve) => {
714
+ replRl.question(
715
+ `
716
+ [permission] ${toolName} ${preview}
717
+ allow? [y]es / [n]o / [a]ll for this session: `,
718
+ (a) => resolve(String(a || "").trim().toLowerCase())
719
+ );
720
+ });
721
+ if (answer === "a" || answer === "all") {
722
+ approveAllForSession = true;
723
+ return { decision: "approved_for_session" };
724
+ }
725
+ if (answer === "y" || answer === "yes") return { decision: "approved" };
726
+ return { decision: "denied" };
727
+ }
728
+ };
729
+ console.log(
730
+ autoApprove ? "Tool calls: AUTO-APPROVED (--auto-approve)." : stdinIsTty ? "Tool calls: you will be asked to approve each one (y / n / a)." : "Tool calls: DENIED \u2014 stdin is not a terminal. Re-run with --auto-approve to allow them."
731
+ );
685
732
  let backend;
686
733
  if (KNOWN_CODEX_AGENTS[config.agentName]) {
687
734
  const { CodexAppServerBackend } = await import('./codexAppServerBackend-VGsYtbqg.mjs').then(function (n) { return n.a; });
@@ -706,7 +753,9 @@ async function handleAgentCommand() {
706
753
  args: config.args,
707
754
  transportHandler,
708
755
  env: acpEnv,
709
- log: logFn
756
+ log: logFn,
757
+ permissionHandler
758
+ // #1715 — without one, AcpBackend cancels every tool call (#1630)
710
759
  });
711
760
  }
712
761
  let currentText = "";
@@ -772,6 +821,7 @@ Agent stopped: ${msg.detail || ""}`);
772
821
  output: process.stdout,
773
822
  terminal: false
774
823
  });
824
+ replRl = rl;
775
825
  rl.on("line", async (line) => {
776
826
  const trimmed = line.trim();
777
827
  if (!trimmed) return;
@@ -829,7 +879,7 @@ async function handleSessionCommand() {
829
879
  process.exit(1);
830
880
  }
831
881
  }
832
- const { sessionList, sessionWhoami, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionLoopStart, sessionLoopCancel, sessionLoopStatus, sessionLoopExtend, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-B-yczgz_.mjs');
882
+ const { sessionList, sessionWhoami, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionLoopStart, sessionLoopCancel, sessionLoopStatus, sessionLoopExtend, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, replyPositionals, sendPositionals, sessionInboxClear } = await import('./commands-CcdoQIkb.mjs').then(function (n) { return n.d; });
833
883
  const parseFlagStr = (flag, shortFlag) => {
834
884
  for (let i = 1; i < sessionArgs.length; i++) {
835
885
  if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
@@ -845,6 +895,16 @@ async function handleSessionCommand() {
845
895
  return isNaN(n) ? void 0 : n;
846
896
  };
847
897
  const hasFlag = (flag) => sessionArgs.includes(flag);
898
+ const { parseUrgencyValue } = await import('./inboxGuard-CDqmIypF.mjs');
899
+ const urgencyFlag = async () => {
900
+ const parsed = parseUrgencyValue(parseFlagStr("--urgency"), { present: hasFlag("--urgency") });
901
+ if (!parsed.ok) {
902
+ console.error(parsed.message);
903
+ await flushStdout();
904
+ process.exit(1);
905
+ }
906
+ return parsed.value;
907
+ };
848
908
  if (sessionSubcommand === "machines" || sessionSubcommand === "machine") {
849
909
  await sessionMachines();
850
910
  } else if (sessionSubcommand === "list" || sessionSubcommand === "ls") {
@@ -902,7 +962,7 @@ async function handleSessionCommand() {
902
962
  const warning = describeUnenforceable("nono", { filesystem: { denyRead } });
903
963
  if (warning) console.warn(`Warning: ${warning}`);
904
964
  }
905
- const { parseShareArg } = await import('./commands-B-yczgz_.mjs');
965
+ const { parseShareArg } = await import('./commands-CcdoQIkb.mjs').then(function (n) { return n.d; });
906
966
  const shareEntries = share.map((s) => parseShareArg(s));
907
967
  await sessionSpawn(agent, dir, targetMachineId, {
908
968
  message,
@@ -971,7 +1031,8 @@ async function handleSessionCommand() {
971
1031
  }
972
1032
  await sessionAttach(sessionArgs[1], targetMachineId);
973
1033
  } else if (sessionSubcommand === "send") {
974
- if (!sessionArgs[1] || !sessionArgs[2]) {
1034
+ const sendPos = sendPositionals(sessionArgs.slice(1));
1035
+ if (!sendPos[0] || !sendPos[1]) {
975
1036
  console.error('Usage: svamp session send <session-id> <message> [--model <id>] [--plain] [--subject "..."] [--when-idle] [--urgency urgent|normal] [--wait] [--response] [--btw] [--require-approval] [--as-issue [--issue-title "..."]] [--timeout N] [--json]');
976
1037
  console.error(" --when-idle Deferred delivery: park the message and let the recipient handle it on its next idle turn (default is urgent \u2014 wakes immediately).");
977
1038
  console.error(" --model <id> Switch the session model (e.g. claude-opus-4-7, claude-sonnet-4-6) before delivering the message \u2014 forces a respawn.");
@@ -979,7 +1040,7 @@ async function handleSessionCommand() {
979
1040
  await flushStdout();
980
1041
  process.exit(1);
981
1042
  }
982
- await sessionSend(sessionArgs[1], sessionArgs[2], targetMachineId, {
1043
+ await sessionSend(sendPos[0], sendPos[1], targetMachineId, {
983
1044
  wait: hasFlag("--wait"),
984
1045
  response: hasFlag("--response"),
985
1046
  btw: hasFlag("--btw"),
@@ -988,7 +1049,7 @@ async function handleSessionCommand() {
988
1049
  json: hasFlag("--json"),
989
1050
  subject: parseFlagStr("--subject"),
990
1051
  whenIdle: hasFlag("--when-idle"),
991
- urgency: parseFlagStr("--urgency"),
1052
+ urgency: await urgencyFlag(),
992
1053
  model: parseFlagStr("--model"),
993
1054
  plain: hasFlag("--plain"),
994
1055
  asIssue: hasFlag("--as-issue"),
@@ -1001,7 +1062,7 @@ async function handleSessionCommand() {
1001
1062
  await flushStdout();
1002
1063
  process.exit(1);
1003
1064
  }
1004
- const { sessionEditMessage } = await import('./commands-B-yczgz_.mjs');
1065
+ const { sessionEditMessage } = await import('./commands-CcdoQIkb.mjs').then(function (n) { return n.d; });
1005
1066
  await sessionEditMessage(sessionArgs[1], sessionArgs[2], sessionArgs[3], targetMachineId);
1006
1067
  } else if (sessionSubcommand === "refine") {
1007
1068
  if (!sessionArgs[1] || !sessionArgs[2]) {
@@ -1010,7 +1071,7 @@ async function handleSessionCommand() {
1010
1071
  await flushStdout();
1011
1072
  process.exit(1);
1012
1073
  }
1013
- const { sessionRefineLastReply } = await import('./commands-B-yczgz_.mjs');
1074
+ const { sessionRefineLastReply } = await import('./commands-CcdoQIkb.mjs').then(function (n) { return n.d; });
1014
1075
  await sessionRefineLastReply(sessionArgs[1], sessionArgs[2], targetMachineId);
1015
1076
  } else if (sessionSubcommand === "undo-edit" || sessionSubcommand === "undo") {
1016
1077
  if (!sessionArgs[1]) {
@@ -1019,7 +1080,7 @@ async function handleSessionCommand() {
1019
1080
  await flushStdout();
1020
1081
  process.exit(1);
1021
1082
  }
1022
- const { sessionUndoEdit } = await import('./commands-B-yczgz_.mjs');
1083
+ const { sessionUndoEdit } = await import('./commands-CcdoQIkb.mjs').then(function (n) { return n.d; });
1023
1084
  await sessionUndoEdit(sessionArgs[1], targetMachineId);
1024
1085
  } else if (sessionSubcommand === "query") {
1025
1086
  const dir = sessionArgs[1];
@@ -1030,7 +1091,7 @@ async function handleSessionCommand() {
1030
1091
  await flushStdout();
1031
1092
  process.exit(1);
1032
1093
  }
1033
- const { sessionQuery } = await import('./commands-B-yczgz_.mjs');
1094
+ const { sessionQuery } = await import('./commands-CcdoQIkb.mjs').then(function (n) { return n.d; });
1034
1095
  await sessionQuery(dir, prompt, targetMachineId, {
1035
1096
  timeout: parseFlagInt("--timeout"),
1036
1097
  json: hasFlag("--json"),
@@ -1066,7 +1127,7 @@ async function handleSessionCommand() {
1066
1127
  await flushStdout();
1067
1128
  process.exit(1);
1068
1129
  }
1069
- const { sessionApprove } = await import('./commands-B-yczgz_.mjs');
1130
+ const { sessionApprove } = await import('./commands-CcdoQIkb.mjs').then(function (n) { return n.d; });
1070
1131
  const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
1071
1132
  await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
1072
1133
  json: hasFlag("--json")
@@ -1077,7 +1138,7 @@ async function handleSessionCommand() {
1077
1138
  await flushStdout();
1078
1139
  process.exit(1);
1079
1140
  }
1080
- const { sessionDeny } = await import('./commands-B-yczgz_.mjs');
1141
+ const { sessionDeny } = await import('./commands-CcdoQIkb.mjs').then(function (n) { return n.d; });
1081
1142
  const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
1082
1143
  await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
1083
1144
  json: hasFlag("--json")
@@ -1134,7 +1195,7 @@ async function handleSessionCommand() {
1134
1195
  await flushStdout();
1135
1196
  process.exit(1);
1136
1197
  }
1137
- const { sessionSetTitle } = await import('./agentCommands-D91RcjqQ.mjs');
1198
+ const { sessionSetTitle } = await import('./agentCommands-C_KvvYFp.mjs');
1138
1199
  await sessionSetTitle(title);
1139
1200
  } else if (sessionSubcommand === "set-project-description" || sessionSubcommand === "set-project") {
1140
1201
  const desc = sessionArgs.slice(1).filter((a) => !a.startsWith("--")).join(" ");
@@ -1143,7 +1204,7 @@ async function handleSessionCommand() {
1143
1204
  await flushStdout();
1144
1205
  process.exit(1);
1145
1206
  }
1146
- const { sessionSetProjectDescription } = await import('./agentCommands-D91RcjqQ.mjs');
1207
+ const { sessionSetProjectDescription } = await import('./agentCommands-C_KvvYFp.mjs');
1147
1208
  await sessionSetProjectDescription(desc);
1148
1209
  } else if (sessionSubcommand === "set-link") {
1149
1210
  const url = sessionArgs[1];
@@ -1153,11 +1214,11 @@ async function handleSessionCommand() {
1153
1214
  process.exit(1);
1154
1215
  }
1155
1216
  const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
1156
- const { sessionSetLink } = await import('./agentCommands-D91RcjqQ.mjs');
1217
+ const { sessionSetLink } = await import('./agentCommands-C_KvvYFp.mjs');
1157
1218
  await sessionSetLink(url, label);
1158
1219
  } else if (sessionSubcommand === "link") {
1159
1220
  const op = sessionArgs[1];
1160
- const lm = await import('./agentCommands-D91RcjqQ.mjs');
1221
+ const lm = await import('./agentCommands-C_KvvYFp.mjs');
1161
1222
  if (op === "add") {
1162
1223
  const url = sessionArgs[2];
1163
1224
  if (!url || url.startsWith("--")) {
@@ -1194,7 +1255,7 @@ async function handleSessionCommand() {
1194
1255
  process.exit(1);
1195
1256
  }
1196
1257
  const level = parseFlagStr("--level") || "info";
1197
- const { sessionNotify } = await import('./agentCommands-D91RcjqQ.mjs');
1258
+ const { sessionNotify } = await import('./agentCommands-C_KvvYFp.mjs');
1198
1259
  await sessionNotify(message, level);
1199
1260
  } else if (sessionSubcommand === "broadcast") {
1200
1261
  const action = sessionArgs[1];
@@ -1203,7 +1264,7 @@ async function handleSessionCommand() {
1203
1264
  await flushStdout();
1204
1265
  process.exit(1);
1205
1266
  }
1206
- const { sessionBroadcast } = await import('./agentCommands-D91RcjqQ.mjs');
1267
+ const { sessionBroadcast } = await import('./agentCommands-C_KvvYFp.mjs');
1207
1268
  await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
1208
1269
  } else if (sessionSubcommand === "inbox") {
1209
1270
  const inboxSubcmd = sessionArgs[1];
@@ -1215,24 +1276,24 @@ async function handleSessionCommand() {
1215
1276
  process.exit(1);
1216
1277
  }
1217
1278
  if (agentSessionId) {
1218
- const { inboxSend } = await import('./agentCommands-D91RcjqQ.mjs');
1279
+ const { inboxSend } = await import('./agentCommands-C_KvvYFp.mjs');
1219
1280
  await inboxSend(sessionArgs[2], {
1220
1281
  body: sessionArgs[3],
1221
1282
  subject: parseFlagStr("--subject"),
1222
- urgency: parseFlagStr("--urgency"),
1283
+ urgency: await urgencyFlag(),
1223
1284
  whenIdle: hasFlag("--when-idle")
1224
1285
  });
1225
1286
  } else {
1226
1287
  await sessionInboxSend(sessionArgs[2], sessionArgs[3], targetMachineId, {
1227
1288
  subject: parseFlagStr("--subject"),
1228
- urgency: parseFlagStr("--urgency"),
1289
+ urgency: await urgencyFlag(),
1229
1290
  whenIdle: hasFlag("--when-idle"),
1230
1291
  json: hasFlag("--json")
1231
1292
  });
1232
1293
  }
1233
1294
  } else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
1234
1295
  if (agentSessionId && !sessionArgs[2]) {
1235
- const { inboxList } = await import('./agentCommands-D91RcjqQ.mjs');
1296
+ const { inboxList } = await import('./agentCommands-C_KvvYFp.mjs');
1236
1297
  await inboxList({
1237
1298
  unread: hasFlag("--unread"),
1238
1299
  limit: parseFlagInt("--limit"),
@@ -1256,7 +1317,7 @@ async function handleSessionCommand() {
1256
1317
  process.exit(1);
1257
1318
  }
1258
1319
  if (agentSessionId && !sessionArgs[3]) {
1259
- const { inboxList } = await import('./agentCommands-D91RcjqQ.mjs');
1320
+ const { inboxList } = await import('./agentCommands-C_KvvYFp.mjs');
1260
1321
  await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
1261
1322
  } else if (sessionArgs[3]) {
1262
1323
  await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
@@ -1266,13 +1327,15 @@ async function handleSessionCommand() {
1266
1327
  process.exit(1);
1267
1328
  }
1268
1329
  } else if (inboxSubcmd === "reply") {
1269
- if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
1270
- const { inboxReply } = await import('./agentCommands-D91RcjqQ.mjs');
1271
- await inboxReply(sessionArgs[2], sessionArgs[3]);
1272
- } else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
1273
- await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
1330
+ const pos = replyPositionals(sessionArgs.slice(2));
1331
+ const replyOpts = { urgency: await urgencyFlag(), whenIdle: hasFlag("--when-idle") };
1332
+ if (agentSessionId && pos[0] && pos[1] && !pos[2]) {
1333
+ const { inboxReply } = await import('./agentCommands-C_KvvYFp.mjs');
1334
+ await inboxReply(pos[0], pos[1], replyOpts);
1335
+ } else if (pos[0] && pos[1] && pos[2]) {
1336
+ await sessionInboxReply(pos[0], pos[1], pos[2], targetMachineId, replyOpts);
1274
1337
  } else {
1275
- console.error('Usage: svamp session inbox reply <session-id> <message-id> "<body>"');
1338
+ console.error('Usage: svamp session inbox reply <session-id> <message-id> "<body>" [--urgency urgent|normal] [--when-idle]');
1276
1339
  await flushStdout();
1277
1340
  process.exit(1);
1278
1341
  }
@@ -1310,7 +1373,7 @@ async function handleMachineCommand() {
1310
1373
  return;
1311
1374
  }
1312
1375
  if (machineSubcommand === "share") {
1313
- const { machineShare } = await import('./commands-B-yczgz_.mjs');
1376
+ const { machineShare } = await import('./commands-CcdoQIkb.mjs').then(function (n) { return n.d; });
1314
1377
  let machineId;
1315
1378
  const shareArgs = [];
1316
1379
  for (let i = 1; i < machineArgs.length; i++) {
@@ -1365,11 +1428,11 @@ async function handleMachineCommand() {
1365
1428
  const { fleetExec } = await import('./fleet-Ca-UjJNL.mjs');
1366
1429
  await fleetExec(command, { cwd });
1367
1430
  } else {
1368
- const { machineExec } = await import('./commands-B-yczgz_.mjs');
1431
+ const { machineExec } = await import('./commands-CcdoQIkb.mjs').then(function (n) { return n.d; });
1369
1432
  await machineExec(machineId, command, cwd);
1370
1433
  }
1371
1434
  } else if (machineSubcommand === "info") {
1372
- const { machineInfo } = await import('./commands-B-yczgz_.mjs');
1435
+ const { machineInfo } = await import('./commands-CcdoQIkb.mjs').then(function (n) { return n.d; });
1373
1436
  let machineId;
1374
1437
  for (let i = 1; i < machineArgs.length; i++) {
1375
1438
  if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
@@ -1401,10 +1464,10 @@ async function handleMachineCommand() {
1401
1464
  await flushStdout();
1402
1465
  process.exit(1);
1403
1466
  }
1404
- const { machineNotify } = await import('./agentCommands-D91RcjqQ.mjs');
1467
+ const { machineNotify } = await import('./agentCommands-C_KvvYFp.mjs');
1405
1468
  await machineNotify(message, level);
1406
1469
  } else if (machineSubcommand === "ls") {
1407
- const { machineLs } = await import('./commands-B-yczgz_.mjs');
1470
+ const { machineLs } = await import('./commands-CcdoQIkb.mjs').then(function (n) { return n.d; });
1408
1471
  let machineId;
1409
1472
  let showHidden = false;
1410
1473
  let path;
@@ -2082,7 +2145,7 @@ async function applyClaudeAuthFlags(argv) {
2082
2145
  "--use-hypha-proxy, --use-claude-login, and --anthropic-base-url/--anthropic-api-key are mutually exclusive"
2083
2146
  );
2084
2147
  }
2085
- const mod = await import('./claudeAuth-C0wc1GTM.mjs');
2148
+ const mod = await import('./claudeAuth-DMDvPNhO.mjs');
2086
2149
  if (hasHypha) {
2087
2150
  let url;
2088
2151
  const hyphaIdx = argv.indexOf("--use-hypha-proxy");
@@ -2136,7 +2199,7 @@ async function applyDaemonShareFlag(argv) {
2136
2199
  }
2137
2200
  }
2138
2201
  if (collected.length === 0) return;
2139
- const { updateEnvFile } = await import('./claudeAuth-C0wc1GTM.mjs');
2202
+ const { updateEnvFile } = await import('./claudeAuth-DMDvPNhO.mjs');
2140
2203
  const seen = /* @__PURE__ */ new Set();
2141
2204
  const deduped = collected.filter((e) => {
2142
2205
  const k = e.toLowerCase();
@@ -2169,7 +2232,7 @@ async function handleWiseAgentCommand(rest) {
2169
2232
  }
2170
2233
  });
2171
2234
  const message = rest.slice(1).map((a, idx) => ({ a, idx: idx + 1 })).filter(({ a, idx }) => !a.startsWith("-") && !consumed.has(String(idx))).map(({ a }) => a).join(" ");
2172
- const { wiseAskCli } = await import('./commands-B-yczgz_.mjs');
2235
+ const { wiseAskCli } = await import('./commands-CcdoQIkb.mjs').then(function (n) { return n.d; });
2173
2236
  await wiseAskCli(machineId, message, sessionId, { json });
2174
2237
  return;
2175
2238
  }
@@ -2181,7 +2244,7 @@ async function handleWiseAgentCommand(rest) {
2181
2244
  }
2182
2245
  return void 0;
2183
2246
  };
2184
- const { runWiseVoiceCli } = await import('./headlessCli-C8HzQvis.mjs');
2247
+ const { runWiseVoiceCli } = await import('./headlessCli-BpTXz6FD.mjs');
2185
2248
  await runWiseVoiceCli({ voice: valueOf(["--voice"]), wakeKeywordPath: valueOf(["--wake"]), model: valueOf(["--model"]) });
2186
2249
  return;
2187
2250
  }
@@ -2199,7 +2262,7 @@ async function handleWiseAgentCommand(rest) {
2199
2262
  const mode = valueOf(["--mode"]);
2200
2263
  const mission = valueOf(["--mission"]);
2201
2264
  const url = rest.slice(1).find((a) => /^https?:\/\//.test(a)) || "";
2202
- const { wiseJoinMeetingCli } = await import('./commands-B-yczgz_.mjs');
2265
+ const { wiseJoinMeetingCli } = await import('./commands-CcdoQIkb.mjs').then(function (n) { return n.d; });
2203
2266
  await wiseJoinMeetingCli(machineId, url, sessionId, { json, mode, mission });
2204
2267
  return;
2205
2268
  }
@@ -2211,7 +2274,7 @@ async function handleWiseAgentCommand(rest) {
2211
2274
  }
2212
2275
  return void 0;
2213
2276
  };
2214
- const { wiseLeaveMeetingCli } = await import('./commands-B-yczgz_.mjs');
2277
+ const { wiseLeaveMeetingCli } = await import('./commands-CcdoQIkb.mjs').then(function (n) { return n.d; });
2215
2278
  await wiseLeaveMeetingCli(valueOf(["--machine", "-m"]), valueOf(["--session", "-s"]), { json: rest.includes("--json") });
2216
2279
  return;
2217
2280
  }
@@ -2235,7 +2298,7 @@ async function handleWiseAgentCommand(rest) {
2235
2298
  }
2236
2299
  });
2237
2300
  const text = rest.slice(1).map((a, idx) => ({ a, idx: idx + 1 })).filter(({ a, idx }) => !a.startsWith("-") && !consumed.has(String(idx))).map(({ a }) => a).join(" ");
2238
- const { wiseAnnounceCli } = await import('./commands-B-yczgz_.mjs');
2301
+ const { wiseAnnounceCli } = await import('./commands-CcdoQIkb.mjs').then(function (n) { return n.d; });
2239
2302
  await wiseAnnounceCli(machineId, text, sessionId, { json });
2240
2303
  return;
2241
2304
  }
@@ -2247,7 +2310,7 @@ async function handleWiseAgentCommand(rest) {
2247
2310
  }
2248
2311
  return void 0;
2249
2312
  };
2250
- const { wiseMeetingsCli } = await import('./commands-B-yczgz_.mjs');
2313
+ const { wiseMeetingsCli } = await import('./commands-CcdoQIkb.mjs').then(function (n) { return n.d; });
2251
2314
  await wiseMeetingsCli(valueOf(["--machine", "-m"]), { json: rest.includes("--json") });
2252
2315
  return;
2253
2316
  }
@@ -2308,7 +2371,7 @@ If none is set, hitting a WISE Agent channel returns a clear "not configured" er
2308
2371
  return;
2309
2372
  }
2310
2373
  if (action) {
2311
- const { updateEnvFile } = await import('./claudeAuth-C0wc1GTM.mjs');
2374
+ const { updateEnvFile } = await import('./claudeAuth-DMDvPNhO.mjs');
2312
2375
  const updates = mod.buildWiseAgentEnvUpdates(action);
2313
2376
  updateEnvFile(updates);
2314
2377
  for (const [k, v] of Object.entries(updates)) {
@@ -2322,7 +2385,7 @@ If none is set, hitting a WISE Agent channel returns a clear "not configured" er
2322
2385
  }
2323
2386
  async function handleDaemonAuthCommand(argv) {
2324
2387
  const sub = wantsHelp(argv) ? "--help" : (argv[0] || "status").toLowerCase();
2325
- const mod = await import('./claudeAuth-C0wc1GTM.mjs');
2388
+ const mod = await import('./claudeAuth-DMDvPNhO.mjs');
2326
2389
  if (sub === "--help" || sub === "-h" || sub === "help") {
2327
2390
  console.log(`
2328
2391
  svamp daemon auth \u2014 Configure how Claude subprocesses authenticate
@@ -2399,7 +2462,7 @@ one step: --use-hypha-proxy / --use-claude-login / --anthropic-base-url URL --an
2399
2462
  }
2400
2463
  async function handleDaemonCodexAuthCommand(argv) {
2401
2464
  const sub = wantsHelp(argv) ? "--help" : (argv[0] || "status").toLowerCase();
2402
- const { updateEnvFile } = await import('./claudeAuth-C0wc1GTM.mjs');
2465
+ const { updateEnvFile } = await import('./claudeAuth-DMDvPNhO.mjs');
2403
2466
  const { resolveCodexProvider } = await import('./codexProvider-BtxYc5Rj.mjs');
2404
2467
  const redact = (k) => k && k.length > 10 ? `${k.slice(0, 6)}\u2026${k.slice(-4)}` : k ? "***" : "(unset)";
2405
2468
  if (sub === "--help" || sub === "-h" || sub === "help") {
@@ -2488,7 +2551,7 @@ The generic LLM_API_BASE / LLM_API_KEY / LLM_MODEL env vars are also honored if
2488
2551
  }
2489
2552
  async function handleDaemonKimiAuthCommand(argv) {
2490
2553
  const sub = wantsHelp(argv) ? "--help" : (argv[0] || "status").toLowerCase();
2491
- const { updateEnvFile } = await import('./claudeAuth-C0wc1GTM.mjs');
2554
+ const { updateEnvFile } = await import('./claudeAuth-DMDvPNhO.mjs');
2492
2555
  const { resolveKimiProvider, buildKimiCatalogAddArgs, DEFAULT_KIMI_PROVIDER } = await import('./kimiProvider-DbxODebR.mjs');
2493
2556
  const redact = (k) => k && k.length > 10 ? `${k.slice(0, 6)}\u2026${k.slice(-4)}` : k ? "***" : "(unset)";
2494
2557
  const PRESETS = {
@@ -2655,9 +2718,13 @@ COMMANDS:
2655
2718
  the message lands in the peer's inbox and is processed on
2656
2719
  their next idle turn (no interrupt). Loop safeguard: a send
2657
2720
  issued from a turn that was itself triggered by an inbox
2658
- message is always forced non-urgent (no recursive wake
2659
- cascades); the daemon's per-sender rate limit + circuit
2660
- breaker further bound any storm.
2721
+ message DEFAULTS to non-urgent (no recursive wake cascades)
2722
+ and says so on stderr; pass --urgency urgent to override.
2723
+ This safeguard covers "send" and "inbox send" only \u2014
2724
+ "inbox reply" deliberately defaults urgent (it wakes a party
2725
+ that is waiting) and is bounded by the hop cap instead.
2726
+ The daemon's per-sender rate limit + circuit breaker
2727
+ further bound any storm.
2661
2728
  --when-idle defer: handle on the recipient's
2662
2729
  next idle turn (opposite of the
2663
2730
  urgent default)
@@ -2719,7 +2786,9 @@ COMMANDS:
2719
2786
  inbox send <id> "<body>" [opts] Send a message to session inbox
2720
2787
  inbox list <id> [--unread] [--json] List inbox messages
2721
2788
  inbox read <id> <msg-id> Read and mark a message
2722
- inbox reply <id> <msg-id> "<body>" Reply to sender's session
2789
+ inbox reply <id> <msg-id> "<body>" Reply to sender's session (urgent by default \u2014
2790
+ [--urgency urgent|normal] it wakes a party that is waiting; --when-idle or
2791
+ [--when-idle] --urgency normal defers to their next idle turn)
2723
2792
  inbox clear <id> [--all] Clear read (or all) messages
2724
2793
 
2725
2794
  SPAWN OPTIONS:
@@ -1,4 +1,4 @@
1
- import { r as resolveProjectRoot } from './store-B4E6NzG6.mjs';
1
+ import { r as resolveProjectRoot } from './store-D8dok6_d.mjs';
2
2
  import { w as wantsHelp } from './wantsHelp-6bMOeNUz.mjs';
3
3
  import { s as setWorkflowEnabled, i as isWorkflowEnabled, r as removeWorkflow, g as getWorkflow, l as listWorkflows, c as workflowSteps, a as saveWorkflow, b as rawWorkflow } from './store-fi0f-ff1.mjs';
4
4
  import { v as validateCronExpr, d as describeNextFire } from './cron-hHGdb5kU.mjs';
@@ -21,7 +21,7 @@ function positional(args) {
21
21
  for (let i = 0; i < args.length; i++) {
22
22
  const a = args[i];
23
23
  if (a.startsWith("--")) {
24
- if (a !== "--json") i++;
24
+ if (a !== "--json" && a !== "--force" && a !== "--replace") i++;
25
25
  continue;
26
26
  }
27
27
  out.push(a);
@@ -75,6 +75,13 @@ async function workflowCommand(args) {
75
75
  if (onKinds.includes("idle")) on.idle = true;
76
76
  const owner = flag(rest, "--session") || process.env.SVAMP_SESSION_ID || null;
77
77
  const wf = { name, on: Object.keys(on).length ? on : void 0, jobs: { run: { steps: runs.map((r) => ({ run: r })) } }, session: owner };
78
+ if (!rest.includes("--force") && !rest.includes("--replace") && getWorkflow(root, name)) {
79
+ console.error(`Workflow "${name}" already exists \u2014 refusing to replace it (that would discard its steps, schedule and owning session).`);
80
+ console.error(` svamp workflow show ${name} # see what is there now`);
81
+ console.error(` svamp workflow add ${name} --force \u2026 # deliberately replace it`);
82
+ console.error(` svamp workflow remove ${name} # or remove it first`);
83
+ process.exit(1);
84
+ }
78
85
  saveWorkflow(root, wf);
79
86
  const nSteps = workflowSteps(wf).length;
80
87
  if (json) console.log(JSON.stringify(wf));
@@ -147,7 +154,7 @@ async function workflowCommand(args) {
147
154
  console.error(`Workflow not found: ${name}`);
148
155
  process.exit(1);
149
156
  }
150
- const { runWorkflow } = await import('./run-DDmeV9K3.mjs').then(function (n) { return n.e; });
157
+ const { runWorkflow } = await import('./run-DKOND4dO.mjs').then(function (n) { return n.f; });
151
158
  const run = await runWorkflow(root, wf, { trigger: "manual", actor: process.env.SVAMP_SESSION_ID || null });
152
159
  console.log(`\u25B6 ran workflow "${wf.name}" (${run.steps.length} step${run.steps.length === 1 ? "" : "s"}) \u2192 ${run.status}`);
153
160
  for (const st of run.steps) {