openfox 2.0.76 → 2.0.77
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-3BZ4PDL2.js → chat-handler-FNRKORKP.js} +8 -8
- package/dist/{chunk-XTK6E2QR.js → chunk-3TQN25OM.js} +2 -2
- package/dist/{chunk-J7VCI5EX.js → chunk-BX3VJP2D.js} +96 -44
- package/dist/{chunk-OMWVB2XC.js → chunk-CI5BWHW7.js} +5 -5
- package/dist/{chunk-OCVRIPQP.js → chunk-CJDYSUU5.js} +3 -3
- package/dist/{chunk-HAQV6AJP.js → chunk-CPTC2MD5.js} +2 -2
- package/dist/chunk-NUXS5OQB.js +7 -0
- package/dist/{chunk-EZK7CGJ7.js → chunk-RMXPVQP4.js} +315 -45
- package/dist/{chunk-HLHGNHMV.js → chunk-VMYDUZWI.js} +5 -5
- package/dist/{chunk-KVRSAC4Z.js → chunk-VPFUXGMM.js} +6 -1
- package/dist/{chunk-W4ZEG3LX.js → chunk-WL2WEJAK.js} +2 -2
- package/dist/{chunk-7772ENZN.js → chunk-XNCHOD2X.js} +2 -2
- package/dist/{chunk-D6CI2B7B.js → chunk-YDV7RIQ6.js} +115 -72
- package/dist/{chunk-WGAAQASA.js → chunk-YFVSSMA3.js} +3 -2
- package/dist/{chunk-HHUIXHHX.js → chunk-YPHLCRFP.js} +7 -7
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{client-TDPQVBQ7.js → client-V5DZRO2D.js} +3 -3
- package/dist/{client-pure-NMLDKRDN.js → client-pure-5YE5WFJP.js} +2 -2
- package/dist/{compactor-BB3YYVRP.js → compactor-BJXFE5PL.js} +4 -4
- package/dist/{config-EUMVEFHU.js → config-MD74ETY5.js} +2 -2
- package/dist/{orchestrator-5IMCWX5P.js → orchestrator-67BZJEOO.js} +7 -7
- package/dist/package.json +3 -1
- package/dist/{processor-3R4GS6VB.js → processor-BCOSEMZK.js} +8 -8
- package/dist/{protocol-Sr6Jr4ZS.d.ts → protocol-Ceapo3jt.d.ts} +1 -1
- package/dist/provider/index.d.ts +4 -4
- package/dist/{provider-G2YC2IC4.js → provider-PI3RDDE4.js} +6 -6
- package/dist/{provider-manager-SQIELYLK.js → provider-manager-PD3BXUHY.js} +4 -4
- package/dist/{serve-MXKMKZYY.js → serve-BD44GN7N.js} +13 -13
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +12 -12
- package/dist/{server-SPYFMFQE.js → server-OLRW27DH.js} +9 -9
- package/dist/shared/index.d.ts +3 -3
- package/dist/{tools-JRCUWPJO.js → tools-T7S45DOQ.js} +6 -6
- package/dist/{types-C4cG9CtC.d.ts → types-DABVUbUu.d.ts} +1 -0
- package/dist/{types-DSZhFA8O.d.ts → types-pssMT-oY.d.ts} +1 -1
- package/dist/{update-OXDQ75M7.js → update-56VZOLQJ.js} +2 -2
- package/dist/{update-server-4MTM7M5P.js → update-server-V6GJ43WH.js} +2 -2
- package/dist/web/assets/index-BuUd6IgK.js +305 -0
- package/dist/web/index.html +1 -1
- package/dist/web/sw.js +1 -1
- package/package.json +3 -1
- package/dist/chunk-KQEVAO2Q.js +0 -7
- package/dist/web/assets/index-ghDkIdlf.js +0 -305
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
buildRunChatTurnParams,
|
|
3
3
|
finalizeTurnCompletion,
|
|
4
4
|
generateSessionNameForSession
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3TQN25OM.js";
|
|
6
6
|
import {
|
|
7
7
|
runChatTurn
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-VMYDUZWI.js";
|
|
9
|
+
import "./chunk-YDV7RIQ6.js";
|
|
10
10
|
import "./chunk-NWO6GRYE.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-VPFUXGMM.js";
|
|
12
12
|
import "./chunk-MF3UW36X.js";
|
|
13
13
|
import "./chunk-WGMJCFCE.js";
|
|
14
14
|
import "./chunk-EU3WWTFH.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-XNCHOD2X.js";
|
|
16
16
|
import "./chunk-DH3SSBZN.js";
|
|
17
17
|
import "./chunk-LXFLRM7M.js";
|
|
18
18
|
import "./chunk-OBQPXUXI.js";
|
|
@@ -33,10 +33,10 @@ import {
|
|
|
33
33
|
import "./chunk-J2GP3J3X.js";
|
|
34
34
|
import "./chunk-V4IE7HJY.js";
|
|
35
35
|
import "./chunk-YHEQTVFV.js";
|
|
36
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-RMXPVQP4.js";
|
|
37
37
|
import "./chunk-K44MW7JJ.js";
|
|
38
38
|
import "./chunk-5GOOSZX7.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-YFVSSMA3.js";
|
|
40
40
|
import "./chunk-CQGTEGKL.js";
|
|
41
41
|
import "./chunk-5WRI5ZAA.js";
|
|
42
42
|
|
|
@@ -159,4 +159,4 @@ export {
|
|
|
159
159
|
startChatSession,
|
|
160
160
|
stopSessionExecution
|
|
161
161
|
};
|
|
162
|
-
//# sourceMappingURL=chat-handler-
|
|
162
|
+
//# sourceMappingURL=chat-handler-FNRKORKP.js.map
|
|
@@ -135,7 +135,7 @@ async function generateSessionNameForSession(sessionId, userMessage, deps, signa
|
|
|
135
135
|
client = deps.getLLMClient();
|
|
136
136
|
client.setModel(providerConfig.model);
|
|
137
137
|
} else if (providerConfig) {
|
|
138
|
-
const { createLLMClient } = await import("./client-
|
|
138
|
+
const { createLLMClient } = await import("./client-V5DZRO2D.js");
|
|
139
139
|
client = createLLMClient({
|
|
140
140
|
llm: {
|
|
141
141
|
baseUrl: providerConfig.baseUrl,
|
|
@@ -184,4 +184,4 @@ export {
|
|
|
184
184
|
buildRunChatTurnParams,
|
|
185
185
|
generateSessionNameForSession
|
|
186
186
|
};
|
|
187
|
-
//# sourceMappingURL=chunk-
|
|
187
|
+
//# sourceMappingURL=chunk-3TQN25OM.js.map
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
tokenFromPassword,
|
|
22
22
|
verifyPassword,
|
|
23
23
|
workflowExists
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-CI5BWHW7.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-YDV7RIQ6.js";
|
|
70
70
|
import {
|
|
71
71
|
createMcpTools
|
|
72
72
|
} from "./chunk-NWO6GRYE.js";
|
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
ALWAYS_ALLOWED,
|
|
90
90
|
ALWAYS_ALLOWED_FOR_SUBAGENTS,
|
|
91
91
|
TOP_LEVEL_ONLY_TOOLS
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-XNCHOD2X.js";
|
|
93
93
|
import {
|
|
94
94
|
getProject
|
|
95
95
|
} from "./chunk-LXFLRM7M.js";
|
|
@@ -104,7 +104,7 @@ import {
|
|
|
104
104
|
} from "./chunk-YMFCFMMB.js";
|
|
105
105
|
import {
|
|
106
106
|
VERSION
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-NUXS5OQB.js";
|
|
108
108
|
import {
|
|
109
109
|
createSession,
|
|
110
110
|
deleteSession,
|
|
@@ -144,7 +144,7 @@ import {
|
|
|
144
144
|
detectModel,
|
|
145
145
|
getLlmStatus,
|
|
146
146
|
parseDefaultModelSelection
|
|
147
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-CJDYSUU5.js";
|
|
148
148
|
import {
|
|
149
149
|
getModelProfile
|
|
150
150
|
} from "./chunk-V4IE7HJY.js";
|
|
@@ -1490,6 +1490,26 @@ var McpManager = class {
|
|
|
1490
1490
|
throw new Error(`Unsupported transport: ${entry.config.transport}`);
|
|
1491
1491
|
}
|
|
1492
1492
|
if (!transport) throw new Error("Failed to create transport");
|
|
1493
|
+
let sdkOnMessage = void 0;
|
|
1494
|
+
Object.defineProperty(transport, "onmessage", {
|
|
1495
|
+
get() {
|
|
1496
|
+
return sdkOnMessage;
|
|
1497
|
+
},
|
|
1498
|
+
set(fn) {
|
|
1499
|
+
sdkOnMessage = (message) => {
|
|
1500
|
+
const msg = message;
|
|
1501
|
+
if (msg && msg.result && Array.isArray(msg.result.tools)) {
|
|
1502
|
+
for (const tool of msg.result.tools) {
|
|
1503
|
+
if (tool && tool.outputSchema) {
|
|
1504
|
+
delete tool.outputSchema;
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
fn?.(message);
|
|
1509
|
+
};
|
|
1510
|
+
},
|
|
1511
|
+
configurable: true
|
|
1512
|
+
});
|
|
1493
1513
|
await client.connect(transport);
|
|
1494
1514
|
const { tools: mcpTools } = await client.listTools();
|
|
1495
1515
|
const disabledSet = new Set(entry.config.disabledTools ?? []);
|
|
@@ -1585,7 +1605,27 @@ var McpManager = class {
|
|
|
1585
1605
|
if (!entry) return { success: false, error: `MCP server '${serverName}' not found` };
|
|
1586
1606
|
if (!entry.client) return { success: false, error: `MCP server '${serverName}' is not connected` };
|
|
1587
1607
|
try {
|
|
1588
|
-
const
|
|
1608
|
+
const timeout = entry.config.timeout;
|
|
1609
|
+
const requestOptions = timeout !== void 0 && timeout > 0 ? { timeout: timeout * 1e3 } : void 0;
|
|
1610
|
+
let result;
|
|
1611
|
+
if (timeout !== void 0 && timeout > 0) {
|
|
1612
|
+
let timer;
|
|
1613
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
1614
|
+
timer = setTimeout(() => {
|
|
1615
|
+
reject(new Error(`MCP tool call timed out after ${timeout} seconds`));
|
|
1616
|
+
}, timeout * 1e3);
|
|
1617
|
+
});
|
|
1618
|
+
try {
|
|
1619
|
+
result = await Promise.race([
|
|
1620
|
+
entry.client.callTool({ name: toolName, arguments: args }, void 0, requestOptions),
|
|
1621
|
+
timeoutPromise
|
|
1622
|
+
]);
|
|
1623
|
+
} finally {
|
|
1624
|
+
if (timer) clearTimeout(timer);
|
|
1625
|
+
}
|
|
1626
|
+
} else {
|
|
1627
|
+
result = await entry.client.callTool({ name: toolName, arguments: args });
|
|
1628
|
+
}
|
|
1589
1629
|
const content = result.content;
|
|
1590
1630
|
const textParts = content.filter((c) => c.type === "text").map((c) => c.text);
|
|
1591
1631
|
return { success: !result.isError, output: textParts.join("\n") };
|
|
@@ -4559,7 +4599,7 @@ function createProviderAuthRoutes(config3, providerManager, registry) {
|
|
|
4559
4599
|
try {
|
|
4560
4600
|
const { challenge, completion } = await adapter.beginLogin({ providerId: provider.id });
|
|
4561
4601
|
void completion.then(async ({ credentialRef }) => {
|
|
4562
|
-
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-
|
|
4602
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-MD74ETY5.js");
|
|
4563
4603
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
4564
4604
|
const updatedConfig = updateProvider(globalConfig, provider.id, { credentialRef, authAdapter: adapter.id });
|
|
4565
4605
|
await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
|
|
@@ -4593,7 +4633,7 @@ function createProviderAuthRoutes(config3, providerManager, registry) {
|
|
|
4593
4633
|
if (!context) return;
|
|
4594
4634
|
const { provider, adapter } = context;
|
|
4595
4635
|
if (provider.credentialRef && adapter) await adapter.logout(provider.credentialRef);
|
|
4596
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
4636
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-MD74ETY5.js");
|
|
4597
4637
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
4598
4638
|
const updatedConfig = {
|
|
4599
4639
|
...globalConfig,
|
|
@@ -5073,7 +5113,7 @@ async function createServerHandle(config3) {
|
|
|
5073
5113
|
const mcpManager = new McpManager({
|
|
5074
5114
|
onToolsDiscovered: async (name, tools) => {
|
|
5075
5115
|
try {
|
|
5076
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
5116
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-MD74ETY5.js");
|
|
5077
5117
|
const mode = config3.mode ?? "production";
|
|
5078
5118
|
const globalConfig = await loadGlobalConfig(mode, config3.globalConfigPath);
|
|
5079
5119
|
const mcpServers2 = {
|
|
@@ -5104,12 +5144,11 @@ async function createServerHandle(config3) {
|
|
|
5104
5144
|
setMcpTools(mcpTools);
|
|
5105
5145
|
logger.info("MCP tools registered", { count: mcpTools.length });
|
|
5106
5146
|
}
|
|
5107
|
-
const { signalMcpReady } = await import("./server-
|
|
5147
|
+
const { signalMcpReady } = await import("./server-OLRW27DH.js");
|
|
5108
5148
|
signalMcpReady();
|
|
5109
5149
|
});
|
|
5110
5150
|
const app = express();
|
|
5111
5151
|
app.use(cors());
|
|
5112
|
-
app.use(express.json({ limit: "10mb" }));
|
|
5113
5152
|
const authMiddleware = async (req, res, next) => {
|
|
5114
5153
|
const path = req.path;
|
|
5115
5154
|
const publicPaths = ["/health", "/auth", "/auth/login", "/auto-update/check"];
|
|
@@ -5127,6 +5166,7 @@ async function createServerHandle(config3) {
|
|
|
5127
5166
|
next();
|
|
5128
5167
|
};
|
|
5129
5168
|
app.use("/api", authMiddleware);
|
|
5169
|
+
app.use(express.json({ limit: "75mb" }));
|
|
5130
5170
|
app.get("/api/health", (_req, res) => {
|
|
5131
5171
|
res.json({ status: "ok", timestamp: (/* @__PURE__ */ new Date()).toISOString() });
|
|
5132
5172
|
});
|
|
@@ -5436,7 +5476,7 @@ async function createServerHandle(config3) {
|
|
|
5436
5476
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
5437
5477
|
const { getEventStore: getEventStore2 } = await import("./events-FLWRLM6V.js");
|
|
5438
5478
|
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-ONH3D4OK.js");
|
|
5439
|
-
const { getPendingQuestionsForSession } = await import("./tools-
|
|
5479
|
+
const { getPendingQuestionsForSession } = await import("./tools-T7S45DOQ.js");
|
|
5440
5480
|
const session = sessionManager.getSession(req.params.id);
|
|
5441
5481
|
if (!session) {
|
|
5442
5482
|
return res.status(404).json({ error: "Session not found" });
|
|
@@ -5456,8 +5496,8 @@ async function createServerHandle(config3) {
|
|
|
5456
5496
|
if (!session) {
|
|
5457
5497
|
return res.status(404).json({ error: "Session not found" });
|
|
5458
5498
|
}
|
|
5459
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
5460
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
5499
|
+
const { stopSessionExecution } = await import("./chat-handler-FNRKORKP.js");
|
|
5500
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-T7S45DOQ.js");
|
|
5461
5501
|
sessionManager.clearMessageQueue(sessionId);
|
|
5462
5502
|
stopSessionExecution(sessionId, sessionManager);
|
|
5463
5503
|
abortSession(sessionId);
|
|
@@ -5520,7 +5560,7 @@ async function createServerHandle(config3) {
|
|
|
5520
5560
|
if (!result.success) {
|
|
5521
5561
|
return res.status(500).json({ error: result.error ?? "Failed to set default model" });
|
|
5522
5562
|
}
|
|
5523
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
5563
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-MD74ETY5.js");
|
|
5524
5564
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
5525
5565
|
const updatedConfig = setDefaultModelSelection(globalConfig, providerId, model);
|
|
5526
5566
|
await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
|
|
@@ -5655,7 +5695,7 @@ async function createServerHandle(config3) {
|
|
|
5655
5695
|
if (!callId || approved === void 0) {
|
|
5656
5696
|
return res.status(400).json({ error: "callId and approved are required" });
|
|
5657
5697
|
}
|
|
5658
|
-
const { providePathConfirmation } = await import("./tools-
|
|
5698
|
+
const { providePathConfirmation } = await import("./tools-T7S45DOQ.js");
|
|
5659
5699
|
const result = providePathConfirmation(callId, approved, alwaysAllow);
|
|
5660
5700
|
if (!result.found) {
|
|
5661
5701
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
@@ -5663,7 +5703,7 @@ async function createServerHandle(config3) {
|
|
|
5663
5703
|
const { getEventStore: getEventStore2 } = await import("./events-FLWRLM6V.js");
|
|
5664
5704
|
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-ONH3D4OK.js");
|
|
5665
5705
|
const { createSessionStateMessage } = await import("./protocol-EWEVW65B.js");
|
|
5666
|
-
const { getPendingQuestionsForSession } = await import("./tools-
|
|
5706
|
+
const { getPendingQuestionsForSession } = await import("./tools-T7S45DOQ.js");
|
|
5667
5707
|
const eventStore = getEventStore2();
|
|
5668
5708
|
const events = eventStore.getEvents(sessionId);
|
|
5669
5709
|
const messages = buildMessagesFromStoredEvents(events);
|
|
@@ -5689,7 +5729,7 @@ async function createServerHandle(config3) {
|
|
|
5689
5729
|
if (!skip && typeof answer !== "string") {
|
|
5690
5730
|
return res.status(400).json({ error: "answer is required when not skipping" });
|
|
5691
5731
|
}
|
|
5692
|
-
const { provideAnswer } = await import("./tools-
|
|
5732
|
+
const { provideAnswer } = await import("./tools-T7S45DOQ.js");
|
|
5693
5733
|
const found = provideAnswer(callId, answer ?? "", skip ?? false);
|
|
5694
5734
|
if (!found) {
|
|
5695
5735
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -5749,7 +5789,7 @@ async function createServerHandle(config3) {
|
|
|
5749
5789
|
backend: activeProvider?.backend ?? llmClient.getBackend(),
|
|
5750
5790
|
model: llmClient.getModel()
|
|
5751
5791
|
};
|
|
5752
|
-
const { runAgentTurn, TurnMetrics } = await import("./orchestrator-
|
|
5792
|
+
const { runAgentTurn, TurnMetrics } = await import("./orchestrator-67BZJEOO.js");
|
|
5753
5793
|
runAgentTurn(
|
|
5754
5794
|
{
|
|
5755
5795
|
sessionManager,
|
|
@@ -5787,8 +5827,8 @@ async function createServerHandle(config3) {
|
|
|
5787
5827
|
if (!session) {
|
|
5788
5828
|
return res.status(404).json({ error: "Session not found" });
|
|
5789
5829
|
}
|
|
5790
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
5791
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
5830
|
+
const { stopSessionExecution } = await import("./chat-handler-FNRKORKP.js");
|
|
5831
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-T7S45DOQ.js");
|
|
5792
5832
|
const queuedMessages = sessionManager.getQueueState(sessionId);
|
|
5793
5833
|
sessionManager.clearMessageQueue(sessionId);
|
|
5794
5834
|
stopSessionExecution(sessionId, sessionManager);
|
|
@@ -5932,7 +5972,7 @@ async function createServerHandle(config3) {
|
|
|
5932
5972
|
let visionFallback;
|
|
5933
5973
|
let globalWorkdir;
|
|
5934
5974
|
try {
|
|
5935
|
-
const { loadGlobalConfig, getVisionFallback } = await import("./config-
|
|
5975
|
+
const { loadGlobalConfig, getVisionFallback } = await import("./config-MD74ETY5.js");
|
|
5936
5976
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
5937
5977
|
const fallback = getVisionFallback(globalConfig);
|
|
5938
5978
|
if (fallback) {
|
|
@@ -6086,7 +6126,7 @@ async function createServerHandle(config3) {
|
|
|
6086
6126
|
const backend = req.query["backend"];
|
|
6087
6127
|
if (!url) return res.status(400).json({ error: "url is required" });
|
|
6088
6128
|
try {
|
|
6089
|
-
const { fetchModelsWithContext } = await import("./provider-manager-
|
|
6129
|
+
const { fetchModelsWithContext } = await import("./provider-manager-PD3BXUHY.js");
|
|
6090
6130
|
const { getModelProfile: getModelProfile2 } = await import("./profiles-5J7F4BML.js");
|
|
6091
6131
|
const models = await fetchModelsWithContext(
|
|
6092
6132
|
url,
|
|
@@ -6156,7 +6196,7 @@ async function createServerHandle(config3) {
|
|
|
6156
6196
|
}
|
|
6157
6197
|
const { getModelProfile: getModelProfile2 } = await import("./profiles-5J7F4BML.js");
|
|
6158
6198
|
const { getBackendCapabilities } = await import("./backend-P3GHHLHJ.js");
|
|
6159
|
-
const { buildNonStreamingCreateParams } = await import("./client-pure-
|
|
6199
|
+
const { buildNonStreamingCreateParams } = await import("./client-pure-5YE5WFJP.js");
|
|
6160
6200
|
const { OpenAIHttpClient } = await import("./http-client-PIWB7BXK.js");
|
|
6161
6201
|
const { ensureVersionPrefix } = await import("./url-utils-SAJP7AEX.js");
|
|
6162
6202
|
const profile = getModelProfile2(model);
|
|
@@ -6226,7 +6266,7 @@ async function createServerHandle(config3) {
|
|
|
6226
6266
|
return res.status(400).json({ error: "name, url, and backend are required" });
|
|
6227
6267
|
}
|
|
6228
6268
|
try {
|
|
6229
|
-
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-
|
|
6269
|
+
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-MD74ETY5.js");
|
|
6230
6270
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6231
6271
|
const providerBackend = backend;
|
|
6232
6272
|
const providerModels = modelConfigs?.length ? buildModelConfigs(modelConfigs) : model ? [{ id: model, contextWindow: 2e5, source: "user" }] : [];
|
|
@@ -6266,7 +6306,7 @@ async function createServerHandle(config3) {
|
|
|
6266
6306
|
app.post("/api/init/config", async (req, res) => {
|
|
6267
6307
|
const { workdir, visionFallback } = req.body;
|
|
6268
6308
|
try {
|
|
6269
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6309
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-MD74ETY5.js");
|
|
6270
6310
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6271
6311
|
const updatedConfig = {
|
|
6272
6312
|
...globalConfig,
|
|
@@ -6305,7 +6345,7 @@ async function createServerHandle(config3) {
|
|
|
6305
6345
|
});
|
|
6306
6346
|
app.delete("/api/providers/:id", async (req, res) => {
|
|
6307
6347
|
const { id } = req.params;
|
|
6308
|
-
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-
|
|
6348
|
+
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-MD74ETY5.js");
|
|
6309
6349
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6310
6350
|
const updatedConfig = removeProvider(globalConfig, id);
|
|
6311
6351
|
await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
|
|
@@ -6317,7 +6357,7 @@ async function createServerHandle(config3) {
|
|
|
6317
6357
|
const { id } = req.params;
|
|
6318
6358
|
const { isLocal } = req.body;
|
|
6319
6359
|
try {
|
|
6320
|
-
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-
|
|
6360
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-MD74ETY5.js");
|
|
6321
6361
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6322
6362
|
const provider = globalConfig.providers.find((p) => p.id === id);
|
|
6323
6363
|
if (!provider) {
|
|
@@ -6348,7 +6388,7 @@ async function createServerHandle(config3) {
|
|
|
6348
6388
|
transportAdapter
|
|
6349
6389
|
} = req.body;
|
|
6350
6390
|
try {
|
|
6351
|
-
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-
|
|
6391
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-MD74ETY5.js");
|
|
6352
6392
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6353
6393
|
const provider = globalConfig.providers.find((p) => p.id === id);
|
|
6354
6394
|
if (!provider) {
|
|
@@ -6388,7 +6428,7 @@ async function createServerHandle(config3) {
|
|
|
6388
6428
|
return res.status(400).json({ error: result.error });
|
|
6389
6429
|
}
|
|
6390
6430
|
const llmClient = getLLMClient();
|
|
6391
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
6431
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-MD74ETY5.js");
|
|
6392
6432
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6393
6433
|
const updatedConfig = setDefaultModelSelection(globalConfig, id, llmClient.getModel());
|
|
6394
6434
|
await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
|
|
@@ -6415,7 +6455,7 @@ async function createServerHandle(config3) {
|
|
|
6415
6455
|
});
|
|
6416
6456
|
async function rebuildMcpTools() {
|
|
6417
6457
|
const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-MOGEI6TP.js");
|
|
6418
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
6458
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-T7S45DOQ.js");
|
|
6419
6459
|
const mcpTools = createMcpTools2(mcpManager);
|
|
6420
6460
|
setMcpTools2(mcpTools);
|
|
6421
6461
|
}
|
|
@@ -6424,7 +6464,7 @@ async function createServerHandle(config3) {
|
|
|
6424
6464
|
res.json({ servers });
|
|
6425
6465
|
});
|
|
6426
6466
|
app.post("/api/mcp/servers/test", async (req, res) => {
|
|
6427
|
-
const { name, transport, command, args, env, url, headers } = req.body;
|
|
6467
|
+
const { name, transport, command, args, env, url, headers, timeout } = req.body;
|
|
6428
6468
|
if (transport !== void 0 && transport !== "stdio" && transport !== "http") {
|
|
6429
6469
|
return res.status(400).json({ error: `Invalid transport '${transport}'. Must be 'stdio' or 'http'.` });
|
|
6430
6470
|
}
|
|
@@ -6434,6 +6474,9 @@ async function createServerHandle(config3) {
|
|
|
6434
6474
|
if (transport === "http" && !url) {
|
|
6435
6475
|
return res.status(400).json({ error: "url is required for http transport" });
|
|
6436
6476
|
}
|
|
6477
|
+
if (timeout !== void 0 && (typeof timeout !== "number" || timeout <= 0)) {
|
|
6478
|
+
return res.status(400).json({ error: "timeout must be a positive number" });
|
|
6479
|
+
}
|
|
6437
6480
|
try {
|
|
6438
6481
|
const testManager = new McpManager();
|
|
6439
6482
|
const resolvedTransport = transport === "http" ? "http" : "stdio";
|
|
@@ -6443,7 +6486,8 @@ async function createServerHandle(config3) {
|
|
|
6443
6486
|
...args && args.length > 0 ? { args } : {},
|
|
6444
6487
|
...env && Object.keys(env).length > 0 ? { env } : {},
|
|
6445
6488
|
...url ? { url } : {},
|
|
6446
|
-
...headers && Object.keys(headers).length > 0 ? { headers } : {}
|
|
6489
|
+
...headers && Object.keys(headers).length > 0 ? { headers } : {},
|
|
6490
|
+
...timeout !== void 0 ? { timeout } : {}
|
|
6447
6491
|
};
|
|
6448
6492
|
await testManager.addServer(name ?? "test", testConfig);
|
|
6449
6493
|
const server = testManager.getServer(name ?? "test");
|
|
@@ -6458,13 +6502,16 @@ async function createServerHandle(config3) {
|
|
|
6458
6502
|
}
|
|
6459
6503
|
});
|
|
6460
6504
|
app.post("/api/mcp/servers", async (req, res) => {
|
|
6461
|
-
const { name, transport, command, args, env, url, headers } = req.body;
|
|
6505
|
+
const { name, transport, command, args, env, url, headers, timeout } = req.body;
|
|
6462
6506
|
if (!name) {
|
|
6463
6507
|
return res.status(400).json({ error: "name is required" });
|
|
6464
6508
|
}
|
|
6465
6509
|
if (transport !== void 0 && transport !== "stdio" && transport !== "http") {
|
|
6466
6510
|
return res.status(400).json({ error: `Invalid transport '${transport}'. Must be 'stdio' or 'http'.` });
|
|
6467
6511
|
}
|
|
6512
|
+
if (timeout !== void 0 && (typeof timeout !== "number" || timeout <= 0)) {
|
|
6513
|
+
return res.status(400).json({ error: "timeout must be a positive number" });
|
|
6514
|
+
}
|
|
6468
6515
|
try {
|
|
6469
6516
|
const resolvedTransport = transport === "http" ? "http" : "stdio";
|
|
6470
6517
|
const serverCfg = {
|
|
@@ -6473,11 +6520,12 @@ async function createServerHandle(config3) {
|
|
|
6473
6520
|
...args && args.length > 0 ? { args } : {},
|
|
6474
6521
|
...env && Object.keys(env).length > 0 ? { env } : {},
|
|
6475
6522
|
...url ? { url } : {},
|
|
6476
|
-
...headers && Object.keys(headers).length > 0 ? { headers } : {}
|
|
6523
|
+
...headers && Object.keys(headers).length > 0 ? { headers } : {},
|
|
6524
|
+
...timeout !== void 0 ? { timeout } : {}
|
|
6477
6525
|
};
|
|
6478
6526
|
await mcpManager.addServer(name, serverCfg);
|
|
6479
6527
|
const server = mcpManager.getServer(name);
|
|
6480
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6528
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-MD74ETY5.js");
|
|
6481
6529
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6482
6530
|
const updatedMcpServers = { ...globalConfig.mcpServers ?? {}, [name]: serverCfg };
|
|
6483
6531
|
await saveGlobalConfig(
|
|
@@ -6507,7 +6555,7 @@ async function createServerHandle(config3) {
|
|
|
6507
6555
|
return res.status(404).json({ error: `MCP server '${name}' not found` });
|
|
6508
6556
|
}
|
|
6509
6557
|
const body = req.body;
|
|
6510
|
-
const { transport: rawTransport, command, args, env, url, headers } = body;
|
|
6558
|
+
const { transport: rawTransport, command, args, env, url, headers, timeout } = body;
|
|
6511
6559
|
if (rawTransport !== void 0 && rawTransport !== "stdio" && rawTransport !== "http") {
|
|
6512
6560
|
return res.status(400).json({ error: `Invalid transport '${String(rawTransport)}'. Must be 'stdio' or 'http'.` });
|
|
6513
6561
|
}
|
|
@@ -6526,9 +6574,12 @@ async function createServerHandle(config3) {
|
|
|
6526
6574
|
if (headers !== void 0 && (typeof headers !== "object" || headers === null || Array.isArray(headers) || Object.values(headers).some((v) => typeof v !== "string"))) {
|
|
6527
6575
|
return res.status(400).json({ error: "headers must be a string/string object" });
|
|
6528
6576
|
}
|
|
6577
|
+
if (timeout !== void 0 && (typeof timeout !== "number" || timeout <= 0)) {
|
|
6578
|
+
return res.status(400).json({ error: "timeout must be a positive number" });
|
|
6579
|
+
}
|
|
6529
6580
|
try {
|
|
6530
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6531
|
-
const { applyMcpServerUpdate } = await import("./update-server-
|
|
6581
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-MD74ETY5.js");
|
|
6582
|
+
const { applyMcpServerUpdate } = await import("./update-server-V6GJ43WH.js");
|
|
6532
6583
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6533
6584
|
const mcpServers2 = { ...globalConfig.mcpServers ?? {} };
|
|
6534
6585
|
const patch = {
|
|
@@ -6537,7 +6588,8 @@ async function createServerHandle(config3) {
|
|
|
6537
6588
|
...args !== void 0 ? { args } : {},
|
|
6538
6589
|
...env !== void 0 ? { env } : {},
|
|
6539
6590
|
...url !== void 0 ? { url } : {},
|
|
6540
|
-
...headers !== void 0 ? { headers } : {}
|
|
6591
|
+
...headers !== void 0 ? { headers } : {},
|
|
6592
|
+
...timeout !== void 0 ? { timeout } : {}
|
|
6541
6593
|
};
|
|
6542
6594
|
const { error: updateError } = await applyMcpServerUpdate({
|
|
6543
6595
|
name,
|
|
@@ -6570,7 +6622,7 @@ async function createServerHandle(config3) {
|
|
|
6570
6622
|
return res.status(404).json({ error: `MCP server '${name}' not found` });
|
|
6571
6623
|
}
|
|
6572
6624
|
mcpManager.removeServer(name);
|
|
6573
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6625
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-MD74ETY5.js");
|
|
6574
6626
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6575
6627
|
const updatedMcpServers = { ...globalConfig.mcpServers ?? {} };
|
|
6576
6628
|
delete updatedMcpServers[name];
|
|
@@ -6599,7 +6651,7 @@ async function createServerHandle(config3) {
|
|
|
6599
6651
|
await mcpManager.setToolEnabled(name, toolName, enabled);
|
|
6600
6652
|
const server = mcpManager.getServer(name);
|
|
6601
6653
|
if (server) {
|
|
6602
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6654
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-MD74ETY5.js");
|
|
6603
6655
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6604
6656
|
const mcpServers2 = { ...globalConfig.mcpServers ?? {} };
|
|
6605
6657
|
const serverCfg = mcpServers2[name];
|
|
@@ -6799,7 +6851,7 @@ async function createServerHandle(config3) {
|
|
|
6799
6851
|
const state = sessionManager.getContextState(sessionId);
|
|
6800
6852
|
wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
|
|
6801
6853
|
});
|
|
6802
|
-
const { QueueProcessor } = await import("./processor-
|
|
6854
|
+
const { QueueProcessor } = await import("./processor-BCOSEMZK.js");
|
|
6803
6855
|
const queueProcessor = new QueueProcessor({
|
|
6804
6856
|
sessionManager,
|
|
6805
6857
|
providerManager,
|
|
@@ -6879,4 +6931,4 @@ export {
|
|
|
6879
6931
|
createServerHandle,
|
|
6880
6932
|
createServer
|
|
6881
6933
|
};
|
|
6882
|
-
//# sourceMappingURL=chunk-
|
|
6934
|
+
//# sourceMappingURL=chunk-BX3VJP2D.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
computeSessionHash,
|
|
4
4
|
runAgentTurn,
|
|
5
5
|
runChatTurn
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VMYDUZWI.js";
|
|
7
7
|
import {
|
|
8
8
|
deleteItemFromDir,
|
|
9
9
|
devServerManager,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
jsonSerializer,
|
|
14
14
|
loadAllAgentsDefault,
|
|
15
15
|
saveItemToDir
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-YDV7RIQ6.js";
|
|
17
17
|
import {
|
|
18
18
|
gitSpawnEnv
|
|
19
19
|
} from "./chunk-WGMJCFCE.js";
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
} from "./chunk-EU3WWTFH.js";
|
|
24
24
|
import {
|
|
25
25
|
appendCompactionPrompt
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-CPTC2MD5.js";
|
|
27
27
|
import {
|
|
28
28
|
TurnMetrics,
|
|
29
29
|
createMessageStartEvent
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-XNCHOD2X.js";
|
|
31
31
|
import {
|
|
32
32
|
checkAborted,
|
|
33
33
|
onProcessEvent,
|
|
@@ -2194,4 +2194,4 @@ export {
|
|
|
2194
2194
|
signalMcpReady,
|
|
2195
2195
|
createWebSocketServer
|
|
2196
2196
|
};
|
|
2197
|
-
//# sourceMappingURL=chunk-
|
|
2197
|
+
//# sourceMappingURL=chunk-CI5BWHW7.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createLLMClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WL2WEJAK.js";
|
|
4
4
|
import {
|
|
5
5
|
getModelProfile
|
|
6
6
|
} from "./chunk-V4IE7HJY.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-HNCM3D7Y.js";
|
|
15
15
|
import {
|
|
16
16
|
resolveAttachmentsInMessages
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-RMXPVQP4.js";
|
|
18
18
|
import {
|
|
19
19
|
logger
|
|
20
20
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -807,4 +807,4 @@ export {
|
|
|
807
807
|
parseDefaultModelSelection,
|
|
808
808
|
createProviderManager
|
|
809
809
|
};
|
|
810
|
-
//# sourceMappingURL=chunk-
|
|
810
|
+
//# sourceMappingURL=chunk-CJDYSUU5.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
COMPACTION_PROMPT,
|
|
3
3
|
createMessageStartEvent
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XNCHOD2X.js";
|
|
5
5
|
import {
|
|
6
6
|
getCurrentWindowMessageOptions
|
|
7
7
|
} from "./chunk-NGJ5XJ7D.js";
|
|
@@ -31,4 +31,4 @@ export {
|
|
|
31
31
|
shouldCompact,
|
|
32
32
|
getCompactionTarget
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=chunk-
|
|
34
|
+
//# sourceMappingURL=chunk-CPTC2MD5.js.map
|