svamp-cli 0.2.227 → 0.2.229-canary.0
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-7sqKMVIC.mjs → agentCommands-vkCF5lpv.mjs} +5 -5
- package/dist/{auth-BfDZbHl6.mjs → auth-BWbt32no.mjs} +1 -1
- package/dist/cli.mjs +61 -61
- package/dist/{commands-CWP-J9Cf.mjs → commands-B3Xk9fwW.mjs} +2 -2
- package/dist/{commands-H9h_Mtc4.mjs → commands-BT_CTF0d.mjs} +1 -1
- package/dist/{commands-CU8JDM2d.mjs → commands-BjeQfqB_.mjs} +1 -1
- package/dist/{commands-YML8Rs_R.mjs → commands-C8KarfSR.mjs} +2 -2
- package/dist/{commands-DA_Nx893.mjs → commands-CFrbZPUJ.mjs} +6 -6
- package/dist/{commands-CnlQyDxb.mjs → commands-CuZE9mRT.mjs} +1 -1
- package/dist/{commands-D2iQ2v7_.mjs → commands-DdV_aiDb.mjs} +1 -1
- package/dist/{fleet-B_78L11T.mjs → fleet-C_NOOHxk.mjs} +1 -1
- package/dist/{frpc-BQyt6j5A.mjs → frpc-C_QVN19_.mjs} +1 -1
- package/dist/{headlessCli-CYfN9XvR.mjs → headlessCli-CRChkXw1.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{package-VYP3g593.mjs → package-DbkinILk.mjs} +2 -2
- package/dist/{rpc-a0fp9HhD.mjs → rpc-TUmuH8g2.mjs} +1 -1
- package/dist/{rpc-DMj8ZJPz.mjs → rpc-YXnMjpKe.mjs} +1 -1
- package/dist/{run-LEPH8aka.mjs → run-0V-n-CNt.mjs} +343 -22
- package/dist/{run-DkjwFIFH.mjs → run-W51ltwnJ.mjs} +1 -1
- package/dist/{scheduler-Bz80Ipep.mjs → scheduler-qCvd2QDu.mjs} +1 -1
- package/dist/{serveCommands-u_GoFaBX.mjs → serveCommands-BZX0vJd6.mjs} +5 -5
- package/dist/{serveManager-9vhexH1L.mjs → serveManager-DcgRn8O8.mjs} +2 -2
- package/dist/{sideband-RJijk2GE.mjs → sideband-DSacG3qE.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-0V-n-CNt.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-0V-n-CNt.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-0V-n-CNt.mjs';
|
|
2
|
+
import { handleRealtimeEvent, initMachineVoiceSession } from './sideband-DSacG3qE.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-0V-n-CNt.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.0";
|
|
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-0V-n-CNt.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-0V-n-CNt.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-C_QVN19_.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-DSacG3qE.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-CuZE9mRT.mjs');
|
|
3466
3466
|
const timeout = c.reply?.timeout_sec || 120;
|
|
3467
3467
|
let result;
|
|
3468
3468
|
try {
|
|
@@ -10695,6 +10695,127 @@ 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 parseEvaluatorVerdict(text) {
|
|
10745
|
+
if (!text) return null;
|
|
10746
|
+
const candidates = [];
|
|
10747
|
+
let depth = 0, start = -1;
|
|
10748
|
+
for (let i = 0; i < text.length; i++) {
|
|
10749
|
+
const c = text[i];
|
|
10750
|
+
if (c === "{") {
|
|
10751
|
+
if (depth === 0) start = i;
|
|
10752
|
+
depth++;
|
|
10753
|
+
} else if (c === "}") {
|
|
10754
|
+
depth--;
|
|
10755
|
+
if (depth === 0 && start >= 0) {
|
|
10756
|
+
candidates.push(text.slice(start, i + 1));
|
|
10757
|
+
start = -1;
|
|
10758
|
+
}
|
|
10759
|
+
}
|
|
10760
|
+
}
|
|
10761
|
+
for (let i = candidates.length - 1; i >= 0; i--) {
|
|
10762
|
+
try {
|
|
10763
|
+
const o = JSON.parse(candidates[i]);
|
|
10764
|
+
if (o && (o.verdict === "done" || o.verdict === "continue")) {
|
|
10765
|
+
return { verdict: o.verdict, reason: typeof o.reason === "string" ? o.reason : void 0, guidance: typeof o.guidance === "string" ? o.guidance : void 0 };
|
|
10766
|
+
}
|
|
10767
|
+
} catch {
|
|
10768
|
+
}
|
|
10769
|
+
}
|
|
10770
|
+
return null;
|
|
10771
|
+
}
|
|
10772
|
+
async function runLoopVerification(cfg, deps) {
|
|
10773
|
+
const log = deps.log || (() => {
|
|
10774
|
+
});
|
|
10775
|
+
const maxHolds = typeof cfg.maxHolds === "number" && cfg.maxHolds > 0 ? cfg.maxHolds : 3;
|
|
10776
|
+
const holds = typeof cfg.holds === "number" && cfg.holds > 0 ? cfg.holds : 0;
|
|
10777
|
+
let oracleOutput = "";
|
|
10778
|
+
try {
|
|
10779
|
+
const o = await deps.runOracle(cfg.oracle);
|
|
10780
|
+
oracleOutput = o.output || "";
|
|
10781
|
+
if (!o.ok) {
|
|
10782
|
+
if (holds + 1 > maxHolds) {
|
|
10783
|
+
return { action: "gave_up", reason: `oracle still reports pending work after ${holds} verification hold(s): ${oracleOutput.trim().slice(0, 200)}` };
|
|
10784
|
+
}
|
|
10785
|
+
log(`[loopVerify] oracle reports pending work \u2014 re-kicking instead of marking done`);
|
|
10786
|
+
return { action: "rekick", reason: "oracle reports pending work", guidance: `The loop oracle still reports unfinished work, so the goal is NOT complete:
|
|
10787
|
+
${oracleOutput.trim().slice(0, 500)}
|
|
10788
|
+
Keep working until it is genuinely empty.` };
|
|
10789
|
+
}
|
|
10790
|
+
} catch (e) {
|
|
10791
|
+
log(`[loopVerify] oracle runner error (continuing to evaluator): ${e?.message || e}`);
|
|
10792
|
+
}
|
|
10793
|
+
const closed = issuesClosedSince(deps.projectRoot, cfg.startedAt);
|
|
10794
|
+
const prompt = buildEvaluatorPrompt({ task: cfg.task, until: cfg.until, oracle: cfg.oracle, oracleOutput, closedIssues: closed });
|
|
10795
|
+
let raw = "";
|
|
10796
|
+
try {
|
|
10797
|
+
raw = await deps.runEvaluator(prompt);
|
|
10798
|
+
} catch (e) {
|
|
10799
|
+
log(`[loopVerify] evaluator spawn failed \u2014 failing OPEN (marking done): ${e?.message || e}`);
|
|
10800
|
+
return { action: "done" };
|
|
10801
|
+
}
|
|
10802
|
+
const verdict = parseEvaluatorVerdict(raw);
|
|
10803
|
+
if (!verdict) {
|
|
10804
|
+
log(`[loopVerify] could not parse evaluator verdict \u2014 failing OPEN (marking done)`);
|
|
10805
|
+
return { action: "done" };
|
|
10806
|
+
}
|
|
10807
|
+
if (verdict.verdict === "done") {
|
|
10808
|
+
log(`[loopVerify] evaluator confirms done${verdict.reason ? `: ${verdict.reason}` : ""}`);
|
|
10809
|
+
return { action: "done" };
|
|
10810
|
+
}
|
|
10811
|
+
if (holds + 1 > maxHolds) {
|
|
10812
|
+
return { action: "gave_up", reason: `evaluator held "continue" past the limit (${maxHolds})${verdict.reason ? `: ${verdict.reason}` : ""}` };
|
|
10813
|
+
}
|
|
10814
|
+
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");
|
|
10815
|
+
log(`[loopVerify] evaluator says continue \u2014 re-kicking (hold ${holds + 1}/${maxHolds})`);
|
|
10816
|
+
return { action: "rekick", reason: verdict.reason || "evaluator says continue", guidance };
|
|
10817
|
+
}
|
|
10818
|
+
|
|
10698
10819
|
const OAUTH_TOKEN_ENDPOINT = "https://platform.claude.com/v1/oauth/token";
|
|
10699
10820
|
const OAUTH_CLIENT_ID = "9d1c250a-e61b-44d9-88ed-5944d1962f5e";
|
|
10700
10821
|
const OAUTH_SCOPES = "user:profile user:inference user:sessions:claude_code user:mcp_servers user:file_upload";
|
|
@@ -11582,6 +11703,39 @@ function loopResumeMessage(directory, sessionId) {
|
|
|
11582
11703
|
}
|
|
11583
11704
|
return "Continue the loop \u2014 keep working toward the goal until its exit conditions are met.";
|
|
11584
11705
|
}
|
|
11706
|
+
function stripOldLoopHooks(directory) {
|
|
11707
|
+
try {
|
|
11708
|
+
const p = join$1(directory, ".claude", "settings.json");
|
|
11709
|
+
if (!existsSync$1(p)) return false;
|
|
11710
|
+
const cfg = JSON.parse(readFileSync$1(p, "utf-8"));
|
|
11711
|
+
if (!cfg || typeof cfg.hooks !== "object" || !cfg.hooks) return false;
|
|
11712
|
+
const OLD = /(stop-gate|inject-loop|precompact|state-fp|loop-init|loop-status)\.mjs/;
|
|
11713
|
+
let changed = false;
|
|
11714
|
+
for (const event of Object.keys(cfg.hooks)) {
|
|
11715
|
+
const arr = cfg.hooks[event];
|
|
11716
|
+
if (!Array.isArray(arr)) continue;
|
|
11717
|
+
const keptGroups = arr.filter((group) => {
|
|
11718
|
+
if (group && Array.isArray(group.hooks)) {
|
|
11719
|
+
const before = group.hooks.length;
|
|
11720
|
+
group.hooks = group.hooks.filter((h) => !(h && typeof h.command === "string" && OLD.test(h.command)));
|
|
11721
|
+
if (group.hooks.length !== before) changed = true;
|
|
11722
|
+
return group.hooks.length > 0;
|
|
11723
|
+
}
|
|
11724
|
+
return true;
|
|
11725
|
+
});
|
|
11726
|
+
if (keptGroups.length !== arr.length) changed = true;
|
|
11727
|
+
if (keptGroups.length === 0) delete cfg.hooks[event];
|
|
11728
|
+
else cfg.hooks[event] = keptGroups;
|
|
11729
|
+
}
|
|
11730
|
+
if (changed) {
|
|
11731
|
+
if (Object.keys(cfg.hooks).length === 0) delete cfg.hooks;
|
|
11732
|
+
writeFileSync$1(p, JSON.stringify(cfg, null, 2));
|
|
11733
|
+
}
|
|
11734
|
+
return changed;
|
|
11735
|
+
} catch {
|
|
11736
|
+
return false;
|
|
11737
|
+
}
|
|
11738
|
+
}
|
|
11585
11739
|
function deactivateLoop(directory, sessionId) {
|
|
11586
11740
|
try {
|
|
11587
11741
|
const p = join$1(getLoopDir(directory, sessionId), "loop-state.json");
|
|
@@ -11808,7 +11962,11 @@ function createSvampConfigChecker(directory, sessionId, getMetadata, setMetadata
|
|
|
11808
11962
|
const oracle = typeof cfg.oracle === "string" && cfg.oracle.trim() ? cfg.oracle.trim() : void 0;
|
|
11809
11963
|
const maxIterations = typeof cfg.max_iterations === "number" ? cfg.max_iterations : typeof cfg.max_rounds === "number" ? cfg.max_rounds : 20;
|
|
11810
11964
|
const condition = buildGoalCondition({ task, until, oracle, maxIterations });
|
|
11811
|
-
|
|
11965
|
+
try {
|
|
11966
|
+
stripOldLoopHooks(directory);
|
|
11967
|
+
} catch {
|
|
11968
|
+
}
|
|
11969
|
+
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 });
|
|
11812
11970
|
const existingQueue = getMetadata().messageQueue || [];
|
|
11813
11971
|
setMetadata((m) => ({ ...m, messageQueue: [...existingQueue, { id: randomUUID$1(), text: `/goal ${condition}`, displayText: `\u{1F3AF} Goal: ${(task || until || "").slice(0, 100)}`, createdAt: Date.now() }] }));
|
|
11814
11972
|
onLoopActivated?.();
|
|
@@ -12257,7 +12415,7 @@ async function startDaemon(options) {
|
|
|
12257
12415
|
saveExposedTunnels(list);
|
|
12258
12416
|
}
|
|
12259
12417
|
async function createExposedTunnel(spec) {
|
|
12260
|
-
const { FrpcTunnel } = await import('./frpc-
|
|
12418
|
+
const { FrpcTunnel } = await import('./frpc-C_QVN19_.mjs');
|
|
12261
12419
|
const tunnel = new FrpcTunnel({
|
|
12262
12420
|
name: spec.name,
|
|
12263
12421
|
ports: spec.ports,
|
|
@@ -12277,7 +12435,7 @@ async function startDaemon(options) {
|
|
|
12277
12435
|
return tunnel;
|
|
12278
12436
|
}
|
|
12279
12437
|
const tunnelRecreateState = /* @__PURE__ */ new Map();
|
|
12280
|
-
const { ServeManager } = await import('./serveManager-
|
|
12438
|
+
const { ServeManager } = await import('./serveManager-DcgRn8O8.mjs');
|
|
12281
12439
|
const serveManager = new ServeManager(SVAMP_HOME, (msg) => logger.log(`[SERVE] ${msg}`), hyphaServerUrl);
|
|
12282
12440
|
ensureAutoInstalledSkills(logger).catch(() => {
|
|
12283
12441
|
});
|
|
@@ -12900,6 +13058,161 @@ ${parts.join("\n")}`);
|
|
|
12900
13058
|
};
|
|
12901
13059
|
sessionService.updateMetadata(sessionMetadata);
|
|
12902
13060
|
};
|
|
13061
|
+
const enqueueLoopMessage = (text, displayText) => {
|
|
13062
|
+
const existingQueue = sessionMetadata.messageQueue || [];
|
|
13063
|
+
sessionMetadata = {
|
|
13064
|
+
...sessionMetadata,
|
|
13065
|
+
messageQueue: [...existingQueue, { id: randomUUID$1(), text, displayText, createdAt: Date.now() }]
|
|
13066
|
+
};
|
|
13067
|
+
sessionService.updateMetadata(sessionMetadata);
|
|
13068
|
+
};
|
|
13069
|
+
const runHeadlessEvaluator = (prompt) => new Promise((resolve2, reject) => {
|
|
13070
|
+
const evalArgs = [
|
|
13071
|
+
"--print",
|
|
13072
|
+
prompt,
|
|
13073
|
+
// Read-only reviewer (mirrors .claude/agents/loop-evaluator.md): it inspects
|
|
13074
|
+
// real repo state but must not mutate the working tree it's judging.
|
|
13075
|
+
"--allowedTools",
|
|
13076
|
+
"Read",
|
|
13077
|
+
"Bash",
|
|
13078
|
+
"Grep",
|
|
13079
|
+
"Glob",
|
|
13080
|
+
"--disallowedTools",
|
|
13081
|
+
"Write",
|
|
13082
|
+
"Edit",
|
|
13083
|
+
"MultiEdit",
|
|
13084
|
+
"NotebookEdit",
|
|
13085
|
+
"--permission-mode",
|
|
13086
|
+
"bypassPermissions",
|
|
13087
|
+
"--output-format",
|
|
13088
|
+
"stream-json",
|
|
13089
|
+
"--verbose"
|
|
13090
|
+
];
|
|
13091
|
+
const evalEnv = { ...process.env };
|
|
13092
|
+
applyClaudeProxyEnv(evalEnv);
|
|
13093
|
+
delete evalEnv.CLAUDECODE;
|
|
13094
|
+
let proc;
|
|
13095
|
+
try {
|
|
13096
|
+
proc = spawn$1("claude", evalArgs, { cwd: directory, env: evalEnv, stdio: ["pipe", "pipe", "pipe"] });
|
|
13097
|
+
} catch (e) {
|
|
13098
|
+
reject(e);
|
|
13099
|
+
return;
|
|
13100
|
+
}
|
|
13101
|
+
let out = "", buf = "", stderr = "", settled = false;
|
|
13102
|
+
const timer = setTimeout(() => {
|
|
13103
|
+
if (settled) return;
|
|
13104
|
+
settled = true;
|
|
13105
|
+
try {
|
|
13106
|
+
proc.kill("SIGTERM");
|
|
13107
|
+
} catch {
|
|
13108
|
+
}
|
|
13109
|
+
reject(new Error("evaluator timeout"));
|
|
13110
|
+
}, 3e5);
|
|
13111
|
+
proc.stderr?.on("data", (c) => {
|
|
13112
|
+
stderr += c.toString();
|
|
13113
|
+
});
|
|
13114
|
+
proc.stdout.on("data", (chunk) => {
|
|
13115
|
+
buf += chunk.toString();
|
|
13116
|
+
let nl;
|
|
13117
|
+
while ((nl = buf.indexOf("\n")) !== -1) {
|
|
13118
|
+
const line = buf.slice(0, nl);
|
|
13119
|
+
buf = buf.slice(nl + 1);
|
|
13120
|
+
if (!line.trim()) continue;
|
|
13121
|
+
try {
|
|
13122
|
+
const m = JSON.parse(line);
|
|
13123
|
+
if (m.type === "assistant" && m.message?.content) {
|
|
13124
|
+
for (const b of m.message.content) if (b.type === "text" && b.text) out += b.text;
|
|
13125
|
+
} else if (m.type === "result") {
|
|
13126
|
+
if (settled) continue;
|
|
13127
|
+
settled = true;
|
|
13128
|
+
clearTimeout(timer);
|
|
13129
|
+
if (m.is_error) reject(new Error(String(m.result || "evaluator error")));
|
|
13130
|
+
else resolve2(out || String(m.result || ""));
|
|
13131
|
+
}
|
|
13132
|
+
} catch {
|
|
13133
|
+
}
|
|
13134
|
+
}
|
|
13135
|
+
});
|
|
13136
|
+
proc.on("exit", (code) => {
|
|
13137
|
+
if (settled) return;
|
|
13138
|
+
settled = true;
|
|
13139
|
+
clearTimeout(timer);
|
|
13140
|
+
if (code === 0) resolve2(out);
|
|
13141
|
+
else reject(new Error(stderr.trim() || `evaluator exited with code ${code}`));
|
|
13142
|
+
});
|
|
13143
|
+
proc.on("error", (e) => {
|
|
13144
|
+
if (settled) return;
|
|
13145
|
+
settled = true;
|
|
13146
|
+
clearTimeout(timer);
|
|
13147
|
+
reject(e);
|
|
13148
|
+
});
|
|
13149
|
+
});
|
|
13150
|
+
let goalVerifyInFlight = false;
|
|
13151
|
+
const verifyGoalCompletion = async (ls) => {
|
|
13152
|
+
if (goalVerifyInFlight) return;
|
|
13153
|
+
goalVerifyInFlight = true;
|
|
13154
|
+
const projectRoot = resolveProjectRoot(directory);
|
|
13155
|
+
const startedAt = typeof ls.started_at === "number" ? ls.started_at : typeof ls.resumed_at === "number" ? ls.resumed_at : void 0;
|
|
13156
|
+
const holds = typeof ls.holds === "number" ? ls.holds : 0;
|
|
13157
|
+
const oracleCmd = typeof ls.oracle === "string" && ls.oracle.trim() ? ls.oracle.trim() : void 0;
|
|
13158
|
+
try {
|
|
13159
|
+
sessionService.pushMessage({ type: "message", message: "\u{1F50D} Verifying loop completion (independent review)\u2026" }, "event");
|
|
13160
|
+
const result = await runLoopVerification(
|
|
13161
|
+
{ task: ls.goal_task || ls.task, until: ls.until, oracle: oracleCmd, startedAt, holds, maxHolds: 3 },
|
|
13162
|
+
{
|
|
13163
|
+
projectRoot,
|
|
13164
|
+
runOracle: async (cmd) => {
|
|
13165
|
+
if (cmd) {
|
|
13166
|
+
return await new Promise((resolve2) => {
|
|
13167
|
+
exec$1(cmd, { cwd: directory, timeout: 12e4, maxBuffer: 16 * 1024 * 1024 }, (err, stdout, stderr) => {
|
|
13168
|
+
if (err) resolve2({ ok: false, output: (String(stdout || "") + String(stderr || "")).slice(-500) });
|
|
13169
|
+
else resolve2({ ok: true, output: "" });
|
|
13170
|
+
});
|
|
13171
|
+
});
|
|
13172
|
+
}
|
|
13173
|
+
const pending = backlogOraclePending(projectRoot, sessionId);
|
|
13174
|
+
return { ok: pending.length === 0, output: pending.length ? `${pending.length} pending: ${pending.map((i) => "#" + i.id).join(" ")}` : "No pending issues." };
|
|
13175
|
+
},
|
|
13176
|
+
runEvaluator: (prompt) => runHeadlessEvaluator(prompt),
|
|
13177
|
+
log: (m) => logger.log(`[Session ${sessionId}] ${m}`)
|
|
13178
|
+
}
|
|
13179
|
+
);
|
|
13180
|
+
if (result.action === "rekick") {
|
|
13181
|
+
const cond = ls.task || "";
|
|
13182
|
+
writeGoalLoopState(directory, sessionId, {
|
|
13183
|
+
active: true,
|
|
13184
|
+
phase: "continue",
|
|
13185
|
+
iteration: ls.iteration || 0,
|
|
13186
|
+
task: ls.task,
|
|
13187
|
+
goal_task: ls.goal_task,
|
|
13188
|
+
until: ls.until,
|
|
13189
|
+
oracle: oracleCmd,
|
|
13190
|
+
max_iterations: ls.max_iterations,
|
|
13191
|
+
started_at: startedAt,
|
|
13192
|
+
holds: holds + 1
|
|
13193
|
+
});
|
|
13194
|
+
const guidance = result.guidance.replace(/\s+/g, " ").slice(0, 1200);
|
|
13195
|
+
sessionService.pushMessage({ type: "message", message: `\u{1F501} Loop not done \u2014 independent review: ${result.reason}`, level: "warning" }, "event");
|
|
13196
|
+
enqueueLoopMessage(`/goal ${cond} \u2014 INDEPENDENT REVIEW FEEDBACK (resolve before declaring done): ${guidance}`, "\u{1F501} Re-verifying loop");
|
|
13197
|
+
if (!trackedSession.stopped) setTimeout(() => processMessageQueueRef?.(), 200);
|
|
13198
|
+
} else if (result.action === "gave_up") {
|
|
13199
|
+
writeGoalLoopState(directory, sessionId, { active: false, phase: "gave_up", completed_at: Date.now(), gave_up_reason: result.reason, holds });
|
|
13200
|
+
checkSvampConfig?.();
|
|
13201
|
+
} else {
|
|
13202
|
+
writeGoalLoopState(directory, sessionId, { active: false, phase: "done", completed_at: Date.now(), holds });
|
|
13203
|
+
checkSvampConfig?.();
|
|
13204
|
+
}
|
|
13205
|
+
} catch (e) {
|
|
13206
|
+
logger.log(`[Session ${sessionId}] verifyGoalCompletion error \u2014 failing open (done): ${e?.message || e}`);
|
|
13207
|
+
try {
|
|
13208
|
+
writeGoalLoopState(directory, sessionId, { active: false, phase: "done", completed_at: Date.now() });
|
|
13209
|
+
checkSvampConfig?.();
|
|
13210
|
+
} catch {
|
|
13211
|
+
}
|
|
13212
|
+
} finally {
|
|
13213
|
+
goalVerifyInFlight = false;
|
|
13214
|
+
}
|
|
13215
|
+
};
|
|
12903
13216
|
const signalProcessing = (processing) => {
|
|
12904
13217
|
sessionService.sendKeepAlive(processing);
|
|
12905
13218
|
const newState = processing ? "running" : "idle";
|
|
@@ -13022,6 +13335,10 @@ ${parts.join("\n")}`);
|
|
|
13022
13335
|
} catch (err) {
|
|
13023
13336
|
logger.log(`[Session ${sessionId}] Failed to generate hook settings: ${err?.message || err}`);
|
|
13024
13337
|
}
|
|
13338
|
+
try {
|
|
13339
|
+
if (stripOldLoopHooks(directory)) logger.log(`[Session ${sessionId}] Stripped retired loop-engine hooks from settings.json`);
|
|
13340
|
+
} catch {
|
|
13341
|
+
}
|
|
13025
13342
|
}
|
|
13026
13343
|
if (hookSettings) args.push("--settings", hookSettings.settingsPath);
|
|
13027
13344
|
let spawnCommand = "claude";
|
|
@@ -13342,8 +13659,12 @@ ${parts.join("\n")}`);
|
|
|
13342
13659
|
clearInboundContext(sessionId);
|
|
13343
13660
|
try {
|
|
13344
13661
|
const ls = readLoopState(directory, sessionId);
|
|
13345
|
-
if (ls && ls.engine === "goal" && ls.active !== false) {
|
|
13346
|
-
|
|
13662
|
+
if (ls && ls.engine === "goal" && ls.active !== false && ls.phase !== "done" && ls.phase !== "gave_up" && ls.phase !== "cancelled") {
|
|
13663
|
+
if (process.env.SVAMP_LOOP_VERIFY === "0") {
|
|
13664
|
+
writeGoalLoopState(directory, sessionId, { active: false, phase: "done", completed_at: Date.now() });
|
|
13665
|
+
} else {
|
|
13666
|
+
void verifyGoalCompletion(ls);
|
|
13667
|
+
}
|
|
13347
13668
|
}
|
|
13348
13669
|
} catch {
|
|
13349
13670
|
}
|
|
@@ -14166,9 +14487,9 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
14166
14487
|
onBash: async (command, cwd, timeout) => {
|
|
14167
14488
|
const execTimeout = timeout || 12e4;
|
|
14168
14489
|
logger.log(`[Session ${sessionId}] Bash: ${command} (cwd: ${cwd || directory}, timeout: ${execTimeout}ms)`);
|
|
14169
|
-
const { exec } = await import('child_process');
|
|
14490
|
+
const { exec: exec2 } = await import('child_process');
|
|
14170
14491
|
return new Promise((resolve2) => {
|
|
14171
|
-
|
|
14492
|
+
exec2(command, { cwd: cwd || directory, timeout: execTimeout, maxBuffer: 1024 * 1024 }, (err, stdout, stderr) => {
|
|
14172
14493
|
if (err) {
|
|
14173
14494
|
resolve2({ success: false, stdout: stdout || "", stderr: stderr || err.message, exitCode: err.code ?? 1 });
|
|
14174
14495
|
} else {
|
|
@@ -14178,18 +14499,18 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
14178
14499
|
});
|
|
14179
14500
|
},
|
|
14180
14501
|
onIssue: async (params) => {
|
|
14181
|
-
const { issueRpc } = await import('./rpc-
|
|
14502
|
+
const { issueRpc } = await import('./rpc-TUmuH8g2.mjs');
|
|
14182
14503
|
return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner, rekickLoopOwner });
|
|
14183
14504
|
},
|
|
14184
14505
|
onWorkflow: async (params) => {
|
|
14185
|
-
const { workflowRpc } = await import('./rpc-
|
|
14506
|
+
const { workflowRpc } = await import('./rpc-YXnMjpKe.mjs');
|
|
14186
14507
|
return workflowRpc(params?.cwd || directory, params || {});
|
|
14187
14508
|
},
|
|
14188
14509
|
onRipgrep: async (args, cwd) => {
|
|
14189
|
-
const { exec } = await import('child_process');
|
|
14510
|
+
const { exec: exec2 } = await import('child_process');
|
|
14190
14511
|
const rgCwd = cwd || directory;
|
|
14191
14512
|
return new Promise((resolve2, reject) => {
|
|
14192
|
-
|
|
14513
|
+
exec2(`rg ${args}`, { cwd: rgCwd, timeout: 3e4, maxBuffer: 5 * 1024 * 1024 }, (err, stdout) => {
|
|
14193
14514
|
if (err && !stdout) {
|
|
14194
14515
|
reject(new Error(err.message));
|
|
14195
14516
|
} else {
|
|
@@ -14703,9 +15024,9 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
14703
15024
|
},
|
|
14704
15025
|
onBash: async (command, cwd, timeout) => {
|
|
14705
15026
|
const execTimeout = timeout || 12e4;
|
|
14706
|
-
const { exec } = await import('child_process');
|
|
15027
|
+
const { exec: exec2 } = await import('child_process');
|
|
14707
15028
|
return new Promise((resolve2) => {
|
|
14708
|
-
|
|
15029
|
+
exec2(command, { cwd: cwd || directory, timeout: execTimeout, maxBuffer: 1024 * 1024 }, (err, stdout, stderr) => {
|
|
14709
15030
|
if (err) {
|
|
14710
15031
|
resolve2({ success: false, stdout: stdout || "", stderr: stderr || err.message, exitCode: err.code ?? 1 });
|
|
14711
15032
|
} else {
|
|
@@ -14715,18 +15036,18 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
14715
15036
|
});
|
|
14716
15037
|
},
|
|
14717
15038
|
onIssue: async (params) => {
|
|
14718
|
-
const { issueRpc } = await import('./rpc-
|
|
15039
|
+
const { issueRpc } = await import('./rpc-TUmuH8g2.mjs');
|
|
14719
15040
|
return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner, rekickLoopOwner });
|
|
14720
15041
|
},
|
|
14721
15042
|
onWorkflow: async (params) => {
|
|
14722
|
-
const { workflowRpc } = await import('./rpc-
|
|
15043
|
+
const { workflowRpc } = await import('./rpc-YXnMjpKe.mjs');
|
|
14723
15044
|
return workflowRpc(params?.cwd || directory, params || {});
|
|
14724
15045
|
},
|
|
14725
15046
|
onRipgrep: async (args, cwd) => {
|
|
14726
|
-
const { exec } = await import('child_process');
|
|
15047
|
+
const { exec: exec2 } = await import('child_process');
|
|
14727
15048
|
const rgCwd = cwd || directory;
|
|
14728
15049
|
return new Promise((resolve2, reject) => {
|
|
14729
|
-
|
|
15050
|
+
exec2(`rg ${args}`, { cwd: rgCwd, timeout: 3e4, maxBuffer: 5 * 1024 * 1024 }, (err, stdout) => {
|
|
14730
15051
|
if (err && !stdout) {
|
|
14731
15052
|
reject(new Error(err.message));
|
|
14732
15053
|
} else {
|
|
@@ -15493,7 +15814,7 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
15493
15814
|
const PING_TIMEOUT_MS = 15e3;
|
|
15494
15815
|
const POST_RECONNECT_GRACE_MS = 2e4;
|
|
15495
15816
|
const RECONNECT_JITTER_MS = 2500;
|
|
15496
|
-
const { WorkflowScheduler } = await import('./scheduler-
|
|
15817
|
+
const { WorkflowScheduler } = await import('./scheduler-qCvd2QDu.mjs');
|
|
15497
15818
|
const workflowScheduler = new WorkflowScheduler({
|
|
15498
15819
|
projectRoots: () => {
|
|
15499
15820
|
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-0V-n-CNt.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-0V-n-CNt.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-CuZE9mRT.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-CuZE9mRT.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-CuZE9mRT.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-CuZE9mRT.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-CuZE9mRT.mjs');
|
|
239
239
|
const { machine, server } = await connectAndGetMachine(machineId);
|
|
240
240
|
try {
|
|
241
241
|
const info = await machine.serveInfo();
|