openfox 2.0.68 → 2.0.69
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/{chat-handler-QFEHJBWN.js → chat-handler-K3DWIGHG.js} +4 -3
- package/dist/{chunk-COWJRBV4.js → chunk-46OR4W3L.js} +6 -6
- package/dist/{chunk-6LK47TNE.js → chunk-PVWAE43V.js} +43 -8
- package/dist/chunk-UN26GIQG.js +54 -0
- package/dist/{chunk-FCLCEIY4.js → chunk-UTSSFPYA.js} +4 -4
- package/dist/{chunk-32KLLK4N.js → chunk-VFYNKALW.js} +2 -2
- package/dist/{chunk-DWZEGLHJ.js → chunk-WHVCGVQX.js} +149 -27
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{orchestrator-GNXKJPX4.js → orchestrator-PUV4WG77.js} +4 -3
- package/dist/package.json +1 -1
- package/dist/{processor-TIQEQDP7.js → processor-O2QW27BD.js} +4 -3
- package/dist/{serve-QVVZ5SJE.js → serve-Q34XBLR5.js} +6 -5
- package/dist/server/index.js +5 -4
- package/dist/{server-ECKS2Y3R.js → server-RLNPHLY2.js} +5 -4
- package/dist/{tools-QAEN5KHA.js → tools-CALGWIV2.js} +3 -2
- package/dist/update-server-MYYQUNZX.js +10 -0
- package/dist/web/assets/{index-BA_65WJ5.css → index-BVTG7SRG.css} +1 -1
- package/dist/web/assets/{index-CsZQdTAd.js → index-oKJVe9Cz.js} +74 -72
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
|
@@ -5,14 +5,15 @@ import {
|
|
|
5
5
|
} from "./chunk-64GN6OPR.js";
|
|
6
6
|
import {
|
|
7
7
|
runChatTurn
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-UTSSFPYA.js";
|
|
9
|
+
import "./chunk-PVWAE43V.js";
|
|
10
10
|
import "./chunk-QFSDJIUS.js";
|
|
11
11
|
import "./chunk-4QBDV6LX.js";
|
|
12
12
|
import "./chunk-KXVFHMSM.js";
|
|
13
13
|
import "./chunk-TFCHWMOJ.js";
|
|
14
14
|
import "./chunk-PK2RMVMB.js";
|
|
15
15
|
import "./chunk-NWO6GRYE.js";
|
|
16
|
+
import "./chunk-UN26GIQG.js";
|
|
16
17
|
import "./chunk-VLV3XWZS.js";
|
|
17
18
|
import "./chunk-WGMJCFCE.js";
|
|
18
19
|
import {
|
|
@@ -157,4 +158,4 @@ export {
|
|
|
157
158
|
startChatSession,
|
|
158
159
|
stopSessionExecution
|
|
159
160
|
};
|
|
160
|
-
//# sourceMappingURL=chat-handler-
|
|
161
|
+
//# sourceMappingURL=chat-handler-K3DWIGHG.js.map
|
|
@@ -3,10 +3,7 @@ import {
|
|
|
3
3
|
computeSessionHash,
|
|
4
4
|
runAgentTurn,
|
|
5
5
|
runChatTurn
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
appendCompactionPrompt
|
|
9
|
-
} from "./chunk-YQ3MEZJL.js";
|
|
6
|
+
} from "./chunk-UTSSFPYA.js";
|
|
10
7
|
import {
|
|
11
8
|
deleteItemFromDir,
|
|
12
9
|
devServerManager,
|
|
@@ -16,7 +13,10 @@ import {
|
|
|
16
13
|
jsonSerializer,
|
|
17
14
|
loadAllAgentsDefault,
|
|
18
15
|
saveItemToDir
|
|
19
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-PVWAE43V.js";
|
|
17
|
+
import {
|
|
18
|
+
appendCompactionPrompt
|
|
19
|
+
} from "./chunk-YQ3MEZJL.js";
|
|
20
20
|
import {
|
|
21
21
|
TurnMetrics,
|
|
22
22
|
createMessageStartEvent
|
|
@@ -2158,4 +2158,4 @@ export {
|
|
|
2158
2158
|
signalMcpReady,
|
|
2159
2159
|
createWebSocketServer
|
|
2160
2160
|
};
|
|
2161
|
-
//# sourceMappingURL=chunk-
|
|
2161
|
+
//# sourceMappingURL=chunk-46OR4W3L.js.map
|
|
@@ -36,6 +36,9 @@ import {
|
|
|
36
36
|
import {
|
|
37
37
|
createMcpTools
|
|
38
38
|
} from "./chunk-NWO6GRYE.js";
|
|
39
|
+
import {
|
|
40
|
+
applyMcpServerUpdate
|
|
41
|
+
} from "./chunk-UN26GIQG.js";
|
|
39
42
|
import {
|
|
40
43
|
listBranches
|
|
41
44
|
} from "./chunk-VLV3XWZS.js";
|
|
@@ -3779,7 +3782,7 @@ var callSubAgentTool = {
|
|
|
3779
3782
|
};
|
|
3780
3783
|
}
|
|
3781
3784
|
try {
|
|
3782
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
3785
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-CALGWIV2.js");
|
|
3783
3786
|
const toolRegistry = getToolRegistryForAgent2(agentDef);
|
|
3784
3787
|
const turnMetrics = new TurnMetrics();
|
|
3785
3788
|
const result = await executeSubAgent({
|
|
@@ -4701,18 +4704,18 @@ var mcpConfigTool = createTool(
|
|
|
4701
4704
|
type: "function",
|
|
4702
4705
|
function: {
|
|
4703
4706
|
name: "mcp_config",
|
|
4704
|
-
description: "Configure MCP servers (Model Context Protocol). Actions: list (show all servers and tools), add (add a server), remove (delete a server), toggle-tool (enable/disable a tool). Use this when the user asks to add, remove, or configure MCP servers or tools.",
|
|
4707
|
+
description: "Configure MCP servers (Model Context Protocol). Actions: list (show all servers and tools), add (add a server), update (modify an existing server \u2014 all fields are optional and merged with the current config, transport-incompatible fields are cleared on transport change), remove (delete a server), toggle-tool (enable/disable a tool). Use this when the user asks to add, remove, update, or configure MCP servers or tools.",
|
|
4705
4708
|
parameters: {
|
|
4706
4709
|
type: "object",
|
|
4707
4710
|
properties: {
|
|
4708
4711
|
action: {
|
|
4709
4712
|
type: "string",
|
|
4710
|
-
enum: ["list", "add", "remove", "toggle-tool"],
|
|
4711
|
-
description: "Action: list (show servers), add (add new server), remove (delete a server), toggle-tool (enable/disable a tool)"
|
|
4713
|
+
enum: ["list", "add", "update", "remove", "toggle-tool"],
|
|
4714
|
+
description: "Action: list (show servers), add (add new server), update (modify existing server), remove (delete a server), toggle-tool (enable/disable a tool)"
|
|
4712
4715
|
},
|
|
4713
4716
|
name: {
|
|
4714
4717
|
type: "string",
|
|
4715
|
-
description: "Server name (required for: add, remove, toggle-tool)"
|
|
4718
|
+
description: "Server name (required for: add, update, remove, toggle-tool)"
|
|
4716
4719
|
},
|
|
4717
4720
|
transport: {
|
|
4718
4721
|
type: "string",
|
|
@@ -4758,7 +4761,7 @@ var mcpConfigTool = createTool(
|
|
|
4758
4761
|
async (args, context, helpers) => {
|
|
4759
4762
|
const actionError = validateActionWithPermission(
|
|
4760
4763
|
args.action,
|
|
4761
|
-
["list", "add", "remove", "toggle-tool"],
|
|
4764
|
+
["list", "add", "update", "remove", "toggle-tool"],
|
|
4762
4765
|
"mcp_config",
|
|
4763
4766
|
context.permittedActions
|
|
4764
4767
|
);
|
|
@@ -4778,7 +4781,7 @@ var mcpConfigTool = createTool(
|
|
|
4778
4781
|
mcpNotifyChanged?.(sessionId);
|
|
4779
4782
|
}
|
|
4780
4783
|
async function rebuildTools() {
|
|
4781
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
4784
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-CALGWIV2.js");
|
|
4782
4785
|
const mcpTools = createMcpTools(mcpManagerForTools);
|
|
4783
4786
|
setMcpTools2(mcpTools);
|
|
4784
4787
|
}
|
|
@@ -4834,6 +4837,38 @@ var mcpConfigTool = createTool(
|
|
|
4834
4837
|
const toolCount = server?.tools.length ?? 0;
|
|
4835
4838
|
return helpers.success(`Added MCP server "${args.name}" (${toolCount} tools discovered). ${APPLY_PROMPT_MESSAGE}`);
|
|
4836
4839
|
}
|
|
4840
|
+
if (args.action === "update") {
|
|
4841
|
+
if (!args.name) return helpers.error("Missing required field: name");
|
|
4842
|
+
const existing = mcpManagerForTools.getServer(args.name);
|
|
4843
|
+
if (!existing) return helpers.error(`MCP server "${args.name}" not found`);
|
|
4844
|
+
const globalConfig = await loadGlobalConfig(mcpConfigMode, mcpConfigPath);
|
|
4845
|
+
const mcpServers = { ...globalConfig.mcpServers ?? {} };
|
|
4846
|
+
const patch = {
|
|
4847
|
+
...args.transport !== void 0 ? { transport: args.transport } : {},
|
|
4848
|
+
...args.command !== void 0 ? { command: args.command } : {},
|
|
4849
|
+
...args.args !== void 0 ? { args: args.args } : {},
|
|
4850
|
+
...args.env !== void 0 ? { env: args.env } : {},
|
|
4851
|
+
...args.url !== void 0 ? { url: args.url } : {},
|
|
4852
|
+
...args.headers !== void 0 ? { headers: args.headers } : {}
|
|
4853
|
+
};
|
|
4854
|
+
const { error: updateError } = await applyMcpServerUpdate({
|
|
4855
|
+
name: args.name,
|
|
4856
|
+
patch,
|
|
4857
|
+
existing,
|
|
4858
|
+
persistedCfg: mcpServers[args.name],
|
|
4859
|
+
mcpManager: mcpManagerForTools,
|
|
4860
|
+
save: async (cfg) => {
|
|
4861
|
+
mcpServers[args.name] = cfg;
|
|
4862
|
+
await saveGlobalConfig(mcpConfigMode, { ...globalConfig, mcpServers }, mcpConfigPath);
|
|
4863
|
+
}
|
|
4864
|
+
});
|
|
4865
|
+
if (updateError) return helpers.error(updateError);
|
|
4866
|
+
await rebuildTools();
|
|
4867
|
+
notifyContextChanged(context.sessionId);
|
|
4868
|
+
const server = mcpManagerForTools.getServer(args.name);
|
|
4869
|
+
const toolCount = server?.tools.length ?? 0;
|
|
4870
|
+
return helpers.success(`Updated MCP server "${args.name}" (${toolCount} tools discovered). ${APPLY_PROMPT_MESSAGE}`);
|
|
4871
|
+
}
|
|
4837
4872
|
if (args.action === "remove") {
|
|
4838
4873
|
if (!args.name) return helpers.error("Missing required field: name");
|
|
4839
4874
|
await persistAndRebuild((mcpServers) => {
|
|
@@ -5441,4 +5476,4 @@ export {
|
|
|
5441
5476
|
getToolRegistryForAgent,
|
|
5442
5477
|
createToolRegistry
|
|
5443
5478
|
};
|
|
5444
|
-
//# sourceMappingURL=chunk-
|
|
5479
|
+
//# sourceMappingURL=chunk-PVWAE43V.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// src/server/mcp/update-server.ts
|
|
2
|
+
function buildUpdatedServerConfig(patch, existing, persistedCfg) {
|
|
3
|
+
const existingTransport = existing.config.transport ?? "stdio";
|
|
4
|
+
const resolvedTransport = patch.transport ?? existingTransport;
|
|
5
|
+
const transportChanged = resolvedTransport !== existingTransport;
|
|
6
|
+
const mergedCommand = patch.command !== void 0 ? patch.command : transportChanged ? void 0 : existing.config.command;
|
|
7
|
+
const mergedArgs = patch.args !== void 0 ? patch.args : transportChanged ? void 0 : existing.config.args;
|
|
8
|
+
const mergedEnv = patch.env !== void 0 ? patch.env : transportChanged ? void 0 : existing.config.env;
|
|
9
|
+
const mergedUrl = patch.url !== void 0 ? patch.url : transportChanged ? void 0 : existing.config.url;
|
|
10
|
+
const mergedHeaders = patch.headers !== void 0 ? patch.headers : transportChanged ? void 0 : existing.config.headers;
|
|
11
|
+
if (resolvedTransport === "http" && !mergedUrl) {
|
|
12
|
+
return { serverCfg: {}, error: "url is required for http transport" };
|
|
13
|
+
}
|
|
14
|
+
if (resolvedTransport !== "http" && !mergedCommand) {
|
|
15
|
+
return { serverCfg: {}, error: "command is required for stdio transport" };
|
|
16
|
+
}
|
|
17
|
+
const serverCfg = {
|
|
18
|
+
transport: resolvedTransport,
|
|
19
|
+
...mergedCommand ? { command: mergedCommand } : {},
|
|
20
|
+
...mergedArgs && mergedArgs.length > 0 ? { args: mergedArgs } : {},
|
|
21
|
+
...mergedEnv && Object.keys(mergedEnv).length > 0 ? { env: mergedEnv } : {},
|
|
22
|
+
...mergedUrl ? { url: mergedUrl } : {},
|
|
23
|
+
...mergedHeaders && Object.keys(mergedHeaders).length > 0 ? { headers: mergedHeaders } : {},
|
|
24
|
+
...persistedCfg?.disabledTools && persistedCfg.disabledTools.length > 0 ? { disabledTools: persistedCfg.disabledTools } : {},
|
|
25
|
+
...persistedCfg?.cachedTools && persistedCfg.cachedTools.length > 0 ? { cachedTools: persistedCfg.cachedTools } : {}
|
|
26
|
+
};
|
|
27
|
+
return { serverCfg };
|
|
28
|
+
}
|
|
29
|
+
async function applyMcpServerUpdate(options) {
|
|
30
|
+
const { name, patch, existing, persistedCfg, mcpManager, save } = options;
|
|
31
|
+
const { serverCfg, error } = buildUpdatedServerConfig(patch, existing, persistedCfg);
|
|
32
|
+
if (error) return { serverCfg: {}, error };
|
|
33
|
+
mcpManager.removeServer(name);
|
|
34
|
+
try {
|
|
35
|
+
await mcpManager.addServer(name, serverCfg);
|
|
36
|
+
} catch (addError) {
|
|
37
|
+
await mcpManager.addServer(name, existing.config);
|
|
38
|
+
throw addError;
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
await save(serverCfg);
|
|
42
|
+
} catch (saveError) {
|
|
43
|
+
mcpManager.removeServer(name);
|
|
44
|
+
await mcpManager.addServer(name, existing.config);
|
|
45
|
+
throw saveError;
|
|
46
|
+
}
|
|
47
|
+
return { serverCfg };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
buildUpdatedServerConfig,
|
|
52
|
+
applyMcpServerUpdate
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=chunk-UN26GIQG.js.map
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
loadAllAgentsDefault,
|
|
11
11
|
processEventsForConversation,
|
|
12
12
|
runTopLevelAgentLoop
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-PVWAE43V.js";
|
|
14
14
|
import {
|
|
15
15
|
TurnMetrics,
|
|
16
16
|
buildAgentReminder,
|
|
@@ -64,7 +64,7 @@ function resolveAgentDef(sessionManager, sessionId) {
|
|
|
64
64
|
}
|
|
65
65
|
async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
|
|
66
66
|
const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
|
|
67
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
67
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-CALGWIV2.js");
|
|
68
68
|
const tools = getToolRegistryForAgent2(agentDef).definitions;
|
|
69
69
|
const toolFingerprint = getToolFingerprint(tools);
|
|
70
70
|
const allAgents = await loadAllAgentsDefault();
|
|
@@ -77,7 +77,7 @@ async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
|
|
|
77
77
|
async function computeSessionHash(sessionManager, sessionId) {
|
|
78
78
|
const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
|
|
79
79
|
const agentDef = await resolveAgentDef(sessionManager, sessionId);
|
|
80
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
80
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-CALGWIV2.js");
|
|
81
81
|
const tools = getToolRegistryForAgent2(agentDef).definitions;
|
|
82
82
|
const toolFingerprint = getToolFingerprint(tools);
|
|
83
83
|
return computeDynamicContextHash(instructionContent, skills, toolFingerprint);
|
|
@@ -357,4 +357,4 @@ export {
|
|
|
357
357
|
runChatTurn,
|
|
358
358
|
runAgentTurn
|
|
359
359
|
};
|
|
360
|
-
//# sourceMappingURL=chunk-
|
|
360
|
+
//# sourceMappingURL=chunk-UTSSFPYA.js.map
|
|
@@ -208,7 +208,7 @@ async function runCli(options) {
|
|
|
208
208
|
if (!configExists) {
|
|
209
209
|
await runNetworkSetup(mode);
|
|
210
210
|
}
|
|
211
|
-
const { runServe } = await import("./serve-
|
|
211
|
+
const { runServe } = await import("./serve-Q34XBLR5.js");
|
|
212
212
|
const serveOptions = { mode };
|
|
213
213
|
if (values.port) serveOptions.port = parseInt(values.port);
|
|
214
214
|
if (values["no-browser"] === true) serveOptions.openBrowser = false;
|
|
@@ -220,4 +220,4 @@ async function runCli(options) {
|
|
|
220
220
|
export {
|
|
221
221
|
runCli
|
|
222
222
|
};
|
|
223
|
-
//# sourceMappingURL=chunk-
|
|
223
|
+
//# sourceMappingURL=chunk-VFYNKALW.js.map
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
tokenFromPassword,
|
|
22
22
|
verifyPassword,
|
|
23
23
|
workflowExists
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-46OR4W3L.js";
|
|
25
25
|
import {
|
|
26
26
|
agentExists,
|
|
27
27
|
createToolRegistry,
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
setSkillEnabled,
|
|
67
67
|
skillExists,
|
|
68
68
|
updateOwnedSkill
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-PVWAE43V.js";
|
|
70
70
|
import {
|
|
71
71
|
ALWAYS_ALLOWED,
|
|
72
72
|
ALWAYS_ALLOWED_FOR_SUBAGENTS,
|
|
@@ -1733,7 +1733,9 @@ var LspServer = class {
|
|
|
1733
1733
|
}
|
|
1734
1734
|
this.state = "starting";
|
|
1735
1735
|
try {
|
|
1736
|
-
|
|
1736
|
+
const needsShell = process.platform === "win32" && /\.(cmd|bat)$/i.test(this.commandPath);
|
|
1737
|
+
const command = needsShell ? [`"${this.commandPath}"`, ...this.config.serverArgs].join(" ") : this.commandPath;
|
|
1738
|
+
this.process = spawn(command, needsShell ? [] : this.config.serverArgs, {
|
|
1737
1739
|
cwd: this.workdir,
|
|
1738
1740
|
stdio: ["pipe", "pipe", "pipe"],
|
|
1739
1741
|
env: {
|
|
@@ -1741,11 +1743,21 @@ var LspServer = class {
|
|
|
1741
1743
|
HOME: process.env["HOME"],
|
|
1742
1744
|
PATH: process.env["PATH"]
|
|
1743
1745
|
},
|
|
1744
|
-
windowsHide: true
|
|
1746
|
+
windowsHide: true,
|
|
1747
|
+
shell: needsShell
|
|
1748
|
+
});
|
|
1749
|
+
await new Promise((resolve8, reject) => {
|
|
1750
|
+
this.process.once("spawn", resolve8);
|
|
1751
|
+
this.process.once("error", reject);
|
|
1745
1752
|
});
|
|
1746
1753
|
if (!this.process.stdin || !this.process.stdout) {
|
|
1747
1754
|
throw new Error("Failed to get stdio streams from language server process");
|
|
1748
1755
|
}
|
|
1756
|
+
const onStreamError = (err) => {
|
|
1757
|
+
logger.debug("LSP stream error", { language: this.config.id, error: err.message });
|
|
1758
|
+
};
|
|
1759
|
+
this.process.stdin.on("error", onStreamError);
|
|
1760
|
+
this.process.stdout.on("error", onStreamError);
|
|
1749
1761
|
this.connection = createMessageConnection(
|
|
1750
1762
|
new StreamMessageReader(this.process.stdout),
|
|
1751
1763
|
new StreamMessageWriter(this.process.stdin)
|
|
@@ -2196,6 +2208,21 @@ async function existsExecutable(path) {
|
|
|
2196
2208
|
return false;
|
|
2197
2209
|
}
|
|
2198
2210
|
}
|
|
2211
|
+
function candidateNames(command) {
|
|
2212
|
+
if (process.platform !== "win32") {
|
|
2213
|
+
return [command];
|
|
2214
|
+
}
|
|
2215
|
+
return [".cmd", ".exe", ".bat", ""].map((ext) => command + ext);
|
|
2216
|
+
}
|
|
2217
|
+
async function findInDir(dir, command) {
|
|
2218
|
+
for (const name of candidateNames(command)) {
|
|
2219
|
+
const fullPath = join2(dir, name);
|
|
2220
|
+
if (await existsExecutable(fullPath)) {
|
|
2221
|
+
return fullPath;
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
return null;
|
|
2225
|
+
}
|
|
2199
2226
|
async function which(command, workdir) {
|
|
2200
2227
|
if (isAbsolutePath(command)) {
|
|
2201
2228
|
if (await existsExecutable(command)) {
|
|
@@ -2204,24 +2231,24 @@ async function which(command, workdir) {
|
|
|
2204
2231
|
return null;
|
|
2205
2232
|
}
|
|
2206
2233
|
for (const binDir of getBundledBinPaths()) {
|
|
2207
|
-
const
|
|
2208
|
-
if (
|
|
2209
|
-
return
|
|
2234
|
+
const found = await findInDir(binDir, command);
|
|
2235
|
+
if (found) {
|
|
2236
|
+
return found;
|
|
2210
2237
|
}
|
|
2211
2238
|
}
|
|
2212
2239
|
if (workdir) {
|
|
2213
|
-
const
|
|
2214
|
-
if (
|
|
2215
|
-
return
|
|
2240
|
+
const found = await findInDir(join2(workdir, "node_modules", ".bin"), command);
|
|
2241
|
+
if (found) {
|
|
2242
|
+
return found;
|
|
2216
2243
|
}
|
|
2217
2244
|
}
|
|
2218
2245
|
const pathEnv = process.env["PATH"] ?? "";
|
|
2219
2246
|
const paths = pathEnv.split(getPathSeparator());
|
|
2220
2247
|
for (const dir of paths) {
|
|
2221
2248
|
if (!dir) continue;
|
|
2222
|
-
const
|
|
2223
|
-
if (
|
|
2224
|
-
return
|
|
2249
|
+
const found = await findInDir(dir, command);
|
|
2250
|
+
if (found) {
|
|
2251
|
+
return found;
|
|
2225
2252
|
}
|
|
2226
2253
|
}
|
|
2227
2254
|
return null;
|
|
@@ -4257,7 +4284,7 @@ import { Router as Router9 } from "express";
|
|
|
4257
4284
|
import { spawn as spawn2 } from "child_process";
|
|
4258
4285
|
|
|
4259
4286
|
// src/constants.ts
|
|
4260
|
-
var VERSION = "2.0.
|
|
4287
|
+
var VERSION = "2.0.69";
|
|
4261
4288
|
|
|
4262
4289
|
// src/server/routes/auto-update.ts
|
|
4263
4290
|
var updateInProgress = false;
|
|
@@ -4890,7 +4917,7 @@ async function createServerHandle(config3) {
|
|
|
4890
4917
|
setMcpTools(mcpTools);
|
|
4891
4918
|
logger.info("MCP tools registered", { count: mcpTools.length });
|
|
4892
4919
|
}
|
|
4893
|
-
const { signalMcpReady } = await import("./server-
|
|
4920
|
+
const { signalMcpReady } = await import("./server-RLNPHLY2.js");
|
|
4894
4921
|
signalMcpReady();
|
|
4895
4922
|
});
|
|
4896
4923
|
const app = express();
|
|
@@ -5162,7 +5189,7 @@ async function createServerHandle(config3) {
|
|
|
5162
5189
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
5163
5190
|
const { getEventStore: getEventStore2 } = await import("./events-CDQ4HASP.js");
|
|
5164
5191
|
const { buildMessagesFromStoredEvents } = await import("./folding-V2K34EGN.js");
|
|
5165
|
-
const { getPendingQuestionsForSession } = await import("./tools-
|
|
5192
|
+
const { getPendingQuestionsForSession } = await import("./tools-CALGWIV2.js");
|
|
5166
5193
|
const session = sessionManager.getSession(req.params.id);
|
|
5167
5194
|
if (!session) {
|
|
5168
5195
|
return res.status(404).json({ error: "Session not found" });
|
|
@@ -5181,8 +5208,8 @@ async function createServerHandle(config3) {
|
|
|
5181
5208
|
if (!session) {
|
|
5182
5209
|
return res.status(404).json({ error: "Session not found" });
|
|
5183
5210
|
}
|
|
5184
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
5185
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
5211
|
+
const { stopSessionExecution } = await import("./chat-handler-K3DWIGHG.js");
|
|
5212
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-CALGWIV2.js");
|
|
5186
5213
|
sessionManager.clearMessageQueue(sessionId);
|
|
5187
5214
|
stopSessionExecution(sessionId, sessionManager);
|
|
5188
5215
|
abortSession(sessionId);
|
|
@@ -5278,6 +5305,38 @@ async function createServerHandle(config3) {
|
|
|
5278
5305
|
sessionManager.setMetadataEntries(sessionId, "review_findings", entries);
|
|
5279
5306
|
res.json({ success: true });
|
|
5280
5307
|
});
|
|
5308
|
+
app.put("/api/sessions/:id/metadata/:key", async (req, res) => {
|
|
5309
|
+
const sessionId = req.params.id;
|
|
5310
|
+
const key = req.params.key;
|
|
5311
|
+
const session = sessionManager.getSession(sessionId);
|
|
5312
|
+
if (!session) {
|
|
5313
|
+
return res.status(404).json({ error: "Session not found" });
|
|
5314
|
+
}
|
|
5315
|
+
const { entries } = req.body;
|
|
5316
|
+
if (!Array.isArray(entries)) {
|
|
5317
|
+
return res.status(400).json({ error: "entries is required and must be an array" });
|
|
5318
|
+
}
|
|
5319
|
+
for (let i = 0; i < entries.length; i++) {
|
|
5320
|
+
const c = entries[i];
|
|
5321
|
+
if (c === null || typeof c !== "object" || Array.isArray(c)) {
|
|
5322
|
+
return res.status(400).json({ error: `entries[${i}] must be an object` });
|
|
5323
|
+
}
|
|
5324
|
+
if (c.description !== void 0 && typeof c.description !== "string") {
|
|
5325
|
+
return res.status(400).json({ error: `entries[${i}].description must be a string` });
|
|
5326
|
+
}
|
|
5327
|
+
if (c.status !== void 0 && typeof c.status !== "string") {
|
|
5328
|
+
return res.status(400).json({ error: `entries[${i}].status must be a string` });
|
|
5329
|
+
}
|
|
5330
|
+
}
|
|
5331
|
+
const mapped = entries.map((c, i) => ({
|
|
5332
|
+
...c,
|
|
5333
|
+
id: c.id != null ? String(c.id) : String(i),
|
|
5334
|
+
description: c.description ?? "",
|
|
5335
|
+
status: c.status ?? "open"
|
|
5336
|
+
}));
|
|
5337
|
+
sessionManager.setMetadataEntries(sessionId, key, mapped);
|
|
5338
|
+
res.json({ success: true });
|
|
5339
|
+
});
|
|
5281
5340
|
app.put("/api/sessions/:id/mode", async (req, res) => {
|
|
5282
5341
|
const { getEventStore: getEventStore2 } = await import("./events-CDQ4HASP.js");
|
|
5283
5342
|
const { buildMessagesFromStoredEvents } = await import("./folding-V2K34EGN.js");
|
|
@@ -5336,7 +5395,7 @@ async function createServerHandle(config3) {
|
|
|
5336
5395
|
if (!callId || approved === void 0) {
|
|
5337
5396
|
return res.status(400).json({ error: "callId and approved are required" });
|
|
5338
5397
|
}
|
|
5339
|
-
const { providePathConfirmation } = await import("./tools-
|
|
5398
|
+
const { providePathConfirmation } = await import("./tools-CALGWIV2.js");
|
|
5340
5399
|
const result = providePathConfirmation(callId, approved, alwaysAllow);
|
|
5341
5400
|
if (!result.found) {
|
|
5342
5401
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
@@ -5344,7 +5403,7 @@ async function createServerHandle(config3) {
|
|
|
5344
5403
|
const { getEventStore: getEventStore2 } = await import("./events-CDQ4HASP.js");
|
|
5345
5404
|
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-V2K34EGN.js");
|
|
5346
5405
|
const { createSessionStateMessage } = await import("./protocol-CTNE3ANP.js");
|
|
5347
|
-
const { getPendingQuestionsForSession } = await import("./tools-
|
|
5406
|
+
const { getPendingQuestionsForSession } = await import("./tools-CALGWIV2.js");
|
|
5348
5407
|
const eventStore = getEventStore2();
|
|
5349
5408
|
const events = eventStore.getEvents(sessionId);
|
|
5350
5409
|
const messages = buildMessagesFromStoredEvents(events);
|
|
@@ -5365,7 +5424,7 @@ async function createServerHandle(config3) {
|
|
|
5365
5424
|
if (!skip && typeof answer !== "string") {
|
|
5366
5425
|
return res.status(400).json({ error: "answer is required when not skipping" });
|
|
5367
5426
|
}
|
|
5368
|
-
const { provideAnswer } = await import("./tools-
|
|
5427
|
+
const { provideAnswer } = await import("./tools-CALGWIV2.js");
|
|
5369
5428
|
const found = provideAnswer(callId, answer ?? "", skip ?? false);
|
|
5370
5429
|
if (!found) {
|
|
5371
5430
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -5425,7 +5484,7 @@ async function createServerHandle(config3) {
|
|
|
5425
5484
|
backend: activeProvider?.backend ?? llmClient.getBackend(),
|
|
5426
5485
|
model: llmClient.getModel()
|
|
5427
5486
|
};
|
|
5428
|
-
const { runAgentTurn, TurnMetrics } = await import("./orchestrator-
|
|
5487
|
+
const { runAgentTurn, TurnMetrics } = await import("./orchestrator-PUV4WG77.js");
|
|
5429
5488
|
runAgentTurn(
|
|
5430
5489
|
{
|
|
5431
5490
|
sessionManager,
|
|
@@ -5463,8 +5522,8 @@ async function createServerHandle(config3) {
|
|
|
5463
5522
|
if (!session) {
|
|
5464
5523
|
return res.status(404).json({ error: "Session not found" });
|
|
5465
5524
|
}
|
|
5466
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
5467
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
5525
|
+
const { stopSessionExecution } = await import("./chat-handler-K3DWIGHG.js");
|
|
5526
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-CALGWIV2.js");
|
|
5468
5527
|
const queuedMessages = sessionManager.getQueueState(sessionId);
|
|
5469
5528
|
sessionManager.clearMessageQueue(sessionId);
|
|
5470
5529
|
stopSessionExecution(sessionId, sessionManager);
|
|
@@ -6087,7 +6146,7 @@ async function createServerHandle(config3) {
|
|
|
6087
6146
|
});
|
|
6088
6147
|
async function rebuildMcpTools() {
|
|
6089
6148
|
const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-MOGEI6TP.js");
|
|
6090
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
6149
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-CALGWIV2.js");
|
|
6091
6150
|
const mcpTools = createMcpTools2(mcpManager);
|
|
6092
6151
|
setMcpTools2(mcpTools);
|
|
6093
6152
|
}
|
|
@@ -6172,6 +6231,69 @@ async function createServerHandle(config3) {
|
|
|
6172
6231
|
res.status(400).json({ error: error instanceof Error ? error.message : String(error) });
|
|
6173
6232
|
}
|
|
6174
6233
|
});
|
|
6234
|
+
app.put("/api/mcp/servers/:name", async (req, res) => {
|
|
6235
|
+
const { name } = req.params;
|
|
6236
|
+
const existing = mcpManager.getServer(name);
|
|
6237
|
+
if (!existing) {
|
|
6238
|
+
return res.status(404).json({ error: `MCP server '${name}' not found` });
|
|
6239
|
+
}
|
|
6240
|
+
const body = req.body;
|
|
6241
|
+
const { transport: rawTransport, command, args, env, url, headers } = body;
|
|
6242
|
+
if (rawTransport !== void 0 && rawTransport !== "stdio" && rawTransport !== "http") {
|
|
6243
|
+
return res.status(400).json({ error: `Invalid transport '${String(rawTransport)}'. Must be 'stdio' or 'http'.` });
|
|
6244
|
+
}
|
|
6245
|
+
if (command !== void 0 && typeof command !== "string") {
|
|
6246
|
+
return res.status(400).json({ error: "command must be a string" });
|
|
6247
|
+
}
|
|
6248
|
+
if (args !== void 0 && (!Array.isArray(args) || args.some((a) => typeof a !== "string"))) {
|
|
6249
|
+
return res.status(400).json({ error: "args must be an array of strings" });
|
|
6250
|
+
}
|
|
6251
|
+
if (env !== void 0 && (typeof env !== "object" || env === null || Array.isArray(env) || Object.values(env).some((v) => typeof v !== "string"))) {
|
|
6252
|
+
return res.status(400).json({ error: "env must be a string/string object" });
|
|
6253
|
+
}
|
|
6254
|
+
if (url !== void 0 && typeof url !== "string") {
|
|
6255
|
+
return res.status(400).json({ error: "url must be a string" });
|
|
6256
|
+
}
|
|
6257
|
+
if (headers !== void 0 && (typeof headers !== "object" || headers === null || Array.isArray(headers) || Object.values(headers).some((v) => typeof v !== "string"))) {
|
|
6258
|
+
return res.status(400).json({ error: "headers must be a string/string object" });
|
|
6259
|
+
}
|
|
6260
|
+
try {
|
|
6261
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-EUMVEFHU.js");
|
|
6262
|
+
const { applyMcpServerUpdate } = await import("./update-server-MYYQUNZX.js");
|
|
6263
|
+
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6264
|
+
const mcpServers2 = { ...globalConfig.mcpServers ?? {} };
|
|
6265
|
+
const patch = {
|
|
6266
|
+
...rawTransport !== void 0 ? { transport: rawTransport } : {},
|
|
6267
|
+
...command !== void 0 ? { command } : {},
|
|
6268
|
+
...args !== void 0 ? { args } : {},
|
|
6269
|
+
...env !== void 0 ? { env } : {},
|
|
6270
|
+
...url !== void 0 ? { url } : {},
|
|
6271
|
+
...headers !== void 0 ? { headers } : {}
|
|
6272
|
+
};
|
|
6273
|
+
const { error: updateError } = await applyMcpServerUpdate({
|
|
6274
|
+
name,
|
|
6275
|
+
patch,
|
|
6276
|
+
existing,
|
|
6277
|
+
persistedCfg: mcpServers2[name],
|
|
6278
|
+
mcpManager,
|
|
6279
|
+
save: async (cfg) => {
|
|
6280
|
+
mcpServers2[name] = cfg;
|
|
6281
|
+
await saveGlobalConfig(config3.mode ?? "production", { ...globalConfig, mcpServers: mcpServers2 }, config3.globalConfigPath);
|
|
6282
|
+
}
|
|
6283
|
+
});
|
|
6284
|
+
if (updateError) {
|
|
6285
|
+
return res.status(400).json({ error: updateError });
|
|
6286
|
+
}
|
|
6287
|
+
await rebuildMcpTools();
|
|
6288
|
+
const sessions = sessionManager.listSessions();
|
|
6289
|
+
for (const s of sessions) {
|
|
6290
|
+
sessionManager.setDynamicContextChanged(s.id, true);
|
|
6291
|
+
}
|
|
6292
|
+
res.json({ server: mcpManager.getServer(name) });
|
|
6293
|
+
} catch (error) {
|
|
6294
|
+
res.status(400).json({ error: error instanceof Error ? error.message : String(error) });
|
|
6295
|
+
}
|
|
6296
|
+
});
|
|
6175
6297
|
app.delete("/api/mcp/servers/:name", async (req, res) => {
|
|
6176
6298
|
const { name } = req.params;
|
|
6177
6299
|
const server = mcpManager.getServer(name);
|
|
@@ -6408,7 +6530,7 @@ async function createServerHandle(config3) {
|
|
|
6408
6530
|
const state = sessionManager.getContextState(sessionId);
|
|
6409
6531
|
wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
|
|
6410
6532
|
});
|
|
6411
|
-
const { QueueProcessor } = await import("./processor-
|
|
6533
|
+
const { QueueProcessor } = await import("./processor-O2QW27BD.js");
|
|
6412
6534
|
const queueProcessor = new QueueProcessor({
|
|
6413
6535
|
sessionManager,
|
|
6414
6536
|
providerManager,
|
|
@@ -6489,4 +6611,4 @@ export {
|
|
|
6489
6611
|
createServerHandle,
|
|
6490
6612
|
createServer
|
|
6491
6613
|
};
|
|
6492
|
-
//# sourceMappingURL=chunk-
|
|
6614
|
+
//# sourceMappingURL=chunk-WHVCGVQX.js.map
|
package/dist/cli/dev.js
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runAgentTurn,
|
|
3
3
|
runChatTurn
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-UTSSFPYA.js";
|
|
5
|
+
import "./chunk-PVWAE43V.js";
|
|
6
6
|
import {
|
|
7
7
|
TurnMetrics,
|
|
8
8
|
createChatDoneEvent,
|
|
@@ -16,6 +16,7 @@ import "./chunk-KXVFHMSM.js";
|
|
|
16
16
|
import "./chunk-TFCHWMOJ.js";
|
|
17
17
|
import "./chunk-PK2RMVMB.js";
|
|
18
18
|
import "./chunk-NWO6GRYE.js";
|
|
19
|
+
import "./chunk-UN26GIQG.js";
|
|
19
20
|
import "./chunk-VLV3XWZS.js";
|
|
20
21
|
import "./chunk-WGMJCFCE.js";
|
|
21
22
|
import "./chunk-TFDK6VSG.js";
|
|
@@ -44,4 +45,4 @@ export {
|
|
|
44
45
|
runAgentTurn,
|
|
45
46
|
runChatTurn
|
|
46
47
|
};
|
|
47
|
-
//# sourceMappingURL=orchestrator-
|
|
48
|
+
//# sourceMappingURL=orchestrator-PUV4WG77.js.map
|
package/dist/package.json
CHANGED
|
@@ -3,13 +3,14 @@ import {
|
|
|
3
3
|
finalizeTurnCompletion,
|
|
4
4
|
generateSessionNameForSession
|
|
5
5
|
} from "./chunk-64GN6OPR.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-PVWAE43V.js";
|
|
7
7
|
import "./chunk-QFSDJIUS.js";
|
|
8
8
|
import "./chunk-4QBDV6LX.js";
|
|
9
9
|
import "./chunk-KXVFHMSM.js";
|
|
10
10
|
import "./chunk-TFCHWMOJ.js";
|
|
11
11
|
import "./chunk-PK2RMVMB.js";
|
|
12
12
|
import "./chunk-NWO6GRYE.js";
|
|
13
|
+
import "./chunk-UN26GIQG.js";
|
|
13
14
|
import "./chunk-VLV3XWZS.js";
|
|
14
15
|
import "./chunk-WGMJCFCE.js";
|
|
15
16
|
import {
|
|
@@ -178,7 +179,7 @@ var QueueProcessor = class {
|
|
|
178
179
|
backend: provider?.backend ?? llmClient.getBackend(),
|
|
179
180
|
model: llmClient.getModel()
|
|
180
181
|
};
|
|
181
|
-
const { runChatTurn } = await import("./orchestrator-
|
|
182
|
+
const { runChatTurn } = await import("./orchestrator-PUV4WG77.js");
|
|
182
183
|
const runChatTurnParams = buildRunChatTurnParams({
|
|
183
184
|
sessionManager,
|
|
184
185
|
sessionId,
|
|
@@ -226,4 +227,4 @@ var QueueProcessor = class {
|
|
|
226
227
|
export {
|
|
227
228
|
QueueProcessor
|
|
228
229
|
};
|
|
229
|
-
//# sourceMappingURL=processor-
|
|
230
|
+
//# sourceMappingURL=processor-O2QW27BD.js.map
|