@dimina-kit/devtools 0.4.0-dev.20260731100034 → 0.4.0-dev.20260801163345
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/index.bundle.js +8 -1
- package/dist/main/services/mcp/target-manager.js +5 -1
- package/dist/native-host/common/common.js +154 -58
- package/dist/native-host/container/pageFrame.css +1 -1
- package/dist/native-host/render/render.js +6613 -3313
- package/dist/native-host/service/service.js +2 -2
- package/dist/preload/runtime/native-host.d.ts +2 -0
- package/dist/preload/runtime/native-host.js +2 -1
- package/dist/preload/runtime/node-bindings.d.ts +18 -0
- package/dist/preload/runtime/node-bindings.js +44 -0
- package/dist/preload/windows/main.cjs +1165 -883
- package/dist/preload/windows/main.cjs.map +4 -4
- package/dist/preload/windows/simulator.cjs +68 -6
- package/dist/preload/windows/simulator.cjs.map +4 -4
- package/dist/preload/windows/simulator.js +68 -6
- package/dist/render-host/pageFrame.html +3 -3
- package/dist/shared/node-bindings.d.ts +2 -0
- package/dist/shared/node-bindings.js +2 -0
- package/dist/simulator/assets/device-shell-Cw7c-IkG.js +2 -0
- package/dist/simulator/assets/{jsx-runtime-hBv-rHqQ.js → jsx-runtime-DkKmJyBb.js} +2 -2
- package/dist/simulator/assets/simulator-COIE6R49.js +10 -0
- package/dist/simulator/assets/simulator-mini-app-BLn7XV8e.js +2 -0
- package/dist/simulator/simulator.html +2 -2
- package/package.json +6 -6
- package/dist/simulator/assets/device-shell-B03OuytR.js +0 -2
- package/dist/simulator/assets/simulator-DpdXUf--.js +0 -10
- package/dist/simulator/assets/simulator-mini-app-w1Bhwkld.js +0 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Publishes real Node built-ins into the simulator document's shared JS
|
|
3
|
+
* world (see shared/node-bindings for the consumer-side contract).
|
|
4
|
+
*
|
|
5
|
+
* The simulator WebContentsView runs nodeIntegration:false + sandbox:false +
|
|
6
|
+
* contextIsolation:false: page scripts cannot require Node modules and the
|
|
7
|
+
* vite bundle stubs `node:*` imports, but this preload shares the page's JS
|
|
8
|
+
* world and has full Node access. The FileSystemManager backends and the
|
|
9
|
+
* vpath resolver in the simulator bundle read these bindings.
|
|
10
|
+
*
|
|
11
|
+
* Trust boundary: this preload is assigned ONLY to the simulator top document
|
|
12
|
+
* (devtools' own code) via webPreferences.preload — miniapp render guests and
|
|
13
|
+
* the service host carry their own dedicated preloads, and no preload is
|
|
14
|
+
* session-registered (`setPreloads` is unused repo-wide), so mini-program
|
|
15
|
+
* code never sees these bindings.
|
|
16
|
+
*/
|
|
17
|
+
export declare function installNodeBindings(): void;
|
|
18
|
+
//# sourceMappingURL=node-bindings.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Publishes real Node built-ins into the simulator document's shared JS
|
|
3
|
+
* world (see shared/node-bindings for the consumer-side contract).
|
|
4
|
+
*
|
|
5
|
+
* The simulator WebContentsView runs nodeIntegration:false + sandbox:false +
|
|
6
|
+
* contextIsolation:false: page scripts cannot require Node modules and the
|
|
7
|
+
* vite bundle stubs `node:*` imports, but this preload shares the page's JS
|
|
8
|
+
* world and has full Node access. The FileSystemManager backends and the
|
|
9
|
+
* vpath resolver in the simulator bundle read these bindings.
|
|
10
|
+
*
|
|
11
|
+
* Trust boundary: this preload is assigned ONLY to the simulator top document
|
|
12
|
+
* (devtools' own code) via webPreferences.preload — miniapp render guests and
|
|
13
|
+
* the service host carry their own dedicated preloads, and no preload is
|
|
14
|
+
* session-registered (`setPreloads` is unused repo-wide), so mini-program
|
|
15
|
+
* code never sees these bindings.
|
|
16
|
+
*/
|
|
17
|
+
import fs from 'node:fs';
|
|
18
|
+
import os from 'node:os';
|
|
19
|
+
import path from 'node:path';
|
|
20
|
+
import crypto from 'node:crypto';
|
|
21
|
+
import buffer from 'node:buffer';
|
|
22
|
+
import { NODE_BINDINGS_GLOBAL } from '../../shared/node-bindings.js';
|
|
23
|
+
export function installNodeBindings() {
|
|
24
|
+
// contextIsolation:false means page scripts share this world: freeze the
|
|
25
|
+
// bag (no member swap) and publish it non-writable AND non-configurable —
|
|
26
|
+
// writable:false alone still leaves `delete` and a defineProperty
|
|
27
|
+
// redefinition open to any same-world script, so the full lock needs
|
|
28
|
+
// configurable:false too. A compromised page script then cannot
|
|
29
|
+
// substitute a spoofed `fs` for the vpath resolver / FSM backends to
|
|
30
|
+
// trust by any route.
|
|
31
|
+
const existing = Object.getOwnPropertyDescriptor(globalThis, NODE_BINDINGS_GLOBAL);
|
|
32
|
+
if (existing && !existing.configurable) {
|
|
33
|
+
// Already locked (redefining a non-configurable property throws).
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const bindings = Object.freeze({ fs, os, path, crypto, buffer });
|
|
37
|
+
Object.defineProperty(globalThis, NODE_BINDINGS_GLOBAL, {
|
|
38
|
+
value: bindings,
|
|
39
|
+
writable: false,
|
|
40
|
+
configurable: false,
|
|
41
|
+
enumerable: true,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=node-bindings.js.map
|