openfox 2.0.80 → 2.0.82

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 (44) hide show
  1. package/dist/{chat-handler-2ZEI2WBE.js → chat-handler-73HNN7TQ.js} +15 -15
  2. package/dist/{chunk-4GMRZU7A.js → chunk-3D3N2PXI.js} +4 -4
  3. package/dist/{chunk-V77VNKN6.js → chunk-4VDEVDMG.js} +7 -19
  4. package/dist/{chunk-MTUYDBSL.js → chunk-5ZHVQOI3.js} +2 -2
  5. package/dist/{chunk-MAGDRXHW.js → chunk-7QCJCIVB.js} +33 -93
  6. package/dist/{chunk-F56O4B67.js → chunk-ATU2X6EP.js} +4 -4
  7. package/dist/{chunk-AFJLY43Z.js → chunk-CNJ63FXJ.js} +6 -3
  8. package/dist/{chunk-LYZ3LQRX.js → chunk-DQP5HSDS.js} +2 -2
  9. package/dist/{chunk-EHVDAVYG.js → chunk-FVY2JOTO.js} +2 -2
  10. package/dist/{chunk-ZO5EXQMG.js → chunk-IIRXKSB5.js} +53 -2
  11. package/dist/{chunk-5CQRB7AD.js → chunk-JKZPMRH2.js} +2 -2
  12. package/dist/{chunk-YZUZHWXM.js → chunk-KC7NXZHK.js} +111 -70
  13. package/dist/{chunk-PXF4KHAP.js → chunk-KSVE7RMK.js} +35 -31
  14. package/dist/{chunk-WL2WEJAK.js → chunk-SBSQD7MG.js} +2 -2
  15. package/dist/chunk-UFX46Z5J.js +7 -0
  16. package/dist/{chunk-CJDYSUU5.js → chunk-VB23QPW3.js} +9 -6
  17. package/dist/{chunk-GBVS4LCP.js → chunk-WL6AOKRD.js} +8 -8
  18. package/dist/cli/dev.js +1 -1
  19. package/dist/cli/index.js +1 -1
  20. package/dist/{client-V5DZRO2D.js → client-TA2VD4LR.js} +5 -3
  21. package/dist/{compactor-LJFUIKWB.js → compactor-YKESKGHL.js} +6 -6
  22. package/dist/http-client-QZY7W36Q.js +11 -0
  23. package/dist/{manager-ATWZUL3O.js → manager-WOUOQVLV.js} +4 -4
  24. package/dist/{orchestrator-SSTGBBOU.js → orchestrator-CMKIFPOS.js} +10 -10
  25. package/dist/package.json +1 -1
  26. package/dist/{path-security-EKTUMDJW.js → path-security-AWDNKRZ4.js} +3 -3
  27. package/dist/{platform-VBNNMTR5.js → platform-7AK5MB4K.js} +3 -3
  28. package/dist/{processor-YLPZJMXH.js → processor-XNFEP2DV.js} +14 -14
  29. package/dist/{provider-TIZV4IFE.js → provider-QVVJ6XNZ.js} +6 -4
  30. package/dist/{provider-manager-PD3BXUHY.js → provider-manager-7246YSJT.js} +6 -4
  31. package/dist/{serve-U53R54PO.js → serve-PHRKCACD.js} +17 -17
  32. package/dist/server/index.d.ts +0 -5
  33. package/dist/server/index.js +16 -16
  34. package/dist/{server-2TQ3DFYA.js → server-OLE7676B.js} +12 -12
  35. package/dist/{settings-6M55N4Q2.js → settings-6TJIHDVX.js} +2 -2
  36. package/dist/{tools-APH5FLYT.js → tools-NXEKDL2V.js} +9 -9
  37. package/dist/{update-6OFFUWZN.js → update-BGQRA2UG.js} +2 -2
  38. package/dist/web/assets/{index-CO9RvnPX.css → index-DfmXvFVe.css} +1 -1
  39. package/dist/web/assets/{index-DHsXL2KP.js → index-V9yNKJy4.js} +76 -76
  40. package/dist/web/index.html +2 -2
  41. package/dist/web/sw.js +1 -1
  42. package/package.json +1 -1
  43. package/dist/chunk-RJWYZ6KK.js +0 -7
  44. package/dist/http-client-PIWB7BXK.js +0 -9
