openfox 2.0.51 → 2.0.52

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 (39) hide show
  1. package/dist/{backend-4HGUPY6W.js → backend-B23GIKKD.js} +2 -2
  2. package/dist/{chat-handler-K7M5ZPLO.js → chat-handler-FGRCJX76.js} +7 -7
  3. package/dist/{chunk-AE5Q2JXO.js → chunk-3KVWOPRN.js} +9 -9
  4. package/dist/{chunk-KFO535IO.js → chunk-4566MTWM.js} +2 -2
  5. package/dist/{chunk-KS25ZHG3.js → chunk-6J4KEDJQ.js} +67 -53
  6. package/dist/{chunk-PSFMSGCC.js → chunk-HVLNOTRE.js} +6 -6
  7. package/dist/{chunk-4Y7WWB55.js → chunk-N3Z4SMEH.js} +3 -3
  8. package/dist/{chunk-Z4FMBCJO.js → chunk-PSJON33Y.js} +13 -1
  9. package/dist/{chunk-C7NO4BBK.js → chunk-QQ5XY6BH.js} +2 -2
  10. package/dist/{chunk-CDFPKVOF.js → chunk-R2QCDYYR.js} +2 -2
  11. package/dist/{chunk-7OJTTOZ7.js → chunk-UOKVBO67.js} +2 -2
  12. package/dist/{chunk-ZUADUO54.js → chunk-UOUQMYRJ.js} +6 -6
  13. package/dist/{chunk-55RWNJBT.js → chunk-VZHN46NW.js} +2 -2
  14. package/dist/{chunk-UFFLA4W6.js → chunk-ZO5EXQMG.js} +1 -6
  15. package/dist/{chunk-H5AC62SN.js → chunk-ZZLCX7YT.js} +3 -3
  16. package/dist/cli/dev.js +1 -1
  17. package/dist/cli/index.js +1 -1
  18. package/dist/{client-5FOFNUXM.js → client-Y3ESMMZA.js} +4 -4
  19. package/dist/{compactor-7OGA6OYM.js → compactor-ZKZYSNMD.js} +4 -4
  20. package/dist/{config-G5GNT4UT.js → config-5ZHFKWOW.js} +2 -2
  21. package/dist/{http-client-JTRLBNJC.js → http-client-PIWB7BXK.js} +2 -2
  22. package/dist/{orchestrator-5BXIY2F7.js → orchestrator-5LSO63RB.js} +6 -6
  23. package/dist/package.json +1 -1
  24. package/dist/{processor-L4XHWQUH.js → processor-F5FMOPOQ.js} +7 -7
  25. package/dist/{protocol-A2CLNSAK.d.ts → protocol-DRe5K6Id.d.ts} +1 -0
  26. package/dist/{provider-BYKY7BS3.js → provider-V6Q6WJAF.js} +7 -7
  27. package/dist/{provider-manager-7ARKB5FZ.js → provider-manager-PR64DEN2.js} +5 -5
  28. package/dist/{serve-4D5N2R35.js → serve-J4V6KLQ6.js} +12 -12
  29. package/dist/server/index.d.ts +2 -2
  30. package/dist/server/index.js +11 -11
  31. package/dist/{server-UB2YTFXP.js → server-ZQ5NGHPD.js} +10 -10
  32. package/dist/shared/index.d.ts +2 -2
  33. package/dist/{tools-AALOAXXT.js → tools-2QMJFAXE.js} +5 -5
  34. package/dist/web/assets/index-CkyaIKu9.js +302 -0
  35. package/dist/web/assets/{index-BfYemJAQ.css → index-CvIUuius.css} +1 -1
  36. package/dist/web/index.html +2 -2
  37. package/dist/web/sw.js +1 -1
  38. package/package.json +1 -1
  39. package/dist/web/assets/index-DMYJNpQV.js +0 -302
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getBackendCapabilities,
3
3
  getBackendDisplayName
4
- } from "./chunk-Z4FMBCJO.js";
4
+ } from "./chunk-PSJON33Y.js";
5
5
  import "./chunk-5WRI5ZAA.js";
6
6
  export {
7
7
  getBackendCapabilities,
8
8
  getBackendDisplayName
9
9
  };
10
- //# sourceMappingURL=backend-4HGUPY6W.js.map
10
+ //# sourceMappingURL=backend-B23GIKKD.js.map
@@ -2,11 +2,11 @@ import {
2
2
  buildRunChatTurnParams,
3
3
  finalizeTurnCompletion,
4
4
  generateSessionNameForSession
5
- } from "./chunk-7OJTTOZ7.js";
5
+ } from "./chunk-UOKVBO67.js";
6
6
  import {
7
7
  runChatTurn
8
- } from "./chunk-4Y7WWB55.js";
9
- import "./chunk-AE5Q2JXO.js";
8
+ } from "./chunk-N3Z4SMEH.js";
9
+ import "./chunk-3KVWOPRN.js";
10
10
  import "./chunk-LBGHZLLH.js";
