openfox 1.5.2 → 1.6.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/agent-defaults/builder.agent.md +1 -0
- package/dist/agent-defaults/planner.agent.md +1 -0
- package/dist/{auto-compaction-MNK2FZ6E.js → auto-compaction-BRT6SDEP.js} +7 -5
- package/dist/{chat-handler-Y7KR2RLL.js → chat-handler-55LA4LI2.js} +11 -9
- package/dist/chunk-574HZVLE.js +149 -0
- package/dist/{chunk-NW7PIZH3.js → chunk-CIXMZ73F.js} +82 -3
- package/dist/{chunk-S4QKTRGJ.js → chunk-EBOKO2PW.js} +2 -2
- package/dist/{chunk-GXVA5W7Q.js → chunk-GBBTJ6ND.js} +183 -15
- package/dist/chunk-NBU6KIOD.js +184 -0
- package/dist/{chunk-F7PUG5WA.js → chunk-S73ATBSR.js} +4 -4
- package/dist/{chunk-6PV24MJB.js → chunk-TKWJ665A.js} +2 -2
- package/dist/{chunk-UBWZDTZ4.js → chunk-WZJLCOV3.js} +89 -48
- package/dist/{chunk-TPT6HP4H.js → chunk-XQQ2BRJA.js} +1 -1
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{events-B7S4U4DB.js → events-OZKDX6XE.js} +2 -2
- package/dist/manager-HM2J5VMW.js +20 -0
- package/dist/{orchestrator-QGFC5QB6.js → orchestrator-IEYZSNVH.js} +8 -6
- package/dist/package.json +1 -1
- package/dist/{processor-BFTXIEDV.js → processor-I4BGYK3T.js} +5 -5
- package/dist/{protocol-WQENDK72.js → protocol-ODKD7QJO.js} +3 -3
- package/dist/{protocol-CLWtTnMd.d.ts → protocol-vX_YbJXE.d.ts} +40 -2
- package/dist/{serve-JJLKBQXS.js → serve-SDBFDRNJ.js} +10 -8
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +8 -6
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.js +1 -1
- package/dist/store-2IF3ZSLD.js +33 -0
- package/dist/{tools-MY4TPRP4.js → tools-GQ3PJL6N.js} +7 -5
- package/dist/web/assets/{index-BnJ4NNAw.css → index-Dc2TJUUt.css} +1 -1
- package/dist/web/assets/{index-xs6xUYKs.js → index-JG-uVLoP.js} +70 -62
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import {
|
|
2
|
+
appendLog,
|
|
3
|
+
createProcess,
|
|
4
|
+
getLogsPaginated,
|
|
5
|
+
getProcess,
|
|
6
|
+
getSessionProcesses,
|
|
7
|
+
removeProcess,
|
|
8
|
+
startProcess,
|
|
9
|
+
updateStatus
|
|
10
|
+
} from "./chunk-574HZVLE.js";
|
|
11
|
+
|
|
12
|
+
// src/server/tools/background-process/manager.ts
|
|
13
|
+
import { spawn } from "child_process";
|
|
14
|
+
|
|
15
|
+
// src/server/utils/platform.ts
|
|
16
|
+
import os from "os";
|
|
17
|
+
function getPlatformShell() {
|
|
18
|
+
if (process.platform === "win32") {
|
|
19
|
+
return { command: "cmd.exe", args: ["/c"] };
|
|
20
|
+
}
|
|
21
|
+
const userShell = os.userInfo().shell;
|
|
22
|
+
if (userShell) {
|
|
23
|
+
return { command: userShell, args: ["-c"] };
|
|
24
|
+
}
|
|
25
|
+
return { command: "sh", args: ["-c"] };
|
|
26
|
+
}
|
|
27
|
+
function getPathSeparator() {
|
|
28
|
+
return process.platform === "win32" ? ";" : ":";
|
|
29
|
+
}
|
|
30
|
+
function isWindowsPath(path) {
|
|
31
|
+
return /^[A-Za-z]:[/\\]/.test(path);
|
|
32
|
+
}
|
|
33
|
+
function isAbsolutePath(path) {
|
|
34
|
+
return path.startsWith("/") || isWindowsPath(path);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// src/server/tools/background-process/manager.ts
|
|
38
|
+
var STOP_SIGNAL_TIMEOUT = 5e3;
|
|
39
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
40
|
+
function onProcessEvent(callback) {
|
|
41
|
+
listeners.add(callback);
|
|
42
|
+
return () => {
|
|
43
|
+
listeners.delete(callback);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function emitProcessEvent(processId, msg) {
|
|
47
|
+
for (const listener of listeners) {
|
|
48
|
+
listener(processId, msg);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function createProcess2(sessionId, name, command, cwd, timeout) {
|
|
52
|
+
const process2 = createProcess(sessionId, name, command, cwd);
|
|
53
|
+
if (!process2) return null;
|
|
54
|
+
if (timeout && timeout > 0) {
|
|
55
|
+
setTimeout(() => {
|
|
56
|
+
const p = getProcess(process2.id, sessionId);
|
|
57
|
+
if (p && p.status === "running") {
|
|
58
|
+
stopProcess(process2.id, sessionId);
|
|
59
|
+
}
|
|
60
|
+
}, timeout);
|
|
61
|
+
}
|
|
62
|
+
return process2;
|
|
63
|
+
}
|
|
64
|
+
function startProcessCommand(processId, sessionId, command, cwd) {
|
|
65
|
+
const proc = startProcess(processId, sessionId, 0);
|
|
66
|
+
if (!proc) return null;
|
|
67
|
+
const shell = getPlatformShell();
|
|
68
|
+
const child = spawn(shell.command, [...shell.args, command], {
|
|
69
|
+
cwd,
|
|
70
|
+
env: { ...process.env, FORCE_COLOR: "1" },
|
|
71
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
72
|
+
detached: true
|
|
73
|
+
});
|
|
74
|
+
proc.pid = child.pid ?? null;
|
|
75
|
+
updateStatus(processId, sessionId, "running");
|
|
76
|
+
emitProcessEvent(processId, {
|
|
77
|
+
type: "backgroundProcess.started",
|
|
78
|
+
payload: { processId, name: proc.name, pid: child.pid ?? null, status: "running" },
|
|
79
|
+
sessionId
|
|
80
|
+
});
|
|
81
|
+
child.stdout?.on("data", (chunk) => {
|
|
82
|
+
const text = chunk.toString();
|
|
83
|
+
appendLog(processId, text, "stdout");
|
|
84
|
+
emitProcessEvent(processId, {
|
|
85
|
+
type: "backgroundProcess.output",
|
|
86
|
+
payload: { processId, stream: "stdout", content: text },
|
|
87
|
+
sessionId
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
child.stderr?.on("data", (chunk) => {
|
|
91
|
+
const text = chunk.toString();
|
|
92
|
+
appendLog(processId, text, "stderr");
|
|
93
|
+
emitProcessEvent(processId, {
|
|
94
|
+
type: "backgroundProcess.output",
|
|
95
|
+
payload: { processId, stream: "stderr", content: text },
|
|
96
|
+
sessionId
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
child.on("exit", (code, signal) => {
|
|
100
|
+
updateStatus(processId, sessionId, "exited", code ?? (signal ? 1 : null));
|
|
101
|
+
emitProcessEvent(processId, {
|
|
102
|
+
type: "backgroundProcess.exited",
|
|
103
|
+
payload: { processId, exitCode: code ?? (signal ? 1 : null) },
|
|
104
|
+
sessionId
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
child.on("error", (err) => {
|
|
108
|
+
appendLog(processId, `Error: ${err.message}
|
|
109
|
+
`, "stderr");
|
|
110
|
+
updateStatus(processId, sessionId, "exited", 1);
|
|
111
|
+
emitProcessEvent(processId, {
|
|
112
|
+
type: "backgroundProcess.exited",
|
|
113
|
+
payload: { processId, exitCode: 1 },
|
|
114
|
+
sessionId
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
return child.pid ?? null;
|
|
118
|
+
}
|
|
119
|
+
async function stopProcess(processId, sessionId) {
|
|
120
|
+
const proc = getProcess(processId, sessionId);
|
|
121
|
+
if (!proc || proc.status !== "running" || !proc.pid) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
updateStatus(processId, sessionId, "stopping");
|
|
125
|
+
const pid = proc.pid;
|
|
126
|
+
try {
|
|
127
|
+
try {
|
|
128
|
+
process.kill(-pid, "SIGTERM");
|
|
129
|
+
} catch {
|
|
130
|
+
process.kill(pid, "SIGTERM");
|
|
131
|
+
}
|
|
132
|
+
await new Promise((resolve) => {
|
|
133
|
+
setTimeout(() => {
|
|
134
|
+
try {
|
|
135
|
+
process.kill(-pid, "SIGKILL");
|
|
136
|
+
} catch {
|
|
137
|
+
try {
|
|
138
|
+
process.kill(pid, "SIGKILL");
|
|
139
|
+
} catch (_) {
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
resolve();
|
|
143
|
+
}, STOP_SIGNAL_TIMEOUT);
|
|
144
|
+
});
|
|
145
|
+
updateStatus(processId, sessionId, "exited", null);
|
|
146
|
+
emitProcessEvent(processId, {
|
|
147
|
+
type: "backgroundProcess.removed",
|
|
148
|
+
payload: { processId },
|
|
149
|
+
sessionId
|
|
150
|
+
});
|
|
151
|
+
removeProcess(processId, sessionId);
|
|
152
|
+
} catch (_) {
|
|
153
|
+
updateStatus(processId, sessionId, "exited", 1);
|
|
154
|
+
emitProcessEvent(processId, {
|
|
155
|
+
type: "backgroundProcess.removed",
|
|
156
|
+
payload: { processId },
|
|
157
|
+
sessionId
|
|
158
|
+
});
|
|
159
|
+
removeProcess(processId, sessionId);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function getProcessStatus(processId, sessionId) {
|
|
163
|
+
return getProcess(processId, sessionId);
|
|
164
|
+
}
|
|
165
|
+
function getSessionProcesses2(sessionId) {
|
|
166
|
+
return getSessionProcesses(sessionId);
|
|
167
|
+
}
|
|
168
|
+
function getProcessLogs(processId, since = 0, maxLines) {
|
|
169
|
+
return getLogsPaginated(processId, since, maxLines);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export {
|
|
173
|
+
getPlatformShell,
|
|
174
|
+
getPathSeparator,
|
|
175
|
+
isAbsolutePath,
|
|
176
|
+
onProcessEvent,
|
|
177
|
+
createProcess2 as createProcess,
|
|
178
|
+
startProcessCommand,
|
|
179
|
+
stopProcess,
|
|
180
|
+
getProcessStatus,
|
|
181
|
+
getSessionProcesses2 as getSessionProcesses,
|
|
182
|
+
getProcessLogs
|
|
183
|
+
};
|
|
184
|
+
//# sourceMappingURL=chunk-NBU6KIOD.js.map
|
|
@@ -13,17 +13,17 @@ import {
|
|
|
13
13
|
getToolRegistryForAgent,
|
|
14
14
|
loadAllAgentsDefault,
|
|
15
15
|
runTopLevelAgentLoop
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-GBBTJ6ND.js";
|
|
17
17
|
import {
|
|
18
18
|
getCurrentContextWindowId,
|
|
19
19
|
getEventStore
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-CIXMZ73F.js";
|
|
21
21
|
import {
|
|
22
22
|
buildSnapshotFromSessionState
|
|
23
23
|
} from "./chunk-WQ4W5H6A.js";
|
|
24
24
|
import {
|
|
25
25
|
createChatMessageMessage
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-EBOKO2PW.js";
|
|
27
27
|
import {
|
|
28
28
|
logger
|
|
29
29
|
} from "./chunk-PNBH3RAX.js";
|
|
@@ -311,4 +311,4 @@ export {
|
|
|
311
311
|
runBuilderTurn,
|
|
312
312
|
runVerifierTurn
|
|
313
313
|
};
|
|
314
|
-
//# sourceMappingURL=chunk-
|
|
314
|
+
//# sourceMappingURL=chunk-S73ATBSR.js.map
|
|
@@ -154,7 +154,7 @@ async function runCli(options) {
|
|
|
154
154
|
if (!configExists) {
|
|
155
155
|
await runNetworkSetup(mode);
|
|
156
156
|
}
|
|
157
|
-
const { runServe } = await import("./serve-
|
|
157
|
+
const { runServe } = await import("./serve-SDBFDRNJ.js");
|
|
158
158
|
await runServe({
|
|
159
159
|
mode,
|
|
160
160
|
port: values.port ? parseInt(values.port) : void 0,
|
|
@@ -167,4 +167,4 @@ async function runCli(options) {
|
|
|
167
167
|
export {
|
|
168
168
|
runCli
|
|
169
169
|
};
|
|
170
|
-
//# sourceMappingURL=chunk-
|
|
170
|
+
//# sourceMappingURL=chunk-TKWJ665A.js.map
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
generateSessionName,
|
|
3
|
+
needsNameGeneration
|
|
4
|
+
} from "./chunk-QDEKU5RL.js";
|
|
1
5
|
import {
|
|
2
6
|
createVerifierNudgeConfig,
|
|
3
7
|
runBuilderTurn,
|
|
4
8
|
runChatTurn
|
|
5
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-S73ATBSR.js";
|
|
6
10
|
import {
|
|
7
11
|
TurnMetrics,
|
|
8
12
|
agentExists,
|
|
@@ -40,11 +44,13 @@ import {
|
|
|
40
44
|
saveSkill,
|
|
41
45
|
setSkillEnabled,
|
|
42
46
|
skillExists
|
|
43
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-GBBTJ6ND.js";
|
|
44
48
|
import {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
getPathSeparator,
|
|
50
|
+
getPlatformShell,
|
|
51
|
+
isAbsolutePath,
|
|
52
|
+
onProcessEvent
|
|
53
|
+
} from "./chunk-NBU6KIOD.js";
|
|
48
54
|
import {
|
|
49
55
|
createProviderManager,
|
|
50
56
|
parseDefaultModelSelection
|
|
@@ -81,8 +87,9 @@ import {
|
|
|
81
87
|
updateSessionDangerLevel,
|
|
82
88
|
updateSessionMetadata,
|
|
83
89
|
updateSessionProvider,
|
|
90
|
+
updateSessionRunning,
|
|
84
91
|
updateSessionSummary
|
|
85
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-CIXMZ73F.js";
|
|
86
93
|
import {
|
|
87
94
|
buildContextMessagesFromEventHistory,
|
|
88
95
|
buildMessagesFromStoredEvents,
|
|
@@ -103,7 +110,7 @@ import {
|
|
|
103
110
|
parseClientMessage,
|
|
104
111
|
serializeServerMessage,
|
|
105
112
|
storedEventToServerMessage
|
|
106
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-EBOKO2PW.js";
|
|
107
114
|
import {
|
|
108
115
|
EventEmitter,
|
|
109
116
|
cancelQuestionsForSession,
|
|
@@ -120,7 +127,7 @@ import {
|
|
|
120
127
|
} from "./chunk-QY7BMXWT.js";
|
|
121
128
|
import {
|
|
122
129
|
createServerMessage
|
|
123
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-XQQ2BRJA.js";
|
|
124
131
|
import {
|
|
125
132
|
getGlobalConfigDir
|
|
126
133
|
} from "./chunk-R4HADRYO.js";
|
|
@@ -1194,8 +1201,7 @@ var TerminalManager = class {
|
|
|
1194
1201
|
return `term_${Date.now()}_${Math.random().toString(36).slice(2, 11)}`;
|
|
1195
1202
|
}
|
|
1196
1203
|
getShell() {
|
|
1197
|
-
|
|
1198
|
-
return shell;
|
|
1204
|
+
return getPlatformShell().command;
|
|
1199
1205
|
}
|
|
1200
1206
|
resolveWorkdir(workdir) {
|
|
1201
1207
|
if (workdir && workdir.length > 0) {
|
|
@@ -1580,7 +1586,8 @@ function executeShellCommand(command, cwd, timeout, signal) {
|
|
|
1580
1586
|
reject(new Error("Aborted"));
|
|
1581
1587
|
return;
|
|
1582
1588
|
}
|
|
1583
|
-
const
|
|
1589
|
+
const shell = getPlatformShell();
|
|
1590
|
+
const proc = spawn2(shell.command, [...shell.args, command], {
|
|
1584
1591
|
cwd,
|
|
1585
1592
|
env: { ...process.env, FORCE_COLOR: "0" },
|
|
1586
1593
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -2488,6 +2495,17 @@ function createWebSocketServer(httpServer, config, getLLMClient, getActiveProvid
|
|
|
2488
2495
|
errorMessage
|
|
2489
2496
|
}));
|
|
2490
2497
|
});
|
|
2498
|
+
onProcessEvent((_processId, msg) => {
|
|
2499
|
+
const sessionId = msg.sessionId;
|
|
2500
|
+
if (!sessionId) return;
|
|
2501
|
+
for (const [clientWs, client] of clients) {
|
|
2502
|
+
if (client.activeSessionId === sessionId || client.subscribedSessions.has(sessionId) || client.eventStoreSubscriptions.has(sessionId)) {
|
|
2503
|
+
if (clientWs.readyState === WebSocket2.OPEN) {
|
|
2504
|
+
clientWs.send(serializeServerMessage(msg));
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
});
|
|
2491
2509
|
wss.on("connection", async (ws, req) => {
|
|
2492
2510
|
const url = new URL(req.url || "/", `http://${req.headers.host}`);
|
|
2493
2511
|
const token = url.searchParams.get("token");
|
|
@@ -2501,7 +2519,23 @@ function createWebSocketServer(httpServer, config, getLLMClient, getActiveProvid
|
|
|
2501
2519
|
}
|
|
2502
2520
|
}
|
|
2503
2521
|
logger.debug("WebSocket client connected");
|
|
2504
|
-
clients.set(ws, { ws, activeSessionId: null, subscribedSessions: /* @__PURE__ */ new Map(), eventStoreSubscriptions: /* @__PURE__ */ new Map() });
|
|
2522
|
+
clients.set(ws, { ws, activeSessionId: null, subscribedSessions: /* @__PURE__ */ new Map(), eventStoreSubscriptions: /* @__PURE__ */ new Map(), globalSubscription: null });
|
|
2523
|
+
const eventStore = getEventStore();
|
|
2524
|
+
const { iterator: globalIterator, unsubscribe: globalUnsubscribe } = eventStore.subscribeAll();
|
|
2525
|
+
clients.get(ws).globalSubscription = globalUnsubscribe;
|
|
2526
|
+
(async () => {
|
|
2527
|
+
try {
|
|
2528
|
+
for await (const storedEvent of globalIterator) {
|
|
2529
|
+
if (ws.readyState !== WebSocket2.OPEN) break;
|
|
2530
|
+
const serverMsg = storedEventToServerMessage(storedEvent);
|
|
2531
|
+
if (serverMsg) {
|
|
2532
|
+
ws.send(serializeServerMessage({ ...serverMsg, seq: storedEvent.seq, sessionId: storedEvent.sessionId }));
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
} catch (error) {
|
|
2536
|
+
logger.debug("Global event subscription ended", { error });
|
|
2537
|
+
}
|
|
2538
|
+
})();
|
|
2505
2539
|
ws.on("message", async (data) => {
|
|
2506
2540
|
const message = parseClientMessage(data.toString());
|
|
2507
2541
|
if (!message) {
|
|
@@ -2536,6 +2570,9 @@ function createWebSocketServer(httpServer, config, getLLMClient, getActiveProvid
|
|
|
2536
2570
|
for (const unsubscribe of client.eventStoreSubscriptions.values()) {
|
|
2537
2571
|
unsubscribe();
|
|
2538
2572
|
}
|
|
2573
|
+
if (client.globalSubscription) {
|
|
2574
|
+
client.globalSubscription();
|
|
2575
|
+
}
|
|
2539
2576
|
}
|
|
2540
2577
|
unsubscribeAllFromTerminal(ws);
|
|
2541
2578
|
clients.delete(ws);
|
|
@@ -2584,27 +2621,7 @@ async function handleClientMessage(ws, client, message, getLLMClient, getActiveP
|
|
|
2584
2621
|
sendForSession(sessionId, createContextStateMessage(contextState));
|
|
2585
2622
|
return true;
|
|
2586
2623
|
};
|
|
2587
|
-
const ensureEventStoreSubscription = (
|
|
2588
|
-
if (client.eventStoreSubscriptions.has(sessionId)) {
|
|
2589
|
-
return;
|
|
2590
|
-
}
|
|
2591
|
-
const sid = sessionId;
|
|
2592
|
-
const eventStore = getEventStore();
|
|
2593
|
-
const { iterator, unsubscribe } = eventStore.subscribe(sid);
|
|
2594
|
-
client.eventStoreSubscriptions.set(sessionId, unsubscribe);
|
|
2595
|
-
(async () => {
|
|
2596
|
-
try {
|
|
2597
|
-
for await (const storedEvent of iterator) {
|
|
2598
|
-
const serverMsg = storedEventToServerMessage(storedEvent);
|
|
2599
|
-
if (serverMsg && ws.readyState === WebSocket2.OPEN) {
|
|
2600
|
-
ws.send(serializeServerMessage({ ...serverMsg, seq: storedEvent.seq, sessionId: sid }));
|
|
2601
|
-
}
|
|
2602
|
-
}
|
|
2603
|
-
} catch (error) {
|
|
2604
|
-
logger.debug("EventStore subscription ended", { sessionId: sid, error });
|
|
2605
|
-
}
|
|
2606
|
-
})();
|
|
2607
|
-
logger.debug("Subscribed to EventStore", { sessionId });
|
|
2624
|
+
const ensureEventStoreSubscription = (_sessionId) => {
|
|
2608
2625
|
};
|
|
2609
2626
|
switch (message.type) {
|
|
2610
2627
|
// =========================================================================
|
|
@@ -3535,7 +3552,7 @@ async function existsExecutable(path) {
|
|
|
3535
3552
|
}
|
|
3536
3553
|
}
|
|
3537
3554
|
async function which(command, workdir) {
|
|
3538
|
-
if (command
|
|
3555
|
+
if (isAbsolutePath(command)) {
|
|
3539
3556
|
if (await existsExecutable(command)) {
|
|
3540
3557
|
return command;
|
|
3541
3558
|
}
|
|
@@ -3554,7 +3571,7 @@ async function which(command, workdir) {
|
|
|
3554
3571
|
}
|
|
3555
3572
|
}
|
|
3556
3573
|
const pathEnv = process.env["PATH"] ?? "";
|
|
3557
|
-
const paths = pathEnv.split(
|
|
3574
|
+
const paths = pathEnv.split(getPathSeparator());
|
|
3558
3575
|
for (const dir of paths) {
|
|
3559
3576
|
if (!dir) continue;
|
|
3560
3577
|
const fullPath = join3(dir, command);
|
|
@@ -4379,6 +4396,7 @@ var SessionManager = class {
|
|
|
4379
4396
|
return session;
|
|
4380
4397
|
}
|
|
4381
4398
|
logger.debug("Setting session running state", { sessionId, isRunning });
|
|
4399
|
+
updateSessionRunning(sessionId, isRunning);
|
|
4382
4400
|
emitRunningChanged(sessionId, isRunning);
|
|
4383
4401
|
const updatedSession = this.requireSession(sessionId);
|
|
4384
4402
|
this.emit({ type: "session_updated", session: updatedSession });
|
|
@@ -5712,7 +5730,7 @@ async function createServerHandle(config) {
|
|
|
5712
5730
|
res.json({ success: true });
|
|
5713
5731
|
});
|
|
5714
5732
|
app.get("/api/sessions", async (req, res) => {
|
|
5715
|
-
const { getRecentUserPromptsForSession } = await import("./events-
|
|
5733
|
+
const { getRecentUserPromptsForSession } = await import("./events-OZKDX6XE.js");
|
|
5716
5734
|
const projectId = req.query["projectId"];
|
|
5717
5735
|
const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
|
|
5718
5736
|
const offset = parseInt(req.query["offset"]) || 0;
|
|
@@ -5745,7 +5763,7 @@ async function createServerHandle(config) {
|
|
|
5745
5763
|
res.status(201).json({ session });
|
|
5746
5764
|
});
|
|
5747
5765
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
5748
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5766
|
+
const { getEventStore: getEventStore2 } = await import("./events-OZKDX6XE.js");
|
|
5749
5767
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-NZYOXNKK.js");
|
|
5750
5768
|
const session = sessionManager.getSession(req.params.id);
|
|
5751
5769
|
if (!session) {
|
|
@@ -5776,7 +5794,7 @@ async function createServerHandle(config) {
|
|
|
5776
5794
|
res.json({ success: true });
|
|
5777
5795
|
});
|
|
5778
5796
|
app.post("/api/sessions/:id/provider", async (req, res) => {
|
|
5779
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5797
|
+
const { getEventStore: getEventStore2 } = await import("./events-OZKDX6XE.js");
|
|
5780
5798
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-NZYOXNKK.js");
|
|
5781
5799
|
const sessionId = req.params.id;
|
|
5782
5800
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -5814,7 +5832,7 @@ async function createServerHandle(config) {
|
|
|
5814
5832
|
res.json({ success: true });
|
|
5815
5833
|
});
|
|
5816
5834
|
app.put("/api/sessions/:id/mode", async (req, res) => {
|
|
5817
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5835
|
+
const { getEventStore: getEventStore2 } = await import("./events-OZKDX6XE.js");
|
|
5818
5836
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-NZYOXNKK.js");
|
|
5819
5837
|
const sessionId = req.params.id;
|
|
5820
5838
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -5853,14 +5871,14 @@ async function createServerHandle(config) {
|
|
|
5853
5871
|
if (!callId || approved === void 0) {
|
|
5854
5872
|
return res.status(400).json({ error: "callId and approved are required" });
|
|
5855
5873
|
}
|
|
5856
|
-
const { providePathConfirmation: providePathConfirmation2 } = await import("./tools-
|
|
5874
|
+
const { providePathConfirmation: providePathConfirmation2 } = await import("./tools-GQ3PJL6N.js");
|
|
5857
5875
|
const result = providePathConfirmation2(callId, approved, alwaysAllow);
|
|
5858
5876
|
if (!result.found) {
|
|
5859
5877
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
5860
5878
|
}
|
|
5861
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5879
|
+
const { getEventStore: getEventStore2 } = await import("./events-OZKDX6XE.js");
|
|
5862
5880
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-NZYOXNKK.js");
|
|
5863
|
-
const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-
|
|
5881
|
+
const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-ODKD7QJO.js");
|
|
5864
5882
|
const eventStore = getEventStore2();
|
|
5865
5883
|
const events = eventStore.getEvents(sessionId);
|
|
5866
5884
|
const messages = buildMessagesFromStoredEvents2(events);
|
|
@@ -5878,7 +5896,7 @@ async function createServerHandle(config) {
|
|
|
5878
5896
|
if (!callId || !answer) {
|
|
5879
5897
|
return res.status(400).json({ error: "callId and answer are required" });
|
|
5880
5898
|
}
|
|
5881
|
-
const { provideAnswer: provideAnswer2 } = await import("./tools-
|
|
5899
|
+
const { provideAnswer: provideAnswer2 } = await import("./tools-GQ3PJL6N.js");
|
|
5882
5900
|
const found = provideAnswer2(callId, answer);
|
|
5883
5901
|
if (!found) {
|
|
5884
5902
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -5914,14 +5932,14 @@ async function createServerHandle(config) {
|
|
|
5914
5932
|
if (!session) {
|
|
5915
5933
|
return res.status(404).json({ error: "Session not found" });
|
|
5916
5934
|
}
|
|
5917
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
5918
|
-
const { cancelQuestionsForSession: cancelQuestionsForSession2, cancelPathConfirmationsForSession: cancelPathConfirmationsForSession2 } = await import("./tools-
|
|
5935
|
+
const { stopSessionExecution } = await import("./chat-handler-55LA4LI2.js");
|
|
5936
|
+
const { cancelQuestionsForSession: cancelQuestionsForSession2, cancelPathConfirmationsForSession: cancelPathConfirmationsForSession2 } = await import("./tools-GQ3PJL6N.js");
|
|
5919
5937
|
stopSessionExecution(sessionId, sessionManager);
|
|
5920
5938
|
abortSession(sessionId);
|
|
5921
5939
|
cancelQuestionsForSession2(sessionId, "Session stopped by user");
|
|
5922
5940
|
cancelPathConfirmationsForSession2(sessionId, "Session stopped by user");
|
|
5923
5941
|
sessionManager.clearMessageQueue(sessionId);
|
|
5924
|
-
const eventStore = (await import("./events-
|
|
5942
|
+
const eventStore = (await import("./events-OZKDX6XE.js")).getEventStore();
|
|
5925
5943
|
eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
|
|
5926
5944
|
res.json({ success: true });
|
|
5927
5945
|
});
|
|
@@ -6201,6 +6219,27 @@ async function createServerHandle(config) {
|
|
|
6201
6219
|
app.use("/api/workflows", createWorkflowRoutes(configDir, config));
|
|
6202
6220
|
app.use("/api/dev-server", createDevServerRoutes());
|
|
6203
6221
|
app.use("/api/terminals", createTerminalRoutes());
|
|
6222
|
+
app.get("/api/sessions/:id/background-processes", async (req, res) => {
|
|
6223
|
+
const { getSessionProcesses } = await import("./manager-HM2J5VMW.js");
|
|
6224
|
+
const sessionId = req.params.id;
|
|
6225
|
+
const processes = getSessionProcesses(sessionId);
|
|
6226
|
+
res.json({ processes });
|
|
6227
|
+
});
|
|
6228
|
+
app.post("/api/sessions/:id/background-process/:processId/stop", async (req, res) => {
|
|
6229
|
+
const { stopProcess } = await import("./manager-HM2J5VMW.js");
|
|
6230
|
+
const sessionId = req.params.id;
|
|
6231
|
+
const processId = req.params.processId;
|
|
6232
|
+
const session = sessionManager.getSession(sessionId);
|
|
6233
|
+
if (!session) {
|
|
6234
|
+
return res.status(404).json({ error: "Session not found" });
|
|
6235
|
+
}
|
|
6236
|
+
try {
|
|
6237
|
+
await stopProcess(processId, sessionId);
|
|
6238
|
+
res.json({ success: true });
|
|
6239
|
+
} catch (err) {
|
|
6240
|
+
res.status(500).json({ error: err instanceof Error ? err.message : "Failed to stop process" });
|
|
6241
|
+
}
|
|
6242
|
+
});
|
|
6204
6243
|
const { getCurrentBranch } = await import("./branch.api-XADFZZAA.js");
|
|
6205
6244
|
app.get("/api/branch", async (req, res) => {
|
|
6206
6245
|
await getCurrentBranch(req, res);
|
|
@@ -6341,7 +6380,7 @@ async function createServerHandle(config) {
|
|
|
6341
6380
|
providerManager
|
|
6342
6381
|
);
|
|
6343
6382
|
const wss = wssExports.wss;
|
|
6344
|
-
const { QueueProcessor } = await import("./processor-
|
|
6383
|
+
const { QueueProcessor } = await import("./processor-I4BGYK3T.js");
|
|
6345
6384
|
const queueProcessor = new QueueProcessor({
|
|
6346
6385
|
sessionManager,
|
|
6347
6386
|
providerManager,
|
|
@@ -6379,6 +6418,8 @@ async function createServerHandle(config) {
|
|
|
6379
6418
|
logger.info("Shutting down...");
|
|
6380
6419
|
void (async () => {
|
|
6381
6420
|
await devServerManager.stopAll();
|
|
6421
|
+
const { cleanupAllProcesses } = await import("./store-2IF3ZSLD.js");
|
|
6422
|
+
cleanupAllProcesses();
|
|
6382
6423
|
viteServer?.close();
|
|
6383
6424
|
for (const client of wss.clients) {
|
|
6384
6425
|
client.terminate();
|
|
@@ -6411,4 +6452,4 @@ export {
|
|
|
6411
6452
|
createServerHandle,
|
|
6412
6453
|
createServer
|
|
6413
6454
|
};
|
|
6414
|
-
//# sourceMappingURL=chunk-
|
|
6455
|
+
//# sourceMappingURL=chunk-WZJLCOV3.js.map
|
package/dist/cli/dev.js
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
isFileInCache,
|
|
37
37
|
isStoredEvent,
|
|
38
38
|
isTurnEvent
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-CIXMZ73F.js";
|
|
40
40
|
import {
|
|
41
41
|
buildContextMessagesFromEventHistory,
|
|
42
42
|
buildContextMessagesFromMessages,
|
|
@@ -111,4 +111,4 @@ export {
|
|
|
111
111
|
isStoredEvent,
|
|
112
112
|
isTurnEvent
|
|
113
113
|
};
|
|
114
|
-
//# sourceMappingURL=events-
|
|
114
|
+
//# sourceMappingURL=events-OZKDX6XE.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createProcess,
|
|
3
|
+
getProcessLogs,
|
|
4
|
+
getProcessStatus,
|
|
5
|
+
getSessionProcesses,
|
|
6
|
+
onProcessEvent,
|
|
7
|
+
startProcessCommand,
|
|
8
|
+
stopProcess
|
|
9
|
+
} from "./chunk-NBU6KIOD.js";
|
|
10
|
+
import "./chunk-574HZVLE.js";
|
|
11
|
+
export {
|
|
12
|
+
createProcess,
|
|
13
|
+
getProcessLogs,
|
|
14
|
+
getProcessStatus,
|
|
15
|
+
getSessionProcesses,
|
|
16
|
+
onProcessEvent,
|
|
17
|
+
startProcessCommand,
|
|
18
|
+
stopProcess
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=manager-HM2J5VMW.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
runBuilderTurn,
|
|
4
4
|
runChatTurn,
|
|
5
5
|
runVerifierTurn
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-S73ATBSR.js";
|
|
7
7
|
import {
|
|
8
8
|
TurnMetrics,
|
|
9
9
|
createChatDoneEvent,
|
|
@@ -11,16 +11,18 @@ import {
|
|
|
11
11
|
createMessageStartEvent,
|
|
12
12
|
createToolCallEvent,
|
|
13
13
|
createToolResultEvent
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GBBTJ6ND.js";
|
|
15
|
+
import "./chunk-NBU6KIOD.js";
|
|
16
|
+
import "./chunk-574HZVLE.js";
|
|
15
17
|
import "./chunk-XFXOSPYH.js";
|
|
16
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-CIXMZ73F.js";
|
|
17
19
|
import "./chunk-WQ4W5H6A.js";
|
|
18
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-EBOKO2PW.js";
|
|
19
21
|
import "./chunk-22CTURMH.js";
|
|
20
22
|
import "./chunk-7IOZFJBW.js";
|
|
21
23
|
import "./chunk-XKFPU2FA.js";
|
|
22
24
|
import "./chunk-3EHGGBWE.js";
|
|
23
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-XQQ2BRJA.js";
|
|
24
26
|
import "./chunk-R4HADRYO.js";
|
|
25
27
|
import "./chunk-TVQOONDR.js";
|
|
26
28
|
import "./chunk-PNBH3RAX.js";
|
|
@@ -36,4 +38,4 @@ export {
|
|
|
36
38
|
runChatTurn,
|
|
37
39
|
runVerifierTurn
|
|
38
40
|
};
|
|
39
|
-
//# sourceMappingURL=orchestrator-
|
|
41
|
+
//# sourceMappingURL=orchestrator-IEYZSNVH.js.map
|