openfox 2.0.75 → 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/README.md +5 -2
- package/dist/{chat-handler-QLMBYRDY.js → chat-handler-FNRKORKP.js} +16 -16
- package/dist/{chunk-CJ2AJ7HU.js → chunk-3TQN25OM.js} +3 -3
- package/dist/{chunk-KEVRZWL3.js → chunk-46RORSKU.js} +2 -2
- package/dist/{chunk-S7O77CVO.js → chunk-4QHDQP2N.js} +2 -2
- package/dist/{chunk-I4RWK2L2.js → chunk-7QXRQ5ZL.js} +3 -3
- package/dist/{chunk-MIJX54CG.js → chunk-BX3VJP2D.js} +167 -89
- package/dist/{chunk-LKUAKQZY.js → chunk-CI5BWHW7.js} +8 -8
- package/dist/{chunk-OHGQILRF.js → chunk-CJDYSUU5.js} +3 -3
- package/dist/{chunk-LUG5QTFC.js → chunk-CPTC2MD5.js} +3 -3
- package/dist/{chunk-E5LLEO3C.js → chunk-DH3SSBZN.js} +2 -2
- package/dist/{chunk-UV3EMWL4.js → chunk-LXFLRM7M.js} +2 -2
- package/dist/{chunk-YFFP4DR4.js → chunk-NGJ5XJ7D.js} +2 -2
- package/dist/chunk-NUXS5OQB.js +7 -0
- package/dist/{chunk-LTFB2WWE.js → chunk-OBQPXUXI.js} +2 -2
- package/dist/{chunk-EZK7CGJ7.js → chunk-RMXPVQP4.js} +315 -45
- package/dist/{chunk-J3VQBVGO.js → chunk-VMYDUZWI.js} +8 -8
- package/dist/{chunk-UN26GIQG.js → chunk-VPFUXGMM.js} +6 -1
- package/dist/{chunk-6XOA2WPU.js → chunk-WL2WEJAK.js} +6 -3
- package/dist/{chunk-XWBNYU2L.js → chunk-XNCHOD2X.js} +5 -4
- package/dist/{chunk-6ZMGWDOD.js → chunk-YDV7RIQ6.js} +143 -109
- package/dist/{chunk-WGAAQASA.js → chunk-YFVSSMA3.js} +3 -2
- package/dist/{chunk-QNKXZH3Z.js → chunk-YMFCFMMB.js} +2 -2
- package/dist/{chunk-PJQW6TYI.js → chunk-YPHLCRFP.js} +7 -7
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{client-SC6X65GY.js → client-V5DZRO2D.js} +3 -3
- package/dist/{client-pure-NMLDKRDN.js → client-pure-5YE5WFJP.js} +2 -2
- package/dist/{compactor-AERNYEMP.js → compactor-BJXFE5PL.js} +8 -8
- package/dist/{config-EUMVEFHU.js → config-MD74ETY5.js} +2 -2
- package/dist/{events-X353XCPN.js → events-FLWRLM6V.js} +3 -3
- package/dist/{inspect-proxy-PHVZBZUO.js → inspect-proxy-JHZV34QR.js} +4 -4
- package/dist/{manager-5GILDCVD.js → manager-OPMCSYN2.js} +5 -5
- package/dist/{orchestrator-BIFTALBG.js → orchestrator-67BZJEOO.js} +15 -15
- package/dist/package.json +3 -1
- package/dist/{path-security-3FAIPJSV.js → path-security-ZROWNL22.js} +4 -4
- package/dist/{platform-XQ7BS3KQ.js → platform-QGXO3CNR.js} +4 -4
- package/dist/plugins-registry.json +6 -0
- package/dist/{processor-MQ47QSDR.js → processor-BCOSEMZK.js} +16 -16
- package/dist/{project-creator-FQRBN3RG.js → project-creator-C22J43BC.js} +3 -3
- package/dist/{projects-LHRNCUGW.js → projects-WSVINK2C.js} +3 -3
- package/dist/{protocol-Sr6Jr4ZS.d.ts → protocol-Ceapo3jt.d.ts} +1 -1
- package/dist/provider/index.d.ts +4 -4
- package/dist/{provider-OJUCZ5RN.js → provider-PI3RDDE4.js} +6 -6
- package/dist/{provider-manager-MAKXSL6L.js → provider-manager-PD3BXUHY.js} +4 -4
- package/dist/{serve-UD27KOL2.js → serve-BD44GN7N.js} +21 -21
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +20 -20
- package/dist/{server-TJ3PP5EW.js → server-OLRW27DH.js} +17 -17
- package/dist/{settings-PFXRYXZU.js → settings-7XDMSPIC.js} +3 -3
- package/dist/shared/index.d.ts +3 -3
- package/dist/{tools-RZ464GUJ.js → tools-T7S45DOQ.js} +14 -14
- 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-MWIZH4P2.js → update-56VZOLQJ.js} +2 -2
- package/dist/{update-server-MYYQUNZX.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/plugins-registry.json +6 -0
- package/dist/chunk-6COWK53A.js +0 -7
- package/dist/web/assets/index-Bn4hwZeP.js +0 -305
|
@@ -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,22 +89,22 @@ 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
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-LXFLRM7M.js";
|
|
96
96
|
import {
|
|
97
97
|
getPathSeparator,
|
|
98
98
|
isAbsolutePath
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-4QHDQP2N.js";
|
|
100
100
|
import {
|
|
101
101
|
deleteSetting,
|
|
102
102
|
getSetting,
|
|
103
103
|
setSetting
|
|
104
|
-
} from "./chunk-
|
|
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,
|
|
@@ -132,10 +132,10 @@ import {
|
|
|
132
132
|
updateSessionProvider,
|
|
133
133
|
updateSessionRunning,
|
|
134
134
|
updateSessionWorkdir
|
|
135
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-NGJ5XJ7D.js";
|
|
136
136
|
import {
|
|
137
137
|
initDatabase
|
|
138
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-7QXRQ5ZL.js";
|
|
139
139
|
import {
|
|
140
140
|
createContextStateMessage
|
|
141
141
|
} from "./chunk-O3NUNU4H.js";
|
|
@@ -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") };
|
|
@@ -4221,6 +4261,16 @@ function createDirectoryRoutes() {
|
|
|
4221
4261
|
// src/server/routes/file-search.ts
|
|
4222
4262
|
import { Router as Router8 } from "express";
|
|
4223
4263
|
import fg from "fast-glob";
|
|
4264
|
+
var IGNORED_PATTERNS = [
|
|
4265
|
+
"**/node_modules/**",
|
|
4266
|
+
"**/.git/**",
|
|
4267
|
+
"**/dist/**",
|
|
4268
|
+
"**/.next/**",
|
|
4269
|
+
"**/.cache/**",
|
|
4270
|
+
"**/__pycache__/**",
|
|
4271
|
+
"**/*.lock",
|
|
4272
|
+
"**/.openfox/**"
|
|
4273
|
+
];
|
|
4224
4274
|
function createFileSearchRoutes() {
|
|
4225
4275
|
const router = Router8();
|
|
4226
4276
|
router.get("/", async (req, res) => {
|
|
@@ -4236,21 +4286,15 @@ function createFileSearchRoutes() {
|
|
|
4236
4286
|
return router;
|
|
4237
4287
|
}
|
|
4238
4288
|
async function searchFiles(query, workdir) {
|
|
4289
|
+
if (query.endsWith("/")) {
|
|
4290
|
+
return listDirectoryContents(query, workdir);
|
|
4291
|
+
}
|
|
4239
4292
|
const entries = await fg(["**/*"], {
|
|
4240
4293
|
cwd: workdir,
|
|
4241
4294
|
dot: true,
|
|
4242
|
-
deep:
|
|
4295
|
+
deep: 32,
|
|
4243
4296
|
onlyFiles: false,
|
|
4244
|
-
ignore:
|
|
4245
|
-
"**/node_modules/**",
|
|
4246
|
-
"**/.git/**",
|
|
4247
|
-
"**/dist/**",
|
|
4248
|
-
"**/.next/**",
|
|
4249
|
-
"**/.cache/**",
|
|
4250
|
-
"**/__pycache__/**",
|
|
4251
|
-
"**/*.lock",
|
|
4252
|
-
"**/.openfox/**"
|
|
4253
|
-
],
|
|
4297
|
+
ignore: IGNORED_PATTERNS,
|
|
4254
4298
|
objectMode: true
|
|
4255
4299
|
});
|
|
4256
4300
|
const scored = [];
|
|
@@ -4274,6 +4318,28 @@ async function searchFiles(query, workdir) {
|
|
|
4274
4318
|
scored.sort((a, b) => b.score - a.score);
|
|
4275
4319
|
return scored.slice(0, 20);
|
|
4276
4320
|
}
|
|
4321
|
+
async function listDirectoryContents(query, workdir) {
|
|
4322
|
+
const dirPath = query.slice(0, -1).replace(/\/+/g, "/");
|
|
4323
|
+
const pattern = dirPath ? `${dirPath}/*` : "*";
|
|
4324
|
+
const entries = await fg([pattern], {
|
|
4325
|
+
cwd: workdir,
|
|
4326
|
+
dot: true,
|
|
4327
|
+
onlyFiles: false,
|
|
4328
|
+
ignore: IGNORED_PATTERNS,
|
|
4329
|
+
objectMode: true
|
|
4330
|
+
});
|
|
4331
|
+
const results = entries.map((entry) => {
|
|
4332
|
+
const isDir = entry.dirent.isDirectory();
|
|
4333
|
+
return {
|
|
4334
|
+
path: entry.path,
|
|
4335
|
+
name: entry.path.split("/").pop() || entry.path,
|
|
4336
|
+
type: isDir ? "directory" : "file",
|
|
4337
|
+
score: isDir ? 110 : 100
|
|
4338
|
+
};
|
|
4339
|
+
});
|
|
4340
|
+
results.sort((a, b) => b.score - a.score);
|
|
4341
|
+
return results.slice(0, 20);
|
|
4342
|
+
}
|
|
4277
4343
|
function fuzzyScore(filePath, query) {
|
|
4278
4344
|
if (!query) {
|
|
4279
4345
|
return 1;
|
|
@@ -4533,7 +4599,7 @@ function createProviderAuthRoutes(config3, providerManager, registry) {
|
|
|
4533
4599
|
try {
|
|
4534
4600
|
const { challenge, completion } = await adapter.beginLogin({ providerId: provider.id });
|
|
4535
4601
|
void completion.then(async ({ credentialRef }) => {
|
|
4536
|
-
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-
|
|
4602
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-MD74ETY5.js");
|
|
4537
4603
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
4538
4604
|
const updatedConfig = updateProvider(globalConfig, provider.id, { credentialRef, authAdapter: adapter.id });
|
|
4539
4605
|
await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
|
|
@@ -4567,7 +4633,7 @@ function createProviderAuthRoutes(config3, providerManager, registry) {
|
|
|
4567
4633
|
if (!context) return;
|
|
4568
4634
|
const { provider, adapter } = context;
|
|
4569
4635
|
if (provider.credentialRef && adapter) await adapter.logout(provider.credentialRef);
|
|
4570
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
4636
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-MD74ETY5.js");
|
|
4571
4637
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
4572
4638
|
const updatedConfig = {
|
|
4573
4639
|
...globalConfig,
|
|
@@ -5047,7 +5113,7 @@ async function createServerHandle(config3) {
|
|
|
5047
5113
|
const mcpManager = new McpManager({
|
|
5048
5114
|
onToolsDiscovered: async (name, tools) => {
|
|
5049
5115
|
try {
|
|
5050
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
5116
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-MD74ETY5.js");
|
|
5051
5117
|
const mode = config3.mode ?? "production";
|
|
5052
5118
|
const globalConfig = await loadGlobalConfig(mode, config3.globalConfigPath);
|
|
5053
5119
|
const mcpServers2 = {
|
|
@@ -5078,12 +5144,11 @@ async function createServerHandle(config3) {
|
|
|
5078
5144
|
setMcpTools(mcpTools);
|
|
5079
5145
|
logger.info("MCP tools registered", { count: mcpTools.length });
|
|
5080
5146
|
}
|
|
5081
|
-
const { signalMcpReady } = await import("./server-
|
|
5147
|
+
const { signalMcpReady } = await import("./server-OLRW27DH.js");
|
|
5082
5148
|
signalMcpReady();
|
|
5083
5149
|
});
|
|
5084
5150
|
const app = express();
|
|
5085
5151
|
app.use(cors());
|
|
5086
|
-
app.use(express.json({ limit: "10mb" }));
|
|
5087
5152
|
const authMiddleware = async (req, res, next) => {
|
|
5088
5153
|
const path = req.path;
|
|
5089
5154
|
const publicPaths = ["/health", "/auth", "/auth/login", "/auto-update/check"];
|
|
@@ -5101,6 +5166,7 @@ async function createServerHandle(config3) {
|
|
|
5101
5166
|
next();
|
|
5102
5167
|
};
|
|
5103
5168
|
app.use("/api", authMiddleware);
|
|
5169
|
+
app.use(express.json({ limit: "75mb" }));
|
|
5104
5170
|
app.get("/api/health", (_req, res) => {
|
|
5105
5171
|
res.json({ status: "ok", timestamp: (/* @__PURE__ */ new Date()).toISOString() });
|
|
5106
5172
|
});
|
|
@@ -5140,7 +5206,7 @@ async function createServerHandle(config3) {
|
|
|
5140
5206
|
res.json({ tools });
|
|
5141
5207
|
});
|
|
5142
5208
|
app.get("/api/projects", async (_req, res) => {
|
|
5143
|
-
const { listProjects } = await import("./projects-
|
|
5209
|
+
const { listProjects } = await import("./projects-WSVINK2C.js");
|
|
5144
5210
|
const projects = listProjects();
|
|
5145
5211
|
res.json({ projects });
|
|
5146
5212
|
});
|
|
@@ -5149,7 +5215,7 @@ async function createServerHandle(config3) {
|
|
|
5149
5215
|
if (!name || !workdir) {
|
|
5150
5216
|
return res.status(400).json({ error: "name and workdir are required" });
|
|
5151
5217
|
}
|
|
5152
|
-
const { createDirectoryWithGit } = await import("./project-creator-
|
|
5218
|
+
const { createDirectoryWithGit } = await import("./project-creator-C22J43BC.js");
|
|
5153
5219
|
try {
|
|
5154
5220
|
const project = await createDirectoryWithGit(name, workdir);
|
|
5155
5221
|
res.status(201).json({ project });
|
|
@@ -5194,7 +5260,7 @@ async function createServerHandle(config3) {
|
|
|
5194
5260
|
}
|
|
5195
5261
|
});
|
|
5196
5262
|
app.get("/api/projects/:id", async (req, res) => {
|
|
5197
|
-
const { getProject: getProject2 } = await import("./projects-
|
|
5263
|
+
const { getProject: getProject2 } = await import("./projects-WSVINK2C.js");
|
|
5198
5264
|
const project = getProject2(req.params.id);
|
|
5199
5265
|
if (!project) {
|
|
5200
5266
|
return res.status(404).json({ error: "Project not found" });
|
|
@@ -5202,7 +5268,7 @@ async function createServerHandle(config3) {
|
|
|
5202
5268
|
res.json({ project });
|
|
5203
5269
|
});
|
|
5204
5270
|
app.put("/api/projects/:id", async (req, res) => {
|
|
5205
|
-
const { updateProject } = await import("./projects-
|
|
5271
|
+
const { updateProject } = await import("./projects-WSVINK2C.js");
|
|
5206
5272
|
const { name, customInstructions, dangerLevel } = req.body;
|
|
5207
5273
|
const updates = {};
|
|
5208
5274
|
if (name !== void 0) updates.name = name;
|
|
@@ -5215,7 +5281,7 @@ async function createServerHandle(config3) {
|
|
|
5215
5281
|
res.json({ project: updated });
|
|
5216
5282
|
});
|
|
5217
5283
|
app.delete("/api/projects/:id", async (req, res) => {
|
|
5218
|
-
const { getProject: getProject2, deleteProject } = await import("./projects-
|
|
5284
|
+
const { getProject: getProject2, deleteProject } = await import("./projects-WSVINK2C.js");
|
|
5219
5285
|
const project = getProject2(req.params.id);
|
|
5220
5286
|
if (!project) {
|
|
5221
5287
|
return res.status(404).json({ error: "Project not found" });
|
|
@@ -5224,7 +5290,7 @@ async function createServerHandle(config3) {
|
|
|
5224
5290
|
res.json({ success: true });
|
|
5225
5291
|
});
|
|
5226
5292
|
app.put("/api/projects/:id/star", async (req, res) => {
|
|
5227
|
-
const { toggleStar } = await import("./projects-
|
|
5293
|
+
const { toggleStar } = await import("./projects-WSVINK2C.js");
|
|
5228
5294
|
const { isStarred } = req.body;
|
|
5229
5295
|
if (typeof isStarred !== "boolean") {
|
|
5230
5296
|
return res.status(400).json({ error: "isStarred is required and must be a boolean" });
|
|
@@ -5236,7 +5302,7 @@ async function createServerHandle(config3) {
|
|
|
5236
5302
|
res.json({ project });
|
|
5237
5303
|
});
|
|
5238
5304
|
app.get("/api/projects/:id/branches", async (req, res) => {
|
|
5239
|
-
const { getProject: getProject2 } = await import("./projects-
|
|
5305
|
+
const { getProject: getProject2 } = await import("./projects-WSVINK2C.js");
|
|
5240
5306
|
const project = getProject2(req.params.id);
|
|
5241
5307
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5242
5308
|
const { listBranches } = await import("./workspace-6QTTUMMW.js");
|
|
@@ -5244,7 +5310,7 @@ async function createServerHandle(config3) {
|
|
|
5244
5310
|
res.json({ branches });
|
|
5245
5311
|
});
|
|
5246
5312
|
app.post("/api/projects/:id/checkout", async (req, res) => {
|
|
5247
|
-
const { getProject: getProject2 } = await import("./projects-
|
|
5313
|
+
const { getProject: getProject2 } = await import("./projects-WSVINK2C.js");
|
|
5248
5314
|
const project = getProject2(req.params.id);
|
|
5249
5315
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5250
5316
|
const { branch } = req.body;
|
|
@@ -5258,7 +5324,7 @@ async function createServerHandle(config3) {
|
|
|
5258
5324
|
}
|
|
5259
5325
|
});
|
|
5260
5326
|
app.post("/api/projects/:id/checkout-new", async (req, res) => {
|
|
5261
|
-
const { getProject: getProject2 } = await import("./projects-
|
|
5327
|
+
const { getProject: getProject2 } = await import("./projects-WSVINK2C.js");
|
|
5262
5328
|
const project = getProject2(req.params.id);
|
|
5263
5329
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5264
5330
|
const { name } = req.body;
|
|
@@ -5310,7 +5376,7 @@ async function createServerHandle(config3) {
|
|
|
5310
5376
|
}
|
|
5311
5377
|
});
|
|
5312
5378
|
app.get("/api/projects/:id/workspaces", async (req, res) => {
|
|
5313
|
-
const { getProject: getProject2 } = await import("./projects-
|
|
5379
|
+
const { getProject: getProject2 } = await import("./projects-WSVINK2C.js");
|
|
5314
5380
|
const project = getProject2(req.params.id);
|
|
5315
5381
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5316
5382
|
const { listWorkspaces } = await import("./workspace-6QTTUMMW.js");
|
|
@@ -5319,8 +5385,8 @@ async function createServerHandle(config3) {
|
|
|
5319
5385
|
res.json({ workspaces: workspacesList });
|
|
5320
5386
|
});
|
|
5321
5387
|
app.get("/api/sessions", async (req, res) => {
|
|
5322
|
-
const { getRecentUserPromptsForSession } = await import("./events-
|
|
5323
|
-
const { getPendingConfirmationsBySession } = await import("./path-security-
|
|
5388
|
+
const { getRecentUserPromptsForSession } = await import("./events-FLWRLM6V.js");
|
|
5389
|
+
const { getPendingConfirmationsBySession } = await import("./path-security-ZROWNL22.js");
|
|
5324
5390
|
const projectId = req.query["projectId"];
|
|
5325
5391
|
const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
|
|
5326
5392
|
const offset = parseInt(req.query["offset"]) || 0;
|
|
@@ -5408,9 +5474,9 @@ async function createServerHandle(config3) {
|
|
|
5408
5474
|
}
|
|
5409
5475
|
});
|
|
5410
5476
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
5411
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5477
|
+
const { getEventStore: getEventStore2 } = await import("./events-FLWRLM6V.js");
|
|
5412
5478
|
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-ONH3D4OK.js");
|
|
5413
|
-
const { getPendingQuestionsForSession } = await import("./tools-
|
|
5479
|
+
const { getPendingQuestionsForSession } = await import("./tools-T7S45DOQ.js");
|
|
5414
5480
|
const session = sessionManager.getSession(req.params.id);
|
|
5415
5481
|
if (!session) {
|
|
5416
5482
|
return res.status(404).json({ error: "Session not found" });
|
|
@@ -5430,8 +5496,8 @@ async function createServerHandle(config3) {
|
|
|
5430
5496
|
if (!session) {
|
|
5431
5497
|
return res.status(404).json({ error: "Session not found" });
|
|
5432
5498
|
}
|
|
5433
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
5434
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
5499
|
+
const { stopSessionExecution } = await import("./chat-handler-FNRKORKP.js");
|
|
5500
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-T7S45DOQ.js");
|
|
5435
5501
|
sessionManager.clearMessageQueue(sessionId);
|
|
5436
5502
|
stopSessionExecution(sessionId, sessionManager);
|
|
5437
5503
|
abortSession(sessionId);
|
|
@@ -5460,7 +5526,7 @@ async function createServerHandle(config3) {
|
|
|
5460
5526
|
res.json({ success: true });
|
|
5461
5527
|
});
|
|
5462
5528
|
app.post("/api/sessions/:id/provider", async (req, res) => {
|
|
5463
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5529
|
+
const { getEventStore: getEventStore2 } = await import("./events-FLWRLM6V.js");
|
|
5464
5530
|
const { buildMessagesFromStoredEvents } = await import("./folding-ONH3D4OK.js");
|
|
5465
5531
|
const sessionId = req.params.id;
|
|
5466
5532
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -5494,7 +5560,7 @@ async function createServerHandle(config3) {
|
|
|
5494
5560
|
if (!result.success) {
|
|
5495
5561
|
return res.status(500).json({ error: result.error ?? "Failed to set default model" });
|
|
5496
5562
|
}
|
|
5497
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
5563
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-MD74ETY5.js");
|
|
5498
5564
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
5499
5565
|
const updatedConfig = setDefaultModelSelection(globalConfig, providerId, model);
|
|
5500
5566
|
await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
|
|
@@ -5572,7 +5638,7 @@ async function createServerHandle(config3) {
|
|
|
5572
5638
|
res.json({ success: true });
|
|
5573
5639
|
});
|
|
5574
5640
|
app.put("/api/sessions/:id/mode", async (req, res) => {
|
|
5575
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5641
|
+
const { getEventStore: getEventStore2 } = await import("./events-FLWRLM6V.js");
|
|
5576
5642
|
const { buildMessagesFromStoredEvents } = await import("./folding-ONH3D4OK.js");
|
|
5577
5643
|
const sessionId = req.params.id;
|
|
5578
5644
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -5629,15 +5695,15 @@ async function createServerHandle(config3) {
|
|
|
5629
5695
|
if (!callId || approved === void 0) {
|
|
5630
5696
|
return res.status(400).json({ error: "callId and approved are required" });
|
|
5631
5697
|
}
|
|
5632
|
-
const { providePathConfirmation } = await import("./tools-
|
|
5698
|
+
const { providePathConfirmation } = await import("./tools-T7S45DOQ.js");
|
|
5633
5699
|
const result = providePathConfirmation(callId, approved, alwaysAllow);
|
|
5634
5700
|
if (!result.found) {
|
|
5635
5701
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
5636
5702
|
}
|
|
5637
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5703
|
+
const { getEventStore: getEventStore2 } = await import("./events-FLWRLM6V.js");
|
|
5638
5704
|
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-ONH3D4OK.js");
|
|
5639
5705
|
const { createSessionStateMessage } = await import("./protocol-EWEVW65B.js");
|
|
5640
|
-
const { getPendingQuestionsForSession } = await import("./tools-
|
|
5706
|
+
const { getPendingQuestionsForSession } = await import("./tools-T7S45DOQ.js");
|
|
5641
5707
|
const eventStore = getEventStore2();
|
|
5642
5708
|
const events = eventStore.getEvents(sessionId);
|
|
5643
5709
|
const messages = buildMessagesFromStoredEvents(events);
|
|
@@ -5663,7 +5729,7 @@ async function createServerHandle(config3) {
|
|
|
5663
5729
|
if (!skip && typeof answer !== "string") {
|
|
5664
5730
|
return res.status(400).json({ error: "answer is required when not skipping" });
|
|
5665
5731
|
}
|
|
5666
|
-
const { provideAnswer } = await import("./tools-
|
|
5732
|
+
const { provideAnswer } = await import("./tools-T7S45DOQ.js");
|
|
5667
5733
|
const found = provideAnswer(callId, answer ?? "", skip ?? false);
|
|
5668
5734
|
if (!found) {
|
|
5669
5735
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -5691,7 +5757,7 @@ async function createServerHandle(config3) {
|
|
|
5691
5757
|
if (!session) {
|
|
5692
5758
|
return res.status(404).json({ error: "Session not found" });
|
|
5693
5759
|
}
|
|
5694
|
-
const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-
|
|
5760
|
+
const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-7XDMSPIC.js");
|
|
5695
5761
|
if (getSetting2(SETTINGS_KEYS.CACHE_WARMING) !== "true") {
|
|
5696
5762
|
return res.json({ success: false, reason: "disabled" });
|
|
5697
5763
|
}
|
|
@@ -5723,7 +5789,7 @@ async function createServerHandle(config3) {
|
|
|
5723
5789
|
backend: activeProvider?.backend ?? llmClient.getBackend(),
|
|
5724
5790
|
model: llmClient.getModel()
|
|
5725
5791
|
};
|
|
5726
|
-
const { runAgentTurn, TurnMetrics } = await import("./orchestrator-
|
|
5792
|
+
const { runAgentTurn, TurnMetrics } = await import("./orchestrator-67BZJEOO.js");
|
|
5727
5793
|
runAgentTurn(
|
|
5728
5794
|
{
|
|
5729
5795
|
sessionManager,
|
|
@@ -5761,15 +5827,15 @@ async function createServerHandle(config3) {
|
|
|
5761
5827
|
if (!session) {
|
|
5762
5828
|
return res.status(404).json({ error: "Session not found" });
|
|
5763
5829
|
}
|
|
5764
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
5765
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
5830
|
+
const { stopSessionExecution } = await import("./chat-handler-FNRKORKP.js");
|
|
5831
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-T7S45DOQ.js");
|
|
5766
5832
|
const queuedMessages = sessionManager.getQueueState(sessionId);
|
|
5767
5833
|
sessionManager.clearMessageQueue(sessionId);
|
|
5768
5834
|
stopSessionExecution(sessionId, sessionManager);
|
|
5769
5835
|
abortSession(sessionId);
|
|
5770
5836
|
cancelQuestionsForSession(sessionId, "Session stopped by user");
|
|
5771
5837
|
cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
|
|
5772
|
-
const eventStore = (await import("./events-
|
|
5838
|
+
const eventStore = (await import("./events-FLWRLM6V.js")).getEventStore();
|
|
5773
5839
|
eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
|
|
5774
5840
|
res.json({ success: true, queuedMessages });
|
|
5775
5841
|
});
|
|
@@ -5783,7 +5849,7 @@ async function createServerHandle(config3) {
|
|
|
5783
5849
|
if (typeof messageIndex !== "number" || messageIndex < 0) {
|
|
5784
5850
|
return res.status(400).json({ error: "messageIndex must be a non-negative number" });
|
|
5785
5851
|
}
|
|
5786
|
-
const { truncateSessionMessages } = await import("./events-
|
|
5852
|
+
const { truncateSessionMessages } = await import("./events-FLWRLM6V.js");
|
|
5787
5853
|
truncateSessionMessages(sessionId, messageIndex);
|
|
5788
5854
|
res.json({ success: true });
|
|
5789
5855
|
});
|
|
@@ -5800,7 +5866,7 @@ async function createServerHandle(config3) {
|
|
|
5800
5866
|
if (content !== void 0 && (typeof content !== "string" || !content.trim())) {
|
|
5801
5867
|
return res.status(400).json({ error: "content must be a non-empty string if provided" });
|
|
5802
5868
|
}
|
|
5803
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
5869
|
+
const { getEventStore: getEventStore2 } = await import("./events-FLWRLM6V.js");
|
|
5804
5870
|
const { buildMessagesFromStoredEvents } = await import("./folding-ONH3D4OK.js");
|
|
5805
5871
|
const eventStore = getEventStore2();
|
|
5806
5872
|
const events = eventStore.getEvents(sessionId);
|
|
@@ -5813,7 +5879,7 @@ async function createServerHandle(config3) {
|
|
|
5813
5879
|
if (msg.role !== "user" || msg.isSystemGenerated) {
|
|
5814
5880
|
return res.status(400).json({ error: "Can only replay user messages" });
|
|
5815
5881
|
}
|
|
5816
|
-
const { truncateSessionMessages } = await import("./events-
|
|
5882
|
+
const { truncateSessionMessages } = await import("./events-FLWRLM6V.js");
|
|
5817
5883
|
truncateSessionMessages(sessionId, msgIndex - 1);
|
|
5818
5884
|
sessionManager.queueMessage(sessionId, "asap", content ?? msg.content, msg.attachments, msg.messageKind);
|
|
5819
5885
|
res.json({ success: true });
|
|
@@ -5845,7 +5911,7 @@ async function createServerHandle(config3) {
|
|
|
5845
5911
|
res.json({ accepted: true });
|
|
5846
5912
|
});
|
|
5847
5913
|
app.get("/api/settings", async (req, res) => {
|
|
5848
|
-
const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-
|
|
5914
|
+
const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-7XDMSPIC.js");
|
|
5849
5915
|
const keysParam = req.query["keys"];
|
|
5850
5916
|
if (!keysParam) {
|
|
5851
5917
|
return res.status(400).json({ error: "keys query parameter is required" });
|
|
@@ -5858,19 +5924,19 @@ async function createServerHandle(config3) {
|
|
|
5858
5924
|
res.json(result);
|
|
5859
5925
|
});
|
|
5860
5926
|
app.get("/api/settings/:key", async (req, res) => {
|
|
5861
|
-
const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-
|
|
5927
|
+
const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-7XDMSPIC.js");
|
|
5862
5928
|
const key = req.params.key;
|
|
5863
5929
|
const value = getSetting2(key) ?? SETTINGS_DEFAULTS[key] ?? null;
|
|
5864
5930
|
res.json({ key, value });
|
|
5865
5931
|
});
|
|
5866
5932
|
app.get("/api/settings/:key", async (req, res) => {
|
|
5867
|
-
const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-
|
|
5933
|
+
const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-7XDMSPIC.js");
|
|
5868
5934
|
const key = req.params.key;
|
|
5869
5935
|
const value = getSetting2(key) ?? SETTINGS_DEFAULTS[key] ?? null;
|
|
5870
5936
|
res.json({ key, value });
|
|
5871
5937
|
});
|
|
5872
5938
|
app.put("/api/settings/:key", async (req, res) => {
|
|
5873
|
-
const { setSetting: setSetting2 } = await import("./settings-
|
|
5939
|
+
const { setSetting: setSetting2 } = await import("./settings-7XDMSPIC.js");
|
|
5874
5940
|
const key = req.params.key;
|
|
5875
5941
|
const { value } = req.body;
|
|
5876
5942
|
if (value === void 0) {
|
|
@@ -5897,7 +5963,7 @@ async function createServerHandle(config3) {
|
|
|
5897
5963
|
}
|
|
5898
5964
|
});
|
|
5899
5965
|
app.get("/api/tools/shells", async (_req, res) => {
|
|
5900
|
-
const { listAvailableShells } = await import("./platform-
|
|
5966
|
+
const { listAvailableShells } = await import("./platform-QGXO3CNR.js");
|
|
5901
5967
|
res.json({ shells: listAvailableShells() });
|
|
5902
5968
|
});
|
|
5903
5969
|
app.get("/api/config", async (_req, res) => {
|
|
@@ -5906,7 +5972,7 @@ async function createServerHandle(config3) {
|
|
|
5906
5972
|
let visionFallback;
|
|
5907
5973
|
let globalWorkdir;
|
|
5908
5974
|
try {
|
|
5909
|
-
const { loadGlobalConfig, getVisionFallback } = await import("./config-
|
|
5975
|
+
const { loadGlobalConfig, getVisionFallback } = await import("./config-MD74ETY5.js");
|
|
5910
5976
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
5911
5977
|
const fallback = getVisionFallback(globalConfig);
|
|
5912
5978
|
if (fallback) {
|
|
@@ -6060,7 +6126,7 @@ async function createServerHandle(config3) {
|
|
|
6060
6126
|
const backend = req.query["backend"];
|
|
6061
6127
|
if (!url) return res.status(400).json({ error: "url is required" });
|
|
6062
6128
|
try {
|
|
6063
|
-
const { fetchModelsWithContext } = await import("./provider-manager-
|
|
6129
|
+
const { fetchModelsWithContext } = await import("./provider-manager-PD3BXUHY.js");
|
|
6064
6130
|
const { getModelProfile: getModelProfile2 } = await import("./profiles-5J7F4BML.js");
|
|
6065
6131
|
const models = await fetchModelsWithContext(
|
|
6066
6132
|
url,
|
|
@@ -6130,7 +6196,7 @@ async function createServerHandle(config3) {
|
|
|
6130
6196
|
}
|
|
6131
6197
|
const { getModelProfile: getModelProfile2 } = await import("./profiles-5J7F4BML.js");
|
|
6132
6198
|
const { getBackendCapabilities } = await import("./backend-P3GHHLHJ.js");
|
|
6133
|
-
const { buildNonStreamingCreateParams } = await import("./client-pure-
|
|
6199
|
+
const { buildNonStreamingCreateParams } = await import("./client-pure-5YE5WFJP.js");
|
|
6134
6200
|
const { OpenAIHttpClient } = await import("./http-client-PIWB7BXK.js");
|
|
6135
6201
|
const { ensureVersionPrefix } = await import("./url-utils-SAJP7AEX.js");
|
|
6136
6202
|
const profile = getModelProfile2(model);
|
|
@@ -6200,7 +6266,7 @@ async function createServerHandle(config3) {
|
|
|
6200
6266
|
return res.status(400).json({ error: "name, url, and backend are required" });
|
|
6201
6267
|
}
|
|
6202
6268
|
try {
|
|
6203
|
-
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-
|
|
6269
|
+
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-MD74ETY5.js");
|
|
6204
6270
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6205
6271
|
const providerBackend = backend;
|
|
6206
6272
|
const providerModels = modelConfigs?.length ? buildModelConfigs(modelConfigs) : model ? [{ id: model, contextWindow: 2e5, source: "user" }] : [];
|
|
@@ -6240,7 +6306,7 @@ async function createServerHandle(config3) {
|
|
|
6240
6306
|
app.post("/api/init/config", async (req, res) => {
|
|
6241
6307
|
const { workdir, visionFallback } = req.body;
|
|
6242
6308
|
try {
|
|
6243
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6309
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-MD74ETY5.js");
|
|
6244
6310
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6245
6311
|
const updatedConfig = {
|
|
6246
6312
|
...globalConfig,
|
|
@@ -6279,7 +6345,7 @@ async function createServerHandle(config3) {
|
|
|
6279
6345
|
});
|
|
6280
6346
|
app.delete("/api/providers/:id", async (req, res) => {
|
|
6281
6347
|
const { id } = req.params;
|
|
6282
|
-
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-
|
|
6348
|
+
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-MD74ETY5.js");
|
|
6283
6349
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6284
6350
|
const updatedConfig = removeProvider(globalConfig, id);
|
|
6285
6351
|
await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
|
|
@@ -6291,7 +6357,7 @@ async function createServerHandle(config3) {
|
|
|
6291
6357
|
const { id } = req.params;
|
|
6292
6358
|
const { isLocal } = req.body;
|
|
6293
6359
|
try {
|
|
6294
|
-
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-
|
|
6360
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-MD74ETY5.js");
|
|
6295
6361
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6296
6362
|
const provider = globalConfig.providers.find((p) => p.id === id);
|
|
6297
6363
|
if (!provider) {
|
|
@@ -6322,7 +6388,7 @@ async function createServerHandle(config3) {
|
|
|
6322
6388
|
transportAdapter
|
|
6323
6389
|
} = req.body;
|
|
6324
6390
|
try {
|
|
6325
|
-
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-
|
|
6391
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-MD74ETY5.js");
|
|
6326
6392
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6327
6393
|
const provider = globalConfig.providers.find((p) => p.id === id);
|
|
6328
6394
|
if (!provider) {
|
|
@@ -6362,7 +6428,7 @@ async function createServerHandle(config3) {
|
|
|
6362
6428
|
return res.status(400).json({ error: result.error });
|
|
6363
6429
|
}
|
|
6364
6430
|
const llmClient = getLLMClient();
|
|
6365
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
6431
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-MD74ETY5.js");
|
|
6366
6432
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6367
6433
|
const updatedConfig = setDefaultModelSelection(globalConfig, id, llmClient.getModel());
|
|
6368
6434
|
await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
|
|
@@ -6389,7 +6455,7 @@ async function createServerHandle(config3) {
|
|
|
6389
6455
|
});
|
|
6390
6456
|
async function rebuildMcpTools() {
|
|
6391
6457
|
const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-MOGEI6TP.js");
|
|
6392
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
6458
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-T7S45DOQ.js");
|
|
6393
6459
|
const mcpTools = createMcpTools2(mcpManager);
|
|
6394
6460
|
setMcpTools2(mcpTools);
|
|
6395
6461
|
}
|
|
@@ -6398,7 +6464,7 @@ async function createServerHandle(config3) {
|
|
|
6398
6464
|
res.json({ servers });
|
|
6399
6465
|
});
|
|
6400
6466
|
app.post("/api/mcp/servers/test", async (req, res) => {
|
|
6401
|
-
const { name, transport, command, args, env, url, headers } = req.body;
|
|
6467
|
+
const { name, transport, command, args, env, url, headers, timeout } = req.body;
|
|
6402
6468
|
if (transport !== void 0 && transport !== "stdio" && transport !== "http") {
|
|
6403
6469
|
return res.status(400).json({ error: `Invalid transport '${transport}'. Must be 'stdio' or 'http'.` });
|
|
6404
6470
|
}
|
|
@@ -6408,6 +6474,9 @@ async function createServerHandle(config3) {
|
|
|
6408
6474
|
if (transport === "http" && !url) {
|
|
6409
6475
|
return res.status(400).json({ error: "url is required for http transport" });
|
|
6410
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
|
+
}
|
|
6411
6480
|
try {
|
|
6412
6481
|
const testManager = new McpManager();
|
|
6413
6482
|
const resolvedTransport = transport === "http" ? "http" : "stdio";
|
|
@@ -6417,7 +6486,8 @@ async function createServerHandle(config3) {
|
|
|
6417
6486
|
...args && args.length > 0 ? { args } : {},
|
|
6418
6487
|
...env && Object.keys(env).length > 0 ? { env } : {},
|
|
6419
6488
|
...url ? { url } : {},
|
|
6420
|
-
...headers && Object.keys(headers).length > 0 ? { headers } : {}
|
|
6489
|
+
...headers && Object.keys(headers).length > 0 ? { headers } : {},
|
|
6490
|
+
...timeout !== void 0 ? { timeout } : {}
|
|
6421
6491
|
};
|
|
6422
6492
|
await testManager.addServer(name ?? "test", testConfig);
|
|
6423
6493
|
const server = testManager.getServer(name ?? "test");
|
|
@@ -6432,13 +6502,16 @@ async function createServerHandle(config3) {
|
|
|
6432
6502
|
}
|
|
6433
6503
|
});
|
|
6434
6504
|
app.post("/api/mcp/servers", async (req, res) => {
|
|
6435
|
-
const { name, transport, command, args, env, url, headers } = req.body;
|
|
6505
|
+
const { name, transport, command, args, env, url, headers, timeout } = req.body;
|
|
6436
6506
|
if (!name) {
|
|
6437
6507
|
return res.status(400).json({ error: "name is required" });
|
|
6438
6508
|
}
|
|
6439
6509
|
if (transport !== void 0 && transport !== "stdio" && transport !== "http") {
|
|
6440
6510
|
return res.status(400).json({ error: `Invalid transport '${transport}'. Must be 'stdio' or 'http'.` });
|
|
6441
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
|
+
}
|
|
6442
6515
|
try {
|
|
6443
6516
|
const resolvedTransport = transport === "http" ? "http" : "stdio";
|
|
6444
6517
|
const serverCfg = {
|
|
@@ -6447,11 +6520,12 @@ async function createServerHandle(config3) {
|
|
|
6447
6520
|
...args && args.length > 0 ? { args } : {},
|
|
6448
6521
|
...env && Object.keys(env).length > 0 ? { env } : {},
|
|
6449
6522
|
...url ? { url } : {},
|
|
6450
|
-
...headers && Object.keys(headers).length > 0 ? { headers } : {}
|
|
6523
|
+
...headers && Object.keys(headers).length > 0 ? { headers } : {},
|
|
6524
|
+
...timeout !== void 0 ? { timeout } : {}
|
|
6451
6525
|
};
|
|
6452
6526
|
await mcpManager.addServer(name, serverCfg);
|
|
6453
6527
|
const server = mcpManager.getServer(name);
|
|
6454
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6528
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-MD74ETY5.js");
|
|
6455
6529
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6456
6530
|
const updatedMcpServers = { ...globalConfig.mcpServers ?? {}, [name]: serverCfg };
|
|
6457
6531
|
await saveGlobalConfig(
|
|
@@ -6481,7 +6555,7 @@ async function createServerHandle(config3) {
|
|
|
6481
6555
|
return res.status(404).json({ error: `MCP server '${name}' not found` });
|
|
6482
6556
|
}
|
|
6483
6557
|
const body = req.body;
|
|
6484
|
-
const { transport: rawTransport, command, args, env, url, headers } = body;
|
|
6558
|
+
const { transport: rawTransport, command, args, env, url, headers, timeout } = body;
|
|
6485
6559
|
if (rawTransport !== void 0 && rawTransport !== "stdio" && rawTransport !== "http") {
|
|
6486
6560
|
return res.status(400).json({ error: `Invalid transport '${String(rawTransport)}'. Must be 'stdio' or 'http'.` });
|
|
6487
6561
|
}
|
|
@@ -6500,9 +6574,12 @@ async function createServerHandle(config3) {
|
|
|
6500
6574
|
if (headers !== void 0 && (typeof headers !== "object" || headers === null || Array.isArray(headers) || Object.values(headers).some((v) => typeof v !== "string"))) {
|
|
6501
6575
|
return res.status(400).json({ error: "headers must be a string/string object" });
|
|
6502
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
|
+
}
|
|
6503
6580
|
try {
|
|
6504
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6505
|
-
const { applyMcpServerUpdate } = await import("./update-server-
|
|
6581
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-MD74ETY5.js");
|
|
6582
|
+
const { applyMcpServerUpdate } = await import("./update-server-V6GJ43WH.js");
|
|
6506
6583
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6507
6584
|
const mcpServers2 = { ...globalConfig.mcpServers ?? {} };
|
|
6508
6585
|
const patch = {
|
|
@@ -6511,7 +6588,8 @@ async function createServerHandle(config3) {
|
|
|
6511
6588
|
...args !== void 0 ? { args } : {},
|
|
6512
6589
|
...env !== void 0 ? { env } : {},
|
|
6513
6590
|
...url !== void 0 ? { url } : {},
|
|
6514
|
-
...headers !== void 0 ? { headers } : {}
|
|
6591
|
+
...headers !== void 0 ? { headers } : {},
|
|
6592
|
+
...timeout !== void 0 ? { timeout } : {}
|
|
6515
6593
|
};
|
|
6516
6594
|
const { error: updateError } = await applyMcpServerUpdate({
|
|
6517
6595
|
name,
|
|
@@ -6544,7 +6622,7 @@ async function createServerHandle(config3) {
|
|
|
6544
6622
|
return res.status(404).json({ error: `MCP server '${name}' not found` });
|
|
6545
6623
|
}
|
|
6546
6624
|
mcpManager.removeServer(name);
|
|
6547
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6625
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-MD74ETY5.js");
|
|
6548
6626
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6549
6627
|
const updatedMcpServers = { ...globalConfig.mcpServers ?? {} };
|
|
6550
6628
|
delete updatedMcpServers[name];
|
|
@@ -6573,7 +6651,7 @@ async function createServerHandle(config3) {
|
|
|
6573
6651
|
await mcpManager.setToolEnabled(name, toolName, enabled);
|
|
6574
6652
|
const server = mcpManager.getServer(name);
|
|
6575
6653
|
if (server) {
|
|
6576
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6654
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-MD74ETY5.js");
|
|
6577
6655
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6578
6656
|
const mcpServers2 = { ...globalConfig.mcpServers ?? {} };
|
|
6579
6657
|
const serverCfg = mcpServers2[name];
|
|
@@ -6624,13 +6702,13 @@ async function createServerHandle(config3) {
|
|
|
6624
6702
|
})
|
|
6625
6703
|
);
|
|
6626
6704
|
app.get("/api/sessions/:id/background-processes", async (req, res) => {
|
|
6627
|
-
const { getSessionProcesses } = await import("./manager-
|
|
6705
|
+
const { getSessionProcesses } = await import("./manager-OPMCSYN2.js");
|
|
6628
6706
|
const sessionId = req.params.id;
|
|
6629
6707
|
const processes = getSessionProcesses(sessionId);
|
|
6630
6708
|
res.json({ processes });
|
|
6631
6709
|
});
|
|
6632
6710
|
app.post("/api/sessions/:id/background-process/:processId/stop", async (req, res) => {
|
|
6633
|
-
const { stopProcess } = await import("./manager-
|
|
6711
|
+
const { stopProcess } = await import("./manager-OPMCSYN2.js");
|
|
6634
6712
|
const sessionId = req.params.id;
|
|
6635
6713
|
const processId = req.params.processId;
|
|
6636
6714
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -6773,7 +6851,7 @@ async function createServerHandle(config3) {
|
|
|
6773
6851
|
const state = sessionManager.getContextState(sessionId);
|
|
6774
6852
|
wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
|
|
6775
6853
|
});
|
|
6776
|
-
const { QueueProcessor } = await import("./processor-
|
|
6854
|
+
const { QueueProcessor } = await import("./processor-BCOSEMZK.js");
|
|
6777
6855
|
const queueProcessor = new QueueProcessor({
|
|
6778
6856
|
sessionManager,
|
|
6779
6857
|
providerManager,
|
|
@@ -6815,7 +6893,7 @@ async function createServerHandle(config3) {
|
|
|
6815
6893
|
void (async () => {
|
|
6816
6894
|
await devServerManager.stopAll();
|
|
6817
6895
|
await mcpManager.disconnectAll();
|
|
6818
|
-
const { stopAllInspectProxies } = await import("./inspect-proxy-
|
|
6896
|
+
const { stopAllInspectProxies } = await import("./inspect-proxy-JHZV34QR.js");
|
|
6819
6897
|
stopAllInspectProxies();
|
|
6820
6898
|
const { cleanupAllProcesses } = await import("./store-SARB6V2N.js");
|
|
6821
6899
|
cleanupAllProcesses();
|
|
@@ -6853,4 +6931,4 @@ export {
|
|
|
6853
6931
|
createServerHandle,
|
|
6854
6932
|
createServer
|
|
6855
6933
|
};
|
|
6856
|
-
//# sourceMappingURL=chunk-
|
|
6934
|
+
//# sourceMappingURL=chunk-BX3VJP2D.js.map
|