11
11
  import "./chunk-PBGOZMVY.js";
12
12
  import "./chunk-VRGRAQDG.js";
@@ -19,18 +19,18 @@ import {
19
19
  import "./chunk-EU3WWTFH.js";
20
20
  import "./chunk-CDRQJDSJ.js";
21
21
  import "./chunk-YQ3SOPBI.js";
22
- import "./chunk-55RWNJBT.js";
22
+ import "./chunk-VZHN46NW.js";
23
23
  import {
24
24
  getEventStore
25
25
  } from "./chunk-AIJE3RYH.js";
26
26
  import "./chunk-TMUBLQFC.js";
27
27
  import "./chunk-ZPIZLTWU.js";
28
28
  import "./chunk-J2GP3J3X.js";
29
- import "./chunk-Z4FMBCJO.js";
29
+ import "./chunk-PSJON33Y.js";
30
30
  import "./chunk-Z6W4YHJB.js";
31
31
  import "./chunk-K44MW7JJ.js";
32
32
  import "./chunk-YD6NDTKF.js";
33
- import "./chunk-C7NO4BBK.js";
33
+ import "./chunk-QQ5XY6BH.js";
34
34
  import "./chunk-CQGTEGKL.js";
35
35
  import "./chunk-V4IE7HJY.js";
36
36
  import "./chunk-5WRI5ZAA.js";
@@ -154,4 +154,4 @@ export {
154
154
  startChatSession,
155
155
  stopSessionExecution
156
156
  };
157
- //# sourceMappingURL=chat-handler-K7M5ZPLO.js.map
157
+ //# sourceMappingURL=chat-handler-FGRCJX76.js.map
@@ -49,7 +49,7 @@ import {
49
49
  createToolCallEvent,
50
50
  createToolResultEvent,
51
51
  streamLLMPure
52
- } from "./chunk-55RWNJBT.js";
52
+ } from "./chunk-VZHN46NW.js";
53
53
  import {
54
54
  getCurrentContextWindowId,
55
55
  getCurrentWindowMessageOptions,
@@ -72,7 +72,7 @@ import {
72
72
  import {
73
73
  loadGlobalConfig,
74
74
  saveGlobalConfig
75
- } from "./chunk-C7NO4BBK.js";
75
+ } from "./chunk-QQ5XY6BH.js";
76
76
  import {
77
77
  getGlobalConfigDir
78
78
  } from "./chunk-CQGTEGKL.js";
@@ -2609,7 +2609,7 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
2609
2609
  sessionManager.setCurrentContextSize(sessionId, result.usage.promptTokens);
2610
2610
  if (!compacting) {
2611
2611
  const contextState2 = sessionManager.getContextState(sessionId);
2612
- const { shouldCompact, appendCompactionPrompt } = await import("./compactor-7OGA6OYM.js");
2612
+ const { shouldCompact, appendCompactionPrompt } = await import("./compactor-ZKZYSNMD.js");
2613
2613
  if (shouldCompact(contextState2.currentTokens, contextState2.maxTokens, runtimeConfig.context.compactionThreshold)) {
2614
2614
  appendCompactionPrompt(sessionId, append);
2615
2615
  compacting = true;
@@ -2966,7 +2966,7 @@ async function describeImageFromDataUrl(dataUrl, visionModel, options) {
2966
2966
  import { createHash as createHash2 } from "crypto";
2967
2967
  async function loadVisionModelFromGlobalConfig() {
2968
2968
  try {
2969
- const { loadGlobalConfig: loadGlobalConfig2, getVisionFallback } = await import("./config-G5GNT4UT.js");
2969
+ const { loadGlobalConfig: loadGlobalConfig2, getVisionFallback } = await import("./config-5ZHFKWOW.js");
2970
2970
  const runtimeConfig = getRuntimeConfig();
2971
2971
  const mode = runtimeConfig.mode ?? "production";
2972
2972
  const globalConfig = await loadGlobalConfig2(mode);
@@ -3481,7 +3481,7 @@ var callSubAgentTool = {
3481
3481
  };
3482
3482
  }
3483
3483
  try {
3484
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-AALOAXXT.js");
3484
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-2QMJFAXE.js");
3485
3485
  const toolRegistry = getToolRegistryForAgent2(agentDef);
3486
3486
  const turnMetrics = new TurnMetrics();
3487
3487
  const result = await executeSubAgent({
@@ -4297,7 +4297,7 @@ function resolveAgentDef2(sessionManager, sessionId) {
4297
4297
  }
4298
4298
  async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
4299
4299
  const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
4300
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-AALOAXXT.js");
4300
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-2QMJFAXE.js");
4301
4301
  const tools = getToolRegistryForAgent2(agentDef).definitions;
4302
4302
  const toolFingerprint = getToolFingerprint(tools);
4303
4303
  const allAgents = await loadAllAgentsDefault();
@@ -4310,7 +4310,7 @@ async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
4310
4310
  async function computeSessionHash(sessionManager, sessionId) {
4311
4311
  const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
4312
4312
  const agentDef = await resolveAgentDef2(sessionManager, sessionId);
4313
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-AALOAXXT.js");
4313
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-2QMJFAXE.js");
4314
4314
  const tools = getToolRegistryForAgent2(agentDef).definitions;
4315
4315
  const toolFingerprint = getToolFingerprint(tools);
4316
4316
  return computeDynamicContextHash(instructionContent, skills, toolFingerprint);
@@ -4417,7 +4417,7 @@ var mcpConfigTool = createTool(
4417
4417
  await saveGlobalConfig(mcpConfigMode, { ...globalConfig, mcpServers: updated });
4418
4418
  }
4419
4419
  async function rebuildTools() {
4420
- const { setMcpTools: setMcpTools2 } = await import("./tools-AALOAXXT.js");
4420
+ const { setMcpTools: setMcpTools2 } = await import("./tools-2QMJFAXE.js");
4421
4421
  const mcpTools = createMcpTools(mcpManagerForTools);
4422
4422
  setMcpTools2(mcpTools);
4423
4423
  }
@@ -5087,4 +5087,4 @@ export {
5087
5087
  getToolRegistryForAgent,
5088
5088
  createToolRegistry
5089
5089
  };
5090
- //# sourceMappingURL=chunk-AE5Q2JXO.js.map
5090
+ //# sourceMappingURL=chunk-3KVWOPRN.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  COMPACTION_PROMPT,
3
3
  createMessageStartEvent
4
- } from "./chunk-55RWNJBT.js";
4
+ } from "./chunk-VZHN46NW.js";
5
5
  import {
6
6
  getCurrentWindowMessageOptions
7
7
  } from "./chunk-AIJE3RYH.js";
@@ -31,4 +31,4 @@ export {
31
31
  shouldCompact,
32
32
  getCompactionTarget
33
33
  };
34
- //# sourceMappingURL=chunk-KFO535IO.js.map
34
+ //# sourceMappingURL=chunk-4566MTWM.js.map
@@ -21,7 +21,7 @@ import {
21
21
  tokenFromPassword,
22
22
  verifyPassword,
23
23
  workflowExists
24
- } from "./chunk-PSFMSGCC.js";
24
+ } from "./chunk-HVLNOTRE.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-AE5Q2JXO.js";
64
+ } from "./chunk-3KVWOPRN.js";
65
65
  import {
66
66
  getPathSeparator,
67
67
  isAbsolutePath
@@ -82,7 +82,7 @@ import {
82
82
  ALWAYS_ALLOWED,
83
83
  ALWAYS_ALLOWED_FOR_SUBAGENTS,
84
84
  TOP_LEVEL_ONLY_TOOLS
85
- } from "./chunk-55RWNJBT.js";
85
+ } from "./chunk-VZHN46NW.js";
86
86
  import {
87
87
  createSession,
88
88
  deleteSession,
@@ -116,20 +116,20 @@ import {
116
116
  import {
117
117
  createProviderManager,
118
118
  parseDefaultModelSelection
119
- } from "./chunk-CDFPKVOF.js";
119
+ } from "./chunk-R2QCDYYR.js";
120
120
  import {
121
121
  detectModel,
122
122
  getLlmStatus
123
123
  } from "./chunk-M3RB4IF6.js";
124
124
  import {
125
125
  getBackendDisplayName
126
- } from "./chunk-Z4FMBCJO.js";
126
+ } from "./chunk-PSJON33Y.js";
127
127
  import {
128
128
  buildModelsUrl
129
129
  } from "./chunk-HNCM3D7Y.js";
130
130
  import {
131
131
  SessionNotFoundError
132
- } from "./chunk-UFFLA4W6.js";
132
+ } from "./chunk-ZO5EXQMG.js";
133
133
  import {
134
134
  logger,
135
135
  setLogLevel
@@ -3849,7 +3849,7 @@ import { Router as Router7 } from "express";
3849
3849
  import { spawn as spawn2 } from "child_process";
3850
3850
 
3851
3851
  // src/constants.ts
3852
- var VERSION = "2.0.51";
3852
+ var VERSION = "2.0.52";
3853
3853
 
3854
3854
  // src/server/routes/auto-update.ts
3855
3855
  var updateInProgress = false;
@@ -4016,7 +4016,7 @@ async function createServerHandle(config4) {
4016
4016
  const mcpManager = new McpManager({
4017
4017
  onToolsDiscovered: async (name, tools) => {
4018
4018
  try {
4019
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-G5GNT4UT.js");
4019
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-5ZHFKWOW.js");
4020
4020
  const mode = config4.mode ?? "production";
4021
4021
  const globalConfig = await loadGlobalConfig(mode);
4022
4022
  const mcpServers2 = {
@@ -4046,7 +4046,7 @@ async function createServerHandle(config4) {
4046
4046
  setMcpTools(mcpTools);
4047
4047
  logger.info("MCP tools registered", { count: mcpTools.length });
4048
4048
  }
4049
- const { signalMcpReady } = await import("./server-UB2YTFXP.js");
4049
+ const { signalMcpReady } = await import("./server-ZQ5NGHPD.js");
4050
4050
  signalMcpReady();
4051
4051
  });
4052
4052
  const app = express();
@@ -4239,7 +4239,7 @@ async function createServerHandle(config4) {
4239
4239
  app.get("/api/sessions/:id", async (req, res) => {
4240
4240
  const { getEventStore: getEventStore2 } = await import("./events-52XADT6Y.js");
4241
4241
  const { buildMessagesFromStoredEvents } = await import("./folding-2BGFLV5J.js");
4242
- const { getPendingQuestionsForSession } = await import("./tools-AALOAXXT.js");
4242
+ const { getPendingQuestionsForSession } = await import("./tools-2QMJFAXE.js");
4243
4243
  const session = sessionManager.getSession(req.params.id);
4244
4244
  if (!session) {
4245
4245
  return res.status(404).json({ error: "Session not found" });
@@ -4258,8 +4258,8 @@ async function createServerHandle(config4) {
4258
4258
  if (!session) {
4259
4259
  return res.status(404).json({ error: "Session not found" });
4260
4260
  }
4261
- const { stopSessionExecution } = await import("./chat-handler-K7M5ZPLO.js");
4262
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-AALOAXXT.js");
4261
+ const { stopSessionExecution } = await import("./chat-handler-FGRCJX76.js");
4262
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-2QMJFAXE.js");
4263
4263
  sessionManager.clearMessageQueue(sessionId);
4264
4264
  stopSessionExecution(sessionId, sessionManager);
4265
4265
  abortSession(sessionId);
@@ -4312,7 +4312,7 @@ async function createServerHandle(config4) {
4312
4312
  if (!result.success) {
4313
4313
  return res.status(500).json({ error: result.error ?? "Failed to set default model" });
4314
4314
  }
4315
- const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-G5GNT4UT.js");
4315
+ const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-5ZHFKWOW.js");
4316
4316
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4317
4317
  const updatedConfig = setDefaultModelSelection(globalConfig, providerId, model);
4318
4318
  await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
@@ -4413,7 +4413,7 @@ async function createServerHandle(config4) {
4413
4413
  if (!callId || approved === void 0) {
4414
4414
  return res.status(400).json({ error: "callId and approved are required" });
4415
4415
  }
4416
- const { providePathConfirmation } = await import("./tools-AALOAXXT.js");
4416
+ const { providePathConfirmation } = await import("./tools-2QMJFAXE.js");
4417
4417
  const result = providePathConfirmation(callId, approved, alwaysAllow);
4418
4418
  if (!result.found) {
4419
4419
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
@@ -4421,7 +4421,7 @@ async function createServerHandle(config4) {
4421
4421
  const { getEventStore: getEventStore2 } = await import("./events-52XADT6Y.js");
4422
4422
  const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-2BGFLV5J.js");
4423
4423
  const { createSessionStateMessage } = await import("./protocol-CTNE3ANP.js");
4424
- const { getPendingQuestionsForSession } = await import("./tools-AALOAXXT.js");
4424
+ const { getPendingQuestionsForSession } = await import("./tools-2QMJFAXE.js");
4425
4425
  const eventStore = getEventStore2();
4426
4426
  const events = eventStore.getEvents(sessionId);
4427
4427
  const messages = buildMessagesFromStoredEvents(events);
@@ -4442,7 +4442,7 @@ async function createServerHandle(config4) {
4442
4442
  if (!skip && typeof answer !== "string") {
4443
4443
  return res.status(400).json({ error: "answer is required when not skipping" });
4444
4444
  }
4445
- const { provideAnswer } = await import("./tools-AALOAXXT.js");
4445
+ const { provideAnswer } = await import("./tools-2QMJFAXE.js");
4446
4446
  const found = provideAnswer(callId, answer ?? "", skip ?? false);
4447
4447
  if (!found) {
4448
4448
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -4478,7 +4478,7 @@ async function createServerHandle(config4) {
4478
4478
  if (sessionManager.isWarmedUp(sessionId)) {
4479
4479
  return res.json({ success: false, reason: "already_warmed" });
4480
4480
  }
4481
- const { runAgentTurn, TurnMetrics } = await import("./orchestrator-5BXIY2F7.js");
4481
+ const { runAgentTurn, TurnMetrics } = await import("./orchestrator-5LSO63RB.js");
4482
4482
  runAgentTurn(
4483
4483
  {
4484
4484
  sessionManager,
@@ -4521,8 +4521,8 @@ async function createServerHandle(config4) {
4521
4521
  if (!session) {
4522
4522
  return res.status(404).json({ error: "Session not found" });
4523
4523
  }
4524
- const { stopSessionExecution } = await import("./chat-handler-K7M5ZPLO.js");
4525
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-AALOAXXT.js");
4524
+ const { stopSessionExecution } = await import("./chat-handler-FGRCJX76.js");
4525
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-2QMJFAXE.js");
4526
4526
  const queuedMessages = sessionManager.getQueueState(sessionId);
4527
4527
  sessionManager.clearMessageQueue(sessionId);
4528
4528
  stopSessionExecution(sessionId, sessionManager);
@@ -4553,16 +4553,25 @@ async function createServerHandle(config4) {
4553
4553
  if (!session) {
4554
4554
  return res.status(404).json({ error: "Session not found" });
4555
4555
  }
4556
- const { messageIndex } = req.body;
4557
- if (typeof messageIndex !== "number" || messageIndex < 0) {
4558
- return res.status(400).json({ error: "messageIndex must be a non-negative number" });
4556
+ const { messageId } = req.body;
4557
+ if (typeof messageId !== "string" || !messageId) {
4558
+ return res.status(400).json({ error: "messageId is required" });
4559
+ }
4560
+ const { getEventStore: getEventStore2 } = await import("./events-52XADT6Y.js");
4561
+ const { buildMessagesFromStoredEvents } = await import("./folding-2BGFLV5J.js");
4562
+ const eventStore = getEventStore2();
4563
+ const events = eventStore.getEvents(sessionId);
4564
+ const messages = buildMessagesFromStoredEvents(events);
4565
+ const msgIndex = messages.findIndex((m) => m.id === messageId);
4566
+ if (msgIndex === -1) {
4567
+ return res.status(400).json({ error: "Message not found" });
4559
4568
  }
4560
- const msg = session.messages[messageIndex];
4561
- if (!msg) {
4562
- return res.status(400).json({ error: "Message not found at this index" });
4569
+ const msg = messages[msgIndex];
4570
+ if (msg.role !== "user" || msg.isSystemGenerated) {
4571
+ return res.status(400).json({ error: "Can only replay user messages" });
4563
4572
  }
4564
4573
  const { truncateSessionMessages } = await import("./events-52XADT6Y.js");
4565
- truncateSessionMessages(sessionId, messageIndex - 1);
4574
+ truncateSessionMessages(sessionId, msgIndex - 1);
4566
4575
  sessionManager.queueMessage(sessionId, "asap", msg.content, msg.attachments, msg.messageKind);
4567
4576
  res.json({ success: true });
4568
4577
  });
@@ -4633,7 +4642,7 @@ async function createServerHandle(config4) {
4633
4642
  let visionFallback;
4634
4643
  let globalWorkdir;
4635
4644
  try {
4636
- const { loadGlobalConfig, getVisionFallback } = await import("./config-G5GNT4UT.js");
4645
+ const { loadGlobalConfig, getVisionFallback } = await import("./config-5ZHFKWOW.js");
4637
4646
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4638
4647
  const fallback = getVisionFallback(globalConfig);
4639
4648
  if (fallback) {
@@ -4702,7 +4711,8 @@ async function createServerHandle(config4) {
4702
4711
  ...m.temperature !== void 0 && { temperature: m.temperature },
4703
4712
  ...m.topP !== void 0 && { topP: m.topP },
4704
4713
  ...m.topK !== void 0 && { topK: m.topK },
4705
- ...m.maxTokens !== void 0 && { maxTokens: m.maxTokens }
4714
+ ...m.maxTokens !== void 0 && { maxTokens: m.maxTokens },
4715
+ ...m.selected !== void 0 && { selected: m.selected }
4706
4716
  }));
4707
4717
  }
4708
4718
  app.post("/api/providers/test", async (req, res) => {
@@ -4730,20 +4740,24 @@ async function createServerHandle(config4) {
4730
4740
  const apiKey = req.query["apiKey"];
4731
4741
  if (!url) return res.status(400).json({ error: "url is required" });
4732
4742
  try {
4733
- const { fetchModelsWithContext } = await import("./provider-manager-7ARKB5FZ.js");
4743
+ const { fetchModelsWithContext } = await import("./provider-manager-PR64DEN2.js");
4744
+ const { getModelProfile: getModelProfile2 } = await import("./profiles-5J7F4BML.js");
4734
4745
  const models = await fetchModelsWithContext(url, apiKey);
4735
4746
  if (models.length === 0) {
4736
4747
  return res.status(404).json({ error: `No models found at ${buildModelsUrl(url)}`, url });
4737
4748
  }
4738
4749
  res.json({
4739
- models: models.map((m) => ({
4740
- id: m.id,
4741
- contextWindow: m.contextWindow,
4742
- defaultTemperature: m.defaultTemperature,
4743
- defaultTopP: m.defaultTopP,
4744
- defaultTopK: m.defaultTopK,
4745
- defaultMaxTokens: m.defaultMaxTokens
4746
- })),
4750
+ models: models.map((m) => {
4751
+ const profile = getModelProfile2(m.id);
4752
+ return {
4753
+ id: m.id,
4754
+ contextWindow: m.contextWindow,
4755
+ defaultTemperature: profile.temperature,
4756
+ defaultTopP: profile.topP,
4757
+ defaultTopK: profile.topK,
4758
+ defaultMaxTokens: profile.defaultMaxTokens
4759
+ };
4760
+ }),
4747
4761
  url
4748
4762
  });
4749
4763
  } catch (error) {
@@ -4777,9 +4791,9 @@ async function createServerHandle(config4) {
4777
4791
  if (!mode) return res.status(400).json({ error: "mode is required" });
4778
4792
  try {
4779
4793
  const { getModelProfile: getModelProfile2 } = await import("./profiles-5J7F4BML.js");
4780
- const { getBackendCapabilities } = await import("./backend-4HGUPY6W.js");
4794
+ const { getBackendCapabilities } = await import("./backend-B23GIKKD.js");
4781
4795
  const { buildNonStreamingCreateParams } = await import("./client-pure-DO3S675T.js");
4782
- const { OpenAIHttpClient } = await import("./http-client-JTRLBNJC.js");
4796
+ const { OpenAIHttpClient } = await import("./http-client-PIWB7BXK.js");
4783
4797
  const { ensureVersionPrefix } = await import("./url-utils-SAJP7AEX.js");
4784
4798
  const profile = getModelProfile2(model);
4785
4799
  const capabilities = getBackendCapabilities(backend || "unknown");
@@ -4846,7 +4860,7 @@ async function createServerHandle(config4) {
4846
4860
  return res.status(400).json({ error: "name, url, and backend are required" });
4847
4861
  }
4848
4862
  try {
4849
- const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-G5GNT4UT.js");
4863
+ const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-5ZHFKWOW.js");
4850
4864
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4851
4865
  const providerBackend = backend;
4852
4866
  const providerModels = modelConfigs?.length ? buildModelConfigs(modelConfigs) : model ? [{ id: model, contextWindow: 2e5, source: "user" }] : [];
@@ -4860,8 +4874,8 @@ async function createServerHandle(config4) {
4860
4874
  models: providerModels,
4861
4875
  isActive: true
4862
4876
  });
4863
- const firstModelId = model ?? providerModels[0]?.id ?? "auto";
4864
- const finalConfig = setDefaultModelSelection(
4877
+ const firstModelId = model ?? providerModels.find((m) => m.selected)?.id ?? providerModels[0]?.id ?? "auto";
4878
+ const finalConfig = configWithProvider.defaultModelSelection ? configWithProvider : setDefaultModelSelection(
4865
4879
  configWithProvider,
4866
4880
  configWithProvider.providers[configWithProvider.providers.length - 1].id,
4867
4881
  firstModelId
@@ -4884,7 +4898,7 @@ async function createServerHandle(config4) {
4884
4898
  app.post("/api/init/config", async (req, res) => {
4885
4899
  const { workdir, visionFallback } = req.body;
4886
4900
  try {
4887
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-G5GNT4UT.js");
4901
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-5ZHFKWOW.js");
4888
4902
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4889
4903
  const updatedConfig = {
4890
4904
  ...globalConfig,
@@ -4912,7 +4926,7 @@ async function createServerHandle(config4) {
4912
4926
  });
4913
4927
  app.delete("/api/providers/:id", async (req, res) => {
4914
4928
  const { id } = req.params;
4915
- const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-G5GNT4UT.js");
4929
+ const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-5ZHFKWOW.js");
4916
4930
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4917
4931
  const updatedConfig = removeProvider(globalConfig, id);
4918
4932
  await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
@@ -4924,7 +4938,7 @@ async function createServerHandle(config4) {
4924
4938
  const { id } = req.params;
4925
4939
  const { isLocal } = req.body;
4926
4940
  try {
4927
- const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-G5GNT4UT.js");
4941
+ const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-5ZHFKWOW.js");
4928
4942
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4929
4943
  const provider = globalConfig.providers.find((p) => p.id === id);
4930
4944
  if (!provider) {
@@ -4953,7 +4967,7 @@ async function createServerHandle(config4) {
4953
4967
  models: modelConfigs
4954
4968
  } = req.body;
4955
4969
  try {
4956
- const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-G5GNT4UT.js");
4970
+ const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-5ZHFKWOW.js");
4957
4971
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4958
4972
  const provider = globalConfig.providers.find((p) => p.id === id);
4959
4973
  if (!provider) {
@@ -4991,7 +5005,7 @@ async function createServerHandle(config4) {
4991
5005
  return res.status(400).json({ error: result.error });
4992
5006
  }
4993
5007
  const llmClient = getLLMClient();
4994
- const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-G5GNT4UT.js");
5008
+ const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-5ZHFKWOW.js");
4995
5009
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4996
5010
  const updatedConfig = setDefaultModelSelection(globalConfig, id, llmClient.getModel());
4997
5011
  await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
@@ -5018,7 +5032,7 @@ async function createServerHandle(config4) {
5018
5032
  });
5019
5033
  async function rebuildMcpTools() {
5020
5034
  const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-MOGEI6TP.js");
5021
- const { setMcpTools: setMcpTools2 } = await import("./tools-AALOAXXT.js");
5035
+ const { setMcpTools: setMcpTools2 } = await import("./tools-2QMJFAXE.js");
5022
5036
  const mcpTools = createMcpTools2(mcpManager);
5023
5037
  setMcpTools2(mcpTools);
5024
5038
  }
@@ -5080,7 +5094,7 @@ async function createServerHandle(config4) {
5080
5094
  };
5081
5095
  await mcpManager.addServer(name, serverCfg);
5082
5096
  const server = mcpManager.getServer(name);
5083
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-G5GNT4UT.js");
5097
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-5ZHFKWOW.js");
5084
5098
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
5085
5099
  const updatedMcpServers = { ...globalConfig.mcpServers ?? {}, [name]: serverCfg };
5086
5100
  await saveGlobalConfig(config4.mode ?? "production", {
@@ -5106,7 +5120,7 @@ async function createServerHandle(config4) {
5106
5120
  return res.status(404).json({ error: `MCP server '${name}' not found` });
5107
5121
  }
5108
5122
  mcpManager.removeServer(name);
5109
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-G5GNT4UT.js");
5123
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-5ZHFKWOW.js");
5110
5124
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
5111
5125
  const updatedMcpServers = { ...globalConfig.mcpServers ?? {} };
5112
5126
  delete updatedMcpServers[name];
@@ -5131,7 +5145,7 @@ async function createServerHandle(config4) {
5131
5145
  await mcpManager.setToolEnabled(name, toolName, enabled);
5132
5146
  const server = mcpManager.getServer(name);
5133
5147
  if (server) {
5134
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-G5GNT4UT.js");
5148
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-5ZHFKWOW.js");
5135
5149
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
5136
5150
  const mcpServers2 = { ...globalConfig.mcpServers ?? {} };
5137
5151
  const serverCfg = mcpServers2[name];
@@ -5326,7 +5340,7 @@ async function createServerHandle(config4) {
5326
5340
  const state = sessionManager.getContextState(sessionId);
5327
5341
  wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
5328
5342
  });
5329
- const { QueueProcessor } = await import("./processor-L4XHWQUH.js");
5343
+ const { QueueProcessor } = await import("./processor-F5FMOPOQ.js");
5330
5344
  const queueProcessor = new QueueProcessor({
5331
5345
  sessionManager,
5332
5346
  providerManager,
@@ -5401,4 +5415,4 @@ export {
5401
5415
  createServerHandle,
5402
5416
  createServer
5403
5417
  };
5404
- //# sourceMappingURL=chunk-KS25ZHG3.js.map
5418
+ //# sourceMappingURL=chunk-6J4KEDJQ.js.map
@@ -2,7 +2,7 @@ import {
2
2
  injectWorkflowKickoffIfNeeded,
3
3
  runAgentTurn,
4
4
  runChatTurn
5
- } from "./chunk-4Y7WWB55.js";
5
+ } from "./chunk-N3Z4SMEH.js";
6
6
  import {
7
7
  applyDynamicContext,
8
8
  checkAborted,
@@ -16,7 +16,7 @@ import {
16
16
  loadAllAgentsDefault,
17
17
  saveItemToDir,
18
18
  spawnShellProcess
19
- } from "./chunk-AE5Q2JXO.js";
19
+ } from "./chunk-3KVWOPRN.js";
20
20
  import {
21
21
  getPlatformShell,
22
22
  onProcessEvent
@@ -40,11 +40,11 @@ import {
40
40
  } from "./chunk-EU3WWTFH.js";
41
41
  import {
42
42
  appendCompactionPrompt
43
- } from "./chunk-KFO535IO.js";
43
+ } from "./chunk-4566MTWM.js";
44
44
  import {
45
45
  TurnMetrics,
46
46
  createMessageStartEvent
47
- } from "./chunk-55RWNJBT.js";
47
+ } from "./chunk-VZHN46NW.js";
48
48
  import {
49
49
  getCurrentContextWindowId,
50
50
  getEventStore,
@@ -52,7 +52,7 @@ import {
52
52
  } from "./chunk-AIJE3RYH.js";
53
53
  import {
54
54
  createLLMClient
55
- } from "./chunk-H5AC62SN.js";
55
+ } from "./chunk-ZZLCX7YT.js";
56
56
  import {
57
57
  ensureVersionPrefix
58
58
  } from "./chunk-HNCM3D7Y.js";
@@ -2091,4 +2091,4 @@ export {
2091
2091
  signalMcpReady,
2092
2092
  createWebSocketServer
2093
2093
  };
2094
- //# sourceMappingURL=chunk-PSFMSGCC.js.map
2094
+ //# sourceMappingURL=chunk-HVLNOTRE.js.map
@@ -12,7 +12,7 @@ import {
12
12
  loadAllAgentsDefault,
13
13
  processEventsForConversation,
14
14
  runTopLevelAgentLoop
15
- } from "./chunk-AE5Q2JXO.js";
15
+ } from "./chunk-3KVWOPRN.js";
16
16
  import {
17
17
  TurnMetrics,
18
18
  WORKFLOW_KICKOFF_PROMPT,
@@ -20,7 +20,7 @@ import {
20
20
  buildAgentSmallReminder,
21
21
  createChatDoneEvent,
22
22
  createMessageStartEvent
23
- } from "./chunk-55RWNJBT.js";
23
+ } from "./chunk-VZHN46NW.js";
24
24
  import {
25
25
  getCurrentContextWindowId,
26
26
  getCurrentWindowMessageOptions,
@@ -324,4 +324,4 @@ export {
324
324
  runAgentTurn,
325
325
  injectWorkflowKickoffIfNeeded
326
326
  };
327
- //# sourceMappingURL=chunk-4Y7WWB55.js.map
327
+ //# sourceMappingURL=chunk-N3Z4SMEH.js.map
@@ -8,6 +8,14 @@ var BACKEND_CAPABILITIES = {
8
8
  supportsChatTemplateKwargs: true,
9
9
  supportsTopK: true
10
10
  },
11
+ openai: {
12
+ supportsChatTemplateKwargs: false,
13
+ supportsTopK: false
14
+ },
15
+ anthropic: {
16
+ supportsChatTemplateKwargs: false,
17
+ supportsTopK: false
18
+ },
11
19
  ollama: {
12
20
  supportsChatTemplateKwargs: false,
13
21
  supportsTopK: false
@@ -40,6 +48,10 @@ function getBackendDisplayName(backend) {
40
48
  return "llama.cpp";
41
49
  case "opencode-go":
42
50
  return "OpenCode Go";
51
+ case "openai":
52
+ return "OpenAI";
53
+ case "anthropic":
54
+ return "Anthropic";
43
55
  case "unknown":
44
56
  return "Other";
45
57
  }
@@ -49,4 +61,4 @@ export {
49
61
  getBackendCapabilities,
50
62
  getBackendDisplayName
51
63
  };
52
- //# sourceMappingURL=chunk-Z4FMBCJO.js.map
64
+ //# sourceMappingURL=chunk-PSJON33Y.js.map
@@ -190,7 +190,7 @@ function addProvider(config, provider) {
190
190
  { ...newProvider, isActive: shouldActivate }
191
191
  ],
192
192
  mcpServers: config.mcpServers,
193
- defaultModelSelection: shouldActivate ? `${newProvider.id}/${newProvider.models?.[0]?.id ?? "auto"}` : config.defaultModelSelection,
193
+ defaultModelSelection: shouldActivate && !config.defaultModelSelection ? `${newProvider.id}/${newProvider.models?.find((m) => m.selected)?.id ?? newProvider.models?.[0]?.id ?? "auto"}` : config.defaultModelSelection,
194
194
  activeProviderId: shouldActivate ? newProvider.id : config.activeProviderId,
195
195
  activeWorkflowId: config.activeWorkflowId,
196
196
  server: config.server ?? { port: 10369, host: "127.0.0.1", openBrowser: true },
@@ -281,4 +281,4 @@ export {
281
281
  removeProvider,
282
282
  activateProvider
283
283
  };
284
- //# sourceMappingURL=chunk-C7NO4BBK.js.map
284
+ //# sourceMappingURL=chunk-QQ5XY6BH.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-M3RB4IF6.js";
4
4
  import {
5
5
  createLLMClient
6
- } from "./chunk-H5AC62SN.js";
6
+ } from "./chunk-ZZLCX7YT.js";
7
7
  import {
8
8
  buildModelsUrl,
9
9
  ensureVersionPrefix,
@@ -551,4 +551,4 @@ export {
551
551
  parseDefaultModelSelection,
552
552
  createProviderManager
553
553
  };
554
- //# sourceMappingURL=chunk-CDFPKVOF.js.map
554
+ //# sourceMappingURL=chunk-R2QCDYYR.js.map
@@ -131,7 +131,7 @@ async function generateSessionNameForSession(sessionId, userMessage, deps, signa
131
131
  client = deps.getLLMClient();
132
132
  client.setModel(providerConfig.model);
133
133
  } else if (providerConfig) {
134
- const { createLLMClient } = await import("./client-5FOFNUXM.js");
134
+ const { createLLMClient } = await import("./client-Y3ESMMZA.js");
135
135
  client = createLLMClient({
136
136
  llm: {
137
137
  baseUrl: providerConfig.baseUrl,
@@ -180,4 +180,4 @@ export {
180
180
  buildRunChatTurnParams,
181
181
  generateSessionNameForSession
182
182
  };
183
- //# sourceMappingURL=chunk-7OJTTOZ7.js.map
183
+ //# sourceMappingURL=chunk-UOKVBO67.js.map