svamp-cli 0.2.98 → 0.2.101

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 (41) hide show
  1. package/README.md +7 -5
  2. package/bin/skills/loop/IMPLEMENTATION_PROGRESS.md +49 -0
  3. package/bin/skills/loop/SKILL.md +99 -0
  4. package/bin/skills/loop/bin/channel-core.mjs +161 -0
  5. package/bin/skills/loop/bin/channel-server.mjs +151 -0
  6. package/bin/skills/loop/bin/inject-loop.mjs +41 -0
  7. package/bin/skills/loop/bin/loop-init.mjs +128 -0
  8. package/bin/skills/loop/bin/loop-status.mjs +38 -0
  9. package/bin/skills/loop/bin/precompact.mjs +27 -0
  10. package/bin/skills/loop/bin/routine-cli.mjs +121 -0
  11. package/bin/skills/loop/bin/routine-core.mjs +126 -0
  12. package/bin/skills/loop/bin/routine-runner.mjs +125 -0
  13. package/bin/skills/loop/bin/routine-store.mjs +49 -0
  14. package/bin/skills/loop/bin/state-fp.mjs +113 -0
  15. package/bin/skills/loop/bin/stop-gate.mjs +170 -0
  16. package/bin/skills/loop/routines.process.yaml +20 -0
  17. package/bin/skills/loop/test/test-channel-core.mjs +86 -0
  18. package/bin/skills/loop/test/test-loop-gate.mjs +246 -0
  19. package/bin/skills/loop/test/test-routine-core.mjs +54 -0
  20. package/bin/skills/loop/test/test-routine-engine.mjs +122 -0
  21. package/dist/{agentCommands-BULNvfKa.mjs → agentCommands-CAqLhLOH.mjs} +2 -2
  22. package/dist/{auth-BfDOBBPy.mjs → auth-CYA0e4mT.mjs} +1 -1
  23. package/dist/{caddy-BMbX-mFX.mjs → caddy-CuTbE3NY.mjs} +1 -14
  24. package/dist/cli.mjs +76 -77
  25. package/dist/{commands-C9DbNFz1.mjs → commands-B2uNdsyR.mjs} +2 -2
  26. package/dist/{commands-h2Dzb5m1.mjs → commands-Bxn_4u7d.mjs} +1 -1
  27. package/dist/{commands-DIhhodx8.mjs → commands-CdxEOPUt.mjs} +34 -42
  28. package/dist/{commands-qE4ZGLzB.mjs → commands-D-3h8H0C.mjs} +6 -6
  29. package/dist/{commands-FhGCsATM.mjs → commands-DRQUzw4j.mjs} +1 -1
  30. package/dist/{fleet-Cmma7Iu-.mjs → fleet-CNF84yJV.mjs} +1 -1
  31. package/dist/{frpc-BZ4l4-os.mjs → frpc-WVnBbyjf.mjs} +2 -15
  32. package/dist/{headlessCli-xRpI9fdk.mjs → headlessCli-DcP8eawK.mjs} +2 -2
  33. package/dist/index.mjs +1 -1
  34. package/dist/package-DHxiXJ3N.mjs +63 -0
  35. package/dist/{run-DTIEcH-W.mjs → run-C7WSV8zx.mjs} +1 -1
  36. package/dist/{run-DxzG-3JD.mjs → run-CsMTSngP.mjs} +246 -709
  37. package/dist/{serveCommands-CzllIFB_.mjs → serveCommands-Can8WtLI.mjs} +5 -5
  38. package/dist/{serveManager-C6_Vloil.mjs → serveManager-DfETVSOb.mjs} +3 -3
  39. package/dist/{sideband-wPe3a3m1.mjs → sideband-C10Ni7p_.mjs} +1 -1
  40. package/package.json +3 -3
  41. package/dist/package-DD227VZO.mjs +0 -63
package/dist/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { e as clearStopMarker, f as stopMarkerExists, s as startDaemon, b as stopDaemon, d as daemonStatus } from './run-DxzG-3JD.mjs';
1
+ import { e as clearStopMarker, f as stopMarkerExists, s as startDaemon, b as stopDaemon, d as daemonStatus } from './run-CsMTSngP.mjs';
2
2
  import { ensureSupervisorViaServiceManager, LAUNCHD_LABEL } from './serviceManager-hlOVxkhW.mjs';
3
3
  import 'os';
4
4
  import 'fs/promises';
@@ -33,7 +33,7 @@ const subcommand = args[0];
33
33
  let daemonSubcommand = args[1];
34
34
  async function main() {
35
35
  try {
36
- const { getLoadedConfig } = await import('./run-DxzG-3JD.mjs').then(function (n) { return n.Y; });
36
+ const { getLoadedConfig } = await import('./run-CsMTSngP.mjs').then(function (n) { return n.Y; });
37
37
  getLoadedConfig();
38
38
  } catch {
39
39
  }
@@ -50,7 +50,7 @@ async function main() {
50
50
  console.error(`svamp daemon restart: ${err.message || err}`);
51
51
  process.exit(1);
52
52
  }
53
- const { restartDaemon } = await import('./run-DxzG-3JD.mjs').then(function (n) { return n._; });
53
+ const { restartDaemon } = await import('./run-CsMTSngP.mjs').then(function (n) { return n._; });
54
54
  await restartDaemon();
55
55
  process.exit(0);
56
56
  }
@@ -343,7 +343,7 @@ async function main() {
343
343
  console.error("svamp service: Service commands are not available in sandboxed sessions.");
344
344
  process.exit(1);
345
345
  }
