openfox 2.0.36 → 2.0.38

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 (40) hide show
  1. package/dist/{chat-handler-GZOH45BG.js → chat-handler-TPKAEATB.js} +9 -9
  2. package/dist/{chunk-OSMUHB5F.js → chunk-55RWNJBT.js} +6 -2
  3. package/dist/{chunk-GIR5N4A3.js → chunk-7W2WATAO.js} +6 -6
  4. package/dist/{chunk-Z3RKDS6H.js → chunk-ATBNY4CL.js} +169 -47
  5. package/dist/{chunk-6PLAWCHQ.js → chunk-EHYFYQXY.js} +4 -2
  6. package/dist/{chunk-PWY6EBZ6.js → chunk-EZ3BPIUV.js} +9 -2
  7. package/dist/{chunk-U4ZRBCSO.js → chunk-FFQCZ2MI.js} +5 -5
  8. package/dist/{chunk-ZXELI3WY.js → chunk-GZZW4XSI.js} +7 -7
  9. package/dist/{chunk-QCVPT2LZ.js → chunk-HJ7KRYWX.js} +81 -31
  10. package/dist/{chunk-BGCDJYNU.js → chunk-JGNAYJJZ.js} +6 -5
  11. package/dist/{chunk-WTDCC4IP.js → chunk-NF6WHQAT.js} +9 -2
  12. package/dist/{chunk-DHOOJDHX.js → chunk-SM2PK6TV.js} +4 -4
  13. package/dist/{chunk-ZMONCXGW.js → chunk-WXAOEWJS.js} +3 -3
  14. package/dist/{chunk-ZJ4FP6RS.js → chunk-Z6W4YHJB.js} +7 -1
  15. package/dist/{chunk-QYP6MOB5.js → chunk-ZBLT7MNL.js} +2 -2
  16. package/dist/cli/dev.js +1 -1
  17. package/dist/cli/index.js +1 -1
  18. package/dist/{client-X6BVH4Q4.js → client-XTPAYYRH.js} +3 -3
  19. package/dist/{client-pure-5NOTSIRK.js → client-pure-N2MOIDQ6.js} +2 -2
  20. package/dist/{compactor-SHEOFZDB.js → compactor-RZA5VSRT.js} +6 -6
  21. package/dist/{config-QI3KOU42.js → config-XOXIIBUY.js} +2 -2
  22. package/dist/{events-YLICLPBY.js → events-KZZPCW2Q.js} +3 -3
  23. package/dist/{folding-PI67HWBR.js → folding-ENYH4LMG.js} +2 -2
  24. package/dist/{orchestrator-3WHRUJSV.js → orchestrator-ZFBVVQBO.js} +8 -8
  25. package/dist/package.json +1 -1
  26. package/dist/{processor-3C6MIX7N.js → processor-NG4NH2SS.js} +9 -9
  27. package/dist/{protocol-BC1QSQ-Y.d.ts → protocol-COpRaEpx.d.ts} +1 -0
  28. package/dist/{provider-SHGBQRFO.js → provider-JLLIB72V.js} +6 -6
  29. package/dist/{provider-manager-5742XBEI.js → provider-manager-GTWFGTCV.js} +4 -4
  30. package/dist/{serve-3SIVWL3C.js → serve-VIWHYE6X.js} +13 -13
  31. package/dist/server/index.d.ts +2 -2
  32. package/dist/server/index.js +12 -12
  33. package/dist/{server-A5IUSVLK.js → server-MEJPUI4S.js} +11 -11
  34. package/dist/shared/index.d.ts +2 -2
  35. package/dist/{tools-FJ63BHW2.js → tools-ATO5MSWX.js} +7 -7
  36. package/dist/web/assets/{index-DIvNnXne.css → index-GFd2V-Ja.css} +1 -1
  37. package/dist/web/assets/{index-tTqXCWKx.js → index-I3ZLVKAn.js} +57 -56
  38. package/dist/web/index.html +2 -2
  39. package/dist/web/sw.js +1 -1
  40. package/package.json +1 -1
@@ -2,11 +2,11 @@ import {
2
2
  buildRunChatTurnParams,
3
3
  finalizeTurnCompletion,
4
4
  generateSessionNameForSession
5
- } from "./chunk-BGCDJYNU.js";
5
+ } from "./chunk-JGNAYJJZ.js";
6
6
  import {
7
7
  runChatTurn
8
- } from "./chunk-U4ZRBCSO.js";
9
- import "./chunk-QCVPT2LZ.js";
8
+ } from "./chunk-FFQCZ2MI.js";
9
+ import "./chunk-HJ7KRYWX.js";
10
10
  import "./chunk-DL6ZILAF.js";
11
11
  import "./chunk-PBGOZMVY.js";
12
12
  import "./chunk-VRGRAQDG.js";
