openfox 2.0.0-beta.8 → 2.0.0
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-XIAY7O5X.js → chat-handler-LJMW4OK3.js} +9 -9
- package/dist/{chunk-QN5ST54E.js → chunk-32GQUDLN.js} +118 -97
- package/dist/{chunk-IGSZUXQP.js → chunk-7ZMMDZU7.js} +435 -33
- package/dist/{chunk-CDDMHSZF.js → chunk-CK6LGE7G.js} +10 -6
- package/dist/{chunk-7FDY3EOH.js → chunk-FFEAEPJB.js} +80 -226
- package/dist/{chunk-2ZS2B5HW.js → chunk-HPCGVAS4.js} +21 -45
- package/dist/{chunk-XJEOP6XU.js → chunk-ITWVFGFV.js} +1 -30
- package/dist/{chunk-DFITQ75T.js → chunk-LEDG5WAN.js} +29 -35
- package/dist/{chunk-GJ47CMZM.js → chunk-MFUPS6UE.js} +6 -6
- package/dist/{chunk-NPHYEUYE.js → chunk-XEK3KII6.js} +55 -4
- package/dist/{chunk-GJ34YIOL.js → chunk-ZDY4WMZJ.js} +185 -71
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{config-QUT7YZQ7.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-GAOENX5Q.js → orchestrator-LX6FKB6L.js} +8 -8
- package/dist/package.json +2 -1
- package/dist/{processor-6VIYGURD.js → processor-NMYSEBC7.js} +11 -6
- package/dist/{protocol-CDOV1pyc.d.ts → protocol-D59sCy9L.d.ts} +15 -6
- package/dist/{provider-4T6BVPMD.js → provider-DTNQYCMV.js} +9 -20
- package/dist/provider-manager-LMHAHLIF.js +15 -0
- package/dist/{serve-2V7T6GDG.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-SDXWIYSA.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-EMJGF3A7.js +0 -466
- 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,28 +131,27 @@ import {
|
|
|
131
131
|
createServerMessage
|
|
132
132
|
} from "./chunk-BVHFMAVN.js";
|
|
133
133
|
import {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
} from "./chunk-IGSZUXQP.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
|
-
|
|
142
|
-
|
|
142
|
+
ensureVersionPrefix,
|
|
143
|
+
getLlmStatus,
|
|
144
|
+
parseDefaultModelSelection
|
|
145
|
+
} from "./chunk-7ZMMDZU7.js";
|
|
143
146
|
import {
|
|
144
|
-
detectBackend,
|
|
145
147
|
getBackendDisplayName,
|
|
146
148
|
getModelProfile,
|
|
147
149
|
modelSupportsVision
|
|
148
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-FFEAEPJB.js";
|
|
149
151
|
import {
|
|
150
152
|
logger,
|
|
151
153
|
setLogLevel
|
|
152
154
|
} from "./chunk-K44MW7JJ.js";
|
|
153
|
-
import {
|
|
154
|
-
getGlobalConfigDir
|
|
155
|
-
} from "./chunk-CQGTEGKL.js";
|
|
156
155
|
|
|
157
156
|
// src/server/index.ts
|
|
158
157
|
import express from "express";
|
|
@@ -2843,18 +2842,22 @@ function createWebSocketServer(httpServer, config4, getLLMClient, getActiveProvi
|
|
|
2843
2842
|
sessionLLMClients.delete(sessionId);
|
|
2844
2843
|
return getLLMClient();
|
|
2845
2844
|
}
|
|
2846
|
-
const
|
|
2845
|
+
const modelConfig = provider.models.find((m) => m.id === session.providerModel);
|
|
2846
|
+
const reasoningEffort = modelConfig?.thinkingEnabled && modelConfig?.thinkingLevel ? modelConfig.thinkingLevel : void 0;
|
|
2847
|
+
const baseUrl = ensureVersionPrefix(provider.url);
|
|
2847
2848
|
const sessionConfig = {
|
|
2848
2849
|
...config4,
|
|
2849
2850
|
llm: {
|
|
2850
2851
|
...config4.llm,
|
|
2851
2852
|
baseUrl,
|
|
2852
2853
|
model: session.providerModel,
|
|
2853
|
-
...provider.apiKey && { apiKey: provider.apiKey }
|
|
2854
|
+
...provider.apiKey && { apiKey: provider.apiKey },
|
|
2855
|
+
...provider.thinkingField && { thinkingField: provider.thinkingField },
|
|
2856
|
+
...reasoningEffort && { reasoningEffort }
|
|
2854
2857
|
}
|
|
2855
2858
|
};
|
|
2856
2859
|
const client = createLLMClient(sessionConfig);
|
|
2857
|
-
if (provider.backend !== "
|
|
2860
|
+
if (provider.backend !== "unknown") {
|
|
2858
2861
|
client.setBackend(provider.backend);
|
|
2859
2862
|
}
|
|
2860
2863
|
client.setModel(session.providerModel);
|
|
@@ -5281,8 +5284,7 @@ ${summary}`,
|
|
|
5281
5284
|
metadataEntries: eventState.metadataEntries,
|
|
5282
5285
|
contextWindows: [],
|
|
5283
5286
|
// Derived from events, not stored separately
|
|
5284
|
-
executionState: eventState.
|
|
5285
|
-
lastModeWithReminder: eventState.lastModeWithReminder,
|
|
5287
|
+
executionState: eventState.cachedSystemPrompt || hasCachedPrompt ? {
|
|
5286
5288
|
cachedSystemPrompt: cachedData?.systemPrompt ?? eventState.cachedSystemPrompt,
|
|
5287
5289
|
dynamicContextHash: cachedData?.hash ?? eventState.dynamicContextHash
|
|
5288
5290
|
} : null
|
|
@@ -5830,7 +5832,7 @@ import { Router as Router6 } from "express";
|
|
|
5830
5832
|
import { spawn as spawn5 } from "child_process";
|
|
5831
5833
|
|
|
5832
5834
|
// src/constants.ts
|
|
5833
|
-
var VERSION = "2.0.0
|
|
5835
|
+
var VERSION = "2.0.0";
|
|
5834
5836
|
|
|
5835
5837
|
// src/server/routes/auto-update.ts
|
|
5836
5838
|
var updateInProgress = false;
|
|
@@ -5940,29 +5942,19 @@ async function createServerHandle(config4) {
|
|
|
5940
5942
|
}
|
|
5941
5943
|
async function initLLM() {
|
|
5942
5944
|
const llmClient = getLLMClient();
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
if (
|
|
5946
|
-
|
|
5947
|
-
llmClient.setBackend(backend);
|
|
5948
|
-
if (!useMock2) {
|
|
5949
|
-
logger.info("Auto-detected LLM backend", { backend: getBackendDisplayName(backend) });
|
|
5950
|
-
}
|
|
5951
|
-
} else {
|
|
5952
|
-
backend = config4.llm.backend;
|
|
5953
|
-
llmClient.setBackend(backend);
|
|
5954
|
-
if (!useMock2) {
|
|
5955
|
-
logger.info("Using configured LLM backend", { backend: getBackendDisplayName(backend) });
|
|
5956
|
-
}
|
|
5945
|
+
const backend = config4.llm.backend;
|
|
5946
|
+
llmClient.setBackend(backend);
|
|
5947
|
+
if (!useMock) {
|
|
5948
|
+
logger.info("Using configured LLM backend", { backend: getBackendDisplayName(backend) });
|
|
5957
5949
|
}
|
|
5958
5950
|
const detected = await detectModel(config4.llm.baseUrl);
|
|
5959
5951
|
if (detected) {
|
|
5960
5952
|
llmClient.setModel(detected);
|
|
5961
|
-
if (!
|
|
5953
|
+
if (!useMock) {
|
|
5962
5954
|
logger.info("Auto-detected LLM model", { model: detected, backend: getBackendDisplayName(backend) });
|
|
5963
5955
|
}
|
|
5964
5956
|
} else {
|
|
5965
|
-
if (!
|
|
5957
|
+
if (!useMock) {
|
|
5966
5958
|
logger.warn("Could not auto-detect model, using config", { model: config4.llm.model });
|
|
5967
5959
|
}
|
|
5968
5960
|
}
|
|
@@ -6133,7 +6125,7 @@ async function createServerHandle(config4) {
|
|
|
6133
6125
|
res.json({ project });
|
|
6134
6126
|
});
|
|
6135
6127
|
app.get("/api/sessions", async (req, res) => {
|
|
6136
|
-
const { getRecentUserPromptsForSession } = await import("./events-
|
|
6128
|
+
const { getRecentUserPromptsForSession } = await import("./events-ZKWAKWI7.js");
|
|
6137
6129
|
const projectId = req.query["projectId"];
|
|
6138
6130
|
const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
|
|
6139
6131
|
const offset = parseInt(req.query["offset"]) || 0;
|
|
@@ -6166,8 +6158,8 @@ async function createServerHandle(config4) {
|
|
|
6166
6158
|
res.status(201).json({ session });
|
|
6167
6159
|
});
|
|
6168
6160
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
6169
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6170
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-
|
|
6161
|
+
const { getEventStore: getEventStore2 } = await import("./events-ZKWAKWI7.js");
|
|
6162
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-YOCGTZYH.js");
|
|
6171
6163
|
const session = sessionManager.getSession(req.params.id);
|
|
6172
6164
|
if (!session) {
|
|
6173
6165
|
return res.status(404).json({ error: "Session not found" });
|
|
@@ -6197,8 +6189,8 @@ async function createServerHandle(config4) {
|
|
|
6197
6189
|
res.json({ success: true });
|
|
6198
6190
|
});
|
|
6199
6191
|
app.post("/api/sessions/:id/provider", async (req, res) => {
|
|
6200
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6201
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-
|
|
6192
|
+
const { getEventStore: getEventStore2 } = await import("./events-ZKWAKWI7.js");
|
|
6193
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-YOCGTZYH.js");
|
|
6202
6194
|
const sessionId = req.params.id;
|
|
6203
6195
|
const session = sessionManager.getSession(sessionId);
|
|
6204
6196
|
if (!session) {
|
|
@@ -6209,7 +6201,7 @@ async function createServerHandle(config4) {
|
|
|
6209
6201
|
return res.status(400).json({ error: "providerId is required" });
|
|
6210
6202
|
}
|
|
6211
6203
|
sessionManager.setSessionProvider(sessionId, providerId, model ?? "auto");
|
|
6212
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
6204
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-BU66P4KX.js");
|
|
6213
6205
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6214
6206
|
const updatedConfig = setDefaultModelSelection(globalConfig, providerId, model ?? "auto");
|
|
6215
6207
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
@@ -6240,8 +6232,8 @@ async function createServerHandle(config4) {
|
|
|
6240
6232
|
res.json({ success: true });
|
|
6241
6233
|
});
|
|
6242
6234
|
app.put("/api/sessions/:id/mode", async (req, res) => {
|
|
6243
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6244
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-
|
|
6235
|
+
const { getEventStore: getEventStore2 } = await import("./events-ZKWAKWI7.js");
|
|
6236
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-YOCGTZYH.js");
|
|
6245
6237
|
const sessionId = req.params.id;
|
|
6246
6238
|
const session = sessionManager.getSession(sessionId);
|
|
6247
6239
|
if (!session) {
|
|
@@ -6297,13 +6289,13 @@ async function createServerHandle(config4) {
|
|
|
6297
6289
|
if (!callId || approved === void 0) {
|
|
6298
6290
|
return res.status(400).json({ error: "callId and approved are required" });
|
|
6299
6291
|
}
|
|
6300
|
-
const { providePathConfirmation } = await import("./tools-
|
|
6292
|
+
const { providePathConfirmation } = await import("./tools-BOE5T3KC.js");
|
|
6301
6293
|
const result = providePathConfirmation(callId, approved, alwaysAllow);
|
|
6302
6294
|
if (!result.found) {
|
|
6303
6295
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
6304
6296
|
}
|
|
6305
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6306
|
-
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");
|
|
6307
6299
|
const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-CN24IKQN.js");
|
|
6308
6300
|
const eventStore = getEventStore2();
|
|
6309
6301
|
const events = eventStore.getEvents(sessionId);
|
|
@@ -6321,7 +6313,7 @@ async function createServerHandle(config4) {
|
|
|
6321
6313
|
if (!callId || !answer) {
|
|
6322
6314
|
return res.status(400).json({ error: "callId and answer are required" });
|
|
6323
6315
|
}
|
|
6324
|
-
const { provideAnswer: provideAnswer2 } = await import("./tools-
|
|
6316
|
+
const { provideAnswer: provideAnswer2 } = await import("./tools-BOE5T3KC.js");
|
|
6325
6317
|
const found = provideAnswer2(callId, answer);
|
|
6326
6318
|
if (!found) {
|
|
6327
6319
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -6357,14 +6349,14 @@ async function createServerHandle(config4) {
|
|
|
6357
6349
|
if (!session) {
|
|
6358
6350
|
return res.status(404).json({ error: "Session not found" });
|
|
6359
6351
|
}
|
|
6360
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
6361
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
6352
|
+
const { stopSessionExecution } = await import("./chat-handler-LJMW4OK3.js");
|
|
6353
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-BOE5T3KC.js");
|
|
6362
6354
|
stopSessionExecution(sessionId, sessionManager);
|
|
6363
6355
|
abortSession(sessionId);
|
|
6364
6356
|
cancelQuestionsForSession(sessionId, "Session stopped by user");
|
|
6365
6357
|
cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
|
|
6366
6358
|
sessionManager.clearMessageQueue(sessionId);
|
|
6367
|
-
const eventStore = (await import("./events-
|
|
6359
|
+
const eventStore = (await import("./events-ZKWAKWI7.js")).getEventStore();
|
|
6368
6360
|
eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
|
|
6369
6361
|
res.json({ success: true });
|
|
6370
6362
|
});
|
|
@@ -6378,7 +6370,7 @@ async function createServerHandle(config4) {
|
|
|
6378
6370
|
if (typeof messageIndex !== "number" || messageIndex < 0) {
|
|
6379
6371
|
return res.status(400).json({ error: "messageIndex must be a non-negative number" });
|
|
6380
6372
|
}
|
|
6381
|
-
const { truncateSessionMessages } = await import("./events-
|
|
6373
|
+
const { truncateSessionMessages } = await import("./events-ZKWAKWI7.js");
|
|
6382
6374
|
truncateSessionMessages(sessionId, messageIndex);
|
|
6383
6375
|
res.json({ success: true });
|
|
6384
6376
|
});
|
|
@@ -6396,7 +6388,7 @@ async function createServerHandle(config4) {
|
|
|
6396
6388
|
if (!msg) {
|
|
6397
6389
|
return res.status(400).json({ error: "Message not found at this index" });
|
|
6398
6390
|
}
|
|
6399
|
-
const { truncateSessionMessages } = await import("./events-
|
|
6391
|
+
const { truncateSessionMessages } = await import("./events-ZKWAKWI7.js");
|
|
6400
6392
|
truncateSessionMessages(sessionId, messageIndex - 1);
|
|
6401
6393
|
sessionManager.queueMessage(sessionId, "asap", msg.content, msg.attachments, msg.messageKind);
|
|
6402
6394
|
res.json({ success: true });
|
|
@@ -6468,7 +6460,7 @@ async function createServerHandle(config4) {
|
|
|
6468
6460
|
let visionFallback;
|
|
6469
6461
|
let globalWorkdir;
|
|
6470
6462
|
try {
|
|
6471
|
-
const { loadGlobalConfig, getVisionFallback } = await import("./config-
|
|
6463
|
+
const { loadGlobalConfig, getVisionFallback } = await import("./config-BU66P4KX.js");
|
|
6472
6464
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6473
6465
|
const fallback = getVisionFallback(globalConfig);
|
|
6474
6466
|
if (fallback) {
|
|
@@ -6521,17 +6513,16 @@ async function createServerHandle(config4) {
|
|
|
6521
6513
|
});
|
|
6522
6514
|
});
|
|
6523
6515
|
app.post("/api/providers/test", async (req, res) => {
|
|
6524
|
-
const { url,
|
|
6516
|
+
const { url, backend: reqBackend } = req.body;
|
|
6525
6517
|
if (!url) {
|
|
6526
6518
|
return res.status(400).json({ error: "url is required" });
|
|
6527
6519
|
}
|
|
6528
6520
|
try {
|
|
6529
|
-
const backend = skipBackendDetection ? "auto" : await detectBackend(url);
|
|
6530
6521
|
const model = await detectModel(url);
|
|
6531
6522
|
res.json({
|
|
6532
6523
|
success: true,
|
|
6533
6524
|
url,
|
|
6534
|
-
backend,
|
|
6525
|
+
backend: reqBackend || "unknown",
|
|
6535
6526
|
model
|
|
6536
6527
|
});
|
|
6537
6528
|
} catch (error) {
|
|
@@ -6541,13 +6532,79 @@ async function createServerHandle(config4) {
|
|
|
6541
6532
|
});
|
|
6542
6533
|
}
|
|
6543
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
|
+
});
|
|
6544
6592
|
app.post("/api/providers", async (req, res) => {
|
|
6545
|
-
const {
|
|
6593
|
+
const {
|
|
6594
|
+
name,
|
|
6595
|
+
url,
|
|
6596
|
+
backend,
|
|
6597
|
+
apiKey,
|
|
6598
|
+
model,
|
|
6599
|
+
isLocal,
|
|
6600
|
+
thinkingField,
|
|
6601
|
+
models: modelConfigs
|
|
6602
|
+
} = req.body;
|
|
6546
6603
|
if (!name || !url || !backend) {
|
|
6547
6604
|
return res.status(400).json({ error: "name, url, and backend are required" });
|
|
6548
6605
|
}
|
|
6549
6606
|
try {
|
|
6550
|
-
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-
|
|
6607
|
+
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-BU66P4KX.js");
|
|
6551
6608
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6552
6609
|
const providerBackend = backend;
|
|
6553
6610
|
const configWithProvider = addProvider(globalConfig, {
|
|
@@ -6556,7 +6613,18 @@ async function createServerHandle(config4) {
|
|
|
6556
6613
|
backend: providerBackend,
|
|
6557
6614
|
apiKey,
|
|
6558
6615
|
...isLocal !== void 0 ? { isLocal } : {},
|
|
6559
|
-
|
|
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" }] : [],
|
|
6560
6628
|
isActive: true
|
|
6561
6629
|
});
|
|
6562
6630
|
const finalConfig = setDefaultModelSelection(
|
|
@@ -6581,7 +6649,7 @@ async function createServerHandle(config4) {
|
|
|
6581
6649
|
app.post("/api/init/config", async (req, res) => {
|
|
6582
6650
|
const { workdir, visionFallback } = req.body;
|
|
6583
6651
|
try {
|
|
6584
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6652
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-BU66P4KX.js");
|
|
6585
6653
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6586
6654
|
const updatedConfig = {
|
|
6587
6655
|
...globalConfig,
|
|
@@ -6609,7 +6677,7 @@ async function createServerHandle(config4) {
|
|
|
6609
6677
|
});
|
|
6610
6678
|
app.delete("/api/providers/:id", async (req, res) => {
|
|
6611
6679
|
const { id } = req.params;
|
|
6612
|
-
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-
|
|
6680
|
+
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-BU66P4KX.js");
|
|
6613
6681
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6614
6682
|
const updatedConfig = removeProvider(globalConfig, id);
|
|
6615
6683
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
@@ -6620,14 +6688,60 @@ async function createServerHandle(config4) {
|
|
|
6620
6688
|
const { id } = req.params;
|
|
6621
6689
|
const { isLocal } = req.body;
|
|
6622
6690
|
try {
|
|
6623
|
-
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-
|
|
6691
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-BU66P4KX.js");
|
|
6692
|
+
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6693
|
+
const provider = globalConfig.providers.find((p) => p.id === id);
|
|
6694
|
+
if (!provider) {
|
|
6695
|
+
return res.status(404).json({ error: "Provider not found" });
|
|
6696
|
+
}
|
|
6697
|
+
const updates = {};
|
|
6698
|
+
if (isLocal !== void 0) updates["isLocal"] = isLocal;
|
|
6699
|
+
const updatedConfig = updateProvider(globalConfig, id, updates);
|
|
6700
|
+
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
6701
|
+
providerManager.setProviders(updatedConfig.providers, updatedConfig.defaultModelSelection ?? void 0);
|
|
6702
|
+
res.json({ success: true, provider: updatedConfig.providers.find((p) => p.id === id) });
|
|
6703
|
+
} catch (error) {
|
|
6704
|
+
res.status(500).json({ error: error instanceof Error ? error.message : "Failed to update provider" });
|
|
6705
|
+
}
|
|
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");
|
|
6624
6720
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6625
6721
|
const provider = globalConfig.providers.find((p) => p.id === id);
|
|
6626
6722
|
if (!provider) {
|
|
6627
6723
|
return res.status(404).json({ error: "Provider not found" });
|
|
6628
6724
|
}
|
|
6629
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;
|
|
6630
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
|
+
}
|
|
6631
6745
|
const updatedConfig = updateProvider(globalConfig, id, updates);
|
|
6632
6746
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
6633
6747
|
providerManager.setProviders(updatedConfig.providers, updatedConfig.defaultModelSelection ?? void 0);
|
|
@@ -6649,7 +6763,7 @@ async function createServerHandle(config4) {
|
|
|
6649
6763
|
return res.status(400).json({ error: result.error });
|
|
6650
6764
|
}
|
|
6651
6765
|
const llmClient = getLLMClient();
|
|
6652
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
6766
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-BU66P4KX.js");
|
|
6653
6767
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6654
6768
|
const updatedConfig = setDefaultModelSelection(globalConfig, id, llmClient.getModel());
|
|
6655
6769
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
@@ -6668,7 +6782,7 @@ async function createServerHandle(config4) {
|
|
|
6668
6782
|
modelId,
|
|
6669
6783
|
body
|
|
6670
6784
|
});
|
|
6671
|
-
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;
|
|
6672
6786
|
let result;
|
|
6673
6787
|
if (hasFullSettings) {
|
|
6674
6788
|
result = await providerManager.updateModelSettings(id, modelId, body);
|
|
@@ -6680,7 +6794,7 @@ async function createServerHandle(config4) {
|
|
|
6680
6794
|
if (!result.success) {
|
|
6681
6795
|
return res.status(400).json({ error: result.error });
|
|
6682
6796
|
}
|
|
6683
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6797
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-BU66P4KX.js");
|
|
6684
6798
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6685
6799
|
const updatedProviders = providerManager.getProviders();
|
|
6686
6800
|
const updatedConfig = {
|
|
@@ -6894,7 +7008,7 @@ async function createServerHandle(config4) {
|
|
|
6894
7008
|
providerManager
|
|
6895
7009
|
);
|
|
6896
7010
|
const wss = wssExports.wss;
|
|
6897
|
-
const { QueueProcessor } = await import("./processor-
|
|
7011
|
+
const { QueueProcessor } = await import("./processor-NMYSEBC7.js");
|
|
6898
7012
|
const queueProcessor = new QueueProcessor({
|
|
6899
7013
|
sessionManager,
|
|
6900
7014
|
providerManager,
|
|
@@ -6966,4 +7080,4 @@ export {
|
|
|
6966
7080
|
createServerHandle,
|
|
6967
7081
|
createServer
|
|
6968
7082
|
};
|
|
6969
|
-
//# 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-EMJGF3A7.js";
|
|
19
|
-
import "./chunk-7FDY3EOH.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-7FDY3EOH.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",
|