openfox 1.6.100 → 1.6.102

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 (32) hide show
  1. package/dist/{auto-compaction-NLUAT562.js → auto-compaction-7LMAY5JV.js} +7 -7
  2. package/dist/{chat-handler-5KT442LF.js → chat-handler-ZJVIM7U4.js} +10 -10
  3. package/dist/{chunk-DCYDTDWO.js → chunk-6WZI6F6G.js} +20 -4
  4. package/dist/{chunk-VMRDLSNP.js → chunk-AI3CY7T6.js} +3 -3
  5. package/dist/{chunk-IB3TCZF7.js → chunk-IZC2EZ4D.js} +4 -4
  6. package/dist/{chunk-BZBT5VJL.js → chunk-J335KZ6U.js} +4 -3
  7. package/dist/{chunk-X3GA33UG.js → chunk-MEYDERUX.js} +1 -1
  8. package/dist/{chunk-Y532ULQ2.js → chunk-PDPXHSNZ.js} +7 -5
  9. package/dist/{chunk-TYIHIHJF.js → chunk-PSJIT5LZ.js} +3 -1
  10. package/dist/{chunk-MEOKWBXX.js → chunk-RCQOHFAN.js} +10 -6
  11. package/dist/{chunk-PFSOVCEN.js → chunk-RYEZ7LDX.js} +74 -13
  12. package/dist/{chunk-KOQOPNE5.js → chunk-ZPCJLFAG.js} +187 -50
  13. package/dist/cli/dev.js +1 -1
  14. package/dist/cli/index.js +1 -1
  15. package/dist/{events-QBKF32WS.js → events-OKTZRT3Y.js} +3 -3
  16. package/dist/{folding-EQPDQKQS.js → folding-Z3OMWNOE.js} +2 -2
  17. package/dist/{orchestrator-4GHZFEGT.js → orchestrator-5EYWRAZ2.js} +8 -8
  18. package/dist/package.json +3 -1
  19. package/dist/{processor-I3WKCUAE.js → processor-XJYCHNV6.js} +7 -7
  20. package/dist/{protocol-eKAFeMXn.d.ts → protocol-CdVNdXi8.d.ts} +6 -1
  21. package/dist/{protocol-GKGDN64O.js → protocol-TNC6MCJV.js} +3 -3
  22. package/dist/{serve-CJEAHPPU.js → serve-SGFEQ5N7.js} +9 -9
  23. package/dist/server/index.d.ts +10 -1
  24. package/dist/server/index.js +8 -8
  25. package/dist/{settings-4334IX63.js → settings-VRAOAPLA.js} +2 -2
  26. package/dist/shared/index.d.ts +2 -2
  27. package/dist/shared/index.js +1 -1
  28. package/dist/{tools-UBURWNND.js → tools-WFIYKFBE.js} +7 -7
  29. package/dist/web/assets/{index-DzlTckHS.js → index-DcGVOFte.js} +61 -61
  30. package/dist/web/index.html +1 -1
  31. package/dist/web/sw.js +1 -1
  32. package/package.json +3 -1
@@ -2,11 +2,13 @@ import {
2
2
  createVerifierNudgeConfig,
3
3
  runBuilderTurn,
4
4
  runChatTurn
5
- } from "./chunk-Y532ULQ2.js";
5
+ } from "./chunk-PDPXHSNZ.js";
6
6
  import {
7
7
  TurnMetrics,
8
8
  agentExists,
9
+ buildTopLevelSystemPrompt,
9
10
  checkAborted,
11
+ computeDynamicContextHash,
10
12
  createMessageStartEvent,
11
13
  createToolRegistry,
12
14
  deleteAgent,
@@ -18,9 +20,12 @@ import {
18
20
  executeSubAgent,
19
21
  findAgentById,
20
22
  findSkillById,
23
+ getAllInstructions,
21
24
  getDefaultAgentIds,
22
25
  getDefaultIds,
23
26
  getDefaultSkillIds,
27
+ getEnabledSkillMetadata,
28
+ getSubAgents,
24
29
  getToolRegistryForAgent,
25
30
  getTopLevelAgents,
26
31
  isDefaultAgent,
@@ -46,7 +51,7 @@ import {
46
51
  saveSkillToProject,
47
52
  skillExists,
48
53
  spawnShellProcess
49
- } from "./chunk-PFSOVCEN.js";
54
+ } from "./chunk-RYEZ7LDX.js";
50
55
  import {
51
56
  getProject
52
57
  } from "./chunk-XAMAYRDA.js";
@@ -95,14 +100,14 @@ import {
95
100
  updateSessionMetadata,
96
101
  updateSessionProvider,
97
102
  updateSessionRunning
98
- } from "./chunk-BZBT5VJL.js";
103
+ } from "./chunk-J335KZ6U.js";
99
104
  import {
100
105
  initDatabase
101
106
  } from "./chunk-FBGWG4N6.js";
