openfox 2.0.0-beta.9 → 2.0.1
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/README.md +11 -0
- package/dist/{chat-handler-6COBLIDR.js → chat-handler-LJMW4OK3.js} +9 -9
- package/dist/{chunk-LR5R7EEE.js → chunk-32GQUDLN.js} +22 -18
- package/dist/{chunk-DMH6JVPF.js → chunk-7ZMMDZU7.js} +431 -32
- package/dist/{chunk-CDDMHSZF.js → chunk-CK6LGE7G.js} +10 -6
- package/dist/{chunk-VIIRNJDT.js → chunk-FFEAEPJB.js} +80 -245
- package/dist/{chunk-EZUR7OEP.js → chunk-HPCGVAS4.js} +21 -45
- package/dist/{chunk-XJEOP6XU.js → chunk-ITWVFGFV.js} +1 -30
- package/dist/{chunk-C75I2KZM.js → chunk-LEDG5WAN.js} +29 -35
- package/dist/{chunk-KUG27ZUR.js → chunk-MFUPS6UE.js} +6 -6
- package/dist/{chunk-NPHYEUYE.js → chunk-XEK3KII6.js} +55 -4
- package/dist/{chunk-J2FFLZ5Z.js → chunk-ZDY4WMZJ.js} +184 -71
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{config-TDVA7MQN.js → config-BU66P4KX.js} +2 -7
- package/dist/{events-PQ3KTI5H.js → events-ZKWAKWI7.js} +3 -3
- package/dist/{folding-CXORTBAU.js → folding-YOCGTZYH.js} +2 -2
- package/dist/{orchestrator-ZNGTMZ7W.js → orchestrator-LX6FKB6L.js} +8 -8
- package/dist/package.json +2 -1
- package/dist/{processor-WMAU4C2N.js → processor-NMYSEBC7.js} +11 -6
- package/dist/{protocol-CDOV1pyc.d.ts → protocol-D59sCy9L.d.ts} +15 -6
- package/dist/{provider-BGH4MBLH.js → provider-DTNQYCMV.js} +9 -20
- package/dist/provider-manager-LMHAHLIF.js +15 -0
- package/dist/{serve-N3LBZUVN.js → serve-SGNL43UL.js} +14 -15
- package/dist/server/index.d.ts +22 -16
- package/dist/server/index.js +9 -10
- package/dist/shared/index.d.ts +2 -2
- package/dist/{tools-CQGEU3JK.js → tools-BOE5T3KC.js} +7 -7
- package/dist/web/assets/index-Bego8SwT.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 +2 -1
- package/dist/chunk-UKTPL5ZG.js +0 -469
- package/dist/web/assets/index-BJuF4wi7.js +0 -299
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
injectWorkflowKickoffIfNeeded,
|
|
4
4
|
runAgentTurn,
|
|
5
5
|
runChatTurn
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LEDG5WAN.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-32GQUDLN.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,11 +97,11 @@ import {
|
|
|
94
97
|
updateSessionMetadata,
|
|
95
98
|
updateSessionProvider,
|
|
96
99
|
updateSessionRunning
|
|
97
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-XEK3KII6.js";
|
|
98
101
|
import {
|
|
99
102
|
buildMessagesFromStoredEvents,
|
|
100
103
|
foldPendingConfirmations
|
|
101
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-ITWVFGFV.js";
|
|
102
105
|
import {
|
|
103
106
|
createChatErrorMessage,
|
|
104
107
|
createChatMessageMessage,
|
|
@@ -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";
|
|
@@ -131,29 +131,27 @@ import {
|
|
|
131
131
|
createServerMessage
|
|
132
132
|
} from "./chunk-BVHFMAVN.js";
|
|
133
133
|
import {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
} from "./chunk-DMH6JVPF.js";
|
|
134
|
+
getGlobalConfigDir
|
|
135
|
+
} from "./chunk-CQGTEGKL.js";
|
|
137
136
|
import {
|
|
138
137
|
SessionNotFoundError,
|
|
138
|
+
buildModelsUrl,
|
|
139
139
|
createLLMClient,
|
|
140
|
+
createProviderManager,
|
|
140
141
|
detectModel,
|
|
141
|
-
getLlmStatus
|
|
142
|
-
} from "./chunk-UKTPL5ZG.js";
|
|
143
|
-
import {
|
|
144
|
-
detectBackend,
|
|
145
142
|
ensureVersionPrefix,
|
|
143
|
+
getLlmStatus,
|
|
144
|
+
parseDefaultModelSelection
|
|
145
|
+
} from "./chunk-7ZMMDZU7.js";
|
|
146
|
+
import {
|
|
146
147
|
getBackendDisplayName,
|
|
147
148
|
getModelProfile,
|
|
148
149
|
modelSupportsVision
|
|
149
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-FFEAEPJB.js";
|
|
150
151
|
import {
|
|
151
152
|
logger,
|
|
152
153
|
setLogLevel
|
|
153
154
|
} from "./chunk-K44MW7JJ.js";
|
|
154
|
-
import {
|
|
155
|
-
getGlobalConfigDir
|
|
156
|
-
} from "./chunk-CQGTEGKL.js";
|
|
157
155
|
|
|
158
156
|
// src/server/index.ts
|
|
159
157
|
import express from "express";
|
|
@@ -2844,6 +2842,8 @@ function createWebSocketServer(httpServer, config4, getLLMClient, getActiveProvi
|
|
|
2844
2842
|
sessionLLMClients.delete(sessionId);
|
|
2845
2843
|
return getLLMClient();
|
|
2846
2844
|
}
|
|
2845
|
+
const modelConfig = provider.models.find((m) => m.id === session.providerModel);
|
|
2846
|
+
const reasoningEffort = modelConfig?.thinkingEnabled && modelConfig?.thinkingLevel ? modelConfig.thinkingLevel : void 0;
|
|
2847
2847
|
const baseUrl = ensureVersionPrefix(provider.url);
|
|
2848
2848
|
const sessionConfig = {
|
|
2849
2849
|
...config4,
|
|
@@ -2851,11 +2851,13 @@ function createWebSocketServer(httpServer, config4, getLLMClient, getActiveProvi
|
|
|
2851
2851
|
...config4.llm,
|
|
2852
2852
|
baseUrl,
|
|
2853
2853
|
model: session.providerModel,
|
|
2854
|
-
...provider.apiKey && { apiKey: provider.apiKey }
|
|
2854
|
+
...provider.apiKey && { apiKey: provider.apiKey },
|
|
2855
|
+
...provider.thinkingField && { thinkingField: provider.thinkingField },
|
|
2856
|
+
...reasoningEffort && { reasoningEffort }
|
|
2855
2857
|
}
|
|
2856
2858
|
};
|
|
2857
2859
|
const client = createLLMClient(sessionConfig);
|
|
2858
|
-
if (provider.backend !== "
|
|
2860
|
+
if (provider.backend !== "unknown") {
|
|
2859
2861
|
client.setBackend(provider.backend);
|
|
2860
2862
|
}
|
|
2861
2863
|
client.setModel(session.providerModel);
|
|
@@ -5282,8 +5284,7 @@ ${summary}`,
|
|
|
5282
5284
|
metadataEntries: eventState.metadataEntries,
|
|
5283
5285
|
contextWindows: [],
|
|
5284
5286
|
// Derived from events, not stored separately
|
|
5285
|
-
executionState: eventState.
|
|
5286
|
-
lastModeWithReminder: eventState.lastModeWithReminder,
|
|
5287
|
+
executionState: eventState.cachedSystemPrompt || hasCachedPrompt ? {
|
|
5287
5288
|
cachedSystemPrompt: cachedData?.systemPrompt ?? eventState.cachedSystemPrompt,
|
|
5288
5289
|
dynamicContextHash: cachedData?.hash ?? eventState.dynamicContextHash
|
|
5289
5290
|
} : null
|
|
@@ -5831,7 +5832,7 @@ import { Router as Router6 } from "express";
|
|
|
5831
5832
|
import { spawn as spawn5 } from "child_process";
|
|
5832
5833
|
|
|
5833
5834
|
// src/constants.ts
|
|
5834
|
-
var VERSION = "2.0.0
|
|
5835
|
+
var VERSION = "2.0.0";
|
|
5835
5836
|
|
|
5836
5837
|
// src/server/routes/auto-update.ts
|
|
5837
5838
|
var updateInProgress = false;
|
|
@@ -5941,29 +5942,19 @@ async function createServerHandle(config4) {
|
|
|
5941
5942
|
}
|
|
5942
5943
|
async function initLLM() {
|
|
5943
5944
|
const llmClient = getLLMClient();
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
if (
|
|
5947
|
-
|
|
5948
|
-
llmClient.setBackend(backend);
|
|
5949
|
-
if (!useMock2) {
|
|
5950
|
-
logger.info("Auto-detected LLM backend", { backend: getBackendDisplayName(backend) });
|
|
5951
|
-
}
|
|
5952
|
-
} else {
|
|
5953
|
-
backend = config4.llm.backend;
|
|
5954
|
-
llmClient.setBackend(backend);
|
|
5955
|
-
if (!useMock2) {
|
|
5956
|
-
logger.info("Using configured LLM backend", { backend: getBackendDisplayName(backend) });
|
|
5957
|
-
}
|
|
5945
|
+
const backend = config4.llm.backend;
|
|
5946
|
+
llmClient.setBackend(backend);
|
|
5947
|
+
if (!useMock) {
|
|
5948
|
+
logger.info("Using configured LLM backend", { backend: getBackendDisplayName(backend) });
|
|
5958
5949
|
}
|
|
5959
5950
|
const detected = await detectModel(config4.llm.baseUrl);
|
|
5960
5951
|
if (detected) {
|
|
5961
5952
|
llmClient.setModel(detected);
|
|
5962
|
-
if (!
|
|
5953
|
+
if (!useMock) {
|
|
5963
5954
|
logger.info("Auto-detected LLM model", { model: detected, backend: getBackendDisplayName(backend) });
|
|
5964
5955
|
}
|
|
5965
5956
|
} else {
|
|
5966
|
-
if (!
|
|
5957
|
+
if (!useMock) {
|
|
5967
5958
|
logger.warn("Could not auto-detect model, using config", { model: config4.llm.model });
|
|
5968
5959
|
}
|
|
5969
5960
|
}
|
|
@@ -6134,7 +6125,7 @@ async function createServerHandle(config4) {
|
|
|
6134
6125
|
res.json({ project });
|
|
6135
6126
|
});
|
|
6136
6127
|
app.get("/api/sessions", async (req, res) => {
|
|
6137
|
-
const { getRecentUserPromptsForSession } = await import("./events-
|
|
6128
|
+
const { getRecentUserPromptsForSession } = await import("./events-ZKWAKWI7.js");
|
|
6138
6129
|
const projectId = req.query["projectId"];
|
|
6139
6130
|
const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
|
|
6140
6131
|
const offset = parseInt(req.query["offset"]) || 0;
|
|
@@ -6167,8 +6158,8 @@ async function createServerHandle(config4) {
|
|
|
6167
6158
|
res.status(201).json({ session });
|
|
6168
6159
|
});
|
|
6169
6160
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
6170
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6171
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-
|
|
6161
|
+
const { getEventStore: getEventStore2 } = await import("./events-ZKWAKWI7.js");
|
|
6162
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-YOCGTZYH.js");
|
|
6172
6163
|
const session = sessionManager.getSession(req.params.id);
|
|
6173
6164
|
if (!session) {
|
|
6174
6165
|
return res.status(404).json({ error: "Session not found" });
|
|
@@ -6198,8 +6189,8 @@ async function createServerHandle(config4) {
|
|
|
6198
6189
|
res.json({ success: true });
|
|
6199
6190
|
});
|
|
6200
6191
|
app.post("/api/sessions/:id/provider", async (req, res) => {
|
|
6201
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6202
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-
|
|
6192
|
+
const { getEventStore: getEventStore2 } = await import("./events-ZKWAKWI7.js");
|
|
6193
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-YOCGTZYH.js");
|
|
6203
6194
|
const sessionId = req.params.id;
|
|
6204
6195
|
const session = sessionManager.getSession(sessionId);
|
|
6205
6196
|
if (!session) {
|
|
@@ -6210,7 +6201,7 @@ async function createServerHandle(config4) {
|
|
|
6210
6201
|
return res.status(400).json({ error: "providerId is required" });
|
|
6211
6202
|
}
|
|
6212
6203
|
sessionManager.setSessionProvider(sessionId, providerId, model ?? "auto");
|
|
6213
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
6204
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-BU66P4KX.js");
|
|
6214
6205
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6215
6206
|
const updatedConfig = setDefaultModelSelection(globalConfig, providerId, model ?? "auto");
|
|
6216
6207
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
@@ -6241,8 +6232,8 @@ async function createServerHandle(config4) {
|
|
|
6241
6232
|
res.json({ success: true });
|
|
6242
6233
|
});
|
|
6243
6234
|
app.put("/api/sessions/:id/mode", async (req, res) => {
|
|
6244
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6245
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-
|
|
6235
|
+
const { getEventStore: getEventStore2 } = await import("./events-ZKWAKWI7.js");
|
|
6236
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-YOCGTZYH.js");
|
|
6246
6237
|
const sessionId = req.params.id;
|
|
6247
6238
|
const session = sessionManager.getSession(sessionId);
|
|
6248
6239
|
if (!session) {
|
|
@@ -6298,13 +6289,13 @@ async function createServerHandle(config4) {
|
|
|
6298
6289
|
if (!callId || approved === void 0) {
|
|
6299
6290
|
return res.status(400).json({ error: "callId and approved are required" });
|
|
6300
6291
|
}
|
|
6301
|
-
const { providePathConfirmation } = await import("./tools-
|
|
6292
|
+
const { providePathConfirmation } = await import("./tools-BOE5T3KC.js");
|
|
6302
6293
|
const result = providePathConfirmation(callId, approved, alwaysAllow);
|
|
6303
6294
|
if (!result.found) {
|
|
6304
6295
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
6305
6296
|
}
|
|
6306
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6307
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-
|
|
6297
|
+
const { getEventStore: getEventStore2 } = await import("./events-ZKWAKWI7.js");
|
|
6298
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-YOCGTZYH.js");
|
|
6308
6299
|
const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-CN24IKQN.js");
|
|
6309
6300
|
const eventStore = getEventStore2();
|
|
6310
6301
|
const events = eventStore.getEvents(sessionId);
|
|
@@ -6322,7 +6313,7 @@ async function createServerHandle(config4) {
|
|
|
6322
6313
|
if (!callId || !answer) {
|
|
6323
6314
|
return res.status(400).json({ error: "callId and answer are required" });
|
|
6324
6315
|
}
|
|
6325
|
-
const { provideAnswer: provideAnswer2 } = await import("./tools-
|
|
6316
|
+
const { provideAnswer: provideAnswer2 } = await import("./tools-BOE5T3KC.js");
|
|
6326
6317
|
const found = provideAnswer2(callId, answer);
|
|
6327
6318
|
if (!found) {
|
|
6328
6319
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -6358,14 +6349,14 @@ async function createServerHandle(config4) {
|
|
|
6358
6349
|
if (!session) {
|
|
6359
6350
|
return res.status(404).json({ error: "Session not found" });
|
|
6360
6351
|
}
|
|
6361
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
6362
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
6352
|
+
const { stopSessionExecution } = await import("./chat-handler-LJMW4OK3.js");
|
|
6353
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-BOE5T3KC.js");
|
|
6363
6354
|
stopSessionExecution(sessionId, sessionManager);
|
|
6364
6355
|
abortSession(sessionId);
|
|
6365
6356
|
cancelQuestionsForSession(sessionId, "Session stopped by user");
|
|
6366
6357
|
cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
|
|
6367
6358
|
sessionManager.clearMessageQueue(sessionId);
|
|
6368
|
-
const eventStore = (await import("./events-
|
|
6359
|
+
const eventStore = (await import("./events-ZKWAKWI7.js")).getEventStore();
|
|
6369
6360
|
eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
|
|
6370
6361
|
res.json({ success: true });
|
|
6371
6362
|
});
|
|
@@ -6379,7 +6370,7 @@ async function createServerHandle(config4) {
|
|
|
6379
6370
|
if (typeof messageIndex !== "number" || messageIndex < 0) {
|
|
6380
6371
|
return res.status(400).json({ error: "messageIndex must be a non-negative number" });
|
|
6381
6372
|
}
|
|
6382
|
-
const { truncateSessionMessages } = await import("./events-
|
|
6373
|
+
const { truncateSessionMessages } = await import("./events-ZKWAKWI7.js");
|
|
6383
6374
|
truncateSessionMessages(sessionId, messageIndex);
|
|
6384
6375
|
res.json({ success: true });
|
|
6385
6376
|
});
|
|
@@ -6397,7 +6388,7 @@ async function createServerHandle(config4) {
|
|
|
6397
6388
|
if (!msg) {
|
|
6398
6389
|
return res.status(400).json({ error: "Message not found at this index" });
|
|
6399
6390
|
}
|
|
6400
|
-
const { truncateSessionMessages } = await import("./events-
|
|
6391
|
+
const { truncateSessionMessages } = await import("./events-ZKWAKWI7.js");
|
|
6401
6392
|
truncateSessionMessages(sessionId, messageIndex - 1);
|
|
6402
6393
|
sessionManager.queueMessage(sessionId, "asap", msg.content, msg.attachments, msg.messageKind);
|
|
6403
6394
|
res.json({ success: true });
|
|
@@ -6469,7 +6460,7 @@ async function createServerHandle(config4) {
|
|
|
6469
6460
|
let visionFallback;
|
|
6470
6461
|
let globalWorkdir;
|
|
6471
6462
|
try {
|
|
6472
|
-
const { loadGlobalConfig, getVisionFallback } = await import("./config-
|
|
6463
|
+
const { loadGlobalConfig, getVisionFallback } = await import("./config-BU66P4KX.js");
|
|
6473
6464
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6474
6465
|
const fallback = getVisionFallback(globalConfig);
|
|
6475
6466
|
if (fallback) {
|
|
@@ -6522,17 +6513,16 @@ async function createServerHandle(config4) {
|
|
|
6522
6513
|
});
|
|
6523
6514
|
});
|
|
6524
6515
|
app.post("/api/providers/test", async (req, res) => {
|
|
6525
|
-
const { url,
|
|
6516
|
+
const { url, backend: reqBackend } = req.body;
|
|
6526
6517
|
if (!url) {
|
|
6527
6518
|
return res.status(400).json({ error: "url is required" });
|
|
6528
6519
|
}
|
|
6529
6520
|
try {
|
|
6530
|
-
const backend = skipBackendDetection ? "auto" : await detectBackend(url);
|
|
6531
6521
|
const model = await detectModel(url);
|
|
6532
6522
|
res.json({
|
|
6533
6523
|
success: true,
|
|
6534
6524
|
url,
|
|
6535
|
-
backend,
|
|
6525
|
+
backend: reqBackend || "unknown",
|
|
6536
6526
|
model
|
|
6537
6527
|
});
|
|
6538
6528
|
} catch (error) {
|
|
@@ -6542,13 +6532,79 @@ async function createServerHandle(config4) {
|
|
|
6542
6532
|
});
|
|
6543
6533
|
}
|
|
6544
6534
|
});
|
|
6535
|
+
app.get("/api/providers/models", async (req, res) => {
|
|
6536
|
+
const url = req.query["url"];
|
|
6537
|
+
if (!url) return res.status(400).json({ error: "url is required" });
|
|
6538
|
+
try {
|
|
6539
|
+
const { fetchModelsWithContext } = await import("./provider-manager-LMHAHLIF.js");
|
|
6540
|
+
const models = await fetchModelsWithContext(url);
|
|
6541
|
+
if (models.length === 0) {
|
|
6542
|
+
return res.status(404).json({ error: `No models found at ${buildModelsUrl(url)}`, url });
|
|
6543
|
+
}
|
|
6544
|
+
res.json({
|
|
6545
|
+
models: models.map((m) => ({
|
|
6546
|
+
id: m.id,
|
|
6547
|
+
contextWindow: m.contextWindow,
|
|
6548
|
+
defaultTemperature: m.defaultTemperature,
|
|
6549
|
+
defaultTopP: m.defaultTopP,
|
|
6550
|
+
defaultTopK: m.defaultTopK,
|
|
6551
|
+
defaultMaxTokens: m.defaultMaxTokens
|
|
6552
|
+
})),
|
|
6553
|
+
url
|
|
6554
|
+
});
|
|
6555
|
+
} catch (error) {
|
|
6556
|
+
res.status(400).json({
|
|
6557
|
+
error: `Failed to fetch models from ${url}: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
6558
|
+
url
|
|
6559
|
+
});
|
|
6560
|
+
}
|
|
6561
|
+
});
|
|
6562
|
+
app.post("/api/providers/test-params", async (req, res) => {
|
|
6563
|
+
const { url, model, params, apiKey } = req.body;
|
|
6564
|
+
if (!url) return res.status(400).json({ error: "url is required" });
|
|
6565
|
+
if (!model) return res.status(400).json({ error: "model is required" });
|
|
6566
|
+
try {
|
|
6567
|
+
const headers = { "Content-Type": "application/json" };
|
|
6568
|
+
if (apiKey) headers["Authorization"] = `Bearer ${apiKey}`;
|
|
6569
|
+
const body = {
|
|
6570
|
+
model,
|
|
6571
|
+
messages: [{ role: "user", content: "say hi in one word" }],
|
|
6572
|
+
max_tokens: 8e3,
|
|
6573
|
+
...params
|
|
6574
|
+
};
|
|
6575
|
+
const response = await fetch(`${ensureVersionPrefix(url)}/chat/completions`, {
|
|
6576
|
+
method: "POST",
|
|
6577
|
+
headers,
|
|
6578
|
+
body: JSON.stringify(body),
|
|
6579
|
+
signal: AbortSignal.timeout(15e3)
|
|
6580
|
+
});
|
|
6581
|
+
if (!response.ok) {
|
|
6582
|
+
const errorBody = await response.text();
|
|
6583
|
+
return res.status(400).json({ error: `API error (${response.status}): ${errorBody.slice(0, 200)}` });
|
|
6584
|
+
}
|
|
6585
|
+
const data = await response.json();
|
|
6586
|
+
const message = data.choices?.[0]?.message ?? {};
|
|
6587
|
+
res.json({ success: true, message, raw: JSON.stringify(data, null, 2).slice(0, 2e3) });
|
|
6588
|
+
} catch (error) {
|
|
6589
|
+
res.status(400).json({ error: error instanceof Error ? error.message : "Request failed" });
|
|
6590
|
+
}
|
|
6591
|
+
});
|
|
6545
6592
|
app.post("/api/providers", async (req, res) => {
|
|
6546
|
-
const {
|
|
6593
|
+
const {
|
|
6594
|
+
name,
|
|
6595
|
+
url,
|
|
6596
|
+
backend,
|
|
6597
|
+
apiKey,
|
|
6598
|
+
model,
|
|
6599
|
+
isLocal,
|
|
6600
|
+
thinkingField,
|
|
6601
|
+
models: modelConfigs
|
|
6602
|
+
} = req.body;
|
|
6547
6603
|
if (!name || !url || !backend) {
|
|
6548
6604
|
return res.status(400).json({ error: "name, url, and backend are required" });
|
|
6549
6605
|
}
|
|
6550
6606
|
try {
|
|
6551
|
-
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-
|
|
6607
|
+
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-BU66P4KX.js");
|
|
6552
6608
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6553
6609
|
const providerBackend = backend;
|
|
6554
6610
|
const configWithProvider = addProvider(globalConfig, {
|
|
@@ -6557,7 +6613,18 @@ async function createServerHandle(config4) {
|
|
|
6557
6613
|
backend: providerBackend,
|
|
6558
6614
|
apiKey,
|
|
6559
6615
|
...isLocal !== void 0 ? { isLocal } : {},
|
|
6560
|
-
|
|
6616
|
+
...thinkingField ? { thinkingField } : {},
|
|
6617
|
+
models: modelConfigs?.length ? modelConfigs.map((m) => ({
|
|
6618
|
+
id: m.id,
|
|
6619
|
+
contextWindow: m.contextWindow,
|
|
6620
|
+
source: "user",
|
|
6621
|
+
...m.supportsVision !== void 0 ? { supportsVision: m.supportsVision } : {},
|
|
6622
|
+
...m.thinkingEnabled !== void 0 ? { thinkingEnabled: m.thinkingEnabled } : {},
|
|
6623
|
+
...m.thinkingLevel ? { thinkingLevel: m.thinkingLevel } : {},
|
|
6624
|
+
...m.nonThinkingEnabled !== void 0 ? { nonThinkingEnabled: m.nonThinkingEnabled } : {},
|
|
6625
|
+
...m.thinkingExtraKwargs ? { thinkingExtraKwargs: m.thinkingExtraKwargs } : {},
|
|
6626
|
+
...m.nonThinkingExtraKwargs ? { nonThinkingExtraKwargs: m.nonThinkingExtraKwargs } : {}
|
|
6627
|
+
})) : model ? [{ id: model, contextWindow: 2e5, source: "user" }] : [],
|
|
6561
6628
|
isActive: true
|
|
6562
6629
|
});
|
|
6563
6630
|
const finalConfig = setDefaultModelSelection(
|
|
@@ -6582,7 +6649,7 @@ async function createServerHandle(config4) {
|
|
|
6582
6649
|
app.post("/api/init/config", async (req, res) => {
|
|
6583
6650
|
const { workdir, visionFallback } = req.body;
|
|
6584
6651
|
try {
|
|
6585
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6652
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-BU66P4KX.js");
|
|
6586
6653
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6587
6654
|
const updatedConfig = {
|
|
6588
6655
|
...globalConfig,
|
|
@@ -6610,7 +6677,7 @@ async function createServerHandle(config4) {
|
|
|
6610
6677
|
});
|
|
6611
6678
|
app.delete("/api/providers/:id", async (req, res) => {
|
|
6612
6679
|
const { id } = req.params;
|
|
6613
|
-
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-
|
|
6680
|
+
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-BU66P4KX.js");
|
|
6614
6681
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6615
6682
|
const updatedConfig = removeProvider(globalConfig, id);
|
|
6616
6683
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
@@ -6621,7 +6688,7 @@ async function createServerHandle(config4) {
|
|
|
6621
6688
|
const { id } = req.params;
|
|
6622
6689
|
const { isLocal } = req.body;
|
|
6623
6690
|
try {
|
|
6624
|
-
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-
|
|
6691
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-BU66P4KX.js");
|
|
6625
6692
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6626
6693
|
const provider = globalConfig.providers.find((p) => p.id === id);
|
|
6627
6694
|
if (!provider) {
|
|
@@ -6637,6 +6704,52 @@ async function createServerHandle(config4) {
|
|
|
6637
6704
|
res.status(500).json({ error: error instanceof Error ? error.message : "Failed to update provider" });
|
|
6638
6705
|
}
|
|
6639
6706
|
});
|
|
6707
|
+
app.put("/api/providers/:id", async (req, res) => {
|
|
6708
|
+
const { id } = req.params;
|
|
6709
|
+
const {
|
|
6710
|
+
name,
|
|
6711
|
+
url,
|
|
6712
|
+
backend,
|
|
6713
|
+
apiKey,
|
|
6714
|
+
isLocal,
|
|
6715
|
+
thinkingField,
|
|
6716
|
+
models: modelConfigs
|
|
6717
|
+
} = req.body;
|
|
6718
|
+
try {
|
|
6719
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-BU66P4KX.js");
|
|
6720
|
+
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6721
|
+
const provider = globalConfig.providers.find((p) => p.id === id);
|
|
6722
|
+
if (!provider) {
|
|
6723
|
+
return res.status(404).json({ error: "Provider not found" });
|
|
6724
|
+
}
|
|
6725
|
+
const updates = {};
|
|
6726
|
+
if (name !== void 0) updates["name"] = name;
|
|
6727
|
+
if (url !== void 0) updates["url"] = url;
|
|
6728
|
+
if (backend !== void 0) updates["backend"] = backend;
|
|
6729
|
+
if (apiKey !== void 0) updates["apiKey"] = apiKey || void 0;
|
|
6730
|
+
if (isLocal !== void 0) updates["isLocal"] = isLocal;
|
|
6731
|
+
if (thinkingField !== void 0) updates["thinkingField"] = thinkingField || void 0;
|
|
6732
|
+
if (modelConfigs !== void 0) {
|
|
6733
|
+
updates["models"] = modelConfigs.map((m) => ({
|
|
6734
|
+
id: m.id,
|
|
6735
|
+
contextWindow: m.contextWindow,
|
|
6736
|
+
source: "user",
|
|
6737
|
+
...m.supportsVision !== void 0 ? { supportsVision: m.supportsVision } : {},
|
|
6738
|
+
...m.thinkingEnabled !== void 0 ? { thinkingEnabled: m.thinkingEnabled } : {},
|
|
6739
|
+
...m.thinkingLevel ? { thinkingLevel: m.thinkingLevel } : {},
|
|
6740
|
+
...m.nonThinkingEnabled !== void 0 ? { nonThinkingEnabled: m.nonThinkingEnabled } : {},
|
|
6741
|
+
...m.thinkingExtraKwargs ? { thinkingExtraKwargs: m.thinkingExtraKwargs } : {},
|
|
6742
|
+
...m.nonThinkingExtraKwargs ? { nonThinkingExtraKwargs: m.nonThinkingExtraKwargs } : {}
|
|
6743
|
+
}));
|
|
6744
|
+
}
|
|
6745
|
+
const updatedConfig = updateProvider(globalConfig, id, updates);
|
|
6746
|
+
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
6747
|
+
providerManager.setProviders(updatedConfig.providers, updatedConfig.defaultModelSelection ?? void 0);
|
|
6748
|
+
res.json({ success: true, provider: updatedConfig.providers.find((p) => p.id === id) });
|
|
6749
|
+
} catch (error) {
|
|
6750
|
+
res.status(500).json({ error: error instanceof Error ? error.message : "Failed to update provider" });
|
|
6751
|
+
}
|
|
6752
|
+
});
|
|
6640
6753
|
app.get("/api/providers/:id/models", async (req, res) => {
|
|
6641
6754
|
const { id } = req.params;
|
|
6642
6755
|
const models = await providerManager.getProviderModels(id);
|
|
@@ -6650,7 +6763,7 @@ async function createServerHandle(config4) {
|
|
|
6650
6763
|
return res.status(400).json({ error: result.error });
|
|
6651
6764
|
}
|
|
6652
6765
|
const llmClient = getLLMClient();
|
|
6653
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
6766
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-BU66P4KX.js");
|
|
6654
6767
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6655
6768
|
const updatedConfig = setDefaultModelSelection(globalConfig, id, llmClient.getModel());
|
|
6656
6769
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
@@ -6669,7 +6782,7 @@ async function createServerHandle(config4) {
|
|
|
6669
6782
|
modelId,
|
|
6670
6783
|
body
|
|
6671
6784
|
});
|
|
6672
|
-
const hasFullSettings = body.temperature !== void 0 || body.topP !== void 0 || body.topK !== void 0 || body.maxTokens !== void 0;
|
|
6785
|
+
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;
|
|
6673
6786
|
let result;
|
|
6674
6787
|
if (hasFullSettings) {
|
|
6675
6788
|
result = await providerManager.updateModelSettings(id, modelId, body);
|
|
@@ -6681,7 +6794,7 @@ async function createServerHandle(config4) {
|
|
|
6681
6794
|
if (!result.success) {
|
|
6682
6795
|
return res.status(400).json({ error: result.error });
|
|
6683
6796
|
}
|
|
6684
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6797
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-BU66P4KX.js");
|
|
6685
6798
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6686
6799
|
const updatedProviders = providerManager.getProviders();
|
|
6687
6800
|
const updatedConfig = {
|
|
@@ -6895,7 +7008,7 @@ async function createServerHandle(config4) {
|
|
|
6895
7008
|
providerManager
|
|
6896
7009
|
);
|
|
6897
7010
|
const wss = wssExports.wss;
|
|
6898
|
-
const { QueueProcessor } = await import("./processor-
|
|
7011
|
+
const { QueueProcessor } = await import("./processor-NMYSEBC7.js");
|
|
6899
7012
|
const queueProcessor = new QueueProcessor({
|
|
6900
7013
|
sessionManager,
|
|
6901
7014
|
providerManager,
|
|
@@ -6967,4 +7080,4 @@ export {
|
|
|
6967
7080
|
createServerHandle,
|
|
6968
7081
|
createServer
|
|
6969
7082
|
};
|
|
6970
|
-
//# sourceMappingURL=chunk-
|
|
7083
|
+
//# sourceMappingURL=chunk-ZDY4WMZJ.js.map
|
package/dist/cli/dev.js
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -12,12 +12,8 @@ import {
|
|
|
12
12
|
removeProvider,
|
|
13
13
|
saveGlobalConfig,
|
|
14
14
|
setDefaultModelSelection,
|
|
15
|
-
trySmartDefaults,
|
|
16
15
|
updateProvider
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-UKTPL5ZG.js";
|
|
19
|
-
import "./chunk-VIIRNJDT.js";
|
|
20
|
-
import "./chunk-K44MW7JJ.js";
|
|
16
|
+
} from "./chunk-HPCGVAS4.js";
|
|
21
17
|
import "./chunk-CQGTEGKL.js";
|
|
22
18
|
export {
|
|
23
19
|
activateProvider,
|
|
@@ -33,7 +29,6 @@ export {
|
|
|
33
29
|
removeProvider,
|
|
34
30
|
saveGlobalConfig,
|
|
35
31
|
setDefaultModelSelection,
|
|
36
|
-
trySmartDefaults,
|
|
37
32
|
updateProvider
|
|
38
33
|
};
|
|
39
|
-
//# sourceMappingURL=config-
|
|
34
|
+
//# sourceMappingURL=config-BU66P4KX.js.map
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
isStoredEvent,
|
|
40
40
|
isTurnEvent,
|
|
41
41
|
truncateSessionMessages
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-XEK3KII6.js";
|
|
43
43
|
import {
|
|
44
44
|
buildContextMessagesFromEventHistory,
|
|
45
45
|
buildContextMessagesFromMessages,
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
foldTodos,
|
|
57
57
|
foldTurnEventsToSnapshotMessages,
|
|
58
58
|
getMessagesForWindow
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-ITWVFGFV.js";
|
|
60
60
|
import "./chunk-FBGWG4N6.js";
|
|
61
61
|
import "./chunk-K44MW7JJ.js";
|
|
62
62
|
export {
|
|
@@ -116,4 +116,4 @@ export {
|
|
|
116
116
|
isTurnEvent,
|
|
117
117
|
truncateSessionMessages
|
|
118
118
|
};
|
|
119
|
-
//# sourceMappingURL=events-
|
|
119
|
+
//# sourceMappingURL=events-ZKWAKWI7.js.map
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
handleToolResult,
|
|
24
24
|
spreadOptionalMessageFields,
|
|
25
25
|
stripOrphanedToolCalls
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-ITWVFGFV.js";
|
|
27
27
|
export {
|
|
28
28
|
buildContextMessagesFromEventHistory,
|
|
29
29
|
buildContextMessagesFromMessages,
|
|
@@ -50,4 +50,4 @@ export {
|
|
|
50
50
|
spreadOptionalMessageFields,
|
|
51
51
|
stripOrphanedToolCalls
|
|
52
52
|
};
|
|
53
|
-
//# sourceMappingURL=folding-
|
|
53
|
+
//# sourceMappingURL=folding-YOCGTZYH.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
injectWorkflowKickoffIfNeeded,
|
|
3
3
|
runAgentTurn,
|
|
4
4
|
runChatTurn
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LEDG5WAN.js";
|
|
6
6
|
import {
|
|
7
7
|
TurnMetrics,
|
|
8
8
|
createChatDoneEvent,
|
|
@@ -10,21 +10,21 @@ import {
|
|
|
10
10
|
createMessageStartEvent,
|
|
11
11
|
createToolCallEvent,
|
|
12
12
|
createToolResultEvent
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-32GQUDLN.js";
|
|
14
14
|
import "./chunk-DL6ZILAF.js";
|
|
15
15
|
import "./chunk-PBGOZMVY.js";
|
|
16
16
|
import "./chunk-VRGRAQDG.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-XAMAYRDA.js";
|
|
18
|
+
import "./chunk-XEK3KII6.js";
|
|
19
|
+
import "./chunk-ITWVFGFV.js";
|
|
19
20
|
import "./chunk-7TTEGAO6.js";
|
|
20
21
|
import "./chunk-BJYPTN5S.js";
|
|
21
22
|
import "./chunk-RFNEDBVO.js";
|
|
22
|
-
import "./chunk-XAMAYRDA.js";
|
|
23
23
|
import "./chunk-FBGWG4N6.js";
|
|
24
24
|
import "./chunk-BVHFMAVN.js";
|
|
25
|
-
import "./chunk-VIIRNJDT.js";
|
|
26
|
-
import "./chunk-K44MW7JJ.js";
|
|
27
25
|
import "./chunk-CQGTEGKL.js";
|
|
26
|
+
import "./chunk-FFEAEPJB.js";
|
|
27
|
+
import "./chunk-K44MW7JJ.js";
|
|
28
28
|
export {
|
|
29
29
|
TurnMetrics,
|
|
30
30
|
createChatDoneEvent,
|
|
@@ -36,4 +36,4 @@ export {
|
|
|
36
36
|
runAgentTurn,
|
|
37
37
|
runChatTurn
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=orchestrator-
|
|
39
|
+
//# sourceMappingURL=orchestrator-LX6FKB6L.js.map
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openfox",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Local-LLM-first agentic coding assistant",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"sql-language-server": "^1.7.1",
|
|
83
83
|
"strip-ansi": "^7.2.0",
|
|
84
84
|
"turndown": "^7.2.2",
|
|
85
|
+
"undici": "^8.5.0",
|
|
85
86
|
"typescript": "^5.8.2",
|
|
86
87
|
"typescript-language-server": "^5.1.3",
|
|
87
88
|
"vite": "^6.1.0",
|