openfox 2.0.22 → 2.0.24

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.
Files changed (28) hide show
  1. package/dist/{chat-handler-KNDSH5WR.js → chat-handler-4ATHDLH4.js} +5 -5
  2. package/dist/{chunk-3JPTXSR7.js → chunk-4EDH3ZXL.js} +3 -3
  3. package/dist/{chunk-ASM2Z7JU.js → chunk-CDIYCGCO.js} +2 -2
  4. package/dist/{chunk-EH27R2J3.js → chunk-INRKWEOH.js} +18 -18
  5. package/dist/{chunk-TVQTTZYW.js → chunk-MDRNKI7D.js} +7 -7
  6. package/dist/{chunk-VDC2QL2O.js → chunk-QK6TYNUN.js} +3 -3
  7. package/dist/{chunk-T67KB6ZS.js → chunk-RYHCYZQ7.js} +8 -8
  8. package/dist/{chunk-Z4SWOUWC.js → chunk-UUFEE7VR.js} +1 -1
  9. package/dist/{chunk-PQ56PX7L.js → chunk-XJ4SUDL7.js} +83 -9
  10. package/dist/{chunk-DX37WNM7.js → chunk-YUHODMKY.js} +2 -2
  11. package/dist/{chunk-3SGGOBCL.js → chunk-YVF3BLQS.js} +3 -3
  12. package/dist/cli/dev.js +1 -1
  13. package/dist/cli/index.js +1 -1
  14. package/dist/{compactor-EOQYEOFS.js → compactor-SEZEZSML.js} +4 -4
  15. package/dist/{orchestrator-ZVPFU2ZF.js → orchestrator-MFN7COWT.js} +5 -5
  16. package/dist/package.json +1 -2
  17. package/dist/{processor-DKAYI3PV.js → processor-W2ZSJVOJ.js} +5 -5
  18. package/dist/{provider-YBTRC77Y.js → provider-IMW3ITB7.js} +4 -4
  19. package/dist/{provider-manager-DETXLDKW.js → provider-manager-DNBMBP4D.js} +4 -4
  20. package/dist/{serve-F7G655XI.js → serve-ABSUHKT3.js} +10 -10
  21. package/dist/server/index.js +9 -9
  22. package/dist/{server-CN7ML6XN.js → server-7EAYI7T4.js} +8 -8
  23. package/dist/{tools-ZUOBYTVD.js → tools-7CKTYL2G.js} +4 -4
  24. package/dist/web/assets/{index-D61sh6SX.js → index-Bi5R_oF2.js} +60 -60
  25. package/dist/web/assets/{index-Bq9rJ9jH.css → index-CkUCxzzC.css} +1 -1
  26. package/dist/web/index.html +2 -2
  27. package/dist/web/sw.js +1 -1
  28. package/package.json +1 -2
@@ -8,10 +8,10 @@ import {
8
8
  } from "./chunk-GI24G4OW.js";
9
9
  import {
10
10
  runChatTurn
11
- } from "./chunk-VDC2QL2O.js";
12
- import "./chunk-TVQTTZYW.js";
11
+ } from "./chunk-QK6TYNUN.js";
12
+ import "./chunk-MDRNKI7D.js";
13
13
  import "./chunk-O4TED6AJ.js";
14
- import "./chunk-DX37WNM7.js";
14
+ import "./chunk-YUHODMKY.js";
15
15
  import "./chunk-DL6ZILAF.js";
16
16
  import "./chunk-PBGOZMVY.js";
17
17
  import "./chunk-VRGRAQDG.js";
@@ -31,7 +31,7 @@ import "./chunk-FBGWG4N6.js";
31
31
  import "./chunk-YD6NDTKF.js";
32
32
  import "./chunk-SNQT7LNU.js";
33
33
  import "./chunk-CQGTEGKL.js";
34
- import "./chunk-Z4SWOUWC.js";
34
+ import "./chunk-UUFEE7VR.js";
35
35
  import {
36
36
  logger
37
37
  } from "./chunk-K44MW7JJ.js";
@@ -164,4 +164,4 @@ export {
164
164
  startChatSession,
165
165
  stopSessionExecution
166
166
  };
167
- //# sourceMappingURL=chat-handler-KNDSH5WR.js.map
167
+ //# sourceMappingURL=chat-handler-4ATHDLH4.js.map
@@ -152,7 +152,7 @@ async function runCli(options) {
152
152
  break;
153
153
  }
