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.
Files changed (84) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/CHANGELOG.md +30 -0
  3. package/dist/{chat-handler-T47GATL5.js → chat-handler-WGDFMOOD.js} +23 -22
  4. package/dist/chunk-24YKXKCG.js +35 -0
  5. package/dist/chunk-2OMGR7LN.js +45 -0
  6. package/dist/{chunk-GFW2HWJ6.js → chunk-4R5GV7RW.js} +37 -16
  7. package/dist/{chunk-P5MSY7ZI.js → chunk-5H5NRWHA.js} +22 -17
  8. package/dist/{chunk-MQMPIXON.js → chunk-5UMXFLET.js} +3 -3
  9. package/dist/{chunk-5JWJEZJ3.js → chunk-5UQ4CKOA.js} +2 -2
  10. package/dist/{chunk-7JVBDBXE.js → chunk-7QMWYNVF.js} +2 -2
  11. package/dist/{chunk-P57IBMK4.js → chunk-AATMPL7S.js} +4 -4
  12. package/dist/{chunk-OUQZZEIQ.js → chunk-BIZFY3QP.js} +487 -210
  13. package/dist/{chunk-LQKXJPKP.js → chunk-CTWZPN7G.js} +5 -1
  14. package/dist/{chunk-BKMWZTNO.js → chunk-DWA4IE65.js} +14 -2
  15. package/dist/{chunk-HXHPKGJE.js → chunk-ESZQTFQP.js} +614 -157
  16. package/dist/{chunk-KWAHD2JA.js → chunk-F2MOHHXB.js} +15 -2
  17. package/dist/{chunk-A7CB4USC.js → chunk-GP3CLMPQ.js} +132 -45
  18. package/dist/{chunk-HCYSGLY2.js → chunk-HF3NDXB4.js} +1 -1
  19. package/dist/{chunk-Y6ZGHOKM.js → chunk-I5ODJKYM.js} +4 -4
  20. package/dist/{chunk-OMMPTN6X.js → chunk-IAT2LBIX.js} +69 -27
  21. package/dist/{chunk-6EZDW4JS.js → chunk-J3NMNYGM.js} +2 -2
  22. package/dist/{chunk-M5T4RDPJ.js → chunk-MEEUXRFL.js} +2 -2
  23. package/dist/{chunk-RRUSYVQD.js → chunk-NFEZATSN.js} +8 -8
  24. package/dist/{chunk-MGEYAYGU.js → chunk-O3RCSKUH.js} +2 -2
  25. package/dist/{chunk-ELYHHEYL.js → chunk-ORCQ3EXQ.js} +2 -2
  26. package/dist/{chunk-FEIRWXLX.js → chunk-OZWHRBDY.js} +64 -17
  27. package/dist/{chunk-FGNJMKDV.js → chunk-QZOV4OVN.js} +29 -5
  28. package/dist/{chunk-TACWRDDC.js → chunk-S67WIWUG.js} +2 -2
  29. package/dist/{chunk-ZL4IAFF3.js → chunk-UKIUQAQZ.js} +3 -3
  30. package/dist/{chunk-VXG3AFFY.js → chunk-VHLD6PCZ.js} +8 -8
  31. package/dist/chunk-WY3PWHWY.js +7 -0
  32. package/dist/{chunk-CLDCHOEA.js → chunk-ZMK4VX7V.js} +2 -2
  33. package/dist/cli/dev.js +4 -1
  34. package/dist/cli/index.js +4 -1
  35. package/dist/{client-2K6PPPJJ.js → client-VVYOWXRR.js} +4 -4
  36. package/dist/{compactor-OEJAA2YP.js → compactor-454UEIEX.js} +9 -9
  37. package/dist/{dynamic-context-NJZKAZE3.js → dynamic-context-LKC6JYLQ.js} +10 -10
  38. package/dist/{events-ZJPRGVL2.js → events-335XAKFK.js} +6 -6
  39. package/dist/export-import-3WMRLO4A.js +137 -0
  40. package/dist/{folding-QRZOHY2I.js → folding-H7JTX6KI.js} +4 -4
  41. package/dist/{http-client-P4XTKAZA.js → http-client-A445WYZU.js} +3 -3
  42. package/dist/{install-VA2F6X6Z.js → install-AVTFA344.js} +64 -15
  43. package/dist/{launch-UKXVO37B.js → launch-GJ7EHQRI.js} +23 -22
  44. package/dist/{manager-TMBFBCQL.js → manager-ZACEUL5P.js} +4 -4
  45. package/dist/{mcp-YU7AM3UV.js → mcp-SQ4DOGPT.js} +22 -9
  46. package/dist/{orchestrator-GX22Y5EM.js → orchestrator-JGJWTRO5.js} +22 -21
  47. package/dist/package.json +3 -1
  48. package/dist/{path-security-CBACXAMS.js → path-security-4LROI7F4.js} +10 -10
  49. package/dist/{platform-5LQXOZO3.js → platform-XPMZKAUB.js} +3 -3
  50. package/dist/{processor-V35OLKRV.js → processor-MSQP63ML.js} +22 -21
  51. package/dist/{project-creator-6AGQTNXB.js → project-creator-T3A4H3YV.js} +42 -29
  52. package/dist/{protocol-BMUoqwYH.d.ts → protocol-Nr_H1_oC.d.ts} +3 -1
  53. package/dist/{protocol-Y7MRKRUO.js → protocol-XO4ZROAU.js} +3 -3
  54. package/dist/provider/index.d.ts +4 -4
  55. package/dist/provider-JWUNG2TD.js +507 -0
  56. package/dist/{provider-manager-BO5ZBG3T.js → provider-manager-2KKZ37XJ.js} +5 -5
  57. package/dist/pwa-V5PFB4OQ.js +502 -0
  58. package/dist/{registry-CMSSZHDC.js → registry-BEIR7Y5G.js} +3 -3
  59. package/dist/{serve-XRVT3D7Z.js → serve-CW5C3CBZ.js} +47 -36
  60. package/dist/server/index.d.ts +18 -3
  61. package/dist/server/index.js +27 -26
  62. package/dist/{server-GXMZMPXI.js → server-ZHEB7XS2.js} +26 -25
  63. package/dist/{service-WKABQHKL.js → service-M77VWL2M.js} +97 -32
  64. package/dist/{service-O3LCO3TQ.js → service-XIUNS5XV.js} +7 -6
  65. package/dist/{session-overrides-OECQYRDK.js → session-overrides-LYW5PJ3R.js} +5 -5
  66. package/dist/{sessions-NMPX5ICI.js → sessions-AOK3AGHY.js} +6 -4
  67. package/dist/{settings-MDCRNQBY.js → settings-ZJPM6PQV.js} +2 -2
  68. package/dist/shared/index.d.ts +31 -4
  69. package/dist/shared/index.js +16 -2
  70. package/dist/{tasks-WOC3QUFA.js → tasks-3JJWJJ3X.js} +34 -18
  71. package/dist/{tools-CW6POKUL.js → tools-E63MOJBO.js} +20 -19
  72. package/dist/{types-CoY8Ka1C.d.ts → types-BlQjLBui.d.ts} +1 -1
  73. package/dist/{types-BIkpxjaj.d.ts → types-G10ho8PT.d.ts} +1 -1
  74. package/dist/update-XVXNSSDK.js +76 -0
  75. package/dist/web/assets/{index-Y300llHY.css → index-Bg_Z8i3F.css} +1 -1
  76. package/dist/web/assets/index-wTFCxQAw.js +313 -0
  77. package/dist/web/index.html +2 -2
  78. package/dist/web/sw.js +1 -1
  79. package/package.json +3 -1
  80. package/dist/chunk-JKGHTBEV.js +0 -7
  81. package/dist/provider-NWRGNGS3.js +0 -403
  82. package/dist/pwa-2GRFSXD7.js +0 -363
  83. package/dist/update-VC3Y3EOP.js +0 -49
  84. package/dist/web/assets/index-ATAQvBwl.js +0 -312
