svamp-cli 0.2.323 → 0.2.324
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-Bmgpks9U.mjs → adminCommands-CHE1wq5m.mjs} +1 -1
- package/dist/{agentCommands-CjbndvZ2.mjs → agentCommands-D7CV6DKL.mjs} +5 -5
- package/dist/{auth-7A9m78i5.mjs → auth-BfimMIpL.mjs} +1 -1
- package/dist/{cli-C3GwCq0z.mjs → cli-Dv0vM2P7.mjs} +82 -77
- package/dist/cli.mjs +2 -2
- package/dist/{commands-LMbH3V-v.mjs → commands-4hjEGB-I.mjs} +11 -11
- package/dist/{commands-DLQwUjpD.mjs → commands-BA4LVlQW.mjs} +2 -2
- package/dist/{commands-CZLE29kn.mjs → commands-BQ7UFowe.mjs} +3 -3
- package/dist/{commands-BARTdhcw.mjs → commands-CQK2nD3o.mjs} +7 -4
- package/dist/{commands-DVvR4X4G.mjs → commands-CdbvHh2p.mjs} +2 -2
- package/dist/{commands-CygFvR0a.mjs → commands-CuyCq5eZ.mjs} +3 -3
- package/dist/{commands-C8im5Q2J.mjs → commands-GRfwAHgR.mjs} +17 -5
- package/dist/{commands-gQM3K8Yf.mjs → commands-jaaQooYW.mjs} +1 -1
- package/dist/{fleet-C68s3qVt.mjs → fleet-CSh3MUcM.mjs} +3 -3
- package/dist/{headlessCli-0_H-JwW2.mjs → headlessCli-Zl5Yu4CL.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{notifyCommands-r0r8eyxA.mjs → notifyCommands-BQZXhfLt.mjs} +1 -1
- package/dist/{package-BGIfEYpX.mjs → package-DgboZg2o.mjs} +2 -2
- package/dist/{pinnedClaudeCode-C8CmQv3y.mjs → pinnedClaudeCode-8SZDu7O-.mjs} +1 -1
- package/dist/{rpc-BosOiRY-.mjs → rpc-BIzMNjqC.mjs} +1 -1
- package/dist/{rpc-DP4CiR0g.mjs → rpc-C1KIoUyz.mjs} +1 -1
- package/dist/{run-BiwqH1hw.mjs → run-CEp9YpUZ.mjs} +334 -53
- package/dist/{run-DAo9Lw4D.mjs → run-DKAROgSg.mjs} +1 -1
- package/dist/{scheduler-BN9GuvGN.mjs → scheduler-DIYulmdV.mjs} +1 -1
- package/dist/{serveCommands-C_E-RAiL.mjs → serveCommands-Bq5Cw3mE.mjs} +10 -10
- package/dist/{sideband-L0YNMJhj.mjs → sideband-C83128hf.mjs} +1 -1
- package/package.json +2 -2
- package/dist/supervisorLock-DmfzJx7B.mjs +0 -159
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as path from 'path';
|
|
2
|
-
import { w as wantsHelp } from './cli-
|
|
3
|
-
import './run-
|
|
2
|
+
import { w as wantsHelp } from './cli-Dv0vM2P7.mjs';
|
|
3
|
+
import './run-CEp9YpUZ.mjs';
|
|
4
4
|
import 'os';
|
|
5
5
|
import 'fs/promises';
|
|
6
6
|
import 'fs';
|
|
@@ -77,7 +77,7 @@ async function handleServeCommand() {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
async function serveAdd(args, machineId) {
|
|
80
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
80
|
+
const { connectAndGetMachine } = await import('./commands-GRfwAHgR.mjs');
|
|
81
81
|
const pos = positionalArgs(args);
|
|
82
82
|
const name = pos[0];
|
|
83
83
|
if (!name) {
|
|
@@ -110,7 +110,7 @@ async function serveAdd(args, machineId) {
|
|
|
110
110
|
}
|
|
111
111
|
if (sessionId && result?.url) {
|
|
112
112
|
try {
|
|
113
|
-
const { autoAddSessionLink } = await import('./agentCommands-
|
|
113
|
+
const { autoAddSessionLink } = await import('./agentCommands-D7CV6DKL.mjs');
|
|
114
114
|
autoAddSessionLink(String(result.url), name, void 0, { kind: "serve", name });
|
|
115
115
|
} catch {
|
|
116
116
|
}
|
|
@@ -124,7 +124,7 @@ async function serveAdd(args, machineId) {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
async function serveApply(args, machineId) {
|
|
127
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
127
|
+
const { connectAndGetMachine } = await import('./commands-GRfwAHgR.mjs');
|
|
128
128
|
const fs = await import('fs');
|
|
129
129
|
const yaml = await import('yaml');
|
|
130
130
|
const file = positionalArgs(args)[0];
|
|
@@ -206,7 +206,7 @@ async function serveApply(args, machineId) {
|
|
|
206
206
|
console.log(`URL: ${result.url}`);
|
|
207
207
|
if (params.sessionId && result?.url) {
|
|
208
208
|
try {
|
|
209
|
-
const { autoAddSessionLink } = await import('./agentCommands-
|
|
209
|
+
const { autoAddSessionLink } = await import('./agentCommands-D7CV6DKL.mjs');
|
|
210
210
|
const prevSession = process.env.SVAMP_SESSION_ID;
|
|
211
211
|
process.env.SVAMP_SESSION_ID = String(params.sessionId);
|
|
212
212
|
try {
|
|
@@ -227,7 +227,7 @@ async function serveApply(args, machineId) {
|
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
async function serveRemove(args, machineId) {
|
|
230
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
230
|
+
const { connectAndGetMachine } = await import('./commands-GRfwAHgR.mjs');
|
|
231
231
|
const pos = positionalArgs(args);
|
|
232
232
|
const name = pos[0];
|
|
233
233
|
if (!name) {
|
|
@@ -237,7 +237,7 @@ async function serveRemove(args, machineId) {
|
|
|
237
237
|
const { machine, server } = await connectAndGetMachine(machineId);
|
|
238
238
|
try {
|
|
239
239
|
await machine.serveRemove({ name });
|
|
240
|
-
const { removeSessionLinkByService } = await import('./agentCommands-
|
|
240
|
+
const { removeSessionLinkByService } = await import('./agentCommands-D7CV6DKL.mjs');
|
|
241
241
|
removeSessionLinkByService("serve", name);
|
|
242
242
|
console.log(`Mount '${name}' removed.`);
|
|
243
243
|
} catch (err) {
|
|
@@ -249,7 +249,7 @@ async function serveRemove(args, machineId) {
|
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
async function serveList(args, machineId) {
|
|
252
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
252
|
+
const { connectAndGetMachine } = await import('./commands-GRfwAHgR.mjs');
|
|
253
253
|
const all = hasFlag(args, "--all", "-a");
|
|
254
254
|
const json = hasFlag(args, "--json");
|
|
255
255
|
const sessionId = getFlag(args, "--session");
|
|
@@ -283,7 +283,7 @@ async function serveList(args, machineId) {
|
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
async function serveInfo(machineId) {
|
|
286
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
286
|
+
const { connectAndGetMachine } = await import('./commands-GRfwAHgR.mjs');
|
|
287
287
|
const { machine, server } = await connectAndGetMachine(machineId);
|
|
288
288
|
try {
|
|
289
289
|
const info = await machine.serveInfo();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as READ_ONLY_TOOLS, M as loadMachineContext, N as buildMachineInstructions, O as machineToolsForRole, P as buildMachineTools } from './run-
|
|
1
|
+
import { R as READ_ONLY_TOOLS, M as loadMachineContext, N as buildMachineInstructions, O as machineToolsForRole, P as buildMachineTools } from './run-CEp9YpUZ.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.324",
|
|
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": "node test/with-timeout.mjs 420 npx tsx test/test-context-window.mjs && node test/with-timeout.mjs 420 npx tsx test/test-ratelimit-retry.mjs && node test/with-timeout.mjs 420 npx tsx test/test-reconnect-health.mjs &&node test/with-timeout.mjs 420 npx tsx test/test-instance-config.mjs && node test/with-timeout.mjs 420 npx tsx test/test-authorize.mjs && node test/with-timeout.mjs 420 npx tsx test/test-normalize-allowed-user.mjs && node test/with-timeout.mjs 420 npx tsx test/test-share-url.mjs && node test/with-timeout.mjs 420 npx tsx test/test-update-sharing-normalization.mjs && node test/with-timeout.mjs 420 npx tsx test/test-sharing-notify-sync.mjs && node test/with-timeout.mjs 420 npx tsx test/test-sharing-notify-resolve.mjs && node test/with-timeout.mjs 420 npx tsx test/test-staged-homes-sweep.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-helpers.mjs && node test/with-timeout.mjs 420 npx tsx test/test-cli-routing.mjs && node test/with-timeout.mjs 420 npx tsx test/test-security-context.mjs && node test/with-timeout.mjs 420 npx tsx test/test-isolation-decision.mjs && node test/with-timeout.mjs 420 npx tsx test/test-message-helpers.mjs && node test/with-timeout.mjs 420 npx tsx test/test-stdin-delivery.mjs && node test/with-timeout.mjs 420 npx tsx test/test-agent-config.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wrap-command.mjs && node test/with-timeout.mjs 420 npx tsx test/test-credential-staging.mjs && node test/with-timeout.mjs 420 npx tsx test/test-claude-auth.mjs && node test/with-timeout.mjs 420 npx tsx test/test-backend-accounts.mjs && node test/with-timeout.mjs 420 npx tsx test/test-codex-force-model.mjs && node test/with-timeout.mjs 420 npx tsx test/test-backend-oauth.mjs && node test/with-timeout.mjs 420 npx tsx test/test-btw-proxy-env.mjs && node test/with-timeout.mjs 420 npx tsx test/test-output-formatters.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox-guard.mjs && node test/with-timeout.mjs 420 npx tsx test/test-user-events.mjs && node test/with-timeout.mjs 420 npx tsx test/test-migrate-children.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outpost-install.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outpost-setup.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outpost-pairing.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outpost-coordinator.mjs && node test/with-timeout.mjs 420 npx tsx test/e2e-outpost-transport.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox-reconcile.mjs && node test/with-timeout.mjs 420 npx tsx test/test-auto-topic.mjs && node test/with-timeout.mjs 420 npx tsx test/test-project-info.mjs && node test/with-timeout.mjs 420 npx tsx test/test-agent-types.mjs && node test/with-timeout.mjs 420 npx tsx test/test-transport.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-update-handlers.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-scanner.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hypha-client.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hook-settings.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-service-logic.mjs && node test/with-timeout.mjs 420 npx tsx test/test-daemon-persistence.mjs && node test/with-timeout.mjs 420 npx tsx test/test-detect-isolation.mjs && node test/with-timeout.mjs 420 npx tsx test/test-isolation-disable.mjs && node test/with-timeout.mjs 420 npx tsx test/test-machine-service-logic.mjs && node test/with-timeout.mjs 420 npx tsx test/test-machine-session-visibility.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-access-fallback.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-rpc-role-map.mjs && node test/with-timeout.mjs 420 npx tsx test/test-interactive-helpers.mjs && node test/with-timeout.mjs 420 npx tsx test/test-pinned-codex.mjs && node test/with-timeout.mjs 420 npx tsx test/test-codex-request-timeout.mjs && node test/with-timeout.mjs 420 npx tsx test/test-codex-app-server.mjs && node test/with-timeout.mjs 420 npx tsx test/test-kimi-provider.mjs && node test/with-timeout.mjs 420 npx tsx test/test-acp-backend.mjs && node test/with-timeout.mjs 420 npx tsx test/test-acp-bridge.mjs && node test/with-timeout.mjs 420 npx tsx test/test-listener-backoff.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-identity-env.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hook-server.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-commands.mjs && node test/with-timeout.mjs 420 npx tsx test/test-interactive-console.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-messages.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-send-query.mjs && node test/with-timeout.mjs 420 npx tsx test/test-skills.mjs && node test/with-timeout.mjs 420 npx tsx test/test-agent-grouping.mjs && node test/with-timeout.mjs 420 npx tsx test/test-machine-list-directory.mjs && node test/with-timeout.mjs 420 npx tsx test/test-service-commands.mjs && node test/with-timeout.mjs 420 npx tsx test/test-supervisor.mjs && node test/with-timeout.mjs 420 npx tsx test/test-supervisor-lock.mjs && node test/with-timeout.mjs 420 node test/test-supervisor-restart.mjs && node test/with-timeout.mjs 420 npx tsx test/test-clear-detection.mjs && node test/with-timeout.mjs 420 npx tsx test/test-compact-detect.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-consolidation.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox-store.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox-cross-machine.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-store.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-store-lock.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-close-gate.mjs && node test/with-timeout.mjs 420 npx tsx test/test-loop-verify.mjs && node test/with-timeout.mjs 420 npx tsx test/test-restore-decision.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-rpc.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-pause.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-store.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-rpc.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-scheduler.mjs && node test/with-timeout.mjs 420 npx tsx test/test-cron.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-runs.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-runs-lock.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-idle.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-reconcile.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-link-subdomain.mjs && node test/with-timeout.mjs 420 npx tsx test/test-short-id.mjs && node test/with-timeout.mjs 420 npx tsx test/test-transcript-edit.mjs && node test/with-timeout.mjs 420 npx tsx test/test-edit-history.mjs && node test/with-timeout.mjs 420 npx tsx test/test-friendly-name.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-rpc-dispatch.mjs && node test/with-timeout.mjs 420 npx tsx test/test-sandbox-cli.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-manager.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-files-gateway.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-ws-upgrade.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-auth.mjs && node test/with-timeout.mjs 420 npx tsx test/test-static-file-server.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-stability.mjs && node test/with-timeout.mjs 420 npx tsx test/test-frpc-e2e.mjs --unit-only && node test/with-timeout.mjs 420 npx tsx test/test-frpc-status.mjs && node test/with-timeout.mjs 420 npx tsx test/test-frpc-orphan-reap.mjs && node test/with-timeout.mjs 420 node test/pinnedClaudeCode.test.mjs && node test/with-timeout.mjs 420 node test/fleet.test.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-file.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-rpc.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-agent.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-agent.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channels-service.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hotreload-seam.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hot-reload.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hot-reload-live.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-core.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-async-reply.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outbox-reload.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-binding.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-store-lock.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-identity.mjs && node test/with-timeout.mjs 420 npx tsx test/test-stateless-dispatch-limiter.mjs && node test/with-timeout.mjs 420 npx tsx test/test-shared-session-identity.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-agent-auth.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-http.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-upload.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-voice.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-headless.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-machine.mjs && node test/with-timeout.mjs 420 npx tsx test/test-crew-merge.mjs && node test/with-timeout.mjs 420 npx tsx test/test-crew-verdict-routing.mjs && node test/with-timeout.mjs 420 npx tsx test/test-crew-standalone.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-links.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-loop-pause-guard.mjs && node test/with-timeout.mjs 420 npx tsx test/test-artifact-guard.mjs && node test/with-timeout.mjs 420 npx tsx test/test-artifact-sync-pagination.mjs && node test/with-timeout.mjs 420 npx tsx test/test-graceful-restart.mjs && node test/with-timeout.mjs 420 npx tsx test/test-flush-exit.mjs && node test/with-timeout.mjs 420 npx tsx test/test-codex-skills.mjs && node test/with-timeout.mjs 420 npx tsx test/test-nightly-0807-fixes.mjs && node test/with-timeout.mjs 420 npx tsx test/test-log-prune.mjs && node test/with-timeout.mjs 420 node test/test-message-count-cache.mjs && node test/with-timeout.mjs 420 node test/test-serve-link-gate.mjs && node test/with-timeout.mjs 420 node test/test-security-context-unenforceable.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-id-resolution.mjs && node test/with-timeout.mjs 420 npx tsx test/test-help-flag-never-acts.mjs && node test/with-timeout.mjs 420 npx tsx test/test-with-timeout.mjs",
|
|
23
|
+
"test": "node test/with-timeout.mjs 420 npx tsx test/test-context-window.mjs && node test/with-timeout.mjs 420 npx tsx test/test-ratelimit-retry.mjs && node test/with-timeout.mjs 420 npx tsx test/test-reconnect-health.mjs &&node test/with-timeout.mjs 420 npx tsx test/test-instance-config.mjs && node test/with-timeout.mjs 420 npx tsx test/test-authorize.mjs && node test/with-timeout.mjs 420 npx tsx test/test-normalize-allowed-user.mjs && node test/with-timeout.mjs 420 npx tsx test/test-share-url.mjs && node test/with-timeout.mjs 420 npx tsx test/test-update-sharing-normalization.mjs && node test/with-timeout.mjs 420 npx tsx test/test-sharing-notify-sync.mjs && node test/with-timeout.mjs 420 npx tsx test/test-sharing-notify-resolve.mjs && node test/with-timeout.mjs 420 npx tsx test/test-staged-homes-sweep.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-helpers.mjs && node test/with-timeout.mjs 420 npx tsx test/test-cli-routing.mjs && node test/with-timeout.mjs 420 npx tsx test/test-security-context.mjs && node test/with-timeout.mjs 420 npx tsx test/test-isolation-decision.mjs && node test/with-timeout.mjs 420 npx tsx test/test-message-helpers.mjs && node test/with-timeout.mjs 420 npx tsx test/test-stdin-delivery.mjs && node test/with-timeout.mjs 420 npx tsx test/test-agent-config.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wrap-command.mjs && node test/with-timeout.mjs 420 npx tsx test/test-credential-staging.mjs && node test/with-timeout.mjs 420 npx tsx test/test-claude-auth.mjs && node test/with-timeout.mjs 420 npx tsx test/test-backend-accounts.mjs && node test/with-timeout.mjs 420 npx tsx test/test-codex-force-model.mjs && node test/with-timeout.mjs 420 npx tsx test/test-backend-oauth.mjs && node test/with-timeout.mjs 420 npx tsx test/test-btw-proxy-env.mjs && node test/with-timeout.mjs 420 npx tsx test/test-output-formatters.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox-guard.mjs && node test/with-timeout.mjs 420 npx tsx test/test-user-events.mjs && node test/with-timeout.mjs 420 npx tsx test/test-migrate-children.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outpost-install.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outpost-setup.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outpost-pairing.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outpost-coordinator.mjs && node test/with-timeout.mjs 420 npx tsx test/e2e-outpost-transport.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox-reconcile.mjs && node test/with-timeout.mjs 420 npx tsx test/test-auto-topic.mjs && node test/with-timeout.mjs 420 npx tsx test/test-project-info.mjs && node test/with-timeout.mjs 420 npx tsx test/test-agent-types.mjs && node test/with-timeout.mjs 420 npx tsx test/test-transport.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-update-handlers.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-scanner.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hypha-client.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hook-settings.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-service-logic.mjs && node test/with-timeout.mjs 420 npx tsx test/test-daemon-persistence.mjs && node test/with-timeout.mjs 420 npx tsx test/test-detect-isolation.mjs && node test/with-timeout.mjs 420 npx tsx test/test-isolation-disable.mjs && node test/with-timeout.mjs 420 npx tsx test/test-machine-service-logic.mjs && node test/with-timeout.mjs 420 npx tsx test/test-machine-session-visibility.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-access-fallback.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-rpc-role-map.mjs && node test/with-timeout.mjs 420 npx tsx test/test-interactive-helpers.mjs && node test/with-timeout.mjs 420 npx tsx test/test-pinned-codex.mjs && node test/with-timeout.mjs 420 npx tsx test/test-codex-request-timeout.mjs && node test/with-timeout.mjs 420 npx tsx test/test-codex-app-server.mjs && node test/with-timeout.mjs 420 npx tsx test/test-kimi-provider.mjs && node test/with-timeout.mjs 420 npx tsx test/test-acp-backend.mjs && node test/with-timeout.mjs 420 npx tsx test/test-acp-bridge.mjs && node test/with-timeout.mjs 420 npx tsx test/test-listener-backoff.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-identity-env.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hook-server.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-commands.mjs && node test/with-timeout.mjs 420 npx tsx test/test-interactive-console.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-messages.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-send-query.mjs && node test/with-timeout.mjs 420 npx tsx test/test-skills.mjs && node test/with-timeout.mjs 420 npx tsx test/test-agent-grouping.mjs && node test/with-timeout.mjs 420 npx tsx test/test-machine-list-directory.mjs && node test/with-timeout.mjs 420 npx tsx test/test-service-commands.mjs && node test/with-timeout.mjs 420 npx tsx test/test-supervisor.mjs && node test/with-timeout.mjs 420 npx tsx test/test-supervisor-lock.mjs && node test/with-timeout.mjs 420 node test/test-supervisor-restart.mjs && node test/with-timeout.mjs 420 npx tsx test/test-clear-detection.mjs && node test/with-timeout.mjs 420 npx tsx test/test-compact-detect.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-consolidation.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox-store.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox.mjs && node test/with-timeout.mjs 420 npx tsx test/test-inbox-cross-machine.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-store.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-store-lock.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-close-gate.mjs && node test/with-timeout.mjs 420 npx tsx test/test-loop-verify.mjs && node test/with-timeout.mjs 420 npx tsx test/test-restore-decision.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-rpc.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-pause.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-store.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-rpc.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-scheduler.mjs && node test/with-timeout.mjs 420 npx tsx test/test-cron.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-runs.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-runs-lock.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-idle.mjs && node test/with-timeout.mjs 420 npx tsx test/test-workflow-reconcile.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-link-subdomain.mjs && node test/with-timeout.mjs 420 npx tsx test/test-short-id.mjs && node test/with-timeout.mjs 420 npx tsx test/test-transcript-edit.mjs && node test/with-timeout.mjs 420 npx tsx test/test-edit-history.mjs && node test/with-timeout.mjs 420 npx tsx test/test-friendly-name.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-rpc-dispatch.mjs && node test/with-timeout.mjs 420 npx tsx test/test-sandbox-cli.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-manager.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-files-gateway.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-ws-upgrade.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-auth.mjs && node test/with-timeout.mjs 420 npx tsx test/test-static-file-server.mjs && node test/with-timeout.mjs 420 npx tsx test/test-serve-stability.mjs && node test/with-timeout.mjs 420 npx tsx test/test-frpc-e2e.mjs --unit-only && node test/with-timeout.mjs 420 npx tsx test/test-frpc-status.mjs && node test/with-timeout.mjs 420 npx tsx test/test-frpc-orphan-reap.mjs && node test/with-timeout.mjs 420 node test/pinnedClaudeCode.test.mjs && node test/with-timeout.mjs 420 node test/fleet.test.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-file.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-rpc.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-agent.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-agent.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channels-service.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hotreload-seam.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hot-reload.mjs && node test/with-timeout.mjs 420 npx tsx test/test-hot-reload-live.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-core.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-async-reply.mjs && node test/with-timeout.mjs 420 npx tsx test/test-outbox-reload.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-binding.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-store-lock.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-identity.mjs && node test/with-timeout.mjs 420 npx tsx test/test-stateless-dispatch-limiter.mjs && node test/with-timeout.mjs 420 npx tsx test/test-shared-session-identity.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-agent-auth.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-http.mjs && node test/with-timeout.mjs 420 npx tsx test/test-channel-upload.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-voice.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-headless.mjs && node test/with-timeout.mjs 420 npx tsx test/test-wise-machine.mjs && node test/with-timeout.mjs 420 npx tsx test/test-crew-merge.mjs && node test/with-timeout.mjs 420 npx tsx test/test-crew-verdict-routing.mjs && node test/with-timeout.mjs 420 npx tsx test/test-crew-standalone.mjs && node test/with-timeout.mjs 420 npx tsx test/test-session-links.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-loop-pause-guard.mjs && node test/with-timeout.mjs 420 npx tsx test/test-artifact-guard.mjs && node test/with-timeout.mjs 420 npx tsx test/test-artifact-sync-pagination.mjs && node test/with-timeout.mjs 420 npx tsx test/test-graceful-restart.mjs && node test/with-timeout.mjs 420 npx tsx test/test-flush-exit.mjs && node test/with-timeout.mjs 420 npx tsx test/test-codex-skills.mjs && node test/with-timeout.mjs 420 npx tsx test/test-nightly-0807-fixes.mjs && node test/with-timeout.mjs 420 npx tsx test/test-nightly-0814-fixes.mjs && node test/with-timeout.mjs 420 npx tsx test/test-log-prune.mjs && node test/with-timeout.mjs 420 node test/test-message-count-cache.mjs && node test/with-timeout.mjs 420 node test/test-serve-link-gate.mjs && node test/with-timeout.mjs 420 node test/test-security-context-unenforceable.mjs && node test/with-timeout.mjs 420 npx tsx test/test-issue-id-resolution.mjs && node test/with-timeout.mjs 420 npx tsx test/test-help-flag-never-acts.mjs && node test/with-timeout.mjs 420 npx tsx test/test-with-timeout.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,159 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync, unlinkSync, openSync, writeSync, closeSync } from 'node:fs';
|
|
2
|
-
import { execFileSync } from 'node:child_process';
|
|
3
|
-
|
|
4
|
-
function acquireSupervisorLock(pidFile, pid = process.pid) {
|
|
5
|
-
try {
|
|
6
|
-
const fd = openSync(pidFile, "wx");
|
|
7
|
-
try {
|
|
8
|
-
writeSync(fd, String(pid));
|
|
9
|
-
} finally {
|
|
10
|
-
closeSync(fd);
|
|
11
|
-
}
|
|
12
|
-
return { acquired: true };
|
|
13
|
-
} catch (err) {
|
|
14
|
-
if (err?.code !== "EEXIST") throw err;
|
|
15
|
-
}
|
|
16
|
-
let existingPid = 0;
|
|
17
|
-
try {
|
|
18
|
-
existingPid = parseInt(readFileSync(pidFile, "utf-8").trim(), 10);
|
|
19
|
-
} catch {
|
|
20
|
-
}
|
|
21
|
-
if (!existingPid || Number.isNaN(existingPid) || existingPid <= 0) {
|
|
22
|
-
try {
|
|
23
|
-
unlinkSync(pidFile);
|
|
24
|
-
} catch {
|
|
25
|
-
}
|
|
26
|
-
return { acquired: false, staleCleaned: true };
|
|
27
|
-
}
|
|
28
|
-
if (isPidAlive(existingPid)) {
|
|
29
|
-
return { acquired: false, heldBy: existingPid };
|
|
30
|
-
}
|
|
31
|
-
try {
|
|
32
|
-
unlinkSync(pidFile);
|
|
33
|
-
} catch {
|
|
34
|
-
}
|
|
35
|
-
return { acquired: false, staleCleaned: true };
|
|
36
|
-
}
|
|
37
|
-
function acquireSupervisorLockWithRetry(pidFile, pid = process.pid) {
|
|
38
|
-
let result = acquireSupervisorLock(pidFile, pid);
|
|
39
|
-
if (!result.acquired && result.staleCleaned) {
|
|
40
|
-
result = acquireSupervisorLock(pidFile, pid);
|
|
41
|
-
}
|
|
42
|
-
return { acquired: result.acquired, heldBy: result.heldBy };
|
|
43
|
-
}
|
|
44
|
-
function releaseSupervisorLock(pidFile, pid = process.pid) {
|
|
45
|
-
try {
|
|
46
|
-
if (!existsSync(pidFile)) return;
|
|
47
|
-
const content = parseInt(readFileSync(pidFile, "utf-8").trim(), 10);
|
|
48
|
-
if (content === pid) unlinkSync(pidFile);
|
|
49
|
-
} catch {
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function isPidAlive(pid) {
|
|
53
|
-
if (!pid || Number.isNaN(pid) || pid <= 0) return false;
|
|
54
|
-
try {
|
|
55
|
-
process.kill(pid, 0);
|
|
56
|
-
return true;
|
|
57
|
-
} catch (err) {
|
|
58
|
-
return err?.code === "EPERM";
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
function findOrphanedSyncPids(currentSupervisorPid = process.pid) {
|
|
62
|
-
if (process.platform === "win32") return [];
|
|
63
|
-
const pids = [];
|
|
64
|
-
try {
|
|
65
|
-
const uid = typeof process.getuid === "function" ? process.getuid() : void 0;
|
|
66
|
-
const pgrepArgs = uid !== void 0 ? ["-u", String(uid), "-af", "svamp daemon start-sync"] : ["-af", "svamp daemon start-sync"];
|
|
67
|
-
const output = execFileSync("pgrep", pgrepArgs, {
|
|
68
|
-
encoding: "utf-8",
|
|
69
|
-
timeout: 5e3
|
|
70
|
-
});
|
|
71
|
-
for (const line of output.split("\n")) {
|
|
72
|
-
const trimmed = line.trim();
|
|
73
|
-
if (!trimmed) continue;
|
|
74
|
-
const match = trimmed.match(/^(\d+)\s/);
|
|
75
|
-
if (!match) continue;
|
|
76
|
-
const pid = parseInt(match[1], 10);
|
|
77
|
-
if (Number.isNaN(pid) || pid <= 0) continue;
|
|
78
|
-
if (pid === process.pid) continue;
|
|
79
|
-
const ppid = getPpid(pid);
|
|
80
|
-
if (ppid === currentSupervisorPid) continue;
|
|
81
|
-
pids.push(pid);
|
|
82
|
-
}
|
|
83
|
-
} catch (err) {
|
|
84
|
-
if (err?.status !== 1) ;
|
|
85
|
-
}
|
|
86
|
-
return pids;
|
|
87
|
-
}
|
|
88
|
-
function getPpid(pid) {
|
|
89
|
-
if (process.platform === "win32") return 0;
|
|
90
|
-
try {
|
|
91
|
-
const out = execFileSync("ps", ["-o", "ppid=", "-p", String(pid)], {
|
|
92
|
-
encoding: "utf-8",
|
|
93
|
-
timeout: 2e3
|
|
94
|
-
}).trim();
|
|
95
|
-
const ppid = parseInt(out, 10);
|
|
96
|
-
return Number.isNaN(ppid) ? 0 : ppid;
|
|
97
|
-
} catch {
|
|
98
|
-
return 0;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
async function killOrphanedSyncs(pids, opts = {}) {
|
|
102
|
-
if (pids.length === 0) return;
|
|
103
|
-
const log = opts.log || (() => {
|
|
104
|
-
});
|
|
105
|
-
const gracePeriodMs = opts.gracePeriodMs ?? 3e3;
|
|
106
|
-
log(`Killing ${pids.length} orphan sync daemon(s): ${pids.join(", ")}`);
|
|
107
|
-
for (const pid of pids) {
|
|
108
|
-
try {
|
|
109
|
-
process.kill(pid, "SIGTERM");
|
|
110
|
-
} catch {
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
const pollStep = 100;
|
|
114
|
-
const steps = Math.max(1, Math.ceil(gracePeriodMs / pollStep));
|
|
115
|
-
for (let i = 0; i < steps; i++) {
|
|
116
|
-
await new Promise((r) => setTimeout(r, pollStep));
|
|
117
|
-
if (pids.every((p) => !isPidAlive(p))) {
|
|
118
|
-
log("All orphan daemons exited cleanly");
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
const survivors = pids.filter(isPidAlive);
|
|
123
|
-
if (survivors.length > 0) {
|
|
124
|
-
log(`Force-killing survivors: ${survivors.join(", ")}`);
|
|
125
|
-
for (const pid of survivors) {
|
|
126
|
-
try {
|
|
127
|
-
process.kill(pid, "SIGKILL");
|
|
128
|
-
} catch {
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
function watchParentLiveness(opts) {
|
|
134
|
-
if (process.env.SVAMP_SUPERVISED !== "1") {
|
|
135
|
-
return () => {
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
const supervisorPid = process.ppid;
|
|
139
|
-
if (!supervisorPid || supervisorPid === 1) {
|
|
140
|
-
return () => {
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
const intervalMs = opts.intervalMs ?? 5e3;
|
|
144
|
-
let fired = false;
|
|
145
|
-
const timer = setInterval(() => {
|
|
146
|
-
if (fired) return;
|
|
147
|
-
if (!isPidAlive(supervisorPid)) {
|
|
148
|
-
fired = true;
|
|
149
|
-
clearInterval(timer);
|
|
150
|
-
opts.onParentDeath();
|
|
151
|
-
}
|
|
152
|
-
}, intervalMs);
|
|
153
|
-
timer.unref?.();
|
|
154
|
-
return () => {
|
|
155
|
-
clearInterval(timer);
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export { acquireSupervisorLock, acquireSupervisorLockWithRetry, findOrphanedSyncPids, getPpid, isPidAlive, killOrphanedSyncs, releaseSupervisorLock, watchParentLiveness };
|