@dimina-kit/devtools 0.1.0-dev.20260422094158
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/LICENSE +21 -0
- package/README.md +562 -0
- package/dist/main/api.d.ts +21 -0
- package/dist/main/api.d.ts.map +1 -0
- package/dist/main/api.js +22 -0
- package/dist/main/api.js.map +1 -0
- package/dist/main/app/app.d.ts +15 -0
- package/dist/main/app/app.d.ts.map +1 -0
- package/dist/main/app/app.js +192 -0
- package/dist/main/app/app.js.map +1 -0
- package/dist/main/app/bootstrap.d.ts +14 -0
- package/dist/main/app/bootstrap.d.ts.map +1 -0
- package/dist/main/app/bootstrap.js +41 -0
- package/dist/main/app/bootstrap.js.map +1 -0
- package/dist/main/app/launch.d.ts +10 -0
- package/dist/main/app/launch.d.ts.map +1 -0
- package/dist/main/app/launch.js +28 -0
- package/dist/main/app/launch.js.map +1 -0
- package/dist/main/app/lifecycle.d.ts +2 -0
- package/dist/main/app/lifecycle.d.ts.map +1 -0
- package/dist/main/app/lifecycle.js +11 -0
- package/dist/main/app/lifecycle.js.map +1 -0
- package/dist/main/index.d.ts +2 -0
- package/dist/main/index.d.ts.map +1 -0
- package/dist/main/index.js +3 -0
- package/dist/main/index.js.map +1 -0
- package/dist/main/ipc/app.d.ts +3 -0
- package/dist/main/ipc/app.d.ts.map +1 -0
- package/dist/main/ipc/app.js +14 -0
- package/dist/main/ipc/app.js.map +1 -0
- package/dist/main/ipc/index.d.ts +9 -0
- package/dist/main/ipc/index.d.ts.map +1 -0
- package/dist/main/ipc/index.js +9 -0
- package/dist/main/ipc/index.js.map +1 -0
- package/dist/main/ipc/panels.d.ts +3 -0
- package/dist/main/ipc/panels.d.ts.map +1 -0
- package/dist/main/ipc/panels.js +39 -0
- package/dist/main/ipc/panels.js.map +1 -0
- package/dist/main/ipc/popover.d.ts +3 -0
- package/dist/main/ipc/popover.d.ts.map +1 -0
- package/dist/main/ipc/popover.js +13 -0
- package/dist/main/ipc/popover.js.map +1 -0
- package/dist/main/ipc/projects.d.ts +3 -0
- package/dist/main/ipc/projects.d.ts.map +1 -0
- package/dist/main/ipc/projects.js +15 -0
- package/dist/main/ipc/projects.js.map +1 -0
- package/dist/main/ipc/session.d.ts +3 -0
- package/dist/main/ipc/session.d.ts.map +1 -0
- package/dist/main/ipc/session.js +10 -0
- package/dist/main/ipc/session.js.map +1 -0
- package/dist/main/ipc/settings.d.ts +3 -0
- package/dist/main/ipc/settings.d.ts.map +1 -0
- package/dist/main/ipc/settings.js +61 -0
- package/dist/main/ipc/settings.js.map +1 -0
- package/dist/main/ipc/simulator.d.ts +3 -0
- package/dist/main/ipc/simulator.d.ts.map +1 -0
- package/dist/main/ipc/simulator.js +26 -0
- package/dist/main/ipc/simulator.js.map +1 -0
- package/dist/main/ipc/toolbar.d.ts +3 -0
- package/dist/main/ipc/toolbar.d.ts.map +1 -0
- package/dist/main/ipc/toolbar.js +10 -0
- package/dist/main/ipc/toolbar.js.map +1 -0
- package/dist/main/menu/index.d.ts +3 -0
- package/dist/main/menu/index.d.ts.map +1 -0
- package/dist/main/menu/index.js +65 -0
- package/dist/main/menu/index.js.map +1 -0
- package/dist/main/services/automation/exec.d.ts +9 -0
- package/dist/main/services/automation/exec.d.ts.map +1 -0
- package/dist/main/services/automation/exec.js +33 -0
- package/dist/main/services/automation/exec.js.map +1 -0
- package/dist/main/services/automation/handlers/app.d.ts +3 -0
- package/dist/main/services/automation/handlers/app.d.ts.map +1 -0
- package/dist/main/services/automation/handlers/app.js +132 -0
- package/dist/main/services/automation/handlers/app.js.map +1 -0
- package/dist/main/services/automation/handlers/element.d.ts +3 -0
- package/dist/main/services/automation/handlers/element.d.ts.map +1 -0
- package/dist/main/services/automation/handlers/element.js +151 -0
- package/dist/main/services/automation/handlers/element.js.map +1 -0
- package/dist/main/services/automation/handlers/page.d.ts +3 -0
- package/dist/main/services/automation/handlers/page.d.ts.map +1 -0
- package/dist/main/services/automation/handlers/page.js +66 -0
- package/dist/main/services/automation/handlers/page.js.map +1 -0
- package/dist/main/services/automation/handlers/tool.d.ts +3 -0
- package/dist/main/services/automation/handlers/tool.d.ts.map +1 -0
- package/dist/main/services/automation/handlers/tool.js +8 -0
- package/dist/main/services/automation/handlers/tool.js.map +1 -0
- package/dist/main/services/automation/index.d.ts +18 -0
- package/dist/main/services/automation/index.d.ts.map +1 -0
- package/dist/main/services/automation/index.js +95 -0
- package/dist/main/services/automation/index.js.map +1 -0
- package/dist/main/services/automation/registry.d.ts +6 -0
- package/dist/main/services/automation/registry.d.ts.map +1 -0
- package/dist/main/services/automation/registry.js +20 -0
- package/dist/main/services/automation/registry.js.map +1 -0
- package/dist/main/services/automation/shared.d.ts +24 -0
- package/dist/main/services/automation/shared.d.ts.map +1 -0
- package/dist/main/services/automation/shared.js +2 -0
- package/dist/main/services/automation/shared.js.map +1 -0
- package/dist/main/services/default-adapter.d.ts +3 -0
- package/dist/main/services/default-adapter.d.ts.map +1 -0
- package/dist/main/services/default-adapter.js +17 -0
- package/dist/main/services/default-adapter.js.map +1 -0
- package/dist/main/services/layout/index.d.ts +27 -0
- package/dist/main/services/layout/index.d.ts.map +1 -0
- package/dist/main/services/layout/index.js +49 -0
- package/dist/main/services/layout/index.js.map +1 -0
- package/dist/main/services/mcp/index.d.ts +15 -0
- package/dist/main/services/mcp/index.d.ts.map +1 -0
- package/dist/main/services/mcp/index.js +15 -0
- package/dist/main/services/mcp/index.js.map +1 -0
- package/dist/main/services/mcp/server.d.ts +10 -0
- package/dist/main/services/mcp/server.d.ts.map +1 -0
- package/dist/main/services/mcp/server.js +76 -0
- package/dist/main/services/mcp/server.js.map +1 -0
- package/dist/main/services/mcp/target-manager.d.ts +43 -0
- package/dist/main/services/mcp/target-manager.d.ts.map +1 -0
- package/dist/main/services/mcp/target-manager.js +165 -0
- package/dist/main/services/mcp/target-manager.js.map +1 -0
- package/dist/main/services/mcp/tool-registry.d.ts +14 -0
- package/dist/main/services/mcp/tool-registry.d.ts.map +1 -0
- package/dist/main/services/mcp/tool-registry.js +84 -0
- package/dist/main/services/mcp/tool-registry.js.map +1 -0
- package/dist/main/services/mcp/tools/context-tools.d.ts +15 -0
- package/dist/main/services/mcp/tools/context-tools.d.ts.map +1 -0
- package/dist/main/services/mcp/tools/context-tools.js +244 -0
- package/dist/main/services/mcp/tools/context-tools.js.map +1 -0
- package/dist/main/services/mcp/tools/simulator-tools.d.ts +14 -0
- package/dist/main/services/mcp/tools/simulator-tools.d.ts.map +1 -0
- package/dist/main/services/mcp/tools/simulator-tools.js +143 -0
- package/dist/main/services/mcp/tools/simulator-tools.js.map +1 -0
- package/dist/main/services/mcp/tools/workbench-tools.d.ts +7 -0
- package/dist/main/services/mcp/tools/workbench-tools.d.ts.map +1 -0
- package/dist/main/services/mcp/tools/workbench-tools.js +13 -0
- package/dist/main/services/mcp/tools/workbench-tools.js.map +1 -0
- package/dist/main/services/notifications/renderer-notifier.d.ts +80 -0
- package/dist/main/services/notifications/renderer-notifier.d.ts.map +1 -0
- package/dist/main/services/notifications/renderer-notifier.js +70 -0
- package/dist/main/services/notifications/renderer-notifier.js.map +1 -0
- package/dist/main/services/projects/index.d.ts +2 -0
- package/dist/main/services/projects/index.d.ts.map +1 -0
- package/dist/main/services/projects/index.js +6 -0
- package/dist/main/services/projects/index.js.map +1 -0
- package/dist/main/services/projects/project-repository.d.ts +28 -0
- package/dist/main/services/projects/project-repository.d.ts.map +1 -0
- package/dist/main/services/projects/project-repository.js +145 -0
- package/dist/main/services/projects/project-repository.js.map +1 -0
- package/dist/main/services/settings/index.d.ts +16 -0
- package/dist/main/services/settings/index.d.ts.map +1 -0
- package/dist/main/services/settings/index.js +46 -0
- package/dist/main/services/settings/index.js.map +1 -0
- package/dist/main/services/simulator/dir.d.ts +2 -0
- package/dist/main/services/simulator/dir.d.ts.map +1 -0
- package/dist/main/services/simulator/dir.js +5 -0
- package/dist/main/services/simulator/dir.js.map +1 -0
- package/dist/main/services/simulator/referer.d.ts +10 -0
- package/dist/main/services/simulator/referer.d.ts.map +1 -0
- package/dist/main/services/simulator/referer.js +20 -0
- package/dist/main/services/simulator/referer.js.map +1 -0
- package/dist/main/services/views/view-manager.d.ts +84 -0
- package/dist/main/services/views/view-manager.d.ts.map +1 -0
- package/dist/main/services/views/view-manager.js +254 -0
- package/dist/main/services/views/view-manager.js.map +1 -0
- package/dist/main/services/workbench-context.d.ts +59 -0
- package/dist/main/services/workbench-context.d.ts.map +1 -0
- package/dist/main/services/workbench-context.js +33 -0
- package/dist/main/services/workbench-context.js.map +1 -0
- package/dist/main/services/workspace/index.d.ts +2 -0
- package/dist/main/services/workspace/index.d.ts.map +1 -0
- package/dist/main/services/workspace/index.js +2 -0
- package/dist/main/services/workspace/index.js.map +1 -0
- package/dist/main/services/workspace/workspace-service.d.ts +49 -0
- package/dist/main/services/workspace/workspace-service.d.ts.map +1 -0
- package/dist/main/services/workspace/workspace-service.js +90 -0
- package/dist/main/services/workspace/workspace-service.js.map +1 -0
- package/dist/main/utils/logger.d.ts +15 -0
- package/dist/main/utils/logger.d.ts.map +1 -0
- package/dist/main/utils/logger.js +48 -0
- package/dist/main/utils/logger.js.map +1 -0
- package/dist/main/utils/paths.d.ts +6 -0
- package/dist/main/utils/paths.d.ts.map +1 -0
- package/dist/main/utils/paths.js +15 -0
- package/dist/main/utils/paths.js.map +1 -0
- package/dist/main/utils/theme.d.ts +10 -0
- package/dist/main/utils/theme.d.ts.map +1 -0
- package/dist/main/utils/theme.js +13 -0
- package/dist/main/utils/theme.js.map +1 -0
- package/dist/main/windows/main-window/create.d.ts +11 -0
- package/dist/main/windows/main-window/create.d.ts.map +1 -0
- package/dist/main/windows/main-window/create.js +67 -0
- package/dist/main/windows/main-window/create.js.map +1 -0
- package/dist/main/windows/main-window/events.d.ts +9 -0
- package/dist/main/windows/main-window/events.d.ts.map +1 -0
- package/dist/main/windows/main-window/events.js +18 -0
- package/dist/main/windows/main-window/events.js.map +1 -0
- package/dist/main/windows/main-window/index.d.ts +5 -0
- package/dist/main/windows/main-window/index.d.ts.map +1 -0
- package/dist/main/windows/main-window/index.js +3 -0
- package/dist/main/windows/main-window/index.js.map +1 -0
- package/dist/main/windows/settings-window/create.d.ts +3 -0
- package/dist/main/windows/settings-window/create.d.ts.map +1 -0
- package/dist/main/windows/settings-window/create.js +18 -0
- package/dist/main/windows/settings-window/create.js.map +1 -0
- package/dist/main/windows/settings-window/events.d.ts +3 -0
- package/dist/main/windows/settings-window/events.d.ts.map +1 -0
- package/dist/main/windows/settings-window/events.js +6 -0
- package/dist/main/windows/settings-window/events.js.map +1 -0
- package/dist/main/windows/settings-window/index.d.ts +3 -0
- package/dist/main/windows/settings-window/index.d.ts.map +1 -0
- package/dist/main/windows/settings-window/index.js +3 -0
- package/dist/main/windows/settings-window/index.js.map +1 -0
- package/dist/preload/instrumentation/app-data.d.ts +3 -0
- package/dist/preload/instrumentation/app-data.d.ts.map +1 -0
- package/dist/preload/instrumentation/app-data.js +103 -0
- package/dist/preload/instrumentation/app-data.js.map +1 -0
- package/dist/preload/instrumentation/console.d.ts +2 -0
- package/dist/preload/instrumentation/console.d.ts.map +1 -0
- package/dist/preload/instrumentation/console.js +54 -0
- package/dist/preload/instrumentation/console.js.map +1 -0
- package/dist/preload/instrumentation/disposable.d.ts +11 -0
- package/dist/preload/instrumentation/disposable.d.ts.map +1 -0
- package/dist/preload/instrumentation/disposable.js +15 -0
- package/dist/preload/instrumentation/disposable.js.map +1 -0
- package/dist/preload/instrumentation/index.d.ts +5 -0
- package/dist/preload/instrumentation/index.d.ts.map +1 -0
- package/dist/preload/instrumentation/index.js +5 -0
- package/dist/preload/instrumentation/index.js.map +1 -0
- package/dist/preload/instrumentation/storage.d.ts +2 -0
- package/dist/preload/instrumentation/storage.d.ts.map +1 -0
- package/dist/preload/instrumentation/storage.js +106 -0
- package/dist/preload/instrumentation/storage.js.map +1 -0
- package/dist/preload/instrumentation/wxml-extract.d.ts +11 -0
- package/dist/preload/instrumentation/wxml-extract.d.ts.map +1 -0
- package/dist/preload/instrumentation/wxml-extract.js +173 -0
- package/dist/preload/instrumentation/wxml-extract.js.map +1 -0
- package/dist/preload/instrumentation/wxml.d.ts +5 -0
- package/dist/preload/instrumentation/wxml.d.ts.map +1 -0
- package/dist/preload/instrumentation/wxml.js +223 -0
- package/dist/preload/instrumentation/wxml.js.map +1 -0
- package/dist/preload/runtime/bridge.d.ts +36 -0
- package/dist/preload/runtime/bridge.d.ts.map +1 -0
- package/dist/preload/runtime/bridge.js +151 -0
- package/dist/preload/runtime/bridge.js.map +1 -0
- package/dist/preload/runtime/host.d.ts +3 -0
- package/dist/preload/runtime/host.d.ts.map +1 -0
- package/dist/preload/runtime/host.js +28 -0
- package/dist/preload/runtime/host.js.map +1 -0
- package/dist/preload/shared/api-compat.d.ts +2 -0
- package/dist/preload/shared/api-compat.d.ts.map +1 -0
- package/dist/preload/shared/api-compat.js +196 -0
- package/dist/preload/shared/api-compat.js.map +1 -0
- package/dist/preload/shared/constants.d.ts +16 -0
- package/dist/preload/shared/constants.d.ts.map +1 -0
- package/dist/preload/shared/constants.js +16 -0
- package/dist/preload/shared/constants.js.map +1 -0
- package/dist/preload/shared/types.d.ts +34 -0
- package/dist/preload/shared/types.d.ts.map +1 -0
- package/dist/preload/shared/types.js +8 -0
- package/dist/preload/shared/types.js.map +1 -0
- package/dist/preload/windows/main.d.ts +7 -0
- package/dist/preload/windows/main.d.ts.map +1 -0
- package/dist/preload/windows/main.js +7 -0
- package/dist/preload/windows/main.js.map +1 -0
- package/dist/preload/windows/simulator.js +969 -0
- package/dist/preload/windows/simulator.js.map +7 -0
- package/dist/renderer/assets/index-kcmIQPCg.js +2 -0
- package/dist/renderer/assets/index-kcmIQPCg.js.map +1 -0
- package/dist/renderer/assets/input-B7sz4y1r.js +2 -0
- package/dist/renderer/assets/input-B7sz4y1r.js.map +1 -0
- package/dist/renderer/assets/ipc-transport-C9-PPTGn.css +1 -0
- package/dist/renderer/assets/ipc-transport-L_WD9x12.js +9 -0
- package/dist/renderer/assets/ipc-transport-L_WD9x12.js.map +1 -0
- package/dist/renderer/assets/popover-CzMIs2j4.js +2 -0
- package/dist/renderer/assets/popover-CzMIs2j4.js.map +1 -0
- package/dist/renderer/assets/select-BBXJVe8R.js +2 -0
- package/dist/renderer/assets/select-BBXJVe8R.js.map +1 -0
- package/dist/renderer/assets/settings-Db1pvrBJ.js +2 -0
- package/dist/renderer/assets/settings-Db1pvrBJ.js.map +1 -0
- package/dist/renderer/assets/settings-api-DJ1M-CNt.js +2 -0
- package/dist/renderer/assets/settings-api-DJ1M-CNt.js.map +1 -0
- package/dist/renderer/assets/workbenchSettings-BnQsvWkQ.js +8 -0
- package/dist/renderer/assets/workbenchSettings-BnQsvWkQ.js.map +1 -0
- package/dist/renderer/entries/main/index.html +15 -0
- package/dist/renderer/entries/popover/index.html +18 -0
- package/dist/renderer/entries/settings/index.html +15 -0
- package/dist/renderer/entries/workbench-settings/index.html +15 -0
- package/dist/shared/constants.d.ts +10 -0
- package/dist/shared/constants.d.ts.map +1 -0
- package/dist/shared/constants.js +10 -0
- package/dist/shared/constants.js.map +1 -0
- package/dist/shared/ipc-channels.d.ts +89 -0
- package/dist/shared/ipc-channels.d.ts.map +1 -0
- package/dist/shared/ipc-channels.js +102 -0
- package/dist/shared/ipc-channels.js.map +1 -0
- package/dist/shared/types.d.ts +89 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +2 -0
- package/dist/shared/types.js.map +1 -0
- package/dist/simulator/assets/simulator-C1eHXnuq.js +9 -0
- package/dist/simulator/assets/simulator-C1eHXnuq.js.map +1 -0
- package/dist/simulator/simulator.html +164 -0
- package/package.json +204 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>Dimina DevTools Simulator</title>
|
|
8
|
+
<style>html, body { overflow: hidden; height: 100%; margin: 0; }</style>
|
|
9
|
+
<script type="module" crossorigin src="/simulator/assets/simulator-C1eHXnuq.js"></script>
|
|
10
|
+
</head>
|
|
11
|
+
|
|
12
|
+
<body>
|
|
13
|
+
<div id="root"></div>
|
|
14
|
+
<script>
|
|
15
|
+
// Intercept Worker creation to inject createInnerAudioContext into the
|
|
16
|
+
// service layer. The service runs in a Web Worker so it cannot return
|
|
17
|
+
// objects synchronously through invokeAPI. By shimming the function
|
|
18
|
+
// directly in the Worker global scope it executes in the same thread as
|
|
19
|
+
// the mini-app code and returns a proxy object that forwards operations
|
|
20
|
+
// to the container (main thread) via invokeAPI messages.
|
|
21
|
+
;(function () {
|
|
22
|
+
const _Worker = Worker
|
|
23
|
+
|
|
24
|
+
// ── SharedArrayBuffer sync invoke infrastructure ──────────────
|
|
25
|
+
// Injected BEFORE service.js so the message listener is registered
|
|
26
|
+
// early. _syncInvoke blocks the Worker with Atomics.wait until the
|
|
27
|
+
// container writes the result into the shared buffer.
|
|
28
|
+
const SYNC_INFRA = `;(function(){
|
|
29
|
+
var _syncSAB = null;
|
|
30
|
+
self.addEventListener('message', function(e) {
|
|
31
|
+
if (e.data && e.data.type === '__sync_init__') { _syncSAB = e.data.sab; }
|
|
32
|
+
});
|
|
33
|
+
self._syncInvoke = function(name, params) {
|
|
34
|
+
if (!_syncSAB) return undefined;
|
|
35
|
+
var lock = new Int32Array(_syncSAB, 0, 1);
|
|
36
|
+
var lenArr = new Int32Array(_syncSAB, 4, 1);
|
|
37
|
+
var dataArr = new Uint8Array(_syncSAB, 8);
|
|
38
|
+
Atomics.store(lock, 0, 0);
|
|
39
|
+
self.postMessage({ method: '__sync_invoke__', body: { name: name, params: params } });
|
|
40
|
+
Atomics.wait(lock, 0, 0);
|
|
41
|
+
var len = lenArr[0];
|
|
42
|
+
var slice = dataArr.slice(0, len);
|
|
43
|
+
return JSON.parse(new TextDecoder().decode(slice));
|
|
44
|
+
};
|
|
45
|
+
})();`
|
|
46
|
+
|
|
47
|
+
// ── Patch sync APIs on wx/qd/dd after service.js loads ───────
|
|
48
|
+
const SYNC_PATCH = `;(function(){
|
|
49
|
+
function _p(ns) {
|
|
50
|
+
if (!ns) return;
|
|
51
|
+
var si = self._syncInvoke;
|
|
52
|
+
ns.getStorageSync = function(key) {
|
|
53
|
+
var r = si('getStorageSync', { key: key });
|
|
54
|
+
return r && r.data !== undefined ? r.data : '';
|
|
55
|
+
};
|
|
56
|
+
ns.setStorageSync = function(key, data) {
|
|
57
|
+
si('setStorageSync', { key: key, data: data });
|
|
58
|
+
};
|
|
59
|
+
ns.removeStorageSync = function(key) {
|
|
60
|
+
si('removeStorageSync', { key: key });
|
|
61
|
+
};
|
|
62
|
+
ns.clearStorageSync = function() {
|
|
63
|
+
si('clearStorageSync');
|
|
64
|
+
};
|
|
65
|
+
ns.getStorageInfoSync = function() {
|
|
66
|
+
return si('getStorageInfoSync') || { keys: [], currentSize: 0, limitSize: 10485760 };
|
|
67
|
+
};
|
|
68
|
+
ns.getAccountInfoSync = function() {
|
|
69
|
+
return si('getAccountInfoSync') || {};
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
_p(self.wx); _p(self.qd); _p(self.dd);
|
|
73
|
+
})();`
|
|
74
|
+
|
|
75
|
+
const SHIM = `;(function(){
|
|
76
|
+
var _seq = 0;
|
|
77
|
+
function _createInnerAudioContext() {
|
|
78
|
+
var id = '__audio_' + (++_seq) + '_' + Date.now();
|
|
79
|
+
var ns = self.wx || self.qd || self.dd;
|
|
80
|
+
if (ns) ns.__audio_create({ id: id });
|
|
81
|
+
var state = { src:'', startTime:0, autoplay:false, loop:false, volume:1, playbackRate:1, _id:id };
|
|
82
|
+
return new Proxy(state, {
|
|
83
|
+
get: function(t, k) {
|
|
84
|
+
if (k === 'play') return function(){ if(ns) ns.__audio_call({ id:id, method:'play' }); };
|
|
85
|
+
if (k === 'pause') return function(){ if(ns) ns.__audio_call({ id:id, method:'pause' }); };
|
|
86
|
+
if (k === 'stop') return function(){ if(ns) ns.__audio_call({ id:id, method:'stop' }); };
|
|
87
|
+
if (k === 'seek') return function(p){ if(ns) ns.__audio_call({ id:id, method:'seek', args:[p] }); };
|
|
88
|
+
if (k === 'destroy') return function(){ if(ns) ns.__audio_call({ id:id, method:'destroy' }); };
|
|
89
|
+
if (k === 'onCanplay' || k === 'onPlay' || k === 'onPause' || k === 'onStop' ||
|
|
90
|
+
k === 'onEnded' || k === 'onTimeUpdate' || k === 'onError' || k === 'onSeeking' ||
|
|
91
|
+
k === 'onSeeked' || k === 'onWaiting' ||
|
|
92
|
+
k === 'offCanplay' || k === 'offPlay' || k === 'offPause' || k === 'offStop' ||
|
|
93
|
+
k === 'offEnded' || k === 'offTimeUpdate' || k === 'offError' || k === 'offSeeking' ||
|
|
94
|
+
k === 'offSeeked' || k === 'offWaiting') return function(){};
|
|
95
|
+
return t[k];
|
|
96
|
+
},
|
|
97
|
+
set: function(t, k, v) {
|
|
98
|
+
t[k] = v;
|
|
99
|
+
if (ns && (k==='src'||k==='startTime'||k==='autoplay'||k==='loop'||k==='volume'||k==='playbackRate'))
|
|
100
|
+
ns.__audio_setProp({ id:id, key:k, value:v });
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
// importScripts is synchronous — wx/qd/dd are already set by service.js
|
|
106
|
+
if (self.wx) self.wx.createInnerAudioContext = _createInnerAudioContext;
|
|
107
|
+
if (self.qd) self.qd.createInnerAudioContext = _createInnerAudioContext;
|
|
108
|
+
if (self.dd) self.dd.createInnerAudioContext = _createInnerAudioContext;
|
|
109
|
+
})();`
|
|
110
|
+
// Read custom API namespaces from query parameter once at load time
|
|
111
|
+
// so we can inject them into every Worker before service.js runs.
|
|
112
|
+
const _nsParam = new URLSearchParams(window.location.search).get('apiNamespaces')
|
|
113
|
+
const _apiNs = _nsParam ? _nsParam.split(',').filter(Boolean) : []
|
|
114
|
+
|
|
115
|
+
window.Worker = class extends _Worker {
|
|
116
|
+
constructor(url, opts) {
|
|
117
|
+
const absUrl = new URL(url, location.href).href
|
|
118
|
+
const origin = location.origin
|
|
119
|
+
// Patch importScripts so relative URLs resolve against the
|
|
120
|
+
// original origin (Blob URLs have no usable base).
|
|
121
|
+
const patchImportScripts = `
|
|
122
|
+
var _is = importScripts;
|
|
123
|
+
importScripts = function() {
|
|
124
|
+
var a = [];
|
|
125
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
126
|
+
try { new URL(arguments[i]); a.push(arguments[i]); }
|
|
127
|
+
catch(e) { a.push("${origin}" + (arguments[i][0]==="/"?"":"/") + arguments[i]); }
|
|
128
|
+
}
|
|
129
|
+
return _is.apply(self, a);
|
|
130
|
+
};
|
|
131
|
+
`
|
|
132
|
+
// Inject __diminaApiNamespaces before service.js loads so
|
|
133
|
+
// env.js picks it up without needing container-side methods.
|
|
134
|
+
const injectNs = _apiNs.length
|
|
135
|
+
? 'self.__diminaApiNamespaces=' + JSON.stringify(_apiNs) + ';'
|
|
136
|
+
: ''
|
|
137
|
+
const shimBlob = new Blob(
|
|
138
|
+
[patchImportScripts + injectNs + SYNC_INFRA + '_is("' + absUrl + '");' + SHIM + SYNC_PATCH],
|
|
139
|
+
{ type: 'application/javascript' }
|
|
140
|
+
)
|
|
141
|
+
super(URL.createObjectURL(shimBlob), { ...opts, type: 'classic' })
|
|
142
|
+
|
|
143
|
+
// ── Main-thread SAB setup ────────────────────────────
|
|
144
|
+
// Create SharedArrayBuffer, send it to Worker, and
|
|
145
|
+
// listen for __sync_invoke__ messages. The handler
|
|
146
|
+
// (window.__handleSyncInvoke) is defined in the module
|
|
147
|
+
// script where AppManager is in scope.
|
|
148
|
+
if (typeof SharedArrayBuffer !== 'undefined') {
|
|
149
|
+
const SAB_SIZE = 4 + 4 + 65536
|
|
150
|
+
const sab = new SharedArrayBuffer(SAB_SIZE)
|
|
151
|
+
this.postMessage({ type: '__sync_init__', sab })
|
|
152
|
+
this.addEventListener('message', (e) => {
|
|
153
|
+
if (e.data?.method === '__sync_invoke__') {
|
|
154
|
+
window.__handleSyncInvoke?.(sab, e.data)
|
|
155
|
+
}
|
|
156
|
+
})
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
})()
|
|
161
|
+
</script>
|
|
162
|
+
</body>
|
|
163
|
+
|
|
164
|
+
</html>
|
package/package.json
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dimina-kit/devtools",
|
|
3
|
+
"version": "0.1.0-dev.20260422094158",
|
|
4
|
+
"description": "Dimina DevTools - modular developer tools for mini app debugging",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"dimina",
|
|
7
|
+
"mini-app",
|
|
8
|
+
"miniprogram",
|
|
9
|
+
"devtools",
|
|
10
|
+
"electron",
|
|
11
|
+
"debugger",
|
|
12
|
+
"inspector",
|
|
13
|
+
"mcp"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "EchoTechFE",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/EchoTechFE/dimina-kit.git",
|
|
20
|
+
"directory": "packages/devtools"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/EchoTechFE/dimina-kit/issues"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/EchoTechFE/dimina-kit/tree/main/packages/devtools#readme",
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE"
|
|
30
|
+
],
|
|
31
|
+
"main": "dist/main/api.js",
|
|
32
|
+
"types": "dist/main/api.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": "./dist/main/api.js",
|
|
35
|
+
"./app": "./dist/main/app/app.js",
|
|
36
|
+
"./launch": "./dist/main/app/launch.js",
|
|
37
|
+
"./types": "./dist/shared/types.js",
|
|
38
|
+
"./context": "./dist/main/services/workbench-context.js",
|
|
39
|
+
"./view-manager": "./dist/main/services/views/view-manager.js",
|
|
40
|
+
"./create-window": "./dist/main/windows/main-window/index.js",
|
|
41
|
+
"./layout": "./dist/main/services/layout/index.js",
|
|
42
|
+
"./projects": "./dist/main/services/projects/index.js",
|
|
43
|
+
"./ipc-app": "./dist/main/ipc/app.js",
|
|
44
|
+
"./ipc-simulator": "./dist/main/ipc/simulator.js",
|
|
45
|
+
"./ipc-panels": "./dist/main/ipc/panels.js",
|
|
46
|
+
"./ipc-toolbar": "./dist/main/ipc/toolbar.js",
|
|
47
|
+
"./ipc-popover": "./dist/main/ipc/popover.js",
|
|
48
|
+
"./ipc-settings": "./dist/main/ipc/settings.js",
|
|
49
|
+
"./ipc-projects": "./dist/main/ipc/projects.js",
|
|
50
|
+
"./ipc-session": "./dist/main/ipc/session.js",
|
|
51
|
+
"./paths": "./dist/main/utils/paths.js",
|
|
52
|
+
"./workbench-settings": "./dist/main/services/settings/index.js",
|
|
53
|
+
"./preload": "./dist/preload/windows/main.js",
|
|
54
|
+
"./simulator-dir": "./dist/main/services/simulator/dir.js",
|
|
55
|
+
"./bootstrap": "./dist/main/app/bootstrap.js"
|
|
56
|
+
},
|
|
57
|
+
"typesVersions": {
|
|
58
|
+
"*": {
|
|
59
|
+
"app": [
|
|
60
|
+
"dist/main/app/app.d.ts"
|
|
61
|
+
],
|
|
62
|
+
"launch": [
|
|
63
|
+
"dist/main/app/launch.d.ts"
|
|
64
|
+
],
|
|
65
|
+
"types": [
|
|
66
|
+
"dist/shared/types.d.ts"
|
|
67
|
+
],
|
|
68
|
+
"context": [
|
|
69
|
+
"dist/main/services/workbench-context.d.ts"
|
|
70
|
+
],
|
|
71
|
+
"view-manager": [
|
|
72
|
+
"dist/main/services/views/view-manager.d.ts"
|
|
73
|
+
],
|
|
74
|
+
"create-window": [
|
|
75
|
+
"dist/main/windows/main-window/index.d.ts"
|
|
76
|
+
],
|
|
77
|
+
"layout": [
|
|
78
|
+
"dist/main/services/layout/index.d.ts"
|
|
79
|
+
],
|
|
80
|
+
"projects": [
|
|
81
|
+
"dist/main/services/projects/index.d.ts"
|
|
82
|
+
],
|
|
83
|
+
"ipc-app": [
|
|
84
|
+
"dist/main/ipc/app.d.ts"
|
|
85
|
+
],
|
|
86
|
+
"ipc-simulator": [
|
|
87
|
+
"dist/main/ipc/simulator.d.ts"
|
|
88
|
+
],
|
|
89
|
+
"ipc-panels": [
|
|
90
|
+
"dist/main/ipc/panels.d.ts"
|
|
91
|
+
],
|
|
92
|
+
"ipc-toolbar": [
|
|
93
|
+
"dist/main/ipc/toolbar.d.ts"
|
|
94
|
+
],
|
|
95
|
+
"ipc-popover": [
|
|
96
|
+
"dist/main/ipc/popover.d.ts"
|
|
97
|
+
],
|
|
98
|
+
"ipc-settings": [
|
|
99
|
+
"dist/main/ipc/settings.d.ts"
|
|
100
|
+
],
|
|
101
|
+
"ipc-projects": [
|
|
102
|
+
"dist/main/ipc/projects.d.ts"
|
|
103
|
+
],
|
|
104
|
+
"ipc-session": [
|
|
105
|
+
"dist/main/ipc/session.d.ts"
|
|
106
|
+
],
|
|
107
|
+
"paths": [
|
|
108
|
+
"dist/main/utils/paths.d.ts"
|
|
109
|
+
],
|
|
110
|
+
"workbench-settings": [
|
|
111
|
+
"dist/main/services/settings/index.d.ts"
|
|
112
|
+
],
|
|
113
|
+
"bootstrap": [
|
|
114
|
+
"dist/main/app/bootstrap.d.ts"
|
|
115
|
+
],
|
|
116
|
+
"simulator-dir": [
|
|
117
|
+
"dist/main/services/simulator/dir.d.ts"
|
|
118
|
+
],
|
|
119
|
+
"preload": [
|
|
120
|
+
"dist/preload/windows/main.d.ts"
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"type": "module",
|
|
125
|
+
"engines": {
|
|
126
|
+
"node": ">=20"
|
|
127
|
+
},
|
|
128
|
+
"dependencies": {
|
|
129
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
130
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
131
|
+
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
132
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
133
|
+
"@radix-ui/react-separator": "^1.1.8",
|
|
134
|
+
"@radix-ui/react-switch": "^1.2.6",
|
|
135
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
|
136
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
137
|
+
"@tanstack/react-virtual": "^3.13.24",
|
|
138
|
+
"@uiw/react-json-view": "2.0.0-alpha.41",
|
|
139
|
+
"class-variance-authority": "^0.7.1",
|
|
140
|
+
"clsx": "^2.1.1",
|
|
141
|
+
"chrome-remote-interface": "^0.34.0",
|
|
142
|
+
"cmdk": "^1.1.1",
|
|
143
|
+
"lucide-react": "^1.8.0",
|
|
144
|
+
"react": "^18.3.1",
|
|
145
|
+
"react-dom": "^18.3.1",
|
|
146
|
+
"react-resizable-panels": "^4.10.0",
|
|
147
|
+
"tailwind-merge": "^2.6.0",
|
|
148
|
+
"ws": "^8.20.0",
|
|
149
|
+
"zod": "^4.3.6",
|
|
150
|
+
"@dimina-kit/devkit": "0.1.0-dev.20260422094158"
|
|
151
|
+
},
|
|
152
|
+
"devDependencies": {
|
|
153
|
+
"@playwright/test": "^1.59.1",
|
|
154
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
155
|
+
"@testing-library/react": "^16.3.2",
|
|
156
|
+
"@types/chrome-remote-interface": "^0.33.0",
|
|
157
|
+
"@types/node": "^22.10.0",
|
|
158
|
+
"@types/react": "^18.3.12",
|
|
159
|
+
"@types/react-dom": "^18.3.1",
|
|
160
|
+
"@types/ws": "^8.18.1",
|
|
161
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
162
|
+
"autoprefixer": "^10.5.0",
|
|
163
|
+
"concurrently": "^9.2.1",
|
|
164
|
+
"electron": "^41.2.1",
|
|
165
|
+
"electron-builder": "^26.8.1",
|
|
166
|
+
"eslint": "^10.2.1",
|
|
167
|
+
"globals": "^17.5.0",
|
|
168
|
+
"jsdom": "^29.0.2",
|
|
169
|
+
"miniprogram-automator": "^0.12.1",
|
|
170
|
+
"postcss": "^8.5.10",
|
|
171
|
+
"tailwindcss": "^3.4.17",
|
|
172
|
+
"typescript": "5.9.2",
|
|
173
|
+
"vite": "^8.0.8",
|
|
174
|
+
"esbuild": "^0.28.0",
|
|
175
|
+
"vitest": "^4.1.4",
|
|
176
|
+
"@dimina-kit/eslint-config": "0.1.0",
|
|
177
|
+
"@dimina-kit/typescript-config": "0.1.0"
|
|
178
|
+
},
|
|
179
|
+
"peerDependencies": {
|
|
180
|
+
"electron": ">=36"
|
|
181
|
+
},
|
|
182
|
+
"publishConfig": {
|
|
183
|
+
"access": "public"
|
|
184
|
+
},
|
|
185
|
+
"scripts": {
|
|
186
|
+
"start": "electron dist/main/index.js",
|
|
187
|
+
"build": "pnpm build:main && pnpm build:preload && pnpm build:renderer && pnpm build:simulator",
|
|
188
|
+
"build:container": "node build-container.js",
|
|
189
|
+
"build:simulator": "vite build --config vite.config.simulator.ts",
|
|
190
|
+
"pack": "electron-builder --dir",
|
|
191
|
+
"dist": "electron-builder",
|
|
192
|
+
"build:main": "tsc -p tsconfig.main.json",
|
|
193
|
+
"build:preload": "tsc -p tsconfig.preload.json && esbuild src/preload/windows/simulator.ts --bundle --platform=node --format=cjs --sourcemap --external:electron --outfile=dist/preload/windows/simulator.js",
|
|
194
|
+
"build:renderer": "vite build",
|
|
195
|
+
"dev": "pnpm build && concurrently \"vite build --watch\" \"vite build --watch --config vite.config.simulator.ts\" \"tsc -p tsconfig.main.json --watch\" \"tsc -p tsconfig.preload.json --watch\" \"esbuild src/preload/windows/simulator.ts --bundle --platform=node --format=cjs --sourcemap --external:electron --outfile=dist/preload/windows/simulator.js --watch\" \"electron dist/main/index.js\"",
|
|
196
|
+
"build:core": "pnpm --filter @dimina-kit/devkit build",
|
|
197
|
+
"check-types": "tsc --noEmit",
|
|
198
|
+
"lint": "eslint . --max-warnings 0",
|
|
199
|
+
"test": "vitest run",
|
|
200
|
+
"test:dev": "vitest",
|
|
201
|
+
"test:e2e": "playwright test",
|
|
202
|
+
"test:e2e:ui": "playwright test --ui"
|
|
203
|
+
}
|
|
204
|
+
}
|