svamp-cli 0.2.299 → 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.
Files changed (29) hide show
  1. package/dist/{adminCommands-D08GLn9K.mjs → adminCommands-DMiliv55.mjs} +1 -1
  2. package/dist/{agentCommands-DLpNORpD.mjs → agentCommands-BCkWdFFW.mjs} +5 -5
  3. package/dist/{auth-Cq1Tggti.mjs → auth-Ba1_zl1h.mjs} +1 -1
  4. package/dist/{cli-Dd82AdTd.mjs → cli-Bv0Zhf3M.mjs} +69 -69
  5. package/dist/cli.mjs +2 -2
  6. package/dist/{commands-BdgY6EVk.mjs → commands-B2mRza8S.mjs} +2 -2
  7. package/dist/{commands-C_ROarRL.mjs → commands-BA3eBROn.mjs} +1 -1
  8. package/dist/{commands-C60tZyej.mjs → commands-BAlaK67Y.mjs} +1 -1
  9. package/dist/{commands-CBXkcBgD.mjs → commands-BC3RuhRx.mjs} +2 -2
  10. package/dist/commands-BnirT9RR.mjs +161 -0
  11. package/dist/{commands-BAuKr5Bn.mjs → commands-DhB2iz0_.mjs} +7 -7
  12. package/dist/{commands-dC4o6d-s.mjs → commands-bIioWHWe.mjs} +2 -2
  13. package/dist/{commands-BzaZz_ke.mjs → commands-hHZu5qJh.mjs} +1 -1
  14. package/dist/{fleet-CbK3VsXL.mjs → fleet-BFurNsSA.mjs} +1 -1
  15. package/dist/{frpc-BqfCBMke.mjs → frpc-Cb6jUvED.mjs} +1 -1
  16. package/dist/{headlessCli-Wm7z6_EN.mjs → headlessCli-DP9gpAxv.mjs} +2 -2
  17. package/dist/index.mjs +1 -1
  18. package/dist/{notifyCommands-DM1mwI92.mjs → notifyCommands-C0i6P1yC.mjs} +1 -1
  19. package/dist/package-D8lHDQja.mjs +64 -0
  20. package/dist/{rpc-BJySEOZA.mjs → rpc-B-bxS-Pv.mjs} +1 -1
  21. package/dist/{rpc-DZekVCXH.mjs → rpc-CNkfUlz1.mjs} +1 -1
  22. package/dist/{run-C_5djiX4.mjs → run-C0GhrtVf.mjs} +433 -77
  23. package/dist/{run-BYIuK238.mjs → run-CvT_37Ov.mjs} +1 -1
  24. package/dist/{scheduler-CJ4qyaq2.mjs → scheduler-DT1_BBdZ.mjs} +1 -1
  25. package/dist/{serveCommands-DIutqRPk.mjs → serveCommands-CUabu97u.mjs} +5 -5
  26. package/dist/{sideband-BVmN7F-h.mjs → sideband-BlZBmbji.mjs} +1 -1
  27. package/package.json +2 -2
  28. package/dist/commands-QrHdpbuH.mjs +0 -293
  29. package/dist/package-BJe_70EQ.mjs +0 -64
@@ -1,4 +1,4 @@
1
- import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import { al as applyClaudeProxyEnv, am as composeSessionId, an as generateFriendlyName, c as connectToHypha, a as createSessionStore, r as registerMachineService, ao as generateHookSettings } from './run-C_5djiX4.mjs';
1
+ import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import { ah as applyClaudeProxyEnv, ai as composeSessionId, aj as generateFriendlyName, c as connectToHypha, a as createSessionStore, r as registerMachineService, ak as generateHookSettings } from './run-C0GhrtVf.mjs';
2
2
  import os from 'node:os';
3
3
  import { resolve, join } from 'node:path';
4
4
  import { existsSync, readFileSync, watch } from 'node:fs';
@@ -1,4 +1,4 @@
1
- import { j as resolveProjectRoot, D as listWorkflows, E as isWorkflowEnabled, F as workflowCrons, y as runWorkflow, G as cronMatches } from './run-C_5djiX4.mjs';
1
+ import { j as resolveProjectRoot, D as listWorkflows, E as isWorkflowEnabled, F as workflowCrons, y as runWorkflow, G as cronMatches } from './run-C0GhrtVf.mjs';
2
2
  import 'os';
3
3
  import 'fs/promises';
4
4
  import 'fs';
@@ -54,7 +54,7 @@ async function handleServeCommand() {
54
54
  }
55
55
  }
56
56
  async function serveAdd(args, machineId) {
57
- const { connectAndGetMachine } = await import('./commands-C60tZyej.mjs');
57
+ const { connectAndGetMachine } = await import('./commands-BAlaK67Y.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-C60tZyej.mjs');
96
+ const { connectAndGetMachine } = await import('./commands-BAlaK67Y.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-C60tZyej.mjs');
185
+ const { connectAndGetMachine } = await import('./commands-BAlaK67Y.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-C60tZyej.mjs');
205
+ const { connectAndGetMachine } = await import('./commands-BAlaK67Y.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-C60tZyej.mjs');
238
+ const { connectAndGetMachine } = await import('./commands-BAlaK67Y.mjs');
239
239
  const { machine, server } = await connectAndGetMachine(machineId);
240
240
  try {
241
241
  const info = await machine.serveInfo();
@@ -1,4 +1,4 @@
1
- import { R as READ_ONLY_TOOLS, Q as loadMachineContext, T as buildMachineInstructions, U as machineToolsForRole, V as buildMachineTools } from './run-C_5djiX4.mjs';
1
+ import { R as READ_ONLY_TOOLS, M as loadMachineContext, N as buildMachineInstructions, O as machineToolsForRole, P as buildMachineTools } from './run-C0GhrtVf.mjs';
2
2
  import 'node:child_process';
3
3
  import 'os';
4
4
  import 'fs/promises';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svamp-cli",
3
- "version": "0.2.299",
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-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-C_5djiX4.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-C_5djiX4.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.299";
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-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 };