openfox 1.6.80 → 1.6.82

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 (34) hide show
  1. package/dist/{auto-compaction-Q3GRX7T5.js → auto-compaction-I3GTBPTZ.js} +6 -6
  2. package/dist/{chat-handler-PO5OBBJE.js → chat-handler-IOHM7XMZ.js} +9 -9
  3. package/dist/{chunk-BSTVRSV6.js → chunk-C3O6MZJV.js} +2 -2
  4. package/dist/{chunk-A5W6JUYZ.js → chunk-D67V55WE.js} +3 -3
  5. package/dist/{chunk-UKMRZDWM.js → chunk-DVNZAJT5.js} +3 -3
  6. package/dist/{chunk-WR6QCJJO.js → chunk-HJOH367L.js} +10 -8
  7. package/dist/{chunk-YLLWWYDA.js → chunk-MDL6USSE.js} +32 -30
  8. package/dist/{chunk-TGWEH2BC.js → chunk-NRJOTXHG.js} +5 -9
  9. package/dist/{chunk-HPTMW2FT.js → chunk-WHPOBTTU.js} +3 -3
  10. package/dist/{chunk-LHKXWUEK.js → chunk-WNYDTFJO.js} +16 -5
  11. package/dist/{chunk-7DOKXSMI.js → chunk-XI7JEBNT.js} +50 -41
  12. package/dist/{chunk-GFLXCEZA.js → chunk-Y2LKLZ2V.js} +6 -6
  13. package/dist/{chunk-CUDAT6SS.js → chunk-Y325P6Z4.js} +2 -2
  14. package/dist/{chunk-UF6D2IPO.js → chunk-ZPQDYRQI.js} +2 -2
  15. package/dist/cli/dev.js +1 -1
  16. package/dist/cli/index.js +1 -1
  17. package/dist/{config-5CONAOL7.js → config-RIK5T6WK.js} +5 -5
  18. package/dist/{events-QDUOJQML.js → events-I7NDHSNU.js} +2 -2
  19. package/dist/{orchestrator-LVD4YU54.js → orchestrator-YFHSFYII.js} +7 -7
  20. package/dist/package.json +1 -1
  21. package/dist/{processor-SAS6Z2XZ.js → processor-EM4BINEJ.js} +5 -5
  22. package/dist/{protocol-4xbfAlGO.d.ts → protocol-OnZRAPeM.d.ts} +1 -0
  23. package/dist/{protocol-IXFNYZEX.js → protocol-VVUFP4I7.js} +2 -2
  24. package/dist/{provider-ESEBV3LL.js → provider-AASLIQZJ.js} +7 -7
  25. package/dist/{serve-U5FU7YWD.js → serve-OJPBEKVE.js} +11 -11
  26. package/dist/server/index.d.ts +1 -1
  27. package/dist/server/index.js +9 -9
  28. package/dist/shared/index.d.ts +2 -2
  29. package/dist/{tools-B4KSCOWC.js → tools-PPLFGZCK.js} +6 -6
  30. package/dist/{vision-fallback-ED27LH6C.js → vision-fallback-GMDXLVRN.js} +2 -2
  31. package/dist/web/assets/{index-DuIE79t4.js → index-CkbORFn4.js} +46 -43
  32. package/dist/web/index.html +1 -1
  33. package/dist/web/sw.js +1 -1
  34. package/package.json +1 -1
@@ -2,26 +2,26 @@ import {
2
2
  maybeAutoCompactContext,
3
3
  performManualContextCompaction,
4
4
  resolveCompactionStatsIdentity
5
- } from "./chunk-7DOKXSMI.js";
5
+ } from "./chunk-XI7JEBNT.js";
6
6
  import "./chunk-OXI26S7U.js";
7
7
  import "./chunk-CMQCO27Y.js";
8
8
  import "./chunk-DL6ZILAF.js";
9
9
  import "./chunk-PBGOZMVY.js";
10
10
  import "./chunk-VRGRAQDG.js";
11
- import "./chunk-CUDAT6SS.js";
12
- import "./chunk-LHKXWUEK.js";
11
+ import "./chunk-Y325P6Z4.js";
12
+ import "./chunk-WNYDTFJO.js";
13
13
  import "./chunk-KIOUKC3Z.js";
