openfox 2.0.133 → 2.0.134
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 +12 -0
- package/dist/CHANGELOG.md +12 -0
- package/dist/{chat-handler-T47GATL5.js → chat-handler-YCZE2XEJ.js} +23 -22
- package/dist/chunk-24YKXKCG.js +35 -0
- package/dist/chunk-2OMGR7LN.js +45 -0
- package/dist/{chunk-OUQZZEIQ.js → chunk-5IXCCMFU.js} +335 -187
- package/dist/{chunk-MQMPIXON.js → chunk-5UMXFLET.js} +3 -3
- package/dist/{chunk-5JWJEZJ3.js → chunk-5UQ4CKOA.js} +2 -2
- package/dist/{chunk-P5MSY7ZI.js → chunk-7HGBJFIJ.js} +22 -17
- package/dist/{chunk-7JVBDBXE.js → chunk-7QMWYNVF.js} +2 -2
- package/dist/{chunk-P57IBMK4.js → chunk-AATMPL7S.js} +4 -4
- package/dist/{chunk-ZL4IAFF3.js → chunk-BZND27IB.js} +3 -3
- package/dist/{chunk-FGNJMKDV.js → chunk-CSYOWFPU.js} +5 -5
- package/dist/{chunk-LQKXJPKP.js → chunk-CTWZPN7G.js} +5 -1
- package/dist/{chunk-BKMWZTNO.js → chunk-DWA4IE65.js} +14 -2
- package/dist/{chunk-RRUSYVQD.js → chunk-FAQDLL2X.js} +8 -8
- package/dist/{chunk-HCYSGLY2.js → chunk-HF3NDXB4.js} +1 -1
- package/dist/{chunk-6EZDW4JS.js → chunk-J3NMNYGM.js} +2 -2
- package/dist/{chunk-HXHPKGJE.js → chunk-J5HOUEPE.js} +614 -157
- package/dist/{chunk-A7CB4USC.js → chunk-M4J2L4VH.js} +132 -45
- package/dist/{chunk-M5T4RDPJ.js → chunk-MEEUXRFL.js} +2 -2
- package/dist/{chunk-OMMPTN6X.js → chunk-MRE4OYKI.js} +69 -27
- package/dist/{chunk-MGEYAYGU.js → chunk-O3RCSKUH.js} +2 -2
- package/dist/{chunk-ELYHHEYL.js → chunk-ORCQ3EXQ.js} +2 -2
- package/dist/{chunk-FEIRWXLX.js → chunk-OZWHRBDY.js} +64 -17
- package/dist/{chunk-TACWRDDC.js → chunk-QDARWVQ2.js} +2 -2
- package/dist/{chunk-VXG3AFFY.js → chunk-QICVOQNX.js} +8 -8
- package/dist/chunk-QTLYD2FF.js +7 -0
- package/dist/{chunk-Y6ZGHOKM.js → chunk-YLVOU7T7.js} +4 -4
- package/dist/{chunk-GFW2HWJ6.js → chunk-YOPXAI2W.js} +37 -16
- package/dist/{chunk-CLDCHOEA.js → chunk-ZMK4VX7V.js} +2 -2
- package/dist/{chunk-KWAHD2JA.js → chunk-ZTBKMVV6.js} +2 -2
- package/dist/cli/dev.js +4 -1
- package/dist/cli/index.js +4 -1
- package/dist/{client-2K6PPPJJ.js → client-VVYOWXRR.js} +4 -4
- package/dist/{compactor-OEJAA2YP.js → compactor-PD6DQ4NY.js} +9 -9
- package/dist/{dynamic-context-NJZKAZE3.js → dynamic-context-WKEXQCTK.js} +10 -10
- package/dist/{events-ZJPRGVL2.js → events-3WSNI7XC.js} +6 -6
- package/dist/{folding-QRZOHY2I.js → folding-H7JTX6KI.js} +4 -4
- package/dist/{http-client-P4XTKAZA.js → http-client-A445WYZU.js} +3 -3
- package/dist/{install-VA2F6X6Z.js → install-AVTFA344.js} +64 -15
- package/dist/{launch-UKXVO37B.js → launch-FJ65HRV4.js} +23 -22
- package/dist/{manager-TMBFBCQL.js → manager-ZACEUL5P.js} +4 -4
- package/dist/{mcp-YU7AM3UV.js → mcp-SQ4DOGPT.js} +22 -9
- package/dist/{orchestrator-GX22Y5EM.js → orchestrator-OT66EDXO.js} +22 -21
- package/dist/package.json +3 -1
- package/dist/{path-security-CBACXAMS.js → path-security-5CFMMULR.js} +10 -10
- package/dist/{platform-5LQXOZO3.js → platform-XPMZKAUB.js} +3 -3
- package/dist/{processor-V35OLKRV.js → processor-CHMHMMIE.js} +22 -21
- package/dist/{project-creator-6AGQTNXB.js → project-creator-T3A4H3YV.js} +42 -29
- package/dist/{protocol-BMUoqwYH.d.ts → protocol-Nr_H1_oC.d.ts} +3 -1
- package/dist/{protocol-Y7MRKRUO.js → protocol-XO4ZROAU.js} +3 -3
- package/dist/provider/index.d.ts +4 -4
- package/dist/provider-JWUNG2TD.js +507 -0
- package/dist/{provider-manager-BO5ZBG3T.js → provider-manager-2KKZ37XJ.js} +5 -5
- package/dist/pwa-V5PFB4OQ.js +502 -0
- package/dist/{registry-CMSSZHDC.js → registry-BEIR7Y5G.js} +3 -3
- package/dist/{serve-XRVT3D7Z.js → serve-HSDVY37K.js} +47 -36
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +27 -26
- package/dist/{server-GXMZMPXI.js → server-3UVLECD5.js} +26 -25
- package/dist/{service-WKABQHKL.js → service-M77VWL2M.js} +97 -32
- package/dist/{service-O3LCO3TQ.js → service-XIUNS5XV.js} +7 -6
- package/dist/{session-overrides-OECQYRDK.js → session-overrides-Y5B4XQPU.js} +5 -5
- package/dist/{sessions-NMPX5ICI.js → sessions-IGINPPBP.js} +4 -4
- package/dist/{settings-MDCRNQBY.js → settings-ZJPM6PQV.js} +2 -2
- package/dist/shared/index.d.ts +31 -4
- package/dist/shared/index.js +16 -2
- package/dist/{tasks-WOC3QUFA.js → tasks-3JJWJJ3X.js} +34 -18
- package/dist/{tools-CW6POKUL.js → tools-WWIWD3O7.js} +20 -19
- package/dist/{types-CoY8Ka1C.d.ts → types-BlQjLBui.d.ts} +1 -1
- package/dist/{types-BIkpxjaj.d.ts → types-G10ho8PT.d.ts} +1 -1
- package/dist/update-Q6SH7UP2.js +76 -0
- package/dist/web/assets/index-C48qmBAI.js +313 -0
- package/dist/web/index.html +1 -1
- package/dist/web/sw.js +1 -1
- package/package.json +3 -1
- package/dist/chunk-JKGHTBEV.js +0 -7
- package/dist/provider-NWRGNGS3.js +0 -403
- package/dist/pwa-2GRFSXD7.js +0 -363
- package/dist/update-VC3Y3EOP.js +0 -49
- package/dist/web/assets/index-ATAQvBwl.js +0 -312
|
@@ -24,10 +24,10 @@ import {
|
|
|
24
24
|
terminalManager,
|
|
25
25
|
tokenFromPassword,
|
|
26
26
|
verifyPassword
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-M4J2L4VH.js";
|
|
28
28
|
import {
|
|
29
29
|
TEMPLATE_VARIABLES
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-7HGBJFIJ.js";
|
|
31
31
|
import {
|
|
32
32
|
createToolRegistry,
|
|
33
33
|
devServerManager,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
setMcpManagerForTools,
|
|
43
43
|
setMcpTools,
|
|
44
44
|
setNotifyMcpServersChanged
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-J5HOUEPE.js";
|
|
46
46
|
import {
|
|
47
47
|
checkoutBranchFromSharedSource,
|
|
48
48
|
deleteWorkspace,
|
|
@@ -86,12 +86,13 @@ import {
|
|
|
86
86
|
saveCommandToProject,
|
|
87
87
|
saveWorkflow,
|
|
88
88
|
saveWorkflowToProject,
|
|
89
|
+
serverT,
|
|
89
90
|
workflowExists
|
|
90
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-OZWHRBDY.js";
|
|
91
92
|
import {
|
|
92
93
|
getSessionDisabledServers,
|
|
93
94
|
setSessionDisabledServers
|
|
94
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-QDARWVQ2.js";
|
|
95
96
|
import {
|
|
96
97
|
createMcpTools
|
|
97
98
|
} from "./chunk-JE7LW7Y6.js";
|
|
@@ -113,12 +114,12 @@ import {
|
|
|
113
114
|
setSkillEnabled,
|
|
114
115
|
skillExists,
|
|
115
116
|
updateOwnedSkill
|
|
116
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-DWA4IE65.js";
|
|
117
118
|
import {
|
|
118
119
|
ALWAYS_ALLOWED,
|
|
119
120
|
ALWAYS_ALLOWED_FOR_SUBAGENTS,
|
|
120
121
|
TOP_LEVEL_ONLY_TOOLS
|
|
121
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-7QMWYNVF.js";
|
|
122
123
|
import {
|
|
123
124
|
EventEmitter,
|
|
124
125
|
getPendingQuestionsForSession,
|
|
@@ -127,7 +128,7 @@ import {
|
|
|
127
128
|
import {
|
|
128
129
|
getPendingConfirmationsBySession,
|
|
129
130
|
providePathConfirmation
|
|
130
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-YLVOU7T7.js";
|
|
131
132
|
import {
|
|
132
133
|
combineEventsWithSnapshot,
|
|
133
134
|
emitAssistantMessageStart,
|
|
@@ -145,10 +146,10 @@ import {
|
|
|
145
146
|
getEventStore,
|
|
146
147
|
getSessionState,
|
|
147
148
|
initEventStore
|
|
148
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-CSYOWFPU.js";
|
|
149
150
|
import {
|
|
150
151
|
buildMessagesFromStoredEvents
|
|
151
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-MEEUXRFL.js";
|
|
152
153
|
import {
|
|
153
154
|
clearWorkflowExecution,
|
|
154
155
|
createSession,
|
|
@@ -174,7 +175,7 @@ import {
|
|
|
174
175
|
updateSessionRunning,
|
|
175
176
|
updateSessionWorkdir,
|
|
176
177
|
updateWorkflowExecutionStatus
|
|
177
|
-
} from "./chunk-
|
|
178
|
+
} from "./chunk-ZTBKMVV6.js";
|
|
178
179
|
import {
|
|
179
180
|
agentExists,
|
|
180
181
|
deleteAgent,
|
|
@@ -191,7 +192,7 @@ import {
|
|
|
191
192
|
saveAgent,
|
|
192
193
|
saveAgentToProject,
|
|
193
194
|
setRuntimeConfig
|
|
194
|
-
} from "./chunk-
|
|
195
|
+
} from "./chunk-ORCQ3EXQ.js";
|
|
195
196
|
import {
|
|
196
197
|
findFileByInternalId,
|
|
197
198
|
pathExists
|
|
@@ -199,23 +200,23 @@ import {
|
|
|
199
200
|
import {
|
|
200
201
|
createContextStateMessage,
|
|
201
202
|
toClientSession
|
|
202
|
-
} from "./chunk-
|
|
203
|
+
} from "./chunk-AATMPL7S.js";
|
|
203
204
|
import {
|
|
204
205
|
getPathSeparator,
|
|
205
206
|
isAbsolutePath
|
|
206
|
-
} from "./chunk-
|
|
207
|
+
} from "./chunk-O3RCSKUH.js";
|
|
207
208
|
import {
|
|
208
209
|
createProviderManager,
|
|
209
210
|
detectModel,
|
|
210
211
|
getLlmStatus,
|
|
211
212
|
parseDefaultModelSelection
|
|
212
|
-
} from "./chunk-
|
|
213
|
+
} from "./chunk-5UQ4CKOA.js";
|
|
213
214
|
import {
|
|
214
215
|
buildOpenFoxMcpBootstrap
|
|
215
216
|
} from "./chunk-YNMP647F.js";
|
|
216
217
|
import {
|
|
217
218
|
VERSION
|
|
218
|
-
} from "./chunk-
|
|
219
|
+
} from "./chunk-QTLYD2FF.js";
|
|
219
220
|
import {
|
|
220
221
|
deleteProject,
|
|
221
222
|
getProject,
|
|
@@ -235,12 +236,12 @@ import {
|
|
|
235
236
|
import {
|
|
236
237
|
SessionNotFoundError,
|
|
237
238
|
WorkspaceInUseError
|
|
238
|
-
} from "./chunk-
|
|
239
|
+
} from "./chunk-J3NMNYGM.js";
|
|
239
240
|
import {
|
|
240
241
|
deleteSetting,
|
|
241
242
|
getSetting,
|
|
242
243
|
setSetting
|
|
243
|
-
} from "./chunk-
|
|
244
|
+
} from "./chunk-CTWZPN7G.js";
|
|
244
245
|
import {
|
|
245
246
|
initDatabase
|
|
246
247
|
} from "./chunk-JU757HVI.js";
|
|
@@ -253,7 +254,7 @@ import {
|
|
|
253
254
|
} from "./chunk-K44MW7JJ.js";
|
|
254
255
|
import {
|
|
255
256
|
createServerMessage
|
|
256
|
-
} from "./chunk-
|
|
257
|
+
} from "./chunk-HF3NDXB4.js";
|
|
257
258
|
import {
|
|
258
259
|
getGlobalConfigDir
|
|
259
260
|
} from "./chunk-CQGTEGKL.js";
|
|
@@ -3990,13 +3991,33 @@ var SessionManager = class {
|
|
|
3990
3991
|
}
|
|
3991
3992
|
} catch (innerErr) {
|
|
3992
3993
|
throw new Error(
|
|
3993
|
-
|
|
3994
|
+
serverT(
|
|
3995
|
+
{
|
|
3996
|
+
en: 'Failed to create branch "{{branch}}" in workspace "{{workspace}}": {{reason}}',
|
|
3997
|
+
fr: "\xC9chec de cr\xE9ation de la branche \xAB {{branch}} \xBB dans le workspace \xAB {{workspace}} \xBB : {{reason}}"
|
|
3998
|
+
},
|
|
3999
|
+
{
|
|
4000
|
+
branch,
|
|
4001
|
+
workspace: workspaceName,
|
|
4002
|
+
reason: innerErr instanceof Error ? innerErr.message : String(innerErr)
|
|
4003
|
+
}
|
|
4004
|
+
)
|
|
3994
4005
|
);
|
|
3995
4006
|
}
|
|
3996
4007
|
});
|
|
3997
4008
|
} catch (err) {
|
|
3998
4009
|
throw new Error(
|
|
3999
|
-
|
|
4010
|
+
serverT(
|
|
4011
|
+
{
|
|
4012
|
+
en: 'Failed to apply branch "{{branch}}" to workspace "{{workspace}}": {{reason}}',
|
|
4013
|
+
fr: "\xC9chec d\u2019application de la branche \xAB {{branch}} \xBB au workspace \xAB {{workspace}} \xBB : {{reason}}"
|
|
4014
|
+
},
|
|
4015
|
+
{
|
|
4016
|
+
branch,
|
|
4017
|
+
workspace: workspaceName,
|
|
4018
|
+
reason: err instanceof Error ? err.message : String(err)
|
|
4019
|
+
}
|
|
4020
|
+
)
|
|
4000
4021
|
);
|
|
4001
4022
|
}
|
|
4002
4023
|
}
|
|
@@ -4375,8 +4396,16 @@ async function loadItemsForScope(config3, configDir, projectDir, scope) {
|
|
|
4375
4396
|
var ID_REGEX = /^[a-z0-9-]+$/;
|
|
4376
4397
|
function validateNameIdPrompt(body) {
|
|
4377
4398
|
const meta = body["metadata"];
|
|
4378
|
-
if (!meta?.["name"] || !body["prompt"])
|
|
4379
|
-
|
|
4399
|
+
if (!meta?.["name"] || !body["prompt"])
|
|
4400
|
+
return serverT({
|
|
4401
|
+
en: "Missing required fields: metadata.name, prompt",
|
|
4402
|
+
fr: "Champs requis manquants : metadata.name, prompt"
|
|
4403
|
+
});
|
|
4404
|
+
if (meta["id"] && !ID_REGEX.test(String(meta["id"])))
|
|
4405
|
+
return serverT({
|
|
4406
|
+
en: "ID must be lowercase alphanumeric with hyphens only",
|
|
4407
|
+
fr: "L\u2019ID doit \xEAtre en minuscules alphanum\xE9riques, avec des tirets uniquement"
|
|
4408
|
+
});
|
|
4380
4409
|
return null;
|
|
4381
4410
|
}
|
|
4382
4411
|
function getProjectItemPath(projectDir, dirName, id, ext) {
|
|
@@ -4416,7 +4445,7 @@ function createCrudRoutes(config3, configDir, projectDir) {
|
|
|
4416
4445
|
const allDefaults = await config3.loadDefaults();
|
|
4417
4446
|
const item = allDefaults.find((d) => d.metadata.id === id);
|
|
4418
4447
|
if (!item) {
|
|
4419
|
-
return res.status(404).json({ error: "Default not found" });
|
|
4448
|
+
return res.status(404).json({ error: serverT({ en: "Default not found", fr: "\xC9l\xE9ment par d\xE9faut introuvable" }) });
|
|
4420
4449
|
}
|
|
4421
4450
|
res.json(item);
|
|
4422
4451
|
});
|
|
@@ -4432,7 +4461,7 @@ function createCrudRoutes(config3, configDir, projectDir) {
|
|
|
4432
4461
|
const items = await loadItemsForScope(config3, configDir, effectiveProjectDir, scope);
|
|
4433
4462
|
const item = config3.findById(id, items);
|
|
4434
4463
|
if (!item) {
|
|
4435
|
-
return res.status(404).json({ error: "Not found" });
|
|
4464
|
+
return res.status(404).json({ error: serverT({ en: "Not found", fr: "Introuvable" }) });
|
|
4436
4465
|
}
|
|
4437
4466
|
res.json(item);
|
|
4438
4467
|
});
|
|
@@ -4441,17 +4470,19 @@ function createCrudRoutes(config3, configDir, projectDir) {
|
|
|
4441
4470
|
const meta = body["metadata"];
|
|
4442
4471
|
const customError = config3.validateCreate?.(body);
|
|
4443
4472
|
if (!meta?.["id"] || customError) {
|
|
4444
|
-
return res.status(400).json({ error: customError ?? "Missing required fields" });
|
|
4473
|
+
return res.status(400).json({ error: customError ?? serverT({ en: "Missing required fields", fr: "Champs requis manquants" }) });
|
|
4445
4474
|
}
|
|
4446
4475
|
const id = String(meta["id"]);
|
|
4447
4476
|
const destination = body["destination"] ?? "user";
|
|
4448
4477
|
const effectiveProjectDir = resolveProjectDir(req, projectDir);
|
|
4449
4478
|
if (destination === "project" && !effectiveProjectDir) {
|
|
4450
|
-
return res.status(400).json({ error: "No project directory configured" });
|
|
4479
|
+
return res.status(400).json({ error: serverT({ en: "No project directory configured", fr: "Aucun r\xE9pertoire de projet configur\xE9" }) });
|
|
4451
4480
|
}
|
|
4452
4481
|
const exists = await config3.exists(configDir, id, effectiveProjectDir);
|
|
4453
4482
|
if (exists) {
|
|
4454
|
-
return res.status(409).json({
|
|
4483
|
+
return res.status(409).json({
|
|
4484
|
+
error: serverT({ en: "An item with this ID already exists", fr: "Un \xE9l\xE9ment avec cet ID existe d\xE9j\xE0" })
|
|
4485
|
+
});
|
|
4455
4486
|
}
|
|
4456
4487
|
if (destination === "project") {
|
|
4457
4488
|
await config3.saveToProject(effectiveProjectDir, body);
|
|
@@ -4466,7 +4497,7 @@ function createCrudRoutes(config3, configDir, projectDir) {
|
|
|
4466
4497
|
const items = await config3.loadAll(configDir, effectiveProjectDir);
|
|
4467
4498
|
const existing = config3.findById(id, items);
|
|
4468
4499
|
if (!existing) {
|
|
4469
|
-
return res.status(404).json({ error: "Not found" });
|
|
4500
|
+
return res.status(404).json({ error: serverT({ en: "Not found", fr: "Introuvable" }) });
|
|
4470
4501
|
}
|
|
4471
4502
|
const body = req.body;
|
|
4472
4503
|
const meta = body["metadata"];
|
|
@@ -4492,7 +4523,7 @@ function createCrudRoutes(config3, configDir, projectDir) {
|
|
|
4492
4523
|
const result = target === "project" ? await config3.deleteProject(effectiveProjectDir, id) : await config3.delete(configDir, id);
|
|
4493
4524
|
if (!result.success) {
|
|
4494
4525
|
return res.status(target === "project" ? 500 : 403).json({
|
|
4495
|
-
error: target === "project" ? "Failed to delete project item" : result.reason ?? "Cannot delete this item"
|
|
4526
|
+
error: target === "project" ? serverT({ en: "Failed to delete project item", fr: "\xC9chec de suppression de l\u2019\xE9l\xE9ment de projet" }) : result.reason ?? serverT({ en: "Cannot delete this item", fr: "Impossible de supprimer cet \xE9l\xE9ment" })
|
|
4496
4527
|
});
|
|
4497
4528
|
}
|
|
4498
4529
|
res.json({ success: true });
|
|
@@ -4503,7 +4534,7 @@ function createCrudRoutes(config3, configDir, projectDir) {
|
|
|
4503
4534
|
const items = await config3.loadAll(configDir, effectiveProjectDir);
|
|
4504
4535
|
const source = config3.findById(id, items);
|
|
4505
4536
|
if (!source) {
|
|
4506
|
-
return res.status(404).json({ error: "Not found" });
|
|
4537
|
+
return res.status(404).json({ error: serverT({ en: "Not found", fr: "Introuvable" }) });
|
|
4507
4538
|
}
|
|
4508
4539
|
const newId = `${id}-copy-${Date.now()}`;
|
|
4509
4540
|
const duplicated = {
|
|
@@ -4512,7 +4543,10 @@ function createCrudRoutes(config3, configDir, projectDir) {
|
|
|
4512
4543
|
};
|
|
4513
4544
|
const destination = req.body.destination ?? "user";
|
|
4514
4545
|
if (destination === "project") {
|
|
4515
|
-
if (!effectiveProjectDir)
|
|
4546
|
+
if (!effectiveProjectDir)
|
|
4547
|
+
return res.status(400).json({
|
|
4548
|
+
error: serverT({ en: "No project directory configured", fr: "Aucun r\xE9pertoire de projet configur\xE9" })
|
|
4549
|
+
});
|
|
4516
4550
|
await config3.saveToProject(effectiveProjectDir, duplicated);
|
|
4517
4551
|
} else {
|
|
4518
4552
|
await config3.save(configDir, duplicated);
|
|
@@ -4625,13 +4659,16 @@ function createSkillRoutes(configDir, projectDir) {
|
|
|
4625
4659
|
const router = Router2();
|
|
4626
4660
|
router.put("/library", async (req, res) => {
|
|
4627
4661
|
const path = req.body.path;
|
|
4628
|
-
if (typeof path !== "string" || !path.trim())
|
|
4662
|
+
if (typeof path !== "string" || !path.trim())
|
|
4663
|
+
return res.status(400).json({ error: serverT({ en: "path is required", fr: "path est requis" }) });
|
|
4629
4664
|
try {
|
|
4630
4665
|
const selected = await resolveLibrary(path);
|
|
4631
4666
|
setSetting(SKILL_DIRECTORIES_SETTING, JSON.stringify([path]));
|
|
4632
4667
|
res.json(selected);
|
|
4633
4668
|
} catch (error) {
|
|
4634
|
-
res.status(400).json({
|
|
4669
|
+
res.status(400).json({
|
|
4670
|
+
error: error instanceof Error ? error.message : serverT({ en: "Cannot use directory", fr: "Impossible d\u2019utiliser ce r\xE9pertoire" })
|
|
4671
|
+
});
|
|
4635
4672
|
}
|
|
4636
4673
|
});
|
|
4637
4674
|
router.delete("/library", (_req, res) => {
|
|
@@ -4649,10 +4686,16 @@ function createSkillRoutes(configDir, projectDir) {
|
|
|
4649
4686
|
const paths = JSON.parse(String(req.body["paths"] ?? "[]"));
|
|
4650
4687
|
const files = req.files;
|
|
4651
4688
|
if (!Array.isArray(paths) || paths.length !== files.length || paths.some((path) => typeof path !== "string")) {
|
|
4652
|
-
return res.status(400).json({
|
|
4689
|
+
return res.status(400).json({
|
|
4690
|
+
error: serverT({
|
|
4691
|
+
en: "File path manifest does not match upload",
|
|
4692
|
+
fr: "Le manifeste des chemins de fichiers ne correspond pas \xE0 l\u2019envoi"
|
|
4693
|
+
})
|
|
4694
|
+
});
|
|
4653
4695
|
}
|
|
4654
4696
|
const totalBytes = files.reduce((total, file) => total + file.size, 0);
|
|
4655
|
-
if (totalBytes > 50 * 1024 * 1024)
|
|
4697
|
+
if (totalBytes > 50 * 1024 * 1024)
|
|
4698
|
+
return res.status(413).json({ error: serverT({ en: "Package exceeds 50 MiB", fr: "Le paquet d\xE9passe 50 Mio" }) });
|
|
4656
4699
|
const installed = await installSkillPackage(
|
|
4657
4700
|
library.resolvedPath,
|
|
4658
4701
|
packageName,
|
|
@@ -4661,29 +4704,35 @@ function createSkillRoutes(configDir, projectDir) {
|
|
|
4661
4704
|
res.status(201).json(installed);
|
|
4662
4705
|
} catch (error) {
|
|
4663
4706
|
const status = error instanceof SkillInstallError ? error.status : 400;
|
|
4664
|
-
res.status(status).json({
|
|
4707
|
+
res.status(status).json({
|
|
4708
|
+
error: error instanceof Error ? error.message : serverT({ en: "Install failed", fr: "\xC9chec de l\u2019installation" })
|
|
4709
|
+
});
|
|
4665
4710
|
}
|
|
4666
4711
|
});
|
|
4667
4712
|
});
|
|
4668
4713
|
router.post("/:id/toggle", async (req, res) => {
|
|
4669
4714
|
const existing = await findSkillByIdForRequest(req, configDir, projectDir);
|
|
4670
|
-
if (!existing) return res.status(404).json({ error: "Not found" });
|
|
4715
|
+
if (!existing) return res.status(404).json({ error: serverT({ en: "Not found", fr: "Introuvable" }) });
|
|
4671
4716
|
const enabled = !isSkillEnabled(existing.metadata.id);
|
|
4672
4717
|
setSkillEnabled(existing.metadata.id, enabled);
|
|
4673
4718
|
res.json({ enabled });
|
|
4674
4719
|
});
|
|
4675
4720
|
router.put("/:id", async (req, res) => {
|
|
4676
4721
|
const existing = await findSkillByIdForRequest(req, configDir, projectDir);
|
|
4677
|
-
if (!existing) return res.status(404).json({ error: "Not found" });
|
|
4722
|
+
if (!existing) return res.status(404).json({ error: serverT({ en: "Not found", fr: "Introuvable" }) });
|
|
4678
4723
|
const updated = await updateOwnedSkill(existing, req.body);
|
|
4679
|
-
if (!updated)
|
|
4724
|
+
if (!updated)
|
|
4725
|
+
return res.status(403).json({ error: serverT({ en: "This skill is read-only", fr: "Cette comp\xE9tence est en lecture seule" }) });
|
|
4680
4726
|
res.json(updated);
|
|
4681
4727
|
});
|
|
4682
4728
|
router.delete("/:id", async (req, res) => {
|
|
4683
4729
|
const existing = await findSkillByIdForRequest(req, configDir, projectDir);
|
|
4684
|
-
if (!existing) return res.status(404).json({ error: "Not found" });
|
|
4730
|
+
if (!existing) return res.status(404).json({ error: serverT({ en: "Not found", fr: "Introuvable" }) });
|
|
4685
4731
|
const result = await deleteOwnedSkill(existing);
|
|
4686
|
-
if (!result.success)
|
|
4732
|
+
if (!result.success)
|
|
4733
|
+
return res.status(403).json({
|
|
4734
|
+
error: result.reason ?? serverT({ en: "Cannot delete this skill", fr: "Impossible de supprimer cette comp\xE9tence" })
|
|
4735
|
+
});
|
|
4687
4736
|
res.json({ success: true });
|
|
4688
4737
|
});
|
|
4689
4738
|
router.use(createCrudRoutes(createConfig(configDir, projectDir), configDir, projectDir));
|
|
@@ -4767,7 +4816,12 @@ var config2 = {
|
|
|
4767
4816
|
const { id } = req.params;
|
|
4768
4817
|
const { providerId, model, reasoningEffort } = req.body;
|
|
4769
4818
|
if (reasoningEffort !== void 0 && !isReasoningEffortValue(reasoningEffort)) {
|
|
4770
|
-
return res.status(400).json({
|
|
4819
|
+
return res.status(400).json({
|
|
4820
|
+
error: serverT(
|
|
4821
|
+
{ en: "Unsupported reasoningEffort: {{value}}", fr: "reasoningEffort non pris en charge : {{value}}" },
|
|
4822
|
+
{ value: String(reasoningEffort) }
|
|
4823
|
+
)
|
|
4824
|
+
});
|
|
4771
4825
|
}
|
|
4772
4826
|
if (providerId && model) {
|
|
4773
4827
|
setAgentModelOverride(id, {
|
|
@@ -5595,7 +5649,7 @@ function createDevServerRoutes() {
|
|
|
5595
5649
|
const router = Router5();
|
|
5596
5650
|
router.get("/", async (req, res) => {
|
|
5597
5651
|
const workdir = req.query["workdir"];
|
|
5598
|
-
if (!workdir) return res.status(400).json({ error: "workdir required" });
|
|
5652
|
+
if (!workdir) return res.status(400).json({ error: serverT({ en: "workdir required", fr: "workdir requis" }) });
|
|
5599
5653
|
const status = devServerManager.getStatus(workdir);
|
|
5600
5654
|
if (!status.config) {
|
|
5601
5655
|
const config3 = await devServerManager.loadConfig(workdir);
|
|
@@ -5609,37 +5663,41 @@ function createDevServerRoutes() {
|
|
|
5609
5663
|
});
|
|
5610
5664
|
router.post("/start", async (req, res) => {
|
|
5611
5665
|
const workdir = req.query["workdir"];
|
|
5612
|
-
if (!workdir) return res.status(400).json({ error: "workdir required" });
|
|
5666
|
+
if (!workdir) return res.status(400).json({ error: serverT({ en: "workdir required", fr: "workdir requis" }) });
|
|
5613
5667
|
try {
|
|
5614
5668
|
const status = await devServerManager.start(workdir);
|
|
5615
5669
|
res.json(status);
|
|
5616
5670
|
} catch (err) {
|
|
5617
|
-
res.status(500).json({
|
|
5671
|
+
res.status(500).json({
|
|
5672
|
+
error: err instanceof Error ? err.message : serverT({ en: "Failed to start", fr: "\xC9chec du d\xE9marrage" })
|
|
5673
|
+
});
|
|
5618
5674
|
}
|
|
5619
5675
|
});
|
|
5620
5676
|
router.post("/stop", async (req, res) => {
|
|
5621
5677
|
const workdir = req.query["workdir"];
|
|
5622
|
-
if (!workdir) return res.status(400).json({ error: "workdir required" });
|
|
5678
|
+
if (!workdir) return res.status(400).json({ error: serverT({ en: "workdir required", fr: "workdir requis" }) });
|
|
5623
5679
|
try {
|
|
5624
5680
|
const status = await devServerManager.stop(workdir);
|
|
5625
5681
|
res.json(status);
|
|
5626
5682
|
} catch (err) {
|
|
5627
|
-
res.status(500).json({ error: err instanceof Error ? err.message : "Failed to stop" });
|
|
5683
|
+
res.status(500).json({ error: err instanceof Error ? err.message : serverT({ en: "Failed to stop", fr: "\xC9chec de l\u2019arr\xEAt" }) });
|
|
5628
5684
|
}
|
|
5629
5685
|
});
|
|
5630
5686
|
router.post("/restart", async (req, res) => {
|
|
5631
5687
|
const workdir = req.query["workdir"];
|
|
5632
|
-
if (!workdir) return res.status(400).json({ error: "workdir required" });
|
|
5688
|
+
if (!workdir) return res.status(400).json({ error: serverT({ en: "workdir required", fr: "workdir requis" }) });
|
|
5633
5689
|
try {
|
|
5634
5690
|
const status = await devServerManager.restart(workdir);
|
|
5635
5691
|
res.json(status);
|
|
5636
5692
|
} catch (err) {
|
|
5637
|
-
res.status(500).json({
|
|
5693
|
+
res.status(500).json({
|
|
5694
|
+
error: err instanceof Error ? err.message : serverT({ en: "Failed to restart", fr: "\xC9chec du red\xE9marrage" })
|
|
5695
|
+
});
|
|
5638
5696
|
}
|
|
5639
5697
|
});
|
|
5640
5698
|
router.get("/logs", (req, res) => {
|
|
5641
5699
|
const workdir = req.query["workdir"];
|
|
5642
|
-
if (!workdir) return res.status(400).json({ error: "workdir required" });
|
|
5700
|
+
if (!workdir) return res.status(400).json({ error: serverT({ en: "workdir required", fr: "workdir requis" }) });
|
|
5643
5701
|
const offset = Math.max(0, parseInt(req.query["offset"]) || 0);
|
|
5644
5702
|
const limit = Math.max(1, parseInt(req.query["limit"]) || Infinity);
|
|
5645
5703
|
const result = devServerManager.getLogsSlice(workdir, offset, limit);
|
|
@@ -5647,43 +5705,51 @@ function createDevServerRoutes() {
|
|
|
5647
5705
|
});
|
|
5648
5706
|
router.post("/clear-logs", (req, res) => {
|
|
5649
5707
|
const workdir = req.query["workdir"];
|
|
5650
|
-
if (!workdir) return res.status(400).json({ error: "workdir required" });
|
|
5708
|
+
if (!workdir) return res.status(400).json({ error: serverT({ en: "workdir required", fr: "workdir requis" }) });
|
|
5651
5709
|
try {
|
|
5652
5710
|
devServerManager.clearLogs(workdir);
|
|
5653
5711
|
res.json({ ok: true });
|
|
5654
5712
|
} catch (err) {
|
|
5655
|
-
res.status(500).json({
|
|
5713
|
+
res.status(500).json({
|
|
5714
|
+
error: err instanceof Error ? err.message : serverT({ en: "Failed to clear logs", fr: "\xC9chec de l\u2019effacement des journaux" })
|
|
5715
|
+
});
|
|
5656
5716
|
}
|
|
5657
5717
|
});
|
|
5658
5718
|
router.post("/insert-marker", (req, res) => {
|
|
5659
5719
|
const workdir = req.query["workdir"];
|
|
5660
|
-
if (!workdir) return res.status(400).json({ error: "workdir required" });
|
|
5720
|
+
if (!workdir) return res.status(400).json({ error: serverT({ en: "workdir required", fr: "workdir requis" }) });
|
|
5661
5721
|
try {
|
|
5662
5722
|
devServerManager.insertMarker(workdir);
|
|
5663
5723
|
res.json({ ok: true });
|
|
5664
5724
|
} catch (err) {
|
|
5665
|
-
res.status(500).json({
|
|
5725
|
+
res.status(500).json({
|
|
5726
|
+
error: err instanceof Error ? err.message : serverT({ en: "Failed to insert marker", fr: "\xC9chec de l\u2019insertion du marqueur" })
|
|
5727
|
+
});
|
|
5666
5728
|
}
|
|
5667
5729
|
});
|
|
5668
5730
|
router.get("/config", async (req, res) => {
|
|
5669
5731
|
const workdir = req.query["workdir"];
|
|
5670
|
-
if (!workdir) return res.status(400).json({ error: "workdir required" });
|
|
5732
|
+
if (!workdir) return res.status(400).json({ error: serverT({ en: "workdir required", fr: "workdir requis" }) });
|
|
5671
5733
|
const config3 = await devServerManager.loadConfig(workdir);
|
|
5672
5734
|
res.json({ config: config3 });
|
|
5673
5735
|
});
|
|
5674
5736
|
router.post("/config", async (req, res) => {
|
|
5675
5737
|
const workdir = req.query["workdir"];
|
|
5676
|
-
if (!workdir) return res.status(400).json({ error: "workdir required" });
|
|
5738
|
+
if (!workdir) return res.status(400).json({ error: serverT({ en: "workdir required", fr: "workdir requis" }) });
|
|
5677
5739
|
const { command, url, hotReload, disableInspect } = req.body;
|
|
5678
5740
|
if (!command || !url) {
|
|
5679
|
-
return res.status(400).json({
|
|
5741
|
+
return res.status(400).json({
|
|
5742
|
+
error: serverT({ en: "command and url are required", fr: "command et url sont requis" })
|
|
5743
|
+
});
|
|
5680
5744
|
}
|
|
5681
5745
|
try {
|
|
5682
5746
|
const config3 = { command, url, hotReload: hotReload ?? false, disableInspect: disableInspect ?? false };
|
|
5683
5747
|
await devServerManager.saveConfig(workdir, config3);
|
|
5684
5748
|
res.json({ config: config3 });
|
|
5685
5749
|
} catch (err) {
|
|
5686
|
-
res.status(500).json({
|
|
5750
|
+
res.status(500).json({
|
|
5751
|
+
error: err instanceof Error ? err.message : serverT({ en: "Failed to save config", fr: "\xC9chec de l\u2019enregistrement de la configuration" })
|
|
5752
|
+
});
|
|
5687
5753
|
}
|
|
5688
5754
|
});
|
|
5689
5755
|
return router;
|
|
@@ -5762,7 +5828,37 @@ async function checkDirExists(path) {
|
|
|
5762
5828
|
}
|
|
5763
5829
|
async function validatePathWritable(path) {
|
|
5764
5830
|
if (await isWritable(path)) return null;
|
|
5765
|
-
return
|
|
5831
|
+
return serverT({
|
|
5832
|
+
en: "Workspace root directory exists but is not writable",
|
|
5833
|
+
fr: "Le r\xE9pertoire racine du workspace existe mais n\u2019est pas accessible en \xE9criture"
|
|
5834
|
+
});
|
|
5835
|
+
}
|
|
5836
|
+
function rootDirBlockError(blockReason, displayPath, suggestion) {
|
|
5837
|
+
if (blockReason === "exact") {
|
|
5838
|
+
return suggestion ? serverT(
|
|
5839
|
+
{
|
|
5840
|
+
en: 'Cannot use "{{path}}" directly as workspace root. Use a subdirectory like "{{suggestion}}" instead.',
|
|
5841
|
+
fr: "Impossible d\u2019utiliser \xAB {{path}} \xBB directement comme racine du workspace. Utilisez plut\xF4t un sous-r\xE9pertoire comme \xAB {{suggestion}} \xBB."
|
|
5842
|
+
},
|
|
5843
|
+
{ path: displayPath, suggestion }
|
|
5844
|
+
) : serverT(
|
|
5845
|
+
{
|
|
5846
|
+
en: 'Cannot use "{{path}}" directly as workspace root. Use a subdirectory instead.',
|
|
5847
|
+
fr: "Impossible d\u2019utiliser \xAB {{path}} \xBB directement comme racine du workspace. Utilisez un sous-r\xE9pertoire \xE0 la place."
|
|
5848
|
+
},
|
|
5849
|
+
{ path: displayPath }
|
|
5850
|
+
);
|
|
5851
|
+
}
|
|
5852
|
+
if (blockReason === "virtual_fs") {
|
|
5853
|
+
return serverT(
|
|
5854
|
+
{
|
|
5855
|
+
en: 'Cannot use paths under "{{path}}" for workspaces.',
|
|
5856
|
+
fr: "Impossible d\u2019utiliser des chemins sous \xAB {{path}} \xBB pour les workspaces."
|
|
5857
|
+
},
|
|
5858
|
+
{ path: displayPath }
|
|
5859
|
+
);
|
|
5860
|
+
}
|
|
5861
|
+
return null;
|
|
5766
5862
|
}
|
|
5767
5863
|
async function findOrphanedWorkspaces(dir) {
|
|
5768
5864
|
const results = [];
|
|
@@ -5790,7 +5886,7 @@ function createWorkspaceConfigRoutes(sessionManager) {
|
|
|
5790
5886
|
const router = Router6();
|
|
5791
5887
|
router.get("/config", async (req, res) => {
|
|
5792
5888
|
const workdir = req.query["workdir"];
|
|
5793
|
-
if (!workdir) return res.status(400).json({ error: "workdir required" });
|
|
5889
|
+
if (!workdir) return res.status(400).json({ error: serverT({ en: "workdir required", fr: "workdir requis" }) });
|
|
5794
5890
|
const config3 = await loadWorkspaceConfig(workdir);
|
|
5795
5891
|
const project = getProjectByWorkdir(workdir);
|
|
5796
5892
|
const rootDir = project?.workspaceRootDir ?? void 0;
|
|
@@ -5800,16 +5896,28 @@ function createWorkspaceConfigRoutes(sessionManager) {
|
|
|
5800
5896
|
});
|
|
5801
5897
|
router.post("/config", async (req, res) => {
|
|
5802
5898
|
const workdir = req.query["workdir"];
|
|
5803
|
-
if (!workdir) return res.status(400).json({ error: "workdir required" });
|
|
5899
|
+
if (!workdir) return res.status(400).json({ error: serverT({ en: "workdir required", fr: "workdir requis" }) });
|
|
5804
5900
|
const { setup, rootDir, mcpOverrides } = req.body;
|
|
5805
5901
|
if (!Array.isArray(setup) && typeof rootDir !== "string" && mcpOverrides === void 0) {
|
|
5806
|
-
return res.status(400).json({
|
|
5902
|
+
return res.status(400).json({
|
|
5903
|
+
error: serverT({
|
|
5904
|
+
en: "At least one of setup, rootDir, or mcpOverrides must be provided",
|
|
5905
|
+
fr: "Au moins un de setup, rootDir ou mcpOverrides doit \xEAtre fourni"
|
|
5906
|
+
})
|
|
5907
|
+
});
|
|
5807
5908
|
}
|
|
5808
5909
|
if (setup !== void 0 && !Array.isArray(setup)) {
|
|
5809
|
-
return res.status(400).json({
|
|
5910
|
+
return res.status(400).json({
|
|
5911
|
+
error: serverT({ en: "setup must be an array of strings", fr: "setup doit \xEAtre un tableau de cha\xEEnes" })
|
|
5912
|
+
});
|
|
5810
5913
|
}
|
|
5811
5914
|
if (mcpOverrides !== void 0 && (typeof mcpOverrides !== "object" || mcpOverrides === null || Array.isArray(mcpOverrides))) {
|
|
5812
|
-
return res.status(400).json({
|
|
5915
|
+
return res.status(400).json({
|
|
5916
|
+
error: serverT({
|
|
5917
|
+
en: "mcpOverrides must be an object mapping server names to overrides",
|
|
5918
|
+
fr: "mcpOverrides doit \xEAtre un objet associant les noms de serveurs \xE0 des surcharges"
|
|
5919
|
+
})
|
|
5920
|
+
});
|
|
5813
5921
|
}
|
|
5814
5922
|
const existing = await loadWorkspaceConfig(workdir);
|
|
5815
5923
|
const config3 = { ...existing };
|
|
@@ -5823,12 +5931,8 @@ function createWorkspaceConfigRoutes(sessionManager) {
|
|
|
5823
5931
|
const resolvedPath = resolveRootDir(trimmed, workdir);
|
|
5824
5932
|
const displayPath = formatRootDir(resolvedPath);
|
|
5825
5933
|
const blockReason = getRootDirBlockReason(resolvedPath);
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
}
|
|
5829
|
-
if (blockReason === "virtual_fs") {
|
|
5830
|
-
return res.status(400).json({ error: `Cannot use paths under "${displayPath}" for workspaces.` });
|
|
5831
|
-
}
|
|
5934
|
+
const blockError = rootDirBlockError(blockReason, displayPath);
|
|
5935
|
+
if (blockError) return res.status(400).json({ error: blockError });
|
|
5832
5936
|
const dirExists = await checkDirExists(resolvedPath);
|
|
5833
5937
|
if (dirExists) {
|
|
5834
5938
|
const writableErr = await validatePathWritable(resolvedPath);
|
|
@@ -5865,29 +5969,25 @@ function createWorkspaceConfigRoutes(sessionManager) {
|
|
|
5865
5969
|
}
|
|
5866
5970
|
res.json({ config: { ...config3, rootDir: savedRootDir ?? void 0 } });
|
|
5867
5971
|
} catch (err) {
|
|
5868
|
-
res.status(500).json({
|
|
5972
|
+
res.status(500).json({
|
|
5973
|
+
error: err instanceof Error ? err.message : serverT({ en: "Failed to save config", fr: "\xC9chec de l\u2019enregistrement de la configuration" })
|
|
5974
|
+
});
|
|
5869
5975
|
}
|
|
5870
5976
|
});
|
|
5871
5977
|
router.post("/config/validate", async (req, res) => {
|
|
5872
5978
|
const { rootDir, workdir, projectName, createIfMissing } = req.body;
|
|
5873
5979
|
if (!rootDir || typeof rootDir !== "string") {
|
|
5874
|
-
return res.status(400).json({ error: "rootDir is required" });
|
|
5980
|
+
return res.status(400).json({ error: serverT({ en: "rootDir is required", fr: "rootDir est requis" }) });
|
|
5875
5981
|
}
|
|
5876
5982
|
if (!workdir || typeof workdir !== "string") {
|
|
5877
|
-
return res.status(400).json({ error: "workdir is required" });
|
|
5983
|
+
return res.status(400).json({ error: serverT({ en: "workdir is required", fr: "workdir est requis" }) });
|
|
5878
5984
|
}
|
|
5879
5985
|
const resolvedPath = resolveRootDir(rootDir, workdir);
|
|
5880
5986
|
const displayPath = formatRootDir(resolvedPath);
|
|
5881
5987
|
const blockReason = getRootDirBlockReason(resolvedPath);
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
error: suggestion ? `Cannot use "${displayPath}" directly as workspace root. Use a subdirectory like "${suggestion}" instead.` : `Cannot use "${displayPath}" directly as workspace root. Use a subdirectory instead.`
|
|
5886
|
-
});
|
|
5887
|
-
}
|
|
5888
|
-
if (blockReason === "virtual_fs") {
|
|
5889
|
-
return res.status(400).json({ error: `Cannot use paths under "${displayPath}" for workspaces.` });
|
|
5890
|
-
}
|
|
5988
|
+
const suggestion = typeof projectName === "string" ? suggestRootDirChild(resolvedPath, projectName) : void 0;
|
|
5989
|
+
const blockError = rootDirBlockError(blockReason, displayPath, suggestion);
|
|
5990
|
+
if (blockError) return res.status(400).json({ error: blockError });
|
|
5891
5991
|
let dirExists = await checkDirExists(resolvedPath);
|
|
5892
5992
|
if (dirExists) {
|
|
5893
5993
|
const writableErr = await validatePathWritable(resolvedPath);
|
|
@@ -5946,7 +6046,7 @@ function createTerminalRoutes() {
|
|
|
5946
6046
|
if (success) {
|
|
5947
6047
|
res.status(204).send();
|
|
5948
6048
|
} else {
|
|
5949
|
-
res.status(404).json({ error: "Terminal not found" });
|
|
6049
|
+
res.status(404).json({ error: serverT({ en: "Terminal not found", fr: "Terminal introuvable" }) });
|
|
5950
6050
|
}
|
|
5951
6051
|
});
|
|
5952
6052
|
router.get("/:id", (req, res) => {
|
|
@@ -5955,7 +6055,7 @@ function createTerminalRoutes() {
|
|
|
5955
6055
|
if (session) {
|
|
5956
6056
|
res.json({ id: session.id, workdir: session.workdir });
|
|
5957
6057
|
} else {
|
|
5958
|
-
res.status(404).json({ error: "Terminal not found" });
|
|
6058
|
+
res.status(404).json({ error: serverT({ en: "Terminal not found", fr: "Terminal introuvable" }) });
|
|
5959
6059
|
}
|
|
5960
6060
|
});
|
|
5961
6061
|
return router;
|
|
@@ -5989,7 +6089,7 @@ function createDirectoryRoutes() {
|
|
|
5989
6089
|
});
|
|
5990
6090
|
} catch {
|
|
5991
6091
|
res.status(400).json({
|
|
5992
|
-
error: "Cannot read directory",
|
|
6092
|
+
error: serverT({ en: "Cannot read directory", fr: "Impossible de lire le r\xE9pertoire" }),
|
|
5993
6093
|
current: DEFAULT_BASE_PATH,
|
|
5994
6094
|
parent: null,
|
|
5995
6095
|
directories: [],
|
|
@@ -6022,7 +6122,7 @@ function createFileSearchRoutes() {
|
|
|
6022
6122
|
const results = await searchFiles(query, workdir);
|
|
6023
6123
|
res.json(results);
|
|
6024
6124
|
} catch {
|
|
6025
|
-
res.status(500).json({ error: "File search failed" });
|
|
6125
|
+
res.status(500).json({ error: serverT({ en: "File search failed", fr: "\xC9chec de la recherche de fichiers" }) });
|
|
6026
6126
|
}
|
|
6027
6127
|
});
|
|
6028
6128
|
return router;
|
|
@@ -6127,6 +6227,11 @@ async function checkAuth(req, opts) {
|
|
|
6127
6227
|
}
|
|
6128
6228
|
return true;
|
|
6129
6229
|
}
|
|
6230
|
+
async function requireAuth(req, res, opts) {
|
|
6231
|
+
if (await checkAuth(req, opts)) return true;
|
|
6232
|
+
res.status(401).json({ error: serverT({ en: "Unauthorized", fr: "Non autoris\xE9" }) });
|
|
6233
|
+
return false;
|
|
6234
|
+
}
|
|
6130
6235
|
function isDevMode() {
|
|
6131
6236
|
return process.env["NODE_ENV"] === "development";
|
|
6132
6237
|
}
|
|
@@ -6252,12 +6357,9 @@ function createAutoUpdateRoutes(options = {}) {
|
|
|
6252
6357
|
}
|
|
6253
6358
|
});
|
|
6254
6359
|
router.post("/", async (req, res) => {
|
|
6255
|
-
if (!await
|
|
6256
|
-
res.status(401).json({ error: "Unauthorized" });
|
|
6257
|
-
return;
|
|
6258
|
-
}
|
|
6360
|
+
if (!await requireAuth(req, res, options)) return;
|
|
6259
6361
|
if (updateInProgress) {
|
|
6260
|
-
res.status(409).json({ error: "Update already in progress" });
|
|
6362
|
+
res.status(409).json({ error: serverT({ en: "Update already in progress", fr: "Une mise \xE0 jour est d\xE9j\xE0 en cours" }) });
|
|
6261
6363
|
return;
|
|
6262
6364
|
}
|
|
6263
6365
|
updateInProgress = true;
|
|
@@ -6289,20 +6391,19 @@ function createAutoUpdateRoutes(options = {}) {
|
|
|
6289
6391
|
const version = versionMatch?.[1] ?? VERSION;
|
|
6290
6392
|
res.json({ success: true, version, isService });
|
|
6291
6393
|
} else {
|
|
6292
|
-
const error = exitCode === null ? "Update timed out" : stderr || stdout || "Update failed";
|
|
6394
|
+
const error = exitCode === null ? serverT({ en: "Update timed out", fr: "Mise \xE0 jour expir\xE9e" }) : stderr || stdout || serverT({ en: "Update failed", fr: "\xC9chec de la mise \xE0 jour" });
|
|
6293
6395
|
res.json({ success: false, error, isService });
|
|
6294
6396
|
}
|
|
6295
6397
|
} catch (err) {
|
|
6296
|
-
res.status(500).json({
|
|
6398
|
+
res.status(500).json({
|
|
6399
|
+
error: err instanceof Error ? err.message : serverT({ en: "Update failed to start", fr: "\xC9chec du d\xE9marrage de la mise \xE0 jour" })
|
|
6400
|
+
});
|
|
6297
6401
|
} finally {
|
|
6298
6402
|
updateInProgress = false;
|
|
6299
6403
|
}
|
|
6300
6404
|
});
|
|
6301
6405
|
router.post("/restart", async (req, res) => {
|
|
6302
|
-
if (!await
|
|
6303
|
-
res.status(401).json({ error: "Unauthorized" });
|
|
6304
|
-
return;
|
|
6305
|
-
}
|
|
6406
|
+
if (!await requireAuth(req, res, options)) return;
|
|
6306
6407
|
try {
|
|
6307
6408
|
const child = spawn2("openfox service restart", {
|
|
6308
6409
|
detached: true,
|
|
@@ -6313,7 +6414,9 @@ function createAutoUpdateRoutes(options = {}) {
|
|
|
6313
6414
|
child.unref();
|
|
6314
6415
|
res.json({ success: true });
|
|
6315
6416
|
} catch (err) {
|
|
6316
|
-
res.status(500).json({
|
|
6417
|
+
res.status(500).json({
|
|
6418
|
+
error: err instanceof Error ? err.message : serverT({ en: "Failed to trigger restart", fr: "\xC9chec du d\xE9clenchement du red\xE9marrage" })
|
|
6419
|
+
});
|
|
6317
6420
|
}
|
|
6318
6421
|
});
|
|
6319
6422
|
return router;
|
|
@@ -6326,13 +6429,19 @@ function createProviderAuthRoutes(config3, providerManager, registry) {
|
|
|
6326
6429
|
function resolveAuthContext(providerId, res) {
|
|
6327
6430
|
const provider = providerManager.getProviders().find((item) => item.id === providerId);
|
|
6328
6431
|
if (!provider) {
|
|
6329
|
-
res.status(404).json({ error: "Provider not found" });
|
|
6432
|
+
res.status(404).json({ error: serverT({ en: "Provider not found", fr: "Fournisseur introuvable" }) });
|
|
6330
6433
|
return void 0;
|
|
6331
6434
|
}
|
|
6332
6435
|
return { provider, adapter: registry.getAuth(provider.authAdapter) };
|
|
6333
6436
|
}
|
|
6334
6437
|
function missingAuthPlugin(provider) {
|
|
6335
|
-
return
|
|
6438
|
+
return serverT(
|
|
6439
|
+
{
|
|
6440
|
+
en: "Missing provider auth plugin: {{adapter}}",
|
|
6441
|
+
fr: "Plugin d\u2019authentification du fournisseur manquant : {{adapter}}"
|
|
6442
|
+
},
|
|
6443
|
+
{ adapter: provider.authAdapter ?? "unknown" }
|
|
6444
|
+
);
|
|
6336
6445
|
}
|
|
6337
6446
|
router.post("/:providerId/login", async (req, res) => {
|
|
6338
6447
|
const context = resolveAuthContext(req.params.providerId, res);
|
|
@@ -6356,7 +6465,12 @@ function createProviderAuthRoutes(config3, providerManager, registry) {
|
|
|
6356
6465
|
});
|
|
6357
6466
|
res.json(challenge);
|
|
6358
6467
|
} catch (error) {
|
|
6359
|
-
res.status(502).json({
|
|
6468
|
+
res.status(502).json({
|
|
6469
|
+
error: error instanceof Error ? error.message : serverT({
|
|
6470
|
+
en: "Unable to start provider login",
|
|
6471
|
+
fr: "Impossible de d\xE9marrer la connexion au fournisseur"
|
|
6472
|
+
})
|
|
6473
|
+
});
|
|
6360
6474
|
}
|
|
6361
6475
|
});
|
|
6362
6476
|
router.get("/:providerId/status", async (req, res) => {
|
|
@@ -6593,15 +6707,15 @@ function createPluginRoutes(options) {
|
|
|
6593
6707
|
router.post("/install", async (req, res) => {
|
|
6594
6708
|
const { githubUrl } = req.body;
|
|
6595
6709
|
if (!githubUrl || typeof githubUrl !== "string") {
|
|
6596
|
-
return res.status(400).json({ error: "githubUrl is required" });
|
|
6710
|
+
return res.status(400).json({ error: serverT({ en: "githubUrl is required", fr: "githubUrl est requis" }) });
|
|
6597
6711
|
}
|
|
6598
6712
|
const parsed = githubUrl.match(/github\.com\/([^/]+)\/([^/]+?)(?:\/|$)/);
|
|
6599
6713
|
if (!parsed) {
|
|
6600
|
-
return res.status(400).json({ error: "Invalid GitHub URL" });
|
|
6714
|
+
return res.status(400).json({ error: serverT({ en: "Invalid GitHub URL", fr: "URL GitHub invalide" }) });
|
|
6601
6715
|
}
|
|
6602
6716
|
const repoName = parsed[2].replace(/\.git$/, "");
|
|
6603
6717
|
if (!/^[a-zA-Z0-9_-]+$/.test(repoName)) {
|
|
6604
|
-
return res.status(400).json({ error: "Invalid repository name" });
|
|
6718
|
+
return res.status(400).json({ error: serverT({ en: "Invalid repository name", fr: "Nom de d\xE9p\xF4t invalide" }) });
|
|
6605
6719
|
}
|
|
6606
6720
|
const pluginsDir = join8(getGlobalConfigDir(config3.mode ?? "production"), "plugins");
|
|
6607
6721
|
const targetDir = join8(pluginsDir, repoName);
|
|
@@ -6609,7 +6723,12 @@ function createPluginRoutes(options) {
|
|
|
6609
6723
|
try {
|
|
6610
6724
|
await execFileP("mkdir", ["-p", pluginsDir], { timeout: 5e3 });
|
|
6611
6725
|
} catch {
|
|
6612
|
-
return res.status(500).json({
|
|
6726
|
+
return res.status(500).json({
|
|
6727
|
+
error: serverT({
|
|
6728
|
+
en: "Failed to create plugins directory",
|
|
6729
|
+
fr: "\xC9chec de la cr\xE9ation du r\xE9pertoire des plugins"
|
|
6730
|
+
})
|
|
6731
|
+
});
|
|
6613
6732
|
}
|
|
6614
6733
|
let gitOk = false;
|
|
6615
6734
|
try {
|
|
@@ -6618,7 +6737,12 @@ function createPluginRoutes(options) {
|
|
|
6618
6737
|
} catch {
|
|
6619
6738
|
}
|
|
6620
6739
|
if (!gitOk) {
|
|
6621
|
-
return res.status(500).json({
|
|
6740
|
+
return res.status(500).json({
|
|
6741
|
+
error: serverT({
|
|
6742
|
+
en: "git is not installed or not found in PATH",
|
|
6743
|
+
fr: "git n\u2019est pas install\xE9 ou introuvable dans le PATH"
|
|
6744
|
+
})
|
|
6745
|
+
});
|
|
6622
6746
|
}
|
|
6623
6747
|
try {
|
|
6624
6748
|
const cloneUrl = githubUrl.replace(/\/$/, "") + ".git";
|
|
@@ -6631,7 +6755,10 @@ function createPluginRoutes(options) {
|
|
|
6631
6755
|
await execFileP("npm", ["install", "--no-audit", "--no-fund"], { cwd: targetDir, timeout: 12e4 });
|
|
6632
6756
|
await execFileP("npm", ["run", "build"], { cwd: targetDir, timeout: 12e4 });
|
|
6633
6757
|
} catch (err) {
|
|
6634
|
-
loadError =
|
|
6758
|
+
loadError = serverT({
|
|
6759
|
+
en: "Failed to install/build plugin dependencies",
|
|
6760
|
+
fr: "\xC9chec de l\u2019installation/du build des d\xE9pendances du plugin"
|
|
6761
|
+
});
|
|
6635
6762
|
logger2.error("Plugin build failed", { repoName, error: String(err) });
|
|
6636
6763
|
}
|
|
6637
6764
|
if (!loadError) {
|
|
@@ -6640,13 +6767,25 @@ function createPluginRoutes(options) {
|
|
|
6640
6767
|
const pluginEntry = manifest.openfox?.plugin;
|
|
6641
6768
|
const apiVersion = manifest.openfox?.apiVersion;
|
|
6642
6769
|
if (!pluginEntry || !manifest.name) {
|
|
6643
|
-
loadError =
|
|
6770
|
+
loadError = serverT({
|
|
6771
|
+
en: "Plugin package.json is missing openfox.plugin or name field",
|
|
6772
|
+
fr: "Le package.json du plugin ne contient pas le champ openfox.plugin ou name"
|
|
6773
|
+
});
|
|
6644
6774
|
} else if (apiVersion !== 1) {
|
|
6645
|
-
loadError =
|
|
6775
|
+
loadError = serverT(
|
|
6776
|
+
{
|
|
6777
|
+
en: "Unsupported plugin API version: {{version}}",
|
|
6778
|
+
fr: "Version d\u2019API de plugin non prise en charge : {{version}}"
|
|
6779
|
+
},
|
|
6780
|
+
{ version: String(apiVersion) }
|
|
6781
|
+
);
|
|
6646
6782
|
} else {
|
|
6647
6783
|
const mod = await import(pathToFileURL2(join8(targetDir, pluginEntry)).href);
|
|
6648
6784
|
if (typeof mod.register !== "function") {
|
|
6649
|
-
loadError =
|
|
6785
|
+
loadError = serverT({
|
|
6786
|
+
en: "Plugin does not export register(registry)",
|
|
6787
|
+
fr: "Le plugin n\u2019exporte pas register(registry)"
|
|
6788
|
+
});
|
|
6650
6789
|
} else {
|
|
6651
6790
|
const diagnostic = {
|
|
6652
6791
|
packageName: manifest.name,
|
|
@@ -6680,14 +6819,14 @@ function createPluginRoutes(options) {
|
|
|
6680
6819
|
}
|
|
6681
6820
|
}
|
|
6682
6821
|
} catch (err) {
|
|
6683
|
-
loadError = err instanceof Error ? err.message : "Failed to load plugin";
|
|
6822
|
+
loadError = err instanceof Error ? err.message : serverT({ en: "Failed to load plugin", fr: "\xC9chec du chargement du plugin" });
|
|
6684
6823
|
logger2.error("Plugin runtime load failed", { repoName, error: loadError });
|
|
6685
6824
|
}
|
|
6686
6825
|
}
|
|
6687
6826
|
res.json({ success: true, loaded, loadError, path: targetDir });
|
|
6688
6827
|
} catch (err) {
|
|
6689
6828
|
await rm2(tmpDir, { recursive: true, force: true });
|
|
6690
|
-
const msg = err instanceof Error ? err.message : "Clone failed";
|
|
6829
|
+
const msg = err instanceof Error ? err.message : serverT({ en: "Clone failed", fr: "\xC9chec du clonage" });
|
|
6691
6830
|
logger2.error("Plugin install failed", { githubUrl, error: msg });
|
|
6692
6831
|
res.status(500).json({ error: msg });
|
|
6693
6832
|
}
|
|
@@ -6719,14 +6858,15 @@ function createPluginRoutes(options) {
|
|
|
6719
6858
|
});
|
|
6720
6859
|
router.get("/:name/open-folder", async (req, res) => {
|
|
6721
6860
|
const name = req.params.name;
|
|
6722
|
-
if (!/^[a-zA-Z0-9_-]+$/.test(name))
|
|
6861
|
+
if (!/^[a-zA-Z0-9_-]+$/.test(name))
|
|
6862
|
+
return res.status(400).json({ error: serverT({ en: "Invalid plugin name", fr: "Nom de plugin invalide" }) });
|
|
6723
6863
|
const targetDir = join8(getGlobalConfigDir(config3.mode ?? "production"), "plugins", name);
|
|
6724
6864
|
await openFolderRoute(targetDir, res);
|
|
6725
6865
|
});
|
|
6726
6866
|
router.delete("/:name", async (req, res) => {
|
|
6727
6867
|
const name = req.params.name;
|
|
6728
6868
|
if (!/^[a-zA-Z0-9_-]+$/.test(name)) {
|
|
6729
|
-
return res.status(400).json({ error: "Invalid plugin name" });
|
|
6869
|
+
return res.status(400).json({ error: serverT({ en: "Invalid plugin name", fr: "Nom de plugin invalide" }) });
|
|
6730
6870
|
}
|
|
6731
6871
|
const targetDir = join8(getGlobalConfigDir(config3.mode ?? "production"), "plugins", name);
|
|
6732
6872
|
try {
|
|
@@ -6736,7 +6876,9 @@ function createPluginRoutes(options) {
|
|
|
6736
6876
|
}
|
|
6737
6877
|
res.json({ success: true });
|
|
6738
6878
|
} catch (err) {
|
|
6739
|
-
res.status(500).json({
|
|
6879
|
+
res.status(500).json({
|
|
6880
|
+
error: err instanceof Error ? err.message : serverT({ en: "Failed to remove plugin", fr: "\xC9chec de la suppression du plugin" })
|
|
6881
|
+
});
|
|
6740
6882
|
}
|
|
6741
6883
|
});
|
|
6742
6884
|
return router;
|
|
@@ -6749,11 +6891,16 @@ function registerSessionFavoriteRoute(router, sessionManager) {
|
|
|
6749
6891
|
const id = req.params["id"];
|
|
6750
6892
|
const { isFavorite } = req.body;
|
|
6751
6893
|
if (typeof isFavorite !== "boolean") {
|
|
6752
|
-
return res.status(400).json({
|
|
6894
|
+
return res.status(400).json({
|
|
6895
|
+
error: serverT({
|
|
6896
|
+
en: "isFavorite is required and must be a boolean",
|
|
6897
|
+
fr: "isFavorite est requis et doit \xEAtre un bool\xE9en"
|
|
6898
|
+
})
|
|
6899
|
+
});
|
|
6753
6900
|
}
|
|
6754
6901
|
const session = sessionManager.getSession(id);
|
|
6755
6902
|
if (!session) {
|
|
6756
|
-
return res.status(404).json({ error: "Session not found" });
|
|
6903
|
+
return res.status(404).json({ error: serverT({ en: "Session not found", fr: "Session introuvable" }) });
|
|
6757
6904
|
}
|
|
6758
6905
|
toggleFavorite(id, isFavorite);
|
|
6759
6906
|
res.json({ success: true });
|
|
@@ -6810,7 +6957,7 @@ function detectWsl() {
|
|
|
6810
6957
|
// src/server/index.ts
|
|
6811
6958
|
var __dirname3 = dirname7(fileURLToPath6(import.meta.url));
|
|
6812
6959
|
async function announceContextDrift(sessionManager, sessionIds) {
|
|
6813
|
-
const { injectContextDriftRemindersForSessions } = await import("./dynamic-context-
|
|
6960
|
+
const { injectContextDriftRemindersForSessions } = await import("./dynamic-context-WKEXQCTK.js");
|
|
6814
6961
|
await injectContextDriftRemindersForSessions(sessionManager, sessionIds);
|
|
6815
6962
|
}
|
|
6816
6963
|
async function createServerHandle(config3) {
|
|
@@ -6917,7 +7064,7 @@ async function createServerHandle(config3) {
|
|
|
6917
7064
|
toolRegistry = createToolRegistry();
|
|
6918
7065
|
logger.info("MCP tools registered", { count: mcpTools.length });
|
|
6919
7066
|
}
|
|
6920
|
-
const { signalMcpReady } = await import("./server-
|
|
7067
|
+
const { signalMcpReady } = await import("./server-3UVLECD5.js");
|
|
6921
7068
|
signalMcpReady();
|
|
6922
7069
|
});
|
|
6923
7070
|
const app = express();
|
|
@@ -7028,9 +7175,9 @@ async function createServerHandle(config3) {
|
|
|
7028
7175
|
if (!name || !workdir) {
|
|
7029
7176
|
return res.status(400).json({ error: "name and workdir are required" });
|
|
7030
7177
|
}
|
|
7031
|
-
const {
|
|
7178
|
+
const { createProjectDirectory } = await import("./project-creator-T3A4H3YV.js");
|
|
7032
7179
|
try {
|
|
7033
|
-
const project = await
|
|
7180
|
+
const project = await createProjectDirectory(name, workdir);
|
|
7034
7181
|
res.status(201).json({ project });
|
|
7035
7182
|
} catch (err) {
|
|
7036
7183
|
const eaccError = err;
|
|
@@ -7132,9 +7279,9 @@ async function createServerHandle(config3) {
|
|
|
7132
7279
|
const sessionFavoriteRouter = express.Router();
|
|
7133
7280
|
registerSessionFavoriteRoute(sessionFavoriteRouter, sessionManager);
|
|
7134
7281
|
app.use("/api", sessionFavoriteRouter);
|
|
7135
|
-
const { createTasksService } = await import("./service-
|
|
7136
|
-
const { registerTaskRoutes } = await import("./tasks-
|
|
7137
|
-
const { setTasksService } = await import("./tools-
|
|
7282
|
+
const { createTasksService } = await import("./service-XIUNS5XV.js");
|
|
7283
|
+
const { registerTaskRoutes } = await import("./tasks-3JJWJJ3X.js");
|
|
7284
|
+
const { setTasksService } = await import("./tools-WWIWD3O7.js");
|
|
7138
7285
|
const tasksService = createTasksService({
|
|
7139
7286
|
sessionManager,
|
|
7140
7287
|
config: config3,
|
|
@@ -7166,7 +7313,7 @@ async function createServerHandle(config3) {
|
|
|
7166
7313
|
}
|
|
7167
7314
|
try {
|
|
7168
7315
|
await checkoutBranch(project.workdir, branch);
|
|
7169
|
-
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-
|
|
7316
|
+
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-IGINPPBP.js");
|
|
7170
7317
|
const allSessions = sessionManager.listSessions();
|
|
7171
7318
|
for (const s of allSessions) {
|
|
7172
7319
|
if (sessionManager.getEffectiveWorkdir(s.id) === project.workdir) {
|
|
@@ -7202,7 +7349,7 @@ async function createServerHandle(config3) {
|
|
|
7202
7349
|
);
|
|
7203
7350
|
}
|
|
7204
7351
|
await createBranch(project.workdir, name, sb);
|
|
7205
|
-
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-
|
|
7352
|
+
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-IGINPPBP.js");
|
|
7206
7353
|
const allSessions = sessionManager.listSessions();
|
|
7207
7354
|
for (const s of allSessions) {
|
|
7208
7355
|
if (sessionManager.getEffectiveWorkdir(s.id) === project.workdir) {
|
|
@@ -7234,7 +7381,7 @@ async function createServerHandle(config3) {
|
|
|
7234
7381
|
if (!branch || typeof branch !== "string") return res.status(400).json({ error: "branch is required" });
|
|
7235
7382
|
const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
|
|
7236
7383
|
const { checkoutBranch, validateRef: validateRef2 } = await import("./workspace-LM646OHC.js");
|
|
7237
|
-
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-
|
|
7384
|
+
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-IGINPPBP.js");
|
|
7238
7385
|
try {
|
|
7239
7386
|
await validateRef2(effectiveWorkdir, branch);
|
|
7240
7387
|
await checkoutBranch(effectiveWorkdir, branch);
|
|
@@ -7277,7 +7424,7 @@ All file and git operations should use this branch.
|
|
|
7277
7424
|
if (!name || typeof name !== "string") return res.status(400).json({ error: "name is required" });
|
|
7278
7425
|
const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
|
|
7279
7426
|
const { validateRef: validateRef2 } = await import("./workspace-LM646OHC.js");
|
|
7280
|
-
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-
|
|
7427
|
+
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-IGINPPBP.js");
|
|
7281
7428
|
try {
|
|
7282
7429
|
await validateRef2(effectiveWorkdir, name);
|
|
7283
7430
|
if (sourceBranch) {
|
|
@@ -7332,8 +7479,8 @@ All file and git operations should use this branch.
|
|
|
7332
7479
|
res.json({ workspaces: workspacesList });
|
|
7333
7480
|
});
|
|
7334
7481
|
app.get("/api/sessions", async (req, res) => {
|
|
7335
|
-
const { getRecentUserPromptsForSession } = await import("./events-
|
|
7336
|
-
const { getPendingConfirmationsBySession: getPendingConfirmationsBySession2 } = await import("./path-security-
|
|
7482
|
+
const { getRecentUserPromptsForSession } = await import("./events-3WSNI7XC.js");
|
|
7483
|
+
const { getPendingConfirmationsBySession: getPendingConfirmationsBySession2 } = await import("./path-security-5CFMMULR.js");
|
|
7337
7484
|
const projectId = req.query["projectId"];
|
|
7338
7485
|
const rawLimit = req.query["limit"];
|
|
7339
7486
|
const offset = parseInt(req.query["offset"]) || 0;
|
|
@@ -7388,7 +7535,7 @@ All file and git operations should use this branch.
|
|
|
7388
7535
|
disabledServers = mcpManager.getAllServers().filter((s) => s.config.disabled).map((s) => s.name);
|
|
7389
7536
|
}
|
|
7390
7537
|
if (disabledServers.length > 0) {
|
|
7391
|
-
const { setSessionDisabledServers: setSessionDisabledServers2 } = await import("./session-overrides-
|
|
7538
|
+
const { setSessionDisabledServers: setSessionDisabledServers2 } = await import("./session-overrides-Y5B4XQPU.js");
|
|
7392
7539
|
setSessionDisabledServers2(session.id, disabledServers);
|
|
7393
7540
|
}
|
|
7394
7541
|
} catch {
|
|
@@ -7461,10 +7608,10 @@ All file and git operations should use this branch.
|
|
|
7461
7608
|
}
|
|
7462
7609
|
});
|
|
7463
7610
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
7464
|
-
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEventsWithSnapshot2 } = await import("./events-
|
|
7465
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations } = await import("./folding-
|
|
7466
|
-
const { getPendingQuestionsForSession: getPendingQuestionsForSession2 } = await import("./tools-
|
|
7467
|
-
const { getMaxVisibleItems } = await import("./settings-
|
|
7611
|
+
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEventsWithSnapshot2 } = await import("./events-3WSNI7XC.js");
|
|
7612
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations } = await import("./folding-H7JTX6KI.js");
|
|
7613
|
+
const { getPendingQuestionsForSession: getPendingQuestionsForSession2 } = await import("./tools-WWIWD3O7.js");
|
|
7614
|
+
const { getMaxVisibleItems } = await import("./settings-ZJPM6PQV.js");
|
|
7468
7615
|
const session = sessionManager.getSession(req.params.id);
|
|
7469
7616
|
if (!session) {
|
|
7470
7617
|
return res.status(404).json({ error: "Session not found" });
|
|
@@ -7492,9 +7639,9 @@ All file and git operations should use this branch.
|
|
|
7492
7639
|
});
|
|
7493
7640
|
app.get("/api/sessions/:id/status", async (req, res) => {
|
|
7494
7641
|
const { projectSessionStatus: projectSessionStatus2 } = await import("./session-status-UFO5IFI7.js");
|
|
7495
|
-
const { getPendingQuestionsForSession: getPendingQuestionsForSession2 } = await import("./tools-
|
|
7496
|
-
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEventsWithSnapshot2 } = await import("./events-
|
|
7497
|
-
const { foldPendingConfirmations } = await import("./folding-
|
|
7642
|
+
const { getPendingQuestionsForSession: getPendingQuestionsForSession2 } = await import("./tools-WWIWD3O7.js");
|
|
7643
|
+
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEventsWithSnapshot2 } = await import("./events-3WSNI7XC.js");
|
|
7644
|
+
const { foldPendingConfirmations } = await import("./folding-H7JTX6KI.js");
|
|
7498
7645
|
const sessionId = req.params["id"];
|
|
7499
7646
|
if (!sessionId) {
|
|
7500
7647
|
return res.status(400).json({ error: "Session id is required" });
|
|
@@ -7524,8 +7671,8 @@ All file and git operations should use this branch.
|
|
|
7524
7671
|
if (!session) {
|
|
7525
7672
|
return res.status(404).json({ error: "Session not found" });
|
|
7526
7673
|
}
|
|
7527
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
7528
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
7674
|
+
const { stopSessionExecution } = await import("./chat-handler-YCZE2XEJ.js");
|
|
7675
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-WWIWD3O7.js");
|
|
7529
7676
|
sessionManager.clearMessageQueue(sessionId);
|
|
7530
7677
|
stopSessionExecution(sessionId, sessionManager);
|
|
7531
7678
|
abortSession(sessionId);
|
|
@@ -7554,9 +7701,9 @@ All file and git operations should use this branch.
|
|
|
7554
7701
|
res.json({ success: true });
|
|
7555
7702
|
});
|
|
7556
7703
|
app.post("/api/sessions/:id/provider", async (req, res) => {
|
|
7557
|
-
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-
|
|
7558
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-
|
|
7559
|
-
const { getMaxVisibleItems } = await import("./settings-
|
|
7704
|
+
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-3WSNI7XC.js");
|
|
7705
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-H7JTX6KI.js");
|
|
7706
|
+
const { getMaxVisibleItems } = await import("./settings-ZJPM6PQV.js");
|
|
7560
7707
|
const sessionId = req.params.id;
|
|
7561
7708
|
const session = sessionManager.getSession(sessionId);
|
|
7562
7709
|
if (!session) {
|
|
@@ -7584,9 +7731,9 @@ All file and git operations should use this branch.
|
|
|
7584
7731
|
res.json({ session: toClientSession(updatedSession), messages, hiddenCount, contextState });
|
|
7585
7732
|
});
|
|
7586
7733
|
app.delete("/api/sessions/:id/provider", async (req, res) => {
|
|
7587
|
-
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-
|
|
7588
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-
|
|
7589
|
-
const { getMaxVisibleItems } = await import("./settings-
|
|
7734
|
+
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-3WSNI7XC.js");
|
|
7735
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-H7JTX6KI.js");
|
|
7736
|
+
const { getMaxVisibleItems } = await import("./settings-ZJPM6PQV.js");
|
|
7590
7737
|
const sessionId = req.params.id;
|
|
7591
7738
|
const session = sessionManager.getSession(sessionId);
|
|
7592
7739
|
if (!session) {
|
|
@@ -7716,9 +7863,9 @@ All file and git operations should use this branch.
|
|
|
7716
7863
|
res.json({ success: true });
|
|
7717
7864
|
});
|
|
7718
7865
|
app.put("/api/sessions/:id/mode", async (req, res) => {
|
|
7719
|
-
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-
|
|
7720
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-
|
|
7721
|
-
const { getMaxVisibleItems } = await import("./settings-
|
|
7866
|
+
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-3WSNI7XC.js");
|
|
7867
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-H7JTX6KI.js");
|
|
7868
|
+
const { getMaxVisibleItems } = await import("./settings-ZJPM6PQV.js");
|
|
7722
7869
|
const sessionId = req.params.id;
|
|
7723
7870
|
const session = sessionManager.getSession(sessionId);
|
|
7724
7871
|
if (!session) {
|
|
@@ -7778,7 +7925,7 @@ All file and git operations should use this branch.
|
|
|
7778
7925
|
setSessionDisabledServers(sessionId, disabledServers);
|
|
7779
7926
|
const messages = session.messages ?? [];
|
|
7780
7927
|
if (messages.length === 0) {
|
|
7781
|
-
const { applyDynamicContext } = await import("./dynamic-context-
|
|
7928
|
+
const { applyDynamicContext } = await import("./dynamic-context-WKEXQCTK.js");
|
|
7782
7929
|
const modelName = session.providerModel ?? providerManager.getCurrentModel();
|
|
7783
7930
|
await applyDynamicContext(sessionManager, sessionId, modelName);
|
|
7784
7931
|
} else {
|
|
@@ -7812,7 +7959,7 @@ All file and git operations should use this branch.
|
|
|
7812
7959
|
if (alwaysAllow !== void 0 && typeof alwaysAllow !== "boolean") {
|
|
7813
7960
|
return res.status(400).json({ error: "alwaysAllow must be a boolean if provided" });
|
|
7814
7961
|
}
|
|
7815
|
-
const { providePathConfirmation: providePathConfirmation2, getConfirmationSessionId } = await import("./tools-
|
|
7962
|
+
const { providePathConfirmation: providePathConfirmation2, getConfirmationSessionId } = await import("./tools-WWIWD3O7.js");
|
|
7816
7963
|
const pendingSessionId = getConfirmationSessionId(callId);
|
|
7817
7964
|
if (!pendingSessionId) {
|
|
7818
7965
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
@@ -7824,11 +7971,11 @@ All file and git operations should use this branch.
|
|
|
7824
7971
|
if (!result.found) {
|
|
7825
7972
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
7826
7973
|
}
|
|
7827
|
-
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEvents } = await import("./events-
|
|
7828
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations } = await import("./folding-
|
|
7829
|
-
const { createSessionStateMessage } = await import("./protocol-
|
|
7830
|
-
const { getPendingQuestionsForSession: getPendingQuestionsForSession2 } = await import("./tools-
|
|
7831
|
-
const { getMaxVisibleItems } = await import("./settings-
|
|
7974
|
+
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEvents } = await import("./events-3WSNI7XC.js");
|
|
7975
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations } = await import("./folding-H7JTX6KI.js");
|
|
7976
|
+
const { createSessionStateMessage } = await import("./protocol-XO4ZROAU.js");
|
|
7977
|
+
const { getPendingQuestionsForSession: getPendingQuestionsForSession2 } = await import("./tools-WWIWD3O7.js");
|
|
7978
|
+
const { getMaxVisibleItems } = await import("./settings-ZJPM6PQV.js");
|
|
7832
7979
|
const eventStore = getEventStore2();
|
|
7833
7980
|
const { snapshot, events: eventsSinceSnapshot } = eventStore.getEventsSinceSnapshot(sessionId);
|
|
7834
7981
|
const events = combineEvents(sessionId, snapshot, eventsSinceSnapshot);
|
|
@@ -7865,7 +8012,7 @@ All file and git operations should use this branch.
|
|
|
7865
8012
|
if (!skip && typeof answer !== "string") {
|
|
7866
8013
|
return res.status(400).json({ error: "answer is required when not skipping" });
|
|
7867
8014
|
}
|
|
7868
|
-
const { provideAnswer: provideAnswer2 } = await import("./tools-
|
|
8015
|
+
const { provideAnswer: provideAnswer2 } = await import("./tools-WWIWD3O7.js");
|
|
7869
8016
|
const found = provideAnswer2(callId, answer ?? "", skip ?? false);
|
|
7870
8017
|
if (!found) {
|
|
7871
8018
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -7898,7 +8045,7 @@ All file and git operations should use this branch.
|
|
|
7898
8045
|
if (!session) {
|
|
7899
8046
|
return res.status(404).json({ error: "Session not found" });
|
|
7900
8047
|
}
|
|
7901
|
-
const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-
|
|
8048
|
+
const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-ZJPM6PQV.js");
|
|
7902
8049
|
if (getSetting2(SETTINGS_KEYS.CACHE_WARMING) !== "true") {
|
|
7903
8050
|
return res.json({ success: false, reason: "disabled" });
|
|
7904
8051
|
}
|
|
@@ -7931,7 +8078,7 @@ All file and git operations should use this branch.
|
|
|
7931
8078
|
backend: activeProvider?.backend ?? llmClient.getBackend(),
|
|
7932
8079
|
model: llmClient.getModel()
|
|
7933
8080
|
};
|
|
7934
|
-
const { runAgentTurn, TurnMetrics } = await import("./orchestrator-
|
|
8081
|
+
const { runAgentTurn, TurnMetrics } = await import("./orchestrator-OT66EDXO.js");
|
|
7935
8082
|
runAgentTurn(
|
|
7936
8083
|
{
|
|
7937
8084
|
sessionManager,
|
|
@@ -7969,15 +8116,15 @@ All file and git operations should use this branch.
|
|
|
7969
8116
|
if (!session) {
|
|
7970
8117
|
return res.status(404).json({ error: "Session not found" });
|
|
7971
8118
|
}
|
|
7972
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
7973
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
8119
|
+
const { stopSessionExecution } = await import("./chat-handler-YCZE2XEJ.js");
|
|
8120
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-WWIWD3O7.js");
|
|
7974
8121
|
const queuedMessages = sessionManager.getQueueState(sessionId);
|
|
7975
8122
|
sessionManager.clearMessageQueue(sessionId);
|
|
7976
8123
|
stopSessionExecution(sessionId, sessionManager);
|
|
7977
8124
|
abortSession(sessionId);
|
|
7978
8125
|
cancelQuestionsForSession(sessionId, "Session stopped by user");
|
|
7979
8126
|
cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
|
|
7980
|
-
const eventStore = (await import("./events-
|
|
8127
|
+
const eventStore = (await import("./events-3WSNI7XC.js")).getEventStore();
|
|
7981
8128
|
eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
|
|
7982
8129
|
res.json({ success: true, queuedMessages });
|
|
7983
8130
|
});
|
|
@@ -7991,7 +8138,7 @@ All file and git operations should use this branch.
|
|
|
7991
8138
|
if (typeof messageIndex !== "number" || messageIndex < 0) {
|
|
7992
8139
|
return res.status(400).json({ error: "messageIndex must be a non-negative number" });
|
|
7993
8140
|
}
|
|
7994
|
-
const { truncateSessionMessages } = await import("./events-
|
|
8141
|
+
const { truncateSessionMessages } = await import("./events-3WSNI7XC.js");
|
|
7995
8142
|
truncateSessionMessages(sessionId, messageIndex);
|
|
7996
8143
|
res.json({ success: true });
|
|
7997
8144
|
});
|
|
@@ -8011,8 +8158,8 @@ All file and git operations should use this branch.
|
|
|
8011
8158
|
if (attachments !== void 0 && !Array.isArray(attachments)) {
|
|
8012
8159
|
return res.status(400).json({ error: "attachments must be an array if provided" });
|
|
8013
8160
|
}
|
|
8014
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
8015
|
-
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-
|
|
8161
|
+
const { getEventStore: getEventStore2 } = await import("./events-3WSNI7XC.js");
|
|
8162
|
+
const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-H7JTX6KI.js");
|
|
8016
8163
|
const eventStore = getEventStore2();
|
|
8017
8164
|
const events = eventStore.getEvents(sessionId);
|
|
8018
8165
|
const { messages } = buildMessagesFromStoredEvents2(events);
|
|
@@ -8024,7 +8171,7 @@ All file and git operations should use this branch.
|
|
|
8024
8171
|
if (msg.role !== "user" || msg.isSystemGenerated) {
|
|
8025
8172
|
return res.status(400).json({ error: "Can only replay user messages" });
|
|
8026
8173
|
}
|
|
8027
|
-
const { truncateSessionMessages } = await import("./events-
|
|
8174
|
+
const { truncateSessionMessages } = await import("./events-3WSNI7XC.js");
|
|
8028
8175
|
truncateSessionMessages(sessionId, msgIndex - 1);
|
|
8029
8176
|
sessionManager.queueMessage(
|
|
8030
8177
|
sessionId,
|
|
@@ -8086,7 +8233,7 @@ All file and git operations should use this branch.
|
|
|
8086
8233
|
res.json({ accepted: true });
|
|
8087
8234
|
});
|
|
8088
8235
|
app.get("/api/settings", async (req, res) => {
|
|
8089
|
-
const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-
|
|
8236
|
+
const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-ZJPM6PQV.js");
|
|
8090
8237
|
const keysParam = req.query["keys"];
|
|
8091
8238
|
if (!keysParam) {
|
|
8092
8239
|
return res.status(400).json({ error: "keys query parameter is required" });
|
|
@@ -8099,19 +8246,19 @@ All file and git operations should use this branch.
|
|
|
8099
8246
|
res.json(result);
|
|
8100
8247
|
});
|
|
8101
8248
|
app.get("/api/settings/:key", async (req, res) => {
|
|
8102
|
-
const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-
|
|
8249
|
+
const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-ZJPM6PQV.js");
|
|
8103
8250
|
const key = req.params.key;
|
|
8104
8251
|
const value = getSetting2(key) ?? SETTINGS_DEFAULTS[key] ?? null;
|
|
8105
8252
|
res.json({ key, value });
|
|
8106
8253
|
});
|
|
8107
8254
|
app.get("/api/settings/:key", async (req, res) => {
|
|
8108
|
-
const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-
|
|
8255
|
+
const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-ZJPM6PQV.js");
|
|
8109
8256
|
const key = req.params.key;
|
|
8110
8257
|
const value = getSetting2(key) ?? SETTINGS_DEFAULTS[key] ?? null;
|
|
8111
8258
|
res.json({ key, value });
|
|
8112
8259
|
});
|
|
8113
8260
|
app.put("/api/settings/:key", async (req, res) => {
|
|
8114
|
-
const { setSetting: setSetting2 } = await import("./settings-
|
|
8261
|
+
const { setSetting: setSetting2 } = await import("./settings-ZJPM6PQV.js");
|
|
8115
8262
|
const key = req.params.key;
|
|
8116
8263
|
const { value } = req.body;
|
|
8117
8264
|
if (value === void 0) {
|
|
@@ -8138,7 +8285,7 @@ All file and git operations should use this branch.
|
|
|
8138
8285
|
}
|
|
8139
8286
|
});
|
|
8140
8287
|
app.get("/api/tools/shells", async (_req, res) => {
|
|
8141
|
-
const { listAvailableShells } = await import("./platform-
|
|
8288
|
+
const { listAvailableShells } = await import("./platform-XPMZKAUB.js");
|
|
8142
8289
|
res.json({ shells: listAvailableShells() });
|
|
8143
8290
|
});
|
|
8144
8291
|
app.get("/api/config", async (_req, res) => {
|
|
@@ -8175,7 +8322,8 @@ All file and git operations should use this branch.
|
|
|
8175
8322
|
activeProviderId: providerManager.getActiveProviderId(),
|
|
8176
8323
|
defaultModelSelection: config3.defaultModelSelection,
|
|
8177
8324
|
visionFallback,
|
|
8178
|
-
platform: platformInfo
|
|
8325
|
+
platform: platformInfo,
|
|
8326
|
+
locale: (await import("./settings-ZJPM6PQV.js")).getSetting("display.locale") ?? "automatic"
|
|
8179
8327
|
});
|
|
8180
8328
|
});
|
|
8181
8329
|
app.post("/api/model/refresh", async (_req, res) => {
|
|
@@ -8231,7 +8379,7 @@ All file and git operations should use this branch.
|
|
|
8231
8379
|
}));
|
|
8232
8380
|
}
|
|
8233
8381
|
app.post("/api/proxy/test", async (_req, res) => {
|
|
8234
|
-
const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-
|
|
8382
|
+
const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-ZJPM6PQV.js");
|
|
8235
8383
|
const proxyUrl = getSetting2(SETTINGS_KEYS.PROXY_URL);
|
|
8236
8384
|
if (!proxyUrl) {
|
|
8237
8385
|
return res.status(400).json({ success: false, error: "No proxy URL configured" });
|
|
@@ -8323,7 +8471,7 @@ All file and git operations should use this branch.
|
|
|
8323
8471
|
}
|
|
8324
8472
|
});
|
|
8325
8473
|
app.post("/api/proxy/test", async (_req, res) => {
|
|
8326
|
-
const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-
|
|
8474
|
+
const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-ZJPM6PQV.js");
|
|
8327
8475
|
const proxyUrl = getSetting2(SETTINGS_KEYS.PROXY_URL);
|
|
8328
8476
|
if (!proxyUrl) {
|
|
8329
8477
|
return res.status(400).json({ success: false, error: "No proxy URL configured" });
|
|
@@ -8350,7 +8498,7 @@ All file and git operations should use this branch.
|
|
|
8350
8498
|
const backend = req.query["backend"];
|
|
8351
8499
|
if (!url) return res.status(400).json({ error: "url is required" });
|
|
8352
8500
|
try {
|
|
8353
|
-
const { fetchModelsWithContext } = await import("./provider-manager-
|
|
8501
|
+
const { fetchModelsWithContext } = await import("./provider-manager-2KKZ37XJ.js");
|
|
8354
8502
|
const { getModelProfile: getModelProfile2 } = await import("./profiles-EBCVFYG7.js");
|
|
8355
8503
|
const { getCatalogEntry } = await import("./model-catalog-2PCKTYGW.js");
|
|
8356
8504
|
const models = await fetchModelsWithContext(
|
|
@@ -8425,7 +8573,7 @@ All file and git operations should use this branch.
|
|
|
8425
8573
|
const { getModelProfile: getModelProfile2 } = await import("./profiles-EBCVFYG7.js");
|
|
8426
8574
|
const { getBackendCapabilities } = await import("./backend-NDBY3DAQ.js");
|
|
8427
8575
|
const { buildNonStreamingCreateParams } = await import("./client-pure-FLKP6PTI.js");
|
|
8428
|
-
const { OpenAIHttpClient } = await import("./http-client-
|
|
8576
|
+
const { OpenAIHttpClient } = await import("./http-client-A445WYZU.js");
|
|
8429
8577
|
const { ensureVersionPrefix } = await import("./url-utils-C5BM7NF7.js");
|
|
8430
8578
|
const profile = getModelProfile2(model);
|
|
8431
8579
|
const capabilities = getBackendCapabilities(backend || "unknown");
|
|
@@ -8842,7 +8990,7 @@ All file and git operations should use this branch.
|
|
|
8842
8990
|
});
|
|
8843
8991
|
async function rebuildMcpTools() {
|
|
8844
8992
|
const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-FJAFLDZA.js");
|
|
8845
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
8993
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-WWIWD3O7.js");
|
|
8846
8994
|
const mcpTools = createMcpTools2(mcpManager);
|
|
8847
8995
|
setMcpTools2(mcpTools);
|
|
8848
8996
|
toolRegistry = createToolRegistry();
|
|
@@ -9272,13 +9420,13 @@ All file and git operations should use this branch.
|
|
|
9272
9420
|
})
|
|
9273
9421
|
);
|
|
9274
9422
|
app.get("/api/sessions/:id/background-processes", async (req, res) => {
|
|
9275
|
-
const { getSessionProcesses } = await import("./manager-
|
|
9423
|
+
const { getSessionProcesses } = await import("./manager-ZACEUL5P.js");
|
|
9276
9424
|
const sessionId = req.params.id;
|
|
9277
9425
|
const processes = getSessionProcesses(sessionId);
|
|
9278
9426
|
res.json({ processes });
|
|
9279
9427
|
});
|
|
9280
9428
|
app.post("/api/sessions/:id/background-process/:processId/stop", async (req, res) => {
|
|
9281
|
-
const { stopProcess } = await import("./manager-
|
|
9429
|
+
const { stopProcess } = await import("./manager-ZACEUL5P.js");
|
|
9282
9430
|
const sessionId = req.params.id;
|
|
9283
9431
|
const processId = req.params.processId;
|
|
9284
9432
|
const session = sessionManager.getSession(sessionId);
|
|
@@ -9418,7 +9566,7 @@ All file and git operations should use this branch.
|
|
|
9418
9566
|
);
|
|
9419
9567
|
const wss = wssExports.wss;
|
|
9420
9568
|
deferTasksBroadcast = (projectId, payload) => wssExports.broadcastForProject(projectId, "", { type: "tasks.update", payload });
|
|
9421
|
-
const { launchWorkflowRun, abortRunnerRun } = await import("./launch-
|
|
9569
|
+
const { launchWorkflowRun, abortRunnerRun } = await import("./launch-FJ65HRV4.js");
|
|
9422
9570
|
deferTasksLaunchWorkflow = (sessionId, launch) => {
|
|
9423
9571
|
const effective = sessionManager.resolveEffectiveProviderModel(sessionId);
|
|
9424
9572
|
let llmClient = getLLMClient();
|
|
@@ -9463,7 +9611,7 @@ All file and git operations should use this branch.
|
|
|
9463
9611
|
const state = sessionManager.getContextState(sessionId);
|
|
9464
9612
|
wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
|
|
9465
9613
|
});
|
|
9466
|
-
const { QueueProcessor } = await import("./processor-
|
|
9614
|
+
const { QueueProcessor } = await import("./processor-CHMHMMIE.js");
|
|
9467
9615
|
const queueProcessor = new QueueProcessor({
|
|
9468
9616
|
sessionManager,
|
|
9469
9617
|
providerManager,
|
|
@@ -9488,8 +9636,8 @@ All file and git operations should use this branch.
|
|
|
9488
9636
|
sessionManager,
|
|
9489
9637
|
listProjects: () => listProjects(),
|
|
9490
9638
|
createProject: async (name, workdir) => {
|
|
9491
|
-
const {
|
|
9492
|
-
return
|
|
9639
|
+
const { createProjectDirectory } = await import("./project-creator-T3A4H3YV.js");
|
|
9640
|
+
return createProjectDirectory(name, workdir);
|
|
9493
9641
|
},
|
|
9494
9642
|
deleteProject: (projectId) => {
|
|
9495
9643
|
const project = getProject(projectId);
|
|
@@ -9505,8 +9653,8 @@ All file and git operations should use this branch.
|
|
|
9505
9653
|
launchWorkflow: (sessionId, launch) => deferTasksLaunchWorkflow(sessionId, launch),
|
|
9506
9654
|
stopSession: (sessionId) => {
|
|
9507
9655
|
void (async () => {
|
|
9508
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
9509
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
9656
|
+
const { stopSessionExecution } = await import("./chat-handler-YCZE2XEJ.js");
|
|
9657
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-WWIWD3O7.js");
|
|
9510
9658
|
sessionManager.clearMessageQueue(sessionId);
|
|
9511
9659
|
stopSessionExecution(sessionId, sessionManager);
|
|
9512
9660
|
abortSession(sessionId);
|
|
@@ -9627,4 +9775,4 @@ export {
|
|
|
9627
9775
|
createServerHandle,
|
|
9628
9776
|
createServer
|
|
9629
9777
|
};
|
|
9630
|
-
//# sourceMappingURL=chunk-
|
|
9778
|
+
//# sourceMappingURL=chunk-5IXCCMFU.js.map
|