openfox 2.0.30 → 2.0.32

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/{chat-handler-Q62GBC4Z.js → chat-handler-NXK4SYGA.js} +9 -9
  2. package/dist/{chunk-ZRKYDC4O.js → chunk-7CCRQRQ4.js} +18 -28
  3. package/dist/{chunk-UHWRWFLE.js → chunk-BGCDJYNU.js} +2 -2
  4. package/dist/{chunk-JCOLS2ZM.js → chunk-BXUFIMHG.js} +44 -54
  5. package/dist/{chunk-EQUVYCW5.js → chunk-E4EUSGI7.js} +10 -29
  6. package/dist/{chunk-M2YRM64Q.js → chunk-JNSSFTVD.js} +2 -2
  7. package/dist/{chunk-HVDYK3TL.js → chunk-KF75UHK5.js} +44 -52
  8. package/dist/{chunk-SS3F2VYF.js → chunk-OSMUHB5F.js} +1 -6
  9. package/dist/{chunk-XDPGWGUW.js → chunk-U7MFDM6L.js} +2 -2
  10. package/dist/{chunk-M7M2VH45.js → chunk-WTDCC4IP.js} +30 -2
  11. package/dist/{chunk-O4TED6AJ.js → chunk-YQ3SOPBI.js} +2 -2
  12. package/dist/{chunk-SSWRM5BT.js → chunk-ZMONCXGW.js} +3 -3
  13. package/dist/{chunk-FBGWG4N6.js → chunk-ZPIZLTWU.js} +13 -1
  14. package/dist/cli/dev.js +1 -1
  15. package/dist/cli/index.js +1 -1
  16. package/dist/{compactor-BN5IDIVR.js → compactor-SHEOFZDB.js} +5 -5
  17. package/dist/{events-F5IURVXP.js → events-YLICLPBY.js} +3 -3
  18. package/dist/{orchestrator-7BJEOWTX.js → orchestrator-4FTESO2X.js} +8 -8
  19. package/dist/package.json +1 -1
  20. package/dist/{processor-AFP2CBQI.js → processor-EV3WONAR.js} +9 -9
  21. package/dist/{project-creator-BDDFQM6G.js → project-creator-W6Z7KCMZ.js} +3 -3
  22. package/dist/{projects-VO4PMVZY.js → projects-2XSGA7JG.js} +3 -3
  23. package/dist/{serve-6FBUKU4F.js → serve-CB44TMNB.js} +11 -11
  24. package/dist/server/index.d.ts +0 -8
  25. package/dist/server/index.js +10 -10
  26. package/dist/{server-5Q566V7W.js → server-I5U4MNGB.js} +10 -10
  27. package/dist/{settings-MMEBGS53.js → settings-MTGCEUS7.js} +3 -3
  28. package/dist/{tools-G3KFVM2A.js → tools-EKK2C42A.js} +7 -7
  29. package/dist/web/assets/{index-fWmnetkq.js → index-DS0Hsr0z.js} +46 -46
  30. package/dist/web/index.html +1 -1
  31. package/dist/web/sw.js +1 -1
  32. package/package.json +1 -1
