svamp-cli 0.1.96 → 0.1.98
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-CJNxmnV5.mjs → agentCommands-DEy_oHlG.mjs} +2 -2
- package/dist/cli.mjs +27 -27
- package/dist/{commands-D1hYL4Vi.mjs → commands-C3AufFSh.mjs} +2 -2
- package/dist/{commands-CFQRfeSs.mjs → commands-ZIQq18u9.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{package-YOLex1RV.mjs → package-DcV9wNjG.mjs} +1 -1
- package/dist/{run-jvUqdZAp.mjs → run-B42dhjUk.mjs} +1 -1
- package/dist/{run-DxZEyfKG.mjs → run-CJn8b3Kr.mjs} +7 -2
- package/package.json +1 -1
|
@@ -148,7 +148,7 @@ async function sessionBroadcast(action, args) {
|
|
|
148
148
|
console.log(`Broadcast sent: ${action}`);
|
|
149
149
|
}
|
|
150
150
|
async function connectToMachineService() {
|
|
151
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
151
|
+
const { connectAndGetMachine } = await import('./commands-ZIQq18u9.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-ZIQq18u9.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 { b as stopDaemon, s as startDaemon, d as daemonStatus } from './run-
|
|
1
|
+
import { b as stopDaemon, s as startDaemon, d as daemonStatus } from './run-CJn8b3Kr.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -231,7 +231,7 @@ async function main() {
|
|
|
231
231
|
console.error("svamp process: Process commands are not available in sandboxed sessions.");
|
|
232
232
|
process.exit(1);
|
|
233
233
|
}
|
|
234
|
-
const { processCommand } = await import('./commands-
|
|
234
|
+
const { processCommand } = await import('./commands-C3AufFSh.mjs');
|
|
235
235
|
let machineId;
|
|
236
236
|
const processArgs = args.slice(1);
|
|
237
237
|
const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
|
|
@@ -249,7 +249,7 @@ async function main() {
|
|
|
249
249
|
} else if (!subcommand || subcommand === "start") {
|
|
250
250
|
await handleInteractiveCommand();
|
|
251
251
|
} else if (subcommand === "--version" || subcommand === "-v") {
|
|
252
|
-
const pkg = await import('./package-
|
|
252
|
+
const pkg = await import('./package-DcV9wNjG.mjs').catch(() => ({ default: { version: "unknown" } }));
|
|
253
253
|
console.log(`svamp version: ${pkg.default.version}`);
|
|
254
254
|
} else {
|
|
255
255
|
console.error(`Unknown command: ${subcommand}`);
|
|
@@ -258,7 +258,7 @@ async function main() {
|
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
async function handleInteractiveCommand() {
|
|
261
|
-
const { runInteractive } = await import('./run-
|
|
261
|
+
const { runInteractive } = await import('./run-B42dhjUk.mjs');
|
|
262
262
|
const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
|
|
263
263
|
let directory = process.cwd();
|
|
264
264
|
let resumeSessionId;
|
|
@@ -303,7 +303,7 @@ async function handleAgentCommand() {
|
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
305
|
if (agentArgs[0] === "list") {
|
|
306
|
-
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-
|
|
306
|
+
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-CJn8b3Kr.mjs').then(function (n) { return n.i; });
|
|
307
307
|
console.log("Known agents:");
|
|
308
308
|
for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
|
|
309
309
|
console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
|
|
@@ -315,7 +315,7 @@ async function handleAgentCommand() {
|
|
|
315
315
|
console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
|
-
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-
|
|
318
|
+
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-CJn8b3Kr.mjs').then(function (n) { return n.i; });
|
|
319
319
|
let cwd = process.cwd();
|
|
320
320
|
const filteredArgs = [];
|
|
321
321
|
for (let i = 0; i < agentArgs.length; i++) {
|
|
@@ -339,12 +339,12 @@ async function handleAgentCommand() {
|
|
|
339
339
|
console.log(`Starting ${config.agentName} agent in ${cwd}...`);
|
|
340
340
|
let backend;
|
|
341
341
|
if (KNOWN_MCP_AGENTS[config.agentName]) {
|
|
342
|
-
const { CodexMcpBackend } = await import('./run-
|
|
342
|
+
const { CodexMcpBackend } = await import('./run-CJn8b3Kr.mjs').then(function (n) { return n.j; });
|
|
343
343
|
backend = new CodexMcpBackend({ cwd, log: logFn });
|
|
344
344
|
} else {
|
|
345
|
-
const { AcpBackend } = await import('./run-
|
|
346
|
-
const { GeminiTransport } = await import('./run-
|
|
347
|
-
const { DefaultTransport } = await import('./run-
|
|
345
|
+
const { AcpBackend } = await import('./run-CJn8b3Kr.mjs').then(function (n) { return n.h; });
|
|
346
|
+
const { GeminiTransport } = await import('./run-CJn8b3Kr.mjs').then(function (n) { return n.G; });
|
|
347
|
+
const { DefaultTransport } = await import('./run-CJn8b3Kr.mjs').then(function (n) { return n.D; });
|
|
348
348
|
const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
|
|
349
349
|
backend = new AcpBackend({
|
|
350
350
|
agentName: config.agentName,
|
|
@@ -471,7 +471,7 @@ async function handleSessionCommand() {
|
|
|
471
471
|
process.exit(1);
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-
|
|
474
|
+
const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionRalphStart, sessionRalphCancel, sessionRalphStatus, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-ZIQq18u9.mjs');
|
|
475
475
|
const parseFlagStr = (flag, shortFlag) => {
|
|
476
476
|
for (let i = 1; i < sessionArgs.length; i++) {
|
|
477
477
|
if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
|
|
@@ -531,7 +531,7 @@ async function handleSessionCommand() {
|
|
|
531
531
|
allowDomain.push(sessionArgs[++i]);
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
const { parseShareArg } = await import('./commands-
|
|
534
|
+
const { parseShareArg } = await import('./commands-ZIQq18u9.mjs');
|
|
535
535
|
const shareEntries = share.map((s) => parseShareArg(s));
|
|
536
536
|
await sessionSpawn(agent, dir, targetMachineId, {
|
|
537
537
|
message,
|
|
@@ -617,7 +617,7 @@ async function handleSessionCommand() {
|
|
|
617
617
|
console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
|
|
618
618
|
process.exit(1);
|
|
619
619
|
}
|
|
620
|
-
const { sessionApprove } = await import('./commands-
|
|
620
|
+
const { sessionApprove } = await import('./commands-ZIQq18u9.mjs');
|
|
621
621
|
const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
622
622
|
await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
|
|
623
623
|
json: hasFlag("--json")
|
|
@@ -627,7 +627,7 @@ async function handleSessionCommand() {
|
|
|
627
627
|
console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
|
|
628
628
|
process.exit(1);
|
|
629
629
|
}
|
|
630
|
-
const { sessionDeny } = await import('./commands-
|
|
630
|
+
const { sessionDeny } = await import('./commands-ZIQq18u9.mjs');
|
|
631
631
|
const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
632
632
|
await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
|
|
633
633
|
json: hasFlag("--json")
|
|
@@ -663,7 +663,7 @@ async function handleSessionCommand() {
|
|
|
663
663
|
console.error("Usage: svamp session set-title <title>");
|
|
664
664
|
process.exit(1);
|
|
665
665
|
}
|
|
666
|
-
const { sessionSetTitle } = await import('./agentCommands-
|
|
666
|
+
const { sessionSetTitle } = await import('./agentCommands-DEy_oHlG.mjs');
|
|
667
667
|
await sessionSetTitle(title);
|
|
668
668
|
} else if (sessionSubcommand === "set-link") {
|
|
669
669
|
const url = sessionArgs[1];
|
|
@@ -672,7 +672,7 @@ async function handleSessionCommand() {
|
|
|
672
672
|
process.exit(1);
|
|
673
673
|
}
|
|
674
674
|
const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
675
|
-
const { sessionSetLink } = await import('./agentCommands-
|
|
675
|
+
const { sessionSetLink } = await import('./agentCommands-DEy_oHlG.mjs');
|
|
676
676
|
await sessionSetLink(url, label);
|
|
677
677
|
} else if (sessionSubcommand === "notify") {
|
|
678
678
|
const message = sessionArgs[1];
|
|
@@ -681,7 +681,7 @@ async function handleSessionCommand() {
|
|
|
681
681
|
process.exit(1);
|
|
682
682
|
}
|
|
683
683
|
const level = parseFlagStr("--level") || "info";
|
|
684
|
-
const { sessionNotify } = await import('./agentCommands-
|
|
684
|
+
const { sessionNotify } = await import('./agentCommands-DEy_oHlG.mjs');
|
|
685
685
|
await sessionNotify(message, level);
|
|
686
686
|
} else if (sessionSubcommand === "broadcast") {
|
|
687
687
|
const action = sessionArgs[1];
|
|
@@ -689,7 +689,7 @@ async function handleSessionCommand() {
|
|
|
689
689
|
console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
|
|
690
690
|
process.exit(1);
|
|
691
691
|
}
|
|
692
|
-
const { sessionBroadcast } = await import('./agentCommands-
|
|
692
|
+
const { sessionBroadcast } = await import('./agentCommands-DEy_oHlG.mjs');
|
|
693
693
|
await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
|
|
694
694
|
} else if (sessionSubcommand === "inbox") {
|
|
695
695
|
const inboxSubcmd = sessionArgs[1];
|
|
@@ -700,7 +700,7 @@ async function handleSessionCommand() {
|
|
|
700
700
|
process.exit(1);
|
|
701
701
|
}
|
|
702
702
|
if (agentSessionId) {
|
|
703
|
-
const { inboxSend } = await import('./agentCommands-
|
|
703
|
+
const { inboxSend } = await import('./agentCommands-DEy_oHlG.mjs');
|
|
704
704
|
await inboxSend(sessionArgs[2], {
|
|
705
705
|
body: sessionArgs[3],
|
|
706
706
|
subject: parseFlagStr("--subject"),
|
|
@@ -715,7 +715,7 @@ async function handleSessionCommand() {
|
|
|
715
715
|
}
|
|
716
716
|
} else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
|
|
717
717
|
if (agentSessionId && !sessionArgs[2]) {
|
|
718
|
-
const { inboxList } = await import('./agentCommands-
|
|
718
|
+
const { inboxList } = await import('./agentCommands-DEy_oHlG.mjs');
|
|
719
719
|
await inboxList({
|
|
720
720
|
unread: hasFlag("--unread"),
|
|
721
721
|
limit: parseFlagInt("--limit"),
|
|
@@ -737,7 +737,7 @@ async function handleSessionCommand() {
|
|
|
737
737
|
process.exit(1);
|
|
738
738
|
}
|
|
739
739
|
if (agentSessionId && !sessionArgs[3]) {
|
|
740
|
-
const { inboxList } = await import('./agentCommands-
|
|
740
|
+
const { inboxList } = await import('./agentCommands-DEy_oHlG.mjs');
|
|
741
741
|
await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
|
|
742
742
|
} else if (sessionArgs[3]) {
|
|
743
743
|
await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
|
|
@@ -747,7 +747,7 @@ async function handleSessionCommand() {
|
|
|
747
747
|
}
|
|
748
748
|
} else if (inboxSubcmd === "reply") {
|
|
749
749
|
if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
|
|
750
|
-
const { inboxReply } = await import('./agentCommands-
|
|
750
|
+
const { inboxReply } = await import('./agentCommands-DEy_oHlG.mjs');
|
|
751
751
|
await inboxReply(sessionArgs[2], sessionArgs[3]);
|
|
752
752
|
} else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
|
|
753
753
|
await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
|
|
@@ -783,7 +783,7 @@ async function handleMachineCommand() {
|
|
|
783
783
|
return;
|
|
784
784
|
}
|
|
785
785
|
if (machineSubcommand === "share") {
|
|
786
|
-
const { machineShare } = await import('./commands-
|
|
786
|
+
const { machineShare } = await import('./commands-ZIQq18u9.mjs');
|
|
787
787
|
let machineId;
|
|
788
788
|
const shareArgs = [];
|
|
789
789
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
@@ -813,7 +813,7 @@ async function handleMachineCommand() {
|
|
|
813
813
|
}
|
|
814
814
|
await machineShare(machineId, { add, remove, list, configPath, showConfig });
|
|
815
815
|
} else if (machineSubcommand === "exec") {
|
|
816
|
-
const { machineExec } = await import('./commands-
|
|
816
|
+
const { machineExec } = await import('./commands-ZIQq18u9.mjs');
|
|
817
817
|
let machineId;
|
|
818
818
|
let cwd;
|
|
819
819
|
const cmdParts = [];
|
|
@@ -833,7 +833,7 @@ async function handleMachineCommand() {
|
|
|
833
833
|
}
|
|
834
834
|
await machineExec(machineId, command, cwd);
|
|
835
835
|
} else if (machineSubcommand === "info") {
|
|
836
|
-
const { machineInfo } = await import('./commands-
|
|
836
|
+
const { machineInfo } = await import('./commands-ZIQq18u9.mjs');
|
|
837
837
|
let machineId;
|
|
838
838
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
839
839
|
if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
|
|
@@ -853,10 +853,10 @@ async function handleMachineCommand() {
|
|
|
853
853
|
level = machineArgs[++i];
|
|
854
854
|
}
|
|
855
855
|
}
|
|
856
|
-
const { machineNotify } = await import('./agentCommands-
|
|
856
|
+
const { machineNotify } = await import('./agentCommands-DEy_oHlG.mjs');
|
|
857
857
|
await machineNotify(message, level);
|
|
858
858
|
} else if (machineSubcommand === "ls") {
|
|
859
|
-
const { machineLs } = await import('./commands-
|
|
859
|
+
const { machineLs } = await import('./commands-ZIQq18u9.mjs');
|
|
860
860
|
let machineId;
|
|
861
861
|
let showHidden = false;
|
|
862
862
|
let path;
|
|
@@ -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-ZIQq18u9.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-CJn8b3Kr.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 { 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-CJn8b3Kr.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
8
8
|
import 'fs';
|
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-CJn8b3Kr.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -2,7 +2,7 @@ import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(im
|
|
|
2
2
|
import os from 'node:os';
|
|
3
3
|
import { 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-CJn8b3Kr.mjs';
|
|
6
6
|
import { createServer } from 'node:http';
|
|
7
7
|
import { spawn } from 'node:child_process';
|
|
8
8
|
import { createInterface } from 'node:readline';
|
|
@@ -378,7 +378,9 @@ async function registerMachineService(server, machineId, metadata, daemonState,
|
|
|
378
378
|
id: "default",
|
|
379
379
|
name: `Svamp Machine (${metadata.displayName || machineId})`,
|
|
380
380
|
type: "svamp-machine",
|
|
381
|
-
|
|
381
|
+
// 'public' so cross-workspace getService works for sharing.
|
|
382
|
+
// All methods enforce access via authorizeRequest(context, sharing, role).
|
|
383
|
+
config: { visibility: "public", require_context: true },
|
|
382
384
|
// Machine info
|
|
383
385
|
getMachineInfo: async (context) => {
|
|
384
386
|
let hasMachineAccess = false;
|
|
@@ -5856,7 +5858,10 @@ async function startDaemon(options) {
|
|
|
5856
5858
|
token: hyphaToken,
|
|
5857
5859
|
name: `svamp-machine-${machineId}`,
|
|
5858
5860
|
transport: "http",
|
|
5859
|
-
|
|
5861
|
+
// Use HYPHA_CLIENT_ID if set (server-apps integration), otherwise use machineId.
|
|
5862
|
+
// Using machineId gives a STABLE client_id across reconnections, so the service ID
|
|
5863
|
+
// (workspace/clientId:default) is predictable and can be stored in share bookmarks.
|
|
5864
|
+
clientId: hyphaClientId || machineId
|
|
5860
5865
|
});
|
|
5861
5866
|
logger.log(`Connected to Hypha (workspace: ${server.config.workspace})`);
|
|
5862
5867
|
server.on("disconnected", (reason) => {
|