154
154
  case "provider": {
155
- const { runProviderCommand } = await import("./provider-YBTRC77Y.js");
155
+ const { runProviderCommand } = await import("./provider-IMW3ITB7.js");
156
156
  const [, subcommand] = positionals;
157
157
  await runProviderCommand(mode, subcommand);
158
158
  break;
@@ -196,7 +196,7 @@ async function runCli(options) {
196
196
  if (!configExists) {
197
197
  await runNetworkSetup(mode);
198
198
  }
199
- const { runServe } = await import("./serve-F7G655XI.js");
199
+ const { runServe } = await import("./serve-ABSUHKT3.js");
200
200
  const serveOptions = { mode };
201
201
  if (values.port) serveOptions.port = parseInt(values.port);
202
202
  if (values["no-browser"] === true) serveOptions.openBrowser = false;
@@ -208,4 +208,4 @@ async function runCli(options) {
208
208
  export {
209
209
  runCli
210
210
  };
211
- //# sourceMappingURL=chunk-3JPTXSR7.js.map
211
+ //# sourceMappingURL=chunk-4EDH3ZXL.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  COMPACTION_PROMPT,
3
3
  createMessageStartEvent
4
- } from "./chunk-DX37WNM7.js";
4
+ } from "./chunk-YUHODMKY.js";
5
5
  import {
6
6
  getCurrentWindowMessageOptions
7
7
  } from "./chunk-YBWY4DKY.js";
@@ -31,4 +31,4 @@ export {
31
31
  shouldCompact,
32
32
  getCompactionTarget
33
33
  };
34
- //# sourceMappingURL=chunk-ASM2Z7JU.js.map
34
+ //# sourceMappingURL=chunk-CDIYCGCO.js.map
@@ -21,7 +21,7 @@ import {
21
21
  tokenFromPassword,
22
22
  verifyPassword,
23
23
  workflowExists
24
- } from "./chunk-T67KB6ZS.js";
24
+ } from "./chunk-RYHCYZQ7.js";
25
25
  import {
26
26
  agentExists,
27
27
  createToolRegistry,
@@ -61,7 +61,7 @@ import {
61
61
  setMcpTools,
62
62
  setNotifyMcpServersChanged,
63
63
  skillExists
64
- } from "./chunk-TVQTTZYW.js";
64
+ } from "./chunk-MDRNKI7D.js";
65
65
  import {
66
66
  getProject
67
67
  } from "./chunk-O4TED6AJ.js";
@@ -69,7 +69,7 @@ import {
69
69
  ALWAYS_ALLOWED,
70
70
  ALWAYS_ALLOWED_FOR_SUBAGENTS,
71
71
  TOP_LEVEL_ONLY_TOOLS
72
- } from "./chunk-DX37WNM7.js";
72
+ } from "./chunk-YUHODMKY.js";
73
73
  import {
74
74
  getPathSeparator,
75
75
  isAbsolutePath
@@ -120,18 +120,18 @@ import {
120
120
  import {
121
121
  createProviderManager,
122
122
  parseDefaultModelSelection
123
- } from "./chunk-3SGGOBCL.js";
123
+ } from "./chunk-YVF3BLQS.js";
124
124
  import {
125
125
  SessionNotFoundError,
126
126
  buildModelsUrl,
127
127
  detectModel,
128
128
  ensureVersionPrefix,
129
129
  getLlmStatus
130
- } from "./chunk-PQ56PX7L.js";
130
+ } from "./chunk-XJ4SUDL7.js";
131
131
  import {
132
132
  getBackendDisplayName,
133
133
  getModelProfile
134
- } from "./chunk-Z4SWOUWC.js";
134
+ } from "./chunk-UUFEE7VR.js";
135
135
  import {
136
136
  logger,
137
137
  setLogLevel
@@ -3443,7 +3443,7 @@ import { Router as Router6 } from "express";
3443
3443
  import { spawn as spawn2 } from "child_process";
3444
3444
 
3445
3445
  // src/constants.ts
3446
- var VERSION = "2.0.22";
3446
+ var VERSION = "2.0.24";
3447
3447
 
3448
3448
  // src/server/routes/auto-update.ts
3449
3449
  var updateInProgress = false;
@@ -3623,7 +3623,7 @@ async function createServerHandle(config4) {
3623
3623
  setMcpTools(mcpTools);
3624
3624
  logger.info("MCP tools registered", { count: mcpTools.length });
3625
3625
  }
3626
- const { signalMcpReady } = await import("./server-CN7ML6XN.js");
3626
+ const { signalMcpReady } = await import("./server-7EAYI7T4.js");
3627
3627
  signalMcpReady();
3628
3628
  });
