openfox 1.6.101 → 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-JSXVY2CJ.js → auto-compaction-7LMAY5JV.js} +7 -7
  2. package/dist/{chat-handler-45TB6QWI.js → chat-handler-ZJVIM7U4.js} +10 -10
  3. package/dist/{chunk-DCYDTDWO.js → chunk-6WZI6F6G.js} +20 -4
  4. package/dist/{chunk-L6LTCUCO.js → chunk-AI3CY7T6.js} +2 -2
  5. package/dist/{chunk-SBQ36AOQ.js → chunk-IZC2EZ4D.js} +4 -4
  6. package/dist/{chunk-MBLZSLPH.js → chunk-J335KZ6U.js} +4 -3
  7. package/dist/{chunk-UTBDR6KM.js → chunk-MEYDERUX.js} +1 -1
  8. package/dist/{chunk-NASF624P.js → chunk-PDPXHSNZ.js} +7 -5
  9. package/dist/{chunk-TYIHIHJF.js → chunk-PSJIT5LZ.js} +3 -1
  10. package/dist/{chunk-C5U6NRAY.js → chunk-RCQOHFAN.js} +2 -2
  11. package/dist/{chunk-5LYWA56Z.js → chunk-RYEZ7LDX.js} +60 -7
  12. package/dist/{chunk-SCAFZ75C.js → chunk-ZPCJLFAG.js} +180 -37
  13. package/dist/cli/dev.js +1 -1
  14. package/dist/cli/index.js +1 -1
  15. package/dist/{events-JP746DV3.js → events-OKTZRT3Y.js} +3 -3
  16. package/dist/{folding-EQPDQKQS.js → folding-Z3OMWNOE.js} +2 -2
  17. package/dist/{orchestrator-RRO2XLYZ.js → orchestrator-5EYWRAZ2.js} +8 -8
  18. package/dist/package.json +3 -1
  19. package/dist/{processor-C4KLV5SV.js → processor-XJYCHNV6.js} +7 -7
  20. package/dist/{protocol-BkFgSJVU.d.ts → protocol-CdVNdXi8.d.ts} +5 -1
  21. package/dist/{protocol-SVQYBN2X.js → protocol-TNC6MCJV.js} +3 -3
  22. package/dist/{serve-5B36ZPK3.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-AGVKG553.js → tools-WFIYKFBE.js} +7 -7
  29. package/dist/web/assets/{index-Du9Uz0qZ.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-NASF624P.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-5LYWA56Z.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-MBLZSLPH.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-C5U6NRAY.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-UTBDR6KM.js";
135
+ } from "./chunk-MEYDERUX.js";
131
136
  import {
132
137
  getGlobalConfigDir
133
138
  } from "./chunk-CQGTEGKL.js";
@@ -2881,9 +2886,34 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
2881
2886
  if (branch) moduleStartGitPolling(session.workdir);
2882
2887
  }
2883
2888
  ensureEventStoreSubscription(session.id);
2884
- const contextState = sessionManager.getContextState(session.id);
2885
- send(createContextStateMessage(contextState));
2886
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
+ }
2887
2917
  break;
2888
2918
  }
2889
2919
  // =========================================================================
@@ -2933,6 +2963,88 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
2933
2963
  })();
2934
2964
  break;
2935
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
+ }
2936
3048
  // =========================================================================
2937
3049
  // Runner (Auto-Loop)
2938
3050
  // =========================================================================
@@ -4111,6 +4223,8 @@ var SessionManager = class {
4111
4223
  events = new EventEmitter();
4112
4224
  activeSessionId = null;
4113
4225
  providerManager;
4226
+ cachedPromptStore = /* @__PURE__ */ new Map();
4227
+ dynamicContextChangedStore = /* @__PURE__ */ new Map();
4114
4228
  constructor(providerManager) {
4115
4229
  this.providerManager = providerManager;
4116
4230
  }
@@ -4448,6 +4562,7 @@ ${summary}`, {
4448
4562
  const state = getSessionState(sessionId, this.providerManager.getCurrentModelContext());
4449
4563
  const maxTokens = this.providerManager.getCurrentModelContext();
4450
4564
  const compactionCount = state?.contextState.compactionCount ?? 0;
4565
+ const dynamicContextChanged = this.getDynamicContextChanged(sessionId);
4451
4566
  emitContextState(
4452
4567
  sessionId,
4453
4568
  promptTokens,
@@ -4455,7 +4570,8 @@ ${summary}`, {
4455
4570
  compactionCount,
4456
4571
  isInDangerZone(promptTokens, maxTokens),
4457
4572
  canCompact(promptTokens, maxTokens),
4458
- subAgentId
4573
+ subAgentId,
4574
+ dynamicContextChanged
4459
4575
  );
4460
4576
  logger.debug("Context state updated", { sessionId, promptTokens, maxTokens, subAgentId });
4461
4577
  }
