svamp-cli 0.2.90 → 0.2.91
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-BjhBmutV.mjs → agentCommands-Cq5-Dj_E.mjs} +2 -2
- package/dist/{auth-LB4hwDfW.mjs → auth-DPhc_hNc.mjs} +4 -3
- package/dist/cli.mjs +89 -53
- package/dist/{commands-C-5cSioE.mjs → commands-B9ssOqX0.mjs} +5 -5
- package/dist/{commands-XrfOgVzR.mjs → commands-C6HpuYOB.mjs} +4 -3
- package/dist/{commands-sQMe36dC.mjs → commands-DemyBiUh.mjs} +3 -2
- package/dist/{commands-Bg7NZ6PK.mjs → commands-LfAaLGbG.mjs} +4 -3
- package/dist/{commands-mlxYf-v-.mjs → commands-kGkSBEMq.mjs} +40 -6
- package/dist/{fleet-Dts-Z6LV.mjs → fleet-DRQS1weD.mjs} +4 -3
- package/dist/{frpc-DTA0--Z7.mjs → frpc-BBNWJChC.mjs} +4 -3
- package/dist/index.mjs +4 -3
- package/dist/{package-DR--K5aO.mjs → package-GxcmHBEB.mjs} +2 -2
- package/dist/{run-1BK4-WPo.mjs → run-DWr_h85y.mjs} +2879 -2223
- package/dist/{run-DrC7KnK3.mjs → run-YihZemmc.mjs} +3 -2
- package/dist/{serveCommands-BXn2hnJ0.mjs → serveCommands-Js_HSnLs.mjs} +5 -5
- package/dist/{serveManager-Cd2gJI7J.mjs → serveManager-Dn9GyzAG.mjs} +5 -4
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@ import { existsSync, readFileSync } from 'node:fs';
|
|
|
2
2
|
import { execSync } from 'node:child_process';
|
|
3
3
|
import { basename, resolve, join } from 'node:path';
|
|
4
4
|
import os from 'node:os';
|
|
5
|
-
import { A as normalizeAllowedUser, B as loadSecurityContextConfig, C as resolveSecurityContext, D as buildSecurityContextFromFlags, E as mergeSecurityContexts, c as connectToHypha, F as buildSessionShareUrl, G as buildMachineShareUrl } from './run-
|
|
5
|
+
import { A as normalizeAllowedUser, B as loadSecurityContextConfig, C as resolveSecurityContext, D as buildSecurityContextFromFlags, E as mergeSecurityContexts, c as connectToHypha, F as buildSessionShareUrl, G as computeOutboundHop, H as buildMachineShareUrl } from './run-DWr_h85y.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
8
8
|
import 'fs';
|
|
@@ -10,9 +10,10 @@ import 'path';
|
|
|
10
10
|
import 'url';
|
|
11
11
|
import 'child_process';
|
|
12
12
|
import 'crypto';
|
|
13
|
+
import 'node:vm';
|
|
14
|
+
import 'ws';
|
|
13
15
|
import 'util';
|
|
14
16
|
import 'node:crypto';
|
|
15
|
-
import 'node:vm';
|
|
16
17
|
import '@agentclientprotocol/sdk';
|
|
17
18
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
18
19
|
import '@modelcontextprotocol/sdk/client/stdio.js';
|
|
@@ -1671,6 +1672,9 @@ async function sendCore(machine, fullId, message, opts) {
|
|
|
1671
1672
|
const preSeq = wantResponse ? await snapshotLatestSeq(machine, fullId) : 0;
|
|
1672
1673
|
const { randomUUID } = await import('node:crypto');
|
|
1673
1674
|
const callerSessionId = process.env.SVAMP_SESSION_ID;
|
|
1675
|
+
const hop = computeOutboundHop(callerSessionId);
|
|
1676
|
+
let urgency = opts?.urgency ? opts.urgency : shouldWait ? "urgent" : "normal";
|
|
1677
|
+
if (hop.fromInboxTurn) urgency = "normal";
|
|
1674
1678
|
const inboxMessage = {
|
|
1675
1679
|
messageId: randomUUID(),
|
|
1676
1680
|
body: message,
|
|
@@ -1680,7 +1684,9 @@ async function sendCore(machine, fullId, message, opts) {
|
|
|
1680
1684
|
...callerSessionId ? { fromSession: callerSessionId } : {},
|
|
1681
1685
|
to: fullId,
|
|
1682
1686
|
subject: opts?.subject,
|
|
1683
|
-
urgency
|
|
1687
|
+
urgency,
|
|
1688
|
+
hopCount: hop.hopCount,
|
|
1689
|
+
...hop.threadId ? { threadId: hop.threadId } : {}
|
|
1684
1690
|
};
|
|
1685
1691
|
const result = await machine.sessionRPC(fullId, "sendInboxMessage", { message: inboxMessage });
|
|
1686
1692
|
let waitResult;
|
|
@@ -2194,6 +2200,28 @@ async function machineExec(machineId, command, cwd) {
|
|
|
2194
2200
|
await server.disconnect();
|
|
2195
2201
|
}
|
|
2196
2202
|
}
|
|
2203
|
+
async function wiseAskCli(machineId, message, sessionId, opts) {
|
|
2204
|
+
if (!message) {
|
|
2205
|
+
console.error('Usage: svamp wise ask "<message>" [--session <id>] [-m <machine>]');
|
|
2206
|
+
process.exit(1);
|
|
2207
|
+
}
|
|
2208
|
+
const { server, machine } = await connectAndGetMachine(machineId);
|
|
2209
|
+
try {
|
|
2210
|
+
const res = await machine.wiseAsk({ message, sessionId });
|
|
2211
|
+
if (opts?.json) {
|
|
2212
|
+
console.log(JSON.stringify(res, null, 2));
|
|
2213
|
+
process.exit(res?.success ? 0 : 1);
|
|
2214
|
+
}
|
|
2215
|
+
if (res?.error) {
|
|
2216
|
+
console.error(`\u2717 ${res.error}`);
|
|
2217
|
+
process.exit(1);
|
|
2218
|
+
}
|
|
2219
|
+
console.log(res?.reply || `(${res?.status || "no reply"})`);
|
|
2220
|
+
process.exit(0);
|
|
2221
|
+
} finally {
|
|
2222
|
+
await server.disconnect();
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2197
2225
|
async function machineInfo(machineId) {
|
|
2198
2226
|
const { server, machine } = await connectAndGetMachine(machineId);
|
|
2199
2227
|
try {
|
|
@@ -2309,6 +2337,9 @@ async function sessionInboxSend(sessionIdPartial, body, machineId, opts) {
|
|
|
2309
2337
|
try {
|
|
2310
2338
|
const { randomUUID } = await import('node:crypto');
|
|
2311
2339
|
const callerSessionId = process.env.SVAMP_SESSION_ID;
|
|
2340
|
+
const hop = computeOutboundHop(callerSessionId);
|
|
2341
|
+
let urgency = opts?.urgency || "normal";
|
|
2342
|
+
if (hop.fromInboxTurn) urgency = "normal";
|
|
2312
2343
|
const message = {
|
|
2313
2344
|
messageId: randomUUID(),
|
|
2314
2345
|
body,
|
|
@@ -2318,9 +2349,10 @@ async function sessionInboxSend(sessionIdPartial, body, machineId, opts) {
|
|
|
2318
2349
|
...callerSessionId ? { fromSession: callerSessionId } : {},
|
|
2319
2350
|
to: fullId,
|
|
2320
2351
|
subject: opts?.subject,
|
|
2321
|
-
urgency
|
|
2352
|
+
urgency,
|
|
2353
|
+
hopCount: hop.hopCount,
|
|
2322
2354
|
replyTo: opts?.replyTo,
|
|
2323
|
-
threadId: opts?.threadId
|
|
2355
|
+
threadId: opts?.threadId || hop.threadId
|
|
2324
2356
|
};
|
|
2325
2357
|
const result = await machine.sessionRPC(fullId, "sendInboxMessage", { message });
|
|
2326
2358
|
if (opts?.json) {
|
|
@@ -2402,6 +2434,7 @@ async function sessionInboxReply(sessionIdPartial, messageId, body, machineId) {
|
|
|
2402
2434
|
process.exit(1);
|
|
2403
2435
|
}
|
|
2404
2436
|
const { randomUUID } = await import('node:crypto');
|
|
2437
|
+
const hop = computeOutboundHop(process.env.SVAMP_SESSION_ID || fullId);
|
|
2405
2438
|
const reply = {
|
|
2406
2439
|
messageId: randomUUID(),
|
|
2407
2440
|
body,
|
|
@@ -2412,6 +2445,7 @@ async function sessionInboxReply(sessionIdPartial, messageId, body, machineId) {
|
|
|
2412
2445
|
to: original.fromSession,
|
|
2413
2446
|
subject: original.subject ? `Re: ${original.subject}` : void 0,
|
|
2414
2447
|
urgency: "normal",
|
|
2448
|
+
hopCount: hop.hopCount,
|
|
2415
2449
|
replyTo: original.messageId,
|
|
2416
2450
|
threadId: original.threadId || original.messageId
|
|
2417
2451
|
};
|
|
@@ -2431,4 +2465,4 @@ async function sessionInboxClear(sessionIdPartial, machineId, opts) {
|
|
|
2431
2465
|
}
|
|
2432
2466
|
}
|
|
2433
2467
|
|
|
2434
|
-
export { collectAssistantResponse, connectAndGetMachine, connectAndResolveSession, createWorktree, generateWorktreeName, machineExec, machineInfo, machineLs, machineShare, parseShareArg, queryCore, renderMessage, resolveSessionId, sendCore, sessionApprove, sessionArchive, sessionAttach, sessionDelete, sessionDeny, sessionInboxClear, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxSend, sessionInfo, sessionList, sessionMachines, sessionMessages, sessionQuery, sessionRalphCancel, sessionRalphStart, sessionRalphStatus, sessionResume, sessionSend, sessionShare, sessionSpawn, sessionWait, sessionWhoami, snapshotLatestSeq, validateSendOptions };
|
|
2468
|
+
export { collectAssistantResponse, connectAndGetMachine, connectAndResolveSession, createWorktree, generateWorktreeName, machineExec, machineInfo, machineLs, machineShare, parseShareArg, queryCore, renderMessage, resolveSessionId, sendCore, sessionApprove, sessionArchive, sessionAttach, sessionDelete, sessionDeny, sessionInboxClear, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxSend, sessionInfo, sessionList, sessionMachines, sessionMessages, sessionQuery, sessionRalphCancel, sessionRalphStart, sessionRalphStatus, sessionResume, sessionSend, sessionShare, sessionSpawn, sessionWait, sessionWhoami, snapshotLatestSeq, validateSendOptions, wiseAskCli };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import os from 'node:os';
|
|
4
|
-
import { c as connectToHypha } from './run-
|
|
4
|
+
import { c as connectToHypha } from './run-DWr_h85y.mjs';
|
|
5
5
|
import { PINNED_CLAUDE_CODE_VERSION } from './pinnedClaudeCode-HydRNEt7.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
@@ -10,10 +10,11 @@ import 'path';
|
|
|
10
10
|
import 'url';
|
|
11
11
|
import 'child_process';
|
|
12
12
|
import 'crypto';
|
|
13
|
-
import 'util';
|
|
14
|
-
import 'node:crypto';
|
|
15
13
|
import 'node:vm';
|
|
16
14
|
import 'node:child_process';
|
|
15
|
+
import 'ws';
|
|
16
|
+
import 'util';
|
|
17
|
+
import 'node:crypto';
|
|
17
18
|
import '@agentclientprotocol/sdk';
|
|
18
19
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
19
20
|
import '@modelcontextprotocol/sdk/client/stdio.js';
|
|
@@ -3,16 +3,17 @@ import { mkdirSync, writeFileSync, unlinkSync, existsSync, chmodSync, readFileSy
|
|
|
3
3
|
import { join } from 'path';
|
|
4
4
|
import { homedir, platform, arch } from 'os';
|
|
5
5
|
import { createHash, randomUUID } from 'crypto';
|
|
6
|
-
import { h as getFrpsSubdomainHost, i as getFrpsServerPort, j as getFrpsServerAddr } from './run-
|
|
6
|
+
import { h as getFrpsSubdomainHost, i as getFrpsServerPort, j as getFrpsServerAddr } from './run-DWr_h85y.mjs';
|
|
7
7
|
import 'fs/promises';
|
|
8
8
|
import 'url';
|
|
9
9
|
import 'node:fs';
|
|
10
|
+
import 'node:vm';
|
|
11
|
+
import 'node:child_process';
|
|
12
|
+
import 'ws';
|
|
10
13
|
import 'util';
|
|
11
14
|
import 'node:crypto';
|
|
12
15
|
import 'node:path';
|
|
13
16
|
import 'node:os';
|
|
14
|
-
import 'node:vm';
|
|
15
|
-
import 'node:child_process';
|
|
16
17
|
import '@agentclientprotocol/sdk';
|
|
17
18
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
18
19
|
import '@modelcontextprotocol/sdk/client/stdio.js';
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as connectToHypha, d as daemonStatus, g as getHyphaServerUrl, r as registerMachineService, a as registerSessionService, s as startDaemon, b as stopDaemon } from './run-
|
|
1
|
+
export { c as connectToHypha, d as daemonStatus, g as getHyphaServerUrl, r as registerMachineService, a as registerSessionService, s as startDaemon, b as stopDaemon } from './run-DWr_h85y.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -7,12 +7,13 @@ import 'url';
|
|
|
7
7
|
import 'child_process';
|
|
8
8
|
import 'crypto';
|
|
9
9
|
import 'node:fs';
|
|
10
|
+
import 'node:vm';
|
|
11
|
+
import 'node:child_process';
|
|
12
|
+
import 'ws';
|
|
10
13
|
import 'util';
|
|
11
14
|
import 'node:crypto';
|
|
12
15
|
import 'node:path';
|
|
13
16
|
import 'node:os';
|
|
14
|
-
import 'node:vm';
|
|
15
|
-
import 'node:child_process';
|
|
16
17
|
import '@agentclientprotocol/sdk';
|
|
17
18
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
18
19
|
import '@modelcontextprotocol/sdk/client/stdio.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var name = "svamp-cli";
|
|
2
|
-
var version = "0.2.
|
|
2
|
+
var version = "0.2.91";
|
|
3
3
|
var description = "Svamp CLI — AI workspace daemon on Hypha Cloud";
|
|
4
4
|
var author = "Amun AI AB";
|
|
5
5
|
var license = "SEE LICENSE IN LICENSE";
|
|
@@ -19,7 +19,7 @@ var exports$1 = {
|
|
|
19
19
|
var scripts = {
|
|
20
20
|
build: "rm -rf dist bin/skills && mkdir -p bin/skills && cp -r ../../skills/artifact bin/skills/artifact && tsc --noEmit && pkgroll",
|
|
21
21
|
typecheck: "tsc --noEmit",
|
|
22
|
-
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 && npx tsx test/test-channel-http.mjs",
|
|
22
|
+
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-inbox-guard.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 && npx tsx test/test-channel-http.mjs && npx tsx test/test-wise-voice.mjs && npx tsx test/test-wise-voice-attach.mjs && npx tsx test/test-wise-machine.mjs",
|
|
23
23
|
"test:hypha": "node --no-warnings test/test-hypha-service.mjs",
|
|
24
24
|
dev: "tsx src/cli.ts",
|
|
25
25
|
"dev:daemon": "tsx src/cli.ts daemon start-sync",
|