@@ -2,21 +2,25 @@ import {
2
2
  buildRunChatTurnParams,
3
3
  finalizeTurnCompletion,
4
4
  generateSessionNameForSession
5
- } from "./chunk-GBVS4LCP.js";
5
+ } from "./chunk-WL6AOKRD.js";
6
6
  import {
7
7
  runChatTurn
8
- } from "./chunk-V77VNKN6.js";
9
- import "./chunk-MAGDRXHW.js";
10
- import "./chunk-5CQRB7AD.js";
8
+ } from "./chunk-4VDEVDMG.js";
9
+ import "./chunk-7QCJCIVB.js";
10
+ import "./chunk-JKZPMRH2.js";
11
11
  import "./chunk-NWO6GRYE.js";
12
12
  import "./chunk-VPFUXGMM.js";
13
13
  import "./chunk-37WF2Z3T.js";
14
14
  import "./chunk-WGMJCFCE.js";
15
- import "./chunk-4GMRZU7A.js";
15
+ import "./chunk-3D3N2PXI.js";
16
+ import {
17
+ createChatMessageMessage,
18
+ createPhaseChangedMessage,
19
+ createSessionRunningMessage
20
+ } from "./chunk-SJTG56CH.js";
16
21
  import "./chunk-EU3WWTFH.js";
17
- import "./chunk-EHVDAVYG.js";
18
- import "./chunk-MTUYDBSL.js";
19
- import "./chunk-AFJLY43Z.js";
22
+ import "./chunk-FVY2JOTO.js";
23
+ import "./chunk-5ZHVQOI3.js";
20
24
  import "./chunk-EYIWUONA.js";
21
25
  import "./chunk-6AE3JPDJ.js";
22
26
  import "./chunk-I72ACQ6R.js";
@@ -25,16 +29,12 @@ import {
25
29
  } from "./chunk-BUXIESO5.js";
26
30
  import "./chunk-A2IZ4PWQ.js";
27
31
  import "./chunk-AANVMTYU.js";
28
- import "./chunk-RGUUZD5B.js";
29
- import {
30
- createChatMessageMessage,
31
- createPhaseChangedMessage,
32
- createSessionRunningMessage
33
- } from "./chunk-SJTG56CH.js";
34
32
  import "./chunk-J2GP3J3X.js";
35
33
  import "./chunk-V4IE7HJY.js";
36
34
  import "./chunk-YHEQTVFV.js";
37
35
  import "./chunk-RMXPVQP4.js";
36
+ import "./chunk-CNJ63FXJ.js";
37
+ import "./chunk-RGUUZD5B.js";
38
38
  import "./chunk-K44MW7JJ.js";
39
39
  import "./chunk-X6BXZFO7.js";
40
40
  import "./chunk-NH2PVB6R.js";
@@ -160,4 +160,4 @@ export {
160
160
  startChatSession,
161
161
  stopSessionExecution
162
162
  };
163
- //# sourceMappingURL=chat-handler-2ZEI2WBE.js.map
163
+ //# sourceMappingURL=chat-handler-73HNN7TQ.js.map
@@ -1,9 +1,9 @@
1
- import {
2
- getEventStore
3
- } from "./chunk-BUXIESO5.js";
4
1
  import {
5
2
  createChatPathConfirmationMessage
6
3
  } from "./chunk-SJTG56CH.js";
4
+ import {
5
+ getEventStore
6
+ } from "./chunk-BUXIESO5.js";
7
7
 
8
8
  // src/server/tools/path-security.ts
9
9
  import { realpath } from "fs/promises";
@@ -494,4 +494,4 @@ export {
494
494
  getConfirmationSessionId,
495
495
  getPendingConfirmationsBySession
496
496
  };