@@ -0,0 +1,502 @@
1
+ import {
2
+ cancel,
3
+ confirm,
4
+ isCancel,
5
+ log
6
+ } from "./chunk-AGXJ5O63.js";
7
+ import {
8
+ cliT
9
+ } from "./chunk-2OMGR7LN.js";
10
+ import "./chunk-24YKXKCG.js";
11
+ import {
12
+ getGlobalConfigDir
13
+ } from "./chunk-CQGTEGKL.js";
14
+ import "./chunk-YLJ4XMA6.js";
15
+
16
+ // src/cli/pwa.ts
17
+ import { execSync, spawn } from "child_process";
18
+ import { join } from "path";
19
+ import { readFile, writeFile, access, mkdir } from "fs/promises";
20
+ import { platform } from "os";
21
+ var PWA_CONFIG_FILE = "pwa.json";
22
+ function execSyncSilent(cmd) {
23
+ try {
24
+ return execSync(cmd, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], windowsHide: true });
25
+ } catch {
26
+ return "";
27
+ }
28
+ }
29
+ function execSyncOk(cmd) {
30
+ try {
31
+ execSync(cmd, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], windowsHide: true });
32
+ return true;
33
+ } catch {
34
+ return false;
35
+ }
36
+ }
37
+ function isFirefoxPwaAvailable() {
38
+ if (platform() === "win32") {
39
+ return execSyncOk("where firefoxpwa");
40
+ }
41
+ return execSyncOk("which firefoxpwa");
42
+ }
43
+ function isRuntimeInstalled() {
44
+ const out = execSyncSilent("firefoxpwa runtime --help");
45
+ return out.includes("uninstall");
46
+ }
47
+ function getManifestUrl(mode) {
48
+ const port = mode === "development" ? 10469 : 10369;
49
+ return `http://127.0.0.1:${port}/manifest.webmanifest`;
50
+ }
51
+ function getPwaConfigPath(mode) {
52
+ return join(getGlobalConfigDir(mode), PWA_CONFIG_FILE);
53
+ }
54
+ async function loadPwaConfig(mode) {
55
+ try {
56
+ const content = await readFile(getPwaConfigPath(mode), "utf-8");
57
+ return JSON.parse(content);
58
+ } catch {
59
+ return null;
60
+ }
61
+ }
62
+ async function savePwaConfig(mode, config) {
63
+ await mkdir(getGlobalConfigDir(mode), { recursive: true });
64
+ await writeFile(getPwaConfigPath(mode), JSON.stringify(config, null, 2));
65
+ }
66
+ async function removePwaConfig(mode) {
67
+ try {
68
+ await access(getPwaConfigPath(mode));
69
+ } catch {
70
+ return;
71
+ }
72
+ const { unlink } = await import("fs/promises");
73
+ await unlink(getPwaConfigPath(mode));
74
+ }
75
+ function getFirefoxPwaInstallHint() {
76
+ const plat = platform();
77
+ switch (plat) {
78
+ case "darwin":
79
+ return "brew install firefoxpwa";
80
+ case "win32":
81
+ return "scoop install extras/firefoxpwa # or: choco install firefoxpwa # or: winget install filips.FirefoxPWA";
82
+ case "linux":
83
+ if (execSyncOk("which apt-get")) return "apt install firefoxpwa # Debian/Ubuntu";
84
+ if (execSyncOk("which dnf")) return "dnf install firefoxpwa # Fedora/RHEL";
85
+ if (execSyncOk("which pacman")) return "pacman -S firefoxpwa # Arch";
86
+ return "See: https://pwasforfirefox.filips.si/installation/";
87
+ default:
88
+ return "See: https://pwasforfirefox.filips.si/installation/";
89
+ }
90
+ }
91
+ function probeInstalledApp(manifestUrl) {
92
+ try {
93
+ const out = execSync("firefoxpwa profile list", { encoding: "utf-8", windowsHide: true });
94
+ const lines = out.split("\n");
95
+ let currentProfile = "";
96
+ for (const line of lines) {
97
+ const idMatch = line.match(/^ID:\s+(\S+)/);
98
+ if (idMatch) {
99
+ currentProfile = idMatch[1];
100
+ continue;
101
+ }
102
+ const appMatch = line.match(/-\s+\S+:\s+(\S+)\s+\((\S+)\)/);
103
+ if (appMatch && currentProfile) {
104
+ if (appMatch[1] === manifestUrl) {
105
+ return { appId: appMatch[2], profileId: currentProfile };
106
+ }
107
+ }
108
+ }
109
+ } catch {
110
+ }
111
+ return null;
112
+ }
113
+ async function isServerReachable(port) {
114
+ try {
115
+ const res = await fetch(`http://127.0.0.1:${port}/manifest.webmanifest`, {
116
+ signal: AbortSignal.timeout(5e3)
117
+ });
118
+ return res.ok;
119
+ } catch {
120
+ return false;
121
+ }
122
+ }
123
+ function printPwaHelp() {
124
+ console.log(
125
+ cliT({
126
+ en: `
127
+ PWA Commands (via Firefox PWAsForFirefox):
128
+
129
+ openfox pwa Start the PWA install walkthrough
130
+ openfox pwa install Install OpenFox as a desktop PWA
131
+ openfox pwa uninstall Remove the OpenFox PWA from your system
132
+ openfox pwa launch Launch the OpenFox PWA
133
+ openfox pwa update Re-register the PWA (use after upgrading OpenFox)
134
+ openfox pwa status Check if the PWA is installed
135
+
136
+ Requirements:
137
+ Install PWAsForFirefox first: https://pwasforfirefox.filips.si/installation/
138
+ `,
139
+ fr: `
140
+ Commandes PWA (via Firefox PWAsForFirefox) :
141
+
142
+ openfox pwa D\xE9marrer l\u2019assistant d\u2019installation PWA
143
+ openfox pwa install Installer OpenFox comme PWA de bureau
144
+ openfox pwa uninstall Supprimer la PWA OpenFox de votre syst\xE8me
145
+ openfox pwa launch Lancer la PWA OpenFox
146
+ openfox pwa update R\xE9enregistrer la PWA (apr\xE8s une mise \xE0 jour d\u2019OpenFox)
147
+ openfox pwa status V\xE9rifier si la PWA est install\xE9e
148
+
149
+ Pr\xE9requis :
150
+ Installez d\u2019abord PWAsForFirefox : https://pwasforfirefox.filips.si/installation/
151
+ `
152
+ })
153
+ );
154
+ }
155
+ async function runPwaCommand(mode, subcommand) {
156
+ switch (subcommand) {
157
+ case "install":
158
+ case void 0:
159
+ await pwaInstall(mode);
160
+ break;
161
+ case "uninstall":
162
+ await pwaUninstall(mode);
163
+ break;
164
+ case "launch":
165
+ await pwaLaunch(mode);
166
+ break;
167
+ case "update":
168
+ await pwaUpdate(mode);
169
+ break;
170
+ case "status":
171
+ await pwaStatus(mode);
172
+ break;
173
+ default:
174
+ printPwaHelp();
175
+ }
176
+ }
177
+ async function pwaInstall(mode) {
178
+ const manifestUrl = getManifestUrl(mode);
179
+ if (!isFirefoxPwaAvailable()) {
180
+ const hint = getFirefoxPwaInstallHint();
181
+ log.error(
182
+ cliT({
183
+ en: "firefoxpwa is not installed or not on your PATH.",
184
+ fr: "firefoxpwa n\u2019est pas install\xE9 ou absent de votre PATH."
185
+ })
186
+ );
187
+ console.log(
188
+ cliT({
189
+ en: `
190
+ Install it first:
191
+
192
+ ${hint}
193
+
194
+ See: https://pwasforfirefox.filips.si/installation/`,
195
+ fr: `
196
+ Installez-le d\u2019abord :
197
+
198
+ ${hint}
199
+
200
+ Voir : https://pwasforfirefox.filips.si/installation/`
201
+ })
202
+ );
203
+ process.exit(1);
204
+ }
205
+ if (!isRuntimeInstalled()) {
206
+ const install = await confirm({
207
+ message: cliT({
208
+ en: "Firefox PWA runtime is not installed. Install it now?",
209
+ fr: "Le runtime Firefox PWA n\u2019est pas install\xE9. L\u2019installer maintenant ?"
210
+ }),
211
+ initialValue: true
212
+ });
213
+ if (isCancel(install)) {
214
+ cancel();
215
+ process.exit(0);
216
+ }
217
+ if (install) {
218
+ log.info(cliT({ en: "Running: firefoxpwa runtime install", fr: "Ex\xE9cution : firefoxpwa runtime install" }));
219
+ try {
220
+ spawn("firefoxpwa", ["runtime", "install"], { stdio: "inherit", windowsHide: true });
221
+ } catch {
222
+ log.error(cliT({ en: "Failed to install runtime.", fr: "\xC9chec de l\u2019installation du runtime." }));
223
+ process.exit(1);
224
+ }
225
+ } else {
226
+ log.info(
227
+ cliT({
228
+ en: "Skipping runtime install. The PWA cannot be used until the runtime is installed.",
229
+ fr: "Installation du runtime ignor\xE9e. La PWA ne pourra pas \xEAtre utilis\xE9e tant que le runtime n\u2019est pas install\xE9."
230
+ })
231
+ );
232
+ process.exit(0);
233
+ }
234
+ }
235
+ const port = mode === "development" ? 10469 : 10369;
236
+ if (!await isServerReachable(port)) {
237
+ log.error(
238
+ cliT({
239
+ en: `OpenFox server is not reachable on port ${port}.`,
240
+ fr: `Le serveur OpenFox est injoignable sur le port ${port}.`
241
+ })
242
+ );
243
+ console.log(
244
+ cliT({ en: `
245
+ Start OpenFox first:
246
+
247
+ openfox
248
+ `, fr: `
249
+ D\xE9marrez d\u2019abord OpenFox :
250
+
251
+ openfox
252
+ ` })
253
+ );
254
+ process.exit(1);
255
+ }
256
+ const existing = await loadPwaConfig(mode);
257
+ if (existing) {
258
+ const installed = probeInstalledApp(manifestUrl);
259
+ if (installed) {
260
+ log.info(cliT({ en: "OpenFox PWA is already installed.", fr: "La PWA OpenFox est d\xE9j\xE0 install\xE9e." }));
261
+ console.log(cliT({ en: ` App ID: ${installed.appId}`, fr: ` ID de l\u2019app : ${installed.appId}` }));
262
+ console.log(cliT({ en: ` Profile: ${installed.profileId}`, fr: ` Profil : ${installed.profileId}` }));
263
+ console.log(cliT({ en: ` URL: ${manifestUrl}`, fr: ` URL : ${manifestUrl}` }));
264
+ console.log(
265
+ cliT({
266
+ en: `
267
+ Use "openfox pwa launch" to start it, or "openfox pwa uninstall" to remove it.`,
268
+ fr: `
269
+ Utilisez \xAB openfox pwa launch \xBB pour la lancer, ou \xAB openfox pwa uninstall \xBB pour la supprimer.`
270
+ })
271
+ );
272
+ return;
273
+ }
274
+ }
275
+ if (existing) {
276
+ await removePwaConfig(mode);
277
+ }
278
+ log.info(cliT({ en: "Installing OpenFox PWA...", fr: "Installation de la PWA OpenFox..." }));
279
+ let appId = "";
280
+ let profileId = "00000000000000000000000000";
281
+ try {
282
+ execSync(`firefoxpwa site install ${manifestUrl}`, { encoding: "utf-8", windowsHide: true });
283
+ const detected = probeInstalledApp(manifestUrl);
284
+ if (detected) {
285
+ appId = detected.appId;
286
+ profileId = detected.profileId;
287
+ }
288
+ } catch {
289
+ log.error(
290
+ cliT({
291
+ en: "Failed to install PWA. Ensure OpenFox is running and try again.",
292
+ fr: "\xC9chec de l\u2019installation de la PWA. Assurez-vous qu\u2019OpenFox tourne et r\xE9essayez."
293
+ })
294
+ );
295
+ process.exit(1);
296
+ }
297
+ if (!appId) {
298
+ log.error(
299
+ cliT({
300
+ en: "Could not detect installed app ID. The PWA may still be installed.",
301
+ fr: "Impossible de d\xE9tecter l\u2019ID de l\u2019application install\xE9e. La PWA est peut-\xEAtre quand m\xEAme install\xE9e."
302
+ })
303
+ );
304
+ console.log(cliT({ en: "Check with: firefoxpwa profile list", fr: "V\xE9rifiez avec : firefoxpwa profile list" }));
305
+ process.exit(1);
306
+ }
307
+ const pwaConfig = { appId, profileId, manifestUrl, installedAt: (/* @__PURE__ */ new Date()).toISOString() };
308
+ await savePwaConfig(mode, pwaConfig);
309
+ log.info(cliT({ en: "OpenFox PWA installed successfully!", fr: "PWA OpenFox install\xE9e avec succ\xE8s !" }));
310
+ console.log(cliT({ en: `
311
+ App ID: ${appId}`, fr: `
312
+ ID de l\u2019app : ${appId}` }));
313
+ console.log(cliT({ en: ` Profile: ${profileId}`, fr: ` Profil : ${profileId}` }));
314
+ console.log(cliT({ en: `
315
+ Launch it with: openfox pwa launch`, fr: `
316
+ Lancez-la avec : openfox pwa launch` }));
317
+ }
318
+ async function pwaUninstall(mode) {
319
+ if (!isFirefoxPwaAvailable()) {
320
+ log.error(
321
+ cliT({
322
+ en: "firefoxpwa is not installed or not on your PATH.",
323
+ fr: "firefoxpwa n\u2019est pas install\xE9 ou absent de votre PATH."
324
+ })
325
+ );
326
+ process.exit(1);
327
+ }
328
+ const manifestUrl = getManifestUrl(mode);
329
+ const existing = await loadPwaConfig(mode);
330
+ let appId = existing?.appId ?? "";
331
+ if (!appId) {
332
+ const detected = probeInstalledApp(manifestUrl);
333
+ if (detected) appId = detected.appId;
334
+ }
335
+ if (!appId) {
336
+ log.info(cliT({ en: "OpenFox PWA is not installed.", fr: "La PWA OpenFox n\u2019est pas install\xE9e." }));
337
+ return;
338
+ }
339
+ log.info(cliT({ en: "Removing OpenFox PWA...", fr: "Suppression de la PWA OpenFox..." }));
340
+ try {
341
+ execSync(`firefoxpwa site uninstall ${appId} --quiet`, { encoding: "utf-8", windowsHide: true });
342
+ } catch {
343
+ log.error(
344
+ cliT({
345
+ en: `Failed to uninstall PWA (ID: ${appId}).`,
346
+ fr: `\xC9chec de la d\xE9sinstallation de la PWA (ID : ${appId}).`
347
+ })
348
+ );
349
+ process.exit(1);
350
+ }
351
+ await removePwaConfig(mode);
352
+ log.info(cliT({ en: "OpenFox PWA removed from your system.", fr: "PWA OpenFox supprim\xE9e de votre syst\xE8me." }));
353
+ console.log(
354
+ cliT({
355
+ en: "\nNote: The Firefox PWA runtime is still installed.",
356
+ fr: "\nRemarque : le runtime Firefox PWA est toujours install\xE9."
357
+ })
358
+ );
359
+ console.log(
360
+ cliT({ en: "To remove it: firefoxpwa runtime uninstall", fr: "Pour le supprimer : firefoxpwa runtime uninstall" })
361
+ );
362
+ }
363
+ async function pwaLaunch(mode) {
364
+ if (!isFirefoxPwaAvailable()) {
365
+ log.error(
366
+ cliT({
367
+ en: "firefoxpwa is not installed or not on your PATH.",
368
+ fr: "firefoxpwa n\u2019est pas install\xE9 ou absent de votre PATH."
369
+ })
370
+ );
371
+ process.exit(1);
372
+ }
373
+ const manifestUrl = getManifestUrl(mode);
374
+ const existing = await loadPwaConfig(mode);
375
+ let appId = existing?.appId ?? "";
376
+ if (!appId) {
377
+ const detected = probeInstalledApp(manifestUrl);
378
+ if (detected) appId = detected.appId;
379
+ }
380
+ if (!appId) {
381
+ log.info(cliT({ en: "OpenFox PWA is not installed.", fr: "La PWA OpenFox n\u2019est pas install\xE9e." }));
382
+ console.log(
383
+ cliT({ en: "\nInstall it first: openfox pwa install", fr: "\nInstallez-la d\u2019abord : openfox pwa install" })
384
+ );
385
+ return;
386
+ }
387
+ log.info(cliT({ en: "Launching OpenFox PWA...", fr: "Lancement de la PWA OpenFox..." }));
388
+ spawn("firefoxpwa", ["site", "launch", appId], { stdio: "inherit", windowsHide: true });
389
+ }
390
+ async function pwaUpdate(mode) {
391
+ if (!isFirefoxPwaAvailable()) {
392
+ log.error(
393
+ cliT({
394
+ en: "firefoxpwa is not installed or not on your PATH.",
395
+ fr: "firefoxpwa n\u2019est pas install\xE9 ou absent de votre PATH."
396
+ })
397
+ );
398
+ process.exit(1);
399
+ }
400
+ const manifestUrl = getManifestUrl(mode);
401
+ const existing = await loadPwaConfig(mode);
402
+ let appId = existing?.appId ?? "";
403
+ if (!appId) {
404
+ const detected = probeInstalledApp(manifestUrl);
405
+ if (detected) appId = detected.appId;
406
+ }
407
+ if (!appId) {
408
+ log.info(cliT({ en: "OpenFox PWA is not installed.", fr: "La PWA OpenFox n\u2019est pas install\xE9e." }));
409
+ console.log(
410
+ cliT({ en: "\nInstall it first: openfox pwa install", fr: "\nInstallez-la d\u2019abord : openfox pwa install" })
411
+ );
412
+ return;
413
+ }
414
+ try {
415
+ execSync(`firefoxpwa site update ${appId}`, { encoding: "utf-8", windowsHide: true });
416
+ } catch {
417
+ log.error(cliT({ en: "Failed to update PWA metadata.", fr: "\xC9chec de la mise \xE0 jour des m\xE9tadonn\xE9es PWA." }));
418
+ process.exit(1);
419
+ }
420
+ log.info(cliT({ en: "OpenFox PWA metadata updated.", fr: "M\xE9tadonn\xE9es PWA OpenFox mises \xE0 jour." }));
421
+ console.log(
422
+ cliT({
423
+ en: `
424
+ The manifest is re-fetched automatically on each launch.`,
425
+ fr: `
426
+ Le manifeste est re-t\xE9l\xE9charg\xE9 automatiquement \xE0 chaque lancement.`
427
+ })
428
+ );
429
+ console.log(
430
+ cliT({
431
+ en: `Launch to pick up OpenFox changes:
432
+
433
+ openfox pwa launch`,
434
+ fr: `Lancez la PWA pour appliquer les changements d\u2019OpenFox :
435
+
436
+ openfox pwa launch`
437
+ })
438
+ );
439
+ }
440
+ async function pwaStatus(mode) {
441
+ if (!isFirefoxPwaAvailable()) {
442
+ log.error(
443
+ cliT({
444
+ en: "firefoxpwa is not installed or not on your PATH.",
445
+ fr: "firefoxpwa n\u2019est pas install\xE9 ou absent de votre PATH."
446
+ })
447
+ );
448
+ console.log(
449
+ cliT({
450
+ en: "\nInstall PWAsForFirefox: https://pwasforfirefox.filips.si/installation/",
451
+ fr: "\nInstallez PWAsForFirefox : https://pwasforfirefox.filips.si/installation/"
452
+ })
453
+ );
454
+ return;
455
+ }
456
+ if (!isRuntimeInstalled()) {
457
+ log.warn(cliT({ en: "Firefox PWA runtime is not installed.", fr: "Le runtime Firefox PWA n\u2019est pas install\xE9." }));
458
+ console.log(cliT({ en: `
459
+ Run: firefoxpwa runtime install`, fr: `
460
+ Ex\xE9cutez : firefoxpwa runtime install` }));
461
+ return;
462
+ }
463
+ const manifestUrl = getManifestUrl(mode);
464
+ const existing = await loadPwaConfig(mode);
465
+ let appId = existing?.appId ?? "";
466
+ if (!appId) {
467
+ const detected = probeInstalledApp(manifestUrl);
468
+ if (detected) appId = detected.appId;
469
+ }
470
+ if (!appId) {
471
+ log.info(cliT({ en: "OpenFox PWA is not installed.", fr: "La PWA OpenFox n\u2019est pas install\xE9e." }));
472
+ console.log(cliT({ en: "\nInstall it: openfox pwa install", fr: "\nInstallez-la : openfox pwa install" }));
473
+ return;
474
+ }
475
+ log.info(cliT({ en: "OpenFox PWA is installed.", fr: "La PWA OpenFox est install\xE9e." }));
476
+ console.log(cliT({ en: `
477
+ App ID: ${appId}`, fr: `
478
+ ID de l\u2019app : ${appId}` }));
479
+ console.log(
480
+ cliT({
481
+ en: ` Profile ID: ${existing?.profileId ?? "default"}`,
482
+ fr: ` ID du profil : ${existing?.profileId ?? "default"}`
483
+ })
484
+ );
485
+ console.log(cliT({ en: ` Manifest: ${manifestUrl}`, fr: ` Manifeste : ${manifestUrl}` }));
486
+ console.log(
487
+ cliT({
488
+ en: ` Installed: ${existing?.installedAt ? new Date(existing.installedAt).toLocaleString() : "unknown"}`,
489
+ fr: ` Install\xE9e le : ${existing?.installedAt ? new Date(existing.installedAt).toLocaleString() : "inconnu"}`
490
+ })
491
+ );
492
+ }
493
+ export {
494
+ getManifestUrl,
495
+ isServerReachable,
496
+ loadPwaConfig,
497
+ printPwaHelp,
498
+ removePwaConfig,
499
+ runPwaCommand,
500
+ savePwaConfig
501
+ };
502
+ //# sourceMappingURL=pwa-V5PFB4OQ.js.map
@@ -17,10 +17,10 @@ import {
17
17
  resolveDefaultAgentId,
18
18
  saveAgent,
19
19
  saveAgentToProject
20
- } from "./chunk-ELYHHEYL.js";
20
+ } from "./chunk-ORCQ3EXQ.js";
21
21
  import "./chunk-OSXPQSLW.js";
