openfox 2.0.31 → 2.0.33

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 (33) hide show
  1. package/dist/{chat-handler-Q62GBC4Z.js → chat-handler-YCFYRTFG.js} +9 -9
  2. package/dist/{chunk-2OU2JR6Q.js → chunk-7CGFLVUG.js} +2 -2
  3. package/dist/{chunk-UHWRWFLE.js → chunk-BGCDJYNU.js} +2 -2
  4. package/dist/{chunk-ZRKYDC4O.js → chunk-EB2RIVZA.js} +18 -28
  5. package/dist/{chunk-EQUVYCW5.js → chunk-IBKGV6OJ.js} +14 -29
  6. package/dist/{chunk-2Q46DWWO.js → chunk-IYEZ6CAW.js} +44 -52
  7. package/dist/{chunk-M2YRM64Q.js → chunk-JNSSFTVD.js} +2 -2
  8. package/dist/{chunk-SS3F2VYF.js → chunk-OSMUHB5F.js} +1 -6
  9. package/dist/{chunk-M7M2VH45.js → chunk-WTDCC4IP.js} +30 -2
  10. package/dist/{chunk-JCOLS2ZM.js → chunk-XJU2PBLN.js} +61 -68
  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-YJV4CXKV.js} +8 -8
  19. package/dist/package.json +1 -1
  20. package/dist/{processor-AFP2CBQI.js → processor-VGVPSVGE.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-IMGECZ2I.js → serve-DU5ZDKBE.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-RHYGD2Q6.js} +10 -10
  27. package/dist/{settings-MMEBGS53.js → settings-MTGCEUS7.js} +3 -3
  28. package/dist/{tools-G3KFVM2A.js → tools-2QBZBNDL.js} +7 -7
  29. package/dist/web/assets/{index-DS0Hsr0z.js → index-D5CeXQdc.js} +61 -61
  30. package/dist/web/assets/{index-CJuwWvXr.css → index-DIvNnXne.css} +1 -1
  31. package/dist/web/index.html +2 -2
  32. package/dist/web/sw.js +1 -1
  33. package/package.json +1 -1
@@ -2,11 +2,11 @@ import {
2
2
  buildRunChatTurnParams,
3
3
  finalizeTurnCompletion,
4
4
  generateSessionNameForSession
5
- } from "./chunk-UHWRWFLE.js";
5
+ } from "./chunk-BGCDJYNU.js";
6
6
  import {
7
7
  runChatTurn
8
- } from "./chunk-ZRKYDC4O.js";
9
- import "./chunk-JCOLS2ZM.js";
8
+ } from "./chunk-EB2RIVZA.js";
9
+ import "./chunk-XJU2PBLN.js";
10
10
  import "./chunk-DL6ZILAF.js";
11
11
  import "./chunk-PBGOZMVY.js";
12
12
  import "./chunk-VRGRAQDG.js";
@@ -17,14 +17,14 @@ import {
17
17
  createSessionRunningMessage
18
18
  } from "./chunk-F4PMNP7S.js";
19
19
  import "./chunk-EU3WWTFH.js";
20
- import "./chunk-M2YRM64Q.js";
21
- import "./chunk-O4TED6AJ.js";
22
- import "./chunk-SS3F2VYF.js";
20
+ import "./chunk-JNSSFTVD.js";
21
+ import "./chunk-YQ3SOPBI.js";
22
+ import "./chunk-OSMUHB5F.js";
23
23
  import {
24
24
  getEventStore
25
- } from "./chunk-M7M2VH45.js";
25
+ } from "./chunk-WTDCC4IP.js";
26
26
  import "./chunk-6PLAWCHQ.js";
27
- import "./chunk-FBGWG4N6.js";
27
+ import "./chunk-ZPIZLTWU.js";
28
28
  import "./chunk-J2GP3J3X.js";
29
29
  import "./chunk-Z4FMBCJO.js";
30
30
  import "./chunk-ZJ4FP6RS.js";
@@ -145,4 +145,4 @@ export {
145
145
  startChatSession,
146
146
  stopSessionExecution
147
147
  };