14
14
  import "./chunk-TS5XFQ2D.js";
15
- import "./chunk-UF6D2IPO.js";
15
+ import "./chunk-ZPQDYRQI.js";
16
16
  import "./chunk-BJYPTN5S.js";
17
17
  import "./chunk-NDJ6FKSP.js";
18
18
  import "./chunk-CQGTEGKL.js";
19
19
  import "./chunk-B5AP3RSV.js";
20
- import "./chunk-BSTVRSV6.js";
20
+ import "./chunk-C3O6MZJV.js";
21
21
  import "./chunk-K44MW7JJ.js";
22
22
  export {
23
23
  maybeAutoCompactContext,
24
24
  performManualContextCompaction,
25
25
  resolveCompactionStatsIdentity
26
26
  };
27
- //# sourceMappingURL=auto-compaction-Q3GRX7T5.js.map
27
+ //# sourceMappingURL=auto-compaction-I3GTBPTZ.js.map
@@ -5,32 +5,32 @@ import {
5
5
  generateSessionName,
6
6
  getSessionMessageCount,
7
7
  needsNameGenerationCheck
8
- } from "./chunk-A5W6JUYZ.js";
8
+ } from "./chunk-D67V55WE.js";
9
9
  import {
10
10
  runChatTurn
11
- } from "./chunk-HPTMW2FT.js";
12
- import "./chunk-7DOKXSMI.js";
11
+ } from "./chunk-WHPOBTTU.js";
12
+ import "./chunk-XI7JEBNT.js";
13
13
  import "./chunk-OXI26S7U.js";
14
14
  import "./chunk-CMQCO27Y.js";
15
15
  import "./chunk-DL6ZILAF.js";
16
16
  import "./chunk-PBGOZMVY.js";
17
17
  import "./chunk-VRGRAQDG.js";
18
- import "./chunk-CUDAT6SS.js";
18
+ import "./chunk-Y325P6Z4.js";
19
19
  import {
20
20
  getEventStore
21
- } from "./chunk-LHKXWUEK.js";
21
+ } from "./chunk-WNYDTFJO.js";
22
22
  import "./chunk-KIOUKC3Z.js";
23
23
  import "./chunk-TS5XFQ2D.js";
24
24
  import {
25
25
  createChatMessageMessage,
26
26
  createPhaseChangedMessage,
27
27
  createSessionRunningMessage
28
- } from "./chunk-UF6D2IPO.js";
28
+ } from "./chunk-ZPQDYRQI.js";
29
29
  import "./chunk-BJYPTN5S.js";
30
30
  import "./chunk-NDJ6FKSP.js";
31
31
  import "./chunk-CQGTEGKL.js";
32
32
  import "./chunk-B5AP3RSV.js";
33
- import "./chunk-BSTVRSV6.js";
33
+ import "./chunk-C3O6MZJV.js";
34
34
  import {
35
35
  logger
36
36
  } from "./chunk-K44MW7JJ.js";
