openfox 2.0.58 → 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.
- package/dist/agent-defaults/explorer.agent.md +4 -0
- package/dist/{branch.api-5DMEAIBI.js → branch.api-LAN42BA5.js} +3 -2
- package/dist/{chat-handler-W5D5LKKU.js → chat-handler-AS44EMQE.js} +6 -6
- package/dist/{chunk-YMEZFRY2.js → chunk-43UFGATL.js} +5 -5
- package/dist/{chunk-CFLGVCYT.js → chunk-5MDIKIMG.js} +20 -9
- package/dist/{chunk-BIWVYBIE.js → chunk-BGTEIA2S.js} +4 -3
- package/dist/{chunk-XR2XC7WM.js → chunk-EKI5SZC7.js} +2 -2
- package/dist/{chunk-LAWUUAN7.js → chunk-FRU2X3IZ.js} +69 -29
- package/dist/{chunk-UDZNMYWN.js → chunk-LQFCQ6PY.js} +95 -72
- package/dist/{chunk-55VITQP3.js → chunk-P7C6KF2H.js} +9 -9
- package/dist/{chunk-ADOXTORQ.js → chunk-PK2RMVMB.js} +2 -2
- package/dist/cli/dev.js +2 -2
- package/dist/cli/index.js +2 -2
- package/dist/{config-C2YDEF3N.js → config-GMQUPNBY.js} +2 -2
- package/dist/{manager-CZOVNTSN.js → manager-344C5JLZ.js} +3 -3
- package/dist/{orchestrator-Q47D6JXG.js → orchestrator-MH7J2YVP.js} +6 -6
- package/dist/package.json +1 -1
- package/dist/{permissions-QLHZUEGW.js → permissions-CGEK3DGZ.js} +21 -17
- package/dist/{processor-2YJ33KUH.js → processor-34MVJZTD.js} +6 -6
- package/dist/{project-creator-7RBHP6K6.js → project-creator-IDW7RACH.js} +4 -4
- package/dist/{protocol-PSKVUhdN.d.ts → protocol-J7khRG62.d.ts} +2 -0
- package/dist/{provider-SNXYPSPH.js → provider-LBYBC5AG.js} +3 -3
- package/dist/{pwa-M6QZ52ZO.js → pwa-T6JRAYJB.js} +11 -10
- package/dist/{serve-LOPGRMFP.js → serve-NHF6B5RQ.js} +8 -8
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +7 -7
- package/dist/{server-XUDZRBD3.js → server-KDGQZNYQ.js} +7 -7
- package/dist/{service-YYJ5Y7CN.js → service-6DL3MJZD.js} +7 -5
- package/dist/shared/index.d.ts +2 -2
- package/dist/{store-NS2RMRA7.js → store-FXTCHBI4.js} +2 -2
- package/dist/{tools-YJLXW3QS.js → tools-FQ54IAYG.js} +5 -5
- 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
|
|
@@ -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-
|
|
50
|
+
//# sourceMappingURL=branch.api-LAN42BA5.js.map
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
} from "./chunk-NVPVDDQZ.js";
|
|
6
6
|
import {
|
|
7
7
|
runChatTurn
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-EKI5SZC7.js";
|
|
9
|
+
import "./chunk-FRU2X3IZ.js";
|
|
10
10
|
import "./chunk-LBGHZLLH.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-BGTEIA2S.js";
|
|
12
|
+
import "./chunk-PK2RMVMB.js";
|
|
13
13
|
import "./chunk-NWO6GRYE.js";
|
|
14
14
|
import {
|
|
15
15
|
createChatMessageMessage,
|
|
@@ -30,7 +30,7 @@ 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-
|
|
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-
|
|
157
|
+
//# sourceMappingURL=chat-handler-AS44EMQE.js.map
|
|
@@ -125,8 +125,8 @@ var configSchema = z.object({
|
|
|
125
125
|
function getVisionFallback(config) {
|
|
126
126
|
return config.visionFallback ?? getDefaultVisionFallback();
|
|
127
127
|
}
|
|
128
|
-
async function loadGlobalConfig(mode) {
|
|
129
|
-
const configPath = getGlobalConfigPath(mode);
|
|
128
|
+
async function loadGlobalConfig(mode, configPathOverride) {
|
|
129
|
+
const configPath = configPathOverride ?? getGlobalConfigPath(mode);
|
|
130
130
|
try {
|
|
131
131
|
const content = await readFile(configPath, "utf-8");
|
|
132
132
|
const parsed = JSON.parse(content);
|
|
@@ -138,8 +138,8 @@ async function loadGlobalConfig(mode) {
|
|
|
138
138
|
function getDefaultVisionFallback() {
|
|
139
139
|
return { enabled: false, url: "http://localhost:11434", model: "qwen3.5:0.8b", timeout: 120 };
|
|
140
140
|
}
|
|
141
|
-
async function saveGlobalConfig(mode, config) {
|
|
142
|
-
const configPath = getGlobalConfigPath(mode);
|
|
141
|
+
async function saveGlobalConfig(mode, config, configPathOverride) {
|
|
142
|
+
const configPath = configPathOverride ?? getGlobalConfigPath(mode);
|
|
143
143
|
const fullConfig = {
|
|
144
144
|
providers: config.providers ?? [],
|
|
145
145
|
mcpServers: config.mcpServers,
|
|
@@ -291,4 +291,4 @@ export {
|
|
|
291
291
|
removeProvider,
|
|
292
292
|
activateProvider
|
|
293
293
|
};
|
|
294
|
-
//# sourceMappingURL=chunk-
|
|
294
|
+
//# sourceMappingURL=chunk-43UFGATL.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
injectWorkflowKickoffIfNeeded,
|
|
3
3
|
runAgentTurn,
|
|
4
4
|
runChatTurn
|
|
5
|
-
} from "./chunk-
|
|
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-
|
|
19
|
+
} from "./chunk-FRU2X3IZ.js";
|
|
20
20
|
import {
|
|
21
21
|
getPlatformShell,
|
|
22
22
|
onProcessEvent
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-BGTEIA2S.js";
|
|
24
24
|
import {
|
|
25
25
|
createChatErrorMessage,
|
|
26
26
|
createChatMessageMessage,
|
|
@@ -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"], {
|
|
456
|
-
|
|
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-
|
|
2105
|
+
//# sourceMappingURL=chunk-5MDIKIMG.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
removeProcess,
|
|
9
9
|
startProcess,
|
|
10
10
|
updateStatus
|
|
11
|
-
} from "./chunk-
|
|
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-
|
|
157
|
+
//# sourceMappingURL=chunk-BGTEIA2S.js.map
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
loadAllAgentsDefault,
|
|
13
13
|
processEventsForConversation,
|
|
14
14
|
runTopLevelAgentLoop
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FRU2X3IZ.js";
|
|
16
16
|
import {
|
|
17
17
|
TurnMetrics,
|
|
18
18
|
WORKFLOW_KICKOFF_PROMPT,
|
|
@@ -324,4 +324,4 @@ export {
|
|
|
324
324
|
runAgentTurn,
|
|
325
325
|
injectWorkflowKickoffIfNeeded
|
|
326
326
|
};
|
|
327
|
-
//# sourceMappingURL=chunk-
|
|
327
|
+
//# sourceMappingURL=chunk-EKI5SZC7.js.map
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
getSessionProcesses,
|
|
10
10
|
startProcessCommand,
|
|
11
11
|
stopProcess
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BGTEIA2S.js";
|
|
13
13
|
import {
|
|
14
14
|
getMaxPerSession,
|
|
15
15
|
getSessionProcessCount,
|
|
16
16
|
terminateProcessTree
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-PK2RMVMB.js";
|
|
18
18
|
import {
|
|
19
19
|
createMcpTools
|
|
20
20
|
} from "./chunk-NWO6GRYE.js";
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
import {
|
|
74
74
|
loadGlobalConfig,
|
|
75
75
|
saveGlobalConfig
|
|
76
|
-
} from "./chunk-
|
|
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=(])(
|
|
279
|
+
const absolutePattern = /(?:^|[\s=(])(\/[^\s"'|&;<>`()]+)/g;
|
|
277
280
|
while ((match = absolutePattern.exec(sanitized)) !== null) {
|
|
278
|
-
const
|
|
279
|
-
if (
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
if (
|
|
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";
|
|
@@ -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-
|
|
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
|
|
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-
|
|
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
|
|
3680
|
-
import { resolve as resolve5, join as
|
|
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
|
|
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
|
|
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 =
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
|
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
|
|
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-
|
|
5074
|
+
//# sourceMappingURL=chunk-FRU2X3IZ.js.map
|