openfox 2.0.26 → 2.0.28
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-C4HZJNUN.js → chat-handler-5ZJY4XN6.js} +7 -7
- package/dist/{chunk-YBPRGUAE.js → chunk-AETO4TMN.js} +48 -40
- package/dist/{chunk-SNQT7LNU.js → chunk-BW6DQC2L.js} +5 -23
- package/dist/{chunk-YRRUHP4T.js → chunk-D7ODVXBQ.js} +6 -6
- package/dist/{chunk-GBUP7UDI.js → chunk-DHOOJDHX.js} +14 -17
- package/dist/{chunk-K454WU7A.js → chunk-ERNIKY6J.js} +9 -9
- package/dist/{chunk-DW55I7SI.js → chunk-IONBIUBB.js} +8 -8
- package/dist/{chunk-YBWY4DKY.js → chunk-M7M2VH45.js} +2 -2
- package/dist/{chunk-YGSBVKFU.js → chunk-SS3F2VYF.js} +2 -1
- package/dist/{chunk-WEXW7ZXJ.js → chunk-SSWRM5BT.js} +3 -3
- package/dist/{chunk-VI236SOY.js → chunk-UHWRWFLE.js} +2 -2
- package/dist/{chunk-7H4PYZMT.js → chunk-WTO2M2JL.js} +4 -4
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{compactor-JMGSZ4DQ.js → compactor-BN5IDIVR.js} +4 -4
- package/dist/{config-Z66BQTNX.js → config-OV5OLKOC.js} +2 -2
- package/dist/{events-JKPHAR5W.js → events-F5IURVXP.js} +2 -2
- package/dist/{orchestrator-HZX3IETX.js → orchestrator-I4QEUXG3.js} +6 -6
- package/dist/package.json +1 -1
- package/dist/{processor-AX2QQWUX.js → processor-2GN5MJHI.js} +7 -7
- package/dist/{provider-XRTIWMB6.js → provider-AHIVZZI5.js} +4 -4
- package/dist/{provider-manager-4H4VGNYA.js → provider-manager-5742XBEI.js} +2 -2
- package/dist/{serve-NVFK3XHF.js → serve-O47BL4WX.js} +11 -11
- package/dist/server/index.js +9 -9
- package/dist/{server-7MFV467L.js → server-LNEF4YAD.js} +8 -8
- package/dist/{tools-4KGLCQJL.js → tools-EHUIRZFG.js} +5 -5
- package/dist/web/assets/{index-CtG8oo36.js → index-CjZhNP1p.js} +31 -31
- package/dist/web/index.html +1 -1
- 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-UHWRWFLE.js";
|
|
6
6
|
import {
|
|
7
7
|
runChatTurn
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-WTO2M2JL.js";
|
|
9
|
+
import "./chunk-ERNIKY6J.js";
|
|
10
10
|
import "./chunk-DL6ZILAF.js";
|
|
11
11
|
import "./chunk-PBGOZMVY.js";
|
|
12
12
|
import "./chunk-VRGRAQDG.js";
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
import "./chunk-EU3WWTFH.js";
|
|
20
20
|
import "./chunk-RFNEDBVO.js";
|
|
21
21
|
import "./chunk-O4TED6AJ.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-SS3F2VYF.js";
|
|
23
23
|
import {
|
|
24
24
|
getEventStore
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-M7M2VH45.js";
|
|
26
26
|
import "./chunk-6PLAWCHQ.js";
|
|
27
27
|
import "./chunk-FBGWG4N6.js";
|
|
28
28
|
import "./chunk-J2GP3J3X.js";
|
|
@@ -30,7 +30,7 @@ import "./chunk-Z4FMBCJO.js";
|
|
|
30
30
|
import "./chunk-ZJ4FP6RS.js";
|
|
31
31
|
import "./chunk-K44MW7JJ.js";
|
|
32
32
|
import "./chunk-YD6NDTKF.js";
|
|
33
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-BW6DQC2L.js";
|
|
34
34
|
import "./chunk-CQGTEGKL.js";
|
|
35
35
|
import "./chunk-V4IE7HJY.js";
|
|
36
36
|
|
|
@@ -145,4 +145,4 @@ export {
|
|
|
145
145
|
startChatSession,
|
|
146
146
|
stopSessionExecution
|
|
147
147
|
};
|
|
148
|
-
//# sourceMappingURL=chat-handler-
|
|
148
|
+
//# sourceMappingURL=chat-handler-5ZJY4XN6.js.map
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
tokenFromPassword,
|
|
22
22
|
verifyPassword,
|
|
23
23
|
workflowExists
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-IONBIUBB.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-ERNIKY6J.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-SS3F2VYF.js";
|
|
86
86
|
import {
|
|
87
87
|
createSession,
|
|
88
88
|
deleteSession,
|
|
@@ -107,14 +107,14 @@ import {
|
|
|
107
107
|
updateSessionMetadata,
|
|
108
108
|
updateSessionProvider,
|
|
109
109
|
updateSessionRunning
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-M7M2VH45.js";
|
|
111
111
|
import {
|
|
112
112
|
initDatabase
|
|
113
113
|
} from "./chunk-FBGWG4N6.js";
|
|
114
114
|
import {
|
|
115
115
|
createProviderManager,
|
|
116
116
|
parseDefaultModelSelection
|
|
117
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-DHOOJDHX.js";
|
|
118
118
|
import {
|
|
119
119
|
detectModel,
|
|
120
120
|
getLlmStatus
|
|
@@ -3448,7 +3448,7 @@ import { Router as Router6 } from "express";
|
|
|
3448
3448
|
import { spawn as spawn2 } from "child_process";
|
|
3449
3449
|
|
|
3450
3450
|
// src/constants.ts
|
|
3451
|
-
var VERSION = "2.0.
|
|
3451
|
+
var VERSION = "2.0.28";
|
|
3452
3452
|
|
|
3453
3453
|
// src/server/routes/auto-update.ts
|
|
3454
3454
|
var updateInProgress = false;
|
|
@@ -3628,7 +3628,7 @@ async function createServerHandle(config4) {
|
|
|
3628
3628
|
setMcpTools(mcpTools);
|
|
3629
3629
|
logger.info("MCP tools registered", { count: mcpTools.length });
|
|
3630
3630
|
}
|
|
3631
|
-
const { signalMcpReady } = await import("./server-
|
|
3631
|
+
const { signalMcpReady } = await import("./server-LNEF4YAD.js");
|
|
3632
3632
|
signalMcpReady();
|
|
3633
3633
|
});
|
|
3634
3634
|
const app = express();
|
|
@@ -3786,7 +3786,7 @@ async function createServerHandle(config4) {
|
|
|
3786
3786
|
res.json({ project });
|
|
3787
3787
|
});
|
|
3788
3788
|
app.get("/api/sessions", async (req, res) => {
|
|
3789
|
-
const { getRecentUserPromptsForSession } = await import("./events-
|
|
3789
|
+
const { getRecentUserPromptsForSession } = await import("./events-F5IURVXP.js");
|
|
3790
3790
|
const projectId = req.query["projectId"];
|
|
3791
3791
|
const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
|
|
3792
3792
|
const offset = parseInt(req.query["offset"]) || 0;
|
|
@@ -3819,9 +3819,9 @@ async function createServerHandle(config4) {
|
|
|
3819
3819
|
res.status(201).json({ session });
|
|
3820
3820
|
});
|
|
3821
3821
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
3822
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
3822
|
+
const { getEventStore: getEventStore2 } = await import("./events-F5IURVXP.js");
|
|
3823
3823
|
const { buildMessagesFromStoredEvents } = await import("./folding-PI67HWBR.js");
|
|
3824
|
-
const { getPendingQuestionsForSession } = await import("./tools-
|
|
3824
|
+
const { getPendingQuestionsForSession } = await import("./tools-EHUIRZFG.js");
|
|
3825
3825
|
const session = sessionManager.getSession(req.params.id);
|
|
3826
3826
|
if (!session) {
|
|
3827
3827
|
return res.status(404).json({ error: "Session not found" });
|
|
@@ -3852,7 +3852,7 @@ async function createServerHandle(config4) {
|
|
|
3852
3852
|
res.json({ success: true });
|
|
3853
3853
|
});
|
|
3854
3854
|
app.post("/api/sessions/:id/provider", async (req, res) => {
|
|
3855
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
3855
|
+
const { getEventStore: getEventStore2 } = await import("./events-F5IURVXP.js");
|
|
3856
3856
|
const { buildMessagesFromStoredEvents } = await import("./folding-PI67HWBR.js");
|
|
3857
3857
|
const sessionId = req.params.id;
|
|
3858
3858
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -3863,10 +3863,12 @@ async function createServerHandle(config4) {
|
|
|
3863
3863
|
if (!providerId) {
|
|
3864
3864
|
return res.status(400).json({ error: "providerId is required" });
|
|
3865
3865
|
}
|
|
3866
|
-
|
|
3867
|
-
const
|
|
3866
|
+
const provider = providerManager.getProviders().find((p) => p.id === providerId);
|
|
3867
|
+
const resolvedModel = model ?? provider?.models?.[0]?.id ?? "auto";
|
|
3868
|
+
sessionManager.setSessionProvider(sessionId, providerId, resolvedModel);
|
|
3869
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-OV5OLKOC.js");
|
|
3868
3870
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
3869
|
-
const updatedConfig = setDefaultModelSelection(globalConfig, providerId,
|
|
3871
|
+
const updatedConfig = setDefaultModelSelection(globalConfig, providerId, resolvedModel);
|
|
3870
3872
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
3871
3873
|
config4.defaultModelSelection = updatedConfig.defaultModelSelection;
|
|
3872
3874
|
const contextState = sessionManager.getContextState(sessionId);
|
|
@@ -3895,7 +3897,7 @@ async function createServerHandle(config4) {
|
|
|
3895
3897
|
res.json({ success: true });
|
|
3896
3898
|
});
|
|
3897
3899
|
app.put("/api/sessions/:id/mode", async (req, res) => {
|
|
3898
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
3900
|
+
const { getEventStore: getEventStore2 } = await import("./events-F5IURVXP.js");
|
|
3899
3901
|
const { buildMessagesFromStoredEvents } = await import("./folding-PI67HWBR.js");
|
|
3900
3902
|
const sessionId = req.params.id;
|
|
3901
3903
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -3952,15 +3954,15 @@ async function createServerHandle(config4) {
|
|
|
3952
3954
|
if (!callId || approved === void 0) {
|
|
3953
3955
|
return res.status(400).json({ error: "callId and approved are required" });
|
|
3954
3956
|
}
|
|
3955
|
-
const { providePathConfirmation } = await import("./tools-
|
|
3957
|
+
const { providePathConfirmation } = await import("./tools-EHUIRZFG.js");
|
|
3956
3958
|
const result = providePathConfirmation(callId, approved, alwaysAllow);
|
|
3957
3959
|
if (!result.found) {
|
|
3958
3960
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
3959
3961
|
}
|
|
3960
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
3962
|
+
const { getEventStore: getEventStore2 } = await import("./events-F5IURVXP.js");
|
|
3961
3963
|
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-PI67HWBR.js");
|
|
3962
3964
|
const { createSessionStateMessage } = await import("./protocol-BKNLAEPJ.js");
|
|
3963
|
-
const { getPendingQuestionsForSession } = await import("./tools-
|
|
3965
|
+
const { getPendingQuestionsForSession } = await import("./tools-EHUIRZFG.js");
|
|
3964
3966
|
const eventStore = getEventStore2();
|
|
3965
3967
|
const events = eventStore.getEvents(sessionId);
|
|
3966
3968
|
const messages = buildMessagesFromStoredEvents(events);
|
|
@@ -3981,7 +3983,7 @@ async function createServerHandle(config4) {
|
|
|
3981
3983
|
if (!skip && typeof answer !== "string") {
|
|
3982
3984
|
return res.status(400).json({ error: "answer is required when not skipping" });
|
|
3983
3985
|
}
|
|
3984
|
-
const { provideAnswer } = await import("./tools-
|
|
3986
|
+
const { provideAnswer } = await import("./tools-EHUIRZFG.js");
|
|
3985
3987
|
const found = provideAnswer(callId, answer ?? "", skip ?? false);
|
|
3986
3988
|
if (!found) {
|
|
3987
3989
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -4017,15 +4019,15 @@ async function createServerHandle(config4) {
|
|
|
4017
4019
|
if (!session) {
|
|
4018
4020
|
return res.status(404).json({ error: "Session not found" });
|
|
4019
4021
|
}
|
|
4020
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
4021
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
4022
|
+
const { stopSessionExecution } = await import("./chat-handler-5ZJY4XN6.js");
|
|
4023
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-EHUIRZFG.js");
|
|
4022
4024
|
const queuedMessages = sessionManager.getQueueState(sessionId);
|
|
4023
4025
|
sessionManager.clearMessageQueue(sessionId);
|
|
4024
4026
|
stopSessionExecution(sessionId, sessionManager);
|
|
4025
4027
|
abortSession(sessionId);
|
|
4026
4028
|
cancelQuestionsForSession(sessionId, "Session stopped by user");
|
|
4027
4029
|
cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
|
|
4028
|
-
const eventStore = (await import("./events-
|
|
4030
|
+
const eventStore = (await import("./events-F5IURVXP.js")).getEventStore();
|
|
4029
4031
|
eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
|
|
4030
4032
|
res.json({ success: true, queuedMessages });
|
|
4031
4033
|
});
|
|
@@ -4039,7 +4041,7 @@ async function createServerHandle(config4) {
|
|
|
4039
4041
|
if (typeof messageIndex !== "number" || messageIndex < 0) {
|
|
4040
4042
|
return res.status(400).json({ error: "messageIndex must be a non-negative number" });
|
|
4041
4043
|
}
|
|
4042
|
-
const { truncateSessionMessages } = await import("./events-
|
|
4044
|
+
const { truncateSessionMessages } = await import("./events-F5IURVXP.js");
|
|
4043
4045
|
truncateSessionMessages(sessionId, messageIndex);
|
|
4044
4046
|
res.json({ success: true });
|
|
4045
4047
|
});
|
|
@@ -4057,7 +4059,7 @@ async function createServerHandle(config4) {
|
|
|
4057
4059
|
if (!msg) {
|
|
4058
4060
|
return res.status(400).json({ error: "Message not found at this index" });
|
|
4059
4061
|
}
|
|
4060
|
-
const { truncateSessionMessages } = await import("./events-
|
|
4062
|
+
const { truncateSessionMessages } = await import("./events-F5IURVXP.js");
|
|
4061
4063
|
truncateSessionMessages(sessionId, messageIndex - 1);
|
|
4062
4064
|
sessionManager.queueMessage(sessionId, "asap", msg.content, msg.attachments, msg.messageKind);
|
|
4063
4065
|
res.json({ success: true });
|
|
@@ -4129,7 +4131,7 @@ async function createServerHandle(config4) {
|
|
|
4129
4131
|
let visionFallback;
|
|
4130
4132
|
let globalWorkdir;
|
|
4131
4133
|
try {
|
|
4132
|
-
const { loadGlobalConfig, getVisionFallback } = await import("./config-
|
|
4134
|
+
const { loadGlobalConfig, getVisionFallback } = await import("./config-OV5OLKOC.js");
|
|
4133
4135
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
4134
4136
|
const fallback = getVisionFallback(globalConfig);
|
|
4135
4137
|
if (fallback) {
|
|
@@ -4225,7 +4227,7 @@ async function createServerHandle(config4) {
|
|
|
4225
4227
|
const apiKey = req.query["apiKey"];
|
|
4226
4228
|
if (!url) return res.status(400).json({ error: "url is required" });
|
|
4227
4229
|
try {
|
|
4228
|
-
const { fetchModelsWithContext } = await import("./provider-manager-
|
|
4230
|
+
const { fetchModelsWithContext } = await import("./provider-manager-5742XBEI.js");
|
|
4229
4231
|
const models = await fetchModelsWithContext(url, apiKey);
|
|
4230
4232
|
if (models.length === 0) {
|
|
4231
4233
|
return res.status(404).json({ error: `No models found at ${buildModelsUrl(url)}`, url });
|
|
@@ -4341,9 +4343,10 @@ async function createServerHandle(config4) {
|
|
|
4341
4343
|
return res.status(400).json({ error: "name, url, and backend are required" });
|
|
4342
4344
|
}
|
|
4343
4345
|
try {
|
|
4344
|
-
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-
|
|
4346
|
+
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-OV5OLKOC.js");
|
|
4345
4347
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
4346
4348
|
const providerBackend = backend;
|
|
4349
|
+
const providerModels = modelConfigs?.length ? buildModelConfigs(modelConfigs) : model ? [{ id: model, contextWindow: 2e5, source: "user" }] : [];
|
|
4347
4350
|
const configWithProvider = addProvider(globalConfig, {
|
|
4348
4351
|
name,
|
|
4349
4352
|
url,
|
|
@@ -4351,16 +4354,18 @@ async function createServerHandle(config4) {
|
|
|
4351
4354
|
apiKey,
|
|
4352
4355
|
...isLocal !== void 0 ? { isLocal } : {},
|
|
4353
4356
|
...thinkingField ? { thinkingField } : {},
|
|
4354
|
-
models:
|
|
4357
|
+
models: providerModels,
|
|
4355
4358
|
isActive: true
|
|
4356
4359
|
});
|
|
4360
|
+
const firstModelId = model ?? providerModels[0]?.id ?? "auto";
|
|
4357
4361
|
const finalConfig = setDefaultModelSelection(
|
|
4358
4362
|
configWithProvider,
|
|
4359
4363
|
configWithProvider.providers[configWithProvider.providers.length - 1].id,
|
|
4360
|
-
|
|
4364
|
+
firstModelId
|
|
4361
4365
|
);
|
|
4362
4366
|
await saveGlobalConfig(config4.mode ?? "production", finalConfig);
|
|
4363
4367
|
providerManager.setProviders(finalConfig.providers, finalConfig.defaultModelSelection ?? void 0);
|
|
4368
|
+
config4.defaultModelSelection = finalConfig.defaultModelSelection;
|
|
4364
4369
|
const newProvider = finalConfig.providers[finalConfig.providers.length - 1];
|
|
4365
4370
|
res.status(201).json({
|
|
4366
4371
|
success: true,
|
|
@@ -4376,7 +4381,7 @@ async function createServerHandle(config4) {
|
|
|
4376
4381
|
app.post("/api/init/config", async (req, res) => {
|
|
4377
4382
|
const { workdir, visionFallback } = req.body;
|
|
4378
4383
|
try {
|
|
4379
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
4384
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-OV5OLKOC.js");
|
|
4380
4385
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
4381
4386
|
const updatedConfig = {
|
|
4382
4387
|
...globalConfig,
|
|
@@ -4404,18 +4409,19 @@ async function createServerHandle(config4) {
|
|
|
4404
4409
|
});
|
|
4405
4410
|
app.delete("/api/providers/:id", async (req, res) => {
|
|
4406
4411
|
const { id } = req.params;
|
|
4407
|
-
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-
|
|
4412
|
+
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-OV5OLKOC.js");
|
|
4408
4413
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
4409
4414
|
const updatedConfig = removeProvider(globalConfig, id);
|
|
4410
4415
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
4411
4416
|
providerManager.setProviders(updatedConfig.providers, updatedConfig.defaultModelSelection ?? void 0);
|
|
4417
|
+
config4.defaultModelSelection = updatedConfig.defaultModelSelection;
|
|
4412
4418
|
res.json({ success: true });
|
|
4413
4419
|
});
|
|
4414
4420
|
app.patch("/api/providers/:id", async (req, res) => {
|
|
4415
4421
|
const { id } = req.params;
|
|
4416
4422
|
const { isLocal } = req.body;
|
|
4417
4423
|
try {
|
|
4418
|
-
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-
|
|
4424
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-OV5OLKOC.js");
|
|
4419
4425
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
4420
4426
|
const provider = globalConfig.providers.find((p) => p.id === id);
|
|
4421
4427
|
if (!provider) {
|
|
@@ -4426,6 +4432,7 @@ async function createServerHandle(config4) {
|
|
|
4426
4432
|
const updatedConfig = updateProvider(globalConfig, id, updates);
|
|
4427
4433
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
4428
4434
|
providerManager.setProviders(updatedConfig.providers, updatedConfig.defaultModelSelection ?? void 0);
|
|
4435
|
+
config4.defaultModelSelection = updatedConfig.defaultModelSelection;
|
|
4429
4436
|
res.json({ success: true, provider: updatedConfig.providers.find((p) => p.id === id) });
|
|
4430
4437
|
} catch (error) {
|
|
4431
4438
|
res.status(500).json({ error: error instanceof Error ? error.message : "Failed to update provider" });
|
|
@@ -4443,7 +4450,7 @@ async function createServerHandle(config4) {
|
|
|
4443
4450
|
models: modelConfigs
|
|
4444
4451
|
} = req.body;
|
|
4445
4452
|
try {
|
|
4446
|
-
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-
|
|
4453
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-OV5OLKOC.js");
|
|
4447
4454
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
4448
4455
|
const provider = globalConfig.providers.find((p) => p.id === id);
|
|
4449
4456
|
if (!provider) {
|
|
@@ -4462,6 +4469,7 @@ async function createServerHandle(config4) {
|
|
|
4462
4469
|
const updatedConfig = updateProvider(globalConfig, id, updates);
|
|
4463
4470
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
4464
4471
|
providerManager.setProviders(updatedConfig.providers, updatedConfig.defaultModelSelection ?? void 0);
|
|
4472
|
+
config4.defaultModelSelection = updatedConfig.defaultModelSelection;
|
|
4465
4473
|
res.json({ success: true, provider: updatedConfig.providers.find((p) => p.id === id) });
|
|
4466
4474
|
} catch (error) {
|
|
4467
4475
|
res.status(500).json({ error: error instanceof Error ? error.message : "Failed to update provider" });
|
|
@@ -4480,7 +4488,7 @@ async function createServerHandle(config4) {
|
|
|
4480
4488
|
return res.status(400).json({ error: result.error });
|
|
4481
4489
|
}
|
|
4482
4490
|
const llmClient = getLLMClient();
|
|
4483
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
4491
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-OV5OLKOC.js");
|
|
4484
4492
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
4485
4493
|
const updatedConfig = setDefaultModelSelection(globalConfig, id, llmClient.getModel());
|
|
4486
4494
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
@@ -4507,7 +4515,7 @@ async function createServerHandle(config4) {
|
|
|
4507
4515
|
});
|
|
4508
4516
|
async function rebuildMcpTools() {
|
|
4509
4517
|
const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-B7QP6NLA.js");
|
|
4510
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
4518
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-EHUIRZFG.js");
|
|
4511
4519
|
const mcpTools = createMcpTools2(mcpManager);
|
|
4512
4520
|
setMcpTools2(mcpTools);
|
|
4513
4521
|
}
|
|
@@ -4569,7 +4577,7 @@ async function createServerHandle(config4) {
|
|
|
4569
4577
|
};
|
|
4570
4578
|
await mcpManager.addServer(name, serverCfg);
|
|
4571
4579
|
const server = mcpManager.getServer(name);
|
|
4572
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
4580
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-OV5OLKOC.js");
|
|
4573
4581
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
4574
4582
|
const updatedMcpServers = { ...globalConfig.mcpServers ?? {}, [name]: serverCfg };
|
|
4575
4583
|
await saveGlobalConfig(config4.mode ?? "production", {
|
|
@@ -4595,7 +4603,7 @@ async function createServerHandle(config4) {
|
|
|
4595
4603
|
return res.status(404).json({ error: `MCP server '${name}' not found` });
|
|
4596
4604
|
}
|
|
4597
4605
|
mcpManager.removeServer(name);
|
|
4598
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
4606
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-OV5OLKOC.js");
|
|
4599
4607
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
4600
4608
|
const updatedMcpServers = { ...globalConfig.mcpServers ?? {} };
|
|
4601
4609
|
delete updatedMcpServers[name];
|
|
@@ -4620,7 +4628,7 @@ async function createServerHandle(config4) {
|
|
|
4620
4628
|
await mcpManager.setToolEnabled(name, toolName, enabled);
|
|
4621
4629
|
const server = mcpManager.getServer(name);
|
|
4622
4630
|
if (server) {
|
|
4623
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
4631
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-OV5OLKOC.js");
|
|
4624
4632
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
4625
4633
|
const mcpServers2 = { ...globalConfig.mcpServers ?? {} };
|
|
4626
4634
|
const serverCfg = mcpServers2[name];
|
|
@@ -4819,7 +4827,7 @@ async function createServerHandle(config4) {
|
|
|
4819
4827
|
const state = sessionManager.getContextState(sessionId);
|
|
4820
4828
|
wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
|
|
4821
4829
|
});
|
|
4822
|
-
const { QueueProcessor } = await import("./processor-
|
|
4830
|
+
const { QueueProcessor } = await import("./processor-2GN5MJHI.js");
|
|
4823
4831
|
const queueProcessor = new QueueProcessor({
|
|
4824
4832
|
sessionManager,
|
|
4825
4833
|
providerManager,
|
|
@@ -4894,4 +4902,4 @@ export {
|
|
|
4894
4902
|
createServerHandle,
|
|
4895
4903
|
createServer
|
|
4896
4904
|
};
|
|
4897
|
-
//# sourceMappingURL=chunk-
|
|
4905
|
+
//# sourceMappingURL=chunk-AETO4TMN.js.map
|
|
@@ -145,29 +145,10 @@ function migrateConfig(raw) {
|
|
|
145
145
|
if (migrationOccurred) {
|
|
146
146
|
console.warn("Migrating legacy maxContext to model-specific config");
|
|
147
147
|
}
|
|
148
|
-
if (obj.defaultModelSelection) {
|
|
149
|
-
return {
|
|
150
|
-
config: configSchema.parse({
|
|
151
|
-
...obj,
|
|
152
|
-
providers
|
|
153
|
-
}),
|
|
154
|
-
migrated: migrationOccurred
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
let defaultModelSelection;
|
|
158
|
-
if (obj.activeProviderId) {
|
|
159
|
-
const activeProvider = obj.providers.find((p) => p.id === obj.activeProviderId);
|
|
160
|
-
if (activeProvider?.model) {
|
|
161
|
-
defaultModelSelection = `${obj.activeProviderId}/${activeProvider.model}`;
|
|
162
|
-
} else {
|
|
163
|
-
defaultModelSelection = `${obj.activeProviderId}/auto`;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
148
|
return {
|
|
167
149
|
config: configSchema.parse({
|
|
168
150
|
...obj,
|
|
169
|
-
providers
|
|
170
|
-
defaultModelSelection
|
|
151
|
+
providers
|
|
171
152
|
}),
|
|
172
153
|
migrated: migrationOccurred
|
|
173
154
|
};
|
|
@@ -301,7 +282,7 @@ function addProvider(config, provider) {
|
|
|
301
282
|
{ ...newProvider, isActive: shouldActivate }
|
|
302
283
|
],
|
|
303
284
|
mcpServers: config.mcpServers,
|
|
304
|
-
defaultModelSelection: shouldActivate ? `${newProvider.id}
|
|
285
|
+
defaultModelSelection: shouldActivate ? `${newProvider.id}/${newProvider.models?.[0]?.id ?? "auto"}` : config.defaultModelSelection,
|
|
305
286
|
activeProviderId: shouldActivate ? newProvider.id : config.activeProviderId,
|
|
306
287
|
activeWorkflowId: config.activeWorkflowId,
|
|
307
288
|
server: config.server ?? { port: 10369, host: "127.0.0.1", openBrowser: true },
|
|
@@ -330,7 +311,8 @@ function removeProvider(config, providerId) {
|
|
|
330
311
|
const slashIndex = config.defaultModelSelection.indexOf("/");
|
|
331
312
|
const selectedProviderId = slashIndex === -1 ? config.defaultModelSelection : config.defaultModelSelection.substring(0, slashIndex);
|
|
332
313
|
if (selectedProviderId === providerId) {
|
|
333
|
-
|
|
314
|
+
const firstModelId = filtered[0]?.models?.[0]?.id ?? "auto";
|
|
315
|
+
newDefaultModelSelection = filtered.length > 0 ? `${filtered[0].id}/${firstModelId}` : void 0;
|
|
334
316
|
}
|
|
335
317
|
}
|
|
336
318
|
const wasActive = config.activeProviderId === providerId;
|
|
@@ -436,4 +418,4 @@ export {
|
|
|
436
418
|
activateProvider,
|
|
437
419
|
mergeConfigs
|
|
438
420
|
};
|
|
439
|
-
//# sourceMappingURL=chunk-
|
|
421
|
+
//# sourceMappingURL=chunk-BW6DQC2L.js.map
|
|
@@ -33,7 +33,7 @@ Options:
|
|
|
33
33
|
}
|
|
34
34
|
async function runNetworkSetup(mode) {
|
|
35
35
|
const { loadAuthConfig, saveAuthConfig, encryptPassword } = await import("./auth-56SIRACI.js");
|
|
36
|
-
const { saveGlobalConfig } = await import("./config-
|
|
36
|
+
const { saveGlobalConfig } = await import("./config-OV5OLKOC.js");
|
|
37
37
|
const { getAuthKeyPath } = await import("./paths-X46PPOI2.js");
|
|
38
38
|
const existingAuth = await loadAuthConfig(mode);
|
|
39
39
|
if (existingAuth) {
|
|
@@ -94,7 +94,7 @@ async function runNetworkSetup(mode) {
|
|
|
94
94
|
console.log("\u2713 Configuration saved!\n");
|
|
95
95
|
}
|
|
96
96
|
async function runConfig(mode) {
|
|
97
|
-
const { loadGlobalConfig, getActiveProvider, getDefaultModel } = await import("./config-
|
|
97
|
+
const { loadGlobalConfig, getActiveProvider, getDefaultModel } = await import("./config-OV5OLKOC.js");
|
|
98
98
|
const { getGlobalConfigPath } = await import("./paths-X46PPOI2.js");
|
|
99
99
|
const config = await loadGlobalConfig(mode);
|
|
100
100
|
const configPath = getGlobalConfigPath(mode);
|
|
@@ -152,7 +152,7 @@ async function runCli(options) {
|
|
|
152
152
|
break;
|
|
153
153
|
}
|
|
154
154
|
case "provider": {
|
|
155
|
-
const { runProviderCommand } = await import("./provider-
|
|
155
|
+
const { runProviderCommand } = await import("./provider-AHIVZZI5.js");
|
|
156
156
|
const [, subcommand] = positionals;
|
|
157
157
|
await runProviderCommand(mode, subcommand);
|
|
158
158
|
break;
|
|
@@ -191,12 +191,12 @@ async function runCli(options) {
|
|
|
191
191
|
break;
|
|
192
192
|
}
|
|
193
193
|
default: {
|
|
194
|
-
const { configFileExists } = await import("./config-
|
|
194
|
+
const { configFileExists } = await import("./config-OV5OLKOC.js");
|
|
195
195
|
const configExists = await configFileExists(mode);
|
|
196
196
|
if (!configExists) {
|
|
197
197
|
await runNetworkSetup(mode);
|
|
198
198
|
}
|
|
199
|
-
const { runServe } = await import("./serve-
|
|
199
|
+
const { runServe } = await import("./serve-O47BL4WX.js");
|
|
200
200
|
const serveOptions = { mode };
|
|
201
201
|
if (values.port) serveOptions.port = parseInt(values.port);
|
|
202
202
|
if (values["no-browser"] === true) serveOptions.openBrowser = false;
|
|
@@ -208,4 +208,4 @@ async function runCli(options) {
|
|
|
208
208
|
export {
|
|
209
209
|
runCli
|
|
210
210
|
};
|
|
211
|
-
//# sourceMappingURL=chunk-
|
|
211
|
+
//# sourceMappingURL=chunk-D7ODVXBQ.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
clearModelCache
|
|
3
|
-
detectModel
|
|
2
|
+
clearModelCache
|
|
4
3
|
} from "./chunk-M3RB4IF6.js";
|
|
5
4
|
import {
|
|
6
5
|
createLLMClient
|
|
@@ -158,7 +157,7 @@ async function fetchOllamaModelsWithContext(baseUrl, _apiKey) {
|
|
|
158
157
|
function parseDefaultModelSelection(selection) {
|
|
159
158
|
if (!selection) return { providerId: void 0, model: void 0 };
|
|
160
159
|
const slashIndex = selection.indexOf("/");
|
|
161
|
-
if (slashIndex === -1) return { providerId: selection, model:
|
|
160
|
+
if (slashIndex === -1) return { providerId: selection, model: void 0 };
|
|
162
161
|
return {
|
|
163
162
|
providerId: selection.substring(0, slashIndex),
|
|
164
163
|
model: selection.substring(slashIndex + 1)
|
|
@@ -237,8 +236,11 @@ function createProviderManager(config) {
|
|
|
237
236
|
if (!provider) {
|
|
238
237
|
return { success: false, error: "Provider not found" };
|
|
239
238
|
}
|
|
240
|
-
const currentModel = parseDefaultModelSelection(defaultModelSelection).model
|
|
241
|
-
|
|
239
|
+
const currentModel = parseDefaultModelSelection(defaultModelSelection).model;
|
|
240
|
+
let targetModel = options?.model ?? currentModel;
|
|
241
|
+
if (!targetModel || targetModel === "auto") {
|
|
242
|
+
targetModel = provider.models?.[0]?.id ?? "auto";
|
|
243
|
+
}
|
|
242
244
|
const isModelSwitch = providerId === parseDefaultModelSelection(defaultModelSelection).providerId && options?.model && options.model !== currentModel;
|
|
243
245
|
if (providerId === parseDefaultModelSelection(defaultModelSelection).providerId && !isModelSwitch) {
|
|
244
246
|
return { success: true };
|
|
@@ -280,14 +282,7 @@ function createProviderManager(config) {
|
|
|
280
282
|
providers = providers.map((p) => p.id === providerId ? { ...p, models: userModels } : p);
|
|
281
283
|
}
|
|
282
284
|
newClient.setBackend(provider.backend);
|
|
283
|
-
|
|
284
|
-
const detected = await detectModel(provider.url);
|
|
285
|
-
if (detected) {
|
|
286
|
-
newClient.setModel(detected);
|
|
287
|
-
}
|
|
288
|
-
} else {
|
|
289
|
-
newClient.setModel(targetModel);
|
|
290
|
-
}
|
|
285
|
+
newClient.setModel(targetModel);
|
|
291
286
|
providerStatus.set(providerId, "connected");
|
|
292
287
|
} catch (err) {
|
|
293
288
|
logger.warn("Could not connect to provider", {
|
|
@@ -320,7 +315,8 @@ function createProviderManager(config) {
|
|
|
320
315
|
if (providerData.isActive || providers.length === 0) {
|
|
321
316
|
providers = providers.map((p) => ({ ...p, isActive: false }));
|
|
322
317
|
provider.isActive = true;
|
|
323
|
-
|
|
318
|
+
const firstModelId = provider.models?.[0]?.id ?? "auto";
|
|
319
|
+
defaultModelSelection = `${id}/${firstModelId}`;
|
|
324
320
|
}
|
|
325
321
|
providers.push(provider);
|
|
326
322
|
providerStatus.set(id, "unknown");
|
|
@@ -334,7 +330,8 @@ function createProviderManager(config) {
|
|
|
334
330
|
providerStatus.delete(providerId);
|
|
335
331
|
if (wasActive && providers.length > 0) {
|
|
336
332
|
providers[0].isActive = true;
|
|
337
|
-
|
|
333
|
+
const firstModelId = providers[0]?.models?.[0]?.id ?? "auto";
|
|
334
|
+
defaultModelSelection = `${providers[0].id}/${firstModelId}`;
|
|
338
335
|
} else if (providers.length === 0) {
|
|
339
336
|
defaultModelSelection = void 0;
|
|
340
337
|
}
|
|
@@ -351,7 +348,7 @@ function createProviderManager(config) {
|
|
|
351
348
|
const newActiveProviderId = this.getActiveProviderId();
|
|
352
349
|
if (newActiveProviderId && newActiveProviderId !== wasActiveProviderId) {
|
|
353
350
|
const activeProvider = providers.find((p) => p.id === newActiveProviderId);
|
|
354
|
-
if (activeProvider
|
|
351
|
+
if (activeProvider) {
|
|
355
352
|
const providerConfig = createConfigForProvider(activeProvider, this.getCurrentModel() ?? "auto");
|
|
356
353
|
llmClient = createLLMClient(providerConfig);
|
|
357
354
|
logger.info("setProviders: recreated LLM client for new active provider", {
|
|
@@ -554,4 +551,4 @@ export {
|
|
|
554
551
|
parseDefaultModelSelection,
|
|
555
552
|
createProviderManager
|
|
556
553
|
};
|
|
557
|
-
//# sourceMappingURL=chunk-
|
|
554
|
+
//# sourceMappingURL=chunk-DHOOJDHX.js.map
|
|
@@ -50,13 +50,13 @@ import {
|
|
|
50
50
|
createToolCallEvent,
|
|
51
51
|
createToolResultEvent,
|
|
52
52
|
streamLLMPure
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-SS3F2VYF.js";
|
|
54
54
|
import {
|
|
55
55
|
getCurrentContextWindowId,
|
|
56
56
|
getCurrentWindowMessageOptions,
|
|
57
57
|
getEventStore,
|
|
58
58
|
getRuntimeConfig
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-M7M2VH45.js";
|
|
60
60
|
import {
|
|
61
61
|
buildContextMessagesFromEventHistory,
|
|
62
62
|
foldContextState,
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
import {
|
|
73
73
|
loadGlobalConfig,
|
|
74
74
|
saveGlobalConfig
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-BW6DQC2L.js";
|
|
76
76
|
import {
|
|
77
77
|
getGlobalConfigDir
|
|
78
78
|
} from "./chunk-CQGTEGKL.js";
|
|
@@ -2563,7 +2563,7 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
|
|
|
2563
2563
|
sessionManager.setCurrentContextSize(sessionId, result.usage.promptTokens);
|
|
2564
2564
|
if (!compacting) {
|
|
2565
2565
|
const contextState2 = sessionManager.getContextState(sessionId);
|
|
2566
|
-
const { shouldCompact, appendCompactionPrompt } = await import("./compactor-
|
|
2566
|
+
const { shouldCompact, appendCompactionPrompt } = await import("./compactor-BN5IDIVR.js");
|
|
2567
2567
|
if (shouldCompact(contextState2.currentTokens, contextState2.maxTokens, runtimeConfig.context.compactionThreshold)) {
|
|
2568
2568
|
appendCompactionPrompt(sessionId, append);
|
|
2569
2569
|
compacting = true;
|
|
@@ -2913,7 +2913,7 @@ async function describeImageFromDataUrl(dataUrl, visionModel, options) {
|
|
|
2913
2913
|
import { createHash as createHash2 } from "crypto";
|
|
2914
2914
|
async function loadVisionModelFromGlobalConfig() {
|
|
2915
2915
|
try {
|
|
2916
|
-
const { loadGlobalConfig: loadGlobalConfig2, getVisionFallback } = await import("./config-
|
|
2916
|
+
const { loadGlobalConfig: loadGlobalConfig2, getVisionFallback } = await import("./config-OV5OLKOC.js");
|
|
2917
2917
|
const runtimeConfig = getRuntimeConfig();
|
|
2918
2918
|
const mode = runtimeConfig.mode ?? "production";
|
|
2919
2919
|
const globalConfig = await loadGlobalConfig2(mode);
|
|
@@ -3368,7 +3368,7 @@ var callSubAgentTool = {
|
|
|
3368
3368
|
};
|
|
3369
3369
|
}
|
|
3370
3370
|
try {
|
|
3371
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
3371
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-EHUIRZFG.js");
|
|
3372
3372
|
const toolRegistry = getToolRegistryForAgent2(agentDef);
|
|
3373
3373
|
const turnMetrics = new TurnMetrics();
|
|
3374
3374
|
const result = await executeSubAgent({
|
|
@@ -4174,7 +4174,7 @@ async function computeContextHash(sessionManager, sessionId) {
|
|
|
4174
4174
|
const runtimeConfig = getRuntimeConfig();
|
|
4175
4175
|
const configDir = getGlobalConfigDir(runtimeConfig.mode ?? "production");
|
|
4176
4176
|
const skills = await getEnabledSkillMetadata(configDir, runtimeConfig.workdir);
|
|
4177
|
-
const { createToolRegistry: createToolRegistry2 } = await import("./tools-
|
|
4177
|
+
const { createToolRegistry: createToolRegistry2 } = await import("./tools-EHUIRZFG.js");
|
|
4178
4178
|
const allTools = createToolRegistry2().definitions;
|
|
4179
4179
|
const toolFingerprint = getToolFingerprint(allTools);
|
|
4180
4180
|
const hash = computeDynamicContextHash(instructionContent, skills, toolFingerprint);
|
|
@@ -4287,7 +4287,7 @@ var mcpConfigTool = createTool(
|
|
|
4287
4287
|
await saveGlobalConfig(mcpConfigMode, { ...globalConfig, mcpServers: updated });
|
|
4288
4288
|
}
|
|
4289
4289
|
async function rebuildTools() {
|
|
4290
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
4290
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-EHUIRZFG.js");
|
|
4291
4291
|
const mcpTools = createMcpTools(mcpManagerForTools);
|
|
4292
4292
|
setMcpTools2(mcpTools);
|
|
4293
4293
|
}
|
|
@@ -4691,4 +4691,4 @@ export {
|
|
|
4691
4691
|
getToolRegistryForAgent,
|
|
4692
4692
|
createToolRegistry
|
|
4693
4693
|
};
|
|
4694
|
-
//# sourceMappingURL=chunk-
|
|
4694
|
+
//# sourceMappingURL=chunk-ERNIKY6J.js.map
|