openfox 2.0.57 → 2.0.59

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 (47) hide show
  1. package/dist/agent-defaults/explorer.agent.md +4 -0
  2. package/dist/{auto-config-F5Y6KAQ6.js → auto-config-T5GR2N6X.js} +20 -1
  3. package/dist/{backend-B23GIKKD.js → backend-P3GHHLHJ.js} +2 -2
  4. package/dist/{branch.api-5DMEAIBI.js → branch.api-LAN42BA5.js} +3 -2
  5. package/dist/{chat-handler-QO4XB66I.js → chat-handler-AS44EMQE.js} +9 -9
  6. package/dist/{chunk-QQ5XY6BH.js → chunk-43UFGATL.js} +16 -6
  7. package/dist/{chunk-DQCEXCDD.js → chunk-5MDIKIMG.js} +23 -12
  8. package/dist/{chunk-VZHN46NW.js → chunk-6VDCH5ML.js} +2 -2
  9. package/dist/{chunk-BIWVYBIE.js → chunk-BGTEIA2S.js} +4 -3
  10. package/dist/{chunk-WI6HGJ27.js → chunk-EKI5SZC7.js} +3 -3
  11. package/dist/{chunk-AGXBUC4M.js → chunk-FRU2X3IZ.js} +71 -31
  12. package/dist/{chunk-4566MTWM.js → chunk-GJU35MDV.js} +2 -2
  13. package/dist/{chunk-R2QCDYYR.js → chunk-H774GQJW.js} +53 -2
  14. package/dist/{chunk-ZZLCX7YT.js → chunk-JKLPWTUN.js} +2 -2
  15. package/dist/{chunk-5HOP4QF7.js → chunk-LQFCQ6PY.js} +107 -79
  16. package/dist/{chunk-UOKVBO67.js → chunk-NVPVDDQZ.js} +2 -2
  17. package/dist/{chunk-F7M2W46Q.js → chunk-P7C6KF2H.js} +9 -9
  18. package/dist/{chunk-ADOXTORQ.js → chunk-PK2RMVMB.js} +2 -2
  19. package/dist/{chunk-PSJON33Y.js → chunk-YHEQTVFV.js} +7 -1
  20. package/dist/cli/dev.js +2 -2
  21. package/dist/cli/index.js +2 -2
  22. package/dist/{client-Y3ESMMZA.js → client-KRFGMNGN.js} +3 -3
  23. package/dist/{compactor-ZKZYSNMD.js → compactor-Q33AJPCQ.js} +4 -4
  24. package/dist/{config-5ZHFKWOW.js → config-GMQUPNBY.js} +2 -2
  25. package/dist/{manager-CZOVNTSN.js → manager-344C5JLZ.js} +3 -3
  26. package/dist/{orchestrator-YMNKXVDF.js → orchestrator-MH7J2YVP.js} +8 -8
  27. package/dist/package.json +1 -1
  28. package/dist/{permissions-QLHZUEGW.js → permissions-CGEK3DGZ.js} +21 -17
  29. package/dist/{processor-2BB65JWR.js → processor-34MVJZTD.js} +9 -9
  30. package/dist/{project-creator-7RBHP6K6.js → project-creator-IDW7RACH.js} +4 -4
  31. package/dist/{protocol-DRe5K6Id.d.ts → protocol-J7khRG62.d.ts} +3 -1
  32. package/dist/{provider-V6Q6WJAF.js → provider-LBYBC5AG.js} +6 -6
  33. package/dist/{provider-manager-PR64DEN2.js → provider-manager-ABEUYU3K.js} +4 -4
  34. package/dist/{pwa-M6QZ52ZO.js → pwa-T6JRAYJB.js} +11 -10
  35. package/dist/{serve-WFQT6BP6.js → serve-NHF6B5RQ.js} +13 -13
  36. package/dist/server/index.d.ts +2 -2
  37. package/dist/server/index.js +12 -12
  38. package/dist/{server-V32ZOVU4.js → server-KDGQZNYQ.js} +11 -11
  39. package/dist/{service-YYJ5Y7CN.js → service-6DL3MJZD.js} +7 -5
  40. package/dist/shared/index.d.ts +2 -2
  41. package/dist/{store-NS2RMRA7.js → store-FXTCHBI4.js} +2 -2
  42. package/dist/{tools-L2SMYKJZ.js → tools-FQ54IAYG.js} +7 -7
  43. package/dist/web/assets/{index-CvIUuius.css → index-DjfRXOO7.css} +1 -1
  44. package/dist/web/assets/{index-CRW5qofP.js → index-Dqqp_j-f.js} +71 -71
  45. package/dist/web/index.html +2 -2
  46. package/dist/web/sw.js +1 -1
  47. package/package.json +1 -1
@@ -18,6 +18,10 @@ Your role is to investigate and map out code structure, find relevant files, and
18
18
  Guidelines:
19
19
 
