svamp-cli 0.2.83 → 0.2.84
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-Bf00Irxu.mjs → agentCommands-C10NivHS.mjs} +2 -2
- package/dist/cli.mjs +80 -50
- package/dist/{commands-Bd1H83bg.mjs → commands-B75aXb6C.mjs} +1 -1
- package/dist/{commands-B3omCaQt.mjs → commands-BeZMEZhQ.mjs} +6 -6
- package/dist/{commands-iW8jm4vc.mjs → commands-CtYB14Y-.mjs} +5 -5
- package/dist/{commands-D8fkJXXU.mjs → commands-biNfOPRI.mjs} +2 -2
- package/dist/{fleet-CCCPxbz-.mjs → fleet-D_sem31C.mjs} +1 -1
- package/dist/{frpc-F50mVRLL.mjs → frpc-D3LiH7GX.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/package-CUo2nRNC.mjs +63 -0
- package/dist/{run-C90uN1y2.mjs → run-MQKWgYFS.mjs} +192 -30
- package/dist/{run-X3V7bQwE.mjs → run-Xk8il2Yz.mjs} +1 -1
- package/dist/{serveCommands-DgG_ZFt7.mjs → serveCommands-9D4WCoJR.mjs} +5 -5
- package/dist/{serveManager-DBjlwnv7.mjs → serveManager-j2Z-hrHL.mjs} +2 -2
- package/package.json +2 -2
- package/dist/package-Cf8yLCTr.mjs +0 -63
|
@@ -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-B75aXb6C.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-B75aXb6C.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-MQKWgYFS.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -31,6 +31,11 @@ const args = process.argv.slice(2);
|
|
|
31
31
|
const subcommand = args[0];
|
|
32
32
|
let daemonSubcommand = args[1];
|
|
33
33
|
async function main() {
|
|
34
|
+
try {
|
|
35
|
+
const { getLoadedConfig } = await import('./run-MQKWgYFS.mjs').then(function (n) { return n.K; });
|
|
36
|
+
getLoadedConfig();
|
|
37
|
+
} catch {
|
|
38
|
+
}
|
|
34
39
|
if (subcommand === "login") {
|
|
35
40
|
await loginToHypha();
|
|
36
41
|
} else if (subcommand === "logout") {
|
|
@@ -44,7 +49,7 @@ async function main() {
|
|
|
44
49
|
console.error(`svamp daemon restart: ${err.message || err}`);
|
|
45
50
|
process.exit(1);
|
|
46
51
|
}
|
|
47
|
-
const { restartDaemon } = await import('./run-
|
|
52
|
+
const { restartDaemon } = await import('./run-MQKWgYFS.mjs').then(function (n) { return n.M; });
|
|
48
53
|
await restartDaemon();
|
|
49
54
|
process.exit(0);
|
|
50
55
|
}
|
|
@@ -296,7 +301,7 @@ async function main() {
|
|
|
296
301
|
console.error("svamp service: Service commands are not available in sandboxed sessions.");
|
|
297
302
|
process.exit(1);
|
|
298
303
|
}
|
|
299
|
-
const { handleServiceCommand } = await import('./commands-
|
|
304
|
+
const { handleServiceCommand } = await import('./commands-CtYB14Y-.mjs');
|
|
300
305
|
await handleServiceCommand();
|
|
301
306
|
} else if (subcommand === "serve") {
|
|
302
307
|
const { isSandboxed: isSandboxedServe } = await import('./sandboxDetect-DNTcbgWD.mjs');
|
|
@@ -304,7 +309,7 @@ async function main() {
|
|
|
304
309
|
console.error("svamp serve: Serve commands are not available in sandboxed sessions.");
|
|
305
310
|
process.exit(1);
|
|
306
311
|
}
|
|
307
|
-
const { handleServeCommand } = await import('./serveCommands-
|
|
312
|
+
const { handleServeCommand } = await import('./serveCommands-9D4WCoJR.mjs');
|
|
308
313
|
await handleServeCommand();
|
|
309
314
|
process.exit(0);
|
|
310
315
|
} else if (subcommand === "process" || subcommand === "proc") {
|
|
@@ -313,7 +318,7 @@ async function main() {
|
|
|
313
318
|
console.error("svamp process: Process commands are not available in sandboxed sessions.");
|
|
314
319
|
process.exit(1);
|
|
315
320
|
}
|
|
316
|
-
const { processCommand } = await import('./commands-
|
|
321
|
+
const { processCommand } = await import('./commands-biNfOPRI.mjs');
|
|
317
322
|
let machineId;
|
|
318
323
|
const processArgs = args.slice(1);
|
|
319
324
|
const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
|
|
@@ -331,7 +336,7 @@ async function main() {
|
|
|
331
336
|
} else if (!subcommand || subcommand === "start") {
|
|
332
337
|
await handleInteractiveCommand();
|
|
333
338
|
} else if (subcommand === "--version" || subcommand === "-v") {
|
|
334
|
-
const pkg = await import('./package-
|
|
339
|
+
const pkg = await import('./package-CUo2nRNC.mjs').catch(() => ({ default: { version: "unknown" } }));
|
|
335
340
|
console.log(`svamp version: ${pkg.default.version}`);
|
|
336
341
|
} else {
|
|
337
342
|
console.error(`Unknown command: ${subcommand}`);
|
|
@@ -340,7 +345,7 @@ async function main() {
|
|
|
340
345
|
}
|
|
341
346
|
}
|
|
342
347
|
async function handleInteractiveCommand() {
|
|
343
|
-
const { runInteractive } = await import('./run-
|
|
348
|
+
const { runInteractive } = await import('./run-Xk8il2Yz.mjs');
|
|
344
349
|
const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
|
|
345
350
|
let directory = process.cwd();
|
|
346
351
|
let resumeSessionId;
|
|
@@ -385,7 +390,7 @@ async function handleAgentCommand() {
|
|
|
385
390
|
return;
|
|
386
391
|
}
|
|
387
392
|
if (agentArgs[0] === "list") {
|
|
388
|
-
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-
|
|
393
|
+
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-MQKWgYFS.mjs').then(function (n) { return n.G; });
|
|
389
394
|
console.log("Known agents:");
|
|
390
395
|
for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
|
|
391
396
|
console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
|
|
@@ -397,7 +402,7 @@ async function handleAgentCommand() {
|
|
|
397
402
|
console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
|
|
398
403
|
return;
|
|
399
404
|
}
|
|
400
|
-
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-
|
|
405
|
+
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-MQKWgYFS.mjs').then(function (n) { return n.G; });
|
|
401
406
|
let cwd = process.cwd();
|
|
402
407
|
const filteredArgs = [];
|
|
403
408
|
for (let i = 0; i < agentArgs.length; i++) {
|
|
@@ -421,12 +426,12 @@ async function handleAgentCommand() {
|
|
|
421
426
|
console.log(`Starting ${config.agentName} agent in ${cwd}...`);
|
|
422
427
|
let backend;
|
|
423
428
|
if (KNOWN_MCP_AGENTS[config.agentName]) {
|
|
424
|
-
const { CodexMcpBackend } = await import('./run-
|
|
429
|
+
const { CodexMcpBackend } = await import('./run-MQKWgYFS.mjs').then(function (n) { return n.H; });
|
|
425
430
|
backend = new CodexMcpBackend({ cwd, log: logFn });
|
|
426
431
|
} else {
|
|
427
|
-
const { AcpBackend } = await import('./run-
|
|
428
|
-
const { GeminiTransport } = await import('./run-
|
|
429
|
-
const { DefaultTransport } = await import('./run-
|
|
432
|
+
const { AcpBackend } = await import('./run-MQKWgYFS.mjs').then(function (n) { return n.F; });
|
|
433
|
+
const { GeminiTransport } = await import('./run-MQKWgYFS.mjs').then(function (n) { return n.I; });
|
|
434
|
+
const { DefaultTransport } = await import('./run-MQKWgYFS.mjs').then(function (n) { return n.E; });
|
|
430
435
|
const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
|
|
431
436
|
backend = new AcpBackend({
|
|
432
437
|
agentName: config.agentName,
|
|
@@ -553,7 +558,7 @@ async function handleSessionCommand() {
|
|
|
553
558
|
process.exit(1);
|
|
554
559
|
}
|
|
555
560
|
}
|
|
556
|
-
const { sessionList, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-
|
|
561
|
+
const { sessionList, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-B75aXb6C.mjs');
|
|
557
562
|
const parseFlagStr = (flag, shortFlag) => {
|
|
558
563
|
for (let i = 1; i < sessionArgs.length; i++) {
|
|
559
564
|
if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
|
|
@@ -619,7 +624,7 @@ async function handleSessionCommand() {
|
|
|
619
624
|
allowDomain.push(sessionArgs[++i]);
|
|
620
625
|
}
|
|
621
626
|
}
|
|
622
|
-
const { parseShareArg } = await import('./commands-
|
|
627
|
+
const { parseShareArg } = await import('./commands-B75aXb6C.mjs');
|
|
623
628
|
const shareEntries = share.map((s) => parseShareArg(s));
|
|
624
629
|
await sessionSpawn(agent, dir, targetMachineId, {
|
|
625
630
|
message,
|
|
@@ -705,7 +710,7 @@ async function handleSessionCommand() {
|
|
|
705
710
|
console.error(" Spawns a stateless Claude session in <directory>, sends <prompt>, prints the answer, then deletes the session.");
|
|
706
711
|
process.exit(1);
|
|
707
712
|
}
|
|
708
|
-
const { sessionQuery } = await import('./commands-
|
|
713
|
+
const { sessionQuery } = await import('./commands-B75aXb6C.mjs');
|
|
709
714
|
await sessionQuery(dir, prompt, targetMachineId, {
|
|
710
715
|
timeout: parseFlagInt("--timeout"),
|
|
711
716
|
json: hasFlag("--json"),
|
|
@@ -738,7 +743,7 @@ async function handleSessionCommand() {
|
|
|
738
743
|
console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
|
|
739
744
|
process.exit(1);
|
|
740
745
|
}
|
|
741
|
-
const { sessionApprove } = await import('./commands-
|
|
746
|
+
const { sessionApprove } = await import('./commands-B75aXb6C.mjs');
|
|
742
747
|
const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
743
748
|
await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
|
|
744
749
|
json: hasFlag("--json")
|
|
@@ -748,7 +753,7 @@ async function handleSessionCommand() {
|
|
|
748
753
|
console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
|
|
749
754
|
process.exit(1);
|
|
750
755
|
}
|
|
751
|
-
const { sessionDeny } = await import('./commands-
|
|
756
|
+
const { sessionDeny } = await import('./commands-B75aXb6C.mjs');
|
|
752
757
|
const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
753
758
|
await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
|
|
754
759
|
json: hasFlag("--json")
|
|
@@ -784,7 +789,7 @@ async function handleSessionCommand() {
|
|
|
784
789
|
console.error("Usage: svamp session set-title <title>");
|
|
785
790
|
process.exit(1);
|
|
786
791
|
}
|
|
787
|
-
const { sessionSetTitle } = await import('./agentCommands-
|
|
792
|
+
const { sessionSetTitle } = await import('./agentCommands-C10NivHS.mjs');
|
|
788
793
|
await sessionSetTitle(title);
|
|
789
794
|
} else if (sessionSubcommand === "set-link") {
|
|
790
795
|
const url = sessionArgs[1];
|
|
@@ -793,7 +798,7 @@ async function handleSessionCommand() {
|
|
|
793
798
|
process.exit(1);
|
|
794
799
|
}
|
|
795
800
|
const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
796
|
-
const { sessionSetLink } = await import('./agentCommands-
|
|
801
|
+
const { sessionSetLink } = await import('./agentCommands-C10NivHS.mjs');
|
|
797
802
|
await sessionSetLink(url, label);
|
|
798
803
|
} else if (sessionSubcommand === "notify") {
|
|
799
804
|
const message = sessionArgs[1];
|
|
@@ -802,7 +807,7 @@ async function handleSessionCommand() {
|
|
|
802
807
|
process.exit(1);
|
|
803
808
|
}
|
|
804
809
|
const level = parseFlagStr("--level") || "info";
|
|
805
|
-
const { sessionNotify } = await import('./agentCommands-
|
|
810
|
+
const { sessionNotify } = await import('./agentCommands-C10NivHS.mjs');
|
|
806
811
|
await sessionNotify(message, level);
|
|
807
812
|
} else if (sessionSubcommand === "broadcast") {
|
|
808
813
|
const action = sessionArgs[1];
|
|
@@ -810,7 +815,7 @@ async function handleSessionCommand() {
|
|
|
810
815
|
console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
|
|
811
816
|
process.exit(1);
|
|
812
817
|
}
|
|
813
|
-
const { sessionBroadcast } = await import('./agentCommands-
|
|
818
|
+
const { sessionBroadcast } = await import('./agentCommands-C10NivHS.mjs');
|
|
814
819
|
await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
|
|
815
820
|
} else if (sessionSubcommand === "inbox") {
|
|
816
821
|
const inboxSubcmd = sessionArgs[1];
|
|
@@ -821,7 +826,7 @@ async function handleSessionCommand() {
|
|
|
821
826
|
process.exit(1);
|
|
822
827
|
}
|
|
823
828
|
if (agentSessionId) {
|
|
824
|
-
const { inboxSend } = await import('./agentCommands-
|
|
829
|
+
const { inboxSend } = await import('./agentCommands-C10NivHS.mjs');
|
|
825
830
|
await inboxSend(sessionArgs[2], {
|
|
826
831
|
body: sessionArgs[3],
|
|
827
832
|
subject: parseFlagStr("--subject"),
|
|
@@ -836,7 +841,7 @@ async function handleSessionCommand() {
|
|
|
836
841
|
}
|
|
837
842
|
} else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
|
|
838
843
|
if (agentSessionId && !sessionArgs[2]) {
|
|
839
|
-
const { inboxList } = await import('./agentCommands-
|
|
844
|
+
const { inboxList } = await import('./agentCommands-C10NivHS.mjs');
|
|
840
845
|
await inboxList({
|
|
841
846
|
unread: hasFlag("--unread"),
|
|
842
847
|
limit: parseFlagInt("--limit"),
|
|
@@ -858,7 +863,7 @@ async function handleSessionCommand() {
|
|
|
858
863
|
process.exit(1);
|
|
859
864
|
}
|
|
860
865
|
if (agentSessionId && !sessionArgs[3]) {
|
|
861
|
-
const { inboxList } = await import('./agentCommands-
|
|
866
|
+
const { inboxList } = await import('./agentCommands-C10NivHS.mjs');
|
|
862
867
|
await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
|
|
863
868
|
} else if (sessionArgs[3]) {
|
|
864
869
|
await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
|
|
@@ -868,7 +873,7 @@ async function handleSessionCommand() {
|
|
|
868
873
|
}
|
|
869
874
|
} else if (inboxSubcmd === "reply") {
|
|
870
875
|
if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
|
|
871
|
-
const { inboxReply } = await import('./agentCommands-
|
|
876
|
+
const { inboxReply } = await import('./agentCommands-C10NivHS.mjs');
|
|
872
877
|
await inboxReply(sessionArgs[2], sessionArgs[3]);
|
|
873
878
|
} else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
|
|
874
879
|
await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
|
|
@@ -904,7 +909,7 @@ async function handleMachineCommand() {
|
|
|
904
909
|
return;
|
|
905
910
|
}
|
|
906
911
|
if (machineSubcommand === "share") {
|
|
907
|
-
const { machineShare } = await import('./commands-
|
|
912
|
+
const { machineShare } = await import('./commands-B75aXb6C.mjs');
|
|
908
913
|
let machineId;
|
|
909
914
|
const shareArgs = [];
|
|
910
915
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
@@ -934,7 +939,7 @@ async function handleMachineCommand() {
|
|
|
934
939
|
}
|
|
935
940
|
await machineShare(machineId, { add, remove, list, configPath, showConfig });
|
|
936
941
|
} else if (machineSubcommand === "exec") {
|
|
937
|
-
const { machineExec } = await import('./commands-
|
|
942
|
+
const { machineExec } = await import('./commands-B75aXb6C.mjs');
|
|
938
943
|
let machineId;
|
|
939
944
|
let cwd;
|
|
940
945
|
const cmdParts = [];
|
|
@@ -954,7 +959,7 @@ async function handleMachineCommand() {
|
|
|
954
959
|
}
|
|
955
960
|
await machineExec(machineId, command, cwd);
|
|
956
961
|
} else if (machineSubcommand === "info") {
|
|
957
|
-
const { machineInfo } = await import('./commands-
|
|
962
|
+
const { machineInfo } = await import('./commands-B75aXb6C.mjs');
|
|
958
963
|
let machineId;
|
|
959
964
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
960
965
|
if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
|
|
@@ -974,10 +979,10 @@ async function handleMachineCommand() {
|
|
|
974
979
|
level = machineArgs[++i];
|
|
975
980
|
}
|
|
976
981
|
}
|
|
977
|
-
const { machineNotify } = await import('./agentCommands-
|
|
982
|
+
const { machineNotify } = await import('./agentCommands-C10NivHS.mjs');
|
|
978
983
|
await machineNotify(message, level);
|
|
979
984
|
} else if (machineSubcommand === "ls") {
|
|
980
|
-
const { machineLs } = await import('./commands-
|
|
985
|
+
const { machineLs } = await import('./commands-B75aXb6C.mjs');
|
|
981
986
|
let machineId;
|
|
982
987
|
let showHidden = false;
|
|
983
988
|
let path;
|
|
@@ -1035,24 +1040,24 @@ Examples:
|
|
|
1035
1040
|
};
|
|
1036
1041
|
const hasFlag = (name) => fleetArgs.includes(`--${name}`);
|
|
1037
1042
|
if (sub === "status") {
|
|
1038
|
-
const { fleetStatus } = await import('./fleet-
|
|
1043
|
+
const { fleetStatus } = await import('./fleet-D_sem31C.mjs');
|
|
1039
1044
|
await fleetStatus();
|
|
1040
1045
|
} else if (sub === "exec") {
|
|
1041
1046
|
const command = fleetArgs.slice(1).filter((a) => !a.startsWith("--")).join(" ");
|
|
1042
|
-
const { fleetExec } = await import('./fleet-
|
|
1047
|
+
const { fleetExec } = await import('./fleet-D_sem31C.mjs');
|
|
1043
1048
|
await fleetExec(command, { cwd: flag("cwd") });
|
|
1044
1049
|
} else if (sub === "upgrade-claude") {
|
|
1045
|
-
const { fleetUpgradeClaude } = await import('./fleet-
|
|
1050
|
+
const { fleetUpgradeClaude } = await import('./fleet-D_sem31C.mjs');
|
|
1046
1051
|
await fleetUpgradeClaude({ version: flag("version", "-v") });
|
|
1047
1052
|
} else if (sub === "upgrade-svamp") {
|
|
1048
|
-
const { fleetUpgradeSvamp } = await import('./fleet-
|
|
1053
|
+
const { fleetUpgradeSvamp } = await import('./fleet-D_sem31C.mjs');
|
|
1049
1054
|
await fleetUpgradeSvamp({ version: flag("version", "-v"), excludeSelf: hasFlag("exclude-self") });
|
|
1050
1055
|
} else if (sub === "daemon-restart") {
|
|
1051
|
-
const { fleetDaemonRestart } = await import('./fleet-
|
|
1056
|
+
const { fleetDaemonRestart } = await import('./fleet-D_sem31C.mjs');
|
|
1052
1057
|
await fleetDaemonRestart({ graceful: !hasFlag("cleanup") });
|
|
1053
1058
|
} else if (sub === "push-skill") {
|
|
1054
1059
|
const name = fleetArgs[1];
|
|
1055
|
-
const { fleetPushSkill } = await import('./fleet-
|
|
1060
|
+
const { fleetPushSkill } = await import('./fleet-D_sem31C.mjs');
|
|
1056
1061
|
await fleetPushSkill(name);
|
|
1057
1062
|
} else {
|
|
1058
1063
|
console.error(`Unknown fleet subcommand: ${sub}`);
|
|
@@ -1068,7 +1073,7 @@ async function handleSkillsCommand() {
|
|
|
1068
1073
|
await printSkillsHelp();
|
|
1069
1074
|
return;
|
|
1070
1075
|
}
|
|
1071
|
-
const { skillsFind, skillsInstall, skillsList, skillsRemove, skillsPublish } = await import('./commands-
|
|
1076
|
+
const { skillsFind, skillsInstall, skillsList, skillsRemove, skillsPublish } = await import('./commands-BeZMEZhQ.mjs');
|
|
1072
1077
|
if (skillsSubcommand === "find" || skillsSubcommand === "search") {
|
|
1073
1078
|
const query = skillsArgs.slice(1).filter((a) => !a.startsWith("--")).join(" ");
|
|
1074
1079
|
if (!query) {
|
|
@@ -1107,12 +1112,28 @@ async function handleSkillsCommand() {
|
|
|
1107
1112
|
process.exit(0);
|
|
1108
1113
|
}
|
|
1109
1114
|
async function loginToHypha() {
|
|
1110
|
-
const
|
|
1111
|
-
if (!
|
|
1112
|
-
console.error("Usage: svamp login <
|
|
1113
|
-
console.error("
|
|
1115
|
+
const anchorArg = args[1] || process.env.SVAMP_INSTANCE_URL || process.env.HYPHA_SERVER_URL;
|
|
1116
|
+
if (!anchorArg) {
|
|
1117
|
+
console.error("Usage: svamp login <frontend-url> (e.g. https://svamp.aicell.io)");
|
|
1118
|
+
console.error(" The frontend serves /svamp.json, which carries the Hypha server URL and");
|
|
1119
|
+
console.error(" routing config. A Hypha server URL also works as a legacy fallback.");
|
|
1114
1120
|
process.exit(1);
|
|
1115
1121
|
}
|
|
1122
|
+
const anchor = anchorArg.replace(/\/+$/, "");
|
|
1123
|
+
const { loadInstanceConfig } = await import('./run-MQKWgYFS.mjs').then(function (n) { return n.K; });
|
|
1124
|
+
let cfg = null;
|
|
1125
|
+
try {
|
|
1126
|
+
cfg = await loadInstanceConfig({ anchor, force: true });
|
|
1127
|
+
} catch {
|
|
1128
|
+
}
|
|
1129
|
+
const configMode = !!(cfg && typeof cfg.hyphaServerUrl === "string" && cfg.hyphaServerUrl.trim());
|
|
1130
|
+
const serverUrl = configMode ? cfg.hyphaServerUrl.trim().replace(/\/+$/, "") : anchor;
|
|
1131
|
+
if (configMode) {
|
|
1132
|
+
console.log(`Found Svamp instance config at ${anchor}`);
|
|
1133
|
+
console.log(` Hypha server: ${serverUrl}`);
|
|
1134
|
+
} else {
|
|
1135
|
+
console.log(`No svamp.json found at ${anchor} \u2014 using it as the Hypha server (legacy mode).`);
|
|
1136
|
+
}
|
|
1116
1137
|
console.log(`Logging in to Hypha server: ${serverUrl}`);
|
|
1117
1138
|
console.log("A browser window will open for authentication...");
|
|
1118
1139
|
try {
|
|
@@ -1162,13 +1183,17 @@ Please open this URL in your browser:
|
|
|
1162
1183
|
const existing = fs.readFileSync(envFile, "utf-8").split("\n");
|
|
1163
1184
|
for (const line of existing) {
|
|
1164
1185
|
const trimmed = line.trim();
|
|
1165
|
-
if (trimmed.startsWith("HYPHA_TOKEN=") || trimmed.startsWith("HYPHA_WORKSPACE=") || trimmed.startsWith("HYPHA_SERVER_URL=")) {
|
|
1186
|
+
if (trimmed.startsWith("HYPHA_TOKEN=") || trimmed.startsWith("HYPHA_WORKSPACE=") || trimmed.startsWith("HYPHA_SERVER_URL=") || trimmed.startsWith("SVAMP_INSTANCE_URL=")) {
|
|
1166
1187
|
continue;
|
|
1167
1188
|
}
|
|
1168
1189
|
envLines.push(line);
|
|
1169
1190
|
}
|
|
1170
1191
|
}
|
|
1171
|
-
|
|
1192
|
+
if (configMode) {
|
|
1193
|
+
envLines.push(`SVAMP_INSTANCE_URL=${anchor}`);
|
|
1194
|
+
} else {
|
|
1195
|
+
envLines.push(`HYPHA_SERVER_URL=${serverUrl}`);
|
|
1196
|
+
}
|
|
1172
1197
|
envLines.push(`HYPHA_TOKEN=${longLivedToken}`);
|
|
1173
1198
|
envLines.push(`HYPHA_WORKSPACE=${workspace}`);
|
|
1174
1199
|
while (envLines.length > 0 && envLines[envLines.length - 1].trim() === "") {
|
|
@@ -1205,12 +1230,17 @@ async function logoutFromHypha() {
|
|
|
1205
1230
|
await stopDaemon();
|
|
1206
1231
|
} catch {
|
|
1207
1232
|
}
|
|
1233
|
+
try {
|
|
1234
|
+
const { clearInstanceConfigCache } = await import('./run-MQKWgYFS.mjs').then(function (n) { return n.K; });
|
|
1235
|
+
clearInstanceConfigCache();
|
|
1236
|
+
} catch {
|
|
1237
|
+
}
|
|
1208
1238
|
if (fs.existsSync(envFile)) {
|
|
1209
1239
|
const existing = fs.readFileSync(envFile, "utf-8").split("\n");
|
|
1210
1240
|
const kept = [];
|
|
1211
1241
|
for (const line of existing) {
|
|
1212
1242
|
const trimmed = line.trim();
|
|
1213
|
-
if (trimmed.startsWith("HYPHA_TOKEN=") || trimmed.startsWith("HYPHA_WORKSPACE=") || trimmed.startsWith("HYPHA_SERVER_URL=")) {
|
|
1243
|
+
if (trimmed.startsWith("HYPHA_TOKEN=") || trimmed.startsWith("HYPHA_WORKSPACE=") || trimmed.startsWith("HYPHA_SERVER_URL=") || trimmed.startsWith("SVAMP_INSTANCE_URL=")) {
|
|
1214
1244
|
continue;
|
|
1215
1245
|
}
|
|
1216
1246
|
kept.push(line);
|
|
@@ -1514,7 +1544,7 @@ async function applyClaudeAuthFlags(argv) {
|
|
|
1514
1544
|
"--use-hypha-proxy, --use-claude-login, and --anthropic-base-url/--anthropic-api-key are mutually exclusive"
|
|
1515
1545
|
);
|
|
1516
1546
|
}
|
|
1517
|
-
const mod = await import('./run-
|
|
1547
|
+
const mod = await import('./run-MQKWgYFS.mjs').then(function (n) { return n.J; });
|
|
1518
1548
|
if (hasHypha) {
|
|
1519
1549
|
let url;
|
|
1520
1550
|
const hyphaIdx = argv.indexOf("--use-hypha-proxy");
|
|
@@ -1568,7 +1598,7 @@ async function applyDaemonShareFlag(argv) {
|
|
|
1568
1598
|
}
|
|
1569
1599
|
}
|
|
1570
1600
|
if (collected.length === 0) return;
|
|
1571
|
-
const { updateEnvFile } = await import('./run-
|
|
1601
|
+
const { updateEnvFile } = await import('./run-MQKWgYFS.mjs').then(function (n) { return n.J; });
|
|
1572
1602
|
const seen = /* @__PURE__ */ new Set();
|
|
1573
1603
|
const deduped = collected.filter((e) => {
|
|
1574
1604
|
const k = e.toLowerCase();
|
|
@@ -1581,7 +1611,7 @@ async function applyDaemonShareFlag(argv) {
|
|
|
1581
1611
|
}
|
|
1582
1612
|
async function handleDaemonAuthCommand(argv) {
|
|
1583
1613
|
const sub = (argv[0] || "status").toLowerCase();
|
|
1584
|
-
const mod = await import('./run-
|
|
1614
|
+
const mod = await import('./run-MQKWgYFS.mjs').then(function (n) { return n.J; });
|
|
1585
1615
|
if (sub === "--help" || sub === "-h" || sub === "help") {
|
|
1586
1616
|
console.log(`
|
|
1587
1617
|
svamp daemon auth \u2014 Configure how Claude subprocesses authenticate
|
|
@@ -1874,8 +1904,8 @@ Examples:
|
|
|
1874
1904
|
async function printSkillsHelp() {
|
|
1875
1905
|
let browseUrl = "<HYPHA_SERVER_URL>/<workspace>/artifacts/marketplace (set HYPHA_SERVER_URL)";
|
|
1876
1906
|
try {
|
|
1877
|
-
const { getArtifactBaseUrl,
|
|
1878
|
-
browseUrl = `${getArtifactBaseUrl()}/${
|
|
1907
|
+
const { getArtifactBaseUrl, getSkillsCollectionName } = await import('./run-MQKWgYFS.mjs').then(function (n) { return n.L; });
|
|
1908
|
+
browseUrl = `${getArtifactBaseUrl()}/${getSkillsCollectionName()}`;
|
|
1879
1909
|
} catch {
|
|
1880
1910
|
}
|
|
1881
1911
|
console.log(`
|
|
@@ -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 {
|
|
5
|
+
import { w as normalizeAllowedUser, x as loadSecurityContextConfig, y as resolveSecurityContext, z as buildSecurityContextFromFlags, A as mergeSecurityContexts, c as connectToHypha, B as buildSessionShareUrl, C as buildMachineShareUrl } from './run-MQKWgYFS.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
8
8
|
import 'fs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import os from 'os';
|
|
2
2
|
import fs__default from 'fs';
|
|
3
3
|
import { resolve, join, relative } from 'path';
|
|
4
|
-
import { p as parseFrontmatter,
|
|
4
|
+
import { p as parseFrontmatter, k as getSkillsServer, l as getSkillsWorkspaceName, m as getSkillsCollectionName, n as fetchWithTimeout, o as searchSkills, q as SKILLS_DIR, t as getSkillInfo, u as downloadSkillFile, v as listSkillFiles } from './run-MQKWgYFS.mjs';
|
|
5
5
|
import 'fs/promises';
|
|
6
6
|
import 'url';
|
|
7
7
|
import 'child_process';
|
|
@@ -276,7 +276,7 @@ async function skillsPublish(skillPath, opts) {
|
|
|
276
276
|
server = await connectToServer({
|
|
277
277
|
server_url: serverUrl,
|
|
278
278
|
token,
|
|
279
|
-
workspace:
|
|
279
|
+
workspace: getSkillsWorkspaceName()
|
|
280
280
|
});
|
|
281
281
|
} catch (err) {
|
|
282
282
|
console.error(`Failed to connect to Hypha: ${err.message}`);
|
|
@@ -295,7 +295,7 @@ async function skillsPublish(skillPath, opts) {
|
|
|
295
295
|
let existingArtifact = null;
|
|
296
296
|
try {
|
|
297
297
|
existingArtifact = await am.read({
|
|
298
|
-
artifact_id: `${
|
|
298
|
+
artifact_id: `${getSkillsWorkspaceName()}/${manifest.name}`,
|
|
299
299
|
_rkwargs: true
|
|
300
300
|
});
|
|
301
301
|
} catch {
|
|
@@ -325,7 +325,7 @@ async function skillsPublish(skillPath, opts) {
|
|
|
325
325
|
const created = await am.create({
|
|
326
326
|
alias: manifest.name,
|
|
327
327
|
type: "skill",
|
|
328
|
-
parent_id: `${
|
|
328
|
+
parent_id: `${getSkillsWorkspaceName()}/${getSkillsCollectionName()}`,
|
|
329
329
|
manifest: {
|
|
330
330
|
name: manifest.name,
|
|
331
331
|
description: manifest.description,
|
|
@@ -400,8 +400,8 @@ async function skillsPublish(skillPath, opts) {
|
|
|
400
400
|
}
|
|
401
401
|
const skillsServer = getSkillsServer();
|
|
402
402
|
console.log(`Published "${manifest.name}" (${uploaded} files)${versionTag ? ` as ${versionTag}` : ""}`);
|
|
403
|
-
console.log(` View: ${skillsServer}/${
|
|
404
|
-
const gitUrl = `${skillsServer}/${
|
|
403
|
+
console.log(` View: ${skillsServer}/${getSkillsWorkspaceName()}/artifacts/${manifest.name}`);
|
|
404
|
+
const gitUrl = `${skillsServer}/${getSkillsWorkspaceName()}/git/${manifest.name}`;
|
|
405
405
|
console.log(` Git: ${gitUrl}`);
|
|
406
406
|
if (isUpdate) {
|
|
407
407
|
console.log(` Tip: Use --version <tag> to publish a named version.`);
|
|
@@ -58,7 +58,7 @@ async function serviceExpose(args) {
|
|
|
58
58
|
process.exit(1);
|
|
59
59
|
}
|
|
60
60
|
if (foreground) {
|
|
61
|
-
const { runFrpcTunnel } = await import('./frpc-
|
|
61
|
+
const { runFrpcTunnel } = await import('./frpc-D3LiH7GX.mjs');
|
|
62
62
|
await runFrpcTunnel(name, ports, void 0, {
|
|
63
63
|
group,
|
|
64
64
|
groupKey,
|
|
@@ -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-B75aXb6C.mjs');
|
|
72
72
|
const { server, machine } = await connectAndGetMachine();
|
|
73
73
|
try {
|
|
74
74
|
const status = await machine.tunnelStart({
|
|
@@ -123,7 +123,7 @@ async function serviceServe(args) {
|
|
|
123
123
|
};
|
|
124
124
|
process.on("SIGINT", cleanup);
|
|
125
125
|
process.on("SIGTERM", cleanup);
|
|
126
|
-
const { runFrpcTunnel } = await import('./frpc-
|
|
126
|
+
const { runFrpcTunnel } = await import('./frpc-D3LiH7GX.mjs');
|
|
127
127
|
await runFrpcTunnel(name, [caddyPort]);
|
|
128
128
|
} catch (err) {
|
|
129
129
|
console.error(`Error serving directory: ${err.message}`);
|
|
@@ -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-B75aXb6C.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-B75aXb6C.mjs');
|
|
165
165
|
const { server, machine } = await connectAndGetMachine();
|
|
166
166
|
try {
|
|
167
167
|
await machine.tunnelStop({ name });
|
|
@@ -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-B75aXb6C.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-MQKWgYFS.mjs';
|
|
9
9
|
import 'os';
|
|
10
10
|
import 'fs/promises';
|
|
11
11
|
import 'url';
|
|
@@ -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-MQKWgYFS.mjs';
|
|
5
5
|
import { PINNED_CLAUDE_CODE_VERSION } from './pinnedClaudeCode-HydRNEt7.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
@@ -3,7 +3,7 @@ import { mkdirSync, writeFileSync, unlinkSync, existsSync, chmodSync, readFileSy
|
|
|
3
3
|
import { join } from 'path';
|
|
4
4
|
import { homedir, platform, arch } from 'os';
|
|
5
5
|
import { createHash, randomUUID } from 'crypto';
|
|
6
|
-
import { e as getFrpsSubdomainHost, f as getFrpsServerAddr } from './run-
|
|
6
|
+
import { e as getFrpsSubdomainHost, f as getFrpsServerPort, h as getFrpsServerAddr } from './run-MQKWgYFS.mjs';
|
|
7
7
|
import 'fs/promises';
|
|
8
8
|
import 'url';
|
|
9
9
|
import 'node:fs';
|
|
@@ -229,7 +229,7 @@ class FrpcTunnel {
|
|
|
229
229
|
const hyphaToken = options.serverConfig?.hyphaToken || process.env.HYPHA_TOKEN || "";
|
|
230
230
|
this.serverConfig = {
|
|
231
231
|
serverAddr: options.serverConfig?.serverAddr || process.env.FRPS_SERVER_ADDR || (isInCluster() ? FRPS_CLUSTER_ADDR : getFrpsServerAddr()),
|
|
232
|
-
serverPort: options.serverConfig?.serverPort ||
|
|
232
|
+
serverPort: options.serverConfig?.serverPort || getFrpsServerPort() || DEFAULT_FRPS_PORT,
|
|
233
233
|
authToken: options.serverConfig?.authToken || process.env.FRPS_AUTH_TOKEN || FRPS_PUBLIC_TOKEN,
|
|
234
234
|
hyphaToken,
|
|
235
235
|
subDomainHost: options.serverConfig?.subDomainHost || process.env.FRPS_SUBDOMAIN_HOST || getFrpsSubdomainHost()
|
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-MQKWgYFS.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var name = "svamp-cli";
|
|
2
|
+
var version = "0.2.84";
|
|
3
|
+
var description = "Svamp CLI — AI workspace daemon on Hypha Cloud";
|
|
4
|
+
var author = "Amun AI AB";
|
|
5
|
+
var license = "SEE LICENSE IN LICENSE";
|
|
6
|
+
var type = "module";
|
|
7
|
+
var bin = {
|
|
8
|
+
svamp: "./bin/svamp.mjs"
|
|
9
|
+
};
|
|
10
|
+
var files = [
|
|
11
|
+
"dist",
|
|
12
|
+
"bin"
|
|
13
|
+
];
|
|
14
|
+
var main = "./dist/index.mjs";
|
|
15
|
+
var exports$1 = {
|
|
16
|
+
".": "./dist/index.mjs",
|
|
17
|
+
"./cli": "./dist/cli.mjs"
|
|
18
|
+
};
|
|
19
|
+
var scripts = {
|
|
20
|
+
build: "rm -rf dist bin/skills && mkdir -p bin/skills && cp -r ../../skills/artifact bin/skills/artifact && tsc --noEmit && pkgroll",
|
|
21
|
+
typecheck: "tsc --noEmit",
|
|
22
|
+
test: "npx tsx test/test-context-window.mjs && npx tsx test/test-instance-config.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 && node test/fleet.test.mjs",
|
|
23
|
+
"test:hypha": "node --no-warnings test/test-hypha-service.mjs",
|
|
24
|
+
dev: "tsx src/cli.ts",
|
|
25
|
+
"dev:daemon": "tsx src/cli.ts daemon start-sync",
|
|
26
|
+
"test:e2e": "node --no-warnings test/e2e-session-tests.mjs",
|
|
27
|
+
"test:frpc": "npx tsx test/test-frpc-e2e.mjs"
|
|
28
|
+
};
|
|
29
|
+
var dependencies = {
|
|
30
|
+
"@agentclientprotocol/sdk": "^0.14.1",
|
|
31
|
+
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
32
|
+
"hypha-rpc": "0.21.40",
|
|
33
|
+
"node-pty": "1.2.0-beta.11",
|
|
34
|
+
ws: "^8.18.0",
|
|
35
|
+
yaml: "^2.8.2",
|
|
36
|
+
zod: "^3.24.4"
|
|
37
|
+
};
|
|
38
|
+
var devDependencies = {
|
|
39
|
+
"@types/node": ">=20",
|
|
40
|
+
"@types/ws": "^8.5.14",
|
|
41
|
+
pkgroll: "^2.14.2",
|
|
42
|
+
tsx: "^4.20.6",
|
|
43
|
+
typescript: "5.9.3"
|
|
44
|
+
};
|
|
45
|
+
var packageManager = "yarn@1.22.22";
|
|
46
|
+
var _package = {
|
|
47
|
+
name: name,
|
|
48
|
+
version: version,
|
|
49
|
+
description: description,
|
|
50
|
+
author: author,
|
|
51
|
+
license: license,
|
|
52
|
+
type: type,
|
|
53
|
+
bin: bin,
|
|
54
|
+
files: files,
|
|
55
|
+
main: main,
|
|
56
|
+
exports: exports$1,
|
|
57
|
+
scripts: scripts,
|
|
58
|
+
dependencies: dependencies,
|
|
59
|
+
devDependencies: devDependencies,
|
|
60
|
+
packageManager: packageManager
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export { author, bin, _package as default, dependencies, description, devDependencies, exports$1 as exports, files, license, main, name, packageManager, scripts, type, version };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import os from 'os';
|
|
1
|
+
import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import os, { homedir as homedir$1 } from 'os';
|
|
2
2
|
import fs, { mkdir as mkdir$1, readdir as readdir$1, readFile, writeFile as writeFile$1, rename, unlink } from 'fs/promises';
|
|
3
|
-
import { readFileSync as readFileSync$1, mkdirSync, writeFileSync, renameSync, existsSync as existsSync$1, copyFileSync, unlinkSync as unlinkSync$1, watch, rmdirSync, readdirSync } from 'fs';
|
|
3
|
+
import { readFileSync as readFileSync$1, mkdirSync, writeFileSync, renameSync, existsSync as existsSync$1, rmSync, copyFileSync, unlinkSync as unlinkSync$1, watch, rmdirSync, readdirSync } from 'fs';
|
|
4
4
|
import path__default, { join, dirname, resolve, basename } from 'path';
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
6
|
import { execFile, spawn as spawn$1, execSync as execSync$1 } from 'child_process';
|
|
@@ -1393,7 +1393,7 @@ async function registerMachineService(server, machineId, metadata, daemonState,
|
|
|
1393
1393
|
const tunnels = handlers.tunnels;
|
|
1394
1394
|
if (!tunnels) throw new Error("Tunnel management not available");
|
|
1395
1395
|
if (tunnels.has(params.name)) throw new Error(`Tunnel '${params.name}' already running`);
|
|
1396
|
-
const { FrpcTunnel } = await import('./frpc-
|
|
1396
|
+
const { FrpcTunnel } = await import('./frpc-D3LiH7GX.mjs');
|
|
1397
1397
|
const tunnel = new FrpcTunnel({
|
|
1398
1398
|
name: params.name,
|
|
1399
1399
|
ports: params.ports,
|
|
@@ -1522,9 +1522,22 @@ async function registerMachineService(server, machineId, metadata, daemonState,
|
|
|
1522
1522
|
await sm.recreateTunnel();
|
|
1523
1523
|
return { success: true, health: sm.getTunnelHealth() };
|
|
1524
1524
|
},
|
|
1525
|
-
// WISE voice — create ephemeral token for OpenAI Realtime API
|
|
1525
|
+
// WISE voice — create ephemeral token for OpenAI Realtime API.
|
|
1526
|
+
//
|
|
1527
|
+
// Minting is intentionally NOT gated on machine sharing. The mint only
|
|
1528
|
+
// exchanges an OpenAI key for a short-lived ephemeral token; anything the
|
|
1529
|
+
// resulting WISE agent actually does flows back through the session/machine
|
|
1530
|
+
// RPCs (sendMessage=interact, bash/terminal=admin, …), each authorized on
|
|
1531
|
+
// its own. Gating the mint on `interact` here added no real protection —
|
|
1532
|
+
// an interact user can already drive the agent to do anything on this box —
|
|
1533
|
+
// but it DID cause false failures when the resolved machine wasn't shared
|
|
1534
|
+
// to the caller's identity (e.g. a machine with sharing disabled). We only
|
|
1535
|
+
// require a signed-in, non-anonymous user so the daemon isn't an open
|
|
1536
|
+
// OpenAI relay. (No context at all = internal call → allowed.)
|
|
1526
1537
|
wiseCreateEphemeralToken: async (params, context) => {
|
|
1527
|
-
|
|
1538
|
+
if (context && (!context.user || context.user.is_anonymous)) {
|
|
1539
|
+
return { success: false, error: "Sign in to use WISE voice." };
|
|
1540
|
+
}
|
|
1528
1541
|
const apiKey = params.apiKey || process.env.OPENAI_API_KEY;
|
|
1529
1542
|
if (!apiKey) {
|
|
1530
1543
|
return { success: false, error: "No OpenAI API key found. Set OPENAI_API_KEY or pass apiKey." };
|
|
@@ -5543,38 +5556,177 @@ var claudeAuth = /*#__PURE__*/Object.freeze({
|
|
|
5543
5556
|
updateEnvFile: updateEnvFile
|
|
5544
5557
|
});
|
|
5545
5558
|
|
|
5559
|
+
const SVAMP_HOME$2 = process.env.SVAMP_HOME || join(homedir$1(), ".svamp");
|
|
5560
|
+
const CACHE_FILE = join(SVAMP_HOME$2, "instance-config.json");
|
|
5561
|
+
const CONFIG_FILENAME = "svamp.json";
|
|
5562
|
+
let _config = null;
|
|
5563
|
+
let _loaded = false;
|
|
5564
|
+
function stripSlash$1(u) {
|
|
5565
|
+
return u.replace(/\/+$/, "");
|
|
5566
|
+
}
|
|
5567
|
+
function getInstanceUrl() {
|
|
5568
|
+
const raw = (process.env.SVAMP_INSTANCE_URL || "").trim();
|
|
5569
|
+
return raw ? stripSlash$1(raw) : void 0;
|
|
5570
|
+
}
|
|
5571
|
+
function configUrlsFor(anchor) {
|
|
5572
|
+
const base = stripSlash$1(anchor);
|
|
5573
|
+
return [`${base}/${CONFIG_FILENAME}`, `${base}/.well-known/${CONFIG_FILENAME}`];
|
|
5574
|
+
}
|
|
5575
|
+
async function fetchConfig(anchor) {
|
|
5576
|
+
for (const url of configUrlsFor(anchor)) {
|
|
5577
|
+
try {
|
|
5578
|
+
const resp = await fetch(url, { signal: AbortSignal.timeout(8e3) });
|
|
5579
|
+
if (!resp.ok) continue;
|
|
5580
|
+
const data = await resp.json();
|
|
5581
|
+
if (data && typeof data === "object" && !Array.isArray(data)) {
|
|
5582
|
+
return data;
|
|
5583
|
+
}
|
|
5584
|
+
} catch {
|
|
5585
|
+
}
|
|
5586
|
+
}
|
|
5587
|
+
return null;
|
|
5588
|
+
}
|
|
5589
|
+
function readCache() {
|
|
5590
|
+
try {
|
|
5591
|
+
if (existsSync$1(CACHE_FILE)) {
|
|
5592
|
+
const data = JSON.parse(readFileSync$1(CACHE_FILE, "utf-8"));
|
|
5593
|
+
if (data && typeof data === "object" && !Array.isArray(data)) return data;
|
|
5594
|
+
}
|
|
5595
|
+
} catch {
|
|
5596
|
+
}
|
|
5597
|
+
return null;
|
|
5598
|
+
}
|
|
5599
|
+
function writeCache(cfg) {
|
|
5600
|
+
try {
|
|
5601
|
+
mkdirSync(SVAMP_HOME$2, { recursive: true });
|
|
5602
|
+
writeFileSync(CACHE_FILE, JSON.stringify(cfg, null, 2) + "\n", "utf-8");
|
|
5603
|
+
} catch {
|
|
5604
|
+
}
|
|
5605
|
+
}
|
|
5606
|
+
function applyConfig(cfg) {
|
|
5607
|
+
_config = cfg;
|
|
5608
|
+
if (cfg.hyphaServerUrl && typeof cfg.hyphaServerUrl === "string") {
|
|
5609
|
+
process.env.HYPHA_SERVER_URL = stripSlash$1(cfg.hyphaServerUrl.trim());
|
|
5610
|
+
}
|
|
5611
|
+
}
|
|
5612
|
+
async function loadInstanceConfig(opts = {}) {
|
|
5613
|
+
if (_loaded && !opts.force) return _config;
|
|
5614
|
+
const anchor = opts.anchor ? stripSlash$1(opts.anchor) : getInstanceUrl();
|
|
5615
|
+
if (anchor) {
|
|
5616
|
+
const fetched = await fetchConfig(anchor);
|
|
5617
|
+
if (fetched) {
|
|
5618
|
+
applyConfig(fetched);
|
|
5619
|
+
writeCache(fetched);
|
|
5620
|
+
_loaded = true;
|
|
5621
|
+
return _config;
|
|
5622
|
+
}
|
|
5623
|
+
}
|
|
5624
|
+
const cached = readCache();
|
|
5625
|
+
if (cached) applyConfig(cached);
|
|
5626
|
+
_loaded = true;
|
|
5627
|
+
return _config;
|
|
5628
|
+
}
|
|
5629
|
+
function getLoadedConfig() {
|
|
5630
|
+
if (!_loaded) {
|
|
5631
|
+
const cached = readCache();
|
|
5632
|
+
if (cached) applyConfig(cached);
|
|
5633
|
+
_loaded = true;
|
|
5634
|
+
}
|
|
5635
|
+
return _config;
|
|
5636
|
+
}
|
|
5637
|
+
function clearInstanceConfigCache() {
|
|
5638
|
+
_config = null;
|
|
5639
|
+
_loaded = false;
|
|
5640
|
+
try {
|
|
5641
|
+
if (existsSync$1(CACHE_FILE)) rmSync(CACHE_FILE);
|
|
5642
|
+
} catch {
|
|
5643
|
+
}
|
|
5644
|
+
}
|
|
5645
|
+
function __setConfigForTest(cfg) {
|
|
5646
|
+
_config = cfg;
|
|
5647
|
+
_loaded = true;
|
|
5648
|
+
if (cfg) applyConfig(cfg);
|
|
5649
|
+
}
|
|
5650
|
+
function __resetForTest() {
|
|
5651
|
+
_config = null;
|
|
5652
|
+
_loaded = false;
|
|
5653
|
+
}
|
|
5654
|
+
|
|
5655
|
+
var instanceConfig = /*#__PURE__*/Object.freeze({
|
|
5656
|
+
__proto__: null,
|
|
5657
|
+
CONFIG_FILENAME: CONFIG_FILENAME,
|
|
5658
|
+
__resetForTest: __resetForTest,
|
|
5659
|
+
__setConfigForTest: __setConfigForTest,
|
|
5660
|
+
clearInstanceConfigCache: clearInstanceConfigCache,
|
|
5661
|
+
configUrlsFor: configUrlsFor,
|
|
5662
|
+
getInstanceUrl: getInstanceUrl,
|
|
5663
|
+
getLoadedConfig: getLoadedConfig,
|
|
5664
|
+
loadInstanceConfig: loadInstanceConfig
|
|
5665
|
+
});
|
|
5666
|
+
|
|
5667
|
+
function stripSlash(u) {
|
|
5668
|
+
return u.replace(/\/+$/, "");
|
|
5669
|
+
}
|
|
5546
5670
|
function getHyphaServerUrl() {
|
|
5547
|
-
const
|
|
5548
|
-
|
|
5671
|
+
const fromCfg = getLoadedConfig()?.hyphaServerUrl;
|
|
5672
|
+
if (typeof fromCfg === "string" && fromCfg.trim()) return stripSlash(fromCfg.trim());
|
|
5673
|
+
const env = (process.env.HYPHA_SERVER_URL || "").trim();
|
|
5674
|
+
return env ? stripSlash(env) : void 0;
|
|
5549
5675
|
}
|
|
5550
5676
|
function getFrpsSubdomainHost() {
|
|
5551
|
-
const
|
|
5552
|
-
if (
|
|
5677
|
+
const fromCfg = getLoadedConfig()?.frps?.subdomainHost;
|
|
5678
|
+
if (typeof fromCfg === "string" && fromCfg.trim()) return fromCfg.trim();
|
|
5679
|
+
const env = (process.env.FRPS_SUBDOMAIN_HOST || "").trim();
|
|
5680
|
+
if (env) return env;
|
|
5553
5681
|
throw new Error(
|
|
5554
|
-
|
|
5682
|
+
'frps subdomain host is not configured. Serve a svamp.json with "frps.subdomainHost" at your frontend URL (svamp login <frontend-url>), or set FRPS_SUBDOMAIN_HOST (legacy). It is deployment-specific and never guessed.'
|
|
5555
5683
|
);
|
|
5556
5684
|
}
|
|
5557
5685
|
function getFrpsServerAddr() {
|
|
5558
|
-
const
|
|
5559
|
-
if (
|
|
5686
|
+
const fromCfg = getLoadedConfig()?.frps?.serverAddr;
|
|
5687
|
+
if (typeof fromCfg === "string" && fromCfg.trim()) return fromCfg.trim();
|
|
5688
|
+
const env = (process.env.FRPS_SERVER_ADDR || "").trim();
|
|
5689
|
+
if (env) return env;
|
|
5560
5690
|
return `frps-ctrl.${getFrpsSubdomainHost()}`;
|
|
5561
5691
|
}
|
|
5692
|
+
function getFrpsServerPort() {
|
|
5693
|
+
const fromCfg = getLoadedConfig()?.frps?.serverPort;
|
|
5694
|
+
if (typeof fromCfg === "number" && Number.isFinite(fromCfg)) return fromCfg;
|
|
5695
|
+
const env = parseInt(process.env.FRPS_SERVER_PORT || "", 10);
|
|
5696
|
+
return Number.isFinite(env) ? env : void 0;
|
|
5697
|
+
}
|
|
5562
5698
|
function getSvampWebBaseUrl() {
|
|
5563
|
-
const
|
|
5564
|
-
if (
|
|
5699
|
+
const fromCfg = getLoadedConfig()?.web?.baseUrl;
|
|
5700
|
+
if (typeof fromCfg === "string" && fromCfg.trim()) return stripSlash(fromCfg.trim());
|
|
5701
|
+
const env = (process.env.SVAMP_WEB_URL || "").trim();
|
|
5702
|
+
if (env) return stripSlash(env);
|
|
5703
|
+
const instance = getInstanceUrl();
|
|
5704
|
+
if (instance) return instance;
|
|
5565
5705
|
throw new Error(
|
|
5566
|
-
|
|
5706
|
+
'Svamp web base URL is not configured. Serve a svamp.json with "web.baseUrl", log in with your frontend URL (svamp login <frontend-url>), or set SVAMP_WEB_URL (legacy).'
|
|
5567
5707
|
);
|
|
5568
5708
|
}
|
|
5569
5709
|
function getSkillsServerUrl() {
|
|
5570
|
-
const
|
|
5571
|
-
if (
|
|
5710
|
+
const fromCfg = getLoadedConfig()?.skills?.server;
|
|
5711
|
+
if (typeof fromCfg === "string" && fromCfg.trim()) return stripSlash(fromCfg.trim());
|
|
5712
|
+
const env = (process.env.HYPHA_SKILLS_SERVER || "").trim();
|
|
5713
|
+
if (env) return stripSlash(env);
|
|
5572
5714
|
const server = getHyphaServerUrl();
|
|
5573
5715
|
if (server) return server;
|
|
5574
5716
|
throw new Error(
|
|
5575
|
-
"Cannot determine skills marketplace server
|
|
5717
|
+
"Cannot determine skills marketplace server. Serve a svamp.json or set HYPHA_SERVER_URL."
|
|
5576
5718
|
);
|
|
5577
5719
|
}
|
|
5720
|
+
function getSkillsWorkspace() {
|
|
5721
|
+
const fromCfg = getLoadedConfig()?.skills?.workspace;
|
|
5722
|
+
if (typeof fromCfg === "string" && fromCfg.trim()) return fromCfg.trim();
|
|
5723
|
+
return (process.env.HYPHA_SKILLS_WORKSPACE || "").trim() || "hypha-cloud";
|
|
5724
|
+
}
|
|
5725
|
+
function getSkillsCollection() {
|
|
5726
|
+
const fromCfg = getLoadedConfig()?.skills?.collection;
|
|
5727
|
+
if (typeof fromCfg === "string" && fromCfg.trim()) return fromCfg.trim();
|
|
5728
|
+
return (process.env.HYPHA_SKILLS_COLLECTION || "").trim() || "marketplace";
|
|
5729
|
+
}
|
|
5578
5730
|
|
|
5579
5731
|
function getShareBaseUrl() {
|
|
5580
5732
|
return getSvampWebBaseUrl();
|
|
@@ -5960,14 +6112,18 @@ function escapeHtml(s) {
|
|
|
5960
6112
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
5961
6113
|
}
|
|
5962
6114
|
|
|
5963
|
-
const SKILLS_WORKSPACE = process.env.HYPHA_SKILLS_WORKSPACE || "hypha-cloud";
|
|
5964
|
-
const SKILLS_COLLECTION = process.env.HYPHA_SKILLS_COLLECTION || "marketplace";
|
|
5965
6115
|
const SKILLS_DIR = join(os.homedir(), ".claude", "skills");
|
|
6116
|
+
function getSkillsWorkspaceName() {
|
|
6117
|
+
return getSkillsWorkspace();
|
|
6118
|
+
}
|
|
6119
|
+
function getSkillsCollectionName() {
|
|
6120
|
+
return getSkillsCollection();
|
|
6121
|
+
}
|
|
5966
6122
|
function getSkillsServer() {
|
|
5967
6123
|
return getSkillsServerUrl();
|
|
5968
6124
|
}
|
|
5969
6125
|
function getArtifactBaseUrl() {
|
|
5970
|
-
return `${getSkillsServer()}/${
|
|
6126
|
+
return `${getSkillsServer()}/${getSkillsWorkspaceName()}/artifacts`;
|
|
5971
6127
|
}
|
|
5972
6128
|
async function fetchWithTimeout(url, options = {}, timeoutMs = 3e4) {
|
|
5973
6129
|
const controller = new AbortController();
|
|
@@ -6025,7 +6181,7 @@ function parseFrontmatter(content) {
|
|
|
6025
6181
|
async function searchSkills(query) {
|
|
6026
6182
|
const base = getArtifactBaseUrl();
|
|
6027
6183
|
const filters = encodeURIComponent(JSON.stringify({ type: "skill" }));
|
|
6028
|
-
const url = `${base}/${
|
|
6184
|
+
const url = `${base}/${getSkillsCollectionName()}/children?keywords=${encodeURIComponent(query)}&filters=${filters}&limit=50`;
|
|
6029
6185
|
const resp = await fetchWithTimeout(url);
|
|
6030
6186
|
if (!resp.ok) {
|
|
6031
6187
|
if (resp.status === 404) return [];
|
|
@@ -6037,7 +6193,7 @@ async function searchSkills(query) {
|
|
|
6037
6193
|
async function listAllSkills(offset = 0, limit = 100) {
|
|
6038
6194
|
const base = getArtifactBaseUrl();
|
|
6039
6195
|
const filters = encodeURIComponent(JSON.stringify({ type: "skill" }));
|
|
6040
|
-
const url = `${base}/${
|
|
6196
|
+
const url = `${base}/${getSkillsCollectionName()}/children?filters=${filters}&offset=${offset}&limit=${limit}`;
|
|
6041
6197
|
const resp = await fetchWithTimeout(url);
|
|
6042
6198
|
if (!resp.ok) {
|
|
6043
6199
|
if (resp.status === 404) return [];
|
|
@@ -6109,15 +6265,15 @@ function normalizeSkill(item) {
|
|
|
6109
6265
|
|
|
6110
6266
|
var api = /*#__PURE__*/Object.freeze({
|
|
6111
6267
|
__proto__: null,
|
|
6112
|
-
SKILLS_COLLECTION: SKILLS_COLLECTION,
|
|
6113
6268
|
SKILLS_DIR: SKILLS_DIR,
|
|
6114
|
-
SKILLS_WORKSPACE: SKILLS_WORKSPACE,
|
|
6115
6269
|
downloadSkillFile: downloadSkillFile,
|
|
6116
6270
|
downloadSkillZip: downloadSkillZip,
|
|
6117
6271
|
fetchWithTimeout: fetchWithTimeout,
|
|
6118
6272
|
getArtifactBaseUrl: getArtifactBaseUrl,
|
|
6119
6273
|
getSkillInfo: getSkillInfo,
|
|
6274
|
+
getSkillsCollectionName: getSkillsCollectionName,
|
|
6120
6275
|
getSkillsServer: getSkillsServer,
|
|
6276
|
+
getSkillsWorkspaceName: getSkillsWorkspaceName,
|
|
6121
6277
|
listAllSkills: listAllSkills,
|
|
6122
6278
|
listSkillFiles: listSkillFiles,
|
|
6123
6279
|
parseFrontmatter: parseFrontmatter,
|
|
@@ -8144,10 +8300,16 @@ async function startDaemon(options) {
|
|
|
8144
8300
|
process.exit(0);
|
|
8145
8301
|
}
|
|
8146
8302
|
}
|
|
8303
|
+
try {
|
|
8304
|
+
await loadInstanceConfig();
|
|
8305
|
+
} catch (err) {
|
|
8306
|
+
logger.log(`[config] Instance config load failed (continuing with env): ${err?.message || err}`);
|
|
8307
|
+
}
|
|
8147
8308
|
const hyphaServerUrl = process.env.HYPHA_SERVER_URL;
|
|
8148
8309
|
if (!hyphaServerUrl) {
|
|
8149
|
-
console.error("
|
|
8150
|
-
console.error('Run "svamp login <
|
|
8310
|
+
console.error("No Hypha server configured.");
|
|
8311
|
+
console.error('Run "svamp login <frontend-url>" first (e.g. https://svamp.aicell.io),');
|
|
8312
|
+
console.error("or set SVAMP_INSTANCE_URL / HYPHA_SERVER_URL in .env or the environment.");
|
|
8151
8313
|
process.exit(1);
|
|
8152
8314
|
}
|
|
8153
8315
|
const hyphaToken = process.env.HYPHA_TOKEN;
|
|
@@ -8207,7 +8369,7 @@ async function startDaemon(options) {
|
|
|
8207
8369
|
const list = loadExposedTunnels().filter((t) => t.name !== name);
|
|
8208
8370
|
saveExposedTunnels(list);
|
|
8209
8371
|
}
|
|
8210
|
-
const { ServeManager } = await import('./serveManager-
|
|
8372
|
+
const { ServeManager } = await import('./serveManager-j2Z-hrHL.mjs');
|
|
8211
8373
|
const serveManager = new ServeManager(SVAMP_HOME, (msg) => logger.log(`[SERVE] ${msg}`), hyphaServerUrl);
|
|
8212
8374
|
ensureAutoInstalledSkills(logger).catch(() => {
|
|
8213
8375
|
});
|
|
@@ -10780,7 +10942,7 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
10780
10942
|
const specs = loadExposedTunnels();
|
|
10781
10943
|
if (specs.length === 0) return;
|
|
10782
10944
|
logger.log(`[exposed-tunnels] Restoring ${specs.length} tunnel(s) from ${EXPOSED_TUNNELS_FILE}`);
|
|
10783
|
-
const { FrpcTunnel } = await import('./frpc-
|
|
10945
|
+
const { FrpcTunnel } = await import('./frpc-D3LiH7GX.mjs');
|
|
10784
10946
|
for (const spec of specs) {
|
|
10785
10947
|
if (tunnels.has(spec.name)) continue;
|
|
10786
10948
|
try {
|
|
@@ -11527,4 +11689,4 @@ var run = /*#__PURE__*/Object.freeze({
|
|
|
11527
11689
|
stopDaemon: stopDaemon
|
|
11528
11690
|
});
|
|
11529
11691
|
|
|
11530
|
-
export {
|
|
11692
|
+
export { mergeSecurityContexts as A, buildSessionShareUrl as B, buildMachineShareUrl as C, generateHookSettings as D, DefaultTransport$1 as E, acpBackend as F, acpAgentConfig as G, codexMcpBackend as H, GeminiTransport$1 as I, claudeAuth as J, instanceConfig as K, api as L, run as M, ServeAuth as S, registerSessionService as a, stopDaemon as b, connectToHypha as c, daemonStatus as d, getFrpsSubdomainHost as e, getFrpsServerPort as f, getHyphaServerUrl$1 as g, getFrpsServerAddr as h, getHyphaServerUrl as i, hasCookieToken as j, getSkillsServer as k, getSkillsWorkspaceName as l, getSkillsCollectionName as m, fetchWithTimeout as n, searchSkills as o, parseFrontmatter as p, SKILLS_DIR as q, registerMachineService as r, startDaemon as s, getSkillInfo as t, downloadSkillFile as u, listSkillFiles as v, normalizeAllowedUser as w, loadSecurityContextConfig as x, resolveSecurityContext as y, buildSecurityContextFromFlags as z };
|
|
@@ -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,
|
|
5
|
+
import { c as connectToHypha, a as registerSessionService, D as generateHookSettings } from './run-MQKWgYFS.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-B75aXb6C.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-B75aXb6C.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-B75aXb6C.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-B75aXb6C.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-B75aXb6C.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 {
|
|
7
|
+
import { i as getHyphaServerUrl, S as ServeAuth, j as hasCookieToken } from './run-MQKWgYFS.mjs';
|
|
8
8
|
import 'os';
|
|
9
9
|
import 'fs/promises';
|
|
10
10
|
import 'url';
|
|
@@ -712,7 +712,7 @@ class ServeManager {
|
|
|
712
712
|
const mount = this.mounts.get(mountName);
|
|
713
713
|
const subdomainOverride = mount?.access === "link" && mount.linkToken ? /* @__PURE__ */ new Map([[this.port, `static-${subdomainSafe}-${mount.linkToken}`]]) : void 0;
|
|
714
714
|
try {
|
|
715
|
-
const { FrpcTunnel } = await import('./frpc-
|
|
715
|
+
const { FrpcTunnel } = await import('./frpc-D3LiH7GX.mjs');
|
|
716
716
|
let tunnel;
|
|
717
717
|
tunnel = new FrpcTunnel({
|
|
718
718
|
name: tunnelName,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svamp-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.84",
|
|
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 && node test/pinnedClaudeCode.test.mjs && node test/fleet.test.mjs",
|
|
23
|
+
"test": "npx tsx test/test-context-window.mjs && npx tsx test/test-instance-config.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 && node test/fleet.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",
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
var name = "svamp-cli";
|
|
2
|
-
var version = "0.2.83";
|
|
3
|
-
var description = "Svamp CLI — AI workspace daemon on Hypha Cloud";
|
|
4
|
-
var author = "Amun AI AB";
|
|
5
|
-
var license = "SEE LICENSE IN LICENSE";
|
|
6
|
-
var type = "module";
|
|
7
|
-
var bin = {
|
|
8
|
-
svamp: "./bin/svamp.mjs"
|
|
9
|
-
};
|
|
10
|
-
var files = [
|
|
11
|
-
"dist",
|
|
12
|
-
"bin"
|
|
13
|
-
];
|
|
14
|
-
var main = "./dist/index.mjs";
|
|
15
|
-
var exports$1 = {
|
|
16
|
-
".": "./dist/index.mjs",
|
|
17
|
-
"./cli": "./dist/cli.mjs"
|
|
18
|
-
};
|
|
19
|
-
var scripts = {
|
|
20
|
-
build: "rm -rf dist bin/skills && mkdir -p bin/skills && cp -r ../../skills/artifact bin/skills/artifact && tsc --noEmit && pkgroll",
|
|
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 && node test/pinnedClaudeCode.test.mjs && node test/fleet.test.mjs",
|
|
23
|
-
"test:hypha": "node --no-warnings test/test-hypha-service.mjs",
|
|
24
|
-
dev: "tsx src/cli.ts",
|
|
25
|
-
"dev:daemon": "tsx src/cli.ts daemon start-sync",
|
|
26
|
-
"test:e2e": "node --no-warnings test/e2e-session-tests.mjs",
|
|
27
|
-
"test:frpc": "npx tsx test/test-frpc-e2e.mjs"
|
|
28
|
-
};
|
|
29
|
-
var dependencies = {
|
|
30
|
-
"@agentclientprotocol/sdk": "^0.14.1",
|
|
31
|
-
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
32
|
-
"hypha-rpc": "0.21.40",
|
|
33
|
-
"node-pty": "1.2.0-beta.11",
|
|
34
|
-
ws: "^8.18.0",
|
|
35
|
-
yaml: "^2.8.2",
|
|
36
|
-
zod: "^3.24.4"
|
|
37
|
-
};
|
|
38
|
-
var devDependencies = {
|
|
39
|
-
"@types/node": ">=20",
|
|
40
|
-
"@types/ws": "^8.5.14",
|
|
41
|
-
pkgroll: "^2.14.2",
|
|
42
|
-
tsx: "^4.20.6",
|
|
43
|
-
typescript: "5.9.3"
|
|
44
|
-
};
|
|
45
|
-
var packageManager = "yarn@1.22.22";
|
|
46
|
-
var _package = {
|
|
47
|
-
name: name,
|
|
48
|
-
version: version,
|
|
49
|
-
description: description,
|
|
50
|
-
author: author,
|
|
51
|
-
license: license,
|
|
52
|
-
type: type,
|
|
53
|
-
bin: bin,
|
|
54
|
-
files: files,
|
|
55
|
-
main: main,
|
|
56
|
-
exports: exports$1,
|
|
57
|
-
scripts: scripts,
|
|
58
|
-
dependencies: dependencies,
|
|
59
|
-
devDependencies: devDependencies,
|
|
60
|
-
packageManager: packageManager
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export { author, bin, _package as default, dependencies, description, devDependencies, exports$1 as exports, files, license, main, name, packageManager, scripts, type, version };
|