svamp-cli 0.2.281 → 0.2.283
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-BfRJD2aA.mjs +205 -0
- package/dist/{agentCommands-i-qaq_2s.mjs → agentCommands-B23M4vER.mjs} +5 -5
- package/dist/{auth-DDr5dyj0.mjs → auth-DPZSnISj.mjs} +1 -1
- package/dist/{cli-Bp0pUO_8.mjs → cli-yOuFbsef.mjs} +74 -67
- package/dist/cli.mjs +2 -2
- package/dist/{commands-CdjKMUGJ.mjs → commands-BABblJRp.mjs} +1 -1
- package/dist/{commands-D8OeSTxb.mjs → commands-BHO7rzSh.mjs} +1 -1
- package/dist/{commands-CKM28jKj.mjs → commands-BqaOHWym.mjs} +7 -7
- package/dist/{commands-BnI1mRkf.mjs → commands-CRA262P3.mjs} +2 -2
- package/dist/{commands-DmdJbFhU.mjs → commands-Cp8G-iuw.mjs} +2 -2
- package/dist/{commands-Cz4cl4Th.mjs → commands-DDf0W30g.mjs} +2 -2
- package/dist/{commands-BFLKkIyS.mjs → commands-DqsoW-S0.mjs} +1 -1
- package/dist/{fleet-DCwX4RTF.mjs → fleet-BxhHefua.mjs} +1 -1
- package/dist/{frpc-Dst1Xkue.mjs → frpc-BsR6aGNJ.mjs} +1 -1
- package/dist/{headlessCli-CyCQlRjV.mjs → headlessCli-B-aMhdKx.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{notifyCommands-CfvUfjfP.mjs → notifyCommands-CfnthGpX.mjs} +1 -1
- package/dist/{package-DoBwyCNL.mjs → package-COj14J00.mjs} +1 -1
- package/dist/{rpc-DXZSyYAh.mjs → rpc-B5BRaVsS.mjs} +1 -1
- package/dist/{rpc-Dt3gekac.mjs → rpc-BjrKqEib.mjs} +1 -1
- package/dist/{run-DSlJ62Xb.mjs → run-CRTzyKbn.mjs} +30 -93
- package/dist/{run-C75iKIIt.mjs → run-DWJenrBe.mjs} +1 -1
- package/dist/{scheduler-CTndQ5_D.mjs → scheduler-QYMtbUDe.mjs} +1 -1
- package/dist/{serveCommands-CC32Vh-8.mjs → serveCommands-Cj3MLbZb.mjs} +5 -5
- package/dist/{sideband-DAZlMFIi.mjs → sideband-CKmZxwY6.mjs} +1 -1
- package/package.json +1 -1
- package/dist/adminCommands-Dc-nM2T4.mjs +0 -100
|
@@ -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';
|
|
@@ -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,9 +9446,14 @@ class SessionArtifactSync {
|
|
|
9446
9446
|
}
|
|
9447
9447
|
}
|
|
9448
9448
|
|
|
9449
|
-
const
|
|
9450
|
-
const
|
|
9451
|
-
const
|
|
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
|
+
};
|
|
9452
9457
|
function computeCollectionConfigUpdate(existingConfig, extra) {
|
|
9453
9458
|
const cfg = existingConfig || {};
|
|
9454
9459
|
const changed = Object.entries(extra).some(([k, v]) => JSON.stringify(cfg[k]) !== JSON.stringify(v));
|
|
@@ -9481,62 +9486,14 @@ class SharingNotificationSync {
|
|
|
9481
9486
|
this.log("[SHARING NOTIFY] Artifact manager not available");
|
|
9482
9487
|
return;
|
|
9483
9488
|
}
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
this.shareCollectionId = id;
|
|
9487
|
-
}),
|
|
9488
|
-
this.ensureCollection(EVENT_COLLECTION_ALIAS, "Svamp User Events", "General-purpose user event inbox for bell notifications", RECIPIENT_SCOPING_CONFIG).then((id) => {
|
|
9489
|
-
this.eventCollectionId = id;
|
|
9490
|
-
})
|
|
9491
|
-
]);
|
|
9489
|
+
this.shareCollectionId = SHARE_COLLECTION_ID;
|
|
9490
|
+
this.eventCollectionId = EVENT_COLLECTION_ID;
|
|
9492
9491
|
this.initialized = true;
|
|
9493
|
-
this.log(
|
|
9492
|
+
this.log(`[SHARING NOTIFY] Initialized (${EVENT_COLLECTION_ID} + ${SHARE_COLLECTION_ID})`);
|
|
9494
9493
|
} catch (err) {
|
|
9495
9494
|
this.log(`[SHARING NOTIFY] Init failed: ${err.message}`);
|
|
9496
9495
|
}
|
|
9497
9496
|
}
|
|
9498
|
-
async ensureCollection(alias, name, description, extraConfig) {
|
|
9499
|
-
try {
|
|
9500
|
-
const existing = await this.artifactManager.read({
|
|
9501
|
-
artifact_id: alias,
|
|
9502
|
-
_rkwargs: true
|
|
9503
|
-
});
|
|
9504
|
-
if (extraConfig) await this.reconcileCollectionConfig(alias, existing, extraConfig);
|
|
9505
|
-
return existing.id;
|
|
9506
|
-
} catch {
|
|
9507
|
-
const collection = await this.artifactManager.create({
|
|
9508
|
-
alias,
|
|
9509
|
-
type: "collection",
|
|
9510
|
-
stage: true,
|
|
9511
|
-
manifest: { name, description },
|
|
9512
|
-
config: { permissions: { "*": "r", "@": "rw+" }, ...extraConfig || {} },
|
|
9513
|
-
_rkwargs: true
|
|
9514
|
-
});
|
|
9515
|
-
await this.artifactManager.commit({
|
|
9516
|
-
artifact_id: collection.id,
|
|
9517
|
-
_rkwargs: true
|
|
9518
|
-
});
|
|
9519
|
-
this.log(`[SHARING NOTIFY] Created collection: ${alias} (${collection.id})`);
|
|
9520
|
-
return collection.id;
|
|
9521
|
-
}
|
|
9522
|
-
}
|
|
9523
|
-
/**
|
|
9524
|
-
* Best-effort: add `extraConfig` keys to an EXISTING collection's config if missing (merged with
|
|
9525
|
-
* existing config/permissions). No-throw — a perms error on a non-owner daemon is expected and
|
|
9526
|
-
* harmless. See ensureCollection for the ownership rationale.
|
|
9527
|
-
*/
|
|
9528
|
-
async reconcileCollectionConfig(alias, existing, extraConfig) {
|
|
9529
|
-
try {
|
|
9530
|
-
const { changed, merged } = computeCollectionConfigUpdate(existing?.config, extraConfig);
|
|
9531
|
-
if (!changed) return;
|
|
9532
|
-
await this.artifactManager.edit({ artifact_id: existing.id, config: merged, _rkwargs: true });
|
|
9533
|
-
await this.artifactManager.commit({ artifact_id: existing.id, _rkwargs: true }).catch(() => {
|
|
9534
|
-
});
|
|
9535
|
-
this.log(`[SHARING NOTIFY] Reconciled config on ${alias} \u2014 added recipient-scoping flag`);
|
|
9536
|
-
} catch (err) {
|
|
9537
|
-
this.log(`[SHARING NOTIFY] Config reconcile on ${alias} skipped (need owner/admin rights): ${err?.message || err}`);
|
|
9538
|
-
}
|
|
9539
|
-
}
|
|
9540
9497
|
// ── Share bookmark artifacts (svamp-shared-sessions) ──────────────
|
|
9541
9498
|
async notifyShare(params) {
|
|
9542
9499
|
if (!this.initialized || !this.shareCollectionId) return;
|
|
@@ -9554,38 +9511,18 @@ class SharingNotificationSync {
|
|
|
9554
9511
|
shareType: params.shareType || "session"
|
|
9555
9512
|
};
|
|
9556
9513
|
try {
|
|
9557
|
-
const
|
|
9558
|
-
|
|
9514
|
+
const artifact = await this.artifactManager.create({
|
|
9515
|
+
alias,
|
|
9559
9516
|
parent_id: this.shareCollectionId,
|
|
9560
|
-
|
|
9561
|
-
|
|
9562
|
-
await this.artifactManager.edit({
|
|
9563
|
-
artifact_id: existing.id,
|
|
9517
|
+
type: "share-notification",
|
|
9518
|
+
stage: true,
|
|
9564
9519
|
manifest,
|
|
9565
9520
|
_rkwargs: true
|
|
9566
9521
|
});
|
|
9567
|
-
await this.artifactManager.commit({
|
|
9568
|
-
artifact_id: existing.id,
|
|
9569
|
-
_rkwargs: true
|
|
9522
|
+
await this.artifactManager.commit({ artifact_id: artifact.id, _rkwargs: true }).catch(() => {
|
|
9570
9523
|
});
|
|
9571
|
-
} catch {
|
|
9572
|
-
|
|
9573
|
-
const artifact = await this.artifactManager.create({
|
|
9574
|
-
alias,
|
|
9575
|
-
parent_id: this.shareCollectionId,
|
|
9576
|
-
type: "share-notification",
|
|
9577
|
-
stage: true,
|
|
9578
|
-
manifest,
|
|
9579
|
-
_rkwargs: true
|
|
9580
|
-
});
|
|
9581
|
-
await this.artifactManager.commit({
|
|
9582
|
-
artifact_id: artifact.id,
|
|
9583
|
-
_rkwargs: true
|
|
9584
|
-
});
|
|
9585
|
-
} catch (createErr) {
|
|
9586
|
-
this.log(`[SHARING NOTIFY] Failed to create share notification for ${params.recipientEmail}: ${createErr.message}`);
|
|
9587
|
-
return;
|
|
9588
|
-
}
|
|
9524
|
+
} catch (createErr) {
|
|
9525
|
+
this.log(`[SHARING NOTIFY] share-notification attach skipped for ${params.recipientEmail}: ${createErr.message}`);
|
|
9589
9526
|
}
|
|
9590
9527
|
this.log(`[SHARING NOTIFY] Share notified ${params.recipientEmail} about ${params.shareType || "session"} ${params.sessionId.slice(0, 8)}`);
|
|
9591
9528
|
const shareType = params.shareType || "session";
|
|
@@ -16208,7 +16145,7 @@ async function startDaemon(options) {
|
|
|
16208
16145
|
try {
|
|
16209
16146
|
const dir = loadSessionIndex()[sessionId]?.directory;
|
|
16210
16147
|
if (!dir) return;
|
|
16211
|
-
const { reconcileServiceLinks } = await import('./agentCommands-
|
|
16148
|
+
const { reconcileServiceLinks } = await import('./agentCommands-B23M4vER.mjs');
|
|
16212
16149
|
const configPath = getSvampConfigPath(dir, sessionId);
|
|
16213
16150
|
const config = readSvampConfig(configPath);
|
|
16214
16151
|
const entries = Array.from(urls.entries());
|
|
@@ -16226,7 +16163,7 @@ async function startDaemon(options) {
|
|
|
16226
16163
|
}
|
|
16227
16164
|
}
|
|
16228
16165
|
async function createExposedTunnel(spec) {
|
|
16229
|
-
const { FrpcTunnel } = await import('./frpc-
|
|
16166
|
+
const { FrpcTunnel } = await import('./frpc-BsR6aGNJ.mjs');
|
|
16230
16167
|
const tunnel = new FrpcTunnel({
|
|
16231
16168
|
name: spec.name,
|
|
16232
16169
|
ports: spec.ports,
|
|
@@ -18442,11 +18379,11 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
18442
18379
|
});
|
|
18443
18380
|
},
|
|
18444
18381
|
onIssue: async (params) => {
|
|
18445
|
-
const { issueRpc } = await import('./rpc-
|
|
18382
|
+
const { issueRpc } = await import('./rpc-B5BRaVsS.mjs');
|
|
18446
18383
|
return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner, rekickLoopOwner });
|
|
18447
18384
|
},
|
|
18448
18385
|
onWorkflow: async (params) => {
|
|
18449
|
-
const { workflowRpc } = await import('./rpc-
|
|
18386
|
+
const { workflowRpc } = await import('./rpc-BjrKqEib.mjs');
|
|
18450
18387
|
return workflowRpc(params?.cwd || directory, params || {});
|
|
18451
18388
|
},
|
|
18452
18389
|
onRipgrep: async (args, cwd) => {
|
|
@@ -19058,11 +18995,11 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
19058
18995
|
});
|
|
19059
18996
|
},
|
|
19060
18997
|
onIssue: async (params) => {
|
|
19061
|
-
const { issueRpc } = await import('./rpc-
|
|
18998
|
+
const { issueRpc } = await import('./rpc-B5BRaVsS.mjs');
|
|
19062
18999
|
return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner, rekickLoopOwner });
|
|
19063
19000
|
},
|
|
19064
19001
|
onWorkflow: async (params) => {
|
|
19065
|
-
const { workflowRpc } = await import('./rpc-
|
|
19002
|
+
const { workflowRpc } = await import('./rpc-BjrKqEib.mjs');
|
|
19066
19003
|
return workflowRpc(params?.cwd || directory, params || {});
|
|
19067
19004
|
},
|
|
19068
19005
|
onRipgrep: async (args, cwd) => {
|
|
@@ -20177,7 +20114,7 @@ ${oracle.output.trim().slice(0, 500)}`, "\u{1F501} Continuing loop");
|
|
|
20177
20114
|
const PING_TIMEOUT_MS = 15e3;
|
|
20178
20115
|
const POST_RECONNECT_GRACE_MS = 2e4;
|
|
20179
20116
|
const RECONNECT_JITTER_MS = 2500;
|
|
20180
|
-
const { WorkflowScheduler } = await import('./scheduler-
|
|
20117
|
+
const { WorkflowScheduler } = await import('./scheduler-QYMtbUDe.mjs');
|
|
20181
20118
|
const workflowScheduler = new WorkflowScheduler({
|
|
20182
20119
|
projectRoots: () => {
|
|
20183
20120
|
const dirs = /* @__PURE__ */ new Set();
|
|
@@ -20800,4 +20737,4 @@ var run = /*#__PURE__*/Object.freeze({
|
|
|
20800
20737
|
writeStopMarker: writeStopMarker
|
|
20801
20738
|
});
|
|
20802
20739
|
|
|
20803
|
-
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,100 +0,0 @@
|
|
|
1
|
-
import { c as connectToHypha, K as computeCollectionConfigUpdate } from './run-DSlJ62Xb.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 };
|