@dimina-kit/devtools 0.4.0 → 0.5.0
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/README.md +51 -660
- package/dist/main/api.d.ts +2 -1
- package/dist/main/app/app.d.ts +41 -12
- package/dist/main/app/app.js +299 -514
- package/dist/main/app/bootstrap.d.ts +8 -5
- package/dist/main/app/bootstrap.js +15 -15
- package/dist/main/app/editor-view.d.ts +21 -0
- package/dist/main/app/editor-view.js +71 -0
- package/dist/main/app/global-mirrors.d.ts +23 -0
- package/dist/main/app/global-mirrors.js +37 -0
- package/dist/main/app/host-sidebar-default.d.ts +19 -0
- package/dist/main/app/host-sidebar-default.js +44 -0
- package/dist/main/app/lifecycle.d.ts +12 -1
- package/dist/main/app/lifecycle.js +27 -1
- package/dist/main/app/menu-setup.d.ts +13 -0
- package/dist/main/app/menu-setup.js +49 -0
- package/dist/main/app/native-overview.d.ts +1 -1
- package/dist/main/app/open-project-ipc.d.ts +13 -0
- package/dist/main/app/open-project-ipc.js +21 -0
- package/dist/main/app/project-list-surface.d.ts +31 -0
- package/dist/main/app/project-list-surface.js +20 -0
- package/dist/main/app/project-window.d.ts +36 -0
- package/dist/main/app/project-window.js +93 -0
- package/dist/main/app/servers.d.ts +17 -0
- package/dist/main/app/servers.js +60 -0
- package/dist/main/app/ui-extension-targets.d.ts +42 -0
- package/dist/main/app/ui-extension-targets.js +101 -0
- package/dist/main/app/window-close-reveal.harness.d.ts +34 -0
- package/dist/main/app/window-close-reveal.harness.js +65 -0
- package/dist/main/app/window-events.d.ts +15 -0
- package/dist/main/app/window-events.js +45 -0
- package/dist/main/app/window-runtime-services.d.ts +41 -0
- package/dist/main/app/window-runtime-services.js +197 -0
- package/dist/main/app/workbench-modules.d.ts +24 -0
- package/dist/main/app/workbench-modules.js +51 -0
- package/dist/main/app/workbench-window.d.ts +85 -0
- package/dist/main/app/workbench-window.js +310 -0
- package/dist/main/index.bundle.js +11712 -9986
- package/dist/main/index.js +49 -1
- package/dist/main/ipc/app-lifecycle.d.ts +1 -31
- package/dist/main/ipc/app-lifecycle.js +1 -53
- package/dist/main/ipc/app.d.ts +4 -1
- package/dist/main/ipc/app.js +4 -3
- package/dist/main/ipc/bridge-router.d.ts +19 -116
- package/dist/main/ipc/bridge-router.js +28 -2128
- package/dist/main/ipc/device-picker.d.ts +16 -0
- package/dist/main/ipc/device-picker.js +27 -0
- package/dist/main/ipc/index.d.ts +5 -0
- package/dist/main/ipc/index.js +5 -0
- package/dist/main/ipc/internal-devtools.d.ts +16 -0
- package/dist/main/ipc/internal-devtools.js +10 -0
- package/dist/main/ipc/page-scroll.d.ts +1 -13
- package/dist/main/ipc/page-scroll.js +1 -16
- package/dist/main/ipc/popover.d.ts +4 -1
- package/dist/main/ipc/popover.js +26 -19
- package/dist/main/ipc/project-create.d.ts +16 -0
- package/dist/main/ipc/project-create.js +27 -0
- package/dist/main/ipc/project-fs.d.ts +38 -3
- package/dist/main/ipc/project-fs.js +53 -22
- package/dist/main/ipc/projects.d.ts +3 -3
- package/dist/main/ipc/projects.js +47 -11
- package/dist/main/ipc/session-listener-bag.d.ts +1 -40
- package/dist/main/ipc/session-listener-bag.js +1 -39
- package/dist/main/ipc/session.d.ts +4 -1
- package/dist/main/ipc/session.js +26 -26
- package/dist/main/ipc/settings.d.ts +4 -1
- package/dist/main/ipc/settings.js +17 -19
- package/dist/main/ipc/simulator-module.d.ts +9 -3
- package/dist/main/ipc/simulator-module.js +13 -10
- package/dist/main/ipc/simulator.d.ts +4 -1
- package/dist/main/ipc/simulator.js +12 -18
- package/dist/main/ipc/tooltip.d.ts +14 -0
- package/dist/main/ipc/tooltip.js +29 -0
- package/dist/main/ipc/views.d.ts +19 -2
- package/dist/main/ipc/views.js +76 -8
- package/dist/main/runtime/devtools-backend-before-quit.harness.d.ts +43 -0
- package/dist/main/runtime/devtools-backend-before-quit.harness.js +87 -0
- package/dist/main/runtime/devtools-backend.js +60 -4
- package/dist/main/runtime/devtools-runtime-mock.harness.d.ts +21 -0
- package/dist/main/runtime/devtools-runtime-mock.harness.js +313 -0
- package/dist/main/runtime/miniapp-runtime.d.ts +91 -22
- package/dist/main/services/app-services.d.ts +62 -0
- package/dist/main/services/app-services.js +64 -0
- package/dist/main/services/automation/connection-target.d.ts +36 -0
- package/dist/main/services/automation/connection-target.js +29 -0
- package/dist/main/services/automation/console-bridge.d.ts +28 -0
- package/dist/main/services/automation/console-bridge.js +91 -0
- package/dist/main/services/automation/handlers/app.js +4 -4
- package/dist/main/services/automation/handlers/element.js +55 -21
- package/dist/main/services/automation/index.d.ts +12 -1
- package/dist/main/services/automation/index.js +54 -133
- package/dist/main/services/cdp-session/index.d.ts +87 -0
- package/dist/main/services/cdp-session/index.js +173 -0
- package/dist/main/services/compile-standby.js +4 -0
- package/dist/main/services/console-forward/cdp-inject.d.ts +18 -0
- package/dist/main/services/console-forward/cdp-inject.js +30 -0
- package/dist/main/services/console-forward/global-console-mirror.d.ts +33 -0
- package/dist/main/services/console-forward/global-console-mirror.js +71 -0
- package/dist/main/services/console-forward/global-diagnostics-mirror.d.ts +33 -0
- package/dist/main/services/console-forward/global-diagnostics-mirror.js +73 -0
- package/dist/main/services/console-forward/index.d.ts +1 -46
- package/dist/main/services/console-forward/index.js +1 -185
- package/dist/main/services/console-forward/internal-log.d.ts +2 -0
- package/dist/main/services/console-forward/internal-log.js +2 -0
- package/dist/main/services/console-forward/open-gated-relay.d.ts +67 -0
- package/dist/main/services/console-forward/open-gated-relay.js +55 -0
- package/dist/main/services/default-adapter.js +1 -1
- package/dist/main/services/diagnostics/index.d.ts +1 -48
- package/dist/main/services/diagnostics/index.js +1 -60
- package/dist/main/services/dimina-resource-server.d.ts +1 -6
- package/dist/main/services/dimina-resource-server.js +1 -98
- package/dist/main/services/elements-forward/index.d.ts +132 -15
- package/dist/main/services/elements-forward/index.js +155 -304
- package/dist/main/services/fs-bridge-protocol.d.ts +61 -0
- package/dist/main/services/fs-bridge-protocol.js +34 -0
- package/dist/main/services/fs-watch-sse.d.ts +40 -0
- package/dist/main/services/fs-watch-sse.js +113 -0
- package/dist/main/services/http-json.d.ts +9 -0
- package/dist/main/services/http-json.js +6 -0
- package/dist/main/services/layout/index.d.ts +11 -0
- package/dist/main/services/layout/index.js +23 -0
- package/dist/main/services/mcp/connection-owner.d.ts +38 -0
- package/dist/main/services/mcp/connection-owner.js +79 -0
- package/dist/main/services/mcp/index.d.ts +3 -1
- package/dist/main/services/mcp/index.js +4 -3
- package/dist/main/services/mcp/opened-project.d.ts +88 -0
- package/dist/main/services/mcp/opened-project.js +60 -0
- package/dist/main/services/mcp/server.d.ts +2 -1
- package/dist/main/services/mcp/server.js +29 -4
- package/dist/main/services/mcp/target-manager.d.ts +71 -23
- package/dist/main/services/mcp/target-manager.js +269 -138
- package/dist/main/services/mcp/target-selection.d.ts +47 -0
- package/dist/main/services/mcp/target-selection.js +71 -0
- package/dist/main/services/mcp/tools/context-tools.js +20 -5
- package/dist/main/services/mcp/tools/project-tools.d.ts +72 -0
- package/dist/main/services/mcp/tools/project-tools.js +133 -0
- package/dist/main/services/module.d.ts +13 -5
- package/dist/main/services/network-forward/body-cache.d.ts +72 -0
- package/dist/main/services/network-forward/body-cache.js +179 -0
- package/dist/main/services/network-forward/frontend-dispatch.d.ts +91 -0
- package/dist/main/services/network-forward/frontend-dispatch.js +148 -0
- package/dist/main/services/network-forward/global-body-gate.d.ts +46 -0
- package/dist/main/services/network-forward/global-body-gate.js +93 -0
- package/dist/main/services/network-forward/global-mirror-test-fixtures.d.ts +48 -0
- package/dist/main/services/network-forward/global-mirror-test-fixtures.js +96 -0
- package/dist/main/services/network-forward/http.d.ts +47 -0
- package/dist/main/services/network-forward/http.js +162 -0
- package/dist/main/services/network-forward/index.d.ts +135 -15
- package/dist/main/services/network-forward/index.js +854 -224
- package/dist/main/services/network-forward/request-ids.d.ts +5 -0
- package/dist/main/services/network-forward/request-ids.js +5 -0
- package/dist/main/services/network-forward/user-facing.d.ts +21 -0
- package/dist/main/services/network-forward/user-facing.js +50 -0
- package/dist/main/services/network-forward/websocket.d.ts +36 -0
- package/dist/main/services/network-forward/websocket.js +120 -0
- package/dist/main/services/notifications/renderer-notifier.d.ts +71 -9
- package/dist/main/services/notifications/renderer-notifier.js +45 -8
- package/dist/main/services/projects/create-project-service.js +19 -5
- package/dist/main/services/projects/local-provider.js +8 -4
- package/dist/main/services/projects/project-repository.d.ts +59 -7
- package/dist/main/services/projects/project-repository.js +285 -51
- package/dist/main/services/projects/types.d.ts +44 -34
- package/dist/main/services/render-inspect/index.d.ts +12 -2
- package/dist/main/services/render-inspect/index.js +21 -102
- package/dist/main/services/safe-area/index.d.ts +21 -6
- package/dist/main/services/safe-area/index.js +92 -46
- package/dist/main/services/service-host-pool/pool.d.ts +1 -196
- package/dist/main/services/service-host-pool/pool.js +1 -363
- package/dist/main/services/settings/index.d.ts +7 -1
- package/dist/main/services/settings/index.js +22 -2
- package/dist/main/services/simulator/custom-apis.d.ts +1 -42
- package/dist/main/services/simulator/custom-apis.js +1 -46
- package/dist/main/services/simulator/referer.d.ts +1 -9
- package/dist/main/services/simulator/referer.js +1 -19
- package/dist/main/services/simulator/ui-extensions.d.ts +21 -0
- package/dist/main/services/simulator/ui-extensions.js +176 -0
- package/dist/main/services/simulator-appdata/index.d.ts +6 -0
- package/dist/main/services/simulator-appdata/index.js +21 -2
- package/dist/main/services/simulator-current-page/index.d.ts +5 -3
- package/dist/main/services/simulator-current-page/index.js +8 -1
- package/dist/main/services/simulator-storage/index.d.ts +34 -5
- package/dist/main/services/simulator-storage/index.js +73 -71
- package/dist/main/services/simulator-storage/service-storage-ops.d.ts +1 -39
- package/dist/main/services/simulator-storage/service-storage-ops.js +1 -66
- package/dist/main/services/simulator-storage/window-scope.d.ts +20 -0
- package/dist/main/services/simulator-storage/window-scope.js +20 -0
- package/dist/main/services/simulator-temp-files/disk.d.ts +1 -54
- package/dist/main/services/simulator-temp-files/disk.js +1 -237
- package/dist/main/services/simulator-temp-files/fs-channels.d.ts +1 -68
- package/dist/main/services/simulator-temp-files/fs-channels.js +1 -107
- package/dist/main/services/simulator-temp-files/index.d.ts +1 -32
- package/dist/main/services/simulator-temp-files/index.js +1 -181
- package/dist/main/services/simulator-temp-files/request-handler.d.ts +1 -29
- package/dist/main/services/simulator-temp-files/request-handler.js +1 -177
- package/dist/main/services/simulator-temp-files/resolver.d.ts +1 -21
- package/dist/main/services/simulator-temp-files/resolver.js +1 -21
- package/dist/main/services/simulator-temp-files/store.d.ts +1 -13
- package/dist/main/services/simulator-temp-files/store.js +1 -23
- package/dist/main/services/update/github-release-checker.js +22 -3
- package/dist/main/services/update/update-manager.d.ts +21 -4
- package/dist/main/services/update/update-manager.js +55 -11
- package/dist/main/services/views/clear-console-filter.d.ts +44 -0
- package/dist/main/services/views/clear-console-filter.js +86 -0
- package/dist/main/services/views/console-filter-test-fixtures.d.ts +94 -0
- package/dist/main/services/views/console-filter-test-fixtures.js +82 -0
- package/dist/main/services/views/console-filter.d.ts +94 -0
- package/dist/main/services/views/console-filter.js +190 -0
- package/dist/main/services/views/devtools-tabs.d.ts +24 -4
- package/dist/main/services/views/devtools-tabs.js +40 -21
- package/dist/main/services/views/frontend-bootstrap-gate.d.ts +59 -0
- package/dist/main/services/views/frontend-bootstrap-gate.js +117 -0
- package/dist/main/services/views/host-dialog-port-channel.d.ts +18 -0
- package/dist/main/services/views/host-dialog-port-channel.js +15 -0
- package/dist/main/services/views/host-dialog-session-runtime.d.ts +10 -0
- package/dist/main/services/views/host-dialog-session-runtime.js +17 -0
- package/dist/main/services/views/host-dialog-view.d.ts +95 -0
- package/dist/main/services/views/host-dialog-view.js +147 -0
- package/dist/main/services/views/host-sidebar-port-channel.d.ts +18 -0
- package/dist/main/services/views/host-sidebar-port-channel.js +15 -0
- package/dist/main/services/views/host-sidebar-session-runtime.d.ts +10 -0
- package/dist/main/services/views/host-sidebar-session-runtime.js +17 -0
- package/dist/main/services/views/host-sidebar-view.d.ts +59 -0
- package/dist/main/services/views/host-sidebar-view.js +44 -0
- package/dist/main/services/views/host-slot-port-channel.d.ts +124 -0
- package/dist/main/services/views/host-slot-port-channel.js +289 -0
- package/dist/main/services/views/host-slot-session-runtime.d.ts +40 -0
- package/dist/main/services/views/host-slot-session-runtime.js +50 -0
- package/dist/main/services/views/host-slot-view.d.ts +109 -0
- package/dist/main/services/views/host-slot-view.js +147 -0
- package/dist/main/services/views/host-toolbar-port-channel.d.ts +6 -91
- package/dist/main/services/views/host-toolbar-port-channel.js +10 -243
- package/dist/main/services/views/host-toolbar-session-runtime.d.ts +5 -30
- package/dist/main/services/views/host-toolbar-session-runtime.js +9 -47
- package/dist/main/services/views/host-toolbar-view.d.ts +34 -7
- package/dist/main/services/views/host-toolbar-view.js +30 -237
- package/dist/main/services/views/managed-web-contents-view.d.ts +48 -0
- package/dist/main/services/views/managed-web-contents-view.js +143 -0
- package/dist/main/services/views/miniapp-partition.d.ts +1 -89
- package/dist/main/services/views/miniapp-partition.js +1 -158
- package/dist/main/services/views/native-simulator-devtools-host.js +206 -68
- package/dist/main/services/views/native-simulator-view.d.ts +6 -0
- package/dist/main/services/views/native-simulator-view.js +47 -40
- package/dist/main/services/views/native-view-tree.d.ts +25 -0
- package/dist/main/services/views/native-view-tree.js +69 -0
- package/dist/main/services/views/overlay-panels-view.d.ts +63 -4
- package/dist/main/services/views/overlay-panels-view.js +257 -108
- package/dist/main/services/views/placement-reconciler.d.ts +18 -18
- package/dist/main/services/views/placement-reconciler.js +91 -29
- package/dist/main/services/views/placement-test-driver.d.ts +27 -0
- package/dist/main/services/views/placement-test-driver.js +29 -0
- package/dist/main/services/views/refresh-styles.d.ts +10 -0
- package/dist/main/services/views/refresh-styles.js +57 -0
- package/dist/main/services/views/simulator-session-policy.d.ts +1 -27
- package/dist/main/services/views/simulator-session-policy.js +1 -98
- package/dist/main/services/views/view-manager-devtools-host-test-fixtures.d.ts +76 -0
- package/dist/main/services/views/view-manager-devtools-host-test-fixtures.js +184 -0
- package/dist/main/services/views/view-manager.d.ts +69 -88
- package/dist/main/services/views/view-manager.js +62 -7
- package/dist/main/services/views/workbench-view.d.ts +2 -0
- package/dist/main/services/views/workbench-view.js +104 -17
- package/dist/main/services/window-contexts/context-router.d.ts +36 -0
- package/dist/main/services/window-contexts/context-router.js +55 -0
- package/dist/main/services/workbench-coi-host.d.ts +52 -0
- package/dist/main/services/workbench-coi-host.js +227 -0
- package/dist/main/services/workbench-coi-server.d.ts +11 -0
- package/dist/main/services/workbench-coi-server.js +126 -126
- package/dist/main/services/workbench-coi-shutdown.d.ts +40 -0
- package/dist/main/services/workbench-coi-shutdown.js +69 -0
- package/dist/main/services/workbench-coi-static.d.ts +23 -0
- package/dist/main/services/workbench-coi-static.js +87 -0
- package/dist/main/services/workbench-context.d.ts +88 -8
- package/dist/main/services/workbench-context.js +54 -6
- package/dist/main/services/workspace/compile-log-buffer.d.ts +40 -0
- package/dist/main/services/workspace/compile-log-buffer.js +41 -0
- package/dist/main/services/workspace/compile-mode-adapter.d.ts +18 -0
- package/dist/main/services/workspace/compile-mode-adapter.js +57 -0
- package/dist/main/services/workspace/compile-mode-store.d.ts +25 -0
- package/dist/main/services/workspace/compile-mode-store.js +71 -0
- package/dist/main/services/workspace/open-project-guards.d.ts +16 -0
- package/dist/main/services/workspace/open-project-guards.js +42 -0
- package/dist/main/services/workspace/rebuild-status.d.ts +37 -0
- package/dist/main/services/workspace/rebuild-status.js +36 -0
- package/dist/main/services/workspace/session-status-store.d.ts +47 -0
- package/dist/main/services/workspace/session-status-store.js +73 -0
- package/dist/main/services/workspace/status-tap.d.ts +20 -0
- package/dist/main/services/workspace/status-tap.js +32 -0
- package/dist/main/services/workspace/workspace-compile-modes.d.ts +59 -0
- package/dist/main/services/workspace/workspace-compile-modes.js +93 -0
- package/dist/main/services/workspace/workspace-lifecycle-race.testutil.d.ts +22 -0
- package/dist/main/services/workspace/workspace-lifecycle-race.testutil.js +62 -0
- package/dist/main/services/workspace/workspace-referer.d.ts +17 -0
- package/dist/main/services/workspace/workspace-referer.js +26 -0
- package/dist/main/services/workspace/workspace-service.d.ts +7 -5
- package/dist/main/services/workspace/workspace-service.js +96 -135
- package/dist/main/services/workspace/workspace-thumbnails.d.ts +22 -0
- package/dist/main/services/workspace/workspace-thumbnails.js +67 -0
- package/dist/main/utils/ipc-context-source.d.ts +40 -0
- package/dist/main/utils/ipc-context-source.js +23 -0
- package/dist/main/utils/ipc-registry.d.ts +46 -21
- package/dist/main/utils/ipc-registry.js +166 -76
- package/dist/main/utils/paths.d.ts +18 -0
- package/dist/main/utils/paths.js +18 -0
- package/dist/main/utils/sender-policy.d.ts +10 -1
- package/dist/main/utils/sender-policy.js +42 -4
- package/dist/main/utils/theme.d.ts +18 -8
- package/dist/main/utils/theme.js +19 -9
- package/dist/main/windows/internal-devtools-window/index.d.ts +66 -0
- package/dist/main/windows/internal-devtools-window/index.js +160 -0
- package/dist/main/windows/main-window/create.d.ts +16 -0
- package/dist/main/windows/main-window/create.js +19 -11
- package/dist/main/windows/main-window/events.d.ts +1 -1
- package/dist/main/windows/main-window/events.js +26 -13
- package/dist/main/windows/main-window/index.d.ts +1 -1
- package/dist/main/windows/main-window/index.js +1 -1
- package/dist/main/windows/service-host-window/create.d.ts +1 -92
- package/dist/main/windows/service-host-window/create.js +1 -154
- package/dist/native-host/common/common.js +173 -53
- package/dist/native-host/container/pageFrame.css +1 -1
- package/dist/native-host/render/render.js +8278 -3659
- package/dist/native-host/service/service.js +2 -2
- package/dist/preload/index.d.ts +2 -0
- package/dist/preload/index.js +1 -0
- package/dist/preload/instrumentation/app-data.d.ts +2 -2
- package/dist/preload/instrumentation/app-data.js +1 -1
- package/dist/preload/instrumentation/wxml.js +1 -1
- package/dist/preload/runtime/bridge.d.ts +3 -3
- package/dist/preload/runtime/bridge.js +2 -2
- package/dist/preload/runtime/clipboard.d.ts +6 -0
- package/dist/preload/runtime/clipboard.js +12 -0
- package/dist/preload/runtime/host-dialog-advertiser.d.ts +22 -0
- package/dist/preload/runtime/host-dialog-advertiser.js +37 -0
- package/dist/preload/runtime/host-dialog-port.d.ts +44 -0
- package/dist/preload/runtime/host-dialog-port.js +53 -0
- package/dist/preload/runtime/host-dialog-runtime.d.ts +28 -0
- package/dist/preload/runtime/host-dialog-runtime.js +36 -0
- package/dist/preload/runtime/host-sidebar-advertiser.d.ts +19 -0
- package/dist/preload/runtime/host-sidebar-advertiser.js +35 -0
- package/dist/preload/runtime/host-sidebar-port.d.ts +44 -0
- package/dist/preload/runtime/host-sidebar-port.js +53 -0
- package/dist/preload/runtime/host-sidebar-runtime.d.ts +28 -0
- package/dist/preload/runtime/host-sidebar-runtime.js +36 -0
- package/dist/preload/runtime/host-slot-port-bridge.d.ts +18 -0
- package/dist/preload/runtime/host-slot-port-bridge.js +112 -0
- package/dist/preload/runtime/host-toolbar-advertiser.d.ts +5 -13
- package/dist/preload/runtime/host-toolbar-advertiser.js +18 -38
- package/dist/preload/runtime/host-toolbar-port.d.ts +9 -0
- package/dist/preload/runtime/host-toolbar-port.js +11 -95
- package/dist/preload/runtime/native-host.d.ts +14 -0
- package/dist/preload/runtime/native-host.js +5 -8
- package/dist/preload/runtime/node-bindings.d.ts +18 -0
- package/dist/preload/runtime/node-bindings.js +44 -0
- package/dist/preload/runtime/temp-files.js +9 -2
- package/dist/preload/runtime/wait-for-slot-root.d.ts +23 -0
- package/dist/preload/runtime/wait-for-slot-root.js +80 -0
- package/dist/preload/shared/api-compat.js +63 -41
- package/dist/preload/windows/host-dialog-runtime.cjs +360 -0
- package/dist/preload/windows/host-dialog-runtime.cjs.map +7 -0
- package/dist/preload/windows/host-dialog-runtime.d.ts +2 -0
- package/dist/preload/windows/host-dialog-runtime.js +13 -0
- package/dist/preload/windows/host-sidebar-runtime.cjs +361 -0
- package/dist/preload/windows/host-sidebar-runtime.cjs.map +7 -0
- package/dist/preload/windows/host-sidebar-runtime.d.ts +2 -0
- package/dist/preload/windows/host-sidebar-runtime.js +13 -0
- package/dist/preload/windows/host-toolbar-runtime.cjs +142 -52
- package/dist/preload/windows/host-toolbar-runtime.cjs.map +3 -3
- package/dist/preload/windows/main.cjs +4922 -1246
- package/dist/preload/windows/main.cjs.map +4 -4
- package/dist/preload/windows/main.css +428 -0
- package/dist/preload/windows/main.css.map +7 -0
- package/dist/preload/windows/simulator.cjs +376 -322
- package/dist/preload/windows/simulator.cjs.map +4 -4
- package/dist/preload/windows/simulator.js +376 -322
- package/dist/render-host/pageFrame.html +4 -4
- package/dist/render-host/preload.cjs +30 -0
- package/dist/render-host/render-inspect.js +184 -115
- package/dist/renderer/assets/button-CB2MWjHY.js +2 -0
- package/dist/renderer/assets/constants-CkoGPQTS.js +2 -0
- package/dist/renderer/assets/constants-zQZ2-y21.js +2 -0
- package/dist/renderer/assets/createLucideIcon-cZ9FlZZw.js +2 -0
- package/dist/renderer/assets/devicePicker-H2eIO4e1.js +2 -0
- package/dist/renderer/assets/dialog-pHzEA8Vx.js +46 -0
- package/dist/renderer/assets/dist-B5HADirS.js +2 -0
- package/dist/renderer/assets/dist-DIFlRMKe.js +2 -0
- package/dist/renderer/assets/hostSidebarDefault-DRWh6OCt.js +2 -0
- package/dist/renderer/assets/index-CEL_XFge.js +2 -0
- package/dist/renderer/assets/input-CAObw95L.js +2 -0
- package/dist/renderer/assets/ipc-channels-overlays-gIPUFnqc.js +2 -0
- package/dist/renderer/assets/jsx-runtime-DICEQH_0.css +1 -0
- package/dist/renderer/assets/jsx-runtime-DIw5wnYl.js +9 -0
- package/dist/renderer/assets/plus-BQ9u5EbL.js +2 -0
- package/dist/renderer/assets/popover-Cw7G2Ctp.js +2 -0
- package/dist/renderer/assets/presets-DMZOb9ay.js +2 -0
- package/dist/renderer/assets/project-api-YTOr_Yvo.js +2 -0
- package/dist/renderer/assets/projectCreateDialog-BmLqiYxn.js +2 -0
- package/dist/renderer/assets/search-BMvuYF48.js +2 -0
- package/dist/renderer/assets/select-nFP95TxM.js +2 -0
- package/dist/renderer/assets/settings-CnpVfSWt.js +2 -0
- package/dist/renderer/assets/settings-api-Ccsf-Nsj.js +2 -0
- package/dist/renderer/assets/settings-tab-bar-CAzrv32m.js +2 -0
- package/dist/renderer/assets/smartphone-Bb2GdIKy.js +2 -0
- package/dist/renderer/assets/tabs-CPKN3Mmq.js +2 -0
- package/dist/renderer/assets/tooltip-D6AxXRk5.js +2 -0
- package/dist/renderer/assets/types-Bh0hA7El.js +2 -0
- package/dist/renderer/assets/updateDialog-CwndJ0Bl.js +2 -0
- package/dist/renderer/assets/utils-sEB5OZEQ.js +2 -0
- package/dist/renderer/assets/view-api-B-2zPBR5.js +2 -0
- package/dist/renderer/assets/view-ids-BfaDVV5P.js +2 -0
- package/dist/renderer/assets/workbench-C0Jkdlps.js +5 -0
- package/dist/renderer/assets/workbenchSettings-YD0Ctbm_.js +8 -0
- package/dist/renderer/entries/device-picker/index.html +28 -0
- package/dist/renderer/entries/host-sidebar-default/index.html +22 -0
- package/dist/renderer/entries/main/index.html +16 -7
- package/dist/renderer/entries/popover/index.html +16 -6
- package/dist/renderer/entries/project-create-dialog/index.html +27 -0
- package/dist/renderer/entries/settings/index.html +10 -5
- package/dist/renderer/entries/tooltip/index.html +21 -0
- package/dist/renderer/entries/update-dialog/index.html +25 -0
- package/dist/renderer/entries/workbench/index.html +49 -0
- package/dist/renderer/entries/workbench-settings/index.html +12 -5
- package/dist/service-host/appdata-set-data.cjs +39 -0
- package/dist/service-host/host-env-update.cjs +23 -0
- package/dist/service-host/preload.cjs +54 -48
- package/dist/service-host/service-message-queue.cjs +71 -0
- package/dist/service-host/sync-impls/menu-button-geometry.js +16 -5
- package/dist/service-host/sync-impls/menu-button.js +5 -3
- package/dist/service-host/sync-impls/system-info.js +31 -9
- package/dist/shared/bridge-channels.d.ts +1 -416
- package/dist/shared/bridge-channels.js +1 -89
- package/dist/shared/compile-mode-state.d.ts +73 -0
- package/dist/shared/compile-mode-state.js +100 -0
- package/dist/shared/compile-modes.d.ts +152 -0
- package/dist/shared/compile-modes.js +237 -0
- package/dist/shared/constants.d.ts +22 -0
- package/dist/shared/constants.js +22 -0
- package/dist/shared/dmb-resource-url.d.ts +2 -0
- package/dist/shared/dmb-resource-url.js +2 -0
- package/dist/shared/ipc-channels-overlays.d.ts +162 -0
- package/dist/shared/ipc-channels-overlays.js +203 -0
- package/dist/shared/ipc-channels.d.ts +24 -154
- package/dist/shared/ipc-channels.js +48 -96
- package/dist/shared/ipc-schemas.d.ts +143 -54
- package/dist/shared/ipc-schemas.js +137 -45
- package/dist/shared/node-bindings.d.ts +2 -0
- package/dist/shared/node-bindings.js +2 -0
- package/dist/shared/project-window-types.d.ts +42 -0
- package/dist/shared/project-window-types.js +2 -0
- package/dist/shared/simulator-route.d.ts +8 -0
- package/dist/shared/simulator-route.js +15 -0
- package/dist/shared/simulator-ui.d.ts +61 -0
- package/dist/shared/simulator-ui.js +12 -0
- package/dist/shared/types.d.ts +126 -41
- package/dist/shared/view-ids.d.ts +10 -0
- package/dist/shared/view-ids.js +23 -0
- package/dist/simulator/assets/bridge-channels-B3JAmRfl.js +2 -0
- package/dist/simulator/assets/device-shell-ATEhHV2_.css +1 -0
- package/dist/simulator/assets/device-shell-DucLepkm.js +431 -0
- package/dist/simulator/assets/simulator-B4rbcOVt.js +10 -0
- package/dist/simulator/assets/simulator-mini-app-DFo7fhi5.js +2 -0
- package/dist/simulator/assets/simulator-ui-BupATgKo.css +1 -0
- package/dist/simulator/assets/simulator-ui-i3GCc7YJ.js +2 -0
- package/dist/simulator/simulator.html +4 -3
- package/dist/simulator/temp-files.d.ts +35 -0
- package/dist/simulator/temp-files.js +121 -0
- package/dist/simulator/types.d.ts +50 -0
- package/dist/simulator/types.js +2 -0
- package/dist/vscode-workbench/assets/__vite-browser-external-JIkWewFf.js +1 -0
- package/dist/vscode-workbench/assets/{dist-TpGpmMGi.js → dist-CXG-u1VB.js} +3 -3
- package/dist/vscode-workbench/assets/fs-core-worker-urls-DZ1nod84.js +1 -0
- package/dist/vscode-workbench/assets/fs-core.worker-Bnmpp6fo.js +1 -0
- package/dist/vscode-workbench/assets/fs-query.worker-cZ-7Fjch.js +2 -0
- package/dist/vscode-workbench/assets/{iconv-lite-umd-C9tiCAJa.js → iconv-lite-umd-Dxx9Qyb4.js} +1 -1
- package/dist/vscode-workbench/assets/{index-DJ1HyMZ7.js → index-6VJMsaWj.js} +475 -475
- package/dist/vscode-workbench/assets/{jschardet-DE1jV513.js → jschardet-Ba3D16vt.js} +1 -1
- package/dist/vscode-workbench/index.html +21 -1
- package/package.json +23 -13
- package/dist/main/services/views/destroy-child-view.d.ts +0 -9
- package/dist/main/services/views/destroy-child-view.js +0 -23
- package/dist/preload/instrumentation/wxml-extract.d.ts +0 -11
- package/dist/preload/instrumentation/wxml-extract.js +0 -382
- package/dist/preload/shared/sid-registry.d.ts +0 -11
- package/dist/preload/shared/sid-registry.js +0 -38
- package/dist/renderer/assets/constants-EAMiwL9_.js +0 -2
- package/dist/renderer/assets/index-BMqyDx71.js +0 -49
- package/dist/renderer/assets/input-CDAEwpBO.js +0 -2
- package/dist/renderer/assets/ipc-transport-B7eFOR68.css +0 -1
- package/dist/renderer/assets/ipc-transport-_G1k5V1p.js +0 -9
- package/dist/renderer/assets/popover-DEdjK14m.js +0 -2
- package/dist/renderer/assets/select-DpKPCh3y.js +0 -2
- package/dist/renderer/assets/settings-M5q2elUr.js +0 -2
- package/dist/renderer/assets/settings-api-CDlZoHiO.js +0 -2
- package/dist/renderer/assets/workbenchSettings-CT_H1WhV.js +0 -8
- package/dist/shared/appdata-accumulator.d.ts +0 -95
- package/dist/shared/appdata-accumulator.js +0 -218
- package/dist/shared/request-core.d.ts +0 -84
- package/dist/shared/request-core.js +0 -168
- package/dist/shared/simulator-api-metadata.d.ts +0 -26
- package/dist/shared/simulator-api-metadata.js +0 -59
- package/dist/shared/vpath.d.ts +0 -42
- package/dist/shared/vpath.js +0 -105
- package/dist/simulator/assets/bridge-channels-zhsumfky.js +0 -2
- package/dist/simulator/assets/device-shell-C-wcFq3Z.js +0 -2
- package/dist/simulator/assets/device-shell-CS1rqAQz.css +0 -1
- package/dist/simulator/assets/jsx-runtime-BDTY6fEq.js +0 -2
- package/dist/simulator/assets/simulator-DU3-fS3v.js +0 -10
- package/dist/simulator/assets/simulator-mini-app-DzfMfnVM.js +0 -2
- package/dist/simulator/device-shell/menu-button-geometry.js +0 -8
- package/dist/vscode-workbench/assets/__vite-browser-external-CXi6Kz9W.js +0 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { nativeImage } from 'electron';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { defaultPreloadPath } from '../utils/paths.js';
|
|
4
|
+
import { createMainWindow } from '../windows/main-window/index.js';
|
|
5
|
+
// eslint-disable-next-line no-restricted-syntax -- grandfathered(workbench-context): shrink-only
|
|
6
|
+
import { createWorkbenchContext } from '../services/workbench-context.js';
|
|
7
|
+
function createConfiguredMainWindow(config, rendererDir, entry, title, autoShow, query) {
|
|
8
|
+
const mainWindow = createMainWindow({
|
|
9
|
+
title,
|
|
10
|
+
indexHtml: path.join(rendererDir, entry),
|
|
11
|
+
query,
|
|
12
|
+
width: config.window?.width,
|
|
13
|
+
height: config.window?.height,
|
|
14
|
+
minWidth: config.window?.minWidth,
|
|
15
|
+
minHeight: config.window?.minHeight,
|
|
16
|
+
autoShow,
|
|
17
|
+
});
|
|
18
|
+
// Set window/taskbar icon if provided (Linux/Windows; macOS uses app bundle icon)
|
|
19
|
+
if (config.icon) {
|
|
20
|
+
const icon = nativeImage.createFromPath(config.icon);
|
|
21
|
+
if (!icon.isEmpty())
|
|
22
|
+
mainWindow.setIcon(icon);
|
|
23
|
+
}
|
|
24
|
+
return mainWindow;
|
|
25
|
+
}
|
|
26
|
+
function createContext(config, mainWindow, rendererDir, appServices) {
|
|
27
|
+
return createWorkbenchContext({
|
|
28
|
+
mainWindow,
|
|
29
|
+
appServices,
|
|
30
|
+
adapter: config.adapter,
|
|
31
|
+
preloadPath: config.preloadPath ?? defaultPreloadPath,
|
|
32
|
+
rendererDir,
|
|
33
|
+
appName: config.appName,
|
|
34
|
+
apiNamespaces: config.apiNamespaces,
|
|
35
|
+
fileTypes: config.fileTypes,
|
|
36
|
+
brandingProvider: config.brandingProvider,
|
|
37
|
+
customCreateProjectDialog: config.customCreateProjectDialog,
|
|
38
|
+
// No cast needed here: the hook receives the project record, so the
|
|
39
|
+
// main-process `Project` the context hands it satisfies the structural
|
|
40
|
+
// `EditableProject` the config declares.
|
|
41
|
+
customEditProjectDialog: config.customEditProjectDialog,
|
|
42
|
+
onBeforeOpenProject: config.onBeforeOpenProject,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
export async function disposeContext(ctx) {
|
|
46
|
+
await ctx.workspace.closeProject();
|
|
47
|
+
await ctx.registry.dispose().catch((err) => {
|
|
48
|
+
console.warn('[workbench] dispose registry encountered errors:', err);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Build a window together with the context that owns it, and publish that
|
|
53
|
+
* context to the router so IPC arriving from this window is answered by it.
|
|
54
|
+
*
|
|
55
|
+
* The router registration is parked on the context's own registry: a window
|
|
56
|
+
* that is torn down must stop claiming senders in the same breath, or a
|
|
57
|
+
* recycled `webContents.id` would resolve to a dead context.
|
|
58
|
+
*/
|
|
59
|
+
function createWindowWithContext(opts, entry, title, autoShow, query) {
|
|
60
|
+
const { config, rendererDir, appServices, router } = opts;
|
|
61
|
+
const window = createConfiguredMainWindow(config, rendererDir, entry, title, autoShow, query);
|
|
62
|
+
const context = createContext(config, window, rendererDir, appServices);
|
|
63
|
+
// Anchor the window's renderer as the first Connection. Resources scoped to
|
|
64
|
+
// that webContents (acquired by later wiring) tear down with it; see
|
|
65
|
+
// packages/electron-deck/docs/foundation.md (teardown paths).
|
|
66
|
+
context.connections.acquire(window.webContents);
|
|
67
|
+
context.registry.add(router.register(context));
|
|
68
|
+
return { window, context, dispose: () => disposeContext(context) };
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The project-list window. It is the application's root window: the app-level
|
|
72
|
+
* IPC surface is registered while it exists, and it stays open for the whole
|
|
73
|
+
* session so workbench windows can come and go around it.
|
|
74
|
+
*/
|
|
75
|
+
export function createLauncherWindow(opts) {
|
|
76
|
+
return createWindowWithContext(opts, 'entries/main/index.html', opts.config.appName ?? 'Dimina DevTools', opts.config.window?.autoShow);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* A workbench window: one open mini-program project, with its own simulator,
|
|
80
|
+
* panels and editor. The project identity travels in the URL query so the
|
|
81
|
+
* renderer entry can mount straight into the project without asking main.
|
|
82
|
+
*/
|
|
83
|
+
export function createWorkbenchWindow(opts, project) {
|
|
84
|
+
return createWindowWithContext(opts, 'entries/workbench/index.html', project.name || opts.config.appName || 'Dimina DevTools',
|
|
85
|
+
// Always hidden: `workbench-window.ts`'s reveal gate is the sole place
|
|
86
|
+
// that ever shows a project window, once BOTH `setupProjectWindow` has
|
|
87
|
+
// resolved and the renderer's own `ready-to-show` has fired. Passing
|
|
88
|
+
// anything but `false` here would let `createMainWindow`'s own
|
|
89
|
+
// `ready-to-show` handler show the window itself and race that gate.
|
|
90
|
+
// `config.projectWindow?.autoShow` is read by the gate instead, not here.
|
|
91
|
+
false, { path: project.path, name: project.name ?? '' });
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=project-window.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { WorkbenchAppInstance } from './app.js';
|
|
2
|
+
import { startAutomationServer } from '../services/automation/index.js';
|
|
3
|
+
import { type McpOpenedProject, type McpProjectTarget } from '../services/mcp/index.js';
|
|
4
|
+
import type { Disposable } from '@dimina-kit/electron-deck/main';
|
|
5
|
+
/**
|
|
6
|
+
* The automation server outlives every window: it binds its port at boot,
|
|
7
|
+
* before any project is open, so it cannot capture a context at start and
|
|
8
|
+
* takes `getContext` instead. What that resolver hands back is only the
|
|
9
|
+
* starting point — each connection pins the first project window it reaches
|
|
10
|
+
* and stays there, so window focus cannot redirect a live client.
|
|
11
|
+
*/
|
|
12
|
+
export declare function setupAutomation(instance: WorkbenchAppInstance, getContext: Parameters<typeof startAutomationServer>[0], senders: Parameters<typeof startAutomationServer>[1]): Promise<Disposable | null>;
|
|
13
|
+
export declare function setupMcp(currentProject: () => McpProjectTarget, openProjectWindow: (project: {
|
|
14
|
+
path: string;
|
|
15
|
+
name: string;
|
|
16
|
+
}) => Promise<McpOpenedProject>): Disposable | null;
|
|
17
|
+
//# sourceMappingURL=servers.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { app } from 'electron';
|
|
2
|
+
import { startAutomationServer } from '../services/automation/index.js';
|
|
3
|
+
import { startMcpServer, } from '../services/mcp/index.js';
|
|
4
|
+
import { loadWorkbenchSettings } from '../services/settings/index.js';
|
|
5
|
+
/** Parse --auto, --auto-port, --project from process.argv. */
|
|
6
|
+
function parseAutoArgs() {
|
|
7
|
+
const argv = process.argv;
|
|
8
|
+
let auto = false;
|
|
9
|
+
let autoPort = 9420;
|
|
10
|
+
let projectPath = '';
|
|
11
|
+
for (let i = 0; i < argv.length; i++) {
|
|
12
|
+
if (argv[i] === 'auto' || argv[i] === '--auto')
|
|
13
|
+
auto = true;
|
|
14
|
+
if ((argv[i] === '--auto-port' || argv[i] === '--auto_port') && argv[i + 1]) {
|
|
15
|
+
const parsed = parseInt(argv[i + 1], 10);
|
|
16
|
+
// 0 → OS-assigned free port (used by parallel e2e workers)
|
|
17
|
+
if (Number.isFinite(parsed) && parsed >= 0)
|
|
18
|
+
autoPort = parsed;
|
|
19
|
+
}
|
|
20
|
+
if (argv[i] === '--project' && argv[i + 1]) {
|
|
21
|
+
projectPath = argv[i + 1];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return { auto, autoPort, projectPath };
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The automation server outlives every window: it binds its port at boot,
|
|
28
|
+
* before any project is open, so it cannot capture a context at start and
|
|
29
|
+
* takes `getContext` instead. What that resolver hands back is only the
|
|
30
|
+
* starting point — each connection pins the first project window it reaches
|
|
31
|
+
* and stays there, so window focus cannot redirect a live client.
|
|
32
|
+
*/
|
|
33
|
+
export async function setupAutomation(instance, getContext, senders) {
|
|
34
|
+
// Start automation server if --auto flag is present
|
|
35
|
+
const autoArgs = parseAutoArgs();
|
|
36
|
+
if (!autoArgs.auto)
|
|
37
|
+
return null;
|
|
38
|
+
const server = await startAutomationServer(getContext, senders, autoArgs.autoPort);
|
|
39
|
+
instance.automationServer = server;
|
|
40
|
+
// Stable, parseable line for e2e harnesses that scrape stdout.
|
|
41
|
+
console.log(`[automation] listening on ws://127.0.0.1:${server.port}`);
|
|
42
|
+
return { dispose: () => server.close() };
|
|
43
|
+
}
|
|
44
|
+
export function setupMcp(currentProject, openProjectWindow) {
|
|
45
|
+
const settings = loadWorkbenchSettings();
|
|
46
|
+
if (!settings.mcp.enabled)
|
|
47
|
+
return null;
|
|
48
|
+
const cdpPortSwitch = app.commandLine.getSwitchValue('remote-debugging-port');
|
|
49
|
+
const cdpPort = cdpPortSwitch ? parseInt(cdpPortSwitch, 10) : settings.cdp.port;
|
|
50
|
+
// Resolved per tool call, not once at boot: the project MCP drives lives in
|
|
51
|
+
// whichever workbench window is active, and that changes as windows open and
|
|
52
|
+
// close. Each call then holds the target it got.
|
|
53
|
+
return startMcpServer(cdpPort, settings.mcp.port, {
|
|
54
|
+
currentProject,
|
|
55
|
+
// A project opens into its own window; the renderer entry mounted there
|
|
56
|
+
// compiles it and attaches the simulator.
|
|
57
|
+
requestOpenInUi: (p) => openProjectWindow(p),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=servers.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ledger of host-registered simulator UI extensions.
|
|
3
|
+
*
|
|
4
|
+
* A registration is app-level — the host makes it once — but an extension can
|
|
5
|
+
* only exist inside a PROJECT window: it mounts into that window's device
|
|
6
|
+
* frame and talks to its simulator renderer. So one registration becomes one
|
|
7
|
+
* live extension per project window, and the ledger is what keeps those copies
|
|
8
|
+
* in step with the windows: every project window that opens gets its own copy,
|
|
9
|
+
* and a copy exists exactly as long as the window that owns it.
|
|
10
|
+
*
|
|
11
|
+
* The project list is deliberately not a target. It runs no bridge router and
|
|
12
|
+
* no simulator, so an extension registered into it could never mount, and
|
|
13
|
+
* `invoke` — which follows the window the user works in — would be answered by
|
|
14
|
+
* that dead copy every time the list window has focus.
|
|
15
|
+
*/
|
|
16
|
+
import { type Disposable } from '@dimina-kit/electron-deck/main';
|
|
17
|
+
import type { SimulatorUiExtensionHandle, SimulatorUiExtensionRegistration } from '../../shared/simulator-ui.js';
|
|
18
|
+
/**
|
|
19
|
+
* The window surface the ledger needs, described structurally so this module
|
|
20
|
+
* does not import WorkbenchContext (see eslint-workbench-context-gate).
|
|
21
|
+
*/
|
|
22
|
+
export interface UiExtensionWindow {
|
|
23
|
+
simulatorUiExtensions: {
|
|
24
|
+
register: (registration: SimulatorUiExtensionRegistration) => SimulatorUiExtensionHandle;
|
|
25
|
+
};
|
|
26
|
+
registry: {
|
|
27
|
+
add: (d: Disposable) => Disposable;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface UiExtensionTargetsDeps<W extends UiExtensionWindow> {
|
|
31
|
+
/** Every open project window, in open order. */
|
|
32
|
+
projectWindows: () => W[];
|
|
33
|
+
/** The project window the user is working in, or null when none is open. */
|
|
34
|
+
activeWindow: () => W | null;
|
|
35
|
+
}
|
|
36
|
+
export interface UiExtensionTargets<W extends UiExtensionWindow> {
|
|
37
|
+
/** Give a freshly opened project window its copy of every registration. */
|
|
38
|
+
attachTo: (window: W) => void;
|
|
39
|
+
register: (registration: SimulatorUiExtensionRegistration) => SimulatorUiExtensionHandle;
|
|
40
|
+
}
|
|
41
|
+
export declare function createUiExtensionTargets<W extends UiExtensionWindow>(deps: UiExtensionTargetsDeps<W>): UiExtensionTargets<W>;
|
|
42
|
+
//# sourceMappingURL=ui-extension-targets.d.ts.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ledger of host-registered simulator UI extensions.
|
|
3
|
+
*
|
|
4
|
+
* A registration is app-level — the host makes it once — but an extension can
|
|
5
|
+
* only exist inside a PROJECT window: it mounts into that window's device
|
|
6
|
+
* frame and talks to its simulator renderer. So one registration becomes one
|
|
7
|
+
* live extension per project window, and the ledger is what keeps those copies
|
|
8
|
+
* in step with the windows: every project window that opens gets its own copy,
|
|
9
|
+
* and a copy exists exactly as long as the window that owns it.
|
|
10
|
+
*
|
|
11
|
+
* The project list is deliberately not a target. It runs no bridge router and
|
|
12
|
+
* no simulator, so an extension registered into it could never mount, and
|
|
13
|
+
* `invoke` — which follows the window the user works in — would be answered by
|
|
14
|
+
* that dead copy every time the list window has focus.
|
|
15
|
+
*/
|
|
16
|
+
import { toDisposable } from '@dimina-kit/electron-deck/main';
|
|
17
|
+
import { assertSimulatorUiExtensionShape } from '../services/simulator/ui-extensions.js';
|
|
18
|
+
export function createUiExtensionTargets(deps) {
|
|
19
|
+
/** Per registration, one target per project window that currently holds it. */
|
|
20
|
+
const ledger = new Map();
|
|
21
|
+
/** Ids currently spoken for app-wide, so a clash is caught where it happens. */
|
|
22
|
+
const ids = new Set();
|
|
23
|
+
function attach(window, targets, registration) {
|
|
24
|
+
const extension = window.simulatorUiExtensions.register(registration);
|
|
25
|
+
// Owned by the window: its registry drives this on close, which both tears
|
|
26
|
+
// the extension down and drops the record. A record left behind would keep
|
|
27
|
+
// a disposed extension reachable as an `invoke` target and would make the
|
|
28
|
+
// ledger grow with every window ever opened.
|
|
29
|
+
const owned = window.registry.add(toDisposable(async () => {
|
|
30
|
+
const index = targets.findIndex((t) => t.extension === extension);
|
|
31
|
+
if (index >= 0)
|
|
32
|
+
targets.splice(index, 1);
|
|
33
|
+
await extension.dispose();
|
|
34
|
+
}));
|
|
35
|
+
targets.push({ window, extension, owned });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A window refusing an extension is a fact about that window: the project
|
|
39
|
+
* still opens, the other windows keep their copies, and windows opened later
|
|
40
|
+
* still get theirs. Letting it escape would turn one bad extension into "no
|
|
41
|
+
* project can be opened any more".
|
|
42
|
+
*/
|
|
43
|
+
function tryAttach(window, targets, registration) {
|
|
44
|
+
try {
|
|
45
|
+
attach(window, targets, registration);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
console.warn(`[simulator-ui] project window did not take extension "${registration.id}":`, error instanceof Error ? error.message : String(error));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
attachTo: (window) => {
|
|
53
|
+
for (const [registration, targets] of ledger)
|
|
54
|
+
tryAttach(window, targets, registration);
|
|
55
|
+
},
|
|
56
|
+
register: (registration) => {
|
|
57
|
+
// Checked here, before anything is recorded: the ledger owns the
|
|
58
|
+
// app-level set of registrations, and hosts register in `onSetup` where
|
|
59
|
+
// there is no project window to do the checking. A rejected registration
|
|
60
|
+
// must leave no record — otherwise it is handed to every project window
|
|
61
|
+
// opened afterwards and takes each of them down as it is built.
|
|
62
|
+
// Snapshotted before anything reads it: the ledger outlives this call and
|
|
63
|
+
// hands the registration to every project window opened later, so a host
|
|
64
|
+
// that reuses its object to describe the next extension would otherwise
|
|
65
|
+
// rewrite what an already-registered one means — the id it releases, and
|
|
66
|
+
// the extension future windows are given.
|
|
67
|
+
const snapshot = { ...registration };
|
|
68
|
+
assertSimulatorUiExtensionShape(snapshot);
|
|
69
|
+
const id = snapshot.id;
|
|
70
|
+
if (ids.has(id)) {
|
|
71
|
+
throw new Error(`Simulator UI extension "${id}" is already registered`);
|
|
72
|
+
}
|
|
73
|
+
const targets = [];
|
|
74
|
+
ids.add(id);
|
|
75
|
+
ledger.set(snapshot, targets);
|
|
76
|
+
for (const window of deps.projectWindows())
|
|
77
|
+
tryAttach(window, targets, snapshot);
|
|
78
|
+
return {
|
|
79
|
+
dispose: () => {
|
|
80
|
+
// Only while this registration is the one holding the id: a second
|
|
81
|
+
// dispose must not free an id a later registration now owns.
|
|
82
|
+
if (!ledger.delete(snapshot))
|
|
83
|
+
return;
|
|
84
|
+
ids.delete(id);
|
|
85
|
+
// Copied: disposing a window-owned record splices it out of `targets`.
|
|
86
|
+
for (const target of [...targets])
|
|
87
|
+
void target.owned.dispose();
|
|
88
|
+
targets.length = 0;
|
|
89
|
+
},
|
|
90
|
+
invoke: (method, params) => {
|
|
91
|
+
const active = deps.activeWindow();
|
|
92
|
+
const target = targets.find((t) => t.window === active) ?? targets[targets.length - 1];
|
|
93
|
+
if (!target)
|
|
94
|
+
throw new Error('simulator UI extension has no live window');
|
|
95
|
+
return target.extension.invoke(method, params);
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=ui-extension-targets.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export { stubs, devkitStubs } from '../runtime/devtools-runtime-mock.harness.js';
|
|
2
|
+
/**
|
|
3
|
+
* Shared per-test setup: reset modules (fresh module-level state each test),
|
|
4
|
+
* reset the mock harness above, and dynamically re-import `electron` +
|
|
5
|
+
* `createDevtoolsRuntime` + the lifecycle flag — dynamic, not a static
|
|
6
|
+
* top-level import, because it must happen AFTER `vi.resetModules()` picks
|
|
7
|
+
* up a fresh module instance each test. Registers its own `beforeEach`; call
|
|
8
|
+
* once per describing test file.
|
|
9
|
+
*/
|
|
10
|
+
export interface RuntimeTestState {
|
|
11
|
+
createDevtoolsRuntime: typeof import('./app.js').createDevtoolsRuntime;
|
|
12
|
+
registerAppLifecycle: typeof import('./lifecycle.js').registerAppLifecycle;
|
|
13
|
+
isAppQuitting: typeof import('./lifecycle.js').isAppQuitting;
|
|
14
|
+
electron: typeof import('electron');
|
|
15
|
+
}
|
|
16
|
+
export declare function registerRuntimeTestLifecycle(): RuntimeTestState;
|
|
17
|
+
/**
|
|
18
|
+
* Registers `projectDir` as an openable project (app.json present, empty
|
|
19
|
+
* projects list) and opens it in its own window via the real
|
|
20
|
+
* `openProjectWindow`. Does NOT open a devkit session — the close guards
|
|
21
|
+
* under test branch on window-list membership, not session state (teardown
|
|
22
|
+
* is unconditional; see workbench-window.ts's `wireWorkbenchWindowEvents`
|
|
23
|
+
* doc comment), so a session adds cost without adding coverage here.
|
|
24
|
+
*/
|
|
25
|
+
export declare function openProjectWindow(instance: Awaited<ReturnType<typeof import('./app.js').createDevtoolsRuntime>>, projectDir: string): Promise<ReturnType<Awaited<ReturnType<typeof import('./app.js').createDevtoolsRuntime>>['projectWindows']>[number]>;
|
|
26
|
+
/** A fresh Electron-shaped close event, plus a getter for whether it was prevented. */
|
|
27
|
+
export declare function makeCloseEvent(): {
|
|
28
|
+
event: {
|
|
29
|
+
preventDefault: () => void;
|
|
30
|
+
};
|
|
31
|
+
prevented: () => boolean;
|
|
32
|
+
};
|
|
33
|
+
export declare function emitClose(win: unknown, event: unknown): void;
|
|
34
|
+
//# sourceMappingURL=window-close-reveal.harness.d.ts.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared vitest mock harness for the list/workbench-window close-guard test
|
|
3
|
+
* files (`main-window-close-guard.test.ts`, `workbench-window-reveal-on-
|
|
4
|
+
* close.test.ts`, and siblings) — all drive the REAL `createDevtoolsRuntime`
|
|
5
|
+
* against the electron/fs/`@dimina-kit/devkit` mock set defined in
|
|
6
|
+
* `../runtime/devtools-runtime-mock.harness.ts`, plus the runtime-lifecycle
|
|
7
|
+
* and window-opening helpers below that those tests need in common.
|
|
8
|
+
*
|
|
9
|
+
* `vi.mock(...)` calls in the imported core module run once per importing
|
|
10
|
+
* test file's own isolated module graph (vitest scopes mocking per test
|
|
11
|
+
* file); chaining through this module has the same effect as if they were
|
|
12
|
+
* written directly in the importing file.
|
|
13
|
+
*/
|
|
14
|
+
import { beforeEach, vi } from 'vitest';
|
|
15
|
+
import { stubs, devkitStubs } from '../runtime/devtools-runtime-mock.harness.js';
|
|
16
|
+
export { stubs, devkitStubs } from '../runtime/devtools-runtime-mock.harness.js';
|
|
17
|
+
export function registerRuntimeTestLifecycle() {
|
|
18
|
+
const state = {};
|
|
19
|
+
beforeEach(async () => {
|
|
20
|
+
vi.resetModules();
|
|
21
|
+
stubs.reset();
|
|
22
|
+
devkitStubs.sessionClose.mockClear();
|
|
23
|
+
state.electron = await import('electron');
|
|
24
|
+
({ createDevtoolsRuntime: state.createDevtoolsRuntime } = await import('./app.js'));
|
|
25
|
+
({ registerAppLifecycle: state.registerAppLifecycle, isAppQuitting: state.isAppQuitting } =
|
|
26
|
+
await import('./lifecycle.js'));
|
|
27
|
+
});
|
|
28
|
+
return state;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Registers `projectDir` as an openable project (app.json present, empty
|
|
32
|
+
* projects list) and opens it in its own window via the real
|
|
33
|
+
* `openProjectWindow`. Does NOT open a devkit session — the close guards
|
|
34
|
+
* under test branch on window-list membership, not session state (teardown
|
|
35
|
+
* is unconditional; see workbench-window.ts's `wireWorkbenchWindowEvents`
|
|
36
|
+
* doc comment), so a session adds cost without adding coverage here.
|
|
37
|
+
*/
|
|
38
|
+
export async function openProjectWindow(instance, projectDir) {
|
|
39
|
+
stubs.projectsWithAppJson.add(projectDir);
|
|
40
|
+
if (stubs.getProjectsJson() === null)
|
|
41
|
+
stubs.setProjectsJson(JSON.stringify([]));
|
|
42
|
+
await instance.openProjectWindow({ path: projectDir });
|
|
43
|
+
// The manager keys its window map by project path and this helper always
|
|
44
|
+
// opens a path it just registered, so the newest entry is the one that was
|
|
45
|
+
// asked for. Matching on anything weaker (e.g. "the first window that isn't
|
|
46
|
+
// the list window") hands back the PREVIOUSLY opened project once a second
|
|
47
|
+
// one is open, which is exactly the multi-window case these tests exist for.
|
|
48
|
+
const found = instance.projectWindows().at(-1);
|
|
49
|
+
if (!found)
|
|
50
|
+
throw new Error(`openProjectWindow(${projectDir}) did not publish a window`);
|
|
51
|
+
return found;
|
|
52
|
+
}
|
|
53
|
+
/** A fresh Electron-shaped close event, plus a getter for whether it was prevented. */
|
|
54
|
+
export function makeCloseEvent() {
|
|
55
|
+
let count = 0;
|
|
56
|
+
return {
|
|
57
|
+
event: { preventDefault: () => { count += 1; } },
|
|
58
|
+
prevented: () => count > 0,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export function emitClose(win, event) {
|
|
62
|
+
;
|
|
63
|
+
win.emit('close', event);
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=window-close-reveal.harness.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BrowserWindow } from 'electron';
|
|
2
|
+
import { type Disposable } from '@dimina-kit/electron-deck/main';
|
|
3
|
+
/**
|
|
4
|
+
* Bring `win` back in front of the user from any hidden or minimized state.
|
|
5
|
+
*
|
|
6
|
+
* The project-list window hides instead of closing while projects are open —
|
|
7
|
+
* it owns app-level IPC that cannot be registered a second time, so it must
|
|
8
|
+
* outlive its own close button — which makes "show the project list" a real
|
|
9
|
+
* operation with several entry points (the menu, a macOS dock activate, the
|
|
10
|
+
* last project window closing). They all go through here so none of them can
|
|
11
|
+
* drift into handling only some of the hidden states.
|
|
12
|
+
*/
|
|
13
|
+
export declare function revealWindow(win: BrowserWindow): void;
|
|
14
|
+
export declare function enableDevRendererAutoReload(rendererDir: string): Disposable;
|
|
15
|
+
//# sourceMappingURL=window-events.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { app, BrowserWindow } from 'electron';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import { toDisposable } from '@dimina-kit/electron-deck/main';
|
|
4
|
+
/**
|
|
5
|
+
* Bring `win` back in front of the user from any hidden or minimized state.
|
|
6
|
+
*
|
|
7
|
+
* The project-list window hides instead of closing while projects are open —
|
|
8
|
+
* it owns app-level IPC that cannot be registered a second time, so it must
|
|
9
|
+
* outlive its own close button — which makes "show the project list" a real
|
|
10
|
+
* operation with several entry points (the menu, a macOS dock activate, the
|
|
11
|
+
* last project window closing). They all go through here so none of them can
|
|
12
|
+
* drift into handling only some of the hidden states.
|
|
13
|
+
*/
|
|
14
|
+
export function revealWindow(win) {
|
|
15
|
+
if (win.isDestroyed())
|
|
16
|
+
return;
|
|
17
|
+
if (win.isMinimized())
|
|
18
|
+
win.restore();
|
|
19
|
+
win.show();
|
|
20
|
+
win.focus();
|
|
21
|
+
}
|
|
22
|
+
export function enableDevRendererAutoReload(rendererDir) {
|
|
23
|
+
// Auto-reload renderer windows when dist files change during development
|
|
24
|
+
if (app.isPackaged) {
|
|
25
|
+
return toDisposable(() => { });
|
|
26
|
+
}
|
|
27
|
+
let reloadTimer = null;
|
|
28
|
+
const watcher = fs.watch(rendererDir, { recursive: true }, () => {
|
|
29
|
+
if (reloadTimer)
|
|
30
|
+
clearTimeout(reloadTimer);
|
|
31
|
+
reloadTimer = setTimeout(() => {
|
|
32
|
+
for (const win of BrowserWindow.getAllWindows()) {
|
|
33
|
+
win.webContents.reload();
|
|
34
|
+
}
|
|
35
|
+
}, 300);
|
|
36
|
+
});
|
|
37
|
+
return toDisposable(() => {
|
|
38
|
+
if (reloadTimer) {
|
|
39
|
+
clearTimeout(reloadTimer);
|
|
40
|
+
reloadTimer = null;
|
|
41
|
+
}
|
|
42
|
+
watcher.close();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=window-events.js.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { BrowserWindow } from "electron";
|
|
2
|
+
import type { ConnectionRegistry, DisposableRegistry } from "@dimina-kit/electron-deck/main";
|
|
3
|
+
import type { SyncStorageChange } from "../../shared/ipc-channels.js";
|
|
4
|
+
import type { SenderPolicy } from "../utils/ipc-registry.js";
|
|
5
|
+
import type { BridgeRouterHandle } from "../ipc/bridge-router.js";
|
|
6
|
+
import type { CdpSessionBroker } from "../services/cdp-session/index.js";
|
|
7
|
+
import type { InternalDevtoolsWindow } from "../windows/internal-devtools-window/index.js";
|
|
8
|
+
import type { NetworkForwarder } from "../services/network-forward/index.js";
|
|
9
|
+
import type { AppDataTap } from "../services/simulator-appdata/index.js";
|
|
10
|
+
import type { StorageApi } from "../services/simulator-storage/index.js";
|
|
11
|
+
import type { WorkspaceService } from "../services/workspace/workspace-service.js";
|
|
12
|
+
/**
|
|
13
|
+
* Narrow view of the context fields these services read, plus the four fields
|
|
14
|
+
* they publish back onto it for bridge-router to consume.
|
|
15
|
+
*/
|
|
16
|
+
export interface WindowRuntimeContext {
|
|
17
|
+
registry: DisposableRegistry;
|
|
18
|
+
connections: ConnectionRegistry;
|
|
19
|
+
cdpSessionBroker: CdpSessionBroker;
|
|
20
|
+
senderPolicy: SenderPolicy;
|
|
21
|
+
workspace: WorkspaceService;
|
|
22
|
+
bridge?: BridgeRouterHandle;
|
|
23
|
+
internalDevtoolsWindow?: InternalDevtoolsWindow;
|
|
24
|
+
storageApi?: StorageApi;
|
|
25
|
+
onServiceStorageChanged?: (appId: string, change: SyncStorageChange) => void;
|
|
26
|
+
networkForward?: NetworkForwarder;
|
|
27
|
+
appData?: AppDataTap;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Resolve the active project's appId. Shared by the storage panel filter, the
|
|
31
|
+
* native-host WXML/element-inspect services (which scope the active render
|
|
32
|
+
* guest by appId) and the editor's per-project workspace identity.
|
|
33
|
+
*/
|
|
34
|
+
export declare function createActiveAppIdResolver(context: Pick<WindowRuntimeContext, "workspace">): () => string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Panel-backing services that push into one window's renderer: storage, and
|
|
37
|
+
* under native-host the MCP target tracking plus the WXML / AppData /
|
|
38
|
+
* current-page streams.
|
|
39
|
+
*/
|
|
40
|
+
export declare function setupWindowRuntimeServices(context: WindowRuntimeContext, mainWindow: BrowserWindow, getActiveAppId: () => string | null, projectPath: string): void;
|
|
41
|
+
//# sourceMappingURL=window-runtime-services.d.ts.map
|