@@ -19,18 +19,18 @@ import {
19
19
  import "./chunk-EU3WWTFH.js";
20
20
  import "./chunk-JNSSFTVD.js";
21
21
  import "./chunk-YQ3SOPBI.js";
22
- import "./chunk-OSMUHB5F.js";
22
+ import "./chunk-55RWNJBT.js";
23
23
  import {
24
24
  getEventStore
25
- } from "./chunk-WTDCC4IP.js";
26
- import "./chunk-6PLAWCHQ.js";
25
+ } from "./chunk-NF6WHQAT.js";
26
+ import "./chunk-EHYFYQXY.js";
27
27
  import "./chunk-ZPIZLTWU.js";
28
28
  import "./chunk-J2GP3J3X.js";
29
29
  import "./chunk-Z4FMBCJO.js";
30
- import "./chunk-ZJ4FP6RS.js";
30
+ import "./chunk-Z6W4YHJB.js";
31
31
  import "./chunk-K44MW7JJ.js";
32
32
  import "./chunk-YD6NDTKF.js";
33
- import "./chunk-PWY6EBZ6.js";
33
+ import "./chunk-EZ3BPIUV.js";
34
34
  import "./chunk-CQGTEGKL.js";
35
35
  import "./chunk-V4IE7HJY.js";
36
36
 
@@ -145,4 +145,4 @@ export {
145
145
  startChatSession,
146
146
  stopSessionExecution
147
147
  };
148
- //# sourceMappingURL=chat-handler-GZOH45BG.js.map
148
+ //# sourceMappingURL=chat-handler-TPKAEATB.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-Z4FMBCJO.js";
7
7
  import {
8
8
  buildModelParams
9
- } from "./chunk-ZJ4FP6RS.js";
9
+ } from "./chunk-Z6W4YHJB.js";
10
10
  import {
11
11
  logger
12
12
  } from "./chunk-K44MW7JJ.js";
@@ -69,6 +69,10 @@ Platform: ${process.platform} (${process.arch})${modelLine}
69
69
  - If the current runtime reminder says build mode, focus on implementation, verification, and completing approved criteria.
70
70
  - Respect tool and permission constraints enforced by the server even if the conversation suggests otherwise.
71
71
 
72
+ ## FILE REFERENCES
73
+ - The user may reference files or directories with an @ prefix, e.g. @src/index.ts or @web/components/.
74
+ - These are paths relative to the working directory above. Strip the leading @ and resolve against the working directory \u2014 never treat an @-reference as an absolute path.
75
+
72
76
  ## IMPORTANT GUARDRAILS
73
77
  - NEVER delete/git checkout an already modified file: that would result in a data loss.
74
78
 
@@ -701,4 +705,4 @@ export {
701
705
  createChatDoneEvent,
702
706
  consumeStreamGenerator
703
707
  };
704
- //# sourceMappingURL=chunk-OSMUHB5F.js.map
708
+ //# sourceMappingURL=chunk-55RWNJBT.js.map
@@ -33,7 +33,7 @@ Options:
33
33
  }
