openfox 2.0.95 → 2.0.97
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 +23 -0
- package/dist/CHANGELOG.md +23 -0
- package/dist/{chat-handler-5FV3TGQD.js → chat-handler-XXXMTO7W.js} +16 -16
- package/dist/{chunk-SJJVNSA6.js → chunk-2VJIQEZE.js} +41 -5
- package/dist/{chunk-OHBY2673.js → chunk-3LRYZ7R3.js} +46 -3
- package/dist/{chunk-W7P5P54O.js → chunk-3W6STALV.js} +2 -2
- package/dist/chunk-62QCBNPE.js +15 -0
- package/dist/{chunk-OZD247P4.js → chunk-C3XL7X4E.js} +8 -8
- package/dist/{chunk-D6T3X22W.js → chunk-CCEG3AFM.js} +14 -14
- package/dist/{chunk-YPBV47DH.js → chunk-CSKPPHD3.js} +2 -2
- package/dist/{chunk-62X2MPO6.js → chunk-D3SXT3BL.js} +4 -4
- package/dist/chunk-DRMYR6BF.js +7 -0
- package/dist/{chunk-ZMSHE564.js → chunk-G5JFKTSR.js} +2 -2
- package/dist/{chunk-KG2PJVOE.js → chunk-GPGJBDI6.js} +187 -80
- package/dist/{chunk-YCPUV7AR.js → chunk-HJEATCSM.js} +7 -7
- package/dist/{chunk-7P7OKBYQ.js → chunk-KNYPBXPW.js} +4 -4
- package/dist/{chunk-MC3MCMAF.js → chunk-KQPDU65K.js} +2 -2
- package/dist/{chunk-MB7STVMR.js → chunk-LZW5LSVH.js} +5 -5
- package/dist/{chunk-P637C6X3.js → chunk-O2PLNJIU.js} +2 -2
- package/dist/{chunk-6RHMIMID.js → chunk-O5YWFX7H.js} +21 -25
- package/dist/{chunk-5UFTFBNW.js → chunk-T3INQCET.js} +6 -6
- package/dist/{chunk-OQTLFO4R.js → chunk-URQQOUCS.js} +46 -3
- package/dist/{chunk-5N5JXT7R.js → chunk-XLI6PDJG.js} +2 -2
- package/dist/{chunk-TSHJW7OC.js → chunk-ZIMGU5ZH.js} +2 -2
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{client-RENSCJPZ.js → client-IK47PLPP.js} +2 -2
- package/dist/{compactor-3RXIAIPR.js → compactor-U7EUKEUE.js} +6 -6
- package/dist/{config-XIYAPMX3.js → config-M7RDIFC5.js} +4 -2
- package/dist/{dynamic-context-CJFDFUJF.js → dynamic-context-TDB4G5CH.js} +4 -4
- package/dist/{events-QHZDLHEB.js → events-4THEZWVL.js} +5 -5
- package/dist/{folding-O4OYOTPS.js → folding-OYBO2NTH.js} +3 -3
- package/dist/openFolder-Z27FEM5M.js +8 -0
- package/dist/{orchestrator-LDVMBC23.js → orchestrator-MTCF2EPU.js} +13 -13
- package/dist/package.json +1 -1
- package/dist/{path-security-72KGHGSV.js → path-security-6GYETPWN.js} +6 -6
- package/dist/{processor-32QUVPV6.js → processor-F3EZWNPO.js} +13 -13
- package/dist/{provider-A74GHQUO.js → provider-5KFIZM5T.js} +5 -5
- package/dist/{provider-manager-PBOF77RQ.js → provider-manager-23O5QVDJ.js} +3 -3
- package/dist/{registry-XBEHPY7C.js → registry-QEOTM3IG.js} +2 -2
- package/dist/{serve-GL5WUPRP.js → serve-JACH7OQW.js} +21 -20
- package/dist/server/index.js +20 -19
- package/dist/{server-OYVGQU7O.js → server-KIRPYPP6.js} +16 -16
- package/dist/{session-overrides-QWD4V5KW.js → session-overrides-BQSE3V3F.js} +4 -4
- package/dist/{sessions-BT4PION7.js → sessions-AUDWMF55.js} +3 -3
- package/dist/{tools-UTA3TV7P.js → tools-I3BAXRVD.js} +11 -11
- package/dist/{update-VUTN743C.js → update-NZZWLDK7.js} +2 -2
- package/dist/web/assets/{index-BlV1FebL.css → index-BG5sD2ez.css} +1 -1
- package/dist/web/assets/{index-BUiw9fSe.js → index-C1sXLxiM.js} +80 -73
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/dist/{workspace-IIRKILYL.js → workspace-2NDXTCVR.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-VKU7YBLH.js +0 -7
|
@@ -21,7 +21,10 @@ import {
|
|
|
21
21
|
tokenFromPassword,
|
|
22
22
|
verifyPassword,
|
|
23
23
|
workflowExists
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-CCEG3AFM.js";
|
|
25
|
+
import {
|
|
26
|
+
openFolder
|
|
27
|
+
} from "./chunk-62QCBNPE.js";
|
|
25
28
|
import {
|
|
26
29
|
createToolRegistry,
|
|
27
30
|
devServerManager,
|
|
@@ -30,7 +33,7 @@ import {
|
|
|
30
33
|
setMcpManagerForTools,
|
|
31
34
|
setMcpTools,
|
|
32
35
|
setNotifyMcpServersChanged
|
|
33
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-O5YWFX7H.js";
|
|
34
37
|
import {
|
|
35
38
|
createMcpTools
|
|
36
39
|
} from "./chunk-NWO6GRYE.js";
|
|
@@ -48,7 +51,7 @@ import {
|
|
|
48
51
|
validateRef,
|
|
49
52
|
validateWorkspaceName,
|
|
50
53
|
workspaceExists
|
|
51
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-D3SXT3BL.js";
|
|
52
55
|
import {
|
|
53
56
|
deleteOwnedSkill,
|
|
54
57
|
deleteProjectSkill,
|
|
@@ -67,11 +70,11 @@ import {
|
|
|
67
70
|
setSkillEnabled,
|
|
68
71
|
skillExists,
|
|
69
72
|
updateOwnedSkill
|
|
70
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-KQPDU65K.js";
|
|
71
74
|
import {
|
|
72
75
|
getSessionDisabledServers,
|
|
73
76
|
setSessionDisabledServers
|
|
74
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-XLI6PDJG.js";
|
|
75
78
|
import {
|
|
76
79
|
createContextStateMessage
|
|
77
80
|
} from "./chunk-27SDWNKL.js";
|
|
@@ -104,14 +107,14 @@ import {
|
|
|
104
107
|
getEventStore,
|
|
105
108
|
getSessionState,
|
|
106
109
|
initEventStore
|
|
107
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-KNYPBXPW.js";
|
|
108
111
|
import {
|
|
109
112
|
getPathSeparator,
|
|
110
113
|
isAbsolutePath
|
|
111
114
|
} from "./chunk-NLN5LPQ4.js";
|
|
112
115
|
import {
|
|
113
116
|
VERSION
|
|
114
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-DRMYR6BF.js";
|
|
115
118
|
import {
|
|
116
119
|
clearWorkflowExecution,
|
|
117
120
|
createSession,
|
|
@@ -131,13 +134,14 @@ import {
|
|
|
131
134
|
updateSessionRunning,
|
|
132
135
|
updateSessionWorkdir,
|
|
133
136
|
updateWorkflowExecutionStatus
|
|
134
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-ZIMGU5ZH.js";
|
|
135
138
|
import {
|
|
136
139
|
agentExists,
|
|
137
140
|
deleteAgent,
|
|
138
141
|
deleteItemFromDir,
|
|
139
142
|
deleteProjectAgent,
|
|
140
143
|
findAgentById,
|
|
144
|
+
findFileByInternalId,
|
|
141
145
|
getDefaultAgentIds,
|
|
142
146
|
getDefaultIds,
|
|
143
147
|
getTopLevelAgents,
|
|
@@ -153,13 +157,13 @@ import {
|
|
|
153
157
|
saveAgentToProject,
|
|
154
158
|
saveItemToDir,
|
|
155
159
|
setRuntimeConfig
|
|
156
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-3LRYZ7R3.js";
|
|
157
161
|
import {
|
|
158
162
|
createProviderManager,
|
|
159
163
|
detectModel,
|
|
160
164
|
getLlmStatus,
|
|
161
165
|
parseDefaultModelSelection
|
|
162
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-CSKPPHD3.js";
|
|
163
167
|
import {
|
|
164
168
|
getModelProfile
|
|
165
169
|
} from "./chunk-V4IE7HJY.js";
|
|
@@ -3920,7 +3924,10 @@ function getProjectItemPath(projectDir, dirName, id, ext) {
|
|
|
3920
3924
|
}
|
|
3921
3925
|
async function isProjectItem(projectDir, dirName, id, ext) {
|
|
3922
3926
|
if (!projectDir) return false;
|
|
3923
|
-
|
|
3927
|
+
if (await pathExists(getProjectItemPath(projectDir, dirName, id, ext))) return true;
|
|
3928
|
+
const dir = join3(projectDir, ".openfox", dirName);
|
|
3929
|
+
const found = await findFileByInternalId(dir, id, ext);
|
|
3930
|
+
return found !== null;
|
|
3924
3931
|
}
|
|
3925
3932
|
function createCrudRoutes(config3, configDir, projectDir) {
|
|
3926
3933
|
const router = Router();
|
|
@@ -5166,7 +5173,7 @@ function createProviderAuthRoutes(config3, providerManager, registry) {
|
|
|
5166
5173
|
try {
|
|
5167
5174
|
const { challenge, completion } = await adapter.beginLogin({ providerId: provider.id });
|
|
5168
5175
|
void completion.then(async ({ credentialRef }) => {
|
|
5169
|
-
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-
|
|
5176
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-M7RDIFC5.js");
|
|
5170
5177
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
5171
5178
|
const updatedConfig = updateProvider(globalConfig, provider.id, { credentialRef, authAdapter: adapter.id });
|
|
5172
5179
|
await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
|
|
@@ -5200,7 +5207,7 @@ function createProviderAuthRoutes(config3, providerManager, registry) {
|
|
|
5200
5207
|
if (!context) return;
|
|
5201
5208
|
const { provider, adapter } = context;
|
|
5202
5209
|
if (provider.credentialRef && adapter) await adapter.logout(provider.credentialRef);
|
|
5203
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
5210
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-M7RDIFC5.js");
|
|
5204
5211
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
5205
5212
|
const updatedConfig = {
|
|
5206
5213
|
...globalConfig,
|
|
@@ -5376,15 +5383,12 @@ import { fileURLToPath as fileURLToPath6, pathToFileURL as pathToFileURL2 } from
|
|
|
5376
5383
|
import { dirname as dirname7, resolve as resolve7, join as join9 } from "path";
|
|
5377
5384
|
import { existsSync } from "fs";
|
|
5378
5385
|
import { readFile as readFile3, readdir as readdir4, rm as rm2, rename as rename2 } from "fs/promises";
|
|
5379
|
-
import { platform } from "os";
|
|
5380
5386
|
import { execFile } from "child_process";
|
|
5381
5387
|
import { promisify } from "util";
|
|
5382
5388
|
var execFileP = promisify(execFile);
|
|
5383
|
-
async function
|
|
5389
|
+
async function openFolderRoute(dir, res) {
|
|
5384
5390
|
try {
|
|
5385
|
-
await
|
|
5386
|
-
const cmd = platform() === "darwin" ? "open" : platform() === "win32" ? "explorer" : "xdg-open";
|
|
5387
|
-
await execFileP(cmd, [dir], { timeout: 5e3 });
|
|
5391
|
+
await openFolder(dir);
|
|
5388
5392
|
res.json({ success: true });
|
|
5389
5393
|
} catch (err) {
|
|
5390
5394
|
res.status(500).json({ error: err instanceof Error ? err.message : "Failed to open folder" });
|
|
@@ -5538,13 +5542,13 @@ function createPluginRoutes(options) {
|
|
|
5538
5542
|
});
|
|
5539
5543
|
router.get("/open-folder", async (_req, res) => {
|
|
5540
5544
|
const pluginsDir = join9(getGlobalConfigDir(config3.mode ?? "production"), "plugins");
|
|
5541
|
-
await
|
|
5545
|
+
await openFolderRoute(pluginsDir, res);
|
|
5542
5546
|
});
|
|
5543
5547
|
router.get("/:name/open-folder", async (req, res) => {
|
|
5544
5548
|
const name = req.params.name;
|
|
5545
5549
|
if (!/^[a-zA-Z0-9_-]+$/.test(name)) return res.status(400).json({ error: "Invalid plugin name" });
|
|
5546
5550
|
const targetDir = join9(getGlobalConfigDir(config3.mode ?? "production"), "plugins", name);
|
|
5547
|
-
await
|
|
5551
|
+
await openFolderRoute(targetDir, res);
|
|
5548
5552
|
});
|
|
5549
5553
|
router.delete("/:name", async (req, res) => {
|
|
5550
5554
|
const name = req.params.name;
|
|
@@ -5680,7 +5684,7 @@ async function createServerHandle(config3) {
|
|
|
5680
5684
|
const mcpManager = new McpManager({
|
|
5681
5685
|
onToolsDiscovered: async (name, tools) => {
|
|
5682
5686
|
try {
|
|
5683
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
5687
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-M7RDIFC5.js");
|
|
5684
5688
|
const mode = config3.mode ?? "production";
|
|
5685
5689
|
const globalConfig = await loadGlobalConfig(mode, config3.globalConfigPath);
|
|
5686
5690
|
const mcpServers2 = {
|
|
@@ -5711,7 +5715,7 @@ async function createServerHandle(config3) {
|
|
|
5711
5715
|
setMcpTools(mcpTools);
|
|
5712
5716
|
logger.info("MCP tools registered", { count: mcpTools.length });
|
|
5713
5717
|
}
|
|
5714
|
-
const { signalMcpReady } = await import("./server-
|
|
5718
|
+
const { signalMcpReady } = await import("./server-KIRPYPP6.js");
|
|
5715
5719
|
signalMcpReady();
|
|
5716
5720
|
});
|
|
5717
5721
|
const app = express();
|
|
@@ -5850,6 +5854,20 @@ async function createServerHandle(config3) {
|
|
|
5850
5854
|
}
|
|
5851
5855
|
res.json({ project });
|
|
5852
5856
|
});
|
|
5857
|
+
app.get("/api/projects/:id/open-folder", async (req, res) => {
|
|
5858
|
+
const { getProject: getProject2 } = await import("./projects-M5XKC7O6.js");
|
|
5859
|
+
const project = getProject2(req.params.id);
|
|
5860
|
+
if (!project) {
|
|
5861
|
+
return res.status(404).json({ error: "Project not found" });
|
|
5862
|
+
}
|
|
5863
|
+
try {
|
|
5864
|
+
const { openFolder: openFolder2 } = await import("./openFolder-Z27FEM5M.js");
|
|
5865
|
+
await openFolder2(project.workdir);
|
|
5866
|
+
res.json({ success: true });
|
|
5867
|
+
} catch (err) {
|
|
5868
|
+
res.status(500).json({ error: err instanceof Error ? err.message : "Failed to open folder" });
|
|
5869
|
+
}
|
|
5870
|
+
});
|
|
5853
5871
|
app.put("/api/projects/:id", async (req, res) => {
|
|
5854
5872
|
const { updateProject: updateProject2 } = await import("./projects-M5XKC7O6.js");
|
|
5855
5873
|
const { name, customInstructions, dangerLevel } = req.body;
|
|
@@ -5888,7 +5906,7 @@ async function createServerHandle(config3) {
|
|
|
5888
5906
|
const { getProject: getProject2 } = await import("./projects-M5XKC7O6.js");
|
|
5889
5907
|
const project = getProject2(req.params.id);
|
|
5890
5908
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5891
|
-
const { listBranches } = await import("./workspace-
|
|
5909
|
+
const { listBranches } = await import("./workspace-2NDXTCVR.js");
|
|
5892
5910
|
const branches = await listBranches(project.workdir);
|
|
5893
5911
|
res.json({ branches });
|
|
5894
5912
|
});
|
|
@@ -5898,13 +5916,13 @@ async function createServerHandle(config3) {
|
|
|
5898
5916
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5899
5917
|
const { branch } = req.body;
|
|
5900
5918
|
if (!branch || typeof branch !== "string") return res.status(400).json({ error: "branch is required" });
|
|
5901
|
-
const { checkoutBranch, isGitRepository } = await import("./workspace-
|
|
5919
|
+
const { checkoutBranch, isGitRepository } = await import("./workspace-2NDXTCVR.js");
|
|
5902
5920
|
if (!await isGitRepository(project.workdir)) {
|
|
5903
5921
|
return res.status(400).json({ error: "Project is not a git repository" });
|
|
5904
5922
|
}
|
|
5905
5923
|
try {
|
|
5906
5924
|
await checkoutBranch(project.workdir, branch);
|
|
5907
|
-
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-
|
|
5925
|
+
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-AUDWMF55.js");
|
|
5908
5926
|
const allSessions = sessionManager.listSessions();
|
|
5909
5927
|
for (const s of allSessions) {
|
|
5910
5928
|
if (sessionManager.getEffectiveWorkdir(s.id) === project.workdir) {
|
|
@@ -5923,7 +5941,7 @@ async function createServerHandle(config3) {
|
|
|
5923
5941
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5924
5942
|
const { name, sourceBranch } = req.body;
|
|
5925
5943
|
if (!name || typeof name !== "string") return res.status(400).json({ error: "name is required" });
|
|
5926
|
-
const { createBranch, resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, validateRef: validateRef2, getDefaultBranch, isGitRepository } = await import("./workspace-
|
|
5944
|
+
const { createBranch, resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, validateRef: validateRef2, getDefaultBranch, isGitRepository } = await import("./workspace-2NDXTCVR.js");
|
|
5927
5945
|
if (!await isGitRepository(project.workdir)) {
|
|
5928
5946
|
return res.status(400).json({ error: "Project is not a git repository" });
|
|
5929
5947
|
}
|
|
@@ -5940,7 +5958,7 @@ async function createServerHandle(config3) {
|
|
|
5940
5958
|
);
|
|
5941
5959
|
}
|
|
5942
5960
|
await createBranch(project.workdir, name, sb);
|
|
5943
|
-
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-
|
|
5961
|
+
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-AUDWMF55.js");
|
|
5944
5962
|
const allSessions = sessionManager.listSessions();
|
|
5945
5963
|
for (const s of allSessions) {
|
|
5946
5964
|
if (sessionManager.getEffectiveWorkdir(s.id) === project.workdir) {
|
|
@@ -5957,7 +5975,7 @@ async function createServerHandle(config3) {
|
|
|
5957
5975
|
const session = sessionManager.getSession(req.params.id);
|
|
5958
5976
|
if (!session) return res.status(404).json({ error: "Session not found" });
|
|
5959
5977
|
const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
|
|
5960
|
-
const { listBranches, getDefaultBranch } = await import("./workspace-
|
|
5978
|
+
const { listBranches, getDefaultBranch } = await import("./workspace-2NDXTCVR.js");
|
|
5961
5979
|
const [branches, defaultBranch] = await Promise.all([
|
|
5962
5980
|
listBranches(effectiveWorkdir),
|
|
5963
5981
|
getDefaultBranch(session.workdir)
|
|
@@ -5971,8 +5989,8 @@ async function createServerHandle(config3) {
|
|
|
5971
5989
|
const { branch } = req.body;
|
|
5972
5990
|
if (!branch || typeof branch !== "string") return res.status(400).json({ error: "branch is required" });
|
|
5973
5991
|
const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
|
|
5974
|
-
const { checkoutBranch, validateRef: validateRef2 } = await import("./workspace-
|
|
5975
|
-
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-
|
|
5992
|
+
const { checkoutBranch, validateRef: validateRef2 } = await import("./workspace-2NDXTCVR.js");
|
|
5993
|
+
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-AUDWMF55.js");
|
|
5976
5994
|
try {
|
|
5977
5995
|
await validateRef2(effectiveWorkdir, branch);
|
|
5978
5996
|
await checkoutBranch(effectiveWorkdir, branch);
|
|
@@ -6014,16 +6032,16 @@ All file and git operations should use this branch.
|
|
|
6014
6032
|
const { name, sourceBranch } = req.body;
|
|
6015
6033
|
if (!name || typeof name !== "string") return res.status(400).json({ error: "name is required" });
|
|
6016
6034
|
const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
|
|
6017
|
-
const { validateRef: validateRef2 } = await import("./workspace-
|
|
6018
|
-
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-
|
|
6035
|
+
const { validateRef: validateRef2 } = await import("./workspace-2NDXTCVR.js");
|
|
6036
|
+
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-AUDWMF55.js");
|
|
6019
6037
|
try {
|
|
6020
6038
|
await validateRef2(effectiveWorkdir, name);
|
|
6021
6039
|
if (sourceBranch) {
|
|
6022
|
-
const { resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, createBranch } = await import("./workspace-
|
|
6040
|
+
const { resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, createBranch } = await import("./workspace-2NDXTCVR.js");
|
|
6023
6041
|
const sb = await resolveAndValidateSourceBranch2(effectiveWorkdir, sourceBranch, session.workdir);
|
|
6024
6042
|
await createBranch(effectiveWorkdir, name, sb);
|
|
6025
6043
|
} else {
|
|
6026
|
-
const { createBranch, getDefaultBranch, resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2 } = await import("./workspace-
|
|
6044
|
+
const { createBranch, getDefaultBranch, resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2 } = await import("./workspace-2NDXTCVR.js");
|
|
6027
6045
|
const defaultBranch = await getDefaultBranch(session.workdir);
|
|
6028
6046
|
const sb = await resolveAndValidateSourceBranch2(effectiveWorkdir, defaultBranch, session.workdir);
|
|
6029
6047
|
await createBranch(effectiveWorkdir, name, sb);
|
|
@@ -6064,14 +6082,14 @@ All file and git operations should use this branch.
|
|
|
6064
6082
|
const { getProject: getProject2 } = await import("./projects-M5XKC7O6.js");
|
|
6065
6083
|
const project = getProject2(req.params.id);
|
|
6066
6084
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
6067
|
-
const { listWorkspaces } = await import("./workspace-
|
|
6085
|
+
const { listWorkspaces } = await import("./workspace-2NDXTCVR.js");
|
|
6068
6086
|
const all = await listWorkspaces(project.name, project.workdir);
|
|
6069
6087
|
const workspacesList = all.filter((ws) => ws.path !== project.workdir);
|
|
6070
6088
|
res.json({ workspaces: workspacesList });
|
|
6071
6089
|
});
|
|
6072
6090
|
app.get("/api/sessions", async (req, res) => {
|
|
6073
|
-
const { getRecentUserPromptsForSession } = await import("./events-
|
|
6074
|
-
const { getPendingConfirmationsBySession } = await import("./path-security-
|
|
6091
|
+
const { getRecentUserPromptsForSession } = await import("./events-4THEZWVL.js");
|
|
6092
|
+
const { getPendingConfirmationsBySession } = await import("./path-security-6GYETPWN.js");
|
|
6075
6093
|
const projectId = req.query["projectId"];
|
|
6076
6094
|
const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
|
|
6077
6095
|
const offset = parseInt(req.query["offset"]) || 0;
|
|
@@ -6117,7 +6135,7 @@ All file and git operations should use this branch.
|
|
|
6117
6135
|
disabledServers = mcpManager.getAllServers().filter((s) => s.config.disabled).map((s) => s.name);
|
|
6118
6136
|
}
|
|
6119
6137
|
if (disabledServers.length > 0) {
|
|
6120
|
-
const { setSessionDisabledServers: setSessionDisabledServers2 } = await import("./session-overrides-
|
|
6138
|
+
const { setSessionDisabledServers: setSessionDisabledServers2 } = await import("./session-overrides-BQSE3V3F.js");
|
|
6121
6139
|
setSessionDisabledServers2(session.id, disabledServers);
|
|
6122
6140
|
}
|
|
6123
6141
|
} catch {
|
|
@@ -6154,7 +6172,7 @@ All file and git operations should use this branch.
|
|
|
6154
6172
|
if (!target || typeof target !== "string") return res.status(400).json({ error: "target is required" });
|
|
6155
6173
|
const project = sessionManager.getProject(session.projectId);
|
|
6156
6174
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
6157
|
-
const { isGitRepository } = await import("./workspace-
|
|
6175
|
+
const { isGitRepository } = await import("./workspace-2NDXTCVR.js");
|
|
6158
6176
|
if (!await isGitRepository(project.workdir)) {
|
|
6159
6177
|
return res.status(400).json({ error: "Project is not a git repository" });
|
|
6160
6178
|
}
|
|
@@ -6172,7 +6190,7 @@ All file and git operations should use this branch.
|
|
|
6172
6190
|
if (!target || typeof target !== "string") return res.status(400).json({ error: "target is required" });
|
|
6173
6191
|
const project = sessionManager.getProject(session.projectId);
|
|
6174
6192
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
6175
|
-
const { isGitRepository } = await import("./workspace-
|
|
6193
|
+
const { isGitRepository } = await import("./workspace-2NDXTCVR.js");
|
|
6176
6194
|
if (!await isGitRepository(project.workdir)) {
|
|
6177
6195
|
return res.status(400).json({ error: "Project is not a git repository" });
|
|
6178
6196
|
}
|
|
@@ -6190,9 +6208,9 @@ All file and git operations should use this branch.
|
|
|
6190
6208
|
}
|
|
6191
6209
|
});
|
|
6192
6210
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
6193
|
-
const { getEventStore: getEventStore2, combineEventsWithSnapshot } = await import("./events-
|
|
6194
|
-
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-
|
|
6195
|
-
const { getPendingQuestionsForSession } = await import("./tools-
|
|
6211
|
+
const { getEventStore: getEventStore2, combineEventsWithSnapshot } = await import("./events-4THEZWVL.js");
|
|
6212
|
+
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-OYBO2NTH.js");
|
|
6213
|
+
const { getPendingQuestionsForSession } = await import("./tools-I3BAXRVD.js");
|
|
6196
6214
|
const { getMaxVisibleItems } = await import("./settings-2WVGUPYV.js");
|
|
6197
6215
|
const session = sessionManager.getSession(req.params.id);
|
|
6198
6216
|
if (!session) {
|
|
@@ -6225,8 +6243,8 @@ All file and git operations should use this branch.
|
|
|
6225
6243
|
if (!session) {
|
|
6226
6244
|
return res.status(404).json({ error: "Session not found" });
|
|
6227
6245
|
}
|
|
6228
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
6229
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
6246
|
+
const { stopSessionExecution } = await import("./chat-handler-XXXMTO7W.js");
|
|
6247
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-I3BAXRVD.js");
|
|
6230
6248
|
sessionManager.clearMessageQueue(sessionId);
|
|
6231
6249
|
stopSessionExecution(sessionId, sessionManager);
|
|
6232
6250
|
abortSession(sessionId);
|
|
@@ -6255,8 +6273,8 @@ All file and git operations should use this branch.
|
|
|
6255
6273
|
res.json({ success: true });
|
|
6256
6274
|
});
|
|
6257
6275
|
app.post("/api/sessions/:id/provider", async (req, res) => {
|
|
6258
|
-
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-
|
|
6259
|
-
const { buildMessagesFromStoredEvents } = await import("./folding-
|
|
6276
|
+
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-4THEZWVL.js");
|
|
6277
|
+
const { buildMessagesFromStoredEvents } = await import("./folding-OYBO2NTH.js");
|
|
6260
6278
|
const { getMaxVisibleItems } = await import("./settings-2WVGUPYV.js");
|
|
6261
6279
|
const sessionId = req.params.id;
|
|
6262
6280
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -6292,7 +6310,7 @@ All file and git operations should use this branch.
|
|
|
6292
6310
|
if (!result.success) {
|
|
6293
6311
|
return res.status(500).json({ error: result.error ?? "Failed to set default model" });
|
|
6294
6312
|
}
|
|
6295
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
6313
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-M7RDIFC5.js");
|
|
6296
6314
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6297
6315
|
const updatedConfig = setDefaultModelSelection(globalConfig, providerId, model);
|
|
6298
6316
|
await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
|
|
@@ -6370,8 +6388,8 @@ All file and git operations should use this branch.
|
|
|
6370
6388
|
res.json({ success: true });
|
|
6371
6389
|
});
|
|
6372
6390
|
app.put("/api/sessions/:id/mode", async (req, res) => {
|
|
6373
|
-
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-
|
|
6374
|
-
const { buildMessagesFromStoredEvents } = await import("./folding-
|
|
6391
|
+
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-4THEZWVL.js");
|
|
6392
|
+
const { buildMessagesFromStoredEvents } = await import("./folding-OYBO2NTH.js");
|
|
6375
6393
|
const { getMaxVisibleItems } = await import("./settings-2WVGUPYV.js");
|
|
6376
6394
|
const sessionId = req.params.id;
|
|
6377
6395
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -6458,7 +6476,7 @@ All file and git operations should use this branch.
|
|
|
6458
6476
|
if (alwaysAllow !== void 0 && typeof alwaysAllow !== "boolean") {
|
|
6459
6477
|
return res.status(400).json({ error: "alwaysAllow must be a boolean if provided" });
|
|
6460
6478
|
}
|
|
6461
|
-
const { providePathConfirmation, getConfirmationSessionId } = await import("./tools-
|
|
6479
|
+
const { providePathConfirmation, getConfirmationSessionId } = await import("./tools-I3BAXRVD.js");
|
|
6462
6480
|
const pendingSessionId = getConfirmationSessionId(callId);
|
|
6463
6481
|
if (!pendingSessionId) {
|
|
6464
6482
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
@@ -6470,10 +6488,10 @@ All file and git operations should use this branch.
|
|
|
6470
6488
|
if (!result.found) {
|
|
6471
6489
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
6472
6490
|
}
|
|
6473
|
-
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEvents } = await import("./events-
|
|
6474
|
-
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-
|
|
6491
|
+
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEvents } = await import("./events-4THEZWVL.js");
|
|
6492
|
+
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-OYBO2NTH.js");
|
|
6475
6493
|
const { createSessionStateMessage } = await import("./protocol-YDNGGADL.js");
|
|
6476
|
-
const { getPendingQuestionsForSession } = await import("./tools-
|
|
6494
|
+
const { getPendingQuestionsForSession } = await import("./tools-I3BAXRVD.js");
|
|
6477
6495
|
const { getMaxVisibleItems } = await import("./settings-2WVGUPYV.js");
|
|
6478
6496
|
const eventStore = getEventStore2();
|
|
6479
6497
|
const { snapshot, events: eventsSinceSnapshot } = eventStore.getEventsSinceSnapshot(sessionId);
|
|
@@ -6510,7 +6528,7 @@ All file and git operations should use this branch.
|
|
|
6510
6528
|
if (!skip && typeof answer !== "string") {
|
|
6511
6529
|
return res.status(400).json({ error: "answer is required when not skipping" });
|
|
6512
6530
|
}
|
|
6513
|
-
const { provideAnswer } = await import("./tools-
|
|
6531
|
+
const { provideAnswer } = await import("./tools-I3BAXRVD.js");
|
|
6514
6532
|
const found = provideAnswer(callId, answer ?? "", skip ?? false);
|
|
6515
6533
|
if (!found) {
|
|
6516
6534
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -6575,7 +6593,7 @@ All file and git operations should use this branch.
|
|
|
6575
6593
|
backend: activeProvider?.backend ?? llmClient.getBackend(),
|
|
6576
6594
|
model: llmClient.getModel()
|
|
6577
6595
|
};
|
|
6578
|
-
const { runAgentTurn, TurnMetrics } = await import("./orchestrator-
|
|
6596
|
+
const { runAgentTurn, TurnMetrics } = await import("./orchestrator-MTCF2EPU.js");
|
|
6579
6597
|
runAgentTurn(
|
|
6580
6598
|
{
|
|
6581
6599
|
sessionManager,
|
|
@@ -6613,15 +6631,15 @@ All file and git operations should use this branch.
|
|
|
6613
6631
|
if (!session) {
|
|
6614
6632
|
return res.status(404).json({ error: "Session not found" });
|
|
6615
6633
|
}
|
|
6616
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
6617
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
6634
|
+
const { stopSessionExecution } = await import("./chat-handler-XXXMTO7W.js");
|
|
6635
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-I3BAXRVD.js");
|
|
6618
6636
|
const queuedMessages = sessionManager.getQueueState(sessionId);
|
|
6619
6637
|
sessionManager.clearMessageQueue(sessionId);
|
|
6620
6638
|
stopSessionExecution(sessionId, sessionManager);
|
|
6621
6639
|
abortSession(sessionId);
|
|
6622
6640
|
cancelQuestionsForSession(sessionId, "Session stopped by user");
|
|
6623
6641
|
cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
|
|
6624
|
-
const eventStore = (await import("./events-
|
|
6642
|
+
const eventStore = (await import("./events-4THEZWVL.js")).getEventStore();
|
|
6625
6643
|
eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
|
|
6626
6644
|
res.json({ success: true, queuedMessages });
|
|
6627
6645
|
});
|
|
@@ -6635,7 +6653,7 @@ All file and git operations should use this branch.
|
|
|
6635
6653
|
if (typeof messageIndex !== "number" || messageIndex < 0) {
|
|
6636
6654
|
return res.status(400).json({ error: "messageIndex must be a non-negative number" });
|
|
6637
6655
|
}
|
|
6638
|
-
const { truncateSessionMessages } = await import("./events-
|
|
6656
|
+
const { truncateSessionMessages } = await import("./events-4THEZWVL.js");
|
|
6639
6657
|
truncateSessionMessages(sessionId, messageIndex);
|
|
6640
6658
|
res.json({ success: true });
|
|
6641
6659
|
});
|
|
@@ -6652,8 +6670,8 @@ All file and git operations should use this branch.
|
|
|
6652
6670
|
if (content !== void 0 && (typeof content !== "string" || !content.trim())) {
|
|
6653
6671
|
return res.status(400).json({ error: "content must be a non-empty string if provided" });
|
|
6654
6672
|
}
|
|
6655
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
6656
|
-
const { buildMessagesFromStoredEvents } = await import("./folding-
|
|
6673
|
+
const { getEventStore: getEventStore2 } = await import("./events-4THEZWVL.js");
|
|
6674
|
+
const { buildMessagesFromStoredEvents } = await import("./folding-OYBO2NTH.js");
|
|
6657
6675
|
const eventStore = getEventStore2();
|
|
6658
6676
|
const events = eventStore.getEvents(sessionId);
|
|
6659
6677
|
const { messages } = buildMessagesFromStoredEvents(events);
|
|
@@ -6665,7 +6683,7 @@ All file and git operations should use this branch.
|
|
|
6665
6683
|
if (msg.role !== "user" || msg.isSystemGenerated) {
|
|
6666
6684
|
return res.status(400).json({ error: "Can only replay user messages" });
|
|
6667
6685
|
}
|
|
6668
|
-
const { truncateSessionMessages } = await import("./events-
|
|
6686
|
+
const { truncateSessionMessages } = await import("./events-4THEZWVL.js");
|
|
6669
6687
|
truncateSessionMessages(sessionId, msgIndex - 1);
|
|
6670
6688
|
sessionManager.queueMessage(sessionId, "asap", content ?? msg.content, msg.attachments, msg.messageKind);
|
|
6671
6689
|
res.json({ success: true });
|
|
@@ -6782,7 +6800,7 @@ All file and git operations should use this branch.
|
|
|
6782
6800
|
let visionFallback;
|
|
6783
6801
|
let globalWorkdir;
|
|
6784
6802
|
try {
|
|
6785
|
-
const { loadGlobalConfig, getVisionFallback } = await import("./config-
|
|
6803
|
+
const { loadGlobalConfig, getVisionFallback } = await import("./config-M7RDIFC5.js");
|
|
6786
6804
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
6787
6805
|
const fallback = getVisionFallback(globalConfig);
|
|
6788
6806
|
if (fallback) {
|
|
@@ -6791,7 +6809,8 @@ All file and git operations should use this branch.
|
|
|
6791
6809
|
url: fallback.url ?? "http://localhost:11434",
|
|
6792
6810
|
model: fallback.model ?? "qwen3.5:0.8b",
|
|
6793
6811
|
timeout: fallback.timeout ?? 120,
|
|
6794
|
-
backend: fallback.backend ?? "ollama"
|
|
6812
|
+
backend: fallback.backend ?? "ollama",
|
|
6813
|
+
...fallback.providerModelRef ? { providerModelRef: fallback.providerModelRef } : {}
|
|
6795
6814
|
};
|
|
6796
6815
|
}
|
|
6797
6816
|
globalWorkdir = globalConfig.workspace?.workdir;
|
|
@@ -6981,7 +7000,7 @@ All file and git operations should use this branch.
|
|
|
6981
7000
|
const backend = req.query["backend"];
|
|
6982
7001
|
if (!url) return res.status(400).json({ error: "url is required" });
|
|
6983
7002
|
try {
|
|
6984
|
-
const { fetchModelsWithContext } = await import("./provider-manager-
|
|
7003
|
+
const { fetchModelsWithContext } = await import("./provider-manager-23O5QVDJ.js");
|
|
6985
7004
|
const { getModelProfile: getModelProfile2 } = await import("./profiles-5J7F4BML.js");
|
|
6986
7005
|
const models = await fetchModelsWithContext(
|
|
6987
7006
|
url,
|
|
@@ -7121,7 +7140,7 @@ All file and git operations should use this branch.
|
|
|
7121
7140
|
return res.status(400).json({ error: "name, url, and backend are required" });
|
|
7122
7141
|
}
|
|
7123
7142
|
try {
|
|
7124
|
-
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-
|
|
7143
|
+
const { loadGlobalConfig, saveGlobalConfig, addProvider, setDefaultModelSelection } = await import("./config-M7RDIFC5.js");
|
|
7125
7144
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
7126
7145
|
const providerBackend = backend;
|
|
7127
7146
|
const providerModels = modelConfigs?.length ? buildModelConfigs(modelConfigs) : model ? [{ id: model, contextWindow: 2e5, source: "user" }] : [];
|
|
@@ -7161,12 +7180,13 @@ All file and git operations should use this branch.
|
|
|
7161
7180
|
app.post("/api/init/config", async (req, res) => {
|
|
7162
7181
|
const { workdir, visionFallback } = req.body;
|
|
7163
7182
|
try {
|
|
7164
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
7183
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-M7RDIFC5.js");
|
|
7165
7184
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
7185
|
+
const updatedVf = visionFallback ? { ...globalConfig.visionFallback, ...visionFallback } : globalConfig.visionFallback;
|
|
7166
7186
|
const updatedConfig = {
|
|
7167
7187
|
...globalConfig,
|
|
7168
7188
|
workspace: workdir ? { workdir } : globalConfig.workspace,
|
|
7169
|
-
visionFallback:
|
|
7189
|
+
visionFallback: updatedVf
|
|
7170
7190
|
};
|
|
7171
7191
|
await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
|
|
7172
7192
|
res.json({ success: true });
|
|
@@ -7177,6 +7197,93 @@ All file and git operations should use this branch.
|
|
|
7177
7197
|
});
|
|
7178
7198
|
}
|
|
7179
7199
|
});
|
|
7200
|
+
app.put("/api/config/vision-fallback", async (req, res) => {
|
|
7201
|
+
const { z } = await import("zod");
|
|
7202
|
+
const visionFallbackUpdateSchema = z.object({
|
|
7203
|
+
enabled: z.boolean().optional(),
|
|
7204
|
+
url: z.string().optional(),
|
|
7205
|
+
model: z.string().optional(),
|
|
7206
|
+
timeout: z.number().positive().optional(),
|
|
7207
|
+
backend: z.enum(["ollama", "openai"]).optional(),
|
|
7208
|
+
providerModelRef: z.string().optional()
|
|
7209
|
+
});
|
|
7210
|
+
const parsed = visionFallbackUpdateSchema.safeParse(req.body);
|
|
7211
|
+
if (!parsed.success) {
|
|
7212
|
+
res.status(400).json({ success: false, error: parsed.error.issues.map((i) => i.message).join(", ") });
|
|
7213
|
+
return;
|
|
7214
|
+
}
|
|
7215
|
+
const updates = parsed.data;
|
|
7216
|
+
try {
|
|
7217
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-M7RDIFC5.js");
|
|
7218
|
+
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
7219
|
+
const filteredUpdates = Object.fromEntries(Object.entries(updates).filter(([, v]) => v !== void 0));
|
|
7220
|
+
const updatedConfig = {
|
|
7221
|
+
...globalConfig,
|
|
7222
|
+
visionFallback: {
|
|
7223
|
+
...globalConfig.visionFallback ?? {
|
|
7224
|
+
enabled: false,
|
|
7225
|
+
url: "http://localhost:11434",
|
|
7226
|
+
model: "qwen3.5:0.8b",
|
|
7227
|
+
timeout: 120,
|
|
7228
|
+
backend: "ollama"
|
|
7229
|
+
},
|
|
7230
|
+
...filteredUpdates
|
|
7231
|
+
}
|
|
7232
|
+
};
|
|
7233
|
+
await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
|
|
7234
|
+
res.json({ success: true });
|
|
7235
|
+
} catch (error) {
|
|
7236
|
+
res.status(500).json({
|
|
7237
|
+
success: false,
|
|
7238
|
+
error: error instanceof Error ? error.message : "Failed to save vision fallback config"
|
|
7239
|
+
});
|
|
7240
|
+
}
|
|
7241
|
+
});
|
|
7242
|
+
app.post("/api/config/vision-fallback/test", async (req, res) => {
|
|
7243
|
+
const { z } = await import("zod");
|
|
7244
|
+
const testSchema = z.object({
|
|
7245
|
+
url: z.string().optional(),
|
|
7246
|
+
model: z.string().optional(),
|
|
7247
|
+
backend: z.enum(["ollama", "openai"]).optional(),
|
|
7248
|
+
providerModelRef: z.string().optional(),
|
|
7249
|
+
timeout: z.number().positive().optional()
|
|
7250
|
+
});
|
|
7251
|
+
const parsed = testSchema.safeParse(req.body);
|
|
7252
|
+
if (!parsed.success) {
|
|
7253
|
+
res.status(400).json({ success: false, error: parsed.error.issues.map((i) => i.message).join(", ") });
|
|
7254
|
+
return;
|
|
7255
|
+
}
|
|
7256
|
+
const testConfig = parsed.data;
|
|
7257
|
+
try {
|
|
7258
|
+
const { resolveVisionFallback } = await import("./config-M7RDIFC5.js");
|
|
7259
|
+
const { loadGlobalConfig } = await import("./config-M7RDIFC5.js");
|
|
7260
|
+
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
7261
|
+
const filteredTestConfig = Object.fromEntries(Object.entries(testConfig).filter(([, v]) => v !== void 0));
|
|
7262
|
+
const testVisionFallback = {
|
|
7263
|
+
...globalConfig.visionFallback ?? {
|
|
7264
|
+
enabled: true,
|
|
7265
|
+
url: "http://localhost:11434",
|
|
7266
|
+
model: "qwen3.5:0.8b",
|
|
7267
|
+
timeout: 120,
|
|
7268
|
+
backend: "ollama"
|
|
7269
|
+
},
|
|
7270
|
+
...filteredTestConfig,
|
|
7271
|
+
enabled: true
|
|
7272
|
+
};
|
|
7273
|
+
const testGlobalConfig = { ...globalConfig, visionFallback: testVisionFallback };
|
|
7274
|
+
const resolved = resolveVisionFallback(testGlobalConfig);
|
|
7275
|
+
if (resolved) {
|
|
7276
|
+
res.json({
|
|
7277
|
+
success: true,
|
|
7278
|
+
description: `Config valid: ${resolved.model} @ ${resolved.baseUrl} (${resolved.backend})`
|
|
7279
|
+
});
|
|
7280
|
+
} else {
|
|
7281
|
+
res.json({ success: false, error: "Could not resolve vision model config. Check your settings." });
|
|
7282
|
+
}
|
|
7283
|
+
} catch (error) {
|
|
7284
|
+
res.json({ success: false, error: error instanceof Error ? error.message : "Test failed" });
|
|
7285
|
+
}
|
|
7286
|
+
});
|
|
7180
7287
|
app.use("/api/plugins", createPluginRoutes({ config: config3, providerAdapters, pluginDiagnostics, logger }));
|
|
7181
7288
|
app.get("/api/plugins", (_req, res) => res.json({ plugins: pluginDiagnostics }));
|
|
7182
7289
|
app.get("/api/provider-presets", (_req, res) => res.json({ presets: providerAdapters.getPresets() }));
|
|
@@ -7200,7 +7307,7 @@ All file and git operations should use this branch.
|
|
|
7200
7307
|
});
|
|
7201
7308
|
app.delete("/api/providers/:id", async (req, res) => {
|
|
7202
7309
|
const { id } = req.params;
|
|
7203
|
-
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-
|
|
7310
|
+
const { loadGlobalConfig, saveGlobalConfig, removeProvider } = await import("./config-M7RDIFC5.js");
|
|
7204
7311
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
7205
7312
|
const updatedConfig = removeProvider(globalConfig, id);
|
|
7206
7313
|
await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
|
|
@@ -7212,7 +7319,7 @@ All file and git operations should use this branch.
|
|
|
7212
7319
|
const { id } = req.params;
|
|
7213
7320
|
const { isLocal } = req.body;
|
|
7214
7321
|
try {
|
|
7215
|
-
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-
|
|
7322
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-M7RDIFC5.js");
|
|
7216
7323
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
7217
7324
|
const provider = globalConfig.providers.find((p) => p.id === id);
|
|
7218
7325
|
if (!provider) {
|
|
@@ -7243,7 +7350,7 @@ All file and git operations should use this branch.
|
|
|
7243
7350
|
transportAdapter
|
|
7244
7351
|
} = req.body;
|
|
7245
7352
|
try {
|
|
7246
|
-
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-
|
|
7353
|
+
const { loadGlobalConfig, saveGlobalConfig, updateProvider } = await import("./config-M7RDIFC5.js");
|
|
7247
7354
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
7248
7355
|
const provider = globalConfig.providers.find((p) => p.id === id);
|
|
7249
7356
|
if (!provider) {
|
|
@@ -7283,7 +7390,7 @@ All file and git operations should use this branch.
|
|
|
7283
7390
|
return res.status(400).json({ error: result.error });
|
|
7284
7391
|
}
|
|
7285
7392
|
const llmClient = getLLMClient();
|
|
7286
|
-
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-
|
|
7393
|
+
const { loadGlobalConfig, saveGlobalConfig, setDefaultModelSelection } = await import("./config-M7RDIFC5.js");
|
|
7287
7394
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
7288
7395
|
const updatedConfig = setDefaultModelSelection(globalConfig, id, llmClient.getModel());
|
|
7289
7396
|
await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
|
|
@@ -7310,7 +7417,7 @@ All file and git operations should use this branch.
|
|
|
7310
7417
|
});
|
|
7311
7418
|
async function rebuildMcpTools() {
|
|
7312
7419
|
const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-MOGEI6TP.js");
|
|
7313
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
7420
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-I3BAXRVD.js");
|
|
7314
7421
|
const mcpTools = createMcpTools2(mcpManager);
|
|
7315
7422
|
setMcpTools2(mcpTools);
|
|
7316
7423
|
}
|
|
@@ -7380,7 +7487,7 @@ All file and git operations should use this branch.
|
|
|
7380
7487
|
};
|
|
7381
7488
|
await mcpManager.addServer(name, serverCfg);
|
|
7382
7489
|
const server = mcpManager.getServer(name);
|
|
7383
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
7490
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-M7RDIFC5.js");
|
|
7384
7491
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
7385
7492
|
const updatedMcpServers = { ...globalConfig.mcpServers ?? {}, [name]: serverCfg };
|
|
7386
7493
|
await saveGlobalConfig(
|
|
@@ -7438,7 +7545,7 @@ All file and git operations should use this branch.
|
|
|
7438
7545
|
return res.status(400).json({ error: "disabled must be a boolean" });
|
|
7439
7546
|
}
|
|
7440
7547
|
try {
|
|
7441
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
7548
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-M7RDIFC5.js");
|
|
7442
7549
|
const { applyMcpServerUpdate } = await import("./update-server-4I6LXE5K.js");
|
|
7443
7550
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
7444
7551
|
const mcpServers2 = { ...globalConfig.mcpServers ?? {} };
|
|
@@ -7484,7 +7591,7 @@ All file and git operations should use this branch.
|
|
|
7484
7591
|
return res.status(404).json({ error: `MCP server '${name}' not found` });
|
|
7485
7592
|
}
|
|
7486
7593
|
mcpManager.removeServer(name);
|
|
7487
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
7594
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-M7RDIFC5.js");
|
|
7488
7595
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
7489
7596
|
const updatedMcpServers = { ...globalConfig.mcpServers ?? {} };
|
|
7490
7597
|
delete updatedMcpServers[name];
|
|
@@ -7514,7 +7621,7 @@ All file and git operations should use this branch.
|
|
|
7514
7621
|
await mcpManager.setToolEnabled(name, toolName, enabled);
|
|
7515
7622
|
const server = mcpManager.getServer(name);
|
|
7516
7623
|
if (server) {
|
|
7517
|
-
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-
|
|
7624
|
+
const { loadGlobalConfig, saveGlobalConfig } = await import("./config-M7RDIFC5.js");
|
|
7518
7625
|
const globalConfig = await loadGlobalConfig(config3.mode ?? "production", config3.globalConfigPath);
|
|
7519
7626
|
const mcpServers2 = { ...globalConfig.mcpServers ?? {} };
|
|
7520
7627
|
const serverCfg = mcpServers2[name];
|
|
@@ -7717,7 +7824,7 @@ All file and git operations should use this branch.
|
|
|
7717
7824
|
const state = sessionManager.getContextState(sessionId);
|
|
7718
7825
|
wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
|
|
7719
7826
|
});
|
|
7720
|
-
const { QueueProcessor } = await import("./processor-
|
|
7827
|
+
const { QueueProcessor } = await import("./processor-F3EZWNPO.js");
|
|
7721
7828
|
const queueProcessor = new QueueProcessor({
|
|
7722
7829
|
sessionManager,
|
|
7723
7830
|
providerManager,
|
|
@@ -7801,4 +7908,4 @@ export {
|
|
|
7801
7908
|
createServerHandle,
|
|
7802
7909
|
createServer
|
|
7803
7910
|
};
|
|
7804
|
-
//# sourceMappingURL=chunk-
|
|
7911
|
+
//# sourceMappingURL=chunk-GPGJBDI6.js.map
|