svamp-cli 0.2.70 → 0.2.72
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.
- package/dist/{agentCommands-BaQIO1T2.mjs → agentCommands-C1Q4jqOT.mjs} +2 -2
- package/dist/cli.mjs +34 -34
- package/dist/{commands-CB03m9-Z.mjs → commands-Cyp2k10B.mjs} +2 -2
- package/dist/{commands-CdGLuwtQ.mjs → commands-DJVdDzTe.mjs} +3 -3
- package/dist/{commands-BMOelGYC.mjs → commands-DV0URNXH.mjs} +7 -3
- package/dist/index.mjs +1 -1
- package/dist/{package-Cw40xKCx.mjs → package-hpa4sCE_.mjs} +2 -2
- package/dist/pinnedClaudeCode-HydRNEt7.mjs +58 -0
- package/dist/{run-BqAe7GgA.mjs → run-CC-0bNTe.mjs} +57 -28
- package/dist/{run-Di-48dsY.mjs → run-D4yrAi1I.mjs} +1 -1
- package/dist/{serveCommands-DpKi_PuD.mjs → serveCommands-BeQKrUIn.mjs} +5 -5
- package/dist/{serveManager-Dy4afaLH.mjs → serveManager-B9cemdRt.mjs} +1 -1
- package/package.json +2 -2
|
@@ -148,7 +148,7 @@ async function sessionBroadcast(action, args) {
|
|
|
148
148
|
console.log(`Broadcast sent: ${action}`);
|
|
149
149
|
}
|
|
150
150
|
async function connectToMachineService() {
|
|
151
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
151
|
+
const { connectAndGetMachine } = await import('./commands-DV0URNXH.mjs');
|
|
152
152
|
return connectAndGetMachine();
|
|
153
153
|
}
|
|
154
154
|
async function inboxSend(targetSessionId, opts) {
|
|
@@ -165,7 +165,7 @@ async function inboxSend(targetSessionId, opts) {
|
|
|
165
165
|
}
|
|
166
166
|
const { server, machine } = await connectToMachineService();
|
|
167
167
|
try {
|
|
168
|
-
const { resolveSessionId } = await import('./commands-
|
|
168
|
+
const { resolveSessionId } = await import('./commands-DV0URNXH.mjs');
|
|
169
169
|
const sessions = await machine.listSessions();
|
|
170
170
|
const match = resolveSessionId(sessions, targetSessionId);
|
|
171
171
|
const fullTargetId = match.sessionId;
|
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as startDaemon, b as stopDaemon, d as daemonStatus } from './run-
|
|
1
|
+
import { s as startDaemon, b as stopDaemon, d as daemonStatus } from './run-CC-0bNTe.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -44,7 +44,7 @@ async function main() {
|
|
|
44
44
|
console.error(`svamp daemon restart: ${err.message || err}`);
|
|
45
45
|
process.exit(1);
|
|
46
46
|
}
|
|
47
|
-
const { restartDaemon } = await import('./run-
|
|
47
|
+
const { restartDaemon } = await import('./run-CC-0bNTe.mjs').then(function (n) { return n.u; });
|
|
48
48
|
await restartDaemon();
|
|
49
49
|
process.exit(0);
|
|
50
50
|
}
|
|
@@ -280,7 +280,7 @@ async function main() {
|
|
|
280
280
|
console.error("svamp service: Service commands are not available in sandboxed sessions.");
|
|
281
281
|
process.exit(1);
|
|
282
282
|
}
|
|
283
|
-
const { handleServiceCommand } = await import('./commands-
|
|
283
|
+
const { handleServiceCommand } = await import('./commands-DJVdDzTe.mjs');
|
|
284
284
|
await handleServiceCommand();
|
|
285
285
|
} else if (subcommand === "serve") {
|
|
286
286
|
const { isSandboxed: isSandboxedServe } = await import('./sandboxDetect-DNTcbgWD.mjs');
|
|
@@ -288,7 +288,7 @@ async function main() {
|
|
|
288
288
|
console.error("svamp serve: Serve commands are not available in sandboxed sessions.");
|
|
289
289
|
process.exit(1);
|
|
290
290
|
}
|
|
291
|
-
const { handleServeCommand } = await import('./serveCommands-
|
|
291
|
+
const { handleServeCommand } = await import('./serveCommands-BeQKrUIn.mjs');
|
|
292
292
|
await handleServeCommand();
|
|
293
293
|
process.exit(0);
|
|
294
294
|
} else if (subcommand === "process" || subcommand === "proc") {
|
|
@@ -297,7 +297,7 @@ async function main() {
|
|
|
297
297
|
console.error("svamp process: Process commands are not available in sandboxed sessions.");
|
|
298
298
|
process.exit(1);
|
|
299
299
|
}
|
|
300
|
-
const { processCommand } = await import('./commands-
|
|
300
|
+
const { processCommand } = await import('./commands-Cyp2k10B.mjs');
|
|
301
301
|
let machineId;
|
|
302
302
|
const processArgs = args.slice(1);
|
|
303
303
|
const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
|
|
@@ -315,7 +315,7 @@ async function main() {
|
|
|
315
315
|
} else if (!subcommand || subcommand === "start") {
|
|
316
316
|
await handleInteractiveCommand();
|
|
317
317
|
} else if (subcommand === "--version" || subcommand === "-v") {
|
|
318
|
-
const pkg = await import('./package-
|
|
318
|
+
const pkg = await import('./package-hpa4sCE_.mjs').catch(() => ({ default: { version: "unknown" } }));
|
|
319
319
|
console.log(`svamp version: ${pkg.default.version}`);
|
|
320
320
|
} else {
|
|
321
321
|
console.error(`Unknown command: ${subcommand}`);
|
|
@@ -324,7 +324,7 @@ async function main() {
|
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
async function handleInteractiveCommand() {
|
|
327
|
-
const { runInteractive } = await import('./run-
|
|
327
|
+
const { runInteractive } = await import('./run-D4yrAi1I.mjs');
|
|
328
328
|
const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
|
|
329
329
|
let directory = process.cwd();
|
|
330
330
|
let resumeSessionId;
|
|
@@ -369,7 +369,7 @@ async function handleAgentCommand() {
|
|
|
369
369
|
return;
|
|
370
370
|
}
|
|
371
371
|
if (agentArgs[0] === "list") {
|
|
372
|
-
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-
|
|
372
|
+
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-CC-0bNTe.mjs').then(function (n) { return n.p; });
|
|
373
373
|
console.log("Known agents:");
|
|
374
374
|
for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
|
|
375
375
|
console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
|
|
@@ -381,7 +381,7 @@ async function handleAgentCommand() {
|
|
|
381
381
|
console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
|
|
382
382
|
return;
|
|
383
383
|
}
|
|
384
|
-
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-
|
|
384
|
+
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-CC-0bNTe.mjs').then(function (n) { return n.p; });
|
|
385
385
|
let cwd = process.cwd();
|
|
386
386
|
const filteredArgs = [];
|
|
387
387
|
for (let i = 0; i < agentArgs.length; i++) {
|
|
@@ -405,12 +405,12 @@ async function handleAgentCommand() {
|
|
|
405
405
|
console.log(`Starting ${config.agentName} agent in ${cwd}...`);
|
|
406
406
|
let backend;
|
|
407
407
|
if (KNOWN_MCP_AGENTS[config.agentName]) {
|
|
408
|
-
const { CodexMcpBackend } = await import('./run-
|
|
408
|
+
const { CodexMcpBackend } = await import('./run-CC-0bNTe.mjs').then(function (n) { return n.q; });
|
|
409
409
|
backend = new CodexMcpBackend({ cwd, log: logFn });
|
|
410
410
|
} else {
|
|
411
|
-
const { AcpBackend } = await import('./run-
|
|
412
|
-
const { GeminiTransport } = await import('./run-
|
|
413
|
-
const { DefaultTransport } = await import('./run-
|
|
411
|
+
const { AcpBackend } = await import('./run-CC-0bNTe.mjs').then(function (n) { return n.o; });
|
|
412
|
+
const { GeminiTransport } = await import('./run-CC-0bNTe.mjs').then(function (n) { return n.G; });
|
|
413
|
+
const { DefaultTransport } = await import('./run-CC-0bNTe.mjs').then(function (n) { return n.D; });
|
|
414
414
|
const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
|
|
415
415
|
backend = new AcpBackend({
|
|
416
416
|
agentName: config.agentName,
|
|
@@ -537,7 +537,7 @@ async function handleSessionCommand() {
|
|
|
537
537
|
process.exit(1);
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
|
-
const { sessionList, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-
|
|
540
|
+
const { sessionList, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-DV0URNXH.mjs');
|
|
541
541
|
const parseFlagStr = (flag, shortFlag) => {
|
|
542
542
|
for (let i = 1; i < sessionArgs.length; i++) {
|
|
543
543
|
if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
|
|
@@ -603,7 +603,7 @@ async function handleSessionCommand() {
|
|
|
603
603
|
allowDomain.push(sessionArgs[++i]);
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
|
-
const { parseShareArg } = await import('./commands-
|
|
606
|
+
const { parseShareArg } = await import('./commands-DV0URNXH.mjs');
|
|
607
607
|
const shareEntries = share.map((s) => parseShareArg(s));
|
|
608
608
|
await sessionSpawn(agent, dir, targetMachineId, {
|
|
609
609
|
message,
|
|
@@ -687,7 +687,7 @@ async function handleSessionCommand() {
|
|
|
687
687
|
console.error(" Spawns a stateless Claude session in <directory>, sends <prompt>, prints the answer, then deletes the session.");
|
|
688
688
|
process.exit(1);
|
|
689
689
|
}
|
|
690
|
-
const { sessionQuery } = await import('./commands-
|
|
690
|
+
const { sessionQuery } = await import('./commands-DV0URNXH.mjs');
|
|
691
691
|
await sessionQuery(dir, prompt, targetMachineId, {
|
|
692
692
|
timeout: parseFlagInt("--timeout"),
|
|
693
693
|
json: hasFlag("--json"),
|
|
@@ -720,7 +720,7 @@ async function handleSessionCommand() {
|
|
|
720
720
|
console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
|
|
721
721
|
process.exit(1);
|
|
722
722
|
}
|
|
723
|
-
const { sessionApprove } = await import('./commands-
|
|
723
|
+
const { sessionApprove } = await import('./commands-DV0URNXH.mjs');
|
|
724
724
|
const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
725
725
|
await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
|
|
726
726
|
json: hasFlag("--json")
|
|
@@ -730,7 +730,7 @@ async function handleSessionCommand() {
|
|
|
730
730
|
console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
|
|
731
731
|
process.exit(1);
|
|
732
732
|
}
|
|
733
|
-
const { sessionDeny } = await import('./commands-
|
|
733
|
+
const { sessionDeny } = await import('./commands-DV0URNXH.mjs');
|
|
734
734
|
const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
735
735
|
await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
|
|
736
736
|
json: hasFlag("--json")
|
|
@@ -766,7 +766,7 @@ async function handleSessionCommand() {
|
|
|
766
766
|
console.error("Usage: svamp session set-title <title>");
|
|
767
767
|
process.exit(1);
|
|
768
768
|
}
|
|
769
|
-
const { sessionSetTitle } = await import('./agentCommands-
|
|
769
|
+
const { sessionSetTitle } = await import('./agentCommands-C1Q4jqOT.mjs');
|
|
770
770
|
await sessionSetTitle(title);
|
|
771
771
|
} else if (sessionSubcommand === "set-link") {
|
|
772
772
|
const url = sessionArgs[1];
|
|
@@ -775,7 +775,7 @@ async function handleSessionCommand() {
|
|
|
775
775
|
process.exit(1);
|
|
776
776
|
}
|
|
777
777
|
const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
778
|
-
const { sessionSetLink } = await import('./agentCommands-
|
|
778
|
+
const { sessionSetLink } = await import('./agentCommands-C1Q4jqOT.mjs');
|
|
779
779
|
await sessionSetLink(url, label);
|
|
780
780
|
} else if (sessionSubcommand === "notify") {
|
|
781
781
|
const message = sessionArgs[1];
|
|
@@ -784,7 +784,7 @@ async function handleSessionCommand() {
|
|
|
784
784
|
process.exit(1);
|
|
785
785
|
}
|
|
786
786
|
const level = parseFlagStr("--level") || "info";
|
|
787
|
-
const { sessionNotify } = await import('./agentCommands-
|
|
787
|
+
const { sessionNotify } = await import('./agentCommands-C1Q4jqOT.mjs');
|
|
788
788
|
await sessionNotify(message, level);
|
|
789
789
|
} else if (sessionSubcommand === "broadcast") {
|
|
790
790
|
const action = sessionArgs[1];
|
|
@@ -792,7 +792,7 @@ async function handleSessionCommand() {
|
|
|
792
792
|
console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
|
|
793
793
|
process.exit(1);
|
|
794
794
|
}
|
|
795
|
-
const { sessionBroadcast } = await import('./agentCommands-
|
|
795
|
+
const { sessionBroadcast } = await import('./agentCommands-C1Q4jqOT.mjs');
|
|
796
796
|
await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
|
|
797
797
|
} else if (sessionSubcommand === "inbox") {
|
|
798
798
|
const inboxSubcmd = sessionArgs[1];
|
|
@@ -803,7 +803,7 @@ async function handleSessionCommand() {
|
|
|
803
803
|
process.exit(1);
|
|
804
804
|
}
|
|
805
805
|
if (agentSessionId) {
|
|
806
|
-
const { inboxSend } = await import('./agentCommands-
|
|
806
|
+
const { inboxSend } = await import('./agentCommands-C1Q4jqOT.mjs');
|
|
807
807
|
await inboxSend(sessionArgs[2], {
|
|
808
808
|
body: sessionArgs[3],
|
|
809
809
|
subject: parseFlagStr("--subject"),
|
|
@@ -818,7 +818,7 @@ async function handleSessionCommand() {
|
|
|
818
818
|
}
|
|
819
819
|
} else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
|
|
820
820
|
if (agentSessionId && !sessionArgs[2]) {
|
|
821
|
-
const { inboxList } = await import('./agentCommands-
|
|
821
|
+
const { inboxList } = await import('./agentCommands-C1Q4jqOT.mjs');
|
|
822
822
|
await inboxList({
|
|
823
823
|
unread: hasFlag("--unread"),
|
|
824
824
|
limit: parseFlagInt("--limit"),
|
|
@@ -840,7 +840,7 @@ async function handleSessionCommand() {
|
|
|
840
840
|
process.exit(1);
|
|
841
841
|
}
|
|
842
842
|
if (agentSessionId && !sessionArgs[3]) {
|
|
843
|
-
const { inboxList } = await import('./agentCommands-
|
|
843
|
+
const { inboxList } = await import('./agentCommands-C1Q4jqOT.mjs');
|
|
844
844
|
await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
|
|
845
845
|
} else if (sessionArgs[3]) {
|
|
846
846
|
await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
|
|
@@ -850,7 +850,7 @@ async function handleSessionCommand() {
|
|
|
850
850
|
}
|
|
851
851
|
} else if (inboxSubcmd === "reply") {
|
|
852
852
|
if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
|
|
853
|
-
const { inboxReply } = await import('./agentCommands-
|
|
853
|
+
const { inboxReply } = await import('./agentCommands-C1Q4jqOT.mjs');
|
|
854
854
|
await inboxReply(sessionArgs[2], sessionArgs[3]);
|
|
855
855
|
} else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
|
|
856
856
|
await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
|
|
@@ -886,7 +886,7 @@ async function handleMachineCommand() {
|
|
|
886
886
|
return;
|
|
887
887
|
}
|
|
888
888
|
if (machineSubcommand === "share") {
|
|
889
|
-
const { machineShare } = await import('./commands-
|
|
889
|
+
const { machineShare } = await import('./commands-DV0URNXH.mjs');
|
|
890
890
|
let machineId;
|
|
891
891
|
const shareArgs = [];
|
|
892
892
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
@@ -916,7 +916,7 @@ async function handleMachineCommand() {
|
|
|
916
916
|
}
|
|
917
917
|
await machineShare(machineId, { add, remove, list, configPath, showConfig });
|
|
918
918
|
} else if (machineSubcommand === "exec") {
|
|
919
|
-
const { machineExec } = await import('./commands-
|
|
919
|
+
const { machineExec } = await import('./commands-DV0URNXH.mjs');
|
|
920
920
|
let machineId;
|
|
921
921
|
let cwd;
|
|
922
922
|
const cmdParts = [];
|
|
@@ -936,7 +936,7 @@ async function handleMachineCommand() {
|
|
|
936
936
|
}
|
|
937
937
|
await machineExec(machineId, command, cwd);
|
|
938
938
|
} else if (machineSubcommand === "info") {
|
|
939
|
-
const { machineInfo } = await import('./commands-
|
|
939
|
+
const { machineInfo } = await import('./commands-DV0URNXH.mjs');
|
|
940
940
|
let machineId;
|
|
941
941
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
942
942
|
if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
|
|
@@ -956,10 +956,10 @@ async function handleMachineCommand() {
|
|
|
956
956
|
level = machineArgs[++i];
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
|
-
const { machineNotify } = await import('./agentCommands-
|
|
959
|
+
const { machineNotify } = await import('./agentCommands-C1Q4jqOT.mjs');
|
|
960
960
|
await machineNotify(message, level);
|
|
961
961
|
} else if (machineSubcommand === "ls") {
|
|
962
|
-
const { machineLs } = await import('./commands-
|
|
962
|
+
const { machineLs } = await import('./commands-DV0URNXH.mjs');
|
|
963
963
|
let machineId;
|
|
964
964
|
let showHidden = false;
|
|
965
965
|
let path;
|
|
@@ -1429,7 +1429,7 @@ async function applyClaudeAuthFlags(argv) {
|
|
|
1429
1429
|
"--use-hypha-proxy, --use-claude-login, and --anthropic-base-url/--anthropic-api-key are mutually exclusive"
|
|
1430
1430
|
);
|
|
1431
1431
|
}
|
|
1432
|
-
const mod = await import('./run-
|
|
1432
|
+
const mod = await import('./run-CC-0bNTe.mjs').then(function (n) { return n.t; });
|
|
1433
1433
|
if (hasHypha) {
|
|
1434
1434
|
mod.setClaudeAuthHyphaProxy();
|
|
1435
1435
|
console.log("Claude auth configured: hypha-proxy (uses HYPHA_TOKEN live at each spawn).");
|
|
@@ -1467,7 +1467,7 @@ async function applyDaemonShareFlag(argv) {
|
|
|
1467
1467
|
}
|
|
1468
1468
|
}
|
|
1469
1469
|
if (collected.length === 0) return;
|
|
1470
|
-
const { updateEnvFile } = await import('./run-
|
|
1470
|
+
const { updateEnvFile } = await import('./run-CC-0bNTe.mjs').then(function (n) { return n.t; });
|
|
1471
1471
|
const seen = /* @__PURE__ */ new Set();
|
|
1472
1472
|
const deduped = collected.filter((e) => {
|
|
1473
1473
|
const k = e.toLowerCase();
|
|
@@ -1480,7 +1480,7 @@ async function applyDaemonShareFlag(argv) {
|
|
|
1480
1480
|
}
|
|
1481
1481
|
async function handleDaemonAuthCommand(argv) {
|
|
1482
1482
|
const sub = (argv[0] || "status").toLowerCase();
|
|
1483
|
-
const mod = await import('./run-
|
|
1483
|
+
const mod = await import('./run-CC-0bNTe.mjs').then(function (n) { return n.t; });
|
|
1484
1484
|
if (sub === "--help" || sub === "-h" || sub === "help") {
|
|
1485
1485
|
console.log(`
|
|
1486
1486
|
svamp daemon auth \u2014 Configure how Claude subprocesses authenticate
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { writeFileSync, readFileSync } from 'fs';
|
|
2
2
|
import { resolve } from 'path';
|
|
3
|
-
import { connectAndGetMachine } from './commands-
|
|
3
|
+
import { connectAndGetMachine } from './commands-DV0URNXH.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-
|
|
8
|
+
import './run-CC-0bNTe.mjs';
|
|
9
9
|
import 'os';
|
|
10
10
|
import 'fs/promises';
|
|
11
11
|
import 'url';
|
|
@@ -68,7 +68,7 @@ async function serviceExpose(args) {
|
|
|
68
68
|
});
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
71
|
+
const { connectAndGetMachine } = await import('./commands-DV0URNXH.mjs');
|
|
72
72
|
const { server, machine } = await connectAndGetMachine();
|
|
73
73
|
try {
|
|
74
74
|
const status = await machine.tunnelStart({
|
|
@@ -132,7 +132,7 @@ async function serviceServe(args) {
|
|
|
132
132
|
}
|
|
133
133
|
async function serviceList(_args) {
|
|
134
134
|
try {
|
|
135
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
135
|
+
const { connectAndGetMachine } = await import('./commands-DV0URNXH.mjs');
|
|
136
136
|
const { server, machine } = await connectAndGetMachine();
|
|
137
137
|
try {
|
|
138
138
|
const tunnels = await machine.tunnelList({});
|
|
@@ -161,7 +161,7 @@ async function serviceDelete(args) {
|
|
|
161
161
|
process.exit(1);
|
|
162
162
|
}
|
|
163
163
|
try {
|
|
164
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
164
|
+
const { connectAndGetMachine } = await import('./commands-DV0URNXH.mjs');
|
|
165
165
|
const { server, machine } = await connectAndGetMachine();
|
|
166
166
|
try {
|
|
167
167
|
await machine.tunnelStop({ name });
|
|
@@ -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 { n as normalizeAllowedUser, l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha, i as buildSessionShareUrl, j as buildMachineShareUrl } from './run-
|
|
5
|
+
import { n as normalizeAllowedUser, l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha, i as buildSessionShareUrl, j as buildMachineShareUrl } from './run-CC-0bNTe.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
8
8
|
import 'fs';
|
|
@@ -1464,12 +1464,14 @@ async function sendCore(machine, fullId, message, opts) {
|
|
|
1464
1464
|
}
|
|
1465
1465
|
const preSeq = wantResponse ? await snapshotLatestSeq(machine, fullId) : 0;
|
|
1466
1466
|
const { randomUUID } = await import('node:crypto');
|
|
1467
|
+
const callerSessionId = process.env.SVAMP_SESSION_ID;
|
|
1467
1468
|
const inboxMessage = {
|
|
1468
1469
|
messageId: randomUUID(),
|
|
1469
1470
|
body: message,
|
|
1470
1471
|
timestamp: Date.now(),
|
|
1471
1472
|
read: false,
|
|
1472
|
-
from: `cli:${os.userInfo().username}`,
|
|
1473
|
+
from: callerSessionId ? `agent:${callerSessionId}` : `cli:${os.userInfo().username}`,
|
|
1474
|
+
...callerSessionId ? { fromSession: callerSessionId } : {},
|
|
1473
1475
|
to: fullId,
|
|
1474
1476
|
subject: opts?.subject,
|
|
1475
1477
|
urgency: opts?.urgency || "urgent"
|
|
@@ -2100,12 +2102,14 @@ async function sessionInboxSend(sessionIdPartial, body, machineId, opts) {
|
|
|
2100
2102
|
const { server, machine, fullId } = await connectAndResolveSession(sessionIdPartial, machineId);
|
|
2101
2103
|
try {
|
|
2102
2104
|
const { randomUUID } = await import('node:crypto');
|
|
2105
|
+
const callerSessionId = process.env.SVAMP_SESSION_ID;
|
|
2103
2106
|
const message = {
|
|
2104
2107
|
messageId: randomUUID(),
|
|
2105
2108
|
body,
|
|
2106
2109
|
timestamp: Date.now(),
|
|
2107
2110
|
read: false,
|
|
2108
|
-
from: `cli:${os.userInfo().username}`,
|
|
2111
|
+
from: callerSessionId ? `agent:${callerSessionId}` : `cli:${os.userInfo().username}`,
|
|
2112
|
+
...callerSessionId ? { fromSession: callerSessionId } : {},
|
|
2109
2113
|
to: fullId,
|
|
2110
2114
|
subject: opts?.subject,
|
|
2111
2115
|
urgency: opts?.urgency || "normal",
|
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-
|
|
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-CC-0bNTe.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.2.
|
|
2
|
+
var version = "0.2.72";
|
|
3
3
|
var description = "Svamp CLI — AI workspace daemon on Hypha Cloud";
|
|
4
4
|
var author = "Amun AI AB";
|
|
5
5
|
var license = "SEE LICENSE IN LICENSE";
|
|
@@ -19,7 +19,7 @@ var exports$1 = {
|
|
|
19
19
|
var scripts = {
|
|
20
20
|
build: "rm -rf dist bin/skills && mkdir -p bin/skills && cp -r ../../skills/artifact bin/skills/artifact && tsc --noEmit && pkgroll",
|
|
21
21
|
typecheck: "tsc --noEmit",
|
|
22
|
-
test: "npx tsx test/test-context-window.mjs && npx tsx test/test-authorize.mjs && npx tsx test/test-normalize-allowed-user.mjs && npx tsx test/test-share-url.mjs && npx tsx test/test-update-sharing-normalization.mjs && npx tsx test/test-staged-homes-sweep.mjs && npx tsx test/test-session-helpers.mjs && npx tsx test/test-cli-routing.mjs && npx tsx test/test-security-context.mjs && npx tsx test/test-isolation-decision.mjs && npx tsx test/test-ralph-loop.mjs && npx tsx test/test-message-helpers.mjs && npx tsx test/test-agent-config.mjs && npx tsx test/test-wrap-command.mjs && npx tsx test/test-credential-staging.mjs && npx tsx test/test-claude-auth.mjs && npx tsx test/test-output-formatters.mjs && npx tsx test/test-agent-types.mjs && npx tsx test/test-transport.mjs && npx tsx test/test-session-update-handlers.mjs && npx tsx test/test-session-scanner.mjs && npx tsx test/test-hypha-client.mjs && npx tsx test/test-hook-settings.mjs && npx tsx test/test-session-service-logic.mjs && npx tsx test/test-daemon-persistence.mjs && npx tsx test/test-detect-isolation.mjs && npx tsx test/test-machine-service-logic.mjs && npx tsx test/test-interactive-helpers.mjs && npx tsx test/test-codex-backend.mjs && npx tsx test/test-acp-backend.mjs && npx tsx test/test-acp-bridge.mjs && npx tsx test/test-hook-server.mjs && npx tsx test/test-session-commands.mjs && npx tsx test/test-interactive-console.mjs && npx tsx test/test-session-messages.mjs && npx tsx test/test-session-send-query.mjs && npx tsx test/test-skills.mjs && npx tsx test/test-agent-grouping.mjs && npx tsx test/test-ralph-loop-integration.mjs && npx tsx test/test-ralph-loop-modes.mjs && npx tsx test/test-machine-list-directory.mjs && npx tsx test/test-service-commands.mjs && npx tsx test/test-supervisor.mjs && npx tsx test/test-supervisor-lock.mjs && npx tsx test/test-clear-detection.mjs && npx tsx test/test-session-consolidation.mjs && npx tsx test/test-inbox.mjs && npx tsx test/test-session-rpc-dispatch.mjs && npx tsx test/test-sandbox-cli.mjs && npx tsx test/test-serve-manager.mjs && npx tsx test/test-serve-stability.mjs && npx tsx test/test-frpc-e2e.mjs --unit-only",
|
|
22
|
+
test: "npx tsx test/test-context-window.mjs && npx tsx test/test-authorize.mjs && npx tsx test/test-normalize-allowed-user.mjs && npx tsx test/test-share-url.mjs && npx tsx test/test-update-sharing-normalization.mjs && npx tsx test/test-staged-homes-sweep.mjs && npx tsx test/test-session-helpers.mjs && npx tsx test/test-cli-routing.mjs && npx tsx test/test-security-context.mjs && npx tsx test/test-isolation-decision.mjs && npx tsx test/test-ralph-loop.mjs && npx tsx test/test-message-helpers.mjs && npx tsx test/test-agent-config.mjs && npx tsx test/test-wrap-command.mjs && npx tsx test/test-credential-staging.mjs && npx tsx test/test-claude-auth.mjs && npx tsx test/test-output-formatters.mjs && npx tsx test/test-agent-types.mjs && npx tsx test/test-transport.mjs && npx tsx test/test-session-update-handlers.mjs && npx tsx test/test-session-scanner.mjs && npx tsx test/test-hypha-client.mjs && npx tsx test/test-hook-settings.mjs && npx tsx test/test-session-service-logic.mjs && npx tsx test/test-daemon-persistence.mjs && npx tsx test/test-detect-isolation.mjs && npx tsx test/test-machine-service-logic.mjs && npx tsx test/test-interactive-helpers.mjs && npx tsx test/test-codex-backend.mjs && npx tsx test/test-acp-backend.mjs && npx tsx test/test-acp-bridge.mjs && npx tsx test/test-hook-server.mjs && npx tsx test/test-session-commands.mjs && npx tsx test/test-interactive-console.mjs && npx tsx test/test-session-messages.mjs && npx tsx test/test-session-send-query.mjs && npx tsx test/test-skills.mjs && npx tsx test/test-agent-grouping.mjs && npx tsx test/test-ralph-loop-integration.mjs && npx tsx test/test-ralph-loop-modes.mjs && npx tsx test/test-machine-list-directory.mjs && npx tsx test/test-service-commands.mjs && npx tsx test/test-supervisor.mjs && npx tsx test/test-supervisor-lock.mjs && npx tsx test/test-clear-detection.mjs && npx tsx test/test-session-consolidation.mjs && npx tsx test/test-inbox.mjs && npx tsx test/test-session-rpc-dispatch.mjs && npx tsx test/test-sandbox-cli.mjs && npx tsx test/test-serve-manager.mjs && npx tsx test/test-serve-stability.mjs && npx tsx test/test-frpc-e2e.mjs --unit-only && node test/pinnedClaudeCode.test.mjs",
|
|
23
23
|
"test:hypha": "node --no-warnings test/test-hypha-service.mjs",
|
|
24
24
|
dev: "tsx src/cli.ts",
|
|
25
25
|
"dev:daemon": "tsx src/cli.ts daemon start-sync",
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { spawn, exec as exec$1 } from 'node:child_process';
|
|
2
|
+
import { promisify } from 'node:util';
|
|
3
|
+
|
|
4
|
+
const PINNED_CLAUDE_CODE_VERSION = "2.1.168";
|
|
5
|
+
const exec = promisify(exec$1);
|
|
6
|
+
async function readClaudeVersion() {
|
|
7
|
+
try {
|
|
8
|
+
const { stdout } = await exec("claude --version", { timeout: 1e4 });
|
|
9
|
+
const m = stdout.trim().match(/(\d+\.\d+\.\d+(?:[-.][\w]+)?)/);
|
|
10
|
+
return m ? m[1] : null;
|
|
11
|
+
} catch {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function runInstaller(version, log) {
|
|
16
|
+
return new Promise((resolve) => {
|
|
17
|
+
const proc = spawn("claude", ["install", version], { stdio: ["ignore", "pipe", "pipe"] });
|
|
18
|
+
let stderr = "";
|
|
19
|
+
proc.stdout?.on("data", (b) => log(`[claude install] ${b.toString().trimEnd()}`));
|
|
20
|
+
proc.stderr?.on("data", (b) => {
|
|
21
|
+
const s = b.toString();
|
|
22
|
+
stderr += s;
|
|
23
|
+
log(`[claude install] ${s.trimEnd()}`);
|
|
24
|
+
});
|
|
25
|
+
proc.on("error", (e) => {
|
|
26
|
+
stderr += String(e);
|
|
27
|
+
resolve({ ok: false, stderr });
|
|
28
|
+
});
|
|
29
|
+
proc.on("exit", (code) => resolve({ ok: code === 0, stderr }));
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
async function ensureClaudeCodeVersion(log, pinned = PINNED_CLAUDE_CODE_VERSION, opts) {
|
|
33
|
+
const autoInstall = opts?.allowAutoInstall !== false;
|
|
34
|
+
const current = await readClaudeVersion();
|
|
35
|
+
if (!current) {
|
|
36
|
+
log(`[claude-version] 'claude' not on PATH \u2014 please run the Anthropic installer once: curl -fsSL https://claude.ai/install.sh | sh`);
|
|
37
|
+
return { kind: "not-installed", want: pinned };
|
|
38
|
+
}
|
|
39
|
+
if (current === pinned) {
|
|
40
|
+
log(`[claude-version] OK \u2014 claude ${current} matches pinned ${pinned}`);
|
|
41
|
+
return { kind: "ok", version: current };
|
|
42
|
+
}
|
|
43
|
+
if (!autoInstall) {
|
|
44
|
+
log(`[claude-version] DRIFT \u2014 installed ${current} \u2260 pinned ${pinned} (auto-install disabled)`);
|
|
45
|
+
return { kind: "skipped", reason: `installed=${current} pinned=${pinned}` };
|
|
46
|
+
}
|
|
47
|
+
log(`[claude-version] DRIFT \u2014 installed ${current} \u2260 pinned ${pinned}; running 'claude install ${pinned}'`);
|
|
48
|
+
const { ok, stderr } = await runInstaller(pinned, log);
|
|
49
|
+
if (!ok) {
|
|
50
|
+
log(`[claude-version] install failed for ${pinned}: ${stderr.trim().slice(0, 400)}`);
|
|
51
|
+
return { kind: "install-failed", from: current, want: pinned, error: stderr.slice(0, 400) };
|
|
52
|
+
}
|
|
53
|
+
const after = await readClaudeVersion();
|
|
54
|
+
log(`[claude-version] installer finished; now reports ${after ?? "unknown"}`);
|
|
55
|
+
return { kind: "installed", from: current, to: after ?? pinned };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { PINNED_CLAUDE_CODE_VERSION, ensureClaudeCodeVersion };
|
|
@@ -1597,7 +1597,7 @@ async function registerMachineService(server, machineId, metadata, daemonState,
|
|
|
1597
1597
|
}
|
|
1598
1598
|
|
|
1599
1599
|
function isStructuredMessage(msg) {
|
|
1600
|
-
return !!(msg.from
|
|
1600
|
+
return !!(msg.from || msg.fromSession || msg.subject || msg.replyTo || msg.threadId);
|
|
1601
1601
|
}
|
|
1602
1602
|
function escapeXml(s) {
|
|
1603
1603
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
@@ -5703,10 +5703,16 @@ class ServeAuth {
|
|
|
5703
5703
|
return access.some((e) => e.toLowerCase() === email.toLowerCase());
|
|
5704
5704
|
}
|
|
5705
5705
|
/**
|
|
5706
|
-
* Generate the login page HTML.
|
|
5707
|
-
*
|
|
5708
|
-
*
|
|
5709
|
-
*
|
|
5706
|
+
* Generate the login page HTML.
|
|
5707
|
+
*
|
|
5708
|
+
* Uses the Hypha-Login HTTP endpoints directly (no SDK / no WebSocket):
|
|
5709
|
+
* 1. GET /public/services/hypha-login/start → { login_url, key }
|
|
5710
|
+
* 2. open popup to login_url so the user signs in
|
|
5711
|
+
* 3. GET /public/services/hypha-login/check?key=… → token (long-polled)
|
|
5712
|
+
*
|
|
5713
|
+
* This matches the proven pattern in svamp-app/.../share/[id].tsx and
|
|
5714
|
+
* removes a class of hangs we previously saw when the JS SDK never
|
|
5715
|
+
* invoked its `login_callback` (button-stuck-after-click symptom).
|
|
5710
5716
|
*/
|
|
5711
5717
|
getLoginPageHtml(redirectUrl) {
|
|
5712
5718
|
return `<!DOCTYPE html>
|
|
@@ -5729,7 +5735,6 @@ button:disabled{background:#94d3a2;cursor:wait}
|
|
|
5729
5735
|
a{color:#0969da;text-decoration:none}
|
|
5730
5736
|
a:hover{text-decoration:underline}
|
|
5731
5737
|
</style>
|
|
5732
|
-
<script src="https://cdn.jsdelivr.net/npm/hypha-rpc@0.21.28/dist/hypha-rpc-websocket.min.js"><\/script>
|
|
5733
5738
|
</head><body>
|
|
5734
5739
|
<div class="card">
|
|
5735
5740
|
<h1>Sign in required</h1>
|
|
@@ -5751,17 +5756,10 @@ function setError(msg) {
|
|
|
5751
5756
|
}
|
|
5752
5757
|
|
|
5753
5758
|
btn.addEventListener('click', async () => {
|
|
5754
|
-
if (typeof hyphaWebsocketClient === 'undefined' || !hyphaWebsocketClient.login) {
|
|
5755
|
-
setError('Hypha SDK failed to load. Check your network connection and retry.');
|
|
5756
|
-
return;
|
|
5757
|
-
}
|
|
5758
|
-
|
|
5759
5759
|
// Open the popup SYNCHRONOUSLY inside the click handler so the browser's
|
|
5760
|
-
// popup blocker treats it as user-initiated. The
|
|
5761
|
-
//
|
|
5762
|
-
//
|
|
5763
|
-
// blocked \u2014 especially inside sandboxed iframes (canvas, artifact view).
|
|
5764
|
-
// We point it at about:blank first and rewrite the URL once we have it.
|
|
5760
|
+
// popup blocker treats it as user-initiated. The HTTP request below is
|
|
5761
|
+
// awaited, by which time the user-gesture flag has cleared and any
|
|
5762
|
+
// window.open() call would be silently blocked.
|
|
5765
5763
|
const popup = window.open('about:blank', '_blank');
|
|
5766
5764
|
if (!popup) {
|
|
5767
5765
|
setError('Popup was blocked by the browser. Please allow popups for this site and retry.');
|
|
@@ -5770,21 +5768,42 @@ btn.addEventListener('click', async () => {
|
|
|
5770
5768
|
try { popup.document.write('<html><body style="font-family:system-ui;padding:24px;color:#656d76">Opening Hypha sign-in\u2026</body></html>'); } catch (e) {}
|
|
5771
5769
|
|
|
5772
5770
|
btn.disabled = true;
|
|
5773
|
-
statusEl.textContent = '
|
|
5771
|
+
statusEl.textContent = 'Contacting Hypha\u2026';
|
|
5774
5772
|
|
|
5775
5773
|
try {
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
catch (e) { window.open(context.login_url, '_blank'); }
|
|
5782
|
-
},
|
|
5783
|
-
});
|
|
5774
|
+
// 1. Ask the Hypha-Login service for a login URL + polling key.
|
|
5775
|
+
const startResp = await fetch(hyphaServer + '/public/services/hypha-login/start');
|
|
5776
|
+
if (!startResp.ok) throw new Error('Login start failed: HTTP ' + startResp.status);
|
|
5777
|
+
const ctx = await startResp.json();
|
|
5778
|
+
if (!ctx || !ctx.login_url || !ctx.key) throw new Error('Login start returned no URL/key');
|
|
5784
5779
|
|
|
5785
|
-
|
|
5780
|
+
// 2. Redirect the popup to the actual login UI.
|
|
5781
|
+
statusEl.textContent = 'Waiting for you to sign in\u2026';
|
|
5782
|
+
try { popup.location.href = ctx.login_url; }
|
|
5783
|
+
catch (e) { window.open(ctx.login_url, '_blank'); }
|
|
5786
5784
|
|
|
5787
|
-
//
|
|
5785
|
+
// 3. Long-poll the check endpoint until the user finishes signing in.
|
|
5786
|
+
// Each request waits up to 3 s server-side; we retry for ~3 minutes total.
|
|
5787
|
+
const checkBase = ctx.check_url || (hyphaServer + '/public/services/hypha-login/check');
|
|
5788
|
+
let token = null;
|
|
5789
|
+
for (let i = 0; i < 60; i++) {
|
|
5790
|
+
if (popup.closed) {
|
|
5791
|
+
// User dismissed the popup before completing \u2014 keep polling briefly
|
|
5792
|
+
// (the report endpoint may still fire even if window is gone).
|
|
5793
|
+
}
|
|
5794
|
+
try {
|
|
5795
|
+
const r = await fetch(checkBase + '?key=' + encodeURIComponent(ctx.key) + '&timeout=3');
|
|
5796
|
+
if (r.ok) {
|
|
5797
|
+
const body = await r.json();
|
|
5798
|
+
const t = typeof body === 'string' ? body : (body && (body.token || body));
|
|
5799
|
+
if (typeof t === 'string' && t.length > 20) { token = t; break; }
|
|
5800
|
+
}
|
|
5801
|
+
} catch (e) { /* transient \u2014 retry */ }
|
|
5802
|
+
}
|
|
5803
|
+
|
|
5804
|
+
if (!token) throw new Error('Timed out waiting for sign-in. Please try again.');
|
|
5805
|
+
|
|
5806
|
+
// 4. Set the cookie so subsequent requests to this origin are authenticated.
|
|
5788
5807
|
const secure = location.protocol === 'https:' ? '; Secure' : '';
|
|
5789
5808
|
document.cookie = cookieName + '=' + token + '; path=/; SameSite=Lax' + secure;
|
|
5790
5809
|
|
|
@@ -6458,6 +6477,8 @@ You are running inside a Svamp session (id: ${sessionId}) on Hypha Cloud. Use th
|
|
|
6458
6477
|
## Parallel Agents
|
|
6459
6478
|
|
|
6460
6479
|
You may be running in parallel with other agents \u2014 possibly sharing the same working directory. Stay aware of peers: if files change unexpectedly, or you want to initiate collaboration or coordinate to avoid edit conflicts, discover peers with \`svamp session list\` and inspect their activity with \`svamp session info <id>\` / \`svamp session messages <id>\`. Reach out via \`svamp session send <id> "<msg>"\` when coordination is genuinely useful. Keep cross-agent chatter minimal and purposeful: never reply reflexively, avoid ping-pong loops (especially across restarts where queued messages may re-fire), and only initiate contact with a concrete reason. Treat peer messages as informational unless they clearly require action.
|
|
6480
|
+
|
|
6481
|
+
**Inbox messages between agents** arrive wrapped as \`<svamp-message message-id="\u2026" from="agent:\u2026" from-session="\u2026" \u2026>BODY</svamp-message>\`. A plain user turn has no such wrapper \u2014 that's how you tell them apart. To reply to the sender, use \`svamp session inbox reply <message-id> "<body>"\` (auto-routes to \`from-session\`, preserves \`thread-id\`). Replying is optional \u2014 only when it's useful for the work.
|
|
6461
6482
|
`;
|
|
6462
6483
|
}
|
|
6463
6484
|
|
|
@@ -7848,10 +7869,18 @@ async function startDaemon(options) {
|
|
|
7848
7869
|
const list = loadExposedTunnels().filter((t) => t.name !== name);
|
|
7849
7870
|
saveExposedTunnels(list);
|
|
7850
7871
|
}
|
|
7851
|
-
const { ServeManager } = await import('./serveManager-
|
|
7872
|
+
const { ServeManager } = await import('./serveManager-B9cemdRt.mjs');
|
|
7852
7873
|
const serveManager = new ServeManager(SVAMP_HOME, (msg) => logger.log(`[SERVE] ${msg}`), hyphaServerUrl);
|
|
7853
7874
|
ensureAutoInstalledSkills(logger).catch(() => {
|
|
7854
7875
|
});
|
|
7876
|
+
(async () => {
|
|
7877
|
+
try {
|
|
7878
|
+
const { ensureClaudeCodeVersion } = await import('./pinnedClaudeCode-HydRNEt7.mjs');
|
|
7879
|
+
await ensureClaudeCodeVersion((msg) => logger.log(msg));
|
|
7880
|
+
} catch (e) {
|
|
7881
|
+
logger.log(`[claude-version] check failed: ${e?.message || e}`);
|
|
7882
|
+
}
|
|
7883
|
+
})();
|
|
7855
7884
|
preventMachineSleep(logger);
|
|
7856
7885
|
try {
|
|
7857
7886
|
logger.log("Connecting to Hypha server...");
|
|
@@ -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 { resolve, join } from 'node:path';
|
|
4
4
|
import { existsSync, readFileSync, watch } from 'node:fs';
|
|
5
|
-
import { c as connectToHypha, a as registerSessionService, k as generateHookSettings } from './run-
|
|
5
|
+
import { c as connectToHypha, a as registerSessionService, k as generateHookSettings } from './run-CC-0bNTe.mjs';
|
|
6
6
|
import { createServer } from 'node:http';
|
|
7
7
|
import { spawn } from 'node:child_process';
|
|
8
8
|
import { createInterface } from 'node:readline';
|
|
@@ -54,7 +54,7 @@ async function handleServeCommand() {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
async function serveAdd(args, machineId) {
|
|
57
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
57
|
+
const { connectAndGetMachine } = await import('./commands-DV0URNXH.mjs');
|
|
58
58
|
const pos = positionalArgs(args);
|
|
59
59
|
const name = pos[0];
|
|
60
60
|
if (!name) {
|
|
@@ -93,7 +93,7 @@ async function serveAdd(args, machineId) {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
async function serveApply(args, machineId) {
|
|
96
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
96
|
+
const { connectAndGetMachine } = await import('./commands-DV0URNXH.mjs');
|
|
97
97
|
const fs = await import('fs');
|
|
98
98
|
const yaml = await import('yaml');
|
|
99
99
|
const file = positionalArgs(args)[0];
|
|
@@ -182,7 +182,7 @@ async function serveApply(args, machineId) {
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
async function serveRemove(args, machineId) {
|
|
185
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
185
|
+
const { connectAndGetMachine } = await import('./commands-DV0URNXH.mjs');
|
|
186
186
|
const pos = positionalArgs(args);
|
|
187
187
|
const name = pos[0];
|
|
188
188
|
if (!name) {
|
|
@@ -202,7 +202,7 @@ async function serveRemove(args, machineId) {
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
async function serveList(args, machineId) {
|
|
205
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
205
|
+
const { connectAndGetMachine } = await import('./commands-DV0URNXH.mjs');
|
|
206
206
|
const all = hasFlag(args, "--all", "-a");
|
|
207
207
|
const json = hasFlag(args, "--json");
|
|
208
208
|
const sessionId = getFlag(args, "--session");
|
|
@@ -235,7 +235,7 @@ async function serveList(args, machineId) {
|
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
async function serveInfo(machineId) {
|
|
238
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
238
|
+
const { connectAndGetMachine } = await import('./commands-DV0URNXH.mjs');
|
|
239
239
|
const { machine, server } = await connectAndGetMachine(machineId);
|
|
240
240
|
try {
|
|
241
241
|
const info = await machine.serveInfo();
|
|
@@ -4,7 +4,7 @@ import * as fs from 'fs';
|
|
|
4
4
|
import * as http from 'http';
|
|
5
5
|
import * as net from 'net';
|
|
6
6
|
import * as path from 'path';
|
|
7
|
-
import { S as ServeAuth, h as hasCookieToken } from './run-
|
|
7
|
+
import { S as ServeAuth, h as hasCookieToken } from './run-CC-0bNTe.mjs';
|
|
8
8
|
import 'os';
|
|
9
9
|
import 'fs/promises';
|
|
10
10
|
import 'url';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svamp-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.72",
|
|
4
4
|
"description": "Svamp CLI — AI workspace daemon on Hypha Cloud",
|
|
5
5
|
"author": "Amun AI AB",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build": "rm -rf dist bin/skills && mkdir -p bin/skills && cp -r ../../skills/artifact bin/skills/artifact && tsc --noEmit && pkgroll",
|
|
22
22
|
"typecheck": "tsc --noEmit",
|
|
23
|
-
"test": "npx tsx test/test-context-window.mjs && npx tsx test/test-authorize.mjs && npx tsx test/test-normalize-allowed-user.mjs && npx tsx test/test-share-url.mjs && npx tsx test/test-update-sharing-normalization.mjs && npx tsx test/test-staged-homes-sweep.mjs && npx tsx test/test-session-helpers.mjs && npx tsx test/test-cli-routing.mjs && npx tsx test/test-security-context.mjs && npx tsx test/test-isolation-decision.mjs && npx tsx test/test-ralph-loop.mjs && npx tsx test/test-message-helpers.mjs && npx tsx test/test-agent-config.mjs && npx tsx test/test-wrap-command.mjs && npx tsx test/test-credential-staging.mjs && npx tsx test/test-claude-auth.mjs && npx tsx test/test-output-formatters.mjs && npx tsx test/test-agent-types.mjs && npx tsx test/test-transport.mjs && npx tsx test/test-session-update-handlers.mjs && npx tsx test/test-session-scanner.mjs && npx tsx test/test-hypha-client.mjs && npx tsx test/test-hook-settings.mjs && npx tsx test/test-session-service-logic.mjs && npx tsx test/test-daemon-persistence.mjs && npx tsx test/test-detect-isolation.mjs && npx tsx test/test-machine-service-logic.mjs && npx tsx test/test-interactive-helpers.mjs && npx tsx test/test-codex-backend.mjs && npx tsx test/test-acp-backend.mjs && npx tsx test/test-acp-bridge.mjs && npx tsx test/test-hook-server.mjs && npx tsx test/test-session-commands.mjs && npx tsx test/test-interactive-console.mjs && npx tsx test/test-session-messages.mjs && npx tsx test/test-session-send-query.mjs && npx tsx test/test-skills.mjs && npx tsx test/test-agent-grouping.mjs && npx tsx test/test-ralph-loop-integration.mjs && npx tsx test/test-ralph-loop-modes.mjs && npx tsx test/test-machine-list-directory.mjs && npx tsx test/test-service-commands.mjs && npx tsx test/test-supervisor.mjs && npx tsx test/test-supervisor-lock.mjs && npx tsx test/test-clear-detection.mjs && npx tsx test/test-session-consolidation.mjs && npx tsx test/test-inbox.mjs && npx tsx test/test-session-rpc-dispatch.mjs && npx tsx test/test-sandbox-cli.mjs && npx tsx test/test-serve-manager.mjs && npx tsx test/test-serve-stability.mjs && npx tsx test/test-frpc-e2e.mjs --unit-only",
|
|
23
|
+
"test": "npx tsx test/test-context-window.mjs && npx tsx test/test-authorize.mjs && npx tsx test/test-normalize-allowed-user.mjs && npx tsx test/test-share-url.mjs && npx tsx test/test-update-sharing-normalization.mjs && npx tsx test/test-staged-homes-sweep.mjs && npx tsx test/test-session-helpers.mjs && npx tsx test/test-cli-routing.mjs && npx tsx test/test-security-context.mjs && npx tsx test/test-isolation-decision.mjs && npx tsx test/test-ralph-loop.mjs && npx tsx test/test-message-helpers.mjs && npx tsx test/test-agent-config.mjs && npx tsx test/test-wrap-command.mjs && npx tsx test/test-credential-staging.mjs && npx tsx test/test-claude-auth.mjs && npx tsx test/test-output-formatters.mjs && npx tsx test/test-agent-types.mjs && npx tsx test/test-transport.mjs && npx tsx test/test-session-update-handlers.mjs && npx tsx test/test-session-scanner.mjs && npx tsx test/test-hypha-client.mjs && npx tsx test/test-hook-settings.mjs && npx tsx test/test-session-service-logic.mjs && npx tsx test/test-daemon-persistence.mjs && npx tsx test/test-detect-isolation.mjs && npx tsx test/test-machine-service-logic.mjs && npx tsx test/test-interactive-helpers.mjs && npx tsx test/test-codex-backend.mjs && npx tsx test/test-acp-backend.mjs && npx tsx test/test-acp-bridge.mjs && npx tsx test/test-hook-server.mjs && npx tsx test/test-session-commands.mjs && npx tsx test/test-interactive-console.mjs && npx tsx test/test-session-messages.mjs && npx tsx test/test-session-send-query.mjs && npx tsx test/test-skills.mjs && npx tsx test/test-agent-grouping.mjs && npx tsx test/test-ralph-loop-integration.mjs && npx tsx test/test-ralph-loop-modes.mjs && npx tsx test/test-machine-list-directory.mjs && npx tsx test/test-service-commands.mjs && npx tsx test/test-supervisor.mjs && npx tsx test/test-supervisor-lock.mjs && npx tsx test/test-clear-detection.mjs && npx tsx test/test-session-consolidation.mjs && npx tsx test/test-inbox.mjs && npx tsx test/test-session-rpc-dispatch.mjs && npx tsx test/test-sandbox-cli.mjs && npx tsx test/test-serve-manager.mjs && npx tsx test/test-serve-stability.mjs && npx tsx test/test-frpc-e2e.mjs --unit-only && node test/pinnedClaudeCode.test.mjs",
|
|
24
24
|
"test:hypha": "node --no-warnings test/test-hypha-service.mjs",
|
|
25
25
|
"dev": "tsx src/cli.ts",
|
|
26
26
|
"dev:daemon": "tsx src/cli.ts daemon start-sync",
|