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
|
@@ -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,
|
|
5
|
+
import { c as connectToHypha, a as registerSessionService, H as generateHookSettings } from './run-C4i9N-F6.mjs';
|
|
6
6
|
import { createServer } from 'node:http';
|
|
7
7
|
import { spawn } from 'node:child_process';
|
|
8
8
|
import { createInterface } from 'node:readline';
|
|
@@ -14,6 +14,7 @@ import 'url';
|
|
|
14
14
|
import 'child_process';
|
|
15
15
|
import 'crypto';
|
|
16
16
|
import 'util';
|
|
17
|
+
import 'node:vm';
|
|
17
18
|
import '@agentclientprotocol/sdk';
|
|
18
19
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
19
20
|
import '@modelcontextprotocol/sdk/client/stdio.js';
|
|
@@ -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-DY1ciMPa.mjs');
|
|
58
58
|
const pos = positionalArgs(args);
|
|
59
59
|
const name = pos[0];
|
|
60
60
|
if (!name) {
|
|
@@ -93,7 +93,7 @@ async function serveAdd(args, machineId) {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
async function serveApply(args, machineId) {
|
|
96
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
96
|
+
const { connectAndGetMachine } = await import('./commands-DY1ciMPa.mjs');
|
|
97
97
|
const fs = await import('fs');
|
|
98
98
|
const yaml = await import('yaml');
|
|
99
99
|
const file = positionalArgs(args)[0];
|
|
@@ -182,7 +182,7 @@ async function serveApply(args, machineId) {
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
async function serveRemove(args, machineId) {
|
|
185
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
185
|
+
const { connectAndGetMachine } = await import('./commands-DY1ciMPa.mjs');
|
|
186
186
|
const pos = positionalArgs(args);
|
|
187
187
|
const name = pos[0];
|
|
188
188
|
if (!name) {
|
|
@@ -202,7 +202,7 @@ async function serveRemove(args, machineId) {
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
async function serveList(args, machineId) {
|
|
205
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
205
|
+
const { connectAndGetMachine } = await import('./commands-DY1ciMPa.mjs');
|
|
206
206
|
const all = hasFlag(args, "--all", "-a");
|
|
207
207
|
const json = hasFlag(args, "--json");
|
|
208
208
|
const sessionId = getFlag(args, "--session");
|
|
@@ -235,7 +235,7 @@ async function serveList(args, machineId) {
|
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
async function serveInfo(machineId) {
|
|
238
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
238
|
+
const { connectAndGetMachine } = await import('./commands-DY1ciMPa.mjs');
|
|
239
239
|
const { machine, server } = await connectAndGetMachine(machineId);
|
|
240
240
|
try {
|
|
241
241
|
const info = await machine.serveInfo();
|
|
@@ -4,7 +4,7 @@ import * as fs from 'fs';
|
|
|
4
4
|
import * as http from 'http';
|
|
5
5
|
import * as net from 'net';
|
|
6
6
|
import * as path from 'path';
|
|
7
|
-
import {
|
|
7
|
+
import { k as getHyphaServerUrl, S as ServeAuth, l as hasCookieToken } from './run-C4i9N-F6.mjs';
|
|
8
8
|
import 'os';
|
|
9
9
|
import 'fs/promises';
|
|
10
10
|
import 'url';
|
|
@@ -13,6 +13,7 @@ import 'util';
|
|
|
13
13
|
import 'node:crypto';
|
|
14
14
|
import 'node:path';
|
|
15
15
|
import 'node:os';
|
|
16
|
+
import 'node:vm';
|
|
16
17
|
import 'node:child_process';
|
|
17
18
|
import '@agentclientprotocol/sdk';
|
|
18
19
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
@@ -712,7 +713,7 @@ class ServeManager {
|
|
|
712
713
|
const mount = this.mounts.get(mountName);
|
|
713
714
|
const subdomainOverride = mount?.access === "link" && mount.linkToken ? /* @__PURE__ */ new Map([[this.port, `static-${subdomainSafe}-${mount.linkToken}`]]) : void 0;
|
|
714
715
|
try {
|
|
715
|
-
const { FrpcTunnel } = await import('./frpc-
|
|
716
|
+
const { FrpcTunnel } = await import('./frpc-BiazjxzU.mjs');
|
|
716
717
|
let tunnel;
|
|
717
718
|
tunnel = new FrpcTunnel({
|
|
718
719
|
name: tunnelName,
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const LAUNCHD_LABEL = "io.hypha.svamp.daemon";
|
|
2
|
+
const SYSTEMD_UNIT = "svamp-daemon.service";
|
|
3
|
+
async function ensureSupervisorViaServiceManager() {
|
|
4
|
+
const os = await import('os');
|
|
5
|
+
const { join } = await import('path');
|
|
6
|
+
const fs = await import('fs');
|
|
7
|
+
const { execSync } = await import('child_process');
|
|
8
|
+
if (process.platform === "darwin") {
|
|
9
|
+
const plistPath = join(os.homedir(), "Library", "LaunchAgents", `${LAUNCHD_LABEL}.plist`);
|
|
10
|
+
if (!fs.existsSync(plistPath)) return false;
|
|
11
|
+
const uid = typeof process.getuid === "function" ? process.getuid() : 0;
|
|
12
|
+
try {
|
|
13
|
+
execSync(`launchctl bootstrap gui/${uid} "${plistPath}" 2>/dev/null`, { stdio: "ignore" });
|
|
14
|
+
} catch {
|
|
15
|
+
}
|
|
16
|
+
try {
|
|
17
|
+
execSync(`launchctl enable gui/${uid}/${LAUNCHD_LABEL} 2>/dev/null`, { stdio: "ignore" });
|
|
18
|
+
} catch {
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
execSync(`launchctl kickstart -k gui/${uid}/${LAUNCHD_LABEL}`, { stdio: "ignore" });
|
|
22
|
+
return true;
|
|
23
|
+
} catch {
|
|
24
|
+
try {
|
|
25
|
+
execSync(`launchctl load "${plistPath}" 2>/dev/null`, { stdio: "ignore" });
|
|
26
|
+
return true;
|
|
27
|
+
} catch {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (process.platform === "linux") {
|
|
33
|
+
const unitPath = join(os.homedir(), ".config", "systemd", "user", SYSTEMD_UNIT);
|
|
34
|
+
if (!fs.existsSync(unitPath)) return false;
|
|
35
|
+
try {
|
|
36
|
+
execSync(`systemctl --user start ${SYSTEMD_UNIT}`, { stdio: "ignore" });
|
|
37
|
+
return true;
|
|
38
|
+
} catch {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
async function stopViaServiceManager() {
|
|
45
|
+
const os = await import('os');
|
|
46
|
+
const { join } = await import('path');
|
|
47
|
+
const fs = await import('fs');
|
|
48
|
+
const { execSync } = await import('child_process');
|
|
49
|
+
if (process.platform === "darwin") {
|
|
50
|
+
const plistPath = join(os.homedir(), "Library", "LaunchAgents", `${LAUNCHD_LABEL}.plist`);
|
|
51
|
+
if (!fs.existsSync(plistPath)) return false;
|
|
52
|
+
const uid = typeof process.getuid === "function" ? process.getuid() : 0;
|
|
53
|
+
try {
|
|
54
|
+
execSync(`launchctl bootout gui/${uid}/${LAUNCHD_LABEL} 2>/dev/null`, { stdio: "ignore" });
|
|
55
|
+
return true;
|
|
56
|
+
} catch {
|
|
57
|
+
try {
|
|
58
|
+
execSync(`launchctl unload "${plistPath}" 2>/dev/null`, { stdio: "ignore" });
|
|
59
|
+
return true;
|
|
60
|
+
} catch {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (process.platform === "linux") {
|
|
66
|
+
const unitPath = join(os.homedir(), ".config", "systemd", "user", SYSTEMD_UNIT);
|
|
67
|
+
if (!fs.existsSync(unitPath)) return false;
|
|
68
|
+
try {
|
|
69
|
+
execSync(`systemctl --user stop ${SYSTEMD_UNIT}`, { stdio: "ignore" });
|
|
70
|
+
return true;
|
|
71
|
+
} catch {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { LAUNCHD_LABEL, SYSTEMD_UNIT, ensureSupervisorViaServiceManager, stopViaServiceManager };
|
package/package.json
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
2
|
+
"name": "svamp-cli",
|
|
3
|
+
"version": "0.2.89",
|
|
4
|
+
"description": "Svamp CLI — AI workspace daemon on Hypha Cloud",
|
|
5
|
+
"author": "Amun AI AB",
|
|
6
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"bin": {
|
|
9
|
+
"svamp": "./bin/svamp.mjs"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"bin"
|
|
14
|
+
],
|
|
15
|
+
"main": "./dist/index.mjs",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": "./dist/index.mjs",
|
|
18
|
+
"./cli": "./dist/cli.mjs"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "rm -rf dist bin/skills && mkdir -p bin/skills && cp -r ../../skills/artifact bin/skills/artifact && tsc --noEmit && pkgroll",
|
|
22
|
+
"typecheck": "tsc --noEmit",
|
|
23
|
+
"test": "npx tsx test/test-context-window.mjs && npx tsx test/test-instance-config.mjs && npx tsx test/test-authorize.mjs && npx tsx test/test-normalize-allowed-user.mjs && npx tsx test/test-share-url.mjs && npx tsx test/test-update-sharing-normalization.mjs && npx tsx test/test-staged-homes-sweep.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-session-send-query.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 && node test/test-supervisor-restart.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 && node test/pinnedClaudeCode.test.mjs && node test/fleet.test.mjs && npx tsx test/test-routine.mjs && npx tsx test/test-routine-rpc.mjs && npx tsx test/test-session-file.mjs && npx tsx test/test-channel-rpc.mjs && npx tsx test/test-wise-agent.mjs && npx tsx test/test-channel-agent.mjs && npx tsx test/test-channels-service.mjs && npx tsx test/test-wise-runjs.mjs && npx tsx test/test-wise-agent-auth.mjs",
|
|
24
|
+
"test:hypha": "node --no-warnings test/test-hypha-service.mjs",
|
|
25
|
+
"dev": "tsx src/cli.ts",
|
|
26
|
+
"dev:daemon": "tsx src/cli.ts daemon start-sync",
|
|
27
|
+
"test:e2e": "node --no-warnings test/e2e-session-tests.mjs",
|
|
28
|
+
"test:frpc": "npx tsx test/test-frpc-e2e.mjs"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@agentclientprotocol/sdk": "^0.14.1",
|
|
32
|
+
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
33
|
+
"hypha-rpc": "0.21.40",
|
|
34
|
+
"node-pty": "1.2.0-beta.11",
|
|
35
|
+
"ws": "^8.18.0",
|
|
36
|
+
"yaml": "^2.8.2",
|
|
37
|
+
"zod": "^3.24.4"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/node": ">=20",
|
|
41
|
+
"@types/ws": "^8.5.14",
|
|
42
|
+
"pkgroll": "^2.14.2",
|
|
43
|
+
"tsx": "^4.20.6",
|
|
44
|
+
"typescript": "5.9.3"
|
|
45
|
+
},
|
|
46
|
+
"packageManager": "yarn@1.22.22"
|
|
47
47
|
}
|