openfox 1.6.86 → 1.6.88
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/{auto-compaction-SFGVXG5N.js → auto-compaction-6A34RHDV.js} +5 -5
- package/dist/{chat-handler-DNKX3XP4.js → chat-handler-6ATTKNZT.js} +8 -8
- package/dist/{chunk-ENH5AUOX.js → chunk-6P5WQP6Y.js} +5 -1
- package/dist/{chunk-5YZ6UPJD.js → chunk-BZUNXVUJ.js} +2 -2
- package/dist/{chunk-3ZFBNQFW.js → chunk-DF5BZBP6.js} +3 -3
- package/dist/{chunk-4VT74LCD.js → chunk-ERFRUQQR.js} +1 -1
- package/dist/{chunk-56MJNPRR.js → chunk-N7W42N5Y.js} +3 -3
- package/dist/{chunk-GN7RB4Y4.js → chunk-PAAUYFYS.js} +8 -4
- package/dist/{chunk-X77U3VSW.js → chunk-QPOO2EM6.js} +193 -27
- package/dist/{chunk-IGPHQGUN.js → chunk-UEZDAB5X.js} +13 -13
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{events-ZHG3VBZC.js → events-AQKDXJFK.js} +2 -2
- package/dist/{orchestrator-62JU2Z7E.js → orchestrator-YUAFANFC.js} +6 -6
- package/dist/package.json +1 -1
- package/dist/{processor-ELRLBORH.js → processor-4SOP4Q6S.js} +6 -6
- package/dist/{protocol-DaC_kENH.d.ts → protocol--8PKNwb_.d.ts} +15 -2
- package/dist/{protocol-NEBXAMJ3.js → protocol-QDSVJTRN.js} +5 -3
- package/dist/{serve-Z2RZ5D3X.js → serve-EJRMCF6B.js} +7 -7
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +6 -6
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.js +1 -1
- package/dist/{tools-DAOJPK7C.js → tools-7MGUWXDP.js} +5 -5
- package/dist/web/assets/{index-DNXnQmN1.css → index-CF48Zu7j.css} +1 -1
- package/dist/web/assets/{index-cQ_EgBxT.js → index-DGidgYuL.js} +53 -53
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
|
@@ -2,19 +2,19 @@ import {
|
|
|
2
2
|
maybeAutoCompactContext,
|
|
3
3
|
performManualContextCompaction,
|
|
4
4
|
resolveCompactionStatsIdentity
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UEZDAB5X.js";
|
|
6
6
|
import "./chunk-RCECKE5L.js";
|
|
7
7
|
import "./chunk-ZHBL5G5X.js";
|
|
8
8
|
import "./chunk-DL6ZILAF.js";
|
|
9
9
|
import "./chunk-PBGOZMVY.js";
|
|
10
10
|
import "./chunk-VRGRAQDG.js";
|
|
11
11
|
import "./chunk-YNIAFX24.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-6P5WQP6Y.js";
|
|
13
13
|
import "./chunk-5GVCNVKV.js";
|
|
14
14
|
import "./chunk-XVWVAWSG.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-PAAUYFYS.js";
|
|
16
16
|
import "./chunk-BJYPTN5S.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-ERFRUQQR.js";
|
|
18
18
|
import "./chunk-CQGTEGKL.js";
|
|
19
19
|
import "./chunk-B5AP3RSV.js";
|
|
20
20
|
import "./chunk-WSRF5L3S.js";
|
|
@@ -24,4 +24,4 @@ export {
|
|
|
24
24
|
performManualContextCompaction,
|
|
25
25
|
resolveCompactionStatsIdentity
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=auto-compaction-
|
|
27
|
+
//# sourceMappingURL=auto-compaction-6A34RHDV.js.map
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
generateSessionName,
|
|
6
6
|
getSessionMessageCount,
|
|
7
7
|
needsNameGenerationCheck
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DF5BZBP6.js";
|
|
9
9
|
import {
|
|
10
10
|
runChatTurn
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-N7W42N5Y.js";
|
|
12
|
+
import "./chunk-UEZDAB5X.js";
|
|
13
13
|
import "./chunk-RCECKE5L.js";
|
|
14
14
|
import "./chunk-ZHBL5G5X.js";
|
|
15
15
|
import "./chunk-DL6ZILAF.js";
|
|
@@ -18,16 +18,16 @@ import "./chunk-VRGRAQDG.js";
|
|
|
18
18
|
import "./chunk-YNIAFX24.js";
|
|
19
19
|
import {
|
|
20
20
|
getEventStore
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-6P5WQP6Y.js";
|
|
22
22
|
import "./chunk-5GVCNVKV.js";
|
|
23
23
|
import "./chunk-XVWVAWSG.js";
|
|
24
24
|
import {
|
|
25
25
|
createChatMessageMessage,
|
|
26
26
|
createPhaseChangedMessage,
|
|
27
27
|
createSessionRunningMessage
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-PAAUYFYS.js";
|
|
29
29
|
import "./chunk-BJYPTN5S.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-ERFRUQQR.js";
|
|
31
31
|
import "./chunk-CQGTEGKL.js";
|
|
32
32
|
import "./chunk-B5AP3RSV.js";
|
|
33
33
|
import "./chunk-WSRF5L3S.js";
|
|
@@ -61,7 +61,7 @@ async function startChatSession(sessionId, content, deps, options) {
|
|
|
61
61
|
sessionManager.setRunning(sessionId, true);
|
|
62
62
|
broadcastForSession(sessionId, createSessionRunningMessage(true));
|
|
63
63
|
try {
|
|
64
|
-
const { maybeAutoCompactContext } = await import("./auto-compaction-
|
|
64
|
+
const { maybeAutoCompactContext } = await import("./auto-compaction-6A34RHDV.js");
|
|
65
65
|
await maybeAutoCompactContext({
|
|
66
66
|
sessionManager,
|
|
67
67
|
sessionId,
|
|
@@ -175,4 +175,4 @@ export {
|
|
|
175
175
|
startChatSession,
|
|
176
176
|
stopSessionExecution
|
|
177
177
|
};
|
|
178
|
-
//# sourceMappingURL=chat-handler-
|
|
178
|
+
//# sourceMappingURL=chat-handler-6ATTKNZT.js.map
|
|
@@ -514,6 +514,10 @@ var EventStore = class {
|
|
|
514
514
|
var eventStoreInstance = null;
|
|
515
515
|
function initEventStore(db) {
|
|
516
516
|
eventStoreInstance = new EventStore(db);
|
|
517
|
+
try {
|
|
518
|
+
db.prepare(`UPDATE sessions SET is_running = 0`).run();
|
|
519
|
+
} catch {
|
|
520
|
+
}
|
|
517
521
|
resetStaleRunningSessions(eventStoreInstance, db);
|
|
518
522
|
const result = eventStoreInstance.optimizeStorage();
|
|
519
523
|
if (result.deletedSnapshots > 0 || result.strippedSnapshots > 0) {
|
|
@@ -1279,4 +1283,4 @@ export {
|
|
|
1279
1283
|
compactContext,
|
|
1280
1284
|
getRecentUserPromptsForSession
|
|
1281
1285
|
};
|
|
1282
|
-
//# sourceMappingURL=chunk-
|
|
1286
|
+
//# sourceMappingURL=chunk-6P5WQP6Y.js.map
|
|
@@ -190,7 +190,7 @@ async function runCli(options) {
|
|
|
190
190
|
if (!configExists) {
|
|
191
191
|
await runNetworkSetup(mode);
|
|
192
192
|
}
|
|
193
|
-
const { runServe } = await import("./serve-
|
|
193
|
+
const { runServe } = await import("./serve-EJRMCF6B.js");
|
|
194
194
|
const serveOptions = { mode };
|
|
195
195
|
if (values.port) serveOptions.port = parseInt(values.port);
|
|
196
196
|
if (values["no-browser"] === true) serveOptions.openBrowser = false;
|
|
@@ -202,4 +202,4 @@ async function runCli(options) {
|
|
|
202
202
|
export {
|
|
203
203
|
runCli
|
|
204
204
|
};
|
|
205
|
-
//# sourceMappingURL=chunk-
|
|
205
|
+
//# sourceMappingURL=chunk-BZUNXVUJ.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getEventStore,
|
|
3
3
|
updateSessionMetadata
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6P5WQP6Y.js";
|
|
5
5
|
import {
|
|
6
6
|
buildMessagesFromStoredEvents,
|
|
7
7
|
foldPendingConfirmations
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
createContextStateMessage,
|
|
11
11
|
createSessionStateMessage
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-PAAUYFYS.js";
|
|
13
13
|
import {
|
|
14
14
|
logger
|
|
15
15
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -143,4 +143,4 @@ export {
|
|
|
143
143
|
needsNameGenerationCheck,
|
|
144
144
|
applyGeneratedSessionName
|
|
145
145
|
};
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-DF5BZBP6.js.map
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
getToolRegistryForAgent,
|
|
14
14
|
loadAllAgentsDefault,
|
|
15
15
|
runTopLevelAgentLoop
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-UEZDAB5X.js";
|
|
17
17
|
import {
|
|
18
18
|
getCurrentContextWindowId,
|
|
19
19
|
getEventStore
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-6P5WQP6Y.js";
|
|
21
21
|
import {
|
|
22
22
|
buildSnapshotFromSessionState
|
|
23
23
|
} from "./chunk-XVWVAWSG.js";
|
|
@@ -327,4 +327,4 @@ export {
|
|
|
327
327
|
runBuilderTurn,
|
|
328
328
|
runVerifierTurn
|
|
329
329
|
};
|
|
330
|
-
//# sourceMappingURL=chunk-
|
|
330
|
+
//# sourceMappingURL=chunk-N7W42N5Y.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServerMessage,
|
|
3
3
|
isClientMessage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ERFRUQQR.js";
|
|
5
5
|
|
|
6
6
|
// src/server/ws/protocol.ts
|
|
7
7
|
function enrichMessagesWithToolResults(messages) {
|
|
@@ -43,11 +43,11 @@ function serializeServerMessage(message) {
|
|
|
43
43
|
function createErrorMessage(code, message, correlationId) {
|
|
44
44
|
return createServerMessage("error", { code, message }, correlationId);
|
|
45
45
|
}
|
|
46
|
-
function createSessionStateMessage(session, messages, pendingConfirmations = [], correlationId) {
|
|
46
|
+
function createSessionStateMessage(session, messages, pendingConfirmations = [], gitStatus, correlationId) {
|
|
47
47
|
const enrichedMessages = enrichMessagesWithToolResults(messages);
|
|
48
48
|
return createServerMessage(
|
|
49
49
|
"session.state",
|
|
50
|
-
{ session, messages: enrichedMessages, pendingConfirmations },
|
|
50
|
+
{ session, messages: enrichedMessages, pendingConfirmations, ...gitStatus ? { gitStatus } : {} },
|
|
51
51
|
correlationId
|
|
52
52
|
);
|
|
53
53
|
}
|
|
@@ -63,6 +63,9 @@ function createProjectStateMessage(project, correlationId) {
|
|
|
63
63
|
function createProjectListMessage(projects, correlationId) {
|
|
64
64
|
return createServerMessage("project.list", { projects }, correlationId);
|
|
65
65
|
}
|
|
66
|
+
function createGitStatusMessage(branch, diffFiles, correlationId) {
|
|
67
|
+
return createServerMessage("git.status", { branch, diff: { files: diffFiles } }, correlationId);
|
|
68
|
+
}
|
|
66
69
|
function createChatDeltaMessage(messageId, content) {
|
|
67
70
|
return createServerMessage("chat.delta", { messageId, content });
|
|
68
71
|
}
|
|
@@ -314,6 +317,7 @@ export {
|
|
|
314
317
|
createSessionRunningMessage,
|
|
315
318
|
createProjectStateMessage,
|
|
316
319
|
createProjectListMessage,
|
|
320
|
+
createGitStatusMessage,
|
|
317
321
|
createChatDeltaMessage,
|
|
318
322
|
createChatThinkingMessage,
|
|
319
323
|
createChatToolPreparingMessage,
|
|
@@ -343,4 +347,4 @@ export {
|
|
|
343
347
|
createQueueStateMessage,
|
|
344
348
|
storedEventToServerMessage
|
|
345
349
|
};
|
|
346
|
-
//# sourceMappingURL=chunk-
|
|
350
|
+
//# sourceMappingURL=chunk-PAAUYFYS.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createVerifierNudgeConfig,
|
|
3
3
|
runBuilderTurn,
|
|
4
4
|
runChatTurn
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-N7W42N5Y.js";
|
|
6
6
|
import {
|
|
7
7
|
TurnMetrics,
|
|
8
8
|
agentExists,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
setSkillEnabled,
|
|
38
38
|
skillExists,
|
|
39
39
|
spawnShellProcess
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-UEZDAB5X.js";
|
|
41
41
|
import {
|
|
42
42
|
getProject
|
|
43
43
|
} from "./chunk-ZHBL5G5X.js";
|
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
updateSessionProvider,
|
|
88
88
|
updateSessionRunning,
|
|
89
89
|
updateSessionSummary
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-6P5WQP6Y.js";
|
|
91
91
|
import {
|
|
92
92
|
initDatabase
|
|
93
93
|
} from "./chunk-5GVCNVKV.js";
|
|
@@ -100,6 +100,7 @@ import {
|
|
|
100
100
|
createChatMessageMessage,
|
|
101
101
|
createContextStateMessage,
|
|
102
102
|
createErrorMessage,
|
|
103
|
+
createGitStatusMessage,
|
|
103
104
|
createQueueStateMessage,
|
|
104
105
|
createSessionRunningMessage,
|
|
105
106
|
createSessionStateMessage,
|
|
@@ -108,7 +109,7 @@ import {
|
|
|
108
109
|
parseClientMessage,
|
|
109
110
|
serializeServerMessage,
|
|
110
111
|
storedEventToServerMessage
|
|
111
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-PAAUYFYS.js";
|
|
112
113
|
import {
|
|
113
114
|
EventEmitter,
|
|
114
115
|
provideAnswer
|
|
@@ -118,7 +119,7 @@ import {
|
|
|
118
119
|
} from "./chunk-RGRBWDZP.js";
|
|
119
120
|
import {
|
|
120
121
|
createServerMessage
|
|
121
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-ERFRUQQR.js";
|
|
122
123
|
import {
|
|
123
124
|
getGlobalConfigDir
|
|
124
125
|
} from "./chunk-CQGTEGKL.js";
|
|
@@ -1276,6 +1277,7 @@ function createMockLLMClient() {
|
|
|
1276
1277
|
|
|
1277
1278
|
// src/server/ws/server.ts
|
|
1278
1279
|
import { WebSocketServer, WebSocket as WebSocket2 } from "ws";
|
|
1280
|
+
import { spawn as spawn2 } from "child_process";
|
|
1279
1281
|
|
|
1280
1282
|
// src/server/ws/terminal.ts
|
|
1281
1283
|
import WebSocket from "ws";
|
|
@@ -2276,6 +2278,152 @@ async function isValidToken(token) {
|
|
|
2276
2278
|
}
|
|
2277
2279
|
|
|
2278
2280
|
// src/server/ws/server.ts
|
|
2281
|
+
function moduleGitBranch(cwd) {
|
|
2282
|
+
return new Promise((resolve2) => {
|
|
2283
|
+
const proc = spawn2("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
|
|
2284
|
+
cwd,
|
|
2285
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
2286
|
+
});
|
|
2287
|
+
let stdout = "";
|
|
2288
|
+
proc.stdout.on("data", (data) => {
|
|
2289
|
+
stdout += data.toString();
|
|
2290
|
+
});
|
|
2291
|
+
proc.on("close", (code) => {
|
|
2292
|
+
if (code === 0 && stdout.trim()) {
|
|
2293
|
+
resolve2(stdout.trim());
|
|
2294
|
+
} else {
|
|
2295
|
+
resolve2(null);
|
|
2296
|
+
}
|
|
2297
|
+
});
|
|
2298
|
+
proc.on("error", () => resolve2(null));
|
|
2299
|
+
});
|
|
2300
|
+
}
|
|
2301
|
+
function moduleGitDiff(cwd) {
|
|
2302
|
+
return new Promise((resolve2) => {
|
|
2303
|
+
const proc = spawn2("git", ["diff", "--stat", "--numstat", "--format=", "HEAD"], {
|
|
2304
|
+
cwd,
|
|
2305
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
2306
|
+
});
|
|
2307
|
+
const statusProc = spawn2("git", ["status", "--porcelain", "-uall"], {
|
|
2308
|
+
cwd,
|
|
2309
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
2310
|
+
});
|
|
2311
|
+
let diffStdout = "";
|
|
2312
|
+
let statusStdout = "";
|
|
2313
|
+
proc.stdout.on("data", (data) => {
|
|
2314
|
+
diffStdout += data.toString();
|
|
2315
|
+
});
|
|
2316
|
+
statusProc.stdout.on("data", (data) => {
|
|
2317
|
+
statusStdout += data.toString();
|
|
2318
|
+
});
|
|
2319
|
+
let procExited = false;
|
|
2320
|
+
let statusExited = false;
|
|
2321
|
+
let diffCode = null;
|
|
2322
|
+
let statusCode = null;
|
|
2323
|
+
const processResults = () => {
|
|
2324
|
+
if (diffCode !== 0 || statusCode !== 0) {
|
|
2325
|
+
resolve2({ hash: "", files: [] });
|
|
2326
|
+
return;
|
|
2327
|
+
}
|
|
2328
|
+
const hashProc = spawn2("git", ["rev-parse", "HEAD"], { cwd, stdio: ["ignore", "pipe", "ignore"] });
|
|
2329
|
+
let hash = "";
|
|
2330
|
+
hashProc.stdout.on("data", (data) => {
|
|
2331
|
+
hash += data.toString();
|
|
2332
|
+
});
|
|
2333
|
+
hashProc.on("close", (hCode) => {
|
|
2334
|
+
if (hCode !== 0) hash = "";
|
|
2335
|
+
});
|
|
2336
|
+
hashProc.on("error", () => {
|
|
2337
|
+
hash = "";
|
|
2338
|
+
});
|
|
2339
|
+
const files = [];
|
|
2340
|
+
for (const line of diffStdout.split("\n")) {
|
|
2341
|
+
if (!line) continue;
|
|
2342
|
+
const parts = line.split(" ");
|
|
2343
|
+
if (parts.length < 3) continue;
|
|
2344
|
+
const statusChar = parts[1]?.[0];
|
|
2345
|
+
const status = statusChar === "A" ? "added" : statusChar === "d" ? "deleted" : "modified";
|
|
2346
|
+
files.push({
|
|
2347
|
+
path: parts[2] ?? parts[1] ?? parts[0] ?? "",
|
|
2348
|
+
status,
|
|
2349
|
+
additions: parseInt(parts[0] ?? "") || 0,
|
|
2350
|
+
deletions: parseInt(parts[1] ?? "") || 0
|
|
2351
|
+
});
|
|
2352
|
+
}
|
|
2353
|
+
for (const line of statusStdout.split("\n")) {
|
|
2354
|
+
if (!line) continue;
|
|
2355
|
+
if (!line.startsWith("?? ")) continue;
|
|
2356
|
+
const path = line.slice(3);
|
|
2357
|
+
if (!path) continue;
|
|
2358
|
+
files.push({
|
|
2359
|
+
path,
|
|
2360
|
+
status: "added",
|
|
2361
|
+
additions: 0,
|
|
2362
|
+
deletions: 0
|
|
2363
|
+
});
|
|
2364
|
+
}
|
|
2365
|
+
resolve2({ hash: hash.trim(), files });
|
|
2366
|
+
};
|
|
2367
|
+
proc.on("close", (code) => {
|
|
2368
|
+
procExited = true;
|
|
2369
|
+
diffCode = code;
|
|
2370
|
+
if (statusExited) processResults();
|
|
2371
|
+
});
|
|
2372
|
+
statusProc.on("close", (code) => {
|
|
2373
|
+
statusExited = true;
|
|
2374
|
+
statusCode = code;
|
|
2375
|
+
if (procExited) processResults();
|
|
2376
|
+
});
|
|
2377
|
+
proc.on("error", () => resolve2({ hash: "", files: [] }));
|
|
2378
|
+
statusProc.on("error", () => {
|
|
2379
|
+
if (!procExited) {
|
|
2380
|
+
resolve2({ hash: "", files: [] });
|
|
2381
|
+
}
|
|
2382
|
+
});
|
|
2383
|
+
});
|
|
2384
|
+
}
|
|
2385
|
+
var moduleWorkdirLastHash = /* @__PURE__ */ new Map();
|
|
2386
|
+
var moduleWorkdirInterval = /* @__PURE__ */ new Map();
|
|
2387
|
+
var gitPollInterval = 1e4;
|
|
2388
|
+
var moduleClients = null;
|
|
2389
|
+
var moduleEnqueueSend = null;
|
|
2390
|
+
function moduleGitPoll(workdir) {
|
|
2391
|
+
;
|
|
2392
|
+
(async () => {
|
|
2393
|
+
try {
|
|
2394
|
+
const branch = await moduleGitBranch(workdir);
|
|
2395
|
+
const { hash, files } = await moduleGitDiff(workdir);
|
|
2396
|
+
const lastHash = moduleWorkdirLastHash.get(workdir);
|
|
2397
|
+
if (hash !== lastHash) {
|
|
2398
|
+
moduleWorkdirLastHash.set(workdir, hash);
|
|
2399
|
+
const msg = createGitStatusMessage(branch, files);
|
|
2400
|
+
const activeClients = moduleClients;
|
|
2401
|
+
const sendFn = moduleEnqueueSend;
|
|
2402
|
+
if (!activeClients || !sendFn) return;
|
|
2403
|
+
for (const [ws, client] of activeClients) {
|
|
2404
|
+
if (client.activeWorkdir === workdir && ws.readyState === WebSocket2.OPEN) {
|
|
2405
|
+
const seq = client.lastSentSeq + 1;
|
|
2406
|
+
sendFn(client, serializeServerMessage({ ...msg, sessionId: client.activeSessionId ?? "" }), seq);
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
}
|
|
2410
|
+
} catch {
|
|
2411
|
+
}
|
|
2412
|
+
})();
|
|
2413
|
+
}
|
|
2414
|
+
function moduleStartGitPolling(workdir) {
|
|
2415
|
+
if (moduleWorkdirInterval.has(workdir)) return;
|
|
2416
|
+
const interval = setInterval(() => moduleGitPoll(workdir), gitPollInterval);
|
|
2417
|
+
moduleWorkdirInterval.set(workdir, interval);
|
|
2418
|
+
}
|
|
2419
|
+
function moduleStopGitPolling(workdir) {
|
|
2420
|
+
const interval = moduleWorkdirInterval.get(workdir);
|
|
2421
|
+
if (interval !== void 0) {
|
|
2422
|
+
clearInterval(interval);
|
|
2423
|
+
moduleWorkdirInterval.delete(workdir);
|
|
2424
|
+
moduleWorkdirLastHash.delete(workdir);
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2279
2427
|
function resolveStatsIdentity(llmClient, getActiveProvider) {
|
|
2280
2428
|
const provider = getActiveProvider?.();
|
|
2281
2429
|
const model = llmClient.getModel();
|
|
@@ -2335,6 +2483,7 @@ var MAX_SEND_QUEUE_SIZE = 1e3;
|
|
|
2335
2483
|
function createWebSocketServer(httpServer, config, getLLMClient, getActiveProvider, sessionManager, providerManager) {
|
|
2336
2484
|
const wss = new WebSocketServer({ server: httpServer });
|
|
2337
2485
|
const clients = /* @__PURE__ */ new Map();
|
|
2486
|
+
moduleClients = clients;
|
|
2338
2487
|
const sessionLLMClients = /* @__PURE__ */ new Map();
|
|
2339
2488
|
function getSessionLLMClient(sessionId) {
|
|
2340
2489
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -2409,6 +2558,7 @@ function createWebSocketServer(httpServer, config, getLLMClient, getActiveProvid
|
|
|
2409
2558
|
client.sendQueue.push({ data, seq });
|
|
2410
2559
|
processSendQueue(client);
|
|
2411
2560
|
}
|
|
2561
|
+
moduleEnqueueSend = enqueueSend;
|
|
2412
2562
|
function processSendQueue(client) {
|
|
2413
2563
|
if (client.isSending || client.sendQueue.length === 0) {
|
|
2414
2564
|
return;
|
|
@@ -2540,6 +2690,7 @@ function createWebSocketServer(httpServer, config, getLLMClient, getActiveProvid
|
|
|
2540
2690
|
clients.set(ws, {
|
|
2541
2691
|
ws,
|
|
2542
2692
|
activeSessionId: null,
|
|
2693
|
+
activeWorkdir: null,
|
|
2543
2694
|
globalSubscription: null,
|
|
2544
2695
|
sendQueue: [],
|
|
2545
2696
|
isSending: false,
|
|
@@ -2617,15 +2768,18 @@ function createWebSocketServer(httpServer, config, getLLMClient, getActiveProvid
|
|
|
2617
2768
|
ws.on("close", () => {
|
|
2618
2769
|
logger.debug("WebSocket client disconnected");
|
|
2619
2770
|
const client = clients.get(ws);
|
|
2771
|
+
const disconnectedWorkdir = client?.activeWorkdir ?? null;
|
|
2620
2772
|
if (client?.globalSubscription) {
|
|
2621
2773
|
client.globalSubscription();
|
|
2622
2774
|
}
|
|
2623
2775
|
unsubscribeAllFromTerminal(ws);
|
|
2624
|
-
if (client) {
|
|
2625
|
-
client.sendQueue = [];
|
|
2626
|
-
client.isSending = false;
|
|
2627
|
-
}
|
|
2628
2776
|
clients.delete(ws);
|
|
2777
|
+
if (disconnectedWorkdir) {
|
|
2778
|
+
const hasRemaining = [...clients.values()].some((c) => c.activeWorkdir === disconnectedWorkdir);
|
|
2779
|
+
if (!hasRemaining) {
|
|
2780
|
+
moduleStopGitPolling(disconnectedWorkdir);
|
|
2781
|
+
}
|
|
2782
|
+
}
|
|
2629
2783
|
});
|
|
2630
2784
|
ws.on("error", (error) => {
|
|
2631
2785
|
logger.error("WebSocket error", { error });
|
|
@@ -2701,6 +2855,8 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
|
|
|
2701
2855
|
return;
|
|
2702
2856
|
}
|
|
2703
2857
|
client.activeSessionId = session.id;
|
|
2858
|
+
client.activeWorkdir = session.workdir;
|
|
2859
|
+
if (session.workdir) moduleStartGitPolling(session.workdir);
|
|
2704
2860
|
ensureEventStoreSubscription(session.id);
|
|
2705
2861
|
const eventStore = getEventStore();
|
|
2706
2862
|
const events = eventStore.getEvents(session.id);
|
|
@@ -2712,7 +2868,17 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
|
|
|
2712
2868
|
messageCount: messages.length,
|
|
2713
2869
|
pendingConfirmationsCount: pendingConfirmations.length
|
|
2714
2870
|
});
|
|
2715
|
-
|
|
2871
|
+
const initialGitStatus = (async () => {
|
|
2872
|
+
if (!session.workdir) return void 0;
|
|
2873
|
+
const branch = await moduleGitBranch(session.workdir);
|
|
2874
|
+
const { files } = await moduleGitDiff(session.workdir);
|
|
2875
|
+
return { branch, diff: { files } };
|
|
2876
|
+
})();
|
|
2877
|
+
const gitStatusPayload = await initialGitStatus;
|
|
2878
|
+
sendForSession(
|
|
2879
|
+
session.id,
|
|
2880
|
+
createSessionStateMessage(session, messages, pendingConfirmations, gitStatusPayload, message.id)
|
|
2881
|
+
);
|
|
2716
2882
|
const contextState = sessionManager.getContextState(session.id);
|
|
2717
2883
|
sendForSession(session.id, createContextStateMessage(contextState));
|
|
2718
2884
|
break;
|
|
@@ -2899,7 +3065,7 @@ ${content}` : workflowInfo;
|
|
|
2899
3065
|
}
|
|
2900
3066
|
|
|
2901
3067
|
// src/server/lsp/server.ts
|
|
2902
|
-
import { spawn as
|
|
3068
|
+
import { spawn as spawn3 } from "child_process";
|
|
2903
3069
|
import { extname } from "path";
|
|
2904
3070
|
import { createMessageConnection, StreamMessageReader, StreamMessageWriter } from "vscode-jsonrpc/node.js";
|
|
2905
3071
|
var LSP = {
|
|
@@ -2961,7 +3127,7 @@ var LspServer = class {
|
|
|
2961
3127
|
}
|
|
2962
3128
|
this.state = "starting";
|
|
2963
3129
|
try {
|
|
2964
|
-
this.process =
|
|
3130
|
+
this.process = spawn3(this.commandPath, this.config.serverArgs, {
|
|
2965
3131
|
cwd: this.workdir,
|
|
2966
3132
|
stdio: ["pipe", "pipe", "pipe"],
|
|
2967
3133
|
env: {
|
|
@@ -5261,7 +5427,7 @@ function createTerminalRoutes() {
|
|
|
5261
5427
|
}
|
|
5262
5428
|
|
|
5263
5429
|
// src/constants.ts
|
|
5264
|
-
var VERSION = "1.6.
|
|
5430
|
+
var VERSION = "1.6.88";
|
|
5265
5431
|
|
|
5266
5432
|
// src/server/index.ts
|
|
5267
5433
|
var __dirname2 = dirname5(fileURLToPath4(import.meta.url));
|
|
@@ -5476,7 +5642,7 @@ async function createServerHandle(config) {
|
|
|
5476
5642
|
res.json({ project });
|
|
5477
5643
|
});
|
|
5478
5644
|
app.get("/api/sessions", async (req, res) => {
|
|
5479
|
-
const { getRecentUserPromptsForSession } = await import("./events-
|
|
5645
|
+
const { getRecentUserPromptsForSession } = await import("./events-AQKDXJFK.js");
|
|
5480
5646
|
const projectId = req.query["projectId"];
|
|
5481
5647
|
const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
|
|
5482
5648
|
const offset = parseInt(req.query["offset"]) || 0;
|
|
@@ -5509,7 +5675,7 @@ async function createServerHandle(config) {
|
|
|
5509
5675
|
res.status(201).json({ session });
|
|
5510
5676
|
});
|
|
5511
5677
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
5512
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5678
|
+
const { getEventStore: getEventStore2 } = await import("./events-AQKDXJFK.js");
|
|
5513
5679
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-4VHGQE6Y.js");
|
|
5514
5680
|
const session = sessionManager.getSession(req.params.id);
|
|
5515
5681
|
if (!session) {
|
|
@@ -5540,7 +5706,7 @@ async function createServerHandle(config) {
|
|
|
5540
5706
|
res.json({ success: true });
|
|
5541
5707
|
});
|
|
5542
5708
|
app.post("/api/sessions/:id/provider", async (req, res) => {
|
|
5543
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5709
|
+
const { getEventStore: getEventStore2 } = await import("./events-AQKDXJFK.js");
|
|
5544
5710
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-4VHGQE6Y.js");
|
|
5545
5711
|
const sessionId = req.params.id;
|
|
5546
5712
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -5578,7 +5744,7 @@ async function createServerHandle(config) {
|
|
|
5578
5744
|
res.json({ success: true });
|
|
5579
5745
|
});
|
|
5580
5746
|
app.put("/api/sessions/:id/mode", async (req, res) => {
|
|
5581
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5747
|
+
const { getEventStore: getEventStore2 } = await import("./events-AQKDXJFK.js");
|
|
5582
5748
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-4VHGQE6Y.js");
|
|
5583
5749
|
const sessionId = req.params.id;
|
|
5584
5750
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -5631,14 +5797,14 @@ async function createServerHandle(config) {
|
|
|
5631
5797
|
if (!callId || approved === void 0) {
|
|
5632
5798
|
return res.status(400).json({ error: "callId and approved are required" });
|
|
5633
5799
|
}
|
|
5634
|
-
const { providePathConfirmation } = await import("./tools-
|
|
5800
|
+
const { providePathConfirmation } = await import("./tools-7MGUWXDP.js");
|
|
5635
5801
|
const result = providePathConfirmation(callId, approved, alwaysAllow);
|
|
5636
5802
|
if (!result.found) {
|
|
5637
5803
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
5638
5804
|
}
|
|
5639
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5805
|
+
const { getEventStore: getEventStore2 } = await import("./events-AQKDXJFK.js");
|
|
5640
5806
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-4VHGQE6Y.js");
|
|
5641
|
-
const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-
|
|
5807
|
+
const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-QDSVJTRN.js");
|
|
5642
5808
|
const eventStore = getEventStore2();
|
|
5643
5809
|
const events = eventStore.getEvents(sessionId);
|
|
5644
5810
|
const messages = buildMessagesFromStoredEvents2(events);
|
|
@@ -5655,7 +5821,7 @@ async function createServerHandle(config) {
|
|
|
5655
5821
|
if (!callId || !answer) {
|
|
5656
5822
|
return res.status(400).json({ error: "callId and answer are required" });
|
|
5657
5823
|
}
|
|
5658
|
-
const { provideAnswer: provideAnswer2 } = await import("./tools-
|
|
5824
|
+
const { provideAnswer: provideAnswer2 } = await import("./tools-7MGUWXDP.js");
|
|
5659
5825
|
const found = provideAnswer2(callId, answer);
|
|
5660
5826
|
if (!found) {
|
|
5661
5827
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -5691,14 +5857,14 @@ async function createServerHandle(config) {
|
|
|
5691
5857
|
if (!session) {
|
|
5692
5858
|
return res.status(404).json({ error: "Session not found" });
|
|
5693
5859
|
}
|
|
5694
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
5695
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
5860
|
+
const { stopSessionExecution } = await import("./chat-handler-6ATTKNZT.js");
|
|
5861
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-7MGUWXDP.js");
|
|
5696
5862
|
stopSessionExecution(sessionId, sessionManager);
|
|
5697
5863
|
abortSession(sessionId);
|
|
5698
5864
|
cancelQuestionsForSession(sessionId, "Session stopped by user");
|
|
5699
5865
|
cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
|
|
5700
5866
|
sessionManager.clearMessageQueue(sessionId);
|
|
5701
|
-
const eventStore = (await import("./events-
|
|
5867
|
+
const eventStore = (await import("./events-AQKDXJFK.js")).getEventStore();
|
|
5702
5868
|
eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
|
|
5703
5869
|
res.json({ success: true });
|
|
5704
5870
|
});
|
|
@@ -5712,7 +5878,7 @@ async function createServerHandle(config) {
|
|
|
5712
5878
|
if (typeof messageIndex !== "number" || messageIndex < 0) {
|
|
5713
5879
|
return res.status(400).json({ error: "messageIndex must be a non-negative number" });
|
|
5714
5880
|
}
|
|
5715
|
-
const { truncateSessionMessages } = await import("./events-
|
|
5881
|
+
const { truncateSessionMessages } = await import("./events-AQKDXJFK.js");
|
|
5716
5882
|
truncateSessionMessages(sessionId, messageIndex);
|
|
5717
5883
|
res.json({ success: true });
|
|
5718
5884
|
});
|
|
@@ -6181,7 +6347,7 @@ async function createServerHandle(config) {
|
|
|
6181
6347
|
providerManager
|
|
6182
6348
|
);
|
|
6183
6349
|
const wss = wssExports.wss;
|
|
6184
|
-
const { QueueProcessor } = await import("./processor-
|
|
6350
|
+
const { QueueProcessor } = await import("./processor-4SOP4Q6S.js");
|
|
6185
6351
|
const queueProcessor = new QueueProcessor({
|
|
6186
6352
|
sessionManager,
|
|
6187
6353
|
providerManager,
|
|
@@ -6256,4 +6422,4 @@ export {
|
|
|
6256
6422
|
createServerHandle,
|
|
6257
6423
|
createServer
|
|
6258
6424
|
};
|
|
6259
|
-
//# sourceMappingURL=chunk-
|
|
6425
|
+
//# sourceMappingURL=chunk-QPOO2EM6.js.map
|