svamp-cli 0.2.78 → 0.2.79
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-OplcUdhk.mjs → agentCommands-CDr8wjR0.mjs} +2 -2
- package/dist/cli.mjs +40 -40
- package/dist/{commands-GILVenvg.mjs → commands-BxyD6EGp.mjs} +2 -2
- package/dist/{commands-CZWJawtg.mjs → commands-DBzx8p4a.mjs} +3 -3
- package/dist/{commands-k2E3EJFY.mjs → commands-fDM-vliz.mjs} +1 -1
- package/dist/{fleet-Cp-Ykxc6.mjs → fleet-CQNb2lQG.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{package-ike8lo0g.mjs → package-D7b87vtl.mjs} +1 -1
- package/dist/{run-CZEFZgIV.mjs → run-B4Fm5EI5.mjs} +1 -1
- package/dist/{run-DDKJ85DU.mjs → run-B8H-qZH6.mjs} +51 -1
- package/dist/{serveCommands-j7Igsr-W.mjs → serveCommands-Bm6-KRVS.mjs} +5 -5
- package/dist/{serveManager-Ba-VINC7.mjs → serveManager-D58o1Gom.mjs} +27 -7
- package/package.json +1 -1
|
@@ -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-fDM-vliz.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-fDM-vliz.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-B8H-qZH6.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-B8H-qZH6.mjs').then(function (n) { return n.u; });
|
|
48
48
|
await restartDaemon();
|
|
49
49
|
process.exit(0);
|
|
50
50
|
}
|
|
@@ -287,7 +287,7 @@ async function main() {
|
|
|
287
287
|
console.error("svamp service: Service commands are not available in sandboxed sessions.");
|
|
288
288
|
process.exit(1);
|
|
289
289
|
}
|
|
290
|
-
const { handleServiceCommand } = await import('./commands-
|
|
290
|
+
const { handleServiceCommand } = await import('./commands-DBzx8p4a.mjs');
|
|
291
291
|
await handleServiceCommand();
|
|
292
292
|
} else if (subcommand === "serve") {
|
|
293
293
|
const { isSandboxed: isSandboxedServe } = await import('./sandboxDetect-DNTcbgWD.mjs');
|
|
@@ -295,7 +295,7 @@ async function main() {
|
|
|
295
295
|
console.error("svamp serve: Serve commands are not available in sandboxed sessions.");
|
|
296
296
|
process.exit(1);
|
|
297
297
|
}
|
|
298
|
-
const { handleServeCommand } = await import('./serveCommands-
|
|
298
|
+
const { handleServeCommand } = await import('./serveCommands-Bm6-KRVS.mjs');
|
|
299
299
|
await handleServeCommand();
|
|
300
300
|
process.exit(0);
|
|
301
301
|
} else if (subcommand === "process" || subcommand === "proc") {
|
|
@@ -304,7 +304,7 @@ async function main() {
|
|
|
304
304
|
console.error("svamp process: Process commands are not available in sandboxed sessions.");
|
|
305
305
|
process.exit(1);
|
|
306
306
|
}
|
|
307
|
-
const { processCommand } = await import('./commands-
|
|
307
|
+
const { processCommand } = await import('./commands-BxyD6EGp.mjs');
|
|
308
308
|
let machineId;
|
|
309
309
|
const processArgs = args.slice(1);
|
|
310
310
|
const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
|
|
@@ -322,7 +322,7 @@ async function main() {
|
|
|
322
322
|
} else if (!subcommand || subcommand === "start") {
|
|
323
323
|
await handleInteractiveCommand();
|
|
324
324
|
} else if (subcommand === "--version" || subcommand === "-v") {
|
|
325
|
-
const pkg = await import('./package-
|
|
325
|
+
const pkg = await import('./package-D7b87vtl.mjs').catch(() => ({ default: { version: "unknown" } }));
|
|
326
326
|
console.log(`svamp version: ${pkg.default.version}`);
|
|
327
327
|
} else {
|
|
328
328
|
console.error(`Unknown command: ${subcommand}`);
|
|
@@ -331,7 +331,7 @@ async function main() {
|
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
async function handleInteractiveCommand() {
|
|
334
|
-
const { runInteractive } = await import('./run-
|
|
334
|
+
const { runInteractive } = await import('./run-B4Fm5EI5.mjs');
|
|
335
335
|
const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
|
|
336
336
|
let directory = process.cwd();
|
|
337
337
|
let resumeSessionId;
|
|
@@ -376,7 +376,7 @@ async function handleAgentCommand() {
|
|
|
376
376
|
return;
|
|
377
377
|
}
|
|
378
378
|
if (agentArgs[0] === "list") {
|
|
379
|
-
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-
|
|
379
|
+
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-B8H-qZH6.mjs').then(function (n) { return n.p; });
|
|
380
380
|
console.log("Known agents:");
|
|
381
381
|
for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
|
|
382
382
|
console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
|
|
@@ -388,7 +388,7 @@ async function handleAgentCommand() {
|
|
|
388
388
|
console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
|
-
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-
|
|
391
|
+
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-B8H-qZH6.mjs').then(function (n) { return n.p; });
|
|
392
392
|
let cwd = process.cwd();
|
|
393
393
|
const filteredArgs = [];
|
|
394
394
|
for (let i = 0; i < agentArgs.length; i++) {
|
|
@@ -412,12 +412,12 @@ async function handleAgentCommand() {
|
|
|
412
412
|
console.log(`Starting ${config.agentName} agent in ${cwd}...`);
|
|
413
413
|
let backend;
|
|
414
414
|
if (KNOWN_MCP_AGENTS[config.agentName]) {
|
|
415
|
-
const { CodexMcpBackend } = await import('./run-
|
|
415
|
+
const { CodexMcpBackend } = await import('./run-B8H-qZH6.mjs').then(function (n) { return n.q; });
|
|
416
416
|
backend = new CodexMcpBackend({ cwd, log: logFn });
|
|
417
417
|
} else {
|
|
418
|
-
const { AcpBackend } = await import('./run-
|
|
419
|
-
const { GeminiTransport } = await import('./run-
|
|
420
|
-
const { DefaultTransport } = await import('./run-
|
|
418
|
+
const { AcpBackend } = await import('./run-B8H-qZH6.mjs').then(function (n) { return n.o; });
|
|
419
|
+
const { GeminiTransport } = await import('./run-B8H-qZH6.mjs').then(function (n) { return n.G; });
|
|
420
|
+
const { DefaultTransport } = await import('./run-B8H-qZH6.mjs').then(function (n) { return n.D; });
|
|
421
421
|
const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
|
|
422
422
|
backend = new AcpBackend({
|
|
423
423
|
agentName: config.agentName,
|
|
@@ -544,7 +544,7 @@ async function handleSessionCommand() {
|
|
|
544
544
|
process.exit(1);
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
const { sessionList, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-
|
|
547
|
+
const { sessionList, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-fDM-vliz.mjs');
|
|
548
548
|
const parseFlagStr = (flag, shortFlag) => {
|
|
549
549
|
for (let i = 1; i < sessionArgs.length; i++) {
|
|
550
550
|
if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
|
|
@@ -610,7 +610,7 @@ async function handleSessionCommand() {
|
|
|
610
610
|
allowDomain.push(sessionArgs[++i]);
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
const { parseShareArg } = await import('./commands-
|
|
613
|
+
const { parseShareArg } = await import('./commands-fDM-vliz.mjs');
|
|
614
614
|
const shareEntries = share.map((s) => parseShareArg(s));
|
|
615
615
|
await sessionSpawn(agent, dir, targetMachineId, {
|
|
616
616
|
message,
|
|
@@ -696,7 +696,7 @@ async function handleSessionCommand() {
|
|
|
696
696
|
console.error(" Spawns a stateless Claude session in <directory>, sends <prompt>, prints the answer, then deletes the session.");
|
|
697
697
|
process.exit(1);
|
|
698
698
|
}
|
|
699
|
-
const { sessionQuery } = await import('./commands-
|
|
699
|
+
const { sessionQuery } = await import('./commands-fDM-vliz.mjs');
|
|
700
700
|
await sessionQuery(dir, prompt, targetMachineId, {
|
|
701
701
|
timeout: parseFlagInt("--timeout"),
|
|
702
702
|
json: hasFlag("--json"),
|
|
@@ -729,7 +729,7 @@ async function handleSessionCommand() {
|
|
|
729
729
|
console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
|
|
730
730
|
process.exit(1);
|
|
731
731
|
}
|
|
732
|
-
const { sessionApprove } = await import('./commands-
|
|
732
|
+
const { sessionApprove } = await import('./commands-fDM-vliz.mjs');
|
|
733
733
|
const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
734
734
|
await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
|
|
735
735
|
json: hasFlag("--json")
|
|
@@ -739,7 +739,7 @@ async function handleSessionCommand() {
|
|
|
739
739
|
console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
|
|
740
740
|
process.exit(1);
|
|
741
741
|
}
|
|
742
|
-
const { sessionDeny } = await import('./commands-
|
|
742
|
+
const { sessionDeny } = await import('./commands-fDM-vliz.mjs');
|
|
743
743
|
const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
744
744
|
await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
|
|
745
745
|
json: hasFlag("--json")
|
|
@@ -775,7 +775,7 @@ async function handleSessionCommand() {
|
|
|
775
775
|
console.error("Usage: svamp session set-title <title>");
|
|
776
776
|
process.exit(1);
|
|
777
777
|
}
|
|
778
|
-
const { sessionSetTitle } = await import('./agentCommands-
|
|
778
|
+
const { sessionSetTitle } = await import('./agentCommands-CDr8wjR0.mjs');
|
|
779
779
|
await sessionSetTitle(title);
|
|
780
780
|
} else if (sessionSubcommand === "set-link") {
|
|
781
781
|
const url = sessionArgs[1];
|
|
@@ -784,7 +784,7 @@ async function handleSessionCommand() {
|
|
|
784
784
|
process.exit(1);
|
|
785
785
|
}
|
|
786
786
|
const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
787
|
-
const { sessionSetLink } = await import('./agentCommands-
|
|
787
|
+
const { sessionSetLink } = await import('./agentCommands-CDr8wjR0.mjs');
|
|
788
788
|
await sessionSetLink(url, label);
|
|
789
789
|
} else if (sessionSubcommand === "notify") {
|
|
790
790
|
const message = sessionArgs[1];
|
|
@@ -793,7 +793,7 @@ async function handleSessionCommand() {
|
|
|
793
793
|
process.exit(1);
|
|
794
794
|
}
|
|
795
795
|
const level = parseFlagStr("--level") || "info";
|
|
796
|
-
const { sessionNotify } = await import('./agentCommands-
|
|
796
|
+
const { sessionNotify } = await import('./agentCommands-CDr8wjR0.mjs');
|
|
797
797
|
await sessionNotify(message, level);
|
|
798
798
|
} else if (sessionSubcommand === "broadcast") {
|
|
799
799
|
const action = sessionArgs[1];
|
|
@@ -801,7 +801,7 @@ async function handleSessionCommand() {
|
|
|
801
801
|
console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
|
|
802
802
|
process.exit(1);
|
|
803
803
|
}
|
|
804
|
-
const { sessionBroadcast } = await import('./agentCommands-
|
|
804
|
+
const { sessionBroadcast } = await import('./agentCommands-CDr8wjR0.mjs');
|
|
805
805
|
await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
|
|
806
806
|
} else if (sessionSubcommand === "inbox") {
|
|
807
807
|
const inboxSubcmd = sessionArgs[1];
|
|
@@ -812,7 +812,7 @@ async function handleSessionCommand() {
|
|
|
812
812
|
process.exit(1);
|
|
813
813
|
}
|
|
814
814
|
if (agentSessionId) {
|
|
815
|
-
const { inboxSend } = await import('./agentCommands-
|
|
815
|
+
const { inboxSend } = await import('./agentCommands-CDr8wjR0.mjs');
|
|
816
816
|
await inboxSend(sessionArgs[2], {
|
|
817
817
|
body: sessionArgs[3],
|
|
818
818
|
subject: parseFlagStr("--subject"),
|
|
@@ -827,7 +827,7 @@ async function handleSessionCommand() {
|
|
|
827
827
|
}
|
|
828
828
|
} else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
|
|
829
829
|
if (agentSessionId && !sessionArgs[2]) {
|
|
830
|
-
const { inboxList } = await import('./agentCommands-
|
|
830
|
+
const { inboxList } = await import('./agentCommands-CDr8wjR0.mjs');
|
|
831
831
|
await inboxList({
|
|
832
832
|
unread: hasFlag("--unread"),
|
|
833
833
|
limit: parseFlagInt("--limit"),
|
|
@@ -849,7 +849,7 @@ async function handleSessionCommand() {
|
|
|
849
849
|
process.exit(1);
|
|
850
850
|
}
|
|
851
851
|
if (agentSessionId && !sessionArgs[3]) {
|
|
852
|
-
const { inboxList } = await import('./agentCommands-
|
|
852
|
+
const { inboxList } = await import('./agentCommands-CDr8wjR0.mjs');
|
|
853
853
|
await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
|
|
854
854
|
} else if (sessionArgs[3]) {
|
|
855
855
|
await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
|
|
@@ -859,7 +859,7 @@ async function handleSessionCommand() {
|
|
|
859
859
|
}
|
|
860
860
|
} else if (inboxSubcmd === "reply") {
|
|
861
861
|
if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
|
|
862
|
-
const { inboxReply } = await import('./agentCommands-
|
|
862
|
+
const { inboxReply } = await import('./agentCommands-CDr8wjR0.mjs');
|
|
863
863
|
await inboxReply(sessionArgs[2], sessionArgs[3]);
|
|
864
864
|
} else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
|
|
865
865
|
await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
|
|
@@ -895,7 +895,7 @@ async function handleMachineCommand() {
|
|
|
895
895
|
return;
|
|
896
896
|
}
|
|
897
897
|
if (machineSubcommand === "share") {
|
|
898
|
-
const { machineShare } = await import('./commands-
|
|
898
|
+
const { machineShare } = await import('./commands-fDM-vliz.mjs');
|
|
899
899
|
let machineId;
|
|
900
900
|
const shareArgs = [];
|
|
901
901
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
@@ -925,7 +925,7 @@ async function handleMachineCommand() {
|
|
|
925
925
|
}
|
|
926
926
|
await machineShare(machineId, { add, remove, list, configPath, showConfig });
|
|
927
927
|
} else if (machineSubcommand === "exec") {
|
|
928
|
-
const { machineExec } = await import('./commands-
|
|
928
|
+
const { machineExec } = await import('./commands-fDM-vliz.mjs');
|
|
929
929
|
let machineId;
|
|
930
930
|
let cwd;
|
|
931
931
|
const cmdParts = [];
|
|
@@ -945,7 +945,7 @@ async function handleMachineCommand() {
|
|
|
945
945
|
}
|
|
946
946
|
await machineExec(machineId, command, cwd);
|
|
947
947
|
} else if (machineSubcommand === "info") {
|
|
948
|
-
const { machineInfo } = await import('./commands-
|
|
948
|
+
const { machineInfo } = await import('./commands-fDM-vliz.mjs');
|
|
949
949
|
let machineId;
|
|
950
950
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
951
951
|
if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
|
|
@@ -965,10 +965,10 @@ async function handleMachineCommand() {
|
|
|
965
965
|
level = machineArgs[++i];
|
|
966
966
|
}
|
|
967
967
|
}
|
|
968
|
-
const { machineNotify } = await import('./agentCommands-
|
|
968
|
+
const { machineNotify } = await import('./agentCommands-CDr8wjR0.mjs');
|
|
969
969
|
await machineNotify(message, level);
|
|
970
970
|
} else if (machineSubcommand === "ls") {
|
|
971
|
-
const { machineLs } = await import('./commands-
|
|
971
|
+
const { machineLs } = await import('./commands-fDM-vliz.mjs');
|
|
972
972
|
let machineId;
|
|
973
973
|
let showHidden = false;
|
|
974
974
|
let path;
|
|
@@ -1026,24 +1026,24 @@ Examples:
|
|
|
1026
1026
|
};
|
|
1027
1027
|
const hasFlag = (name) => fleetArgs.includes(`--${name}`);
|
|
1028
1028
|
if (sub === "status") {
|
|
1029
|
-
const { fleetStatus } = await import('./fleet-
|
|
1029
|
+
const { fleetStatus } = await import('./fleet-CQNb2lQG.mjs');
|
|
1030
1030
|
await fleetStatus();
|
|
1031
1031
|
} else if (sub === "exec") {
|
|
1032
1032
|
const command = fleetArgs.slice(1).filter((a) => !a.startsWith("--")).join(" ");
|
|
1033
|
-
const { fleetExec } = await import('./fleet-
|
|
1033
|
+
const { fleetExec } = await import('./fleet-CQNb2lQG.mjs');
|
|
1034
1034
|
await fleetExec(command, { cwd: flag("cwd") });
|
|
1035
1035
|
} else if (sub === "upgrade-claude") {
|
|
1036
|
-
const { fleetUpgradeClaude } = await import('./fleet-
|
|
1036
|
+
const { fleetUpgradeClaude } = await import('./fleet-CQNb2lQG.mjs');
|
|
1037
1037
|
await fleetUpgradeClaude({ version: flag("version", "-v") });
|
|
1038
1038
|
} else if (sub === "upgrade-svamp") {
|
|
1039
|
-
const { fleetUpgradeSvamp } = await import('./fleet-
|
|
1039
|
+
const { fleetUpgradeSvamp } = await import('./fleet-CQNb2lQG.mjs');
|
|
1040
1040
|
await fleetUpgradeSvamp({ version: flag("version", "-v"), excludeSelf: hasFlag("exclude-self") });
|
|
1041
1041
|
} else if (sub === "daemon-restart") {
|
|
1042
|
-
const { fleetDaemonRestart } = await import('./fleet-
|
|
1042
|
+
const { fleetDaemonRestart } = await import('./fleet-CQNb2lQG.mjs');
|
|
1043
1043
|
await fleetDaemonRestart({ graceful: !hasFlag("cleanup") });
|
|
1044
1044
|
} else if (sub === "push-skill") {
|
|
1045
1045
|
const name = fleetArgs[1];
|
|
1046
|
-
const { fleetPushSkill } = await import('./fleet-
|
|
1046
|
+
const { fleetPushSkill } = await import('./fleet-CQNb2lQG.mjs');
|
|
1047
1047
|
await fleetPushSkill(name);
|
|
1048
1048
|
} else {
|
|
1049
1049
|
console.error(`Unknown fleet subcommand: ${sub}`);
|
|
@@ -1502,7 +1502,7 @@ async function applyClaudeAuthFlags(argv) {
|
|
|
1502
1502
|
"--use-hypha-proxy, --use-claude-login, and --anthropic-base-url/--anthropic-api-key are mutually exclusive"
|
|
1503
1503
|
);
|
|
1504
1504
|
}
|
|
1505
|
-
const mod = await import('./run-
|
|
1505
|
+
const mod = await import('./run-B8H-qZH6.mjs').then(function (n) { return n.t; });
|
|
1506
1506
|
if (hasHypha) {
|
|
1507
1507
|
mod.setClaudeAuthHyphaProxy();
|
|
1508
1508
|
console.log("Claude auth configured: hypha-proxy (uses HYPHA_TOKEN live at each spawn).");
|
|
@@ -1540,7 +1540,7 @@ async function applyDaemonShareFlag(argv) {
|
|
|
1540
1540
|
}
|
|
1541
1541
|
}
|
|
1542
1542
|
if (collected.length === 0) return;
|
|
1543
|
-
const { updateEnvFile } = await import('./run-
|
|
1543
|
+
const { updateEnvFile } = await import('./run-B8H-qZH6.mjs').then(function (n) { return n.t; });
|
|
1544
1544
|
const seen = /* @__PURE__ */ new Set();
|
|
1545
1545
|
const deduped = collected.filter((e) => {
|
|
1546
1546
|
const k = e.toLowerCase();
|
|
@@ -1553,7 +1553,7 @@ async function applyDaemonShareFlag(argv) {
|
|
|
1553
1553
|
}
|
|
1554
1554
|
async function handleDaemonAuthCommand(argv) {
|
|
1555
1555
|
const sub = (argv[0] || "status").toLowerCase();
|
|
1556
|
-
const mod = await import('./run-
|
|
1556
|
+
const mod = await import('./run-B8H-qZH6.mjs').then(function (n) { return n.t; });
|
|
1557
1557
|
if (sub === "--help" || sub === "-h" || sub === "help") {
|
|
1558
1558
|
console.log(`
|
|
1559
1559
|
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-fDM-vliz.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-B8H-qZH6.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-fDM-vliz.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-fDM-vliz.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-fDM-vliz.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-B8H-qZH6.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
8
8
|
import 'fs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import os from 'node:os';
|
|
4
|
-
import { c as connectToHypha } from './run-
|
|
4
|
+
import { c as connectToHypha } from './run-B8H-qZH6.mjs';
|
|
5
5
|
import { PINNED_CLAUDE_CODE_VERSION } from './pinnedClaudeCode-HydRNEt7.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
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-B8H-qZH6.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -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-B8H-qZH6.mjs';
|
|
6
6
|
import { createServer } from 'node:http';
|
|
7
7
|
import { spawn } from 'node:child_process';
|
|
8
8
|
import { createInterface } from 'node:readline';
|
|
@@ -5836,12 +5836,62 @@ btn.addEventListener('click', async () => {
|
|
|
5836
5836
|
}
|
|
5837
5837
|
});
|
|
5838
5838
|
<\/script>
|
|
5839
|
+
</body></html>`;
|
|
5840
|
+
}
|
|
5841
|
+
/**
|
|
5842
|
+
* Render an "access denied" page for a request that IS authenticated (valid
|
|
5843
|
+
* Hypha token) but whose email is not authorized for the mount — or for a
|
|
5844
|
+
* misconfigured owner mount with no resolvable owner. This is served as a
|
|
5845
|
+
* 403; it deliberately does NOT redirect to the login page, which would
|
|
5846
|
+
* loop forever and tell the user nothing about why they were rejected.
|
|
5847
|
+
*/
|
|
5848
|
+
getAccessDeniedHtml(opts) {
|
|
5849
|
+
const { email, access, ownerEmail, misconfigured } = opts;
|
|
5850
|
+
const loginHref = `/__login__?return=${encodeURIComponent(opts.returnUrl || "/")}`;
|
|
5851
|
+
let requirement;
|
|
5852
|
+
if (misconfigured) {
|
|
5853
|
+
requirement = `This resource is set to <b>owner-only</b> access, but the server never resolved an owner email (the daemon authenticated with a token that has no email claim). No account can satisfy this \u2014 it is a server-side misconfiguration, not a problem with your account. Fix it by re-creating the mount with an explicit email allowlist, e.g. <code>access: ["${escapeHtml(email || "you@example.com")}"]</code>.`;
|
|
5854
|
+
} else if (access === "owner") {
|
|
5855
|
+
requirement = `This resource is restricted to its owner${ownerEmail ? ` (<code>${escapeHtml(ownerEmail)}</code>)` : ""}.`;
|
|
5856
|
+
} else if (Array.isArray(access)) {
|
|
5857
|
+
const list = access.map((e) => `<code>${escapeHtml(e)}</code>`).join(", ");
|
|
5858
|
+
requirement = `This resource is restricted to: ${list}.`;
|
|
5859
|
+
} else {
|
|
5860
|
+
requirement = "This resource is restricted.";
|
|
5861
|
+
}
|
|
5862
|
+
const signedInLine = email ? `You are signed in as <code>${escapeHtml(email)}</code>, which is not on the allow list.` : `You are not signed in.`;
|
|
5863
|
+
return `<!DOCTYPE html>
|
|
5864
|
+
<html><head>
|
|
5865
|
+
<meta charset="utf-8">
|
|
5866
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
5867
|
+
<title>Access denied \u2014 Svamp File Server</title>
|
|
5868
|
+
<style>
|
|
5869
|
+
*{box-sizing:border-box;margin:0;padding:0}
|
|
5870
|
+
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;display:flex;align-items:center;justify-content:center;min-height:100vh;background:#f6f8fa;color:#24292f;padding:16px}
|
|
5871
|
+
.card{background:#fff;border:1px solid #d0d7de;border-radius:12px;padding:32px;max-width:480px;width:100%;box-shadow:0 4px 12px rgba(31,35,40,0.06)}
|
|
5872
|
+
h1{font-size:1.25rem;margin-bottom:8px}
|
|
5873
|
+
.lead{color:#cf222e;font-weight:600;margin-bottom:16px}
|
|
5874
|
+
p{color:#3d444d;font-size:0.92rem;line-height:1.5;margin-bottom:14px}
|
|
5875
|
+
code{background:#f6f8fa;border:1px solid #d0d7de;border-radius:6px;padding:1px 6px;font-size:0.85em}
|
|
5876
|
+
a.btn{display:inline-block;background:#0969da;color:#fff;border-radius:8px;padding:10px 20px;font-weight:500;text-decoration:none;margin-top:4px}
|
|
5877
|
+
a.btn:hover{background:#0860c4}
|
|
5878
|
+
</style>
|
|
5879
|
+
</head><body>
|
|
5880
|
+
<div class="card">
|
|
5881
|
+
<h1>${misconfigured ? "\u26D4 Access not possible" : "\u26D4 Access denied"}</h1>
|
|
5882
|
+
<p class="lead">${signedInLine}</p>
|
|
5883
|
+
<p>${requirement}</p>
|
|
5884
|
+
${misconfigured ? "" : `<a class="btn" href="${loginHref}">Sign in with a different account</a>`}
|
|
5885
|
+
</div>
|
|
5839
5886
|
</body></html>`;
|
|
5840
5887
|
}
|
|
5841
5888
|
destroy() {
|
|
5842
5889
|
this.cache.clear();
|
|
5843
5890
|
}
|
|
5844
5891
|
}
|
|
5892
|
+
function escapeHtml(s) {
|
|
5893
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
5894
|
+
}
|
|
5845
5895
|
|
|
5846
5896
|
const DEFAULT_PROBE_INTERVAL_S = 10;
|
|
5847
5897
|
const DEFAULT_PROBE_TIMEOUT_S = 5;
|
|
@@ -7926,7 +7976,7 @@ async function startDaemon(options) {
|
|
|
7926
7976
|
const list = loadExposedTunnels().filter((t) => t.name !== name);
|
|
7927
7977
|
saveExposedTunnels(list);
|
|
7928
7978
|
}
|
|
7929
|
-
const { ServeManager } = await import('./serveManager-
|
|
7979
|
+
const { ServeManager } = await import('./serveManager-D58o1Gom.mjs');
|
|
7930
7980
|
const serveManager = new ServeManager(SVAMP_HOME, (msg) => logger.log(`[SERVE] ${msg}`), hyphaServerUrl);
|
|
7931
7981
|
ensureAutoInstalledSkills(logger).catch(() => {
|
|
7932
7982
|
});
|
|
@@ -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-fDM-vliz.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-fDM-vliz.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-fDM-vliz.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-fDM-vliz.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-fDM-vliz.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-B8H-qZH6.mjs';
|
|
8
8
|
import 'os';
|
|
9
9
|
import 'fs/promises';
|
|
10
10
|
import 'url';
|
|
@@ -128,6 +128,9 @@ class ServeManager {
|
|
|
128
128
|
await this.removeMount(spec.name);
|
|
129
129
|
}
|
|
130
130
|
const access = spec.access ?? "link";
|
|
131
|
+
if (access === "owner" && !spec.ownerEmail) {
|
|
132
|
+
this.log(`\u26A0 Mount '${spec.name}': access='owner' but no owner email could be resolved \u2014 NO ONE will be able to sign in. Use an explicit email allowlist instead, e.g. access: ["you@example.com"].`);
|
|
133
|
+
}
|
|
131
134
|
const mount = {
|
|
132
135
|
name: spec.name,
|
|
133
136
|
directory: resolvedDir,
|
|
@@ -542,17 +545,34 @@ class ServeManager {
|
|
|
542
545
|
}
|
|
543
546
|
if (mount && mount.access !== "public" && mount.access !== "link") {
|
|
544
547
|
const userEmail = this.auth ? await this.auth.authenticate(req).catch(() => null) : null;
|
|
548
|
+
if (mount.access === "owner" && !mount.ownerEmail) {
|
|
549
|
+
this.log(`Auth DENY '${mountName}': owner-only mount but ownerEmail is empty (misconfigured \u2014 the daemon's token has no email claim). Set access to an explicit email allowlist. requester=${userEmail || "anonymous"}`);
|
|
550
|
+
const html = this.auth ? this.auth.getAccessDeniedHtml({ email: userEmail, access: mount.access, ownerEmail: mount.ownerEmail, misconfigured: true, returnUrl: req.url || "/" }) : "Access denied (misconfigured owner mount).";
|
|
551
|
+
res.writeHead(403, { "Content-Type": "text/html; charset=utf-8", "Cache-Control": "no-store" });
|
|
552
|
+
res.end(html);
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
545
555
|
const allowed = this.auth ? this.auth.isAuthorized(userEmail, mount.access, mount.ownerEmail) : false;
|
|
546
556
|
if (!allowed) {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
headers
|
|
557
|
+
if (!userEmail) {
|
|
558
|
+
this.log(`Auth: '${mountName}' requires sign-in (no valid token) \u2014 redirecting to /__login__`);
|
|
559
|
+
const loginUrl = `/__login__?return=${encodeURIComponent(req.url || "/")}`;
|
|
560
|
+
const headers = { Location: loginUrl };
|
|
561
|
+
if (hasCookieToken(req)) {
|
|
562
|
+
headers["Set-Cookie"] = "svamp_serve_token=; Path=/; Max-Age=0; SameSite=Lax";
|
|
563
|
+
}
|
|
564
|
+
res.writeHead(302, headers);
|
|
565
|
+
res.end();
|
|
566
|
+
return;
|
|
551
567
|
}
|
|
552
|
-
|
|
553
|
-
|
|
568
|
+
const need = mount.access === "owner" ? `owner (${mount.ownerEmail || "unset"})` : `one of [${mount.access.join(", ")}]`;
|
|
569
|
+
this.log(`Auth DENY '${mountName}': '${userEmail}' is not authorized (requires ${need})`);
|
|
570
|
+
const html = this.auth ? this.auth.getAccessDeniedHtml({ email: userEmail, access: mount.access, ownerEmail: mount.ownerEmail, returnUrl: req.url || "/" }) : `Access denied for ${userEmail}.`;
|
|
571
|
+
res.writeHead(403, { "Content-Type": "text/html; charset=utf-8", "Cache-Control": "no-store" });
|
|
572
|
+
res.end(html);
|
|
554
573
|
return;
|
|
555
574
|
}
|
|
575
|
+
this.log(`Auth OK '${mountName}': ${userEmail}`);
|
|
556
576
|
}
|
|
557
577
|
if (req.method === "PUT" && mount && mount.directory) {
|
|
558
578
|
const filePath = path.join(mount.directory, basePath);
|