openfox 2.0.89 → 2.0.91
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/CHANGELOG.md +25 -0
- package/dist/CHANGELOG.md +25 -0
- package/dist/{chat-handler-NOTXEOLF.js → chat-handler-PC5BUJGA.js} +26 -22
- package/dist/chunk-3NGD6IVM.js +65 -0
- package/dist/{chunk-E5D7V7XC.js → chunk-4IBFA5IF.js} +8 -8
- package/dist/{chunk-VFMHWU3E.js → chunk-54Q4TGG6.js} +7 -3
- package/dist/{chunk-TAHZHEJ4.js → chunk-6J5IZ2NL.js} +10 -3
- package/dist/{chunk-EZWSS7LG.js → chunk-6OAJNCRY.js} +9 -1
- package/dist/{chunk-SYU5GNPN.js → chunk-7YBGCZSI.js} +2 -2
- package/dist/{chunk-AGYP7AUV.js → chunk-AXFPEGJI.js} +2 -2
- package/dist/{chunk-67AVIA5G.js → chunk-BJHPUMRX.js} +2 -2
- package/dist/{chunk-Q4OPCXV4.js → chunk-C56Z4OVW.js} +2 -2
- package/dist/{chunk-U7RLUZBP.js → chunk-CFK34T26.js} +1 -1
- package/dist/{chunk-47WNBFDO.js → chunk-CND2YWIJ.js} +2 -2
- package/dist/{chunk-J2IVK667.js → chunk-DH32AHTL.js} +2 -2
- package/dist/{chunk-7JC5YWST.js → chunk-DVVRKNFS.js} +62 -475
- package/dist/chunk-FSLCOA4R.js +144 -0
- package/dist/{chunk-NTYWC6PD.js → chunk-GH5PL3JW.js} +3 -3
- package/dist/chunk-GPODFKPQ.js +7 -0
- package/dist/{chunk-5OGOPB3I.js → chunk-JJY5O2WH.js} +236 -146
- package/dist/{chunk-J7R25K6N.js → chunk-JX6WL56A.js} +7 -7
- package/dist/{chunk-NGIOAASU.js → chunk-K2O7JTCX.js} +1 -243
- package/dist/{chunk-RNXMN5QY.js → chunk-LT4MPTGU.js} +4 -4
- package/dist/{chunk-7TFKWFY3.js → chunk-NGN3Q26A.js} +88 -72
- package/dist/chunk-NLJXZZTB.js +246 -0
- package/dist/{chunk-OVSB5SFF.js → chunk-NO65CC2R.js} +82 -32
- package/dist/{chunk-N54PQSCH.js → chunk-OQTLFO4R.js} +3 -2
- package/dist/{chunk-U2ECZUAX.js → chunk-Q7CN4JOO.js} +22 -75
- package/dist/{chunk-Q6AKRIM2.js → chunk-ST4NYXLH.js} +9 -2
- package/dist/chunk-SXHGRPCI.js +443 -0
- package/dist/{chunk-2GQ7X2NP.js → chunk-U7D72C4O.js} +4 -4
- package/dist/{chunk-4S76VMPH.js → chunk-VJEVCZZA.js} +6 -4
- package/dist/{chunk-VPFUXGMM.js → chunk-VKWVPQJ5.js} +3 -1
- package/dist/{chunk-3QHXJ3DJ.js → chunk-WPACSSBS.js} +3 -3
- package/dist/{chunk-ANYBIATF.js → chunk-WWC3R3YL.js} +2 -2
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{client-2KVPLIV4.js → client-RBXMHFX3.js} +5 -5
- package/dist/{compactor-W2CUKE22.js → compactor-HW6GBRAG.js} +11 -10
- package/dist/{config-JN6MW5SL.js → config-XIYAPMX3.js} +2 -2
- package/dist/dynamic-context-TDD3Q43F.js +27 -0
- package/dist/{events-OD7MN3FL.js → events-ICX5KVET.js} +7 -7
- package/dist/{folding-TDDQ5CXT.js → folding-L2L4OHX6.js} +5 -5
- package/dist/http-client-E3CV6E5D.js +11 -0
- package/dist/{inspect-proxy-CN2MUFQ5.js → inspect-proxy-NZ3VSMSC.js} +4 -4
- package/dist/{manager-6UIC3QKJ.js → manager-ZPQ6VSM5.js} +5 -5
- package/dist/orchestrator-56LSHPPK.js +55 -0
- package/dist/package.json +1 -1
- package/dist/{path-security-M2JDUBKK.js → path-security-XENIR7SX.js} +10 -10
- package/dist/{platform-55N6FRRU.js → platform-UKZ2QC34.js} +4 -4
- package/dist/{processor-FE4ZJ7GS.js → processor-H6NFFRI2.js} +25 -22
- package/dist/{project-creator-W5VW22DC.js → project-creator-2WMZYQME.js} +3 -3
- package/dist/{projects-HZ3WVTKG.js → projects-N6KVZGMS.js} +3 -3
- package/dist/{protocol-BUA2W2KM.js → protocol-3GNSIGP4.js} +3 -3
- package/dist/{protocol-DKJPL2Ci.d.ts → protocol-CaSHnORC.d.ts} +15 -4
- package/dist/provider/index.d.ts +4 -4
- package/dist/{provider-I2P3NYUI.js → provider-SYYZI2KX.js} +8 -8
- package/dist/{provider-manager-OLDOHCR2.js → provider-manager-P3ZSA5QS.js} +6 -6
- package/dist/registry-ERUV33AP.js +46 -0
- package/dist/{serve-UMPDBCVG.js → serve-KNVANLAK.js} +32 -28
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +31 -27
- package/dist/server-H3525HD6.js +45 -0
- package/dist/session-overrides-NPVYNHTM.js +20 -0
- package/dist/{sessions-Q6SYLG6U.js → sessions-7KCM5QH4.js} +7 -5
- package/dist/{settings-PFZWX6VY.js → settings-2OVKFWR5.js} +3 -3
- package/dist/shared/index.d.ts +3 -3
- package/dist/shared/index.js +1 -1
- package/dist/{tools-NLKP65HF.js → tools-DXBIHSMY.js} +23 -20
- package/dist/{types-C4NrLRR1.d.ts → types-CHCZiJvw.d.ts} +4 -0
- package/dist/{types-B97Fb4vm.d.ts → types-Cw7L4Bze.d.ts} +1 -1
- package/dist/{update-BHTE5TMY.js → update-4BGMFSEG.js} +2 -2
- package/dist/{update-server-V6GJ43WH.js → update-server-4I6LXE5K.js} +2 -2
- package/dist/web/assets/index-Chu9JX0M.js +316 -0
- package/dist/web/assets/index-mS37wyUs.css +32 -0
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/dist/{workspace-N4QHV6J2.js → workspace-YLTMP3OX.js} +4 -4
- package/package.json +1 -1
- package/dist/chunk-TH4JF6XP.js +0 -7
- package/dist/http-client-IPJGJXNJ.js +0 -11
- package/dist/orchestrator-NQDWCULY.js +0 -51
- package/dist/server-4PB7BNE6.js +0 -41
- package/dist/web/assets/index-BQfVUhSC.css +0 -32
- package/dist/web/assets/index-C5sTYb--.js +0 -306
|
@@ -21,33 +21,16 @@ import {
|
|
|
21
21
|
tokenFromPassword,
|
|
22
22
|
verifyPassword,
|
|
23
23
|
workflowExists
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-NO65CC2R.js";
|
|
25
25
|
import {
|
|
26
26
|
createToolRegistry,
|
|
27
|
-
deleteOwnedSkill,
|
|
28
|
-
deleteProjectSkill,
|
|
29
|
-
deleteSkill,
|
|
30
27
|
devServerManager,
|
|
31
|
-
findSkillById,
|
|
32
|
-
getDefaultSkillIds,
|
|
33
|
-
isDefaultSkill,
|
|
34
|
-
isSkillEnabled,
|
|
35
|
-
loadAllSkills,
|
|
36
|
-
loadAllSkillsWithDiagnostics,
|
|
37
|
-
loadDefaultSkills,
|
|
38
|
-
loadProjectSkills,
|
|
39
|
-
loadUserSkills,
|
|
40
|
-
saveSkill,
|
|
41
|
-
saveSkillToProject,
|
|
42
28
|
setMcpConfigMode,
|
|
43
29
|
setMcpConfigPath,
|
|
44
30
|
setMcpManagerForTools,
|
|
45
31
|
setMcpTools,
|
|
46
|
-
setNotifyMcpServersChanged
|
|
47
|
-
|
|
48
|
-
skillExists,
|
|
49
|
-
updateOwnedSkill
|
|
50
|
-
} from "./chunk-7JC5YWST.js";
|
|
32
|
+
setNotifyMcpServersChanged
|
|
33
|
+
} from "./chunk-DVVRKNFS.js";
|
|
51
34
|
import {
|
|
52
35
|
createMcpTools
|
|
53
36
|
} from "./chunk-NWO6GRYE.js";
|
|
@@ -65,30 +48,46 @@ import {
|
|
|
65
48
|
validateRef,
|
|
66
49
|
validateWorkspaceName,
|
|
67
50
|
workspaceExists
|
|
68
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-BJHPUMRX.js";
|
|
52
|
+
import {
|
|
53
|
+
deleteOwnedSkill,
|
|
54
|
+
deleteProjectSkill,
|
|
55
|
+
deleteSkill,
|
|
56
|
+
findSkillById,
|
|
57
|
+
getDefaultSkillIds,
|
|
58
|
+
isDefaultSkill,
|
|
59
|
+
isSkillEnabled,
|
|
60
|
+
loadAllSkills,
|
|
61
|
+
loadAllSkillsWithDiagnostics,
|
|
62
|
+
loadDefaultSkills,
|
|
63
|
+
loadProjectSkills,
|
|
64
|
+
loadUserSkills,
|
|
65
|
+
saveSkill,
|
|
66
|
+
saveSkillToProject,
|
|
67
|
+
setSkillEnabled,
|
|
68
|
+
skillExists,
|
|
69
|
+
updateOwnedSkill
|
|
70
|
+
} from "./chunk-SXHGRPCI.js";
|
|
71
|
+
import {
|
|
72
|
+
getSessionDisabledServers,
|
|
73
|
+
setSessionDisabledServers
|
|
74
|
+
} from "./chunk-3NGD6IVM.js";
|
|
69
75
|
import {
|
|
70
76
|
createContextStateMessage
|
|
71
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-CND2YWIJ.js";
|
|
72
78
|
import {
|
|
73
79
|
EventEmitter
|
|
74
80
|
} from "./chunk-EU3WWTFH.js";
|
|
75
|
-
import {
|
|
76
|
-
ALWAYS_ALLOWED,
|
|
77
|
-
ALWAYS_ALLOWED_FOR_SUBAGENTS,
|
|
78
|
-
TOP_LEVEL_ONLY_TOOLS
|
|
79
|
-
} from "./chunk-NGIOAASU.js";
|
|
80
|
-
import {
|
|
81
|
-
getPathSeparator,
|
|
82
|
-
isAbsolutePath
|
|
83
|
-
} from "./chunk-ANYBIATF.js";
|
|
84
81
|
import {
|
|
85
82
|
getProject,
|
|
86
83
|
getProjectByWorkdir,
|
|
87
84
|
updateProject
|
|
88
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-ST4NYXLH.js";
|
|
89
86
|
import {
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
ALWAYS_ALLOWED,
|
|
88
|
+
ALWAYS_ALLOWED_FOR_SUBAGENTS,
|
|
89
|
+
TOP_LEVEL_ONLY_TOOLS
|
|
90
|
+
} from "./chunk-NLJXZZTB.js";
|
|
92
91
|
import {
|
|
93
92
|
emitAssistantMessageStart,
|
|
94
93
|
emitContextState,
|
|
@@ -104,7 +103,14 @@ import {
|
|
|
104
103
|
getEventStore,
|
|
105
104
|
getSessionState,
|
|
106
105
|
initEventStore
|
|
107
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-LT4MPTGU.js";
|
|
107
|
+
import {
|
|
108
|
+
getPathSeparator,
|
|
109
|
+
isAbsolutePath
|
|
110
|
+
} from "./chunk-WWC3R3YL.js";
|
|
111
|
+
import {
|
|
112
|
+
VERSION
|
|
113
|
+
} from "./chunk-GPODFKPQ.js";
|
|
108
114
|
import {
|
|
109
115
|
createSession,
|
|
110
116
|
deleteSession,
|
|
@@ -120,7 +126,7 @@ import {
|
|
|
120
126
|
updateSessionProvider,
|
|
121
127
|
updateSessionRunning,
|
|
122
128
|
updateSessionWorkdir
|
|
123
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-6J5IZ2NL.js";
|
|
124
130
|
import {
|
|
125
131
|
agentExists,
|
|
126
132
|
deleteAgent,
|
|
@@ -142,13 +148,13 @@ import {
|
|
|
142
148
|
saveAgentToProject,
|
|
143
149
|
saveItemToDir,
|
|
144
150
|
setRuntimeConfig
|
|
145
|
-
} from "./chunk-
|
|
151
|
+
} from "./chunk-NGN3Q26A.js";
|
|
146
152
|
import {
|
|
147
153
|
createProviderManager,
|
|
148
154
|
detectModel,
|
|
149
155
|
getLlmStatus,
|
|
150
156
|
parseDefaultModelSelection
|
|
151
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-GH5PL3JW.js";
|
|
152
158
|
import {
|
|
153
159
|
getModelProfile
|
|
154
160
|
} from "./chunk-V4IE7HJY.js";
|
|
@@ -162,22 +168,22 @@ import {
|
|
|
162
168
|
SessionNotFoundError,
|
|
163
169
|
WorkspaceInUseError,
|
|
164
170
|
proxyFetch
|
|
165
|
-
} from "./chunk-
|
|
171
|
+
} from "./chunk-7YBGCZSI.js";
|
|
166
172
|
import {
|
|
167
173
|
deleteSetting,
|
|
168
174
|
getSetting,
|
|
169
175
|
setSetting
|
|
170
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-54Q4TGG6.js";
|
|
171
177
|
import {
|
|
172
178
|
initDatabase
|
|
173
|
-
} from "./chunk-
|
|
179
|
+
} from "./chunk-6OAJNCRY.js";
|
|
174
180
|
import {
|
|
175
181
|
logger,
|
|
176
182
|
setLogLevel
|
|
177
183
|
} from "./chunk-K44MW7JJ.js";
|
|
178
184
|
import {
|
|
179
185
|
createServerMessage
|
|
180
|
-
} from "./chunk-
|
|
186
|
+
} from "./chunk-CFK34T26.js";
|
|
181
187
|
import {
|
|
182
188
|
getGlobalConfigDir
|
|
183
189
|
} from "./chunk-CQGTEGKL.js";
|
|
@@ -1595,13 +1601,22 @@ var McpManager = class {
|
|
|
1595
1601
|
return this.servers.get(name)?.state;
|
|
1596
1602
|
}
|
|
1597
1603
|
getAllServers() {
|
|
1598
|
-
return Array.from(this.servers.values()).map((e) => e.state);
|
|
1604
|
+
return Array.from(this.servers.values()).map((e) => e.state).sort((a, b) => a.name.localeCompare(b.name));
|
|
1599
1605
|
}
|
|
1600
|
-
|
|
1601
|
-
const defs = [];
|
|
1606
|
+
*iterEnabledServers(override) {
|
|
1602
1607
|
for (const [, entry] of this.servers) {
|
|
1608
|
+
if (override?.disabledServers?.includes(entry.state.name)) continue;
|
|
1609
|
+
const serverDisabled = entry.config.disabled && (!override?.disabledServers || !override.disabledServers.includes(entry.state.name));
|
|
1610
|
+
if (serverDisabled) continue;
|
|
1611
|
+
yield entry;
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
getToolDefinitions(override) {
|
|
1615
|
+
const defs = [];
|
|
1616
|
+
for (const entry of this.iterEnabledServers(override)) {
|
|
1603
1617
|
for (const tool of entry.state.tools) {
|
|
1604
1618
|
if (!tool.enabled) continue;
|
|
1619
|
+
if (override?.disabledTools?.includes(tool.name)) continue;
|
|
1605
1620
|
defs.push({
|
|
1606
1621
|
type: "function",
|
|
1607
1622
|
function: {
|
|
@@ -1656,9 +1671,9 @@ var McpManager = class {
|
|
|
1656
1671
|
entry.state.estimatedTokens = entry.state.tools.filter((t) => t.enabled).reduce((sum, t) => sum + t.estimatedTokens, 0);
|
|
1657
1672
|
this.onServersChanged?.();
|
|
1658
1673
|
}
|
|
1659
|
-
getToolFingerprint() {
|
|
1674
|
+
getToolFingerprint(override) {
|
|
1660
1675
|
const parts = [];
|
|
1661
|
-
for (const
|
|
1676
|
+
for (const entry of this.iterEnabledServers(override)) {
|
|
1662
1677
|
for (const tool of entry.state.tools) {
|
|
1663
1678
|
if (tool.enabled) {
|
|
1664
1679
|
parts.push(`${entry.state.name}:${tool.name}`);
|
|
@@ -4438,7 +4453,7 @@ async function findOrphanedWorkspaces(dir) {
|
|
|
4438
4453
|
}
|
|
4439
4454
|
return results;
|
|
4440
4455
|
}
|
|
4441
|
-
function createWorkspaceConfigRoutes() {
|
|
4456
|
+
function createWorkspaceConfigRoutes(sessionManager) {
|
|
4442
4457
|
const router = Router5();
|
|
4443
4458
|
router.get("/config", async (req, res) => {
|
|
4444
4459
|
const workdir = req.query["workdir"];
|
|
@@ -4446,20 +4461,25 @@ function createWorkspaceConfigRoutes() {
|
|
|
4446
4461
|
const config3 = await loadWorkspaceConfig(workdir);
|
|
4447
4462
|
const project = getProjectByWorkdir(workdir);
|
|
4448
4463
|
const rootDir = project?.workspaceRootDir ?? void 0;
|
|
4449
|
-
|
|
4450
|
-
res.json({ config:
|
|
4464
|
+
const mcpOverrides = project?.mcpOverrides ?? void 0;
|
|
4465
|
+
if (!config3 && !rootDir && !mcpOverrides) return res.json({ config: null });
|
|
4466
|
+
res.json({ config: { ...config3, rootDir, mcpOverrides } });
|
|
4451
4467
|
});
|
|
4452
4468
|
router.post("/config", async (req, res) => {
|
|
4453
4469
|
const workdir = req.query["workdir"];
|
|
4454
4470
|
if (!workdir) return res.status(400).json({ error: "workdir required" });
|
|
4455
|
-
const { setup, rootDir } = req.body;
|
|
4456
|
-
if (!Array.isArray(setup) && typeof rootDir !== "string") {
|
|
4457
|
-
return res.status(400).json({ error: "At least one of setup or
|
|
4471
|
+
const { setup, rootDir, mcpOverrides } = req.body;
|
|
4472
|
+
if (!Array.isArray(setup) && typeof rootDir !== "string" && mcpOverrides === void 0) {
|
|
4473
|
+
return res.status(400).json({ error: "At least one of setup, rootDir, or mcpOverrides must be provided" });
|
|
4458
4474
|
}
|
|
4459
4475
|
if (setup !== void 0 && !Array.isArray(setup)) {
|
|
4460
4476
|
return res.status(400).json({ error: "setup must be an array of strings" });
|
|
4461
4477
|
}
|
|
4462
|
-
|
|
4478
|
+
if (mcpOverrides !== void 0 && (typeof mcpOverrides !== "object" || mcpOverrides === null || Array.isArray(mcpOverrides))) {
|
|
4479
|
+
return res.status(400).json({ error: "mcpOverrides must be an object mapping server names to overrides" });
|
|
4480
|
+
}
|
|
4481
|
+
const existing = await loadWorkspaceConfig(workdir);
|
|
4482
|
+
const config3 = { ...existing };
|
|
4463
4483
|
if (Array.isArray(setup)) {
|
|
4464
4484
|
config3.setup = setup;
|
|
4465
4485
|
}
|
|
@@ -4494,6 +4514,22 @@ function createWorkspaceConfigRoutes() {
|
|
|
4494
4514
|
updateProject(project.id, { workspaceRootDir: savedRootDir });
|
|
4495
4515
|
}
|
|
4496
4516
|
}
|
|
4517
|
+
if (mcpOverrides !== void 0) {
|
|
4518
|
+
const project = getProjectByWorkdir(workdir);
|
|
4519
|
+
if (project) {
|
|
4520
|
+
updateProject(project.id, {
|
|
4521
|
+
mcpOverrides: Object.keys(mcpOverrides).length > 0 ? mcpOverrides : null
|
|
4522
|
+
});
|
|
4523
|
+
const disabledServers = Object.entries(mcpOverrides).filter(([, override]) => override.disabled).map(([name]) => name);
|
|
4524
|
+
const allSessions = sessionManager.listSessions();
|
|
4525
|
+
for (const s of allSessions) {
|
|
4526
|
+
if (s.projectId === project.id) {
|
|
4527
|
+
setSessionDisabledServers(s.id, disabledServers);
|
|
4528
|
+
sessionManager.setDynamicContextChanged(s.id, true);
|
|
4529
|
+
}
|
|
4530
|
+
}
|
|
4531
|
+
}
|
|
4532
|
+
}
|
|
4497
4533
|
res.json({ config: { ...config3, rootDir: savedRootDir ?? void 0 } });
|
|
4498
4534
|
} catch (err) {
|
|
4499
4535
|
res.status(500).json({ error: err instanceof Error ? err.message : "Failed to save config" });
|
|
@@ -4971,7 +5007,7 @@ function createProviderAuthRoutes(config3, providerManager, registry) {
|
|
|
4971
5007
|
try {
|
|
4972
5008
|
const { challenge, completion } = await adapter.beginLogin({ providerId: provider.id });
|
|
4973
5009
|
void completion.then(async ({ credentialRef }) => {
|
|
4974
|
-
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-
|
|
5010
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-XIYAPMX3.js");
|
|
4975
5011
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
4976
5012
|
const updatedConfig = updateProvider(globalConfig, provider.id, { credentialRef, authAdapter: adapter.id });
|
|
4977
5013
|
await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
|
|
@@ -5005,7 +5041,7 @@ function createProviderAuthRoutes(config3, providerManager, registry) {
|
|
|
5005
5041
|
if (!context) return;
|
|
5006
5042
|
const { provider, adapter } = context;
|
|
5007
5043
|
if (provider.credentialRef && adapter) await adapter.logout(provider.credentialRef);
|
|
5008
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
5044
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-XIYAPMX3.js");
|
|
5009
5045
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
5010
5046
|
const updatedConfig = {
|
|
5011
5047
|
...globalConfig,
|
|
@@ -5485,7 +5521,7 @@ async function createServerHandle(config3) {
|
|
|
5485
5521
|
const mcpManager = new McpManager({
|
|
5486
5522
|
onToolsDiscovered: async (name, tools) => {
|
|
5487
5523
|
try {
|
|
5488
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
5524
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-XIYAPMX3.js");
|
|
5489
5525
|
const mode = config3.mode ?? "production";
|
|
5490
5526
|
const globalConfig = await loadGlobalConfig(mode, config3.globalConfigPath);
|
|
5491
5527
|
const mcpServers2 = {
|
|
@@ -5516,7 +5552,7 @@ async function createServerHandle(config3) {
|
|
|
5516
5552
|
setMcpTools(mcpTools);
|
|
5517
5553
|
logger.info("MCP tools registered", { count: mcpTools.length });
|
|
5518
5554
|
}
|
|
5519
|
-
const { signalMcpReady } = await import("./server-
|
|
5555
|
+
const { signalMcpReady } = await import("./server-H3525HD6.js");
|
|
5520
5556
|
signalMcpReady();
|
|
5521
5557
|
});
|
|
5522
5558
|
const app = express();
|
|
@@ -5594,7 +5630,7 @@ async function createServerHandle(config3) {
|
|
|
5594
5630
|
res.json({ tools });
|
|
5595
5631
|
});
|
|
5596
5632
|
app.get("/api/projects", async (_req, res) => {
|
|
5597
|
-
const { listProjects } = await import("./projects-
|
|
5633
|
+
const { listProjects } = await import("./projects-N6KVZGMS.js");
|
|
5598
5634
|
const projects = listProjects();
|
|
5599
5635
|
res.json({ projects });
|
|
5600
5636
|
});
|
|
@@ -5603,7 +5639,7 @@ async function createServerHandle(config3) {
|
|
|
5603
5639
|
if (!name || !workdir) {
|
|
5604
5640
|
return res.status(400).json({ error: "name and workdir are required" });
|
|
5605
5641
|
}
|
|
5606
|
-
const { createDirectoryWithGit } = await import("./project-creator-
|
|
5642
|
+
const { createDirectoryWithGit } = await import("./project-creator-2WMZYQME.js");
|
|
5607
5643
|
try {
|
|
5608
5644
|
const project = await createDirectoryWithGit(name, workdir);
|
|
5609
5645
|
res.status(201).json({ project });
|
|
@@ -5648,7 +5684,7 @@ async function createServerHandle(config3) {
|
|
|
5648
5684
|
}
|
|
5649
5685
|
});
|
|
5650
5686
|
app.get("/api/projects/:id", async (req, res) => {
|
|
5651
|
-
const { getProject: getProject2 } = await import("./projects-
|
|
5687
|
+
const { getProject: getProject2 } = await import("./projects-N6KVZGMS.js");
|
|
5652
5688
|
const project = getProject2(req.params.id);
|
|
5653
5689
|
if (!project) {
|
|
5654
5690
|
return res.status(404).json({ error: "Project not found" });
|
|
@@ -5656,7 +5692,7 @@ async function createServerHandle(config3) {
|
|
|
5656
5692
|
res.json({ project });
|
|
5657
5693
|
});
|
|
5658
5694
|
app.put("/api/projects/:id", async (req, res) => {
|
|
5659
|
-
const { updateProject: updateProject2 } = await import("./projects-
|
|
5695
|
+
const { updateProject: updateProject2 } = await import("./projects-N6KVZGMS.js");
|
|
5660
5696
|
const { name, customInstructions, dangerLevel } = req.body;
|
|
5661
5697
|
const updates = {};
|
|
5662
5698
|
if (name !== void 0) updates.name = name;
|
|
@@ -5669,7 +5705,7 @@ async function createServerHandle(config3) {
|
|
|
5669
5705
|
res.json({ project: updated });
|
|
5670
5706
|
});
|
|
5671
5707
|
app.delete("/api/projects/:id", async (req, res) => {
|
|
5672
|
-
const { getProject: getProject2, deleteProject } = await import("./projects-
|
|
5708
|
+
const { getProject: getProject2, deleteProject } = await import("./projects-N6KVZGMS.js");
|
|
5673
5709
|
const project = getProject2(req.params.id);
|
|
5674
5710
|
if (!project) {
|
|
5675
5711
|
return res.status(404).json({ error: "Project not found" });
|
|
@@ -5678,7 +5714,7 @@ async function createServerHandle(config3) {
|
|
|
5678
5714
|
res.json({ success: true });
|
|
5679
5715
|
});
|
|
5680
5716
|
app.put("/api/projects/:id/star", async (req, res) => {
|
|
5681
|
-
const { toggleStar } = await import("./projects-
|
|
5717
|
+
const { toggleStar } = await import("./projects-N6KVZGMS.js");
|
|
5682
5718
|
const { isStarred } = req.body;
|
|
5683
5719
|
if (typeof isStarred !== "boolean") {
|
|
5684
5720
|
return res.status(400).json({ error: "isStarred is required and must be a boolean" });
|
|
@@ -5690,26 +5726,26 @@ async function createServerHandle(config3) {
|
|
|
5690
5726
|
res.json({ project });
|
|
5691
5727
|
});
|
|
5692
5728
|
app.get("/api/projects/:id/branches", async (req, res) => {
|
|
5693
|
-
const { getProject: getProject2 } = await import("./projects-
|
|
5729
|
+
const { getProject: getProject2 } = await import("./projects-N6KVZGMS.js");
|
|
5694
5730
|
const project = getProject2(req.params.id);
|
|
5695
5731
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5696
|
-
const { listBranches } = await import("./workspace-
|
|
5732
|
+
const { listBranches } = await import("./workspace-YLTMP3OX.js");
|
|
5697
5733
|
const branches = await listBranches(project.workdir);
|
|
5698
5734
|
res.json({ branches });
|
|
5699
5735
|
});
|
|
5700
5736
|
app.post("/api/projects/:id/checkout", async (req, res) => {
|
|
5701
|
-
const { getProject: getProject2 } = await import("./projects-
|
|
5737
|
+
const { getProject: getProject2 } = await import("./projects-N6KVZGMS.js");
|
|
5702
5738
|
const project = getProject2(req.params.id);
|
|
5703
5739
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5704
5740
|
const { branch } = req.body;
|
|
5705
5741
|
if (!branch || typeof branch !== "string") return res.status(400).json({ error: "branch is required" });
|
|
5706
|
-
const { checkoutBranch, isGitRepository } = await import("./workspace-
|
|
5742
|
+
const { checkoutBranch, isGitRepository } = await import("./workspace-YLTMP3OX.js");
|
|
5707
5743
|
if (!await isGitRepository(project.workdir)) {
|
|
5708
5744
|
return res.status(400).json({ error: "Project is not a git repository" });
|
|
5709
5745
|
}
|
|
5710
5746
|
try {
|
|
5711
5747
|
await checkoutBranch(project.workdir, branch);
|
|
5712
|
-
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-
|
|
5748
|
+
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-7KCM5QH4.js");
|
|
5713
5749
|
const allSessions = sessionManager.listSessions();
|
|
5714
5750
|
for (const s of allSessions) {
|
|
5715
5751
|
if (sessionManager.getEffectiveWorkdir(s.id) === project.workdir) {
|
|
@@ -5723,12 +5759,12 @@ async function createServerHandle(config3) {
|
|
|
5723
5759
|
}
|
|
5724
5760
|
});
|
|
5725
5761
|
app.post("/api/projects/:id/checkout-new", async (req, res) => {
|
|
5726
|
-
const { getProject: getProject2 } = await import("./projects-
|
|
5762
|
+
const { getProject: getProject2 } = await import("./projects-N6KVZGMS.js");
|
|
5727
5763
|
const project = getProject2(req.params.id);
|
|
5728
5764
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5729
5765
|
const { name, sourceBranch } = req.body;
|
|
5730
5766
|
if (!name || typeof name !== "string") return res.status(400).json({ error: "name is required" });
|
|
5731
|
-
const { createBranch, resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, validateRef: validateRef2, getDefaultBranch, isGitRepository } = await import("./workspace-
|
|
5767
|
+
const { createBranch, resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, validateRef: validateRef2, getDefaultBranch, isGitRepository } = await import("./workspace-YLTMP3OX.js");
|
|
5732
5768
|
if (!await isGitRepository(project.workdir)) {
|
|
5733
5769
|
return res.status(400).json({ error: "Project is not a git repository" });
|
|
5734
5770
|
}
|
|
@@ -5745,7 +5781,7 @@ async function createServerHandle(config3) {
|
|
|
5745
5781
|
);
|
|
5746
5782
|
}
|
|
5747
5783
|
await createBranch(project.workdir, name, sb);
|
|
5748
|
-
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-
|
|
5784
|
+
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-7KCM5QH4.js");
|
|
5749
5785
|
const allSessions = sessionManager.listSessions();
|
|
5750
5786
|
for (const s of allSessions) {
|
|
5751
5787
|
if (sessionManager.getEffectiveWorkdir(s.id) === project.workdir) {
|
|
@@ -5762,7 +5798,7 @@ async function createServerHandle(config3) {
|
|
|
5762
5798
|
const session = sessionManager.getSession(req.params.id);
|
|
5763
5799
|
if (!session) return res.status(404).json({ error: "Session not found" });
|
|
5764
5800
|
const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
|
|
5765
|
-
const { listBranches, getDefaultBranch } = await import("./workspace-
|
|
5801
|
+
const { listBranches, getDefaultBranch } = await import("./workspace-YLTMP3OX.js");
|
|
5766
5802
|
const [branches, defaultBranch] = await Promise.all([
|
|
5767
5803
|
listBranches(effectiveWorkdir),
|
|
5768
5804
|
getDefaultBranch(session.workdir)
|
|
@@ -5776,8 +5812,8 @@ async function createServerHandle(config3) {
|
|
|
5776
5812
|
const { branch } = req.body;
|
|
5777
5813
|
if (!branch || typeof branch !== "string") return res.status(400).json({ error: "branch is required" });
|
|
5778
5814
|
const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
|
|
5779
|
-
const { checkoutBranch, validateRef: validateRef2 } = await import("./workspace-
|
|
5780
|
-
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-
|
|
5815
|
+
const { checkoutBranch, validateRef: validateRef2 } = await import("./workspace-YLTMP3OX.js");
|
|
5816
|
+
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-7KCM5QH4.js");
|
|
5781
5817
|
try {
|
|
5782
5818
|
await validateRef2(effectiveWorkdir, branch);
|
|
5783
5819
|
await checkoutBranch(effectiveWorkdir, branch);
|
|
@@ -5819,16 +5855,16 @@ All file and git operations should use this branch.
|
|
|
5819
5855
|
const { name, sourceBranch } = req.body;
|
|
5820
5856
|
if (!name || typeof name !== "string") return res.status(400).json({ error: "name is required" });
|
|
5821
5857
|
const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
|
|
5822
|
-
const { validateRef: validateRef2 } = await import("./workspace-
|
|
5823
|
-
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-
|
|
5858
|
+
const { validateRef: validateRef2 } = await import("./workspace-YLTMP3OX.js");
|
|
5859
|
+
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-7KCM5QH4.js");
|
|
5824
5860
|
try {
|
|
5825
5861
|
await validateRef2(effectiveWorkdir, name);
|
|
5826
5862
|
if (sourceBranch) {
|
|
5827
|
-
const { resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, createBranch } = await import("./workspace-
|
|
5863
|
+
const { resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, createBranch } = await import("./workspace-YLTMP3OX.js");
|
|
5828
5864
|
const sb = await resolveAndValidateSourceBranch2(effectiveWorkdir, sourceBranch, session.workdir);
|
|
5829
5865
|
await createBranch(effectiveWorkdir, name, sb);
|
|
5830
5866
|
} else {
|
|
5831
|
-
const { createBranch, getDefaultBranch, resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2 } = await import("./workspace-
|
|
5867
|
+
const { createBranch, getDefaultBranch, resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2 } = await import("./workspace-YLTMP3OX.js");
|
|
5832
5868
|
const defaultBranch = await getDefaultBranch(session.workdir);
|
|
5833
5869
|
const sb = await resolveAndValidateSourceBranch2(effectiveWorkdir, defaultBranch, session.workdir);
|
|
5834
5870
|
await createBranch(effectiveWorkdir, name, sb);
|
|
@@ -5866,17 +5902,17 @@ All file and git operations should use this branch.
|
|
|
5866
5902
|
}
|
|
5867
5903
|
});
|
|
5868
5904
|
app.get("/api/projects/:id/workspaces", async (req, res) => {
|
|
5869
|
-
const { getProject: getProject2 } = await import("./projects-
|
|
5905
|
+
const { getProject: getProject2 } = await import("./projects-N6KVZGMS.js");
|
|
5870
5906
|
const project = getProject2(req.params.id);
|
|
5871
5907
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5872
|
-
const { listWorkspaces } = await import("./workspace-
|
|
5908
|
+
const { listWorkspaces } = await import("./workspace-YLTMP3OX.js");
|
|
5873
5909
|
const all = await listWorkspaces(project.name, project.workdir);
|
|
5874
5910
|
const workspacesList = all.filter((ws) => ws.path !== project.workdir);
|
|
5875
5911
|
res.json({ workspaces: workspacesList });
|
|
5876
5912
|
});
|
|
5877
5913
|
app.get("/api/sessions", async (req, res) => {
|
|
5878
|
-
const { getRecentUserPromptsForSession } = await import("./events-
|
|
5879
|
-
const { getPendingConfirmationsBySession } = await import("./path-security-
|
|
5914
|
+
const { getRecentUserPromptsForSession } = await import("./events-ICX5KVET.js");
|
|
5915
|
+
const { getPendingConfirmationsBySession } = await import("./path-security-XENIR7SX.js");
|
|
5880
5916
|
const projectId = req.query["projectId"];
|
|
5881
5917
|
const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
|
|
5882
5918
|
const offset = parseInt(req.query["offset"]) || 0;
|
|
@@ -5914,6 +5950,19 @@ All file and git operations should use this branch.
|
|
|
5914
5950
|
}
|
|
5915
5951
|
const { providerId, model } = parseDefaultModelSelection(config3.defaultModelSelection);
|
|
5916
5952
|
const session = sessionManager.createSession(projectId, title, providerId ?? null, model ?? null);
|
|
5953
|
+
try {
|
|
5954
|
+
let disabledServers = [];
|
|
5955
|
+
if (project.mcpOverrides) {
|
|
5956
|
+
disabledServers = Object.entries(project.mcpOverrides).filter(([, override]) => override.disabled).map(([name]) => name);
|
|
5957
|
+
} else {
|
|
5958
|
+
disabledServers = mcpManager.getAllServers().filter((s) => s.config.disabled).map((s) => s.name);
|
|
5959
|
+
}
|
|
5960
|
+
if (disabledServers.length > 0) {
|
|
5961
|
+
const { setSessionDisabledServers: setSessionDisabledServers2 } = await import("./session-overrides-NPVYNHTM.js");
|
|
5962
|
+
setSessionDisabledServers2(session.id, disabledServers);
|
|
5963
|
+
}
|
|
5964
|
+
} catch {
|
|
5965
|
+
}
|
|
5917
5966
|
wssExports.broadcastForProject(projectId, session.id, {
|
|
5918
5967
|
type: "session.created",
|
|
5919
5968
|
sessionId: session.id,
|
|
@@ -5946,7 +5995,7 @@ All file and git operations should use this branch.
|
|
|
5946
5995
|
if (!target || typeof target !== "string") return res.status(400).json({ error: "target is required" });
|
|
5947
5996
|
const project = sessionManager.getProject(session.projectId);
|
|
5948
5997
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5949
|
-
const { isGitRepository } = await import("./workspace-
|
|
5998
|
+
const { isGitRepository } = await import("./workspace-YLTMP3OX.js");
|
|
5950
5999
|
if (!await isGitRepository(project.workdir)) {
|
|
5951
6000
|
return res.status(400).json({ error: "Project is not a git repository" });
|
|
5952
6001
|
}
|
|
@@ -5964,7 +6013,7 @@ All file and git operations should use this branch.
|
|
|
5964
6013
|
if (!target || typeof target !== "string") return res.status(400).json({ error: "target is required" });
|
|
5965
6014
|
const project = sessionManager.getProject(session.projectId);
|
|
5966
6015
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5967
|
-
const { isGitRepository } = await import("./workspace-
|
|
6016
|
+
const { isGitRepository } = await import("./workspace-YLTMP3OX.js");
|
|
5968
6017
|
if (!await isGitRepository(project.workdir)) {
|
|
5969
6018
|
return res.status(400).json({ error: "Project is not a git repository" });
|
|
5970
6019
|
}
|
|
@@ -5982,10 +6031,10 @@ All file and git operations should use this branch.
|
|
|
5982
6031
|
}
|
|
5983
6032
|
});
|
|
5984
6033
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
5985
|
-
const { getEventStore: getEventStore2, combineEventsWithSnapshot } = await import("./events-
|
|
5986
|
-
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-
|
|
5987
|
-
const { getPendingQuestionsForSession } = await import("./tools-
|
|
5988
|
-
const { getMaxVisibleItems } = await import("./settings-
|
|
6034
|
+
const { getEventStore: getEventStore2, combineEventsWithSnapshot } = await import("./events-ICX5KVET.js");
|
|
6035
|
+
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-L2L4OHX6.js");
|
|
6036
|
+
const { getPendingQuestionsForSession } = await import("./tools-DXBIHSMY.js");
|
|
6037
|
+
const { getMaxVisibleItems } = await import("./settings-2OVKFWR5.js");
|
|
5989
6038
|
const session = sessionManager.getSession(req.params.id);
|
|
5990
6039
|
if (!session) {
|
|
5991
6040
|
return res.status(404).json({ error: "Session not found" });
|
|
@@ -6015,8 +6064,8 @@ All file and git operations should use this branch.
|
|
|
6015
6064
|
if (!session) {
|
|
6016
6065
|
return res.status(404).json({ error: "Session not found" });
|
|
6017
6066
|
}
|
|
6018
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
6019
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
6067
|
+
const { stopSessionExecution } = await import("./chat-handler-PC5BUJGA.js");
|
|
6068
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-DXBIHSMY.js");
|
|
6020
6069
|
sessionManager.clearMessageQueue(sessionId);
|
|
6021
6070
|
stopSessionExecution(sessionId, sessionManager);
|
|
6022
6071
|
abortSession(sessionId);
|
|
@@ -6045,9 +6094,9 @@ All file and git operations should use this branch.
|
|
|
6045
6094
|
res.json({ success: true });
|
|
6046
6095
|
});
|
|
6047
6096
|
app.post("/api/sessions/:id/provider", async (req, res) => {
|
|
6048
|
-
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-
|
|
6049
|
-
const { buildMessagesFromStoredEvents } = await import("./folding-
|
|
6050
|
-
const { getMaxVisibleItems } = await import("./settings-
|
|
6097
|
+
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-ICX5KVET.js");
|
|
6098
|
+
const { buildMessagesFromStoredEvents } = await import("./folding-L2L4OHX6.js");
|
|
6099
|
+
const { getMaxVisibleItems } = await import("./settings-2OVKFWR5.js");
|
|
6051
6100
|
const sessionId = req.params.id;
|
|
6052
6101
|
const session = sessionManager.getSession(sessionId);
|
|
6053
6102
|
if (!session) {
|
|
@@ -6082,7 +6131,7 @@ All file and git operations should use this branch.
|
|
|
6082
6131
|
if (!result.success) {
|
|
6083
6132
|
return res.status(500).json({ error: result.error ?? "Failed to set default model" });
|
|
6084
6133
|
}
|
|
6085
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
6134
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-XIYAPMX3.js");
|
|
6086
6135
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6087
6136
|
const updatedConfig = setDefaultModelSelection(globalConfig, providerId, model);
|
|
6088
6137
|
await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
|
|
@@ -6160,9 +6209,9 @@ All file and git operations should use this branch.
|
|
|
6160
6209
|
res.json({ success: true });
|
|
6161
6210
|
});
|
|
6162
6211
|
app.put("/api/sessions/:id/mode", async (req, res) => {
|
|
6163
|
-
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-
|
|
6164
|
-
const { buildMessagesFromStoredEvents } = await import("./folding-
|
|
6165
|
-
const { getMaxVisibleItems } = await import("./settings-
|
|
6212
|
+
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-ICX5KVET.js");
|
|
6213
|
+
const { buildMessagesFromStoredEvents } = await import("./folding-L2L4OHX6.js");
|
|
6214
|
+
const { getMaxVisibleItems } = await import("./settings-2OVKFWR5.js");
|
|
6166
6215
|
const sessionId = req.params.id;
|
|
6167
6216
|
const session = sessionManager.getSession(sessionId);
|
|
6168
6217
|
if (!session) {
|
|
@@ -6200,6 +6249,31 @@ All file and git operations should use this branch.
|
|
|
6200
6249
|
const updatedSession = sessionManager.getSession(sessionId);
|
|
6201
6250
|
res.json({ session: updatedSession });
|
|
6202
6251
|
});
|
|
6252
|
+
app.get("/api/sessions/:id/mcp/overrides", async (req, res) => {
|
|
6253
|
+
const sessionId = req.params.id;
|
|
6254
|
+
const session = sessionManager.getSession(sessionId);
|
|
6255
|
+
if (!session) {
|
|
6256
|
+
return res.status(404).json({ error: "Session not found" });
|
|
6257
|
+
}
|
|
6258
|
+
const disabledServers = getSessionDisabledServers(sessionId);
|
|
6259
|
+
res.json({ disabledServers });
|
|
6260
|
+
});
|
|
6261
|
+
app.put("/api/sessions/:id/mcp/overrides", async (req, res) => {
|
|
6262
|
+
const sessionId = req.params.id;
|
|
6263
|
+
const session = sessionManager.getSession(sessionId);
|
|
6264
|
+
if (!session) {
|
|
6265
|
+
return res.status(404).json({ error: "Session not found" });
|
|
6266
|
+
}
|
|
6267
|
+
const { disabledServers } = req.body;
|
|
6268
|
+
if (!Array.isArray(disabledServers)) {
|
|
6269
|
+
return res.status(400).json({ error: "disabledServers must be an array of strings" });
|
|
6270
|
+
}
|
|
6271
|
+
setSessionDisabledServers(sessionId, disabledServers);
|
|
6272
|
+
sessionManager.setDynamicContextChanged(sessionId, true);
|
|
6273
|
+
const state = sessionManager.getContextState(sessionId);
|
|
6274
|
+
wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
|
|
6275
|
+
res.json({ disabledServers: getSessionDisabledServers(sessionId) });
|
|
6276
|
+
});
|
|
6203
6277
|
app.put("/api/sessions/:id/title", async (req, res) => {
|
|
6204
6278
|
const sessionId = req.params.id;
|
|
6205
6279
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -6223,7 +6297,7 @@ All file and git operations should use this branch.
|
|
|
6223
6297
|
if (alwaysAllow !== void 0 && typeof alwaysAllow !== "boolean") {
|
|
6224
6298
|
return res.status(400).json({ error: "alwaysAllow must be a boolean if provided" });
|
|
6225
6299
|
}
|
|
6226
|
-
const { providePathConfirmation, getConfirmationSessionId } = await import("./tools-
|
|
6300
|
+
const { providePathConfirmation, getConfirmationSessionId } = await import("./tools-DXBIHSMY.js");
|
|
6227
6301
|
const pendingSessionId = getConfirmationSessionId(callId);
|
|
6228
6302
|
if (!pendingSessionId) {
|
|
6229
6303
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
@@ -6235,11 +6309,11 @@ All file and git operations should use this branch.
|
|
|
6235
6309
|
if (!result.found) {
|
|
6236
6310
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
6237
6311
|
}
|
|
6238
|
-
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEvents } = await import("./events-
|
|
6239
|
-
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-
|
|
6240
|
-
const { createSessionStateMessage } = await import("./protocol-
|
|
6241
|
-
const { getPendingQuestionsForSession } = await import("./tools-
|
|
6242
|
-
const { getMaxVisibleItems } = await import("./settings-
|
|
6312
|
+
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEvents } = await import("./events-ICX5KVET.js");
|
|
6313
|
+
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-L2L4OHX6.js");
|
|
6314
|
+
const { createSessionStateMessage } = await import("./protocol-3GNSIGP4.js");
|
|
6315
|
+
const { getPendingQuestionsForSession } = await import("./tools-DXBIHSMY.js");
|
|
6316
|
+
const { getMaxVisibleItems } = await import("./settings-2OVKFWR5.js");
|
|
6243
6317
|
const eventStore = getEventStore2();
|
|
6244
6318
|
const { snapshot, events: eventsSinceSnapshot } = eventStore.getEventsSinceSnapshot(sessionId);
|
|
6245
6319
|
const events = combineEvents(sessionId, snapshot, eventsSinceSnapshot);
|
|
@@ -6275,7 +6349,7 @@ All file and git operations should use this branch.
|
|
|
6275
6349
|
if (!skip && typeof answer !== "string") {
|
|
6276
6350
|
return res.status(400).json({ error: "answer is required when not skipping" });
|
|
6277
6351
|
}
|
|
6278
|
-
const { provideAnswer } = await import("./tools-
|
|
6352
|
+
const { provideAnswer } = await import("./tools-DXBIHSMY.js");
|
|
6279
6353
|
const found = provideAnswer(callId, answer ?? "", skip ?? false);
|
|
6280
6354
|
if (!found) {
|
|
6281
6355
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -6295,7 +6369,12 @@ All file and git operations should use this branch.
|
|
|
6295
6369
|
return res.status(400).json({ error: "content or attachments is required" });
|
|
6296
6370
|
}
|
|
6297
6371
|
sessionManager.queueMessage(sessionId, "asap", content, attachments, messageKind);
|
|
6298
|
-
|
|
6372
|
+
const queueState = sessionManager.getQueueState(sessionId);
|
|
6373
|
+
if (session.isRunning || queueState.length > 1) {
|
|
6374
|
+
res.json({ success: true, queueState });
|
|
6375
|
+
} else {
|
|
6376
|
+
res.json({ success: true });
|
|
6377
|
+
}
|
|
6299
6378
|
});
|
|
6300
6379
|
app.post("/api/sessions/:id/warmup", async (req, res) => {
|
|
6301
6380
|
const sessionId = req.params.id;
|
|
@@ -6303,7 +6382,7 @@ All file and git operations should use this branch.
|
|
|
6303
6382
|
if (!session) {
|
|
6304
6383
|
return res.status(404).json({ error: "Session not found" });
|
|
6305
6384
|
}
|
|
6306
|
-
const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-
|
|
6385
|
+
const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-2OVKFWR5.js");
|
|
6307
6386
|
if (getSetting2(SETTINGS_KEYS.CACHE_WARMING) !== "true") {
|
|
6308
6387
|
return res.json({ success: false, reason: "disabled" });
|
|
6309
6388
|
}
|
|
@@ -6335,7 +6414,7 @@ All file and git operations should use this branch.
|
|
|
6335
6414
|
backend: activeProvider?.backend ?? llmClient.getBackend(),
|
|
6336
6415
|
model: llmClient.getModel()
|
|
6337
6416
|
};
|
|
6338
|
-
const { runAgentTurn, TurnMetrics } = await import("./orchestrator-
|
|
6417
|
+
const { runAgentTurn, TurnMetrics } = await import("./orchestrator-56LSHPPK.js");
|
|
6339
6418
|
runAgentTurn(
|
|
6340
6419
|
{
|
|
6341
6420
|
sessionManager,
|
|
@@ -6373,15 +6452,15 @@ All file and git operations should use this branch.
|
|
|
6373
6452
|
if (!session) {
|
|
6374
6453
|
return res.status(404).json({ error: "Session not found" });
|
|
6375
6454
|
}
|
|
6376
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
6377
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
6455
|
+
const { stopSessionExecution } = await import("./chat-handler-PC5BUJGA.js");
|
|
6456
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-DXBIHSMY.js");
|
|
6378
6457
|
const queuedMessages = sessionManager.getQueueState(sessionId);
|
|
6379
6458
|
sessionManager.clearMessageQueue(sessionId);
|
|
6380
6459
|
stopSessionExecution(sessionId, sessionManager);
|
|
6381
6460
|
abortSession(sessionId);
|
|
6382
6461
|
cancelQuestionsForSession(sessionId, "Session stopped by user");
|
|
6383
6462
|
cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
|
|
6384
|
-
const eventStore = (await import("./events-
|
|
6463
|
+
const eventStore = (await import("./events-ICX5KVET.js")).getEventStore();
|
|
6385
6464
|
eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
|
|
6386
6465
|
res.json({ success: true, queuedMessages });
|
|
6387
6466
|
});
|
|
@@ -6395,7 +6474,7 @@ All file and git operations should use this branch.
|
|
|
6395
6474
|
if (typeof messageIndex !== "number" || messageIndex < 0) {
|
|
6396
6475
|
return res.status(400).json({ error: "messageIndex must be a non-negative number" });
|
|
6397
6476
|
}
|
|
6398
|
-
const { truncateSessionMessages } = await import("./events-
|
|
6477
|
+
const { truncateSessionMessages } = await import("./events-ICX5KVET.js");
|
|
6399
6478
|
truncateSessionMessages(sessionId, messageIndex);
|
|
6400
6479
|
res.json({ success: true });
|
|
6401
6480
|
});
|
|
@@ -6412,8 +6491,8 @@ All file and git operations should use this branch.
|
|
|
6412
6491
|
if (content !== void 0 && (typeof content !== "string" || !content.trim())) {
|
|
6413
6492
|
return res.status(400).json({ error: "content must be a non-empty string if provided" });
|
|
6414
6493
|
}
|
|
6415
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6416
|
-
const { buildMessagesFromStoredEvents } = await import("./folding-
|
|
6494
|
+
const { getEventStore: getEventStore2 } = await import("./events-ICX5KVET.js");
|
|
6495
|
+
const { buildMessagesFromStoredEvents } = await import("./folding-L2L4OHX6.js");
|
|
6417
6496
|
const eventStore = getEventStore2();
|
|
6418
6497
|
const events = eventStore.getEvents(sessionId);
|
|
6419
6498
|
const { messages } = buildMessagesFromStoredEvents(events);
|
|
@@ -6425,7 +6504,7 @@ All file and git operations should use this branch.
|
|
|
6425
6504
|
if (msg.role !== "user" || msg.isSystemGenerated) {
|
|
6426
6505
|
return res.status(400).json({ error: "Can only replay user messages" });
|
|
6427
6506
|
}
|
|
6428
|
-
const { truncateSessionMessages } = await import("./events-
|
|
6507
|
+
const { truncateSessionMessages } = await import("./events-ICX5KVET.js");
|
|
6429
6508
|
truncateSessionMessages(sessionId, msgIndex - 1);
|
|
6430
6509
|
sessionManager.queueMessage(sessionId, "asap", content ?? msg.content, msg.attachments, msg.messageKind);
|
|
6431
6510
|
res.json({ success: true });
|
|
@@ -6481,7 +6560,7 @@ All file and git operations should use this branch.
|
|
|
6481
6560
|
res.json({ accepted: true });
|
|
6482
6561
|
});
|
|
6483
6562
|
app.get("/api/settings", async (req, res) => {
|
|
6484
|
-
const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-
|
|
6563
|
+
const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-2OVKFWR5.js");
|
|
6485
6564
|
const keysParam = req.query["keys"];
|
|
6486
6565
|
if (!keysParam) {
|
|
6487
6566
|
return res.status(400).json({ error: "keys query parameter is required" });
|
|
@@ -6494,19 +6573,19 @@ All file and git operations should use this branch.
|
|
|
6494
6573
|
res.json(result);
|
|
6495
6574
|
});
|
|
6496
6575
|
app.get("/api/settings/:key", async (req, res) => {
|
|
6497
|
-
const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-
|
|
6576
|
+
const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-2OVKFWR5.js");
|
|
6498
6577
|
const key = req.params.key;
|
|
6499
6578
|
const value = getSetting2(key) ?? SETTINGS_DEFAULTS[key] ?? null;
|
|
6500
6579
|
res.json({ key, value });
|
|
6501
6580
|
});
|
|
6502
6581
|
app.get("/api/settings/:key", async (req, res) => {
|
|
6503
|
-
const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-
|
|
6582
|
+
const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-2OVKFWR5.js");
|
|
6504
6583
|
const key = req.params.key;
|
|
6505
6584
|
const value = getSetting2(key) ?? SETTINGS_DEFAULTS[key] ?? null;
|
|
6506
6585
|
res.json({ key, value });
|
|
6507
6586
|
});
|
|
6508
6587
|
app.put("/api/settings/:key", async (req, res) => {
|
|
6509
|
-
const { setSetting: setSetting2 } = await import("./settings-
|
|
6588
|
+
const { setSetting: setSetting2 } = await import("./settings-2OVKFWR5.js");
|
|
6510
6589
|
const key = req.params.key;
|
|
6511
6590
|
const { value } = req.body;
|
|
6512
6591
|
if (value === void 0) {
|
|
@@ -6533,7 +6612,7 @@ All file and git operations should use this branch.
|
|
|
6533
6612
|
}
|
|
6534
6613
|
});
|
|
6535
6614
|
app.get("/api/tools/shells", async (_req, res) => {
|
|
6536
|
-
const { listAvailableShells } = await import("./platform-
|
|
6615
|
+
const { listAvailableShells } = await import("./platform-UKZ2QC34.js");
|
|
6537
6616
|
res.json({ shells: listAvailableShells() });
|
|
6538
6617
|
});
|
|
6539
6618
|
app.get("/api/config", async (_req, res) => {
|
|
@@ -6542,7 +6621,7 @@ All file and git operations should use this branch.
|
|
|
6542
6621
|
let visionFallback;
|
|
6543
6622
|
let globalWorkdir;
|
|
6544
6623
|
try {
|
|
6545
|
-
const { loadGlobalConfig, getVisionFallback } = await import("./config-
|
|
6624
|
+
const { loadGlobalConfig, getVisionFallback } = await import("./config-XIYAPMX3.js");
|
|
6546
6625
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6547
6626
|
const fallback = getVisionFallback(globalConfig);
|
|
6548
6627
|
if (fallback) {
|
|
@@ -6692,7 +6771,7 @@ All file and git operations should use this branch.
|
|
|
6692
6771
|
}
|
|
6693
6772
|
});
|
|
6694
6773
|
app.post("/api/proxy/test", async (_req, res) => {
|
|
6695
|
-
const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-
|
|
6774
|
+
const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-2OVKFWR5.js");
|
|
6696
6775
|
const proxyUrl = getSetting2(SETTINGS_KEYS.PROXY_URL);
|
|
6697
6776
|
if (!proxyUrl) {
|
|
6698
6777
|
return res.status(400).json({ success: false, error: "No proxy URL configured" });
|
|
@@ -6719,7 +6798,7 @@ All file and git operations should use this branch.
|
|
|
6719
6798
|
const backend = req.query["backend"];
|
|
6720
6799
|
if (!url) return res.status(400).json({ error: "url is required" });
|
|
6721
6800
|
try {
|
|
6722
|
-
const { fetchModelsWithContext } = await import("./provider-manager-
|
|
6801
|
+
const { fetchModelsWithContext } = await import("./provider-manager-P3ZSA5QS.js");
|
|
6723
6802
|
const { getModelProfile: getModelProfile2 } = await import("./profiles-5J7F4BML.js");
|
|
6724
6803
|
const models = await fetchModelsWithContext(
|
|
6725
6804
|
url,
|
|
@@ -6790,7 +6869,7 @@ All file and git operations should use this branch.
|
|
|
6790
6869
|
const { getModelProfile: getModelProfile2 } = await import("./profiles-5J7F4BML.js");
|
|
6791
6870
|
const { getBackendCapabilities } = await import("./backend-P3GHHLHJ.js");
|
|
6792
6871
|
const { buildNonStreamingCreateParams } = await import("./client-pure-5YE5WFJP.js");
|
|
6793
|
-
const { OpenAIHttpClient } = await import("./http-client-
|
|
6872
|
+
const { OpenAIHttpClient } = await import("./http-client-E3CV6E5D.js");
|
|
6794
6873
|
const { ensureVersionPrefix } = await import("./url-utils-SAJP7AEX.js");
|
|
6795
6874
|
const profile = getModelProfile2(model);
|
|
6796
6875
|
const capabilities = getBackendCapabilities(backend || "unknown");
|
|
@@ -6859,7 +6938,7 @@ All file and git operations should use this branch.
|
|
|
6859
6938
|
return res.status(400).json({ error: "name, url, and backend are required" });
|
|
6860
6939
|
}
|
|
6861
6940
|
try {
|
|
6862
|
-
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-
|
|
6941
|
+
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-XIYAPMX3.js");
|
|
6863
6942
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6864
6943
|
const providerBackend = backend;
|
|
6865
6944
|
const providerModels = modelConfigs?.length ? buildModelConfigs(modelConfigs) : model ? [{ id: model, contextWindow: 2e5, source: "user" }] : [];
|
|
@@ -6899,7 +6978,7 @@ All file and git operations should use this branch.
|
|
|
6899
6978
|
app.post("/api/init/config", async (req, res) => {
|
|
6900
6979
|
const { workdir, visionFallback } = req.body;
|
|
6901
6980
|
try {
|
|
6902
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
6981
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-XIYAPMX3.js");
|
|
6903
6982
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6904
6983
|
const updatedConfig = {
|
|
6905
6984
|
...globalConfig,
|
|
@@ -6938,7 +7017,7 @@ All file and git operations should use this branch.
|
|
|
6938
7017
|
});
|
|
6939
7018
|
app.delete("/api/providers/:id", async (req, res) => {
|
|
6940
7019
|
const { id } = req.params;
|
|
6941
|
-
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-
|
|
7020
|
+
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-XIYAPMX3.js");
|
|
6942
7021
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6943
7022
|
const updatedConfig = removeProvider(globalConfig, id);
|
|
6944
7023
|
await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
|
|
@@ -6950,7 +7029,7 @@ All file and git operations should use this branch.
|
|
|
6950
7029
|
const { id } = req.params;
|
|
6951
7030
|
const { isLocal } = req.body;
|
|
6952
7031
|
try {
|
|
6953
|
-
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-
|
|
7032
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-XIYAPMX3.js");
|
|
6954
7033
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6955
7034
|
const provider = globalConfig.providers.find((p) => p.id === id);
|
|
6956
7035
|
if (!provider) {
|
|
@@ -6981,7 +7060,7 @@ All file and git operations should use this branch.
|
|
|
6981
7060
|
transportAdapter
|
|
6982
7061
|
} = req.body;
|
|
6983
7062
|
try {
|
|
6984
|
-
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-
|
|
7063
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-XIYAPMX3.js");
|
|
6985
7064
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6986
7065
|
const provider = globalConfig.providers.find((p) => p.id === id);
|
|
6987
7066
|
if (!provider) {
|
|
@@ -7021,7 +7100,7 @@ All file and git operations should use this branch.
|
|
|
7021
7100
|
return res.status(400).json({ error: result.error });
|
|
7022
7101
|
}
|
|
7023
7102
|
const llmClient = getLLMClient();
|
|
7024
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
7103
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-XIYAPMX3.js");
|
|
7025
7104
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
7026
7105
|
const updatedConfig = setDefaultModelSelection(globalConfig, id, llmClient.getModel());
|
|
7027
7106
|
await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
|
|
@@ -7048,7 +7127,7 @@ All file and git operations should use this branch.
|
|
|
7048
7127
|
});
|
|
7049
7128
|
async function rebuildMcpTools() {
|
|
7050
7129
|
const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-MOGEI6TP.js");
|
|
7051
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
7130
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-DXBIHSMY.js");
|
|
7052
7131
|
const mcpTools = createMcpTools2(mcpManager);
|
|
7053
7132
|
setMcpTools2(mcpTools);
|
|
7054
7133
|
}
|
|
@@ -7118,7 +7197,7 @@ All file and git operations should use this branch.
|
|
|
7118
7197
|
};
|
|
7119
7198
|
await mcpManager.addServer(name, serverCfg);
|
|
7120
7199
|
const server = mcpManager.getServer(name);
|
|
7121
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
7200
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-XIYAPMX3.js");
|
|
7122
7201
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
7123
7202
|
const updatedMcpServers = { ...globalConfig.mcpServers ?? {}, [name]: serverCfg };
|
|
7124
7203
|
await saveGlobalConfig(
|
|
@@ -7136,6 +7215,8 @@ All file and git operations should use this branch.
|
|
|
7136
7215
|
sessionManager.setDynamicContextChanged(s.id, true);
|
|
7137
7216
|
}
|
|
7138
7217
|
}
|
|
7218
|
+
const allServers = mcpManager.getAllServers();
|
|
7219
|
+
wssExports.broadcastAll(createServerMessage("mcp.servers.changed", { servers: allServers }));
|
|
7139
7220
|
res.status(201).json({ server });
|
|
7140
7221
|
} catch (error) {
|
|
7141
7222
|
res.status(400).json({ error: error instanceof Error ? error.message : String(error) });
|
|
@@ -7148,7 +7229,7 @@ All file and git operations should use this branch.
|
|
|
7148
7229
|
return res.status(404).json({ error: `MCP server '${name}' not found` });
|
|
7149
7230
|
}
|
|
7150
7231
|
const body = req.body;
|
|
7151
|
-
const { transport: rawTransport, command, args, env, url, headers, timeout } = body;
|
|
7232
|
+
const { transport: rawTransport, command, args, env, url, headers, timeout, disabled } = body;
|
|
7152
7233
|
if (rawTransport !== void 0 && rawTransport !== "stdio" && rawTransport !== "http") {
|
|
7153
7234
|
return res.status(400).json({ error: `Invalid transport '${String(rawTransport)}'. Must be 'stdio' or 'http'.` });
|
|
7154
7235
|
}
|
|
@@ -7170,9 +7251,12 @@ All file and git operations should use this branch.
|
|
|
7170
7251
|
if (timeout !== void 0 && (typeof timeout !== "number" || timeout <= 0)) {
|
|
7171
7252
|
return res.status(400).json({ error: "timeout must be a positive number" });
|
|
7172
7253
|
}
|
|
7254
|
+
if (disabled !== void 0 && typeof disabled !== "boolean") {
|
|
7255
|
+
return res.status(400).json({ error: "disabled must be a boolean" });
|
|
7256
|
+
}
|
|
7173
7257
|
try {
|
|
7174
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
7175
|
-
const { applyMcpServerUpdate } = await import("./update-server-
|
|
7258
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-XIYAPMX3.js");
|
|
7259
|
+
const { applyMcpServerUpdate } = await import("./update-server-4I6LXE5K.js");
|
|
7176
7260
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
7177
7261
|
const mcpServers2 = { ...globalConfig.mcpServers ?? {} };
|
|
7178
7262
|
const patch = {
|
|
@@ -7182,7 +7266,8 @@ All file and git operations should use this branch.
|
|
|
7182
7266
|
...env !== void 0 ? { env } : {},
|
|
7183
7267
|
...url !== void 0 ? { url } : {},
|
|
7184
7268
|
...headers !== void 0 ? { headers } : {},
|
|
7185
|
-
...timeout !== void 0 ? { timeout } : {}
|
|
7269
|
+
...timeout !== void 0 ? { timeout } : {},
|
|
7270
|
+
...disabled !== void 0 ? { disabled } : {}
|
|
7186
7271
|
};
|
|
7187
7272
|
const { error: updateError } = await applyMcpServerUpdate({
|
|
7188
7273
|
name,
|
|
@@ -7203,6 +7288,7 @@ All file and git operations should use this branch.
|
|
|
7203
7288
|
for (const s of sessions) {
|
|
7204
7289
|
sessionManager.setDynamicContextChanged(s.id, true);
|
|
7205
7290
|
}
|
|
7291
|
+
wssExports.broadcastAll(createServerMessage("mcp.servers.changed", { servers: mcpManager.getAllServers() }));
|
|
7206
7292
|
res.json({ server: mcpManager.getServer(name) });
|
|
7207
7293
|
} catch (error) {
|
|
7208
7294
|
res.status(400).json({ error: error instanceof Error ? error.message : String(error) });
|
|
@@ -7215,7 +7301,7 @@ All file and git operations should use this branch.
|
|
|
7215
7301
|
return res.status(404).json({ error: `MCP server '${name}' not found` });
|
|
7216
7302
|
}
|
|
7217
7303
|
mcpManager.removeServer(name);
|
|
7218
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
7304
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-XIYAPMX3.js");
|
|
7219
7305
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
7220
7306
|
const updatedMcpServers = { ...globalConfig.mcpServers ?? {} };
|
|
7221
7307
|
delete updatedMcpServers[name];
|
|
@@ -7232,6 +7318,7 @@ All file and git operations should use this branch.
|
|
|
7232
7318
|
for (const s of sessions) {
|
|
7233
7319
|
sessionManager.setDynamicContextChanged(s.id, true);
|
|
7234
7320
|
}
|
|
7321
|
+
wssExports.broadcastAll(createServerMessage("mcp.servers.changed", { servers: mcpManager.getAllServers() }));
|
|
7235
7322
|
res.json({ success: true });
|
|
7236
7323
|
});
|
|
7237
7324
|
app.put("/api/mcp/servers/:name/tools/:toolName", async (req, res) => {
|
|
@@ -7244,7 +7331,7 @@ All file and git operations should use this branch.
|
|
|
7244
7331
|
await mcpManager.setToolEnabled(name, toolName, enabled);
|
|
7245
7332
|
const server = mcpManager.getServer(name);
|
|
7246
7333
|
if (server) {
|
|
7247
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
7334
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-XIYAPMX3.js");
|
|
7248
7335
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
7249
7336
|
const mcpServers2 = { ...globalConfig.mcpServers ?? {} };
|
|
7250
7337
|
const serverCfg = mcpServers2[name];
|
|
@@ -7267,6 +7354,7 @@ All file and git operations should use this branch.
|
|
|
7267
7354
|
for (const s of sessions) {
|
|
7268
7355
|
sessionManager.setDynamicContextChanged(s.id, true);
|
|
7269
7356
|
}
|
|
7357
|
+
wssExports.broadcastAll(createServerMessage("mcp.servers.changed", { servers: mcpManager.getAllServers() }));
|
|
7270
7358
|
res.json({ success: true });
|
|
7271
7359
|
} catch (error) {
|
|
7272
7360
|
res.status(400).json({ error: error instanceof Error ? error.message : String(error) });
|
|
@@ -7278,7 +7366,7 @@ All file and git operations should use this branch.
|
|
|
7278
7366
|
app.use("/api/agents", createAgentRoutes(configDir, projectDir));
|
|
7279
7367
|
app.use("/api/workflows", createWorkflowRoutes(configDir, config3, projectDir));
|
|
7280
7368
|
app.use("/api/dev-server", createDevServerRoutes());
|
|
7281
|
-
app.use("/api/workspace", createWorkspaceConfigRoutes());
|
|
7369
|
+
app.use("/api/workspace", createWorkspaceConfigRoutes(sessionManager));
|
|
7282
7370
|
app.use("/api/terminals", createTerminalRoutes());
|
|
7283
7371
|
app.use(
|
|
7284
7372
|
"/api/auto-update",
|
|
@@ -7295,13 +7383,13 @@ All file and git operations should use this branch.
|
|
|
7295
7383
|
})
|
|
7296
7384
|
);
|
|
7297
7385
|
app.get("/api/sessions/:id/background-processes", async (req, res) => {
|
|
7298
|
-
const { getSessionProcesses } = await import("./manager-
|
|
7386
|
+
const { getSessionProcesses } = await import("./manager-ZPQ6VSM5.js");
|
|
7299
7387
|
const sessionId = req.params.id;
|
|
7300
7388
|
const processes = getSessionProcesses(sessionId);
|
|
7301
7389
|
res.json({ processes });
|
|
7302
7390
|
});
|
|
7303
7391
|
app.post("/api/sessions/:id/background-process/:processId/stop", async (req, res) => {
|
|
7304
|
-
const { stopProcess } = await import("./manager-
|
|
7392
|
+
const { stopProcess } = await import("./manager-ZPQ6VSM5.js");
|
|
7305
7393
|
const sessionId = req.params.id;
|
|
7306
7394
|
const processId = req.params.processId;
|
|
7307
7395
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -7436,15 +7524,17 @@ All file and git operations should use this branch.
|
|
|
7436
7524
|
getLLMClient,
|
|
7437
7525
|
() => providerManager.getActiveProvider(),
|
|
7438
7526
|
sessionManager,
|
|
7439
|
-
providerManager
|
|
7527
|
+
providerManager,
|
|
7528
|
+
() => mcpManager.getAllServers()
|
|
7440
7529
|
);
|
|
7441
7530
|
const wss = wssExports.wss;
|
|
7442
7531
|
setNotifyMcpServersChanged((sessionId) => {
|
|
7443
|
-
|
|
7532
|
+
const servers = mcpManager.getAllServers();
|
|
7533
|
+
wssExports.broadcastAll(createServerMessage("mcp.servers.changed", { servers }));
|
|
7444
7534
|
const state = sessionManager.getContextState(sessionId);
|
|
7445
7535
|
wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
|
|
7446
7536
|
});
|
|
7447
|
-
const { QueueProcessor } = await import("./processor-
|
|
7537
|
+
const { QueueProcessor } = await import("./processor-H6NFFRI2.js");
|
|
7448
7538
|
const queueProcessor = new QueueProcessor({
|
|
7449
7539
|
sessionManager,
|
|
7450
7540
|
providerManager,
|
|
@@ -7486,7 +7576,7 @@ All file and git operations should use this branch.
|
|
|
7486
7576
|
void (async () => {
|
|
7487
7577
|
await devServerManager.stopAll();
|
|
7488
7578
|
await mcpManager.disconnectAll();
|
|
7489
|
-
const { stopAllInspectProxies } = await import("./inspect-proxy-
|
|
7579
|
+
const { stopAllInspectProxies } = await import("./inspect-proxy-NZ3VSMSC.js");
|
|
7490
7580
|
stopAllInspectProxies();
|
|
7491
7581
|
const { cleanupAllProcesses } = await import("./store-SARB6V2N.js");
|
|
7492
7582
|
cleanupAllProcesses();
|
|
@@ -7528,4 +7618,4 @@ export {
|
|
|
7528
7618
|
createServerHandle,
|
|
7529
7619
|
createServer
|
|
7530
7620
|
};
|
|
7531
|
-
//# sourceMappingURL=chunk-
|
|
7621
|
+
//# sourceMappingURL=chunk-JJY5O2WH.js.map
|