openfox 2.0.50 → 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 (43) hide show
  1. package/dist/{backend-4HGUPY6W.js → backend-B23GIKKD.js} +2 -2
  2. package/dist/{chat-handler-PLRNAAXW.js → chat-handler-FGRCJX76.js} +9 -9
  3. package/dist/{chunk-GTY27MWS.js → chunk-3KVWOPRN.js} +13 -11
  4. package/dist/{chunk-2DKFKTLY.js → chunk-4566MTWM.js} +3 -3
  5. package/dist/{chunk-PTKQBKSK.js → chunk-6J4KEDJQ.js} +80 -66
  6. package/dist/{chunk-LB3E24TN.js → chunk-AIJE3RYH.js} +2 -2
  7. package/dist/{chunk-QYCEHUCB.js → chunk-HVLNOTRE.js} +7 -7
  8. package/dist/{chunk-PTIF5OEJ.js → chunk-N3Z4SMEH.js} +5 -5
  9. package/dist/{chunk-Z4FMBCJO.js → chunk-PSJON33Y.js} +13 -1
  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-EHYFYQXY.js → chunk-TMUBLQFC.js} +35 -1
  13. package/dist/{chunk-U62IKLKM.js → chunk-UOKVBO67.js} +4 -4
  14. package/dist/{chunk-J5DFWFIH.js → chunk-UOUQMYRJ.js} +6 -6
  15. package/dist/{chunk-55RWNJBT.js → chunk-VZHN46NW.js} +2 -2
  16. package/dist/{chunk-UFFLA4W6.js → chunk-ZO5EXQMG.js} +1 -6
  17. package/dist/{chunk-H5AC62SN.js → chunk-ZZLCX7YT.js} +3 -3
  18. package/dist/cli/dev.js +1 -1
  19. package/dist/cli/index.js +1 -1
  20. package/dist/{client-5FOFNUXM.js → client-Y3ESMMZA.js} +4 -4
  21. package/dist/{compactor-VIN5YWQF.js → compactor-ZKZYSNMD.js} +6 -6
  22. package/dist/{config-G5GNT4UT.js → config-5ZHFKWOW.js} +2 -2
  23. package/dist/{events-S4EOKSYA.js → events-52XADT6Y.js} +3 -3
  24. package/dist/{folding-H5C6HS7O.js → folding-2BGFLV5J.js} +4 -2
  25. package/dist/{http-client-JTRLBNJC.js → http-client-PIWB7BXK.js} +2 -2
  26. package/dist/{orchestrator-YOAWKIB2.js → orchestrator-5LSO63RB.js} +8 -8
  27. package/dist/package.json +1 -1
  28. package/dist/{processor-U35UWS3W.js → processor-F5FMOPOQ.js} +9 -9
  29. package/dist/{protocol-A2CLNSAK.d.ts → protocol-DRe5K6Id.d.ts} +1 -0
  30. package/dist/{provider-BYKY7BS3.js → provider-V6Q6WJAF.js} +7 -7
  31. package/dist/{provider-manager-7ARKB5FZ.js → provider-manager-PR64DEN2.js} +5 -5
  32. package/dist/{serve-5FEMRPYX.js → serve-J4V6KLQ6.js} +14 -14
  33. package/dist/server/index.d.ts +2 -2
  34. package/dist/server/index.js +13 -13
  35. package/dist/{server-6L6I34NC.js → server-ZQ5NGHPD.js} +12 -12
  36. package/dist/shared/index.d.ts +2 -2
  37. package/dist/{tools-CSRQDWRI.js → tools-2QMJFAXE.js} +7 -7
  38. package/dist/web/assets/index-CkyaIKu9.js +302 -0
  39. package/dist/web/assets/{index-BfYemJAQ.css → index-CvIUuius.css} +1 -1
  40. package/dist/web/index.html +2 -2
  41. package/dist/web/sw.js +1 -1
  42. package/package.json +1 -1
  43. 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-U62IKLKM.js";
5
+ } from "./chunk-UOKVBO67.js";
6
6
  import {
7
7
  runChatTurn
8
- } from "./chunk-PTIF5OEJ.js";
9
- import "./chunk-GTY27MWS.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
- } from "./chunk-LB3E24TN.js";
26
- import "./chunk-EHYFYQXY.js";
25
+ } from "./chunk-AIJE3RYH.js";
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-PLRNAAXW.js.map
157
+ //# sourceMappingURL=chat-handler-FGRCJX76.js.map
@@ -49,13 +49,13 @@ 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,
56
56
  getEventStore,
57
57
  getRuntimeConfig