@@ -21,7 +21,7 @@ import {
21
21
  tokenFromPassword,
22
22
  verifyPassword,
23
23
  workflowExists
24
- } from "./chunk-EQUVYCW5.js";
24
+ } from "./chunk-E4EUSGI7.js";
25
25
  import {
26
26
  agentExists,
27
27
  createToolRegistry,
@@ -61,7 +61,7 @@ import {
61
61
  setMcpTools,
62
62
  setNotifyMcpServersChanged,
63
63
  skillExists
64
- } from "./chunk-JCOLS2ZM.js";
64
+ } from "./chunk-BXUFIMHG.js";
65
65
  import {
66
66
  getPathSeparator,
67
67
  isAbsolutePath
@@ -77,12 +77,12 @@ import {
77
77
  } from "./chunk-EU3WWTFH.js";
78
78
  import {
79
79
  getProject
80
- } from "./chunk-O4TED6AJ.js";
80
+ } from "./chunk-YQ3SOPBI.js";
81
81
  import {
82
82
  ALWAYS_ALLOWED,
83
83
  ALWAYS_ALLOWED_FOR_SUBAGENTS,
84
84
  TOP_LEVEL_ONLY_TOOLS
85
- } from "./chunk-SS3F2VYF.js";
85
+ } from "./chunk-OSMUHB5F.js";
86
86
  import {
87
87
  createSession,
88
88
  deleteSession,
@@ -98,19 +98,21 @@ import {
98
98
  emitUserMessage,
99
99
  getEventStore,
100
100
  getSession,
101
+ getSessionCachedPrompt,
101
102
  getSessionState,
102
103
  initEventStore,
103
104
  listSessions,
104
105
  listSessionsByProject,
105
106
  setRuntimeConfig,
107
+ updateSessionCachedPrompt,
106
108
  updateSessionDangerLevel,
107
109
  updateSessionMetadata,
108
110
  updateSessionProvider,
109
111
  updateSessionRunning
110
- } from "./chunk-M7M2VH45.js";
112
+ } from "./chunk-WTDCC4IP.js";
111
113
  import {
112
114
  initDatabase
113
- } from "./chunk-FBGWG4N6.js";
115
+ } from "./chunk-ZPIZLTWU.js";
114
116
  import {
115
117
  createProviderManager,
116
118
  parseDefaultModelSelection
@@ -2181,7 +2183,6 @@ var SessionManager = class {
2181
2183
  events = new EventEmitter();
2182
2184
  activeSessionId = null;
2183
2185
  providerManager;
2184
- cachedPromptStore = /* @__PURE__ */ new Map();
2185
2186
  dynamicContextChangedStore = /* @__PURE__ */ new Map();
2186
2187
  debugDumpStore = /* @__PURE__ */ new Map();
2187
2188
  constructor(providerManager) {
@@ -2731,10 +2732,11 @@ var SessionManager = class {
2731
2732
  logger.debug("updateExecutionState called", { sessionId, updates });
2732
2733
  }
2733
2734
  setCachedPrompt(sessionId, systemPrompt, tools, hash) {
2734
- this.cachedPromptStore.set(sessionId, { systemPrompt, tools, hash });
2735
+ updateSessionCachedPrompt(sessionId, systemPrompt, tools, hash);
2735
2736
  }
2736
2737
  getCachedPrompt(sessionId) {
2737
- return this.cachedPromptStore.get(sessionId);
2738
+ const result = getSessionCachedPrompt(sessionId);
2739
+ return result ?? void 0;
2738
2740
  }
2739
2741
  setDynamicContextChanged(sessionId, changed) {
2740
2742
  this.dynamicContextChangedStore.set(sessionId, changed);
@@ -2879,17 +2881,7 @@ var SessionManager = class {
2879
2881
  return msg;
2880
2882
  });
2881
2883
  const isRunning = dbSession.isRunning;
2882
- const hasCachedPrompt = this.cachedPromptStore.has(dbSession.id);
2883
- const cachedData = this.cachedPromptStore.get(dbSession.id);
2884
- if (!hasCachedPrompt && eventState.cachedSystemPrompt && eventState.dynamicContextHash) {
2885
- this.cachedPromptStore.set(dbSession.id, {
2886
- systemPrompt: eventState.cachedSystemPrompt,
2887
- tools: [],
2888
- hash: eventState.dynamicContextHash
2889
- });
2890
- }
2891
- if (!this.dynamicContextChangedStore.has(dbSession.id) && eventState.contextState.dynamicContextChanged) {
2892
- }
2884
+ const cachedPrompt = getSessionCachedPrompt(dbSession.id);
2893
2885
  return {
2894
2886
  ...dbSession,
2895
2887
  mode: eventState.mode,
@@ -2900,9 +2892,9 @@ var SessionManager = class {
2900
2892
  metadataEntries: eventState.metadataEntries,
2901
2893
  contextWindows: [],
2902
2894
  // Derived from events, not stored separately
2903
- executionState: eventState.cachedSystemPrompt || hasCachedPrompt ? {
2904
- cachedSystemPrompt: cachedData?.systemPrompt ?? eventState.cachedSystemPrompt,
2905
- dynamicContextHash: cachedData?.hash ?? eventState.dynamicContextHash
2895
+ executionState: eventState.cachedSystemPrompt || cachedPrompt ? {
2896
+ cachedSystemPrompt: cachedPrompt?.systemPrompt ?? eventState.cachedSystemPrompt,
2897
+ dynamicContextHash: cachedPrompt?.hash ?? eventState.dynamicContextHash
2906
2898
  } : null
2907
2899
  };
2908
2900
  }
@@ -3448,7 +3440,7 @@ import { Router as Router6 } from "express";
3448
3440
  import { spawn as spawn2 } from "child_process";
3449
3441
 
3450
3442
  // src/constants.ts
3451
- var VERSION = "2.0.30";
3443
+ var VERSION = "2.0.32";
3452
3444
 
3453
3445
  // src/server/routes/auto-update.ts
3454
3446
  var updateInProgress = false;
@@ -3628,7 +3620,7 @@ async function createServerHandle(config4) {
3628
3620
  setMcpTools(mcpTools);
3629
3621
  logger.info("MCP tools registered", { count: mcpTools.length });
3630
3622
  }
3631
- const { signalMcpReady } = await import("./server-5Q566V7W.js");
3623
+ const { signalMcpReady } = await import("./server-I5U4MNGB.js");
3632
3624
  signalMcpReady();
3633
3625
  });
3634
3626
  const app = express();
@@ -3690,7 +3682,7 @@ async function createServerHandle(config4) {
3690
3682
  res.json({ tools });
3691
3683
  });
3692
3684
  app.get("/api/projects", async (_req, res) => {
3693
- const { listProjects } = await import("./projects-VO4PMVZY.js");
3685
+ const { listProjects } = await import("./projects-2XSGA7JG.js");
3694
3686
  const projects = listProjects();
3695
3687
  res.json({ projects });
3696
3688
  });
@@ -3699,7 +3691,7 @@ async function createServerHandle(config4) {
3699
3691
  if (!name || !workdir) {
3700
3692
  return res.status(400).json({ error: "name and workdir are required" });
3701
3693
  }
3702
- const { createDirectoryWithGit } = await import("./project-creator-BDDFQM6G.js");
3694
+ const { createDirectoryWithGit } = await import("./project-creator-W6Z7KCMZ.js");
3703
3695
  try {
3704
3696
  const project = await createDirectoryWithGit(name, workdir);
3705
3697
  res.status(201).json({ project });
@@ -3744,7 +3736,7 @@ async function createServerHandle(config4) {
3744
3736
  }
3745
3737
  });
3746
3738
  app.get("/api/projects/:id", async (req, res) => {
3747
- const { getProject: getProject2 } = await import("./projects-VO4PMVZY.js");
3739
+ const { getProject: getProject2 } = await import("./projects-2XSGA7JG.js");
3748
3740
  const project = getProject2(req.params.id);
3749
3741
  if (!project) {
3750
3742
  return res.status(404).json({ error: "Project not found" });
@@ -3752,7 +3744,7 @@ async function createServerHandle(config4) {
3752
3744
  res.json({ project });
3753
3745
  });
3754
3746
  app.put("/api/projects/:id", async (req, res) => {
3755
- const { updateProject } = await import("./projects-VO4PMVZY.js");
3747
+ const { updateProject } = await import("./projects-2XSGA7JG.js");
3756
3748
  const { name, customInstructions, dangerLevel } = req.body;
3757
3749
  const updates = {};
3758
3750
  if (name !== void 0) updates.name = name;
@@ -3765,7 +3757,7 @@ async function createServerHandle(config4) {
3765
3757
  res.json({ project: updated });
3766
3758
  });
3767
3759
  app.delete("/api/projects/:id", async (req, res) => {
3768
- const { getProject: getProject2, deleteProject } = await import("./projects-VO4PMVZY.js");
3760
+ const { getProject: getProject2, deleteProject } = await import("./projects-2XSGA7JG.js");
3769
3761
  const project = getProject2(req.params.id);
3770
3762
  if (!project) {
3771
3763
  return res.status(404).json({ error: "Project not found" });
@@ -3774,7 +3766,7 @@ async function createServerHandle(config4) {
3774
3766
  res.json({ success: true });
3775
3767
  });
3776
3768
  app.put("/api/projects/:id/star", async (req, res) => {
3777
- const { toggleStar } = await import("./projects-VO4PMVZY.js");
3769
+ const { toggleStar } = await import("./projects-2XSGA7JG.js");
3778
3770
  const { isStarred } = req.body;
3779
3771
  if (typeof isStarred !== "boolean") {
3780
3772
  return res.status(400).json({ error: "isStarred is required and must be a boolean" });
@@ -3786,7 +3778,7 @@ async function createServerHandle(config4) {
3786
3778
  res.json({ project });
3787
3779
  });
3788
3780
  app.get("/api/sessions", async (req, res) => {
3789
- const { getRecentUserPromptsForSession } = await import("./events-F5IURVXP.js");
3781
+ const { getRecentUserPromptsForSession } = await import("./events-YLICLPBY.js");
3790
3782
  const projectId = req.query["projectId"];
3791
3783
  const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
3792
3784
  const offset = parseInt(req.query["offset"]) || 0;
@@ -3819,9 +3811,9 @@ async function createServerHandle(config4) {
3819
3811
  res.status(201).json({ session });
3820
3812
  });
3821
3813
  app.get("/api/sessions/:id", async (req, res) => {
3822
- const { getEventStore: getEventStore2 } = await import("./events-F5IURVXP.js");
3814
+ const { getEventStore: getEventStore2 } = await import("./events-YLICLPBY.js");
3823
3815
  const { buildMessagesFromStoredEvents } = await import("./folding-PI67HWBR.js");
3824
- const { getPendingQuestionsForSession } = await import("./tools-G3KFVM2A.js");
3816
+ const { getPendingQuestionsForSession } = await import("./tools-EKK2C42A.js");
3825
3817
  const session = sessionManager.getSession(req.params.id);
3826
3818
  if (!session) {
3827
3819
  return res.status(404).json({ error: "Session not found" });
@@ -3852,7 +3844,7 @@ async function createServerHandle(config4) {
3852
3844
  res.json({ success: true });
3853
3845
  });
3854
3846
  app.post("/api/sessions/:id/provider", async (req, res) => {
3855
- const { getEventStore: getEventStore2 } = await import("./events-F5IURVXP.js");
3847
+ const { getEventStore: getEventStore2 } = await import("./events-YLICLPBY.js");
3856
3848
  const { buildMessagesFromStoredEvents } = await import("./folding-PI67HWBR.js");
3857
3849
  const sessionId = req.params.id;
3858
3850
  const session = sessionManager.getSession(sessionId);
@@ -3897,7 +3889,7 @@ async function createServerHandle(config4) {
3897
3889
  res.json({ success: true });
3898
3890
  });
3899
3891
  app.put("/api/sessions/:id/mode", async (req, res) => {
3900
- const { getEventStore: getEventStore2 } = await import("./events-F5IURVXP.js");
3892
+ const { getEventStore: getEventStore2 } = await import("./events-YLICLPBY.js");
3901
3893
  const { buildMessagesFromStoredEvents } = await import("./folding-PI67HWBR.js");
3902
3894
  const sessionId = req.params.id;
3903
3895
  const session = sessionManager.getSession(sessionId);
@@ -3954,15 +3946,15 @@ async function createServerHandle(config4) {
3954
3946
  if (!callId || approved === void 0) {
3955
3947
  return res.status(400).json({ error: "callId and approved are required" });
3956
3948
  }
3957
- const { providePathConfirmation } = await import("./tools-G3KFVM2A.js");
3949
+ const { providePathConfirmation } = await import("./tools-EKK2C42A.js");
3958
3950
  const result = providePathConfirmation(callId, approved, alwaysAllow);
3959
3951
  if (!result.found) {
3960
3952
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
3961
3953
  }
3962
- const { getEventStore: getEventStore2 } = await import("./events-F5IURVXP.js");
3954
+ const { getEventStore: getEventStore2 } = await import("./events-YLICLPBY.js");
3963
3955
  const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-PI67HWBR.js");
3964
3956
  const { createSessionStateMessage } = await import("./protocol-BKNLAEPJ.js");
3965
- const { getPendingQuestionsForSession } = await import("./tools-G3KFVM2A.js");
3957
+ const { getPendingQuestionsForSession } = await import("./tools-EKK2C42A.js");
3966
3958
  const eventStore = getEventStore2();
3967
3959
  const events = eventStore.getEvents(sessionId);
3968
3960
  const messages = buildMessagesFromStoredEvents(events);
@@ -3983,7 +3975,7 @@ async function createServerHandle(config4) {
3983
3975
  if (!skip && typeof answer !== "string") {
3984
3976
  return res.status(400).json({ error: "answer is required when not skipping" });
3985
3977
  }
3986
- const { provideAnswer } = await import("./tools-G3KFVM2A.js");
3978
+ const { provideAnswer } = await import("./tools-EKK2C42A.js");
3987
3979
  const found = provideAnswer(callId, answer ?? "", skip ?? false);
3988
3980
  if (!found) {
3989
3981
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -4019,15 +4011,15 @@ async function createServerHandle(config4) {
4019
4011
  if (!session) {
4020
4012
  return res.status(404).json({ error: "Session not found" });
4021
4013
  }
4022
- const { stopSessionExecution } = await import("./chat-handler-Q62GBC4Z.js");
4023
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-G3KFVM2A.js");
4014
+ const { stopSessionExecution } = await import("./chat-handler-NXK4SYGA.js");
4015
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-EKK2C42A.js");
4024
4016
  const queuedMessages = sessionManager.getQueueState(sessionId);
4025
4017
  sessionManager.clearMessageQueue(sessionId);
4026
4018
  stopSessionExecution(sessionId, sessionManager);
4027
4019
  abortSession(sessionId);
4028
4020
  cancelQuestionsForSession(sessionId, "Session stopped by user");
4029
4021
  cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
4030
- const eventStore = (await import("./events-F5IURVXP.js")).getEventStore();
4022
+ const eventStore = (await import("./events-YLICLPBY.js")).getEventStore();
4031
4023
  eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
4032
4024
  res.json({ success: true, queuedMessages });
4033
4025
  });
@@ -4041,7 +4033,7 @@ async function createServerHandle(config4) {
4041
4033
  if (typeof messageIndex !== "number" || messageIndex < 0) {
4042
4034
  return res.status(400).json({ error: "messageIndex must be a non-negative number" });
4043
4035
  }
4044
- const { truncateSessionMessages } = await import("./events-F5IURVXP.js");
4036
+ const { truncateSessionMessages } = await import("./events-YLICLPBY.js");
4045
4037
  truncateSessionMessages(sessionId, messageIndex);
4046
4038
  res.json({ success: true });
4047
4039
  });
@@ -4059,7 +4051,7 @@ async function createServerHandle(config4) {
4059
4051
  if (!msg) {
4060
4052
  return res.status(400).json({ error: "Message not found at this index" });
4061
4053
  }
4062
- const { truncateSessionMessages } = await import("./events-F5IURVXP.js");
4054
+ const { truncateSessionMessages } = await import("./events-YLICLPBY.js");
4063
4055
  truncateSessionMessages(sessionId, messageIndex - 1);
4064
4056
  sessionManager.queueMessage(sessionId, "asap", msg.content, msg.attachments, msg.messageKind);
4065
4057
  res.json({ success: true });
@@ -4091,7 +4083,7 @@ async function createServerHandle(config4) {
4091
4083
  res.json({ accepted: true });
4092
4084
  });
4093
4085
  app.get("/api/settings", async (req, res) => {
4094
- const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-MMEBGS53.js");
4086
+ const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-MTGCEUS7.js");
4095
4087
  const keysParam = req.query["keys"];
4096
4088
  if (!keysParam) {
4097
4089
  return res.status(400).json({ error: "keys query parameter is required" });
@@ -4104,19 +4096,19 @@ async function createServerHandle(config4) {
4104
4096
  res.json(result);
4105
4097
  });
4106
4098
  app.get("/api/settings/:key", async (req, res) => {
4107
- const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-MMEBGS53.js");
4099
+ const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-MTGCEUS7.js");
4108
4100
  const key = req.params.key;
4109
4101
  const value = getSetting(key) ?? SETTINGS_DEFAULTS[key] ?? null;
4110
4102
  res.json({ key, value });
4111
4103
  });
4112
4104
  app.get("/api/settings/:key", async (req, res) => {
4113
- const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-MMEBGS53.js");
4105
+ const { getSetting, SETTINGS_DEFAULTS } = await import("./settings-MTGCEUS7.js");
4114
4106
  const key = req.params.key;
4115
4107
  const value = getSetting(key) ?? SETTINGS_DEFAULTS[key] ?? null;
4116
4108
  res.json({ key, value });
4117
4109
  });
4118
4110
  app.put("/api/settings/:key", async (req, res) => {
4119
- const { setSetting } = await import("./settings-MMEBGS53.js");
4111
+ const { setSetting } = await import("./settings-MTGCEUS7.js");
4120
4112
  const key = req.params.key;
4121
4113
  const { value } = req.body;
4122
4114
  if (value === void 0) {
@@ -4515,7 +4507,7 @@ async function createServerHandle(config4) {
4515
4507
  });
4516
4508
  async function rebuildMcpTools() {
4517
4509
  const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-B7QP6NLA.js");
4518
- const { setMcpTools: setMcpTools2 } = await import("./tools-G3KFVM2A.js");
4510
+ const { setMcpTools: setMcpTools2 } = await import("./tools-EKK2C42A.js");
4519
4511
  const mcpTools = createMcpTools2(mcpManager);
4520
4512
  setMcpTools2(mcpTools);
4521
4513
  }
@@ -4827,7 +4819,7 @@ async function createServerHandle(config4) {
4827
4819
  const state = sessionManager.getContextState(sessionId);
4828
4820
  wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
4829
4821
  });
4830
- const { QueueProcessor } = await import("./processor-AFP2CBQI.js");
4822
+ const { QueueProcessor } = await import("./processor-EV3WONAR.js");
4831
4823
  const queueProcessor = new QueueProcessor({
4832
4824
  sessionManager,
4833
4825
  providerManager,
@@ -4902,4 +4894,4 @@ export {
4902
4894
  createServerHandle,
4903
4895
  createServer
4904
4896
  };
4905
- //# sourceMappingURL=chunk-HVDYK3TL.js.map
4897
+ //# sourceMappingURL=chunk-KF75UHK5.js.map
@@ -199,10 +199,6 @@ function buildTopLevelSystemPrompt(workdir, customInstructions, skills, subAgent
199
199
  const subAgents = subAgentDefs ? buildSubAgentsSection(subAgentDefs) : "";
200
200
  return base + subAgents;
201
201
  }
202
- function buildSubAgentSystemPrompt(workdir, agentDef, skills, modelName) {
203
- const base = buildBasePrompt(workdir, void 0, skills, modelName);
204
- return base + "\n\n" + agentDef.prompt;
205
- }
206
202
  function buildToolPermissionsSection(allowedTools, isSubAgent) {
207
203
  if (!allowedTools || allowedTools.length === 0) {
208
204
  return "\n\n## AVAILABLE TOOLS\n\nYou have no tools available.";
@@ -692,7 +688,6 @@ export {
692
688
  computeEffectiveTools,
693
689
  buildBasePrompt,
694
690
  buildTopLevelSystemPrompt,
695
- buildSubAgentSystemPrompt,
696
691
  buildAgentReminder,
697
692
  buildAgentSmallReminder,
698
693
  WORKFLOW_KICKOFF_PROMPT,
@@ -706,4 +701,4 @@ export {
706
701
  createChatDoneEvent,
707
702
  consumeStreamGenerator
708
703
  };
709
- //# sourceMappingURL=chunk-SS3F2VYF.js.map
704
+ //# sourceMappingURL=chunk-OSMUHB5F.js.map
@@ -196,7 +196,7 @@ async function runCli(options) {
196
196
  if (!configExists) {
197
197
  await runNetworkSetup(mode);
198
198
  }
199
- const { runServe } = await import("./serve-6FBUKU4F.js");
199
+ const { runServe } = await import("./serve-CB44TMNB.js");
200
200
  const serveOptions = { mode };
201
201
  if (values.port) serveOptions.port = parseInt(values.port);
202
202
  if (values["no-browser"] === true) serveOptions.openBrowser = false;
@@ -208,4 +208,4 @@ async function runCli(options) {
208
208
  export {
209
209
  runCli
210
210
  };
211
- //# sourceMappingURL=chunk-XDPGWGUW.js.map
211
+ //# sourceMappingURL=chunk-U7MFDM6L.js.map
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-6PLAWCHQ.js";
9
9
  import {
10
10
  getDatabase
11
- } from "./chunk-FBGWG4N6.js";
11
+ } from "./chunk-ZPIZLTWU.js";
12
12
  import {
13
13
  logger
14
14
  } from "./chunk-K44MW7JJ.js";
@@ -790,6 +790,32 @@ function updateSessionMetadata(id, metadata) {
790
790
  `
791
791
  ).run(...values);
792
792
  }
793
+ function updateSessionCachedPrompt(id, systemPrompt, tools, hash) {
794
+ const db = getDatabase();
795
+ const now = (/* @__PURE__ */ new Date()).toISOString();
796
+ db.prepare(
797
+ `
798
+ UPDATE sessions SET cached_system_prompt = ?, cached_tools = ?, cached_hash = ?, updated_at = ? WHERE id = ?
799
+ `
800
+ ).run(systemPrompt, JSON.stringify(tools), hash, now, id);
801
+ }
802
+ function getSessionCachedPrompt(id) {
803
+ const db = getDatabase();
804
+ const row = db.prepare(
805
+ `
806
+ SELECT cached_system_prompt, cached_tools, cached_hash FROM sessions WHERE id = ?
807
+ `
808
+ ).get(id);
809
+ if (!row || !row.cached_system_prompt || !row.cached_tools || !row.cached_hash) {
810
+ return null;
811
+ }
812
+ try {
813
+ const tools = JSON.parse(row.cached_tools);
814
+ return { systemPrompt: row.cached_system_prompt, tools, hash: row.cached_hash };
815
+ } catch {
816
+ return null;
817
+ }
818
+ }
793
819
  function updateSessionMessageCount(id, delta) {
794
820
  try {
795
821
  const db = getDatabase();
@@ -1357,6 +1383,8 @@ export {
1357
1383
  updateSessionDangerLevel,
1358
1384
  updateSessionRunning,
1359
1385
  updateSessionMetadata,
1386
+ updateSessionCachedPrompt,
1387
+ getSessionCachedPrompt,
1360
1388
  listSessions,
1361
1389
  listSessionsByProject,
1362
1390
  deleteSession,
@@ -1397,4 +1425,4 @@ export {
1397
1425
  truncateSessionMessages,
1398
1426
  getRecentUserPromptsForSession
1399
1427
  };
1400
- //# sourceMappingURL=chunk-M7M2VH45.js.map
1428
+ //# sourceMappingURL=chunk-WTDCC4IP.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getDatabase
3
- } from "./chunk-FBGWG4N6.js";
3
+ } from "./chunk-ZPIZLTWU.js";
4
4
 
5
5
  // src/server/db/projects.ts
6
6
  function createProject(name, workdir) {
@@ -117,4 +117,4 @@ export {
117
117
  deleteProject,
118
118
  toggleStar
119
119
  };
120
- //# sourceMappingURL=chunk-O4TED6AJ.js.map
120
+ //# sourceMappingURL=chunk-YQ3SOPBI.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  COMPACTION_PROMPT,
3
3
  createMessageStartEvent
4
- } from "./chunk-SS3F2VYF.js";
4
+ } from "./chunk-OSMUHB5F.js";
5
5
  import {
6
6
  getCurrentWindowMessageOptions
7
- } from "./chunk-M7M2VH45.js";
7
+ } from "./chunk-WTDCC4IP.js";
8
8
 
9
9
  // src/server/context/compactor.ts
10
10
  function appendCompactionPrompt(sessionId, append) {
@@ -31,4 +31,4 @@ export {
31
31
  shouldCompact,
32
32
  getCompactionTarget
33
33
  };
34
- //# sourceMappingURL=chunk-SSWRM5BT.js.map
34
+ //# sourceMappingURL=chunk-ZMONCXGW.js.map
@@ -161,6 +161,18 @@ function runMigrations(db2) {
161
161
  ).run();
162
162
  logger.info("Backfilled message counts", { count: backfillResult.changes });
163
163
  }
164
+ if (!columnNames.includes("cached_system_prompt")) {
165
+ logger.info("Migrating sessions table: adding cached_system_prompt column");
166
+ db2.exec(`ALTER TABLE sessions ADD COLUMN cached_system_prompt TEXT`);
167
+ }
168
+ if (!columnNames.includes("cached_tools")) {
169
+ logger.info("Migrating sessions table: adding cached_tools column");
170
+ db2.exec(`ALTER TABLE sessions ADD COLUMN cached_tools TEXT`);
171
+ }
172
+ if (!columnNames.includes("cached_hash")) {
173
+ logger.info("Migrating sessions table: adding cached_hash column");
174
+ db2.exec(`ALTER TABLE sessions ADD COLUMN cached_hash TEXT`);
175
+ }
164
176
  logger.info("Database migrations completed");
165
177
  }
166
178
 
@@ -168,4 +180,4 @@ export {
168
180
  initDatabase,
169
181
  getDatabase
170
182
  };
171
- //# sourceMappingURL=chunk-FBGWG4N6.js.map
183
+ //# sourceMappingURL=chunk-ZPIZLTWU.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-XDPGWGUW.js";
4
+ } from "../chunk-U7MFDM6L.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-XDPGWGUW.js";
4
+ } from "../chunk-U7MFDM6L.js";
5
5
  import {
6
6
  logger
7
7
  } from "../chunk-K44MW7JJ.js";
@@ -2,11 +2,11 @@ import {
2
2
  appendCompactionPrompt,
3
3
  getCompactionTarget,
4
4
  shouldCompact
5
- } from "./chunk-SSWRM5BT.js";
6
- import "./chunk-SS3F2VYF.js";
7
- import "./chunk-M7M2VH45.js";
5
+ } from "./chunk-ZMONCXGW.js";
6
+ import "./chunk-OSMUHB5F.js";
7
+ import "./chunk-WTDCC4IP.js";
8
8
  import "./chunk-6PLAWCHQ.js";
9
- import "./chunk-FBGWG4N6.js";
9
+ import "./chunk-ZPIZLTWU.js";
10
10
  import "./chunk-J2GP3J3X.js";
11
11
  import "./chunk-Z4FMBCJO.js";
12
12
  import "./chunk-ZJ4FP6RS.js";
@@ -17,4 +17,4 @@ export {
17
17
  getCompactionTarget,
18
18
  shouldCompact
19
19
  };
20
- //# sourceMappingURL=compactor-BN5IDIVR.js.map
20
+ //# sourceMappingURL=compactor-SHEOFZDB.js.map
@@ -38,7 +38,7 @@ import {
38
38
  isStoredEvent,
39
39
  isTurnEvent,
40
40
  truncateSessionMessages
41
- } from "./chunk-M7M2VH45.js";
41
+ } from "./chunk-WTDCC4IP.js";
42
42
  import {
43
43
  buildContextMessagesFromEventHistory,
44
44
  buildContextMessagesFromMessages,
@@ -56,7 +56,7 @@ import {
56
56
  foldTurnEventsToSnapshotMessages,
57
57
  getMessagesForWindow
58
58
  } from "./chunk-6PLAWCHQ.js";
59
- import "./chunk-FBGWG4N6.js";
59
+ import "./chunk-ZPIZLTWU.js";
60
60
  import "./chunk-K44MW7JJ.js";
61
61
  export {
62
62
  EventStore,
@@ -114,4 +114,4 @@ export {
114
114
  isTurnEvent,
115
115
  truncateSessionMessages
116
116
  };
117
- //# sourceMappingURL=events-F5IURVXP.js.map
117
+ //# sourceMappingURL=events-YLICLPBY.js.map
@@ -2,16 +2,16 @@ import {
2
2
  injectWorkflowKickoffIfNeeded,
3
3
  runAgentTurn,
4
4
  runChatTurn
5
- } from "./chunk-ZRKYDC4O.js";
6
- import "./chunk-JCOLS2ZM.js";
5
+ } from "./chunk-7CCRQRQ4.js";
6
+ import "./chunk-BXUFIMHG.js";
7
7
  import "./chunk-DL6ZILAF.js";
8
8
  import "./chunk-PBGOZMVY.js";
9
9
  import "./chunk-VRGRAQDG.js";
10
10
  import "./chunk-NWO6GRYE.js";
11
11
  import "./chunk-F4PMNP7S.js";
12
12
  import "./chunk-EU3WWTFH.js";
13
- import "./chunk-M2YRM64Q.js";
14
- import "./chunk-O4TED6AJ.js";
13
+ import "./chunk-JNSSFTVD.js";
14
+ import "./chunk-YQ3SOPBI.js";
15
15
  import {
16
16
  TurnMetrics,
17
17
  createChatDoneEvent,
@@ -19,10 +19,10 @@ import {
19
19
  createMessageStartEvent,
20
20
  createToolCallEvent,
21
21
  createToolResultEvent
22
- } from "./chunk-SS3F2VYF.js";
23
- import "./chunk-M7M2VH45.js";
22
+ } from "./chunk-OSMUHB5F.js";
23
+ import "./chunk-WTDCC4IP.js";
24
24
  import "./chunk-6PLAWCHQ.js";
25
- import "./chunk-FBGWG4N6.js";
25
+ import "./chunk-ZPIZLTWU.js";
26
26
  import "./chunk-J2GP3J3X.js";
27
27
  import "./chunk-Z4FMBCJO.js";
28
28
  import "./chunk-ZJ4FP6RS.js";
@@ -42,4 +42,4 @@ export {
42
42
  runAgentTurn,
43
43
  runChatTurn
44
44
  };
45
- //# sourceMappingURL=orchestrator-7BJEOWTX.js.map
45
+ //# sourceMappingURL=orchestrator-4FTESO2X.js.map
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openfox",
3
- "version": "2.0.30",
3
+ "version": "2.0.32",
4
4
  "description": "Local-LLM-first agentic coding assistant",
5
5
  "type": "module",
6
6
  "bin": {
@@ -2,8 +2,8 @@ import {
2
2
  buildRunChatTurnParams,
3
3
  finalizeTurnCompletion,
4
4
  generateSessionNameForSession
5
- } from "./chunk-UHWRWFLE.js";
6
- import "./chunk-JCOLS2ZM.js";
5
+ } from "./chunk-BGCDJYNU.js";
6
+ import "./chunk-BXUFIMHG.js";
7
7
  import "./chunk-DL6ZILAF.js";
8
8
  import "./chunk-PBGOZMVY.js";
9
9
  import "./chunk-VRGRAQDG.js";
@@ -13,14 +13,14 @@ import {
13
13
  createSessionRunningMessage
14
14
  } from "./chunk-F4PMNP7S.js";
15
15
  import "./chunk-EU3WWTFH.js";
16
- import "./chunk-M2YRM64Q.js";
17
- import "./chunk-O4TED6AJ.js";
18
- import "./chunk-SS3F2VYF.js";
16
+ import "./chunk-JNSSFTVD.js";
17
+ import "./chunk-YQ3SOPBI.js";
18
+ import "./chunk-OSMUHB5F.js";
19
19
  import {
20
20
  getEventStore
21
- } from "./chunk-M7M2VH45.js";
21
+ } from "./chunk-WTDCC4IP.js";
22
22
  import "./chunk-6PLAWCHQ.js";
23
- import "./chunk-FBGWG4N6.js";
23
+ import "./chunk-ZPIZLTWU.js";
24
24
  import "./chunk-J2GP3J3X.js";
25
25
  import "./chunk-Z4FMBCJO.js";
26
26
  import "./chunk-ZJ4FP6RS.js";
@@ -171,7 +171,7 @@ var QueueProcessor = class {
171
171
  backend: provider?.backend ?? llmClient.getBackend(),
172
172
  model: llmClient.getModel()
173
173
  };
174
- const { runChatTurn } = await import("./orchestrator-7BJEOWTX.js");
174
+ const { runChatTurn } = await import("./orchestrator-4FTESO2X.js");
175
175
  const runChatTurnParams = buildRunChatTurnParams({
176
176
  sessionManager,
177
177
  sessionId,
@@ -216,4 +216,4 @@ var QueueProcessor = class {
216
216
  export {
217
217
  QueueProcessor
218
218
  };
219
- //# sourceMappingURL=processor-AFP2CBQI.js.map
219
+ //# sourceMappingURL=processor-EV3WONAR.js.map