22
22
  import "./chunk-DPFET73G.js";
23
- import "./chunk-LQKXJPKP.js";
23
+ import "./chunk-CTWZPN7G.js";
24
24
  import "./chunk-JU757HVI.js";
25
25
  import "./chunk-K44MW7JJ.js";
26
26
  import "./chunk-CQGTEGKL.js";
@@ -45,4 +45,4 @@ export {
45
45
  saveAgent,
46
46
  saveAgentToProject
47
47
  };
48
- //# sourceMappingURL=registry-CMSSZHDC.js.map
48
+ //# sourceMappingURL=registry-BEIR7Y5G.js.map
@@ -1,63 +1,66 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-OUQZZEIQ.js";
3
+ } from "./chunk-BIZFY3QP.js";
4
4
  import "./chunk-T3S5MTMD.js";
5
5
  import "./chunk-WLJJRX22.js";
6
6
  import "./chunk-DQTN4B33.js";
7
7
  import "./chunk-IJ53Y77N.js";
8
- import "./chunk-A7CB4USC.js";
9
- import "./chunk-RRUSYVQD.js";
10
- import "./chunk-P5MSY7ZI.js";
11
- import "./chunk-GFW2HWJ6.js";
12
- import "./chunk-HXHPKGJE.js";
8
+ import "./chunk-GP3CLMPQ.js";
9
+ import "./chunk-NFEZATSN.js";
10
+ import "./chunk-5H5NRWHA.js";
11
+ import "./chunk-4R5GV7RW.js";
12
+ import "./chunk-ESZQTFQP.js";
13
13
  import "./chunk-XE6UC5Z3.js";