346
- const { handleServiceCommand } = await import('./commands-qE4ZGLzB.mjs');
346
+ const { handleServiceCommand } = await import('./commands-D-3h8H0C.mjs');
347
347
  await handleServiceCommand();
348
348
  } else if (subcommand === "serve") {
349
349
  const { isSandboxed: isSandboxedServe } = await import('./sandboxDetect-DNTcbgWD.mjs');
@@ -351,7 +351,7 @@ async function main() {
351
351
  console.error("svamp serve: Serve commands are not available in sandboxed sessions.");
352
352
  process.exit(1);
353
353
  }
354
- const { handleServeCommand } = await import('./serveCommands-CzllIFB_.mjs');
354
+ const { handleServeCommand } = await import('./serveCommands-Can8WtLI.mjs');
355
355
  await handleServeCommand();
356
356
  process.exit(0);
357
357
  } else if (subcommand === "process" || subcommand === "proc") {
@@ -360,7 +360,7 @@ async function main() {
360
360
  console.error("svamp process: Process commands are not available in sandboxed sessions.");
361
361
  process.exit(1);
362
362
  }
363
- const { processCommand } = await import('./commands-C9DbNFz1.mjs');
363
+ const { processCommand } = await import('./commands-B2uNdsyR.mjs');
364
364
  let machineId;
365
365
  const processArgs = args.slice(1);
366
366
  const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
@@ -374,7 +374,7 @@ async function main() {
374
374
  }), machineId);
375
375
  process.exit(0);
