svamp-cli 0.2.257 → 0.2.258
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-fCsOp7ko.mjs → agentCommands-CQ89BZon.mjs} +5 -5
- package/dist/{auth-BH6Awl3O.mjs → auth-CaFsKYbx.mjs} +1 -1
- package/dist/cli.mjs +61 -61
- package/dist/{commands-BpNDUqvv.mjs → commands--X8f4eSr.mjs} +24 -13
- package/dist/{commands-B5veY89L.mjs → commands-B6eGMF5H.mjs} +1 -1
- package/dist/{commands-BzF6GzdR.mjs → commands-BgX0W0uK.mjs} +1 -1
- package/dist/{commands-CE1PdEJJ.mjs → commands-D8l74hsL.mjs} +1 -1
- package/dist/{commands-BCmpKBjg.mjs → commands-Dd8xEIf0.mjs} +1 -1
- package/dist/{commands-DNIxtTXe.mjs → commands-DrfYv705.mjs} +2 -2
- package/dist/{commands-B6BkPRui.mjs → commands-DutfM3U7.mjs} +2 -2
- package/dist/{fleet-XYsLuf-3.mjs → fleet-UvQnIWT1.mjs} +1 -1
- package/dist/{frpc-QESvQN-s.mjs → frpc-IXxyfgPn.mjs} +1 -1
- package/dist/{headlessCli-DuCmcrAL.mjs → headlessCli-BK7WSS3D.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{package-BA3c2JLu.mjs → package-BdZX5mDv.mjs} +2 -2
- package/dist/{rpc-DCeDG4c7.mjs → rpc-CyACkgY1.mjs} +1 -1
- package/dist/{rpc-Bscxex4z.mjs → rpc-D7DB3XCH.mjs} +1 -1
- package/dist/{run-BtGnnEMI.mjs → run-C1Unk4Zx.mjs} +11 -11
- package/dist/{run-BmOCcZRG.mjs → run-C1ufZjIW.mjs} +1 -1
- package/dist/{scheduler-Dbqmnd_o.mjs → scheduler-7wve0Fy3.mjs} +1 -1
- package/dist/{serveCommands-DueTsJSe.mjs → serveCommands-iQJJLsMJ.mjs} +5 -5
- package/dist/{serveManager-BclzoPIb.mjs → serveManager-BszV0oIl.mjs} +62 -74
- package/dist/{sideband-C_ifGgde.mjs → sideband-DMPZ-ZoR.mjs} +1 -1
- package/dist/staticFileServer-FCEOLIYH.mjs +239 -0
- package/package.json +2 -2
- package/dist/caddy-CuTbE3NY.mjs +0 -322
|
@@ -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-D8l74hsL.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-C1Unk4Zx.mjs';
|
|
9
9
|
import 'os';
|
|
10
10
|
import 'fs/promises';
|
|
11
11
|
import 'url';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
|
-
import { connectAndGetMachine, resolveSessionId, createWorktree, connectAndResolveSession } from './commands-
|
|
3
|
+
import { connectAndGetMachine, resolveSessionId, createWorktree, connectAndResolveSession } from './commands-D8l74hsL.mjs';
|
|
4
4
|
import { execSync } from 'node:child_process';
|
|
5
|
-
import { u as updateIssue, t as addComment, v as addIssue, k as shortId } from './run-
|
|
5
|
+
import { u as updateIssue, t as addComment, v as addIssue, k as shortId } from './run-C1Unk4Zx.mjs';
|
|
6
6
|
import 'node:os';
|
|
7
7
|
import 'os';
|
|
8
8
|
import 'fs/promises';
|
|
@@ -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-C1Unk4Zx.mjs';
|
|
5
5
|
import { PINNED_CLAUDE_CODE_VERSION } from './pinnedClaudeCode-DuLXaoGP.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
@@ -4,7 +4,7 @@ import { mkdirSync, writeFileSync, unlinkSync, existsSync, chmodSync, readFileSy
|
|
|
4
4
|
import { join } from 'path';
|
|
5
5
|
import { homedir, platform, arch } from 'os';
|
|
6
6
|
import { randomUUID, createHash } from 'crypto';
|
|
7
|
-
import { h as getFrpsSubdomainHost, i as getFrpsServerPort, j as getFrpsServerAddr } from './run-
|
|
7
|
+
import { h as getFrpsSubdomainHost, i as getFrpsServerPort, j as getFrpsServerAddr } from './run-C1Unk4Zx.mjs';
|
|
8
8
|
import 'fs/promises';
|
|
9
9
|
import 'url';
|
|
10
10
|
import 'node:crypto';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a1 as resolveModel, ae as describeMisconfiguration, af as buildMachineDeps } from './run-
|
|
2
|
-
import { handleRealtimeEvent, initMachineVoiceSession } from './sideband-
|
|
1
|
+
import { a1 as resolveModel, ae as describeMisconfiguration, af as buildMachineDeps } from './run-C1Unk4Zx.mjs';
|
|
2
|
+
import { handleRealtimeEvent, initMachineVoiceSession } from './sideband-DMPZ-ZoR.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-C1Unk4Zx.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var name = "svamp-cli";
|
|
2
|
-
var version = "0.2.
|
|
2
|
+
var version = "0.2.258";
|
|
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 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
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-btw-proxy-env.mjs && npx tsx test/test-output-formatters.mjs && npx tsx test/test-inbox-guard.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-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-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-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-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-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",
|
|
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-btw-proxy-env.mjs && npx tsx test/test-output-formatters.mjs && npx tsx test/test-inbox-guard.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-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-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-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-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-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",
|
|
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",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as resolveProjectRoot, z as getRun, A as listRuns, B as getWorkflow, C as runWorkflow, D as setWorkflowEnabled, E as removeWorkflow, F as saveWorkflow, G as rawWorkflow, H as listWorkflows } from './run-
|
|
1
|
+
import { n as resolveProjectRoot, z as getRun, A as listRuns, B as getWorkflow, C as runWorkflow, D as setWorkflowEnabled, E as removeWorkflow, F as saveWorkflow, G as rawWorkflow, H as listWorkflows } from './run-C1Unk4Zx.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as resolveProjectRoot, u as updateIssue, o as getIssue, p as resumeIssue, q as pauseIssue, t as addComment, v as addIssue, w as listIssues, x as searchIssues, y as isVisibleTo } from './run-
|
|
1
|
+
import { n as resolveProjectRoot, u as updateIssue, o as getIssue, p as resumeIssue, q as pauseIssue, t as addComment, v as addIssue, w as listIssues, x as searchIssues, y as isVisibleTo } from './run-C1Unk4Zx.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -2985,7 +2985,7 @@ async function registerMachineService(server, machineId, metadata, daemonState,
|
|
|
2985
2985
|
const tunnels = handlers.tunnels;
|
|
2986
2986
|
if (!tunnels) throw new Error("Tunnel management not available");
|
|
2987
2987
|
if (tunnels.has(params.name)) throw new Error(`Tunnel '${params.name}' already running`);
|
|
2988
|
-
const { FrpcTunnel } = await import('./frpc-
|
|
2988
|
+
const { FrpcTunnel } = await import('./frpc-IXxyfgPn.mjs');
|
|
2989
2989
|
const tunnel = new FrpcTunnel({
|
|
2990
2990
|
name: params.name,
|
|
2991
2991
|
ports: params.ports,
|
|
@@ -3452,7 +3452,7 @@ QUESTION: ${params.question || "Summarize this concisely."}` }
|
|
|
3452
3452
|
}
|
|
3453
3453
|
const deps = buildSessionDeps(rpc, { cwd, ownerEmail: owner });
|
|
3454
3454
|
const sender = { name: context?.user?.email || context?.user?.id || "user", kind: "user", verified: true };
|
|
3455
|
-
const { toolsForRole } = await import('./sideband-
|
|
3455
|
+
const { toolsForRole } = await import('./sideband-DMPZ-ZoR.mjs');
|
|
3456
3456
|
const r2 = await runWiseAgent({ message: params.message, sender, config: { tools: toolsForRole(role2) }, deps, transport, model: resolved.model });
|
|
3457
3457
|
return fmt(r2);
|
|
3458
3458
|
}
|
|
@@ -3551,7 +3551,7 @@ QUESTION: ${params.question || "Summarize this concisely."}` }
|
|
|
3551
3551
|
if (r.error || !r.sender) return { error: r.error || "unauthorized" };
|
|
3552
3552
|
const callId = "call_" + Math.random().toString(16).slice(2, 12);
|
|
3553
3553
|
const rendered = renderMessage(c, { sender: r.sender, body: { message: kwargs.message }, callId });
|
|
3554
|
-
const { queryCore } = await import('./commands-
|
|
3554
|
+
const { queryCore } = await import('./commands-D8l74hsL.mjs');
|
|
3555
3555
|
const timeout = c.reply?.timeout_sec || 120;
|
|
3556
3556
|
let result;
|
|
3557
3557
|
try {
|
|
@@ -13558,7 +13558,7 @@ async function startDaemon(options) {
|
|
|
13558
13558
|
try {
|
|
13559
13559
|
const dir = loadSessionIndex()[sessionId]?.directory;
|
|
13560
13560
|
if (!dir) return;
|
|
13561
|
-
const { reconcileServiceLinks } = await import('./agentCommands-
|
|
13561
|
+
const { reconcileServiceLinks } = await import('./agentCommands-CQ89BZon.mjs');
|
|
13562
13562
|
const configPath = getSvampConfigPath(dir, sessionId);
|
|
13563
13563
|
const config = readSvampConfig(configPath);
|
|
13564
13564
|
const entries = Array.from(urls.entries());
|
|
@@ -13576,7 +13576,7 @@ async function startDaemon(options) {
|
|
|
13576
13576
|
}
|
|
13577
13577
|
}
|
|
13578
13578
|
async function createExposedTunnel(spec) {
|
|
13579
|
-
const { FrpcTunnel } = await import('./frpc-
|
|
13579
|
+
const { FrpcTunnel } = await import('./frpc-IXxyfgPn.mjs');
|
|
13580
13580
|
const tunnel = new FrpcTunnel({
|
|
13581
13581
|
name: spec.name,
|
|
13582
13582
|
ports: spec.ports,
|
|
@@ -13597,7 +13597,7 @@ async function startDaemon(options) {
|
|
|
13597
13597
|
}
|
|
13598
13598
|
const tunnelRecreateState = /* @__PURE__ */ new Map();
|
|
13599
13599
|
const tunnelRecreateInFlight = /* @__PURE__ */ new Set();
|
|
13600
|
-
const { ServeManager } = await import('./serveManager-
|
|
13600
|
+
const { ServeManager } = await import('./serveManager-BszV0oIl.mjs');
|
|
13601
13601
|
const serveManager = new ServeManager(SVAMP_HOME, (msg) => logger.log(`[SERVE] ${msg}`), hyphaServerUrl);
|
|
13602
13602
|
ensureAutoInstalledSkills(logger).catch(() => {
|
|
13603
13603
|
});
|
|
@@ -15713,11 +15713,11 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
15713
15713
|
});
|
|
15714
15714
|
},
|
|
15715
15715
|
onIssue: async (params) => {
|
|
15716
|
-
const { issueRpc } = await import('./rpc-
|
|
15716
|
+
const { issueRpc } = await import('./rpc-D7DB3XCH.mjs');
|
|
15717
15717
|
return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner, rekickLoopOwner });
|
|
15718
15718
|
},
|
|
15719
15719
|
onWorkflow: async (params) => {
|
|
15720
|
-
const { workflowRpc } = await import('./rpc-
|
|
15720
|
+
const { workflowRpc } = await import('./rpc-CyACkgY1.mjs');
|
|
15721
15721
|
return workflowRpc(params?.cwd || directory, params || {});
|
|
15722
15722
|
},
|
|
15723
15723
|
onRipgrep: async (args, cwd) => {
|
|
@@ -16266,11 +16266,11 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
16266
16266
|
});
|
|
16267
16267
|
},
|
|
16268
16268
|
onIssue: async (params) => {
|
|
16269
|
-
const { issueRpc } = await import('./rpc-
|
|
16269
|
+
const { issueRpc } = await import('./rpc-D7DB3XCH.mjs');
|
|
16270
16270
|
return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner, rekickLoopOwner });
|
|
16271
16271
|
},
|
|
16272
16272
|
onWorkflow: async (params) => {
|
|
16273
|
-
const { workflowRpc } = await import('./rpc-
|
|
16273
|
+
const { workflowRpc } = await import('./rpc-CyACkgY1.mjs');
|
|
16274
16274
|
return workflowRpc(params?.cwd || directory, params || {});
|
|
16275
16275
|
},
|
|
16276
16276
|
onRipgrep: async (args, cwd) => {
|
|
@@ -17235,7 +17235,7 @@ ${oracle.output.trim().slice(0, 500)}`, "\u{1F501} Continuing loop");
|
|
|
17235
17235
|
const PING_TIMEOUT_MS = 15e3;
|
|
17236
17236
|
const POST_RECONNECT_GRACE_MS = 2e4;
|
|
17237
17237
|
const RECONNECT_JITTER_MS = 2500;
|
|
17238
|
-
const { WorkflowScheduler } = await import('./scheduler-
|
|
17238
|
+
const { WorkflowScheduler } = await import('./scheduler-7wve0Fy3.mjs');
|
|
17239
17239
|
const workflowScheduler = new WorkflowScheduler({
|
|
17240
17240
|
projectRoots: () => {
|
|
17241
17241
|
const dirs = /* @__PURE__ */ new Set();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import { ag as applyClaudeProxyEnv, ah as composeSessionId, ai as generateFriendlyName, c as connectToHypha, a as createSessionStore, r as registerMachineService, aj as generateHookSettings } from './run-
|
|
1
|
+
import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import { ag as applyClaudeProxyEnv, ah as composeSessionId, ai as generateFriendlyName, c as connectToHypha, a as createSessionStore, r as registerMachineService, aj as generateHookSettings } from './run-C1Unk4Zx.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 { n as resolveProjectRoot, H as listWorkflows, I as isWorkflowEnabled, J as workflowCrons, C as runWorkflow, K as cronMatches } from './run-
|
|
1
|
+
import { n as resolveProjectRoot, H as listWorkflows, I as isWorkflowEnabled, J as workflowCrons, C as runWorkflow, K as cronMatches } from './run-C1Unk4Zx.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-D8l74hsL.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-D8l74hsL.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-D8l74hsL.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-D8l74hsL.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-D8l74hsL.mjs');
|
|
239
239
|
const { machine, server } = await connectAndGetMachine(machineId);
|
|
240
240
|
try {
|
|
241
241
|
const info = await machine.serveInfo();
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { spawn } from 'child_process';
|
|
1
|
+
import { spawn, execSync } from 'child_process';
|
|
2
2
|
import * as crypto from 'crypto';
|
|
3
3
|
import * as fs from 'fs';
|
|
4
4
|
import * as http from 'http';
|
|
5
5
|
import * as net from 'net';
|
|
6
6
|
import * as path from 'path';
|
|
7
|
-
import {
|
|
7
|
+
import { serveStaticMount } from './staticFileServer-FCEOLIYH.mjs';
|
|
8
|
+
import { l as getHyphaServerUrl, S as ServeAuth, m as hasCookieToken } from './run-C1Unk4Zx.mjs';
|
|
8
9
|
import 'os';
|
|
9
10
|
import 'fs/promises';
|
|
10
11
|
import 'url';
|
|
@@ -56,6 +57,27 @@ async function tryReservePort(preferred) {
|
|
|
56
57
|
});
|
|
57
58
|
});
|
|
58
59
|
}
|
|
60
|
+
function killOrphanedCaddy(log) {
|
|
61
|
+
if (process.platform === "win32") return;
|
|
62
|
+
try {
|
|
63
|
+
const out = execSync("ps -axo pid=,command=", { encoding: "utf-8" });
|
|
64
|
+
const pids = [];
|
|
65
|
+
for (const line of out.split("\n")) {
|
|
66
|
+
const m = /^\s*(\d+)\s+(.*)$/.exec(line);
|
|
67
|
+
if (!m) continue;
|
|
68
|
+
const [, pid, cmd] = m;
|
|
69
|
+
if (cmd.includes(".svamp/bin/caddy") && pid !== String(process.pid)) pids.push(pid);
|
|
70
|
+
}
|
|
71
|
+
for (const pid of pids) {
|
|
72
|
+
try {
|
|
73
|
+
process.kill(Number(pid), "SIGKILL");
|
|
74
|
+
} catch {
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (pids.length) log(`Reaped ${pids.length} orphaned Caddy process(es) \u2014 retired in favor of the native file server (#0358).`);
|
|
78
|
+
} catch {
|
|
79
|
+
}
|
|
80
|
+
}
|
|
59
81
|
const MOUNT_NAME_RE = /^[a-zA-Z0-9][a-zA-Z0-9._-]*$/;
|
|
60
82
|
function validateMountName(name) {
|
|
61
83
|
if (!name || name.length > 128) {
|
|
@@ -68,18 +90,14 @@ function validateMountName(name) {
|
|
|
68
90
|
class ServeManager {
|
|
69
91
|
mounts = /* @__PURE__ */ new Map();
|
|
70
92
|
port = 0;
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
// Caddy internal port
|
|
74
|
-
/** Last-used ports loaded from disk — used as preferred values on next start
|
|
93
|
+
// public HTTP server port (serves static files natively — #0358)
|
|
94
|
+
/** Last-used port loaded from disk — used as the preferred value on next start
|
|
75
95
|
* so external configs (tunnels, cron, bookmarks) survive daemon restarts. */
|
|
76
96
|
persistedPort;
|
|
77
|
-
persistedCaddyPort;
|
|
78
97
|
/** Per-mount frpc tunnel — each mount gets its own subdomain `static-<name>-<hash>`. */
|
|
79
98
|
mountTunnels = /* @__PURE__ */ new Map();
|
|
80
99
|
/** hostname (lowercased, no port) → mount name. Updated when tunnels connect. */
|
|
81
100
|
hostToMount = /* @__PURE__ */ new Map();
|
|
82
|
-
caddy = null;
|
|
83
101
|
proxyServer = null;
|
|
84
102
|
auth = null;
|
|
85
103
|
/** Live child processes for managed mounts. Keyed by mount name. */
|
|
@@ -159,9 +177,6 @@ class ServeManager {
|
|
|
159
177
|
};
|
|
160
178
|
this.mounts.set(spec.name, mount);
|
|
161
179
|
await this.ensureRunning();
|
|
162
|
-
if (resolvedDir && this.caddy?.isRunning) {
|
|
163
|
-
await this.caddy.addMount(spec.name, resolvedDir);
|
|
164
|
-
}
|
|
165
180
|
await this.startMountTunnel(spec.name);
|
|
166
181
|
if (spec.process && !spec.process.wakeOnRequest) {
|
|
167
182
|
try {
|
|
@@ -198,13 +213,6 @@ class ServeManager {
|
|
|
198
213
|
for (const [host, mountName] of this.hostToMount.entries()) {
|
|
199
214
|
if (mountName === name) this.hostToMount.delete(host);
|
|
200
215
|
}
|
|
201
|
-
if (this.caddy?.isRunning) {
|
|
202
|
-
try {
|
|
203
|
-
await this.caddy.removeMount(name);
|
|
204
|
-
} catch (err) {
|
|
205
|
-
this.log(`Warning: Caddy mount removal failed: ${err.message}`);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
216
|
this.persist();
|
|
209
217
|
this.log(`Mount removed: ${name}`);
|
|
210
218
|
if (this.mounts.size === 0) {
|
|
@@ -225,12 +233,12 @@ class ServeManager {
|
|
|
225
233
|
* Get server info — each mount has its own URL (per-mount subdomain).
|
|
226
234
|
*/
|
|
227
235
|
getInfo() {
|
|
228
|
-
const running = this.
|
|
236
|
+
const running = this.proxyServer != null;
|
|
229
237
|
const firstMount = this.mounts.values().next().value;
|
|
230
238
|
const firstUrl = firstMount ? this.getMountUrl(firstMount.name) : null;
|
|
231
239
|
return {
|
|
232
240
|
url: firstUrl,
|
|
233
|
-
port: running ? this.
|
|
241
|
+
port: running ? this.port : 0,
|
|
234
242
|
authProxyPort: running ? this.port : 0,
|
|
235
243
|
running,
|
|
236
244
|
mountCount: this.mounts.size,
|
|
@@ -249,7 +257,6 @@ class ServeManager {
|
|
|
249
257
|
if (!fs.existsSync(this.persistFile)) return;
|
|
250
258
|
const raw = JSON.parse(fs.readFileSync(this.persistFile, "utf-8"));
|
|
251
259
|
this.persistedPort = raw.port;
|
|
252
|
-
this.persistedCaddyPort = raw.caddyPort;
|
|
253
260
|
if (!raw.mounts || raw.mounts.length === 0) return;
|
|
254
261
|
let restoredCount = 0;
|
|
255
262
|
for (const m of raw.mounts) {
|
|
@@ -327,11 +334,6 @@ class ServeManager {
|
|
|
327
334
|
await new Promise((resolve) => this.proxyServer.close(() => resolve()));
|
|
328
335
|
this.proxyServer = null;
|
|
329
336
|
}
|
|
330
|
-
if (this.caddy) {
|
|
331
|
-
await this.caddy.stop();
|
|
332
|
-
this.caddy = null;
|
|
333
|
-
this.log("Caddy stopped");
|
|
334
|
-
}
|
|
335
337
|
this.auth?.destroy();
|
|
336
338
|
}
|
|
337
339
|
// ── Managed-process lifecycle ─────────────────────────────────────────
|
|
@@ -488,8 +490,7 @@ class ServeManager {
|
|
|
488
490
|
persist() {
|
|
489
491
|
const state = {
|
|
490
492
|
mounts: Array.from(this.mounts.values()),
|
|
491
|
-
...this.port > 0 ? { port: this.port } : {}
|
|
492
|
-
...this.caddyPort > 0 ? { caddyPort: this.caddyPort } : {}
|
|
493
|
+
...this.port > 0 ? { port: this.port } : {}
|
|
493
494
|
};
|
|
494
495
|
try {
|
|
495
496
|
fs.writeFileSync(this.persistFile, JSON.stringify(state, null, 2));
|
|
@@ -499,32 +500,24 @@ class ServeManager {
|
|
|
499
500
|
}
|
|
500
501
|
/** Start auth proxy + Caddy if not already running. Per-mount tunnels are started separately. */
|
|
501
502
|
async ensureRunning() {
|
|
502
|
-
if (this.
|
|
503
|
-
|
|
503
|
+
if (this.proxyServer) return;
|
|
504
|
+
killOrphanedCaddy((m) => this.log(m));
|
|
504
505
|
this.port = await tryReservePort(this.persistedPort);
|
|
505
|
-
const adminPort = await findFreePort();
|
|
506
506
|
if (this.persistedPort && this.port !== this.persistedPort) {
|
|
507
507
|
this.log(`\u26A0 Previous serve port ${this.persistedPort} unavailable \u2014 using ${this.port}. Downstream configs referencing the old port will need updating.`);
|
|
508
508
|
}
|
|
509
|
-
if (this.persistedCaddyPort && this.caddyPort !== this.persistedCaddyPort) {
|
|
510
|
-
this.log(`\u26A0 Previous Caddy port ${this.persistedCaddyPort} unavailable \u2014 using ${this.caddyPort} (Caddy is internal; no downstream impact).`);
|
|
511
|
-
}
|
|
512
|
-
const { CaddyManager } = await import('./caddy-CuTbE3NY.mjs');
|
|
513
|
-
this.caddy = new CaddyManager({
|
|
514
|
-
listenPort: this.caddyPort,
|
|
515
|
-
adminPort,
|
|
516
|
-
configDir: path.join(path.dirname(this.persistFile), "caddy"),
|
|
517
|
-
log: (msg) => this.log(`[Caddy] ${msg}`)
|
|
518
|
-
});
|
|
519
|
-
for (const mount of this.mounts.values()) {
|
|
520
|
-
if (mount.directory) {
|
|
521
|
-
await this.caddy.addMount(mount.name, mount.directory);
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
await this.caddy.start();
|
|
525
|
-
this.log(`Caddy file server started on 127.0.0.1:${this.caddyPort}`);
|
|
526
509
|
await this.startAuthProxy();
|
|
527
|
-
this.log(`
|
|
510
|
+
this.log(`Static file server started on 127.0.0.1:${this.port}`);
|
|
511
|
+
}
|
|
512
|
+
/** Minimal mount-listing page for the server root (replaces Caddy's root route). */
|
|
513
|
+
mountListHtml() {
|
|
514
|
+
const esc = (s) => s.replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[c]);
|
|
515
|
+
const items = Array.from(this.mounts.values()).filter((m) => m.directory).map((m) => `<li><a href="/${esc(m.name)}/">${esc(m.name)}</a> \u2014 ${esc(m.directory || "")}</li>`).join("\n");
|
|
516
|
+
return `<!DOCTYPE html><html><head><meta charset="utf-8"><title>Svamp File Server</title>
|
|
517
|
+
<style>body{font-family:system-ui,sans-serif;max-width:700px;margin:40px auto;padding:0 20px;color:#333}
|
|
518
|
+
h1{font-size:1.3rem}ul{list-style:none;padding:0}li{padding:8px 0;border-bottom:1px solid #eee}
|
|
519
|
+
a{color:#0969da;text-decoration:none;font-weight:500}a:hover{text-decoration:underline}</style></head>
|
|
520
|
+
<body><h1>Svamp File Server</h1><ul>${items || "<li>No mounts registered.</li>"}</ul></body></html>`;
|
|
528
521
|
}
|
|
529
522
|
/** Start a lightweight Node.js HTTP proxy with auth + upload support. */
|
|
530
523
|
startAuthProxy() {
|
|
@@ -658,7 +651,7 @@ class ServeManager {
|
|
|
658
651
|
const handle = this.managedProcs.get(mount.name);
|
|
659
652
|
if (handle) handle.lastRequestAt = Date.now();
|
|
660
653
|
const targetPath = mountResolvedByHost ? req.url || "/" : (basePath || "/") + (url.search || "");
|
|
661
|
-
const
|
|
654
|
+
const proxyReq = http.request({
|
|
662
655
|
hostname: "127.0.0.1",
|
|
663
656
|
port: cfg.port,
|
|
664
657
|
path: targetPath,
|
|
@@ -668,37 +661,32 @@ class ServeManager {
|
|
|
668
661
|
res.writeHead(proxyRes.statusCode || 200, proxyRes.headers);
|
|
669
662
|
proxyRes.pipe(res);
|
|
670
663
|
});
|
|
671
|
-
|
|
664
|
+
proxyReq.on("error", (err) => {
|
|
672
665
|
if (!res.headersSent) {
|
|
673
666
|
res.writeHead(502);
|
|
674
667
|
res.end(`Backend error: ${err.message}`);
|
|
675
668
|
}
|
|
676
669
|
});
|
|
677
|
-
req.pipe(
|
|
670
|
+
req.pipe(proxyReq);
|
|
678
671
|
return;
|
|
679
672
|
}
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
673
|
+
if (mount && mount.directory) {
|
|
674
|
+
serveStaticMount(req, res, {
|
|
675
|
+
rootDir: mount.directory,
|
|
676
|
+
relPath: basePath || "/",
|
|
677
|
+
// Path-based access is prefixed with /<mountName>; host-based has no prefix.
|
|
678
|
+
mountUrlPrefix: mountResolvedByHost ? "" : `/${mountName}`,
|
|
679
|
+
browse: true});
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
const cors = { "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Methods": "GET, HEAD, OPTIONS", "Access-Control-Allow-Headers": "*" };
|
|
683
|
+
if (url.pathname === "/" || basePath === "/") {
|
|
684
|
+
res.writeHead(200, { ...cors, "Content-Type": "text/html; charset=utf-8", "Cache-Control": "no-store" });
|
|
685
|
+
res.end(this.mountListHtml());
|
|
686
|
+
} else {
|
|
687
|
+
res.writeHead(404, { ...cors, "Content-Type": "text/plain" });
|
|
688
|
+
res.end("Not found");
|
|
684
689
|
}
|
|
685
|
-
const proxyReq = http.request({
|
|
686
|
-
hostname: "127.0.0.1",
|
|
687
|
-
port: this.caddyPort,
|
|
688
|
-
path: proxyPath,
|
|
689
|
-
method: req.method,
|
|
690
|
-
headers: req.headers
|
|
691
|
-
}, (proxyRes) => {
|
|
692
|
-
res.writeHead(proxyRes.statusCode || 200, proxyRes.headers);
|
|
693
|
-
proxyRes.pipe(res);
|
|
694
|
-
});
|
|
695
|
-
proxyReq.on("error", (err) => {
|
|
696
|
-
if (!res.headersSent) {
|
|
697
|
-
res.writeHead(502);
|
|
698
|
-
res.end("Proxy error");
|
|
699
|
-
}
|
|
700
|
-
});
|
|
701
|
-
req.pipe(proxyReq);
|
|
702
690
|
});
|
|
703
691
|
this.proxyServer = server;
|
|
704
692
|
server.listen(this.port, "127.0.0.1", () => resolve());
|
|
@@ -751,7 +739,7 @@ class ServeManager {
|
|
|
751
739
|
const mount = this.mounts.get(mountName);
|
|
752
740
|
const subdomainOverride = mount?.access === "link" && mount.linkToken ? /* @__PURE__ */ new Map([[this.port, buildLinkSubdomain(subdomainSafe, mount.linkToken)]]) : void 0;
|
|
753
741
|
try {
|
|
754
|
-
const { FrpcTunnel } = await import('./frpc-
|
|
742
|
+
const { FrpcTunnel } = await import('./frpc-IXxyfgPn.mjs');
|
|
755
743
|
let tunnel;
|
|
756
744
|
tunnel = new FrpcTunnel({
|
|
757
745
|
name: tunnelName,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as READ_ONLY_TOOLS, N as loadMachineContext, O as buildMachineInstructions, P as machineToolsForRole, Q as buildMachineTools } from './run-
|
|
1
|
+
import { R as READ_ONLY_TOOLS, N as loadMachineContext, O as buildMachineInstructions, P as machineToolsForRole, Q as buildMachineTools } from './run-C1Unk4Zx.mjs';
|
|
2
2
|
import 'node:child_process';
|
|
3
3
|
import 'os';
|
|
4
4
|
import 'fs/promises';
|