openfox 2.0.51 → 2.0.53

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-PSFMSGCC.js → chunk-HVLNOTRE.js} +6 -6
  6. package/dist/{chunk-KS25ZHG3.js → chunk-KUE7ASKH.js} +72 -54
  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-ZUADUO54.js → chunk-QOHRXWK4.js} +6 -6
  10. package/dist/{chunk-C7NO4BBK.js → chunk-QQ5XY6BH.js} +2 -2
  11. package/dist/{chunk-CDFPKVOF.js → chunk-R2QCDYYR.js} +2 -2
  12. package/dist/{chunk-7OJTTOZ7.js → chunk-UOKVBO67.js} +2 -2
  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-DMHI2CWZ.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-Bc9jabDX.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
@@ -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
@@ -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.53";
3853
3853
 
3854
3854
  // src/server/routes/auto-update.ts
3855
3855
  var updateInProgress = false;
@@ -3989,11 +3989,15 @@ async function createServerHandle(config4) {
3989
3989
  logger.info("Using configured LLM backend", { backend: getBackendDisplayName(backend) });
3990
3990
  }
3991
3991
  const detected = await detectModel(config4.llm.baseUrl);
3992
- if (detected) {
3992
+ if (detected && !config4.defaultModelSelection) {
3993
3993
  llmClient.setModel(detected);
3994
3994
  if (!useMock) {
3995
3995
  logger.info("Auto-detected LLM model", { model: detected, backend: getBackendDisplayName(backend) });
3996
3996
  }
3997
+ } else if (detected && config4.defaultModelSelection) {
3998
+ if (!useMock) {
3999
+ logger.debug("Skipping auto-detect, using configured model", { model: config4.llm.model });
4000
+ }
3997
4001
  } else {
3998
4002
  if (!useMock) {
3999
4003
  logger.warn("Could not auto-detect model, using config", { model: config4.llm.model });
@@ -4016,7 +4020,7 @@ async function createServerHandle(config4) {
4016
4020
  const mcpManager = new McpManager({
4017
4021
  onToolsDiscovered: async (name, tools) => {
4018
4022
  try {
4019
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-G5GNT4UT.js");
4023
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-5ZHFKWOW.js");
4020
4024
  const mode = config4.mode ?? "production";
4021
4025
  const globalConfig = await loadGlobalConfig(mode);
4022
4026
  const mcpServers2 = {
@@ -4046,7 +4050,7 @@ async function createServerHandle(config4) {
4046
4050
  setMcpTools(mcpTools);
4047
4051
  logger.info("MCP tools registered", { count: mcpTools.length });
4048
4052
  }
4049
- const { signalMcpReady } = await import("./server-UB2YTFXP.js");
4053
+ const { signalMcpReady } = await import("./server-ZQ5NGHPD.js");
4050
4054
  signalMcpReady();
4051
4055
  });
4052
4056
  const app = express();
@@ -4239,7 +4243,7 @@ async function createServerHandle(config4) {
4239
4243
  app.get("/api/sessions/:id", async (req, res) => {
4240
4244
  const { getEventStore: getEventStore2 } = await import("./events-52XADT6Y.js");
4241
4245
  const { buildMessagesFromStoredEvents } = await import("./folding-2BGFLV5J.js");
4242
- const { getPendingQuestionsForSession } = await import("./tools-AALOAXXT.js");
4246
+ const { getPendingQuestionsForSession } = await import("./tools-2QMJFAXE.js");
4243
4247
  const session = sessionManager.getSession(req.params.id);
4244
4248
  if (!session) {
4245
4249
  return res.status(404).json({ error: "Session not found" });
@@ -4258,8 +4262,8 @@ async function createServerHandle(config4) {
4258
4262
  if (!session) {
4259
4263
  return res.status(404).json({ error: "Session not found" });
4260
4264
  }
4261
- const { stopSessionExecution } = await import("./chat-handler-K7M5ZPLO.js");
4262
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-AALOAXXT.js");
4265
+ const { stopSessionExecution } = await import("./chat-handler-FGRCJX76.js");
4266
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-2QMJFAXE.js");
4263
4267
  sessionManager.clearMessageQueue(sessionId);
4264
4268
  stopSessionExecution(sessionId, sessionManager);
4265
4269
  abortSession(sessionId);
@@ -4312,7 +4316,7 @@ async function createServerHandle(config4) {
4312
4316
  if (!result.success) {
4313
4317
  return res.status(500).json({ error: result.error ?? "Failed to set default model" });
4314
4318
  }
4315
- const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-G5GNT4UT.js");
4319
+ const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-5ZHFKWOW.js");
4316
4320
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4317
4321
  const updatedConfig = setDefaultModelSelection(globalConfig, providerId, model);
4318
4322
  await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
@@ -4413,7 +4417,7 @@ async function createServerHandle(config4) {
4413
4417
  if (!callId || approved === void 0) {
4414
4418
  return res.status(400).json({ error: "callId and approved are required" });
4415
4419
  }
4416
- const { providePathConfirmation } = await import("./tools-AALOAXXT.js");
4420
+ const { providePathConfirmation } = await import("./tools-2QMJFAXE.js");
4417
4421
  const result = providePathConfirmation(callId, approved, alwaysAllow);
4418
4422
  if (!result.found) {
4419
4423
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
@@ -4421,7 +4425,7 @@ async function createServerHandle(config4) {
4421
4425
  const { getEventStore: getEventStore2 } = await import("./events-52XADT6Y.js");
4422
4426
  const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-2BGFLV5J.js");
4423
4427
  const { createSessionStateMessage } = await import("./protocol-CTNE3ANP.js");
4424
- const { getPendingQuestionsForSession } = await import("./tools-AALOAXXT.js");
4428
+ const { getPendingQuestionsForSession } = await import("./tools-2QMJFAXE.js");
4425
4429
  const eventStore = getEventStore2();
4426
4430
  const events = eventStore.getEvents(sessionId);
4427
4431
  const messages = buildMessagesFromStoredEvents(events);
@@ -4442,7 +4446,7 @@ async function createServerHandle(config4) {
4442
4446
  if (!skip && typeof answer !== "string") {
4443
4447
  return res.status(400).json({ error: "answer is required when not skipping" });
4444
4448
  }
4445
- const { provideAnswer } = await import("./tools-AALOAXXT.js");
4449
+ const { provideAnswer } = await import("./tools-2QMJFAXE.js");
4446
4450
  const found = provideAnswer(callId, answer ?? "", skip ?? false);
4447
4451
  if (!found) {
4448
4452
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -4478,7 +4482,7 @@ async function createServerHandle(config4) {
4478
4482
  if (sessionManager.isWarmedUp(sessionId)) {
4479
4483
  return res.json({ success: false, reason: "already_warmed" });
4480
4484
  }
4481
- const { runAgentTurn, TurnMetrics } = await import("./orchestrator-5BXIY2F7.js");
4485
+ const { runAgentTurn, TurnMetrics } = await import("./orchestrator-5LSO63RB.js");
4482
4486
  runAgentTurn(
4483
4487
  {
4484
4488
  sessionManager,
@@ -4521,8 +4525,8 @@ async function createServerHandle(config4) {
4521
4525
  if (!session) {
4522
4526
  return res.status(404).json({ error: "Session not found" });
4523
4527
  }
4524
- const { stopSessionExecution } = await import("./chat-handler-K7M5ZPLO.js");
4525
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-AALOAXXT.js");
4528
+ const { stopSessionExecution } = await import("./chat-handler-FGRCJX76.js");
4529
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-2QMJFAXE.js");
4526
4530
  const queuedMessages = sessionManager.getQueueState(sessionId);
4527
4531
  sessionManager.clearMessageQueue(sessionId);
4528
4532
  stopSessionExecution(sessionId, sessionManager);
@@ -4553,16 +4557,25 @@ async function createServerHandle(config4) {
4553
4557
  if (!session) {
4554
4558
  return res.status(404).json({ error: "Session not found" });
4555
4559
  }
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" });
4560
+ const { messageId } = req.body;
4561
+ if (typeof messageId !== "string" || !messageId) {
4562
+ return res.status(400).json({ error: "messageId is required" });
4563
+ }
4564
+ const { getEventStore: getEventStore2 } = await import("./events-52XADT6Y.js");
4565
+ const { buildMessagesFromStoredEvents } = await import("./folding-2BGFLV5J.js");
4566
+ const eventStore = getEventStore2();
4567
+ const events = eventStore.getEvents(sessionId);
4568
+ const messages = buildMessagesFromStoredEvents(events);
4569
+ const msgIndex = messages.findIndex((m) => m.id === messageId);
4570
+ if (msgIndex === -1) {
4571
+ return res.status(400).json({ error: "Message not found" });
4559
4572
  }
4560
- const msg = session.messages[messageIndex];
4561
- if (!msg) {
4562
- return res.status(400).json({ error: "Message not found at this index" });
4573
+ const msg = messages[msgIndex];
4574
+ if (msg.role !== "user" || msg.isSystemGenerated) {
4575
+ return res.status(400).json({ error: "Can only replay user messages" });
4563
4576
  }
4564
4577
  const { truncateSessionMessages } = await import("./events-52XADT6Y.js");
4565
- truncateSessionMessages(sessionId, messageIndex - 1);
4578
+ truncateSessionMessages(sessionId, msgIndex - 1);
4566
4579
  sessionManager.queueMessage(sessionId, "asap", msg.content, msg.attachments, msg.messageKind);
4567
4580
  res.json({ success: true });
4568
4581
  });
@@ -4633,7 +4646,7 @@ async function createServerHandle(config4) {
4633
4646
  let visionFallback;
4634
4647
  let globalWorkdir;
4635
4648
  try {
4636
- const { loadGlobalConfig, getVisionFallback } = await import("./config-G5GNT4UT.js");
4649
+ const { loadGlobalConfig, getVisionFallback } = await import("./config-5ZHFKWOW.js");
4637
4650
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4638
4651
  const fallback = getVisionFallback(globalConfig);
4639
4652
  if (fallback) {
@@ -4702,7 +4715,8 @@ async function createServerHandle(config4) {
4702
4715
  ...m.temperature !== void 0 && { temperature: m.temperature },
4703
4716
  ...m.topP !== void 0 && { topP: m.topP },
4704
4717
  ...m.topK !== void 0 && { topK: m.topK },
4705
- ...m.maxTokens !== void 0 && { maxTokens: m.maxTokens }
4718
+ ...m.maxTokens !== void 0 && { maxTokens: m.maxTokens },
4719
+ ...m.selected !== void 0 && { selected: m.selected }
4706
4720
  }));
4707
4721
  }
4708
4722
  app.post("/api/providers/test", async (req, res) => {
@@ -4730,20 +4744,24 @@ async function createServerHandle(config4) {
4730
4744
  const apiKey = req.query["apiKey"];
4731
4745
  if (!url) return res.status(400).json({ error: "url is required" });
4732
4746
  try {
4733
- const { fetchModelsWithContext } = await import("./provider-manager-7ARKB5FZ.js");
4747
+ const { fetchModelsWithContext } = await import("./provider-manager-PR64DEN2.js");
4748
+ const { getModelProfile: getModelProfile2 } = await import("./profiles-5J7F4BML.js");
4734
4749
  const models = await fetchModelsWithContext(url, apiKey);
4735
4750
  if (models.length === 0) {
4736
4751
  return res.status(404).json({ error: `No models found at ${buildModelsUrl(url)}`, url });
4737
4752
  }
4738
4753
  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
- })),
4754
+ models: models.map((m) => {
4755
+ const profile = getModelProfile2(m.id);
4756
+ return {
4757
+ id: m.id,
4758
+ contextWindow: m.contextWindow,
4759
+ defaultTemperature: profile.temperature,
4760
+ defaultTopP: profile.topP,
4761
+ defaultTopK: profile.topK,
4762
+ defaultMaxTokens: profile.defaultMaxTokens
4763
+ };
4764
+ }),
4747
4765
  url
4748
4766
  });
4749
4767
  } catch (error) {
@@ -4777,9 +4795,9 @@ async function createServerHandle(config4) {
4777
4795
  if (!mode) return res.status(400).json({ error: "mode is required" });
4778
4796
  try {
4779
4797
  const { getModelProfile: getModelProfile2 } = await import("./profiles-5J7F4BML.js");
4780
- const { getBackendCapabilities } = await import("./backend-4HGUPY6W.js");
4798
+ const { getBackendCapabilities } = await import("./backend-B23GIKKD.js");
4781
4799
  const { buildNonStreamingCreateParams } = await import("./client-pure-DO3S675T.js");
4782
- const { OpenAIHttpClient } = await import("./http-client-JTRLBNJC.js");
4800
+ const { OpenAIHttpClient } = await import("./http-client-PIWB7BXK.js");
4783
4801
  const { ensureVersionPrefix } = await import("./url-utils-SAJP7AEX.js");
4784
4802
  const profile = getModelProfile2(model);
4785
4803
  const capabilities = getBackendCapabilities(backend || "unknown");
@@ -4846,7 +4864,7 @@ async function createServerHandle(config4) {
4846
4864
  return res.status(400).json({ error: "name, url, and backend are required" });
4847
4865
  }
4848
4866
  try {
4849
- const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-G5GNT4UT.js");
4867
+ const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-5ZHFKWOW.js");
4850
4868
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4851
4869
  const providerBackend = backend;
4852
4870
  const providerModels = modelConfigs?.length ? buildModelConfigs(modelConfigs) : model ? [{ id: model, contextWindow: 2e5, source: "user" }] : [];
@@ -4860,8 +4878,8 @@ async function createServerHandle(config4) {
4860
4878
  models: providerModels,
4861
4879
  isActive: true
4862
4880
  });
4863
- const firstModelId = model ?? providerModels[0]?.id ?? "auto";
4864
- const finalConfig = setDefaultModelSelection(
4881
+ const firstModelId = model ?? providerModels.find((m) => m.selected)?.id ?? providerModels[0]?.id ?? "auto";
4882
+ const finalConfig = configWithProvider.defaultModelSelection ? configWithProvider : setDefaultModelSelection(
4865
4883
  configWithProvider,
4866
4884
  configWithProvider.providers[configWithProvider.providers.length - 1].id,
4867
4885
  firstModelId
@@ -4884,7 +4902,7 @@ async function createServerHandle(config4) {
4884
4902
  app.post("/api/init/config", async (req, res) => {
4885
4903
  const { workdir, visionFallback } = req.body;
4886
4904
  try {
4887
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-G5GNT4UT.js");
4905
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-5ZHFKWOW.js");
4888
4906
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4889
4907
  const updatedConfig = {
4890
4908
  ...globalConfig,
@@ -4912,7 +4930,7 @@ async function createServerHandle(config4) {
4912
4930
  });
4913
4931
  app.delete("/api/providers/:id", async (req, res) => {
4914
4932
  const { id } = req.params;
4915
- const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-G5GNT4UT.js");
4933
+ const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-5ZHFKWOW.js");
4916
4934
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4917
4935
  const updatedConfig = removeProvider(globalConfig, id);
4918
4936
  await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
@@ -4924,7 +4942,7 @@ async function createServerHandle(config4) {
4924
4942
  const { id } = req.params;
4925
4943
  const { isLocal } = req.body;
4926
4944
  try {
4927
- const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-G5GNT4UT.js");
4945
+ const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-5ZHFKWOW.js");
4928
4946
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4929
4947
  const provider = globalConfig.providers.find((p) => p.id === id);
4930
4948
  if (!provider) {
@@ -4953,7 +4971,7 @@ async function createServerHandle(config4) {
4953
4971
  models: modelConfigs
4954
4972
  } = req.body;
4955
4973
  try {
4956
- const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-G5GNT4UT.js");
4974
+ const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-5ZHFKWOW.js");
4957
4975
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4958
4976
  const provider = globalConfig.providers.find((p) => p.id === id);
4959
4977
  if (!provider) {
@@ -4991,7 +5009,7 @@ async function createServerHandle(config4) {
4991
5009
  return res.status(400).json({ error: result.error });
4992
5010
  }
4993
5011
  const llmClient = getLLMClient();
4994
- const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-G5GNT4UT.js");
5012
+ const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-5ZHFKWOW.js");
4995
5013
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4996
5014
  const updatedConfig = setDefaultModelSelection(globalConfig, id, llmClient.getModel());
4997
5015
  await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
@@ -5018,7 +5036,7 @@ async function createServerHandle(config4) {
5018
5036
  });
5019
5037
  async function rebuildMcpTools() {
5020
5038
  const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-MOGEI6TP.js");
5021
- const { setMcpTools: setMcpTools2 } = await import("./tools-AALOAXXT.js");
5039
+ const { setMcpTools: setMcpTools2 } = await import("./tools-2QMJFAXE.js");
5022
5040
  const mcpTools = createMcpTools2(mcpManager);
5023
5041
  setMcpTools2(mcpTools);
5024
5042
  }
@@ -5080,7 +5098,7 @@ async function createServerHandle(config4) {
5080
5098
  };
5081
5099
  await mcpManager.addServer(name, serverCfg);
5082
5100
  const server = mcpManager.getServer(name);
5083
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-G5GNT4UT.js");
5101
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-5ZHFKWOW.js");
5084
5102
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
5085
5103
  const updatedMcpServers = { ...globalConfig.mcpServers ?? {}, [name]: serverCfg };
5086
5104
  await saveGlobalConfig(config4.mode ?? "production", {
@@ -5106,7 +5124,7 @@ async function createServerHandle(config4) {
5106
5124
  return res.status(404).json({ error: `MCP server '${name}' not found` });
5107
5125
  }
5108
5126
  mcpManager.removeServer(name);
5109
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-G5GNT4UT.js");
5127
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-5ZHFKWOW.js");
5110
5128
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
5111
5129
  const updatedMcpServers = { ...globalConfig.mcpServers ?? {} };
5112
5130
  delete updatedMcpServers[name];
@@ -5131,7 +5149,7 @@ async function createServerHandle(config4) {
5131
5149
  await mcpManager.setToolEnabled(name, toolName, enabled);
5132
5150
  const server = mcpManager.getServer(name);
5133
5151
  if (server) {
5134
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-G5GNT4UT.js");
5152
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-5ZHFKWOW.js");
5135
5153
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
5136
5154
  const mcpServers2 = { ...globalConfig.mcpServers ?? {} };
5137
5155
  const serverCfg = mcpServers2[name];
@@ -5326,7 +5344,7 @@ async function createServerHandle(config4) {
5326
5344
  const state = sessionManager.getContextState(sessionId);
5327
5345
  wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
5328
5346
  });
5329
- const { QueueProcessor } = await import("./processor-L4XHWQUH.js");
5347
+ const { QueueProcessor } = await import("./processor-F5FMOPOQ.js");
5330
5348
  const queueProcessor = new QueueProcessor({
5331
5349
  sessionManager,
5332
5350
  providerManager,
@@ -5401,4 +5419,4 @@ export {
5401
5419
  createServerHandle,
5402
5420
  createServer
5403
5421
  };
5404
- //# sourceMappingURL=chunk-KS25ZHG3.js.map
5422
+ //# sourceMappingURL=chunk-KUE7ASKH.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