3629
3629
  const app = express();
@@ -3816,7 +3816,7 @@ async function createServerHandle(config4) {
3816
3816
  app.get("/api/sessions/:id", async (req, res) => {
3817
3817
  const { getEventStore: getEventStore2 } = await import("./events-JKPHAR5W.js");
3818
3818
  const { buildMessagesFromStoredEvents } = await import("./folding-PI67HWBR.js");
3819
- const { getPendingQuestionsForSession } = await import("./tools-ZUOBYTVD.js");
3819
+ const { getPendingQuestionsForSession } = await import("./tools-7CKTYL2G.js");
3820
3820
  const session = sessionManager.getSession(req.params.id);
3821
3821
  if (!session) {
3822
3822
  return res.status(404).json({ error: "Session not found" });
@@ -3947,7 +3947,7 @@ async function createServerHandle(config4) {
3947
3947
  if (!callId || approved === void 0) {
3948
3948
  return res.status(400).json({ error: "callId and approved are required" });
3949
3949
  }
3950
- const { providePathConfirmation } = await import("./tools-ZUOBYTVD.js");
3950
+ const { providePathConfirmation } = await import("./tools-7CKTYL2G.js");
3951
3951
  const result = providePathConfirmation(callId, approved, alwaysAllow);
3952
3952
  if (!result.found) {
3953
3953
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
@@ -3955,7 +3955,7 @@ async function createServerHandle(config4) {
3955
3955
  const { getEventStore: getEventStore2 } = await import("./events-JKPHAR5W.js");
3956
3956
  const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-PI67HWBR.js");
3957
3957
  const { createSessionStateMessage } = await import("./protocol-BKNLAEPJ.js");
3958
- const { getPendingQuestionsForSession } = await import("./tools-ZUOBYTVD.js");
3958
+ const { getPendingQuestionsForSession } = await import("./tools-7CKTYL2G.js");
3959
3959
  const eventStore = getEventStore2();
3960
3960
  const events = eventStore.getEvents(sessionId);
3961
3961
  const messages = buildMessagesFromStoredEvents(events);
@@ -3976,7 +3976,7 @@ async function createServerHandle(config4) {
3976
3976
  if (!skip && typeof answer !== "string") {
3977
3977
  return res.status(400).json({ error: "answer is required when not skipping" });
3978
3978
  }
3979
- const { provideAnswer } = await import("./tools-ZUOBYTVD.js");
3979
+ const { provideAnswer } = await import("./tools-7CKTYL2G.js");
3980
3980
  const found = provideAnswer(callId, answer ?? "", skip ?? false);
3981
3981
  if (!found) {
3982
3982
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -4012,8 +4012,8 @@ async function createServerHandle(config4) {
4012
4012
  if (!session) {
4013
4013
  return res.status(404).json({ error: "Session not found" });
4014
4014
  }
4015
- const { stopSessionExecution } = await import("./chat-handler-KNDSH5WR.js");
4016
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-ZUOBYTVD.js");
4015
+ const { stopSessionExecution } = await import("./chat-handler-4ATHDLH4.js");
4016
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-7CKTYL2G.js");
4017
4017
  const queuedMessages = sessionManager.getQueueState(sessionId);
4018
4018
  sessionManager.clearMessageQueue(sessionId);
4019
4019
  stopSessionExecution(sessionId, sessionManager);
@@ -4220,7 +4220,7 @@ async function createServerHandle(config4) {
4220
4220
  const apiKey = req.query["apiKey"];
4221
4221
  if (!url) return res.status(400).json({ error: "url is required" });
4222
4222
  try {
4223
- const { fetchModelsWithContext } = await import("./provider-manager-DETXLDKW.js");
4223
+ const { fetchModelsWithContext } = await import("./provider-manager-DNBMBP4D.js");
4224
4224
  const models = await fetchModelsWithContext(url, apiKey);
4225
4225
  if (models.length === 0) {
4226
4226
  return res.status(404).json({ error: `No models found at ${buildModelsUrl(url)}`, url });
@@ -4456,7 +4456,7 @@ async function createServerHandle(config4) {
4456
4456
  });
4457
4457
  async function rebuildMcpTools() {
4458
4458
  const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-B7QP6NLA.js");
4459
- const { setMcpTools: setMcpTools2 } = await import("./tools-ZUOBYTVD.js");
4459
+ const { setMcpTools: setMcpTools2 } = await import("./tools-7CKTYL2G.js");
4460
4460
  const mcpTools = createMcpTools2(mcpManager);
4461
4461
  setMcpTools2(mcpTools);
4462
4462
  }
@@ -4768,7 +4768,7 @@ async function createServerHandle(config4) {
4768
4768
  const state = sessionManager.getContextState(sessionId);
4769
4769
  wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
4770
4770
  });
4771
- const { QueueProcessor } = await import("./processor-DKAYI3PV.js");
4771
+ const { QueueProcessor } = await import("./processor-W2ZSJVOJ.js");
4772
4772
  const queueProcessor = new QueueProcessor({
4773
4773
  sessionManager,
4774
4774
  providerManager,
@@ -4843,4 +4843,4 @@ export {
4843
4843
  createServerHandle,
4844
4844
  createServer
4845
4845
  };
4846
- //# sourceMappingURL=chunk-EH27R2J3.js.map
4846
+ //# sourceMappingURL=chunk-INRKWEOH.js.map
@@ -15,7 +15,7 @@ import {
15
15
  createToolCallEvent,
16
16
  createToolResultEvent,
17
17
  streamLLMPure
18
- } from "./chunk-DX37WNM7.js";
18
+ } from "./chunk-YUHODMKY.js";
19
19
  import {
20
20
  startInspectProxy
21
21
  } from "./chunk-DL6ZILAF.js";
@@ -75,7 +75,7 @@ import {
75
75
  } from "./chunk-CQGTEGKL.js";
76
76
  import {
77
77
  modelSupportsVision
78
- } from "./chunk-Z4SWOUWC.js";
78
+ } from "./chunk-UUFEE7VR.js";
79
79
  import {
80
80
  logger
81
81
  } from "./chunk-K44MW7JJ.js";
@@ -2550,7 +2550,7 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
2550
2550
  sessionManager.setCurrentContextSize(sessionId, result.usage.promptTokens);
2551
2551
  if (!compacting) {
2552
2552
  const contextState = sessionManager.getContextState(sessionId);
2553
- const { shouldCompact, appendCompactionPrompt } = await import("./compactor-EOQYEOFS.js");
2553
+ const { shouldCompact, appendCompactionPrompt } = await import("./compactor-SEZEZSML.js");
2554
2554
  if (shouldCompact(contextState.currentTokens, contextState.maxTokens, runtimeConfig.context.compactionThreshold)) {
2555
2555
  appendCompactionPrompt(sessionId, append);
2556
2556
  compacting = true;
@@ -3355,7 +3355,7 @@ var callSubAgentTool = {
3355
3355
  };
3356
3356
  }
3357
3357
  try {
3358
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-ZUOBYTVD.js");
3358
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-7CKTYL2G.js");
3359
3359
  const toolRegistry = getToolRegistryForAgent2(agentDef);
3360
3360
  const turnMetrics = new TurnMetrics();
3361
3361
  const result = await executeSubAgent({
@@ -4161,7 +4161,7 @@ async function computeContextHash(sessionManager, sessionId) {
4161
4161
  const runtimeConfig = getRuntimeConfig();
4162
4162
  const configDir = getGlobalConfigDir(runtimeConfig.mode ?? "production");
4163
4163
  const skills = await getEnabledSkillMetadata(configDir, runtimeConfig.workdir);
4164
- const { createToolRegistry: createToolRegistry2 } = await import("./tools-ZUOBYTVD.js");
4164
+ const { createToolRegistry: createToolRegistry2 } = await import("./tools-7CKTYL2G.js");
4165
4165
  const allTools = createToolRegistry2().definitions;
4166
4166
  const toolFingerprint = getToolFingerprint(allTools);
4167
4167
  const hash = computeDynamicContextHash(instructionContent, skills, toolFingerprint);
@@ -4274,7 +4274,7 @@ var mcpConfigTool = createTool(
4274
4274
  await saveGlobalConfig(mcpConfigMode, { ...globalConfig, mcpServers: updated });
4275
4275
  }
4276
4276
  async function rebuildTools() {
4277
- const { setMcpTools: setMcpTools2 } = await import("./tools-ZUOBYTVD.js");
4277
+ const { setMcpTools: setMcpTools2 } = await import("./tools-7CKTYL2G.js");
4278
4278
  const mcpTools = createMcpTools(mcpManagerForTools);
4279
4279
  setMcpTools2(mcpTools);
4280
4280
  }
@@ -4678,4 +4678,4 @@ export {
4678
4678
  getToolRegistryForAgent,
4679
4679
  createToolRegistry
4680
4680
  };
4681
- //# sourceMappingURL=chunk-TVQTTZYW.js.map
4681
+ //# sourceMappingURL=chunk-MDRNKI7D.js.map
@@ -14,7 +14,7 @@ import {
14
14
  loadAllAgentsDefault,
15
15
  processEventsForConversation,
16
16
  runTopLevelAgentLoop
17
- } from "./chunk-TVQTTZYW.js";
17
+ } from "./chunk-MDRNKI7D.js";
18
18
  import {
19
19
  TurnMetrics,
20
20
  WORKFLOW_KICKOFF_PROMPT,
@@ -22,7 +22,7 @@ import {
22
22
  buildAgentSmallReminder,
23
23
  createChatDoneEvent,
24
24
  createMessageStartEvent
25
- } from "./chunk-DX37WNM7.js";
25
+ } from "./chunk-YUHODMKY.js";
26
26
  import {
27
27
  getCurrentContextWindowId,
28
28
  getCurrentWindowMessageOptions,
@@ -320,4 +320,4 @@ export {
320
320
  runAgentTurn,
321
321
  injectWorkflowKickoffIfNeeded
322
322
  };
323
- //# sourceMappingURL=chunk-VDC2QL2O.js.map
323
+ //# sourceMappingURL=chunk-QK6TYNUN.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  appendCompactionPrompt
3
- } from "./chunk-ASM2Z7JU.js";
3
+ } from "./chunk-CDIYCGCO.js";
4
4
  import {
5
5
  injectWorkflowKickoffIfNeeded,
6
6
  runAgentTurn,
7
7
  runChatTurn
8
- } from "./chunk-VDC2QL2O.js";
8
+ } from "./chunk-QK6TYNUN.js";
9
9
  import {
10
10
  applyDynamicContext,
11
11
  checkAborted,
@@ -22,11 +22,11 @@ import {
22
22
  loadAllAgentsDefault,
23
23
  saveItemToDir,
24
24
  spawnShellProcess
25
- } from "./chunk-TVQTTZYW.js";
25
+ } from "./chunk-MDRNKI7D.js";
26
26
  import {
27
27
  TurnMetrics,
28
28
  createMessageStartEvent
29
- } from "./chunk-DX37WNM7.js";
29
+ } from "./chunk-YUHODMKY.js";
30
30
  import {
31
31
  getPlatformShell,
32
32
  onProcessEvent
@@ -65,7 +65,7 @@ import {
65
65
  import {
66
66
  createLLMClient,
67
67
  ensureVersionPrefix
68
- } from "./chunk-PQ56PX7L.js";
68
+ } from "./chunk-XJ4SUDL7.js";
69
69
  import {
70
70
  logger
71
71
  } from "./chunk-K44MW7JJ.js";
@@ -1775,7 +1775,7 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
1775
1775
  const runtimeConfig = getRuntimeConfig();
1776
1776
  const configDir = getGlobalConfigDir(runtimeConfig.mode ?? "production");
1777
1777
  const skills = await getEnabledSkillMetadata(configDir, runtimeConfig.workdir);
1778
- const { createToolRegistry } = await import("./tools-ZUOBYTVD.js");
1778
+ const { createToolRegistry } = await import("./tools-7CKTYL2G.js");
1779
1779
  const allTools = createToolRegistry().definitions;
1780
1780
  const toolFingerprint = getToolFingerprint(allTools);
1781
1781
  const currentHash = computeDynamicContextHash(instructionContent, skills, toolFingerprint);
@@ -1848,7 +1848,7 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
1848
1848
  const runtimeConfig = getRuntimeConfig();
1849
1849
  const configDir = getGlobalConfigDir(runtimeConfig.mode ?? "production");
1850
1850
  const skills = await getEnabledSkillMetadata(configDir, runtimeConfig.workdir);
1851
- const { createToolRegistry } = await import("./tools-ZUOBYTVD.js");
1851
+ const { createToolRegistry } = await import("./tools-7CKTYL2G.js");
1852
1852
  const allTools = createToolRegistry().definitions;
1853
1853
  const toolFingerprint = getToolFingerprint(allTools);
1854
1854
  const currentHash = computeDynamicContextHash(instructionContent, skills, toolFingerprint);
@@ -2069,4 +2069,4 @@ export {
2069
2069
  signalMcpReady,
2070
2070
  createWebSocketServer
2071
2071
  };
2072
- //# sourceMappingURL=chunk-T67KB6ZS.js.map
2072
+ //# sourceMappingURL=chunk-RYHCYZQ7.js.map
@@ -502,4 +502,4 @@ export {
502
502
  mapFinishReason,
503
503
  streamWithSegments
504
504
  };
505
- //# sourceMappingURL=chunk-Z4SWOUWC.js.map
505
+ //# sourceMappingURL=chunk-UUFEE7VR.js.map
@@ -5,7 +5,7 @@ import {
5
5
  getModelProfile,
6
6
  getThinking,
7
7
  mapFinishReason
8
- } from "./chunk-Z4SWOUWC.js";
8
+ } from "./chunk-UUFEE7VR.js";
9
9
  import {
10
10
  logger
11
11
  } from "./chunk-K44MW7JJ.js";
@@ -26,9 +26,6 @@ function buildModelsUrl(baseUrl) {
26
26
  return `${ensureVersionPrefix(baseUrl)}/models`;
27
27
  }
28
28
 
29
- // src/server/llm/client.ts
30
- import OpenAI from "openai";
31
-
32
29
  // src/server/utils/errors.ts
33
30
  var OpenFoxError = class extends Error {
34
31
  constructor(message, code, details) {
@@ -51,13 +48,90 @@ var LLMError = class extends OpenFoxError {
51
48
  }
52
49
  };
53
50
 
54
- // src/server/llm/client.ts
51
+ // src/server/llm/http-client.ts
55
52
  import { Agent, setGlobalDispatcher } from "undici";
56
53
  var agent = new Agent({ allowH2: true });
57
54
  setGlobalDispatcher(agent);
55
+ var OpenAIHttpClient = class {
56
+ baseURL;
57
+ apiKey;
58
+ constructor(options) {
59
+ this.baseURL = options.baseURL;
60
+ this.apiKey = options.apiKey;
61
+ }
62
+ async fetchChatCompletion(params, options) {
63
+ const url = `${this.baseURL}/chat/completions`;
64
+ const headers = {
65
+ "Content-Type": "application/json",
66
+ Authorization: `Bearer ${this.apiKey}`
67
+ };
68
+ const response = await fetch(url, {
69
+ method: "POST",
70
+ headers,
71
+ body: JSON.stringify(params),
72
+ signal: options?.signal ?? null
73
+ });
74
+ if (!response.ok) {
75
+ const errorText = await response.text();
76
+ throw new LLMError(`HTTP ${response.status}: ${errorText}`);
77
+ }
78
+ return response;
79
+ }
80
+ async createChatCompletion(params, options) {
81
+ const response = await this.fetchChatCompletion(params, options);
82
+ try {
83
+ const data = await response.json();
84
+ return data;
85
+ } catch (error) {
86
+ throw new LLMError(`Failed to parse response: ${error instanceof Error ? error.message : "Unknown error"}`);
87
+ }
88
+ }
89
+ createChatCompletionStream(params, options) {
90
+ const responsePromise = this.fetchChatCompletion(params, options);
91
+ async function* generate() {
92
+ const response = await responsePromise;
93
+ if (!response.body) {
94
+ throw new LLMError("No response body for streaming");
95
+ }
96
+ const reader = response.body.getReader();
97
+ const decoder = new TextDecoder();
98
+ let buffer = "";
99
+ try {
100
+ while (true) {
101
+ const { done, value } = await reader.read();
102
+ if (done) break;
103
+ buffer += decoder.decode(value, { stream: true });
104
+ const lines = buffer.split("\n");
105
+ buffer = lines.pop() || "";
106
+ for (const line of lines) {
107
+ const trimmed = line.trim();
108
+ if (!trimmed) continue;
109
+ if (trimmed.startsWith("data: ")) {
110
+ const data = trimmed.slice(6);
111
+ if (data === "[DONE]") {
112
+ return;
113
+ }
114
+ try {
115
+ const chunk = JSON.parse(data);
116
+ yield chunk;
117
+ } catch (error) {
118
+ logger.warn("Failed to parse SSE chunk", { data, error });
119
+ }
120
+ }
121
+ }
122
+ }
123
+ } finally {
124
+ reader.releaseLock();
125
+ }
126
+ }
127
+ return generate();
128
+ }
129
+ };
130
+
131
+ // src/server/llm/client.ts
58
132
  function createLLMClient(config, initialBackend = "unknown") {
59
133
  const baseURL = ensureVersionPrefix(config.llm.baseUrl);
60
- const openai = new OpenAI({
134
+ const httpClient = new OpenAIHttpClient({
61
135
  baseURL,
62
136
  apiKey: config.llm.apiKey ?? "not-needed"
63
137
  });
@@ -111,7 +185,7 @@ function createLLMClient(config, initialBackend = "unknown") {
111
185
  ...resolvedEffort ? { reasoningEffort: resolvedEffort } : {},
112
186
  ...thinkingField ? { thinkingField } : {}
113
187
  });
114
- const response = await openai.chat.completions.create(createParams, {
188
+ const response = await httpClient.createChatCompletion(createParams, {
115
189
  signal: request.signal
116
190
  });
117
191
  const choice = response.choices[0];
@@ -164,7 +238,7 @@ function createLLMClient(config, initialBackend = "unknown") {
164
238
  ...thinkingField ? { thinkingField } : {}
165
239
  });
166
240
  const { params: streamingParams } = createParams;
167
- const stream = await openai.chat.completions.create(streamingParams, {
241
+ const stream = httpClient.createChatCompletionStream(streamingParams, {
168
242
  signal: request.signal
169
243
  });
170
244
  let fullContent = "";
@@ -394,4 +468,4 @@ export {
394
468
  getLlmStatus,
395
469
  clearModelCache
396
470
  };
397
- //# sourceMappingURL=chunk-PQ56PX7L.js.map
471
+ //# sourceMappingURL=chunk-XJ4SUDL7.js.map
@@ -3,7 +3,7 @@ import {
3
3
  getBackendCapabilities,
4
4
  getModelProfile,
5
5
  streamWithSegments
6
- } from "./chunk-Z4SWOUWC.js";
6
+ } from "./chunk-UUFEE7VR.js";
7
7
  import {
8
8
  logger
9
9
  } from "./chunk-K44MW7JJ.js";
@@ -699,4 +699,4 @@ export {
699
699
  createChatDoneEvent,
700
700
  consumeStreamGenerator
701
701
  };
702
- //# sourceMappingURL=chunk-DX37WNM7.js.map
702
+ //# sourceMappingURL=chunk-YUHODMKY.js.map
@@ -5,10 +5,10 @@ import {
5
5
  detectModel,
6
6
  ensureVersionPrefix,
7
7
  stripVersionPrefix
8
- } from "./chunk-PQ56PX7L.js";
8
+ } from "./chunk-XJ4SUDL7.js";
9
9
  import {
10
10
  getModelProfile
11
- } from "./chunk-Z4SWOUWC.js";
11
+ } from "./chunk-UUFEE7VR.js";
12
12
  import {
13
13
  logger
14
14
  } from "./chunk-K44MW7JJ.js";
@@ -540,4 +540,4 @@ export {
540
540
  parseDefaultModelSelection,
541
541
  createProviderManager
542
542
  };
543
- //# sourceMappingURL=chunk-3SGGOBCL.js.map
543
+ //# sourceMappingURL=chunk-YVF3BLQS.js.map
package/dist/cli/dev.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "../chunk-3JPTXSR7.js";
4
+ } from "../chunk-4EDH3ZXL.js";
5
5
  import {
6
6
  logger
7
7
  } from "../chunk-K44MW7JJ.js";
package/dist/cli/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "../chunk-3JPTXSR7.js";
4
+ } from "../chunk-4EDH3ZXL.js";
5
5
  import {
6
6
  logger
7
7
  } from "../chunk-K44MW7JJ.js";
@@ -2,16 +2,16 @@ import {
2
2
  appendCompactionPrompt,
3
3
  getCompactionTarget,
4
4
  shouldCompact
5
- } from "./chunk-ASM2Z7JU.js";
6
- import "./chunk-DX37WNM7.js";
5
+ } from "./chunk-CDIYCGCO.js";
6
+ import "./chunk-YUHODMKY.js";
7
7
  import "./chunk-YBWY4DKY.js";
8
8
  import "./chunk-6PLAWCHQ.js";
9
9
  import "./chunk-FBGWG4N6.js";
10
- import "./chunk-Z4SWOUWC.js";
10
+ import "./chunk-UUFEE7VR.js";
11
11
  import "./chunk-K44MW7JJ.js";
12
12
  export {
13
13
  appendCompactionPrompt,
14
14
  getCompactionTarget,
15
15
  shouldCompact
16
16
  };
17
- //# sourceMappingURL=compactor-EOQYEOFS.js.map
17
+ //# sourceMappingURL=compactor-SEZEZSML.js.map
@@ -2,8 +2,8 @@ import {
2
2
  injectWorkflowKickoffIfNeeded,
3
3
  runAgentTurn,
4
4
  runChatTurn
5
- } from "./chunk-VDC2QL2O.js";
6
- import "./chunk-TVQTTZYW.js";
5
+ } from "./chunk-QK6TYNUN.js";
6
+ import "./chunk-MDRNKI7D.js";
7
7
  import "./chunk-O4TED6AJ.js";
8
8
  import {
9
9
  TurnMetrics,
@@ -12,7 +12,7 @@ import {
12
12
  createMessageStartEvent,
13
13
  createToolCallEvent,
14
14
  createToolResultEvent
15
- } from "./chunk-DX37WNM7.js";
15
+ } from "./chunk-YUHODMKY.js";
16
16
  import "./chunk-DL6ZILAF.js";
17
17
  import "./chunk-PBGOZMVY.js";
18
18
  import "./chunk-VRGRAQDG.js";
@@ -26,7 +26,7 @@ import "./chunk-FBGWG4N6.js";
26
26
  import "./chunk-YD6NDTKF.js";
27
27
  import "./chunk-SNQT7LNU.js";
28
28
  import "./chunk-CQGTEGKL.js";
29
- import "./chunk-Z4SWOUWC.js";
29
+ import "./chunk-UUFEE7VR.js";
30
30
  import "./chunk-K44MW7JJ.js";
31
31
  export {
32
32
  TurnMetrics,
@@ -39,4 +39,4 @@ export {
39
39
  runAgentTurn,
40
40
  runChatTurn
41
41
  };
42
- //# sourceMappingURL=orchestrator-ZVPFU2ZF.js.map
42
+ //# sourceMappingURL=orchestrator-MFN7COWT.js.map
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openfox",
3
- "version": "2.0.22",
3
+ "version": "2.0.24",
4
4
  "description": "Local-LLM-first agentic coding assistant",
5
5
  "type": "module",
6
6
  "bin": {
@@ -76,7 +76,6 @@
76
76
  "jschardet": "^3.1.4",
77
77
  "node-pty": "^1.2.0-beta.12",
78
78
  "open": "^11.0.0",
79
- "openai": "^6.33.0",
80
79
  "pyright": "^1.1.408",
81
80
  "react-markdown": "^10.1.0",
82
81
  "react-syntax-highlighter": "^16.1.1",
@@ -6,9 +6,9 @@ import {
6
6
  getSessionMessageCount,
7
7
  needsNameGenerationCheck
8
8
  } from "./chunk-GI24G4OW.js";
9
- import "./chunk-TVQTTZYW.js";
9
+ import "./chunk-MDRNKI7D.js";
10
10
  import "./chunk-O4TED6AJ.js";
11
- import "./chunk-DX37WNM7.js";
11
+ import "./chunk-YUHODMKY.js";
12
12
  import "./chunk-DL6ZILAF.js";
13
13
  import "./chunk-PBGOZMVY.js";
14
14
  import "./chunk-VRGRAQDG.js";
@@ -27,7 +27,7 @@ import "./chunk-FBGWG4N6.js";
27
27
  import "./chunk-YD6NDTKF.js";
28
28
  import "./chunk-SNQT7LNU.js";
29
29
  import "./chunk-CQGTEGKL.js";
30
- import "./chunk-Z4SWOUWC.js";
30
+ import "./chunk-UUFEE7VR.js";
31
31
  import {
32
32
  logger
33
33
  } from "./chunk-K44MW7JJ.js";
@@ -193,7 +193,7 @@ var QueueProcessor = class {
193
193
  backend: provider?.backend ?? llmClient.getBackend(),
194
194
  model: llmClient.getModel()
195
195
  };
196
- const { runChatTurn } = await import("./orchestrator-ZVPFU2ZF.js");
196
+ const { runChatTurn } = await import("./orchestrator-MFN7COWT.js");
197
197
  const runChatTurnParams = buildRunChatTurnParams({
198
198
  sessionManager,
199
199
  sessionId,
@@ -241,4 +241,4 @@ var QueueProcessor = class {
241
241
  export {
242
242
  QueueProcessor
243
243
  };
244
- //# sourceMappingURL=processor-DKAYI3PV.js.map
244
+ //# sourceMappingURL=processor-W2ZSJVOJ.js.map