openfox 2.0.0-beta.11 → 2.0.0-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chat-handler-NMJCOCCB.js → chat-handler-DKX2XFHA.js} +8 -8
- package/dist/{chunk-EQQDA4D3.js → chunk-5RP2ZU2G.js} +14 -16
- package/dist/{chunk-4RLDN2LL.js → chunk-BNFQMAH6.js} +160 -39
- package/dist/{chunk-BU56QFHW.js → chunk-DBDMMSCM.js} +7 -8
- package/dist/{chunk-NSBYORD5.js → chunk-DHAKJSE7.js} +4 -2
- package/dist/{chunk-EZUR7OEP.js → chunk-HZODNSSV.js} +15 -9
- package/dist/{chunk-LCRJWUW7.js → chunk-LDHRZRCP.js} +6 -6
- package/dist/{chunk-VIIRNJDT.js → chunk-LXX2CPM5.js} +203 -236
- package/dist/{chunk-EXYMWI7A.js → chunk-OKLV3ZNN.js} +9 -5
- package/dist/{chunk-UKTPL5ZG.js → chunk-SW7MQGY3.js} +123 -214
- package/dist/{chunk-DMH6JVPF.js → chunk-YLQGD5SE.js} +28 -8
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{config-TDVA7MQN.js → config-FAT5XRFB.js} +5 -5
- package/dist/{events-UGTGGFG3.js → events-R7FRQEBE.js} +2 -2
- package/dist/{orchestrator-75L5UGDU.js → orchestrator-NNYZC7AY.js} +7 -7
- package/dist/package.json +1 -1
- package/dist/{processor-GHESQ2YV.js → processor-5T3CXD5I.js} +10 -5
- package/dist/{protocol-B9R1CUvt.d.ts → protocol-zn90yuIr.d.ts} +11 -2
- package/dist/{provider-BGH4MBLH.js → provider-2JYU6KGH.js} +9 -9
- package/dist/provider-manager-IP3HOGNB.js +16 -0
- package/dist/{serve-I6T7V62Z.js → serve-NSTNUQ2K.js} +13 -13
- package/dist/server/index.d.ts +21 -15
- package/dist/server/index.js +9 -9
- package/dist/shared/index.d.ts +2 -2
- package/dist/{tools-D3WWIOQD.js → tools-TJGSHOAR.js} +6 -6
- package/dist/web/assets/index-DIY3E8K9.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/web/assets/index-tJDr1ODC.js +0 -299
|
@@ -5,17 +5,18 @@ import {
|
|
|
5
5
|
generateSessionName,
|
|
6
6
|
getSessionMessageCount,
|
|
7
7
|
needsNameGenerationCheck
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OKLV3ZNN.js";
|
|
9
9
|
import {
|
|
10
10
|
runChatTurn
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-DBDMMSCM.js";
|
|
12
|
+
import "./chunk-5RP2ZU2G.js";
|
|
13
13
|
import "./chunk-DL6ZILAF.js";
|
|
14
14
|
import "./chunk-PBGOZMVY.js";
|
|
15
15
|
import "./chunk-VRGRAQDG.js";
|
|
16
|
+
import "./chunk-XAMAYRDA.js";
|
|
16
17
|
import {
|
|
17
18
|
getEventStore
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-DHAKJSE7.js";
|
|
19
20
|
import "./chunk-ITWVFGFV.js";
|
|
20
21
|
import {
|
|
21
22
|
createChatMessageMessage,
|
|
@@ -24,14 +25,13 @@ import {
|
|
|
24
25
|
} from "./chunk-7TTEGAO6.js";
|
|
25
26
|
import "./chunk-BJYPTN5S.js";
|
|
26
27
|
import "./chunk-RFNEDBVO.js";
|
|
27
|
-
import "./chunk-XAMAYRDA.js";
|
|
28
28
|
import "./chunk-FBGWG4N6.js";
|
|
29
29
|
import "./chunk-BVHFMAVN.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-CQGTEGKL.js";
|
|
31
|
+
import "./chunk-LXX2CPM5.js";
|
|
31
32
|
import {
|
|
32
33
|
logger
|
|
33
34
|
} from "./chunk-K44MW7JJ.js";
|
|
34
|
-
import "./chunk-CQGTEGKL.js";
|
|
35
35
|
|
|
36
36
|
// src/server/session/chat-handler.ts
|
|
37
37
|
var activeAgents = /* @__PURE__ */ new Map();
|
|
@@ -161,4 +161,4 @@ export {
|
|
|
161
161
|
startChatSession,
|
|
162
162
|
stopSessionExecution
|
|
163
163
|
};
|
|
164
|
-
//# sourceMappingURL=chat-handler-
|
|
164
|
+
//# sourceMappingURL=chat-handler-DKX2XFHA.js.map
|
|
@@ -14,12 +14,15 @@ import {
|
|
|
14
14
|
getMaxPerSession,
|
|
15
15
|
getSessionProcessCount
|
|
16
16
|
} from "./chunk-VRGRAQDG.js";
|
|
17
|
+
import {
|
|
18
|
+
getProject
|
|
19
|
+
} from "./chunk-XAMAYRDA.js";
|
|
17
20
|
import {
|
|
18
21
|
getCurrentContextWindowId,
|
|
19
22
|
getCurrentWindowMessageOptions,
|
|
20
23
|
getEventStore,
|
|
21
24
|
getRuntimeConfig
|
|
22
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-DHAKJSE7.js";
|
|
23
26
|
import {
|
|
24
27
|
buildContextMessagesFromEventHistory,
|
|
25
28
|
foldContextState,
|
|
@@ -46,21 +49,18 @@ import {
|
|
|
46
49
|
getSetting
|
|
47
50
|
} from "./chunk-RFNEDBVO.js";
|
|
48
51
|
import {
|
|
49
|
-
|
|
50
|
-
} from "./chunk-
|
|
52
|
+
getGlobalConfigDir
|
|
53
|
+
} from "./chunk-CQGTEGKL.js";
|
|
51
54
|
import {
|
|
52
55
|
buildModelParams,
|
|
53
56
|
getBackendCapabilities,
|
|
54
57
|
getModelProfile,
|
|
55
58
|
modelSupportsVision,
|
|
56
59
|
streamWithSegments
|
|
57
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-LXX2CPM5.js";
|
|
58
61
|
import {
|
|
59
62
|
logger
|
|
60
63
|
} from "./chunk-K44MW7JJ.js";
|
|
61
|
-
import {
|
|
62
|
-
getGlobalConfigDir
|
|
63
|
-
} from "./chunk-CQGTEGKL.js";
|
|
64
64
|
|
|
65
65
|
// src/server/tools/read.ts
|
|
66
66
|
import { readFile as readFile2, stat, readdir } from "fs/promises";
|
|
@@ -2001,12 +2001,12 @@ function matchRetryPatterns(content, thinking, patterns) {
|
|
|
2001
2001
|
|
|
2002
2002
|
// src/server/chat/stream-utils.ts
|
|
2003
2003
|
function buildStreamRequestObject(params) {
|
|
2004
|
-
const { messages, tools, toolChoice,
|
|
2004
|
+
const { messages, tools, toolChoice, reasoningEffort, signal, modelSettings } = params;
|
|
2005
2005
|
return {
|
|
2006
2006
|
messages,
|
|
2007
2007
|
...tools && { tools },
|
|
2008
2008
|
...toolChoice && { toolChoice },
|
|
2009
|
-
|
|
2009
|
+
...reasoningEffort && { reasoningEffort },
|
|
2010
2010
|
...signal && { signal },
|
|
2011
2011
|
...modelSettings && { modelSettings }
|
|
2012
2012
|
};
|
|
@@ -2060,7 +2060,7 @@ function createEmptyStreamResult(aborted, modelParams, patternMatch) {
|
|
|
2060
2060
|
};
|
|
2061
2061
|
}
|
|
2062
2062
|
async function* streamLLMPure(options) {
|
|
2063
|
-
const { messageId, systemPrompt, llmClient, messages, tools, toolChoice, signal,
|
|
2063
|
+
const { messageId, systemPrompt, llmClient, messages, tools, toolChoice, signal, reasoningEffort, retryPatterns } = options;
|
|
2064
2064
|
const llmMessages = [{ role: "system", content: systemPrompt }, ...messages];
|
|
2065
2065
|
const profile = getModelProfile(llmClient.getModel());
|
|
2066
2066
|
const backend = getBackendCapabilities(llmClient.getBackend());
|
|
@@ -2093,7 +2093,7 @@ async function* streamLLMPure(options) {
|
|
|
2093
2093
|
messages: llmMessages,
|
|
2094
2094
|
tools,
|
|
2095
2095
|
toolChoice,
|
|
2096
|
-
|
|
2096
|
+
reasoningEffort,
|
|
2097
2097
|
signal: combinedSignal,
|
|
2098
2098
|
modelSettings: options.modelSettings
|
|
2099
2099
|
});
|
|
@@ -3189,7 +3189,6 @@ function buildAssemblyInput(systemPrompt, baseInput) {
|
|
|
3189
3189
|
injectedFiles: baseInput.injectedFiles,
|
|
3190
3190
|
requestTools: baseInput.requestTools ?? baseInput.promptTools,
|
|
3191
3191
|
toolChoice: baseInput.toolChoice ?? "auto",
|
|
3192
|
-
disableThinking: baseInput.disableThinking ?? false,
|
|
3193
3192
|
...baseInput.customInstructions ? { customInstructions: baseInput.customInstructions } : {},
|
|
3194
3193
|
...baseInput.skills && baseInput.skills.length > 0 ? { skills: baseInput.skills } : {}
|
|
3195
3194
|
});
|
|
@@ -3281,7 +3280,7 @@ async function describeImageFromDataUrl(dataUrl, visionModel, options) {
|
|
|
3281
3280
|
import { createHash as createHash2 } from "crypto";
|
|
3282
3281
|
async function loadVisionModelFromGlobalConfig() {
|
|
3283
3282
|
try {
|
|
3284
|
-
const { loadGlobalConfig, getVisionFallback } = await import("./config-
|
|
3283
|
+
const { loadGlobalConfig, getVisionFallback } = await import("./config-FAT5XRFB.js");
|
|
3285
3284
|
const runtimeConfig = getRuntimeConfig();
|
|
3286
3285
|
const mode = runtimeConfig.mode ?? "production";
|
|
3287
3286
|
const globalConfig = await loadGlobalConfig(mode);
|
|
@@ -3644,7 +3643,6 @@ async function executeSubAgent(options) {
|
|
|
3644
3643
|
injectedFiles: input.injectedFiles,
|
|
3645
3644
|
requestTools: input.promptTools,
|
|
3646
3645
|
toolChoice: input.toolChoice,
|
|
3647
|
-
disableThinking: true,
|
|
3648
3646
|
...instructionContent ? { customInstructions: instructionContent } : {},
|
|
3649
3647
|
...skills.length > 0 ? { skills } : {}
|
|
3650
3648
|
}),
|
|
@@ -3735,7 +3733,7 @@ var callSubAgentTool = {
|
|
|
3735
3733
|
};
|
|
3736
3734
|
}
|
|
3737
3735
|
try {
|
|
3738
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
3736
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-TJGSHOAR.js");
|
|
3739
3737
|
const toolRegistry = getToolRegistryForAgent2(agentDef);
|
|
3740
3738
|
const turnMetrics = new TurnMetrics();
|
|
3741
3739
|
const result = await executeSubAgent({
|
|
@@ -4787,4 +4785,4 @@ export {
|
|
|
4787
4785
|
getToolRegistryForAgent,
|
|
4788
4786
|
createToolRegistry
|
|
4789
4787
|
};
|
|
4790
|
-
//# sourceMappingURL=chunk-
|
|
4788
|
+
//# sourceMappingURL=chunk-5RP2ZU2G.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
injectWorkflowKickoffIfNeeded,
|
|
4
4
|
runAgentTurn,
|
|
5
5
|
runChatTurn
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DBDMMSCM.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-5RP2ZU2G.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,30 @@ 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-YLQGD5SE.js";
|
|
137
140
|
import {
|
|
138
141
|
SessionNotFoundError,
|
|
139
142
|
createLLMClient,
|
|
140
143
|
detectModel,
|
|
141
144
|
getLlmStatus
|
|
142
|
-
} from "./chunk-
|
|
145
|
+
} from "./chunk-SW7MQGY3.js";
|
|
143
146
|
import {
|
|
144
147
|
detectBackend,
|
|
145
148
|
ensureVersionPrefix,
|
|
146
149
|
getBackendDisplayName,
|
|
147
150
|
getModelProfile,
|
|
148
151
|
modelSupportsVision
|
|
149
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-LXX2CPM5.js";
|
|
150
153
|
import {
|
|
151
154
|
logger,
|
|
152
155
|
setLogLevel
|
|
153
156
|
} from "./chunk-K44MW7JJ.js";
|
|
154
|
-
import {
|
|
155
|
-
getGlobalConfigDir
|
|
156
|
-
} from "./chunk-CQGTEGKL.js";
|
|
157
157
|
|
|
158
158
|
// src/server/index.ts
|
|
159
159
|
import express from "express";
|
|
@@ -2851,7 +2851,8 @@ 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 }
|
|
2855
2856
|
}
|
|
2856
2857
|
};
|
|
2857
2858
|
const client = createLLMClient(sessionConfig);
|
|
@@ -5830,7 +5831,7 @@ import { Router as Router6 } from "express";
|
|
|
5830
5831
|
import { spawn as spawn5 } from "child_process";
|
|
5831
5832
|
|
|
5832
5833
|
// src/constants.ts
|
|
5833
|
-
var VERSION = "2.0.0-beta.
|
|
5834
|
+
var VERSION = "2.0.0-beta.13";
|
|
5834
5835
|
|
|
5835
5836
|
// src/server/routes/auto-update.ts
|
|
5836
5837
|
var updateInProgress = false;
|
|
@@ -6133,7 +6134,7 @@ async function createServerHandle(config4) {
|
|
|
6133
6134
|
res.json({ project });
|
|
6134
6135
|
});
|
|
6135
6136
|
app.get("/api/sessions", async (req, res) => {
|
|
6136
|
-
const { getRecentUserPromptsForSession } = await import("./events-
|
|
6137
|
+
const { getRecentUserPromptsForSession } = await import("./events-R7FRQEBE.js");
|
|
6137
6138
|
const projectId = req.query["projectId"];
|
|
6138
6139
|
const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
|
|
6139
6140
|
const offset = parseInt(req.query["offset"]) || 0;
|
|
@@ -6166,7 +6167,7 @@ async function createServerHandle(config4) {
|
|
|
6166
6167
|
res.status(201).json({ session });
|
|
6167
6168
|
});
|
|
6168
6169
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
6169
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6170
|
+
const { getEventStore: getEventStore2 } = await import("./events-R7FRQEBE.js");
|
|
6170
6171
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-YOCGTZYH.js");
|
|
6171
6172
|
const session = sessionManager.getSession(req.params.id);
|
|
6172
6173
|
if (!session) {
|
|
@@ -6197,7 +6198,7 @@ async function createServerHandle(config4) {
|
|
|
6197
6198
|
res.json({ success: true });
|
|
6198
6199
|
});
|
|
6199
6200
|
app.post("/api/sessions/:id/provider", async (req, res) => {
|
|
6200
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6201
|
+
const { getEventStore: getEventStore2 } = await import("./events-R7FRQEBE.js");
|
|
6201
6202
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-YOCGTZYH.js");
|
|
6202
6203
|
const sessionId = req.params.id;
|
|
6203
6204
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -6209,7 +6210,7 @@ async function createServerHandle(config4) {
|
|
|
6209
6210
|
return res.status(400).json({ error: "providerId is required" });
|
|
6210
6211
|
}
|
|
6211
6212
|
sessionManager.setSessionProvider(sessionId, providerId, model ?? "auto");
|
|
6212
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
6213
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-FAT5XRFB.js");
|
|
6213
6214
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6214
6215
|
const updatedConfig = setDefaultModelSelection(globalConfig, providerId, model ?? "auto");
|
|
6215
6216
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
@@ -6240,7 +6241,7 @@ async function createServerHandle(config4) {
|
|
|
6240
6241
|
res.json({ success: true });
|
|
6241
6242
|
});
|
|
6242
6243
|
app.put("/api/sessions/:id/mode", async (req, res) => {
|
|
6243
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6244
|
+
const { getEventStore: getEventStore2 } = await import("./events-R7FRQEBE.js");
|
|
6244
6245
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-YOCGTZYH.js");
|
|
6245
6246
|
const sessionId = req.params.id;
|
|
6246
6247
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -6297,12 +6298,12 @@ async function createServerHandle(config4) {
|
|
|
6297
6298
|
if (!callId || approved === void 0) {
|
|
6298
6299
|
return res.status(400).json({ error: "callId and approved are required" });
|
|
6299
6300
|
}
|
|
6300
|
-
const { providePathConfirmation } = await import("./tools-
|
|
6301
|
+
const { providePathConfirmation } = await import("./tools-TJGSHOAR.js");
|
|
6301
6302
|
const result = providePathConfirmation(callId, approved, alwaysAllow);
|
|
6302
6303
|
if (!result.found) {
|
|
6303
6304
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
6304
6305
|
}
|
|
6305
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6306
|
+
const { getEventStore: getEventStore2 } = await import("./events-R7FRQEBE.js");
|
|
6306
6307
|
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-YOCGTZYH.js");
|
|
6307
6308
|
const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-CN24IKQN.js");
|
|
6308
6309
|
const eventStore = getEventStore2();
|
|
@@ -6321,7 +6322,7 @@ async function createServerHandle(config4) {
|
|
|
6321
6322
|
if (!callId || !answer) {
|
|
6322
6323
|
return res.status(400).json({ error: "callId and answer are required" });
|
|
6323
6324
|
}
|
|
6324
|
-
const { provideAnswer: provideAnswer2 } = await import("./tools-
|
|
6325
|
+
const { provideAnswer: provideAnswer2 } = await import("./tools-TJGSHOAR.js");
|
|
6325
6326
|
const found = provideAnswer2(callId, answer);
|
|
6326
6327
|
if (!found) {
|
|
6327
6328
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -6357,14 +6358,14 @@ async function createServerHandle(config4) {
|
|
|
6357
6358
|
if (!session) {
|
|
6358
6359
|
return res.status(404).json({ error: "Session not found" });
|
|
6359
6360
|
}
|
|
6360
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
6361
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
6361
|
+
const { stopSessionExecution } = await import("./chat-handler-DKX2XFHA.js");
|
|
6362
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-TJGSHOAR.js");
|
|
6362
6363
|
stopSessionExecution(sessionId, sessionManager);
|
|
6363
6364
|
abortSession(sessionId);
|
|
6364
6365
|
cancelQuestionsForSession(sessionId, "Session stopped by user");
|
|
6365
6366
|
cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
|
|
6366
6367
|
sessionManager.clearMessageQueue(sessionId);
|
|
6367
|
-
const eventStore = (await import("./events-
|
|
6368
|
+
const eventStore = (await import("./events-R7FRQEBE.js")).getEventStore();
|
|
6368
6369
|
eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
|
|
6369
6370
|
res.json({ success: true });
|
|
6370
6371
|
});
|
|
@@ -6378,7 +6379,7 @@ async function createServerHandle(config4) {
|
|
|
6378
6379
|
if (typeof messageIndex !== "number" || messageIndex < 0) {
|
|
6379
6380
|
return res.status(400).json({ error: "messageIndex must be a non-negative number" });
|
|
6380
6381
|
}
|
|
6381
|
-
const { truncateSessionMessages } = await import("./events-
|
|
6382
|
+
const { truncateSessionMessages } = await import("./events-R7FRQEBE.js");
|
|
6382
6383
|
truncateSessionMessages(sessionId, messageIndex);
|
|
6383
6384
|
res.json({ success: true });
|
|
6384
6385
|
});
|
|
@@ -6396,7 +6397,7 @@ async function createServerHandle(config4) {
|
|
|
6396
6397
|
if (!msg) {
|
|
6397
6398
|
return res.status(400).json({ error: "Message not found at this index" });
|
|
6398
6399
|
}
|
|
6399
|
-
const { truncateSessionMessages } = await import("./events-
|
|
6400
|
+
const { truncateSessionMessages } = await import("./events-R7FRQEBE.js");
|
|
6400
6401
|
truncateSessionMessages(sessionId, messageIndex - 1);
|
|
6401
6402
|
sessionManager.queueMessage(sessionId, "asap", msg.content, msg.attachments, msg.messageKind);
|
|
6402
6403
|
res.json({ success: true });
|
|
@@ -6468,7 +6469,7 @@ async function createServerHandle(config4) {
|
|
|
6468
6469
|
let visionFallback;
|
|
6469
6470
|
let globalWorkdir;
|
|
6470
6471
|
try {
|
|
6471
|
-
const { loadGlobalConfig, getVisionFallback } = await import("./config-
|
|
6472
|
+
const { loadGlobalConfig, getVisionFallback } = await import("./config-FAT5XRFB.js");
|
|
6472
6473
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6473
6474
|
const fallback = getVisionFallback(globalConfig);
|
|
6474
6475
|
if (fallback) {
|
|
@@ -6541,13 +6542,78 @@ async function createServerHandle(config4) {
|
|
|
6541
6542
|
});
|
|
6542
6543
|
}
|
|
6543
6544
|
});
|
|
6545
|
+
app.get("/api/providers/models", async (req, res) => {
|
|
6546
|
+
const url = req.query["url"];
|
|
6547
|
+
if (!url) return res.status(400).json({ error: "url is required" });
|
|
6548
|
+
try {
|
|
6549
|
+
const { fetchModelsWithContext } = await import("./provider-manager-IP3HOGNB.js");
|
|
6550
|
+
const models = await fetchModelsWithContext(url);
|
|
6551
|
+
if (models.length === 0) {
|
|
6552
|
+
return res.status(404).json({ error: `No models found at ${url}/v1/models`, url });
|
|
6553
|
+
}
|
|
6554
|
+
res.json({
|
|
6555
|
+
models: models.map((m) => ({
|
|
6556
|
+
id: m.id,
|
|
6557
|
+
contextWindow: m.contextWindow,
|
|
6558
|
+
defaultTemperature: m.defaultTemperature,
|
|
6559
|
+
defaultTopP: m.defaultTopP,
|
|
6560
|
+
defaultTopK: m.defaultTopK,
|
|
6561
|
+
defaultMaxTokens: m.defaultMaxTokens
|
|
6562
|
+
})),
|
|
6563
|
+
url
|
|
6564
|
+
});
|
|
6565
|
+
} catch (error) {
|
|
6566
|
+
res.status(400).json({
|
|
6567
|
+
error: `Failed to fetch models from ${url}: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
6568
|
+
url
|
|
6569
|
+
});
|
|
6570
|
+
}
|
|
6571
|
+
});
|
|
6572
|
+
app.post("/api/providers/test-params", async (req, res) => {
|
|
6573
|
+
const { url, params, apiKey } = req.body;
|
|
6574
|
+
if (!url) return res.status(400).json({ error: "url is required" });
|
|
6575
|
+
try {
|
|
6576
|
+
const headers = { "Content-Type": "application/json" };
|
|
6577
|
+
if (apiKey) headers["Authorization"] = `Bearer ${apiKey}`;
|
|
6578
|
+
const body = {
|
|
6579
|
+
model: "deepseek-v4-flash",
|
|
6580
|
+
messages: [{ role: "user", content: "say hi in one word" }],
|
|
6581
|
+
max_tokens: 8e3,
|
|
6582
|
+
...params
|
|
6583
|
+
};
|
|
6584
|
+
const response = await fetch(`${url}/v1/chat/completions`, {
|
|
6585
|
+
method: "POST",
|
|
6586
|
+
headers,
|
|
6587
|
+
body: JSON.stringify(body),
|
|
6588
|
+
signal: AbortSignal.timeout(15e3)
|
|
6589
|
+
});
|
|
6590
|
+
if (!response.ok) {
|
|
6591
|
+
const errorBody = await response.text();
|
|
6592
|
+
return res.status(400).json({ error: `API error (${response.status}): ${errorBody.slice(0, 200)}` });
|
|
6593
|
+
}
|
|
6594
|
+
const data = await response.json();
|
|
6595
|
+
const message = data.choices?.[0]?.message ?? {};
|
|
6596
|
+
res.json({ success: true, message, raw: JSON.stringify(data, null, 2).slice(0, 2e3) });
|
|
6597
|
+
} catch (error) {
|
|
6598
|
+
res.status(400).json({ error: error instanceof Error ? error.message : "Request failed" });
|
|
6599
|
+
}
|
|
6600
|
+
});
|
|
6544
6601
|
app.post("/api/providers", async (req, res) => {
|
|
6545
|
-
const {
|
|
6602
|
+
const {
|
|
6603
|
+
name,
|
|
6604
|
+
url,
|
|
6605
|
+
backend,
|
|
6606
|
+
apiKey,
|
|
6607
|
+
model,
|
|
6608
|
+
isLocal,
|
|
6609
|
+
thinkingField,
|
|
6610
|
+
models: modelConfigs
|
|
6611
|
+
} = req.body;
|
|
6546
6612
|
if (!name || !url || !backend) {
|
|
6547
6613
|
return res.status(400).json({ error: "name, url, and backend are required" });
|
|
6548
6614
|
}
|
|
6549
6615
|
try {
|
|
6550
|
-
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-
|
|
6616
|
+
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-FAT5XRFB.js");
|
|
6551
6617
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6552
6618
|
const providerBackend = backend;
|
|
6553
6619
|
const configWithProvider = addProvider(globalConfig, {
|
|
@@ -6556,7 +6622,16 @@ async function createServerHandle(config4) {
|
|
|
6556
6622
|
backend: providerBackend,
|
|
6557
6623
|
apiKey,
|
|
6558
6624
|
...isLocal !== void 0 ? { isLocal } : {},
|
|
6559
|
-
|
|
6625
|
+
...thinkingField ? { thinkingField } : {},
|
|
6626
|
+
models: modelConfigs?.length ? modelConfigs.map((m) => ({
|
|
6627
|
+
id: m.id,
|
|
6628
|
+
contextWindow: m.contextWindow,
|
|
6629
|
+
source: "user",
|
|
6630
|
+
...m.supportsVision !== void 0 ? { supportsVision: m.supportsVision } : {},
|
|
6631
|
+
...m.thinkingEnabled !== void 0 ? { thinkingEnabled: m.thinkingEnabled } : {},
|
|
6632
|
+
...m.thinkingLevel ? { thinkingLevel: m.thinkingLevel } : {},
|
|
6633
|
+
...m.nonThinkingEnabled !== void 0 ? { nonThinkingEnabled: m.nonThinkingEnabled } : {}
|
|
6634
|
+
})) : model ? [{ id: model, contextWindow: 2e5, source: "user" }] : [],
|
|
6560
6635
|
isActive: true
|
|
6561
6636
|
});
|
|
6562
6637
|
const finalConfig = setDefaultModelSelection(
|
|
@@ -6581,7 +6656,7 @@ async function createServerHandle(config4) {
|
|
|
6581
6656
|
app.post("/api/init/config", async (req, res) => {
|
|
6582
6657
|
const { workdir, visionFallback } = req.body;
|
|
6583
6658
|
try {
|
|
6584
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6659
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-FAT5XRFB.js");
|
|
6585
6660
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6586
6661
|
const updatedConfig = {
|
|
6587
6662
|
...globalConfig,
|
|
@@ -6609,7 +6684,7 @@ async function createServerHandle(config4) {
|
|
|
6609
6684
|
});
|
|
6610
6685
|
app.delete("/api/providers/:id", async (req, res) => {
|
|
6611
6686
|
const { id } = req.params;
|
|
6612
|
-
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-
|
|
6687
|
+
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-FAT5XRFB.js");
|
|
6613
6688
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6614
6689
|
const updatedConfig = removeProvider(globalConfig, id);
|
|
6615
6690
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
@@ -6620,7 +6695,7 @@ async function createServerHandle(config4) {
|
|
|
6620
6695
|
const { id } = req.params;
|
|
6621
6696
|
const { isLocal } = req.body;
|
|
6622
6697
|
try {
|
|
6623
|
-
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-
|
|
6698
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-FAT5XRFB.js");
|
|
6624
6699
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6625
6700
|
const provider = globalConfig.providers.find((p) => p.id === id);
|
|
6626
6701
|
if (!provider) {
|
|
@@ -6636,6 +6711,52 @@ async function createServerHandle(config4) {
|
|
|
6636
6711
|
res.status(500).json({ error: error instanceof Error ? error.message : "Failed to update provider" });
|
|
6637
6712
|
}
|
|
6638
6713
|
});
|
|
6714
|
+
app.put("/api/providers/:id", async (req, res) => {
|
|
6715
|
+
const { id } = req.params;
|
|
6716
|
+
const {
|
|
6717
|
+
name,
|
|
6718
|
+
url,
|
|
6719
|
+
backend,
|
|
6720
|
+
apiKey,
|
|
6721
|
+
isLocal,
|
|
6722
|
+
thinkingField,
|
|
6723
|
+
models: modelConfigs
|
|
6724
|
+
} = req.body;
|
|
6725
|
+
try {
|
|
6726
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-FAT5XRFB.js");
|
|
6727
|
+
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6728
|
+
const provider = globalConfig.providers.find((p) => p.id === id);
|
|
6729
|
+
if (!provider) {
|
|
6730
|
+
return res.status(404).json({ error: "Provider not found" });
|
|
6731
|
+
}
|
|
6732
|
+
const updates = {};
|
|
6733
|
+
if (name !== void 0) updates["name"] = name;
|
|
6734
|
+
if (url !== void 0) updates["url"] = url;
|
|
6735
|
+
if (backend !== void 0) updates["backend"] = backend;
|
|
6736
|
+
if (apiKey !== void 0) updates["apiKey"] = apiKey || void 0;
|
|
6737
|
+
if (isLocal !== void 0) updates["isLocal"] = isLocal;
|
|
6738
|
+
if (thinkingField !== void 0) updates["thinkingField"] = thinkingField || void 0;
|
|
6739
|
+
if (modelConfigs !== void 0) {
|
|
6740
|
+
updates["models"] = modelConfigs.map((m) => ({
|
|
6741
|
+
id: m.id,
|
|
6742
|
+
contextWindow: m.contextWindow,
|
|
6743
|
+
source: "user",
|
|
6744
|
+
...m.supportsVision !== void 0 ? { supportsVision: m.supportsVision } : {},
|
|
6745
|
+
...m.thinkingEnabled !== void 0 ? { thinkingEnabled: m.thinkingEnabled } : {},
|
|
6746
|
+
...m.thinkingLevel ? { thinkingLevel: m.thinkingLevel } : {},
|
|
6747
|
+
...m.nonThinkingEnabled !== void 0 ? { nonThinkingEnabled: m.nonThinkingEnabled } : {},
|
|
6748
|
+
...m.thinkingExtraKwargs ? { thinkingExtraKwargs: m.thinkingExtraKwargs } : {},
|
|
6749
|
+
...m.nonThinkingExtraKwargs ? { nonThinkingExtraKwargs: m.nonThinkingExtraKwargs } : {}
|
|
6750
|
+
}));
|
|
6751
|
+
}
|
|
6752
|
+
const updatedConfig = updateProvider(globalConfig, id, updates);
|
|
6753
|
+
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
6754
|
+
providerManager.setProviders(updatedConfig.providers, updatedConfig.defaultModelSelection ?? void 0);
|
|
6755
|
+
res.json({ success: true, provider: updatedConfig.providers.find((p) => p.id === id) });
|
|
6756
|
+
} catch (error) {
|
|
6757
|
+
res.status(500).json({ error: error instanceof Error ? error.message : "Failed to update provider" });
|
|
6758
|
+
}
|
|
6759
|
+
});
|
|
6639
6760
|
app.get("/api/providers/:id/models", async (req, res) => {
|
|
6640
6761
|
const { id } = req.params;
|
|
6641
6762
|
const models = await providerManager.getProviderModels(id);
|
|
@@ -6649,7 +6770,7 @@ async function createServerHandle(config4) {
|
|
|
6649
6770
|
return res.status(400).json({ error: result.error });
|
|
6650
6771
|
}
|
|
6651
6772
|
const llmClient = getLLMClient();
|
|
6652
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
6773
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-FAT5XRFB.js");
|
|
6653
6774
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6654
6775
|
const updatedConfig = setDefaultModelSelection(globalConfig, id, llmClient.getModel());
|
|
6655
6776
|
await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
|
|
@@ -6668,7 +6789,7 @@ async function createServerHandle(config4) {
|
|
|
6668
6789
|
modelId,
|
|
6669
6790
|
body
|
|
6670
6791
|
});
|
|
6671
|
-
const hasFullSettings = body.temperature !== void 0 || body.topP !== void 0 || body.topK !== void 0 || body.maxTokens !== void 0;
|
|
6792
|
+
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
6793
|
let result;
|
|
6673
6794
|
if (hasFullSettings) {
|
|
6674
6795
|
result = await providerManager.updateModelSettings(id, modelId, body);
|
|
@@ -6680,7 +6801,7 @@ async function createServerHandle(config4) {
|
|
|
6680
6801
|
if (!result.success) {
|
|
6681
6802
|
return res.status(400).json({ error: result.error });
|
|
6682
6803
|
}
|
|
6683
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6804
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-FAT5XRFB.js");
|
|
6684
6805
|
const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
|
|
6685
6806
|
const updatedProviders = providerManager.getProviders();
|
|
6686
6807
|
const updatedConfig = {
|
|
@@ -6894,7 +7015,7 @@ async function createServerHandle(config4) {
|
|
|
6894
7015
|
providerManager
|
|
6895
7016
|
);
|
|
6896
7017
|
const wss = wssExports.wss;
|
|
6897
|
-
const { QueueProcessor } = await import("./processor-
|
|
7018
|
+
const { QueueProcessor } = await import("./processor-5T3CXD5I.js");
|
|
6898
7019
|
const queueProcessor = new QueueProcessor({
|
|
6899
7020
|
sessionManager,
|
|
6900
7021
|
providerManager,
|
|
@@ -6966,4 +7087,4 @@ export {
|
|
|
6966
7087
|
createServerHandle,
|
|
6967
7088
|
createServer
|
|
6968
7089
|
};
|
|
6969
|
-
//# sourceMappingURL=chunk-
|
|
7090
|
+
//# sourceMappingURL=chunk-BNFQMAH6.js.map
|
|
@@ -17,22 +17,22 @@ import {
|
|
|
17
17
|
loadAllAgentsDefault,
|
|
18
18
|
processEventsForConversation,
|
|
19
19
|
runTopLevelAgentLoop
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5RP2ZU2G.js";
|
|
21
21
|
import {
|
|
22
22
|
getCurrentContextWindowId,
|
|
23
23
|
getCurrentWindowMessageOptions,
|
|
24
24
|
getEventStore,
|
|
25
25
|
getRuntimeConfig
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-DHAKJSE7.js";
|
|
27
27
|
import {
|
|
28
28
|
buildSnapshotFromSessionState
|
|
29
29
|
} from "./chunk-ITWVFGFV.js";
|
|
30
|
-
import {
|
|
31
|
-
logger
|
|
32
|
-
} from "./chunk-K44MW7JJ.js";
|
|
33
30
|
import {
|
|
34
31
|
getGlobalConfigDir
|
|
35
32
|
} from "./chunk-CQGTEGKL.js";
|
|
33
|
+
import {
|
|
34
|
+
logger
|
|
35
|
+
} from "./chunk-K44MW7JJ.js";
|
|
36
36
|
|
|
37
37
|
// src/server/chat/dynamic-context.ts
|
|
38
38
|
import { createHash } from "crypto";
|
|
@@ -245,8 +245,7 @@ async function runAgentTurn(options, turnMetrics, agentId, append, callbacks) {
|
|
|
245
245
|
messages: input.messages,
|
|
246
246
|
injectedFiles: input.injectedFiles,
|
|
247
247
|
requestTools: input.promptTools,
|
|
248
|
-
toolChoice: input.toolChoice
|
|
249
|
-
disableThinking: false
|
|
248
|
+
toolChoice: input.toolChoice
|
|
250
249
|
});
|
|
251
250
|
}
|
|
252
251
|
const result = assembleAgentRequest({
|
|
@@ -312,4 +311,4 @@ export {
|
|
|
312
311
|
runAgentTurn,
|
|
313
312
|
injectWorkflowKickoffIfNeeded
|
|
314
313
|
};
|
|
315
|
-
//# sourceMappingURL=chunk-
|
|
314
|
+
//# sourceMappingURL=chunk-DBDMMSCM.js.map
|
|
@@ -895,6 +895,8 @@ var envSchema = z.object({
|
|
|
895
895
|
OPENFOX_WORKDIR: z.string().optional(),
|
|
896
896
|
OPENFOX_DB_PATH: z.string().default("./openfox.db"),
|
|
897
897
|
OPENFOX_LOG_LEVEL: z.enum(["debug", "info", "warn", "error"]).default("info"),
|
|
898
|
+
OPENFOX_REASONING_EFFORT: z.string().optional(),
|
|
899
|
+
// Deprecated: use OPENFOX_REASONING_EFFORT=none instead
|
|
898
900
|
OPENFOX_DISABLE_THINKING: z.coerce.boolean().default(false),
|
|
899
901
|
OPENFOX_DEV: z.coerce.boolean().default(false)
|
|
900
902
|
});
|
|
@@ -911,7 +913,7 @@ function loadConfig() {
|
|
|
911
913
|
idleTimeout: 3e5,
|
|
912
914
|
// 5 minutes of inactivity
|
|
913
915
|
backend: env.OPENFOX_BACKEND,
|
|
914
|
-
|
|
916
|
+
...env.OPENFOX_REASONING_EFFORT ? { reasoningEffort: env.OPENFOX_REASONING_EFFORT } : env.OPENFOX_DISABLE_THINKING ? { reasoningEffort: "none" } : {}
|
|
915
917
|
},
|
|
916
918
|
context: {
|
|
917
919
|
maxTokens: env.OPENFOX_MAX_CONTEXT,
|
|
@@ -1422,4 +1424,4 @@ export {
|
|
|
1422
1424
|
compactContext,
|
|
1423
1425
|
getRecentUserPromptsForSession
|
|
1424
1426
|
};
|
|
1425
|
-
//# sourceMappingURL=chunk-
|
|
1427
|
+
//# sourceMappingURL=chunk-DHAKJSE7.js.map
|