148
- //# sourceMappingURL=chat-handler-Q62GBC4Z.js.map
148
+ //# sourceMappingURL=chat-handler-YCFYRTFG.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-IMGECZ2I.js");
199
+ const { runServe } = await import("./serve-DU5ZDKBE.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-2OU2JR6Q.js.map
211
+ //# sourceMappingURL=chunk-7CGFLVUG.js.map
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  getEventStore,
10
10
  updateSessionMetadata
11
- } from "./chunk-M7M2VH45.js";
11
+ } from "./chunk-WTDCC4IP.js";
12
12
  import {
13
13
  buildMessagesFromStoredEvents,
14
14
  foldPendingConfirmations
@@ -174,4 +174,4 @@ export {
174
174
  buildRunChatTurnParams,
175
175
  generateSessionNameForSession
176
176
  };
177
- //# sourceMappingURL=chunk-UHWRWFLE.js.map
177
+ //# sourceMappingURL=chunk-BGCDJYNU.js.map
@@ -1,20 +1,18 @@
1
1
  import {
2
2
  PathAccessDeniedError,
3
- assembleAgentRequest,
3
+ buildCachedPrompt,
4
4
  computeDynamicContextHash,
5
5
  createAssemblyResult,
6
- createToolRegistry,
7
6
  findAgentById,
8
7
  getAllInstructions,
9
8
  getConversationMessages,
10
9
  getEnabledSkillMetadata,
11
- getSubAgents,
12
10
  getToolFingerprint,
13
11
  getToolRegistryForAgent,
14
12
  loadAllAgentsDefault,
15
13
  processEventsForConversation,
16
14
  runTopLevelAgentLoop
17
- } from "./chunk-JCOLS2ZM.js";
15
+ } from "./chunk-XJU2PBLN.js";
18
16
  import {
19
17
  TurnMetrics,
20
18
  WORKFLOW_KICKOFF_PROMPT,
@@ -22,13 +20,13 @@ import {
22
20
  buildAgentSmallReminder,
23
21
  createChatDoneEvent,
24
22
  createMessageStartEvent
25
- } from "./chunk-SS3F2VYF.js";
23
+ } from "./chunk-OSMUHB5F.js";
26
24
  import {
27
25
  getCurrentContextWindowId,
28
26
  getCurrentWindowMessageOptions,
29
27
  getEventStore,
30
28
  getRuntimeConfig
31
- } from "./chunk-M7M2VH45.js";
29
+ } from "./chunk-WTDCC4IP.js";
32
30
  import {
33
31
  buildSnapshotFromSessionState
34
32
  } from "./chunk-6PLAWCHQ.js";