497
- //# sourceMappingURL=chunk-4GMRZU7A.js.map
497
+ //# sourceMappingURL=chunk-3D3N2PXI.js.map
@@ -9,10 +9,10 @@ import {
9
9
  loadAllAgentsDefault,
10
10
  processEventsForConversation,
11
11
  runTopLevelAgentLoop
12
- } from "./chunk-MAGDRXHW.js";
12
+ } from "./chunk-7QCJCIVB.js";
13
13
  import {
14
14
  PathAccessDeniedError
15
- } from "./chunk-4GMRZU7A.js";
15
+ } from "./chunk-3D3N2PXI.js";
16
16
  import {
17
17
  TurnMetrics,
18
18
  buildAgentReminder,
@@ -20,7 +20,7 @@ import {
20
20
  buildTopLevelSystemPrompt,
21
21
  createChatDoneEvent,
22
22
  createMessageStartEvent
23
- } from "./chunk-EHVDAVYG.js";
23
+ } from "./chunk-FVY2JOTO.js";
24
24
  import {
25
25
  getCurrentContextWindowId,
26
26
  getCurrentWindowMessageOptions,
@@ -66,7 +66,7 @@ function resolveAgentDef(sessionManager, sessionId) {
66
66
  }
67
67
  async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
68
68
  const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
69
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-APH5FLYT.js");
69
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-NXEKDL2V.js");
70
70
  const tools = getToolRegistryForAgent2(agentDef).definitions;
71
71
  const toolFingerprint = getToolFingerprint(tools);
72
72
  const allAgents = await loadAllAgentsDefault();
@@ -79,7 +79,7 @@ async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
79
79
  async function computeSessionHash(sessionManager, sessionId) {
80
80
  const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
81
81
  const agentDef = await resolveAgentDef(sessionManager, sessionId);
82
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-APH5FLYT.js");
82
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-NXEKDL2V.js");
83
83
  const tools = getToolRegistryForAgent2(agentDef).definitions;
84
84
  const toolFingerprint = getToolFingerprint(tools);
85
85
  return computeDynamicContextHash(instructionContent, skills, toolFingerprint);
@@ -97,7 +97,7 @@ async function applyDynamicContext(sessionManager, sessionId) {
97
97
 
98
98
  // src/server/chat/orchestrator.ts
99
99
  async function buildRetryPatterns() {
100
- const { getSetting, SETTINGS_KEYS } = await import("./settings-6M55N4Q2.js");
100
+ const { getSetting, SETTINGS_KEYS } = await import("./settings-6TJIHDVX.js");
101
101
  const raw = getSetting(SETTINGS_KEYS.RETRY_PATTERNS);
102
102
  if (!raw) {
103
103
  const oldXmlProtection = getSetting("llm.disableXmlProtection");
@@ -149,18 +149,6 @@ async function runChatTurn(options) {
149
149
  const mode = session.mode;
150
150
  logger.debug("Starting chat turn", { sessionId, mode });
151
151
  sessionManager.setRunning(sessionId, true);
152
- const branchWarning = await sessionManager.checkBranchConsistency(sessionId);
153
- if (branchWarning) {
154
- logger.warn("Branch consistency check failed", { sessionId, warning: branchWarning });
155
- sessionManager.addMessage(sessionId, {
156
- role: "user",
157
- content: `<system-reminder>
158
- ${branchWarning}
159
- </system-reminder>`,
160
- isSystemGenerated: true,
161
- messageKind: "auto-prompt"
162
- });
163
- }
164
152
  const append = (event) => {
165
153
  try {
166
154
  eventStore.append(sessionId, event);
@@ -371,4 +359,4 @@ export {
371
359
  runChatTurn,
372
360
  runAgentTurn
373
361
  };
374
- //# sourceMappingURL=chunk-V77VNKN6.js.map
362
+ //# sourceMappingURL=chunk-4VDEVDMG.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SETTINGS_KEYS,
3
3
  getSetting
4
- } from "./chunk-AFJLY43Z.js";
4
+ } from "./chunk-CNJ63FXJ.js";
5
5
 
6
6
  // src/server/utils/platform.ts
7
7
  import os from "os";
@@ -63,4 +63,4 @@ export {
63
63
  isWindowsPath,
64
64
  isAbsolutePath
65
65
  };
66
- //# sourceMappingURL=chunk-MTUYDBSL.js.map
66
+ //# sourceMappingURL=chunk-5ZHVQOI3.js.map
@@ -8,7 +8,7 @@ import {
8
8
  spawnShellProcess,
9
9
  startProcessCommand,
10
10
  stopProcess
11
- } from "./chunk-5CQRB7AD.js";
11
+ } from "./chunk-JKZPMRH2.js";
12
12
  import {
13
13
  createMcpTools
14
14
  } from "./chunk-NWO6GRYE.js";
@@ -25,7 +25,14 @@ import {
25
25
  extractSensitivePathsFromCommand,
26
26
  registerPathConfirmation,
27
27
  requestPathAccess
28
- } from "./chunk-4GMRZU7A.js";
28
+ } from "./chunk-3D3N2PXI.js";
29
+ import {
30
+ createChatDoneMessage,
31
+ createChatMessageMessage,
32
+ createChatMessageUpdatedMessage,
33
+ createChatPathConfirmationMessage,
34
+ createQueueStateMessage
35
+ } from "./chunk-SJTG56CH.js";
29
36
  import {
30
37
  AskUserInterrupt,
31
38
  askUserTool
@@ -42,13 +49,7 @@ import {
42
49
  createToolCallEvent,
43
50
  createToolResultEvent,
44
51
  streamLLMPure
45
- } from "./chunk-EHVDAVYG.js";
46
- import {
47
- SETTINGS_KEYS,
48
- deleteSetting,
49
- getSetting,
50
- setSetting
51
- } from "./chunk-AFJLY43Z.js";
52
+ } from "./chunk-FVY2JOTO.js";
52
53
  import {
53
54
  startInspectProxy
54
55
  } from "./chunk-EYIWUONA.js";
@@ -76,13 +77,6 @@ import {
76
77
  reorderToolMessages,
77
78
  stripOrphanedToolCalls
78
79
  } from "./chunk-A2IZ4PWQ.js";
79
- import {
80
- createChatDoneMessage,
81
- createChatMessageMessage,
82
- createChatMessageUpdatedMessage,
83
- createChatPathConfirmationMessage,
84
- createQueueStateMessage
85
- } from "./chunk-SJTG56CH.js";
86
80
  import {
87
81
  modelSupportsVision
88
82
  } from "./chunk-V4IE7HJY.js";
@@ -97,6 +91,12 @@ import {
97
91
  isPdfBuffer,
98
92
  processPdfContent
99
93
  } from "./chunk-RMXPVQP4.js";
94
+ import {
95
+ SETTINGS_KEYS,
96
+ deleteSetting,
97
+ getSetting,
98
+ setSetting
99
+ } from "./chunk-CNJ63FXJ.js";
100
100
  import {
101
101
  logger
102
102
  } from "./chunk-K44MW7JJ.js";
@@ -116,8 +116,17 @@ import { extname, join } from "path";
116
116
  import { randomUUID } from "crypto";
117
117
  import { resolve, isAbsolute } from "path";
118
118
  var confirmationSeqCounter = 0;
119
- function requestUserConfirmation(context, toolLabel, desc) {
119
+ async function requestUserConfirmation(context, toolLabel, desc) {
120
120
  if (context.dangerLevel === "dangerous") return Promise.resolve(true);
121
+ if (toolLabel === "workspace" || toolLabel === "command") {
122
+ try {
123
+ const { getSetting: getSetting2, SETTINGS_KEYS: SETTINGS_KEYS2 } = await import("./settings-6TJIHDVX.js");
124
+ if (getSetting2(SETTINGS_KEYS2.CONFIRM_ON_WORKSPACE_ACTIONS) !== "true") {
125
+ return Promise.resolve(true);
126
+ }
127
+ } catch {
128
+ }
129
+ }
121
130
  if (context.isSubAgent) return Promise.resolve(false);
122
131
  if (typeof context.onEvent !== "function") return Promise.resolve(false);
123
132
  const seq = ++confirmationSeqCounter;
@@ -1040,65 +1049,6 @@ function stripTailPipe(command) {
1040
1049
  }
1041
1050
 
1042
1051
  // src/server/tools/shell.ts
1043
- var ESCAPE_PATTERNS = [
1044
- /\bcd\s+['"]?(?:\.\.|\/|~)/,
1045
- /\bcd\s+\$/,
1046
- // cd with variable expansion ($HOME, ${HOME})
1047
- /\bcd\s+\$\(/,
1048
- // cd with command substitution $(...)
1049
- /\bcd\s+`/,
1050
- // cd with backtick substitution
1051
- /\bgit\s+-C\s+/,
1052
- /GIT_DIR=/,
1053
- /\bgit\s+--work-tree[\s=]/,
1054
- /\bgit\s+--git-dir[\s=]/
1055
- ];
1056
- function extractCdTarget(segment) {
1057
- const trimmed = segment.trim();
1058
- const match = trimmed.match(/^cd\s+(.+)$/);
1059
- if (!match) return null;
1060
- return match[1].replace(/^['"]|['"]$/g, "").trim();
1061
- }
1062
- function isCdTargetWithinWorkdir(cdTarget, workdir) {
1063
- if (!cdTarget.startsWith("/")) return false;
1064
- const resolvedTarget = resolve3(cdTarget);
1065
- const normalizedWorkdir = resolve3(workdir).replace(/\/+$/, "");
1066
- return resolvedTarget === normalizedWorkdir || resolvedTarget.startsWith(normalizedWorkdir + "/");
1067
- }
1068
- function isCdToWithinWorkdir(segment, workdir) {
1069
- const trimmed = segment.trim();
1070
- if (!/^cd\s+['"]?\//.test(trimmed)) return false;
1071
- const cdTarget = extractCdTarget(trimmed);
1072
- return cdTarget !== null && isCdTargetWithinWorkdir(cdTarget, workdir);
1073
- }
1074
- function detectEscapePattern(command, workdir) {
1075
- const normalized = command.replace(/'[^']*'/g, " ").replace(/"[^"]*"/g, " ");
1076
- for (const pattern of ESCAPE_PATTERNS) {
1077
- const match = normalized.match(pattern);
1078
- if (match) {
1079
- const matched = match[0].trim();
1080
- if (workdir && (matched.startsWith("cd /") || matched.startsWith('cd "'))) {
1081
- const segments2 = command.split(/[;&|]|&&|\|\|/);
1082
- const allCdsWithinWorkdir = segments2.every(
1083
- (seg) => !/^cd\s+['"]?\//.test(seg.trim()) || isCdToWithinWorkdir(seg, workdir)
1084
- );
1085
- if (allCdsWithinWorkdir) continue;
1086
- }
1087
- return matched;
1088
- }
1089
- }
1090
- const segments = command.split(/[;&|]|&&|\|\|/);
1091
- for (const segment of segments) {
1092
- const trimmed = segment.trim();
1093
- if (/^cd\s+.+\.\./.test(trimmed) || /^cd\s+['"]?\//.test(trimmed) || /^cd\s+['"]?~/.test(trimmed) || /^cd\s+['"]?\.\./.test(trimmed) || /^cd\s+.*\$\(/.test(trimmed) || // cd with $(...) substitution
1094
- /^cd\s+.*`/.test(trimmed) || // cd with backtick substitution
1095
- /^cd\s+.*\$\{?[A-Za-z_]/.test(trimmed)) {
1096
- if (workdir && isCdToWithinWorkdir(trimmed, workdir)) continue;
1097
- return trimmed;
1098
- }
1099
- }
1100
- return null;
1101
- }
1102
1052
  function detectGitMutation(command) {
1103
1053
  const gitMatch = command.match(
1104
1054
  /\bgit\s+['"]?(?:checkout|switch|branch\s+(-[dDmcMC]|--delete|--move|--copy|--force|-f)|-b\s+\S+|merge|rebase|reset|cherry-pick|worktree|clone|pull|push|fetch|update-ref|symbolic-ref)/
@@ -1179,16 +1129,6 @@ var runCommandTool = createTool(
1179
1129
  `Use background_process tool (action: "start") for background/long-running commands instead of '&'. See the tool description for details.`
1180
1130
  );
1181
1131
  }
1182
- const escapeMatch = detectEscapePattern(args.command, context.workdir);
1183
- if (escapeMatch) {
1184
- const desc = `Command "${args.command}" contains workspace escape pattern "${escapeMatch}". Allow this command?`;
1185
- const approved = await requestUserConfirmation(context, "command", desc);
1186
- if (!approved) {
1187
- return helpers.error(
1188
- `User denied: command "${escapeMatch}" would escape the workspace. Use the workspace tool to switch workspaces directly.`
1189
- );
1190
- }
1191
- }
1192
1132
  const mutationMatch = detectGitMutation(args.command);
1193
1133
  if (mutationMatch) {
1194
1134
  const desc = `Command "${args.command}" modifies Git state (${mutationMatch}). Allow this Git operation?`;
@@ -2636,7 +2576,7 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
2636
2576
  sessionManager.setCurrentContextSize(sessionId, result.usage.promptTokens, config.subAgentMetadata?.subAgentId);
2637
2577
  if (!compacting) {
2638
2578
  const contextState2 = sessionManager.getContextState(sessionId);
2639
- const { shouldCompact, appendCompactionPrompt } = await import("./compactor-LJFUIKWB.js");
2579
+ const { shouldCompact, appendCompactionPrompt } = await import("./compactor-YKESKGHL.js");
2640
2580
  if (shouldCompact(
2641
2581
  contextState2.currentTokens,
2642
2582
  contextState2.maxTokens,
@@ -2721,7 +2661,7 @@ ${COMPACTION_PROMPT}`,
2721
2661
  toolRegistry,
2722
2662
  sessionManager,
2723
2663
  sessionId,
2724
- workdir: session.workspace ?? session.workdir,
2664
+ workdir: sessionManager.getEffectiveWorkdir(sessionId),
2725
2665
  turnMetrics,
2726
2666
  signal,
2727
2667
  onMessage,
@@ -3460,7 +3400,7 @@ async function executeSubAgent(options) {
3460
3400
  })
3461
3401
  );
3462
3402
  }
3463
- const effectiveWorkdir = session.workspace ?? session.workdir;
3403
+ const effectiveWorkdir = sessionManager.getEffectiveWorkdir(session.id);
3464
3404
  const { content: instructionContent } = await getAllInstructions(effectiveWorkdir, session.projectId);
3465
3405
  const config = getRuntimeConfig();
3466
3406
  const configDir = getGlobalConfigDir(config.mode ?? "production");
@@ -3575,7 +3515,7 @@ var callSubAgentTool = {
3575
3515
  };
3576
3516
  }
3577
3517
  try {
3578
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-APH5FLYT.js");
3518
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-NXEKDL2V.js");
3579
3519
  const toolRegistry = getToolRegistryForAgent2(agentDef);
3580
3520
  const turnMetrics = new TurnMetrics();
3581
3521
  const result = await executeSubAgent({
@@ -4578,7 +4518,7 @@ var mcpConfigTool = createTool(
4578
4518
  mcpNotifyChanged?.(sessionId);
4579
4519
  }
4580
4520
  async function rebuildTools() {
4581
- const { setMcpTools: setMcpTools2 } = await import("./tools-APH5FLYT.js");
4521
+ const { setMcpTools: setMcpTools2 } = await import("./tools-NXEKDL2V.js");
4582
4522
  const mcpTools = createMcpTools(mcpManagerForTools);
4583
4523
  setMcpTools2(mcpTools);
4584
4524
  }
@@ -4921,7 +4861,7 @@ var workspaceTool = createTool(
4921
4861
  if (!session) return helpers.error("Session not found");
4922
4862
  const project = sessionManager.getProject(session.projectId);
4923
4863
  if (!project) return helpers.error("Project not found");
4924
- const currentBranch = await getGitBranch(session.workspace ?? session.workdir);
4864
+ const currentBranch = await getGitBranch(sessionManager.getEffectiveWorkdir(session.id));
4925
4865
  const named = await listWorkspaces(project.name, project.workdir);
4926
4866
  const activeWsName = session.workspace?.split("/").pop() ?? null;
4927
4867
  const workspaces = [
@@ -5241,4 +5181,4 @@ export {
5241
5181
  getToolRegistryForAgent,
5242
5182
  createToolRegistry
5243
5183
  };
5244
- //# sourceMappingURL=chunk-MAGDRXHW.js.map
5184
+ //# sourceMappingURL=chunk-7QCJCIVB.js.map
@@ -163,7 +163,7 @@ async function runCli(options) {
163
163
  break;
164
164
  }
165
165
  case "provider": {
166
- const { runProviderCommand } = await import("./provider-TIZV4IFE.js");
166
+ const { runProviderCommand } = await import("./provider-QVVJ6XNZ.js");
167
167
  const [, subcommand] = positionals;
168
168
  await runProviderCommand(mode, subcommand);
169
169
  break;
@@ -200,7 +200,7 @@ async function runCli(options) {
200
200
  break;
201
201
  }
202
202
  case "update": {
203
- const { runUpdate } = await import("./update-6OFFUWZN.js");
203
+ const { runUpdate } = await import("./update-BGQRA2UG.js");
204
204
  const code = await runUpdate();
205
205
  if (code !== 0) {
206
206
  process.exit(code);
@@ -213,7 +213,7 @@ async function runCli(options) {
213
213
  if (!configExists) {
214
214
  await runNetworkSetup(mode);
215
215
  }
216
- const { runServe } = await import("./serve-U53R54PO.js");
216
+ const { runServe } = await import("./serve-PHRKCACD.js");
217
217
  const serveOptions = { mode };
218
218
  if (values.port) serveOptions.port = parseInt(values.port);
219
219
  if (values["no-browser"] === true) serveOptions.openBrowser = false;
@@ -225,4 +225,4 @@ async function runCli(options) {
225
225
  export {
226
226
  runCli
227
227
  };
228
- //# sourceMappingURL=chunk-F56O4B67.js.map
228
+ //# sourceMappingURL=chunk-ATU2X6EP.js.map
@@ -26,7 +26,9 @@ var SETTINGS_KEYS = {
26
26
  SEARCH_SEARXNG_URL: "search.searxngUrl",
27
27
  SEARCH_SEARXNG_API_KEY: "search.searxngApiKey",
28
28
  TOOLS_USE_RTK: "tools.useRtk",
29
- TOOLS_SHELL: "tools.shell"
29
+ TOOLS_SHELL: "tools.shell",
30
+ CONFIRM_ON_WORKSPACE_ACTIONS: "tools.confirmOnWorkspaceActions",
31
+ PROXY_URL: "network.proxyUrl"
30
32
  };
31
33
  var SETTINGS_DEFAULTS = {
32
34
  [SETTINGS_KEYS.DISPLAY_SHOW_THINKING]: "true",
@@ -53,7 +55,8 @@ var SETTINGS_DEFAULTS = {
53
55
  ]
54
56
  }),
55
57
  [SETTINGS_KEYS.TOOLS_USE_RTK]: "false",
56
- [SETTINGS_KEYS.TOOLS_SHELL]: "cmd"
58
+ [SETTINGS_KEYS.TOOLS_SHELL]: "cmd",
59
+ [SETTINGS_KEYS.CONFIRM_ON_WORKSPACE_ACTIONS]: "false"
57
60
  };
58
61
  function getSetting(key) {
59
62
  try {
@@ -106,4 +109,4 @@ export {
106
109
  getAllSettings,
107
110
  getMaxVisibleItems
108
111
  };
109
- //# sourceMappingURL=chunk-AFJLY43Z.js.map
112
+ //# sourceMappingURL=chunk-CNJ63FXJ.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  COMPACTION_PROMPT,
3
3
  createMessageStartEvent
4
- } from "./chunk-EHVDAVYG.js";
4
+ } from "./chunk-FVY2JOTO.js";
5
5
  import {
6
6
  getCurrentWindowMessageOptions
7
7
  } from "./chunk-BUXIESO5.js";
@@ -34,4 +34,4 @@ export {
34
34
  COMPACTION_MAX_RATIO,
35
35
  shouldCompact
36
36
  };
37
- //# sourceMappingURL=chunk-LYZ3LQRX.js.map
37
+ //# sourceMappingURL=chunk-DQP5HSDS.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getPlatformShell
3
- } from "./chunk-MTUYDBSL.js";
3
+ } from "./chunk-5ZHVQOI3.js";
4
4
  import {
5
5
  streamWithSegments
6
6
  } from "./chunk-J2GP3J3X.js";
@@ -680,4 +680,4 @@ export {
680
680
  createChatDoneEvent,
681
681
  consumeStreamGenerator
682
682
  };
683
- //# sourceMappingURL=chunk-EHVDAVYG.js.map
683
+ //# sourceMappingURL=chunk-FVY2JOTO.js.map
@@ -1,3 +1,7 @@
1
+ import {
2
+ SETTINGS_KEYS,
3
+ getSetting
4
+ } from "./chunk-CNJ63FXJ.js";
1
5
  import {
2
6
  logger
3
7
  } from "./chunk-K44MW7JJ.js";
@@ -24,6 +28,52 @@ var LLMError = class extends OpenFoxError {
24
28
  }
25
29
  };
26
30
 
31
+ // src/server/llm/proxy.ts
32
+ import { fetch as undiciFetch, ProxyAgent } from "undici";
33
+ var _cachedProxyUrl;
34
+ var _cachedAgent;
35
+ function getProxyAgent() {
36
+ const proxyUrl = getSetting(SETTINGS_KEYS.PROXY_URL) ?? void 0;
37
+ if (!proxyUrl) {
38
+ if (_cachedAgent) {
39
+ _cachedAgent.destroy().catch((err) => {
40
+ logger.warn("[proxy] Failed to destroy old proxy agent", { error: err });
41
+ });
42
+ _cachedAgent = void 0;
43
+ _cachedProxyUrl = void 0;
44
+ }
45
+ return void 0;
46
+ }
47
+ if (proxyUrl !== _cachedProxyUrl) {
48
+ if (_cachedAgent) {
49
+ _cachedAgent.destroy().catch((err) => {
50
+ logger.warn("[proxy] Failed to destroy old proxy agent", { error: err });
51
+ });
52
+ }
53
+ _cachedProxyUrl = proxyUrl;
54
+ try {
55
+ _cachedAgent = new ProxyAgent({
56
+ uri: proxyUrl,
57
+ requestTls: { rejectUnauthorized: true }
58
+ });
59
+ logger.info("[proxy] Proxy agent created", { proxyUrl });
60
+ } catch (err) {
61
+ logger.error("[proxy] Failed to create proxy agent", { proxyUrl, error: err });
62
+ _cachedAgent = void 0;
63
+ _cachedProxyUrl = void 0;
64
+ return void 0;
65
+ }
66
+ }
67
+ return _cachedAgent;
68
+ }
69
+ async function proxyFetch(url, options) {
70
+ const agent = getProxyAgent();
71
+ if (agent) {
72
+ return undiciFetch(url, { ...options, dispatcher: agent });
73
+ }
74
+ return fetch(url, options);
75
+ }
76
+
27
77
  // src/server/llm/http-client.ts
28
78
  var OpenAIHttpClient = class {
29
79
  baseURL;
@@ -40,7 +90,7 @@ var OpenAIHttpClient = class {
40
90
  };
41
91
  const bodyStr = JSON.stringify(params);
42
92
  logger.debug("HTTP request to LLM", { url, bodyKeys: Object.keys(params) });
43
- const response = await fetch(url, {
93
+ const response = await proxyFetch(url, {
44
94
  method: "POST",
45
95
  headers,
46
96
  body: bodyStr,
@@ -110,6 +160,7 @@ var OpenAIHttpClient = class {
110
160
  export {
111
161
  SessionNotFoundError,
112
162
  LLMError,
163
+ proxyFetch,
113
164
  OpenAIHttpClient
114
165
  };
115
- //# sourceMappingURL=chunk-ZO5EXQMG.js.map
166
+ //# sourceMappingURL=chunk-IIRXKSB5.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getPlatformShell
3
- } from "./chunk-MTUYDBSL.js";
3
+ } from "./chunk-5ZHVQOI3.js";
4
4
  import {
5
5
  appendLog,
6
6
  createProcess,
@@ -153,4 +153,4 @@ export {
153
153
  getSessionProcesses2 as getSessionProcesses,
154
154
  getProcessLogs
155
155
  };
156
- //# sourceMappingURL=chunk-5CQRB7AD.js.map
156
+ //# sourceMappingURL=chunk-JKZPMRH2.js.map