svamp-cli 0.2.87 → 0.2.89
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-CPV2AS4T.mjs → agentCommands-7zzJYIzN.mjs} +2 -2
- package/dist/auth-BRm_dfqc.mjs +73 -0
- package/dist/cli.mjs +197 -81
- package/dist/{commands-CtCjHkST.mjs → commands-25hlQVK5.mjs} +5 -5
- package/dist/{commands-CXEpyNro.mjs → commands-BIsNPVCT.mjs} +2 -1
- package/dist/{commands-Dc5kN_0c.mjs → commands-CA-A0G2y.mjs} +2 -1
- package/dist/{commands-BPR-KpZM.mjs → commands-CVPCcCqU.mjs} +3 -2
- package/dist/{commands-Dbm3UrJS.mjs → commands-DY1ciMPa.mjs} +159 -8
- package/dist/{fleet-CEM8CAZN.mjs → fleet-B_HW0j1E.mjs} +2 -1
- package/dist/{frpc-CJJTmC9m.mjs → frpc-BiazjxzU.mjs} +2 -1
- package/dist/index.mjs +2 -1
- package/dist/{package-BiX-a9rI.mjs → package-jHkQchZL.mjs} +2 -2
- package/dist/{run-BV4hWpyA.mjs → run-C4i9N-F6.mjs} +914 -43
- package/dist/{run-3ndxhd-X.mjs → run-DLtX5Yom.mjs} +2 -1
- package/dist/{serveCommands-ClcajS1I.mjs → serveCommands-B2brwRfz.mjs} +5 -5
- package/dist/{serveManager-tAOF25rN.mjs → serveManager-DHJy5C0z.mjs} +3 -2
- package/dist/serviceManager-hlOVxkhW.mjs +78 -0
- package/package.json +45 -45
|
@@ -148,7 +148,7 @@ async function sessionBroadcast(action, args) {
|
|
|
148
148
|
console.log(`Broadcast sent: ${action}`);
|
|
149
149
|
}
|
|
150
150
|
async function connectToMachineService() {
|
|
151
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
151
|
+
const { connectAndGetMachine } = await import('./commands-DY1ciMPa.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-DY1ciMPa.mjs');
|
|
169
169
|
const sessions = await machine.listSessions();
|
|
170
170
|
const match = resolveSessionId(sessions, targetSessionId);
|
|
171
171
|
const fullTargetId = match.sessionId;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z as resolveModel } from './run-C4i9N-F6.mjs';
|
|
2
|
+
import 'os';
|
|
3
|
+
import 'fs/promises';
|
|
4
|
+
import 'fs';
|
|
5
|
+
import 'path';
|
|
6
|
+
import 'url';
|
|
7
|
+
import 'child_process';
|
|
8
|
+
import 'crypto';
|
|
9
|
+
import 'node:fs';
|
|
10
|
+
import 'util';
|
|
11
|
+
import 'node:crypto';
|
|
12
|
+
import 'node:path';
|
|
13
|
+
import 'node:os';
|
|
14
|
+
import 'node:vm';
|
|
15
|
+
import 'node:child_process';
|
|
16
|
+
import '@agentclientprotocol/sdk';
|
|
17
|
+
import '@modelcontextprotocol/sdk/client/index.js';
|
|
18
|
+
import '@modelcontextprotocol/sdk/client/stdio.js';
|
|
19
|
+
import '@modelcontextprotocol/sdk/types.js';
|
|
20
|
+
import 'zod';
|
|
21
|
+
import 'node:fs/promises';
|
|
22
|
+
import 'node:util';
|
|
23
|
+
|
|
24
|
+
function buildWiseAgentEnvUpdates(action) {
|
|
25
|
+
switch (action.kind) {
|
|
26
|
+
case "use-openai":
|
|
27
|
+
return { WISE_AGENT_PROVIDER: "openai", ...action.key ? { WISE_AGENT_API_KEY: action.key } : {} };
|
|
28
|
+
case "use-hypha-proxy":
|
|
29
|
+
return { WISE_AGENT_PROVIDER: "hypha-proxy", ...action.url ? { SVAMP_HYPHA_PROXY_URL: action.url } : {} };
|
|
30
|
+
case "use-claude-haiku":
|
|
31
|
+
return { WISE_AGENT_PROVIDER: "claude-haiku", WISE_AGENT_MODEL: void 0, ...action.url ? { SVAMP_HYPHA_PROXY_URL: action.url } : {} };
|
|
32
|
+
case "set-model":
|
|
33
|
+
return { WISE_AGENT_MODEL: action.model };
|
|
34
|
+
case "set-base-url":
|
|
35
|
+
return { WISE_AGENT_BASE_URL: action.url };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function redactKey(key) {
|
|
39
|
+
if (!key) return "(none)";
|
|
40
|
+
if (key.length <= 12) return "***";
|
|
41
|
+
return `${key.slice(0, 8)}\u2026${key.slice(-4)}`;
|
|
42
|
+
}
|
|
43
|
+
function describeWiseAgentAuth(env) {
|
|
44
|
+
const r = resolveModel(void 0, env);
|
|
45
|
+
return {
|
|
46
|
+
provider: r.provider,
|
|
47
|
+
model: r.model,
|
|
48
|
+
baseUrl: r.baseUrl || "(unset)",
|
|
49
|
+
keyRedacted: redactKey(r.apiKey)
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function parseWiseAgentAuthArgs(args) {
|
|
53
|
+
const [sub, ...rest] = args;
|
|
54
|
+
if (!sub || sub === "status") return null;
|
|
55
|
+
switch (sub) {
|
|
56
|
+
case "use-openai":
|
|
57
|
+
return { kind: "use-openai", key: rest[0] };
|
|
58
|
+
case "use-hypha-proxy":
|
|
59
|
+
return { kind: "use-hypha-proxy", url: rest[0] };
|
|
60
|
+
case "use-claude-haiku":
|
|
61
|
+
return { kind: "use-claude-haiku", url: rest[0] };
|
|
62
|
+
case "set-model":
|
|
63
|
+
if (!rest[0]) throw new Error("Usage: svamp wise-agent auth set-model <model>");
|
|
64
|
+
return { kind: "set-model", model: rest[0] };
|
|
65
|
+
case "set-base-url":
|
|
66
|
+
if (!rest[0]) throw new Error("Usage: svamp wise-agent auth set-base-url <url>");
|
|
67
|
+
return { kind: "set-base-url", url: rest[0] };
|
|
68
|
+
default:
|
|
69
|
+
throw new Error(`Unknown wise-agent auth command "${sub}". Try: status | use-openai [KEY] | use-hypha-proxy [URL] | use-claude-haiku [URL] | set-model <m> | set-base-url <url>`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { buildWiseAgentEnvUpdates, describeWiseAgentAuth, parseWiseAgentAuthArgs, redactKey };
|