@@ -61,7 +61,7 @@ async function startChatSession(sessionId, content, deps, options) {
61
61
  sessionManager.setRunning(sessionId, true);
62
62
  broadcastForSession(sessionId, createSessionRunningMessage(true));
63
63
  try {
64
- const { maybeAutoCompactContext } = await import("./auto-compaction-Q3GRX7T5.js");
64
+ const { maybeAutoCompactContext } = await import("./auto-compaction-I3GTBPTZ.js");
65
65
  await maybeAutoCompactContext({
66
66
  sessionManager,
67
67
  sessionId,
@@ -175,4 +175,4 @@ export {
175
175
  startChatSession,
176
176
  stopSessionExecution
177
177
  };
178
- //# sourceMappingURL=chat-handler-PO5OBBJE.js.map
178
+ //# sourceMappingURL=chat-handler-IOHM7XMZ.js.map
@@ -29,7 +29,7 @@ function isVisionFallbackEnabled() {
29
29
  async function ensureVisionFallbackConfigLoaded() {
30
30
  if (configLoaded) return;
31
31
  try {
32
- const { loadGlobalConfig, getVisionFallback } = await import("./config-5CONAOL7.js");
32
+ const { loadGlobalConfig, getVisionFallback } = await import("./config-RIK5T6WK.js");
33
33
  const { getRuntimeConfig } = await import("./runtime-config-CBJJJGBD.js");
34
34
  const runtimeConfig = getRuntimeConfig();
35
35
  const mode = runtimeConfig.mode ?? "production";
@@ -137,4 +137,4 @@ export {
137
137
  describeImage,
138
138
  describeImageFromDataUrl
139
139
  };
140
- //# sourceMappingURL=chunk-BSTVRSV6.js.map
140
+ //# sourceMappingURL=chunk-C3O6MZJV.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getEventStore,
3
3
  updateSessionMetadata
4
- } from "./chunk-LHKXWUEK.js";
4
+ } from "./chunk-WNYDTFJO.js";
5
5
  import {
6
6
  buildMessagesFromStoredEvents,
7
7
  foldPendingConfirmations
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  createContextStateMessage,
11
11
  createSessionStateMessage
12
- } from "./chunk-UF6D2IPO.js";
12
+ } from "./chunk-ZPQDYRQI.js";
13
13
  import {
14
14
  logger
15
15
  } from "./chunk-K44MW7JJ.js";
@@ -143,4 +143,4 @@ export {
143
143
  needsNameGenerationCheck,
144
144
  applyGeneratedSessionName
145
145
  };
146
- //# sourceMappingURL=chunk-A5W6JUYZ.js.map
146
+ //# sourceMappingURL=chunk-D67V55WE.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  detectModel
3
- } from "./chunk-TGWEH2BC.js";
3
+ } from "./chunk-NRJOTXHG.js";
4
4
  import {
5
5
  detectBackend
6
- } from "./chunk-CUDAT6SS.js";
6
+ } from "./chunk-Y325P6Z4.js";
7
7
  import {
8
8
  getGlobalConfigPath
9
9
  } from "./chunk-CQGTEGKL.js";
@@ -435,4 +435,4 @@ export {
435
435
  activateProvider,
436
436
  mergeConfigs
437
437
  };
438
- //# sourceMappingURL=chunk-UKMRZDWM.js.map
438
+ //# sourceMappingURL=chunk-DVNZAJT5.js.map
@@ -1,13 +1,12 @@
1
1
  import {
2
2
  clearModelCache,
3
3
  createLLMClient,
4
- detectModel,
5
- setLlmStatus
6
- } from "./chunk-TGWEH2BC.js";
4
+ detectModel
5
+ } from "./chunk-NRJOTXHG.js";
7
6
  import {
8
7
  detectBackend,
9
8
  getModelProfile
10
- } from "./chunk-CUDAT6SS.js";
9
+ } from "./chunk-Y325P6Z4.js";
11
10
  import {
12
11
  logger
13
12
  } from "./chunk-K44MW7JJ.js";
@@ -194,7 +193,10 @@ function createProviderManager(config) {
194
193
  }