14
14
  import "./chunk-J7GAZGZT.js";
15
- import "./chunk-FEIRWXLX.js";
16
- import "./chunk-TACWRDDC.js";
17
- import "./chunk-ZL4IAFF3.js";
15
+ import {
16
+ serverT
17
+ } from "./chunk-OZWHRBDY.js";
18
+ import "./chunk-S67WIWUG.js";
19
+ import "./chunk-UKIUQAQZ.js";
18
20
  import "./chunk-7ET46SNE.js";
19
21
  import "./chunk-LW6MMSTD.js";
20
- import "./chunk-MQMPIXON.js";
22
+ import "./chunk-5UMXFLET.js";
21
23
  import "./chunk-I72ACQ6R.js";
22
24
  import "./chunk-JE7LW7Y6.js";
23
25
  import "./chunk-OAN4BXEW.js";
24
- import "./chunk-VXG3AFFY.js";
25
- import "./chunk-BKMWZTNO.js";
26
- import "./chunk-7JVBDBXE.js";
26
+ import "./chunk-VHLD6PCZ.js";
27
+ import "./chunk-DWA4IE65.js";
28
+ import "./chunk-7QMWYNVF.js";
27
29
  import "./chunk-JURM3RPZ.js";
28
- import "./chunk-Y6ZGHOKM.js";
29
- import "./chunk-FGNJMKDV.js";
30
- import "./chunk-M5T4RDPJ.js";
31
- import "./chunk-KWAHD2JA.js";
30
+ import "./chunk-I5ODJKYM.js";
31
+ import "./chunk-QZOV4OVN.js";
32
+ import "./chunk-MEEUXRFL.js";
33
+ import "./chunk-F2MOHHXB.js";
32
34
  import {
33
35
  loadConfig
34
- } from "./chunk-ELYHHEYL.js";
36
+ } from "./chunk-ORCQ3EXQ.js";
35
37
  import "./chunk-OSXPQSLW.js";