376
376
  } else if (subcommand === "routine" || subcommand === "routines") {
377
- const { routineCommand } = await import('./commands-h2Dzb5m1.mjs');
377
+ const { routineCommand } = await import('./commands-Bxn_4u7d.mjs');
378
378
  await routineCommand(args.slice(1));
379
379
  process.exit(0);
380
380
  } else if (subcommand === "wise-agent" || subcommand === "wise") {
@@ -385,7 +385,7 @@ async function main() {
385
385
  } else if (!subcommand || subcommand === "start") {
386
386
  await handleInteractiveCommand();
387
387
  } else if (subcommand === "--version" || subcommand === "-v") {
388
- const pkg = await import('./package-DD227VZO.mjs').catch(() => ({ default: { version: "unknown" } }));
388
+ const pkg = await import('./package-DHxiXJ3N.mjs').catch(() => ({ default: { version: "unknown" } }));
389
389
  console.log(`svamp version: ${pkg.default.version}`);
390
390
  } else {
391
391
  console.error(`Unknown command: ${subcommand}`);
@@ -394,7 +394,7 @@ async function main() {
394
394
  }
395
395
  }
396
396
  async function handleInteractiveCommand() {
397
- const { runInteractive } = await import('./run-DTIEcH-W.mjs');
397
+ const { runInteractive } = await import('./run-C7WSV8zx.mjs');
398
398
  const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
399
399
  let directory = process.cwd();
400
400
  let resumeSessionId;
@@ -439,7 +439,7 @@ async function handleAgentCommand() {
439
439
  return;
440
440
  }
441
441
  if (agentArgs[0] === "list") {
442
- const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-DxzG-3JD.mjs').then(function (n) { return n.U; });
442
+ const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-CsMTSngP.mjs').then(function (n) { return n.U; });
443
443
  console.log("Known agents:");
444
444
  for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
445
445
  console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
@@ -451,7 +451,7 @@ async function handleAgentCommand() {
451
451
  console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
452
452
  return;
453
453
  }
454
- const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-DxzG-3JD.mjs').then(function (n) { return n.U; });
454
+ const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-CsMTSngP.mjs').then(function (n) { return n.U; });
455
455
  let cwd = process.cwd();
456
456
  const filteredArgs = [];
457
457
  for (let i = 0; i < agentArgs.length; i++) {
@@ -475,12 +475,12 @@ async function handleAgentCommand() {
475
475
  console.log(`Starting ${config.agentName} agent in ${cwd}...`);
476
476
  let backend;
477
477
  if (KNOWN_MCP_AGENTS[config.agentName]) {
478
- const { CodexMcpBackend } = await import('./run-DxzG-3JD.mjs').then(function (n) { return n.V; });
478
+ const { CodexMcpBackend } = await import('./run-CsMTSngP.mjs').then(function (n) { return n.V; });
479
479
  backend = new CodexMcpBackend({ cwd, log: logFn });
480
480
  } else {
481
- const { AcpBackend } = await import('./run-DxzG-3JD.mjs').then(function (n) { return n.T; });
482
- const { GeminiTransport } = await import('./run-DxzG-3JD.mjs').then(function (n) { return n.W; });
483
- const { DefaultTransport } = await import('./run-DxzG-3JD.mjs').then(function (n) { return n.Q; });
481
+ const { AcpBackend } = await import('./run-CsMTSngP.mjs').then(function (n) { return n.T; });
482
+ const { GeminiTransport } = await import('./run-CsMTSngP.mjs').then(function (n) { return n.W; });
483
+ const { DefaultTransport } = await import('./run-CsMTSngP.mjs').then(function (n) { return n.Q; });
484
484
  const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
485
485
  backend = new AcpBackend({
486
486
  agentName: config.agentName,
@@ -607,7 +607,7 @@ async function handleSessionCommand() {
607
607
  process.exit(1);
608
608
  }
609
609
  }
610
- const { sessionList, sessionWhoami, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-DIhhodx8.mjs');
610
+ const { sessionList, sessionWhoami, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionLoopStart, sessionLoopCancel, sessionLoopStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-CdxEOPUt.mjs');
611
611
  const parseFlagStr = (flag, shortFlag) => {
612
612
  for (let i = 1; i < sessionArgs.length; i++) {
613
613
  if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
@@ -675,7 +675,7 @@ async function handleSessionCommand() {
675
675
  allowDomain.push(sessionArgs[++i]);
676
676
  }
677
677
  }
678
- const { parseShareArg } = await import('./commands-DIhhodx8.mjs');
678
+ const { parseShareArg } = await import('./commands-CdxEOPUt.mjs');
679
679
  const shareEntries = share.map((s) => parseShareArg(s));
680
680
  await sessionSpawn(agent, dir, targetMachineId, {
681
681
  message,
@@ -762,7 +762,7 @@ async function handleSessionCommand() {
762
762
  console.error(" Spawns a stateless Claude session in <directory>, sends <prompt>, prints the answer, then deletes the session.");
763
763
  process.exit(1);
764
764
  }
765
- const { sessionQuery } = await import('./commands-DIhhodx8.mjs');
765
+ const { sessionQuery } = await import('./commands-CdxEOPUt.mjs');
766
766
  await sessionQuery(dir, prompt, targetMachineId, {
767
767
  timeout: parseFlagInt("--timeout"),
768
768
  json: hasFlag("--json"),
@@ -795,7 +795,7 @@ async function handleSessionCommand() {
795
795
  console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
796
796
  process.exit(1);
797
797
  }
798
- const { sessionApprove } = await import('./commands-DIhhodx8.mjs');
798
+ const { sessionApprove } = await import('./commands-CdxEOPUt.mjs');
799
799
  const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
800
800
  await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
801
801
  json: hasFlag("--json")
@@ -805,43 +805,42 @@ async function handleSessionCommand() {
805
805
  console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
806
806
  process.exit(1);
807
807
  }
808
- const { sessionDeny } = await import('./commands-DIhhodx8.mjs');
808
+ const { sessionDeny } = await import('./commands-CdxEOPUt.mjs');
809
809
  const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
810
810
  await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
811
811
  json: hasFlag("--json")
812
812
  });
813
- } else if (sessionSubcommand === "ralph-start" || sessionSubcommand === "ralph") {
813
+ } else if (sessionSubcommand === "loop-start" || sessionSubcommand === "loop") {
814
814
  if (!sessionArgs[1] || !sessionArgs[2]) {
815
- console.error('Usage: svamp session ralph-start <session-id> "<task>" [--context-mode fresh|continue] [--completion-promise TEXT] [--max-iterations N] [--cooldown N]');
815
+ console.error('Usage: svamp session loop-start <session-id> "<task>" [--criteria TEXT] [--oracle "cmd"] [--max N] [--evaluator on|off]');
816
816
  process.exit(1);
817
817
  }
818
- const contextModeStr = parseFlagStr("--context-mode") || parseFlagStr("--mode");
819
- const contextMode = contextModeStr === "fresh" || contextModeStr === "continue" ? contextModeStr : void 0;
820
- await sessionRalphStart(sessionArgs[1], sessionArgs[2], targetMachineId, {
821
- completionPromise: parseFlagStr("--completion-promise"),
822
- maxIterations: parseFlagInt("--max-iterations"),
823
- cooldownSeconds: parseFlagInt("--cooldown"),
824
- contextMode
818
+ const evalStr = parseFlagStr("--evaluator");
819
+ await sessionLoopStart(sessionArgs[1], sessionArgs[2], targetMachineId, {
820
+ criteria: parseFlagStr("--criteria"),
821
+ oracle: parseFlagStr("--oracle"),
822
+ maxIterations: parseFlagInt("--max") ?? parseFlagInt("--max-iterations"),
823
+ evaluator: evalStr ? evalStr !== "off" : void 0
825
824
  });
826
- } else if (sessionSubcommand === "ralph-cancel") {
825
+ } else if (sessionSubcommand === "loop-cancel") {
827
826
  if (!sessionArgs[1]) {
828
- console.error("Usage: svamp session ralph-cancel <session-id>");
827
+ console.error("Usage: svamp session loop-cancel <session-id>");
829
828
  process.exit(1);
830
829
  }
831
- await sessionRalphCancel(sessionArgs[1], targetMachineId);
832
- } else if (sessionSubcommand === "ralph-status") {
830
+ await sessionLoopCancel(sessionArgs[1], targetMachineId);
831
+ } else if (sessionSubcommand === "loop-status") {
833
832
  if (!sessionArgs[1]) {
834
- console.error("Usage: svamp session ralph-status <session-id>");
833
+ console.error("Usage: svamp session loop-status <session-id>");
835
834
  process.exit(1);
836
835
  }
837
- await sessionRalphStatus(sessionArgs[1], targetMachineId);
836
+ await sessionLoopStatus(sessionArgs[1], targetMachineId);
838
837
  } else if (sessionSubcommand === "set-title") {
839
838
  const title = sessionArgs[1];
840
839
  if (!title) {
841
840
  console.error("Usage: svamp session set-title <title>");
842
841
  process.exit(1);
843
842
  }
844
- const { sessionSetTitle } = await import('./agentCommands-BULNvfKa.mjs');
843
+ const { sessionSetTitle } = await import('./agentCommands-CAqLhLOH.mjs');
845
844
  await sessionSetTitle(title);
846
845
  } else if (sessionSubcommand === "set-link") {
847
846
  const url = sessionArgs[1];
@@ -850,7 +849,7 @@ async function handleSessionCommand() {
850
849
  process.exit(1);
851
850
  }
852
851
  const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
853
- const { sessionSetLink } = await import('./agentCommands-BULNvfKa.mjs');
852
+ const { sessionSetLink } = await import('./agentCommands-CAqLhLOH.mjs');
854
853
  await sessionSetLink(url, label);
855
854
  } else if (sessionSubcommand === "notify") {
856
855
  const message = sessionArgs[1];
@@ -859,7 +858,7 @@ async function handleSessionCommand() {
859
858
  process.exit(1);
860
859
  }
861
860
  const level = parseFlagStr("--level") || "info";
862
- const { sessionNotify } = await import('./agentCommands-BULNvfKa.mjs');
861
+ const { sessionNotify } = await import('./agentCommands-CAqLhLOH.mjs');
863
862
  await sessionNotify(message, level);
864
863
  } else if (sessionSubcommand === "broadcast") {
865
864
  const action = sessionArgs[1];
@@ -867,7 +866,7 @@ async function handleSessionCommand() {
867
866
  console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
868
867
  process.exit(1);
869
868
  }
870
- const { sessionBroadcast } = await import('./agentCommands-BULNvfKa.mjs');
869
+ const { sessionBroadcast } = await import('./agentCommands-CAqLhLOH.mjs');
871
870
  await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
872
871
  } else if (sessionSubcommand === "inbox") {
873
872
  const inboxSubcmd = sessionArgs[1];
@@ -878,7 +877,7 @@ async function handleSessionCommand() {
878
877
  process.exit(1);
879
878
  }
880
879
  if (agentSessionId) {
881
- const { inboxSend } = await import('./agentCommands-BULNvfKa.mjs');
880
+ const { inboxSend } = await import('./agentCommands-CAqLhLOH.mjs');
882
881
  await inboxSend(sessionArgs[2], {
883
882
  body: sessionArgs[3],
884
883
  subject: parseFlagStr("--subject"),
@@ -893,7 +892,7 @@ async function handleSessionCommand() {
893
892
  }
894
893
  } else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
895
894
  if (agentSessionId && !sessionArgs[2]) {
896
- const { inboxList } = await import('./agentCommands-BULNvfKa.mjs');
895
+ const { inboxList } = await import('./agentCommands-CAqLhLOH.mjs');
897
896
  await inboxList({
898
897
  unread: hasFlag("--unread"),
899
898
  limit: parseFlagInt("--limit"),
@@ -915,7 +914,7 @@ async function handleSessionCommand() {
915
914
  process.exit(1);
916
915
  }
917
916
  if (agentSessionId && !sessionArgs[3]) {
918
- const { inboxList } = await import('./agentCommands-BULNvfKa.mjs');
917
+ const { inboxList } = await import('./agentCommands-CAqLhLOH.mjs');
919
918
  await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
920
919
  } else if (sessionArgs[3]) {
921
920
  await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
@@ -925,7 +924,7 @@ async function handleSessionCommand() {
925
924
  }
926
925
  } else if (inboxSubcmd === "reply") {
927
926
  if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
928
- const { inboxReply } = await import('./agentCommands-BULNvfKa.mjs');
927
+ const { inboxReply } = await import('./agentCommands-CAqLhLOH.mjs');
929
928
  await inboxReply(sessionArgs[2], sessionArgs[3]);
930
929
  } else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
931
930
  await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
@@ -961,7 +960,7 @@ async function handleMachineCommand() {
961
960
  return;
962
961
  }
963
962
  if (machineSubcommand === "share") {
964
- const { machineShare } = await import('./commands-DIhhodx8.mjs');
963
+ const { machineShare } = await import('./commands-CdxEOPUt.mjs');
965
964
  let machineId;
966
965
  const shareArgs = [];
967
966
  for (let i = 1; i < machineArgs.length; i++) {
@@ -991,7 +990,7 @@ async function handleMachineCommand() {
991
990
  }
992
991
  await machineShare(machineId, { add, remove, list, configPath, showConfig });
993
992
  } else if (machineSubcommand === "exec") {
994
- const { machineExec } = await import('./commands-DIhhodx8.mjs');
993
+ const { machineExec } = await import('./commands-CdxEOPUt.mjs');
995
994
  let machineId;
996
995
  let cwd;
997
996
  const cmdParts = [];
@@ -1011,7 +1010,7 @@ async function handleMachineCommand() {
1011
1010
  }
1012
1011
  await machineExec(machineId, command, cwd);
1013
1012
  } else if (machineSubcommand === "info") {
1014
- const { machineInfo } = await import('./commands-DIhhodx8.mjs');
1013
+ const { machineInfo } = await import('./commands-CdxEOPUt.mjs');
1015
1014
  let machineId;
1016
1015
  for (let i = 1; i < machineArgs.length; i++) {
1017
1016
  if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
@@ -1031,10 +1030,10 @@ async function handleMachineCommand() {
1031
1030
  level = machineArgs[++i];
1032
1031
  }
1033
1032
  }
1034
- const { machineNotify } = await import('./agentCommands-BULNvfKa.mjs');
1033
+ const { machineNotify } = await import('./agentCommands-CAqLhLOH.mjs');
1035
1034
  await machineNotify(message, level);
1036
1035
  } else if (machineSubcommand === "ls") {
1037
- const { machineLs } = await import('./commands-DIhhodx8.mjs');
1036
+ const { machineLs } = await import('./commands-CdxEOPUt.mjs');
1038
1037
  let machineId;
1039
1038
  let showHidden = false;
1040
1039
  let path;
@@ -1092,24 +1091,24 @@ Examples:
1092
1091
  };
1093
1092
  const hasFlag = (name) => fleetArgs.includes(`--${name}`);
1094
1093
  if (sub === "status") {
1095
- const { fleetStatus } = await import('./fleet-Cmma7Iu-.mjs');
1094
+ const { fleetStatus } = await import('./fleet-CNF84yJV.mjs');
1096
1095
  await fleetStatus();
1097
1096
  } else if (sub === "exec") {
1098
1097
  const command = fleetArgs.slice(1).filter((a) => !a.startsWith("--")).join(" ");
1099
- const { fleetExec } = await import('./fleet-Cmma7Iu-.mjs');
1098
+ const { fleetExec } = await import('./fleet-CNF84yJV.mjs');
1100
1099
  await fleetExec(command, { cwd: flag("cwd") });
1101
1100
  } else if (sub === "upgrade-claude") {
1102
- const { fleetUpgradeClaude } = await import('./fleet-Cmma7Iu-.mjs');
1101
+ const { fleetUpgradeClaude } = await import('./fleet-CNF84yJV.mjs');
1103
1102
  await fleetUpgradeClaude({ version: flag("version", "-v") });
1104
1103
  } else if (sub === "upgrade-svamp") {
1105
- const { fleetUpgradeSvamp } = await import('./fleet-Cmma7Iu-.mjs');
1104
+ const { fleetUpgradeSvamp } = await import('./fleet-CNF84yJV.mjs');
1106
1105
  await fleetUpgradeSvamp({ version: flag("version", "-v"), excludeSelf: hasFlag("exclude-self") });
1107
1106
  } else if (sub === "daemon-restart") {
1108
- const { fleetDaemonRestart } = await import('./fleet-Cmma7Iu-.mjs');
1107
+ const { fleetDaemonRestart } = await import('./fleet-CNF84yJV.mjs');
1109
1108
  await fleetDaemonRestart({ graceful: !hasFlag("cleanup") });
1110
1109
  } else if (sub === "push-skill") {
1111
1110
  const name = fleetArgs[1];
1112
- const { fleetPushSkill } = await import('./fleet-Cmma7Iu-.mjs');
1111
+ const { fleetPushSkill } = await import('./fleet-CNF84yJV.mjs');
1113
1112
  await fleetPushSkill(name);
1114
1113
  } else {
1115
1114
  console.error(`Unknown fleet subcommand: ${sub}`);
@@ -1125,7 +1124,7 @@ async function handleSkillsCommand() {
1125
1124
  await printSkillsHelp();
1126
1125
  return;
1127
1126
  }
1128
- const { skillsFind, skillsInstall, skillsList, skillsRemove, skillsPublish } = await import('./commands-FhGCsATM.mjs');
1127
+ const { skillsFind, skillsInstall, skillsList, skillsRemove, skillsPublish } = await import('./commands-DRQUzw4j.mjs');
1129
1128
  if (skillsSubcommand === "find" || skillsSubcommand === "search") {
1130
1129
  const query = skillsArgs.slice(1).filter((a) => !a.startsWith("--")).join(" ");
1131
1130
  if (!query) {
@@ -1172,7 +1171,7 @@ async function loginToHypha() {
1172
1171
  process.exit(1);
1173
1172
  }
1174
1173
  const anchor = anchorArg.replace(/\/+$/, "");
1175
- const { loadInstanceConfig } = await import('./run-DxzG-3JD.mjs').then(function (n) { return n.Y; });
1174
+ const { loadInstanceConfig } = await import('./run-CsMTSngP.mjs').then(function (n) { return n.Y; });
1176
1175
  let cfg = null;
1177
1176
  try {
1178
1177
  cfg = await loadInstanceConfig({ anchor, force: true });
@@ -1283,7 +1282,7 @@ async function logoutFromHypha() {
1283
1282
  } catch {
1284
1283
  }
1285
1284
  try {
1286
- const { clearInstanceConfigCache } = await import('./run-DxzG-3JD.mjs').then(function (n) { return n.Y; });
1285
+ const { clearInstanceConfigCache } = await import('./run-CsMTSngP.mjs').then(function (n) { return n.Y; });
1287
1286
  clearInstanceConfigCache();
1288
1287
  } catch {
1289
1288
  }
@@ -1614,7 +1613,7 @@ async function applyClaudeAuthFlags(argv) {
1614
1613
  "--use-hypha-proxy, --use-claude-login, and --anthropic-base-url/--anthropic-api-key are mutually exclusive"
1615
1614
  );
1616
1615
  }
1617
- const mod = await import('./run-DxzG-3JD.mjs').then(function (n) { return n.X; });
1616
+ const mod = await import('./run-CsMTSngP.mjs').then(function (n) { return n.X; });
1618
1617
  if (hasHypha) {
1619
1618
  let url;
1620
1619
  const hyphaIdx = argv.indexOf("--use-hypha-proxy");
@@ -1668,7 +1667,7 @@ async function applyDaemonShareFlag(argv) {
1668
1667
  }
1669
1668
  }
1670
1669
  if (collected.length === 0) return;
1671
- const { updateEnvFile } = await import('./run-DxzG-3JD.mjs').then(function (n) { return n.X; });
1670
+ const { updateEnvFile } = await import('./run-CsMTSngP.mjs').then(function (n) { return n.X; });
1672
1671
  const seen = /* @__PURE__ */ new Set();
1673
1672
  const deduped = collected.filter((e) => {
1674
1673
  const k = e.toLowerCase();
@@ -1701,7 +1700,7 @@ async function handleWiseAgentCommand(rest) {
1701
1700
  }
1702
1701
  });
1703
1702
  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(" ");
1704
- const { wiseAskCli } = await import('./commands-DIhhodx8.mjs');
1703
+ const { wiseAskCli } = await import('./commands-CdxEOPUt.mjs');
1705
1704
  await wiseAskCli(machineId, message, sessionId, { json });
1706
1705
  return;
1707
1706
  }
@@ -1713,7 +1712,7 @@ async function handleWiseAgentCommand(rest) {
1713
1712
  }
1714
1713
  return void 0;
1715
1714
  };
1716
- const { runWiseVoiceCli } = await import('./headlessCli-xRpI9fdk.mjs');
1715
+ const { runWiseVoiceCli } = await import('./headlessCli-DcP8eawK.mjs');
1717
1716
  await runWiseVoiceCli({ voice: valueOf(["--voice"]), wakeKeywordPath: valueOf(["--wake"]), model: valueOf(["--model"]) });
1718
1717
  return;
1719
1718
  }
@@ -1755,7 +1754,7 @@ If none is set, hitting a WISE Agent channel returns a clear "not configured" er
1755
1754
  return;
1756
1755
  }
1757
1756
  const authArgs = rest.slice(1);
1758
- const mod = await import('./auth-BfDOBBPy.mjs');
1757
+ const mod = await import('./auth-CYA0e4mT.mjs');
1759
1758
  let action;
1760
1759
  try {
1761
1760
  action = mod.parseWiseAgentAuthArgs(authArgs);
@@ -1765,7 +1764,7 @@ If none is set, hitting a WISE Agent channel returns a clear "not configured" er
1765
1764
  return;
1766
1765
  }
1767
1766
  if (action) {
1768
- const { updateEnvFile } = await import('./run-DxzG-3JD.mjs').then(function (n) { return n.X; });
1767
+ const { updateEnvFile } = await import('./run-CsMTSngP.mjs').then(function (n) { return n.X; });
1769
1768
  const updates = mod.buildWiseAgentEnvUpdates(action);
1770
1769
  updateEnvFile(updates);
1771
1770
  for (const [k, v] of Object.entries(updates)) {
@@ -1779,7 +1778,7 @@ If none is set, hitting a WISE Agent channel returns a clear "not configured" er
1779
1778
  }
1780
1779
  async function handleDaemonAuthCommand(argv) {
1781
1780
  const sub = (argv[0] || "status").toLowerCase();
1782
- const mod = await import('./run-DxzG-3JD.mjs').then(function (n) { return n.X; });
1781
+ const mod = await import('./run-CsMTSngP.mjs').then(function (n) { return n.X; });
1783
1782
  if (sub === "--help" || sub === "-h" || sub === "help") {
1784
1783
  console.log(`
1785
1784
  svamp daemon auth \u2014 Configure how Claude subprocesses authenticate
@@ -1931,10 +1930,10 @@ COMMANDS:
1931
1930
  share <id> --remove <email> Remove shared user
1932
1931
  share <id> --public <view|interact|off> Set public link access
1933
1932
 
1934
- Ralph Loop (iterative automation):
1935
- ralph-start <id> "<task>" [options] Start iterative loop
1936
- ralph-cancel <id> Cancel loop
1937
- ralph-status <id> Show loop status
1933
+ Loop (self-verifying iterative automation):
1934
+ loop-start <id> "<task>" [options] Start a self-verifying loop
1935
+ loop-cancel <id> Cancel the loop
1936
+ loop-status <id> Show loop phase + iteration
1938
1937
 
1939
1938
  Inbox:
1940
1939
  inbox send <id> "<body>" [opts] Send a message to session inbox
@@ -1988,11 +1987,11 @@ MESSAGES OPTIONS:
1988
1987
  --json Output as JSON array of {id, seq, role, text, createdAt}
1989
1988
  --raw With --json: include full raw objects (tool_use, tool_result, thinking)
1990
1989
 
1991
- RALPH LOOP OPTIONS (for ralph-start):
1992
- --context-mode <mode> fresh (new process each iteration) or continue (same process)
1993
- --completion-promise <text> Completion signal text (default: DONE)
1994
- --max-iterations <n> Max iterations (default: 10)
1995
- --cooldown <sec> Delay between iterations (default: 1)
1990
+ LOOP OPTIONS (for loop-start):
1991
+ --criteria <text> Success criteria \u2014 how we'll know it's done (seeds the evaluator)
1992
+ --oracle <cmd> Pass/fail command (tests/build/lint) the gate runs each iteration
1993
+ --max <n> Max iterations before giving up (default: 20)
1994
+ --evaluator <on|off> Independent evaluator that judges "done" (default: on)
1996
1995
 
1997
1996
  EXIT CODES (for wait, send --wait, spawn --wait):
1998
1997
  0 Agent is idle (task completed successfully)
@@ -2045,9 +2044,9 @@ EXAMPLES:
2045
2044
  # === Isolated session with network restrictions ===
2046
2045
  svamp session spawn claude -d /tmp/sandbox --isolate --deny-network
2047
2046
 
2048
- # === Ralph Loop: iterative task automation ===
2049
- svamp session ralph-start abc1 "Fix all linting errors" \\
2050
- --context-mode fresh --max-iterations 10
2047
+ # === Loop: self-verifying iterative automation ===
2048
+ svamp session loop-start abc1 "Fix all linting errors" \\
2049
+ --criteria "eslint reports zero errors" --oracle "npm run lint" --max 15
2051
2050
  `);
2052
2051
  }
2053
2052
  function printMachineHelp() {
@@ -2082,7 +2081,7 @@ Examples:
2082
2081
  async function printSkillsHelp() {
2083
2082
  let browseUrl = "<HYPHA_SERVER_URL>/<workspace>/artifacts/marketplace (set HYPHA_SERVER_URL)";
2084
2083
  try {
2085
- const { getArtifactBaseUrl, getSkillsCollectionName } = await import('./run-DxzG-3JD.mjs').then(function (n) { return n.Z; });
2084
+ const { getArtifactBaseUrl, getSkillsCollectionName } = await import('./run-CsMTSngP.mjs').then(function (n) { return n.Z; });
2086
2085
  browseUrl = `${getArtifactBaseUrl()}/${getSkillsCollectionName()}`;
2087
2086
  } catch {
2088
2087
  }
@@ -1,11 +1,11 @@
1
1
  import { writeFileSync, readFileSync } from 'fs';
2
2
  import { resolve } from 'path';
3
- import { connectAndGetMachine } from './commands-DIhhodx8.mjs';
3
+ import { connectAndGetMachine } from './commands-CdxEOPUt.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-DxzG-3JD.mjs';
8
+ import './run-CsMTSngP.mjs';
9
9
  import 'os';
10
10
  import 'fs/promises';
11
11
  import 'url';
@@ -1,6 +1,6 @@
1
1
  import { execFileSync } from 'node:child_process';
2
2
  import { createServer } from 'node:http';
3
- import { R as RoutineStore, m as RoutineRunner } from './run-DxzG-3JD.mjs';
3
+ import { R as RoutineStore, m as RoutineRunner } from './run-CsMTSngP.mjs';
4
4
  import 'os';
5
5
  import 'fs/promises';
6
6
  import 'fs';
@@ -2,7 +2,7 @@ import { existsSync, readFileSync } from 'node:fs';
2
2
  import { execSync } from 'node:child_process';
3
3
  import { basename, resolve, join } from 'node:path';
4
4
  import os from 'node:os';
5
- import { F as normalizeAllowedUser, G as loadSecurityContextConfig, H as resolveSecurityContext, I as buildSecurityContextFromFlags, J as mergeSecurityContexts, c as connectToHypha, K as buildSessionShareUrl, L as computeOutboundHop, M as buildMachineShareUrl } from './run-DxzG-3JD.mjs';
5
+ import { F as normalizeAllowedUser, G as loadSecurityContextConfig, H as resolveSecurityContext, I as buildSecurityContextFromFlags, J as mergeSecurityContexts, c as connectToHypha, K as buildSessionShareUrl, L as computeOutboundHop, M as buildMachineShareUrl } from './run-CsMTSngP.mjs';
6
6
  import 'os';
7
7
  import 'fs/promises';
8
8
  import 'fs';
@@ -1221,8 +1221,7 @@ async function sessionInfo(sessionId, machineId, opts) {
1221
1221
  sessionLink: metadata.sessionLink?.url || void 0,
1222
1222
  tags: metadata.tags?.length ? metadata.tags : void 0,
1223
1223
  parentSessionId: metadata.parentSessionId || void 0,
1224
- pendingPermissions: pendingPermissions.length > 0 ? pendingPermissions : void 0,
1225
- ralphLoop: metadata.ralphLoop || void 0
1224
+ pendingPermissions: pendingPermissions.length > 0 ? pendingPermissions : void 0
1226
1225
  };
1227
1226
  if (opts?.json) {
1228
1227
  console.log(formatJson(statusData));
@@ -2263,69 +2262,62 @@ async function machineLs(machineId, path, showHidden) {
2263
2262
  await server.disconnect();
2264
2263
  }
2265
2264
  }
2266
- async function sessionRalphStart(sessionIdPartial, task, machineId, opts) {
2265
+ async function sessionLoopStart(sessionIdPartial, task, machineId, opts) {
2267
2266
  const { server, machine, fullId } = await connectAndResolveSession(sessionIdPartial, machineId);
2268
2267
  try {
2269
2268
  const svc = getSessionProxy(machine, fullId);
2270
- const { metadata } = await svc.getMetadata();
2271
- if (metadata?.ralphLoop?.active) {
2272
- console.error(`Ralph loop is already active (iteration ${metadata.ralphLoop.currentIteration}). Cancel it first with: svamp session ralph-cancel ${sessionIdPartial}`);
2273
- process.exit(1);
2274
- }
2275
- const completionPromise = opts?.completionPromise || "DONE";
2276
- const maxIterations = opts?.maxIterations ?? 0;
2277
- const cooldownSeconds = opts?.cooldownSeconds ?? 1;
2278
- const contextMode = opts?.contextMode || void 0;
2269
+ const maxIterations = opts?.maxIterations ?? 20;
2270
+ const evaluator = opts?.evaluator !== false;
2279
2271
  await svc.updateConfig({
2280
- ralph_loop: {
2272
+ loop: {
2281
2273
  task,
2282
- completion_promise: completionPromise,
2274
+ ...opts?.criteria ? { criteria: opts.criteria } : {},
2275
+ ...opts?.oracle ? { oracle: opts.oracle } : {},
2283
2276
  max_iterations: maxIterations,
2284
- cooldown_seconds: cooldownSeconds,
2285
- ...contextMode ? { context_mode: contextMode } : {}
2277
+ evaluator
2286
2278
  }
2287
2279
  });
2288
- console.log(`Ralph loop started on session ${fullId.slice(0, 8)}`);
2280
+ console.log(`Loop started on session ${fullId.slice(0, 8)}`);
2289
2281
  console.log(` Task: ${task.slice(0, 100)}${task.length > 100 ? "..." : ""}`);
2290
- console.log(` Completion promise: ${completionPromise}`);
2291
- console.log(` Max iterations: ${maxIterations > 0 ? maxIterations : "unlimited"}`);
2292
- if (contextMode) console.log(` Context mode: ${contextMode}`);
2282
+ if (opts?.criteria) console.log(` Success criteria: ${opts.criteria.slice(0, 100)}`);
2283
+ console.log(` Oracle: ${opts?.oracle || "(none)"}`);
2284
+ console.log(` Evaluator: ${evaluator ? "on" : "off"}`);
2285
+ console.log(` Max iterations: ${maxIterations}`);
2293
2286
  } finally {
2294
2287
  await server.disconnect();
2295
2288
  }
2296
2289
  }
2297
- async function sessionRalphCancel(sessionIdPartial, machineId) {
2290
+ async function sessionLoopCancel(sessionIdPartial, machineId) {
2298
2291
  const { server, machine, fullId } = await connectAndResolveSession(sessionIdPartial, machineId);
2299
2292
  try {
2300
2293
  const svc = getSessionProxy(machine, fullId);
2301
- const { metadata } = await svc.getMetadata();
2302
- if (!metadata?.ralphLoop?.active) {
2303
- console.log("No active Ralph loop on this session.");
2304
- return;
2305
- }
2306
- const iteration = metadata.ralphLoop.currentIteration;
2307
- await svc.updateConfig({ ralph_loop: null });
2308
- console.log(`Ralph loop cancelled on session ${fullId.slice(0, 8)} (was at iteration ${iteration})`);
2294
+ await svc.updateConfig({ loop: null });
2295
+ console.log(`Loop cancelled on session ${fullId.slice(0, 8)}`);
2309
2296
  } finally {
2310
2297
  await server.disconnect();
2311
2298
  }
2312
2299
  }
2313
- async function sessionRalphStatus(sessionIdPartial, machineId) {
2300
+ async function sessionLoopStatus(sessionIdPartial, machineId) {
2314
2301
  const { server, machine, fullId } = await connectAndResolveSession(sessionIdPartial, machineId);
2315
2302
  try {
2316
2303
  const svc = getSessionProxy(machine, fullId);
2317
- const { metadata } = await svc.getMetadata();
2318
- const ralph = metadata?.ralphLoop;
2319
- if (!ralph || !ralph.active) {
2320
- console.log("No Ralph loop configured on this session.");
2304
+ let state = null;
2305
+ try {
2306
+ const raw = await svc.readFile(".claude/loop/loop-state.json");
2307
+ const content = typeof raw === "string" ? raw : raw?.content;
2308
+ if (content) state = JSON.parse(Buffer.from(content, "base64").toString("utf-8"));
2309
+ } catch {
2310
+ }
2311
+ if (!state) {
2312
+ console.log("No loop configured on this session.");
2321
2313
  return;
2322
2314
  }
2323
- console.log(`Ralph loop on session ${fullId.slice(0, 8)}:`);
2324
- console.log(` Active: ${ralph.active}`);
2325
- console.log(` Task: ${ralph.task?.slice(0, 100)}${ralph.task?.length > 100 ? "..." : ""}`);
2326
- console.log(` Completion promise: ${ralph.completionPromise}`);
2327
- console.log(` Iteration: ${ralph.currentIteration}${ralph.maxIterations > 0 ? `/${ralph.maxIterations}` : " (unlimited)"}`);
2328
- console.log(` Started at: ${ralph.startedAt}`);
2315
+ console.log(`Loop on session ${fullId.slice(0, 8)}:`);
2316
+ console.log(` Phase: ${state.phase || (state.active === false ? "inactive" : "running")}`);
2317
+ console.log(` Iteration: ${state.iteration ?? 0}`);
2318
+ if (state.last_oracle) console.log(` Last oracle: ${String(state.last_oracle).split("\n")[0]}`);
2319
+ if (state.gave_up_reason) console.log(` Gave up: ${state.gave_up_reason}`);
2320
+ if (state.started_at) console.log(` Started at: ${state.started_at}`);
2329
2321
  } finally {
2330
2322
  await server.disconnect();
2331
2323
  }
@@ -2463,4 +2455,4 @@ async function sessionInboxClear(sessionIdPartial, machineId, opts) {
2463
2455
  }
2464
2456
  }
2465
2457
 
2466
- export { collectAssistantResponse, connectAndGetMachine, connectAndResolveSession, createWorktree, generateWorktreeName, machineExec, machineInfo, machineLs, machineShare, parseShareArg, queryCore, renderMessage, resolveSessionId, sendCore, sessionApprove, sessionArchive, sessionAttach, sessionDelete, sessionDeny, sessionInboxClear, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxSend, sessionInfo, sessionList, sessionMachines, sessionMessages, sessionQuery, sessionRalphCancel, sessionRalphStart, sessionRalphStatus, sessionResume, sessionSend, sessionShare, sessionSpawn, sessionWait, sessionWhoami, snapshotLatestSeq, validateSendOptions, wiseAskCli };
2458
+ export { collectAssistantResponse, connectAndGetMachine, connectAndResolveSession, createWorktree, generateWorktreeName, machineExec, machineInfo, machineLs, machineShare, parseShareArg, queryCore, renderMessage, resolveSessionId, sendCore, sessionApprove, sessionArchive, sessionAttach, sessionDelete, sessionDeny, sessionInboxClear, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxSend, sessionInfo, sessionList, sessionLoopCancel, sessionLoopStart, sessionLoopStatus, sessionMachines, sessionMessages, sessionQuery, sessionResume, sessionSend, sessionShare, sessionSpawn, sessionWait, sessionWhoami, snapshotLatestSeq, validateSendOptions, wiseAskCli };