20
20
  - Use run_command with grep/glob to discover code
21
+ - When using grep, ALWAYS exclude common non-source directories:
22
+ `--exclude-dir=node_modules --exclude-dir=.git --exclude-dir=dist --exclude-dir=.next --exclude-dir=build --exclude-dir=coverage`
23
+ - Respect `.gitignore` exclusion patterns when searching
24
+ - Prefer `rg` (ripgrep) if available — it respects `.gitignore` natively and is faster
21
25
  - Trace dependencies and imports to understand relationships
22
26
  - Identify patterns and conventions in the codebase
23
27
  - Report findings clearly with file paths and key observations
@@ -44,6 +44,9 @@ async function detectModelInfo(baseUrl, apiKey, backend, modelId) {
44
44
  if (backend === "llamacpp") {
45
45
  return await detectLlamacppInfo(baseUrl);
46
46
  }
47
+ if (backend === "lmstudio") {
48
+ return await detectLmstudioInfo(baseUrl, modelId);
49
+ }
47
50
  return await detectVllmInfo(baseUrl, apiKey, modelId);
48
51
  } catch {
49
52
  return { contextWindow: 2e5, source: "default", supportsVision: false };
@@ -90,6 +93,22 @@ async function detectOllamaInfo(baseUrl, modelId) {
90
93
  }
91
94
  throw new Error("No context_length in model_info");
92
95
  }
96
+ async function detectLmstudioInfo(baseUrl, modelId) {
97
+ const base = baseUrl.replace(/\/+$/, "");
98
+ const nativeUrl = `${base.replace(/\/v\d+\/?$/, "")}/api/v1/models`;
99
+ const response = await fetch(nativeUrl, { signal: AbortSignal.timeout(5e3) });
100
+ if (!response.ok) throw new Error(`HTTP ${response.status}`);
101
+ const data = await response.json();
102
+ const model = data.find((m) => (m.key ?? m.id) === modelId);
103
+ if (!model) throw new Error(`Model ${modelId} not found in LM Studio`);
104
+ const loadedContext = model.loaded_instances?.[0]?.config?.context_length;
105
+ const ctxLen = loadedContext ?? model.max_context_length;
106
+ const supportsVision = model.capabilities?.vision ?? false;
107
+ if (ctxLen) {
108
+ return { contextWindow: ctxLen, source: "backend", supportsVision };
109
+ }
110
+ throw new Error("No context_length in LM Studio response");
111
+ }
93
112
  async function probeCombo(baseUrl, apiKey, model, combo, signal) {
94
113
  const headers = { "Content-Type": "application/json" };
95
114
  if (apiKey) headers["Authorization"] = `Bearer ${apiKey}`;
@@ -167,4 +186,4 @@ async function autoConfig(input) {
167
186
  export {
168
187
  autoConfig
169
188
  };
170
- //# sourceMappingURL=auto-config-F5Y6KAQ6.js.map
189
+ //# sourceMappingURL=auto-config-T5GR2N6X.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getBackendCapabilities,
3
3
  getBackendDisplayName
4
- } from "./chunk-PSJON33Y.js";
4
+ } from "./chunk-YHEQTVFV.js";
5
5
  import "./chunk-5WRI5ZAA.js";
6
6
  export {
7
7
  getBackendCapabilities,
8
8
  getBackendDisplayName
9
9
  };
