svamp-cli 0.1.31 → 0.1.32
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/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-fEuWMTdD.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -89,7 +89,7 @@ async function main() {
|
|
|
89
89
|
} else if (subcommand === "--help" || subcommand === "-h" || !subcommand) {
|
|
90
90
|
printHelp();
|
|
91
91
|
} else if (subcommand === "--version" || subcommand === "-v") {
|
|
92
|
-
const pkg = await import('./package-
|
|
92
|
+
const pkg = await import('./package-CMmjP_vD.mjs').catch(() => ({ default: { version: "unknown" } }));
|
|
93
93
|
console.log(`svamp version: ${pkg.default.version}`);
|
|
94
94
|
} else {
|
|
95
95
|
console.error(`Unknown command: ${subcommand}`);
|
|
@@ -104,19 +104,19 @@ async function handleAgentCommand() {
|
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
if (agentArgs[0] === "list") {
|
|
107
|
-
const { KNOWN_ACP_AGENTS } = await import('./run-
|
|
108
|
-
console.log("Known
|
|
107
|
+
const { KNOWN_ACP_AGENTS, KNOWN_MCP_AGENTS: KNOWN_MCP_AGENTS2 } = await import('./run-fEuWMTdD.mjs').then(function (n) { return n.f; });
|
|
108
|
+
console.log("Known agents:");
|
|
109
109
|
for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
|
|
110
|
-
console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")}`);
|
|
110
|
+
console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
|
|
111
|
+
}
|
|
112
|
+
for (const [name, config2] of Object.entries(KNOWN_MCP_AGENTS2)) {
|
|
113
|
+
console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (MCP)`);
|
|
111
114
|
}
|
|
112
115
|
console.log('\nUse "svamp agent <name>" to start an interactive session.');
|
|
113
116
|
console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
|
|
114
117
|
return;
|
|
115
118
|
}
|
|
116
|
-
const { resolveAcpAgentConfig } = await import('./run-
|
|
117
|
-
const { AcpBackend } = await import('./run-dBWhjQRf.mjs').then(function (n) { return n.e; });
|
|
118
|
-
const { GeminiTransport } = await import('./run-dBWhjQRf.mjs').then(function (n) { return n.G; });
|
|
119
|
-
const { DefaultTransport } = await import('./run-dBWhjQRf.mjs').then(function (n) { return n.D; });
|
|
119
|
+
const { resolveAcpAgentConfig, KNOWN_MCP_AGENTS } = await import('./run-fEuWMTdD.mjs').then(function (n) { return n.f; });
|
|
120
120
|
let cwd = process.cwd();
|
|
121
121
|
const filteredArgs = [];
|
|
122
122
|
for (let i = 0; i < agentArgs.length; i++) {
|
|
@@ -134,20 +134,28 @@ async function handleAgentCommand() {
|
|
|
134
134
|
console.error(err.message);
|
|
135
135
|
process.exit(1);
|
|
136
136
|
}
|
|
137
|
+
const logFn = (...logArgs) => {
|
|
138
|
+
if (process.env.DEBUG) console.error("[debug]", ...logArgs);
|
|
139
|
+
};
|
|
137
140
|
console.log(`Starting ${config.agentName} agent in ${cwd}...`);
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
cwd,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
141
|
+
let backend;
|
|
142
|
+
if (KNOWN_MCP_AGENTS[config.agentName]) {
|
|
143
|
+
const { CodexMcpBackend } = await import('./run-fEuWMTdD.mjs').then(function (n) { return n.h; });
|
|
144
|
+
backend = new CodexMcpBackend({ cwd, log: logFn });
|
|
145
|
+
} else {
|
|
146
|
+
const { AcpBackend } = await import('./run-fEuWMTdD.mjs').then(function (n) { return n.e; });
|
|
147
|
+
const { GeminiTransport } = await import('./run-fEuWMTdD.mjs').then(function (n) { return n.G; });
|
|
148
|
+
const { DefaultTransport } = await import('./run-fEuWMTdD.mjs').then(function (n) { return n.D; });
|
|
149
|
+
const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
|
|
150
|
+
backend = new AcpBackend({
|
|
151
|
+
agentName: config.agentName,
|
|
152
|
+
cwd,
|
|
153
|
+
command: config.command,
|
|
154
|
+
args: config.args,
|
|
155
|
+
transportHandler,
|
|
156
|
+
log: logFn
|
|
157
|
+
});
|
|
158
|
+
}
|
|
151
159
|
let currentText = "";
|
|
152
160
|
backend.onMessage((msg) => {
|
|
153
161
|
switch (msg.type) {
|
|
@@ -255,7 +263,7 @@ async function handleSessionCommand() {
|
|
|
255
263
|
printSessionHelp();
|
|
256
264
|
return;
|
|
257
265
|
}
|
|
258
|
-
const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait } = await import('./commands-
|
|
266
|
+
const { sessionList, sessionSpawn, sessionStop, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait } = await import('./commands-EjpBlIl0.mjs');
|
|
259
267
|
const parseFlagStr = (flag, shortFlag) => {
|
|
260
268
|
for (let i = 1; i < sessionArgs.length; i++) {
|
|
261
269
|
if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
|
|
@@ -660,8 +668,8 @@ Usage:
|
|
|
660
668
|
svamp session spawn Spawn a new session on the daemon
|
|
661
669
|
svamp session attach <id> Attach to a session (interactive)
|
|
662
670
|
svamp session --help Show all session commands
|
|
663
|
-
svamp agent list List known
|
|
664
|
-
svamp agent <name> Start local
|
|
671
|
+
svamp agent list List known agents
|
|
672
|
+
svamp agent <name> Start local agent session (gemini, codex)
|
|
665
673
|
svamp agent -- <cmd> Start custom ACP agent
|
|
666
674
|
svamp --version Show version
|
|
667
675
|
svamp --help Show this help
|
|
@@ -689,7 +697,7 @@ Usage:
|
|
|
689
697
|
}
|
|
690
698
|
function printSessionHelp() {
|
|
691
699
|
console.log(`
|
|
692
|
-
svamp session \u2014 Manage daemon sessions (Claude, Gemini,
|
|
700
|
+
svamp session \u2014 Manage daemon sessions (Claude, Gemini, Codex)
|
|
693
701
|
|
|
694
702
|
Usage:
|
|
695
703
|
svamp session list [--active] [--json] List sessions (alias: ls)
|
|
@@ -708,7 +716,7 @@ Usage:
|
|
|
708
716
|
Options:
|
|
709
717
|
--machine <id>, -m <id> Target a specific machine (prefix match supported)
|
|
710
718
|
|
|
711
|
-
Agents: claude (default), gemini,
|
|
719
|
+
Agents: claude (default), gemini, codex
|
|
712
720
|
|
|
713
721
|
Session and machine IDs can be abbreviated (prefix match, like Docker).
|
|
714
722
|
|
|
@@ -730,20 +738,20 @@ Examples:
|
|
|
730
738
|
}
|
|
731
739
|
function printAgentHelp() {
|
|
732
740
|
console.log(`
|
|
733
|
-
svamp agent \u2014 Interactive
|
|
741
|
+
svamp agent \u2014 Interactive agent sessions (local, no daemon required)
|
|
734
742
|
|
|
735
743
|
Usage:
|
|
736
|
-
svamp agent list List known
|
|
744
|
+
svamp agent list List known agents
|
|
737
745
|
svamp agent <name> [-d <path>] Start interactive agent session
|
|
738
746
|
svamp agent -- <cmd> [args] Start custom ACP agent
|
|
739
747
|
|
|
740
748
|
Examples:
|
|
741
749
|
svamp agent gemini Start Gemini agent in current directory
|
|
742
750
|
svamp agent gemini -d /tmp/proj Start Gemini agent in /tmp/proj
|
|
743
|
-
svamp agent
|
|
751
|
+
svamp agent codex Start Codex agent
|
|
744
752
|
svamp agent -- mycli --acp Start custom ACP-compatible agent
|
|
745
753
|
|
|
746
|
-
Known agents: gemini,
|
|
754
|
+
Known agents: gemini (ACP), codex (MCP)
|
|
747
755
|
`);
|
|
748
756
|
}
|
|
749
757
|
main().catch((err) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import os from 'node:os';
|
|
4
|
-
import { c as connectToHypha } from './run-
|
|
4
|
+
import { c as connectToHypha } from './run-fEuWMTdD.mjs';
|
|
5
5
|
import 'os';
|
|
6
6
|
import 'fs/promises';
|
|
7
7
|
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-fEuWMTdD.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -2172,8 +2172,7 @@ var acpBackend = /*#__PURE__*/Object.freeze({
|
|
|
2172
2172
|
});
|
|
2173
2173
|
|
|
2174
2174
|
const KNOWN_ACP_AGENTS = {
|
|
2175
|
-
gemini: { command: "gemini", args: ["--experimental-acp"] }
|
|
2176
|
-
opencode: { command: "opencode", args: ["acp"] }
|
|
2175
|
+
gemini: { command: "gemini", args: ["--experimental-acp"] }
|
|
2177
2176
|
};
|
|
2178
2177
|
const KNOWN_MCP_AGENTS = {
|
|
2179
2178
|
codex: { command: "codex", args: ["mcp-server"] }
|
|
@@ -2196,7 +2195,7 @@ function resolveAcpAgentConfig(cliArgs) {
|
|
|
2196
2195
|
const agentName = cliArgs[0];
|
|
2197
2196
|
const knownAcp = KNOWN_ACP_AGENTS[agentName];
|
|
2198
2197
|
if (knownAcp) {
|
|
2199
|
-
const passthroughArgs = cliArgs.slice(1).filter(
|
|
2198
|
+
const passthroughArgs = cliArgs.slice(1).filter(Boolean);
|
|
2200
2199
|
return {
|
|
2201
2200
|
agentName,
|
|
2202
2201
|
command: knownAcp.command,
|
|
@@ -2818,6 +2817,11 @@ class CodexMcpBackend {
|
|
|
2818
2817
|
}
|
|
2819
2818
|
}
|
|
2820
2819
|
|
|
2820
|
+
var codexMcpBackend = /*#__PURE__*/Object.freeze({
|
|
2821
|
+
__proto__: null,
|
|
2822
|
+
CodexMcpBackend: CodexMcpBackend
|
|
2823
|
+
});
|
|
2824
|
+
|
|
2821
2825
|
const GEMINI_TIMEOUTS = {
|
|
2822
2826
|
init: 12e4,
|
|
2823
2827
|
toolCall: 12e4,
|
|
@@ -4974,4 +4978,4 @@ function daemonStatus() {
|
|
|
4974
4978
|
}
|
|
4975
4979
|
}
|
|
4976
4980
|
|
|
4977
|
-
export { DefaultTransport$1 as D, GeminiTransport$1 as G, registerSessionService as a, stopDaemon as b, connectToHypha as c, daemonStatus as d, acpBackend as e, acpAgentConfig as f, getHyphaServerUrl as g, registerMachineService as r, startDaemon as s };
|
|
4981
|
+
export { DefaultTransport$1 as D, GeminiTransport$1 as G, registerSessionService as a, stopDaemon as b, connectToHypha as c, daemonStatus as d, acpBackend as e, acpAgentConfig as f, getHyphaServerUrl as g, codexMcpBackend as h, registerMachineService as r, startDaemon as s };
|