svamp-cli 0.2.85 → 0.2.87
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-C10NivHS.mjs → agentCommands-CPV2AS4T.mjs} +2 -2
- package/dist/cli.mjs +50 -46
- package/dist/{commands-biNfOPRI.mjs → commands-BPR-KpZM.mjs} +2 -2
- package/dist/{commands-BeZMEZhQ.mjs → commands-CXEpyNro.mjs} +2 -2
- package/dist/{commands-CtYB14Y-.mjs → commands-CtCjHkST.mjs} +5 -5
- package/dist/{commands-B75aXb6C.mjs → commands-Dbm3UrJS.mjs} +1 -1
- package/dist/commands-Dc5kN_0c.mjs +154 -0
- package/dist/{fleet-D_sem31C.mjs → fleet-CEM8CAZN.mjs} +1 -1
- package/dist/{frpc-D3LiH7GX.mjs → frpc-CJJTmC9m.mjs} +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{package-BDGD9W2l.mjs → package-BiX-a9rI.mjs} +2 -2
- package/dist/{run-Xk8il2Yz.mjs → run-3ndxhd-X.mjs} +1 -1
- package/dist/{run-MQKWgYFS.mjs → run-BV4hWpyA.mjs} +363 -37
- package/dist/{serveCommands-9D4WCoJR.mjs → serveCommands-ClcajS1I.mjs} +5 -5
- package/dist/{serveManager-j2Z-hrHL.mjs → serveManager-tAOF25rN.mjs} +3 -3
- package/package.json +45 -45
|
@@ -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-Dbm3UrJS.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-Dbm3UrJS.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-BV4hWpyA.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -10,9 +10,9 @@ import 'node:fs';
|
|
|
10
10
|
import 'util';
|
|
11
11
|
import 'node:crypto';
|
|
12
12
|
import 'node:path';
|
|
13
|
+
import 'node:os';
|
|
13
14
|
import 'node:child_process';
|
|
14
15
|
import '@agentclientprotocol/sdk';
|
|
15
|
-
import 'node:os';
|
|
16
16
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
17
17
|
import '@modelcontextprotocol/sdk/client/stdio.js';
|
|
18
18
|
import '@modelcontextprotocol/sdk/types.js';
|
|
@@ -32,7 +32,7 @@ const subcommand = args[0];
|
|
|
32
32
|
let daemonSubcommand = args[1];
|
|
33
33
|
async function main() {
|
|
34
34
|
try {
|
|
35
|
-
const { getLoadedConfig } = await import('./run-
|
|
35
|
+
const { getLoadedConfig } = await import('./run-BV4hWpyA.mjs').then(function (n) { return n.L; });
|
|
36
36
|
getLoadedConfig();
|
|
37
37
|
} catch {
|
|
38
38
|
}
|
|
@@ -49,7 +49,7 @@ async function main() {
|
|
|
49
49
|
console.error(`svamp daemon restart: ${err.message || err}`);
|
|
50
50
|
process.exit(1);
|
|
51
51
|
}
|
|
52
|
-
const { restartDaemon } = await import('./run-
|
|
52
|
+
const { restartDaemon } = await import('./run-BV4hWpyA.mjs').then(function (n) { return n.N; });
|
|
53
53
|
await restartDaemon();
|
|
54
54
|
process.exit(0);
|
|
55
55
|
}
|
|
@@ -301,7 +301,7 @@ async function main() {
|
|
|
301
301
|
console.error("svamp service: Service commands are not available in sandboxed sessions.");
|
|
302
302
|
process.exit(1);
|
|
303
303
|
}
|
|
304
|
-
const { handleServiceCommand } = await import('./commands-
|
|
304
|
+
const { handleServiceCommand } = await import('./commands-CtCjHkST.mjs');
|
|
305
305
|
await handleServiceCommand();
|
|
306
306
|
} else if (subcommand === "serve") {
|
|
307
307
|
const { isSandboxed: isSandboxedServe } = await import('./sandboxDetect-DNTcbgWD.mjs');
|
|
@@ -309,7 +309,7 @@ async function main() {
|
|
|
309
309
|
console.error("svamp serve: Serve commands are not available in sandboxed sessions.");
|
|
310
310
|
process.exit(1);
|
|
311
311
|
}
|
|
312
|
-
const { handleServeCommand } = await import('./serveCommands-
|
|
312
|
+
const { handleServeCommand } = await import('./serveCommands-ClcajS1I.mjs');
|
|
313
313
|
await handleServeCommand();
|
|
314
314
|
process.exit(0);
|
|
315
315
|
} else if (subcommand === "process" || subcommand === "proc") {
|
|
@@ -318,7 +318,7 @@ async function main() {
|
|
|
318
318
|
console.error("svamp process: Process commands are not available in sandboxed sessions.");
|
|
319
319
|
process.exit(1);
|
|
320
320
|
}
|
|
321
|
-
const { processCommand } = await import('./commands-
|
|
321
|
+
const { processCommand } = await import('./commands-BPR-KpZM.mjs');
|
|
322
322
|
let machineId;
|
|
323
323
|
const processArgs = args.slice(1);
|
|
324
324
|
const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
|
|
@@ -331,12 +331,16 @@ async function main() {
|
|
|
331
331
|
return true;
|
|
332
332
|
}), machineId);
|
|
333
333
|
process.exit(0);
|
|
334
|
+
} else if (subcommand === "routine" || subcommand === "routines") {
|
|
335
|
+
const { routineCommand } = await import('./commands-Dc5kN_0c.mjs');
|
|
336
|
+
await routineCommand(args.slice(1));
|
|
337
|
+
process.exit(0);
|
|
334
338
|
} else if (subcommand === "--help" || subcommand === "-h") {
|
|
335
339
|
printHelp();
|
|
336
340
|
} else if (!subcommand || subcommand === "start") {
|
|
337
341
|
await handleInteractiveCommand();
|
|
338
342
|
} else if (subcommand === "--version" || subcommand === "-v") {
|
|
339
|
-
const pkg = await import('./package-
|
|
343
|
+
const pkg = await import('./package-BiX-a9rI.mjs').catch(() => ({ default: { version: "unknown" } }));
|
|
340
344
|
console.log(`svamp version: ${pkg.default.version}`);
|
|
341
345
|
} else {
|
|
342
346
|
console.error(`Unknown command: ${subcommand}`);
|
|
@@ -345,7 +349,7 @@ async function main() {
|
|
|
345
349
|
}
|
|
346
350
|
}
|
|
347
351
|
async function handleInteractiveCommand() {
|
|
348
|
-
const { runInteractive } = await import('./run-
|
|
352
|
+
const { runInteractive } = await import('./run-3ndxhd-X.mjs');
|
|
349
353
|
const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
|
|
350
354
|
let directory = process.cwd();
|
|
351
355
|
let resumeSessionId;
|
|
@@ -390,7 +394,7 @@ async function handleAgentCommand() {
|
|
|
390
394
|
return;
|
|
391
395
|
}
|
|
392
396
|
if (agentArgs[0] === "list") {
|
|
393
|
-
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-
|
|
397
|
+
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-BV4hWpyA.mjs').then(function (n) { return n.H; });
|
|
394
398
|
console.log("Known agents:");
|
|
395
399
|
for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
|
|
396
400
|
console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
|
|
@@ -402,7 +406,7 @@ async function handleAgentCommand() {
|
|
|
402
406
|
console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
|
|
403
407
|
return;
|
|
404
408
|
}
|
|
405
|
-
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-
|
|
409
|
+
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-BV4hWpyA.mjs').then(function (n) { return n.H; });
|
|
406
410
|
let cwd = process.cwd();
|
|
407
411
|
const filteredArgs = [];
|
|
408
412
|
for (let i = 0; i < agentArgs.length; i++) {
|
|
@@ -426,12 +430,12 @@ async function handleAgentCommand() {
|
|
|
426
430
|
console.log(`Starting ${config.agentName} agent in ${cwd}...`);
|
|
427
431
|
let backend;
|
|
428
432
|
if (KNOWN_MCP_AGENTS[config.agentName]) {
|
|
429
|
-
const { CodexMcpBackend } = await import('./run-
|
|
433
|
+
const { CodexMcpBackend } = await import('./run-BV4hWpyA.mjs').then(function (n) { return n.I; });
|
|
430
434
|
backend = new CodexMcpBackend({ cwd, log: logFn });
|
|
431
435
|
} else {
|
|
432
|
-
const { AcpBackend } = await import('./run-
|
|
433
|
-
const { GeminiTransport } = await import('./run-
|
|
434
|
-
const { DefaultTransport } = await import('./run-
|
|
436
|
+
const { AcpBackend } = await import('./run-BV4hWpyA.mjs').then(function (n) { return n.G; });
|
|
437
|
+
const { GeminiTransport } = await import('./run-BV4hWpyA.mjs').then(function (n) { return n.J; });
|
|
438
|
+
const { DefaultTransport } = await import('./run-BV4hWpyA.mjs').then(function (n) { return n.F; });
|
|
435
439
|
const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
|
|
436
440
|
backend = new AcpBackend({
|
|
437
441
|
agentName: config.agentName,
|
|
@@ -558,7 +562,7 @@ async function handleSessionCommand() {
|
|
|
558
562
|
process.exit(1);
|
|
559
563
|
}
|
|
560
564
|
}
|
|
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-
|
|
565
|
+
const { sessionList, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-Dbm3UrJS.mjs');
|
|
562
566
|
const parseFlagStr = (flag, shortFlag) => {
|
|
563
567
|
for (let i = 1; i < sessionArgs.length; i++) {
|
|
564
568
|
if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
|
|
@@ -624,7 +628,7 @@ async function handleSessionCommand() {
|
|
|
624
628
|
allowDomain.push(sessionArgs[++i]);
|
|
625
629
|
}
|
|
626
630
|
}
|
|
627
|
-
const { parseShareArg } = await import('./commands-
|
|
631
|
+
const { parseShareArg } = await import('./commands-Dbm3UrJS.mjs');
|
|
628
632
|
const shareEntries = share.map((s) => parseShareArg(s));
|
|
629
633
|
await sessionSpawn(agent, dir, targetMachineId, {
|
|
630
634
|
message,
|
|
@@ -710,7 +714,7 @@ async function handleSessionCommand() {
|
|
|
710
714
|
console.error(" Spawns a stateless Claude session in <directory>, sends <prompt>, prints the answer, then deletes the session.");
|
|
711
715
|
process.exit(1);
|
|
712
716
|
}
|
|
713
|
-
const { sessionQuery } = await import('./commands-
|
|
717
|
+
const { sessionQuery } = await import('./commands-Dbm3UrJS.mjs');
|
|
714
718
|
await sessionQuery(dir, prompt, targetMachineId, {
|
|
715
719
|
timeout: parseFlagInt("--timeout"),
|
|
716
720
|
json: hasFlag("--json"),
|
|
@@ -743,7 +747,7 @@ async function handleSessionCommand() {
|
|
|
743
747
|
console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
|
|
744
748
|
process.exit(1);
|
|
745
749
|
}
|
|
746
|
-
const { sessionApprove } = await import('./commands-
|
|
750
|
+
const { sessionApprove } = await import('./commands-Dbm3UrJS.mjs');
|
|
747
751
|
const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
748
752
|
await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
|
|
749
753
|
json: hasFlag("--json")
|
|
@@ -753,7 +757,7 @@ async function handleSessionCommand() {
|
|
|
753
757
|
console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
|
|
754
758
|
process.exit(1);
|
|
755
759
|
}
|
|
756
|
-
const { sessionDeny } = await import('./commands-
|
|
760
|
+
const { sessionDeny } = await import('./commands-Dbm3UrJS.mjs');
|
|
757
761
|
const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
758
762
|
await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
|
|
759
763
|
json: hasFlag("--json")
|
|
@@ -789,7 +793,7 @@ async function handleSessionCommand() {
|
|
|
789
793
|
console.error("Usage: svamp session set-title <title>");
|
|
790
794
|
process.exit(1);
|
|
791
795
|
}
|
|
792
|
-
const { sessionSetTitle } = await import('./agentCommands-
|
|
796
|
+
const { sessionSetTitle } = await import('./agentCommands-CPV2AS4T.mjs');
|
|
793
797
|
await sessionSetTitle(title);
|
|
794
798
|
} else if (sessionSubcommand === "set-link") {
|
|
795
799
|
const url = sessionArgs[1];
|
|
@@ -798,7 +802,7 @@ async function handleSessionCommand() {
|
|
|
798
802
|
process.exit(1);
|
|
799
803
|
}
|
|
800
804
|
const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
801
|
-
const { sessionSetLink } = await import('./agentCommands-
|
|
805
|
+
const { sessionSetLink } = await import('./agentCommands-CPV2AS4T.mjs');
|
|
802
806
|
await sessionSetLink(url, label);
|
|
803
807
|
} else if (sessionSubcommand === "notify") {
|
|
804
808
|
const message = sessionArgs[1];
|
|
@@ -807,7 +811,7 @@ async function handleSessionCommand() {
|
|
|
807
811
|
process.exit(1);
|
|
808
812
|
}
|
|
809
813
|
const level = parseFlagStr("--level") || "info";
|
|
810
|
-
const { sessionNotify } = await import('./agentCommands-
|
|
814
|
+
const { sessionNotify } = await import('./agentCommands-CPV2AS4T.mjs');
|
|
811
815
|
await sessionNotify(message, level);
|
|
812
816
|
} else if (sessionSubcommand === "broadcast") {
|
|
813
817
|
const action = sessionArgs[1];
|
|
@@ -815,7 +819,7 @@ async function handleSessionCommand() {
|
|
|
815
819
|
console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
|
|
816
820
|
process.exit(1);
|
|
817
821
|
}
|
|
818
|
-
const { sessionBroadcast } = await import('./agentCommands-
|
|
822
|
+
const { sessionBroadcast } = await import('./agentCommands-CPV2AS4T.mjs');
|
|
819
823
|
await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
|
|
820
824
|
} else if (sessionSubcommand === "inbox") {
|
|
821
825
|
const inboxSubcmd = sessionArgs[1];
|
|
@@ -826,7 +830,7 @@ async function handleSessionCommand() {
|
|
|
826
830
|
process.exit(1);
|
|
827
831
|
}
|
|
828
832
|
if (agentSessionId) {
|
|
829
|
-
const { inboxSend } = await import('./agentCommands-
|
|
833
|
+
const { inboxSend } = await import('./agentCommands-CPV2AS4T.mjs');
|
|
830
834
|
await inboxSend(sessionArgs[2], {
|
|
831
835
|
body: sessionArgs[3],
|
|
832
836
|
subject: parseFlagStr("--subject"),
|
|
@@ -841,7 +845,7 @@ async function handleSessionCommand() {
|
|
|
841
845
|
}
|
|
842
846
|
} else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
|
|
843
847
|
if (agentSessionId && !sessionArgs[2]) {
|
|
844
|
-
const { inboxList } = await import('./agentCommands-
|
|
848
|
+
const { inboxList } = await import('./agentCommands-CPV2AS4T.mjs');
|
|
845
849
|
await inboxList({
|
|
846
850
|
unread: hasFlag("--unread"),
|
|
847
851
|
limit: parseFlagInt("--limit"),
|
|
@@ -863,7 +867,7 @@ async function handleSessionCommand() {
|
|
|
863
867
|
process.exit(1);
|
|
864
868
|
}
|
|
865
869
|
if (agentSessionId && !sessionArgs[3]) {
|
|
866
|
-
const { inboxList } = await import('./agentCommands-
|
|
870
|
+
const { inboxList } = await import('./agentCommands-CPV2AS4T.mjs');
|
|
867
871
|
await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
|
|
868
872
|
} else if (sessionArgs[3]) {
|
|
869
873
|
await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
|
|
@@ -873,7 +877,7 @@ async function handleSessionCommand() {
|
|
|
873
877
|
}
|
|
874
878
|
} else if (inboxSubcmd === "reply") {
|
|
875
879
|
if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
|
|
876
|
-
const { inboxReply } = await import('./agentCommands-
|
|
880
|
+
const { inboxReply } = await import('./agentCommands-CPV2AS4T.mjs');
|
|
877
881
|
await inboxReply(sessionArgs[2], sessionArgs[3]);
|
|
878
882
|
} else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
|
|
879
883
|
await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
|
|
@@ -909,7 +913,7 @@ async function handleMachineCommand() {
|
|
|
909
913
|
return;
|
|
910
914
|
}
|
|
911
915
|
if (machineSubcommand === "share") {
|
|
912
|
-
const { machineShare } = await import('./commands-
|
|
916
|
+
const { machineShare } = await import('./commands-Dbm3UrJS.mjs');
|
|
913
917
|
let machineId;
|
|
914
918
|
const shareArgs = [];
|
|
915
919
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
@@ -939,7 +943,7 @@ async function handleMachineCommand() {
|
|
|
939
943
|
}
|
|
940
944
|
await machineShare(machineId, { add, remove, list, configPath, showConfig });
|
|
941
945
|
} else if (machineSubcommand === "exec") {
|
|
942
|
-
const { machineExec } = await import('./commands-
|
|
946
|
+
const { machineExec } = await import('./commands-Dbm3UrJS.mjs');
|
|
943
947
|
let machineId;
|
|
944
948
|
let cwd;
|
|
945
949
|
const cmdParts = [];
|
|
@@ -959,7 +963,7 @@ async function handleMachineCommand() {
|
|
|
959
963
|
}
|
|
960
964
|
await machineExec(machineId, command, cwd);
|
|
961
965
|
} else if (machineSubcommand === "info") {
|
|
962
|
-
const { machineInfo } = await import('./commands-
|
|
966
|
+
const { machineInfo } = await import('./commands-Dbm3UrJS.mjs');
|
|
963
967
|
let machineId;
|
|
964
968
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
965
969
|
if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
|
|
@@ -979,10 +983,10 @@ async function handleMachineCommand() {
|
|
|
979
983
|
level = machineArgs[++i];
|
|
980
984
|
}
|
|
981
985
|
}
|
|
982
|
-
const { machineNotify } = await import('./agentCommands-
|
|
986
|
+
const { machineNotify } = await import('./agentCommands-CPV2AS4T.mjs');
|
|
983
987
|
await machineNotify(message, level);
|
|
984
988
|
} else if (machineSubcommand === "ls") {
|
|
985
|
-
const { machineLs } = await import('./commands-
|
|
989
|
+
const { machineLs } = await import('./commands-Dbm3UrJS.mjs');
|
|
986
990
|
let machineId;
|
|
987
991
|
let showHidden = false;
|
|
988
992
|
let path;
|
|
@@ -1040,24 +1044,24 @@ Examples:
|
|
|
1040
1044
|
};
|
|
1041
1045
|
const hasFlag = (name) => fleetArgs.includes(`--${name}`);
|
|
1042
1046
|
if (sub === "status") {
|
|
1043
|
-
const { fleetStatus } = await import('./fleet-
|
|
1047
|
+
const { fleetStatus } = await import('./fleet-CEM8CAZN.mjs');
|
|
1044
1048
|
await fleetStatus();
|
|
1045
1049
|
} else if (sub === "exec") {
|
|
1046
1050
|
const command = fleetArgs.slice(1).filter((a) => !a.startsWith("--")).join(" ");
|
|
1047
|
-
const { fleetExec } = await import('./fleet-
|
|
1051
|
+
const { fleetExec } = await import('./fleet-CEM8CAZN.mjs');
|
|
1048
1052
|
await fleetExec(command, { cwd: flag("cwd") });
|
|
1049
1053
|
} else if (sub === "upgrade-claude") {
|
|
1050
|
-
const { fleetUpgradeClaude } = await import('./fleet-
|
|
1054
|
+
const { fleetUpgradeClaude } = await import('./fleet-CEM8CAZN.mjs');
|
|
1051
1055
|
await fleetUpgradeClaude({ version: flag("version", "-v") });
|
|
1052
1056
|
} else if (sub === "upgrade-svamp") {
|
|
1053
|
-
const { fleetUpgradeSvamp } = await import('./fleet-
|
|
1057
|
+
const { fleetUpgradeSvamp } = await import('./fleet-CEM8CAZN.mjs');
|
|
1054
1058
|
await fleetUpgradeSvamp({ version: flag("version", "-v"), excludeSelf: hasFlag("exclude-self") });
|
|
1055
1059
|
} else if (sub === "daemon-restart") {
|
|
1056
|
-
const { fleetDaemonRestart } = await import('./fleet-
|
|
1060
|
+
const { fleetDaemonRestart } = await import('./fleet-CEM8CAZN.mjs');
|
|
1057
1061
|
await fleetDaemonRestart({ graceful: !hasFlag("cleanup") });
|
|
1058
1062
|
} else if (sub === "push-skill") {
|
|
1059
1063
|
const name = fleetArgs[1];
|
|
1060
|
-
const { fleetPushSkill } = await import('./fleet-
|
|
1064
|
+
const { fleetPushSkill } = await import('./fleet-CEM8CAZN.mjs');
|
|
1061
1065
|
await fleetPushSkill(name);
|
|
1062
1066
|
} else {
|
|
1063
1067
|
console.error(`Unknown fleet subcommand: ${sub}`);
|
|
@@ -1073,7 +1077,7 @@ async function handleSkillsCommand() {
|
|
|
1073
1077
|
await printSkillsHelp();
|
|
1074
1078
|
return;
|
|
1075
1079
|
}
|
|
1076
|
-
const { skillsFind, skillsInstall, skillsList, skillsRemove, skillsPublish } = await import('./commands-
|
|
1080
|
+
const { skillsFind, skillsInstall, skillsList, skillsRemove, skillsPublish } = await import('./commands-CXEpyNro.mjs');
|
|
1077
1081
|
if (skillsSubcommand === "find" || skillsSubcommand === "search") {
|
|
1078
1082
|
const query = skillsArgs.slice(1).filter((a) => !a.startsWith("--")).join(" ");
|
|
1079
1083
|
if (!query) {
|
|
@@ -1120,7 +1124,7 @@ async function loginToHypha() {
|
|
|
1120
1124
|
process.exit(1);
|
|
1121
1125
|
}
|
|
1122
1126
|
const anchor = anchorArg.replace(/\/+$/, "");
|
|
1123
|
-
const { loadInstanceConfig } = await import('./run-
|
|
1127
|
+
const { loadInstanceConfig } = await import('./run-BV4hWpyA.mjs').then(function (n) { return n.L; });
|
|
1124
1128
|
let cfg = null;
|
|
1125
1129
|
try {
|
|
1126
1130
|
cfg = await loadInstanceConfig({ anchor, force: true });
|
|
@@ -1231,7 +1235,7 @@ async function logoutFromHypha() {
|
|
|
1231
1235
|
} catch {
|
|
1232
1236
|
}
|
|
1233
1237
|
try {
|
|
1234
|
-
const { clearInstanceConfigCache } = await import('./run-
|
|
1238
|
+
const { clearInstanceConfigCache } = await import('./run-BV4hWpyA.mjs').then(function (n) { return n.L; });
|
|
1235
1239
|
clearInstanceConfigCache();
|
|
1236
1240
|
} catch {
|
|
1237
1241
|
}
|
|
@@ -1544,7 +1548,7 @@ async function applyClaudeAuthFlags(argv) {
|
|
|
1544
1548
|
"--use-hypha-proxy, --use-claude-login, and --anthropic-base-url/--anthropic-api-key are mutually exclusive"
|
|
1545
1549
|
);
|
|
1546
1550
|
}
|
|
1547
|
-
const mod = await import('./run-
|
|
1551
|
+
const mod = await import('./run-BV4hWpyA.mjs').then(function (n) { return n.K; });
|
|
1548
1552
|
if (hasHypha) {
|
|
1549
1553
|
let url;
|
|
1550
1554
|
const hyphaIdx = argv.indexOf("--use-hypha-proxy");
|
|
@@ -1598,7 +1602,7 @@ async function applyDaemonShareFlag(argv) {
|
|
|
1598
1602
|
}
|
|
1599
1603
|
}
|
|
1600
1604
|
if (collected.length === 0) return;
|
|
1601
|
-
const { updateEnvFile } = await import('./run-
|
|
1605
|
+
const { updateEnvFile } = await import('./run-BV4hWpyA.mjs').then(function (n) { return n.K; });
|
|
1602
1606
|
const seen = /* @__PURE__ */ new Set();
|
|
1603
1607
|
const deduped = collected.filter((e) => {
|
|
1604
1608
|
const k = e.toLowerCase();
|
|
@@ -1611,7 +1615,7 @@ async function applyDaemonShareFlag(argv) {
|
|
|
1611
1615
|
}
|
|
1612
1616
|
async function handleDaemonAuthCommand(argv) {
|
|
1613
1617
|
const sub = (argv[0] || "status").toLowerCase();
|
|
1614
|
-
const mod = await import('./run-
|
|
1618
|
+
const mod = await import('./run-BV4hWpyA.mjs').then(function (n) { return n.K; });
|
|
1615
1619
|
if (sub === "--help" || sub === "-h" || sub === "help") {
|
|
1616
1620
|
console.log(`
|
|
1617
1621
|
svamp daemon auth \u2014 Configure how Claude subprocesses authenticate
|
|
@@ -1904,7 +1908,7 @@ Examples:
|
|
|
1904
1908
|
async function printSkillsHelp() {
|
|
1905
1909
|
let browseUrl = "<HYPHA_SERVER_URL>/<workspace>/artifacts/marketplace (set HYPHA_SERVER_URL)";
|
|
1906
1910
|
try {
|
|
1907
|
-
const { getArtifactBaseUrl, getSkillsCollectionName } = await import('./run-
|
|
1911
|
+
const { getArtifactBaseUrl, getSkillsCollectionName } = await import('./run-BV4hWpyA.mjs').then(function (n) { return n.M; });
|
|
1908
1912
|
browseUrl = `${getArtifactBaseUrl()}/${getSkillsCollectionName()}`;
|
|
1909
1913
|
} catch {
|
|
1910
1914
|
}
|
|
@@ -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-Dbm3UrJS.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-BV4hWpyA.mjs';
|
|
9
9
|
import 'os';
|
|
10
10
|
import 'fs/promises';
|
|
11
11
|
import 'url';
|
|
@@ -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, l as getSkillsServer, m as getSkillsWorkspaceName, n as getSkillsCollectionName, o as fetchWithTimeout, q as searchSkills, t as SKILLS_DIR, u as getSkillInfo, v as downloadSkillFile, w as listSkillFiles } from './run-BV4hWpyA.mjs';
|
|
5
5
|
import 'fs/promises';
|
|
6
6
|
import 'url';
|
|
7
7
|
import 'child_process';
|
|
@@ -10,9 +10,9 @@ import 'node:fs';
|
|
|
10
10
|
import 'util';
|
|
11
11
|
import 'node:crypto';
|
|
12
12
|
import 'node:path';
|
|
13
|
+
import 'node:os';
|
|
13
14
|
import 'node:child_process';
|
|
14
15
|
import '@agentclientprotocol/sdk';
|
|
15
|
-
import 'node:os';
|
|
16
16
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
17
17
|
import '@modelcontextprotocol/sdk/client/stdio.js';
|
|
18
18
|
import '@modelcontextprotocol/sdk/types.js';
|
|
@@ -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-CJJTmC9m.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-Dbm3UrJS.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-CJJTmC9m.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-Dbm3UrJS.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-Dbm3UrJS.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 {
|
|
5
|
+
import { x as normalizeAllowedUser, y as loadSecurityContextConfig, z as resolveSecurityContext, A as buildSecurityContextFromFlags, B as mergeSecurityContexts, c as connectToHypha, C as buildSessionShareUrl, D as buildMachineShareUrl } from './run-BV4hWpyA.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
8
8
|
import 'fs';
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
|
+
import { createServer } from 'node:http';
|
|
3
|
+
import { R as RoutineStore, k as RoutineRunner } from './run-BV4hWpyA.mjs';
|
|
4
|
+
import 'os';
|
|
5
|
+
import 'fs/promises';
|
|
6
|
+
import 'fs';
|
|
7
|
+
import 'path';
|
|
8
|
+
import 'url';
|
|
9
|
+
import 'child_process';
|
|
10
|
+
import 'crypto';
|
|
11
|
+
import 'node:fs';
|
|
12
|
+
import 'util';
|
|
13
|
+
import 'node:crypto';
|
|
14
|
+
import 'node:path';
|
|
15
|
+
import 'node:os';
|
|
16
|
+
import '@agentclientprotocol/sdk';
|
|
17
|
+
import '@modelcontextprotocol/sdk/client/index.js';
|
|
18
|
+
import '@modelcontextprotocol/sdk/client/stdio.js';
|
|
19
|
+
import '@modelcontextprotocol/sdk/types.js';
|
|
20
|
+
import 'zod';
|
|
21
|
+
import 'node:fs/promises';
|
|
22
|
+
import 'node:util';
|
|
23
|
+
|
|
24
|
+
function parseArgs(argv) {
|
|
25
|
+
const a = { _: [] };
|
|
26
|
+
for (let i = 0; i < argv.length; i++) {
|
|
27
|
+
const t = argv[i];
|
|
28
|
+
if (t.startsWith("--")) a[t.slice(2)] = argv[i + 1] && !argv[i + 1].startsWith("--") ? argv[++i] : true;
|
|
29
|
+
else a._.push(t);
|
|
30
|
+
}
|
|
31
|
+
return a;
|
|
32
|
+
}
|
|
33
|
+
async function cliDeliver({ routine, resolved }) {
|
|
34
|
+
const sid = routine.session_id;
|
|
35
|
+
if (resolved.kind === "message") {
|
|
36
|
+
execFileSync("svamp", ["session", "send", sid, resolved.text || ""], { stdio: "pipe" });
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
execFileSync("svamp", [
|
|
40
|
+
"session",
|
|
41
|
+
"send",
|
|
42
|
+
sid,
|
|
43
|
+
`Begin the loop (LOOP MODE). Task: ${resolved.task}. Iterate until the gate lets you stop.`
|
|
44
|
+
], { stdio: "pipe" });
|
|
45
|
+
}
|
|
46
|
+
function buildRoutineFromArgs(a) {
|
|
47
|
+
const r = { session_id: a.session, name: a.name || "routine", overlap: a.overlap || "queue" };
|
|
48
|
+
if (a.schedule) r.trigger = { type: "schedule", cron: a.schedule, missed: a.missed || "skip", tz: a.tz };
|
|
49
|
+
else if (a.webhook || a.api) r.trigger = { type: a.api ? "api" : "webhook", methods: a.get ? ["GET"] : ["GET", "POST"], public: !!a.public };
|
|
50
|
+
else r.trigger = { type: "manual" };
|
|
51
|
+
if (a.loop) r.action = { kind: "loop", task_template: a.task || "", loop: { dir: a.dir, oracle: a.oracle, evaluator: a.evaluator || "off" } };
|
|
52
|
+
else r.action = { kind: "message", template: a.message || a.task || "run" };
|
|
53
|
+
return r;
|
|
54
|
+
}
|
|
55
|
+
async function routineCommand(args) {
|
|
56
|
+
const a = parseArgs(args);
|
|
57
|
+
const cmd = a._[0];
|
|
58
|
+
const store = new RoutineStore();
|
|
59
|
+
const runner = new RoutineRunner({ store, deliver: cliDeliver, log: console.error });
|
|
60
|
+
switch (cmd) {
|
|
61
|
+
case "add": {
|
|
62
|
+
if (!a.session) {
|
|
63
|
+
console.error("--session <id> required");
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
const r = store.save(buildRoutineFromArgs(a));
|
|
67
|
+
console.log(`\u2705 added routine ${r.id} (${r.name}) trigger=${r.trigger.type} action=${r.action.kind} session=${r.session_id}`);
|
|
68
|
+
if (r.trigger.key) console.log(` webhook key: ${r.trigger.key}`);
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
case "list": {
|
|
72
|
+
const rs = store.list(typeof a.session === "string" ? a.session : void 0);
|
|
73
|
+
if (a.json) {
|
|
74
|
+
console.log(JSON.stringify(rs, null, 2));
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
if (!rs.length) {
|
|
78
|
+
console.log("(no routines)");
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
for (const r of rs) console.log(`${r.enabled ? "\u25CF" : "\u25CB"} ${r.id} ${r.name} [${r.trigger.type}${r.trigger.cron ? " " + r.trigger.cron : ""}] -> ${r.action.kind} session=${r.session_id}`);
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
case "remove":
|
|
85
|
+
console.log(store.remove(a._[1]) ? `removed ${a._[1]}` : "not found");
|
|
86
|
+
break;
|
|
87
|
+
case "enable":
|
|
88
|
+
store.setEnabled(a._[1], true);
|
|
89
|
+
console.log(`enabled ${a._[1]}`);
|
|
90
|
+
break;
|
|
91
|
+
case "disable":
|
|
92
|
+
store.setEnabled(a._[1], false);
|
|
93
|
+
console.log(`disabled ${a._[1]}`);
|
|
94
|
+
break;
|
|
95
|
+
case "run-now":
|
|
96
|
+
console.log(JSON.stringify(await runner.runNow(a._[1], {}), null, 2));
|
|
97
|
+
break;
|
|
98
|
+
case "serve":
|
|
99
|
+
await serve(runner, Number(a.port) || 8722);
|
|
100
|
+
break;
|
|
101
|
+
default:
|
|
102
|
+
console.log(`usage: svamp routine <add|list|remove|enable|disable|run-now|serve>
|
|
103
|
+
add --session <id> --name <n> [--schedule "*/5 * * * *" [--missed catchup]] [--webhook|--api [--get] [--public]] (--message "..." | --loop --dir <path> --task "..." [--oracle "cmd"])
|
|
104
|
+
list [--session <id>] [--json]
|
|
105
|
+
serve [--port 8722]`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
async function serve(runner, port) {
|
|
109
|
+
await runner.catchUp(new Date(Date.now() - 24 * 3600 * 1e3), /* @__PURE__ */ new Date());
|
|
110
|
+
const timer = setInterval(() => {
|
|
111
|
+
runner.tick(/* @__PURE__ */ new Date()).catch((e) => console.error("tick error", e));
|
|
112
|
+
}, 2e4);
|
|
113
|
+
const server = createServer((req, res) => {
|
|
114
|
+
const u = new URL(req.url || "/", `http://localhost:${port}`);
|
|
115
|
+
if (u.pathname === "/" || u.pathname === "/health") {
|
|
116
|
+
res.writeHead(200).end("routines ok");
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const m = u.pathname.match(/^\/routine\/([\w.-]+)$/);
|
|
120
|
+
if (!m) {
|
|
121
|
+
res.writeHead(404).end("not found");
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const id = m[1];
|
|
125
|
+
const key = u.searchParams.get("key");
|
|
126
|
+
const query = Object.fromEntries(u.searchParams.entries());
|
|
127
|
+
let chunks = "";
|
|
128
|
+
req.on("data", (c) => {
|
|
129
|
+
chunks += c;
|
|
130
|
+
if (chunks.length > 1e6) req.destroy();
|
|
131
|
+
});
|
|
132
|
+
req.on("end", async () => {
|
|
133
|
+
let body = {};
|
|
134
|
+
try {
|
|
135
|
+
body = chunks ? JSON.parse(chunks) : {};
|
|
136
|
+
} catch {
|
|
137
|
+
}
|
|
138
|
+
const result = await runner.webhook(id, { key, method: req.method, body, query });
|
|
139
|
+
res.writeHead(result.status || 200, { "content-type": "application/json" }).end(JSON.stringify(result));
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
server.listen(port, () => {
|
|
143
|
+
console.log(`\u{1FA9D} routine server on http://localhost:${port}`);
|
|
144
|
+
console.log(` webhook URL: http://localhost:${port}/routine/<id>?key=<key>`);
|
|
145
|
+
console.log(` expose: svamp service expose routines --port ${port}`);
|
|
146
|
+
});
|
|
147
|
+
process.on("SIGINT", () => {
|
|
148
|
+
clearInterval(timer);
|
|
149
|
+
server.close();
|
|
150
|
+
process.exit(0);
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export { routineCommand };
|
|
@@ -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-BV4hWpyA.mjs';
|
|
5
5
|
import { PINNED_CLAUDE_CODE_VERSION } from './pinnedClaudeCode-HydRNEt7.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
@@ -3,16 +3,16 @@ 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 getFrpsServerPort, h as getFrpsServerAddr } from './run-
|
|
6
|
+
import { e as getFrpsSubdomainHost, f as getFrpsServerPort, h as getFrpsServerAddr } from './run-BV4hWpyA.mjs';
|
|
7
7
|
import 'fs/promises';
|
|
8
8
|
import 'url';
|
|
9
9
|
import 'node:fs';
|
|
10
10
|
import 'util';
|
|
11
11
|
import 'node:crypto';
|
|
12
12
|
import 'node:path';
|
|
13
|
+
import 'node:os';
|
|
13
14
|
import 'node:child_process';
|
|
14
15
|
import '@agentclientprotocol/sdk';
|
|
15
|
-
import 'node:os';
|
|
16
16
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
17
17
|
import '@modelcontextprotocol/sdk/client/stdio.js';
|
|
18
18
|
import '@modelcontextprotocol/sdk/types.js';
|