svamp-cli 0.2.228 → 0.2.229-canary.1
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-uF1SFdGm.mjs → agentCommands-CsL5nKMU.mjs} +5 -5
- package/dist/{auth-CURAWrIR.mjs → auth-Wlu9tdQi.mjs} +1 -1
- package/dist/cli.mjs +61 -61
- package/dist/{commands-B1unUPPO.mjs → commands-7UVn6rwT.mjs} +1 -1
- package/dist/{commands-DFVtMGQq.mjs → commands-B40vsIFN.mjs} +1 -1
- package/dist/{commands-C7erh6ui.mjs → commands-Bwh4YPl9.mjs} +2 -2
- package/dist/{commands-sCptO4oM.mjs → commands-Cb4O-FK1.mjs} +1 -1
- package/dist/{commands-Do8vYTHJ.mjs → commands-Dvx0xhxl.mjs} +2 -2
- package/dist/{commands-DiiYVrVe.mjs → commands-Hxd_3e90.mjs} +1 -1
- package/dist/{commands-DIePpr43.mjs → commands-qNegeWoa.mjs} +6 -6
- package/dist/{fleet-_dhjB0Yg.mjs → fleet-DkANyXBc.mjs} +1 -1
- package/dist/{frpc-Bspx1xH-.mjs → frpc-DLHENjxp.mjs} +1 -1
- package/dist/{headlessCli-BVCGQu3M.mjs → headlessCli-DDJv4_nj.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{package-VYP3g593.mjs → package-Co7XlSE3.mjs} +2 -2
- package/dist/{rpc-DvPmbys_.mjs → rpc-D1_ae6MP.mjs} +1 -1
- package/dist/{rpc-BZNJ2PWu.mjs → rpc-DBDPUPj4.mjs} +1 -1
- package/dist/{run-CWjO2BDp.mjs → run-CXQ-NEsY.mjs} +314 -31
- package/dist/{run-CqxwSYnZ.mjs → run-DBB1tUY1.mjs} +1 -1
- package/dist/{scheduler-DifzWtwa.mjs → scheduler-DPwwX1fQ.mjs} +1 -1
- package/dist/{serveCommands-BUJk44dn.mjs → serveCommands-DuhXXuPg.mjs} +5 -5
- package/dist/{serveManager--_kLrbpK.mjs → serveManager-BKTiO1hi.mjs} +2 -2
- package/dist/{sideband-CkrdMDh7.mjs → sideband-BFQr64jf.mjs} +1 -1
- package/package.json +2 -2
|
@@ -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-CXQ-NEsY.mjs';
|
|
5
5
|
import { PINNED_CLAUDE_CODE_VERSION } from './pinnedClaudeCode-VIupR1NK.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-CXQ-NEsY.mjs';
|
|
8
8
|
import 'fs/promises';
|
|
9
9
|
import 'url';
|
|
10
10
|
import 'node:crypto';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as resolveModel, a2 as describeMisconfiguration, a3 as buildMachineDeps } from './run-
|
|
2
|
-
import { handleRealtimeEvent, initMachineVoiceSession } from './sideband-
|
|
1
|
+
import { P as resolveModel, a2 as describeMisconfiguration, a3 as buildMachineDeps } from './run-CXQ-NEsY.mjs';
|
|
2
|
+
import { handleRealtimeEvent, initMachineVoiceSession } from './sideband-BFQr64jf.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-CXQ-NEsY.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.229-canary.1";
|
|
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-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-workflow-runs.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",
|
|
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-workflow-runs.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",
|
|
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 { m as resolveProjectRoot, u as updateIssue, n as getIssue, o as resumeIssue, p as pauseIssue, q as addComment, t as addIssue, v as listIssues, w as searchIssues, x as isVisibleTo } from './run-
|
|
1
|
+
import { m as resolveProjectRoot, u as updateIssue, n as getIssue, o as resumeIssue, p as pauseIssue, q as addComment, t as addIssue, v as listIssues, w as searchIssues, x as isVisibleTo } from './run-CXQ-NEsY.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as resolveProjectRoot } from './run-
|
|
1
|
+
import { m as resolveProjectRoot } from './run-CXQ-NEsY.mjs';
|
|
2
2
|
import { g as getWorkflow, s as setWorkflowEnabled, r as removeWorkflow, a as saveWorkflow, b as rawWorkflow, l as listWorkflows } from './store-BTs0H_y0.mjs';
|
|
3
3
|
import { g as getRun, l as listRuns, r as runWorkflow } from './runStore-CtptN7US.mjs';
|
|
4
4
|
import 'os';
|
|
@@ -3,7 +3,7 @@ import fs, { mkdir as mkdir$1, readdir as readdir$1, readFile, writeFile as writ
|
|
|
3
3
|
import fs__default, { readFileSync as readFileSync$1, mkdirSync as mkdirSync$1, writeFileSync as writeFileSync$1, renameSync as renameSync$1, existsSync as existsSync$1, realpathSync as realpathSync$1, rmSync as rmSync$1, copyFileSync, unlinkSync as unlinkSync$1, readdirSync as readdirSync$1, watch, rmdirSync } from 'fs';
|
|
4
4
|
import path__default, { join as join$1, resolve as resolve$1, dirname as dirname$1, basename as basename$1 } from 'path';
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
|
-
import { execFile, spawn as spawn$1, execSync as execSync$1 } from 'child_process';
|
|
6
|
+
import { execFile, spawn as spawn$1, execSync as execSync$1, exec as exec$1 } from 'child_process';
|
|
7
7
|
import { randomUUID as randomUUID$1 } from 'crypto';
|
|
8
8
|
import { randomBytes, createHash, randomUUID } from 'node:crypto';
|
|
9
9
|
import { existsSync, readFileSync, realpathSync, readdirSync, statSync, mkdirSync, writeFileSync, renameSync, rmSync, appendFileSync, unlinkSync } from 'node:fs';
|
|
@@ -2916,7 +2916,7 @@ async function registerMachineService(server, machineId, metadata, daemonState,
|
|
|
2916
2916
|
const tunnels = handlers.tunnels;
|
|
2917
2917
|
if (!tunnels) throw new Error("Tunnel management not available");
|
|
2918
2918
|
if (tunnels.has(params.name)) throw new Error(`Tunnel '${params.name}' already running`);
|
|
2919
|
-
const { FrpcTunnel } = await import('./frpc-
|
|
2919
|
+
const { FrpcTunnel } = await import('./frpc-DLHENjxp.mjs');
|
|
2920
2920
|
const tunnel = new FrpcTunnel({
|
|
2921
2921
|
name: params.name,
|
|
2922
2922
|
ports: params.ports,
|
|
@@ -3363,7 +3363,7 @@ QUESTION: ${params.question || "Summarize this concisely."}` }
|
|
|
3363
3363
|
}
|
|
3364
3364
|
const deps = buildSessionDeps(rpc, { cwd, ownerEmail: owner });
|
|
3365
3365
|
const sender = { name: context?.user?.email || context?.user?.id || "user", kind: "user", verified: true };
|
|
3366
|
-
const { toolsForRole } = await import('./sideband-
|
|
3366
|
+
const { toolsForRole } = await import('./sideband-BFQr64jf.mjs');
|
|
3367
3367
|
const r2 = await runWiseAgent({ message: params.message, sender, config: { tools: toolsForRole(role2) }, deps, transport, model: resolved.model });
|
|
3368
3368
|
return fmt(r2);
|
|
3369
3369
|
}
|
|
@@ -3462,7 +3462,7 @@ QUESTION: ${params.question || "Summarize this concisely."}` }
|
|
|
3462
3462
|
if (r.error || !r.sender) return { error: r.error || "unauthorized" };
|
|
3463
3463
|
const callId = "call_" + Math.random().toString(16).slice(2, 12);
|
|
3464
3464
|
const rendered = renderMessage(c, { sender: r.sender, body: { message: kwargs.message }, callId });
|
|
3465
|
-
const { queryCore } = await import('./commands-
|
|
3465
|
+
const { queryCore } = await import('./commands-Cb4O-FK1.mjs');
|
|
3466
3466
|
const timeout = c.reply?.timeout_sec || 120;
|
|
3467
3467
|
let result;
|
|
3468
3468
|
try {
|
|
@@ -10695,6 +10695,139 @@ function summarize(issues) {
|
|
|
10695
10695
|
return { total: issues.length, ready: by("ready"), in_progress: by("in_progress"), archived: by("archived") };
|
|
10696
10696
|
}
|
|
10697
10697
|
|
|
10698
|
+
function backlogOraclePending(projectRoot, sessionId) {
|
|
10699
|
+
const inScope = (i) => !sessionId || isVisibleTo(i, sessionId);
|
|
10700
|
+
return listIssues(projectRoot).filter(inScope).filter((i) => i.status === "ready" || i.status === "in_progress").map((i) => ({ id: i.id }));
|
|
10701
|
+
}
|
|
10702
|
+
function issuesClosedSince(projectRoot, sinceMs) {
|
|
10703
|
+
const all = listIssues(projectRoot, { includeArchived: true, status: "archived" });
|
|
10704
|
+
if (!sinceMs || !Number.isFinite(sinceMs)) return all;
|
|
10705
|
+
return all.filter((i) => {
|
|
10706
|
+
if (!i.closed) return false;
|
|
10707
|
+
const t = Date.parse(i.closed);
|
|
10708
|
+
return Number.isFinite(t) && t >= sinceMs;
|
|
10709
|
+
});
|
|
10710
|
+
}
|
|
10711
|
+
function buildEvaluatorPrompt(o) {
|
|
10712
|
+
const lines = [];
|
|
10713
|
+
lines.push("You are an INDEPENDENT, skeptical reviewer. You did NOT write the code under review.");
|
|
10714
|
+
lines.push('A self-verifying loop has just reported its work COMPLETE. Decide whether it is GENUINELY and COMPLETELY done. Default to "continue" on ANY doubt \u2014 a false "done" is far worse than one more iteration.');
|
|
10715
|
+
lines.push("");
|
|
10716
|
+
if (o.task) lines.push(`LOOP TASK / GOAL:
|
|
10717
|
+
${o.task.trim()}`);
|
|
10718
|
+
if (o.until) lines.push(`DONE-WHEN CRITERIA:
|
|
10719
|
+
${o.until.trim()}`);
|
|
10720
|
+
lines.push("");
|
|
10721
|
+
lines.push("Use your tools (Read, Bash, Grep, Glob) to inspect the ACTUAL repository state \u2014 do NOT trust the transcript. Check the working tree, git log/diff, build/test output, and whether changes were actually built/published/deployed where the request implied it.");
|
|
10722
|
+
if (o.oracle) {
|
|
10723
|
+
lines.push("");
|
|
10724
|
+
lines.push(`The loop oracle is \`${o.oracle.trim()}\` and it currently PASSES${o.oracleOutput ? ` (output: ${o.oracleOutput.trim().slice(0, 400)})` : ""}. A green oracle here only means "no OPEN issues" \u2014 it does NOT mean each CLOSED issue actually works.`);
|
|
10725
|
+
}
|
|
10726
|
+
if (o.closedIssues.length) {
|
|
10727
|
+
lines.push("");
|
|
10728
|
+
lines.push("ISSUES CLOSED DURING THIS LOOP \u2014 verify EACH was genuinely resolved by the real change (not closed by self-assertion). Re-read the ORIGINAL request behind each, not just its title:");
|
|
10729
|
+
for (const i of o.closedIssues.slice(0, 40)) {
|
|
10730
|
+
const orig = (i.original || "").trim().replace(/\s+/g, " ").slice(0, 200);
|
|
10731
|
+
const vtype = i.verify?.type ? ` [verify:${i.verify.type}]` : "";
|
|
10732
|
+
lines.push(` - #${i.id} ${i.title}${vtype}${orig ? ` \u2014 original: "${orig}"` : ""}`);
|
|
10733
|
+
}
|
|
10734
|
+
lines.push('Reject "done" if ANY closed issue was not genuinely resolved by the actual change.');
|
|
10735
|
+
} else {
|
|
10736
|
+
lines.push("");
|
|
10737
|
+
lines.push("No issues were closed during this loop. Judge whether the task/criteria are genuinely met from the USER's perspective, end-to-end.");
|
|
10738
|
+
}
|
|
10739
|
+
lines.push("");
|
|
10740
|
+
lines.push("Return ONLY a JSON object on the LAST line, nothing after it:");
|
|
10741
|
+
lines.push('{"verdict":"done"|"continue","reason":"<concise>","guidance":"<what to fix if continue>"}');
|
|
10742
|
+
return lines.join("\n");
|
|
10743
|
+
}
|
|
10744
|
+
function buildGoalCondition(o) {
|
|
10745
|
+
const parts = [];
|
|
10746
|
+
if (o.task) parts.push(o.task.trim());
|
|
10747
|
+
if (o.until) parts.push(`Done when: ${o.until.trim()}.`);
|
|
10748
|
+
if (o.oracle) parts.push(`Verify by running \`${o.oracle.trim()}\` at the end of every turn and pasting its output; it must succeed (exit 0 / no pending work).`);
|
|
10749
|
+
if (!o.until && !o.oracle && o.task) parts.push("Done when the task is fully complete and you have shown the evidence that proves it.");
|
|
10750
|
+
parts.push(`Or stop after ${o.maxIterations && o.maxIterations > 0 ? o.maxIterations : 20} turns.`);
|
|
10751
|
+
if (o.inboxDrain !== false) {
|
|
10752
|
+
parts.push("(\u{1F4EC} Inbox: at the start of each turn, run `svamp session inbox list` and handle any unread peer message \u2014 reply/triage/merge \u2014 before continuing the task above. This is how a long loop drains queued non-urgent mail; it is NOT a completion criterion.)");
|
|
10753
|
+
}
|
|
10754
|
+
return parts.join(" ");
|
|
10755
|
+
}
|
|
10756
|
+
function parseEvaluatorVerdict(text) {
|
|
10757
|
+
if (!text) return null;
|
|
10758
|
+
const candidates = [];
|
|
10759
|
+
let depth = 0, start = -1;
|
|
10760
|
+
for (let i = 0; i < text.length; i++) {
|
|
10761
|
+
const c = text[i];
|
|
10762
|
+
if (c === "{") {
|
|
10763
|
+
if (depth === 0) start = i;
|
|
10764
|
+
depth++;
|
|
10765
|
+
} else if (c === "}") {
|
|
10766
|
+
depth--;
|
|
10767
|
+
if (depth === 0 && start >= 0) {
|
|
10768
|
+
candidates.push(text.slice(start, i + 1));
|
|
10769
|
+
start = -1;
|
|
10770
|
+
}
|
|
10771
|
+
}
|
|
10772
|
+
}
|
|
10773
|
+
for (let i = candidates.length - 1; i >= 0; i--) {
|
|
10774
|
+
try {
|
|
10775
|
+
const o = JSON.parse(candidates[i]);
|
|
10776
|
+
if (o && (o.verdict === "done" || o.verdict === "continue")) {
|
|
10777
|
+
return { verdict: o.verdict, reason: typeof o.reason === "string" ? o.reason : void 0, guidance: typeof o.guidance === "string" ? o.guidance : void 0 };
|
|
10778
|
+
}
|
|
10779
|
+
} catch {
|
|
10780
|
+
}
|
|
10781
|
+
}
|
|
10782
|
+
return null;
|
|
10783
|
+
}
|
|
10784
|
+
async function runLoopVerification(cfg, deps) {
|
|
10785
|
+
const log = deps.log || (() => {
|
|
10786
|
+
});
|
|
10787
|
+
const maxHolds = typeof cfg.maxHolds === "number" && cfg.maxHolds > 0 ? cfg.maxHolds : 3;
|
|
10788
|
+
const holds = typeof cfg.holds === "number" && cfg.holds > 0 ? cfg.holds : 0;
|
|
10789
|
+
let oracleOutput = "";
|
|
10790
|
+
try {
|
|
10791
|
+
const o = await deps.runOracle(cfg.oracle);
|
|
10792
|
+
oracleOutput = o.output || "";
|
|
10793
|
+
if (!o.ok) {
|
|
10794
|
+
if (holds + 1 > maxHolds) {
|
|
10795
|
+
return { action: "gave_up", reason: `oracle still reports pending work after ${holds} verification hold(s): ${oracleOutput.trim().slice(0, 200)}` };
|
|
10796
|
+
}
|
|
10797
|
+
log(`[loopVerify] oracle reports pending work \u2014 re-kicking instead of marking done`);
|
|
10798
|
+
return { action: "rekick", reason: "oracle reports pending work", guidance: `The loop oracle still reports unfinished work, so the goal is NOT complete:
|
|
10799
|
+
${oracleOutput.trim().slice(0, 500)}
|
|
10800
|
+
Keep working until it is genuinely empty.` };
|
|
10801
|
+
}
|
|
10802
|
+
} catch (e) {
|
|
10803
|
+
log(`[loopVerify] oracle runner error (continuing to evaluator): ${e?.message || e}`);
|
|
10804
|
+
}
|
|
10805
|
+
const closed = issuesClosedSince(deps.projectRoot, cfg.startedAt);
|
|
10806
|
+
const prompt = buildEvaluatorPrompt({ task: cfg.task, until: cfg.until, oracle: cfg.oracle, oracleOutput, closedIssues: closed });
|
|
10807
|
+
let raw = "";
|
|
10808
|
+
try {
|
|
10809
|
+
raw = await deps.runEvaluator(prompt);
|
|
10810
|
+
} catch (e) {
|
|
10811
|
+
log(`[loopVerify] evaluator spawn failed \u2014 failing OPEN (marking done): ${e?.message || e}`);
|
|
10812
|
+
return { action: "done" };
|
|
10813
|
+
}
|
|
10814
|
+
const verdict = parseEvaluatorVerdict(raw);
|
|
10815
|
+
if (!verdict) {
|
|
10816
|
+
log(`[loopVerify] could not parse evaluator verdict \u2014 failing OPEN (marking done)`);
|
|
10817
|
+
return { action: "done" };
|
|
10818
|
+
}
|
|
10819
|
+
if (verdict.verdict === "done") {
|
|
10820
|
+
log(`[loopVerify] evaluator confirms done${verdict.reason ? `: ${verdict.reason}` : ""}`);
|
|
10821
|
+
return { action: "done" };
|
|
10822
|
+
}
|
|
10823
|
+
if (holds + 1 > maxHolds) {
|
|
10824
|
+
return { action: "gave_up", reason: `evaluator held "continue" past the limit (${maxHolds})${verdict.reason ? `: ${verdict.reason}` : ""}` };
|
|
10825
|
+
}
|
|
10826
|
+
const guidance = [verdict.reason ? `Independent reviewer says NOT done: ${verdict.reason}` : "Independent reviewer says NOT done.", verdict.guidance ? `Fix: ${verdict.guidance}` : ""].filter(Boolean).join("\n");
|
|
10827
|
+
log(`[loopVerify] evaluator says continue \u2014 re-kicking (hold ${holds + 1}/${maxHolds})`);
|
|
10828
|
+
return { action: "rekick", reason: verdict.reason || "evaluator says continue", guidance };
|
|
10829
|
+
}
|
|
10830
|
+
|
|
10698
10831
|
const OAUTH_TOKEN_ENDPOINT = "https://platform.claude.com/v1/oauth/token";
|
|
10699
10832
|
const OAUTH_CLIENT_ID = "9d1c250a-e61b-44d9-88ed-5944d1962f5e";
|
|
10700
10833
|
const OAUTH_SCOPES = "user:profile user:inference user:sessions:claude_code user:mcp_servers user:file_upload";
|
|
@@ -11555,15 +11688,6 @@ function classifyOptsForMessage(sessionId, message, ownerEmail) {
|
|
|
11555
11688
|
const openThreadReply = takeAwaitingReply(sessionId, message.threadId);
|
|
11556
11689
|
return { self, openThreadReply };
|
|
11557
11690
|
}
|
|
11558
|
-
function buildGoalCondition(o) {
|
|
11559
|
-
const parts = [];
|
|
11560
|
-
if (o.task) parts.push(o.task.trim());
|
|
11561
|
-
if (o.until) parts.push(`Done when: ${o.until.trim()}.`);
|
|
11562
|
-
if (o.oracle) parts.push(`Verify by running \`${o.oracle.trim()}\` at the end of every turn and pasting its output; it must succeed (exit 0 / no pending work).`);
|
|
11563
|
-
if (!o.until && !o.oracle && o.task) parts.push("Done when the task is fully complete and you have shown the evidence that proves it.");
|
|
11564
|
-
parts.push(`Or stop after ${o.maxIterations && o.maxIterations > 0 ? o.maxIterations : 20} turns.`);
|
|
11565
|
-
return parts.join(" ");
|
|
11566
|
-
}
|
|
11567
11691
|
function writeGoalLoopState(directory, sessionId, state) {
|
|
11568
11692
|
try {
|
|
11569
11693
|
const dir = getLoopDir(directory, sessionId);
|
|
@@ -11845,7 +11969,7 @@ function createSvampConfigChecker(directory, sessionId, getMetadata, setMetadata
|
|
|
11845
11969
|
stripOldLoopHooks(directory);
|
|
11846
11970
|
} catch {
|
|
11847
11971
|
}
|
|
11848
|
-
writeGoalLoopState(directory, sessionId, { active: true, phase: "running", iteration: 0, task: condition, until, oracle, max_iterations: maxIterations, started_at: Date.now() });
|
|
11972
|
+
writeGoalLoopState(directory, sessionId, { active: true, phase: "running", iteration: 0, task: condition, goal_task: task, until, oracle, max_iterations: maxIterations, started_at: Date.now(), holds: 0 });
|
|
11849
11973
|
const existingQueue = getMetadata().messageQueue || [];
|
|
11850
11974
|
setMetadata((m) => ({ ...m, messageQueue: [...existingQueue, { id: randomUUID$1(), text: `/goal ${condition}`, displayText: `\u{1F3AF} Goal: ${(task || until || "").slice(0, 100)}`, createdAt: Date.now() }] }));
|
|
11851
11975
|
onLoopActivated?.();
|
|
@@ -12294,7 +12418,7 @@ async function startDaemon(options) {
|
|
|
12294
12418
|
saveExposedTunnels(list);
|
|
12295
12419
|
}
|
|
12296
12420
|
async function createExposedTunnel(spec) {
|
|
12297
|
-
const { FrpcTunnel } = await import('./frpc-
|
|
12421
|
+
const { FrpcTunnel } = await import('./frpc-DLHENjxp.mjs');
|
|
12298
12422
|
const tunnel = new FrpcTunnel({
|
|
12299
12423
|
name: spec.name,
|
|
12300
12424
|
ports: spec.ports,
|
|
@@ -12314,7 +12438,7 @@ async function startDaemon(options) {
|
|
|
12314
12438
|
return tunnel;
|
|
12315
12439
|
}
|
|
12316
12440
|
const tunnelRecreateState = /* @__PURE__ */ new Map();
|
|
12317
|
-
const { ServeManager } = await import('./serveManager
|
|
12441
|
+
const { ServeManager } = await import('./serveManager-BKTiO1hi.mjs');
|
|
12318
12442
|
const serveManager = new ServeManager(SVAMP_HOME, (msg) => logger.log(`[SERVE] ${msg}`), hyphaServerUrl);
|
|
12319
12443
|
ensureAutoInstalledSkills(logger).catch(() => {
|
|
12320
12444
|
});
|
|
@@ -12937,6 +13061,161 @@ ${parts.join("\n")}`);
|
|
|
12937
13061
|
};
|
|
12938
13062
|
sessionService.updateMetadata(sessionMetadata);
|
|
12939
13063
|
};
|
|
13064
|
+
const enqueueLoopMessage = (text, displayText) => {
|
|
13065
|
+
const existingQueue = sessionMetadata.messageQueue || [];
|
|
13066
|
+
sessionMetadata = {
|
|
13067
|
+
...sessionMetadata,
|
|
13068
|
+
messageQueue: [...existingQueue, { id: randomUUID$1(), text, displayText, createdAt: Date.now() }]
|
|
13069
|
+
};
|
|
13070
|
+
sessionService.updateMetadata(sessionMetadata);
|
|
13071
|
+
};
|
|
13072
|
+
const runHeadlessEvaluator = (prompt) => new Promise((resolve2, reject) => {
|
|
13073
|
+
const evalArgs = [
|
|
13074
|
+
"--print",
|
|
13075
|
+
prompt,
|
|
13076
|
+
// Read-only reviewer (mirrors .claude/agents/loop-evaluator.md): it inspects
|
|
13077
|
+
// real repo state but must not mutate the working tree it's judging.
|
|
13078
|
+
"--allowedTools",
|
|
13079
|
+
"Read",
|
|
13080
|
+
"Bash",
|
|
13081
|
+
"Grep",
|
|
13082
|
+
"Glob",
|
|
13083
|
+
"--disallowedTools",
|
|
13084
|
+
"Write",
|
|
13085
|
+
"Edit",
|
|
13086
|
+
"MultiEdit",
|
|
13087
|
+
"NotebookEdit",
|
|
13088
|
+
"--permission-mode",
|
|
13089
|
+
"bypassPermissions",
|
|
13090
|
+
"--output-format",
|
|
13091
|
+
"stream-json",
|
|
13092
|
+
"--verbose"
|
|
13093
|
+
];
|
|
13094
|
+
const evalEnv = { ...process.env };
|
|
13095
|
+
applyClaudeProxyEnv(evalEnv);
|
|
13096
|
+
delete evalEnv.CLAUDECODE;
|
|
13097
|
+
let proc;
|
|
13098
|
+
try {
|
|
13099
|
+
proc = spawn$1("claude", evalArgs, { cwd: directory, env: evalEnv, stdio: ["pipe", "pipe", "pipe"] });
|
|
13100
|
+
} catch (e) {
|
|
13101
|
+
reject(e);
|
|
13102
|
+
return;
|
|
13103
|
+
}
|
|
13104
|
+
let out = "", buf = "", stderr = "", settled = false;
|
|
13105
|
+
const timer = setTimeout(() => {
|
|
13106
|
+
if (settled) return;
|
|
13107
|
+
settled = true;
|
|
13108
|
+
try {
|
|
13109
|
+
proc.kill("SIGTERM");
|
|
13110
|
+
} catch {
|
|
13111
|
+
}
|
|
13112
|
+
reject(new Error("evaluator timeout"));
|
|
13113
|
+
}, 3e5);
|
|
13114
|
+
proc.stderr?.on("data", (c) => {
|
|
13115
|
+
stderr += c.toString();
|
|
13116
|
+
});
|
|
13117
|
+
proc.stdout.on("data", (chunk) => {
|
|
13118
|
+
buf += chunk.toString();
|
|
13119
|
+
let nl;
|
|
13120
|
+
while ((nl = buf.indexOf("\n")) !== -1) {
|
|
13121
|
+
const line = buf.slice(0, nl);
|
|
13122
|
+
buf = buf.slice(nl + 1);
|
|
13123
|
+
if (!line.trim()) continue;
|
|
13124
|
+
try {
|
|
13125
|
+
const m = JSON.parse(line);
|
|
13126
|
+
if (m.type === "assistant" && m.message?.content) {
|
|
13127
|
+
for (const b of m.message.content) if (b.type === "text" && b.text) out += b.text;
|
|
13128
|
+
} else if (m.type === "result") {
|
|
13129
|
+
if (settled) continue;
|
|
13130
|
+
settled = true;
|
|
13131
|
+
clearTimeout(timer);
|
|
13132
|
+
if (m.is_error) reject(new Error(String(m.result || "evaluator error")));
|
|
13133
|
+
else resolve2(out || String(m.result || ""));
|
|
13134
|
+
}
|
|
13135
|
+
} catch {
|
|
13136
|
+
}
|
|
13137
|
+
}
|
|
13138
|
+
});
|
|
13139
|
+
proc.on("exit", (code) => {
|
|
13140
|
+
if (settled) return;
|
|
13141
|
+
settled = true;
|
|
13142
|
+
clearTimeout(timer);
|
|
13143
|
+
if (code === 0) resolve2(out);
|
|
13144
|
+
else reject(new Error(stderr.trim() || `evaluator exited with code ${code}`));
|
|
13145
|
+
});
|
|
13146
|
+
proc.on("error", (e) => {
|
|
13147
|
+
if (settled) return;
|
|
13148
|
+
settled = true;
|
|
13149
|
+
clearTimeout(timer);
|
|
13150
|
+
reject(e);
|
|
13151
|
+
});
|
|
13152
|
+
});
|
|
13153
|
+
let goalVerifyInFlight = false;
|
|
13154
|
+
const verifyGoalCompletion = async (ls) => {
|
|
13155
|
+
if (goalVerifyInFlight) return;
|
|
13156
|
+
goalVerifyInFlight = true;
|
|
13157
|
+
const projectRoot = resolveProjectRoot(directory);
|
|
13158
|
+
const startedAt = typeof ls.started_at === "number" ? ls.started_at : typeof ls.resumed_at === "number" ? ls.resumed_at : void 0;
|
|
13159
|
+
const holds = typeof ls.holds === "number" ? ls.holds : 0;
|
|
13160
|
+
const oracleCmd = typeof ls.oracle === "string" && ls.oracle.trim() ? ls.oracle.trim() : void 0;
|
|
13161
|
+
try {
|
|
13162
|
+
sessionService.pushMessage({ type: "message", message: "\u{1F50D} Verifying loop completion (independent review)\u2026" }, "event");
|
|
13163
|
+
const result = await runLoopVerification(
|
|
13164
|
+
{ task: ls.goal_task || ls.task, until: ls.until, oracle: oracleCmd, startedAt, holds, maxHolds: 3 },
|
|
13165
|
+
{
|
|
13166
|
+
projectRoot,
|
|
13167
|
+
runOracle: async (cmd) => {
|
|
13168
|
+
if (cmd) {
|
|
13169
|
+
return await new Promise((resolve2) => {
|
|
13170
|
+
exec$1(cmd, { cwd: directory, timeout: 12e4, maxBuffer: 16 * 1024 * 1024 }, (err, stdout, stderr) => {
|
|
13171
|
+
if (err) resolve2({ ok: false, output: (String(stdout || "") + String(stderr || "")).slice(-500) });
|
|
13172
|
+
else resolve2({ ok: true, output: "" });
|
|
13173
|
+
});
|
|
13174
|
+
});
|
|
13175
|
+
}
|
|
13176
|
+
const pending = backlogOraclePending(projectRoot, sessionId);
|
|
13177
|
+
return { ok: pending.length === 0, output: pending.length ? `${pending.length} pending: ${pending.map((i) => "#" + i.id).join(" ")}` : "No pending issues." };
|
|
13178
|
+
},
|
|
13179
|
+
runEvaluator: (prompt) => runHeadlessEvaluator(prompt),
|
|
13180
|
+
log: (m) => logger.log(`[Session ${sessionId}] ${m}`)
|
|
13181
|
+
}
|
|
13182
|
+
);
|
|
13183
|
+
if (result.action === "rekick") {
|
|
13184
|
+
const cond = ls.task || "";
|
|
13185
|
+
writeGoalLoopState(directory, sessionId, {
|
|
13186
|
+
active: true,
|
|
13187
|
+
phase: "continue",
|
|
13188
|
+
iteration: ls.iteration || 0,
|
|
13189
|
+
task: ls.task,
|
|
13190
|
+
goal_task: ls.goal_task,
|
|
13191
|
+
until: ls.until,
|
|
13192
|
+
oracle: oracleCmd,
|
|
13193
|
+
max_iterations: ls.max_iterations,
|
|
13194
|
+
started_at: startedAt,
|
|
13195
|
+
holds: holds + 1
|
|
13196
|
+
});
|
|
13197
|
+
const guidance = result.guidance.replace(/\s+/g, " ").slice(0, 1200);
|
|
13198
|
+
sessionService.pushMessage({ type: "message", message: `\u{1F501} Loop not done \u2014 independent review: ${result.reason}`, level: "warning" }, "event");
|
|
13199
|
+
enqueueLoopMessage(`/goal ${cond} \u2014 INDEPENDENT REVIEW FEEDBACK (resolve before declaring done): ${guidance}`, "\u{1F501} Re-verifying loop");
|
|
13200
|
+
if (!trackedSession.stopped) setTimeout(() => processMessageQueueRef?.(), 200);
|
|
13201
|
+
} else if (result.action === "gave_up") {
|
|
13202
|
+
writeGoalLoopState(directory, sessionId, { active: false, phase: "gave_up", completed_at: Date.now(), gave_up_reason: result.reason, holds });
|
|
13203
|
+
checkSvampConfig?.();
|
|
13204
|
+
} else {
|
|
13205
|
+
writeGoalLoopState(directory, sessionId, { active: false, phase: "done", completed_at: Date.now(), holds });
|
|
13206
|
+
checkSvampConfig?.();
|
|
13207
|
+
}
|
|
13208
|
+
} catch (e) {
|
|
13209
|
+
logger.log(`[Session ${sessionId}] verifyGoalCompletion error \u2014 failing open (done): ${e?.message || e}`);
|
|
13210
|
+
try {
|
|
13211
|
+
writeGoalLoopState(directory, sessionId, { active: false, phase: "done", completed_at: Date.now() });
|
|
13212
|
+
checkSvampConfig?.();
|
|
13213
|
+
} catch {
|
|
13214
|
+
}
|
|
13215
|
+
} finally {
|
|
13216
|
+
goalVerifyInFlight = false;
|
|
13217
|
+
}
|
|
13218
|
+
};
|
|
12940
13219
|
const signalProcessing = (processing) => {
|
|
12941
13220
|
sessionService.sendKeepAlive(processing);
|
|
12942
13221
|
const newState = processing ? "running" : "idle";
|
|
@@ -13383,8 +13662,12 @@ ${parts.join("\n")}`);
|
|
|
13383
13662
|
clearInboundContext(sessionId);
|
|
13384
13663
|
try {
|
|
13385
13664
|
const ls = readLoopState(directory, sessionId);
|
|
13386
|
-
if (ls && ls.engine === "goal" && ls.active !== false) {
|
|
13387
|
-
|
|
13665
|
+
if (ls && ls.engine === "goal" && ls.active !== false && ls.phase !== "done" && ls.phase !== "gave_up" && ls.phase !== "cancelled") {
|
|
13666
|
+
if (process.env.SVAMP_LOOP_VERIFY === "0") {
|
|
13667
|
+
writeGoalLoopState(directory, sessionId, { active: false, phase: "done", completed_at: Date.now() });
|
|
13668
|
+
} else {
|
|
13669
|
+
void verifyGoalCompletion(ls);
|
|
13670
|
+
}
|
|
13388
13671
|
}
|
|
13389
13672
|
} catch {
|
|
13390
13673
|
}
|
|
@@ -14207,9 +14490,9 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
14207
14490
|
onBash: async (command, cwd, timeout) => {
|
|
14208
14491
|
const execTimeout = timeout || 12e4;
|
|
14209
14492
|
logger.log(`[Session ${sessionId}] Bash: ${command} (cwd: ${cwd || directory}, timeout: ${execTimeout}ms)`);
|
|
14210
|
-
const { exec } = await import('child_process');
|
|
14493
|
+
const { exec: exec2 } = await import('child_process');
|
|
14211
14494
|
return new Promise((resolve2) => {
|
|
14212
|
-
|
|
14495
|
+
exec2(command, { cwd: cwd || directory, timeout: execTimeout, maxBuffer: 1024 * 1024 }, (err, stdout, stderr) => {
|
|
14213
14496
|
if (err) {
|
|
14214
14497
|
resolve2({ success: false, stdout: stdout || "", stderr: stderr || err.message, exitCode: err.code ?? 1 });
|
|
14215
14498
|
} else {
|
|
@@ -14219,18 +14502,18 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
14219
14502
|
});
|
|
14220
14503
|
},
|
|
14221
14504
|
onIssue: async (params) => {
|
|
14222
|
-
const { issueRpc } = await import('./rpc-
|
|
14505
|
+
const { issueRpc } = await import('./rpc-D1_ae6MP.mjs');
|
|
14223
14506
|
return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner, rekickLoopOwner });
|
|
14224
14507
|
},
|
|
14225
14508
|
onWorkflow: async (params) => {
|
|
14226
|
-
const { workflowRpc } = await import('./rpc-
|
|
14509
|
+
const { workflowRpc } = await import('./rpc-DBDPUPj4.mjs');
|
|
14227
14510
|
return workflowRpc(params?.cwd || directory, params || {});
|
|
14228
14511
|
},
|
|
14229
14512
|
onRipgrep: async (args, cwd) => {
|
|
14230
|
-
const { exec } = await import('child_process');
|
|
14513
|
+
const { exec: exec2 } = await import('child_process');
|
|
14231
14514
|
const rgCwd = cwd || directory;
|
|
14232
14515
|
return new Promise((resolve2, reject) => {
|
|
14233
|
-
|
|
14516
|
+
exec2(`rg ${args}`, { cwd: rgCwd, timeout: 3e4, maxBuffer: 5 * 1024 * 1024 }, (err, stdout) => {
|
|
14234
14517
|
if (err && !stdout) {
|
|
14235
14518
|
reject(new Error(err.message));
|
|
14236
14519
|
} else {
|
|
@@ -14744,9 +15027,9 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
14744
15027
|
},
|
|
14745
15028
|
onBash: async (command, cwd, timeout) => {
|
|
14746
15029
|
const execTimeout = timeout || 12e4;
|
|
14747
|
-
const { exec } = await import('child_process');
|
|
15030
|
+
const { exec: exec2 } = await import('child_process');
|
|
14748
15031
|
return new Promise((resolve2) => {
|
|
14749
|
-
|
|
15032
|
+
exec2(command, { cwd: cwd || directory, timeout: execTimeout, maxBuffer: 1024 * 1024 }, (err, stdout, stderr) => {
|
|
14750
15033
|
if (err) {
|
|
14751
15034
|
resolve2({ success: false, stdout: stdout || "", stderr: stderr || err.message, exitCode: err.code ?? 1 });
|
|
14752
15035
|
} else {
|
|
@@ -14756,18 +15039,18 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
14756
15039
|
});
|
|
14757
15040
|
},
|
|
14758
15041
|
onIssue: async (params) => {
|
|
14759
|
-
const { issueRpc } = await import('./rpc-
|
|
15042
|
+
const { issueRpc } = await import('./rpc-D1_ae6MP.mjs');
|
|
14760
15043
|
return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner, rekickLoopOwner });
|
|
14761
15044
|
},
|
|
14762
15045
|
onWorkflow: async (params) => {
|
|
14763
|
-
const { workflowRpc } = await import('./rpc-
|
|
15046
|
+
const { workflowRpc } = await import('./rpc-DBDPUPj4.mjs');
|
|
14764
15047
|
return workflowRpc(params?.cwd || directory, params || {});
|
|
14765
15048
|
},
|
|
14766
15049
|
onRipgrep: async (args, cwd) => {
|
|
14767
|
-
const { exec } = await import('child_process');
|
|
15050
|
+
const { exec: exec2 } = await import('child_process');
|
|
14768
15051
|
const rgCwd = cwd || directory;
|
|
14769
15052
|
return new Promise((resolve2, reject) => {
|
|
14770
|
-
|
|
15053
|
+
exec2(`rg ${args}`, { cwd: rgCwd, timeout: 3e4, maxBuffer: 5 * 1024 * 1024 }, (err, stdout) => {
|
|
14771
15054
|
if (err && !stdout) {
|
|
14772
15055
|
reject(new Error(err.message));
|
|
14773
15056
|
} else {
|
|
@@ -15534,7 +15817,7 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
15534
15817
|
const PING_TIMEOUT_MS = 15e3;
|
|
15535
15818
|
const POST_RECONNECT_GRACE_MS = 2e4;
|
|
15536
15819
|
const RECONNECT_JITTER_MS = 2500;
|
|
15537
|
-
const { WorkflowScheduler } = await import('./scheduler-
|
|
15820
|
+
const { WorkflowScheduler } = await import('./scheduler-DPwwX1fQ.mjs');
|
|
15538
15821
|
const workflowScheduler = new WorkflowScheduler({
|
|
15539
15822
|
projectRoots: () => {
|
|
15540
15823
|
const dirs = /* @__PURE__ */ new Set();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import { a4 as applyClaudeProxyEnv, a5 as composeSessionId, a6 as generateFriendlyName, c as connectToHypha, a as createSessionStore, r as registerMachineService, a7 as generateHookSettings } from './run-
|
|
1
|
+
import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import { a4 as applyClaudeProxyEnv, a5 as composeSessionId, a6 as generateFriendlyName, c as connectToHypha, a as createSessionStore, r as registerMachineService, a7 as generateHookSettings } from './run-CXQ-NEsY.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 { m as resolveProjectRoot, y as cronMatches } from './run-
|
|
1
|
+
import { m as resolveProjectRoot, y as cronMatches } from './run-CXQ-NEsY.mjs';
|
|
2
2
|
import { l as listWorkflows, i as isWorkflowEnabled, w as workflowCrons } from './store-BTs0H_y0.mjs';
|
|
3
3
|
import { r as runWorkflow } from './runStore-CtptN7US.mjs';
|
|
4
4
|
import 'os';
|
|
@@ -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-Cb4O-FK1.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-Cb4O-FK1.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-Cb4O-FK1.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-Cb4O-FK1.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-Cb4O-FK1.mjs');
|
|
239
239
|
const { machine, server } = await connectAndGetMachine(machineId);
|
|
240
240
|
try {
|
|
241
241
|
const info = await machine.serveInfo();
|
|
@@ -4,7 +4,7 @@ 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 { k as getHyphaServerUrl, S as ServeAuth, l as hasCookieToken } from './run-
|
|
7
|
+
import { k as getHyphaServerUrl, S as ServeAuth, l as hasCookieToken } from './run-CXQ-NEsY.mjs';
|
|
8
8
|
import 'os';
|
|
9
9
|
import 'fs/promises';
|
|
10
10
|
import 'url';
|
|
@@ -733,7 +733,7 @@ class ServeManager {
|
|
|
733
733
|
const mount = this.mounts.get(mountName);
|
|
734
734
|
const subdomainOverride = mount?.access === "link" && mount.linkToken ? /* @__PURE__ */ new Map([[this.port, buildLinkSubdomain(subdomainSafe, mount.linkToken)]]) : void 0;
|
|
735
735
|
try {
|
|
736
|
-
const { FrpcTunnel } = await import('./frpc-
|
|
736
|
+
const { FrpcTunnel } = await import('./frpc-DLHENjxp.mjs');
|
|
737
737
|
let tunnel;
|
|
738
738
|
tunnel = new FrpcTunnel({
|
|
739
739
|
name: tunnelName,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as READ_ONLY_TOOLS, B as loadMachineContext, C as buildMachineInstructions, D as machineToolsForRole, E as buildMachineTools } from './run-
|
|
1
|
+
import { R as READ_ONLY_TOOLS, B as loadMachineContext, C as buildMachineInstructions, D as machineToolsForRole, E as buildMachineTools } from './run-CXQ-NEsY.mjs';
|
|
2
2
|
import 'node:child_process';
|
|
3
3
|
import 'os';
|
|
4
4
|
import 'fs/promises';
|