102
107
  import {
103
108
  buildMessagesFromStoredEvents,
104
109
  foldPendingConfirmations
105
- } from "./chunk-DCYDTDWO.js";
110
+ } from "./chunk-6WZI6F6G.js";
106
111
  import {
107
112
  createChatErrorMessage,
108
113
  createChatMessageMessage,
@@ -117,7 +122,7 @@ import {
117
122
  parseClientMessage,
118
123
  serializeServerMessage,
119
124
  storedEventToServerMessage
120
- } from "./chunk-MEOKWBXX.js";
125
+ } from "./chunk-RCQOHFAN.js";
121
126
  import {
122
127
  EventEmitter,
123
128
  provideAnswer
@@ -127,7 +132,7 @@ import {
127
132
  } from "./chunk-VUQCQXXJ.js";
128
133
  import {
129
134
  createServerMessage
130
- } from "./chunk-X3GA33UG.js";
135
+ } from "./chunk-MEYDERUX.js";
131
136
  import {
132
137
  getGlobalConfigDir
133
138
  } from "./chunk-CQGTEGKL.js";
@@ -1286,6 +1291,7 @@ function createMockLLMClient() {
1286
1291
  // src/server/ws/server.ts
1287
1292
  import { WebSocketServer, WebSocket as WebSocket2 } from "ws";
1288
1293
  import { spawn as spawn2 } from "child_process";
1294
+ import { createHash as createHash2 } from "crypto";
1289
1295
 
1290
1296
  // src/server/ws/terminal.ts
1291
1297
  import WebSocket from "ws";
@@ -2320,6 +2326,9 @@ function moduleGitBranch(cwd) {
2320
2326
  proc.on("error", () => resolve3(null));
2321
2327
  });
2322
2328
  }
