svamp-cli 0.2.300 → 0.2.301
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/{adminCommands-lOuwAyXW.mjs → adminCommands-DMiliv55.mjs} +1 -1
- package/dist/{agentCommands-C56-TSwf.mjs → agentCommands-BCkWdFFW.mjs} +5 -5
- package/dist/{auth-y5EinW_c.mjs → auth-Ba1_zl1h.mjs} +1 -1
- package/dist/{cli-BbbzgMWX.mjs → cli-Bv0Zhf3M.mjs} +69 -69
- package/dist/cli.mjs +2 -2
- package/dist/{commands-Db1SMhcL.mjs → commands-B2mRza8S.mjs} +2 -2
- package/dist/{commands-Qz7oTXdj.mjs → commands-BA3eBROn.mjs} +1 -1
- package/dist/{commands-Cb00JySn.mjs → commands-BAlaK67Y.mjs} +1 -1
- package/dist/{commands-VtqFEtFc.mjs → commands-BC3RuhRx.mjs} +2 -2
- package/dist/commands-BnirT9RR.mjs +161 -0
- package/dist/{commands-BlVHxX-n.mjs → commands-DhB2iz0_.mjs} +7 -7
- package/dist/{commands-Bjbq2pJg.mjs → commands-bIioWHWe.mjs} +2 -2
- package/dist/{commands-BLFj8bE8.mjs → commands-hHZu5qJh.mjs} +1 -1
- package/dist/{fleet-DKAN08u-.mjs → fleet-BFurNsSA.mjs} +1 -1
- package/dist/{frpc-Bx0J5hIR.mjs → frpc-Cb6jUvED.mjs} +1 -1
- package/dist/{headlessCli-DaqkPy9x.mjs → headlessCli-DP9gpAxv.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{notifyCommands-DaAd67p4.mjs → notifyCommands-C0i6P1yC.mjs} +1 -1
- package/dist/package-D8lHDQja.mjs +64 -0
- package/dist/{rpc-C2l4b6gk.mjs → rpc-B-bxS-Pv.mjs} +1 -1
- package/dist/{rpc-D1Vg26a1.mjs → rpc-CNkfUlz1.mjs} +1 -1
- package/dist/{run-DrG6nwGm.mjs → run-C0GhrtVf.mjs} +347 -58
- package/dist/{run-CVRu9pzU.mjs → run-CvT_37Ov.mjs} +1 -1
- package/dist/{scheduler-CGmlf3VQ.mjs → scheduler-DT1_BBdZ.mjs} +1 -1
- package/dist/{serveCommands-CiYytaPO.mjs → serveCommands-CUabu97u.mjs} +5 -5
- package/dist/{sideband-BQz9FNc9.mjs → sideband-BlZBmbji.mjs} +1 -1
- package/package.json +2 -2
- package/dist/commands-Beysszfu.mjs +0 -293
- package/dist/package-B5_N_B9C.mjs +0 -64
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svamp-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.301",
|
|
4
4
|
"description": "Svamp CLI — AI workspace daemon on Hypha Cloud",
|
|
5
5
|
"author": "Amun AI AB",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build": "rm -rf dist bin/skills bin/commands && mkdir -p bin/skills && cp -r ../../skills/artifact bin/skills/artifact && cp -r ../../skills/crew bin/skills/crew && cp -r ../../commands bin/commands && tsc --noEmit && pkgroll",
|
|
22
22
|
"typecheck": "tsc --noEmit",
|
|
23
|
-
"test": "npx tsx test/test-context-window.mjs && npx tsx test/test-ratelimit-retry.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-sharing-notify-sync.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-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-backend-accounts.mjs && npx tsx test/test-codex-force-model.mjs && npx tsx test/test-backend-oauth.mjs && npx tsx test/test-btw-proxy-env.mjs && npx tsx test/test-output-formatters.mjs && npx tsx test/test-inbox-guard.mjs && npx tsx test/test-user-events.mjs && npx tsx test/test-migrate-children.mjs && npx tsx test/test-outpost-install.mjs && npx tsx test/test-outpost-setup.mjs && npx tsx test/test-outpost-pairing.mjs && npx tsx test/test-inbox-reconcile.mjs && npx tsx test/test-auto-topic.mjs && npx tsx test/test-project-info.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-isolation-disable.mjs && npx tsx test/test-machine-service-logic.mjs && npx tsx test/test-session-access-fallback.mjs && npx tsx test/test-interactive-helpers.mjs && npx tsx test/test-codex-app-server.mjs && npx tsx test/test-acp-backend.mjs && npx tsx test/test-acp-bridge.mjs && npx tsx test/test-listener-backoff.mjs && npx tsx test/test-session-identity-env.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-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-compact-detect.mjs && npx tsx test/test-session-consolidation.mjs && npx tsx test/test-inbox-store.mjs && npx tsx test/test-inbox.mjs && npx tsx test/test-inbox-cross-machine.mjs && npx tsx test/test-issue-store.mjs && npx tsx test/test-issue-close-gate.mjs && npx tsx test/test-loop-verify.mjs && npx tsx test/test-restore-decision.mjs && npx tsx test/test-issue-rpc.mjs && npx tsx test/test-issue-pause.mjs && npx tsx test/test-workflow-store.mjs && npx tsx test/test-workflow-rpc.mjs && npx tsx test/test-workflow-scheduler.mjs && npx tsx test/test-cron.mjs && npx tsx test/test-workflow-runs.mjs && npx tsx test/test-workflow-idle.mjs && npx tsx test/test-serve-link-subdomain.mjs && npx tsx test/test-short-id.mjs && npx tsx test/test-transcript-edit.mjs && npx tsx test/test-edit-history.mjs && npx tsx test/test-friendly-name.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-ws-upgrade.mjs && npx tsx test/test-serve-auth.mjs && npx tsx test/test-static-file-server.mjs && npx tsx test/test-serve-stability.mjs && npx tsx test/test-frpc-e2e.mjs --unit-only && npx tsx test/test-frpc-status.mjs && node test/pinnedClaudeCode.test.mjs && node test/fleet.test.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-hotreload-seam.mjs && npx tsx test/test-hot-reload.mjs && npx tsx test/test-hot-reload-live.mjs && npx tsx test/test-session-core.mjs && npx tsx test/test-channel-async-reply.mjs && npx tsx test/test-outbox-reload.mjs && npx tsx test/test-channel-binding.mjs && npx tsx test/test-channel-identity.mjs && npx tsx test/test-stateless-dispatch-limiter.mjs && npx tsx test/test-shared-session-identity.mjs && npx tsx test/test-wise-agent-auth.mjs && npx tsx test/test-channel-http.mjs && npx tsx test/test-channel-upload.mjs && npx tsx test/test-wise-voice.mjs && npx tsx test/test-wise-headless.mjs && npx tsx test/test-wise-machine.mjs && npx tsx test/test-crew-merge.mjs && npx tsx test/test-crew-verdict-routing.mjs && npx tsx test/test-crew-standalone.mjs && npx tsx test/test-session-links.mjs && npx tsx test/test-issue-loop-pause-guard.mjs && npx tsx test/test-artifact-guard.mjs && npx tsx test/test-artifact-sync-pagination.mjs && npx tsx test/test-graceful-restart.mjs && npx tsx test/test-flush-exit.mjs && npx tsx test/test-codex-skills.mjs",
|
|
23
|
+
"test": "npx tsx test/test-context-window.mjs && npx tsx test/test-ratelimit-retry.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-sharing-notify-sync.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-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-backend-accounts.mjs && npx tsx test/test-codex-force-model.mjs && npx tsx test/test-backend-oauth.mjs && npx tsx test/test-btw-proxy-env.mjs && npx tsx test/test-output-formatters.mjs && npx tsx test/test-inbox-guard.mjs && npx tsx test/test-user-events.mjs && npx tsx test/test-migrate-children.mjs && npx tsx test/test-outpost-install.mjs && npx tsx test/test-outpost-setup.mjs && npx tsx test/test-outpost-pairing.mjs && npx tsx test/test-outpost-coordinator.mjs && npx tsx test/e2e-outpost-transport.mjs && npx tsx test/test-inbox-reconcile.mjs && npx tsx test/test-auto-topic.mjs && npx tsx test/test-project-info.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-isolation-disable.mjs && npx tsx test/test-machine-service-logic.mjs && npx tsx test/test-session-access-fallback.mjs && npx tsx test/test-interactive-helpers.mjs && npx tsx test/test-codex-app-server.mjs && npx tsx test/test-acp-backend.mjs && npx tsx test/test-acp-bridge.mjs && npx tsx test/test-listener-backoff.mjs && npx tsx test/test-session-identity-env.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-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-compact-detect.mjs && npx tsx test/test-session-consolidation.mjs && npx tsx test/test-inbox-store.mjs && npx tsx test/test-inbox.mjs && npx tsx test/test-inbox-cross-machine.mjs && npx tsx test/test-issue-store.mjs && npx tsx test/test-issue-close-gate.mjs && npx tsx test/test-loop-verify.mjs && npx tsx test/test-restore-decision.mjs && npx tsx test/test-issue-rpc.mjs && npx tsx test/test-issue-pause.mjs && npx tsx test/test-workflow-store.mjs && npx tsx test/test-workflow-rpc.mjs && npx tsx test/test-workflow-scheduler.mjs && npx tsx test/test-cron.mjs && npx tsx test/test-workflow-runs.mjs && npx tsx test/test-workflow-idle.mjs && npx tsx test/test-serve-link-subdomain.mjs && npx tsx test/test-short-id.mjs && npx tsx test/test-transcript-edit.mjs && npx tsx test/test-edit-history.mjs && npx tsx test/test-friendly-name.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-ws-upgrade.mjs && npx tsx test/test-serve-auth.mjs && npx tsx test/test-static-file-server.mjs && npx tsx test/test-serve-stability.mjs && npx tsx test/test-frpc-e2e.mjs --unit-only && npx tsx test/test-frpc-status.mjs && node test/pinnedClaudeCode.test.mjs && node test/fleet.test.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-hotreload-seam.mjs && npx tsx test/test-hot-reload.mjs && npx tsx test/test-hot-reload-live.mjs && npx tsx test/test-session-core.mjs && npx tsx test/test-channel-async-reply.mjs && npx tsx test/test-outbox-reload.mjs && npx tsx test/test-channel-binding.mjs && npx tsx test/test-channel-identity.mjs && npx tsx test/test-stateless-dispatch-limiter.mjs && npx tsx test/test-shared-session-identity.mjs && npx tsx test/test-wise-agent-auth.mjs && npx tsx test/test-channel-http.mjs && npx tsx test/test-channel-upload.mjs && npx tsx test/test-wise-voice.mjs && npx tsx test/test-wise-headless.mjs && npx tsx test/test-wise-machine.mjs && npx tsx test/test-crew-merge.mjs && npx tsx test/test-crew-verdict-routing.mjs && npx tsx test/test-crew-standalone.mjs && npx tsx test/test-session-links.mjs && npx tsx test/test-issue-loop-pause-guard.mjs && npx tsx test/test-artifact-guard.mjs && npx tsx test/test-artifact-sync-pagination.mjs && npx tsx test/test-graceful-restart.mjs && npx tsx test/test-flush-exit.mjs && npx tsx test/test-codex-skills.mjs",
|
|
24
24
|
"test:hypha": "node --no-warnings test/test-hypha-service.mjs",
|
|
25
25
|
"dev": "tsx src/cli.ts",
|
|
26
26
|
"dev:daemon": "tsx src/cli.ts daemon start-sync",
|
|
@@ -1,293 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { execSync } from 'node:child_process';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import os from 'node:os';
|
|
5
|
-
import { H as buildOutpostInstall, I as ChannelStore, J as DEFAULT_OUTPOST_DOWNLOAD_BASE, K as setupOutpostChannel } from './run-DrG6nwGm.mjs';
|
|
6
|
-
import 'os';
|
|
7
|
-
import 'fs/promises';
|
|
8
|
-
import 'fs';
|
|
9
|
-
import 'path';
|
|
10
|
-
import 'url';
|
|
11
|
-
import 'child_process';
|
|
12
|
-
import 'crypto';
|
|
13
|
-
import 'node:crypto';
|
|
14
|
-
import 'util';
|
|
15
|
-
import 'http';
|
|
16
|
-
import 'net';
|
|
17
|
-
import 'node:events';
|
|
18
|
-
import '@agentclientprotocol/sdk';
|
|
19
|
-
import 'node:readline';
|
|
20
|
-
import 'node:fs/promises';
|
|
21
|
-
import 'node:util';
|
|
22
|
-
import 'yaml';
|
|
23
|
-
|
|
24
|
-
function loadConfig() {
|
|
25
|
-
const p = join(os.homedir(), ".svamp", "outpost.json");
|
|
26
|
-
if (!existsSync(p)) return null;
|
|
27
|
-
try {
|
|
28
|
-
return JSON.parse(readFileSync(p, "utf8"));
|
|
29
|
-
} catch {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
function saveConfig(cfg) {
|
|
34
|
-
writeFileSync(join(os.homedir(), ".svamp", "outpost.json"), JSON.stringify(cfg, null, 2));
|
|
35
|
-
}
|
|
36
|
-
function envVar(name) {
|
|
37
|
-
if (process.env[name]) return process.env[name];
|
|
38
|
-
try {
|
|
39
|
-
for (const line of readFileSync(join(os.homedir(), ".svamp", ".env"), "utf8").split("\n")) {
|
|
40
|
-
const m = line.match(/^\s*([A-Za-z0-9_]+)\s*=\s*(.*)\s*$/);
|
|
41
|
-
if (m && m[1] === name) return m[2].replace(/^["']|["']$/g, "");
|
|
42
|
-
}
|
|
43
|
-
} catch {
|
|
44
|
-
}
|
|
45
|
-
return void 0;
|
|
46
|
-
}
|
|
47
|
-
function machineId() {
|
|
48
|
-
try {
|
|
49
|
-
return JSON.parse(readFileSync(join(os.homedir(), ".svamp", "daemon.state.json"), "utf8")).machineId;
|
|
50
|
-
} catch {
|
|
51
|
-
return void 0;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function projectDir() {
|
|
55
|
-
try {
|
|
56
|
-
return execSync("git rev-parse --show-toplevel", { encoding: "utf8" }).trim();
|
|
57
|
-
} catch {
|
|
58
|
-
return process.cwd();
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
function remotesPath() {
|
|
62
|
-
return join(os.homedir(), ".svamp", "outpost-remotes.json");
|
|
63
|
-
}
|
|
64
|
-
function loadRemotes() {
|
|
65
|
-
try {
|
|
66
|
-
return JSON.parse(readFileSync(remotesPath(), "utf8"));
|
|
67
|
-
} catch {
|
|
68
|
-
return {};
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
function rememberRemote(channel, id, targeted = false) {
|
|
72
|
-
const all = loadRemotes();
|
|
73
|
-
const ch = all[channel] ||= {};
|
|
74
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
75
|
-
ch[id] = { firstSeen: ch[id]?.firstSeen || now, ...targeted ? { lastTargeted: now } : ch[id]?.lastTargeted ? { lastTargeted: ch[id].lastTargeted } : {} };
|
|
76
|
-
try {
|
|
77
|
-
writeFileSync(remotesPath(), JSON.stringify(all, null, 2));
|
|
78
|
-
} catch {
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
function forgetRemote(channel, id) {
|
|
82
|
-
const all = loadRemotes();
|
|
83
|
-
if (!all[channel]?.[id]) return false;
|
|
84
|
-
delete all[channel][id];
|
|
85
|
-
try {
|
|
86
|
-
writeFileSync(remotesPath(), JSON.stringify(all, null, 2));
|
|
87
|
-
} catch {
|
|
88
|
-
}
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
async function outpostUp(args) {
|
|
92
|
-
const session = process.env.SVAMP_SESSION_ID;
|
|
93
|
-
if (!session) {
|
|
94
|
-
console.error("SVAMP_SESSION_ID not set \u2014 run this inside a Svamp session.");
|
|
95
|
-
process.exit(1);
|
|
96
|
-
}
|
|
97
|
-
const workspace = envVar("HYPHA_WORKSPACE");
|
|
98
|
-
const serverUrl = envVar("HYPHA_SERVER_URL") || "https://hypha.aicell.io";
|
|
99
|
-
const mid = machineId();
|
|
100
|
-
if (!workspace || !mid) {
|
|
101
|
-
console.error("Could not resolve workspace/machine (HYPHA_WORKSPACE / daemon.state.json).");
|
|
102
|
-
process.exit(1);
|
|
103
|
-
}
|
|
104
|
-
const dl = argVal(args, "--download-base") || envVar("SVAMP_OUTPOST_DL") || DEFAULT_OUTPOST_DOWNLOAD_BASE;
|
|
105
|
-
const info = setupOutpostChannel({ session, projectDir: projectDir(), channelsServiceId: `${workspace}/${mid}:channels`, serverUrl, downloadBase: dl });
|
|
106
|
-
const { channelId, token, serverBase: gw, install: gen } = info;
|
|
107
|
-
saveConfig({ control: "", serverBase: gw, serveBase: dl, token, channel: channelId, session });
|
|
108
|
-
console.log(`\u2713 outpost channel ready for session ${session} (channel "${channelId}", gateway transport)
|
|
109
|
-
`);
|
|
110
|
-
console.log("Give this to the person at the remote machine:\n");
|
|
111
|
-
console.log(" macOS / Linux:\n " + gen.unix + "\n");
|
|
112
|
-
console.log(" Windows (PowerShell):\n " + gen.windows + "\n");
|
|
113
|
-
console.log(" Direct binaries: " + dl);
|
|
114
|
-
console.log('\nThen drive it from this session: svamp outpost exec "<command>" \xB7 svamp outpost status');
|
|
115
|
-
}
|
|
116
|
-
function argVal(args, name) {
|
|
117
|
-
const i = args.indexOf(name);
|
|
118
|
-
return i >= 0 && i + 1 < args.length ? args[i + 1] : void 0;
|
|
119
|
-
}
|
|
120
|
-
async function http(method, url, body) {
|
|
121
|
-
const resp = await fetch(url, {
|
|
122
|
-
method,
|
|
123
|
-
...body !== void 0 ? { headers: { "content-type": "application/json" }, body: JSON.stringify(body) } : {}
|
|
124
|
-
});
|
|
125
|
-
const text = await resp.text();
|
|
126
|
-
if (!resp.ok) throw new Error(`HTTP ${resp.status}: ${text.slice(0, 200)}`);
|
|
127
|
-
try {
|
|
128
|
-
return JSON.parse(text);
|
|
129
|
-
} catch {
|
|
130
|
-
return text;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
function usage() {
|
|
134
|
-
console.log(`svamp outpost \u2014 drive a connected remote machine (FDE outpost)
|
|
135
|
-
|
|
136
|
-
svamp outpost up Create this session's outpost channel + print the install command
|
|
137
|
-
|
|
138
|
-
svamp outpost list List the outposts (machines) connected to this session
|
|
139
|
-
svamp outpost status Show connected remotes + counts
|
|
140
|
-
svamp outpost exec [--machine <id>] "<command>"
|
|
141
|
-
Run a shell command on one outpost (--machine <id>) or, with no
|
|
142
|
-
--machine, broadcast to every connected outpost. Output arrives
|
|
143
|
-
as chat messages. Each outpost's id is shown in its connect banner.
|
|
144
|
-
svamp outpost forget <id> Drop a machine id from the local list
|
|
145
|
-
svamp outpost logs [--json] Show everything the remote(s) have sent back
|
|
146
|
-
svamp outpost install [--os <os>] Print the install one-liner(s) for the current outpost setup
|
|
147
|
-
|
|
148
|
-
With several machines connected, target each by id, e.g.:
|
|
149
|
-
svamp outpost exec --machine build-mac "uname -a"
|
|
150
|
-
svamp outpost exec "hostname" # runs on ALL connected outposts
|
|
151
|
-
|
|
152
|
-
Reads the relay control endpoint from ~/.svamp/outpost.json (or pass --control <url>).`);
|
|
153
|
-
}
|
|
154
|
-
async function outpostCommand(args) {
|
|
155
|
-
const sub = args[0];
|
|
156
|
-
const cfg = loadConfig();
|
|
157
|
-
const control = argVal(args, "--control") || cfg?.control;
|
|
158
|
-
if (!sub || sub === "help" || sub === "--help") {
|
|
159
|
-
usage();
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
if (sub === "up") {
|
|
163
|
-
await outpostUp(args.slice(1));
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
if (sub === "install") {
|
|
167
|
-
if (!cfg) {
|
|
168
|
-
console.error("No outpost configured (~/.svamp/outpost.json missing).");
|
|
169
|
-
process.exit(1);
|
|
170
|
-
}
|
|
171
|
-
const gen = buildOutpostInstall({ serverBase: cfg.serverBase, channel: cfg.channel, token: cfg.token, session: cfg.session, downloadBase: cfg.serveBase });
|
|
172
|
-
const only = argVal(args, "--os");
|
|
173
|
-
if (only === "windows") console.log(gen.windows);
|
|
174
|
-
else if (only === "unix" || only === "linux" || only === "darwin" || only === "macos") console.log(gen.unix);
|
|
175
|
-
else {
|
|
176
|
-
console.log("macOS / Linux:\n " + gen.unix + "\n");
|
|
177
|
-
console.log("Windows (PowerShell):\n " + gen.windows + "\n");
|
|
178
|
-
if (cfg.serveBase) console.log("Direct download: " + cfg.serveBase);
|
|
179
|
-
}
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
const gateway = !!cfg?.serverBase && /\/services\/[^/]*:channels/.test(cfg.serverBase);
|
|
183
|
-
if (sub === "exec" && gateway) {
|
|
184
|
-
const target = argVal(args, "--machine") || argVal(args, "-m");
|
|
185
|
-
const cmd = args.slice(1).filter((a, i, arr) => a !== "--machine" && a !== "-m" && arr[i - 1] !== "--machine" && arr[i - 1] !== "-m").join(" ").trim();
|
|
186
|
-
if (!cmd) {
|
|
187
|
-
console.error('usage: svamp outpost exec [--machine <id>] "<command>"');
|
|
188
|
-
process.exit(1);
|
|
189
|
-
}
|
|
190
|
-
const { ChannelOutbox } = await import('./run-DrG6nwGm.mjs').then(function (n) { return n.at; });
|
|
191
|
-
const outbox = new ChannelOutbox(projectDir());
|
|
192
|
-
const id = "x" + Date.now().toString(36);
|
|
193
|
-
outbox.append(cfg.channel, { to: "outpost", body: JSON.stringify({ type: "exec", id, cmd, target: target || "" }) });
|
|
194
|
-
if (target) rememberRemote(cfg.channel, target, true);
|
|
195
|
-
console.log(target ? `Sent to outpost "${target}" (channel ${cfg.channel}). Its output arrives as a message in this session shortly.` : `Broadcast to all connected outposts (channel ${cfg.channel}). Output from each arrives as a message shortly. Use --machine <id> to target one.`);
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
if (sub === "list" && gateway) {
|
|
199
|
-
const ch = new ChannelStore(projectDir()).get(cfg.channel);
|
|
200
|
-
const calls = (ch?.last_calls || []).filter((c) => c.sender === "outpost");
|
|
201
|
-
const known = loadRemotes()[cfg.channel] || {};
|
|
202
|
-
const ids = Object.keys(known);
|
|
203
|
-
if (!ids.length && !calls.length) {
|
|
204
|
-
console.log(`No outposts known yet on ${cfg.channel}. When one connects it announces itself in this session's chat as \u{1F5A5}\uFE0F outpost "<id>" connected \u2014 then target it with: svamp outpost exec --machine <id> "\u2026"`);
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
console.log(`Outposts addressed from session ${cfg.session || cfg.channel} (each connect banner in chat confirms which are live):`);
|
|
208
|
-
for (const id of ids) {
|
|
209
|
-
const r = known[id];
|
|
210
|
-
console.log(` \u2022 ${id}${r.lastTargeted ? ` (last targeted ${r.lastTargeted})` : " (seen)"}`);
|
|
211
|
-
}
|
|
212
|
-
if (calls.length) console.log(` channel activity: ${calls.length} recent message(s); last at ${calls[0]?.at}`);
|
|
213
|
-
if (!ids.length) console.log(" (no machine ids recorded yet \u2014 the connect banner in chat shows each outpost's id)");
|
|
214
|
-
console.log(" Drop a stale id with: svamp outpost forget <id>");
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
if ((sub === "forget" || sub === "remove") && gateway) {
|
|
218
|
-
const id = args[1];
|
|
219
|
-
if (!id) {
|
|
220
|
-
console.error("usage: svamp outpost forget <machine-id>");
|
|
221
|
-
process.exit(1);
|
|
222
|
-
}
|
|
223
|
-
console.log(forgetRemote(cfg.channel, id) ? `Forgot outpost "${id}".` : `No such outpost "${id}" recorded.`);
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
if (sub === "status" && gateway) {
|
|
227
|
-
const ch = new ChannelStore(projectDir()).get(cfg.channel);
|
|
228
|
-
const calls = (ch?.last_calls || []).filter((c) => c.sender === "outpost");
|
|
229
|
-
const ids = Object.keys(loadRemotes()[cfg.channel] || {});
|
|
230
|
-
const who = ids.length ? ` \u2014 known machines: ${ids.join(", ")}` : "";
|
|
231
|
-
console.log(calls.length ? `outpost active on ${cfg.channel} \u2014 ${calls.length} recent message(s); last at ${calls[0]?.at}${who}` : `no outpost has connected to ${cfg.channel} yet`);
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
if (sub === "logs" && gateway) {
|
|
235
|
-
console.log(`Gateway mode: the remote's host info + command output arrive as messages in this session's chat (channel ${cfg.channel}).`);
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
if (!control) {
|
|
239
|
-
console.error("No relay control endpoint (~/.svamp/outpost.json missing; run `svamp outpost up`, or pass --control <url>).");
|
|
240
|
-
process.exit(1);
|
|
241
|
-
}
|
|
242
|
-
if (sub === "status") {
|
|
243
|
-
const s = await http("GET", `${control}/state`);
|
|
244
|
-
console.log(`connected remotes: ${s.connectedOutposts} commands sent: ${s.commands} results: ${s.results}`);
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
if (sub === "logs") {
|
|
248
|
-
const r = await http("GET", `${control}/results`);
|
|
249
|
-
if (args.includes("--json")) {
|
|
250
|
-
console.log(JSON.stringify(r, null, 2));
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
for (const m of r) {
|
|
254
|
-
if (m.type === "outpost-hello") console.log(`\u2022 connected: ${m.host?.user}@${m.host?.hostname} (${m.host?.os}/${m.host?.arch}) cwd=${m.host?.cwd}`);
|
|
255
|
-
else if (m.type === "exec-result") console.log(`\u2022 [${m.id}] exit=${m.exitCode}
|
|
256
|
-
${m.output}`);
|
|
257
|
-
}
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
if (sub === "exec") {
|
|
261
|
-
const cmd = args.slice(1).filter((a) => a !== "--control" && a !== control).join(" ").trim();
|
|
262
|
-
if (!cmd) {
|
|
263
|
-
console.error('usage: svamp outpost exec "<command>"');
|
|
264
|
-
process.exit(1);
|
|
265
|
-
}
|
|
266
|
-
const { enqueued } = await http("POST", `${control}/enqueue?cmd=${encodeURIComponent(cmd)}`, {});
|
|
267
|
-
if (!enqueued?.id) {
|
|
268
|
-
console.error("failed to enqueue");
|
|
269
|
-
process.exit(1);
|
|
270
|
-
}
|
|
271
|
-
const deadline = Date.now() + 6e5;
|
|
272
|
-
for (; ; ) {
|
|
273
|
-
const results = await http("GET", `${control}/results`);
|
|
274
|
-
const hit = results.find((m) => m.type === "exec-result" && m.id === enqueued.id);
|
|
275
|
-
if (hit) {
|
|
276
|
-
process.stdout.write(hit.output || "");
|
|
277
|
-
if (typeof hit.exitCode === "number" && hit.exitCode !== 0) console.error(`
|
|
278
|
-
[exit ${hit.exitCode}]`);
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
if (Date.now() > deadline) {
|
|
282
|
-
console.error("timed out waiting for the remote to respond (is it connected?)");
|
|
283
|
-
process.exit(1);
|
|
284
|
-
}
|
|
285
|
-
await new Promise((r) => setTimeout(r, 500));
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
console.error(`unknown outpost command: ${sub}`);
|
|
289
|
-
usage();
|
|
290
|
-
process.exit(1);
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
export { outpostCommand };
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
var name = "svamp-cli";
|
|
2
|
-
var version = "0.2.300";
|
|
3
|
-
var description = "Svamp CLI — AI workspace daemon on Hypha Cloud";
|
|
4
|
-
var author = "Amun AI AB";
|
|
5
|
-
var license = "SEE LICENSE IN LICENSE";
|
|
6
|
-
var type = "module";
|
|
7
|
-
var bin = {
|
|
8
|
-
svamp: "./bin/svamp.mjs"
|
|
9
|
-
};
|
|
10
|
-
var files = [
|
|
11
|
-
"dist",
|
|
12
|
-
"bin"
|
|
13
|
-
];
|
|
14
|
-
var main = "./dist/index.mjs";
|
|
15
|
-
var exports$1 = {
|
|
16
|
-
".": "./dist/index.mjs",
|
|
17
|
-
"./cli": "./dist/cli.mjs"
|
|
18
|
-
};
|
|
19
|
-
var scripts = {
|
|
20
|
-
build: "rm -rf dist bin/skills bin/commands && mkdir -p bin/skills && cp -r ../../skills/artifact bin/skills/artifact && cp -r ../../skills/crew bin/skills/crew && cp -r ../../commands bin/commands && tsc --noEmit && pkgroll",
|
|
21
|
-
typecheck: "tsc --noEmit",
|
|
22
|
-
test: "npx tsx test/test-context-window.mjs && npx tsx test/test-ratelimit-retry.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-sharing-notify-sync.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-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-backend-accounts.mjs && npx tsx test/test-codex-force-model.mjs && npx tsx test/test-backend-oauth.mjs && npx tsx test/test-btw-proxy-env.mjs && npx tsx test/test-output-formatters.mjs && npx tsx test/test-inbox-guard.mjs && npx tsx test/test-user-events.mjs && npx tsx test/test-migrate-children.mjs && npx tsx test/test-outpost-install.mjs && npx tsx test/test-outpost-setup.mjs && npx tsx test/test-outpost-pairing.mjs && npx tsx test/test-inbox-reconcile.mjs && npx tsx test/test-auto-topic.mjs && npx tsx test/test-project-info.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-isolation-disable.mjs && npx tsx test/test-machine-service-logic.mjs && npx tsx test/test-session-access-fallback.mjs && npx tsx test/test-interactive-helpers.mjs && npx tsx test/test-codex-app-server.mjs && npx tsx test/test-acp-backend.mjs && npx tsx test/test-acp-bridge.mjs && npx tsx test/test-listener-backoff.mjs && npx tsx test/test-session-identity-env.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-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-compact-detect.mjs && npx tsx test/test-session-consolidation.mjs && npx tsx test/test-inbox-store.mjs && npx tsx test/test-inbox.mjs && npx tsx test/test-inbox-cross-machine.mjs && npx tsx test/test-issue-store.mjs && npx tsx test/test-issue-close-gate.mjs && npx tsx test/test-loop-verify.mjs && npx tsx test/test-restore-decision.mjs && npx tsx test/test-issue-rpc.mjs && npx tsx test/test-issue-pause.mjs && npx tsx test/test-workflow-store.mjs && npx tsx test/test-workflow-rpc.mjs && npx tsx test/test-workflow-scheduler.mjs && npx tsx test/test-cron.mjs && npx tsx test/test-workflow-runs.mjs && npx tsx test/test-workflow-idle.mjs && npx tsx test/test-serve-link-subdomain.mjs && npx tsx test/test-short-id.mjs && npx tsx test/test-transcript-edit.mjs && npx tsx test/test-edit-history.mjs && npx tsx test/test-friendly-name.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-ws-upgrade.mjs && npx tsx test/test-serve-auth.mjs && npx tsx test/test-static-file-server.mjs && npx tsx test/test-serve-stability.mjs && npx tsx test/test-frpc-e2e.mjs --unit-only && npx tsx test/test-frpc-status.mjs && node test/pinnedClaudeCode.test.mjs && node test/fleet.test.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-hotreload-seam.mjs && npx tsx test/test-hot-reload.mjs && npx tsx test/test-hot-reload-live.mjs && npx tsx test/test-session-core.mjs && npx tsx test/test-channel-async-reply.mjs && npx tsx test/test-outbox-reload.mjs && npx tsx test/test-channel-binding.mjs && npx tsx test/test-channel-identity.mjs && npx tsx test/test-stateless-dispatch-limiter.mjs && npx tsx test/test-shared-session-identity.mjs && npx tsx test/test-wise-agent-auth.mjs && npx tsx test/test-channel-http.mjs && npx tsx test/test-channel-upload.mjs && npx tsx test/test-wise-voice.mjs && npx tsx test/test-wise-headless.mjs && npx tsx test/test-wise-machine.mjs && npx tsx test/test-crew-merge.mjs && npx tsx test/test-crew-verdict-routing.mjs && npx tsx test/test-crew-standalone.mjs && npx tsx test/test-session-links.mjs && npx tsx test/test-issue-loop-pause-guard.mjs && npx tsx test/test-artifact-guard.mjs && npx tsx test/test-artifact-sync-pagination.mjs && npx tsx test/test-graceful-restart.mjs && npx tsx test/test-flush-exit.mjs && npx tsx test/test-codex-skills.mjs",
|
|
23
|
-
"test:hypha": "node --no-warnings test/test-hypha-service.mjs",
|
|
24
|
-
dev: "tsx src/cli.ts",
|
|
25
|
-
"dev:daemon": "tsx src/cli.ts daemon start-sync",
|
|
26
|
-
"test:e2e": "node --no-warnings test/e2e-session-tests.mjs",
|
|
27
|
-
"test:frpc": "npx tsx test/test-frpc-e2e.mjs",
|
|
28
|
-
prepublishOnly: "yarn build"
|
|
29
|
-
};
|
|
30
|
-
var dependencies = {
|
|
31
|
-
"@agentclientprotocol/sdk": "^0.14.1",
|
|
32
|
-
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
33
|
-
"hypha-rpc": "0.21.42",
|
|
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
|
-
var 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
|
-
var packageManager = "yarn@1.22.22";
|
|
47
|
-
var _package = {
|
|
48
|
-
name: name,
|
|
49
|
-
version: version,
|
|
50
|
-
description: description,
|
|
51
|
-
author: author,
|
|
52
|
-
license: license,
|
|
53
|
-
type: type,
|
|
54
|
-
bin: bin,
|
|
55
|
-
files: files,
|
|
56
|
-
main: main,
|
|
57
|
-
exports: exports$1,
|
|
58
|
-
scripts: scripts,
|
|
59
|
-
dependencies: dependencies,
|
|
60
|
-
devDependencies: devDependencies,
|
|
61
|
-
packageManager: packageManager
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export { author, bin, _package as default, dependencies, description, devDependencies, exports$1 as exports, files, license, main, name, packageManager, scripts, type, version };
|