openfox 2.0.0-beta.11 → 2.0.0-beta.14
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/{ask-5SSOA6SZ.js → ask-BRLFZKEW.js} +2 -1
- package/dist/{auth-56SIRACI.js → auth-OGGBJFJQ.js} +2 -1
- package/dist/{branch.api-PWFW26KC.js → branch.api-TCWNJXYA.js} +2 -1
- package/dist/{chat-handler-NMJCOCCB.js → chat-handler-ZFQIJIJT.js} +9 -8
- package/dist/chunk-7D4SUZUM.js +38 -0
- package/dist/{chunk-EZUR7OEP.js → chunk-BURBTNDG.js} +15 -9
- package/dist/{chunk-DMH6JVPF.js → chunk-BZJAO4VY.js} +47 -19
- package/dist/{chunk-NSBYORD5.js → chunk-DHAKJSE7.js} +4 -2
- package/dist/{chunk-4RLDN2LL.js → chunk-EYE2JMLA.js} +189 -61
- package/dist/{chunk-EQQDA4D3.js → chunk-IONKVOSF.js} +17 -19
- package/dist/{chunk-VIIRNJDT.js → chunk-LXX2CPM5.js} +203 -236
- package/dist/{chunk-EXYMWI7A.js → chunk-OKLV3ZNN.js} +9 -5
- package/dist/chunk-QD6U3BDD.js +25277 -0
- package/dist/{chunk-BU56QFHW.js → chunk-RUWSVV7U.js} +8 -9
- package/dist/{chunk-LCRJWUW7.js → chunk-YWYYRA2P.js} +11 -11
- package/dist/cli/dev.js +2 -1
- package/dist/cli/index.js +2 -1
- package/dist/{compactor-TDNRM3A7.js → compactor-WL33VHUF.js} +2 -1
- package/dist/{config-TDVA7MQN.js → config-MFKBDOOT.js} +6 -5
- package/dist/{events-UGTGGFG3.js → events-6UJR2NH4.js} +3 -2
- package/dist/{folding-YOCGTZYH.js → folding-GMO644G3.js} +2 -1
- package/dist/{inspect-proxy-42ZXL2R5.js → inspect-proxy-JZ54RBUN.js} +2 -1
- package/dist/{manager-W7N3XQ4Q.js → manager-NTL3MLGN.js} +2 -1
- package/dist/{orchestrator-75L5UGDU.js → orchestrator-HHF4UC3K.js} +8 -7
- package/dist/package.json +1 -1
- package/dist/{paths-X46PPOI2.js → paths-D7BBTOO5.js} +2 -1
- package/dist/{permissions-Z2IIV2V7.js → permissions-YGAJ47F5.js} +3 -1
- package/dist/{processor-GHESQ2YV.js → processor-EJJTSLRL.js} +11 -5
- package/dist/{project-creator-6DU7E75S.js → project-creator-GMS5YKEF.js} +2 -1
- package/dist/{projects-2HYIZC4Y.js → projects-QHGMUKWH.js} +2 -1
- package/dist/{protocol-CN24IKQN.js → protocol-QQNATDFM.js} +2 -1
- package/dist/{protocol-B9R1CUvt.d.ts → protocol-zn90yuIr.d.ts} +11 -2
- package/dist/{provider-BGH4MBLH.js → provider-APFZV234.js} +10 -9
- package/dist/provider-manager-2NFFVCX5.js +17 -0
- package/dist/{pwa-76XP2DY2.js → pwa-WYVG3NLS.js} +2 -1
- package/dist/{serve-I6T7V62Z.js → serve-GTH76EDG.js} +14 -13
- package/dist/server/index.d.ts +21 -15
- package/dist/server/index.js +10 -9
- package/dist/{service-GB7AIOG5.js → service-W43DAQ5K.js} +3 -1
- package/dist/{settings-6XX56F3F.js → settings-OAISIQVV.js} +2 -1
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.js +1 -0
- package/dist/{store-OQ45KONN.js → store-JZW6VPEK.js} +2 -1
- package/dist/{tools-D3WWIOQD.js → tools-2X2FC6W7.js} +7 -6
- package/dist/web/assets/index-DCu8wsRj.js +299 -0
- package/dist/web/assets/{index-CSOB8dwI.css → index-Sdax8ayU.css} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-UKTPL5ZG.js +0 -469
- package/dist/web/assets/index-tJDr1ODC.js +0 -299
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
injectWorkflowKickoffIfNeeded,
|
|
4
4
|
runAgentTurn,
|
|
5
5
|
runChatTurn
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RUWSVV7U.js";
|
|
7
7
|
import {
|
|
8
8
|
COMPACTION_PROMPT,
|
|
9
9
|
TurnMetrics,
|
|
@@ -59,13 +59,16 @@ import {
|
|
|
59
59
|
skillExists,
|
|
60
60
|
spawnShellProcess,
|
|
61
61
|
streamLLMPure
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-IONKVOSF.js";
|
|
63
63
|
import {
|
|
64
64
|
getPathSeparator,
|
|
65
65
|
getPlatformShell,
|
|
66
66
|
isAbsolutePath,
|
|
67
67
|
onProcessEvent
|
|
68
68
|
} from "./chunk-PBGOZMVY.js";
|
|
69
|
+
import {
|
|
70
|
+
getProject
|
|
71
|
+
} from "./chunk-XAMAYRDA.js";
|
|
69
72
|
import {
|
|
70
73
|
createSession,
|
|
71
74
|
deleteSession,
|
|
@@ -94,7 +97,7 @@ import {
|
|
|
94
97
|
updateSessionMetadata,
|
|
95
98
|
updateSessionProvider,
|
|
96
99
|
updateSessionRunning
|
|
97
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-DHAKJSE7.js";
|
|
98
101
|
import {
|
|
99
102
|
buildMessagesFromStoredEvents,
|
|
100
103
|
foldPendingConfirmations
|
|
@@ -118,9 +121,6 @@ import {
|
|
|
118
121
|
EventEmitter,
|
|
119
122
|
provideAnswer
|
|
120
123
|
} from "./chunk-BJYPTN5S.js";
|
|
121
|
-
import {
|
|
122
|
-
getProject
|
|
123
|
-
} from "./chunk-XAMAYRDA.js";
|
|
124
124
|
import {
|
|
125
125
|
initDatabase
|
|
126
126
|
} from "./chunk-FBGWG4N6.js";
|
|
@@ -130,30 +130,31 @@ import {
|
|
|
130
130
|
import {
|
|
131
131
|
createServerMessage
|
|
132
132
|
} from "./chunk-BVHFMAVN.js";
|
|
133
|
+
import {
|
|
134
|
+
getGlobalConfigDir
|
|
135
|
+
} from "./chunk-CQGTEGKL.js";
|
|
133
136
|
import {
|
|
134
137
|
createProviderManager,
|
|
135
138
|
parseDefaultModelSelection
|
|
136
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-BZJAO4VY.js";
|
|
137
140
|
import {
|
|
138
141
|
SessionNotFoundError,
|
|
139
142
|
createLLMClient,
|
|
140
143
|
detectModel,
|
|
141
144
|
getLlmStatus
|
|
142
|
-
} from "./chunk-
|
|
145
|
+
} from "./chunk-QD6U3BDD.js";
|
|
143
146
|
import {
|
|
147
|
+
buildModelsUrl,
|
|
144
148
|
detectBackend,
|
|
145
149
|
ensureVersionPrefix,
|
|
146
150
|
getBackendDisplayName,
|
|
147
151
|
getModelProfile,
|
|
148
152
|
modelSupportsVision
|
|
149
|
-
} from "./chunk-
|
|
153
|
+
} from "./chunk-LXX2CPM5.js";
|
|
150
154
|
import {
|
|
151
155
|
logger,
|
|
152
156
|
setLogLevel
|
|
153
157
|
} from "./chunk-K44MW7JJ.js";
|
|
154
|
-
import {
|
|
155
|
-
getGlobalConfigDir
|
|
156
|
-
} from "./chunk-CQGTEGKL.js";
|
|
157
158
|
|
|
158
159
|
// src/server/index.ts
|
|
159
160
|
import express from "express";
|
|
@@ -2844,6 +2845,8 @@ function createWebSocketServer(httpServer, config4, getLLMClient, getActiveProvi
|
|
|
2844
2845
|
sessionLLMClients.delete(sessionId);
|
|
2845
2846
|
return getLLMClient();
|
|
2846
2847
|
}
|
|
2848
|
+
const modelConfig = provider.models.find((m) => m.id === session.providerModel);
|
|
2849
|
+
const reasoningEffort = modelConfig?.thinkingEnabled && modelConfig?.thinkingLevel ? modelConfig.thinkingLevel : void 0;
|
|
2847
2850
|
const baseUrl = ensureVersionPrefix(provider.url);
|
|
2848
2851
|
const sessionConfig = {
|
|
2849
2852
|
...config4,
|
|
@@ -2851,7 +2854,9 @@ function createWebSocketServer(httpServer, config4, getLLMClient, getActiveProvi
|
|
|
2851
2854
|
...config4.llm,
|
|
2852
2855
|
baseUrl,
|
|
2853
2856
|
model: session.providerModel,
|
|
2854
|
-
...provider.apiKey && { apiKey: provider.apiKey }
|
|
2857
|
+
...provider.apiKey && { apiKey: provider.apiKey },
|
|
2858
|
+
...provider.thinkingField && { thinkingField: provider.thinkingField },
|
|
2859
|
+
...reasoningEffort && { reasoningEffort }
|
|
2855
2860
|
}
|
|
2856
2861
|
};
|
|
2857
2862
|
const client = createLLMClient(sessionConfig);
|
|
@@ -5830,7 +5835,7 @@ import { Router as Router6 } from "express";
|
|
|
5830
5835
|
import { spawn as spawn5 } from "child_process";
|
|
5831
5836
|
|
|
5832
5837
|
// src/constants.ts
|
|
5833
|
-
var VERSION = "2.0.0-beta.
|
|
5838
|
+
var VERSION = "2.0.0-beta.14";
|
|
5834
5839
|
|
|
5835
5840
|
// src/server/routes/auto-update.ts
|
|
5836
5841
|
var updateInProgress = false;
|
|
@@ -6037,7 +6042,7 @@ async function createServerHandle(config4) {
|
|
|
6037
6042
|
res.json({ tools });
|
|
6038
6043
|
});
|
|
6039
6044
|
app.get("/api/projects", async (_req, res) => {
|
|
6040
|
-
const { listProjects } = await import("./projects-
|
|
6045
|
+
const { listProjects } = await import("./projects-QHGMUKWH.js");
|
|
6041
6046
|
const projects = listProjects();
|
|
6042
6047
|
res.json({ projects });
|
|
6043
6048
|
});
|
|
@@ -6046,7 +6051,7 @@ async function createServerHandle(config4) {
|
|
|
6046
6051
|
if (!name || !workdir) {
|
|
6047
6052
|
return res.status(400).json({ error: "name and workdir are required" });
|
|
6048
6053
|
}
|
|
6049
|
-
const { createDirectoryWithGit } = await import("./project-creator-
|
|
6054
|
+
const { createDirectoryWithGit } = await import("./project-creator-GMS5YKEF.js");
|
|
6050
6055
|
try {
|
|
6051
6056
|
const project = await createDirectoryWithGit(name, workdir);
|
|
6052
6057
|
res.status(201).json({ project });
|
|
@@ -6064,7 +6069,7 @@ async function createServerHandle(config4) {
|
|
|
6064
6069
|
if (!targetPath) {
|
|
6065
6070
|
return res.status(400).json({ error: "path is required" });
|
|
6066
6071
|
}
|
|
6067
|
-
const { checkPermissions } = await import("./permissions-
|
|
6072
|
+
const { checkPermissions } = await import("./permissions-YGAJ47F5.js");
|
|
6068
6073
|
const result = await checkPermissions(targetPath);
|
|
6069
6074
|
if (result.success) {
|
|
6070
6075
|
res.json(result);
|
|
@@ -6081,7 +6086,7 @@ async function createServerHandle(config4) {
|
|
|
6081
6086
|
if (!["group", "ownership", "join_group", "join_group_and_group"].includes(action)) {
|
|
6082
6087
|
return res.status(400).json({ error: 'action must be "group", "ownership", "join_group", or "join_group_and_group"' });
|
|
6083
6088
|
}
|
|
6084
|
-
const { fixPermissions } = await import("./permissions-
|
|
6089
|
+
const { fixPermissions } = await import("./permissions-YGAJ47F5.js");
|
|
6085
6090
|
const result = await fixPermissions(targetPath, action);
|
|
6086
6091
|
if (result.success) {
|
|
6087
6092
|
res.json(result);
|
|
@@ -6091,7 +6096,7 @@ async function createServerHandle(config4) {
|
|
|
6091
6096
|
}
|
|
6092
6097
|
});
|
|
6093
6098
|
app.get("/api/projects/:id", async (req, res) => {
|
|
6094
|
-
const { getProject: getProject2 } = await import("./projects-
|
|
6099
|
+
const { getProject: getProject2 } = await import("./projects-QHGMUKWH.js");
|
|
6095
6100
|
const project = getProject2(req.params.id);
|
|
6096
6101
|
if (!project) {
|
|
6097
6102
|
return res.status(404).json({ error: "Project not found" });
|
|
@@ -6099,7 +6104,7 @@ async function createServerHandle(config4) {
|
|
|
6099
6104
|
res.json({ project });
|
|
6100
6105
|
});
|
|
6101
6106
|
app.put("/api/projects/:id", async (req, res) => {
|
|
6102
|
-
const { updateProject } = await import("./projects-
|
|
6107
|
+
const { updateProject } = await import("./projects-QHGMUKWH.js");
|
|
6103
6108
|
const { name, customInstructions, dangerLevel } = req.body;
|
|
6104
6109
|
const updates = {};
|
|
6105
6110
|
if (name !== void 0) updates.name = name;
|
|
@@ -6112,7 +6117,7 @@ async function createServerHandle(config4) {
|
|
|
6112
6117
|
res.json({ project: updated });
|
|
6113
6118
|
});
|
|
6114
6119
|
app.delete("/api/projects/:id", async (req, res) => {
|
|
6115
|
-
const { getProject: getProject2, deleteProject } = await import("./projects-
|
|
6120
|
+
const { getProject: getProject2, deleteProject } = await import("./projects-QHGMUKWH.js");
|
|
6116
6121
|
const project = getProject2(req.params.id);
|
|
6117
6122
|
if (!project) {
|
|
6118
6123
|
return res.status(404).json({ error: "Project not found" });
|
|
@@ -6121,7 +6126,7 @@ async function createServerHandle(config4) {
|
|
|
6121
6126
|
res.json({ success: true });
|
|
6122
6127
|
});
|
|
6123
6128
|
app.put("/api/projects/:id/star", async (req, res) => {
|
|
6124
|
-
const { toggleStar } = await import("./projects-
|
|
6129
|
+
const { toggleStar } = await import("./projects-QHGMUKWH.js");
|
|
6125
6130
|
const { isStarred } = req.body;
|
|
6126
6131
|
if (typeof isStarred !== "boolean") {
|
|
6127
6132
|
return res.status(400).json({ error: "isStarred is required and must be a boolean" });
|
|
@@ -6133,7 +6138,7 @@ async function createServerHandle(config4) {
|
|
|
6133
6138
|
res.json({ project });
|
|
6134
6139
|
});
|
|
6135
6140
|
app.get("/api/sessions", async (req, res) => {
|
|
6136
|
-
const { getRecentUserPromptsForSession } = await import("./events-
|
|
6141
|
+
const { getRecentUserPromptsForSession } = await import("./events-6UJR2NH4.js");
|
|
6137
6142
|
const projectId = req.query["projectId"];
|
|
6138
6143
|
const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
|
|
6139
6144
|
const offset = parseInt(req.query["offset"]) || 0;
|
|
@@ -6166,8 +6171,8 @@ async function createServerHandle(config4) {
|
|
|
6166
6171
|
res.status(201).json({ session });
|
|
6167
6172
|
});
|
|
6168
6173
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
6169
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6170
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-
|
|
6174
|
+
const { getEventStore: getEventStore2 } = await import("./events-6UJR2NH4.js");
|
|
6175
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-GMO644G3.js");
|
|
6171
6176
|
const session = sessionManager.getSession(req.params.id);
|
|
6172
6177
|
if (!session) {
|
|
6173
6178
|
return res.status(404).json({ error: "Session not found" });
|
|
@@ -6197,8 +6202,8 @@ async function createServerHandle(config4) {
|
|
|
6197
6202
|
res.json({ success: true });
|
|
6198
6203
|
});
|
|
6199
6204
|
app.post("/api/sessions/:id/provider", async (req, res) => {
|
|
6200
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6201
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-
|
|
6205
|
+
const { getEventStore: getEventStore2 } = await import("./events-6UJR2NH4.js");
|
|
6206
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-GMO644G3.js");
|
|
6202
6207
|
const sessionId = req.params.id;
|
|
6203
6208
|
const session = sessionManager.getSession(sessionId);
|
|
6204
6209
|
if (!session) {
|
|
@@ -6209,7 +6214,7 @@ async function createServerHandle(config4) {
|
|
|
6209
6214
|
return res.status(400).json({ error: "providerId is required" });
|
|
6210
6215
|
}
|
|
6211
6216
|
sessionManager.setSessionProvider(sessionId, providerId, model ?? "auto");
|
|
6212
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
6217
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-MFKBDOOT.js");
|
|
6213
6218
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6214
6219
|
const updatedConfig = setDefaultModelSelection(globalConfig, providerId, model ?? "auto");
|
|
6215
6220
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
@@ -6240,8 +6245,8 @@ async function createServerHandle(config4) {
|
|
|
6240
6245
|
res.json({ success: true });
|
|
6241
6246
|
});
|
|
6242
6247
|
app.put("/api/sessions/:id/mode", async (req, res) => {
|
|
6243
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6244
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-
|
|
6248
|
+
const { getEventStore: getEventStore2 } = await import("./events-6UJR2NH4.js");
|
|
6249
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-GMO644G3.js");
|
|
6245
6250
|
const sessionId = req.params.id;
|
|
6246
6251
|
const session = sessionManager.getSession(sessionId);
|
|
6247
6252
|
if (!session) {
|
|
@@ -6297,14 +6302,14 @@ async function createServerHandle(config4) {
|
|
|
6297
6302
|
if (!callId || approved === void 0) {
|
|
6298
6303
|
return res.status(400).json({ error: "callId and approved are required" });
|
|
6299
6304
|
}
|
|
6300
|
-
const { providePathConfirmation } = await import("./tools-
|
|
6305
|
+
const { providePathConfirmation } = await import("./tools-2X2FC6W7.js");
|
|
6301
6306
|
const result = providePathConfirmation(callId, approved, alwaysAllow);
|
|
6302
6307
|
if (!result.found) {
|
|
6303
6308
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
6304
6309
|
}
|
|
6305
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6306
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-
|
|
6307
|
-
const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-
|
|
6310
|
+
const { getEventStore: getEventStore2 } = await import("./events-6UJR2NH4.js");
|
|
6311
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-GMO644G3.js");
|
|
6312
|
+
const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-QQNATDFM.js");
|
|
6308
6313
|
const eventStore = getEventStore2();
|
|
6309
6314
|
const events = eventStore.getEvents(sessionId);
|
|
6310
6315
|
const messages = buildMessagesFromStoredEvents2(events);
|
|
@@ -6321,7 +6326,7 @@ async function createServerHandle(config4) {
|
|
|
6321
6326
|
if (!callId || !answer) {
|
|
6322
6327
|
return res.status(400).json({ error: "callId and answer are required" });
|
|
6323
6328
|
}
|
|
6324
|
-
const { provideAnswer: provideAnswer2 } = await import("./tools-
|
|
6329
|
+
const { provideAnswer: provideAnswer2 } = await import("./tools-2X2FC6W7.js");
|
|
6325
6330
|
const found = provideAnswer2(callId, answer);
|
|
6326
6331
|
if (!found) {
|
|
6327
6332
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -6357,14 +6362,14 @@ async function createServerHandle(config4) {
|
|
|
6357
6362
|
if (!session) {
|
|
6358
6363
|
return res.status(404).json({ error: "Session not found" });
|
|
6359
6364
|
}
|
|
6360
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
6361
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
6365
|
+
const { stopSessionExecution } = await import("./chat-handler-ZFQIJIJT.js");
|
|
6366
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-2X2FC6W7.js");
|
|
6362
6367
|
stopSessionExecution(sessionId, sessionManager);
|
|
6363
6368
|
abortSession(sessionId);
|
|
6364
6369
|
cancelQuestionsForSession(sessionId, "Session stopped by user");
|
|
6365
6370
|
cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
|
|
6366
6371
|
sessionManager.clearMessageQueue(sessionId);
|
|
6367
|
-
const eventStore = (await import("./events-
|
|
6372
|
+
const eventStore = (await import("./events-6UJR2NH4.js")).getEventStore();
|
|
6368
6373
|
eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
|
|
6369
6374
|
res.json({ success: true });
|
|
6370
6375
|
});
|
|
@@ -6378,7 +6383,7 @@ async function createServerHandle(config4) {
|
|
|
6378
6383
|
if (typeof messageIndex !== "number" || messageIndex < 0) {
|
|
6379
6384
|
return res.status(400).json({ error: "messageIndex must be a non-negative number" });
|
|
6380
6385
|
}
|
|
6381
|
-
const { truncateSessionMessages } = await import("./events-
|
|
6386
|
+
const { truncateSessionMessages } = await import("./events-6UJR2NH4.js");
|
|
6382
6387
|
truncateSessionMessages(sessionId, messageIndex);
|
|
6383
6388
|
res.json({ success: true });
|
|
6384
6389
|
});
|
|
@@ -6396,7 +6401,7 @@ async function createServerHandle(config4) {
|
|
|
6396
6401
|
if (!msg) {
|
|
6397
6402
|
return res.status(400).json({ error: "Message not found at this index" });
|
|
6398
6403
|
}
|
|
6399
|
-
const { truncateSessionMessages } = await import("./events-
|
|
6404
|
+
const { truncateSessionMessages } = await import("./events-6UJR2NH4.js");
|
|
6400
6405
|
truncateSessionMessages(sessionId, messageIndex - 1);
|
|
6401
6406
|
sessionManager.queueMessage(sessionId, "asap", msg.content, msg.attachments, msg.messageKind);
|
|
6402
6407
|
res.json({ success: true });
|
|
@@ -6428,7 +6433,7 @@ async function createServerHandle(config4) {
|
|
|
6428
6433
|
res.json({ accepted: true });
|
|
6429
6434
|
});
|
|
6430
6435
|
app.get("/api/settings", async (req, res) => {
|
|
6431
|
-
const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-
|
|
6436
|
+
const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-OAISIQVV.js");
|
|
6432
6437
|
const keysParam = req.query["keys"];
|
|
6433
6438
|
if (!keysParam) {
|
|
6434
6439
|
return res.status(400).json({ error: "keys query parameter is required" });
|
|
@@ -6441,19 +6446,19 @@ async function createServerHandle(config4) {
|
|
|
6441
6446
|
res.json(result);
|
|
6442
6447
|
});
|
|
6443
6448
|
app.get("/api/settings/:key", async (req, res) => {
|
|
6444
|
-
const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-
|
|
6449
|
+
const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-OAISIQVV.js");
|
|
6445
6450
|
const key = req.params.key;
|
|
6446
6451
|
const value = getSetting(key) ?? SETTINGS_DEFAULTS[key] ?? null;
|
|
6447
6452
|
res.json({ key, value });
|
|
6448
6453
|
});
|
|
6449
6454
|
app.get("/api/settings/:key", async (req, res) => {
|
|
6450
|
-
const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-
|
|
6455
|
+
const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-OAISIQVV.js");
|
|
6451
6456
|
const key = req.params.key;
|
|
6452
6457
|
const value = getSetting(key) ?? SETTINGS_DEFAULTS[key] ?? null;
|
|
6453
6458
|
res.json({ key, value });
|
|
6454
6459
|
});
|
|
6455
6460
|
app.put("/api/settings/:key", async (req, res) => {
|
|
6456
|
-
const { setSetting } = await import("./settings-
|
|
6461
|
+
const { setSetting } = await import("./settings-OAISIQVV.js");
|
|
6457
6462
|
const key = req.params.key;
|
|
6458
6463
|
const { value } = req.body;
|
|
6459
6464
|
if (value === void 0) {
|
|
@@ -6468,7 +6473,7 @@ async function createServerHandle(config4) {
|
|
|
6468
6473
|
let visionFallback;
|
|
6469
6474
|
let globalWorkdir;
|
|
6470
6475
|
try {
|
|
6471
|
-
const { loadGlobalConfig, getVisionFallback } = await import("./config-
|
|
6476
|
+
const { loadGlobalConfig, getVisionFallback } = await import("./config-MFKBDOOT.js");
|
|
6472
6477
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6473
6478
|
const fallback = getVisionFallback(globalConfig);
|
|
6474
6479
|
if (fallback) {
|
|
@@ -6541,13 +6546,79 @@ async function createServerHandle(config4) {
|
|
|
6541
6546
|
});
|
|
6542
6547
|
}
|
|
6543
6548
|
});
|
|
6549
|
+
app.get("/api/providers/models", async (req, res) => {
|
|
6550
|
+
const url = req.query["url"];
|
|
6551
|
+
if (!url) return res.status(400).json({ error: "url is required" });
|
|
6552
|
+
try {
|
|
6553
|
+
const { fetchModelsWithContext } = await import("./provider-manager-2NFFVCX5.js");
|
|
6554
|
+
const models = await fetchModelsWithContext(url);
|
|
6555
|
+
if (models.length === 0) {
|
|
6556
|
+
return res.status(404).json({ error: `No models found at ${buildModelsUrl(url)}`, url });
|
|
6557
|
+
}
|
|
6558
|
+
res.json({
|
|
6559
|
+
models: models.map((m) => ({
|
|
6560
|
+
id: m.id,
|
|
6561
|
+
contextWindow: m.contextWindow,
|
|
6562
|
+
defaultTemperature: m.defaultTemperature,
|
|
6563
|
+
defaultTopP: m.defaultTopP,
|
|
6564
|
+
defaultTopK: m.defaultTopK,
|
|
6565
|
+
defaultMaxTokens: m.defaultMaxTokens
|
|
6566
|
+
})),
|
|
6567
|
+
url
|
|
6568
|
+
});
|
|
6569
|
+
} catch (error) {
|
|
6570
|
+
res.status(400).json({
|
|
6571
|
+
error: `Failed to fetch models from ${url}: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
6572
|
+
url
|
|
6573
|
+
});
|
|
6574
|
+
}
|
|
6575
|
+
});
|
|
6576
|
+
app.post("/api/providers/test-params", async (req, res) => {
|
|
6577
|
+
const { url, model, params, apiKey } = req.body;
|
|
6578
|
+
if (!url) return res.status(400).json({ error: "url is required" });
|
|
6579
|
+
if (!model) return res.status(400).json({ error: "model is required" });
|
|
6580
|
+
try {
|
|
6581
|
+
const headers = { "Content-Type": "application/json" };
|
|
6582
|
+
if (apiKey) headers["Authorization"] = `Bearer ${apiKey}`;
|
|
6583
|
+
const body = {
|
|
6584
|
+
model,
|
|
6585
|
+
messages: [{ role: "user", content: "say hi in one word" }],
|
|
6586
|
+
max_tokens: 8e3,
|
|
6587
|
+
...params
|
|
6588
|
+
};
|
|
6589
|
+
const response = await fetch(`${ensureVersionPrefix(url)}/chat/completions`, {
|
|
6590
|
+
method: "POST",
|
|
6591
|
+
headers,
|
|
6592
|
+
body: JSON.stringify(body),
|
|
6593
|
+
signal: AbortSignal.timeout(15e3)
|
|
6594
|
+
});
|
|
6595
|
+
if (!response.ok) {
|
|
6596
|
+
const errorBody = await response.text();
|
|
6597
|
+
return res.status(400).json({ error: `API error (${response.status}): ${errorBody.slice(0, 200)}` });
|
|
6598
|
+
}
|
|
6599
|
+
const data = await response.json();
|
|
6600
|
+
const message = data.choices?.[0]?.message ?? {};
|
|
6601
|
+
res.json({ success: true, message, raw: JSON.stringify(data, null, 2).slice(0, 2e3) });
|
|
6602
|
+
} catch (error) {
|
|
6603
|
+
res.status(400).json({ error: error instanceof Error ? error.message : "Request failed" });
|
|
6604
|
+
}
|
|
6605
|
+
});
|
|
6544
6606
|
app.post("/api/providers", async (req, res) => {
|
|
6545
|
-
const {
|
|
6607
|
+
const {
|
|
6608
|
+
name,
|
|
6609
|
+
url,
|
|
6610
|
+
backend,
|
|
6611
|
+
apiKey,
|
|
6612
|
+
model,
|
|
6613
|
+
isLocal,
|
|
6614
|
+
thinkingField,
|
|
6615
|
+
models: modelConfigs
|
|
6616
|
+
} = req.body;
|
|
6546
6617
|
if (!name || !url || !backend) {
|
|
6547
6618
|
return res.status(400).json({ error: "name, url, and backend are required" });
|
|
6548
6619
|
}
|
|
6549
6620
|
try {
|
|
6550
|
-
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-
|
|
6621
|
+
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-MFKBDOOT.js");
|
|
6551
6622
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6552
6623
|
const providerBackend = backend;
|
|
6553
6624
|
const configWithProvider = addProvider(globalConfig, {
|
|
@@ -6556,7 +6627,18 @@ async function createServerHandle(config4) {
|
|
|
6556
6627
|
backend: providerBackend,
|
|
6557
6628
|
apiKey,
|
|
6558
6629
|
...isLocal !== void 0 ? { isLocal } : {},
|
|
6559
|
-
|
|
6630
|
+
...thinkingField ? { thinkingField } : {},
|
|
6631
|
+
models: modelConfigs?.length ? modelConfigs.map((m) => ({
|
|
6632
|
+
id: m.id,
|
|
6633
|
+
contextWindow: m.contextWindow,
|
|
6634
|
+
source: "user",
|
|
6635
|
+
...m.supportsVision !== void 0 ? { supportsVision: m.supportsVision } : {},
|
|
6636
|
+
...m.thinkingEnabled !== void 0 ? { thinkingEnabled: m.thinkingEnabled } : {},
|
|
6637
|
+
...m.thinkingLevel ? { thinkingLevel: m.thinkingLevel } : {},
|
|
6638
|
+
...m.nonThinkingEnabled !== void 0 ? { nonThinkingEnabled: m.nonThinkingEnabled } : {},
|
|
6639
|
+
...m.thinkingExtraKwargs ? { thinkingExtraKwargs: m.thinkingExtraKwargs } : {},
|
|
6640
|
+
...m.nonThinkingExtraKwargs ? { nonThinkingExtraKwargs: m.nonThinkingExtraKwargs } : {}
|
|
6641
|
+
})) : model ? [{ id: model, contextWindow: 2e5, source: "user" }] : [],
|
|
6560
6642
|
isActive: true
|
|
6561
6643
|
});
|
|
6562
6644
|
const finalConfig = setDefaultModelSelection(
|
|
@@ -6581,7 +6663,7 @@ async function createServerHandle(config4) {
|
|
|
6581
6663
|
app.post("/api/init/config", async (req, res) => {
|
|
6582
6664
|
const { workdir, visionFallback } = req.body;
|
|
6583
6665
|
try {
|
|
6584
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6666
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-MFKBDOOT.js");
|
|
6585
6667
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6586
6668
|
const updatedConfig = {
|
|
6587
6669
|
...globalConfig,
|
|
@@ -6609,7 +6691,7 @@ async function createServerHandle(config4) {
|
|
|
6609
6691
|
});
|
|
6610
6692
|
app.delete("/api/providers/:id", async (req, res) => {
|
|
6611
6693
|
const { id } = req.params;
|
|
6612
|
-
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-
|
|
6694
|
+
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-MFKBDOOT.js");
|
|
6613
6695
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6614
6696
|
const updatedConfig = removeProvider(globalConfig, id);
|
|
6615
6697
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
@@ -6620,7 +6702,7 @@ async function createServerHandle(config4) {
|
|
|
6620
6702
|
const { id } = req.params;
|
|
6621
6703
|
const { isLocal } = req.body;
|
|
6622
6704
|
try {
|
|
6623
|
-
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-
|
|
6705
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-MFKBDOOT.js");
|
|
6624
6706
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6625
6707
|
const provider = globalConfig.providers.find((p) => p.id === id);
|
|
6626
6708
|
if (!provider) {
|
|
@@ -6636,6 +6718,52 @@ async function createServerHandle(config4) {
|
|
|
6636
6718
|
res.status(500).json({ error: error instanceof Error ? error.message : "Failed to update provider" });
|
|
6637
6719
|
}
|
|
6638
6720
|
});
|
|
6721
|
+
app.put("/api/providers/:id", async (req, res) => {
|
|
6722
|
+
const { id } = req.params;
|
|
6723
|
+
const {
|
|
6724
|
+
name,
|
|
6725
|
+
url,
|
|
6726
|
+
backend,
|
|
6727
|
+
apiKey,
|
|
6728
|
+
isLocal,
|
|
6729
|
+
thinkingField,
|
|
6730
|
+
models: modelConfigs
|
|
6731
|
+
} = req.body;
|
|
6732
|
+
try {
|
|
6733
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-MFKBDOOT.js");
|
|
6734
|
+
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6735
|
+
const provider = globalConfig.providers.find((p) => p.id === id);
|
|
6736
|
+
if (!provider) {
|
|
6737
|
+
return res.status(404).json({ error: "Provider not found" });
|
|
6738
|
+
}
|
|
6739
|
+
const updates = {};
|
|
6740
|
+
if (name !== void 0) updates["name"] = name;
|
|
6741
|
+
if (url !== void 0) updates["url"] = url;
|
|
6742
|
+
if (backend !== void 0) updates["backend"] = backend;
|
|
6743
|
+
if (apiKey !== void 0) updates["apiKey"] = apiKey || void 0;
|
|
6744
|
+
if (isLocal !== void 0) updates["isLocal"] = isLocal;
|
|
6745
|
+
if (thinkingField !== void 0) updates["thinkingField"] = thinkingField || void 0;
|
|
6746
|
+
if (modelConfigs !== void 0) {
|
|
6747
|
+
updates["models"] = modelConfigs.map((m) => ({
|
|
6748
|
+
id: m.id,
|
|
6749
|
+
contextWindow: m.contextWindow,
|
|
6750
|
+
source: "user",
|
|
6751
|
+
...m.supportsVision !== void 0 ? { supportsVision: m.supportsVision } : {},
|
|
6752
|
+
...m.thinkingEnabled !== void 0 ? { thinkingEnabled: m.thinkingEnabled } : {},
|
|
6753
|
+
...m.thinkingLevel ? { thinkingLevel: m.thinkingLevel } : {},
|
|
6754
|
+
...m.nonThinkingEnabled !== void 0 ? { nonThinkingEnabled: m.nonThinkingEnabled } : {},
|
|
6755
|
+
...m.thinkingExtraKwargs ? { thinkingExtraKwargs: m.thinkingExtraKwargs } : {},
|
|
6756
|
+
...m.nonThinkingExtraKwargs ? { nonThinkingExtraKwargs: m.nonThinkingExtraKwargs } : {}
|
|
6757
|
+
}));
|
|
6758
|
+
}
|
|
6759
|
+
const updatedConfig = updateProvider(globalConfig, id, updates);
|
|
6760
|
+
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
6761
|
+
providerManager.setProviders(updatedConfig.providers, updatedConfig.defaultModelSelection ?? void 0);
|
|
6762
|
+
res.json({ success: true, provider: updatedConfig.providers.find((p) => p.id === id) });
|
|
6763
|
+
} catch (error) {
|
|
6764
|
+
res.status(500).json({ error: error instanceof Error ? error.message : "Failed to update provider" });
|
|
6765
|
+
}
|
|
6766
|
+
});
|
|
6639
6767
|
app.get("/api/providers/:id/models", async (req, res) => {
|
|
6640
6768
|
const { id } = req.params;
|
|
6641
6769
|
const models = await providerManager.getProviderModels(id);
|
|
@@ -6649,7 +6777,7 @@ async function createServerHandle(config4) {
|
|
|
6649
6777
|
return res.status(400).json({ error: result.error });
|
|
6650
6778
|
}
|
|
6651
6779
|
const llmClient = getLLMClient();
|
|
6652
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
6780
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-MFKBDOOT.js");
|
|
6653
6781
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6654
6782
|
const updatedConfig = setDefaultModelSelection(globalConfig, id, llmClient.getModel());
|
|
6655
6783
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
@@ -6668,7 +6796,7 @@ async function createServerHandle(config4) {
|
|
|
6668
6796
|
modelId,
|
|
6669
6797
|
body
|
|
6670
6798
|
});
|
|
6671
|
-
const hasFullSettings = body.temperature !== void 0 || body.topP !== void 0 || body.topK !== void 0 || body.maxTokens !== void 0;
|
|
6799
|
+
const hasFullSettings = body.temperature !== void 0 || body.topP !== void 0 || body.topK !== void 0 || body.maxTokens !== void 0 || body.thinkingEnabled !== void 0 || body.thinkingLevel !== void 0 || body.nonThinkingEnabled !== void 0 || body.thinkingExtraKwargs !== void 0 || body.nonThinkingExtraKwargs !== void 0;
|
|
6672
6800
|
let result;
|
|
6673
6801
|
if (hasFullSettings) {
|
|
6674
6802
|
result = await providerManager.updateModelSettings(id, modelId, body);
|
|
@@ -6680,7 +6808,7 @@ async function createServerHandle(config4) {
|
|
|
6680
6808
|
if (!result.success) {
|
|
6681
6809
|
return res.status(400).json({ error: result.error });
|
|
6682
6810
|
}
|
|
6683
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6811
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-MFKBDOOT.js");
|
|
6684
6812
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6685
6813
|
const updatedProviders = providerManager.getProviders();
|
|
6686
6814
|
const updatedConfig = {
|
|
@@ -6746,13 +6874,13 @@ async function createServerHandle(config4) {
|
|
|
6746
6874
|
})
|
|
6747
6875
|
);
|
|
6748
6876
|
app.get("/api/sessions/:id/background-processes", async (req, res) => {
|
|
6749
|
-
const { getSessionProcesses } = await import("./manager-
|
|
6877
|
+
const { getSessionProcesses } = await import("./manager-NTL3MLGN.js");
|
|
6750
6878
|
const sessionId = req.params.id;
|
|
6751
6879
|
const processes = getSessionProcesses(sessionId);
|
|
6752
6880
|
res.json({ processes });
|
|
6753
6881
|
});
|
|
6754
6882
|
app.post("/api/sessions/:id/background-process/:processId/stop", async (req, res) => {
|
|
6755
|
-
const { stopProcess } = await import("./manager-
|
|
6883
|
+
const { stopProcess } = await import("./manager-NTL3MLGN.js");
|
|
6756
6884
|
const sessionId = req.params.id;
|
|
6757
6885
|
const processId = req.params.processId;
|
|
6758
6886
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -6766,7 +6894,7 @@ async function createServerHandle(config4) {
|
|
|
6766
6894
|
res.status(500).json({ error: err instanceof Error ? err.message : "Failed to stop process" });
|
|
6767
6895
|
}
|
|
6768
6896
|
});
|
|
6769
|
-
const { getCurrentBranch } = await import("./branch.api-
|
|
6897
|
+
const { getCurrentBranch } = await import("./branch.api-TCWNJXYA.js");
|
|
6770
6898
|
app.get("/api/branch", async (req, res) => {
|
|
6771
6899
|
await getCurrentBranch(req, res);
|
|
6772
6900
|
});
|
|
@@ -6894,7 +7022,7 @@ async function createServerHandle(config4) {
|
|
|
6894
7022
|
providerManager
|
|
6895
7023
|
);
|
|
6896
7024
|
const wss = wssExports.wss;
|
|
6897
|
-
const { QueueProcessor } = await import("./processor-
|
|
7025
|
+
const { QueueProcessor } = await import("./processor-EJJTSLRL.js");
|
|
6898
7026
|
const queueProcessor = new QueueProcessor({
|
|
6899
7027
|
sessionManager,
|
|
6900
7028
|
providerManager,
|
|
@@ -6932,9 +7060,9 @@ async function createServerHandle(config4) {
|
|
|
6932
7060
|
logger.info("Shutting down...");
|
|
6933
7061
|
void (async () => {
|
|
6934
7062
|
await devServerManager.stopAll();
|
|
6935
|
-
const { stopAllInspectProxies } = await import("./inspect-proxy-
|
|
7063
|
+
const { stopAllInspectProxies } = await import("./inspect-proxy-JZ54RBUN.js");
|
|
6936
7064
|
stopAllInspectProxies();
|
|
6937
|
-
const { cleanupAllProcesses } = await import("./store-
|
|
7065
|
+
const { cleanupAllProcesses } = await import("./store-JZW6VPEK.js");
|
|
6938
7066
|
cleanupAllProcesses();
|
|
6939
7067
|
viteServer?.close();
|
|
6940
7068
|
for (const client of wss.clients) {
|
|
@@ -6966,4 +7094,4 @@ export {
|
|
|
6966
7094
|
createServerHandle,
|
|
6967
7095
|
createServer
|
|
6968
7096
|
};
|
|
6969
|
-
//# sourceMappingURL=chunk-
|
|
7097
|
+
//# sourceMappingURL=chunk-EYE2JMLA.js.map
|