34
34
  async function runNetworkSetup(mode) {
35
35
  const { loadAuthConfig, saveAuthConfig, encryptPassword } = await import("./auth-56SIRACI.js");
36
- const { saveGlobalConfig } = await import("./config-QI3KOU42.js");
36
+ const { saveGlobalConfig } = await import("./config-XOXIIBUY.js");
37
37
  const { getAuthKeyPath } = await import("./paths-X46PPOI2.js");
38
38
  const existingAuth = await loadAuthConfig(mode);
39
39
  if (existingAuth) {
@@ -100,7 +100,7 @@ async function runNetworkSetup(mode) {
100
100
  console.log("\u2713 Configuration saved!\n");
101
101
  }
102
102
  async function runConfig(mode) {
103
- const { loadGlobalConfig, getActiveProvider, getDefaultModel } = await import("./config-QI3KOU42.js");
103
+ const { loadGlobalConfig, getActiveProvider, getDefaultModel } = await import("./config-XOXIIBUY.js");
104
104
  const { getGlobalConfigPath } = await import("./paths-X46PPOI2.js");
105
105
  const config = await loadGlobalConfig(mode);
106
106
  const configPath = getGlobalConfigPath(mode);
@@ -158,7 +158,7 @@ async function runCli(options) {
158
158
  break;
159
159
  }
160
160
  case "provider": {
161
- const { runProviderCommand } = await import("./provider-SHGBQRFO.js");
161
+ const { runProviderCommand } = await import("./provider-JLLIB72V.js");
162
162
  const [, subcommand] = positionals;
163
163
  await runProviderCommand(mode, subcommand);
164
164
  break;
@@ -197,12 +197,12 @@ async function runCli(options) {
197
197
  break;
198
198
  }
199
199
  default: {
200
- const { configFileExists } = await import("./config-QI3KOU42.js");
200
+ const { configFileExists } = await import("./config-XOXIIBUY.js");
201
201
  const configExists = await configFileExists(mode);
202
202
  if (!configExists) {
203
203
  await runNetworkSetup(mode);
204
204
  }
205
- const { runServe } = await import("./serve-3SIVWL3C.js");
205
+ const { runServe } = await import("./serve-VIWHYE6X.js");
206
206
  const serveOptions = { mode };
207
207
  if (values.port) serveOptions.port = parseInt(values.port);
208
208
  if (values["no-browser"] === true) serveOptions.openBrowser = false;
@@ -214,4 +214,4 @@ async function runCli(options) {
214
214
  export {
215
215
  runCli
216
216
  };
217
- //# sourceMappingURL=chunk-GIR5N4A3.js.map
217
+ //# sourceMappingURL=chunk-7W2WATAO.js.map
@@ -21,7 +21,7 @@ import {
21
21
  tokenFromPassword,
22
22
  verifyPassword,
23
23
  workflowExists
24
- } from "./chunk-ZXELI3WY.js";
24
+ } from "./chunk-GZZW4XSI.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-QCVPT2LZ.js";
64
+ } from "./chunk-HJ7KRYWX.js";
65
65
  import {
66
66
  getPathSeparator,
67
67
  isAbsolutePath
@@ -82,7 +82,7 @@ import {
82
82
  ALWAYS_ALLOWED,
83
83
  ALWAYS_ALLOWED_FOR_SUBAGENTS,
84
84
  TOP_LEVEL_ONLY_TOOLS
85
- } from "./chunk-OSMUHB5F.js";
85
+ } from "./chunk-55RWNJBT.js";
86
86
  import {
87
87
  createSession,
88
88
  deleteSession,
@@ -109,14 +109,14 @@ import {
109
109
  updateSessionMetadata,
110
110
  updateSessionProvider,
111
111
  updateSessionRunning
112
- } from "./chunk-WTDCC4IP.js";
112
+ } from "./chunk-NF6WHQAT.js";
113
113
  import {
114
114
  initDatabase
115
115
  } from "./chunk-ZPIZLTWU.js";
116
116
  import {
117
117
  createProviderManager,
118
118
  parseDefaultModelSelection
119
- } from "./chunk-DHOOJDHX.js";
119
+ } from "./chunk-SM2PK6TV.js";
120
120
  import {
121
121
  detectModel,
122
122
  getLlmStatus
@@ -1420,8 +1420,10 @@ function estimateToolTokens(toolName, description, inputSchema) {
1420
1420
  var McpManager = class {
1421
1421
  servers = /* @__PURE__ */ new Map();
1422
1422
  onServersChanged;
1423
+ onToolsDiscovered;
1423
1424
  constructor(options) {
1424
1425
  this.onServersChanged = options?.onServersChanged;
1426
+ this.onToolsDiscovered = options?.onToolsDiscovered;
1425
1427
  }
1426
1428
  async addServer(name, config4) {
1427
1429
  if (this.servers.has(name)) {
@@ -1481,12 +1483,34 @@ var McpManager = class {
1481
1483
  entry.client = client;
1482
1484
  entry.transport = transport;
1483
1485
  entry.state = { name, config: entry.config, status: "connected", tools, estimatedTokens: totalTokens };
1486
+ const cachedTools = tools.map((t) => ({
1487
+ name: t.name,
1488
+ ...t.description ? { description: t.description } : {},
1489
+ inputSchema: t.inputSchema,
1490
+ estimatedTokens: t.estimatedTokens
1491
+ }));
1492
+ entry.config.cachedTools = cachedTools;
1493
+ this.onToolsDiscovered?.(name, cachedTools);
1484
1494
  logger.info("Connected to MCP server", { name, toolCount: tools.length });
1485
1495
  this.onServersChanged?.();
1486
1496
  } catch (error) {
1487
1497
  const msg = error instanceof Error ? error.message : String(error);
1488
1498
  logger.error("Failed to connect MCP server", { name, error: msg });
1489
- entry.state = { name, config: entry.config, status: "error", tools: [], estimatedTokens: 0, error: msg };
1499
+ const cachedTools = entry.config.cachedTools;
1500
+ if (cachedTools && cachedTools.length > 0) {
1501
+ const disabledSet = new Set(entry.config.disabledTools ?? []);
1502
+ const tools = cachedTools.map((t) => ({
1503
+ name: t.name,
1504
+ description: t.description ?? "",
1505
+ inputSchema: t.inputSchema,
1506
+ enabled: !disabledSet.has(t.name),
1507
+ estimatedTokens: t.estimatedTokens
1508
+ }));
1509
+ const totalTokens = tools.filter((t) => t.enabled).reduce((sum, t) => sum + t.estimatedTokens, 0);
1510
+ entry.state = { name, config: entry.config, status: "error", tools, estimatedTokens: totalTokens, error: msg };
1511
+ } else {
1512
+ entry.state = { name, config: entry.config, status: "error", tools: [], estimatedTokens: 0, error: msg };
1513
+ }
1490
1514
  this.onServersChanged?.();
1491
1515
  }
1492
1516
  }
@@ -2190,8 +2214,9 @@ var SessionManager = class {
2190
2214
  }
2191
2215
  getCurrentModelSettings() {
2192
2216
  const model = this.providerManager.getCurrentModel();
2193
- if (!model) return void 0;
2194
- return this.providerManager.getModelSettings(model);
2217
+ const providerId = this.providerManager.getActiveProviderId();
2218
+ if (!model || !providerId) return void 0;
2219
+ return this.providerManager.getModelSettings(providerId, model);
2195
2220
  }
2196
2221
  getCurrentModelContext() {
2197
2222
  return this.providerManager.getCurrentModelContext();
@@ -3435,12 +3460,91 @@ function createDirectoryRoutes() {
3435
3460
  return router;
3436
3461
  }
3437
3462
 
3438
- // src/server/routes/auto-update.ts
3463
+ // src/server/routes/file-search.ts
3439
3464
  import { Router as Router6 } from "express";
3465
+ import fg from "fast-glob";
3466
+ function createFileSearchRoutes() {
3467
+ const router = Router6();
3468
+ router.get("/", async (req, res) => {
3469
+ const query = req.query["q"] || "";
3470
+ const workdir = req.query["workdir"] || process.cwd();
3471
+ try {
3472
+ const results = await searchFiles(query, workdir);
3473
+ res.json(results);
3474
+ } catch {
3475
+ res.status(500).json({ error: "File search failed" });
3476
+ }
3477
+ });
3478
+ return router;
3479
+ }
3480
+ async function searchFiles(query, workdir) {
3481
+ const entries = await fg(["**/*"], {
3482
+ cwd: workdir,
3483
+ dot: true,
3484
+ deep: 5,
3485
+ onlyFiles: false,
3486
+ ignore: [
3487
+ "**/node_modules/**",
3488
+ "**/.git/**",
3489
+ "**/dist/**",
3490
+ "**/.next/**",
3491
+ "**/.cache/**",
3492
+ "**/__pycache__/**",
3493
+ "**/*.lock",
3494
+ "**/.openfox/**"
3495
+ ],
3496
+ objectMode: true
3497
+ });
3498
+ const scored = [];
3499
+ for (const entry of entries) {
3500
+ const filePath = entry.path;
3501
+ let score = fuzzyScore(filePath, query);
3502
+ if (score === 0) {
3503
+ continue;
3504
+ }
3505
+ const isDir = entry.dirent.isDirectory();
3506
+ if (isDir) {
3507
+ score += 10;
3508
+ }
3509
+ scored.push({
3510
+ path: filePath,
3511
+ name: filePath.split("/").pop() || filePath,
3512
+ type: isDir ? "directory" : "file",
3513
+ score
3514
+ });
3515
+ }
3516
+ scored.sort((a, b) => b.score - a.score);
3517
+ return scored.slice(0, 20);
3518
+ }
3519
+ function fuzzyScore(filePath, query) {
3520
+ if (!query) {
3521
+ return 1;
3522
+ }
3523
+ const fileName = filePath.split("/").pop() || filePath;
3524
+ const fileNameLower = fileName.toLowerCase();
3525
+ const fullPathLower = filePath.toLowerCase();
3526
+ const lowerQuery = query.toLowerCase();
3527
+ if (fileNameLower === lowerQuery) {
3528
+ return 100;
3529
+ }
3530
+ if (fileNameLower.startsWith(lowerQuery)) {
3531
+ return 80;
3532
+ }
3533
+ if (fileNameLower.includes(lowerQuery)) {
3534
+ return 60;
3535
+ }
3536
+ if (fullPathLower.includes(lowerQuery)) {
3537
+ return 40;
3538
+ }
3539
+ return 0;
3540
+ }
3541
+
3542
+ // src/server/routes/auto-update.ts
3543
+ import { Router as Router7 } from "express";
3440
3544
  import { spawn as spawn2 } from "child_process";
3441
3545
 
3442
3546
  // src/constants.ts
3443
- var VERSION = "2.0.36";
3547
+ var VERSION = "2.0.38";
3444
3548
 
3445
3549
  // src/server/routes/auto-update.ts
3446
3550
  var updateInProgress = false;
@@ -3458,7 +3562,7 @@ async function checkAuth(req, opts) {
3458
3562
  return true;
3459
3563
  }
3460
3564
  function createAutoUpdateRoutes(options = {}) {
3461
- const router = Router6();
3565
+ const router = Router7();
3462
3566
  router.get("/check", async (_req, res) => {
3463
3567
  const isService = isRunningAsService();
3464
3568
  const current = VERSION;
@@ -3604,7 +3708,24 @@ async function createServerHandle(config4) {
3604
3708
  (err) => logger.error("LLM initialization failed", { error: err instanceof Error ? err.message : String(err) })
3605
3709
  );
3606
3710
  const toolRegistry = createToolRegistry();
3607
- const mcpManager = new McpManager();
3711
+ const mcpManager = new McpManager({
3712
+ onToolsDiscovered: async (name, tools) => {
3713
+ try {
3714
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-XOXIIBUY.js");
3715
+ const mode = config4.mode ?? "production";
3716
+ const globalConfig = await loadGlobalConfig(mode);
3717
+ const mcpServers2 = {
3718
+ ...globalConfig.mcpServers ?? {}
3719
+ };
3720
+ if (mcpServers2[name]) {
3721
+ mcpServers2[name] = { ...mcpServers2[name], cachedTools: tools };
3722
+ await saveGlobalConfig(mode, { ...globalConfig, mcpServers: mcpServers2 });
3723
+ }
3724
+ } catch (err) {
3725
+ logger.warn("Failed to persist MCP tool cache", { name, error: String(err) });
3726
+ }
3727
+ }
3728
+ });
3608
3729
  setMcpManagerForTools(mcpManager);
3609
3730
  setMcpConfigMode(config4.mode ?? "production");
3610
3731
  const mcpServers = config4.mcpServers ?? {};
@@ -3620,7 +3741,7 @@ async function createServerHandle(config4) {
3620
3741
  setMcpTools(mcpTools);
3621
3742
  logger.info("MCP tools registered", { count: mcpTools.length });
3622
3743
  }
3623
- const { signalMcpReady } = await import("./server-A5IUSVLK.js");
3744
+ const { signalMcpReady } = await import("./server-MEJPUI4S.js");
3624
3745
  signalMcpReady();
3625
3746
  });
3626
3747
  const app = express();
@@ -3778,7 +3899,7 @@ async function createServerHandle(config4) {
3778
3899
  res.json({ project });
3779
3900
  });
3780
3901
  app.get("/api/sessions", async (req, res) => {
3781
- const { getRecentUserPromptsForSession } = await import("./events-YLICLPBY.js");
3902
+ const { getRecentUserPromptsForSession } = await import("./events-KZZPCW2Q.js");
3782
3903
  const projectId = req.query["projectId"];
3783
3904
  const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
3784
3905
  const offset = parseInt(req.query["offset"]) || 0;
@@ -3811,9 +3932,9 @@ async function createServerHandle(config4) {
3811
3932
  res.status(201).json({ session });
3812
3933
  });
3813
3934
  app.get("/api/sessions/:id", async (req, res) => {
3814
- const { getEventStore: getEventStore2 } = await import("./events-YLICLPBY.js");
3815
- const { buildMessagesFromStoredEvents } = await import("./folding-PI67HWBR.js");
3816
- const { getPendingQuestionsForSession } = await import("./tools-FJ63BHW2.js");
3935
+ const { getEventStore: getEventStore2 } = await import("./events-KZZPCW2Q.js");
3936
+ const { buildMessagesFromStoredEvents } = await import("./folding-ENYH4LMG.js");
3937
+ const { getPendingQuestionsForSession } = await import("./tools-ATO5MSWX.js");
3817
3938
  const session = sessionManager.getSession(req.params.id);
3818
3939
  if (!session) {
3819
3940
  return res.status(404).json({ error: "Session not found" });
@@ -3844,8 +3965,8 @@ async function createServerHandle(config4) {
3844
3965
  res.json({ success: true });
3845
3966
  });
3846
3967
  app.post("/api/sessions/:id/provider", async (req, res) => {
3847
- const { getEventStore: getEventStore2 } = await import("./events-YLICLPBY.js");
3848
- const { buildMessagesFromStoredEvents } = await import("./folding-PI67HWBR.js");
3968
+ const { getEventStore: getEventStore2 } = await import("./events-KZZPCW2Q.js");
3969
+ const { buildMessagesFromStoredEvents } = await import("./folding-ENYH4LMG.js");
3849
3970
  const sessionId = req.params.id;
3850
3971
  const session = sessionManager.getSession(sessionId);
3851
3972
  if (!session) {
@@ -3858,7 +3979,7 @@ async function createServerHandle(config4) {
3858
3979
  const provider = providerManager.getProviders().find((p) => p.id === providerId);
3859
3980
  const resolvedModel = model ?? provider?.models?.[0]?.id ?? "auto";
3860
3981
  sessionManager.setSessionProvider(sessionId, providerId, resolvedModel);
3861
- const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-QI3KOU42.js");
3982
+ const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-XOXIIBUY.js");
3862
3983
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
3863
3984
  const updatedConfig = setDefaultModelSelection(globalConfig, providerId, resolvedModel);
3864
3985
  await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
@@ -3907,8 +4028,8 @@ async function createServerHandle(config4) {
3907
4028
  res.json({ success: true });
3908
4029
  });
3909
4030
  app.put("/api/sessions/:id/mode", async (req, res) => {
3910
- const { getEventStore: getEventStore2 } = await import("./events-YLICLPBY.js");
3911
- const { buildMessagesFromStoredEvents } = await import("./folding-PI67HWBR.js");
4031
+ const { getEventStore: getEventStore2 } = await import("./events-KZZPCW2Q.js");
4032
+ const { buildMessagesFromStoredEvents } = await import("./folding-ENYH4LMG.js");
3912
4033
  const sessionId = req.params.id;
3913
4034
  const session = sessionManager.getSession(sessionId);
3914
4035
  if (!session) {
@@ -3964,15 +4085,15 @@ async function createServerHandle(config4) {
3964
4085
  if (!callId || approved === void 0) {
3965
4086
  return res.status(400).json({ error: "callId and approved are required" });
3966
4087
  }
3967
- const { providePathConfirmation } = await import("./tools-FJ63BHW2.js");
4088
+ const { providePathConfirmation } = await import("./tools-ATO5MSWX.js");
3968
4089
  const result = providePathConfirmation(callId, approved, alwaysAllow);
3969
4090
  if (!result.found) {
3970
4091
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
3971
4092
  }
3972
- const { getEventStore: getEventStore2 } = await import("./events-YLICLPBY.js");
3973
- const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-PI67HWBR.js");
4093
+ const { getEventStore: getEventStore2 } = await import("./events-KZZPCW2Q.js");
4094
+ const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-ENYH4LMG.js");
3974
4095
  const { createSessionStateMessage } = await import("./protocol-BKNLAEPJ.js");
3975
- const { getPendingQuestionsForSession } = await import("./tools-FJ63BHW2.js");
4096
+ const { getPendingQuestionsForSession } = await import("./tools-ATO5MSWX.js");
3976
4097
  const eventStore = getEventStore2();
3977
4098
  const events = eventStore.getEvents(sessionId);
3978
4099
  const messages = buildMessagesFromStoredEvents(events);
@@ -3993,7 +4114,7 @@ async function createServerHandle(config4) {
3993
4114
  if (!skip && typeof answer !== "string") {
3994
4115
  return res.status(400).json({ error: "answer is required when not skipping" });
3995
4116
  }
3996
- const { provideAnswer } = await import("./tools-FJ63BHW2.js");
4117
+ const { provideAnswer } = await import("./tools-ATO5MSWX.js");
3997
4118
  const found = provideAnswer(callId, answer ?? "", skip ?? false);
3998
4119
  if (!found) {
3999
4120
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -4029,15 +4150,15 @@ async function createServerHandle(config4) {
4029
4150
  if (!session) {
4030
4151
  return res.status(404).json({ error: "Session not found" });
4031
4152
  }
4032
- const { stopSessionExecution } = await import("./chat-handler-GZOH45BG.js");
4033
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-FJ63BHW2.js");
4153
+ const { stopSessionExecution } = await import("./chat-handler-TPKAEATB.js");
4154
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-ATO5MSWX.js");
4034
4155
  const queuedMessages = sessionManager.getQueueState(sessionId);
4035
4156
  sessionManager.clearMessageQueue(sessionId);
4036
4157
  stopSessionExecution(sessionId, sessionManager);
4037
4158
  abortSession(sessionId);
4038
4159
  cancelQuestionsForSession(sessionId, "Session stopped by user");
4039
4160
  cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
4040
- const eventStore = (await import("./events-YLICLPBY.js")).getEventStore();
4161
+ const eventStore = (await import("./events-KZZPCW2Q.js")).getEventStore();
4041
4162
  eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
4042
4163
  res.json({ success: true, queuedMessages });
4043
4164
  });
@@ -4051,7 +4172,7 @@ async function createServerHandle(config4) {
4051
4172
  if (typeof messageIndex !== "number" || messageIndex < 0) {
4052
4173
  return res.status(400).json({ error: "messageIndex must be a non-negative number" });
4053
4174
  }
4054
- const { truncateSessionMessages } = await import("./events-YLICLPBY.js");
4175
+ const { truncateSessionMessages } = await import("./events-KZZPCW2Q.js");
4055
4176
  truncateSessionMessages(sessionId, messageIndex);
4056
4177
  res.json({ success: true });
4057
4178
  });
@@ -4069,7 +4190,7 @@ async function createServerHandle(config4) {
4069
4190
  if (!msg) {
4070
4191
  return res.status(400).json({ error: "Message not found at this index" });
4071
4192
  }
4072
- const { truncateSessionMessages } = await import("./events-YLICLPBY.js");
4193
+ const { truncateSessionMessages } = await import("./events-KZZPCW2Q.js");
4073
4194
  truncateSessionMessages(sessionId, messageIndex - 1);
4074
4195
  sessionManager.queueMessage(sessionId, "asap", msg.content, msg.attachments, msg.messageKind);
4075
4196
  res.json({ success: true });
@@ -4141,7 +4262,7 @@ async function createServerHandle(config4) {
4141
4262
  let visionFallback;
4142
4263
  let globalWorkdir;
4143
4264
  try {
4144
- const { loadGlobalConfig, getVisionFallback } = await import("./config-QI3KOU42.js");
4265
+ const { loadGlobalConfig, getVisionFallback } = await import("./config-XOXIIBUY.js");
4145
4266
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4146
4267
  const fallback = getVisionFallback(globalConfig);
4147
4268
  if (fallback) {
@@ -4238,7 +4359,7 @@ async function createServerHandle(config4) {
4238
4359
  const apiKey = req.query["apiKey"];
4239
4360
  if (!url) return res.status(400).json({ error: "url is required" });
4240
4361
  try {
4241
- const { fetchModelsWithContext } = await import("./provider-manager-5742XBEI.js");
4362
+ const { fetchModelsWithContext } = await import("./provider-manager-GTWFGTCV.js");
4242
4363
  const models = await fetchModelsWithContext(url, apiKey);
4243
4364
  if (models.length === 0) {
4244
4365
  return res.status(404).json({ error: `No models found at ${buildModelsUrl(url)}`, url });
@@ -4286,7 +4407,7 @@ async function createServerHandle(config4) {
4286
4407
  try {
4287
4408
  const { getModelProfile: getModelProfile2 } = await import("./profiles-Q36ELWQF.js");
4288
4409
  const { getBackendCapabilities } = await import("./backend-AGXWAU7A.js");
4289
- const { buildNonStreamingCreateParams } = await import("./client-pure-5NOTSIRK.js");
4410
+ const { buildNonStreamingCreateParams } = await import("./client-pure-N2MOIDQ6.js");
4290
4411
  const { OpenAIHttpClient } = await import("./http-client-SIPAW7IM.js");
4291
4412
  const { ensureVersionPrefix } = await import("./url-utils-QWAHP54Q.js");
4292
4413
  const profile = getModelProfile2(model);
@@ -4354,7 +4475,7 @@ async function createServerHandle(config4) {
4354
4475
  return res.status(400).json({ error: "name, url, and backend are required" });
4355
4476
  }
4356
4477
  try {
4357
- const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-QI3KOU42.js");
4478
+ const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-XOXIIBUY.js");
4358
4479
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4359
4480
  const providerBackend = backend;
4360
4481
  const providerModels = modelConfigs?.length ? buildModelConfigs(modelConfigs) : model ? [{ id: model, contextWindow: 2e5, source: "user" }] : [];
@@ -4392,7 +4513,7 @@ async function createServerHandle(config4) {
4392
4513
  app.post("/api/init/config", async (req, res) => {
4393
4514
  const { workdir, visionFallback } = req.body;
4394
4515
  try {
4395
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-QI3KOU42.js");
4516
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-XOXIIBUY.js");
4396
4517
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4397
4518
  const updatedConfig = {
4398
4519
  ...globalConfig,
@@ -4420,7 +4541,7 @@ async function createServerHandle(config4) {
4420
4541
  });
4421
4542
  app.delete("/api/providers/:id", async (req, res) => {
4422
4543
  const { id } = req.params;
4423
- const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-QI3KOU42.js");
4544
+ const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-XOXIIBUY.js");
4424
4545
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4425
4546
  const updatedConfig = removeProvider(globalConfig, id);
4426
4547
  await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
@@ -4432,7 +4553,7 @@ async function createServerHandle(config4) {
4432
4553
  const { id } = req.params;
4433
4554
  const { isLocal } = req.body;
4434
4555
  try {
4435
- const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-QI3KOU42.js");
4556
+ const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-XOXIIBUY.js");
4436
4557
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4437
4558
  const provider = globalConfig.providers.find((p) => p.id === id);
4438
4559
  if (!provider) {
@@ -4461,7 +4582,7 @@ async function createServerHandle(config4) {
4461
4582
  models: modelConfigs
4462
4583
  } = req.body;
4463
4584
  try {
4464
- const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-QI3KOU42.js");
4585
+ const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-XOXIIBUY.js");
4465
4586
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4466
4587
  const provider = globalConfig.providers.find((p) => p.id === id);
4467
4588
  if (!provider) {
@@ -4499,7 +4620,7 @@ async function createServerHandle(config4) {
4499
4620
  return res.status(400).json({ error: result.error });
4500
4621
  }
4501
4622
  const llmClient = getLLMClient();
4502
- const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-QI3KOU42.js");
4623
+ const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-XOXIIBUY.js");
4503
4624
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4504
4625
  const updatedConfig = setDefaultModelSelection(globalConfig, id, llmClient.getModel());
4505
4626
  await saveGlobalConfig(config4.mode ?? "production", updatedConfig);
@@ -4526,7 +4647,7 @@ async function createServerHandle(config4) {
4526
4647
  });
4527
4648
  async function rebuildMcpTools() {
4528
4649
  const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-B7QP6NLA.js");
4529
- const { setMcpTools: setMcpTools2 } = await import("./tools-FJ63BHW2.js");
4650
+ const { setMcpTools: setMcpTools2 } = await import("./tools-ATO5MSWX.js");
4530
4651
  const mcpTools = createMcpTools2(mcpManager);
4531
4652
  setMcpTools2(mcpTools);
4532
4653
  }
@@ -4588,7 +4709,7 @@ async function createServerHandle(config4) {
4588
4709
  };
4589
4710
  await mcpManager.addServer(name, serverCfg);
4590
4711
  const server = mcpManager.getServer(name);
4591
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-QI3KOU42.js");
4712
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-XOXIIBUY.js");
4592
4713
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4593
4714
  const updatedMcpServers = { ...globalConfig.mcpServers ?? {}, [name]: serverCfg };
4594
4715
  await saveGlobalConfig(config4.mode ?? "production", {
@@ -4614,7 +4735,7 @@ async function createServerHandle(config4) {
4614
4735
  return res.status(404).json({ error: `MCP server '${name}' not found` });
4615
4736
  }
4616
4737
  mcpManager.removeServer(name);
4617
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-QI3KOU42.js");
4738
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-XOXIIBUY.js");
4618
4739
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4619
4740
  const updatedMcpServers = { ...globalConfig.mcpServers ?? {} };
4620
4741
  delete updatedMcpServers[name];
@@ -4639,7 +4760,7 @@ async function createServerHandle(config4) {
4639
4760
  await mcpManager.setToolEnabled(name, toolName, enabled);
4640
4761
  const server = mcpManager.getServer(name);
4641
4762
  if (server) {
4642
- const { loadGlobalConfig, saveGlobalConfig } = await import("./config-QI3KOU42.js");
4763
+ const { loadGlobalConfig, saveGlobalConfig } = await import("./config-XOXIIBUY.js");
4643
4764
  const globalConfig = await loadGlobalConfig(config4.mode ?? "production");
4644
4765
  const mcpServers2 = { ...globalConfig.mcpServers ?? {} };
4645
4766
  const serverCfg = mcpServers2[name];
@@ -4710,6 +4831,7 @@ async function createServerHandle(config4) {
4710
4831
  await getCurrentBranch(req, res);
4711
4832
  });
4712
4833
  app.use("/api/directories", createDirectoryRoutes());
4834
+ app.use("/api/files", createFileSearchRoutes());
4713
4835
  const webDir = resolve3(__dirname3, "../../web");
4714
4836
  const isDev = config4.mode === "development";
4715
4837
  let viteServer;
@@ -4838,7 +4960,7 @@ async function createServerHandle(config4) {
4838
4960
  const state = sessionManager.getContextState(sessionId);
4839
4961
  wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
4840
4962
  });
4841
- const { QueueProcessor } = await import("./processor-3C6MIX7N.js");
4963
+ const { QueueProcessor } = await import("./processor-NG4NH2SS.js");
4842
4964
  const queueProcessor = new QueueProcessor({
4843
4965
  sessionManager,
4844
4966
  providerManager,
@@ -4913,4 +5035,4 @@ export {
4913
5035
  createServerHandle,
4914
5036
  createServer
4915
5037
  };
4916
- //# sourceMappingURL=chunk-Z3RKDS6H.js.map
5038
+ //# sourceMappingURL=chunk-ATBNY4CL.js.map
@@ -396,13 +396,15 @@ Error: ${data.result.error}` : `Error: ${data.result.error}`
396
396
  toolCallId: data.toolCallId
397
397
  };
398
398
  if (imageMeta?.dataUrl && imageMeta?.mimeType?.startsWith("image/")) {
399
+ const description = imageMeta["description"];
399
400
  toolMsg.attachments = [
400
401
  {
401
402
  id: crypto.randomUUID(),
402
403
  filename: imageMeta.path ?? "image",
403
404
  mimeType: imageMeta.mimeType,
404
405
  size: imageMeta.size ?? 0,
405
- data: imageMeta.dataUrl
406
+ data: imageMeta.dataUrl,
407
+ ...typeof description === "string" ? { description } : {}
406
408
  }
407
409
  ];
408
410
  }
@@ -831,4 +833,4 @@ export {
831
833
  buildSnapshot,
832
834
  buildSnapshotFromSessionState
833
835
  };
834
- //# sourceMappingURL=chunk-6PLAWCHQ.js.map
836
+ //# sourceMappingURL=chunk-EHYFYQXY.js.map
@@ -62,6 +62,12 @@ var visionFallbackSchema = z.object({
62
62
  timeout: z.number().default(120),
63
63
  backend: z.enum(["ollama", "openai"]).default("ollama")
64
64
  });
65
+ var cachedToolSchema = z.object({
66
+ name: z.string(),
67
+ description: z.string().optional(),
68
+ inputSchema: z.record(z.string(), z.unknown()),
69
+ estimatedTokens: z.number()
70
+ });
65
71
  var mcpServerSchema = z.object({
66
72
  transport: z.enum(["stdio", "http"]).default("stdio"),
67
73
  command: z.string().optional(),
@@ -69,7 +75,8 @@ var mcpServerSchema = z.object({
69
75
  env: z.record(z.string(), z.string()).optional(),
70
76
  url: z.string().optional(),
71
77
  headers: z.record(z.string(), z.string()).optional(),
72
- disabledTools: z.array(z.string()).optional()
78
+ disabledTools: z.array(z.string()).optional(),
79
+ cachedTools: z.array(cachedToolSchema).optional()
73
80
  });
74
81
  var defaultVisionFallback = {
75
82
  enabled: false,
@@ -395,4 +402,4 @@ export {
395
402
  activateProvider,
396
403
  mergeConfigs
397
404
  };
398
- //# sourceMappingURL=chunk-PWY6EBZ6.js.map
405
+ //# sourceMappingURL=chunk-EZ3BPIUV.js.map