openfox 2.0.36 → 2.0.37
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/{chat-handler-GZOH45BG.js → chat-handler-HPXOVKUX.js} +8 -8
- package/dist/{chunk-Z3RKDS6H.js → chunk-2G2H4HUO.js} +115 -34
- package/dist/{chunk-OSMUHB5F.js → chunk-55RWNJBT.js} +6 -2
- package/dist/{chunk-QCVPT2LZ.js → chunk-BJPPDLJX.js} +75 -26
- package/dist/{chunk-ZXELI3WY.js → chunk-DAC7YKYW.js} +7 -7
- package/dist/{chunk-6PLAWCHQ.js → chunk-EHYFYQXY.js} +4 -2
- package/dist/{chunk-BGCDJYNU.js → chunk-JGNAYJJZ.js} +6 -5
- package/dist/{chunk-WTDCC4IP.js → chunk-NF6WHQAT.js} +9 -2
- package/dist/{chunk-GIR5N4A3.js → chunk-PKE4MQWI.js} +3 -3
- package/dist/{chunk-U4ZRBCSO.js → chunk-QG2WM7EX.js} +5 -5
- package/dist/{chunk-DHOOJDHX.js → chunk-SM2PK6TV.js} +4 -4
- package/dist/{chunk-ZMONCXGW.js → chunk-WXAOEWJS.js} +3 -3
- package/dist/{chunk-ZJ4FP6RS.js → chunk-Z6W4YHJB.js} +7 -1
- package/dist/{chunk-QYP6MOB5.js → chunk-ZBLT7MNL.js} +2 -2
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{client-X6BVH4Q4.js → client-XTPAYYRH.js} +3 -3
- package/dist/{client-pure-5NOTSIRK.js → client-pure-N2MOIDQ6.js} +2 -2
- package/dist/{compactor-SHEOFZDB.js → compactor-RZA5VSRT.js} +6 -6
- package/dist/{events-YLICLPBY.js → events-KZZPCW2Q.js} +3 -3
- package/dist/{folding-PI67HWBR.js → folding-ENYH4LMG.js} +2 -2
- package/dist/{orchestrator-3WHRUJSV.js → orchestrator-PTKTND5E.js} +7 -7
- package/dist/package.json +1 -1
- package/dist/{processor-3C6MIX7N.js → processor-D6HYPRZD.js} +8 -8
- package/dist/{protocol-BC1QSQ-Y.d.ts → protocol-COpRaEpx.d.ts} +1 -0
- package/dist/{provider-SHGBQRFO.js → provider-ZLMMOORK.js} +4 -4
- package/dist/{provider-manager-5742XBEI.js → provider-manager-GTWFGTCV.js} +4 -4
- package/dist/{serve-3SIVWL3C.js → serve-NGAWODZ2.js} +12 -12
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +11 -11
- package/dist/{server-A5IUSVLK.js → server-K2BDDDL4.js} +10 -10
- package/dist/shared/index.d.ts +2 -2
- package/dist/{tools-FJ63BHW2.js → tools-JPKBLAQ5.js} +6 -6
- package/dist/web/assets/{index-DIvNnXne.css → index-GFd2V-Ja.css} +1 -1
- package/dist/web/assets/{index-tTqXCWKx.js → index-I3ZLVKAn.js} +57 -56
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
buildRunChatTurnParams,
|
|
3
3
|
finalizeTurnCompletion,
|
|
4
4
|
generateSessionNameForSession
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-JGNAYJJZ.js";
|
|
6
6
|
import {
|
|
7
7
|
runChatTurn
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-QG2WM7EX.js";
|
|
9
|
+
import "./chunk-BJPPDLJX.js";
|
|
10
10
|
import "./chunk-DL6ZILAF.js";
|
|
11
11
|
import "./chunk-PBGOZMVY.js";
|
|
12
12
|
import "./chunk-VRGRAQDG.js";
|
|
@@ -19,15 +19,15 @@ import {
|
|
|
19
19
|
import "./chunk-EU3WWTFH.js";
|
|
20
20
|
import "./chunk-JNSSFTVD.js";
|
|
21
21
|
import "./chunk-YQ3SOPBI.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-55RWNJBT.js";
|
|
23
23
|
import {
|
|
24
24
|
getEventStore
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-NF6WHQAT.js";
|
|
26
|
+
import "./chunk-EHYFYQXY.js";
|
|
27
27
|
import "./chunk-ZPIZLTWU.js";
|
|
28
28
|
import "./chunk-J2GP3J3X.js";
|
|
29
29
|
import "./chunk-Z4FMBCJO.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-Z6W4YHJB.js";
|
|
31
31
|
import "./chunk-K44MW7JJ.js";
|
|
32
32
|
import "./chunk-YD6NDTKF.js";
|
|
33
33
|
import "./chunk-PWY6EBZ6.js";
|
|
@@ -145,4 +145,4 @@ export {
|
|
|
145
145
|
startChatSession,
|
|
146
146
|
stopSessionExecution
|
|
147
147
|
};
|
|
148
|
-
//# sourceMappingURL=chat-handler-
|
|
148
|
+
//# sourceMappingURL=chat-handler-HPXOVKUX.js.map
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
tokenFromPassword,
|
|
22
22
|
verifyPassword,
|
|
23
23
|
workflowExists
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-DAC7YKYW.js";
|
|
25
25
|
import {
|
|
26
26
|
agentExists,
|
|
27
27
|
createToolRegistry,
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
setMcpTools,
|
|
62
62
|
setNotifyMcpServersChanged,
|
|
63
63
|
skillExists
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-BJPPDLJX.js";
|
|
65
65
|
import {
|
|
66
66
|
getPathSeparator,
|
|
67
67
|
isAbsolutePath
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
ALWAYS_ALLOWED,
|
|
83
83
|
ALWAYS_ALLOWED_FOR_SUBAGENTS,
|
|
84
84
|
TOP_LEVEL_ONLY_TOOLS
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-55RWNJBT.js";
|
|
86
86
|
import {
|
|
87
87
|
createSession,
|
|
88
88
|
deleteSession,
|
|
@@ -109,14 +109,14 @@ import {
|
|
|
109
109
|
updateSessionMetadata,
|
|
110
110
|
updateSessionProvider,
|
|
111
111
|
updateSessionRunning
|
|
112
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-NF6WHQAT.js";
|
|
113
113
|
import {
|
|
114
114
|
initDatabase
|
|
115
115
|
} from "./chunk-ZPIZLTWU.js";
|
|
116
116
|
import {
|
|
117
117
|
createProviderManager,
|
|
118
118
|
parseDefaultModelSelection
|
|
119
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-SM2PK6TV.js";
|
|
120
120
|
import {
|
|
121
121
|
detectModel,
|
|
122
122
|
getLlmStatus
|
|
@@ -2190,8 +2190,9 @@ var SessionManager = class {
|
|
|
2190
2190
|
}
|
|
2191
2191
|
getCurrentModelSettings() {
|
|
2192
2192
|
const model = this.providerManager.getCurrentModel();
|
|
2193
|
-
|
|
2194
|
-
|
|
2193
|
+
const providerId = this.providerManager.getActiveProviderId();
|
|
2194
|
+
if (!model || !providerId) return void 0;
|
|
2195
|
+
return this.providerManager.getModelSettings(providerId, model);
|
|
2195
2196
|
}
|
|
2196
2197
|
getCurrentModelContext() {
|
|
2197
2198
|
return this.providerManager.getCurrentModelContext();
|
|
@@ -3435,12 +3436,91 @@ function createDirectoryRoutes() {
|
|
|
3435
3436
|
return router;
|
|
3436
3437
|
}
|
|
3437
3438
|
|
|
3438
|
-
// src/server/routes/
|
|
3439
|
+
// src/server/routes/file-search.ts
|
|
3439
3440
|
import { Router as Router6 } from "express";
|
|
3441
|
+
import fg from "fast-glob";
|
|
3442
|
+
function createFileSearchRoutes() {
|
|
3443
|
+
const router = Router6();
|
|
3444
|
+
router.get("/", async (req, res) => {
|
|
3445
|
+
const query = req.query["q"] || "";
|
|
3446
|
+
const workdir = req.query["workdir"] || process.cwd();
|
|
3447
|
+
try {
|
|
3448
|
+
const results = await searchFiles(query, workdir);
|
|
3449
|
+
res.json(results);
|
|
3450
|
+
} catch {
|
|
3451
|
+
res.status(500).json({ error: "File search failed" });
|
|
3452
|
+
}
|
|
3453
|
+
});
|
|
3454
|
+
return router;
|
|
3455
|
+
}
|
|
3456
|
+
async function searchFiles(query, workdir) {
|
|
3457
|
+
const entries = await fg(["**/*"], {
|
|
3458
|
+
cwd: workdir,
|
|
3459
|
+
dot: true,
|
|
3460
|
+
deep: 5,
|
|
3461
|
+
onlyFiles: false,
|
|
3462
|
+
ignore: [
|
|
3463
|
+
"**/node_modules/**",
|
|
3464
|
+
"**/.git/**",
|
|
3465
|
+
"**/dist/**",
|
|
3466
|
+
"**/.next/**",
|
|
3467
|
+
"**/.cache/**",
|
|
3468
|
+
"**/__pycache__/**",
|
|
3469
|
+
"**/*.lock",
|
|
3470
|
+
"**/.openfox/**"
|
|
3471
|
+
],
|
|
3472
|
+
objectMode: true
|
|
3473
|
+
});
|
|
3474
|
+
const scored = [];
|
|
3475
|
+
for (const entry of entries) {
|
|
3476
|
+
const filePath = entry.path;
|
|
3477
|
+
let score = fuzzyScore(filePath, query);
|
|
3478
|
+
if (score === 0) {
|
|
3479
|
+
continue;
|
|
3480
|
+
}
|
|
3481
|
+
const isDir = entry.dirent.isDirectory();
|
|
3482
|
+
if (isDir) {
|
|
3483
|
+
score += 10;
|
|
3484
|
+
}
|
|
3485
|
+
scored.push({
|
|
3486
|
+
path: filePath,
|
|
3487
|
+
name: filePath.split("/").pop() || filePath,
|
|
3488
|
+
type: isDir ? "directory" : "file",
|
|
3489
|
+
score
|
|
3490
|
+
});
|
|
3491
|
+
}
|
|
3492
|
+
scored.sort((a, b) => b.score - a.score);
|
|
3493
|
+
return scored.slice(0, 20);
|
|
3494
|
+
}
|
|
3495
|
+
function fuzzyScore(filePath, query) {
|
|
3496
|
+
if (!query) {
|
|
3497
|
+
return 1;
|
|
3498
|
+
}
|
|
3499
|
+
const fileName = filePath.split("/").pop() || filePath;
|
|
3500
|
+
const fileNameLower = fileName.toLowerCase();
|
|
3501
|
+
const fullPathLower = filePath.toLowerCase();
|
|
3502
|
+
const lowerQuery = query.toLowerCase();
|
|
3503
|
+
if (fileNameLower === lowerQuery) {
|
|
3504
|
+
return 100;
|
|
3505
|
+
}
|
|
3506
|
+
if (fileNameLower.startsWith(lowerQuery)) {
|
|
3507
|
+
return 80;
|
|
3508
|
+
}
|
|
3509
|
+
if (fileNameLower.includes(lowerQuery)) {
|
|
3510
|
+
return 60;
|
|
3511
|
+
}
|
|
3512
|
+
if (fullPathLower.includes(lowerQuery)) {
|
|
3513
|
+
return 40;
|
|
3514
|
+
}
|
|
3515
|
+
return 0;
|
|
3516
|
+
}
|
|
3517
|
+
|
|
3518
|
+
// src/server/routes/auto-update.ts
|
|
3519
|
+
import { Router as Router7 } from "express";
|
|
3440
3520
|
import { spawn as spawn2 } from "child_process";
|
|
3441
3521
|
|
|
3442
3522
|
// src/constants.ts
|
|
3443
|
-
var VERSION = "2.0.
|
|
3523
|
+
var VERSION = "2.0.37";
|
|
3444
3524
|
|
|
3445
3525
|
// src/server/routes/auto-update.ts
|
|
3446
3526
|
var updateInProgress = false;
|
|
@@ -3458,7 +3538,7 @@ async function checkAuth(req, opts) {
|
|
|
3458
3538
|
return true;
|
|
3459
3539
|
}
|
|
3460
3540
|
function createAutoUpdateRoutes(options = {}) {
|
|
3461
|
-
const router =
|
|
3541
|
+
const router = Router7();
|
|
3462
3542
|
router.get("/check", async (_req, res) => {
|
|
3463
3543
|
const isService = isRunningAsService();
|
|
3464
3544
|
const current = VERSION;
|
|
@@ -3620,7 +3700,7 @@ async function createServerHandle(config4) {
|
|
|
3620
3700
|
setMcpTools(mcpTools);
|
|
3621
3701
|
logger.info("MCP tools registered", { count: mcpTools.length });
|
|
3622
3702
|
}
|
|
3623
|
-
const { signalMcpReady } = await import("./server-
|
|
3703
|
+
const { signalMcpReady } = await import("./server-K2BDDDL4.js");
|
|
3624
3704
|
signalMcpReady();
|
|
3625
3705
|
});
|
|
3626
3706
|
const app = express();
|
|
@@ -3778,7 +3858,7 @@ async function createServerHandle(config4) {
|
|
|
3778
3858
|
res.json({ project });
|
|
3779
3859
|
});
|
|
3780
3860
|
app.get("/api/sessions", async (req, res) => {
|
|
3781
|
-
const { getRecentUserPromptsForSession } = await import("./events-
|
|
3861
|
+
const { getRecentUserPromptsForSession } = await import("./events-KZZPCW2Q.js");
|
|
3782
3862
|
const projectId = req.query["projectId"];
|
|
3783
3863
|
const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
|
|
3784
3864
|
const offset = parseInt(req.query["offset"]) || 0;
|
|
@@ -3811,9 +3891,9 @@ async function createServerHandle(config4) {
|
|
|
3811
3891
|
res.status(201).json({ session });
|
|
3812
3892
|
});
|
|
3813
3893
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
3814
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
3815
|
-
const { buildMessagesFromStoredEvents } = await import("./folding-
|
|
3816
|
-
const { getPendingQuestionsForSession } = await import("./tools-
|
|
3894
|
+
const { getEventStore: getEventStore2 } = await import("./events-KZZPCW2Q.js");
|
|
3895
|
+
const { buildMessagesFromStoredEvents } = await import("./folding-ENYH4LMG.js");
|
|
3896
|
+
const { getPendingQuestionsForSession } = await import("./tools-JPKBLAQ5.js");
|
|
3817
3897
|
const session = sessionManager.getSession(req.params.id);
|
|
3818
3898
|
if (!session) {
|
|
3819
3899
|
return res.status(404).json({ error: "Session not found" });
|
|
@@ -3844,8 +3924,8 @@ async function createServerHandle(config4) {
|
|
|
3844
3924
|
res.json({ success: true });
|
|
3845
3925
|
});
|
|
3846
3926
|
app.post("/api/sessions/:id/provider", async (req, res) => {
|
|
3847
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
3848
|
-
const { buildMessagesFromStoredEvents } = await import("./folding-
|
|
3927
|
+
const { getEventStore: getEventStore2 } = await import("./events-KZZPCW2Q.js");
|
|
3928
|
+
const { buildMessagesFromStoredEvents } = await import("./folding-ENYH4LMG.js");
|
|
3849
3929
|
const sessionId = req.params.id;
|
|
3850
3930
|
const session = sessionManager.getSession(sessionId);
|
|
3851
3931
|
if (!session) {
|
|
@@ -3907,8 +3987,8 @@ async function createServerHandle(config4) {
|
|
|
3907
3987
|
res.json({ success: true });
|
|
3908
3988
|
});
|
|
3909
3989
|
app.put("/api/sessions/:id/mode", async (req, res) => {
|
|
3910
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
3911
|
-
const { buildMessagesFromStoredEvents } = await import("./folding-
|
|
3990
|
+
const { getEventStore: getEventStore2 } = await import("./events-KZZPCW2Q.js");
|
|
3991
|
+
const { buildMessagesFromStoredEvents } = await import("./folding-ENYH4LMG.js");
|
|
3912
3992
|
const sessionId = req.params.id;
|
|
3913
3993
|
const session = sessionManager.getSession(sessionId);
|
|
3914
3994
|
if (!session) {
|
|
@@ -3964,15 +4044,15 @@ async function createServerHandle(config4) {
|
|
|
3964
4044
|
if (!callId || approved === void 0) {
|
|
3965
4045
|
return res.status(400).json({ error: "callId and approved are required" });
|
|
3966
4046
|
}
|
|
3967
|
-
const { providePathConfirmation } = await import("./tools-
|
|
4047
|
+
const { providePathConfirmation } = await import("./tools-JPKBLAQ5.js");
|
|
3968
4048
|
const result = providePathConfirmation(callId, approved, alwaysAllow);
|
|
3969
4049
|
if (!result.found) {
|
|
3970
4050
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
3971
4051
|
}
|
|
3972
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
3973
|
-
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-
|
|
4052
|
+
const { getEventStore: getEventStore2 } = await import("./events-KZZPCW2Q.js");
|
|
4053
|
+
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-ENYH4LMG.js");
|
|
3974
4054
|
const { createSessionStateMessage } = await import("./protocol-BKNLAEPJ.js");
|
|
3975
|
-
const { getPendingQuestionsForSession } = await import("./tools-
|
|
4055
|
+
const { getPendingQuestionsForSession } = await import("./tools-JPKBLAQ5.js");
|
|
3976
4056
|
const eventStore = getEventStore2();
|
|
3977
4057
|
const events = eventStore.getEvents(sessionId);
|
|
3978
4058
|
const messages = buildMessagesFromStoredEvents(events);
|
|
@@ -3993,7 +4073,7 @@ async function createServerHandle(config4) {
|
|
|
3993
4073
|
if (!skip && typeof answer !== "string") {
|
|
3994
4074
|
return res.status(400).json({ error: "answer is required when not skipping" });
|
|
3995
4075
|
}
|
|
3996
|
-
const { provideAnswer } = await import("./tools-
|
|
4076
|
+
const { provideAnswer } = await import("./tools-JPKBLAQ5.js");
|
|
3997
4077
|
const found = provideAnswer(callId, answer ?? "", skip ?? false);
|
|
3998
4078
|
if (!found) {
|
|
3999
4079
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -4029,15 +4109,15 @@ async function createServerHandle(config4) {
|
|
|
4029
4109
|
if (!session) {
|
|
4030
4110
|
return res.status(404).json({ error: "Session not found" });
|
|
4031
4111
|
}
|
|
4032
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
4033
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
4112
|
+
const { stopSessionExecution } = await import("./chat-handler-HPXOVKUX.js");
|
|
4113
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-JPKBLAQ5.js");
|
|
4034
4114
|
const queuedMessages = sessionManager.getQueueState(sessionId);
|
|
4035
4115
|
sessionManager.clearMessageQueue(sessionId);
|
|
4036
4116
|
stopSessionExecution(sessionId, sessionManager);
|
|
4037
4117
|
abortSession(sessionId);
|
|
4038
4118
|
cancelQuestionsForSession(sessionId, "Session stopped by user");
|
|
4039
4119
|
cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
|
|
4040
|
-
const eventStore = (await import("./events-
|
|
4120
|
+
const eventStore = (await import("./events-KZZPCW2Q.js")).getEventStore();
|
|
4041
4121
|
eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
|
|
4042
4122
|
res.json({ success: true, queuedMessages });
|
|
4043
4123
|
});
|
|
@@ -4051,7 +4131,7 @@ async function createServerHandle(config4) {
|
|
|
4051
4131
|
if (typeof messageIndex !== "number" || messageIndex < 0) {
|
|
4052
4132
|
return res.status(400).json({ error: "messageIndex must be a non-negative number" });
|
|
4053
4133
|
}
|
|
4054
|
-
const { truncateSessionMessages } = await import("./events-
|
|
4134
|
+
const { truncateSessionMessages } = await import("./events-KZZPCW2Q.js");
|
|
4055
4135
|
truncateSessionMessages(sessionId, messageIndex);
|
|
4056
4136
|
res.json({ success: true });
|
|
4057
4137
|
});
|
|
@@ -4069,7 +4149,7 @@ async function createServerHandle(config4) {
|
|
|
4069
4149
|
if (!msg) {
|
|
4070
4150
|
return res.status(400).json({ error: "Message not found at this index" });
|
|
4071
4151
|
}
|
|
4072
|
-
const { truncateSessionMessages } = await import("./events-
|
|
4152
|
+
const { truncateSessionMessages } = await import("./events-KZZPCW2Q.js");
|
|
4073
4153
|
truncateSessionMessages(sessionId, messageIndex - 1);
|
|
4074
4154
|
sessionManager.queueMessage(sessionId, "asap", msg.content, msg.attachments, msg.messageKind);
|
|
4075
4155
|
res.json({ success: true });
|
|
@@ -4238,7 +4318,7 @@ async function createServerHandle(config4) {
|
|
|
4238
4318
|
const apiKey = req.query["apiKey"];
|
|
4239
4319
|
if (!url) return res.status(400).json({ error: "url is required" });
|
|
4240
4320
|
try {
|
|
4241
|
-
const { fetchModelsWithContext } = await import("./provider-manager-
|
|
4321
|
+
const { fetchModelsWithContext } = await import("./provider-manager-GTWFGTCV.js");
|
|
4242
4322
|
const models = await fetchModelsWithContext(url, apiKey);
|
|
4243
4323
|
if (models.length === 0) {
|
|
4244
4324
|
return res.status(404).json({ error: `No models found at ${buildModelsUrl(url)}`, url });
|
|
@@ -4286,7 +4366,7 @@ async function createServerHandle(config4) {
|
|
|
4286
4366
|
try {
|
|
4287
4367
|
const { getModelProfile: getModelProfile2 } = await import("./profiles-Q36ELWQF.js");
|
|
4288
4368
|
const { getBackendCapabilities } = await import("./backend-AGXWAU7A.js");
|
|
4289
|
-
const { buildNonStreamingCreateParams } = await import("./client-pure-
|
|
4369
|
+
const { buildNonStreamingCreateParams } = await import("./client-pure-N2MOIDQ6.js");
|
|
4290
4370
|
const { OpenAIHttpClient } = await import("./http-client-SIPAW7IM.js");
|
|
4291
4371
|
const { ensureVersionPrefix } = await import("./url-utils-QWAHP54Q.js");
|
|
4292
4372
|
const profile = getModelProfile2(model);
|
|
@@ -4526,7 +4606,7 @@ async function createServerHandle(config4) {
|
|
|
4526
4606
|
});
|
|
4527
4607
|
async function rebuildMcpTools() {
|
|
4528
4608
|
const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-B7QP6NLA.js");
|
|
4529
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
4609
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-JPKBLAQ5.js");
|
|
4530
4610
|
const mcpTools = createMcpTools2(mcpManager);
|
|
4531
4611
|
setMcpTools2(mcpTools);
|
|
4532
4612
|
}
|
|
@@ -4710,6 +4790,7 @@ async function createServerHandle(config4) {
|
|
|
4710
4790
|
await getCurrentBranch(req, res);
|
|
4711
4791
|
});
|
|
4712
4792
|
app.use("/api/directories", createDirectoryRoutes());
|
|
4793
|
+
app.use("/api/files", createFileSearchRoutes());
|
|
4713
4794
|
const webDir = resolve3(__dirname3, "../../web");
|
|
4714
4795
|
const isDev = config4.mode === "development";
|
|
4715
4796
|
let viteServer;
|
|
@@ -4838,7 +4919,7 @@ async function createServerHandle(config4) {
|
|
|
4838
4919
|
const state = sessionManager.getContextState(sessionId);
|
|
4839
4920
|
wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
|
|
4840
4921
|
});
|
|
4841
|
-
const { QueueProcessor } = await import("./processor-
|
|
4922
|
+
const { QueueProcessor } = await import("./processor-D6HYPRZD.js");
|
|
4842
4923
|
const queueProcessor = new QueueProcessor({
|
|
4843
4924
|
sessionManager,
|
|
4844
4925
|
providerManager,
|
|
@@ -4913,4 +4994,4 @@ export {
|
|
|
4913
4994
|
createServerHandle,
|
|
4914
4995
|
createServer
|
|
4915
4996
|
};
|
|
4916
|
-
//# sourceMappingURL=chunk-
|
|
4997
|
+
//# sourceMappingURL=chunk-2G2H4HUO.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-Z4FMBCJO.js";
|
|
7
7
|
import {
|
|
8
8
|
buildModelParams
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Z6W4YHJB.js";
|
|
10
10
|
import {
|
|
11
11
|
logger
|
|
12
12
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -69,6 +69,10 @@ Platform: ${process.platform} (${process.arch})${modelLine}
|
|
|
69
69
|
- If the current runtime reminder says build mode, focus on implementation, verification, and completing approved criteria.
|
|
70
70
|
- Respect tool and permission constraints enforced by the server even if the conversation suggests otherwise.
|
|
71
71
|
|
|
72
|
+
## FILE REFERENCES
|
|
73
|
+
- The user may reference files or directories with an @ prefix, e.g. @src/index.ts or @web/components/.
|
|
74
|
+
- These are paths relative to the working directory above. Strip the leading @ and resolve against the working directory \u2014 never treat an @-reference as an absolute path.
|
|
75
|
+
|
|
72
76
|
## IMPORTANT GUARDRAILS
|
|
73
77
|
- NEVER delete/git checkout an already modified file: that would result in a data loss.
|
|
74
78
|
|
|
@@ -701,4 +705,4 @@ export {
|
|
|
701
705
|
createChatDoneEvent,
|
|
702
706
|
consumeStreamGenerator
|
|
703
707
|
};
|
|
704
|
-
//# sourceMappingURL=chunk-
|
|
708
|
+
//# sourceMappingURL=chunk-55RWNJBT.js.map
|
|
@@ -49,13 +49,13 @@ import {
|
|
|
49
49
|
createToolCallEvent,
|
|
50
50
|
createToolResultEvent,
|
|
51
51
|
streamLLMPure
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-55RWNJBT.js";
|
|
53
53
|
import {
|
|
54
54
|
getCurrentContextWindowId,
|
|
55
55
|
getCurrentWindowMessageOptions,
|
|
56
56
|
getEventStore,
|
|
57
57
|
getRuntimeConfig
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-NF6WHQAT.js";
|
|
59
59
|
import {
|
|
60
60
|
buildContextMessagesFromEventHistory,
|
|
61
61
|
foldContextState,
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
handleToolCall,
|
|
65
65
|
handleToolResult,
|
|
66
66
|
stripOrphanedToolCalls
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-EHYFYQXY.js";
|
|
68
68
|
import {
|
|
69
69
|
logger
|
|
70
70
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -2581,7 +2581,7 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
|
|
|
2581
2581
|
sessionManager.setCurrentContextSize(sessionId, result.usage.promptTokens);
|
|
2582
2582
|
if (!compacting) {
|
|
2583
2583
|
const contextState2 = sessionManager.getContextState(sessionId);
|
|
2584
|
-
const { shouldCompact, appendCompactionPrompt } = await import("./compactor-
|
|
2584
|
+
const { shouldCompact, appendCompactionPrompt } = await import("./compactor-RZA5VSRT.js");
|
|
2585
2585
|
if (shouldCompact(contextState2.currentTokens, contextState2.maxTokens, runtimeConfig.context.compactionThreshold)) {
|
|
2586
2586
|
appendCompactionPrompt(sessionId, append);
|
|
2587
2587
|
compacting = true;
|
|
@@ -2969,12 +2969,6 @@ function hasImageMetadata(result) {
|
|
|
2969
2969
|
const mimeType = meta["mimeType"];
|
|
2970
2970
|
return typeof dataUrl === "string" && typeof mimeType === "string" && mimeType.startsWith("image/");
|
|
2971
2971
|
}
|
|
2972
|
-
function buildImageDescription(filename, description) {
|
|
2973
|
-
return `[Image: ${filename || "image"} - description: ${description}]`;
|
|
2974
|
-
}
|
|
2975
|
-
function buildImagePlaceholder(filename) {
|
|
2976
|
-
return `[Image: ${filename || "image"}]`;
|
|
2977
|
-
}
|
|
2978
2972
|
async function describeAttachment(att, messageId, options, descriptions) {
|
|
2979
2973
|
const cacheKey = contentHash(att.data);
|
|
2980
2974
|
if (descriptionCache.has(cacheKey)) {
|
|
@@ -3000,7 +2994,7 @@ async function describeAttachment(att, messageId, options, descriptions) {
|
|
|
3000
2994
|
options.onEvent?.({ type: "vision_fallback.done", data: { messageId, attachmentId: att.id, description } });
|
|
3001
2995
|
return description;
|
|
3002
2996
|
}
|
|
3003
|
-
const placeholder =
|
|
2997
|
+
const placeholder = `[Image: ${att.filename || "image"}]`;
|
|
3004
2998
|
descriptions.set(att.id, placeholder);
|
|
3005
2999
|
return placeholder;
|
|
3006
3000
|
}
|
|
@@ -3032,7 +3026,7 @@ async function describeToolResultImage(dataUrl, filename, toolCallId, messageId,
|
|
|
3032
3026
|
});
|
|
3033
3027
|
return description;
|
|
3034
3028
|
}
|
|
3035
|
-
const placeholder =
|
|
3029
|
+
const placeholder = `[Image: ${filename || "image"}]`;
|
|
3036
3030
|
descriptions.set(toolCallId, placeholder);
|
|
3037
3031
|
return placeholder;
|
|
3038
3032
|
}
|
|
@@ -3048,20 +3042,28 @@ async function processContextImages(events, options) {
|
|
|
3048
3042
|
if (!data.attachments || data.attachments.length === 0) continue;
|
|
3049
3043
|
const imageAtts = data.attachments.filter(isImageAttachment);
|
|
3050
3044
|
if (imageAtts.length === 0) continue;
|
|
3051
|
-
let
|
|
3045
|
+
let enriched = false;
|
|
3052
3046
|
for (const att of imageAtts) {
|
|
3047
|
+
if (att.description) {
|
|
3048
|
+
descriptions.set(att.id, att.description);
|
|
3049
|
+
continue;
|
|
3050
|
+
}
|
|
3053
3051
|
const description = await describeAttachment(att, data.messageId, options, descriptions);
|
|
3054
|
-
|
|
3055
|
-
|
|
3052
|
+
att.description = description;
|
|
3053
|
+
enriched = true;
|
|
3054
|
+
}
|
|
3055
|
+
if (enriched && options.persistEvent) {
|
|
3056
|
+
options.persistEvent(event.sessionId, event.seq, data);
|
|
3056
3057
|
}
|
|
3057
|
-
;
|
|
3058
|
-
data.content = content;
|
|
3059
|
-
delete data.attachments;
|
|
3060
3058
|
}
|
|
3061
3059
|
if (event.type === "tool.result") {
|
|
3062
3060
|
const data = event.data;
|
|
3063
3061
|
if (!data.result.metadata || !hasImageMetadata(data.result)) continue;
|
|
3064
3062
|
const meta = data.result.metadata;
|
|
3063
|
+
if (meta["description"]) {
|
|
3064
|
+
descriptions.set(data.toolCallId, meta["description"]);
|
|
3065
|
+
continue;
|
|
3066
|
+
}
|
|
3065
3067
|
const dataUrl = meta["dataUrl"];
|
|
3066
3068
|
const path = meta["path"];
|
|
3067
3069
|
const description = await describeToolResultImage(
|
|
@@ -3072,8 +3074,54 @@ ${buildImageDescription(att.filename, description)}`;
|
|
|
3072
3074
|
options,
|
|
3073
3075
|
descriptions
|
|
3074
3076
|
);
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
+
meta["description"] = description;
|
|
3078
|
+
if (options.persistEvent) {
|
|
3079
|
+
options.persistEvent(event.sessionId, event.seq, data);
|
|
3080
|
+
}
|
|
3081
|
+
}
|
|
3082
|
+
if (event.type === "turn.snapshot") {
|
|
3083
|
+
const snapshot = event.data;
|
|
3084
|
+
let enriched = false;
|
|
3085
|
+
for (const message of snapshot.messages) {
|
|
3086
|
+
if (message.role === "user" && message.attachments && message.attachments.length > 0) {
|
|
3087
|
+
const imageAtts = message.attachments.filter(isImageAttachment);
|
|
3088
|
+
if (imageAtts.length === 0) continue;
|
|
3089
|
+
for (const att of imageAtts) {
|
|
3090
|
+
if (att.description) {
|
|
3091
|
+
descriptions.set(att.id, att.description);
|
|
3092
|
+
continue;
|
|
3093
|
+
}
|
|
3094
|
+
const description = await describeAttachment(att, message.id, options, descriptions);
|
|
3095
|
+
att.description = description;
|
|
3096
|
+
enriched = true;
|
|
3097
|
+
}
|
|
3098
|
+
}
|
|
3099
|
+
if (message.role === "assistant" && message.toolCalls) {
|
|
3100
|
+
for (const toolCall of message.toolCalls) {
|
|
3101
|
+
if (!toolCall.result || !toolCall.result.metadata || !hasImageMetadata(toolCall.result)) continue;
|
|
3102
|
+
const meta = toolCall.result.metadata;
|
|
3103
|
+
if (meta["description"]) {
|
|
3104
|
+
descriptions.set(toolCall.id, meta["description"]);
|
|
3105
|
+
continue;
|
|
3106
|
+
}
|
|
3107
|
+
const dataUrl = meta["dataUrl"];
|
|
3108
|
+
const path = meta["path"];
|
|
3109
|
+
const description = await describeToolResultImage(
|
|
3110
|
+
dataUrl,
|
|
3111
|
+
path,
|
|
3112
|
+
toolCall.id,
|
|
3113
|
+
message.id,
|
|
3114
|
+
options,
|
|
3115
|
+
descriptions
|
|
3116
|
+
);
|
|
3117
|
+
meta["description"] = description;
|
|
3118
|
+
enriched = true;
|
|
3119
|
+
}
|
|
3120
|
+
}
|
|
3121
|
+
}
|
|
3122
|
+
if (enriched && options.persistEvent) {
|
|
3123
|
+
options.persistEvent(event.sessionId, event.seq, snapshot);
|
|
3124
|
+
}
|
|
3077
3125
|
}
|
|
3078
3126
|
}
|
|
3079
3127
|
return { events: modifiedEvents, descriptions };
|
|
@@ -3195,7 +3243,8 @@ async function processEventsForConversation(sessionId, llmClient, onEvent) {
|
|
|
3195
3243
|
const { events: processedEvents } = await processContextImages(rawEvents, {
|
|
3196
3244
|
modelSupportsVision: modelVision,
|
|
3197
3245
|
...visionModel ? { visionModel } : {},
|
|
3198
|
-
onEvent
|
|
3246
|
+
onEvent,
|
|
3247
|
+
persistEvent: (sid, seq, data) => eventStore.updateEventPayload(sid, seq, data)
|
|
3199
3248
|
});
|
|
3200
3249
|
return processedEvents;
|
|
3201
3250
|
}
|
|
@@ -3403,7 +3452,7 @@ var callSubAgentTool = {
|
|
|
3403
3452
|
};
|
|
3404
3453
|
}
|
|
3405
3454
|
try {
|
|
3406
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
3455
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-JPKBLAQ5.js");
|
|
3407
3456
|
const toolRegistry = getToolRegistryForAgent2(agentDef);
|
|
3408
3457
|
const turnMetrics = new TurnMetrics();
|
|
3409
3458
|
const result = await executeSubAgent({
|
|
@@ -4219,7 +4268,7 @@ function resolveAgentDef2(sessionManager, sessionId) {
|
|
|
4219
4268
|
}
|
|
4220
4269
|
async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
|
|
4221
4270
|
const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
|
|
4222
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
4271
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-JPKBLAQ5.js");
|
|
4223
4272
|
const tools = getToolRegistryForAgent2(agentDef).definitions;
|
|
4224
4273
|
const toolFingerprint = getToolFingerprint(tools);
|
|
4225
4274
|
const allAgents = await loadAllAgentsDefault();
|
|
@@ -4232,7 +4281,7 @@ async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
|
|
|
4232
4281
|
async function computeSessionHash(sessionManager, sessionId) {
|
|
4233
4282
|
const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
|
|
4234
4283
|
const agentDef = await resolveAgentDef2(sessionManager, sessionId);
|
|
4235
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
4284
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-JPKBLAQ5.js");
|
|
4236
4285
|
const tools = getToolRegistryForAgent2(agentDef).definitions;
|
|
4237
4286
|
const toolFingerprint = getToolFingerprint(tools);
|
|
4238
4287
|
return computeDynamicContextHash(instructionContent, skills, toolFingerprint);
|
|
@@ -4339,7 +4388,7 @@ var mcpConfigTool = createTool(
|
|
|
4339
4388
|
await saveGlobalConfig(mcpConfigMode, { ...globalConfig, mcpServers: updated });
|
|
4340
4389
|
}
|
|
4341
4390
|
async function rebuildTools() {
|
|
4342
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
4391
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-JPKBLAQ5.js");
|
|
4343
4392
|
const mcpTools = createMcpTools(mcpManagerForTools);
|
|
4344
4393
|
setMcpTools2(mcpTools);
|
|
4345
4394
|
}
|
|
@@ -4743,4 +4792,4 @@ export {
|
|
|
4743
4792
|
getToolRegistryForAgent,
|
|
4744
4793
|
createToolRegistry
|
|
4745
4794
|
};
|
|
4746
|
-
//# sourceMappingURL=chunk-
|
|
4795
|
+
//# sourceMappingURL=chunk-BJPPDLJX.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
injectWorkflowKickoffIfNeeded,
|
|
3
3
|
runAgentTurn,
|
|
4
4
|
runChatTurn
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-QG2WM7EX.js";
|
|
6
6
|
import {
|
|
7
7
|
applyDynamicContext,
|
|
8
8
|
checkAborted,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
loadAllAgentsDefault,
|
|
17
17
|
saveItemToDir,
|
|
18
18
|
spawnShellProcess
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-BJPPDLJX.js";
|
|
20
20
|
import {
|
|
21
21
|
getPlatformShell,
|
|
22
22
|
onProcessEvent
|
|
@@ -40,19 +40,19 @@ import {
|
|
|
40
40
|
} from "./chunk-EU3WWTFH.js";
|
|
41
41
|
import {
|
|
42
42
|
appendCompactionPrompt
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-WXAOEWJS.js";
|
|
44
44
|
import {
|
|
45
45
|
TurnMetrics,
|
|
46
46
|
createMessageStartEvent
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-55RWNJBT.js";
|
|
48
48
|
import {
|
|
49
49
|
getCurrentContextWindowId,
|
|
50
50
|
getEventStore,
|
|
51
51
|
getRuntimeConfig
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-NF6WHQAT.js";
|
|
53
53
|
import {
|
|
54
54
|
createLLMClient
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-ZBLT7MNL.js";
|
|
56
56
|
import {
|
|
57
57
|
ensureVersionPrefix
|
|
58
58
|
} from "./chunk-HNCM3D7Y.js";
|
|
@@ -2056,4 +2056,4 @@ export {
|
|
|
2056
2056
|
signalMcpReady,
|
|
2057
2057
|
createWebSocketServer
|
|
2058
2058
|
};
|
|
2059
|
-
//# sourceMappingURL=chunk-
|
|
2059
|
+
//# sourceMappingURL=chunk-DAC7YKYW.js.map
|
|
@@ -396,13 +396,15 @@ Error: ${data.result.error}` : `Error: ${data.result.error}`
|
|
|
396
396
|
toolCallId: data.toolCallId
|
|
397
397
|
};
|
|
398
398
|
if (imageMeta?.dataUrl && imageMeta?.mimeType?.startsWith("image/")) {
|
|
399
|
+
const description = imageMeta["description"];
|
|
399
400
|
toolMsg.attachments = [
|
|
400
401
|
{
|
|
401
402
|
id: crypto.randomUUID(),
|
|
402
403
|
filename: imageMeta.path ?? "image",
|
|
403
404
|
mimeType: imageMeta.mimeType,
|
|
404
405
|
size: imageMeta.size ?? 0,
|
|
405
|
-
data: imageMeta.dataUrl
|
|
406
|
+
data: imageMeta.dataUrl,
|
|
407
|
+
...typeof description === "string" ? { description } : {}
|
|
406
408
|
}
|
|
407
409
|
];
|
|
408
410
|
}
|
|
@@ -831,4 +833,4 @@ export {
|
|
|
831
833
|
buildSnapshot,
|
|
832
834
|
buildSnapshotFromSessionState
|
|
833
835
|
};
|
|
834
|
-
//# sourceMappingURL=chunk-
|
|
836
|
+
//# sourceMappingURL=chunk-EHYFYQXY.js.map
|