svamp-cli 0.2.260 → 0.2.262
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-BSv2sDdC.mjs → agentCommands-Da1IvglZ.mjs} +5 -5
- package/dist/{auth-U2OQhXs1.mjs → auth-0oP68YeR.mjs} +1 -1
- package/dist/cli.mjs +63 -63
- package/dist/{commands-8qHg0szr.mjs → commands-B8iRZu9B.mjs} +2 -2
- package/dist/{commands-C3tM_vKp.mjs → commands-BO0qy2Y0.mjs} +2 -2
- package/dist/{commands-DAZVK3MR.mjs → commands-CRJ6c4Ea.mjs} +1 -1
- package/dist/{commands-BG8UHYMk.mjs → commands-CijMDYaV.mjs} +1 -1
- package/dist/{commands-ql8AZ56B.mjs → commands-DvsieDv9.mjs} +1 -1
- package/dist/{commands-BCMW-NM7.mjs → commands-QXKWC_Ft.mjs} +1 -1
- package/dist/{commands-CMGqjCrU.mjs → commands-uXRdAqOg.mjs} +6 -6
- package/dist/{fleet-CRR4JSTJ.mjs → fleet-BAWJhQsC.mjs} +1 -1
- package/dist/{frpc-k3ZLz2Mu.mjs → frpc-B7han0nb.mjs} +1 -1
- package/dist/{headlessCli-B78gc29T.mjs → headlessCli-qwpjuvFV.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{package-CKFmfq0u.mjs → package-BejWpjWo.mjs} +1 -1
- package/dist/{rpc-DlioTx05.mjs → rpc-1svTrXB4.mjs} +1 -1
- package/dist/{rpc-BXrKU30m.mjs → rpc-DmHEcy9B.mjs} +1 -1
- package/dist/{run-B8LDPH9R.mjs → run-B7I_RGWW.mjs} +1 -1
- package/dist/{run-DggHONYC.mjs → run-BPaC3cDA.mjs} +94 -26
- package/dist/{scheduler-B9WW7XGk.mjs → scheduler-oOaKoCTW.mjs} +1 -1
- package/dist/{serveCommands-DCA54z5Q.mjs → serveCommands-CIF6ecFk.mjs} +5 -5
- package/dist/{serveManager-BL3aySTV.mjs → serveManager-BiNjVxjK.mjs} +2 -2
- package/dist/{sideband-COyK5_4F.mjs → sideband-COSN23AN.mjs} +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { existsSync, readFileSync, mkdirSync, writeFileSync, renameSync } from '
|
|
|
2
2
|
import { join, dirname } from 'node:path';
|
|
3
3
|
import os from 'node:os';
|
|
4
4
|
import { requireNotSandboxed } from './sandboxDetect-DNTcbgWD.mjs';
|
|
5
|
-
import { k as shortId } from './run-
|
|
5
|
+
import { k as shortId } from './run-BPaC3cDA.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
8
8
|
import 'fs';
|
|
@@ -94,7 +94,7 @@ async function sessionSetTitle(title) {
|
|
|
94
94
|
}
|
|
95
95
|
async function sessionSetProjectDescription(description) {
|
|
96
96
|
const dir = process.cwd();
|
|
97
|
-
const { projectName, writeProjectInfo, sanitizeDescription, projectInfoPath } = await import('./run-
|
|
97
|
+
const { projectName, writeProjectInfo, sanitizeDescription, projectInfoPath } = await import('./run-BPaC3cDA.mjs').then(function (n) { return n.al; });
|
|
98
98
|
const desc = sanitizeDescription(description, 240);
|
|
99
99
|
if (!desc) {
|
|
100
100
|
console.error("Project description is empty.");
|
|
@@ -341,7 +341,7 @@ async function sessionBroadcast(action, args) {
|
|
|
341
341
|
console.log(`Broadcast sent: ${action}`);
|
|
342
342
|
}
|
|
343
343
|
async function connectToMachineService() {
|
|
344
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
344
|
+
const { connectAndGetMachine } = await import('./commands-QXKWC_Ft.mjs');
|
|
345
345
|
return connectAndGetMachine();
|
|
346
346
|
}
|
|
347
347
|
function buildInboxMessage(args) {
|
|
@@ -419,7 +419,7 @@ async function inboxSend(targetSessionId, opts) {
|
|
|
419
419
|
console.error("Message body is required.");
|
|
420
420
|
process.exit(1);
|
|
421
421
|
}
|
|
422
|
-
const { connectAndResolveSession } = await import('./commands-
|
|
422
|
+
const { connectAndResolveSession } = await import('./commands-QXKWC_Ft.mjs');
|
|
423
423
|
let server;
|
|
424
424
|
try {
|
|
425
425
|
const { targetId, messageId } = await inboxSendCore(
|
|
@@ -473,7 +473,7 @@ async function inboxReply(messageId, body) {
|
|
|
473
473
|
console.error("SVAMP_SESSION_ID not set. This command must be run inside a Svamp session.");
|
|
474
474
|
process.exit(1);
|
|
475
475
|
}
|
|
476
|
-
const { connectAndResolveSession } = await import('./commands-
|
|
476
|
+
const { connectAndResolveSession } = await import('./commands-QXKWC_Ft.mjs');
|
|
477
477
|
const { server: localServer, machine: localMachine } = await connectToMachineService();
|
|
478
478
|
let localDisconnected = false;
|
|
479
479
|
const disconnectLocal = async () => {
|
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as clearStopMarker, f as stopMarkerExists, s as startDaemon, b as stopDaemon, d as daemonStatus } from './run-
|
|
1
|
+
import { e as clearStopMarker, f as stopMarkerExists, s as startDaemon, b as stopDaemon, d as daemonStatus } from './run-BPaC3cDA.mjs';
|
|
2
2
|
import { ensureSupervisorViaServiceManager, LAUNCHD_LABEL } from './serviceManager-hlOVxkhW.mjs';
|
|
3
3
|
import 'os';
|
|
4
4
|
import 'fs/promises';
|
|
@@ -32,7 +32,7 @@ const subcommand = args[0];
|
|
|
32
32
|
let daemonSubcommand = args[1];
|
|
33
33
|
async function main() {
|
|
34
34
|
try {
|
|
35
|
-
const { getLoadedConfig } = await import('./run-
|
|
35
|
+
const { getLoadedConfig } = await import('./run-BPaC3cDA.mjs').then(function (n) { return n.as; });
|
|
36
36
|
getLoadedConfig();
|
|
37
37
|
} catch {
|
|
38
38
|
}
|
|
@@ -51,7 +51,7 @@ async function main() {
|
|
|
51
51
|
}
|
|
52
52
|
const whenIdle = args.includes("--when-idle");
|
|
53
53
|
const force = args.includes("--force");
|
|
54
|
-
const mod = await import('./run-
|
|
54
|
+
const mod = await import('./run-BPaC3cDA.mjs').then(function (n) { return n.au; });
|
|
55
55
|
if (whenIdle && !force) {
|
|
56
56
|
if (mod.isDaemonAlive()) {
|
|
57
57
|
mod.writePendingRestart({ reason: "svamp daemon restart --when-idle" });
|
|
@@ -355,7 +355,7 @@ async function main() {
|
|
|
355
355
|
console.error("svamp service: Service commands are not available in sandboxed sessions.");
|
|
356
356
|
process.exit(1);
|
|
357
357
|
}
|
|
358
|
-
const { handleServiceCommand } = await import('./commands-
|
|
358
|
+
const { handleServiceCommand } = await import('./commands-uXRdAqOg.mjs');
|
|
359
359
|
await handleServiceCommand();
|
|
360
360
|
} else if (subcommand === "serve") {
|
|
361
361
|
const { isSandboxed: isSandboxedServe } = await import('./sandboxDetect-DNTcbgWD.mjs');
|
|
@@ -363,7 +363,7 @@ async function main() {
|
|
|
363
363
|
console.error("svamp serve: Serve commands are not available in sandboxed sessions.");
|
|
364
364
|
process.exit(1);
|
|
365
365
|
}
|
|
366
|
-
const { handleServeCommand } = await import('./serveCommands-
|
|
366
|
+
const { handleServeCommand } = await import('./serveCommands-CIF6ecFk.mjs');
|
|
367
367
|
await handleServeCommand();
|
|
368
368
|
process.exit(0);
|
|
369
369
|
} else if (subcommand === "process" || subcommand === "proc") {
|
|
@@ -372,7 +372,7 @@ async function main() {
|
|
|
372
372
|
console.error("svamp process: Process commands are not available in sandboxed sessions.");
|
|
373
373
|
process.exit(1);
|
|
374
374
|
}
|
|
375
|
-
const { processCommand } = await import('./commands-
|
|
375
|
+
const { processCommand } = await import('./commands-BO0qy2Y0.mjs');
|
|
376
376
|
let machineId;
|
|
377
377
|
const processArgs = args.slice(1);
|
|
378
378
|
const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
|
|
@@ -386,18 +386,18 @@ async function main() {
|
|
|
386
386
|
}), machineId);
|
|
387
387
|
process.exit(0);
|
|
388
388
|
} else if (subcommand === "issue" || subcommand === "issues") {
|
|
389
|
-
const { issueCommand } = await import('./commands-
|
|
389
|
+
const { issueCommand } = await import('./commands-DvsieDv9.mjs');
|
|
390
390
|
await issueCommand(args.slice(1));
|
|
391
391
|
process.exit(0);
|
|
392
392
|
} else if (subcommand === "workflow" || subcommand === "workflows") {
|
|
393
|
-
const { workflowCommand } = await import('./commands-
|
|
393
|
+
const { workflowCommand } = await import('./commands-CRJ6c4Ea.mjs');
|
|
394
394
|
await workflowCommand(args.slice(1));
|
|
395
395
|
process.exit(0);
|
|
396
396
|
} else if (subcommand === "wise-agent" || subcommand === "wise") {
|
|
397
397
|
await handleWiseAgentCommand(args.slice(1));
|
|
398
398
|
process.exit(0);
|
|
399
399
|
} else if (subcommand === "feature" || subcommand === "crew") {
|
|
400
|
-
const { crewCommand } = await import('./commands-
|
|
400
|
+
const { crewCommand } = await import('./commands-B8iRZu9B.mjs');
|
|
401
401
|
await crewCommand(args.slice(1));
|
|
402
402
|
process.exit(0);
|
|
403
403
|
} else if (subcommand === "--help" || subcommand === "-h") {
|
|
@@ -405,7 +405,7 @@ async function main() {
|
|
|
405
405
|
} else if (!subcommand || subcommand === "start") {
|
|
406
406
|
await handleInteractiveCommand();
|
|
407
407
|
} else if (subcommand === "--version" || subcommand === "-v") {
|
|
408
|
-
const pkg = await import('./package-
|
|
408
|
+
const pkg = await import('./package-BejWpjWo.mjs').catch(() => ({ default: { version: "unknown" } }));
|
|
409
409
|
console.log(`svamp version: ${pkg.default.version}`);
|
|
410
410
|
} else {
|
|
411
411
|
console.error(`Unknown command: ${subcommand}`);
|
|
@@ -414,7 +414,7 @@ async function main() {
|
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
async function handleInteractiveCommand() {
|
|
417
|
-
const { runInteractive } = await import('./run-
|
|
417
|
+
const { runInteractive } = await import('./run-B7I_RGWW.mjs');
|
|
418
418
|
const interactiveArgs = subcommand === "start" ? args.slice(1) : args;
|
|
419
419
|
let directory = process.cwd();
|
|
420
420
|
let resumeSessionId;
|
|
@@ -459,7 +459,7 @@ async function handleAgentCommand() {
|
|
|
459
459
|
return;
|
|
460
460
|
}
|
|
461
461
|
if (agentArgs[0] === "list") {
|
|
462
|
-
const { KNOWN_ACP_AGENTS, KNOWN_CODEX_AGENTS: KNOWN_CODEX_AGENTS2 } = await import('./run-
|
|
462
|
+
const { KNOWN_ACP_AGENTS, KNOWN_CODEX_AGENTS: KNOWN_CODEX_AGENTS2 } = await import('./run-BPaC3cDA.mjs').then(function (n) { return n.ao; });
|
|
463
463
|
console.log("Known agents:");
|
|
464
464
|
for (const [name, config2] of Object.entries(KNOWN_ACP_AGENTS)) {
|
|
465
465
|
console.log(` ${name.padEnd(12)} ${config2.command} ${config2.args.join(" ")} (ACP)`);
|
|
@@ -471,7 +471,7 @@ async function handleAgentCommand() {
|
|
|
471
471
|
console.log('Use "svamp agent -- <command> [args]" for a custom ACP agent.');
|
|
472
472
|
return;
|
|
473
473
|
}
|
|
474
|
-
const { resolveAcpAgentConfig, KNOWN_CODEX_AGENTS } = await import('./run-
|
|
474
|
+
const { resolveAcpAgentConfig, KNOWN_CODEX_AGENTS } = await import('./run-BPaC3cDA.mjs').then(function (n) { return n.ao; });
|
|
475
475
|
let cwd = process.cwd();
|
|
476
476
|
const filteredArgs = [];
|
|
477
477
|
for (let i = 0; i < agentArgs.length; i++) {
|
|
@@ -495,12 +495,12 @@ async function handleAgentCommand() {
|
|
|
495
495
|
console.log(`Starting ${config.agentName} agent in ${cwd}...`);
|
|
496
496
|
let backend;
|
|
497
497
|
if (KNOWN_CODEX_AGENTS[config.agentName]) {
|
|
498
|
-
const { CodexAppServerBackend } = await import('./run-
|
|
498
|
+
const { CodexAppServerBackend } = await import('./run-BPaC3cDA.mjs').then(function (n) { return n.aq; });
|
|
499
499
|
backend = new CodexAppServerBackend({ cwd, log: logFn });
|
|
500
500
|
} else {
|
|
501
|
-
const { AcpBackend } = await import('./run-
|
|
502
|
-
const { GeminiTransport } = await import('./run-
|
|
503
|
-
const { DefaultTransport } = await import('./run-
|
|
501
|
+
const { AcpBackend } = await import('./run-BPaC3cDA.mjs').then(function (n) { return n.an; });
|
|
502
|
+
const { GeminiTransport } = await import('./run-BPaC3cDA.mjs').then(function (n) { return n.ar; });
|
|
503
|
+
const { DefaultTransport } = await import('./run-BPaC3cDA.mjs').then(function (n) { return n.am; });
|
|
504
504
|
const transportHandler = config.agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(config.agentName);
|
|
505
505
|
backend = new AcpBackend({
|
|
506
506
|
agentName: config.agentName,
|
|
@@ -627,7 +627,7 @@ async function handleSessionCommand() {
|
|
|
627
627
|
process.exit(1);
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
|
-
const { sessionList, sessionWhoami, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionLoopStart, sessionLoopCancel, sessionLoopStatus, sessionLoopExtend, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-
|
|
630
|
+
const { sessionList, sessionWhoami, sessionSpawn, sessionArchive, sessionResume, sessionDelete, sessionInfo, sessionMessages, sessionAttach, sessionMachines, sessionSend, sessionWait, sessionShare, sessionLoopStart, sessionLoopCancel, sessionLoopStatus, sessionLoopExtend, sessionInboxSend, sessionInboxList, sessionInboxRead, sessionInboxReply, sessionInboxClear } = await import('./commands-QXKWC_Ft.mjs');
|
|
631
631
|
const parseFlagStr = (flag, shortFlag) => {
|
|
632
632
|
for (let i = 1; i < sessionArgs.length; i++) {
|
|
633
633
|
if ((sessionArgs[i] === flag || shortFlag) && i + 1 < sessionArgs.length) {
|
|
@@ -695,7 +695,7 @@ async function handleSessionCommand() {
|
|
|
695
695
|
allowDomain.push(sessionArgs[++i]);
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
|
-
const { parseShareArg } = await import('./commands-
|
|
698
|
+
const { parseShareArg } = await import('./commands-QXKWC_Ft.mjs');
|
|
699
699
|
const shareEntries = share.map((s) => parseShareArg(s));
|
|
700
700
|
await sessionSpawn(agent, dir, targetMachineId, {
|
|
701
701
|
message,
|
|
@@ -785,7 +785,7 @@ async function handleSessionCommand() {
|
|
|
785
785
|
console.error(" Rewinds history: rewrites the message + drops everything after it, then restarts Claude.");
|
|
786
786
|
process.exit(1);
|
|
787
787
|
}
|
|
788
|
-
const { sessionEditMessage } = await import('./commands-
|
|
788
|
+
const { sessionEditMessage } = await import('./commands-QXKWC_Ft.mjs');
|
|
789
789
|
await sessionEditMessage(sessionArgs[1], sessionArgs[2], sessionArgs[3], targetMachineId);
|
|
790
790
|
} else if (sessionSubcommand === "refine") {
|
|
791
791
|
if (!sessionArgs[1] || !sessionArgs[2]) {
|
|
@@ -793,7 +793,7 @@ async function handleSessionCommand() {
|
|
|
793
793
|
console.error(" Asks the agent to revise its latest reply in place (no extra round).");
|
|
794
794
|
process.exit(1);
|
|
795
795
|
}
|
|
796
|
-
const { sessionRefineLastReply } = await import('./commands-
|
|
796
|
+
const { sessionRefineLastReply } = await import('./commands-QXKWC_Ft.mjs');
|
|
797
797
|
await sessionRefineLastReply(sessionArgs[1], sessionArgs[2], targetMachineId);
|
|
798
798
|
} else if (sessionSubcommand === "undo-edit" || sessionSubcommand === "undo") {
|
|
799
799
|
if (!sessionArgs[1]) {
|
|
@@ -801,7 +801,7 @@ async function handleSessionCommand() {
|
|
|
801
801
|
console.error(" Reverts the most recent edit/refine, restoring the pre-edit history.");
|
|
802
802
|
process.exit(1);
|
|
803
803
|
}
|
|
804
|
-
const { sessionUndoEdit } = await import('./commands-
|
|
804
|
+
const { sessionUndoEdit } = await import('./commands-QXKWC_Ft.mjs');
|
|
805
805
|
await sessionUndoEdit(sessionArgs[1], targetMachineId);
|
|
806
806
|
} else if (sessionSubcommand === "query") {
|
|
807
807
|
const dir = sessionArgs[1];
|
|
@@ -811,7 +811,7 @@ async function handleSessionCommand() {
|
|
|
811
811
|
console.error(" Spawns a stateless Claude session in <directory>, sends <prompt>, prints the answer, then deletes the session.");
|
|
812
812
|
process.exit(1);
|
|
813
813
|
}
|
|
814
|
-
const { sessionQuery } = await import('./commands-
|
|
814
|
+
const { sessionQuery } = await import('./commands-QXKWC_Ft.mjs');
|
|
815
815
|
await sessionQuery(dir, prompt, targetMachineId, {
|
|
816
816
|
timeout: parseFlagInt("--timeout"),
|
|
817
817
|
json: hasFlag("--json"),
|
|
@@ -844,7 +844,7 @@ async function handleSessionCommand() {
|
|
|
844
844
|
console.error("Usage: svamp session approve <session-id> [request-id] [--json]");
|
|
845
845
|
process.exit(1);
|
|
846
846
|
}
|
|
847
|
-
const { sessionApprove } = await import('./commands-
|
|
847
|
+
const { sessionApprove } = await import('./commands-QXKWC_Ft.mjs');
|
|
848
848
|
const approveReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
849
849
|
await sessionApprove(sessionArgs[1], approveReqId, targetMachineId, {
|
|
850
850
|
json: hasFlag("--json")
|
|
@@ -854,7 +854,7 @@ async function handleSessionCommand() {
|
|
|
854
854
|
console.error("Usage: svamp session deny <session-id> [request-id] [--json]");
|
|
855
855
|
process.exit(1);
|
|
856
856
|
}
|
|
857
|
-
const { sessionDeny } = await import('./commands-
|
|
857
|
+
const { sessionDeny } = await import('./commands-QXKWC_Ft.mjs');
|
|
858
858
|
const denyReqId = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
859
859
|
await sessionDeny(sessionArgs[1], denyReqId, targetMachineId, {
|
|
860
860
|
json: hasFlag("--json")
|
|
@@ -906,7 +906,7 @@ async function handleSessionCommand() {
|
|
|
906
906
|
console.error("Usage: svamp session set-title <title>");
|
|
907
907
|
process.exit(1);
|
|
908
908
|
}
|
|
909
|
-
const { sessionSetTitle } = await import('./agentCommands-
|
|
909
|
+
const { sessionSetTitle } = await import('./agentCommands-Da1IvglZ.mjs');
|
|
910
910
|
await sessionSetTitle(title);
|
|
911
911
|
} else if (sessionSubcommand === "set-project-description" || sessionSubcommand === "set-project") {
|
|
912
912
|
const desc = sessionArgs.slice(1).filter((a) => !a.startsWith("--")).join(" ");
|
|
@@ -914,7 +914,7 @@ async function handleSessionCommand() {
|
|
|
914
914
|
console.error("Usage: svamp session set-project-description <text>");
|
|
915
915
|
process.exit(1);
|
|
916
916
|
}
|
|
917
|
-
const { sessionSetProjectDescription } = await import('./agentCommands-
|
|
917
|
+
const { sessionSetProjectDescription } = await import('./agentCommands-Da1IvglZ.mjs');
|
|
918
918
|
await sessionSetProjectDescription(desc);
|
|
919
919
|
} else if (sessionSubcommand === "set-link") {
|
|
920
920
|
const url = sessionArgs[1];
|
|
@@ -923,11 +923,11 @@ async function handleSessionCommand() {
|
|
|
923
923
|
process.exit(1);
|
|
924
924
|
}
|
|
925
925
|
const label = sessionArgs[2] && !sessionArgs[2].startsWith("--") ? sessionArgs[2] : void 0;
|
|
926
|
-
const { sessionSetLink } = await import('./agentCommands-
|
|
926
|
+
const { sessionSetLink } = await import('./agentCommands-Da1IvglZ.mjs');
|
|
927
927
|
await sessionSetLink(url, label);
|
|
928
928
|
} else if (sessionSubcommand === "link") {
|
|
929
929
|
const op = sessionArgs[1];
|
|
930
|
-
const lm = await import('./agentCommands-
|
|
930
|
+
const lm = await import('./agentCommands-Da1IvglZ.mjs');
|
|
931
931
|
if (op === "add") {
|
|
932
932
|
const url = sessionArgs[2];
|
|
933
933
|
if (!url || url.startsWith("--")) {
|
|
@@ -962,7 +962,7 @@ async function handleSessionCommand() {
|
|
|
962
962
|
process.exit(1);
|
|
963
963
|
}
|
|
964
964
|
const level = parseFlagStr("--level") || "info";
|
|
965
|
-
const { sessionNotify } = await import('./agentCommands-
|
|
965
|
+
const { sessionNotify } = await import('./agentCommands-Da1IvglZ.mjs');
|
|
966
966
|
await sessionNotify(message, level);
|
|
967
967
|
} else if (sessionSubcommand === "broadcast") {
|
|
968
968
|
const action = sessionArgs[1];
|
|
@@ -970,7 +970,7 @@ async function handleSessionCommand() {
|
|
|
970
970
|
console.error("Usage: svamp session broadcast <action> [args...]\nActions: open-canvas <url> [label], close-canvas, toast <message>");
|
|
971
971
|
process.exit(1);
|
|
972
972
|
}
|
|
973
|
-
const { sessionBroadcast } = await import('./agentCommands-
|
|
973
|
+
const { sessionBroadcast } = await import('./agentCommands-Da1IvglZ.mjs');
|
|
974
974
|
await sessionBroadcast(action, sessionArgs.slice(2).filter((a) => !a.startsWith("--")));
|
|
975
975
|
} else if (sessionSubcommand === "inbox") {
|
|
976
976
|
const inboxSubcmd = sessionArgs[1];
|
|
@@ -981,7 +981,7 @@ async function handleSessionCommand() {
|
|
|
981
981
|
process.exit(1);
|
|
982
982
|
}
|
|
983
983
|
if (agentSessionId) {
|
|
984
|
-
const { inboxSend } = await import('./agentCommands-
|
|
984
|
+
const { inboxSend } = await import('./agentCommands-Da1IvglZ.mjs');
|
|
985
985
|
await inboxSend(sessionArgs[2], {
|
|
986
986
|
body: sessionArgs[3],
|
|
987
987
|
subject: parseFlagStr("--subject"),
|
|
@@ -996,7 +996,7 @@ async function handleSessionCommand() {
|
|
|
996
996
|
}
|
|
997
997
|
} else if (inboxSubcmd === "list" || inboxSubcmd === "ls") {
|
|
998
998
|
if (agentSessionId && !sessionArgs[2]) {
|
|
999
|
-
const { inboxList } = await import('./agentCommands-
|
|
999
|
+
const { inboxList } = await import('./agentCommands-Da1IvglZ.mjs');
|
|
1000
1000
|
await inboxList({
|
|
1001
1001
|
unread: hasFlag("--unread"),
|
|
1002
1002
|
limit: parseFlagInt("--limit"),
|
|
@@ -1018,7 +1018,7 @@ async function handleSessionCommand() {
|
|
|
1018
1018
|
process.exit(1);
|
|
1019
1019
|
}
|
|
1020
1020
|
if (agentSessionId && !sessionArgs[3]) {
|
|
1021
|
-
const { inboxList } = await import('./agentCommands-
|
|
1021
|
+
const { inboxList } = await import('./agentCommands-Da1IvglZ.mjs');
|
|
1022
1022
|
await sessionInboxRead(agentSessionId, sessionArgs[2], targetMachineId);
|
|
1023
1023
|
} else if (sessionArgs[3]) {
|
|
1024
1024
|
await sessionInboxRead(sessionArgs[2], sessionArgs[3], targetMachineId);
|
|
@@ -1028,7 +1028,7 @@ async function handleSessionCommand() {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
} else if (inboxSubcmd === "reply") {
|
|
1030
1030
|
if (agentSessionId && sessionArgs[2] && sessionArgs[3] && !sessionArgs[4]) {
|
|
1031
|
-
const { inboxReply } = await import('./agentCommands-
|
|
1031
|
+
const { inboxReply } = await import('./agentCommands-Da1IvglZ.mjs');
|
|
1032
1032
|
await inboxReply(sessionArgs[2], sessionArgs[3]);
|
|
1033
1033
|
} else if (sessionArgs[2] && sessionArgs[3] && sessionArgs[4]) {
|
|
1034
1034
|
await sessionInboxReply(sessionArgs[2], sessionArgs[3], sessionArgs[4], targetMachineId);
|
|
@@ -1066,7 +1066,7 @@ async function handleMachineCommand() {
|
|
|
1066
1066
|
return;
|
|
1067
1067
|
}
|
|
1068
1068
|
if (machineSubcommand === "share") {
|
|
1069
|
-
const { machineShare } = await import('./commands-
|
|
1069
|
+
const { machineShare } = await import('./commands-QXKWC_Ft.mjs');
|
|
1070
1070
|
let machineId;
|
|
1071
1071
|
const shareArgs = [];
|
|
1072
1072
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
@@ -1117,14 +1117,14 @@ async function handleMachineCommand() {
|
|
|
1117
1117
|
process.exit(1);
|
|
1118
1118
|
}
|
|
1119
1119
|
if (all) {
|
|
1120
|
-
const { fleetExec } = await import('./fleet-
|
|
1120
|
+
const { fleetExec } = await import('./fleet-BAWJhQsC.mjs');
|
|
1121
1121
|
await fleetExec(command, { cwd });
|
|
1122
1122
|
} else {
|
|
1123
|
-
const { machineExec } = await import('./commands-
|
|
1123
|
+
const { machineExec } = await import('./commands-QXKWC_Ft.mjs');
|
|
1124
1124
|
await machineExec(machineId, command, cwd);
|
|
1125
1125
|
}
|
|
1126
1126
|
} else if (machineSubcommand === "info") {
|
|
1127
|
-
const { machineInfo } = await import('./commands-
|
|
1127
|
+
const { machineInfo } = await import('./commands-QXKWC_Ft.mjs');
|
|
1128
1128
|
let machineId;
|
|
1129
1129
|
for (let i = 1; i < machineArgs.length; i++) {
|
|
1130
1130
|
if ((machineArgs[i] === "--machine" || machineArgs[i] === "-m") && i + 1 < machineArgs.length) {
|
|
@@ -1144,10 +1144,10 @@ async function handleMachineCommand() {
|
|
|
1144
1144
|
level = machineArgs[++i];
|
|
1145
1145
|
}
|
|
1146
1146
|
}
|
|
1147
|
-
const { machineNotify } = await import('./agentCommands-
|
|
1147
|
+
const { machineNotify } = await import('./agentCommands-Da1IvglZ.mjs');
|
|
1148
1148
|
await machineNotify(message, level);
|
|
1149
1149
|
} else if (machineSubcommand === "ls") {
|
|
1150
|
-
const { machineLs } = await import('./commands-
|
|
1150
|
+
const { machineLs } = await import('./commands-QXKWC_Ft.mjs');
|
|
1151
1151
|
let machineId;
|
|
1152
1152
|
let showHidden = false;
|
|
1153
1153
|
let path;
|
|
@@ -1206,20 +1206,20 @@ Examples:
|
|
|
1206
1206
|
};
|
|
1207
1207
|
const hasFlag = (name) => fleetArgs.includes(`--${name}`);
|
|
1208
1208
|
if (sub === "status") {
|
|
1209
|
-
const { fleetStatus } = await import('./fleet-
|
|
1209
|
+
const { fleetStatus } = await import('./fleet-BAWJhQsC.mjs');
|
|
1210
1210
|
await fleetStatus();
|
|
1211
1211
|
} else if (sub === "upgrade-claude") {
|
|
1212
|
-
const { fleetUpgradeClaude } = await import('./fleet-
|
|
1212
|
+
const { fleetUpgradeClaude } = await import('./fleet-BAWJhQsC.mjs');
|
|
1213
1213
|
await fleetUpgradeClaude({ version: flag("version", "-v") });
|
|
1214
1214
|
} else if (sub === "upgrade-svamp") {
|
|
1215
|
-
const { fleetUpgradeSvamp } = await import('./fleet-
|
|
1215
|
+
const { fleetUpgradeSvamp } = await import('./fleet-BAWJhQsC.mjs');
|
|
1216
1216
|
await fleetUpgradeSvamp({ version: flag("version", "-v"), excludeSelf: hasFlag("exclude-self"), force: hasFlag("force") });
|
|
1217
1217
|
} else if (sub === "daemon-restart") {
|
|
1218
|
-
const { fleetDaemonRestart } = await import('./fleet-
|
|
1218
|
+
const { fleetDaemonRestart } = await import('./fleet-BAWJhQsC.mjs');
|
|
1219
1219
|
await fleetDaemonRestart({ graceful: !hasFlag("cleanup") });
|
|
1220
1220
|
} else if (sub === "push-skill") {
|
|
1221
1221
|
const name = fleetArgs[1];
|
|
1222
|
-
const { fleetPushSkill } = await import('./fleet-
|
|
1222
|
+
const { fleetPushSkill } = await import('./fleet-BAWJhQsC.mjs');
|
|
1223
1223
|
await fleetPushSkill(name);
|
|
1224
1224
|
} else {
|
|
1225
1225
|
console.error(`Unknown fleet subcommand: ${sub}`);
|
|
@@ -1235,7 +1235,7 @@ async function handleSkillsCommand() {
|
|
|
1235
1235
|
await printSkillsHelp();
|
|
1236
1236
|
return;
|
|
1237
1237
|
}
|
|
1238
|
-
const { skillsFind, skillsInstall, skillsList, skillsRemove, skillsPublish } = await import('./commands-
|
|
1238
|
+
const { skillsFind, skillsInstall, skillsList, skillsRemove, skillsPublish } = await import('./commands-CijMDYaV.mjs');
|
|
1239
1239
|
if (skillsSubcommand === "find" || skillsSubcommand === "search") {
|
|
1240
1240
|
const query = skillsArgs.slice(1).filter((a) => !a.startsWith("--")).join(" ");
|
|
1241
1241
|
if (!query) {
|
|
@@ -1282,7 +1282,7 @@ async function loginToHypha() {
|
|
|
1282
1282
|
process.exit(1);
|
|
1283
1283
|
}
|
|
1284
1284
|
const anchor = anchorArg.replace(/\/+$/, "");
|
|
1285
|
-
const { loadInstanceConfig } = await import('./run-
|
|
1285
|
+
const { loadInstanceConfig } = await import('./run-BPaC3cDA.mjs').then(function (n) { return n.as; });
|
|
1286
1286
|
let cfg = null;
|
|
1287
1287
|
try {
|
|
1288
1288
|
cfg = await loadInstanceConfig({ anchor, force: true });
|
|
@@ -1393,7 +1393,7 @@ async function logoutFromHypha() {
|
|
|
1393
1393
|
} catch {
|
|
1394
1394
|
}
|
|
1395
1395
|
try {
|
|
1396
|
-
const { clearInstanceConfigCache } = await import('./run-
|
|
1396
|
+
const { clearInstanceConfigCache } = await import('./run-BPaC3cDA.mjs').then(function (n) { return n.as; });
|
|
1397
1397
|
clearInstanceConfigCache();
|
|
1398
1398
|
} catch {
|
|
1399
1399
|
}
|
|
@@ -1732,7 +1732,7 @@ async function applyClaudeAuthFlags(argv) {
|
|
|
1732
1732
|
"--use-hypha-proxy, --use-claude-login, and --anthropic-base-url/--anthropic-api-key are mutually exclusive"
|
|
1733
1733
|
);
|
|
1734
1734
|
}
|
|
1735
|
-
const mod = await import('./run-
|
|
1735
|
+
const mod = await import('./run-BPaC3cDA.mjs').then(function (n) { return n.ak; });
|
|
1736
1736
|
if (hasHypha) {
|
|
1737
1737
|
let url;
|
|
1738
1738
|
const hyphaIdx = argv.indexOf("--use-hypha-proxy");
|
|
@@ -1786,7 +1786,7 @@ async function applyDaemonShareFlag(argv) {
|
|
|
1786
1786
|
}
|
|
1787
1787
|
}
|
|
1788
1788
|
if (collected.length === 0) return;
|
|
1789
|
-
const { updateEnvFile } = await import('./run-
|
|
1789
|
+
const { updateEnvFile } = await import('./run-BPaC3cDA.mjs').then(function (n) { return n.ak; });
|
|
1790
1790
|
const seen = /* @__PURE__ */ new Set();
|
|
1791
1791
|
const deduped = collected.filter((e) => {
|
|
1792
1792
|
const k = e.toLowerCase();
|
|
@@ -1819,7 +1819,7 @@ async function handleWiseAgentCommand(rest) {
|
|
|
1819
1819
|
}
|
|
1820
1820
|
});
|
|
1821
1821
|
const message = rest.slice(1).map((a, idx) => ({ a, idx: idx + 1 })).filter(({ a, idx }) => !a.startsWith("-") && !consumed.has(String(idx))).map(({ a }) => a).join(" ");
|
|
1822
|
-
const { wiseAskCli } = await import('./commands-
|
|
1822
|
+
const { wiseAskCli } = await import('./commands-QXKWC_Ft.mjs');
|
|
1823
1823
|
await wiseAskCli(machineId, message, sessionId, { json });
|
|
1824
1824
|
return;
|
|
1825
1825
|
}
|
|
@@ -1831,7 +1831,7 @@ async function handleWiseAgentCommand(rest) {
|
|
|
1831
1831
|
}
|
|
1832
1832
|
return void 0;
|
|
1833
1833
|
};
|
|
1834
|
-
const { runWiseVoiceCli } = await import('./headlessCli-
|
|
1834
|
+
const { runWiseVoiceCli } = await import('./headlessCli-qwpjuvFV.mjs');
|
|
1835
1835
|
await runWiseVoiceCli({ voice: valueOf(["--voice"]), wakeKeywordPath: valueOf(["--wake"]), model: valueOf(["--model"]) });
|
|
1836
1836
|
return;
|
|
1837
1837
|
}
|
|
@@ -1849,7 +1849,7 @@ async function handleWiseAgentCommand(rest) {
|
|
|
1849
1849
|
const mode = valueOf(["--mode"]);
|
|
1850
1850
|
const mission = valueOf(["--mission"]);
|
|
1851
1851
|
const url = rest.slice(1).find((a) => /^https?:\/\//.test(a)) || "";
|
|
1852
|
-
const { wiseJoinMeetingCli } = await import('./commands-
|
|
1852
|
+
const { wiseJoinMeetingCli } = await import('./commands-QXKWC_Ft.mjs');
|
|
1853
1853
|
await wiseJoinMeetingCli(machineId, url, sessionId, { json, mode, mission });
|
|
1854
1854
|
return;
|
|
1855
1855
|
}
|
|
@@ -1861,7 +1861,7 @@ async function handleWiseAgentCommand(rest) {
|
|
|
1861
1861
|
}
|
|
1862
1862
|
return void 0;
|
|
1863
1863
|
};
|
|
1864
|
-
const { wiseLeaveMeetingCli } = await import('./commands-
|
|
1864
|
+
const { wiseLeaveMeetingCli } = await import('./commands-QXKWC_Ft.mjs');
|
|
1865
1865
|
await wiseLeaveMeetingCli(valueOf(["--machine", "-m"]), valueOf(["--session", "-s"]), { json: rest.includes("--json") });
|
|
1866
1866
|
return;
|
|
1867
1867
|
}
|
|
@@ -1885,7 +1885,7 @@ async function handleWiseAgentCommand(rest) {
|
|
|
1885
1885
|
}
|
|
1886
1886
|
});
|
|
1887
1887
|
const text = rest.slice(1).map((a, idx) => ({ a, idx: idx + 1 })).filter(({ a, idx }) => !a.startsWith("-") && !consumed.has(String(idx))).map(({ a }) => a).join(" ");
|
|
1888
|
-
const { wiseAnnounceCli } = await import('./commands-
|
|
1888
|
+
const { wiseAnnounceCli } = await import('./commands-QXKWC_Ft.mjs');
|
|
1889
1889
|
await wiseAnnounceCli(machineId, text, sessionId, { json });
|
|
1890
1890
|
return;
|
|
1891
1891
|
}
|
|
@@ -1897,7 +1897,7 @@ async function handleWiseAgentCommand(rest) {
|
|
|
1897
1897
|
}
|
|
1898
1898
|
return void 0;
|
|
1899
1899
|
};
|
|
1900
|
-
const { wiseMeetingsCli } = await import('./commands-
|
|
1900
|
+
const { wiseMeetingsCli } = await import('./commands-QXKWC_Ft.mjs');
|
|
1901
1901
|
await wiseMeetingsCli(valueOf(["--machine", "-m"]), { json: rest.includes("--json") });
|
|
1902
1902
|
return;
|
|
1903
1903
|
}
|
|
@@ -1947,7 +1947,7 @@ If none is set, hitting a WISE Agent channel returns a clear "not configured" er
|
|
|
1947
1947
|
return;
|
|
1948
1948
|
}
|
|
1949
1949
|
const authArgs = rest.slice(1);
|
|
1950
|
-
const mod = await import('./auth-
|
|
1950
|
+
const mod = await import('./auth-0oP68YeR.mjs');
|
|
1951
1951
|
let action;
|
|
1952
1952
|
try {
|
|
1953
1953
|
action = mod.parseWiseAgentAuthArgs(authArgs);
|
|
@@ -1957,7 +1957,7 @@ If none is set, hitting a WISE Agent channel returns a clear "not configured" er
|
|
|
1957
1957
|
return;
|
|
1958
1958
|
}
|
|
1959
1959
|
if (action) {
|
|
1960
|
-
const { updateEnvFile } = await import('./run-
|
|
1960
|
+
const { updateEnvFile } = await import('./run-BPaC3cDA.mjs').then(function (n) { return n.ak; });
|
|
1961
1961
|
const updates = mod.buildWiseAgentEnvUpdates(action);
|
|
1962
1962
|
updateEnvFile(updates);
|
|
1963
1963
|
for (const [k, v] of Object.entries(updates)) {
|
|
@@ -1971,7 +1971,7 @@ If none is set, hitting a WISE Agent channel returns a clear "not configured" er
|
|
|
1971
1971
|
}
|
|
1972
1972
|
async function handleDaemonAuthCommand(argv) {
|
|
1973
1973
|
const sub = (argv[0] || "status").toLowerCase();
|
|
1974
|
-
const mod = await import('./run-
|
|
1974
|
+
const mod = await import('./run-BPaC3cDA.mjs').then(function (n) { return n.ak; });
|
|
1975
1975
|
if (sub === "--help" || sub === "-h" || sub === "help") {
|
|
1976
1976
|
console.log(`
|
|
1977
1977
|
svamp daemon auth \u2014 Configure how Claude subprocesses authenticate
|
|
@@ -2045,8 +2045,8 @@ one step: --use-hypha-proxy / --use-claude-login / --anthropic-base-url URL --an
|
|
|
2045
2045
|
}
|
|
2046
2046
|
async function handleDaemonCodexAuthCommand(argv) {
|
|
2047
2047
|
const sub = (argv[0] || "status").toLowerCase();
|
|
2048
|
-
const { updateEnvFile } = await import('./run-
|
|
2049
|
-
const { resolveCodexProvider } = await import('./run-
|
|
2048
|
+
const { updateEnvFile } = await import('./run-BPaC3cDA.mjs').then(function (n) { return n.ak; });
|
|
2049
|
+
const { resolveCodexProvider } = await import('./run-BPaC3cDA.mjs').then(function (n) { return n.ap; });
|
|
2050
2050
|
const redact = (k) => k && k.length > 10 ? `${k.slice(0, 6)}\u2026${k.slice(-4)}` : k ? "***" : "(unset)";
|
|
2051
2051
|
if (sub === "--help" || sub === "-h" || sub === "help") {
|
|
2052
2052
|
console.log(`
|
|
@@ -2378,7 +2378,7 @@ Examples:
|
|
|
2378
2378
|
async function printSkillsHelp() {
|
|
2379
2379
|
let browseUrl = "<HYPHA_SERVER_URL>/<workspace>/artifacts/marketplace (set HYPHA_SERVER_URL)";
|
|
2380
2380
|
try {
|
|
2381
|
-
const { getArtifactBaseUrl, getSkillsCollectionName } = await import('./run-
|
|
2381
|
+
const { getArtifactBaseUrl, getSkillsCollectionName } = await import('./run-BPaC3cDA.mjs').then(function (n) { return n.at; });
|
|
2382
2382
|
browseUrl = `${getArtifactBaseUrl()}/${getSkillsCollectionName()}`;
|
|
2383
2383
|
} catch {
|
|
2384
2384
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
|
-
import { connectAndGetMachine, resolveSessionId, createWorktree, connectAndResolveSession } from './commands-
|
|
3
|
+
import { connectAndGetMachine, resolveSessionId, createWorktree, connectAndResolveSession } from './commands-QXKWC_Ft.mjs';
|
|
4
4
|
import { execSync } from 'node:child_process';
|
|
5
|
-
import { u as updateIssue, t as addComment, v as addIssue, k as shortId } from './run-
|
|
5
|
+
import { u as updateIssue, t as addComment, v as addIssue, k as shortId } from './run-BPaC3cDA.mjs';
|
|
6
6
|
import 'node:os';
|
|
7
7
|
import 'os';
|
|
8
8
|
import 'fs/promises';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { writeFileSync, readFileSync } from 'fs';
|
|
2
2
|
import { resolve } from 'path';
|
|
3
|
-
import { connectAndGetMachine } from './commands-
|
|
3
|
+
import { connectAndGetMachine } from './commands-QXKWC_Ft.mjs';
|
|
4
4
|
import 'node:fs';
|
|
5
5
|
import 'node:child_process';
|
|
6
6
|
import 'node:path';
|
|
7
7
|
import 'node:os';
|
|
8
|
-
import './run-
|
|
8
|
+
import './run-BPaC3cDA.mjs';
|
|
9
9
|
import 'os';
|
|
10
10
|
import 'fs/promises';
|
|
11
11
|
import 'url';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process';
|
|
2
|
-
import { n as resolveProjectRoot, M as workflowSteps, D as setWorkflowEnabled, I as isWorkflowEnabled, E as removeWorkflow, B as getWorkflow, H as listWorkflows, F as saveWorkflow, G as rawWorkflow } from './run-
|
|
2
|
+
import { n as resolveProjectRoot, M as workflowSteps, D as setWorkflowEnabled, I as isWorkflowEnabled, E as removeWorkflow, B as getWorkflow, H as listWorkflows, F as saveWorkflow, G as rawWorkflow } from './run-BPaC3cDA.mjs';
|
|
3
3
|
import 'os';
|
|
4
4
|
import 'fs/promises';
|
|
5
5
|
import 'fs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import os from 'os';
|
|
2
2
|
import fs__default from 'fs';
|
|
3
3
|
import { resolve, join, relative } from 'path';
|
|
4
|
-
import { T as parseFrontmatter, U as getSkillsServer, V as getSkillsWorkspaceName, W as getSkillsCollectionName, X as fetchWithTimeout, Y as searchSkills, Z as SKILLS_DIR, _ as getSkillInfo, $ as downloadSkillFile, a0 as listSkillFiles } from './run-
|
|
4
|
+
import { T as parseFrontmatter, U as getSkillsServer, V as getSkillsWorkspaceName, W as getSkillsCollectionName, X as fetchWithTimeout, Y as searchSkills, Z as SKILLS_DIR, _ as getSkillInfo, $ as downloadSkillFile, a0 as listSkillFiles } from './run-BPaC3cDA.mjs';
|
|
5
5
|
import 'fs/promises';
|
|
6
6
|
import 'url';
|
|
7
7
|
import 'child_process';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { execSync } from 'node:child_process';
|
|
2
2
|
import { existsSync, readFileSync } from 'node:fs';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
-
import { n as resolveProjectRoot, x as searchIssues, w as listIssues, p as resumeIssue, q as pauseIssue, t as addComment, u as updateIssue, o as getIssue, y as isVisibleTo, L as summarize, v as addIssue } from './run-
|
|
4
|
+
import { n as resolveProjectRoot, x as searchIssues, w as listIssues, p as resumeIssue, q as pauseIssue, t as addComment, u as updateIssue, o as getIssue, y as isVisibleTo, L as summarize, v as addIssue } from './run-BPaC3cDA.mjs';
|
|
5
5
|
import 'os';
|
|
6
6
|
import 'fs/promises';
|
|
7
7
|
import 'fs';
|
|
@@ -2,7 +2,7 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
|
2
2
|
import { execSync } from 'node:child_process';
|
|
3
3
|
import { basename, resolve, join, isAbsolute } from 'node:path';
|
|
4
4
|
import os from 'node:os';
|
|
5
|
-
import { a2 as formatHandle, a3 as normalizeAllowedUser, a4 as loadSecurityContextConfig, a5 as resolveSecurityContext, a6 as buildSecurityContextFromFlags, a7 as mergeSecurityContexts, c as connectToHypha, a8 as buildSessionShareUrl, a9 as computeOutboundHop, k as shortId, aa as registerAwaitingReply, ab as buildMachineShareUrl, ac as parseHandle, ad as handleMatchesMetadata } from './run-
|
|
5
|
+
import { a2 as formatHandle, a3 as normalizeAllowedUser, a4 as loadSecurityContextConfig, a5 as resolveSecurityContext, a6 as buildSecurityContextFromFlags, a7 as mergeSecurityContexts, c as connectToHypha, a8 as buildSessionShareUrl, a9 as computeOutboundHop, k as shortId, aa as registerAwaitingReply, ab as buildMachineShareUrl, ac as parseHandle, ad as handleMatchesMetadata } from './run-BPaC3cDA.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
8
8
|
import 'fs';
|
|
@@ -58,7 +58,7 @@ async function serviceExpose(args) {
|
|
|
58
58
|
process.exit(1);
|
|
59
59
|
}
|
|
60
60
|
if (foreground) {
|
|
61
|
-
const { runFrpcTunnel } = await import('./frpc-
|
|
61
|
+
const { runFrpcTunnel } = await import('./frpc-B7han0nb.mjs');
|
|
62
62
|
await runFrpcTunnel(name, ports, void 0, {
|
|
63
63
|
group,
|
|
64
64
|
groupKey,
|
|
@@ -68,7 +68,7 @@ async function serviceExpose(args) {
|
|
|
68
68
|
});
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
71
|
+
const { connectAndGetMachine } = await import('./commands-QXKWC_Ft.mjs');
|
|
72
72
|
const { server, machine } = await connectAndGetMachine();
|
|
73
73
|
try {
|
|
74
74
|
const status = await machine.tunnelStart({
|
|
@@ -90,7 +90,7 @@ async function serviceExpose(args) {
|
|
|
90
90
|
console.log(` port ${port}: ${url}`);
|
|
91
91
|
}
|
|
92
92
|
if (process.env.SVAMP_SESSION_ID) {
|
|
93
|
-
const { autoAddSessionLink } = await import('./agentCommands-
|
|
93
|
+
const { autoAddSessionLink } = await import('./agentCommands-Da1IvglZ.mjs');
|
|
94
94
|
let added = 0;
|
|
95
95
|
for (const [port, url] of urlEntries) {
|
|
96
96
|
const label = urlEntries.length > 1 ? `${name}:${port}` : name;
|
|
@@ -138,7 +138,7 @@ async function serviceServe(args) {
|
|
|
138
138
|
server.once("error", reject);
|
|
139
139
|
server.listen(servePort, "127.0.0.1", () => resolve());
|
|
140
140
|
});
|
|
141
|
-
const { runFrpcTunnel } = await import('./frpc-
|
|
141
|
+
const { runFrpcTunnel } = await import('./frpc-B7han0nb.mjs');
|
|
142
142
|
void server;
|
|
143
143
|
await runFrpcTunnel(name, [servePort]);
|
|
144
144
|
} catch (err) {
|
|
@@ -148,7 +148,7 @@ async function serviceServe(args) {
|
|
|
148
148
|
}
|
|
149
149
|
async function serviceList(_args) {
|
|
150
150
|
try {
|
|
151
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
151
|
+
const { connectAndGetMachine } = await import('./commands-QXKWC_Ft.mjs');
|
|
152
152
|
const { server, machine } = await connectAndGetMachine();
|
|
153
153
|
try {
|
|
154
154
|
const tunnels = await machine.tunnelList({});
|
|
@@ -188,7 +188,7 @@ async function serviceDelete(args) {
|
|
|
188
188
|
process.exit(1);
|
|
189
189
|
}
|
|
190
190
|
try {
|
|
191
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
191
|
+
const { connectAndGetMachine } = await import('./commands-QXKWC_Ft.mjs');
|
|
192
192
|
const { server, machine } = await connectAndGetMachine();
|
|
193
193
|
try {
|
|
194
194
|
await machine.tunnelStop({ name });
|
|
@@ -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-BPaC3cDA.mjs';
|
|
5
5
|
import { PINNED_CLAUDE_CODE_VERSION } from './pinnedClaudeCode-B9O-hKxm.mjs';
|
|
6
6
|
import 'os';
|
|
7
7
|
import 'fs/promises';
|
|
@@ -4,7 +4,7 @@ import { mkdirSync, chmodSync, writeFileSync, unlinkSync, existsSync, readFileSy
|
|
|
4
4
|
import { join } from 'path';
|
|
5
5
|
import { homedir, platform, arch } from 'os';
|
|
6
6
|
import { randomUUID, createHash } from 'crypto';
|
|
7
|
-
import { h as getFrpsSubdomainHost, i as getFrpsServerPort, j as getFrpsServerAddr } from './run-
|
|
7
|
+
import { h as getFrpsSubdomainHost, i as getFrpsServerPort, j as getFrpsServerAddr } from './run-BPaC3cDA.mjs';
|
|
8
8
|
import 'fs/promises';
|
|
9
9
|
import 'url';
|
|
10
10
|
import 'node:crypto';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a1 as resolveModel, ae as describeMisconfiguration, af as buildMachineDeps } from './run-
|
|
2
|
-
import { handleRealtimeEvent, initMachineVoiceSession } from './sideband-
|
|
1
|
+
import { a1 as resolveModel, ae as describeMisconfiguration, af as buildMachineDeps } from './run-BPaC3cDA.mjs';
|
|
2
|
+
import { handleRealtimeEvent, initMachineVoiceSession } from './sideband-COSN23AN.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-BPaC3cDA.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as resolveProjectRoot, u as updateIssue, o as getIssue, p as resumeIssue, q as pauseIssue, t as addComment, v as addIssue, w as listIssues, x as searchIssues, y as isVisibleTo } from './run-
|
|
1
|
+
import { n as resolveProjectRoot, u as updateIssue, o as getIssue, p as resumeIssue, q as pauseIssue, t as addComment, v as addIssue, w as listIssues, x as searchIssues, y as isVisibleTo } from './run-BPaC3cDA.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as resolveProjectRoot, z as getRun, A as listRuns, B as getWorkflow, C as runWorkflow, D as setWorkflowEnabled, E as removeWorkflow, F as saveWorkflow, G as rawWorkflow, H as listWorkflows } from './run-
|
|
1
|
+
import { n as resolveProjectRoot, z as getRun, A as listRuns, B as getWorkflow, C as runWorkflow, D as setWorkflowEnabled, E as removeWorkflow, F as saveWorkflow, G as rawWorkflow, H as listWorkflows } from './run-BPaC3cDA.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import { ag as applyClaudeProxyEnv, ah as composeSessionId, ai as generateFriendlyName, c as connectToHypha, a as createSessionStore, r as registerMachineService, aj as generateHookSettings } from './run-
|
|
1
|
+
import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import { ag as applyClaudeProxyEnv, ah as composeSessionId, ai as generateFriendlyName, c as connectToHypha, a as createSessionStore, r as registerMachineService, aj as generateHookSettings } from './run-BPaC3cDA.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';
|
|
@@ -3013,7 +3013,7 @@ async function registerMachineService(server, machineId, metadata, daemonState,
|
|
|
3013
3013
|
const tunnels = handlers.tunnels;
|
|
3014
3014
|
if (!tunnels) throw new Error("Tunnel management not available");
|
|
3015
3015
|
if (tunnels.has(params.name)) throw new Error(`Tunnel '${params.name}' already running`);
|
|
3016
|
-
const { FrpcTunnel } = await import('./frpc-
|
|
3016
|
+
const { FrpcTunnel } = await import('./frpc-B7han0nb.mjs');
|
|
3017
3017
|
const tunnel = new FrpcTunnel({
|
|
3018
3018
|
name: params.name,
|
|
3019
3019
|
ports: params.ports,
|
|
@@ -3480,7 +3480,7 @@ QUESTION: ${params.question || "Summarize this concisely."}` }
|
|
|
3480
3480
|
}
|
|
3481
3481
|
const deps = buildSessionDeps(rpc, { cwd, ownerEmail: owner });
|
|
3482
3482
|
const sender = { name: context?.user?.email || context?.user?.id || "user", kind: "user", verified: true };
|
|
3483
|
-
const { toolsForRole } = await import('./sideband-
|
|
3483
|
+
const { toolsForRole } = await import('./sideband-COSN23AN.mjs');
|
|
3484
3484
|
const r2 = await runWiseAgent({ message: params.message, sender, config: { tools: toolsForRole(role2) }, deps, transport, model: resolved.model });
|
|
3485
3485
|
return fmt(r2);
|
|
3486
3486
|
}
|
|
@@ -3579,7 +3579,7 @@ QUESTION: ${params.question || "Summarize this concisely."}` }
|
|
|
3579
3579
|
if (r.error || !r.sender) return { error: r.error || "unauthorized" };
|
|
3580
3580
|
const callId = "call_" + Math.random().toString(16).slice(2, 12);
|
|
3581
3581
|
const rendered = renderMessage(c, { sender: r.sender, body: { message: kwargs.message }, callId });
|
|
3582
|
-
const { queryCore } = await import('./commands-
|
|
3582
|
+
const { queryCore } = await import('./commands-QXKWC_Ft.mjs');
|
|
3583
3583
|
const timeout = c.reply?.timeout_sec || 120;
|
|
3584
3584
|
let result;
|
|
3585
3585
|
try {
|
|
@@ -8115,13 +8115,14 @@ var acpAgentConfig = /*#__PURE__*/Object.freeze({
|
|
|
8115
8115
|
resolveAcpAgentConfig: resolveAcpAgentConfig
|
|
8116
8116
|
});
|
|
8117
8117
|
|
|
8118
|
-
function bridgeAcpToSession(backend, sessionService, getMetadata, setMetadata, log, onTurnEnd) {
|
|
8118
|
+
function bridgeAcpToSession(backend, sessionService, getMetadata, setMetadata, log, onTurnEnd, getModelLabel) {
|
|
8119
8119
|
let pendingText = "";
|
|
8120
8120
|
let turnText = "";
|
|
8121
8121
|
let flushTimer = null;
|
|
8122
8122
|
let bridgeStopped = false;
|
|
8123
8123
|
const pushAssistant = (content) => {
|
|
8124
|
-
|
|
8124
|
+
const model = getModelLabel?.() || "agent";
|
|
8125
|
+
sessionService.pushMessage({ type: "assistant", message: { role: "assistant", model, content } }, "agent");
|
|
8125
8126
|
};
|
|
8126
8127
|
function flushText() {
|
|
8127
8128
|
if (pendingText) {
|
|
@@ -8350,6 +8351,18 @@ function normalizeNotification(method, params) {
|
|
|
8350
8351
|
}
|
|
8351
8352
|
return null;
|
|
8352
8353
|
}
|
|
8354
|
+
function codexCumulativeTokens(payload) {
|
|
8355
|
+
if (!payload || typeof payload !== "object") return 0;
|
|
8356
|
+
const tu = payload.tokenUsage ?? payload.token_usage ?? payload;
|
|
8357
|
+
const bucket = tu?.total ?? tu?.cumulative ?? tu;
|
|
8358
|
+
if (!bucket || typeof bucket !== "object") return 0;
|
|
8359
|
+
const n = (v) => typeof v === "number" && Number.isFinite(v) && v > 0 ? v : 0;
|
|
8360
|
+
const input = n(bucket.inputTokens ?? bucket.input_tokens);
|
|
8361
|
+
const cached = n(bucket.cachedInputTokens ?? bucket.cached_input_tokens ?? bucket.cacheReadInputTokens);
|
|
8362
|
+
const output = n(bucket.outputTokens ?? bucket.output_tokens) + n(bucket.reasoningOutputTokens ?? bucket.reasoning_output_tokens);
|
|
8363
|
+
const nonCachedInput = Math.max(0, input - cached);
|
|
8364
|
+
return nonCachedInput + output + Math.round(cached * 0.1);
|
|
8365
|
+
}
|
|
8353
8366
|
|
|
8354
8367
|
function parseCodexVersion(v) {
|
|
8355
8368
|
const m = v.match(/codex-cli\s+(\d+)\.(\d+)\.(\d+)/);
|
|
@@ -8761,6 +8774,9 @@ class CodexAppServerBackend {
|
|
|
8761
8774
|
// Whether we streamed any delta for the in-flight assistant message (to avoid a duplicate
|
|
8762
8775
|
// fullText push on the final agent_message when the model DID stream).
|
|
8763
8776
|
streamedThisMessage = false;
|
|
8777
|
+
// #0412 P3: cost-weighted CUMULATIVE token total across this thread (from codex usage events),
|
|
8778
|
+
// read by the daemon's loop ledger to enforce token/rate cost caps on Codex loops. Monotonic.
|
|
8779
|
+
cumulativeTokens = 0;
|
|
8764
8780
|
// Tracks the in-flight turn so waitForResponseComplete() can await it.
|
|
8765
8781
|
turnDone = null;
|
|
8766
8782
|
/** True/false if codex supports app-server; null if codex isn't installed. */
|
|
@@ -8845,6 +8861,15 @@ class CodexAppServerBackend {
|
|
|
8845
8861
|
setModel(model) {
|
|
8846
8862
|
this.model = model;
|
|
8847
8863
|
}
|
|
8864
|
+
/** The model label for assistant-message parity with Claude (frontend schema requires a non-empty `model`). */
|
|
8865
|
+
getModel() {
|
|
8866
|
+
return this.model || "codex";
|
|
8867
|
+
}
|
|
8868
|
+
/** #0412 P3: cost-weighted cumulative token total across the thread, so the loop ledger can
|
|
8869
|
+
* enforce token/rate cost caps for Codex loops. 0 until the first usage event arrives. */
|
|
8870
|
+
getCumulativeTokens() {
|
|
8871
|
+
return this.cumulativeTokens;
|
|
8872
|
+
}
|
|
8848
8873
|
// ── internal ─────────────────────────────────────────────────────────────
|
|
8849
8874
|
emit(msg) {
|
|
8850
8875
|
for (const h of this.listeners) {
|
|
@@ -8933,7 +8958,10 @@ class CodexAppServerBackend {
|
|
|
8933
8958
|
}
|
|
8934
8959
|
case "token_count":
|
|
8935
8960
|
case "token_usage": {
|
|
8936
|
-
|
|
8961
|
+
const payload = event.usage ?? event.info ?? event;
|
|
8962
|
+
const cum = codexCumulativeTokens(payload);
|
|
8963
|
+
if (cum > this.cumulativeTokens) this.cumulativeTokens = cum;
|
|
8964
|
+
this.emit({ type: "event", name: "usage", payload });
|
|
8937
8965
|
break;
|
|
8938
8966
|
}
|
|
8939
8967
|
case "error": {
|
|
@@ -13854,7 +13882,7 @@ async function startDaemon(options) {
|
|
|
13854
13882
|
try {
|
|
13855
13883
|
const dir = loadSessionIndex()[sessionId]?.directory;
|
|
13856
13884
|
if (!dir) return;
|
|
13857
|
-
const { reconcileServiceLinks } = await import('./agentCommands-
|
|
13885
|
+
const { reconcileServiceLinks } = await import('./agentCommands-Da1IvglZ.mjs');
|
|
13858
13886
|
const configPath = getSvampConfigPath(dir, sessionId);
|
|
13859
13887
|
const config = readSvampConfig(configPath);
|
|
13860
13888
|
const entries = Array.from(urls.entries());
|
|
@@ -13872,7 +13900,7 @@ async function startDaemon(options) {
|
|
|
13872
13900
|
}
|
|
13873
13901
|
}
|
|
13874
13902
|
async function createExposedTunnel(spec) {
|
|
13875
|
-
const { FrpcTunnel } = await import('./frpc-
|
|
13903
|
+
const { FrpcTunnel } = await import('./frpc-B7han0nb.mjs');
|
|
13876
13904
|
const tunnel = new FrpcTunnel({
|
|
13877
13905
|
name: spec.name,
|
|
13878
13906
|
ports: spec.ports,
|
|
@@ -13893,7 +13921,7 @@ async function startDaemon(options) {
|
|
|
13893
13921
|
}
|
|
13894
13922
|
const tunnelRecreateState = /* @__PURE__ */ new Map();
|
|
13895
13923
|
const tunnelRecreateInFlight = /* @__PURE__ */ new Set();
|
|
13896
|
-
const { ServeManager } = await import('./serveManager-
|
|
13924
|
+
const { ServeManager } = await import('./serveManager-BiNjVxjK.mjs');
|
|
13897
13925
|
const serveManager = new ServeManager(SVAMP_HOME, (msg) => logger.log(`[SERVE] ${msg}`), hyphaServerUrl);
|
|
13898
13926
|
ensureAutoInstalledSkills(logger).catch(() => {
|
|
13899
13927
|
});
|
|
@@ -14138,7 +14166,8 @@ ${v.guidance ? v.guidance + "\n" : ""}Criteria: ${v.criteria || "(none)"}
|
|
|
14138
14166
|
}
|
|
14139
14167
|
}
|
|
14140
14168
|
const sessionId = options2.sessionId || composeSessionId(generateFriendlyName(collectKnownFriendlyNames()), collectKnownSessionIds());
|
|
14141
|
-
const
|
|
14169
|
+
const persistedAgentType = options2.sessionId ? loadPersistedSessions().find((p) => p.sessionId === options2.sessionId)?.agentType : void 0;
|
|
14170
|
+
const agentName = options2.agent || persistedAgentType || agentConfig.agent_type || "claude";
|
|
14142
14171
|
if (agentName !== "claude" && (KNOWN_ACP_AGENTS[agentName] || KNOWN_CODEX_AGENTS[agentName])) {
|
|
14143
14172
|
return await spawnAgentSession(sessionId, directory, agentName, options2, resumeSessionId);
|
|
14144
14173
|
}
|
|
@@ -15503,7 +15532,12 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
15503
15532
|
const existingQueue = sessionMetadata.messageQueue || [];
|
|
15504
15533
|
sessionMetadata = {
|
|
15505
15534
|
...sessionMetadata,
|
|
15506
|
-
|
|
15535
|
+
// #0411: alreadyStored — deliverUserMessageCore already stored+broadcast this
|
|
15536
|
+
// user message (with its localId) BEFORE calling onUserMessage. The drain must
|
|
15537
|
+
// NOT re-push a display bubble (that second copy has localId:null and the
|
|
15538
|
+
// frontend can't reconcile it → the message appears TWICE). Only re-send to
|
|
15539
|
+
// the model. Inbox/loop items (no flag) still get their displayText push.
|
|
15540
|
+
messageQueue: [...existingQueue, { id: randomUUID$1(), text, createdAt: Date.now(), alreadyStored: true }]
|
|
15507
15541
|
};
|
|
15508
15542
|
sessionService.updateMetadata(sessionMetadata);
|
|
15509
15543
|
signalProcessing(false);
|
|
@@ -16009,11 +16043,11 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
16009
16043
|
});
|
|
16010
16044
|
},
|
|
16011
16045
|
onIssue: async (params) => {
|
|
16012
|
-
const { issueRpc } = await import('./rpc-
|
|
16046
|
+
const { issueRpc } = await import('./rpc-1svTrXB4.mjs');
|
|
16013
16047
|
return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner, rekickLoopOwner });
|
|
16014
16048
|
},
|
|
16015
16049
|
onWorkflow: async (params) => {
|
|
16016
|
-
const { workflowRpc } = await import('./rpc-
|
|
16050
|
+
const { workflowRpc } = await import('./rpc-DmHEcy9B.mjs');
|
|
16017
16051
|
return workflowRpc(params?.cwd || directory, params || {});
|
|
16018
16052
|
},
|
|
16019
16053
|
onRipgrep: async (args, cwd) => {
|
|
@@ -16134,7 +16168,7 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
16134
16168
|
logger.log(`[Session ${sessionId}] Processing queued message: "${next.text.slice(0, 50)}..."`);
|
|
16135
16169
|
sessionWasProcessing = true;
|
|
16136
16170
|
signalProcessing(true);
|
|
16137
|
-
sessionService.pushMessage(next.displayText || next.text, "user");
|
|
16171
|
+
if (!next.alreadyStored) sessionService.pushMessage(next.displayText || next.text, "user");
|
|
16138
16172
|
userMessagePending = true;
|
|
16139
16173
|
turnInitiatedByUser = true;
|
|
16140
16174
|
currentTurnMessage = next.text;
|
|
@@ -16280,7 +16314,10 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
16280
16314
|
return false;
|
|
16281
16315
|
};
|
|
16282
16316
|
var parseBashPermission = parseBashPermission2, shouldAutoAllow = shouldAutoAllow2;
|
|
16283
|
-
const
|
|
16317
|
+
const acpPersisted = loadPersistedSessions().find((p) => p.sessionId === sessionId);
|
|
16318
|
+
const acpPersistedName = acpPersisted?.metadata?.friendlyName;
|
|
16319
|
+
const acpCreatedAt = acpPersisted?.createdAt || Date.now();
|
|
16320
|
+
const acpResumeThreadId = acpPersisted?.agentThreadId;
|
|
16284
16321
|
let sessionMetadata = {
|
|
16285
16322
|
path: directory,
|
|
16286
16323
|
// Project namespace for the friendly handle (folder/repo basename).
|
|
@@ -16341,7 +16378,9 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
16341
16378
|
const existingQueue = sessionMetadata.messageQueue || [];
|
|
16342
16379
|
sessionMetadata = {
|
|
16343
16380
|
...sessionMetadata,
|
|
16344
|
-
|
|
16381
|
+
// #0411: alreadyStored — see Claude path. deliverUserMessageCore already stored
|
|
16382
|
+
// this user message; the drain must not re-push a localId:null duplicate.
|
|
16383
|
+
messageQueue: [...existingQueue, { id: randomUUID$1(), text, createdAt: Date.now(), alreadyStored: true }]
|
|
16345
16384
|
};
|
|
16346
16385
|
sessionService.updateMetadata(sessionMetadata);
|
|
16347
16386
|
return;
|
|
@@ -16351,7 +16390,9 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
16351
16390
|
const existingQueue = sessionMetadata.messageQueue || [];
|
|
16352
16391
|
sessionMetadata = {
|
|
16353
16392
|
...sessionMetadata,
|
|
16354
|
-
|
|
16393
|
+
// #0411: alreadyStored — see Claude path. deliverUserMessageCore already stored
|
|
16394
|
+
// this user message; the drain must not re-push a localId:null duplicate.
|
|
16395
|
+
messageQueue: [...existingQueue, { id: randomUUID$1(), text, createdAt: Date.now(), alreadyStored: true }]
|
|
16355
16396
|
};
|
|
16356
16397
|
sessionService.updateMetadata(sessionMetadata);
|
|
16357
16398
|
return;
|
|
@@ -16562,11 +16603,11 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
16562
16603
|
});
|
|
16563
16604
|
},
|
|
16564
16605
|
onIssue: async (params) => {
|
|
16565
|
-
const { issueRpc } = await import('./rpc-
|
|
16606
|
+
const { issueRpc } = await import('./rpc-1svTrXB4.mjs');
|
|
16566
16607
|
return issueRpc(params?.cwd || directory, params || {}, { notifySession: notifyIssueOwner, rekickLoopOwner });
|
|
16567
16608
|
},
|
|
16568
16609
|
onWorkflow: async (params) => {
|
|
16569
|
-
const { workflowRpc } = await import('./rpc-
|
|
16610
|
+
const { workflowRpc } = await import('./rpc-DmHEcy9B.mjs');
|
|
16570
16611
|
return workflowRpc(params?.cwd || directory, params || {});
|
|
16571
16612
|
},
|
|
16572
16613
|
onRipgrep: async (args, cwd) => {
|
|
@@ -16720,13 +16761,16 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
16720
16761
|
const provider = resolveCodexProvider();
|
|
16721
16762
|
const codexModel = options2.model || agentConfig?.default_model || provider.model || void 0;
|
|
16722
16763
|
logger.log(`[Agent Session ${sessionId}] Codex backend: app-server (model=${codexModel ?? "default"}${provider.apiBase ? `, provider=${provider.apiBase}` : ""})`);
|
|
16764
|
+
if (acpResumeThreadId) logger.log(`[Agent Session ${sessionId}] Resuming Codex thread ${acpResumeThreadId} (restart recovery)`);
|
|
16723
16765
|
agentBackend = new CodexAppServerBackend({
|
|
16724
16766
|
cwd: directory,
|
|
16725
16767
|
model: codexModel,
|
|
16726
16768
|
provider,
|
|
16727
16769
|
env: options2.environmentVariables,
|
|
16728
16770
|
log: logger.log,
|
|
16729
|
-
isolationConfig: agentIsoConfig
|
|
16771
|
+
isolationConfig: agentIsoConfig,
|
|
16772
|
+
// #0412 P2: resume the persisted thread across a daemon restart (context intact).
|
|
16773
|
+
resumeThreadId: acpResumeThreadId
|
|
16730
16774
|
});
|
|
16731
16775
|
} else {
|
|
16732
16776
|
const transportHandler = agentName === "gemini" ? new GeminiTransport() : new DefaultTransport(agentName);
|
|
@@ -16743,6 +16787,24 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
16743
16787
|
isolationConfig: agentIsoConfig
|
|
16744
16788
|
});
|
|
16745
16789
|
}
|
|
16790
|
+
const persistAgentSession = () => {
|
|
16791
|
+
try {
|
|
16792
|
+
const threadId = agentBackend.getThreadId?.() || acpResumeThreadId;
|
|
16793
|
+
saveSession({
|
|
16794
|
+
sessionId,
|
|
16795
|
+
directory,
|
|
16796
|
+
permissionMode: currentPermissionMode,
|
|
16797
|
+
metadata: sessionMetadata,
|
|
16798
|
+
createdAt: acpCreatedAt,
|
|
16799
|
+
machineId,
|
|
16800
|
+
wasProcessing: false,
|
|
16801
|
+
agentType: agentName,
|
|
16802
|
+
...threadId ? { agentThreadId: threadId } : {}
|
|
16803
|
+
});
|
|
16804
|
+
} catch (e) {
|
|
16805
|
+
logger.log(`[Agent Session ${sessionId}] persist failed: ${e?.message || e}`);
|
|
16806
|
+
}
|
|
16807
|
+
};
|
|
16746
16808
|
let acpStopped = false;
|
|
16747
16809
|
let acpBackendReady = false;
|
|
16748
16810
|
let acpVerifyInFlight = false;
|
|
@@ -16771,7 +16833,11 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
16771
16833
|
const projectRoot = resolveProjectRoot(directory);
|
|
16772
16834
|
const startedAt = typeof ls.started_at === "number" ? ls.started_at : typeof ls.resumed_at === "number" ? ls.resumed_at : void 0;
|
|
16773
16835
|
const oracleCmd = typeof ls.oracle === "string" && ls.oracle.trim() ? ls.oracle.trim() : void 0;
|
|
16774
|
-
const
|
|
16836
|
+
const acpCumTokens = agentBackend.getCumulativeTokens?.() ?? 0;
|
|
16837
|
+
const acpPrevCum = typeof ls.acp_last_cum_tokens === "number" ? ls.acp_last_cum_tokens : 0;
|
|
16838
|
+
const acpDeltaTokens = Math.max(0, acpCumTokens - acpPrevCum);
|
|
16839
|
+
ls.acp_last_cum_tokens = acpCumTokens;
|
|
16840
|
+
const ledger = accumulateLedger(ls.ledger, { turns: 1, tokens: acpDeltaTokens, ts: now });
|
|
16775
16841
|
ls.ledger = ledger;
|
|
16776
16842
|
const holds = typeof ls.holds === "number" ? ls.holds : 0;
|
|
16777
16843
|
const runOracle = async () => {
|
|
@@ -16787,8 +16853,8 @@ ${capturedError}${buildClaudeErrorHint(capturedError)}`;
|
|
|
16787
16853
|
return { ok: pending.length === 0, output: pending.length ? `${pending.length} pending: ${pending.map((i) => "#" + i.id).join(" ")}` : "No pending issues." };
|
|
16788
16854
|
};
|
|
16789
16855
|
try {
|
|
16790
|
-
if (!ls.acp_budget_warned && ls.budget && (ls.budget.max_tokens || ls.budget.max_tokens_per_hour)) {
|
|
16791
|
-
sessionService.pushMessage({ type: "message", message: "\u26A0\uFE0F A token/rate cost cap (--max-tokens / --max-tokens-per-hour) is INERT for this agent \u2014
|
|
16856
|
+
if (!ls.acp_budget_warned && acpCumTokens === 0 && (ledger?.turns || 0) >= 1 && ls.budget && (ls.budget.max_tokens || ls.budget.max_tokens_per_hour)) {
|
|
16857
|
+
sessionService.pushMessage({ type: "message", message: "\u26A0\uFE0F A token/rate cost cap (--max-tokens / --max-tokens-per-hour) is INERT for this agent \u2014 it exposes no token usage, so this loop is bounded only by --max (iterations) and --max-runtime-sec. Set one of those to cap cost.", level: "warning" }, "event");
|
|
16792
16858
|
ls.acp_budget_warned = true;
|
|
16793
16859
|
}
|
|
16794
16860
|
const acpMaxExt = resolveMaxExtensions(process.env.SVAMP_LOOP_MAX_EXTENSIONS);
|
|
@@ -16899,7 +16965,7 @@ ${oracle.output.trim().slice(0, 500)}`, "\u{1F501} Continuing loop");
|
|
|
16899
16965
|
sessionService.sendKeepAlive(true);
|
|
16900
16966
|
sessionService.markInboxHandled(next.id);
|
|
16901
16967
|
logger.log(`[Session ${sessionId}] Processing queued message: "${next.text.slice(0, 50)}..."`);
|
|
16902
|
-
sessionService.pushMessage(next.displayText || next.text, "user");
|
|
16968
|
+
if (!next.alreadyStored) sessionService.pushMessage(next.displayText || next.text, "user");
|
|
16903
16969
|
agentBackend.sendPrompt(sessionId, next.text).catch((err) => {
|
|
16904
16970
|
logger.error(`[Session ${sessionId}] Error processing queued message: ${err.message}`);
|
|
16905
16971
|
if (!acpStopped) {
|
|
@@ -16924,7 +16990,8 @@ ${oracle.output.trim().slice(0, 500)}`, "\u{1F501} Continuing loop");
|
|
|
16924
16990
|
sessionService.updateMetadata(sessionMetadata);
|
|
16925
16991
|
},
|
|
16926
16992
|
logger.log,
|
|
16927
|
-
onTurnEnd
|
|
16993
|
+
onTurnEnd,
|
|
16994
|
+
() => agentBackend.getModel?.() || options2.model || agentConfig?.default_model || agentName
|
|
16928
16995
|
);
|
|
16929
16996
|
const trackedSession = {
|
|
16930
16997
|
startedBy: "daemon",
|
|
@@ -16952,6 +17019,7 @@ ${oracle.output.trim().slice(0, 500)}`, "\u{1F501} Continuing loop");
|
|
|
16952
17019
|
agentBackend.startSession().then(() => {
|
|
16953
17020
|
acpBackendReady = true;
|
|
16954
17021
|
logger.log(`[Agent Session ${sessionId}] ${agentName} backend started, waiting for first message`);
|
|
17022
|
+
persistAgentSession();
|
|
16955
17023
|
}).catch((err) => {
|
|
16956
17024
|
logger.error(`[Agent Session ${sessionId}] Failed to start ${agentName}:`, err);
|
|
16957
17025
|
sessionService.pushMessage(
|
|
@@ -17547,7 +17615,7 @@ ${oracle.output.trim().slice(0, 500)}`, "\u{1F501} Continuing loop");
|
|
|
17547
17615
|
const PING_TIMEOUT_MS = 15e3;
|
|
17548
17616
|
const POST_RECONNECT_GRACE_MS = 2e4;
|
|
17549
17617
|
const RECONNECT_JITTER_MS = 2500;
|
|
17550
|
-
const { WorkflowScheduler } = await import('./scheduler-
|
|
17618
|
+
const { WorkflowScheduler } = await import('./scheduler-oOaKoCTW.mjs');
|
|
17551
17619
|
const workflowScheduler = new WorkflowScheduler({
|
|
17552
17620
|
projectRoots: () => {
|
|
17553
17621
|
const dirs = /* @__PURE__ */ new Set();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as resolveProjectRoot, H as listWorkflows, I as isWorkflowEnabled, J as workflowCrons, C as runWorkflow, K as cronMatches } from './run-
|
|
1
|
+
import { n as resolveProjectRoot, H as listWorkflows, I as isWorkflowEnabled, J as workflowCrons, C as runWorkflow, K as cronMatches } from './run-BPaC3cDA.mjs';
|
|
2
2
|
import 'os';
|
|
3
3
|
import 'fs/promises';
|
|
4
4
|
import 'fs';
|
|
@@ -54,7 +54,7 @@ async function handleServeCommand() {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
async function serveAdd(args, machineId) {
|
|
57
|
-
const { connectAndGetMachine } = await import('./commands-
|
|
57
|
+
const { connectAndGetMachine } = await import('./commands-QXKWC_Ft.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-QXKWC_Ft.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-QXKWC_Ft.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-QXKWC_Ft.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-QXKWC_Ft.mjs');
|
|
239
239
|
const { machine, server } = await connectAndGetMachine(machineId);
|
|
240
240
|
try {
|
|
241
241
|
const info = await machine.serveInfo();
|
|
@@ -5,7 +5,7 @@ import * as http from 'http';
|
|
|
5
5
|
import * as net from 'net';
|
|
6
6
|
import * as path from 'path';
|
|
7
7
|
import { serveStaticMount } from './staticFileServer-CbYnj2bH.mjs';
|
|
8
|
-
import { l as getHyphaServerUrl, S as ServeAuth, m as hasCookieToken } from './run-
|
|
8
|
+
import { l as getHyphaServerUrl, S as ServeAuth, m as hasCookieToken } from './run-BPaC3cDA.mjs';
|
|
9
9
|
import 'os';
|
|
10
10
|
import 'fs/promises';
|
|
11
11
|
import 'url';
|
|
@@ -854,7 +854,7 @@ Connection: close\r
|
|
|
854
854
|
const mount = this.mounts.get(mountName);
|
|
855
855
|
const subdomainOverride = mount?.access === "link" && mount.linkToken ? /* @__PURE__ */ new Map([[this.port, buildLinkSubdomain(subdomainSafe, mount.linkToken)]]) : void 0;
|
|
856
856
|
try {
|
|
857
|
-
const { FrpcTunnel } = await import('./frpc-
|
|
857
|
+
const { FrpcTunnel } = await import('./frpc-B7han0nb.mjs');
|
|
858
858
|
let tunnel;
|
|
859
859
|
tunnel = new FrpcTunnel({
|
|
860
860
|
name: tunnelName,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as READ_ONLY_TOOLS, N as loadMachineContext, O as buildMachineInstructions, P as machineToolsForRole, Q as buildMachineTools } from './run-
|
|
1
|
+
import { R as READ_ONLY_TOOLS, N as loadMachineContext, O as buildMachineInstructions, P as machineToolsForRole, Q as buildMachineTools } from './run-BPaC3cDA.mjs';
|
|
2
2
|
import 'node:child_process';
|
|
3
3
|
import 'os';
|
|
4
4
|
import 'fs/promises';
|