10
- //# sourceMappingURL=backend-B23GIKKD.js.map
10
+ //# sourceMappingURL=backend-P3GHHLHJ.js.map
@@ -25,7 +25,8 @@ function getGitBranch(cwd) {
25
25
  return new Promise((resolve2) => {
26
26
  const proc = spawn("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
27
27
  cwd,
28
- stdio: ["ignore", "pipe", "ignore"]
28
+ stdio: ["ignore", "pipe", "ignore"],
29
+ windowsHide: true
29
30
  });
30
31
  let stdout = "";
31
32
  proc.stdout.on("data", (data) => {
@@ -46,4 +47,4 @@ function getGitBranch(cwd) {
46
47
  export {
47
48
  getCurrentBranch
48
49
  };
49
- //# sourceMappingURL=branch.api-5DMEAIBI.js.map
50
+ //# sourceMappingURL=branch.api-LAN42BA5.js.map
@@ -2,14 +2,14 @@ import {
2
2
  buildRunChatTurnParams,
3
3
  finalizeTurnCompletion,
4
4
  generateSessionNameForSession
5
- } from "./chunk-UOKVBO67.js";
5
+ } from "./chunk-NVPVDDQZ.js";
6
6
  import {
7
7
  runChatTurn
8
- } from "./chunk-WI6HGJ27.js";
9
- import "./chunk-AGXBUC4M.js";
8
+ } from "./chunk-EKI5SZC7.js";
9
+ import "./chunk-FRU2X3IZ.js";
10
10
  import "./chunk-LBGHZLLH.js";
11
- import "./chunk-BIWVYBIE.js";
12
- import "./chunk-ADOXTORQ.js";
11
+ import "./chunk-BGTEIA2S.js";
12
+ import "./chunk-PK2RMVMB.js";
13
13
  import "./chunk-NWO6GRYE.js";
14
14
  import {
15
15
  createChatMessageMessage,
@@ -19,18 +19,18 @@ import {
19
19
  import "./chunk-EU3WWTFH.js";
20
20
  import "./chunk-CDRQJDSJ.js";
21
21
  import "./chunk-YQ3SOPBI.js";
22
- import "./chunk-VZHN46NW.js";
22
+ import "./chunk-6VDCH5ML.js";
23
23
  import {
24
24
  getEventStore
25
25
  } from "./chunk-AIJE3RYH.js";
26
26
  import "./chunk-TMUBLQFC.js";
27
27
  import "./chunk-ZPIZLTWU.js";
28
28
  import "./chunk-J2GP3J3X.js";
29
- import "./chunk-PSJON33Y.js";
29
+ import "./chunk-YHEQTVFV.js";
30
30
  import "./chunk-Z6W4YHJB.js";
31
31
  import "./chunk-K44MW7JJ.js";
32
32
  import "./chunk-YD6NDTKF.js";
33
- import "./chunk-QQ5XY6BH.js";
33
+ import "./chunk-43UFGATL.js";
34
34
  import "./chunk-CQGTEGKL.js";
35
35
  import "./chunk-V4IE7HJY.js";
36
36
  import "./chunk-5WRI5ZAA.js";
@@ -154,4 +154,4 @@ export {
154
154
  startChatSession,
155
155
  stopSessionExecution
156
156
  };
157
- //# sourceMappingURL=chat-handler-QO4XB66I.js.map
157
+ //# sourceMappingURL=chat-handler-AS44EMQE.js.map
@@ -16,7 +16,17 @@ async function configFileExists(mode) {
16
16
  return false;
17
17
  }
18
18
  }
19
- var backendSchema = z.enum(["vllm", "sglang", "ollama", "llamacpp", "openai", "anthropic", "opencode-go", "unknown"]);
19
+ var backendSchema = z.enum([
20
+ "vllm",
21
+ "sglang",
22
+ "ollama",
23
+ "llamacpp",
24
+ "lmstudio",
25
+ "openai",
26
+ "anthropic",
27
+ "opencode-go",
28
+ "unknown"
29
+ ]);
20
30
  var modelConfigSchema = z.object({
21
31
  id: z.string(),
22
32
  contextWindow: z.number(),
@@ -115,8 +125,8 @@ var configSchema = z.object({
115
125
  function getVisionFallback(config) {
116
126
  return config.visionFallback ?? getDefaultVisionFallback();
117
127
  }
118
- async function loadGlobalConfig(mode) {
119
- const configPath = getGlobalConfigPath(mode);
128
+ async function loadGlobalConfig(mode, configPathOverride) {
129
+ const configPath = configPathOverride ?? getGlobalConfigPath(mode);
120
130
  try {
121
131
  const content = await readFile(configPath, "utf-8");
122
132
  const parsed = JSON.parse(content);
@@ -128,8 +138,8 @@ async function loadGlobalConfig(mode) {
128
138
  function getDefaultVisionFallback() {
129
139
  return { enabled: false, url: "http://localhost:11434", model: "qwen3.5:0.8b", timeout: 120 };
130
140
  }
131
- async function saveGlobalConfig(mode, config) {
132
- const configPath = getGlobalConfigPath(mode);
141
+ async function saveGlobalConfig(mode, config, configPathOverride) {
142
+ const configPath = configPathOverride ?? getGlobalConfigPath(mode);
133
143
  const fullConfig = {
134
144
  providers: config.providers ?? [],
135
145
  mcpServers: config.mcpServers,
@@ -281,4 +291,4 @@ export {
281
291
  removeProvider,
282
292
  activateProvider
283
293
  };
284
- //# sourceMappingURL=chunk-QQ5XY6BH.js.map
294
+ //# sourceMappingURL=chunk-43UFGATL.js.map
@@ -2,7 +2,7 @@ import {
2
2
  injectWorkflowKickoffIfNeeded,
3
3
  runAgentTurn,
4
4
  runChatTurn
5
- } from "./chunk-WI6HGJ27.js";
5
+ } from "./chunk-EKI5SZC7.js";
6
6
  import {
7
7
  applyDynamicContext,
8
8
  checkAborted,
@@ -16,11 +16,11 @@ import {
16
16
  loadAllAgentsDefault,
17
17
  saveItemToDir,
18
18
  spawnShellProcess
19
- } from "./chunk-AGXBUC4M.js";
19
+ } from "./chunk-FRU2X3IZ.js";
20
20
  import {
21
21
  getPlatformShell,
22
22
  onProcessEvent
23
- } from "./chunk-BIWVYBIE.js";
23
+ } from "./chunk-BGTEIA2S.js";
24
24
  import {
25
25
  createChatErrorMessage,
26
26
  createChatMessageMessage,
@@ -40,11 +40,11 @@ import {
40
40
  } from "./chunk-EU3WWTFH.js";
41
41
  import {
42
42
  appendCompactionPrompt
43
- } from "./chunk-4566MTWM.js";
43
+ } from "./chunk-GJU35MDV.js";
44
44
  import {
45
45
  TurnMetrics,
46
46
  createMessageStartEvent
47
- } from "./chunk-VZHN46NW.js";
47
+ } from "./chunk-6VDCH5ML.js";
48
48
  import {
49
49
  getCurrentContextWindowId,
50
50
  getEventStore,
@@ -52,7 +52,7 @@ import {
52
52
  } from "./chunk-AIJE3RYH.js";
53
53
  import {
54
54
  createLLMClient
55
- } from "./chunk-ZZLCX7YT.js";
55
+ } from "./chunk-JKLPWTUN.js";
56
56
  import {
57
57
  ensureVersionPrefix
58
58
  } from "./chunk-HNCM3D7Y.js";
@@ -452,8 +452,16 @@ var TERMINAL_BLOCKED = "$blocked";
452
452
  import { spawn as spawn2 } from "child_process";
453
453
  function getGitDiffFiles(cwd) {
454
454
  return new Promise((resolve) => {
455
- const diffProc = spawn2("git", ["diff", "--name-status", "HEAD"], { cwd, stdio: ["ignore", "pipe", "pipe"] });
456
- const statusProc = spawn2("git", ["status", "--porcelain"], { cwd, stdio: ["ignore", "pipe", "pipe"] });
455
+ const diffProc = spawn2("git", ["diff", "--name-status", "HEAD"], {
456
+ cwd,
457
+ stdio: ["ignore", "pipe", "pipe"],
458
+ windowsHide: true
459
+ });
460
+ const statusProc = spawn2("git", ["status", "--porcelain"], {
461
+ cwd,
462
+ stdio: ["ignore", "pipe", "pipe"],
463
+ windowsHide: true
464
+ });
457
465
  let diffStdout = "";
458
466
  let statusStdout = "";
459
467
  let diffExited = false;
@@ -1187,7 +1195,8 @@ function moduleGitBranch(cwd) {
1187
1195
  return new Promise((resolve) => {
1188
1196
  const proc = spawn3("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
1189
1197
  cwd,
1190
- stdio: ["ignore", "pipe", "ignore"]
1198
+ stdio: ["ignore", "pipe", "ignore"],
1199
+ windowsHide: true
1191
1200
  });
1192
1201
  let stdout = "";
1193
1202
  proc.stdout.on("data", (data) => {
@@ -1210,11 +1219,13 @@ function moduleGitDiff(cwd) {
1210
1219
  return new Promise((resolve) => {
1211
1220
  const diffProc = spawn3("git", ["diff", "--name-status", "HEAD"], {
1212
1221
  cwd,
1213
- stdio: ["ignore", "pipe", "pipe"]
1222
+ stdio: ["ignore", "pipe", "pipe"],
1223
+ windowsHide: true
1214
1224
  });
1215
1225
  const statusProc = spawn3("git", ["status", "--porcelain"], {
1216
1226
  cwd,
1217
- stdio: ["ignore", "pipe", "pipe"]
1227
+ stdio: ["ignore", "pipe", "pipe"],
1228
+ windowsHide: true
1218
1229
  });
1219
1230
  let diffStdout = "";
1220
1231
  let statusStdout = "";
@@ -2091,4 +2102,4 @@ export {
2091
2102
  signalMcpReady,
2092
2103
  createWebSocketServer
2093
2104
  };
2094
- //# sourceMappingURL=chunk-DQCEXCDD.js.map
2105
+ //# sourceMappingURL=chunk-5MDIKIMG.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-J2GP3J3X.js";
4
4
  import {
5
5
  getBackendCapabilities
6
- } from "./chunk-PSJON33Y.js";
6
+ } from "./chunk-YHEQTVFV.js";
7
7
  import {
8
8
  buildModelParams
9
9
  } from "./chunk-Z6W4YHJB.js";
@@ -705,4 +705,4 @@ export {
705
705
  createChatDoneEvent,
706
706
  consumeStreamGenerator
707
707
  };
708
- //# sourceMappingURL=chunk-VZHN46NW.js.map
708
+ //# sourceMappingURL=chunk-6VDCH5ML.js.map
@@ -8,7 +8,7 @@ import {
8
8
  removeProcess,
9
9
  startProcess,
10
10
  updateStatus
11
- } from "./chunk-ADOXTORQ.js";
11
+ } from "./chunk-PK2RMVMB.js";
12
12
 
13
13
  // src/server/tools/background-process/manager.ts
14
14
  import { spawn } from "child_process";
@@ -69,7 +69,8 @@ function startProcessCommand(processId, sessionId, command, cwd) {
69
69
  cwd,
70
70
  env: { ...process.env, FORCE_COLOR: "1" },
71
71
  stdio: ["ignore", "pipe", "pipe"],
72
- detached: true
72
+ detached: true,
73
+ windowsHide: true
73
74
  });
74
75
  proc.pid = child.pid ?? null;
75
76
  updateStatus(processId, sessionId, "running");
@@ -153,4 +154,4 @@ export {
153
154
  getSessionProcesses2 as getSessionProcesses,
154
155
  getProcessLogs
155
156
  };
156
- //# sourceMappingURL=chunk-BIWVYBIE.js.map
157
+ //# sourceMappingURL=chunk-BGTEIA2S.js.map
@@ -12,7 +12,7 @@ import {
12
12
  loadAllAgentsDefault,
13
13
  processEventsForConversation,
14
14
  runTopLevelAgentLoop
15
- } from "./chunk-AGXBUC4M.js";
15
+ } from "./chunk-FRU2X3IZ.js";
16
16
  import {
17
17
  TurnMetrics,
18
18
  WORKFLOW_KICKOFF_PROMPT,
@@ -20,7 +20,7 @@ import {
20
20
  buildAgentSmallReminder,
21
21
  createChatDoneEvent,
22
22
  createMessageStartEvent
23
- } from "./chunk-VZHN46NW.js";
23
+ } from "./chunk-6VDCH5ML.js";
24
24
  import {
25
25
  getCurrentContextWindowId,
26
26
  getCurrentWindowMessageOptions,
@@ -324,4 +324,4 @@ export {
324
324
  runAgentTurn,
325
325
  injectWorkflowKickoffIfNeeded
326
326
  };
327
- //# sourceMappingURL=chunk-WI6HGJ27.js.map
327
+ //# sourceMappingURL=chunk-EKI5SZC7.js.map
@@ -9,12 +9,12 @@ import {
9
9
  getSessionProcesses,
10
10
  startProcessCommand,
11
11
  stopProcess
12
- } from "./chunk-BIWVYBIE.js";
12
+ } from "./chunk-BGTEIA2S.js";
13
13
  import {
14
14
  getMaxPerSession,
15
15
  getSessionProcessCount,
16
16
  terminateProcessTree
17
- } from "./chunk-ADOXTORQ.js";
17
+ } from "./chunk-PK2RMVMB.js";
18
18
  import {
19
19
  createMcpTools
20
20
  } from "./chunk-NWO6GRYE.js";
@@ -50,7 +50,7 @@ import {
50
50
  createToolCallEvent,
51
51
  createToolResultEvent,
52
52
  streamLLMPure
53
- } from "./chunk-VZHN46NW.js";
53
+ } from "./chunk-6VDCH5ML.js";
54
54
  import {
55
55
  getCurrentContextWindowId,
56
56
  getCurrentWindowMessageOptions,
@@ -73,7 +73,7 @@ import {
73
73
  import {
74
74
  loadGlobalConfig,
75
75
  saveGlobalConfig
76
- } from "./chunk-QQ5XY6BH.js";
76
+ } from "./chunk-43UFGATL.js";
77
77
  import {
78
78
  getGlobalConfigDir
79
79
  } from "./chunk-CQGTEGKL.js";
@@ -222,6 +222,9 @@ async function isPathWithinSandbox(path, workdir, sessionId) {
222
222
  function looksLikeRegex(str) {
223
223
  return /[*?+[\]\\]/.test(str);
224
224
  }
225
+ function isPlaceholderToken(str) {
226
+ return str.includes("__URL__") || str.includes("__FILEURL__") || str.includes("__SED__");
227
+ }
225
228
  function extractAbsolutePathsFromCommand(command) {
226
229
  if (!command.trim()) {
227
230
  return [];
@@ -273,16 +276,13 @@ function extractAbsolutePathsFromCommand(command) {
273
276
  }
274
277
  }
275
278
  }
276
- const absolutePattern = /(?:^|[\s=(])(\/?\/[a-zA-Z0-9_\-./]+)/g;
279
+ const absolutePattern = /(?:^|[\s=(])(\/[^\s"'|&;<>`()]+)/g;
277
280
  while ((match = absolutePattern.exec(sanitized)) !== null) {
278
- const pathCandidate = match[1];
279
- if (pathCandidate.includes("__URL__") || pathCandidate.includes("__FILEURL__")) {
280
- continue;
281
- }
282
- if (looksLikeRegex(pathCandidate)) {
283
- continue;
284
- }
285
- const resolved = normalize(pathCandidate);
281
+ const candidate = match[1];
282
+ if (isPlaceholderToken(candidate)) continue;
283
+ if (looksLikeRegex(candidate)) continue;
284
+ const resolved = normalize(candidate);
285
+ if (resolved === "/" || resolved === "") continue;
286
286
  if (!isSafePath(resolved)) {
287
287
  paths.push(resolved);
288
288
  }
@@ -1330,6 +1330,7 @@ function spawnShellProcess(command, cwd, _signal, detached = false) {
1330
1330
  cwd,
1331
1331
  env: { ...process.env, FORCE_COLOR: "0" },
1332
1332
  stdio: ["ignore", "pipe", "pipe"],
1333
+ windowsHide: true,
1333
1334
  ...detached ? { detached: true } : {}
1334
1335
  });
1335
1336
  }
@@ -1667,6 +1668,10 @@ ${Object.entries(schema.fields).map(([f, t]) => ` ${f}: ${t}`).join("\n")}`
1667
1668
  }
1668
1669
  );
1669
1670
 
1671
+ // src/server/sub-agents/manager.ts
1672
+ import { readFile as readFile7, access as access4 } from "fs/promises";
1673
+ import { join as join7, dirname as dirname5, isAbsolute as isAbsolute3 } from "path";
1674
+
1670
1675
  // src/server/agents/registry.ts
1671
1676
  import { readdir as readdir3, readFile as readFile5, writeFile as writeFile4, mkdir as mkdir3, access as access2, unlink as unlink2 } from "fs/promises";
1672
1677
  import { join as join4, dirname as dirname2 } from "path";
@@ -2553,7 +2558,7 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
2553
2558
  sessionManager.setCurrentContextSize(sessionId, result.usage.promptTokens);
2554
2559
  if (!compacting) {
2555
2560
  const contextState2 = sessionManager.getContextState(sessionId);
2556
- const { shouldCompact, appendCompactionPrompt } = await import("./compactor-ZKZYSNMD.js");
2561
+ const { shouldCompact, appendCompactionPrompt } = await import("./compactor-Q33AJPCQ.js");
2557
2562
  if (shouldCompact(contextState2.currentTokens, contextState2.maxTokens, runtimeConfig.context.compactionThreshold)) {
2558
2563
  appendCompactionPrompt(sessionId, append);
2559
2564
  compacting = true;
@@ -2910,7 +2915,7 @@ async function describeImageFromDataUrl(dataUrl, visionModel, options) {
2910
2915
  import { createHash as createHash2 } from "crypto";
2911
2916
  async function loadVisionModelFromGlobalConfig() {
2912
2917
  try {
2913
- const { loadGlobalConfig: loadGlobalConfig2, getVisionFallback } = await import("./config-5ZHFKWOW.js");
2918
+ const { loadGlobalConfig: loadGlobalConfig2, getVisionFallback } = await import("./config-GMQUPNBY.js");
2914
2919
  const runtimeConfig = getRuntimeConfig();
2915
2920
  const mode = runtimeConfig.mode ?? "production";
2916
2921
  const globalConfig = await loadGlobalConfig2(mode);
@@ -3246,6 +3251,33 @@ function getWindowOptions(sessionId) {
3246
3251
  const id = getCurrentContextWindowId(sessionId);
3247
3252
  return id ? { contextWindowId: id } : void 0;
3248
3253
  }
3254
+ async function loadGitIgnoreRules(workdir) {
3255
+ if (!isAbsolute3(workdir)) return "";
3256
+ let currentDir = workdir;
3257
+ while (true) {
3258
+ const gitignorePath = join7(currentDir, ".gitignore");
3259
+ try {
3260
+ await access4(gitignorePath);
3261
+ const content = await readFile7(gitignorePath, "utf-8");
3262
+ const trimmed = content.trim();
3263
+ if (!trimmed) return "";
3264
+ const lines = trimmed.split("\n");
3265
+ const capped = lines.slice(0, 100);
3266
+ if (capped.length < lines.length) capped.push("# ... truncated (too many patterns)");
3267
+ const final = capped.join("\n").slice(0, 4096);
3268
+ return `## Repository Exclusion Rules (.gitignore)
3269
+
3270
+ The following patterns from \`.gitignore\` should be excluded from file searches:
3271
+
3272
+ ${final}`;
3273
+ } catch {
3274
+ }
3275
+ const parentDir = dirname5(currentDir);
3276
+ if (parentDir === currentDir) break;
3277
+ currentDir = parentDir;
3278
+ }
3279
+ return "";
3280
+ }
3249
3281
  async function executeSubAgent(options) {
3250
3282
  const {
3251
3283
  subAgentType,
@@ -3317,7 +3349,9 @@ async function executeSubAgent(options) {
3317
3349
  const config = getRuntimeConfig();
3318
3350
  const configDir = getGlobalConfigDir(config.mode ?? "production");
3319
3351
  const skills = await getEnabledSkillMetadata(configDir, config.workdir);
3320
- const systemPrompt = buildBasePrompt(session.workdir, void 0, skills.length > 0 ? skills : void 0, llmClient.getModel()) + "\n\n" + agentDef.prompt + RETURN_VALUE_INSTRUCTION;
3352
+ const hasRunCommand = agentDef.metadata.allowedTools?.includes("run_command") ?? false;
3353
+ const gitignoreSection = hasRunCommand ? await loadGitIgnoreRules(session.workdir) : "";
3354
+ const systemPrompt = buildBasePrompt(session.workdir, void 0, skills.length > 0 ? skills : void 0, llmClient.getModel()) + "\n\n" + agentDef.prompt + (gitignoreSection ? "\n\n" + gitignoreSection : "") + RETURN_VALUE_INSTRUCTION;
3321
3355
  const subAgentScope = { type: "subagent", sessionId, subAgentId, subAgentType };
3322
3356
  const loopResult = await runTopLevelAgentLoop(
3323
3357
  {
@@ -3425,7 +3459,7 @@ var callSubAgentTool = {
3425
3459
  };
3426
3460
  }
3427
3461
  try {
3428
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-L2SMYKJZ.js");
3462
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-FQ54IAYG.js");
3429
3463
  const toolRegistry = getToolRegistryForAgent2(agentDef);
3430
3464
  const turnMetrics = new TurnMetrics();
3431
3465
  const result = await executeSubAgent({
@@ -3676,13 +3710,13 @@ var webFetchTool = createTool(
3676
3710
 
3677
3711
  // src/server/dev-server/manager.ts
3678
3712
  import { spawn as spawn2 } from "child_process";
3679
- import { readFile as readFile7, writeFile as writeFile6, mkdir as mkdir5 } from "fs/promises";
3680
- import { resolve as resolve5, join as join7 } from "path";
3713
+ import { readFile as readFile8, writeFile as writeFile6, mkdir as mkdir5 } from "fs/promises";
3714
+ import { resolve as resolve5, join as join8 } from "path";
3681
3715
  var MAX_LOG_LINES = 2e3;
3682
3716
  var MAX_LOG_BYTES = 1e5;
3683
3717
  var getDevServerConfigPath = (workdir) => {
3684
3718
  const mode = getRuntimeConfig().mode ?? "production";
3685
- return join7(resolve5(workdir), ".openfox", `${mode === "development" ? "dev-dev" : "dev"}.json`);
3719
+ return join8(resolve5(workdir), ".openfox", `${mode === "development" ? "dev-dev" : "dev"}.json`);
3686
3720
  };
3687
3721
  var ERROR_PATTERNS = [
3688
3722
  /EADDRINUSE/,
@@ -3743,7 +3777,7 @@ var DevServerManager = class {
3743
3777
  async loadConfig(workdir) {
3744
3778
  try {
3745
3779
  const configPath = getDevServerConfigPath(workdir);
3746
- const raw = await readFile7(configPath, "utf-8");
3780
+ const raw = await readFile8(configPath, "utf-8");
3747
3781
  const parsed = JSON.parse(raw);
3748
3782
  if (!parsed.command || !parsed.url) return null;
3749
3783
  return {
@@ -3758,7 +3792,7 @@ var DevServerManager = class {
3758
3792
  }
3759
3793
  async saveConfig(workdir, config) {
3760
3794
  const resolved = this.resolveWorkdir(workdir);
3761
- const dirPath = join7(resolved, ".openfox");
3795
+ const dirPath = join8(resolved, ".openfox");
3762
3796
  await mkdir5(dirPath, { recursive: true });
3763
3797
  const configPath = getDevServerConfigPath(workdir);
3764
3798
  await writeFile6(configPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
@@ -3793,7 +3827,8 @@ var DevServerManager = class {
3793
3827
  cwd: resolved,
3794
3828
  env: { ...process.env, FORCE_COLOR: "1" },
3795
3829
  stdio: ["ignore", "pipe", "pipe"],
3796
- detached: true
3830
+ detached: true,
3831
+ windowsHide: true
3797
3832
  });
3798
3833
  instance.process = proc;
3799
3834
  const appendLog = (stream, content) => {
@@ -4241,7 +4276,7 @@ function resolveAgentDef2(sessionManager, sessionId) {
4241
4276
  }
4242
4277
  async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
4243
4278
  const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
4244
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-L2SMYKJZ.js");
4279
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-FQ54IAYG.js");
4245
4280
  const tools = getToolRegistryForAgent2(agentDef).definitions;
4246
4281
  const toolFingerprint = getToolFingerprint(tools);
4247
4282
  const allAgents = await loadAllAgentsDefault();
@@ -4254,7 +4289,7 @@ async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
4254
4289
  async function computeSessionHash(sessionManager, sessionId) {
4255
4290
  const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
4256
4291
  const agentDef = await resolveAgentDef2(sessionManager, sessionId);
4257
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-L2SMYKJZ.js");
4292
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-FQ54IAYG.js");
4258
4293
  const tools = getToolRegistryForAgent2(agentDef).definitions;
4259
4294
  const toolFingerprint = getToolFingerprint(tools);
4260
4295
  return computeDynamicContextHash(instructionContent, skills, toolFingerprint);
@@ -4273,6 +4308,7 @@ async function applyDynamicContext(sessionManager, sessionId) {
4273
4308
  // src/server/tools/mcp-config.ts
4274
4309
  var mcpManagerForTools = null;
4275
4310
  var mcpConfigMode = "production";
4311
+ var mcpConfigPath;
4276
4312
  var mcpNotifyChanged = null;
4277
4313
  function setMcpManagerForTools(manager) {
4278
4314
  mcpManagerForTools = manager;
@@ -4280,6 +4316,9 @@ function setMcpManagerForTools(manager) {
4280
4316
  function setMcpConfigMode(mode) {
4281
4317
  mcpConfigMode = mode;
4282
4318
  }
4319
+ function setMcpConfigPath(path) {
4320
+ mcpConfigPath = path;
4321
+ }
4283
4322
  function setNotifyMcpServersChanged(fn) {
4284
4323
  mcpNotifyChanged = fn;
4285
4324
  }
@@ -4355,13 +4394,13 @@ var mcpConfigTool = createTool(
4355
4394
  return helpers.error("MCP manager not available");
4356
4395
  }
4357
4396
  async function persistAndRebuild(updater) {
4358
- const globalConfig = await loadGlobalConfig(mcpConfigMode);
4397
+ const globalConfig = await loadGlobalConfig(mcpConfigMode, mcpConfigPath);
4359
4398
  const mcpServers = { ...globalConfig.mcpServers ?? {} };
4360
4399
  const updated = updater(mcpServers);
4361
- await saveGlobalConfig(mcpConfigMode, { ...globalConfig, mcpServers: updated });
4400
+ await saveGlobalConfig(mcpConfigMode, { ...globalConfig, mcpServers: updated }, mcpConfigPath);
4362
4401
  }
4363
4402
  async function rebuildTools() {
4364
- const { setMcpTools: setMcpTools2 } = await import("./tools-L2SMYKJZ.js");
4403
+ const { setMcpTools: setMcpTools2 } = await import("./tools-FQ54IAYG.js");
4365
4404
  const mcpTools = createMcpTools(mcpManagerForTools);
4366
4405
  setMcpTools2(mcpTools);
4367
4406
  }
@@ -4463,7 +4502,7 @@ var mcpConfigTool = createTool(
4463
4502
  );
4464
4503
 
4465
4504
  // src/server/tools/trace-code.ts
4466
- import { stat as stat2, readFile as readFile8 } from "fs/promises";
4505
+ import { stat as stat2, readFile as readFile9 } from "fs/promises";
4467
4506
  function graphNode(location, depth, relation, symbolName, symbolKind) {
4468
4507
  const node = { location, depth, relation, symbolName };
4469
4508
  if (symbolKind) node.symbolKind = symbolKind;
@@ -4495,7 +4534,7 @@ async function getCachedLines(path, approvedPaths) {
4495
4534
  }
4496
4535
  try {
4497
4536
  const stats = await stat2(path);
4498
- const content = await readFile8(path, "utf-8");
4537
+ const content = await readFile9(path, "utf-8");
4499
4538
  const lines = content.split("\n");
4500
4539
  fileCache.set(path, { mtimeMs: stats.mtimeMs, lines });
4501
4540
  if (fileCache.size > CACHE_MAX_SIZE) {
@@ -5021,6 +5060,7 @@ export {
5021
5060
  applyDynamicContext,
5022
5061
  setMcpManagerForTools,
5023
5062
  setMcpConfigMode,
5063
+ setMcpConfigPath,
5024
5064
  setNotifyMcpServersChanged,
5025
5065
  parseToolPermissions,
5026
5066
  getToolPermissions,
@@ -5031,4 +5071,4 @@ export {
5031
5071
  getToolRegistryForAgent,
5032
5072
  createToolRegistry
5033
5073
  };
5034
- //# sourceMappingURL=chunk-AGXBUC4M.js.map
5074
+ //# sourceMappingURL=chunk-FRU2X3IZ.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  COMPACTION_PROMPT,
3
3
  createMessageStartEvent
4
- } from "./chunk-VZHN46NW.js";
4
+ } from "./chunk-6VDCH5ML.js";
5
5
  import {
6
6
  getCurrentWindowMessageOptions
7
7
  } from "./chunk-AIJE3RYH.js";
@@ -31,4 +31,4 @@ export {
31
31
  shouldCompact,
32
32
  getCompactionTarget
33
33
  };
34
- //# sourceMappingURL=chunk-4566MTWM.js.map
34
+ //# sourceMappingURL=chunk-GJU35MDV.js.map