openfox 2.0.42 → 2.0.43

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.
@@ -37,6 +37,7 @@ import "./chunk-5WRI5ZAA.js";
37
37
 
38
38
  // src/server/session/chat-handler.ts
39
39
  var activeAgents = /* @__PURE__ */ new Map();
40
+ var abortedSessions = /* @__PURE__ */ new Set();
40
41
  async function startChatSession(sessionId, content, deps, options) {
41
42
  const { sessionManager, broadcastForSession } = deps;
42
43
  const session = sessionManager.getSession(sessionId);
@@ -113,6 +114,12 @@ function startTurnWithCompletionChain(sessionId, controller, deps) {
113
114
  return;
114
115
  }
115
116
  activeAgents.delete(sessionId);
117
+ if (abortedSessions.has(sessionId)) {
118
+ abortedSessions.delete(sessionId);
119
+ sessionManager.clearMessageQueue(sessionId);
120
+ finalizeTurnCompletion(sessionId, sessionManager, broadcastForSession);
121
+ return;
122
+ }
116
123
  const completionMsgs = sessionManager.drainCompletionMessages(sessionId);
117
124
  const next = completionMsgs[0];
118
125
  if (next) {
@@ -135,6 +142,7 @@ function startTurnWithCompletionChain(sessionId, controller, deps) {
135
142
  });
136
143
  }