2329
+ function hashContent(content) {
2330
+ return createHash2("sha256").update(content).digest("hex");
2331
+ }
2323
2332
  function moduleGitDiff(cwd) {
2324
2333
  return new Promise((resolve3) => {
2325
2334
  const proc = spawn2("git", ["diff", "--stat", "--numstat", "--format=", "HEAD"], {
@@ -2347,17 +2356,7 @@ function moduleGitDiff(cwd) {
2347
2356
  resolve3({ hash: "", files: [] });
2348
2357
  return;
2349
2358
  }
2350
- const hashProc = spawn2("git", ["rev-parse", "HEAD"], { cwd, stdio: ["ignore", "pipe", "ignore"] });
2351
- let hash = "";
2352
- hashProc.stdout.on("data", (data) => {
2353
- hash += data.toString();
2354
- });
2355
- hashProc.on("close", (hCode) => {
2356
- if (hCode !== 0) hash = "";
2357
- });
2358
- hashProc.on("error", () => {
2359
- hash = "";
2360
- });
2359
+ const hash = hashContent(diffStdout + statusStdout);
2361
2360
  const files = [];
2362
2361
  for (const line of diffStdout.split("\n")) {
2363
2362
  if (!line) continue;
@@ -2384,7 +2383,7 @@ function moduleGitDiff(cwd) {
2384
2383
  deletions: 0
2385
2384
  });
2386
2385
  }
2387
- resolve3({ hash: hash.trim(), files });
2386
+ resolve3({ hash, files });
2388
2387
  };
2389
2388
  proc.on("close", (code) => {
2390
2389
  procExited = true;
@@ -2406,7 +2405,7 @@ function moduleGitDiff(cwd) {
2406
2405
  }
2407
2406
  var moduleWorkdirLastHash = /* @__PURE__ */ new Map();
2408
2407
  var moduleWorkdirInterval = /* @__PURE__ */ new Map();
2409
- var gitPollInterval = 1e4;
2408
+ var gitPollInterval = parseInt(process.env["OPENFOX_GIT_POLL_INTERVAL"] ?? "", 10) || 1e4;
2410
2409
  var moduleClients = null;
2411
2410
  var moduleEnqueueSend = null;
2412
2411
  function moduleGitPoll(workdir) {
@@ -2887,9 +2886,34 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
2887
2886
  if (branch) moduleStartGitPolling(session.workdir);
2888
2887
  }
2889
2888
  ensureEventStoreSubscription(session.id);
2890
- const contextState = sessionManager.getContextState(session.id);
2891
- send(createContextStateMessage(contextState));
2892
2889
  send({ type: "ack", payload: { sessionId: session.id }, id: message.id });
2890
+ const sendContextState = () => {
2891
+ const contextState = sessionManager.getContextState(session.id);
2892
+ send(createContextStateMessage(contextState));
2893
+ };
2894
+ sendContextState();
2895
+ const cachedHash = sessionManager.getCachedPrompt(session.id)?.hash;
2896
+ if (cachedHash) {
2897
+ ;
2898
+ (async () => {
2899
+ try {
2900
+ const { content: instructionContent } = await getAllInstructions(session.workdir, session.projectId);
2901
+ const runtimeConfig = getRuntimeConfig();
2902
+ const configDir = getGlobalConfigDir(runtimeConfig.mode ?? "production");
2903
+ const skills = await getEnabledSkillMetadata(configDir, runtimeConfig.workdir);
2904
+ const dynamicInputs = JSON.stringify({
2905
+ instructions: instructionContent,
2906
+ skills: skills.map((s) => s.id).sort()
2907
+ });
2908
+ const currentHash = createHash2("sha256").update(dynamicInputs).digest("hex");
2909
+ if (currentHash !== cachedHash) {
2910
+ sessionManager.setDynamicContextChanged(session.id, true);
2911
+ sendContextState();
2912
+ }
2913
+ } catch {
2914
+ }
2915
+ })();
2916
+ }
2893
2917
  break;
2894
2918
  }
2895
2919
  // =========================================================================
@@ -2939,6 +2963,88 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
2939
2963
  })();
2940
2964
  break;
2941
2965
  }
2966
+ case "context.checkDynamic": {
2967
+ if (!client.activeSessionId) {
2968
+ send(createErrorMessage("NO_SESSION", "No active session", message.id));
2969
+ return;
2970
+ }
2971
+ const sessionId = client.activeSessionId;
2972
+ const session = sessionManager.requireSession(sessionId);
2973
+ (async () => {
2974
+ try {
2975
+ const { content: instructionContent } = await getAllInstructions(session.workdir, session.projectId);
2976
+ const runtimeConfig = getRuntimeConfig();
2977
+ const configDir = getGlobalConfigDir(runtimeConfig.mode ?? "production");
2978
+ const skills = await getEnabledSkillMetadata(configDir, runtimeConfig.workdir);
2979
+ const currentHash = computeDynamicContextHash(instructionContent, skills);
2980
+ const cachedHash = sessionManager.getCachedPrompt(sessionId)?.hash;
2981
+ if (cachedHash) {
2982
+ if (currentHash !== cachedHash) {
2983
+ if (!sessionManager.getDynamicContextChanged(sessionId)) {
2984
+ sessionManager.setDynamicContextChanged(sessionId, true);
2985
+ const newContextState = sessionManager.getContextState(sessionId);
2986
+ sendForSession(sessionId, createContextStateMessage(newContextState));
2987
+ }
2988
+ } else if (sessionManager.getDynamicContextChanged(sessionId)) {
2989
+ sessionManager.setDynamicContextChanged(sessionId, false);
2990
+ const newContextState = sessionManager.getContextState(sessionId);
2991
+ sendForSession(sessionId, createContextStateMessage(newContextState));
2992
+ }
2993
+ }
2994
+ send({ type: "ack", payload: {}, id: message.id });
2995
+ } catch (error) {
2996
+ logger.error("Failed to check dynamic context", { error, sessionId });
2997
+ send({ type: "ack", payload: {}, id: message.id });
2998
+ }
2999
+ })();
3000
+ break;
3001
+ }
3002
+ case "context.applyDynamic": {
3003
+ if (!client.activeSessionId) {
3004
+ send(createErrorMessage("NO_SESSION", "No active session", message.id));
3005
+ return;
3006
+ }
3007
+ const sessionId = client.activeSessionId;
3008
+ const session = sessionManager.requireSession(sessionId);
3009
+ if (session.isRunning) {
3010
+ send(createErrorMessage("SESSION_RUNNING", "Cannot apply dynamic context while session is running", message.id));
3011
+ return;
3012
+ }
3013
+ ;
3014
+ (async () => {
3015
+ try {
3016
+ const { content: instructionContent } = await getAllInstructions(session.workdir, session.projectId);
3017
+ const runtimeConfig = getRuntimeConfig();
3018
+ const configDir = getGlobalConfigDir(runtimeConfig.mode ?? "production");
3019
+ const skills = await getEnabledSkillMetadata(configDir, runtimeConfig.workdir);
3020
+ const dynamicHash = computeDynamicContextHash(instructionContent, skills);
3021
+ const allAgents = await loadAllAgentsDefault();
3022
+ const subAgentDefs = getSubAgents(allAgents);
3023
+ const systemPrompt = buildTopLevelSystemPrompt(
3024
+ session.workdir,
3025
+ instructionContent || void 0,
3026
+ skills,
3027
+ subAgentDefs
3028
+ );
3029
+ sessionManager.setCachedPrompt(sessionId, systemPrompt, dynamicHash);
3030
+ sessionManager.setDynamicContextChanged(sessionId, false);
3031
+ const newContextState = sessionManager.getContextState(sessionId);
3032
+ sendForSession(sessionId, createContextStateMessage(newContextState));
3033
+ send({ type: "ack", payload: {}, id: message.id });
3034
+ } catch (error) {
3035
+ logger.error("Failed to apply dynamic context", { error, sessionId });
3036
+ sendForSession(
3037
+ sessionId,
3038
+ createChatErrorMessage(
3039
+ `Failed to apply dynamic context: ${error instanceof Error ? error.message : "Unknown error"}`,
3040
+ true
3041
+ )
3042
+ );
3043
+ send({ type: "ack", payload: {}, id: message.id });
3044
+ }
3045
+ })();
3046
+ break;
3047
+ }
2942
3048
  // =========================================================================
2943
3049
  // Runner (Auto-Loop)
2944
3050
  // =========================================================================
@@ -4117,6 +4223,8 @@ var SessionManager = class {
4117
4223
  events = new EventEmitter();
4118
4224
  activeSessionId = null;
4119
4225
  providerManager;
4226
+ cachedPromptStore = /* @__PURE__ */ new Map();
4227
+ dynamicContextChangedStore = /* @__PURE__ */ new Map();
4120
4228
  constructor(providerManager) {
4121
4229
  this.providerManager = providerManager;
4122
4230
  }
@@ -4454,6 +4562,7 @@ ${summary}`, {
4454
4562
  const state = getSessionState(sessionId, this.providerManager.getCurrentModelContext());
4455
4563
  const maxTokens = this.providerManager.getCurrentModelContext();
4456
4564
  const compactionCount = state?.contextState.compactionCount ?? 0;
4565
+ const dynamicContextChanged = this.getDynamicContextChanged(sessionId);
4457
4566
  emitContextState(
4458
4567
  sessionId,
4459
4568
  promptTokens,
@@ -4461,7 +4570,8 @@ ${summary}`, {
4461
4570
  compactionCount,
4462
4571
  isInDangerZone(promptTokens, maxTokens),
4463
4572
  canCompact(promptTokens, maxTokens),
4464
- subAgentId
4573
+ subAgentId,
4574
+ dynamicContextChanged
4465
4575
  );
4466
4576
  logger.debug("Context state updated", { sessionId, promptTokens, maxTokens, subAgentId });
4467
4577
  }
@@ -4674,6 +4784,18 @@ ${summary}`, {
4674
4784
  updateExecutionState(sessionId, updates) {
4675
4785
  logger.debug("updateExecutionState called", { sessionId, updates });
4676
4786
  }
4787
+ setCachedPrompt(sessionId, systemPrompt, hash) {
4788
+ this.cachedPromptStore.set(sessionId, { systemPrompt, hash });
4789
+ }
4790
+ getCachedPrompt(sessionId) {
4791
+ return this.cachedPromptStore.get(sessionId);
4792
+ }
4793
+ setDynamicContextChanged(sessionId, changed) {
4794
+ this.dynamicContextChangedStore.set(sessionId, changed);
4795
+ }
4796
+ getDynamicContextChanged(sessionId) {
4797
+ return this.dynamicContextChangedStore.get(sessionId) ?? false;
4798
+ }
4677
4799
  /**
4678
4800
  * @deprecated Use addMessage + compactContext instead
4679
4801
  */
@@ -4728,16 +4850,18 @@ ${summary}`,
4728
4850
  maxTokens = providerManager.getCurrentModelContext();
4729
4851
  }