195
194
  return {
196
195
  getProviders() {
197
- return [...providers];
196
+ return providers.map((p) => ({
197
+ ...p,
198
+ status: providerStatus.get(p.id) ?? "unknown"
199
+ }));
198
200
  },
199
201
  getActiveProvider() {
200
202
  const { providerId } = parseDefaultModelSelection(defaultModelSelection);
@@ -475,7 +477,7 @@ function createProviderManager(config) {
475
477
  backendModelsCount: modelsWithContext.length
476
478
  });
477
479
  if (modelsWithContext.length === 0) {
478
- setLlmStatus("disconnected");
480
+ providerStatus.set(providerId, "disconnected");
479
481
  if (userModels.length > 0) {
480
482
  logger.debug("Backend unavailable, preserving user models", {
481
483
  providerId,
@@ -486,7 +488,7 @@ function createProviderManager(config) {
486
488
  }
487
489
  return { success: false, error: "No models returned from backend" };
488
490
  }
489
- setLlmStatus("connected");
491
+ providerStatus.set(providerId, "connected");
490
492
  const updatedModels = mergeModelsWithUserOverrides(modelsWithContext, userModels);
491
493
  providers = providers.map((p) => p.id === providerId ? { ...p, models: updatedModels } : p);
492
494
  const { providerId: currentProviderId, model: currentModel } = parseDefaultModelSelection(defaultModelSelection);
@@ -509,4 +511,4 @@ export {
509
511
  parseDefaultModelSelection,
510
512
  createProviderManager
511
513
  };
512
- //# sourceMappingURL=chunk-WR6QCJJO.js.map
514
+ //# sourceMappingURL=chunk-HJOH367L.js.map
@@ -2,7 +2,7 @@ import {
2
2
  createVerifierNudgeConfig,
3
3
  runBuilderTurn,
4
4
  runChatTurn
5
- } from "./chunk-HPTMW2FT.js";
5
+ } from "./chunk-WHPOBTTU.js";
6
6
  import {
7
7
  TurnMetrics,
8
8
  agentExists,
@@ -37,7 +37,7 @@ import {
37
37
  setSkillEnabled,
38
38
  skillExists,
39
39
  spawnShellProcess
40
- } from "./chunk-7DOKXSMI.js";
40
+ } from "./chunk-XI7JEBNT.js";
41
41
  import {
42
42
  getProject
43
43
  } from "./chunk-CMQCO27Y.js";
@@ -50,18 +50,18 @@ import {
50
50
  import {
51
51
  createProviderManager,
52
52
  parseDefaultModelSelection
53
- } from "./chunk-WR6QCJJO.js";
53
+ } from "./chunk-HJOH367L.js";
54
54
  import {
55
55
  SessionNotFoundError,
56
56
  createLLMClient,
57
57
  detectModel,
58
58
  getLlmStatus
59
- } from "./chunk-TGWEH2BC.js";
59
+ } from "./chunk-NRJOTXHG.js";
60
60
  import {
61
61
  detectBackend,
62
62
  getBackendDisplayName,
63
63
  getModelProfile
64
- } from "./chunk-CUDAT6SS.js";
64
+ } from "./chunk-Y325P6Z4.js";
65
65
  import {
66
66
  createSession,
67
67
  deleteSession,
@@ -87,7 +87,7 @@ import {
87
87
  updateSessionProvider,
88
88
  updateSessionRunning,
89
89
  updateSessionSummary
90
- } from "./chunk-LHKXWUEK.js";
90
+ } from "./chunk-WNYDTFJO.js";
91
91
  import {
92
92
  initDatabase
93
93
  } from "./chunk-KIOUKC3Z.js";
@@ -108,7 +108,7 @@ import {
108
108
  parseClientMessage,
109
109
  serializeServerMessage,
110
110
  storedEventToServerMessage
111
- } from "./chunk-UF6D2IPO.js";
111
+ } from "./chunk-ZPQDYRQI.js";
112
112
  import {
113
113
  EventEmitter,
114
114
  provideAnswer
@@ -4022,6 +4022,7 @@ var SessionManager = class {
4022
4022
  });
4023
4023
  const eventStore = getEventStore();
4024
4024
  eventStore.deleteSession(id);
4025
+ this.messageQueues.delete(id);
4025
4026
  deleteSession(id);
4026
4027
  if (this.activeSessionId === id) {
4027
4028
  this.activeSessionId = null;
@@ -5257,7 +5258,7 @@ function createTerminalRoutes() {
5257
5258
  }
5258
5259
 
5259
5260
  // src/constants.ts
5260
- var VERSION = "1.6.80";
5261
+ var VERSION = "1.6.82";
5261
5262
 
5262
5263
  // src/server/index.ts
5263
5264
  var __dirname2 = dirname5(fileURLToPath4(import.meta.url));
@@ -5459,7 +5460,7 @@ async function createServerHandle(config) {
5459
5460
  res.json({ success: true });
5460
5461
  });
