svamp-cli 0.2.49 → 0.2.50
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/README.md +17 -8
- package/dist/{agentCommands-CpR_jpWk.mjs → agentCommands-CoozsCNg.mjs} +2 -2
- package/dist/cli.mjs +33 -33
- package/dist/{commands-DmxhoO5X.mjs → commands-Cb0wg6xA.mjs} +2 -2
- package/dist/{commands-CTQAVadm.mjs → commands-CvWyrVnY.mjs} +1 -1
- package/dist/{commands-BswZUToD.mjs → commands-FDeLH4pp.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{package-DnTJGm-n.mjs → package-D2al7V1C.mjs} +1 -1
- package/dist/{run-V2qpcN7f.mjs → run-CIPCavEp.mjs} +59 -6
- package/dist/{run-mXTPYgtc.mjs → run-CPV6r3M6.mjs} +1 -1
- package/dist/{serveCommands-Cj-P-FeY.mjs → serveCommands-Bzmgmhxk.mjs} +5 -5
- package/dist/{serveManager-BhWfboEx.mjs → serveManager-rHhOPkW4.mjs} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -139,16 +139,25 @@ svamp skills publish <path> # Publish to marketplace
|
|
|
139
139
|
|
|
140
140
|
### Service Exposure (Cloud HTTP Services)
|
|
141
141
|
|
|
142
|
-
Expose HTTP services from cloud sandboxes or local machines to stable external URLs.
|
|
142
|
+
Expose HTTP services from cloud sandboxes or local machines to stable external URLs via frpc tunnels.
|
|
143
143
|
|
|
144
144
|
```bash
|
|
145
|
-
svamp service expose <name> --port <port> #
|
|
146
|
-
svamp service
|
|
147
|
-
|
|
148
|
-
svamp service
|
|
149
|
-
svamp service
|
|
150
|
-
svamp service
|
|
151
|
-
|
|
145
|
+
svamp service expose <name> --port <port> # Expose local port via frpc
|
|
146
|
+
svamp service expose <name> --port <port> --group <g> --group-key <key>
|
|
147
|
+
# Multi-machine load balancing
|
|
148
|
+
svamp service serve <name> [dir] # Static-files tunnel
|
|
149
|
+
svamp service list # List active tunnels
|
|
150
|
+
svamp service info <name> # Show details + health
|
|
151
|
+
svamp service delete <name> # Stop tunnel
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
For dynamic apps the daemon should supervise across restarts (with optional
|
|
155
|
+
wake-on-request and idle-stop), prefer `svamp serve apply <yaml>` with a
|
|
156
|
+
`process` block — see [`docs/service-exposure.md`](../../docs/service-exposure.md).
|
|
157
|
+
|
|
158
|
+
The legacy `service create / add-backend / remove-backend / add-port /
|
|
159
|
+
tunnel` subcommands were removed in favor of the declarative
|
|
160
|
+
`service expose --group …` model.
|
|
152
161
|
|
|
153
162
|
### Local Agent Sessions
|
|
154
163
|
|
|
@@ -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-CvWyrVnY.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-CvWyrVnY.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-CIPCavEp.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -43,7 +43,7 @@ async function main() {
|
|
|
43
43
|
console.error(`svamp daemon restart: ${err.message || err}`);
|
|
44
44
|
process.exit(1);
|
|
45
45
|
}
|
|
46
|
-
const { restartDaemon } = await import('./run-
|
|
46
|
+
const { restartDaemon } = await import('./run-CIPCavEp.mjs').then(function (n) { return n.u; });
|
|
47
47
|
await restartDaemon();
|
|
48
48
|
process.exit(0);
|
|
49
49
|
}
|
|
@@ -279,7 +279,7 @@ async function main() {
|
|
|
279
279
|
console.error("svamp service: Service commands are not available in sandboxed sessions.");
|
|
280
280
|
process.exit(1);
|
|
281
281
|
}
|
|
282
|
-
const { handleServiceCommand } = await import('./commands-
|
|
282
|
+
const { handleServiceCommand } = await import('./commands-FDeLH4pp.mjs');
|
|
283
283
|
await handleServiceCommand();
|
|
284
284
|
} else if (subcommand === "serve") {
|
|
285
285
|
const { isSandboxed: isSandboxedServe } = await import('./sandboxDetect-DNTcbgWD.mjs');
|
|
@@ -287,7 +287,7 @@ async function main() {
|
|
|
287
287
|
console.error("svamp serve: Serve commands are not available in sandboxed sessions.");
|
|
288
288
|
process.exit(1);
|
|
289
289
|
}
|
|
290
|
-
const { handleServeCommand } = await import('./serveCommands-
|
|
290
|
+
const { handleServeCommand } = await import('./serveCommands-Bzmgmhxk.mjs');
|
|
291
291
|
await handleServeCommand();
|
|
292
292
|
process.exit(0);
|
|
293
293
|
} else if (subcommand === "process" || subcommand === "proc") {
|
|
@@ -296,7 +296,7 @@ async function main() {
|
|
|
296
296
|
console.error("svamp process: Process commands are not available in sandboxed sessions.");
|
|
297
297
|
process.exit(1);
|
|
298
298
|
}
|
|
299
|
-
const { processCommand } = await import('./commands-
|
|
299
|
+
const { processCommand } = await import('./commands-Cb0wg6xA.mjs');
|
|
300
300
|
let machineId;
|
|
301
301
|
const processArgs = args.slice(1);
|
|
302
302
|
const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
|
|
@@ -314,7 +314,7 @@ async function main() {
|
|
|
314
314
|
} else if (!subcommand || subcommand === "start") {
|
|
315
315
|
await handleInteractiveCommand();
|
|
316
316
|
} else if (subcommand === "--version" || subcommand === "-v") {
|
|
317
|
-
const pkg = await import('./package-
|
|
317
|
+
const pkg = await import('./package-D2al7V1C.mjs').catch(() => ({ default: { version: "unknown" } }));
|
|
318
318
|
console.log(`svamp version: ${pkg.default.version}`);
|
|
319
319
|
} else {
|
|
320
320
|
console.error(`Unknown command: ${subcommand}`);
|
|
@@ -323,7 +323,7 @@ async function main() {
|
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
async function handleInteractiveCommand() {
|
|
326
|
-
const { runInteractive } = await import('./run-
|
|
326
|
+
const { runInteractive } = await import('./run-CPV6r3M6.mjs');
|
|
327
327
|
const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
|
|
328
328
|
let directory = process.cwd();
|
|
329
329
|
let resumeSessionId;
|
|
@@ -368,7 +368,7 @@ async function handleAgentCommand() {
|
|
|
368
368
|
return;
|
|
369
369
|
}
|
|
370
370
|
if (agentArgs[0] === "list") {
|
|
371
|
-
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-
|
|
371
|
+
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-CIPCavEp.mjs').then(function (n) { return n.p; });
|
|
372
372
|
console.log("Known agents:");
|
|
373
373
|
for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
|
|
374
374
|
console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
|
|
@@ -380,7 +380,7 @@ async function handleAgentCommand() {
|
|
|
380
380
|
console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
|
|
381
381
|
return;
|
|
382
382
|
}
|
|
383
|
-
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-
|
|
383
|
+
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-CIPCavEp.mjs').then(function (n) { return n.p; });
|
|
384
384
|
let cwd = process.cwd();
|
|
385
385
|
const filteredArgs = [];
|
|
386
386
|
for (let i = 0; i < agentArgs.length; i++) {
|
|
@@ -404,12 +404,12 @@ async function handleAgentCommand() {
|
|
|
404
404
|
console.log(`Starting ${config.agentName} agent in ${cwd}...`);
|
|
405
405
|
let backend;
|
|
406
406
|
if (KNOWN_MCP_AGENTS[config.agentName]) {
|
|
407
|
-
const { CodexMcpBackend } = await import('./run-
|
|
407
|
+
const { CodexMcpBackend } = await import('./run-CIPCavEp.mjs').then(function (n) { return n.q; });
|
|
408
408
|
backend = new CodexMcpBackend({ cwd, log: logFn });
|
|
409
409
|
} else {
|
|
410
|
-
const { AcpBackend } = await import('./run-
|
|
411
|
-
const { GeminiTransport } = await import('./run-
|
|
412
|
-
const { DefaultTransport } = await import('./run-
|
|
410
|
+
const { AcpBackend } = await import('./run-CIPCavEp.mjs').then(function (n) { return n.o; });
|
|
411
|
+
const { GeminiTransport } = await import('./run-CIPCavEp.mjs').then(function (n) { return n.G; });
|
|
412
|
+
const { DefaultTransport } = await import('./run-CIPCavEp.mjs').then(function (n) { return n.D; });
|
|
413
413
|
const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
|
|
414
414
|
backend = new AcpBackend({
|
|
415
415
|
agentName: config.agentName,
|
|
@@ -536,7 +536,7 @@ async function handleSessionCommand() {
|
|
|
536
536
|
process.exit(1);
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
|
-
const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-
|
|
539
|
+
const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-CvWyrVnY.mjs');
|
|
540
540
|
const parseFlagStr = (flag, shortFlag) => {
|
|
541
541
|
for (let i = 1; i < sessionArgs.length; i++) {
|
|
542
542
|
if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
|
|
@@ -596,7 +596,7 @@ async function handleSessionCommand() {
|
|
|
596
596
|
allowDomain.push(sessionArgs[++i]);
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
|
-
const { parseShareArg } = await import('./commands-
|
|
599
|
+
const { parseShareArg } = await import('./commands-CvWyrVnY.mjs');
|
|
600
600
|
const shareEntries = share.map((s) => parseShareArg(s));
|
|
601
601
|
await sessionSpawn(agent, dir, targetMachineId, {
|
|
602
602
|
message,
|
|
@@ -682,7 +682,7 @@ async function handleSessionCommand() {
|
|
|
682
682
|
console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
|
|
683
683
|
process.exit(1);
|
|
684
684
|
}
|
|
685
|
-
const { sessionApprove } = await import('./commands-
|
|
685
|
+
const { sessionApprove } = await import('./commands-CvWyrVnY.mjs');
|
|
686
686
|
const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
687
687
|
await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
|
|
688
688
|
json: hasFlag("--json")
|
|
@@ -692,7 +692,7 @@ async function handleSessionCommand() {
|
|
|
692
692
|
console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
|
|
693
693
|
process.exit(1);
|
|
694
694
|
}
|
|
695
|
-
const { sessionDeny } = await import('./commands-
|
|
695
|
+
const { sessionDeny } = await import('./commands-CvWyrVnY.mjs');
|
|
696
696
|
const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
697
697
|
await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
|
|
698
698
|
json: hasFlag("--json")
|
|
@@ -728,7 +728,7 @@ async function handleSessionCommand() {
|
|
|
728
728
|
console.error("Usage: svamp session set-title <title>");
|
|
729
729
|
process.exit(1);
|
|
730
730
|
}
|
|
731
|
-
const { sessionSetTitle } = await import('./agentCommands-
|
|
731
|
+
const { sessionSetTitle } = await import('./agentCommands-CoozsCNg.mjs');
|
|
732
732
|
await sessionSetTitle(title);
|
|
733
733
|
} else if (sessionSubcommand === "set-link") {
|
|
734
734
|
const url = sessionArgs[1];
|
|
@@ -737,7 +737,7 @@ async function handleSessionCommand() {
|
|
|
737
737
|
process.exit(1);
|
|
738
738
|
}
|
|
739
739
|
const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
740
|
-
const { sessionSetLink } = await import('./agentCommands-
|
|
740
|
+
const { sessionSetLink } = await import('./agentCommands-CoozsCNg.mjs');
|
|
741
741
|
await sessionSetLink(url, label);
|
|
742
742
|
} else if (sessionSubcommand === "notify") {
|
|
743
743
|
const message = sessionArgs[1];
|
|
@@ -746,7 +746,7 @@ async function handleSessionCommand() {
|
|
|
746
746
|
process.exit(1);
|
|
747
747
|
}
|
|
748
748
|
const level = parseFlagStr("--level") || "info";
|
|
749
|
-
const { sessionNotify } = await import('./agentCommands-
|
|
749
|
+
const { sessionNotify } = await import('./agentCommands-CoozsCNg.mjs');
|
|
750
750
|
await sessionNotify(message, level);
|
|
751
751
|
} else if (sessionSubcommand === "broadcast") {
|
|
752
752
|
const action = sessionArgs[1];
|
|
@@ -754,7 +754,7 @@ async function handleSessionCommand() {
|
|
|
754
754
|
console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
|
|
755
755
|
process.exit(1);
|
|
756
756
|
}
|
|
757
|
-
const { sessionBroadcast } = await import('./agentCommands-
|
|
757
|
+
const { sessionBroadcast } = await import('./agentCommands-CoozsCNg.mjs');
|
|
758
758
|
await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
|
|
759
759
|
} else if (sessionSubcommand === "inbox") {
|
|
760
760
|
const inboxSubcmd = sessionArgs[1];
|
|
@@ -765,7 +765,7 @@ async function handleSessionCommand() {
|
|
|
765
765
|
process.exit(1);
|
|
766
766
|
}
|
|
767
767
|
if (agentSessionId) {
|
|
768
|
-
const { inboxSend } = await import('./agentCommands-
|
|
768
|
+
const { inboxSend } = await import('./agentCommands-CoozsCNg.mjs');
|
|
769
769
|
await inboxSend(sessionArgs[2], {
|
|
770
770
|
body: sessionArgs[3],
|
|
771
771
|
subject: parseFlagStr("--subject"),
|
|
@@ -780,7 +780,7 @@ async function handleSessionCommand() {
|
|
|
780
780
|
}
|
|
781
781
|
} else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
|
|
782
782
|
if (agentSessionId && !sessionArgs[2]) {
|
|
783
|
-
const { inboxList } = await import('./agentCommands-
|
|
783
|
+
const { inboxList } = await import('./agentCommands-CoozsCNg.mjs');
|
|
784
784
|
await inboxList({
|
|
785
785
|
unread: hasFlag("--unread"),
|
|
786
786
|
limit: parseFlagInt("--limit"),
|
|
@@ -802,7 +802,7 @@ async function handleSessionCommand() {
|
|
|
802
802
|
process.exit(1);
|
|
803
803
|
}
|
|
804
804
|
if (agentSessionId && !sessionArgs[3]) {
|
|
805
|
-
const { inboxList } = await import('./agentCommands-
|
|
805
|
+
const { inboxList } = await import('./agentCommands-CoozsCNg.mjs');
|
|
806
806
|
await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
|
|
807
807
|
} else if (sessionArgs[3]) {
|
|
808
808
|
await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
|
|
@@ -812,7 +812,7 @@ async function handleSessionCommand() {
|
|
|
812
812
|
}
|
|
813
813
|
} else if (inboxSubcmd === "reply") {
|
|
814
814
|
if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
|
|
815
|
-
const { inboxReply } = await import('./agentCommands-
|
|
815
|
+
const { inboxReply } = await import('./agentCommands-CoozsCNg.mjs');
|
|
816
816
|
await inboxReply(sessionArgs[2], sessionArgs[3]);
|
|
817
817
|
} else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
|
|
818
818
|
await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
|
|
@@ -848,7 +848,7 @@ async function handleMachineCommand() {
|
|
|
848
848
|
return;
|
|
849
849
|
}
|
|
850
850
|
if (machineSubcommand === "share") {
|
|
851
|
-
const { machineShare } = await import('./commands-
|
|
851
|
+
const { machineShare } = await import('./commands-CvWyrVnY.mjs');
|
|
852
852
|
let machineId;
|
|
853
853
|
const shareArgs = [];
|
|
854
854
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
@@ -878,7 +878,7 @@ async function handleMachineCommand() {
|
|
|
878
878
|
}
|
|
879
879
|
await machineShare(machineId, { add, remove, list, configPath, showConfig });
|
|
880
880
|
} else if (machineSubcommand === "exec") {
|
|
881
|
-
const { machineExec } = await import('./commands-
|
|
881
|
+
const { machineExec } = await import('./commands-CvWyrVnY.mjs');
|
|
882
882
|
let machineId;
|
|
883
883
|
let cwd;
|
|
884
884
|
const cmdParts = [];
|
|
@@ -898,7 +898,7 @@ async function handleMachineCommand() {
|
|
|
898
898
|
}
|
|
899
899
|
await machineExec(machineId, command, cwd);
|
|
900
900
|
} else if (machineSubcommand === "info") {
|
|
901
|
-
const { machineInfo } = await import('./commands-
|
|
901
|
+
const { machineInfo } = await import('./commands-CvWyrVnY.mjs');
|
|
902
902
|
let machineId;
|
|
903
903
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
904
904
|
if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
|
|
@@ -918,10 +918,10 @@ async function handleMachineCommand() {
|
|
|
918
918
|
level = machineArgs[++i];
|
|
919
919
|
}
|
|
920
920
|
}
|
|
921
|
-
const { machineNotify } = await import('./agentCommands-
|
|
921
|
+
const { machineNotify } = await import('./agentCommands-CoozsCNg.mjs');
|
|
922
922
|
await machineNotify(message, level);
|
|
923
923
|
} else if (machineSubcommand === "ls") {
|
|
924
|
-
const { machineLs } = await import('./commands-
|
|
924
|
+
const { machineLs } = await import('./commands-CvWyrVnY.mjs');
|
|
925
925
|
let machineId;
|
|
926
926
|
let showHidden = false;
|
|
927
927
|
let path;
|
|
@@ -1388,7 +1388,7 @@ async function applyClaudeAuthFlags(argv) {
|
|
|
1388
1388
|
"--use-hypha-proxy, --use-claude-login, and --anthropic-base-url/--anthropic-api-key are mutually exclusive"
|
|
1389
1389
|
);
|
|
1390
1390
|
}
|
|
1391
|
-
const mod = await import('./run-
|
|
1391
|
+
const mod = await import('./run-CIPCavEp.mjs').then(function (n) { return n.t; });
|
|
1392
1392
|
if (hasHypha) {
|
|
1393
1393
|
mod.setClaudeAuthHyphaProxy();
|
|
1394
1394
|
console.log("Claude auth configured: hypha-proxy (uses HYPHA_TOKEN live at each spawn).");
|
|
@@ -1426,7 +1426,7 @@ async function applyDaemonShareFlag(argv) {
|
|
|
1426
1426
|
}
|
|
1427
1427
|
}
|
|
1428
1428
|
if (collected.length === 0) return;
|
|
1429
|
-
const { updateEnvFile } = await import('./run-
|
|
1429
|
+
const { updateEnvFile } = await import('./run-CIPCavEp.mjs').then(function (n) { return n.t; });
|
|
1430
1430
|
const seen = /* @__PURE__ */ new Set();
|
|
1431
1431
|
const deduped = collected.filter((e) => {
|
|
1432
1432
|
const k = e.toLowerCase();
|
|
@@ -1439,7 +1439,7 @@ async function applyDaemonShareFlag(argv) {
|
|
|
1439
1439
|
}
|
|
1440
1440
|
async function handleDaemonAuthCommand(argv) {
|
|
1441
1441
|
const sub = (argv[0] || "status").toLowerCase();
|
|
1442
|
-
const mod = await import('./run-
|
|
1442
|
+
const mod = await import('./run-CIPCavEp.mjs').then(function (n) { return n.t; });
|
|
1443
1443
|
if (sub === "--help" || sub === "-h" || sub === "help") {
|
|
1444
1444
|
console.log(`
|
|
1445
1445
|
svamp daemon auth \u2014 Configure how Claude subprocesses authenticate
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { writeFileSync, readFileSync } from 'fs';
|
|
2
2
|
import { resolve } from 'path';
|
|
3
|
-
import { connectAndGetMachine } from './commands-
|
|
3
|
+
import { connectAndGetMachine } from './commands-CvWyrVnY.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-CIPCavEp.mjs';
|
|
9
9
|
import 'os';
|
|
10
10
|
import 'fs/promises';
|
|
11
11
|
import 'url';
|
|
@@ -2,7 +2,7 @@ import { existsSync, readFileSync } from 'node:fs';
|
|
|
2
2
|
import { execSync } from 'node:child_process';
|
|
3
3
|
import { resolve, join } from 'node:path';
|
|
4
4
|
import os from 'node:os';
|
|
5
|
-
import { n as normalizeAllowedUser, l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha, i as buildSessionShareUrl, j as buildMachineShareUrl } from './run-
|
|
5
|
+
import { n as normalizeAllowedUser, l as loadSecurityContextConfig, e as resolveSecurityContext, f as buildSecurityContextFromFlags, m as mergeSecurityContexts, c as connectToHypha, i as buildSessionShareUrl, j as buildMachineShareUrl } from './run-CIPCavEp.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
8
8
|
import 'fs';
|
|
@@ -97,7 +97,7 @@ async function serviceServe(args) {
|
|
|
97
97
|
}
|
|
98
98
|
async function serviceList(_args) {
|
|
99
99
|
try {
|
|
100
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
100
|
+
const { connectAndGetMachine } = await import('./commands-CvWyrVnY.mjs');
|
|
101
101
|
const { server, machine } = await connectAndGetMachine();
|
|
102
102
|
try {
|
|
103
103
|
const tunnels = await machine.tunnelList({});
|
|
@@ -126,7 +126,7 @@ async function serviceDelete(args) {
|
|
|
126
126
|
process.exit(1);
|
|
127
127
|
}
|
|
128
128
|
try {
|
|
129
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
129
|
+
const { connectAndGetMachine } = await import('./commands-CvWyrVnY.mjs');
|
|
130
130
|
const { server, machine } = await connectAndGetMachine();
|
|
131
131
|
try {
|
|
132
132
|
await machine.tunnelStop({ name });
|
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-CIPCavEp.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -6303,6 +6303,28 @@ function checkTruncation(format, tail, fileSize, head) {
|
|
|
6303
6303
|
const __filename$1 = fileURLToPath(import.meta.url);
|
|
6304
6304
|
const __dirname$1 = dirname(__filename$1);
|
|
6305
6305
|
const CLAUDE_SKILLS_DIR = join(os$1.homedir(), ".claude", "skills");
|
|
6306
|
+
function readSkillVersion(skillDir) {
|
|
6307
|
+
try {
|
|
6308
|
+
const md = readFileSync$1(join(skillDir, "SKILL.md"), "utf-8");
|
|
6309
|
+
const m = md.match(/^---\s*\n([\s\S]*?)\n---/);
|
|
6310
|
+
if (!m) return null;
|
|
6311
|
+
const versionLine = m[1].split("\n").find((l) => /^\s*version\s*:/.test(l));
|
|
6312
|
+
if (!versionLine) return null;
|
|
6313
|
+
return versionLine.split(":").slice(1).join(":").trim().replace(/^["']|["']$/g, "");
|
|
6314
|
+
} catch {
|
|
6315
|
+
return null;
|
|
6316
|
+
}
|
|
6317
|
+
}
|
|
6318
|
+
function compareVersions(a, b) {
|
|
6319
|
+
const pa = a.split(".").map((p) => parseInt(p, 10) || 0);
|
|
6320
|
+
const pb = b.split(".").map((p) => parseInt(p, 10) || 0);
|
|
6321
|
+
for (let i = 0; i < Math.max(pa.length, pb.length); i++) {
|
|
6322
|
+
const ai = pa[i] ?? 0;
|
|
6323
|
+
const bi = pb[i] ?? 0;
|
|
6324
|
+
if (ai !== bi) return ai < bi ? -1 : 1;
|
|
6325
|
+
}
|
|
6326
|
+
return 0;
|
|
6327
|
+
}
|
|
6306
6328
|
async function installSkillFromEndpoint(name, baseUrl) {
|
|
6307
6329
|
const resp = await fetch(baseUrl, { signal: AbortSignal.timeout(15e3) });
|
|
6308
6330
|
if (!resp.ok) throw new Error(`HTTP ${resp.status} from ${baseUrl}`);
|
|
@@ -6404,25 +6426,56 @@ function preventMachineSleep(logger) {
|
|
|
6404
6426
|
return;
|
|
6405
6427
|
}
|
|
6406
6428
|
}
|
|
6429
|
+
async function fetchMarketplaceSkillVersion(name) {
|
|
6430
|
+
try {
|
|
6431
|
+
const url = `https://hypha.aicell.io/hypha-cloud/artifacts/${name}/files/SKILL.md`;
|
|
6432
|
+
const resp = await fetch(url, { signal: AbortSignal.timeout(1e4) });
|
|
6433
|
+
if (!resp.ok) return null;
|
|
6434
|
+
const md = await resp.text();
|
|
6435
|
+
const m = md.match(/^---\s*\n([\s\S]*?)\n---/);
|
|
6436
|
+
if (!m) return null;
|
|
6437
|
+
const versionLine = m[1].split("\n").find((l) => /^\s*version\s*:/.test(l));
|
|
6438
|
+
if (!versionLine) return null;
|
|
6439
|
+
return versionLine.split(":").slice(1).join(":").trim().replace(/^["']|["']$/g, "");
|
|
6440
|
+
} catch {
|
|
6441
|
+
return null;
|
|
6442
|
+
}
|
|
6443
|
+
}
|
|
6407
6444
|
async function ensureAutoInstalledSkills(logger) {
|
|
6408
6445
|
const tasks = [
|
|
6409
6446
|
{
|
|
6410
6447
|
name: "svamp",
|
|
6411
|
-
install: () => installSkillFromMarketplace("svamp")
|
|
6448
|
+
install: () => installSkillFromMarketplace("svamp"),
|
|
6449
|
+
marketplaceVersion: () => fetchMarketplaceSkillVersion("svamp")
|
|
6412
6450
|
},
|
|
6413
6451
|
{
|
|
6414
6452
|
name: "hypha",
|
|
6415
6453
|
install: () => installSkillFromEndpoint("hypha", "https://hypha.aicell.io/ws/agent-skills/")
|
|
6454
|
+
// hypha skill ships from a different endpoint without a version probe yet.
|
|
6416
6455
|
}
|
|
6417
6456
|
];
|
|
6418
6457
|
for (const task of tasks) {
|
|
6419
6458
|
const targetDir = join(CLAUDE_SKILLS_DIR, task.name);
|
|
6420
|
-
|
|
6459
|
+
const installed = existsSync$1(targetDir);
|
|
6460
|
+
if (!installed) {
|
|
6461
|
+
try {
|
|
6462
|
+
await task.install();
|
|
6463
|
+
logger.log(`[skills] Auto-installed: ${task.name}`);
|
|
6464
|
+
} catch (err) {
|
|
6465
|
+
logger.log(`[skills] Auto-install of "${task.name}" failed (non-fatal): ${err.message}`);
|
|
6466
|
+
}
|
|
6467
|
+
continue;
|
|
6468
|
+
}
|
|
6469
|
+
if (!task.marketplaceVersion) continue;
|
|
6421
6470
|
try {
|
|
6422
|
-
await task.
|
|
6423
|
-
|
|
6471
|
+
const remote = await task.marketplaceVersion();
|
|
6472
|
+
const local = readSkillVersion(targetDir);
|
|
6473
|
+
if (remote && local && compareVersions(remote, local) > 0) {
|
|
6474
|
+
logger.log(`[skills] Refreshing "${task.name}" ${local} \u2192 ${remote}...`);
|
|
6475
|
+
await task.install();
|
|
6476
|
+
logger.log(`[skills] Refreshed: ${task.name} \u2192 ${remote}`);
|
|
6477
|
+
}
|
|
6424
6478
|
} catch (err) {
|
|
6425
|
-
logger.log(`[skills] Auto-install of "${task.name}" failed (non-fatal): ${err.message}`);
|
|
6426
6479
|
}
|
|
6427
6480
|
}
|
|
6428
6481
|
}
|
|
@@ -7241,7 +7294,7 @@ async function startDaemon(options) {
|
|
|
7241
7294
|
const supervisor = new ProcessSupervisor(join(SVAMP_HOME, "processes"));
|
|
7242
7295
|
await supervisor.init();
|
|
7243
7296
|
const tunnels = /* @__PURE__ */ new Map();
|
|
7244
|
-
const { ServeManager } = await import('./serveManager-
|
|
7297
|
+
const { ServeManager } = await import('./serveManager-rHhOPkW4.mjs');
|
|
7245
7298
|
const serveManager = new ServeManager(SVAMP_HOME, (msg) => logger.log(`[SERVE] ${msg}`), hyphaServerUrl);
|
|
7246
7299
|
ensureAutoInstalledSkills(logger).catch(() => {
|
|
7247
7300
|
});
|
|
@@ -2,7 +2,7 @@ import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(im
|
|
|
2
2
|
import os from 'node:os';
|
|
3
3
|
import { resolve, join } from 'node:path';
|
|
4
4
|
import { existsSync, readFileSync, watch } from 'node:fs';
|
|
5
|
-
import { c as connectToHypha, a as registerSessionService, k as generateHookSettings } from './run-
|
|
5
|
+
import { c as connectToHypha, a as registerSessionService, k as generateHookSettings } from './run-CIPCavEp.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-CvWyrVnY.mjs');
|
|
58
58
|
const pos = positionalArgs(args);
|
|
59
59
|
const name = pos[0];
|
|
60
60
|
if (!name) {
|
|
@@ -86,7 +86,7 @@ async function serveAdd(args, machineId) {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
async function serveApply(args, machineId) {
|
|
89
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
89
|
+
const { connectAndGetMachine } = await import('./commands-CvWyrVnY.mjs');
|
|
90
90
|
const fs = await import('fs');
|
|
91
91
|
const yaml = await import('yaml');
|
|
92
92
|
const file = positionalArgs(args)[0];
|
|
@@ -171,7 +171,7 @@ async function serveApply(args, machineId) {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
async function serveRemove(args, machineId) {
|
|
174
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
174
|
+
const { connectAndGetMachine } = await import('./commands-CvWyrVnY.mjs');
|
|
175
175
|
const pos = positionalArgs(args);
|
|
176
176
|
const name = pos[0];
|
|
177
177
|
if (!name) {
|
|
@@ -191,7 +191,7 @@ async function serveRemove(args, machineId) {
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
async function serveList(args, machineId) {
|
|
194
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
194
|
+
const { connectAndGetMachine } = await import('./commands-CvWyrVnY.mjs');
|
|
195
195
|
const all = hasFlag(args, "--all", "-a");
|
|
196
196
|
const json = hasFlag(args, "--json");
|
|
197
197
|
const sessionId = getFlag(args, "--session");
|
|
@@ -224,7 +224,7 @@ async function serveList(args, machineId) {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
async function serveInfo(machineId) {
|
|
227
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
227
|
+
const { connectAndGetMachine } = await import('./commands-CvWyrVnY.mjs');
|
|
228
228
|
const { machine, server } = await connectAndGetMachine(machineId);
|
|
229
229
|
try {
|
|
230
230
|
const info = await machine.serveInfo();
|
|
@@ -3,7 +3,7 @@ import * as fs from 'fs';
|
|
|
3
3
|
import * as http from 'http';
|
|
4
4
|
import * as net from 'net';
|
|
5
5
|
import * as path from 'path';
|
|
6
|
-
import { S as ServeAuth, h as hasCookieToken } from './run-
|
|
6
|
+
import { S as ServeAuth, h as hasCookieToken } from './run-CIPCavEp.mjs';
|
|
7
7
|
import 'os';
|
|
8
8
|
import 'fs/promises';
|
|
9
9
|
import 'url';
|