36
- import "./chunk-P57IBMK4.js";
38
+ import "./chunk-AATMPL7S.js";
37
39
  import "./chunk-LCLH6ZUL.js";
38
- import "./chunk-MGEYAYGU.js";
39
- import "./chunk-5JWJEZJ3.js";
40
+ import "./chunk-O3RCSKUH.js";
41
+ import "./chunk-5UQ4CKOA.js";
40
42
  import "./chunk-OA2FURC3.js";
41
43
  import "./chunk-J2GP3J3X.js";
42
44
  import "./chunk-YNMP647F.js";
43
45
  import {
44
46
  VERSION
45
- } from "./chunk-JKGHTBEV.js";
47
+ } from "./chunk-WY3PWHWY.js";
46
48
  import "./chunk-DPFET73G.js";
47
- import "./chunk-CLDCHOEA.js";
49
+ import "./chunk-ZMK4VX7V.js";
48
50
  import "./chunk-TS5WKTFB.js";
49
51
  import "./chunk-UV6IH6HK.js";
50
52
  import "./chunk-HNCM3D7Y.js";
51
53
  import "./chunk-EUOWCVU6.js";
52
- import "./chunk-6EZDW4JS.js";
53
- import "./chunk-LQKXJPKP.js";
54
+ import "./chunk-J3NMNYGM.js";
55
+ import "./chunk-CTWZPN7G.js";
54
56
  import "./chunk-JU757HVI.js";
