svamp-cli 0.2.282 → 0.2.284
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-DPZaByla.mjs +235 -0
- package/dist/{agentCommands-C2SA3m-H.mjs → agentCommands-B23M4vER.mjs} +5 -5
- package/dist/{auth-Ei72rgtQ.mjs → auth-DPZSnISj.mjs} +1 -1
- package/dist/{cli-AqDROKlD.mjs → cli-D8tJd71c.mjs} +74 -67
- package/dist/cli.mjs +2 -2
- package/dist/{commands-CUO72eBO.mjs → commands-BABblJRp.mjs} +1 -1
- package/dist/{commands-CDl7rl3f.mjs → commands-BHO7rzSh.mjs} +1 -1
- package/dist/{commands-C6TKdbzy.mjs → commands-BqaOHWym.mjs} +7 -7
- package/dist/{commands-DJLs9f1R.mjs → commands-CDFhSKgn.mjs} +2 -2
- package/dist/{commands-COekL2o8.mjs → commands-Cp8G-iuw.mjs} +2 -2
- package/dist/{commands-BrWafMO7.mjs → commands-DDf0W30g.mjs} +2 -2
- package/dist/{commands-Cx74j8ot.mjs → commands-DqsoW-S0.mjs} +1 -1
- package/dist/{fleet-Dy9ZJ6vm.mjs → fleet-BxhHefua.mjs} +1 -1
- package/dist/{frpc-DjLzbAcP.mjs → frpc-BsR6aGNJ.mjs} +1 -1
- package/dist/{headlessCli-DttVTkeB.mjs → headlessCli-B-aMhdKx.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{notifyCommands-DfQLR_b_.mjs → notifyCommands-CfnthGpX.mjs} +1 -1
- package/dist/package-Br4fCS7J.mjs +64 -0
- package/dist/{rpc-ChQ7ArYi.mjs → rpc-B5BRaVsS.mjs} +1 -1
- package/dist/{rpc-zvlrNata.mjs → rpc-BjrKqEib.mjs} +1 -1
- package/dist/{run-D8PHZBGS.mjs → run-CRTzyKbn.mjs} +30 -99
- package/dist/{run-dVUrVaoC.mjs → run-DWJenrBe.mjs} +1 -1
- package/dist/{scheduler-CntyA8uK.mjs → scheduler-QYMtbUDe.mjs} +1 -1
- package/dist/{serveCommands-DcoJVqwb.mjs → serveCommands-Cj3MLbZb.mjs} +5 -5
- package/dist/{sideband-CpVC-tM4.mjs → sideband-CKmZxwY6.mjs} +1 -1
- package/package.json +2 -2
- package/dist/adminCommands-ChJ_O-_h.mjs +0 -100
- package/dist/package-D2hm0uj4.mjs +0 -64
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { writeFileSync, readFileSync } from 'fs';
|
|
2
2
|
import { resolve } from 'path';
|
|
3
|
-
import { connectAndGetMachine } from './commands-
|
|
3
|
+
import { connectAndGetMachine } from './commands-BABblJRp.mjs';
|
|
4
4
|
import 'node:fs';
|
|
5
5
|
import 'node:child_process';
|
|
6
6
|
import 'node:path';
|
|
7
7
|
import 'node:os';
|
|
8
|
-
import './run-
|
|
8
|
+
import './run-CRTzyKbn.mjs';
|
|
9
9
|
import 'os';
|
|
10
10
|
import 'fs/promises';
|
|
11
11
|
import 'url';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process';
|
|
2
|
-
import { j as resolveProjectRoot, I as workflowSteps, z as setWorkflowEnabled, E as isWorkflowEnabled, A as removeWorkflow, x as getWorkflow, D as listWorkflows, B as saveWorkflow, C as rawWorkflow } from './run-
|
|
2
|
+
import { j as resolveProjectRoot, I as workflowSteps, z as setWorkflowEnabled, E as isWorkflowEnabled, A as removeWorkflow, x as getWorkflow, D as listWorkflows, B as saveWorkflow, C as rawWorkflow } from './run-CRTzyKbn.mjs';
|
|
3
3
|
import 'os';
|
|
4
4
|
import 'fs/promises';
|
|
5
5
|
import 'fs';
|
|
@@ -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-CRTzyKbn.mjs';
|
|
5
5
|
import { PINNED_CLAUDE_CODE_VERSION } from './pinnedClaudeCode-BaMR97BE.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
@@ -4,7 +4,7 @@ import { mkdirSync, chmodSync, writeFileSync, unlinkSync, existsSync, readFileSy
|
|
|
4
4
|
import { join } from 'path';
|
|
5
5
|
import { homedir, platform, arch } from 'os';
|
|
6
6
|
import { randomUUID, createHash } from 'crypto';
|
|
7
|
-
import { e as getFrpsSubdomainHost, f as getFrpsServerPort, h as getFrpsServerAddr } from './run-
|
|
7
|
+
import { e as getFrpsSubdomainHost, f as getFrpsServerPort, h as getFrpsServerAddr } from './run-CRTzyKbn.mjs';
|
|
8
8
|
import 'fs/promises';
|
|
9
9
|
import 'url';
|
|
10
10
|
import 'node:crypto';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { handleRealtimeEvent, initMachineVoiceSession } from './sideband-
|
|
1
|
+
import { a0 as resolveModel, af as describeMisconfiguration, ag as buildMachineDeps } from './run-CRTzyKbn.mjs';
|
|
2
|
+
import { handleRealtimeEvent, initMachineVoiceSession } from './sideband-CKmZxwY6.mjs';
|
|
3
3
|
import { WebSocket } from 'ws';
|
|
4
4
|
import { execSync, spawn } from 'child_process';
|
|
5
5
|
import 'os';
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as connectToHypha, a as createSessionStore, d as daemonStatus, g as getHyphaServerUrl, r as registerMachineService, s as startDaemon, b as stopDaemon } from './run-
|
|
1
|
+
export { c as connectToHypha, a as createSessionStore, d as daemonStatus, g as getHyphaServerUrl, r as registerMachineService, s as startDaemon, b as stopDaemon } from './run-CRTzyKbn.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as connectToHypha, S as SharingNotificationSync, J as parseJwtEmail } from './run-
|
|
1
|
+
import { c as connectToHypha, S as SharingNotificationSync, J as parseJwtEmail } from './run-CRTzyKbn.mjs';
|
|
2
2
|
import { randomUUID } from 'node:crypto';
|
|
3
3
|
import { existsSync, readFileSync } from 'node:fs';
|
|
4
4
|
import { join } from 'node:path';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var name = "svamp-cli";
|
|
2
|
+
var version = "0.2.284";
|
|
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-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-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-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-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-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-graceful-restart.mjs && npx tsx test/test-flush-exit.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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as resolveProjectRoot, u as updateIssue, k as getIssue, l as resumeIssue, p as pauseIssue, m as addComment, n as addIssue, o as listIssues, q as searchIssues, t as isVisibleTo } from './run-
|
|
1
|
+
import { j as resolveProjectRoot, u as updateIssue, k as getIssue, l as resumeIssue, p as pauseIssue, m as addComment, n as addIssue, o as listIssues, q as searchIssues, t as isVisibleTo } from './run-CRTzyKbn.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as resolveProjectRoot, v as getRun, w as listRuns, x as getWorkflow, y as runWorkflow, z as setWorkflowEnabled, A as removeWorkflow, B as saveWorkflow, C as rawWorkflow, D as listWorkflows } from './run-
|
|
1
|
+
import { j as resolveProjectRoot, v as getRun, w as listRuns, x as getWorkflow, y as runWorkflow, z as setWorkflowEnabled, A as removeWorkflow, B as saveWorkflow, C as rawWorkflow, D as listWorkflows } from './run-CRTzyKbn.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -2973,7 +2973,7 @@ Connection: close\r
|
|
|
2973
2973
|
const mount = this.mounts.get(mountName);
|
|
2974
2974
|
const subdomainOverride = mount?.access === "link" && mount.linkToken ? /* @__PURE__ */ new Map([[this.port, buildLinkSubdomain(subdomainSafe, mount.linkToken)]]) : void 0;
|
|
2975
2975
|
try {
|
|
2976
|
-
const { FrpcTunnel } = await import('./frpc-
|
|
2976
|
+
const { FrpcTunnel } = await import('./frpc-BsR6aGNJ.mjs');
|
|
2977
2977
|
let tunnel;
|
|
2978
2978
|
tunnel = new FrpcTunnel({
|
|
2979
2979
|
name: tunnelName,
|
|
@@ -5816,7 +5816,7 @@ async function registerMachineService(server, machineId, metadata, daemonState,
|
|
|
5816
5816
|
const tunnels = handlers.tunnels;
|
|
5817
5817
|
if (!tunnels) throw new Error("Tunnel management not available");
|
|
5818
5818
|
if (tunnels.has(params.name)) throw new Error(`Tunnel '${params.name}' already running`);
|
|
5819
|
-
const { FrpcTunnel } = await import('./frpc-
|
|
5819
|
+
const { FrpcTunnel } = await import('./frpc-BsR6aGNJ.mjs');
|
|
5820
5820
|
const tunnel = new FrpcTunnel({
|
|
5821
5821
|
name: params.name,
|
|
5822
5822
|
ports: params.ports,
|
|
@@ -6292,7 +6292,7 @@ QUESTION: ${params.question || "Summarize this concisely."}` }
|
|
|
6292
6292
|
}
|
|
6293
6293
|
const deps = buildSessionDeps(rpc, { cwd, ownerEmail: owner });
|
|
6294
6294
|
const sender = { name: context?.user?.email || context?.user?.id || "user", kind: "user", verified: true };
|
|
6295
|
-
const { toolsForRole } = await import('./sideband-
|
|
6295
|
+
const { toolsForRole } = await import('./sideband-CKmZxwY6.mjs');
|
|
6296
6296
|
const r2 = await runWiseAgent({ message: params.message, sender, config: { tools: toolsForRole(role2) }, deps, transport, model: resolved.model });
|
|
6297
6297
|
return fmt(r2);
|
|
6298
6298
|
}
|
|
@@ -6391,7 +6391,7 @@ QUESTION: ${params.question || "Summarize this concisely."}` }
|
|
|
6391
6391
|
if (r.error || !r.sender) return { error: r.error || "unauthorized" };
|
|
6392
6392
|
const callId = "call_" + Math.random().toString(16).slice(2, 12);
|
|
6393
6393
|
const rendered = renderMessage(c, { sender: r.sender, body: { message: kwargs.message }, callId });
|
|
6394
|
-
const { queryCore } = await import('./commands-
|
|
6394
|
+
const { queryCore } = await import('./commands-BABblJRp.mjs');
|
|
6395
6395
|
const timeout = c.reply?.timeout_sec || 120;
|
|
6396
6396
|
let result;
|
|
6397
6397
|
try {
|
|
@@ -9446,13 +9446,14 @@ class SessionArtifactSync {
|
|
|
9446
9446
|
}
|
|
9447
9447
|
}
|
|
9448
9448
|
|
|
9449
|
-
const
|
|
9450
|
-
const
|
|
9451
|
-
const
|
|
9452
|
-
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9449
|
+
const SHARE_COLLECTION_ID = "public/svamp-shared-sessions";
|
|
9450
|
+
const EVENT_COLLECTION_ID = "public/svamp-user-events";
|
|
9451
|
+
const SYSTEM_COLLECTION_CONFIG = {
|
|
9452
|
+
permissions: { "@": "lf+" },
|
|
9453
|
+
private_children: true,
|
|
9454
|
+
recipient_field: "recipientEmail",
|
|
9455
|
+
recipient_can_delete: true
|
|
9456
|
+
};
|
|
9456
9457
|
function computeCollectionConfigUpdate(existingConfig, extra) {
|
|
9457
9458
|
const cfg = existingConfig || {};
|
|
9458
9459
|
const changed = Object.entries(extra).some(([k, v]) => JSON.stringify(cfg[k]) !== JSON.stringify(v));
|
|
@@ -9485,64 +9486,14 @@ class SharingNotificationSync {
|
|
|
9485
9486
|
this.log("[SHARING NOTIFY] Artifact manager not available");
|
|
9486
9487
|
return;
|
|
9487
9488
|
}
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
this.shareCollectionId = id;
|
|
9491
|
-
}),
|
|
9492
|
-
this.ensureCollection(EVENT_COLLECTION_ALIAS, "Svamp User Events", "General-purpose user event inbox for bell notifications", RECIPIENT_SCOPING_CONFIG).then((id) => {
|
|
9493
|
-
this.eventCollectionId = id;
|
|
9494
|
-
})
|
|
9495
|
-
]);
|
|
9489
|
+
this.shareCollectionId = SHARE_COLLECTION_ID;
|
|
9490
|
+
this.eventCollectionId = EVENT_COLLECTION_ID;
|
|
9496
9491
|
this.initialized = true;
|
|
9497
|
-
this.log(
|
|
9492
|
+
this.log(`[SHARING NOTIFY] Initialized (${EVENT_COLLECTION_ID} + ${SHARE_COLLECTION_ID})`);
|
|
9498
9493
|
} catch (err) {
|
|
9499
9494
|
this.log(`[SHARING NOTIFY] Init failed: ${err.message}`);
|
|
9500
9495
|
}
|
|
9501
9496
|
}
|
|
9502
|
-
async ensureCollection(alias, name, description, extraConfig) {
|
|
9503
|
-
try {
|
|
9504
|
-
const existing = await this.artifactManager.read({
|
|
9505
|
-
artifact_id: alias,
|
|
9506
|
-
_rkwargs: true
|
|
9507
|
-
});
|
|
9508
|
-
if (extraConfig && autoReconcileCollectionConfigEnabled()) {
|
|
9509
|
-
await this.reconcileCollectionConfig(alias, existing, extraConfig);
|
|
9510
|
-
}
|
|
9511
|
-
return existing.id;
|
|
9512
|
-
} catch {
|
|
9513
|
-
const collection = await this.artifactManager.create({
|
|
9514
|
-
alias,
|
|
9515
|
-
type: "collection",
|
|
9516
|
-
stage: true,
|
|
9517
|
-
manifest: { name, description },
|
|
9518
|
-
config: { permissions: { "*": "r", "@": "rw+" }, ...extraConfig || {} },
|
|
9519
|
-
_rkwargs: true
|
|
9520
|
-
});
|
|
9521
|
-
await this.artifactManager.commit({
|
|
9522
|
-
artifact_id: collection.id,
|
|
9523
|
-
_rkwargs: true
|
|
9524
|
-
});
|
|
9525
|
-
this.log(`[SHARING NOTIFY] Created collection: ${alias} (${collection.id})`);
|
|
9526
|
-
return collection.id;
|
|
9527
|
-
}
|
|
9528
|
-
}
|
|
9529
|
-
/**
|
|
9530
|
-
* Best-effort: add `extraConfig` keys to an EXISTING collection's config if missing (merged with
|
|
9531
|
-
* existing config/permissions). No-throw — a perms error on a non-owner daemon is expected and
|
|
9532
|
-
* harmless. See ensureCollection for the ownership rationale.
|
|
9533
|
-
*/
|
|
9534
|
-
async reconcileCollectionConfig(alias, existing, extraConfig) {
|
|
9535
|
-
try {
|
|
9536
|
-
const { changed, merged } = computeCollectionConfigUpdate(existing?.config, extraConfig);
|
|
9537
|
-
if (!changed) return;
|
|
9538
|
-
await this.artifactManager.edit({ artifact_id: existing.id, config: merged, _rkwargs: true });
|
|
9539
|
-
await this.artifactManager.commit({ artifact_id: existing.id, _rkwargs: true }).catch(() => {
|
|
9540
|
-
});
|
|
9541
|
-
this.log(`[SHARING NOTIFY] Reconciled config on ${alias} \u2014 added recipient-scoping flag`);
|
|
9542
|
-
} catch (err) {
|
|
9543
|
-
this.log(`[SHARING NOTIFY] Config reconcile on ${alias} skipped (need owner/admin rights): ${err?.message || err}`);
|
|
9544
|
-
}
|
|
9545
|
-
}
|
|
9546
9497
|
// ── Share bookmark artifacts (svamp-shared-sessions) ──────────────
|
|
9547
9498
|
async notifyShare(params) {
|
|
9548
9499
|
if (!this.initialized || !this.shareCollectionId) return;
|
|
@@ -9560,38 +9511,18 @@ class SharingNotificationSync {
|
|
|
9560
9511
|
shareType: params.shareType || "session"
|
|
9561
9512
|
};
|
|
9562
9513
|
try {
|
|
9563
|
-
const
|
|
9564
|
-
|
|
9514
|
+
const artifact = await this.artifactManager.create({
|
|
9515
|
+
alias,
|
|
9565
9516
|
parent_id: this.shareCollectionId,
|
|
9566
|
-
|
|
9567
|
-
|
|
9568
|
-
await this.artifactManager.edit({
|
|
9569
|
-
artifact_id: existing.id,
|
|
9517
|
+
type: "share-notification",
|
|
9518
|
+
stage: true,
|
|
9570
9519
|
manifest,
|
|
9571
9520
|
_rkwargs: true
|
|
9572
9521
|
});
|
|
9573
|
-
await this.artifactManager.commit({
|
|
9574
|
-
artifact_id: existing.id,
|
|
9575
|
-
_rkwargs: true
|
|
9522
|
+
await this.artifactManager.commit({ artifact_id: artifact.id, _rkwargs: true }).catch(() => {
|
|
9576
9523
|
});
|
|
9577
|
-
} catch {
|
|
9578
|
-
|
|
9579
|
-
const artifact = await this.artifactManager.create({
|
|
9580
|
-
alias,
|
|
9581
|
-
parent_id: this.shareCollectionId,
|
|
9582
|
-
type: "share-notification",
|
|
9583
|
-
stage: true,
|
|
9584
|
-
manifest,
|
|
9585
|
-
_rkwargs: true
|
|
9586
|
-
});
|
|
9587
|
-
await this.artifactManager.commit({
|
|
9588
|
-
artifact_id: artifact.id,
|
|
9589
|
-
_rkwargs: true
|
|
9590
|
-
});
|
|
9591
|
-
} catch (createErr) {
|
|
9592
|
-
this.log(`[SHARING NOTIFY] Failed to create share notification for ${params.recipientEmail}: ${createErr.message}`);
|
|
9593
|
-
return;
|
|
9594
|
-
}
|
|
9524
|
+
} catch (createErr) {
|
|
9525
|
+
this.log(`[SHARING NOTIFY] share-notification attach skipped for ${params.recipientEmail}: ${createErr.message}`);
|
|
9595
9526
|
}
|
|
9596
9527
|
this.log(`[SHARING NOTIFY] Share notified ${params.recipientEmail} about ${params.shareType || "session"} ${params.sessionId.slice(0, 8)}`);
|
|
9597
9528
|
const shareType = params.shareType || "session";
|
|
@@ -16214,7 +16145,7 @@ async function startDaemon(options) {
|
|
|
16214
16145
|
try {
|
|
16215
16146
|
const dir = loadSessionIndex()[sessionId]?.directory;
|
|
16216
16147
|
if (!dir) return;
|
|
16217
|
-
const { reconcileServiceLinks } = await import('./agentCommands-
|
|
16148
|
+
const { reconcileServiceLinks } = await import('./agentCommands-B23M4vER.mjs');
|
|
16218
16149
|
const configPath = getSvampConfigPath(dir, sessionId);
|
|
16219
16150
|
const config = readSvampConfig(configPath);
|
|
16220
16151
|
const entries = Array.from(urls.entries());
|
|
@@ -16232,7 +16163,7 @@ async function startDaemon(options) {
|
|
|
16232
16163
|
}
|
|
16233
16164
|
}
|
|
16234
16165
|
async function createExposedTunnel(spec) {
|
|
16235
|
-
const { FrpcTunnel } = await import('./frpc-
|
|
16166
|
+
const { FrpcTunnel } = await import('./frpc-BsR6aGNJ.mjs');
|
|
16236
16167
|
const tunnel = new FrpcTunnel({
|
|
16237
16168
|
name: spec.name,
|
|
16238
16169
|
ports: spec.ports,
|
|
@@ -18448,11 +18379,11 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
18448
18379
|
});
|
|
18449
18380
|
},
|
|
18450
18381
|
onIssue: async (params) => {
|
|
18451
|
-
const { issueRpc } = await import('./rpc-
|
|
18382
|
+
const { issueRpc } = await import('./rpc-B5BRaVsS.mjs');
|
|
18452
18383
|
return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner, rekickLoopOwner });
|
|
18453
18384
|
},
|
|
18454
18385
|
onWorkflow: async (params) => {
|
|
18455
|
-
const { workflowRpc } = await import('./rpc-
|
|
18386
|
+
const { workflowRpc } = await import('./rpc-BjrKqEib.mjs');
|
|
18456
18387
|
return workflowRpc(params?.cwd || directory, params || {});
|
|
18457
18388
|
},
|
|
18458
18389
|
onRipgrep: async (args, cwd) => {
|
|
@@ -19064,11 +18995,11 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
19064
18995
|
});
|
|
19065
18996
|
},
|
|
19066
18997
|
onIssue: async (params) => {
|
|
19067
|
-
const { issueRpc } = await import('./rpc-
|
|
18998
|
+
const { issueRpc } = await import('./rpc-B5BRaVsS.mjs');
|
|
19068
18999
|
return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner, rekickLoopOwner });
|
|
19069
19000
|
},
|
|
19070
19001
|
onWorkflow: async (params) => {
|
|
19071
|
-
const { workflowRpc } = await import('./rpc-
|
|
19002
|
+
const { workflowRpc } = await import('./rpc-BjrKqEib.mjs');
|
|
19072
19003
|
return workflowRpc(params?.cwd || directory, params || {});
|
|
19073
19004
|
},
|
|
19074
19005
|
onRipgrep: async (args, cwd) => {
|
|
@@ -20183,7 +20114,7 @@ ${oracle.output.trim().slice(0, 500)}`, "\u{1F501} Continuing loop");
|
|
|
20183
20114
|
const PING_TIMEOUT_MS = 15e3;
|
|
20184
20115
|
const POST_RECONNECT_GRACE_MS = 2e4;
|
|
20185
20116
|
const RECONNECT_JITTER_MS = 2500;
|
|
20186
|
-
const { WorkflowScheduler } = await import('./scheduler-
|
|
20117
|
+
const { WorkflowScheduler } = await import('./scheduler-QYMtbUDe.mjs');
|
|
20187
20118
|
const workflowScheduler = new WorkflowScheduler({
|
|
20188
20119
|
projectRoots: () => {
|
|
20189
20120
|
const dirs = /* @__PURE__ */ new Set();
|
|
@@ -20806,4 +20737,4 @@ var run = /*#__PURE__*/Object.freeze({
|
|
|
20806
20737
|
writeStopMarker: writeStopMarker
|
|
20807
20738
|
});
|
|
20808
20739
|
|
|
20809
|
-
export {
|
|
20740
|
+
export { listSkillFiles as $, removeWorkflow as A, saveWorkflow as B, rawWorkflow as C, listWorkflows as D, isWorkflowEnabled as E, workflowCrons as F, cronMatches as G, summarize as H, workflowSteps as I, parseJwtEmail as J, computeCollectionConfigUpdate as K, SYSTEM_COLLECTION_CONFIG as L, loadMachineContext as M, buildMachineInstructions as N, machineToolsForRole as O, buildMachineTools as P, parseFrontmatter as Q, READ_ONLY_TOOLS as R, SharingNotificationSync as S, getSkillsServer as T, getSkillsWorkspaceName as U, getSkillsCollectionName as V, fetchWithTimeout as W, searchSkills as X, SKILLS_DIR as Y, getSkillInfo as Z, downloadSkillFile as _, createSessionStore as a, resolveModel as a0, clearStopMarker as a1, stopMarkerExists as a2, formatHandle as a3, normalizeAllowedUser as a4, loadSecurityContextConfig as a5, resolveSecurityContext as a6, buildSecurityContextFromFlags as a7, mergeSecurityContexts as a8, buildSessionShareUrl as a9, computeOutboundHop as aa, registerAwaitingReply as ab, buildMachineShareUrl as ac, parseHandle as ad, handleMatchesMetadata as ae, describeMisconfiguration as af, buildMachineDeps as ag, applyClaudeProxyEnv as ah, composeSessionId as ai, generateFriendlyName as aj, generateHookSettings as ak, staticFileServer as al, instanceConfig as am, claudeAuth as an, codexProvider as ao, projectInfo as ap, DefaultTransport$1 as aq, acpBackend as ar, acpAgentConfig as as, codexAppServerBackend as at, GeminiTransport$1 as au, api as av, run as aw, stopDaemon as b, connectToHypha as c, daemonStatus as d, getFrpsSubdomainHost as e, getFrpsServerPort as f, getHyphaServerUrl$1 as g, getFrpsServerAddr as h, shortId as i, resolveProjectRoot as j, getIssue as k, resumeIssue as l, addComment as m, addIssue as n, listIssues as o, pauseIssue as p, searchIssues as q, registerMachineService as r, startDaemon as s, isVisibleTo as t, updateIssue as u, getRun as v, listRuns as w, getWorkflow as x, runWorkflow as y, setWorkflowEnabled as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import {
|
|
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-CRTzyKbn.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-
|
|
1
|
+
import { j as resolveProjectRoot, D as listWorkflows, E as isWorkflowEnabled, F as workflowCrons, y as runWorkflow, G as cronMatches } from './run-CRTzyKbn.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-
|
|
57
|
+
const { connectAndGetMachine } = await import('./commands-BABblJRp.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-BABblJRp.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-BABblJRp.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-BABblJRp.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-BABblJRp.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,
|
|
1
|
+
import { R as READ_ONLY_TOOLS, M as loadMachineContext, N as buildMachineInstructions, O as machineToolsForRole, P as buildMachineTools } from './run-CRTzyKbn.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.
|
|
3
|
+
"version": "0.2.284",
|
|
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-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-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-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-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-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-graceful-restart.mjs && npx tsx test/test-flush-exit.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-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-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-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-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-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-graceful-restart.mjs && npx tsx test/test-flush-exit.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,100 +0,0 @@
|
|
|
1
|
-
import { c as connectToHypha, K as computeCollectionConfigUpdate } from './run-D8PHZBGS.mjs';
|
|
2
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import os from 'node:os';
|
|
5
|
-
import 'os';
|
|
6
|
-
import 'fs/promises';
|
|
7
|
-
import 'fs';
|
|
8
|
-
import 'path';
|
|
9
|
-
import 'url';
|
|
10
|
-
import 'child_process';
|
|
11
|
-
import 'crypto';
|
|
12
|
-
import 'node:crypto';
|
|
13
|
-
import 'node:child_process';
|
|
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 loadEnv() {
|
|
25
|
-
const SVAMP_HOME = process.env.SVAMP_HOME || join(os.homedir(), ".svamp");
|
|
26
|
-
for (const f of [join(SVAMP_HOME, ".env"), join(os.homedir(), ".hypha", ".env")]) {
|
|
27
|
-
if (!existsSync(f)) continue;
|
|
28
|
-
try {
|
|
29
|
-
for (const line of readFileSync(f, "utf-8").split("\n")) {
|
|
30
|
-
const m = line.match(/^\s*([A-Za-z0-9_]+)\s*=\s*(.*)\s*$/);
|
|
31
|
-
if (m && process.env[m[1]] === void 0) process.env[m[1]] = m[2].replace(/^["']|["']$/g, "");
|
|
32
|
-
}
|
|
33
|
-
} catch {
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
async function setCollectionConfig(alias, configJson) {
|
|
38
|
-
if (!alias || !configJson) {
|
|
39
|
-
console.error("Usage: svamp admin set-collection-config <alias> --config '<json>'");
|
|
40
|
-
console.error(` e.g. svamp admin set-collection-config svamp-user-events --config '{"private_children":true,"recipient_field":"recipientEmail"}'`);
|
|
41
|
-
process.exit(1);
|
|
42
|
-
}
|
|
43
|
-
let extra;
|
|
44
|
-
try {
|
|
45
|
-
extra = JSON.parse(configJson);
|
|
46
|
-
if (!extra || typeof extra !== "object" || Array.isArray(extra)) throw new Error("config must be a JSON object");
|
|
47
|
-
} catch (e) {
|
|
48
|
-
console.error(`--config must be a JSON object: ${e.message}`);
|
|
49
|
-
process.exit(1);
|
|
50
|
-
}
|
|
51
|
-
loadEnv();
|
|
52
|
-
const serverUrl = process.env.HYPHA_SERVER_URL;
|
|
53
|
-
const token = process.env.HYPHA_TOKEN;
|
|
54
|
-
if (!serverUrl || !token) {
|
|
55
|
-
console.error('Not logged in. Run "svamp login <url>" first.');
|
|
56
|
-
process.exit(1);
|
|
57
|
-
}
|
|
58
|
-
let server;
|
|
59
|
-
try {
|
|
60
|
-
server = await connectToHypha({ serverUrl, token, name: "svamp-admin-cli" });
|
|
61
|
-
} catch (e) {
|
|
62
|
-
console.error(`Failed to connect to Hypha: ${e.message}`);
|
|
63
|
-
process.exit(1);
|
|
64
|
-
}
|
|
65
|
-
try {
|
|
66
|
-
const am = await server.getService("public/artifact-manager");
|
|
67
|
-
if (!am) {
|
|
68
|
-
console.error("Artifact manager not available.");
|
|
69
|
-
process.exit(1);
|
|
70
|
-
}
|
|
71
|
-
let col;
|
|
72
|
-
try {
|
|
73
|
-
col = await am.read({ artifact_id: alias, _rkwargs: true });
|
|
74
|
-
} catch (e) {
|
|
75
|
-
console.error(`Collection "${alias}" not found (or not readable): ${e.message}`);
|
|
76
|
-
process.exit(1);
|
|
77
|
-
}
|
|
78
|
-
const { changed, merged } = computeCollectionConfigUpdate(col.config, extra);
|
|
79
|
-
if (!changed) {
|
|
80
|
-
console.log(`${alias}: config already up to date (no change).`);
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
try {
|
|
84
|
-
await am.edit({ artifact_id: col.id, config: merged, _rkwargs: true });
|
|
85
|
-
await am.commit({ artifact_id: col.id, _rkwargs: true }).catch(() => {
|
|
86
|
-
});
|
|
87
|
-
} catch (e) {
|
|
88
|
-
console.error(`Failed to set config on "${alias}" (need owner/admin/root rights): ${e.message}`);
|
|
89
|
-
process.exit(1);
|
|
90
|
-
}
|
|
91
|
-
console.log(`\u2713 ${alias}: merged {${Object.keys(extra).join(", ")}} into config (existing keys preserved).`);
|
|
92
|
-
} finally {
|
|
93
|
-
try {
|
|
94
|
-
await server.disconnect?.();
|
|
95
|
-
} catch {
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export { setCollectionConfig };
|