@@ -4668,6 +4784,18 @@ ${summary}`, {
4668
4784
  updateExecutionState(sessionId, updates) {
4669
4785
  logger.debug("updateExecutionState called", { sessionId, updates });
4670
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
+ }
4671
4799
  /**
4672
4800
  * @deprecated Use addMessage + compactContext instead
4673
4801
  */
@@ -4722,16 +4850,18 @@ ${summary}`,
4722
4850
  maxTokens = providerManager.getCurrentModelContext();
4723
4851
  }
4724
4852
  const state = getSessionState(sessionId, maxTokens);
4853
+ const dynamicContextChanged = this.getDynamicContextChanged(sessionId);
4725
4854
  if (!state) {
4726
4855
  return {
4727
4856
  currentTokens: 0,
4728
4857
  maxTokens,
4729
4858
  compactionCount: 0,
4730
4859
  dangerZone: false,
4731
- canCompact: false
4860
+ canCompact: false,
4861
+ dynamicContextChanged
4732
4862
  };
4733
4863
  }
4734
- return state.contextState;
4864
+ return { ...state.contextState, dynamicContextChanged };
4735
4865
  }
4736
4866
  // ============================================================================
4737
4867
  // LSP Manager
@@ -4813,6 +4943,17 @@ ${summary}`,
4813
4943
  return msg;
4814
4944
  });
4815
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
+ }
4816
4957
  return {
4817
4958
  ...dbSession,
4818
4959
  mode: eventState.mode,
@@ -4822,8 +4963,10 @@ ${summary}`,
4822
4963
  criteria: eventState.criteria,
4823
4964
  contextWindows: [],
4824
4965
  // Derived from events, not stored separately
4825
- executionState: eventState.lastModeWithReminder ? {
4826
- 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
4827
4970
  } : null
4828
4971
  };
4829
4972
  }
@@ -5365,7 +5508,7 @@ import { Router as Router6 } from "express";
5365
5508
  import { spawn as spawn4 } from "child_process";
5366
5509
 
5367
5510
  // src/constants.ts
5368
- var VERSION = "1.6.101";
5511
+ var VERSION = "1.6.102";
5369
5512
 
5370
5513
  // src/server/routes/auto-update.ts
5371
5514
  var updateInProgress = false;
@@ -5662,7 +5805,7 @@ async function createServerHandle(config4) {
5662
5805
  res.json({ project });
5663
5806
  });