5461
5462
  app.get("/api/sessions", async (req, res) => {
5462
- const { getRecentUserPromptsForSession } = await import("./events-QDUOJQML.js");
5463
+ const { getRecentUserPromptsForSession } = await import("./events-I7NDHSNU.js");
5463
5464
  const projectId = req.query["projectId"];
5464
5465
  const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
5465
5466
  const offset = parseInt(req.query["offset"]) || 0;
@@ -5492,7 +5493,7 @@ async function createServerHandle(config) {
5492
5493
  res.status(201).json({ session });
5493
5494
  });
5494
5495
  app.get("/api/sessions/:id", async (req, res) => {
5495
- const { getEventStore: getEventStore2 } = await import("./events-QDUOJQML.js");
5496
+ const { getEventStore: getEventStore2 } = await import("./events-I7NDHSNU.js");
5496
5497
  const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-XIKR6AFM.js");
5497
5498
  const session = sessionManager.getSession(req.params.id);
5498
5499
  if (!session) {
@@ -5523,7 +5524,7 @@ async function createServerHandle(config) {
5523
5524
  res.json({ success: true });
5524
5525
  });
5525
5526
  app.post("/api/sessions/:id/provider", async (req, res) => {
5526
- const { getEventStore: getEventStore2 } = await import("./events-QDUOJQML.js");
5527
+ const { getEventStore: getEventStore2 } = await import("./events-I7NDHSNU.js");
5527
5528
  const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-XIKR6AFM.js");
5528
5529
  const sessionId = req.params.id;
5529
5530
  const session = sessionManager.getSession(sessionId);
@@ -5535,7 +5536,7 @@ async function createServerHandle(config) {
5535
5536
  return res.status(400).json({ error: "providerId is required" });
5536
5537
  }
5537
5538
  sessionManager.setSessionProvider(sessionId, providerId, model ?? "auto");
5538
- const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-5CONAOL7.js");
5539
+ const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-RIK5T6WK.js");
5539
5540
  const globalConfig = await loadGlobalConfig(config.mode ?? "production");
5540
5541
  const updatedConfig = setDefaultModelSelection(globalConfig, providerId, model ?? "auto");
5541
5542
  await saveGlobalConfig(config.mode ?? "production", updatedConfig);
@@ -5561,7 +5562,7 @@ async function createServerHandle(config) {
5561
5562
  res.json({ success: true });
5562
5563
  });
5563
5564
  app.put("/api/sessions/:id/mode", async (req, res) => {
5564
- const { getEventStore: getEventStore2 } = await import("./events-QDUOJQML.js");
5565
+ const { getEventStore: getEventStore2 } = await import("./events-I7NDHSNU.js");
5565
5566
  const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-XIKR6AFM.js");
5566
5567
  const sessionId = req.params.id;
5567
5568
  const session = sessionManager.getSession(sessionId);
@@ -5614,14 +5615,14 @@ async function createServerHandle(config) {
5614
5615
  if (!callId || approved === void 0) {
5615
5616
  return res.status(400).json({ error: "callId and approved are required" });
5616
5617
  }
5617
- const { providePathConfirmation } = await import("./tools-B4KSCOWC.js");
5618
+ const { providePathConfirmation } = await import("./tools-PPLFGZCK.js");
5618
5619
  const result = providePathConfirmation(callId, approved, alwaysAllow);
5619
5620
  if (!result.found) {
5620
5621
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
5621
5622
  }
5622
- const { getEventStore: getEventStore2 } = await import("./events-QDUOJQML.js");
5623
+ const { getEventStore: getEventStore2 } = await import("./events-I7NDHSNU.js");
5623
5624
  const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-XIKR6AFM.js");
5624
- const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-IXFNYZEX.js");
5625
+ const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-VVUFP4I7.js");
5625
5626
  const eventStore = getEventStore2();
5626
5627
  const events = eventStore.getEvents(sessionId);
5627
5628
  const messages = buildMessagesFromStoredEvents2(events);
@@ -5638,7 +5639,7 @@ async function createServerHandle(config) {
5638
5639
  if (!callId || !answer) {
5639
5640
  return res.status(400).json({ error: "callId and answer are required" });
5640
5641
  }
5641
- const { provideAnswer: provideAnswer2 } = await import("./tools-B4KSCOWC.js");
5642
+ const { provideAnswer: provideAnswer2 } = await import("./tools-PPLFGZCK.js");
5642
5643
  const found = provideAnswer2(callId, answer);
5643
5644
  if (!found) {
5644
5645
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -5674,14 +5675,14 @@ async function createServerHandle(config) {
5674
5675
  if (!session) {
5675
5676
  return res.status(404).json({ error: "Session not found" });
5676
5677
  }
5677
- const { stopSessionExecution } = await import("./chat-handler-PO5OBBJE.js");
5678
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-B4KSCOWC.js");
5678
+ const { stopSessionExecution } = await import("./chat-handler-IOHM7XMZ.js");
5679
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-PPLFGZCK.js");
5679
5680
  stopSessionExecution(sessionId, sessionManager);
5680
5681
  abortSession(sessionId);
5681
5682
  cancelQuestionsForSession(sessionId, "Session stopped by user");
5682
5683
  cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
5683
5684
  sessionManager.clearMessageQueue(sessionId);
5684
- const eventStore = (await import("./events-QDUOJQML.js")).getEventStore();
5685
+ const eventStore = (await import("./events-I7NDHSNU.js")).getEventStore();
5685
5686
  eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
5686
5687
  res.json({ success: true });
5687
5688
  });
@@ -5695,7 +5696,7 @@ async function createServerHandle(config) {
5695
5696
  if (typeof messageIndex !== "number" || messageIndex < 0) {
5696
5697
  return res.status(400).json({ error: "messageIndex must be a non-negative number" });
5697
5698
  }
5698
- const { truncateSessionMessages } = await import("./events-QDUOJQML.js");
5699
+ const { truncateSessionMessages } = await import("./events-I7NDHSNU.js");
5699
5700
  truncateSessionMessages(sessionId, messageIndex);
5700
5701
  res.json({ success: true });
5701
5702
  });
@@ -5747,7 +5748,7 @@ async function createServerHandle(config) {
5747
5748
  let visionFallback;
5748
5749
  let globalWorkdir;
5749
5750
  try {
5750
- const { loadGlobalConfig, getVisionFallback } = await import("./config-5CONAOL7.js");
5751
+ const { loadGlobalConfig, getVisionFallback } = await import("./config-RIK5T6WK.js");
5751
5752
  const globalConfig = await loadGlobalConfig(config.mode ?? "production");
5752
5753
  const fallback = getVisionFallback(globalConfig);
5753
5754
  if (fallback) {
@@ -5826,7 +5827,7 @@ async function createServerHandle(config) {
5826
5827
  return res.status(400).json({ error: "name, url, and backend are required" });
5827
5828
  }
5828
5829
  try {
5829
- const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-5CONAOL7.js");
5830
+ const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-RIK5T6WK.js");
5830
5831
  const globalConfig = await loadGlobalConfig(config.mode ?? "production");
5831
5832
  const providerBackend = backend;
5832
5833
  const configWithProvider = addProvider(globalConfig, {
@@ -5859,7 +5860,7 @@ async function createServerHandle(config) {
5859
5860
  app.post("/api/init/config", async (req, res) => {
5860
5861
  const { workdir, visionFallback } = req.body;
5861
5862
  try {
5862
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-5CONAOL7.js");
5863
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-RIK5T6WK.js");
5863
5864
  const globalConfig = await loadGlobalConfig(config.mode ?? "production");
5864
5865
  const updatedConfig = {
5865
5866
  ...globalConfig,
@@ -5887,7 +5888,7 @@ async function createServerHandle(config) {
5887
5888
  });
5888
5889
  app.delete("/api/providers/:id", async (req, res) => {
5889
5890
  const { id } = req.params;
5890
- const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-5CONAOL7.js");
5891
+ const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-RIK5T6WK.js");
5891
5892
  const globalConfig = await loadGlobalConfig(config.mode ?? "production");
5892
5893
  const updatedConfig = removeProvider(globalConfig, id);
5893
5894
  await saveGlobalConfig(config.mode ?? "production", updatedConfig);
@@ -5907,7 +5908,7 @@ async function createServerHandle(config) {
5907
5908
  return res.status(400).json({ error: result.error });
5908
5909
  }
5909
5910
  const llmClient = getLLMClient();
5910
- const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-5CONAOL7.js");
5911
+ const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-RIK5T6WK.js");
5911
5912
  const globalConfig = await loadGlobalConfig(config.mode ?? "production");
5912
5913
  const updatedConfig = setDefaultModelSelection(globalConfig, id, llmClient.getModel());
5913
5914
  await saveGlobalConfig(config.mode ?? "production", updatedConfig);
@@ -5938,7 +5939,7 @@ async function createServerHandle(config) {
5938
5939
  if (!result.success) {
5939
5940
  return res.status(400).json({ error: result.error });
5940
5941
  }
5941
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-5CONAOL7.js");
5942
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-RIK5T6WK.js");
5942
5943
  const globalConfig = await loadGlobalConfig(config.mode ?? "production");
5943
5944
  const updatedProviders = providerManager.getProviders();
5944
5945
  const updatedConfig = {
@@ -5978,7 +5979,8 @@ async function createServerHandle(config) {
5978
5979
  res.json({
5979
5980
  success: true,
5980
5981
  providerId: id,
5981
- models: updatedProvider?.models ?? []
5982
+ models: updatedProvider?.models ?? [],
5983
+ status: updatedProvider?.status ?? "unknown"
5982
5984
  });
5983
5985
  });
5984
5986
  app.use("/api/skills", createSkillRoutes(configDir));
@@ -6163,7 +6165,7 @@ async function createServerHandle(config) {
6163
6165
  providerManager
6164
6166
  );
6165
6167
  const wss = wssExports.wss;
6166
- const { QueueProcessor } = await import("./processor-SAS6Z2XZ.js");
6168
+ const { QueueProcessor } = await import("./processor-EM4BINEJ.js");
6167
6169
  const queueProcessor = new QueueProcessor({
6168
6170
  sessionManager,
6169
6171
  providerManager,
@@ -6238,4 +6240,4 @@ export {
6238
6240
  createServerHandle,
6239
6241
  createServer
6240
6242
  };
6241
- //# sourceMappingURL=chunk-YLLWWYDA.js.map
6243
+ //# sourceMappingURL=chunk-MDL6USSE.js.map
@@ -5,10 +5,10 @@ import {
5
5
  getBackendCapabilities,
6
6
  getModelProfile,
7
7
  mapFinishReason
8
- } from "./chunk-CUDAT6SS.js";
8
+ } from "./chunk-Y325P6Z4.js";
9
9
  import {
10
10
  ensureVisionFallbackConfigLoaded
11
- } from "./chunk-BSTVRSV6.js";
11
+ } from "./chunk-C3O6MZJV.js";
12
12
  import {
13
13
  logger
14
14
  } from "./chunk-K44MW7JJ.js";
@@ -104,9 +104,6 @@ async function detectModel(llmBaseUrl, retries = 3, silent = false) {
104
104
  function getLlmStatus() {
105
105
  return llmStatus;
106
106
  }
107
- function setLlmStatus(status) {
108
- llmStatus = status;
109
- }
110
107
  function clearModelCache(url) {
111
108
  if (url) {
112
109
  modelCache.delete(getCacheKey(url));
@@ -191,7 +188,7 @@ function createLLMClient(config, initialBackend = "unknown") {
191
188
  try {
192
189
  const shouldDisableThinking = disableThinking || request.disableThinking === true;
193
190
  await ensureVisionFallbackConfigLoaded();
194
- const { isVisionFallbackEnabled } = await import("./vision-fallback-ED27LH6C.js");
191
+ const { isVisionFallbackEnabled } = await import("./vision-fallback-GMDXLVRN.js");
195
192
  const paramsOptions = {
196
193
  model,
197
194
  request,
@@ -268,7 +265,7 @@ function createLLMClient(config, initialBackend = "unknown") {
268
265
  });
269
266
  try {
270
267
  await ensureVisionFallbackConfigLoaded();
271
- const { isVisionFallbackEnabled } = await import("./vision-fallback-ED27LH6C.js");
268
+ const { isVisionFallbackEnabled } = await import("./vision-fallback-GMDXLVRN.js");
272
269
  const shouldDisableThinking = disableThinking || request.disableThinking === true;
273
270
  const createParams = await buildStreamingCreateParams({
274
271
  model,
@@ -479,7 +476,6 @@ export {
479
476
  createLLMClient,
480
477
  detectModel,
481
478
  getLlmStatus,
482
- setLlmStatus,
483
479
  clearModelCache
484
480
  };
485
- //# sourceMappingURL=chunk-TGWEH2BC.js.map
481
+ //# sourceMappingURL=chunk-NRJOTXHG.js.map
@@ -13,11 +13,11 @@ import {
13
13
  getToolRegistryForAgent,
14
14
  loadAllAgentsDefault,
15
15
  runTopLevelAgentLoop
16
- } from "./chunk-7DOKXSMI.js";
16
+ } from "./chunk-XI7JEBNT.js";
17
17
  import {
18
18
  getCurrentContextWindowId,
19
19
  getEventStore
20
- } from "./chunk-LHKXWUEK.js";
20
+ } from "./chunk-WNYDTFJO.js";
21
21
  import {
22
22
  buildSnapshotFromSessionState
23
23
  } from "./chunk-TS5XFQ2D.js";
@@ -327,4 +327,4 @@ export {
327
327
  runBuilderTurn,
328
328
  runVerifierTurn
329
329
  };
330
- //# sourceMappingURL=chunk-HPTMW2FT.js.map
330
+ //# sourceMappingURL=chunk-WHPOBTTU.js.map
@@ -113,6 +113,15 @@ var EventStore = class {
113
113
  * Append a single event to a session
114
114
  */
115
115
  append(sessionId, event) {
116
+ if (!sessionId || typeof sessionId !== "string") {
117
+ throw new Error("Invalid sessionId: must be a non-empty string");
118
+ }
119
+ if (!event || typeof event.type !== "string" || !event.type) {
120
+ throw new Error("Invalid event: must have a type property");
121
+ }
122
+ if (!event.data || typeof event.data !== "object") {
123
+ throw new Error("Invalid event: must have data object");
124
+ }
116
125
  const timestamp = Date.now();
117
126
  const seq = this.getNextSeq(sessionId);
118
127
  const payload = JSON.stringify(event.data);
@@ -256,13 +265,15 @@ var EventStore = class {
256
265
  notifySubscribers(sessionId, event) {
257
266
  const sessionSubs = this.subscribers.get(sessionId);
258
267
  if (sessionSubs) {
259
- for (const subscriber of sessionSubs) {
268
+ const subscribersCopy = Array.from(sessionSubs);
269
+ for (const subscriber of subscribersCopy) {
260
270
  if (!subscriber.closed) {
261
271
  subscriber.callback(event);
262
272
  }
263
273
  }
264
274
  }
265
- for (const subscriber of this.globalSubscribers.values()) {
275
+ const globalSubscribersCopy = Array.from(this.globalSubscribers.values());
276
+ for (const subscriber of globalSubscribersCopy) {
266
277
  if (!subscriber.closed) {
267
278
  subscriber.callback(event);
268
279
  }
@@ -982,11 +993,11 @@ function emitToolCall(sessionId, messageId, toolCall) {
982
993
  data: { messageId, toolCall }
983
994
  });
984
995
  }
985
- function emitToolOutput(sessionId, toolCallId, stream, content) {
996
+ function emitToolOutput(sessionId, messageId, toolCallId, stream, content) {
986
997
  const eventStore = getEventStore();
987
998
  eventStore.append(sessionId, {
988
999
  type: "tool.output",
989
- data: { toolCallId, stream, content }
1000
+ data: { messageId, toolCallId, stream, content }
990
1001
  });
991
1002
  }
992
1003
  function emitToolResult(sessionId, messageId, toolCallId, result) {
@@ -1258,4 +1269,4 @@ export {
1258
1269
  compactContext,
1259
1270
  getRecentUserPromptsForSession
1260
1271
  };
1261
- //# sourceMappingURL=chunk-LHKXWUEK.js.map
1272
+ //# sourceMappingURL=chunk-WNYDTFJO.js.map