58
- } from "./chunk-LB3E24TN.js";
58
+ } from "./chunk-AIJE3RYH.js";
59
59
  import {
60
60
  buildContextMessagesFromEventHistory,
61
61
  foldContextState,
@@ -63,15 +63,16 @@ import {
63
63
  handleMessageThinking,
64
64
  handleToolCall,
65
65
  handleToolResult,
66
+ reorderToolMessages,
66
67
  stripOrphanedToolCalls
67
- } from "./chunk-EHYFYQXY.js";
68
+ } from "./chunk-TMUBLQFC.js";
68
69
  import {
69
70
  logger
70
71
  } from "./chunk-K44MW7JJ.js";
71
72
  import {
72
73
  loadGlobalConfig,
73
74
  saveGlobalConfig
74
- } from "./chunk-C7NO4BBK.js";
75
+ } from "./chunk-QQ5XY6BH.js";
75
76
  import {
76
77
  getGlobalConfigDir
77
78
  } from "./chunk-CQGTEGKL.js";
@@ -2608,7 +2609,7 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
2608
2609
  sessionManager.setCurrentContextSize(sessionId, result.usage.promptTokens);
2609
2610
  if (!compacting) {
2610
2611
  const contextState2 = sessionManager.getContextState(sessionId);
2611
- const { shouldCompact, appendCompactionPrompt } = await import("./compactor-VIN5YWQF.js");
2612
+ const { shouldCompact, appendCompactionPrompt } = await import("./compactor-ZKZYSNMD.js");
2612
2613
  if (shouldCompact(contextState2.currentTokens, contextState2.maxTokens, runtimeConfig.context.compactionThreshold)) {
2613
2614
  appendCompactionPrompt(sessionId, append);
2614
2615
  compacting = true;
@@ -2965,7 +2966,7 @@ async function describeImageFromDataUrl(dataUrl, visionModel, options) {
2965
2966
  import { createHash as createHash2 } from "crypto";
2966
2967
  async function loadVisionModelFromGlobalConfig() {
2967
2968
  try {
2968
- const { loadGlobalConfig: loadGlobalConfig2, getVisionFallback } = await import("./config-G5GNT4UT.js");
2969
+ const { loadGlobalConfig: loadGlobalConfig2, getVisionFallback } = await import("./config-5ZHFKWOW.js");
2969
2970
  const runtimeConfig = getRuntimeConfig();
2970
2971
  const mode = runtimeConfig.mode ?? "production";
2971
2972
  const globalConfig = await loadGlobalConfig2(mode);
@@ -3235,6 +3236,7 @@ function buildSubAgentContextMessages(events, scope) {
3235
3236
  }
3236
3237
  }
3237
3238
  stripOrphanedToolCalls(messages, fulfilledToolCallIds);
3239
+ reorderToolMessages(messages);
3238
3240
  return messages.map(
3239
3241
  ({ id: _id, subAgentId: _sa, subAgentType: _st, contextWindowId: _cw, isCompactionSummary: _ics, ...rest }) => {
3240
3242
  const ctx = {
@@ -3479,7 +3481,7 @@ var callSubAgentTool = {
3479
3481
  };
3480
3482
  }
3481
3483
  try {
3482
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-CSRQDWRI.js");
3484
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-2QMJFAXE.js");
3483
3485
  const toolRegistry = getToolRegistryForAgent2(agentDef);
3484
3486
  const turnMetrics = new TurnMetrics();
3485
3487
  const result = await executeSubAgent({
@@ -4295,7 +4297,7 @@ function resolveAgentDef2(sessionManager, sessionId) {
4295
4297
  }
4296
4298
  async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
4297
4299
  const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
4298
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-CSRQDWRI.js");
4300
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-2QMJFAXE.js");
4299
4301
  const tools = getToolRegistryForAgent2(agentDef).definitions;
4300
4302
  const toolFingerprint = getToolFingerprint(tools);
4301
4303
  const allAgents = await loadAllAgentsDefault();
@@ -4308,7 +4310,7 @@ async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
4308
4310
  async function computeSessionHash(sessionManager, sessionId) {
4309
4311
  const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
4310
4312
  const agentDef = await resolveAgentDef2(sessionManager, sessionId);
4311
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-CSRQDWRI.js");
4313
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-2QMJFAXE.js");
4312
4314
  const tools = getToolRegistryForAgent2(agentDef).definitions;
4313
4315
  const toolFingerprint = getToolFingerprint(tools);
4314
4316
  return computeDynamicContextHash(instructionContent, skills, toolFingerprint);
@@ -4415,7 +4417,7 @@ var mcpConfigTool = createTool(
4415
4417
  await saveGlobalConfig(mcpConfigMode, { ...globalConfig, mcpServers: updated });
4416
4418
  }
4417
4419
  async function rebuildTools() {
4418
- const { setMcpTools: setMcpTools2 } = await import("./tools-CSRQDWRI.js");
4420
+ const { setMcpTools: setMcpTools2 } = await import("./tools-2QMJFAXE.js");
4419
4421
  const mcpTools = createMcpTools(mcpManagerForTools);
4420
4422
  setMcpTools2(mcpTools);
4421
4423
  }
@@ -5085,4 +5087,4 @@ export {
5085
5087
  getToolRegistryForAgent,
5086
5088
  createToolRegistry
5087
5089
  };
5088
- //# sourceMappingURL=chunk-GTY27MWS.js.map
5090
+ //# sourceMappingURL=chunk-3KVWOPRN.js.map
@@ -1,10 +1,10 @@
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
- } from "./chunk-LB3E24TN.js";
7
+ } from "./chunk-AIJE3RYH.js";
8
8
 
9
9
  // src/server/context/compactor.ts
10
10
  function appendCompactionPrompt(sessionId, append) {
@@ -31,4 +31,4 @@ export {
31
31
  shouldCompact,
32
32
  getCompactionTarget
33
33
  };
34
- //# sourceMappingURL=chunk-2DKFKTLY.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-QYCEHUCB.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-GTY27MWS.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,
@@ -109,27 +109,27 @@ import {
109
109
  updateSessionMetadata,
110
110
  updateSessionProvider,
111
111
  updateSessionRunning
112
- } from "./chunk-LB3E24TN.js";
112
+ } from "./chunk-AIJE3RYH.js";
113
113
  import {
114
114
  initDatabase
115
115
  } from "./chunk-ZPIZLTWU.js";
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.50";
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-6L6I34NC.js");
4049
+ const { signalMcpReady } = await import("./server-ZQ5NGHPD.js");
4050
4050
  signalMcpReady();
4051
4051
  });
4052
4052
  const app = express();
@@ -4204,7 +4204,7 @@ async function createServerHandle(config4) {
4204
4204
  res.json({ project });
4205
4205
  });
4206
4206
  app.get("/api/sessions", async (req, res) => {
4207
- const { getRecentUserPromptsForSession } = await import("./events-S4EOKSYA.js");
4207
+ const { getRecentUserPromptsForSession } = await import("./events-52XADT6Y.js");
4208
4208
  const projectId = req.query["projectId"];
4209
4209
  const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
4210
4210
  const offset = parseInt(req.query["offset"]) || 0;
@@ -4237,9 +4237,9 @@ async function createServerHandle(config4) {
4237
4237
  res.status(201).json({ session });
4238
4238
  });
4239
4239
  app.get("/api/sessions/:id", async (req, res) => {
4240
- const { getEventStore: getEventStore2 } = await import("./events-S4EOKSYA.js");
4241
- const { buildMessagesFromStoredEvents } = await import("./folding-H5C6HS7O.js");
4242
- const { getPendingQuestionsForSession } = await import("./tools-CSRQDWRI.js");
4240
+ const { getEventStore: getEventStore2 } = await import("./events-52XADT6Y.js");
4241
+ const { buildMessagesFromStoredEvents } = await import("./folding-2BGFLV5J.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-PLRNAAXW.js");
4262
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-CSRQDWRI.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);
@@ -4278,8 +4278,8 @@ async function createServerHandle(config4) {
4278
4278
  res.json({ success: true });
4279
4279
  });
4280
4280
  app.post("/api/sessions/:id/provider", async (req, res) => {
4281
- const { getEventStore: getEventStore2 } = await import("./events-S4EOKSYA.js");
4282
- const { buildMessagesFromStoredEvents } = await import("./folding-H5C6HS7O.js");
4281
+ const { getEventStore: getEventStore2 } = await import("./events-52XADT6Y.js");
4282
+ const { buildMessagesFromStoredEvents } = await import("./folding-2BGFLV5J.js");
4283
4283
  const sessionId = req.params.id;
4284
4284
  const session = sessionManager.getSession(sessionId);
4285
4285
  if (!session) {
@@ -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);
@@ -4356,8 +4356,8 @@ async function createServerHandle(config4) {
4356
4356
  res.json({ success: true });
4357
4357
  });
4358
4358
  app.put("/api/sessions/:id/mode", async (req, res) => {
4359
- const { getEventStore: getEventStore2 } = await import("./events-S4EOKSYA.js");
4360
- const { buildMessagesFromStoredEvents } = await import("./folding-H5C6HS7O.js");
4359
+ const { getEventStore: getEventStore2 } = await import("./events-52XADT6Y.js");
4360
+ const { buildMessagesFromStoredEvents } = await import("./folding-2BGFLV5J.js");
4361
4361
  const sessionId = req.params.id;
4362
4362
  const session = sessionManager.getSession(sessionId);
4363
4363
  if (!session) {
@@ -4413,15 +4413,15 @@ 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-CSRQDWRI.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" });
4420
4420
  }
4421
- const { getEventStore: getEventStore2 } = await import("./events-S4EOKSYA.js");
4422
- const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-H5C6HS7O.js");
4421
+ const { getEventStore: getEventStore2 } = await import("./events-52XADT6Y.js");
4422
+ const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-2BGFLV5J.js");
4423
4423
  const { createSessionStateMessage } = await import("./protocol-CTNE3ANP.js");
4424
- const { getPendingQuestionsForSession } = await import("./tools-CSRQDWRI.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-CSRQDWRI.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-YOAWKIB2.js");
4481
+ const { runAgentTurn, TurnMetrics } = await import("./orchestrator-5LSO63RB.js");
4482
4482
  runAgentTurn(
4483
4483
  {
4484
4484
  sessionManager,
@@ -4521,15 +4521,15 @@ 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-PLRNAAXW.js");
4525
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-CSRQDWRI.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);
4529
4529
  abortSession(sessionId);
4530
4530
  cancelQuestionsForSession(sessionId, "Session stopped by user");
4531
4531
  cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
4532
- const eventStore = (await import("./events-S4EOKSYA.js")).getEventStore();
4532
+ const eventStore = (await import("./events-52XADT6Y.js")).getEventStore();
4533
4533
  eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
4534
4534
  res.json({ success: true, queuedMessages });
4535
4535
  });
@@ -4543,7 +4543,7 @@ async function createServerHandle(config4) {
4543
4543
  if (typeof messageIndex !== "number" || messageIndex < 0) {
4544
4544
  return res.status(400).json({ error: "messageIndex must be a non-negative number" });
4545
4545
  }
4546
- const { truncateSessionMessages } = await import("./events-S4EOKSYA.js");
4546
+ const { truncateSessionMessages } = await import("./events-52XADT6Y.js");
4547
4547
  truncateSessionMessages(sessionId, messageIndex);
4548
4548
  res.json({ success: true });
4549
4549
  });
@@ -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
- const { truncateSessionMessages } = await import("./events-S4EOKSYA.js");
4565
- truncateSessionMessages(sessionId, messageIndex - 1);
4573
+ const { truncateSessionMessages } = await import("./events-52XADT6Y.js");
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-CSRQDWRI.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-U35UWS3W.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-PTKQBKSK.js.map
5418
+ //# sourceMappingURL=chunk-6J4KEDJQ.js.map
@@ -5,7 +5,7 @@ import {
5
5
  foldContextState,
6
6
  foldSessionState,
7
7
  spreadOptionalMessageFields
8
- } from "./chunk-EHYFYQXY.js";
8
+ } from "./chunk-TMUBLQFC.js";
9
9
  import {
10
10
  getDatabase
11
11
  } from "./chunk-ZPIZLTWU.js";
@@ -1434,4 +1434,4 @@ export {
1434
1434
  truncateSessionMessages,
1435
1435
  getRecentUserPromptsForSession
1436
1436
  };
1437
- //# sourceMappingURL=chunk-LB3E24TN.js.map
1437
+ //# sourceMappingURL=chunk-AIJE3RYH.js.map
@@ -2,7 +2,7 @@ import {
2
2
  injectWorkflowKickoffIfNeeded,
3
3
  runAgentTurn,
4
4
  runChatTurn
5
- } from "./chunk-PTIF5OEJ.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-GTY27MWS.js";
19
+ } from "./chunk-3KVWOPRN.js";
20
20
  import {
21
21
  getPlatformShell,
22
22
  onProcessEvent
@@ -40,19 +40,19 @@ import {
40
40
  } from "./chunk-EU3WWTFH.js";
41
41
  import {
42
42
  appendCompactionPrompt
43
- } from "./chunk-2DKFKTLY.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,
51
51
  getRuntimeConfig
52
- } from "./chunk-LB3E24TN.js";
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-QYCEHUCB.js.map
2094
+ //# sourceMappingURL=chunk-HVLNOTRE.js.map