5664
5807
  app.get("/api/sessions", async (req, res) => {
5665
- const { getRecentUserPromptsForSession } = await import("./events-JP746DV3.js");
5808
+ const { getRecentUserPromptsForSession } = await import("./events-OKTZRT3Y.js");
5666
5809
  const projectId = req.query["projectId"];
5667
5810
  const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
5668
5811
  const offset = parseInt(req.query["offset"]) || 0;
@@ -5695,8 +5838,8 @@ async function createServerHandle(config4) {
5695
5838
  res.status(201).json({ session });
5696
5839
  });
5697
5840
  app.get("/api/sessions/:id", async (req, res) => {
5698
- const { getEventStore: getEventStore2 } = await import("./events-JP746DV3.js");
5699
- 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");
5700
5843
  const session = sessionManager.getSession(req.params.id);
5701
5844
  if (!session) {
5702
5845
  return res.status(404).json({ error: "Session not found" });
@@ -5726,8 +5869,8 @@ async function createServerHandle(config4) {
5726
5869
  res.json({ success: true });
5727
5870
  });
5728
5871
  app.post("/api/sessions/:id/provider", async (req, res) => {
5729
- const { getEventStore: getEventStore2 } = await import("./events-JP746DV3.js");
5730
- 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");
5731
5874
  const sessionId = req.params.id;
5732
5875
  const session = sessionManager.getSession(sessionId);
5733
5876
  if (!session) {
@@ -5764,8 +5907,8 @@ async function createServerHandle(config4) {
5764
5907
  res.json({ success: true });
5765
5908
  });
5766
5909
  app.put("/api/sessions/:id/mode", async (req, res) => {
5767
- const { getEventStore: getEventStore2 } = await import("./events-JP746DV3.js");
5768
- 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");
5769
5912
  const sessionId = req.params.id;
5770
5913
  const session = sessionManager.getSession(sessionId);
5771
5914
  if (!session) {
@@ -5821,14 +5964,14 @@ async function createServerHandle(config4) {
5821
5964
  if (!callId || approved === void 0) {
5822
5965
  return res.status(400).json({ error: "callId and approved are required" });
5823
5966
  }
5824
- const { providePathConfirmation } = await import("./tools-AGVKG553.js");
5967
+ const { providePathConfirmation } = await import("./tools-WFIYKFBE.js");
5825
5968
  const result = providePathConfirmation(callId, approved, alwaysAllow);
5826
5969
  if (!result.found) {
5827
5970
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
5828
5971
  }
5829
- const { getEventStore: getEventStore2 } = await import("./events-JP746DV3.js");
5830
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations: foldPendingConfirmations2 } = await import("./folding-EQPDQKQS.js");
5831
- const { createSessionStateMessage: createSessionStateMessage2 } = await import("./protocol-SVQYBN2X.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");
5832
5975
  const eventStore = getEventStore2();
5833
5976
  const events = eventStore.getEvents(sessionId);
5834
5977
  const messages = buildMessagesFromStoredEvents2(events);
@@ -5845,7 +5988,7 @@ async function createServerHandle(config4) {
5845
5988
  if (!callId || !answer) {
5846
5989
  return res.status(400).json({ error: "callId and answer are required" });
5847
5990
  }
5848
- const { provideAnswer: provideAnswer2 } = await import("./tools-AGVKG553.js");
5991
+ const { provideAnswer: provideAnswer2 } = await import("./tools-WFIYKFBE.js");
5849
5992
  const found = provideAnswer2(callId, answer);
5850
5993
  if (!found) {
5851
5994
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -5881,14 +6024,14 @@ async function createServerHandle(config4) {
5881
6024
  if (!session) {
5882
6025
  return res.status(404).json({ error: "Session not found" });
5883
6026
  }
5884
- const { stopSessionExecution } = await import("./chat-handler-45TB6QWI.js");
5885
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-AGVKG553.js");
6027
+ const { stopSessionExecution } = await import("./chat-handler-ZJVIM7U4.js");
6028
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-WFIYKFBE.js");
5886
6029
  stopSessionExecution(sessionId, sessionManager);
5887
6030
  abortSession(sessionId);
5888
6031
  cancelQuestionsForSession(sessionId, "Session stopped by user");
5889
6032
  cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
5890
6033
  sessionManager.clearMessageQueue(sessionId);
5891
- const eventStore = (await import("./events-JP746DV3.js")).getEventStore();
6034
+ const eventStore = (await import("./events-OKTZRT3Y.js")).getEventStore();
5892
6035
  eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
5893
6036
  res.json({ success: true });
5894
6037
  });
@@ -5902,7 +6045,7 @@ async function createServerHandle(config4) {
5902
6045
  if (typeof messageIndex !== "number" || messageIndex < 0) {
5903
6046
  return res.status(400).json({ error: "messageIndex must be a non-negative number" });
5904
6047
  }
5905
- const { truncateSessionMessages } = await import("./events-JP746DV3.js");
6048
+ const { truncateSessionMessages } = await import("./events-OKTZRT3Y.js");
5906
6049
  truncateSessionMessages(sessionId, messageIndex);
5907
6050
  res.json({ success: true });
5908
6051
  });
@@ -5920,7 +6063,7 @@ async function createServerHandle(config4) {
5920
6063
  if (!msg) {
5921
6064
  return res.status(400).json({ error: "Message not found at this index" });
5922
6065
  }
5923
- const { truncateSessionMessages } = await import("./events-JP746DV3.js");
6066
+ const { truncateSessionMessages } = await import("./events-OKTZRT3Y.js");
5924
6067
  truncateSessionMessages(sessionId, messageIndex - 1);
5925
6068
  sessionManager.queueMessage(sessionId, "asap", msg.content, msg.attachments, msg.messageKind);
5926
6069
  res.json({ success: true });
@@ -5952,7 +6095,7 @@ async function createServerHandle(config4) {
5952
6095
  res.json({ accepted: true });
5953
6096
  });
5954
6097
  app.get("/api/settings", async (req, res) => {
5955
- const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-4334IX63.js");
6098
+ const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-VRAOAPLA.js");
5956
6099
  const keysParam = req.query["keys"];
5957
6100
  if (!keysParam) {
5958
6101
  return res.status(400).json({ error: "keys query parameter is required" });
@@ -5965,19 +6108,19 @@ async function createServerHandle(config4) {
5965
6108
  res.json(result);
5966
6109
  });
5967
6110
  app.get("/api/settings/:key", async (req, res) => {
5968
- const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-4334IX63.js");
6111
+ const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-VRAOAPLA.js");
5969
6112
  const key = req.params.key;
5970
6113
  const value = getSetting(key) ?? SETTINGS_DEFAULTS[key] ?? null;
5971
6114
  res.json({ key, value });
5972
6115
  });
5973
6116
  app.get("/api/settings/:key", async (req, res) => {
5974
- const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-4334IX63.js");
6117
+ const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-VRAOAPLA.js");
5975
6118
  const key = req.params.key;
5976
6119
  const value = getSetting(key) ?? SETTINGS_DEFAULTS[key] ?? null;
5977
6120
  res.json({ key, value });
5978
6121
  });
5979
6122
  app.put("/api/settings/:key", async (req, res) => {
5980
- const { setSetting } = await import("./settings-4334IX63.js");
6123
+ const { setSetting } = await import("./settings-VRAOAPLA.js");
5981
6124
  const key = req.params.key;
5982
6125
  const { value } = req.body;
5983
6126
  if (value === void 0) {
@@ -6397,7 +6540,7 @@ async function createServerHandle(config4) {
6397
6540
  providerManager
6398
6541
  );
6399
6542
  const wss = wssExports.wss;
6400
- const { QueueProcessor } = await import("./processor-C4KLV5SV.js");
6543
+ const { QueueProcessor } = await import("./processor-XJYCHNV6.js");
6401
6544
  const queueProcessor = new QueueProcessor({
6402
6545
  sessionManager,
6403
6546
  providerManager,
@@ -6469,4 +6612,4 @@ export {
6469
6612
  createServerHandle,
6470
6613
  createServer
6471
6614
  };
6472
- //# sourceMappingURL=chunk-SCAFZ75C.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-L6LTCUCO.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-L6LTCUCO.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-MBLZSLPH.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-JP746DV3.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-NASF624P.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-5LYWA56Z.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-MBLZSLPH.js";
21
+ import "./chunk-J335KZ6U.js";
22
22
  import "./chunk-FBGWG4N6.js";
23
- import "./chunk-DCYDTDWO.js";
24
- import "./chunk-C5U6NRAY.js";
23
+ import "./chunk-6WZI6F6G.js";
24
+ import "./chunk-RCQOHFAN.js";
25
25
  import "./chunk-BJYPTN5S.js";
26
- import "./chunk-UTBDR6KM.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-RRO2XLYZ.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.101",
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-SBQ36AOQ.js";
8
+ } from "./chunk-IZC2EZ4D.js";
9
9
  import {
10
10
  getEventStore
11
- } from "./chunk-MBLZSLPH.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-C5U6NRAY.js";
18
- import "./chunk-UTBDR6KM.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-RRO2XLYZ.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-C4KLV5SV.js.map
224
+ //# sourceMappingURL=processor-XJYCHNV6.js.map
@@ -377,6 +377,9 @@ interface ExecutionState {
377
377
  startedAt: string;
378
378
  lastActivityAt: string;
379
379
  lastModeWithReminder?: string;
380
+ cachedSystemPrompt?: string;
381
+ dynamicContextHash?: string;
382
+ dynamicContextChanged?: boolean;
380
383
  }
381
384
  interface ContextState {
382
385
  currentTokens: number;
@@ -384,6 +387,7 @@ interface ContextState {
384
387
  compactionCount: number;
385
388
  dangerZone: boolean;
386
389
  canCompact: boolean;
390
+ dynamicContextChanged: boolean;
387
391
  }
388
392
  interface ValidationResult {
389
393
  allPassed: boolean;
@@ -506,7 +510,7 @@ interface ElementData {
506
510
  attributes: Record<string, string>;
507
511
  }
508
512
 
509
- type ClientMessageType = 'session.load' | 'context.compact' | 'runner.launch' | 'path.confirm' | 'ask.answer';
513
+ type ClientMessageType = 'session.load' | 'context.compact' | 'context.checkDynamic' | 'context.applyDynamic' | 'runner.launch' | 'path.confirm' | 'ask.answer';
510
514
  interface ClientMessage<T = unknown> {
511
515
  id: string;
512
516
  type: ClientMessageType;
@@ -35,8 +35,8 @@ import {
35
35
  parseClientMessage,
36
36
  serializeServerMessage,
37
37
  storedEventToServerMessage
38
- } from "./chunk-C5U6NRAY.js";
39
- import "./chunk-UTBDR6KM.js";
38
+ } from "./chunk-RCQOHFAN.js";
39
+ import "./chunk-MEYDERUX.js";
40
40
  export {
41
41
  createChatAskUserMessage,
42
42
  createChatDeltaMessage,
@@ -75,4 +75,4 @@ export {
75
75
  serializeServerMessage,
76
76
  storedEventToServerMessage
77
77
  };
78
- //# sourceMappingURL=protocol-SVQYBN2X.js.map
78
+ //# sourceMappingURL=protocol-TNC6MCJV.js.map