@@ -41,7 +39,7 @@ import {
41
39
 
42
40
  // src/server/chat/orchestrator.ts
43
41
  async function buildRetryPatterns() {
44
- const { getSetting, SETTINGS_KEYS } = await import("./settings-MMEBGS53.js");
42
+ const { getSetting, SETTINGS_KEYS } = await import("./settings-MTGCEUS7.js");
45
43
  const raw = getSetting(SETTINGS_KEYS.RETRY_PATTERNS);
46
44
  if (!raw) {
47
45
  const oldXmlProtection = getSetting("llm.disableXmlProtection");
@@ -209,7 +207,6 @@ async function runAgentTurn(options, turnMetrics, agentId, append, callbacks) {
209
207
  const allAgents = await loadAllAgentsDefault();
210
208
  const agentDef = findAgentById(agentId, allAgents) ?? findAgentById("planner", allAgents);
211
209
  injectAgentReminder(options.sessionId, agentDef);
212
- const subAgentDefs = getSubAgents(allAgents);
213
210
  const { content: instructionContent } = await getAllInstructions(
214
211
  options.sessionManager.requireSession(options.sessionId).workdir,
215
212
  options.sessionManager.requireSession(options.sessionId).projectId
@@ -228,44 +225,37 @@ async function runAgentTurn(options, turnMetrics, agentId, append, callbacks) {
228
225
  statsIdentity,
229
226
  signal: options.signal,
230
227
  onMessage: options.onMessage,
231
- assembleRequest: (input) => {
228
+ assembleRequest: async (input) => {
232
229
  const cached = options.sessionManager.getCachedPrompt(options.sessionId);
233
- const liveTools = createToolRegistry().definitions;
234
- const toolFingerprint = getToolFingerprint(liveTools);
235
230
  if (cached) {
231
+ const toolFingerprint = getToolFingerprint(cached.tools);
236
232
  const currentHash = computeDynamicContextHash(instructionContent ?? "", skills, toolFingerprint);
237
233
  if (cached.hash !== currentHash) {
238
234
  logger.debug("assembleRequest: hash mismatch", {
239
235
  sessionId: options.sessionId,
240
236
  cachedHash: cached.hash,
241
237
  currentHash,
242
- cachedTools: cached.tools.map((t) => t.function.name),
243
- liveTools: liveTools.map((t) => t.function.name)
238
+ cachedTools: cached.tools.map((t) => t.function.name)
244
239
  });
245
240
  options.sessionManager.setDynamicContextChanged(options.sessionId, true);
246
- options.sessionManager.setDebugDump(options.sessionId, {
247
- cachedPrompt: cached.systemPrompt.slice(0, 5e3),
248
- cachedTools: cached.tools.map((t) => t.function.name),
249
- liveTools: liveTools.map((t) => t.function.name)
250
- });
251
241
  }
252
242
  return createAssemblyResult({
253
243
  systemPrompt: cached.systemPrompt,
254
244
  messages: input.messages,
255
245
  injectedFiles: input.injectedFiles,
256
- requestTools: cached.tools.length > 0 ? cached.tools : liveTools,
246
+ requestTools: cached.tools,
257
247
  toolChoice: input.toolChoice
258
248
  });
259
249
  }
260
- const result = assembleAgentRequest({
261
- ...input,
262
- agentDef,
263
- subAgentDefs,
264
- modelName: options.llmClient.getModel()
250
+ const result = await buildCachedPrompt(options.sessionManager, options.sessionId, agentDef);
251
+ options.sessionManager.setCachedPrompt(options.sessionId, result.systemPrompt, result.tools, result.hash);
252
+ return createAssemblyResult({
253
+ systemPrompt: result.systemPrompt,
254
+ messages: input.messages,
255
+ injectedFiles: input.injectedFiles,
256
+ requestTools: result.tools,
257
+ toolChoice: input.toolChoice
265
258
  });
266
- const hash = computeDynamicContextHash(instructionContent ?? "", skills, toolFingerprint);
267
- options.sessionManager.setCachedPrompt(options.sessionId, result.systemPrompt, result.tools, hash);
268
- return result;
269
259
  },
270
260
  getToolRegistry: () => getToolRegistryForAgent(agentDef),
271
261
  getConversationMessages: buildGetConversationMessages(options.sessionId, options.llmClient, append),
@@ -320,4 +310,4 @@ export {
320
310
  runAgentTurn,
321
311
  injectWorkflowKickoffIfNeeded
322
312
  };
323
- //# sourceMappingURL=chunk-ZRKYDC4O.js.map
313
+ //# sourceMappingURL=chunk-EB2RIVZA.js.map
@@ -2,24 +2,21 @@ import {
2
2
  injectWorkflowKickoffIfNeeded,
3
3
  runAgentTurn,
4
4
  runChatTurn
5
- } from "./chunk-ZRKYDC4O.js";
5
+ } from "./chunk-EB2RIVZA.js";
6
6
  import {
7
7
  applyDynamicContext,
8
8
  checkAborted,
9
- computeDynamicContextHash,
9
+ computeSessionHash,
10
10
  deleteItemFromDir,
11
11
  devServerManager,
12
12
  executeSubAgent,
13
13
  findAgentById,
14
- getAllInstructions,
15
- getEnabledSkillMetadata,
16
- getToolFingerprint,
17
14
  getToolRegistryForAgent,
18
15
  jsonSerializer,
19
16
  loadAllAgentsDefault,
20
17
  saveItemToDir,
21
18
  spawnShellProcess
22
- } from "./chunk-JCOLS2ZM.js";
19
+ } from "./chunk-XJU2PBLN.js";
23
20
  import {
24
21
  getPlatformShell,
25
22
  onProcessEvent
@@ -43,16 +40,16 @@ import {
43
40
  } from "./chunk-EU3WWTFH.js";
44
41
  import {
45
42
  appendCompactionPrompt
46
- } from "./chunk-SSWRM5BT.js";
43
+ } from "./chunk-ZMONCXGW.js";
47
44
  import {
48
45
  TurnMetrics,
49
46
  createMessageStartEvent
50
- } from "./chunk-SS3F2VYF.js";
47
+ } from "./chunk-OSMUHB5F.js";
51
48
  import {
52
49
  getCurrentContextWindowId,
53
50
  getEventStore,
54
51
  getRuntimeConfig
55
- } from "./chunk-M7M2VH45.js";
52
+ } from "./chunk-WTDCC4IP.js";
56
53
  import {
57
54
  createLLMClient
58
55
  } from "./chunk-QYP6MOB5.js";
@@ -768,6 +765,10 @@ async function executeWorkflow(workflow, options, subGroup) {
768
765
  stepOutput: lastStepOutput
769
766
  };
770
767
  sessionManager.setPhase(sessionId, step.phase);
768
+ if (step.type === "agent") {
769
+ const agentStep = step;
770
+ sessionManager.setMode(sessionId, agentStep.agentId ?? "planner");
771
+ }
771
772
  logger.debug("Workflow step executing", { sessionId, iteration: iterations, stepId: step.id, stepType: step.type });
772
773
  let stepOutcome = null;
773
774
  switch (step.type) {
@@ -1773,14 +1774,7 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
1773
1774
  (async () => {
1774
1775
  try {
1775
1776
  await mcpReadyPromise;
1776
- const { content: instructionContent } = await getAllInstructions(session.workdir, session.projectId);
1777
- const runtimeConfig = getRuntimeConfig();
1778
- const configDir = getGlobalConfigDir(runtimeConfig.mode ?? "production");
1779
- const skills = await getEnabledSkillMetadata(configDir, runtimeConfig.workdir);
1780
- const { createToolRegistry } = await import("./tools-G3KFVM2A.js");
1781
- const allTools = createToolRegistry().definitions;
1782
- const toolFingerprint = getToolFingerprint(allTools);
1783
- const currentHash = computeDynamicContextHash(instructionContent, skills, toolFingerprint);
1777
+ const currentHash = await computeSessionHash(sessionManager, session.id);
1784
1778
  if (currentHash !== cachedHash) {
1785
1779
  sessionManager.setDynamicContextChanged(session.id, true);
1786
1780
  sendContextState();
@@ -1842,26 +1836,17 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
1842
1836
  return;
1843
1837
  }
1844
1838
  const sessionId = client.activeSessionId;
1845
- const session = sessionManager.requireSession(sessionId);
1846
1839
  (async () => {
1847
1840
  try {
1848
1841
  await mcpReadyPromise;
1849
- const { content: instructionContent } = await getAllInstructions(session.workdir, session.projectId);
1850
- const runtimeConfig = getRuntimeConfig();
1851
- const configDir = getGlobalConfigDir(runtimeConfig.mode ?? "production");
1852
- const skills = await getEnabledSkillMetadata(configDir, runtimeConfig.workdir);
1853
- const { createToolRegistry } = await import("./tools-G3KFVM2A.js");
1854
- const allTools = createToolRegistry().definitions;
1855
- const toolFingerprint = getToolFingerprint(allTools);
1856
- const currentHash = computeDynamicContextHash(instructionContent, skills, toolFingerprint);
1842
+ const currentHash = await computeSessionHash(sessionManager, sessionId);
1857
1843
  const cachedHash = sessionManager.getCachedPrompt(sessionId)?.hash;
1858
1844
  if (cachedHash) {
1859
1845
  if (currentHash !== cachedHash) {
1860
1846
  logger.debug("checkDynamic: hash mismatch", {
1861
1847
  sessionId,
1862
1848
  cachedHash,
1863
- currentHash,
1864
- toolCount: allTools.length
1849
+ currentHash
1865
1850
  });
1866
1851
  if (!sessionManager.getDynamicContextChanged(sessionId)) {
1867
1852
  sessionManager.setDynamicContextChanged(sessionId, true);
@@ -2071,4 +2056,4 @@ export {
2071
2056
  signalMcpReady,
2072
2057
  createWebSocketServer
2073
2058
  };
2074
- //# sourceMappingURL=chunk-EQUVYCW5.js.map
2059
+ //# sourceMappingURL=chunk-IBKGV6OJ.js.map
@@ -21,7 +21,7 @@ import {
21
21
  tokenFromPassword,
22
22
  verifyPassword,
23
23
  workflowExists
24
- } from "./chunk-EQUVYCW5.js";
24
+ } from "./chunk-IBKGV6OJ.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-XJU2PBLN.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.31";
3443
+ var VERSION = "2.0.33";
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-RHYGD2Q6.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-2QBZBNDL.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-2QBZBNDL.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-2QBZBNDL.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-2QBZBNDL.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-YCFYRTFG.js");
4015
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-2QBZBNDL.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-2QBZBNDL.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-VGVPSVGE.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-2Q46DWWO.js.map
4897
+ //# sourceMappingURL=chunk-IYEZ6CAW.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/settings.ts
6
6
  var SETTINGS_KEYS = {
@@ -90,4 +90,4 @@ export {
90
90
  deleteSetting,
91
91
  getAllSettings
92
92
  };
93
- //# sourceMappingURL=chunk-M2YRM64Q.js.map
93
+ //# sourceMappingURL=chunk-JNSSFTVD.js.map