55
57
  import "./chunk-2AI7VYPN.js";
56
58
  import {
57
59
  logger
58
60
  } from "./chunk-K44MW7JJ.js";
59
61
  import "./chunk-7OHXF5GW.js";
60
- import "./chunk-HCYSGLY2.js";
62
+ import "./chunk-HF3NDXB4.js";
63
+ import "./chunk-24YKXKCG.js";
61
64
  import {
62
65
  getActiveProvider,
63
66
  getDefaultModel,
@@ -136,25 +139,33 @@ function displayStartupBanner(config) {
136
139
  \u{1F98A} OpenFox v${VERSION}
137
140
  `);
138
141
  if (isLocalhost) {
139
- console.log(` \u{1F310} Server: http://localhost:${port}`);
140
- console.log(" \u{1F512} Access: Localhost only");
142
+ console.log(` \u{1F310} ${serverT({ en: `Server: http://localhost:${port}`, fr: `Serveur : http://localhost:${port}` })}`);
143
+ console.log(` \u{1F512} ${serverT({ en: "Access: Localhost only", fr: "Acc\xE8s : localhost uniquement" })}`);
141
144
  } else {
142
145
  const ips = getValidIPv4Addresses();
143
146
  if (ips.length === 0) {
144
- console.log(` \u{1F310} Server: http://0.0.0.0:${port}`);
145
- console.warn(" \u26A0\uFE0F Warning: No valid network interfaces detected");
147
+ console.log(` \u{1F310} ${serverT({ en: `Server: http://0.0.0.0:${port}`, fr: `Serveur : http://0.0.0.0:${port}` })}`);
148
+ console.warn(
149
+ ` \u26A0\uFE0F ${serverT({ en: "Warning: No valid network interfaces detected", fr: "Avertissement : aucune interface r\xE9seau valide d\xE9tect\xE9e" })}`
150
+ );
146
151
  } else {
147
- console.log(" \u{1F310} Server:");
152
+ console.log(` \u{1F310} ${serverT({ en: "Server:", fr: "Serveur :" })}`);
148
153
  for (const ip of ips) {
149
154
  console.log(` \u2022 http://${ip}:${port}`);
150
155
  }
151
- console.log(" \u{1F30D} Access: Local network");
156
+ console.log(` \u{1F30D} ${serverT({ en: "Access: Local network", fr: "Acc\xE8s : r\xE9seau local" })}`);
152
157
  }
153
158
  }
154
159
  const size = getDatabaseSize(databasePath);
155
- console.log(` \u{1F4BE} Database: ${databasePath} (${size})`);
156
- console.log(` \u2699\uFE0F Config: ${configPath}`);
157
- console.log("\n\u{1F4A1} Tip: Press Ctrl+C to stop the server\n");
160
+ console.log(
161
+ ` \u{1F4BE} ${serverT({ en: `Database: ${databasePath} (${size})`, fr: `Base de donn\xE9es : ${databasePath} (${size})` })}`
162
+ );
163
+ console.log(` \u2699\uFE0F ${serverT({ en: `Config: ${configPath}`, fr: `Config : ${configPath}` })}`);
164
+ console.log(
165
+ `
166
+ \u{1F4A1} ${serverT({ en: "Tip: Press Ctrl+C to stop the server", fr: "Astuce : appuyez sur Ctrl+C pour arr\xEAter le serveur" })}
167
+ `
168
+ );
158
169
  }
159
170
 
160
171
  // src/cli/serve.ts
@@ -229,4 +240,4 @@ async function runServe(options) {
229
240
  export {
230
241
  runServe
231
242
  };
232
- //# sourceMappingURL=serve-XRVT3D7Z.js.map
243
+ //# sourceMappingURL=serve-CW5C3CBZ.js.map
@@ -1,7 +1,7 @@
1
- import { i as Diagnostic, x as Provider, M as ModelConfig, z as Session, J as SessionSummary, t as Project, G as SessionMode, H as SessionPhase, a0 as UserStepChoice, a2 as WorkflowExecution, a as Message, e as Criterion, g as CriterionStatus, r as MetadataEntry, A as Attachment, c as ContextState, D as DangerLevel$1, N as StatsIdentity, $ as ToolResult, b as Config } from '../types-BIkpxjaj.js';
1
+ import { D as Diagnostic, N as Provider, M as ModelConfig, j as Session, i as SessionSummary, P as Project, S as SessionMode, h as SessionPhase, a1 as UserStepChoice, W as WorkflowExecution, c as Message, f as Criterion, t as CriterionStatus, g as MetadataEntry, A as Attachment, C as ContextState, v as DangerLevel$1, V as StatsIdentity, b as ToolResult, q as Config } from '../types-G10ho8PT.js';
2
2
  import { Server } from 'node:http';
3
- import { e as LLMClient, d as LLMToolDefinition } from '../types-CoY8Ka1C.js';
4
- import { a8 as QueuedMessage, a9 as ServerMessage } from '../protocol-BMUoqwYH.js';
3
+ import { e as LLMClient, d as LLMToolDefinition } from '../types-BlQjLBui.js';
4
+ import { a8 as QueuedMessage, a9 as ServerMessage } from '../protocol-Nr_H1_oC.js';
5
5
 
6
6
  /**
7
7
  * Model-specific configuration profiles.
@@ -427,6 +427,21 @@ declare class SessionManager {
427
427
  * @throws Error if the original session or message is not found
428
428
  */
429
429
  forkSession(originalSessionId: string, messageId: string, title?: string): Session;
430
+ /**
431
+ * Import a session from an export document into a target project.
432
+ *
433
+ * The cached layout (system prompt, tools, hash) is restored verbatim so the
434
+ * provider-side prefix cache stays valid, and the event history is replayed
435
+ * as-is. Drift between the original environment's cached layout and the
436
+ * target environment (system prompt, tools) is announced via injected
437
+ * <system-reminder> messages, followed by an import marker reminder.
438
+ *
439
+ * @param projectId - Target project (the session is created there)
440
+ * @param rawPayload - Exported session document (validated)
441
+ * @returns The imported session
442
+ * @throws Error for invalid payloads or unknown project
443
+ */
444
+ importSession(projectId: string, rawPayload: unknown): Promise<Session>;
430
445
  /**
431
446
  * Get a session by ID. Returns null if not found.
432
447
  * Session state is derived from EventStore.