openfox 2.0.133 → 2.0.135
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 +30 -0
- package/dist/CHANGELOG.md +30 -0
- package/dist/{chat-handler-T47GATL5.js → chat-handler-WGDFMOOD.js} +23 -22
- package/dist/chunk-24YKXKCG.js +35 -0
- package/dist/chunk-2OMGR7LN.js +45 -0
- package/dist/{chunk-GFW2HWJ6.js → chunk-4R5GV7RW.js} +37 -16
- package/dist/{chunk-P5MSY7ZI.js → chunk-5H5NRWHA.js} +22 -17
- package/dist/{chunk-MQMPIXON.js → chunk-5UMXFLET.js} +3 -3
- package/dist/{chunk-5JWJEZJ3.js → chunk-5UQ4CKOA.js} +2 -2
- package/dist/{chunk-7JVBDBXE.js → chunk-7QMWYNVF.js} +2 -2
- package/dist/{chunk-P57IBMK4.js → chunk-AATMPL7S.js} +4 -4
- package/dist/{chunk-OUQZZEIQ.js → chunk-BIZFY3QP.js} +487 -210
- package/dist/{chunk-LQKXJPKP.js → chunk-CTWZPN7G.js} +5 -1
- package/dist/{chunk-BKMWZTNO.js → chunk-DWA4IE65.js} +14 -2
- package/dist/{chunk-HXHPKGJE.js → chunk-ESZQTFQP.js} +614 -157
- package/dist/{chunk-KWAHD2JA.js → chunk-F2MOHHXB.js} +15 -2
- package/dist/{chunk-A7CB4USC.js → chunk-GP3CLMPQ.js} +132 -45
- package/dist/{chunk-HCYSGLY2.js → chunk-HF3NDXB4.js} +1 -1
- package/dist/{chunk-Y6ZGHOKM.js → chunk-I5ODJKYM.js} +4 -4
- package/dist/{chunk-OMMPTN6X.js → chunk-IAT2LBIX.js} +69 -27
- package/dist/{chunk-6EZDW4JS.js → chunk-J3NMNYGM.js} +2 -2
- package/dist/{chunk-M5T4RDPJ.js → chunk-MEEUXRFL.js} +2 -2
- package/dist/{chunk-RRUSYVQD.js → chunk-NFEZATSN.js} +8 -8
- 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-FGNJMKDV.js → chunk-QZOV4OVN.js} +29 -5
- package/dist/{chunk-TACWRDDC.js → chunk-S67WIWUG.js} +2 -2
- package/dist/{chunk-ZL4IAFF3.js → chunk-UKIUQAQZ.js} +3 -3
- package/dist/{chunk-VXG3AFFY.js → chunk-VHLD6PCZ.js} +8 -8
- package/dist/chunk-WY3PWHWY.js +7 -0
- package/dist/{chunk-CLDCHOEA.js → chunk-ZMK4VX7V.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-454UEIEX.js} +9 -9
- package/dist/{dynamic-context-NJZKAZE3.js → dynamic-context-LKC6JYLQ.js} +10 -10
- package/dist/{events-ZJPRGVL2.js → events-335XAKFK.js} +6 -6
- package/dist/export-import-3WMRLO4A.js +137 -0
- 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-GJ7EHQRI.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-JGJWTRO5.js} +22 -21
- package/dist/package.json +3 -1
- package/dist/{path-security-CBACXAMS.js → path-security-4LROI7F4.js} +10 -10
- package/dist/{platform-5LQXOZO3.js → platform-XPMZKAUB.js} +3 -3
- package/dist/{processor-V35OLKRV.js → processor-MSQP63ML.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-CW5C3CBZ.js} +47 -36
- package/dist/server/index.d.ts +18 -3
- package/dist/server/index.js +27 -26
- package/dist/{server-GXMZMPXI.js → server-ZHEB7XS2.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-LYW5PJ3R.js} +5 -5
- package/dist/{sessions-NMPX5ICI.js → sessions-AOK3AGHY.js} +6 -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-E63MOJBO.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-XVXNSSDK.js +76 -0
- package/dist/web/assets/{index-Y300llHY.css → index-Bg_Z8i3F.css} +1 -1
- package/dist/web/assets/index-wTFCxQAw.js +313 -0
- package/dist/web/index.html +2 -2
- 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
|
@@ -4,13 +4,19 @@ import {
|
|
|
4
4
|
password,
|
|
5
5
|
select
|
|
6
6
|
} from "./chunk-AGXJ5O63.js";
|
|
7
|
+
import {
|
|
8
|
+
cliT,
|
|
9
|
+
setCliMode
|
|
10
|
+
} from "./chunk-2OMGR7LN.js";
|
|
7
11
|
|
|
8
12
|
// src/cli/main.ts
|
|
9
13
|
import { parseArgs } from "util";
|
|
10
14
|
import { generateKeyPairSync } from "crypto";
|
|
11
15
|
import { writeFile } from "fs/promises";
|
|
12
16
|
function printHelp() {
|
|
13
|
-
console.log(
|
|
17
|
+
console.log(
|
|
18
|
+
cliT({
|
|
19
|
+
en: `
|
|
14
20
|
OpenFox - Local LLM coding assistant
|
|
15
21
|
|
|
16
22
|
Usage:
|
|
@@ -34,7 +40,34 @@ Options:
|
|
|
34
40
|
--no-browser Don't open browser on start
|
|
35
41
|
-h, --help Show this help message
|
|
36
42
|
-v, --version Show version number
|
|
37
|
-
|
|
43
|
+
`,
|
|
44
|
+
fr: `
|
|
45
|
+
OpenFox - Assistant de codage LLM local
|
|
46
|
+
|
|
47
|
+
Utilisation :
|
|
48
|
+
openfox [commande] [options]
|
|
49
|
+
|
|
50
|
+
Commandes :
|
|
51
|
+
(aucune) D\xE9marrer le serveur pour le projet courant
|
|
52
|
+
config Afficher la configuration actuelle
|
|
53
|
+
provider add Ajouter un nouveau fournisseur LLM
|
|
54
|
+
provider list Lister les fournisseurs configur\xE9s
|
|
55
|
+
provider use Changer de fournisseur actif
|
|
56
|
+
provider remove Supprimer un fournisseur
|
|
57
|
+
service G\xE9rer le service systemd (install, start, stop, status, logs, uninstall)
|
|
58
|
+
pwa G\xE9rer l\u2019installation PWA (install, uninstall, launch, update, status)
|
|
59
|
+
mcp Afficher une configuration MCP pr\xEAte \xE0 coller pour ce serveur (demande le mot de passe s\u2019il est d\xE9fini)
|
|
60
|
+
install Installer un lanceur OpenFox persistant (utiliser --check pour inspecter)
|
|
61
|
+
update Mettre OpenFox \xE0 jour vers la derni\xE8re version
|
|
62
|
+
|
|
63
|
+
Options :
|
|
64
|
+
-p, --port <nombre> Sp\xE9cifier le port (d\xE9faut : 10369 pour prod, 10469 pour dev)
|
|
65
|
+
--no-browser Ne pas ouvrir le navigateur au d\xE9marrage
|
|
66
|
+
-h, --help Afficher ce message d\u2019aide
|
|
67
|
+
-v, --version Afficher le num\xE9ro de version
|
|
68
|
+
`
|
|
69
|
+
})
|
|
70
|
+
);
|
|
38
71
|
}
|
|
39
72
|
async function runNetworkSetup(mode) {
|
|
40
73
|
const { loadAuthConfig, saveAuthConfig, encryptPassword } = await import("./auth-D3WLIBTG.js");
|
|
@@ -44,12 +77,15 @@ async function runNetworkSetup(mode) {
|
|
|
44
77
|
if (existingAuth) {
|
|
45
78
|
return;
|
|
46
79
|
}
|
|
47
|
-
console.log("\nOpenFox Setup\n");
|
|
80
|
+
console.log(cliT({ en: "\nOpenFox Setup\n", fr: "\nConfiguration d\u2019OpenFox\n" }));
|
|
48
81
|
const networkChoice = await select({
|
|
49
|
-
message: "How should OpenFox be accessible?",
|
|
82
|
+
message: cliT({ en: "How should OpenFox be accessible?", fr: "Comment OpenFox doit-il \xEAtre accessible ?" }),
|
|
50
83
|
options: [
|
|
51
|
-
{ value: "localhost", label: "Secure (localhost only)" },
|
|
52
|
-
{
|
|
84
|
+
{ value: "localhost", label: cliT({ en: "Secure (localhost only)", fr: "S\xE9curis\xE9 (localhost uniquement)" }) },
|
|
85
|
+
{
|
|
86
|
+
value: "network",
|
|
87
|
+
label: cliT({ en: "Accessible from local network", fr: "Accessible depuis le r\xE9seau local" })
|
|
88
|
+
}
|
|
53
89
|
]
|
|
54
90
|
});
|
|
55
91
|
if (isCancel(networkChoice)) {
|
|
@@ -61,7 +97,10 @@ async function runNetworkSetup(mode) {
|
|
|
61
97
|
let passwordValue;
|
|
62
98
|
if (isNetwork) {
|
|
63
99
|
const pwd = await password({
|
|
64
|
-
message:
|
|
100
|
+
message: cliT({
|
|
101
|
+
en: "Set a password? (optional, press Enter to skip)",
|
|
102
|
+
fr: "D\xE9finir un mot de passe ? (facultatif, Entr\xE9e pour ignorer)"
|
|
103
|
+
})
|
|
65
104
|
});
|
|
66
105
|
if (isCancel(pwd)) {
|
|
67
106
|
cancel();
|
|
@@ -102,7 +141,7 @@ async function runNetworkSetup(mode) {
|
|
|
102
141
|
backend: "ollama"
|
|
103
142
|
}
|
|
104
143
|
});
|
|
105
|
-
console.log("\u2713 Configuration saved!\n");
|
|
144
|
+
console.log(cliT({ en: "\u2713 Configuration saved!\n", fr: "\u2713 Configuration enregistr\xE9e !\n" }));
|
|
106
145
|
}
|
|
107
146
|
async function runConfig(mode) {
|
|
108
147
|
const { loadGlobalConfig, getActiveProvider, getDefaultModel } = await import("./config-LOK3LXFH.js");
|
|
@@ -111,24 +150,27 @@ async function runConfig(mode) {
|
|
|
111
150
|
const configPath = getGlobalConfigPath(mode);
|
|
112
151
|
const activeProvider = getActiveProvider(config);
|
|
113
152
|
const defaultModel = getDefaultModel(config);
|
|
114
|
-
console.log(`Configuration (${mode}):`);
|
|
115
|
-
console.log(` Location: ${configPath}`);
|
|
116
|
-
console.log(
|
|
153
|
+
console.log(cliT({ en: `Configuration (${mode}):`, fr: `Configuration (${mode}) :` }));
|
|
154
|
+
console.log(cliT({ en: ` Location: ${configPath}`, fr: ` Emplacement : ${configPath}` }));
|
|
155
|
+
console.log(
|
|
156
|
+
cliT({ en: ` Providers: ${config.providers.length}`, fr: ` Fournisseurs : ${config.providers.length}` })
|
|
157
|
+
);
|
|
117
158
|
if (activeProvider) {
|
|
118
|
-
console.log(` Active: ${activeProvider.name}`);
|
|
119
|
-
console.log(` URL: ${activeProvider.url}`);
|
|
120
|
-
console.log(` Model: ${defaultModel ?? "auto"}`);
|
|
121
|
-
console.log(` Backend: ${activeProvider.backend}`);
|
|
159
|
+
console.log(cliT({ en: ` Active: ${activeProvider.name}`, fr: ` Actif : ${activeProvider.name}` }));
|
|
160
|
+
console.log(cliT({ en: ` URL: ${activeProvider.url}`, fr: ` URL : ${activeProvider.url}` }));
|
|
161
|
+
console.log(cliT({ en: ` Model: ${defaultModel ?? "auto"}`, fr: ` Mod\xE8le : ${defaultModel ?? "auto"}` }));
|
|
162
|
+
console.log(cliT({ en: ` Backend: ${activeProvider.backend}`, fr: ` Backend : ${activeProvider.backend}` }));
|
|
122
163
|
} else {
|
|
123
|
-
console.log(` Active: (none configured)`);
|
|
164
|
+
console.log(cliT({ en: ` Active: (none configured)`, fr: ` Actif : (aucun configur\xE9)` }));
|
|
124
165
|
}
|
|
125
166
|
const host = config.server.host ?? "127.0.0.1";
|
|
126
|
-
const hostDisplay = host === "0.0.0.0" ? `${host} (accessible from local network)` : `${host} (localhost only)
|
|
127
|
-
console.log(` Server: ${hostDisplay}`);
|
|
128
|
-
console.log(` Port: ${config.server.port}`);
|
|
167
|
+
const hostDisplay = host === "0.0.0.0" ? cliT({ en: `${host} (accessible from local network)`, fr: `${host} (accessible depuis le r\xE9seau local)` }) : cliT({ en: `${host} (localhost only)`, fr: `${host} (localhost uniquement)` });
|
|
168
|
+
console.log(cliT({ en: ` Server: ${hostDisplay}`, fr: ` Serveur : ${hostDisplay}` }));
|
|
169
|
+
console.log(cliT({ en: ` Port: ${config.server.port}`, fr: ` Port : ${config.server.port}` }));
|
|
129
170
|
}
|
|
130
171
|
async function runCli(options) {
|
|
131
172
|
const { mode } = options;
|
|
173
|
+
setCliMode(mode);
|
|
132
174
|
const { values, positionals } = parseArgs({
|
|
133
175
|
options: {
|
|
134
176
|
port: { type: "string", short: "p" },
|
|
@@ -165,13 +207,13 @@ async function runCli(options) {
|
|
|
165
207
|
break;
|
|
166
208
|
}
|
|
167
209
|
case "provider": {
|
|
168
|
-
const { runProviderCommand } = await import("./provider-
|
|
210
|
+
const { runProviderCommand } = await import("./provider-JWUNG2TD.js");
|
|
169
211
|
const [, subcommand] = positionals;
|
|
170
212
|
await runProviderCommand(mode, subcommand);
|
|
171
213
|
break;
|
|
172
214
|
}
|
|
173
215
|
case "service": {
|
|
174
|
-
const { runServiceCommand } = await import("./service-
|
|
216
|
+
const { runServiceCommand } = await import("./service-M77VWL2M.js");
|
|
175
217
|
const [, subcommand, ...serviceArgs] = positionals;
|
|
176
218
|
if (values.follow) {
|
|
177
219
|
serviceArgs.push("-f");
|
|
@@ -184,7 +226,7 @@ async function runCli(options) {
|
|
|
184
226
|
break;
|
|
185
227
|
}
|
|
186
228
|
case "pwa": {
|
|
187
|
-
const { runPwaCommand, printPwaHelp } = await import("./pwa-
|
|
229
|
+
const { runPwaCommand, printPwaHelp } = await import("./pwa-V5PFB4OQ.js");
|
|
188
230
|
const [, subcommand] = positionals;
|
|
189
231
|
if (subcommand === "--help" || subcommand === "-h" || values.help) {
|
|
190
232
|
printPwaHelp();
|
|
@@ -194,7 +236,7 @@ async function runCli(options) {
|
|
|
194
236
|
break;
|
|
195
237
|
}
|
|
196
238
|
case "mcp": {
|
|
197
|
-
const { runMcpCommand } = await import("./mcp-
|
|
239
|
+
const { runMcpCommand } = await import("./mcp-SQ4DOGPT.js");
|
|
198
240
|
const mcpOptions = {};
|
|
199
241
|
if (values.password) mcpOptions.password = values.password;
|
|
200
242
|
if (values.port) mcpOptions.port = parseInt(values.port);
|
|
@@ -202,7 +244,7 @@ async function runCli(options) {
|
|
|
202
244
|
break;
|
|
203
245
|
}
|
|
204
246
|
case "install": {
|
|
205
|
-
const { runInstall } = await import("./install-
|
|
247
|
+
const { runInstall } = await import("./install-AVTFA344.js");
|
|
206
248
|
const code = await runInstall({ check: values.check === true });
|
|
207
249
|
if (code !== 0) {
|
|
208
250
|
process.exit(code);
|
|
@@ -210,7 +252,7 @@ async function runCli(options) {
|
|
|
210
252
|
break;
|
|
211
253
|
}
|
|
212
254
|
case "update": {
|
|
213
|
-
const { runUpdate } = await import("./update-
|
|
255
|
+
const { runUpdate } = await import("./update-XVXNSSDK.js");
|
|
214
256
|
const code = await runUpdate();
|
|
215
257
|
if (code !== 0) {
|
|
216
258
|
process.exit(code);
|
|
@@ -223,7 +265,7 @@ async function runCli(options) {
|
|
|
223
265
|
if (!configExists) {
|
|
224
266
|
await runNetworkSetup(mode);
|
|
225
267
|
}
|
|
226
|
-
const { runServe } = await import("./serve-
|
|
268
|
+
const { runServe } = await import("./serve-CW5C3CBZ.js");
|
|
227
269
|
const serveOptions = { mode };
|
|
228
270
|
if (values.port) serveOptions.port = parseInt(values.port);
|
|
229
271
|
if (values["no-browser"] === true) serveOptions.openBrowser = false;
|
|
@@ -235,4 +277,4 @@ async function runCli(options) {
|
|
|
235
277
|
export {
|
|
236
278
|
runCli
|
|
237
279
|
};
|
|
238
|
-
//# sourceMappingURL=chunk-
|
|
280
|
+
//# sourceMappingURL=chunk-IAT2LBIX.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SETTINGS_KEYS,
|
|
3
3
|
getSetting
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CTWZPN7G.js";
|
|
5
5
|
import {
|
|
6
6
|
logger
|
|
7
7
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -194,4 +194,4 @@ export {
|
|
|
194
194
|
ChatHttpClient,
|
|
195
195
|
OpenAIHttpClient
|
|
196
196
|
};
|
|
197
|
-
//# sourceMappingURL=chunk-
|
|
197
|
+
//# sourceMappingURL=chunk-J3NMNYGM.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveDefaultAgentId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ORCQ3EXQ.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeAskOptions
|
|
6
6
|
} from "./chunk-LCLH6ZUL.js";
|
|
@@ -965,4 +965,4 @@ export {
|
|
|
965
965
|
buildSnapshot,
|
|
966
966
|
buildSnapshotFromSessionState
|
|
967
967
|
};
|
|
968
|
-
//# sourceMappingURL=chunk-
|
|
968
|
+
//# sourceMappingURL=chunk-MEEUXRFL.js.map
|
|
@@ -4,24 +4,24 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
combineEventsWithSnapshot,
|
|
6
6
|
getEventStore
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QZOV4OVN.js";
|
|
8
8
|
import {
|
|
9
9
|
buildMessagesFromStoredEvents,
|
|
10
10
|
foldPendingConfirmations
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MEEUXRFL.js";
|
|
12
12
|
import {
|
|
13
13
|
updateSessionMetadata
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-F2MOHHXB.js";
|
|
15
15
|
import {
|
|
16
16
|
getRuntimeConfig
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ORCQ3EXQ.js";
|
|
18
18
|
import {
|
|
19
19
|
createContextStateMessage,
|
|
20
20
|
createSessionStateMessage
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-AATMPL7S.js";
|
|
22
22
|
import {
|
|
23
23
|
getMaxVisibleItems
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-CTWZPN7G.js";
|
|
25
25
|
import {
|
|
26
26
|
logger
|
|
27
27
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -162,7 +162,7 @@ async function generateSessionNameForSession(sessionId, userMessage, deps, signa
|
|
|
162
162
|
client = deps.getLLMClient();
|
|
163
163
|
client.setModel(providerConfig.model);
|
|
164
164
|
} else if (providerConfig) {
|
|
165
|
-
const { createLLMClient } = await import("./client-
|
|
165
|
+
const { createLLMClient } = await import("./client-VVYOWXRR.js");
|
|
166
166
|
client = createLLMClient(
|
|
167
167
|
{
|
|
168
168
|
llm: {
|
|
@@ -216,4 +216,4 @@ export {
|
|
|
216
216
|
needsNameGeneration,
|
|
217
217
|
generateSessionNameForSession
|
|
218
218
|
};
|
|
219
|
-
//# sourceMappingURL=chunk-
|
|
219
|
+
//# sourceMappingURL=chunk-NFEZATSN.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SETTINGS_KEYS,
|
|
3
3
|
getSetting
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CTWZPN7G.js";
|
|
5
5
|
|
|
6
6
|
// src/server/utils/platform.ts
|
|
7
7
|
import os from "os";
|
|
@@ -63,4 +63,4 @@ export {
|
|
|
63
63
|
isWindowsPath,
|
|
64
64
|
isAbsolutePath
|
|
65
65
|
};
|
|
66
|
-
//# sourceMappingURL=chunk-
|
|
66
|
+
//# sourceMappingURL=chunk-O3RCSKUH.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
SETTINGS_KEYS,
|
|
9
9
|
getSetting
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CTWZPN7G.js";
|
|
11
11
|
import {
|
|
12
12
|
logger
|
|
13
13
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -352,4 +352,4 @@ export {
|
|
|
352
352
|
getOverrideAgentIds,
|
|
353
353
|
resolveDefaultAgentId
|
|
354
354
|
};
|
|
355
|
-
//# sourceMappingURL=chunk-
|
|
355
|
+
//# sourceMappingURL=chunk-ORCQ3EXQ.js.map
|
|
@@ -8,16 +8,25 @@ import {
|
|
|
8
8
|
} from "./chunk-OSXPQSLW.js";
|
|
9
9
|
import {
|
|
10
10
|
parseDefaultModelSelection
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5UQ4CKOA.js";
|
|
12
12
|
import {
|
|
13
13
|
getProject
|
|
14
14
|
} from "./chunk-DPFET73G.js";
|
|
15
|
+
import {
|
|
16
|
+
SETTINGS_KEYS,
|
|
17
|
+
getSetting
|
|
18
|
+
} from "./chunk-CTWZPN7G.js";
|
|
15
19
|
import {
|
|
16
20
|
getDatabase
|
|
17
21
|
} from "./chunk-JU757HVI.js";
|
|
18
22
|
import {
|
|
19
23
|
logger
|
|
20
24
|
} from "./chunk-K44MW7JJ.js";
|
|
25
|
+
import {
|
|
26
|
+
getLocale,
|
|
27
|
+
setLocale,
|
|
28
|
+
t
|
|
29
|
+
} from "./chunk-24YKXKCG.js";
|
|
21
30
|
|
|
22
31
|
// src/server/commands/registry.ts
|
|
23
32
|
import { writeFile, mkdir, unlink } from "fs/promises";
|
|
@@ -654,6 +663,16 @@ function safeParseAttachments(raw) {
|
|
|
654
663
|
}
|
|
655
664
|
}
|
|
656
665
|
|
|
666
|
+
// src/server/i18n.ts
|
|
667
|
+
function resolveLocale() {
|
|
668
|
+
return getSetting(SETTINGS_KEYS.DISPLAY_LOCALE) === "fr" ? "fr" : "en";
|
|
669
|
+
}
|
|
670
|
+
function serverT(tx, vars) {
|
|
671
|
+
const locale = resolveLocale();
|
|
672
|
+
if (getLocale() !== locale) setLocale(locale);
|
|
673
|
+
return t(tx, vars);
|
|
674
|
+
}
|
|
675
|
+
|
|
657
676
|
// src/server/tasks/service.ts
|
|
658
677
|
function isTaskConflictError(err) {
|
|
659
678
|
return err instanceof Error && err.code === "CONFLICT";
|
|
@@ -712,13 +731,15 @@ function createTasksService(deps) {
|
|
|
712
731
|
function assertOwned(projectId, taskId) {
|
|
713
732
|
const task = getTask(taskId);
|
|
714
733
|
if (!task || task.projectId !== projectId) {
|
|
715
|
-
throw new Error(
|
|
734
|
+
throw new Error(serverT({ en: "Task not found: {{id}}", fr: "T\xE2che introuvable : {{id}}" }, { id: taskId }));
|
|
716
735
|
}
|
|
717
736
|
return task;
|
|
718
737
|
}
|
|
719
738
|
function assertNotStale(task, expectedVersion) {
|
|
720
739
|
if (expectedVersion !== void 0 && task.version !== expectedVersion) {
|
|
721
|
-
const err = new Error(
|
|
740
|
+
const err = new Error(
|
|
741
|
+
serverT({ en: "Task changed, refresh and retry", fr: "T\xE2che modifi\xE9e, actualisez et r\xE9essayez" })
|
|
742
|
+
);
|
|
722
743
|
err.code = "CONFLICT";
|
|
723
744
|
err.task = task;
|
|
724
745
|
throw err;
|
|
@@ -728,7 +749,12 @@ function createTasksService(deps) {
|
|
|
728
749
|
const hasContent = input.prompt.trim().length > 0;
|
|
729
750
|
const hasAttachments = (input.attachments?.length ?? 0) > 0;
|
|
730
751
|
if (!hasContent && !hasAttachments) {
|
|
731
|
-
throw new Error(
|
|
752
|
+
throw new Error(
|
|
753
|
+
serverT({
|
|
754
|
+
en: "Task requires at least a prompt or an attachment",
|
|
755
|
+
fr: "La t\xE2che requiert au moins un prompt ou une pi\xE8ce jointe"
|
|
756
|
+
})
|
|
757
|
+
);
|
|
732
758
|
}
|
|
733
759
|
const task = createTask(projectId, {
|
|
734
760
|
prompt: input.prompt,
|
|
@@ -757,7 +783,8 @@ function createTasksService(deps) {
|
|
|
757
783
|
function duplicate(projectId, taskId, actor) {
|
|
758
784
|
const source = assertOwned(projectId, taskId);
|
|
759
785
|
const copy = cloneTask(taskId);
|
|
760
|
-
if (!copy)
|
|
786
|
+
if (!copy)
|
|
787
|
+
throw new Error(serverT({ en: "Task not found: {{id}}", fr: "T\xE2che introuvable : {{id}}" }, { id: taskId }));
|
|
761
788
|
addAuditEntry(
|
|
762
789
|
copy.id,
|
|
763
790
|
actor.actor,
|
|
@@ -800,7 +827,12 @@ function createTasksService(deps) {
|
|
|
800
827
|
const settings = getTaskSettings(projectId);
|
|
801
828
|
if (opts.actor === "agent") {
|
|
802
829
|
if (!opts.sessionId) {
|
|
803
|
-
throw new Error(
|
|
830
|
+
throw new Error(
|
|
831
|
+
serverT({
|
|
832
|
+
en: "Agent moves must bind to the current session (sessionId is required)",
|
|
833
|
+
fr: "Les d\xE9placements d\u2019agent doivent \xEAtre li\xE9s \xE0 la session courante (sessionId requis)"
|
|
834
|
+
})
|
|
835
|
+
);
|
|
804
836
|
}
|
|
805
837
|
setTaskRunState(taskId, "running");
|
|
806
838
|
addTaskLink(taskId, opts.sessionId, true);
|
|
@@ -865,7 +897,7 @@ function createTasksService(deps) {
|
|
|
865
897
|
const gates = getGateConfig(projectId);
|
|
866
898
|
const gate = gates.find((g) => g.id === gateId);
|
|
867
899
|
if (!gate) {
|
|
868
|
-
throw new Error(
|
|
900
|
+
throw new Error(serverT({ en: "Unknown gate: {{id}}", fr: "Porte inconnue : {{id}}" }, { id: gateId }));
|
|
869
901
|
}
|
|
870
902
|
setGateValue(taskId, gateId, value, actor.actor, actor.actorName, sessionId);
|
|
871
903
|
addAuditEntry(taskId, actor.actor, "gate_value", `Set gate "${gate.name}" = "${value}"`, actor.actorName);
|
|
@@ -895,7 +927,15 @@ function createTasksService(deps) {
|
|
|
895
927
|
function reorder(projectId, taskId, status, toIndex) {
|
|
896
928
|
const task = assertOwned(projectId, taskId);
|
|
897
929
|
if (task.status !== status) {
|
|
898
|
-
throw new Error(
|
|
930
|
+
throw new Error(
|
|
931
|
+
serverT(
|
|
932
|
+
{
|
|
933
|
+
en: "Cannot reorder task: status mismatch ({{current}} != {{target}})",
|
|
934
|
+
fr: "Impossible de r\xE9ordonner la t\xE2che : statut incoh\xE9rent ({{current}} != {{target}})"
|
|
935
|
+
},
|
|
936
|
+
{ current: task.status, target: status }
|
|
937
|
+
)
|
|
938
|
+
);
|
|
899
939
|
}
|
|
900
940
|
reorderTask(taskId, status, toIndex);
|
|
901
941
|
const fresh = getTask(taskId);
|
|
@@ -906,11 +946,11 @@ function createTasksService(deps) {
|
|
|
906
946
|
return computeCounts(listTasks(projectId));
|
|
907
947
|
}
|
|
908
948
|
function computeCounts(tasks) {
|
|
909
|
-
const todo = tasks.filter((
|
|
910
|
-
const inProgress = tasks.filter((
|
|
911
|
-
const running = tasks.filter((
|
|
912
|
-
const queued = tasks.filter((
|
|
913
|
-
const done = tasks.filter((
|
|
949
|
+
const todo = tasks.filter((t2) => t2.status === "todo").length;
|
|
950
|
+
const inProgress = tasks.filter((t2) => t2.status === "in_progress").length;
|
|
951
|
+
const running = tasks.filter((t2) => t2.status === "in_progress" && t2.runState === "running").length;
|
|
952
|
+
const queued = tasks.filter((t2) => t2.status === "in_progress" && t2.runState === "queued").length;
|
|
953
|
+
const done = tasks.filter((t2) => t2.status === "done").length;
|
|
914
954
|
return { open: todo + inProgress, todo, inProgress, running, queued, done };
|
|
915
955
|
}
|
|
916
956
|
function requiredGates(projectId, variant) {
|
|
@@ -922,7 +962,13 @@ function createTasksService(deps) {
|
|
|
922
962
|
}
|
|
923
963
|
function gateBlockedError(task, destination, missing) {
|
|
924
964
|
const err = new Error(
|
|
925
|
-
|
|
965
|
+
serverT(
|
|
966
|
+
{
|
|
967
|
+
en: "Cannot move to {{destination}}: missing required gate fields: {{missing}}",
|
|
968
|
+
fr: "Impossible de d\xE9placer vers {{destination}} : champs de porte requis manquants : {{missing}}"
|
|
969
|
+
},
|
|
970
|
+
{ destination, missing: missing.map((m) => m.name).join(", ") }
|
|
971
|
+
)
|
|
926
972
|
);
|
|
927
973
|
err.code = "GATE_BLOCKED";
|
|
928
974
|
err.missing = missing;
|
|
@@ -930,7 +976,7 @@ function createTasksService(deps) {
|
|
|
930
976
|
return err;
|
|
931
977
|
}
|
|
932
978
|
function activeCount(projectId) {
|
|
933
|
-
return listTasks(projectId).filter((
|
|
979
|
+
return listTasks(projectId).filter((t2) => t2.status === "in_progress" && t2.runState === "running").length;
|
|
934
980
|
}
|
|
935
981
|
async function seedSession(projectId, task, from, targetSessionId) {
|
|
936
982
|
let session;
|
|
@@ -989,7 +1035,7 @@ function createTasksService(deps) {
|
|
|
989
1035
|
const settings = getTaskSettings(projectId);
|
|
990
1036
|
if (settings.queuePaused) return void 0;
|
|
991
1037
|
if (activeCount(projectId) >= settings.slotLimit) return void 0;
|
|
992
|
-
const queued = listTasks(projectId).filter((
|
|
1038
|
+
const queued = listTasks(projectId).filter((t2) => t2.status === "in_progress" && t2.runState === "queued").sort((a, b) => a.position - b.position);
|
|
993
1039
|
const next = queued[0];
|
|
994
1040
|
if (!next) return void 0;
|
|
995
1041
|
setTaskRunState(next.id, "running");
|
|
@@ -1087,6 +1133,7 @@ function promptLabel(prompt) {
|
|
|
1087
1133
|
}
|
|
1088
1134
|
|
|
1089
1135
|
export {
|
|
1136
|
+
serverT,
|
|
1090
1137
|
loadDefaultCommands,
|
|
1091
1138
|
loadUserCommands,
|
|
1092
1139
|
loadProjectCommands,
|
|
@@ -1119,4 +1166,4 @@ export {
|
|
|
1119
1166
|
isTaskGateError,
|
|
1120
1167
|
createTasksService
|
|
1121
1168
|
};
|
|
1122
|
-
//# sourceMappingURL=chunk-
|
|
1169
|
+
//# sourceMappingURL=chunk-OZWHRBDY.js.map
|
|
@@ -6,16 +6,16 @@ import {
|
|
|
6
6
|
foldSessionState,
|
|
7
7
|
spreadOptionalMessageFields,
|
|
8
8
|
trimSnapshotStreamingOutput
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MEEUXRFL.js";
|
|
10
10
|
import {
|
|
11
11
|
updateSessionMessageCount
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-F2MOHHXB.js";
|
|
13
13
|
import {
|
|
14
14
|
getRuntimeConfig
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ORCQ3EXQ.js";
|
|
16
16
|
import {
|
|
17
17
|
SETTINGS_KEYS
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-CTWZPN7G.js";
|
|
19
19
|
import {
|
|
20
20
|
logger
|
|
21
21
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -211,6 +211,30 @@ var EventStore = class _EventStore {
|
|
|
211
211
|
}
|
|
212
212
|
return results;
|
|
213
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* Import events verbatim (used by session import).
|
|
216
|
+
* Preserves original seq and timestamp; rewrites the sessionId.
|
|
217
|
+
* Intended for a fresh session (no existing events for the target id).
|
|
218
|
+
*/
|
|
219
|
+
importEvents(sessionId, events) {
|
|
220
|
+
if (events.length === 0) return [];
|
|
221
|
+
const insert = this.db.prepare(
|
|
222
|
+
`INSERT INTO events (session_id, seq, timestamp, event_type, payload)
|
|
223
|
+
VALUES (?, ?, ?, ?, ?)`
|
|
224
|
+
);
|
|
225
|
+
const transaction = this.db.transaction(() => {
|
|
226
|
+
for (const event of events) {
|
|
227
|
+
insert.run(sessionId, event.seq, event.timestamp, event.type, JSON.stringify(event.data));
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
transaction();
|
|
231
|
+
this.invalidateSessionCache(sessionId);
|
|
232
|
+
const stored = events.map((event) => ({ ...event, sessionId }));
|
|
233
|
+
for (const event of stored) {
|
|
234
|
+
this.notifySubscribers(sessionId, event);
|
|
235
|
+
}
|
|
236
|
+
return stored;
|
|
237
|
+
}
|
|
214
238
|
getNextSeq(sessionId) {
|
|
215
239
|
const row = this.db.prepare(`SELECT MAX(seq) as max_seq FROM events WHERE session_id = ?`).get(sessionId);
|
|
216
240
|
return (row?.max_seq ?? 0) + 1;
|
|
@@ -1465,4 +1489,4 @@ export {
|
|
|
1465
1489
|
truncateSessionMessages,
|
|
1466
1490
|
getRecentUserPromptsForSession
|
|
1467
1491
|
};
|
|
1468
|
-
//# sourceMappingURL=chunk-
|
|
1492
|
+
//# sourceMappingURL=chunk-QZOV4OVN.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateSessionMcpDisabledServers
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-F2MOHHXB.js";
|
|
4
4
|
import {
|
|
5
5
|
getDatabase
|
|
6
6
|
} from "./chunk-JU757HVI.js";
|
|
@@ -62,4 +62,4 @@ export {
|
|
|
62
62
|
clearSessionOverrides,
|
|
63
63
|
getAllSessionOverrides
|
|
64
64
|
};
|
|
65
|
-
//# sourceMappingURL=chunk-
|
|
65
|
+
//# sourceMappingURL=chunk-S67WIWUG.js.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-7ET46SNE.js";
|
|
4
4
|
import {
|
|
5
5
|
COMPACTION_PROMPT
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7QMWYNVF.js";
|
|
7
7
|
import {
|
|
8
8
|
getCurrentWindowMessageOptions
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QZOV4OVN.js";
|
|
10
10
|
|
|
11
11
|
// src/server/context/compactor.ts
|
|
12
12
|
function appendCompactionPrompt(sessionId, append) {
|
|
@@ -36,4 +36,4 @@ export {
|
|
|
36
36
|
COMPACTION_MAX_RATIO,
|
|
37
37
|
shouldCompact
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
39
|
+
//# sourceMappingURL=chunk-UKIUQAQZ.js.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getAllInstructions,
|
|
3
3
|
getEnabledSkillMetadata
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DWA4IE65.js";
|
|
5
5
|
import {
|
|
6
6
|
buildTopLevelSystemPrompt
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7QMWYNVF.js";
|
|
8
8
|
import {
|
|
9
9
|
getCurrentContextWindowId,
|
|
10
10
|
getEventStore
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-QZOV4OVN.js";
|
|
12
12
|
import {
|
|
13
13
|
findAgentById,
|
|
14
14
|
getRuntimeConfig,
|
|
15
15
|
getSubAgents,
|
|
16
16
|
loadAllAgentsDefault,
|
|
17
17
|
resolveDefaultAgentId
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ORCQ3EXQ.js";
|
|
19
19
|
import {
|
|
20
20
|
logger
|
|
21
21
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -223,7 +223,7 @@ async function injectDriftReminders(sessionManager, sessionId, agentDef, options
|
|
|
223
223
|
if (!cached) {
|
|
224
224
|
return { injectedToolReminder: false, injectedPromptReminder: false };
|
|
225
225
|
}
|
|
226
|
-
const { getToolRegistryForAgent } = await import("./tools-
|
|
226
|
+
const { getToolRegistryForAgent } = await import("./tools-E63MOJBO.js");
|
|
227
227
|
const liveTools = getToolRegistryForAgent(agentDef, sessionId).definitions;
|
|
228
228
|
let injectedToolReminder = false;
|
|
229
229
|
let injectedPromptReminder = false;
|
|
@@ -329,7 +329,7 @@ function resolveAgentDef(sessionManager, sessionId) {
|
|
|
329
329
|
}
|
|
330
330
|
async function buildCachedPrompt(sessionManager, sessionId, agentDef, modelName) {
|
|
331
331
|
const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
|
|
332
|
-
const { getToolRegistryForAgent } = await import("./tools-
|
|
332
|
+
const { getToolRegistryForAgent } = await import("./tools-E63MOJBO.js");
|
|
333
333
|
const tools = getToolRegistryForAgent(agentDef, sessionId).definitions;
|
|
334
334
|
const toolFingerprint = getToolFingerprint(tools);
|
|
335
335
|
const allAgents = await loadAllAgentsDefault(sessionManager.getProjectWorkdir(sessionId));
|
|
@@ -349,7 +349,7 @@ async function buildCachedPrompt(sessionManager, sessionId, agentDef, modelName)
|
|
|
349
349
|
async function computeSessionHash(sessionManager, sessionId, modelName) {
|
|
350
350
|
const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
|
|
351
351
|
const agentDef = await resolveAgentDef(sessionManager, sessionId);
|
|
352
|
-
const { getToolRegistryForAgent } = await import("./tools-
|
|
352
|
+
const { getToolRegistryForAgent } = await import("./tools-E63MOJBO.js");
|
|
353
353
|
const tools = getToolRegistryForAgent(agentDef, sessionId).definitions;
|
|
354
354
|
const toolFingerprint = getToolFingerprint(tools);
|
|
355
355
|
return computeDynamicContextHash(instructionContent, skills, toolFingerprint, modelName);
|
|
@@ -390,4 +390,4 @@ export {
|
|
|
390
390
|
computeSessionHash,
|
|
391
391
|
applyDynamicContext
|
|
392
392
|
};
|
|
393
|
-
//# sourceMappingURL=chunk-
|
|
393
|
+
//# sourceMappingURL=chunk-VHLD6PCZ.js.map
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
DONE,
|
|
21
21
|
LLMError,
|
|
22
22
|
OpenAIHttpClient
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-J3NMNYGM.js";
|
|
24
24
|
import {
|
|
25
25
|
logger
|
|
26
26
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -768,4 +768,4 @@ function createLLMClient(config, initialBackend = config.llm.backend ?? "unknown
|
|
|
768
768
|
export {
|
|
769
769
|
createLLMClient
|
|
770
770
|
};
|
|
771
|
-
//# sourceMappingURL=chunk-
|
|
771
|
+
//# sourceMappingURL=chunk-ZMK4VX7V.js.map
|