4730
4852
  const state = getSessionState(sessionId, maxTokens);
4853
+ const dynamicContextChanged = this.getDynamicContextChanged(sessionId);
4731
4854
  if (!state) {
4732
4855
  return {
4733
4856
  currentTokens: 0,
4734
4857
  maxTokens,
4735
4858
  compactionCount: 0,
4736
4859
  dangerZone: false,
4737
- canCompact: false
4860
+ canCompact: false,
4861
+ dynamicContextChanged
4738
4862
  };
4739
4863
  }
4740
- return state.contextState;
4864
+ return { ...state.contextState, dynamicContextChanged };
4741
4865
  }
4742
4866
  // ============================================================================
4743
4867
  // LSP Manager
@@ -4819,6 +4943,17 @@ ${summary}`,
4819
4943
  return msg;
4820
4944
  });
4821
4945
  const isRunning = dbSession.isRunning;
4946
+ const hasCachedPrompt = this.cachedPromptStore.has(dbSession.id);
4947
+ const cachedData = this.cachedPromptStore.get(dbSession.id);
4948
+ if (!hasCachedPrompt && eventState.cachedSystemPrompt && eventState.dynamicContextHash) {
4949
+ this.cachedPromptStore.set(dbSession.id, {
4950
+ systemPrompt: eventState.cachedSystemPrompt,
4951
+ hash: eventState.dynamicContextHash
4952
+ });
4953
+ }
4954
+ if (!this.dynamicContextChangedStore.has(dbSession.id) && eventState.contextState.dynamicContextChanged) {
4955
+ this.dynamicContextChangedStore.set(dbSession.id, true);
4956
+ }
4822
4957
  return {
4823
4958
  ...dbSession,
4824
4959
  mode: eventState.mode,
@@ -4828,8 +4963,10 @@ ${summary}`,
4828
4963
  criteria: eventState.criteria,
