svamp-cli 0.2.38 → 0.2.39
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-Djr_xWX-.mjs → agentCommands-BvmStLoh.mjs} +2 -2
- package/dist/cli.mjs +128 -29
- package/dist/{commands-B8Q1ig7j.mjs → commands-CWKFZm9s.mjs} +1 -1
- package/dist/{commands-BpW-hioi.mjs → commands-DVXppwx2.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{package-CcU8sNV_.mjs → package-CPiu8-uW.mjs} +2 -2
- package/dist/{run-BStlzTCG.mjs → run--6SzG2CH.mjs} +1 -1
- package/dist/{run-D-1qvfLH.mjs → run-CRwkPQDW.mjs} +177 -4
- package/dist/{serveCommands-B2vQJyUt.mjs → serveCommands-B9Dq2loo.mjs} +4 -4
- package/package.json +2 -2
|
@@ -148,7 +148,7 @@ async function sessionBroadcast(action, args) {
|
|
|
148
148
|
console.log(`Broadcast sent: ${action}`);
|
|
149
149
|
}
|
|
150
150
|
async function connectToMachineService() {
|
|
151
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
151
|
+
const { connectAndGetMachine } = await import('./commands-CWKFZm9s.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-CWKFZm9s.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-CRwkPQDW.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -36,11 +36,23 @@ async function main() {
|
|
|
36
36
|
await logoutFromHypha();
|
|
37
37
|
} else if (subcommand === "daemon") {
|
|
38
38
|
if (daemonSubcommand === "restart") {
|
|
39
|
-
|
|
39
|
+
try {
|
|
40
|
+
await applyClaudeAuthFlags(args);
|
|
41
|
+
} catch (err) {
|
|
42
|
+
console.error(`svamp daemon restart: ${err.message || err}`);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
const { restartDaemon } = await import('./run-CRwkPQDW.mjs').then(function (n) { return n.n; });
|
|
40
46
|
await restartDaemon();
|
|
41
47
|
process.exit(0);
|
|
42
48
|
}
|
|
43
49
|
if (daemonSubcommand === "start") {
|
|
50
|
+
try {
|
|
51
|
+
await applyClaudeAuthFlags(args);
|
|
52
|
+
} catch (err) {
|
|
53
|
+
console.error(`svamp daemon start: ${err.message || err}`);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
44
56
|
const { spawn } = await import('child_process');
|
|
45
57
|
const extraArgs = [];
|
|
46
58
|
if (args.includes("--no-auto-continue")) extraArgs.push("--no-auto-continue");
|
|
@@ -222,6 +234,9 @@ async function main() {
|
|
|
222
234
|
} else if (daemonSubcommand === "uninstall") {
|
|
223
235
|
await uninstallDaemonService();
|
|
224
236
|
process.exit(0);
|
|
237
|
+
} else if (daemonSubcommand === "auth") {
|
|
238
|
+
await handleDaemonAuthCommand(args.slice(2));
|
|
239
|
+
process.exit(0);
|
|
225
240
|
} else {
|
|
226
241
|
printDaemonHelp();
|
|
227
242
|
}
|
|
@@ -257,7 +272,7 @@ async function main() {
|
|
|
257
272
|
console.error("svamp serve: Serve commands are not available in sandboxed sessions.");
|
|
258
273
|
process.exit(1);
|
|
259
274
|
}
|
|
260
|
-
const { handleServeCommand } = await import('./serveCommands-
|
|
275
|
+
const { handleServeCommand } = await import('./serveCommands-B9Dq2loo.mjs');
|
|
261
276
|
await handleServeCommand();
|
|
262
277
|
process.exit(0);
|
|
263
278
|
} else if (subcommand === "process" || subcommand === "proc") {
|
|
@@ -266,7 +281,7 @@ async function main() {
|
|
|
266
281
|
console.error("svamp process: Process commands are not available in sandboxed sessions.");
|
|
267
282
|
process.exit(1);
|
|
268
283
|
}
|
|
269
|
-
const { processCommand } = await import('./commands-
|
|
284
|
+
const { processCommand } = await import('./commands-DVXppwx2.mjs');
|
|
270
285
|
let machineId;
|
|
271
286
|
const processArgs = args.slice(1);
|
|
272
287
|
const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
|
|
@@ -284,7 +299,7 @@ async function main() {
|
|
|
284
299
|
} else if (!subcommand || subcommand === "start") {
|
|
285
300
|
await handleInteractiveCommand();
|
|
286
301
|
} else if (subcommand === "--version" || subcommand === "-v") {
|
|
287
|
-
const pkg = await import('./package-
|
|
302
|
+
const pkg = await import('./package-CPiu8-uW.mjs').catch(() => ({ default: { version: "unknown" } }));
|
|
288
303
|
console.log(`svamp version: ${pkg.default.version}`);
|
|
289
304
|
} else {
|
|
290
305
|
console.error(`Unknown command: ${subcommand}`);
|
|
@@ -293,7 +308,7 @@ async function main() {
|
|
|
293
308
|
}
|
|
294
309
|
}
|
|
295
310
|
async function handleInteractiveCommand() {
|
|
296
|
-
const { runInteractive } = await import('./run
|
|
311
|
+
const { runInteractive } = await import('./run--6SzG2CH.mjs');
|
|
297
312
|
const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
|
|
298
313
|
let directory = process.cwd();
|
|
299
314
|
let resumeSessionId;
|
|
@@ -338,7 +353,7 @@ async function handleAgentCommand() {
|
|
|
338
353
|
return;
|
|
339
354
|
}
|
|
340
355
|
if (agentArgs[0] === "list") {
|
|
341
|
-
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-
|
|
356
|
+
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-CRwkPQDW.mjs').then(function (n) { return n.i; });
|
|
342
357
|
console.log("Known agents:");
|
|
343
358
|
for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
|
|
344
359
|
console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
|
|
@@ -350,7 +365,7 @@ async function handleAgentCommand() {
|
|
|
350
365
|
console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
|
|
351
366
|
return;
|
|
352
367
|
}
|
|
353
|
-
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-
|
|
368
|
+
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-CRwkPQDW.mjs').then(function (n) { return n.i; });
|
|
354
369
|
let cwd = process.cwd();
|
|
355
370
|
const filteredArgs = [];
|
|
356
371
|
for (let i = 0; i < agentArgs.length; i++) {
|
|
@@ -374,12 +389,12 @@ async function handleAgentCommand() {
|
|
|
374
389
|
console.log(`Starting ${config.agentName} agent in ${cwd}...`);
|
|
375
390
|
let backend;
|
|
376
391
|
if (KNOWN_MCP_AGENTS[config.agentName]) {
|
|
377
|
-
const { CodexMcpBackend } = await import('./run-
|
|
392
|
+
const { CodexMcpBackend } = await import('./run-CRwkPQDW.mjs').then(function (n) { return n.j; });
|
|
378
393
|
backend = new CodexMcpBackend({ cwd, log: logFn });
|
|
379
394
|
} else {
|
|
380
|
-
const { AcpBackend } = await import('./run-
|
|
381
|
-
const { GeminiTransport } = await import('./run-
|
|
382
|
-
const { DefaultTransport } = await import('./run-
|
|
395
|
+
const { AcpBackend } = await import('./run-CRwkPQDW.mjs').then(function (n) { return n.h; });
|
|
396
|
+
const { GeminiTransport } = await import('./run-CRwkPQDW.mjs').then(function (n) { return n.G; });
|
|
397
|
+
const { DefaultTransport } = await import('./run-CRwkPQDW.mjs').then(function (n) { return n.D; });
|
|
383
398
|
const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
|
|
384
399
|
backend = new AcpBackend({
|
|
385
400
|
agentName: config.agentName,
|
|
@@ -506,7 +521,7 @@ async function handleSessionCommand() {
|
|
|
506
521
|
process.exit(1);
|
|
507
522
|
}
|
|
508
523
|
}
|
|
509
|
-
const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-
|
|
524
|
+
const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-CWKFZm9s.mjs');
|
|
510
525
|
const parseFlagStr = (flag, shortFlag) => {
|
|
511
526
|
for (let i = 1; i < sessionArgs.length; i++) {
|
|
512
527
|
if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
|
|
@@ -566,7 +581,7 @@ async function handleSessionCommand() {
|
|
|
566
581
|
allowDomain.push(sessionArgs[++i]);
|
|
567
582
|
}
|
|
568
583
|
}
|
|
569
|
-
const { parseShareArg } = await import('./commands-
|
|
584
|
+
const { parseShareArg } = await import('./commands-CWKFZm9s.mjs');
|
|
570
585
|
const shareEntries = share.map((s) => parseShareArg(s));
|
|
571
586
|
await sessionSpawn(agent, dir, targetMachineId, {
|
|
572
587
|
message,
|
|
@@ -652,7 +667,7 @@ async function handleSessionCommand() {
|
|
|
652
667
|
console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
|
|
653
668
|
process.exit(1);
|
|
654
669
|
}
|
|
655
|
-
const { sessionApprove } = await import('./commands-
|
|
670
|
+
const { sessionApprove } = await import('./commands-CWKFZm9s.mjs');
|
|
656
671
|
const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
657
672
|
await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
|
|
658
673
|
json: hasFlag("--json")
|
|
@@ -662,7 +677,7 @@ async function handleSessionCommand() {
|
|
|
662
677
|
console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
|
|
663
678
|
process.exit(1);
|
|
664
679
|
}
|
|
665
|
-
const { sessionDeny } = await import('./commands-
|
|
680
|
+
const { sessionDeny } = await import('./commands-CWKFZm9s.mjs');
|
|
666
681
|
const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
667
682
|
await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
|
|
668
683
|
json: hasFlag("--json")
|
|
@@ -698,7 +713,7 @@ async function handleSessionCommand() {
|
|
|
698
713
|
console.error("Usage: svamp session set-title <title>");
|
|
699
714
|
process.exit(1);
|
|
700
715
|
}
|
|
701
|
-
const { sessionSetTitle } = await import('./agentCommands-
|
|
716
|
+
const { sessionSetTitle } = await import('./agentCommands-BvmStLoh.mjs');
|
|
702
717
|
await sessionSetTitle(title);
|
|
703
718
|
} else if (sessionSubcommand === "set-link") {
|
|
704
719
|
const url = sessionArgs[1];
|
|
@@ -707,7 +722,7 @@ async function handleSessionCommand() {
|
|
|
707
722
|
process.exit(1);
|
|
708
723
|
}
|
|
709
724
|
const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
710
|
-
const { sessionSetLink } = await import('./agentCommands-
|
|
725
|
+
const { sessionSetLink } = await import('./agentCommands-BvmStLoh.mjs');
|
|
711
726
|
await sessionSetLink(url, label);
|
|
712
727
|
} else if (sessionSubcommand === "notify") {
|
|
713
728
|
const message = sessionArgs[1];
|
|
@@ -716,7 +731,7 @@ async function handleSessionCommand() {
|
|
|
716
731
|
process.exit(1);
|
|
717
732
|
}
|
|
718
733
|
const level = parseFlagStr("--level") || "info";
|
|
719
|
-
const { sessionNotify } = await import('./agentCommands-
|
|
734
|
+
const { sessionNotify } = await import('./agentCommands-BvmStLoh.mjs');
|
|
720
735
|
await sessionNotify(message, level);
|
|
721
736
|
} else if (sessionSubcommand === "broadcast") {
|
|
722
737
|
const action = sessionArgs[1];
|
|
@@ -724,7 +739,7 @@ async function handleSessionCommand() {
|
|
|
724
739
|
console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
|
|
725
740
|
process.exit(1);
|
|
726
741
|
}
|
|
727
|
-
const { sessionBroadcast } = await import('./agentCommands-
|
|
742
|
+
const { sessionBroadcast } = await import('./agentCommands-BvmStLoh.mjs');
|
|
728
743
|
await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
|
|
729
744
|
} else if (sessionSubcommand === "inbox") {
|
|
730
745
|
const inboxSubcmd = sessionArgs[1];
|
|
@@ -735,7 +750,7 @@ async function handleSessionCommand() {
|
|
|
735
750
|
process.exit(1);
|
|
736
751
|
}
|
|
737
752
|
if (agentSessionId) {
|
|
738
|
-
const { inboxSend } = await import('./agentCommands-
|
|
753
|
+
const { inboxSend } = await import('./agentCommands-BvmStLoh.mjs');
|
|
739
754
|
await inboxSend(sessionArgs[2], {
|
|
740
755
|
body: sessionArgs[3],
|
|
741
756
|
subject: parseFlagStr("--subject"),
|
|
@@ -750,7 +765,7 @@ async function handleSessionCommand() {
|
|
|
750
765
|
}
|
|
751
766
|
} else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
|
|
752
767
|
if (agentSessionId && !sessionArgs[2]) {
|
|
753
|
-
const { inboxList } = await import('./agentCommands-
|
|
768
|
+
const { inboxList } = await import('./agentCommands-BvmStLoh.mjs');
|
|
754
769
|
await inboxList({
|
|
755
770
|
unread: hasFlag("--unread"),
|
|
756
771
|
limit: parseFlagInt("--limit"),
|
|
@@ -772,7 +787,7 @@ async function handleSessionCommand() {
|
|
|
772
787
|
process.exit(1);
|
|
773
788
|
}
|
|
774
789
|
if (agentSessionId && !sessionArgs[3]) {
|
|
775
|
-
const { inboxList } = await import('./agentCommands-
|
|
790
|
+
const { inboxList } = await import('./agentCommands-BvmStLoh.mjs');
|
|
776
791
|
await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
|
|
777
792
|
} else if (sessionArgs[3]) {
|
|
778
793
|
await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
|
|
@@ -782,7 +797,7 @@ async function handleSessionCommand() {
|
|
|
782
797
|
}
|
|
783
798
|
} else if (inboxSubcmd === "reply") {
|
|
784
799
|
if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
|
|
785
|
-
const { inboxReply } = await import('./agentCommands-
|
|
800
|
+
const { inboxReply } = await import('./agentCommands-BvmStLoh.mjs');
|
|
786
801
|
await inboxReply(sessionArgs[2], sessionArgs[3]);
|
|
787
802
|
} else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
|
|
788
803
|
await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
|
|
@@ -818,7 +833,7 @@ async function handleMachineCommand() {
|
|
|
818
833
|
return;
|
|
819
834
|
}
|
|
820
835
|
if (machineSubcommand === "share") {
|
|
821
|
-
const { machineShare } = await import('./commands-
|
|
836
|
+
const { machineShare } = await import('./commands-CWKFZm9s.mjs');
|
|
822
837
|
let machineId;
|
|
823
838
|
const shareArgs = [];
|
|
824
839
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
@@ -848,7 +863,7 @@ async function handleMachineCommand() {
|
|
|
848
863
|
}
|
|
849
864
|
await machineShare(machineId, { add, remove, list, configPath, showConfig });
|
|
850
865
|
} else if (machineSubcommand === "exec") {
|
|
851
|
-
const { machineExec } = await import('./commands-
|
|
866
|
+
const { machineExec } = await import('./commands-CWKFZm9s.mjs');
|
|
852
867
|
let machineId;
|
|
853
868
|
let cwd;
|
|
854
869
|
const cmdParts = [];
|
|
@@ -868,7 +883,7 @@ async function handleMachineCommand() {
|
|
|
868
883
|
}
|
|
869
884
|
await machineExec(machineId, command, cwd);
|
|
870
885
|
} else if (machineSubcommand === "info") {
|
|
871
|
-
const { machineInfo } = await import('./commands-
|
|
886
|
+
const { machineInfo } = await import('./commands-CWKFZm9s.mjs');
|
|
872
887
|
let machineId;
|
|
873
888
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
874
889
|
if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
|
|
@@ -888,10 +903,10 @@ async function handleMachineCommand() {
|
|
|
888
903
|
level = machineArgs[++i];
|
|
889
904
|
}
|
|
890
905
|
}
|
|
891
|
-
const { machineNotify } = await import('./agentCommands-
|
|
906
|
+
const { machineNotify } = await import('./agentCommands-BvmStLoh.mjs');
|
|
892
907
|
await machineNotify(message, level);
|
|
893
908
|
} else if (machineSubcommand === "ls") {
|
|
894
|
-
const { machineLs } = await import('./commands-
|
|
909
|
+
const { machineLs } = await import('./commands-CWKFZm9s.mjs');
|
|
895
910
|
let machineId;
|
|
896
911
|
let showHidden = false;
|
|
897
912
|
let path;
|
|
@@ -1329,8 +1344,92 @@ Usage:
|
|
|
1329
1344
|
svamp daemon status Show daemon status
|
|
1330
1345
|
svamp daemon install Install as login service (macOS/Linux) \u2014 auto-start at login
|
|
1331
1346
|
svamp daemon uninstall Remove login service
|
|
1347
|
+
svamp daemon auth Show Claude API auth mode used for spawned sessions
|
|
1348
|
+
svamp daemon auth use-hypha-proxy Route Claude through https://proxy.hypha.aicell.io with HYPHA_TOKEN
|
|
1349
|
+
svamp daemon auth use-login Use ~/.claude credentials (run "claude login" to set them)
|
|
1350
|
+
svamp daemon auth set <URL> <KEY> Use a custom Anthropic gateway (base URL must not end in /v1)
|
|
1351
|
+
|
|
1352
|
+
Claude auth flags (take effect on next start/restart):
|
|
1353
|
+
svamp daemon start --use-hypha-proxy
|
|
1354
|
+
svamp daemon start --use-claude-login
|
|
1355
|
+
svamp daemon start --anthropic-base-url URL --anthropic-api-key KEY
|
|
1332
1356
|
`);
|
|
1333
1357
|
}
|
|
1358
|
+
async function applyClaudeAuthFlags(argv) {
|
|
1359
|
+
const hasHypha = argv.includes("--use-hypha-proxy");
|
|
1360
|
+
const hasLogin = argv.includes("--use-claude-login") || argv.includes("--use-login");
|
|
1361
|
+
const baseUrlIdx = argv.indexOf("--anthropic-base-url");
|
|
1362
|
+
const apiKeyIdx = argv.indexOf("--anthropic-api-key");
|
|
1363
|
+
const hasCustom = baseUrlIdx !== -1 || apiKeyIdx !== -1;
|
|
1364
|
+
const chosen = [hasHypha, hasLogin, hasCustom].filter(Boolean).length;
|
|
1365
|
+
if (chosen === 0) return;
|
|
1366
|
+
if (chosen > 1) {
|
|
1367
|
+
throw new Error(
|
|
1368
|
+
"--use-hypha-proxy, --use-claude-login, and --anthropic-base-url/--anthropic-api-key are mutually exclusive"
|
|
1369
|
+
);
|
|
1370
|
+
}
|
|
1371
|
+
const mod = await import('./run-CRwkPQDW.mjs').then(function (n) { return n.k; });
|
|
1372
|
+
if (hasHypha) {
|
|
1373
|
+
mod.setClaudeAuthHyphaProxy();
|
|
1374
|
+
console.log("Claude auth configured: hypha-proxy (uses HYPHA_TOKEN live at each spawn).");
|
|
1375
|
+
return;
|
|
1376
|
+
}
|
|
1377
|
+
if (hasLogin) {
|
|
1378
|
+
mod.setClaudeAuthLogin();
|
|
1379
|
+
console.log('Claude auth configured: login (uses ~/.claude credentials \u2014 run "claude login" if needed).');
|
|
1380
|
+
return;
|
|
1381
|
+
}
|
|
1382
|
+
if (baseUrlIdx === -1 || apiKeyIdx === -1) {
|
|
1383
|
+
throw new Error("--anthropic-base-url and --anthropic-api-key must be passed together");
|
|
1384
|
+
}
|
|
1385
|
+
const baseUrl = argv[baseUrlIdx + 1];
|
|
1386
|
+
const apiKey = argv[apiKeyIdx + 1];
|
|
1387
|
+
if (!baseUrl || baseUrl.startsWith("--")) throw new Error("--anthropic-base-url requires a value");
|
|
1388
|
+
if (!apiKey || apiKey.startsWith("--")) throw new Error("--anthropic-api-key requires a value");
|
|
1389
|
+
mod.setClaudeAuthCustom(baseUrl, apiKey);
|
|
1390
|
+
console.log(`Claude auth configured: custom (base URL ${baseUrl}).`);
|
|
1391
|
+
}
|
|
1392
|
+
async function handleDaemonAuthCommand(argv) {
|
|
1393
|
+
const sub = (argv[0] || "status").toLowerCase();
|
|
1394
|
+
const mod = await import('./run-CRwkPQDW.mjs').then(function (n) { return n.k; });
|
|
1395
|
+
if (sub === "status" || sub === "show") {
|
|
1396
|
+
const s = mod.getClaudeAuthStatus();
|
|
1397
|
+
console.log(`Claude auth mode: ${s.mode}`);
|
|
1398
|
+
if (s.baseUrl) console.log(` ANTHROPIC_BASE_URL: ${s.baseUrl}`);
|
|
1399
|
+
if (s.apiKeyPreview) console.log(` ANTHROPIC_API_KEY : ${s.apiKeyPreview}`);
|
|
1400
|
+
if (s.mode === "login") {
|
|
1401
|
+
console.log(' (Claude subprocesses will use credentials from ~/.claude \u2014 run "claude login" to set them.)');
|
|
1402
|
+
}
|
|
1403
|
+
if (s.hyphaTokenMissing) {
|
|
1404
|
+
console.log(' WARNING: mode=hypha but HYPHA_TOKEN is not set \u2014 run "svamp login" first.');
|
|
1405
|
+
}
|
|
1406
|
+
return;
|
|
1407
|
+
}
|
|
1408
|
+
if (sub === "use-hypha-proxy") {
|
|
1409
|
+
mod.setClaudeAuthHyphaProxy();
|
|
1410
|
+
console.log('Claude auth set to hypha-proxy. Run "svamp daemon restart" to apply.');
|
|
1411
|
+
return;
|
|
1412
|
+
}
|
|
1413
|
+
if (sub === "use-login" || sub === "use-claude-login") {
|
|
1414
|
+
mod.setClaudeAuthLogin();
|
|
1415
|
+
console.log('Claude auth set to login (~/.claude credentials). Run "svamp daemon restart" to apply.');
|
|
1416
|
+
return;
|
|
1417
|
+
}
|
|
1418
|
+
if (sub === "set") {
|
|
1419
|
+
const baseUrl = argv[1];
|
|
1420
|
+
const apiKey = argv[2];
|
|
1421
|
+
if (!baseUrl || !apiKey) {
|
|
1422
|
+
console.error("Usage: svamp daemon auth set <base-url> <api-key>");
|
|
1423
|
+
process.exit(1);
|
|
1424
|
+
}
|
|
1425
|
+
mod.setClaudeAuthCustom(baseUrl, apiKey);
|
|
1426
|
+
console.log(`Claude auth set to custom (${baseUrl}). Run "svamp daemon restart" to apply.`);
|
|
1427
|
+
return;
|
|
1428
|
+
}
|
|
1429
|
+
console.error(`Unknown subcommand: svamp daemon auth ${sub}`);
|
|
1430
|
+
console.error("Available: status, use-hypha-proxy, use-login, set <URL> <KEY>");
|
|
1431
|
+
process.exit(1);
|
|
1432
|
+
}
|
|
1334
1433
|
function printSessionHelp() {
|
|
1335
1434
|
console.log(`
|
|
1336
1435
|
svamp session \u2014 Spawn and manage AI agent sessions
|
|
@@ -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 { l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha } from './run-
|
|
5
|
+
import { l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha } from './run-CRwkPQDW.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
8
8
|
import 'fs';
|
|
@@ -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-CWKFZm9s.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-CRwkPQDW.mjs';
|
|
9
9
|
import 'os';
|
|
10
10
|
import 'fs/promises';
|
|
11
11
|
import 'url';
|
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-CRwkPQDW.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var name = "svamp-cli";
|
|
2
|
-
var version = "0.2.
|
|
2
|
+
var version = "0.2.39";
|
|
3
3
|
var description = "Svamp CLI — AI workspace daemon on Hypha Cloud";
|
|
4
4
|
var author = "Amun AI AB";
|
|
5
5
|
var license = "SEE LICENSE IN LICENSE";
|
|
@@ -19,7 +19,7 @@ var exports$1 = {
|
|
|
19
19
|
var scripts = {
|
|
20
20
|
build: "rm -rf dist && tsc --noEmit && pkgroll",
|
|
21
21
|
typecheck: "tsc --noEmit",
|
|
22
|
-
test: "npx tsx test/test-authorize.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-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-skills.mjs && npx tsx test/test-agent-grouping.mjs && npx tsx test/test-ralph-loop-integration.mjs && npx tsx test/test-ralph-loop-modes.mjs && npx tsx test/test-machine-list-directory.mjs && npx tsx test/test-service-commands.mjs && npx tsx test/test-supervisor.mjs && npx tsx test/test-supervisor-lock.mjs && npx tsx test/test-clear-detection.mjs && npx tsx test/test-session-consolidation.mjs && npx tsx test/test-inbox.mjs && npx tsx test/test-session-rpc-dispatch.mjs && npx tsx test/test-sandbox-cli.mjs && npx tsx test/test-serve-manager.mjs && npx tsx test/test-serve-stability.mjs && npx tsx test/test-frpc-e2e.mjs --unit-only",
|
|
22
|
+
test: "npx tsx test/test-authorize.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-skills.mjs && npx tsx test/test-agent-grouping.mjs && npx tsx test/test-ralph-loop-integration.mjs && npx tsx test/test-ralph-loop-modes.mjs && npx tsx test/test-machine-list-directory.mjs && npx tsx test/test-service-commands.mjs && npx tsx test/test-supervisor.mjs && npx tsx test/test-supervisor-lock.mjs && npx tsx test/test-clear-detection.mjs && npx tsx test/test-session-consolidation.mjs && npx tsx test/test-inbox.mjs && npx tsx test/test-session-rpc-dispatch.mjs && npx tsx test/test-sandbox-cli.mjs && npx tsx test/test-serve-manager.mjs && npx tsx test/test-serve-stability.mjs && npx tsx test/test-frpc-e2e.mjs --unit-only",
|
|
23
23
|
"test:hypha": "node --no-warnings test/test-hypha-service.mjs",
|
|
24
24
|
dev: "tsx src/cli.ts",
|
|
25
25
|
"dev:daemon": "tsx src/cli.ts daemon start-sync",
|
|
@@ -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 { join, resolve } from 'node:path';
|
|
4
4
|
import { mkdirSync, writeFileSync, existsSync, unlinkSync, readFileSync, watch } from 'node:fs';
|
|
5
|
-
import { c as connectToHypha, a as registerSessionService } from './run-
|
|
5
|
+
import { c as connectToHypha, a as registerSessionService } from './run-CRwkPQDW.mjs';
|
|
6
6
|
import { createServer } from 'node:http';
|
|
7
7
|
import { spawn } from 'node:child_process';
|
|
8
8
|
import { createInterface } from 'node:readline';
|
|
@@ -4930,6 +4930,162 @@ function shouldIsolate(input) {
|
|
|
4930
4930
|
return input.optionsSecurityContext !== null && input.optionsSecurityContext !== void 0;
|
|
4931
4931
|
}
|
|
4932
4932
|
|
|
4933
|
+
const HYPHA_PROXY_BASE_URL = "https://proxy.hypha.aicell.io";
|
|
4934
|
+
const MODE_KEY = "SVAMP_CLAUDE_PROXY";
|
|
4935
|
+
const MANAGED_KEYS = /* @__PURE__ */ new Set([
|
|
4936
|
+
MODE_KEY,
|
|
4937
|
+
"ANTHROPIC_BASE_URL",
|
|
4938
|
+
"ANTHROPIC_API_KEY"
|
|
4939
|
+
]);
|
|
4940
|
+
function envFilePath() {
|
|
4941
|
+
const svampHome = process.env.SVAMP_HOME || join$1(homedir(), ".svamp");
|
|
4942
|
+
return join$1(svampHome, ".env");
|
|
4943
|
+
}
|
|
4944
|
+
function readEnvLines() {
|
|
4945
|
+
const file = envFilePath();
|
|
4946
|
+
if (!existsSync(file)) return [];
|
|
4947
|
+
return readFileSync(file, "utf-8").split("\n");
|
|
4948
|
+
}
|
|
4949
|
+
function writeEnvLines(lines) {
|
|
4950
|
+
const file = envFilePath();
|
|
4951
|
+
const dir = join$1(file, "..");
|
|
4952
|
+
if (!existsSync(dir)) mkdirSync$1(dir, { recursive: true });
|
|
4953
|
+
while (lines.length > 0 && lines[lines.length - 1].trim() === "") {
|
|
4954
|
+
lines.pop();
|
|
4955
|
+
}
|
|
4956
|
+
writeFileSync$1(file, lines.join("\n") + "\n", "utf-8");
|
|
4957
|
+
}
|
|
4958
|
+
function updateEnvFile(updates) {
|
|
4959
|
+
const lines = readEnvLines();
|
|
4960
|
+
const kept = [];
|
|
4961
|
+
const remainingUpdates = new Map(Object.entries(updates));
|
|
4962
|
+
for (const line of lines) {
|
|
4963
|
+
const trimmed = line.trim();
|
|
4964
|
+
if (!trimmed || trimmed.startsWith("#")) {
|
|
4965
|
+
kept.push(line);
|
|
4966
|
+
continue;
|
|
4967
|
+
}
|
|
4968
|
+
const eq = trimmed.indexOf("=");
|
|
4969
|
+
const key = eq === -1 ? trimmed : trimmed.slice(0, eq);
|
|
4970
|
+
if (remainingUpdates.has(key)) {
|
|
4971
|
+
const v = remainingUpdates.get(key);
|
|
4972
|
+
remainingUpdates.delete(key);
|
|
4973
|
+
if (v === void 0) continue;
|
|
4974
|
+
kept.push(`${key}=${v}`);
|
|
4975
|
+
continue;
|
|
4976
|
+
}
|
|
4977
|
+
kept.push(line);
|
|
4978
|
+
}
|
|
4979
|
+
for (const [key, v] of remainingUpdates) {
|
|
4980
|
+
if (v === void 0) continue;
|
|
4981
|
+
kept.push(`${key}=${v}`);
|
|
4982
|
+
}
|
|
4983
|
+
writeEnvLines(kept);
|
|
4984
|
+
}
|
|
4985
|
+
function currentMode() {
|
|
4986
|
+
const raw = (process.env[MODE_KEY] || "").trim().toLowerCase();
|
|
4987
|
+
if (raw === "hypha" || raw === "hypha-proxy") return "hypha";
|
|
4988
|
+
if (raw === "custom") return "custom";
|
|
4989
|
+
return "login";
|
|
4990
|
+
}
|
|
4991
|
+
function redactKey(key) {
|
|
4992
|
+
if (!key) return void 0;
|
|
4993
|
+
if (key.length <= 12) return "***";
|
|
4994
|
+
return `${key.slice(0, 8)}\u2026${key.slice(-4)}`;
|
|
4995
|
+
}
|
|
4996
|
+
function getClaudeAuthStatus() {
|
|
4997
|
+
const mode = currentMode();
|
|
4998
|
+
if (mode === "hypha") {
|
|
4999
|
+
const token = process.env.HYPHA_TOKEN;
|
|
5000
|
+
return {
|
|
5001
|
+
mode,
|
|
5002
|
+
baseUrl: HYPHA_PROXY_BASE_URL,
|
|
5003
|
+
apiKeyPreview: redactKey(token),
|
|
5004
|
+
hyphaTokenMissing: !token
|
|
5005
|
+
};
|
|
5006
|
+
}
|
|
5007
|
+
if (mode === "custom") {
|
|
5008
|
+
return {
|
|
5009
|
+
mode,
|
|
5010
|
+
baseUrl: process.env.ANTHROPIC_BASE_URL,
|
|
5011
|
+
apiKeyPreview: redactKey(process.env.ANTHROPIC_API_KEY)
|
|
5012
|
+
};
|
|
5013
|
+
}
|
|
5014
|
+
return { mode: "login" };
|
|
5015
|
+
}
|
|
5016
|
+
function setClaudeAuthHyphaProxy() {
|
|
5017
|
+
updateEnvFile({
|
|
5018
|
+
[MODE_KEY]: "hypha",
|
|
5019
|
+
// Hypha mode resolves token live at spawn — no stored copy.
|
|
5020
|
+
ANTHROPIC_BASE_URL: void 0,
|
|
5021
|
+
ANTHROPIC_API_KEY: void 0
|
|
5022
|
+
});
|
|
5023
|
+
}
|
|
5024
|
+
function setClaudeAuthLogin() {
|
|
5025
|
+
updateEnvFile({
|
|
5026
|
+
[MODE_KEY]: void 0,
|
|
5027
|
+
ANTHROPIC_BASE_URL: void 0,
|
|
5028
|
+
ANTHROPIC_API_KEY: void 0
|
|
5029
|
+
});
|
|
5030
|
+
}
|
|
5031
|
+
function setClaudeAuthCustom(baseUrl, apiKey) {
|
|
5032
|
+
if (!baseUrl) throw new Error("ANTHROPIC_BASE_URL is required for custom mode");
|
|
5033
|
+
if (!apiKey) throw new Error("ANTHROPIC_API_KEY is required for custom mode");
|
|
5034
|
+
const trimmed = baseUrl.replace(/\/+$/, "");
|
|
5035
|
+
if (trimmed.endsWith("/v1")) {
|
|
5036
|
+
throw new Error(
|
|
5037
|
+
"ANTHROPIC_BASE_URL must not end in /v1 \u2014 the SDK appends it, producing double /v1/v1/messages"
|
|
5038
|
+
);
|
|
5039
|
+
}
|
|
5040
|
+
updateEnvFile({
|
|
5041
|
+
[MODE_KEY]: "custom",
|
|
5042
|
+
ANTHROPIC_BASE_URL: trimmed,
|
|
5043
|
+
ANTHROPIC_API_KEY: apiKey
|
|
5044
|
+
});
|
|
5045
|
+
}
|
|
5046
|
+
function applyClaudeProxyEnv(spawnEnv) {
|
|
5047
|
+
const mode = currentMode();
|
|
5048
|
+
if (mode === "hypha") {
|
|
5049
|
+
const token = process.env.HYPHA_TOKEN;
|
|
5050
|
+
if (!token) {
|
|
5051
|
+
delete spawnEnv.ANTHROPIC_BASE_URL;
|
|
5052
|
+
delete spawnEnv.ANTHROPIC_API_KEY;
|
|
5053
|
+
return "hypha mode but HYPHA_TOKEN missing \u2014 falling back to login";
|
|
5054
|
+
}
|
|
5055
|
+
spawnEnv.ANTHROPIC_BASE_URL = HYPHA_PROXY_BASE_URL;
|
|
5056
|
+
spawnEnv.ANTHROPIC_API_KEY = token;
|
|
5057
|
+
return `hypha proxy (${HYPHA_PROXY_BASE_URL})`;
|
|
5058
|
+
}
|
|
5059
|
+
if (mode === "custom") {
|
|
5060
|
+
const url = process.env.ANTHROPIC_BASE_URL;
|
|
5061
|
+
const key = process.env.ANTHROPIC_API_KEY;
|
|
5062
|
+
if (!url || !key) {
|
|
5063
|
+
delete spawnEnv.ANTHROPIC_BASE_URL;
|
|
5064
|
+
delete spawnEnv.ANTHROPIC_API_KEY;
|
|
5065
|
+
return "custom mode but ANTHROPIC_BASE_URL/API_KEY missing \u2014 falling back to login";
|
|
5066
|
+
}
|
|
5067
|
+
spawnEnv.ANTHROPIC_BASE_URL = url;
|
|
5068
|
+
spawnEnv.ANTHROPIC_API_KEY = key;
|
|
5069
|
+
return `custom proxy (${url})`;
|
|
5070
|
+
}
|
|
5071
|
+
delete spawnEnv.ANTHROPIC_BASE_URL;
|
|
5072
|
+
delete spawnEnv.ANTHROPIC_API_KEY;
|
|
5073
|
+
return null;
|
|
5074
|
+
}
|
|
5075
|
+
const MANAGED_ENV_KEYS = Array.from(MANAGED_KEYS);
|
|
5076
|
+
|
|
5077
|
+
var claudeAuth = /*#__PURE__*/Object.freeze({
|
|
5078
|
+
__proto__: null,
|
|
5079
|
+
HYPHA_PROXY_BASE_URL: HYPHA_PROXY_BASE_URL,
|
|
5080
|
+
MANAGED_ENV_KEYS: MANAGED_ENV_KEYS,
|
|
5081
|
+
applyClaudeProxyEnv: applyClaudeProxyEnv,
|
|
5082
|
+
getClaudeAuthStatus: getClaudeAuthStatus,
|
|
5083
|
+
setClaudeAuthCustom: setClaudeAuthCustom,
|
|
5084
|
+
setClaudeAuthHyphaProxy: setClaudeAuthHyphaProxy,
|
|
5085
|
+
setClaudeAuthLogin: setClaudeAuthLogin,
|
|
5086
|
+
updateEnvFile: updateEnvFile
|
|
5087
|
+
});
|
|
5088
|
+
|
|
4933
5089
|
const DEFAULT_PROBE_INTERVAL_S = 10;
|
|
4934
5090
|
const DEFAULT_PROBE_TIMEOUT_S = 5;
|
|
4935
5091
|
const DEFAULT_PROBE_FAILURE_THRESHOLD = 3;
|
|
@@ -6824,6 +6980,10 @@ async function startDaemon(options) {
|
|
|
6824
6980
|
delete spawnEnv.CLAUDECODE;
|
|
6825
6981
|
spawnEnv.SVAMP_SESSION_ID = sessionId;
|
|
6826
6982
|
delete spawnEnv.SVAMP_SANDBOXED;
|
|
6983
|
+
const proxyDesc = applyClaudeProxyEnv(spawnEnv);
|
|
6984
|
+
if (proxyDesc) {
|
|
6985
|
+
logger.log(`[Session ${sessionId}] Claude auth: ${proxyDesc}`);
|
|
6986
|
+
}
|
|
6827
6987
|
if (isoConfig && stagedCredentials) {
|
|
6828
6988
|
Object.assign(spawnEnv, stagedCredentials.env);
|
|
6829
6989
|
const filtered = {};
|
|
@@ -9047,18 +9207,31 @@ The automated loop has finished. Review the progress above and let me know if yo
|
|
|
9047
9207
|
}, HEARTBEAT_INTERVAL_MS);
|
|
9048
9208
|
const PROXY_TOKEN_REFRESH_INTERVAL_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
9049
9209
|
let proxyTokenRefreshInterval;
|
|
9050
|
-
|
|
9210
|
+
const proxyMode = (process.env.SVAMP_CLAUDE_PROXY || "").toLowerCase();
|
|
9211
|
+
if (proxyMode === "hypha" || proxyMode === "hypha-proxy") {
|
|
9212
|
+
const refreshProxyToken = async () => {
|
|
9213
|
+
try {
|
|
9214
|
+
const freshToken = await server.generateToken({ expires_in: 30 * 24 * 3600 });
|
|
9215
|
+
process.env.HYPHA_TOKEN = freshToken;
|
|
9216
|
+
logger.log("Hypha proxy token refreshed (30-day expiry)");
|
|
9217
|
+
} catch (err) {
|
|
9218
|
+
logger.log(`Hypha proxy token refresh failed (will retry in 7 days): ${err}`);
|
|
9219
|
+
}
|
|
9220
|
+
};
|
|
9221
|
+
proxyTokenRefreshInterval = setInterval(refreshProxyToken, PROXY_TOKEN_REFRESH_INTERVAL_MS);
|
|
9222
|
+
logger.log("Hypha proxy token auto-refresh enabled (every 7 days)");
|
|
9223
|
+
} else if (process.env.ANTHROPIC_BASE_URL && !process.env.SVAMP_CLAUDE_PROXY) {
|
|
9051
9224
|
const refreshProxyToken = async () => {
|
|
9052
9225
|
try {
|
|
9053
9226
|
const freshToken = await server.generateToken({ expires_in: 30 * 24 * 3600 });
|
|
9054
9227
|
process.env.ANTHROPIC_API_KEY = freshToken;
|
|
9055
|
-
logger.log("Proxy token refreshed (30-day expiry)");
|
|
9228
|
+
logger.log("Proxy token refreshed (legacy, 30-day expiry)");
|
|
9056
9229
|
} catch (err) {
|
|
9057
9230
|
logger.log(`Proxy token refresh failed (will retry in 7 days): ${err}`);
|
|
9058
9231
|
}
|
|
9059
9232
|
};
|
|
9060
9233
|
proxyTokenRefreshInterval = setInterval(refreshProxyToken, PROXY_TOKEN_REFRESH_INTERVAL_MS);
|
|
9061
|
-
logger.log("Proxy token auto-refresh enabled (every 7 days)");
|
|
9234
|
+
logger.log("Proxy token auto-refresh enabled (legacy mode, every 7 days)");
|
|
9062
9235
|
}
|
|
9063
9236
|
let oauthRefreshInterval;
|
|
9064
9237
|
const refreshOAuthAndRestageCredentials = async () => {
|
|
@@ -9396,4 +9569,4 @@ var run = /*#__PURE__*/Object.freeze({
|
|
|
9396
9569
|
stopDaemon: stopDaemon
|
|
9397
9570
|
});
|
|
9398
9571
|
|
|
9399
|
-
export { DefaultTransport$1 as D, GeminiTransport$1 as G, registerSessionService as a, stopDaemon as b, connectToHypha as c, daemonStatus as d, resolveSecurityContext as e, buildSecurityContextFromFlags as f, getHyphaServerUrl as g, acpBackend as h, acpAgentConfig as i, codexMcpBackend as j,
|
|
9572
|
+
export { DefaultTransport$1 as D, GeminiTransport$1 as G, registerSessionService as a, stopDaemon as b, connectToHypha as c, daemonStatus as d, resolveSecurityContext as e, buildSecurityContextFromFlags as f, getHyphaServerUrl as g, acpBackend as h, acpAgentConfig as i, codexMcpBackend as j, claudeAuth as k, loadSecurityContextConfig as l, mergeSecurityContexts as m, run as n, registerMachineService as r, startDaemon as s };
|
|
@@ -52,7 +52,7 @@ async function handleServeCommand() {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
async function serveAdd(args, machineId) {
|
|
55
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
55
|
+
const { connectAndGetMachine } = await import('./commands-CWKFZm9s.mjs');
|
|
56
56
|
const pos = positionalArgs(args);
|
|
57
57
|
const name = pos[0];
|
|
58
58
|
if (!name) {
|
|
@@ -84,7 +84,7 @@ async function serveAdd(args, machineId) {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
async function serveRemove(args, machineId) {
|
|
87
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
87
|
+
const { connectAndGetMachine } = await import('./commands-CWKFZm9s.mjs');
|
|
88
88
|
const pos = positionalArgs(args);
|
|
89
89
|
const name = pos[0];
|
|
90
90
|
if (!name) {
|
|
@@ -104,7 +104,7 @@ async function serveRemove(args, machineId) {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
async function serveList(args, machineId) {
|
|
107
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
107
|
+
const { connectAndGetMachine } = await import('./commands-CWKFZm9s.mjs');
|
|
108
108
|
const all = hasFlag(args, "--all", "-a");
|
|
109
109
|
const json = hasFlag(args, "--json");
|
|
110
110
|
const sessionId = getFlag(args, "--session");
|
|
@@ -137,7 +137,7 @@ async function serveList(args, machineId) {
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
async function serveInfo(machineId) {
|
|
140
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
140
|
+
const { connectAndGetMachine } = await import('./commands-CWKFZm9s.mjs');
|
|
141
141
|
const { machine, server } = await connectAndGetMachine(machineId);
|
|
142
142
|
try {
|
|
143
143
|
const info = await machine.serveInfo();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svamp-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.39",
|
|
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 && tsc --noEmit && pkgroll",
|
|
22
22
|
"typecheck": "tsc --noEmit",
|
|
23
|
-
"test": "npx tsx test/test-authorize.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-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-skills.mjs && npx tsx test/test-agent-grouping.mjs && npx tsx test/test-ralph-loop-integration.mjs && npx tsx test/test-ralph-loop-modes.mjs && npx tsx test/test-machine-list-directory.mjs && npx tsx test/test-service-commands.mjs && npx tsx test/test-supervisor.mjs && npx tsx test/test-supervisor-lock.mjs && npx tsx test/test-clear-detection.mjs && npx tsx test/test-session-consolidation.mjs && npx tsx test/test-inbox.mjs && npx tsx test/test-session-rpc-dispatch.mjs && npx tsx test/test-sandbox-cli.mjs && npx tsx test/test-serve-manager.mjs && npx tsx test/test-serve-stability.mjs && npx tsx test/test-frpc-e2e.mjs --unit-only",
|
|
23
|
+
"test": "npx tsx test/test-authorize.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-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",
|
|
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",
|