@dimina-kit/devtools 0.3.2-dev.20260524104239 → 0.3.2-dev.20260525152421
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/dist/main/app/app.js +13 -2
- package/dist/main/app/bootstrap.d.ts +9 -0
- package/dist/main/app/bootstrap.js +28 -1
- package/dist/main/index.bundle.js +570 -20
- package/dist/main/services/simulator-temp-files/disk.d.ts +55 -0
- package/dist/main/services/simulator-temp-files/disk.js +215 -0
- package/dist/main/services/simulator-temp-files/fs-channels.d.ts +69 -0
- package/dist/main/services/simulator-temp-files/fs-channels.js +108 -0
- package/dist/main/services/simulator-temp-files/index.d.ts +33 -0
- package/dist/main/services/simulator-temp-files/index.js +160 -0
- package/dist/main/services/simulator-temp-files/request-handler.d.ts +30 -0
- package/dist/main/services/simulator-temp-files/request-handler.js +178 -0
- package/dist/main/services/simulator-temp-files/resolver.d.ts +22 -0
- package/dist/main/services/simulator-temp-files/resolver.js +22 -0
- package/dist/main/services/simulator-temp-files/store.d.ts +14 -0
- package/dist/main/services/simulator-temp-files/store.js +24 -0
- package/dist/preload/runtime/temp-files.d.ts +8 -0
- package/dist/preload/runtime/temp-files.js +34 -0
- package/dist/preload/windows/simulator.js +38 -6
- package/dist/simulator/assets/simulator-CVOFTpSj.js +9 -0
- package/dist/simulator/simulator.html +1 -1
- package/package.json +4 -4
- package/dist/simulator/assets/simulator-DDRBJ6Wa.js +0 -9
package/dist/main/app/app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { setupCdpPort } from './bootstrap.js';
|
|
2
|
-
import { app, BrowserWindow, nativeImage } from 'electron';
|
|
1
|
+
import { setupCdpPort, registerDifileScheme } from './bootstrap.js';
|
|
2
|
+
import { app, BrowserWindow, nativeImage, session } from 'electron';
|
|
3
3
|
import fs from 'fs';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { rendererDir as defaultRendererDir, defaultPreloadPath } from '../utils/paths.js';
|
|
@@ -13,6 +13,7 @@ import { registerAppIpc, popoverModule, projectsModule, sessionModule, settingsM
|
|
|
13
13
|
import { startAutomationServer } from '../services/automation/index.js';
|
|
14
14
|
import { startMcpServer } from '../services/mcp/index.js';
|
|
15
15
|
import { setupSimulatorStorage } from '../services/simulator-storage/index.js';
|
|
16
|
+
import { setupSimulatorTempFiles } from '../services/simulator-temp-files/index.js';
|
|
16
17
|
import { UpdateManager } from '../services/update/index.js';
|
|
17
18
|
import { toDisposable } from '../utils/disposable.js';
|
|
18
19
|
import { IpcRegistry } from '../utils/ipc-registry.js';
|
|
@@ -259,6 +260,9 @@ export function createWorkbenchApp(config = {}) {
|
|
|
259
260
|
let setupPromise = null;
|
|
260
261
|
let appEventsRegistered = false;
|
|
261
262
|
setupCdpPort();
|
|
263
|
+
// Privileged scheme registration must run before `app.whenReady` —
|
|
264
|
+
// registering it later throws.
|
|
265
|
+
registerDifileScheme();
|
|
262
266
|
async function setup() {
|
|
263
267
|
if (setupPromise)
|
|
264
268
|
return setupPromise;
|
|
@@ -273,6 +277,13 @@ export function createWorkbenchApp(config = {}) {
|
|
|
273
277
|
// creation-time color (see installThemeBackgroundSync).
|
|
274
278
|
context.registry.add(installThemeBackgroundSync());
|
|
275
279
|
registerBuiltinModules(config, context);
|
|
280
|
+
// Wire the simulator-side difile:// protocol handler + temp-file IPC
|
|
281
|
+
// before host onSetup so any host-driven simulator boot sees the
|
|
282
|
+
// protocol live. The module installs its own narrow sender-policy
|
|
283
|
+
// (simulator-session-only) — see file header — because the default
|
|
284
|
+
// workbench policy intentionally rejects the simulator <webview>.
|
|
285
|
+
const simSession = session.fromPartition('persist:simulator');
|
|
286
|
+
context.registry.add(setupSimulatorTempFiles(simSession));
|
|
276
287
|
installMenu(config, mainWindow, context);
|
|
277
288
|
// Gated custom-IPC surface for the host. Bound to ctx.senderPolicy so
|
|
278
289
|
// host channels go through the same gateway as built-in IPC, and
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Register `difile://` as a privileged scheme so `simSession.protocol.handle`
|
|
3
|
+
* can serve `difile://devtools/{uuid}` URLs from the simulator webview without
|
|
4
|
+
* tripping CSP / fetch-API restrictions. Must be called before `app.whenReady`.
|
|
5
|
+
*
|
|
6
|
+
* Idempotent — subsequent calls are no-ops because Electron throws if the same
|
|
7
|
+
* scheme is registered twice.
|
|
8
|
+
*/
|
|
9
|
+
export declare function registerDifileScheme(): void;
|
|
1
10
|
/**
|
|
2
11
|
* Suppress EPIPE errors on stdout/stderr.
|
|
3
12
|
* Call at the very top of your entry file, before any imports that may write.
|
|
@@ -1,6 +1,33 @@
|
|
|
1
|
-
import { app } from 'electron';
|
|
1
|
+
import { app, protocol } from 'electron';
|
|
2
2
|
import { DEFAULT_CDP_PORT } from '../../shared/constants.js';
|
|
3
3
|
import { loadWorkbenchSettings } from '../services/settings/index.js';
|
|
4
|
+
let difileSchemeRegistered = false;
|
|
5
|
+
/**
|
|
6
|
+
* Register `difile://` as a privileged scheme so `simSession.protocol.handle`
|
|
7
|
+
* can serve `difile://devtools/{uuid}` URLs from the simulator webview without
|
|
8
|
+
* tripping CSP / fetch-API restrictions. Must be called before `app.whenReady`.
|
|
9
|
+
*
|
|
10
|
+
* Idempotent — subsequent calls are no-ops because Electron throws if the same
|
|
11
|
+
* scheme is registered twice.
|
|
12
|
+
*/
|
|
13
|
+
export function registerDifileScheme() {
|
|
14
|
+
if (difileSchemeRegistered)
|
|
15
|
+
return;
|
|
16
|
+
difileSchemeRegistered = true;
|
|
17
|
+
protocol.registerSchemesAsPrivileged([
|
|
18
|
+
{
|
|
19
|
+
scheme: 'difile',
|
|
20
|
+
privileges: {
|
|
21
|
+
standard: true,
|
|
22
|
+
secure: true,
|
|
23
|
+
supportFetchAPI: true,
|
|
24
|
+
stream: true,
|
|
25
|
+
bypassCSP: true,
|
|
26
|
+
corsEnabled: true,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
]);
|
|
30
|
+
}
|
|
4
31
|
/**
|
|
5
32
|
* Suppress EPIPE errors on stdout/stderr.
|
|
6
33
|
* Call at the very top of your entry file, before any imports that may write.
|