137
144
  function stopSessionExecution(sessionId, sessionManager) {
145
+ abortedSessions.add(sessionId);
138
146
  const controller = activeAgents.get(sessionId);
139
147
  if (controller) {
140
148
  activeAgents.delete(sessionId);
@@ -146,4 +154,4 @@ export {
146
154
  startChatSession,
147
155
  stopSessionExecution
148
156
  };
149
- //# sourceMappingURL=chat-handler-KW4CAXTH.js.map
157
+ //# sourceMappingURL=chat-handler-233L35BD.js.map
@@ -208,7 +208,7 @@ async function runCli(options) {
208
208
  if (!configExists) {
209
209
  await runNetworkSetup(mode);
210
210
  }
211
- const { runServe } = await import("./serve-J5POPC5Z.js");
211
+ const { runServe } = await import("./serve-LAAYCXXI.js");
212
212
  const serveOptions = { mode };
213
213
  if (values.port) serveOptions.port = parseInt(values.port);
214
214
  if (values["no-browser"] === true) serveOptions.openBrowser = false;
@@ -220,4 +220,4 @@ async function runCli(options) {
220
220
  export {
221
221
  runCli
222
222
  };
223
- //# sourceMappingURL=chunk-6ZS7YQOO.js.map
223
+ //# sourceMappingURL=chunk-FQ6UFNTT.js.map
@@ -21,7 +21,7 @@ import {
21
21
  tokenFromPassword,
22
22
  verifyPassword,
23
23
  workflowExists
24
- } from "./chunk-XIBT7GFC.js";
24
+ } from "./chunk-V234MYXB.js";
25
25
  import {
26
26
  agentExists,
27
27
  createToolRegistry,
@@ -3837,7 +3837,7 @@ import { Router as Router7 } from "express";
3837
3837
  import { spawn as spawn2 } from "child_process";
3838
3838
 
3839
3839
  // src/constants.ts
3840
- var VERSION = "2.0.42";
3840
+ var VERSION = "2.0.43";
3841
3841
 
3842
3842
  // src/server/routes/auto-update.ts
3843
3843
  var updateInProgress = false;
@@ -4034,7 +4034,7 @@ async function createServerHandle(config4) {
4034
4034
  setMcpTools(mcpTools);
4035
4035
  logger.info("MCP tools registered", { count: mcpTools.length });
4036
4036
  }
4037
- const { signalMcpReady } = await import("./server-NJ56QOTU.js");
4037
+ const { signalMcpReady } = await import("./server-GVQNOHX3.js");
4038
4038
  signalMcpReady();
4039
4039
  });
4040
4040
  const app = express();
@@ -4443,7 +4443,7 @@ async function createServerHandle(config4) {
4443
4443
  if (!session) {
4444
4444
  return res.status(404).json({ error: "Session not found" });
4445
4445
  }
4446
- const { stopSessionExecution } = await import("./chat-handler-KW4CAXTH.js");
4446
+ const { stopSessionExecution } = await import("./chat-handler-233L35BD.js");
4447
4447
  const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-PS5CSPGS.js");
4448
4448
  const queuedMessages = sessionManager.getQueueState(sessionId);
4449
4449
  sessionManager.clearMessageQueue(sessionId);
@@ -5248,7 +5248,7 @@ async function createServerHandle(config4) {
5248
5248
  const state = sessionManager.getContextState(sessionId);
5249
5249
  wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
5250
5250
  });
5251
- const { QueueProcessor } = await import("./processor-VGEPABSY.js");
5251
+ const { QueueProcessor } = await import("./processor-T6FX54JU.js");
5252
5252
  const queueProcessor = new QueueProcessor({
5253
5253
  sessionManager,
5254
5254
  providerManager,
@@ -5323,4 +5323,4 @@ export {
5323
5323
  createServerHandle,
5324
5324
  createServer
5325
5325
  };
5326
- //# sourceMappingURL=chunk-LS3FQ4UQ.js.map
5326
+ //# sourceMappingURL=chunk-FZ5LNBZS.js.map
@@ -1372,6 +1372,7 @@ function processQueueAndRestartTurn(sessionManager, sessionId, drainFn, queueMod
1372
1372
  return true;
1373
1373
  }
1374
1374
  var activeAgents = /* @__PURE__ */ new Map();
1375
+ var abortedSessions = /* @__PURE__ */ new Set();
1375
1376
  var MAX_SEND_QUEUE_SIZE = 1e3;
1376
1377
  function createWebSocketServer(httpServer, config, getLLMClient, getActiveProvider, sessionManager, providerManager) {
1377
1378
  const wss = new WebSocketServer({ server: httpServer });
@@ -1483,6 +1484,13 @@ function createWebSocketServer(httpServer, config, getLLMClient, getActiveProvid
1483
1484
  return;
1484
1485
  }
1485
1486
  activeAgents.delete(sessionId);
1487
+ if (abortedSessions.has(sessionId)) {
1488
+ abortedSessions.delete(sessionId);
1489
+ sessionManager.clearMessageQueue(sessionId);
1490
+ const contextState2 = sessionManager.getContextState(sessionId);
1491
+ sendFn(sessionId, createContextStateMessage(contextState2));
1492
+ return;
1493
+ }
1486
1494
  const processed = processQueueAndRestartTurn(
1487
1495
  sessionManager,
1488
1496
  sessionId,
@@ -1684,6 +1692,7 @@ function createWebSocketServer(httpServer, config, getLLMClient, getActiveProvid
1684
1692
  return {
1685
1693
  wss,
1686
1694
  abortSession: (sessionId) => {
1695
+ abortedSessions.add(sessionId);
1687
1696
  const controller = activeAgents.get(sessionId);
1688
1697
  if (controller) {
1689
1698
  activeAgents.delete(sessionId);
@@ -2056,4 +2065,4 @@ export {
2056
2065
  signalMcpReady,
2057
2066
  createWebSocketServer
2058
2067
  };
2059
- //# sourceMappingURL=chunk-XIBT7GFC.js.map
2068
+ //# sourceMappingURL=chunk-V234MYXB.js.map
package/dist/cli/dev.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "../chunk-6ZS7YQOO.js";
4
+ } from "../chunk-FQ6UFNTT.js";
5
5
  import "../chunk-XY3LESVZ.js";
6
6
  import {
7
7
  logger
package/dist/cli/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "../chunk-6ZS7YQOO.js";
4
+ } from "../chunk-FQ6UFNTT.js";
5
5
  import "../chunk-XY3LESVZ.js";
6
6
  import {
7
7
  logger
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openfox",
3
- "version": "2.0.42",
3
+ "version": "2.0.43",
4
4
  "description": "Local-LLM-first agentic coding assistant",
5
5
  "type": "module",
6
6
  "bin": {
@@ -38,6 +38,7 @@ var QueueProcessor = class {
38
38
  deps;
39
39
  unsubscribe = null;
40
40
  activeAgents = /* @__PURE__ */ new Map();
41
+ abortedSessions = /* @__PURE__ */ new Set();
41
42
  constructor(deps) {
42
43
  this.deps = deps;
43
44
  }
@@ -67,6 +68,7 @@ var QueueProcessor = class {
67
68
  logger.debug("QueueProcessor stopped");
68
69
  }
69
70
  abortSession(sessionId) {
71
+ this.abortedSessions.add(sessionId);
70
72
  const controller = this.activeAgents.get(sessionId);
71
73
  if (controller) {
72
74
  controller.abort();
@@ -195,6 +197,11 @@ var QueueProcessor = class {
195
197
  broadcastForSession(sessionId, createSessionRunningMessage(false));
196
198
  return;
197
199
  }
200
+ if (this.abortedSessions.has(sessionId)) {
201
+ this.abortedSessions.delete(sessionId);
202
+ finalizeTurnCompletion(sessionId, sessionManager, broadcastForSession);
203
+ return;
204
+ }
198
205
  const hasMore = sessionManager.hasQueuedMessages(sessionId);
199
206
  if (!hasMore) {
200
207
  finalizeTurnCompletion(sessionId, sessionManager, broadcastForSession);
@@ -217,4 +224,4 @@ var QueueProcessor = class {
217
224
  export {
218
225
  QueueProcessor
219
226
  };
220
- //# sourceMappingURL=processor-VGEPABSY.js.map
227
+ //# sourceMappingURL=processor-T6FX54JU.js.map
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  VERSION,
3
3
  createServer
4
- } from "./chunk-LS3FQ4UQ.js";
5
- import "./chunk-XIBT7GFC.js";
4
+ } from "./chunk-FZ5LNBZS.js";
5
+ import "./chunk-V234MYXB.js";
6
6
  import "./chunk-ULZORR3T.js";
7
7
  import "./chunk-TT6LDJU5.js";
8
8
  import "./chunk-LBGHZLLH.js";
@@ -200,4 +200,4 @@ async function runServe(options) {
200
200
  export {
201
201
  runServe
202
202
  };
203
- //# sourceMappingURL=serve-J5POPC5Z.js.map
203
+ //# sourceMappingURL=serve-LAAYCXXI.js.map
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createServer,
3
3
  createServerHandle
4
- } from "../chunk-LS3FQ4UQ.js";
5
- import "../chunk-XIBT7GFC.js";
4
+ } from "../chunk-FZ5LNBZS.js";
5
+ import "../chunk-V234MYXB.js";
6
6
  import "../chunk-ULZORR3T.js";
7
7
  import "../chunk-TT6LDJU5.js";
8
8
  import "../chunk-LBGHZLLH.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createWebSocketServer,
3
3
  signalMcpReady
4
- } from "./chunk-XIBT7GFC.js";
4
+ } from "./chunk-V234MYXB.js";
5
5
  import "./chunk-ULZORR3T.js";
6
6
  import "./chunk-TT6LDJU5.js";
7
7
  import "./chunk-LBGHZLLH.js";
@@ -35,4 +35,4 @@ export {
35
35
  createWebSocketServer,
36
36
  signalMcpReady
37
37
  };
38
- //# sourceMappingURL=server-NJ56QOTU.js.map
38
+ //# sourceMappingURL=server-GVQNOHX3.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openfox",
3
- "version": "2.0.42",
3
+ "version": "2.0.43",
4
4
  "description": "Local-LLM-first agentic coding assistant",
5
5
  "type": "module",
6
6
  "bin": {