4829
4964
  contextWindows: [],
4830
4965
  // Derived from events, not stored separately
4831
- executionState: eventState.lastModeWithReminder ? {
4832
- lastModeWithReminder: eventState.lastModeWithReminder
4966
+ executionState: eventState.lastModeWithReminder || eventState.cachedSystemPrompt || hasCachedPrompt ? {
4967
+ lastModeWithReminder: eventState.lastModeWithReminder,
4968
+ cachedSystemPrompt: cachedData?.systemPrompt ?? eventState.cachedSystemPrompt,
4969
+ dynamicContextHash: cachedData?.hash ?? eventState.dynamicContextHash
4833
4970
  } : null
4834
4971
  };
4835
4972
  }
@@ -5371,7 +5508,7 @@ import { Router as Router6 } from "express";
5371
5508
  import { spawn as spawn4 } from "child_process";
5372
5509
 
5373
5510
  // src/constants.ts
5374
- var VERSION = "1.6.100";
5511
+ var VERSION = "1.6.102";
5375
5512
 
5376
5513
  // src/server/routes/auto-update.ts
5377
5514
  var updateInProgress = false;
@@ -5668,7 +5805,7 @@ async function createServerHandle(config4) {
5668
5805
  res.json({ project });
5669
5806
  });
5670
5807
  app.get("/api/sessions", async (req, res) => {
5671
- const { getRecentUserPromptsForSession } = await import("./events-QBKF32WS.js");
5808
+ const { getRecentUserPromptsForSession } = await import("./events-OKTZRT3Y.js");
5672
5809
  const projectId = req.query["projectId"];
5673
5810
  const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
5674
5811
  const offset = parseInt(req.query["offset"]) || 0;
@@ -5701,8 +5838,8 @@ async function createServerHandle(config4) {
5701
5838
  res.status(201).json({ session });
5702
5839
  });
5703
5840
  app.get("/api/sessions/:id", async (req, res) => {
5704
- const { getEventStore: getEventStore2 } = await import("./events-QBKF32WS.js");
5705
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-EQPDQKQS.js");
5841
+ const { getEventStore: getEventStore2 } = await import("./events-OKTZRT3Y.js");
5842
+ const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-Z3OMWNOE.js");
5706
5843
  const session = sessionManager.getSession(req.params.id);
5707
5844
  if (!session) {
5708
5845
  return res.status(404).json({ error: "Session not found" });
@@ -5732,8 +5869,8 @@ async function createServerHandle(config4) {
5732
5869
  res.json({ success: true });
5733
5870
  });
5734
5871
  app.post("/api/sessions/:id/provider", async (req, res) => {
5735
- const { getEventStore: getEventStore2 } = await import("./events-QBKF32WS.js");
5736
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-EQPDQKQS.js");
5872
+ const { getEventStore: getEventStore2 } = await import("./events-OKTZRT3Y.js");
5873
+ const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-Z3OMWNOE.js");
5737
5874
  const sessionId = req.params.id;
5738
5875
  const session = sessionManager.getSession(sessionId);
5739
5876
  if (!session) {
@@ -5770,8 +5907,8 @@ async function createServerHandle(config4) {
5770
5907
  res.json({ success: true });
5771
5908
  });
5772
5909
  app.put("/api/sessions/:id/mode", async (req, res) => {
5773
- const { getEventStore: getEventStore2 } = await import("./events-QBKF32WS.js");
5774
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-EQPDQKQS.js");
5910
+ const { getEventStore: getEventStore2 } = await import("./events-OKTZRT3Y.js");
5911
+ const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-Z3OMWNOE.js");
5775
5912
  const sessionId = req.params.id;
5776
5913
  const session = sessionManager.getSession(sessionId);
5777
5914
  if (!session) {
@@ -5827,14 +5964,14 @@ async function createServerHandle(config4) {
5827
5964
  if (!callId || approved === void 0) {
5828
5965
  return res.status(400).json({ error: "callId and approved are required" });
5829
5966
  }
5830
- const { providePathConfirmation } = await import("./tools-UBURWNND.js");
5967
+ const { providePathConfirmation } = await import("./tools-WFIYKFBE.js");
5831
5968
  const result = providePathConfirmation(callId, approved, alwaysAllow);
5832
5969
  if (!result.found) {
5833
5970
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
5834
5971
  }
5835
- const { getEventStore: getEventStore2 } = await import("./events-QBKF32WS.js");
5836
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-EQPDQKQS.js");
5837
- const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-GKGDN64O.js");
5972
+ const { getEventStore: getEventStore2 } = await import("./events-OKTZRT3Y.js");
5973
+ const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-Z3OMWNOE.js");
5974
+ const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-TNC6MCJV.js");
5838
5975
  const eventStore = getEventStore2();
5839
5976
  const events = eventStore.getEvents(sessionId);
5840
5977
  const messages = buildMessagesFromStoredEvents2(events);
@@ -5851,7 +5988,7 @@ async function createServerHandle(config4) {
5851
5988
  if (!callId || !answer) {
5852
5989
  return res.status(400).json({ error: "callId and answer are required" });
5853
5990
  }
5854
- const { provideAnswer: provideAnswer2 } = await import("./tools-UBURWNND.js");
5991
+ const { provideAnswer: provideAnswer2 } = await import("./tools-WFIYKFBE.js");
5855
5992
  const found = provideAnswer2(callId, answer);
5856
5993
  if (!found) {
5857
5994
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -5887,14 +6024,14 @@ async function createServerHandle(config4) {
5887
6024
  if (!session) {
5888
6025
  return res.status(404).json({ error: "Session not found" });
5889
6026
  }
5890
- const { stopSessionExecution } = await import("./chat-handler-5KT442LF.js");
5891
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-UBURWNND.js");
6027
+ const { stopSessionExecution } = await import("./chat-handler-ZJVIM7U4.js");
6028
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-WFIYKFBE.js");
5892
6029
  stopSessionExecution(sessionId, sessionManager);
5893
6030
  abortSession(sessionId);
5894
6031
  cancelQuestionsForSession(sessionId, "Session stopped by user");
5895
6032
  cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
5896
6033
  sessionManager.clearMessageQueue(sessionId);
5897
- const eventStore = (await import("./events-QBKF32WS.js")).getEventStore();
6034
+ const eventStore = (await import("./events-OKTZRT3Y.js")).getEventStore();
5898
6035
  eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
5899
6036
  res.json({ success: true });
5900
6037
  });
@@ -5908,7 +6045,7 @@ async function createServerHandle(config4) {
5908
6045
  if (typeof messageIndex !== "number" || messageIndex < 0) {
5909
6046
  return res.status(400).json({ error: "messageIndex must be a non-negative number" });
5910
6047
  }
5911
- const { truncateSessionMessages } = await import("./events-QBKF32WS.js");
6048
+ const { truncateSessionMessages } = await import("./events-OKTZRT3Y.js");
5912
6049
  truncateSessionMessages(sessionId, messageIndex);
5913
6050
  res.json({ success: true });
5914
6051
  });
@@ -5926,7 +6063,7 @@ async function createServerHandle(config4) {
5926
6063
  if (!msg) {
5927
6064
  return res.status(400).json({ error: "Message not found at this index" });
5928
6065
  }
5929
- const { truncateSessionMessages } = await import("./events-QBKF32WS.js");
6066
+ const { truncateSessionMessages } = await import("./events-OKTZRT3Y.js");
5930
6067
  truncateSessionMessages(sessionId, messageIndex - 1);
5931
6068
  sessionManager.queueMessage(sessionId, "asap", msg.content, msg.attachments, msg.messageKind);
5932
6069
  res.json({ success: true });
@@ -5958,7 +6095,7 @@ async function createServerHandle(config4) {
5958
6095
  res.json({ accepted: true });
5959
6096
  });
5960
6097
  app.get("/api/settings", async (req, res) => {
5961
- const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-4334IX63.js");
6098
+ const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-VRAOAPLA.js");
5962
6099
  const keysParam = req.query["keys"];
5963
6100
  if (!keysParam) {
5964
6101
  return res.status(400).json({ error: "keys query parameter is required" });
@@ -5971,19 +6108,19 @@ async function createServerHandle(config4) {
5971
6108
  res.json(result);
5972
6109
  });
5973
6110
  app.get("/api/settings/:key", async (req, res) => {
5974
- const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-4334IX63.js");
6111
+ const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-VRAOAPLA.js");
5975
6112
  const key = req.params.key;
5976
6113
  const value = getSetting(key) ?? SETTINGS_DEFAULTS[key] ?? null;
5977
6114
  res.json({ key, value });
5978
6115
  });
5979
6116
  app.get("/api/settings/:key", async (req, res) => {
5980
- const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-4334IX63.js");
6117
+ const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-VRAOAPLA.js");
5981
6118
  const key = req.params.key;
5982
6119
  const value = getSetting(key) ?? SETTINGS_DEFAULTS[key] ?? null;
5983
6120
  res.json({ key, value });
5984
6121
  });
5985
6122
  app.put("/api/settings/:key", async (req, res) => {
5986
- const { setSetting } = await import("./settings-4334IX63.js");
6123
+ const { setSetting } = await import("./settings-VRAOAPLA.js");
5987
6124
  const key = req.params.key;
5988
6125
  const { value } = req.body;
5989
6126
  if (value === void 0) {
@@ -6403,7 +6540,7 @@ async function createServerHandle(config4) {
6403
6540
  providerManager
6404
6541
  );
6405
6542
  const wss = wssExports.wss;
6406
- const { QueueProcessor } = await import("./processor-I3WKCUAE.js");
6543
+ const { QueueProcessor } = await import("./processor-XJYCHNV6.js");
6407
6544
  const queueProcessor = new QueueProcessor({
6408
6545
  sessionManager,
6409
6546
  providerManager,
@@ -6475,4 +6612,4 @@ export {
6475
6612
  createServerHandle,
6476
6613
  createServer
6477
6614
  };
6478
- //# sourceMappingURL=chunk-KOQOPNE5.js.map
6615
+ //# sourceMappingURL=chunk-ZPCJLFAG.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-VMRDLSNP.js";
4
+ } from "../chunk-AI3CY7T6.js";
5
5
  import {
6
6
  logger
7
7
  } from "../chunk-K44MW7JJ.js";
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-VMRDLSNP.js";
4
+ } from "../chunk-AI3CY7T6.js";
5
5
  import {
6
6
  logger
7
7
  } from "../chunk-K44MW7JJ.js";
@@ -37,7 +37,7 @@ import {
37
37
  isStoredEvent,
38
38
  isTurnEvent,
39
39
  truncateSessionMessages
40
- } from "./chunk-BZBT5VJL.js";
40
+ } from "./chunk-J335KZ6U.js";
41
41
  import "./chunk-FBGWG4N6.js";
42
42
  import {
43
43
  buildContextMessagesFromEventHistory,
@@ -55,7 +55,7 @@ import {
55
55
  foldTodos,
56
56
  foldTurnEventsToSnapshotMessages,
57
57
  getMessagesForWindow
58
- } from "./chunk-DCYDTDWO.js";
58
+ } from "./chunk-6WZI6F6G.js";
59
59
  import "./chunk-CGZHLM3K.js";
60
60
  import "./chunk-K44MW7JJ.js";
61
61
  export {
@@ -113,4 +113,4 @@ export {
113
113
  isTurnEvent,
114
114
  truncateSessionMessages
115
115
  };
116
- //# sourceMappingURL=events-QBKF32WS.js.map
116
+ //# sourceMappingURL=events-OKTZRT3Y.js.map
@@ -22,7 +22,7 @@ import {
22
22
  handleToolResult,
23
23
  spreadOptionalMessageFields,
24
24
  stripOrphanedToolCalls
25
- } from "./chunk-DCYDTDWO.js";
25
+ } from "./chunk-6WZI6F6G.js";
26
26
  export {
27
27
  buildContextMessagesFromEventHistory,
28
28
  buildContextMessagesFromMessages,
@@ -48,4 +48,4 @@ export {
48
48
  spreadOptionalMessageFields,
49
49
  stripOrphanedToolCalls
50
50
  };
51
- //# sourceMappingURL=folding-EQPDQKQS.js.map
51
+ //# sourceMappingURL=folding-Z3OMWNOE.js.map
@@ -3,7 +3,7 @@ import {
3
3
  runBuilderTurn,
4
4
  runChatTurn,
5
5
  runVerifierTurn
6
- } from "./chunk-Y532ULQ2.js";
6
+ } from "./chunk-PDPXHSNZ.js";
7
7
  import {
8
8
  TurnMetrics,
9
9
  createChatDoneEvent,
@@ -11,19 +11,19 @@ import {
11
11
  createMessageStartEvent,
12
12
  createToolCallEvent,
13
13
  createToolResultEvent
14
- } from "./chunk-PFSOVCEN.js";
15
- import "./chunk-TYIHIHJF.js";
14
+ } from "./chunk-RYEZ7LDX.js";
15
+ import "./chunk-PSJIT5LZ.js";
16
16
  import "./chunk-XAMAYRDA.js";
17
17
  import "./chunk-DL6ZILAF.js";
18
18
  import "./chunk-PBGOZMVY.js";
19
19
  import "./chunk-VRGRAQDG.js";
20
20
  import "./chunk-HGAMIPFO.js";
21
- import "./chunk-BZBT5VJL.js";
21
+ import "./chunk-J335KZ6U.js";
22
22
  import "./chunk-FBGWG4N6.js";
23
- import "./chunk-DCYDTDWO.js";
24
- import "./chunk-MEOKWBXX.js";
23
+ import "./chunk-6WZI6F6G.js";
24
+ import "./chunk-RCQOHFAN.js";
25
25
  import "./chunk-BJYPTN5S.js";
26
- import "./chunk-X3GA33UG.js";
26
+ import "./chunk-MEYDERUX.js";
27
27
  import "./chunk-CQGTEGKL.js";
28
28
  import "./chunk-CGZHLM3K.js";
29
29
  import "./chunk-SZKEGZIB.js";
@@ -40,4 +40,4 @@ export {
40
40
  runChatTurn,
41
41
  runVerifierTurn
42
42
  };
43
- //# sourceMappingURL=orchestrator-4GHZFEGT.js.map
43
+ //# sourceMappingURL=orchestrator-5EYWRAZ2.js.map
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openfox",
3
- "version": "1.6.100",
3
+ "version": "1.6.102",
4
4
  "description": "Local-LLM-first agentic coding assistant",
5
5
  "type": "module",
6
6
  "bin": {
@@ -116,8 +116,10 @@
116
116
  "concurrently": "^9.2.1",
117
117
  "dotenv": "^17.3.1",
118
118
  "eslint": "^10.1.0",
119
+ "happy-dom": "^20.10.2",
119
120
  "husky": "^9.1.7",
120
121
  "jscpd": "^4.0.9",
122
+ "jsdom": "^29.1.1",
121
123
  "lint-staged": "^16.4.0",
122
124
  "postcss": "^8.5.1",
123
125
  "prettier": "^3.8.1",
@@ -5,17 +5,17 @@ import {
5
5
  generateSessionName,
6
6
  getSessionMessageCount,
7
7
  needsNameGenerationCheck
8
- } from "./chunk-IB3TCZF7.js";
8
+ } from "./chunk-IZC2EZ4D.js";
9
9
  import {
10
10
  getEventStore
11
- } from "./chunk-BZBT5VJL.js";
11
+ } from "./chunk-J335KZ6U.js";
12
12
  import "./chunk-FBGWG4N6.js";
13
- import "./chunk-DCYDTDWO.js";
13
+ import "./chunk-6WZI6F6G.js";
14
14
  import {
15
15
  createChatMessageMessage,
16
16
  createSessionRunningMessage
17
- } from "./chunk-MEOKWBXX.js";
18
- import "./chunk-X3GA33UG.js";
17
+ } from "./chunk-RCQOHFAN.js";
18
+ import "./chunk-MEYDERUX.js";
19
19
  import "./chunk-CGZHLM3K.js";
20
20
  import {
21
21
  logger
@@ -177,7 +177,7 @@ var QueueProcessor = class {
177
177
  backend: provider?.backend ?? llmClient.getBackend(),
178
178
  model: llmClient.getModel()
179
179
  };
180
- const { runChatTurn } = await import("./orchestrator-4GHZFEGT.js");
180
+ const { runChatTurn } = await import("./orchestrator-5EYWRAZ2.js");
181
181
  const runChatTurnParams = buildRunChatTurnParams({
182
182
  sessionManager,
183
183
  sessionId,
@@ -221,4 +221,4 @@ var QueueProcessor = class {
221
221
  export {
222
222
  QueueProcessor
223
223
  };
224
- //# sourceMappingURL=processor-I3WKCUAE.js.map
224
+ //# sourceMappingURL=processor-XJYCHNV6.js.map