@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,5 @@
|
|
|
1
|
+
/** Body caches own simulator-CDP and main-process HTTP ids, never native backend ids. */
|
|
2
|
+
export declare const VIRTUAL_REQUEST_ID_PREFIX = "dimina:sim:";
|
|
3
|
+
export declare const NATIVE_HTTP_REQUEST_ID_PREFIX = "dimina:http:";
|
|
4
|
+
export declare const BODY_REQUEST_ID_PREFIXES: readonly ["dimina:sim:", "dimina:http:"];
|
|
5
|
+
//# sourceMappingURL=request-ids.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Body caches own simulator-CDP and main-process HTTP ids, never native backend ids. */
|
|
2
|
+
export const VIRTUAL_REQUEST_ID_PREFIX = 'dimina:sim:';
|
|
3
|
+
export const NATIVE_HTTP_REQUEST_ID_PREFIX = 'dimina:http:';
|
|
4
|
+
export const BODY_REQUEST_ID_PREFIXES = [VIRTUAL_REQUEST_ID_PREFIX, NATIVE_HTTP_REQUEST_ID_PREFIX];
|
|
5
|
+
//# sourceMappingURL=request-ids.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Judges whether a captured network request belongs on the user-facing
|
|
3
|
+
* (right-panel) DevTools Network tab, or should be hidden there — a
|
|
4
|
+
* framework/host-internal resource load, visible only in the standalone
|
|
5
|
+
* internal DevTools window's unfiltered global mirror.
|
|
6
|
+
*
|
|
7
|
+
* Single source of truth for the split (network-forward's user-facing sink
|
|
8
|
+
* and the global mirror both key off this): scheme must be one of
|
|
9
|
+
* http/https/ws/wss, AND the request's origin must not match ANY of
|
|
10
|
+
* `internalOrigins` — each is a base URL of a server this app itself runs
|
|
11
|
+
* whose own traffic is host-internal, not the developer's business traffic.
|
|
12
|
+
* There are currently two: the resource server (serves the compiled
|
|
13
|
+
* mini-app bundle) and the simulator's own static-asset server (serves
|
|
14
|
+
* `simulator.html` + its JS/CSS — a THIRD-PARTY-to-the-user-code origin the
|
|
15
|
+
* `attachSimulator` CDP session also observes, since it captures the whole
|
|
16
|
+
* simulator WebContentsView's network activity, not just the mini-app's own
|
|
17
|
+
* `wx.request` calls). `null`/`undefined` entries (a server not currently
|
|
18
|
+
* running, e.g. no project open) are skipped, not treated as a match.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isUserFacingRequest(url: string, internalOrigins?: ReadonlyArray<string | null | undefined>): boolean;
|
|
21
|
+
//# sourceMappingURL=user-facing.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** URL schemes that can carry the mini-app author's own business traffic. */
|
|
2
|
+
const USER_FACING_SCHEMES = new Set(['http:', 'https:', 'ws:', 'wss:']);
|
|
3
|
+
/**
|
|
4
|
+
* Judges whether a captured network request belongs on the user-facing
|
|
5
|
+
* (right-panel) DevTools Network tab, or should be hidden there — a
|
|
6
|
+
* framework/host-internal resource load, visible only in the standalone
|
|
7
|
+
* internal DevTools window's unfiltered global mirror.
|
|
8
|
+
*
|
|
9
|
+
* Single source of truth for the split (network-forward's user-facing sink
|
|
10
|
+
* and the global mirror both key off this): scheme must be one of
|
|
11
|
+
* http/https/ws/wss, AND the request's origin must not match ANY of
|
|
12
|
+
* `internalOrigins` — each is a base URL of a server this app itself runs
|
|
13
|
+
* whose own traffic is host-internal, not the developer's business traffic.
|
|
14
|
+
* There are currently two: the resource server (serves the compiled
|
|
15
|
+
* mini-app bundle) and the simulator's own static-asset server (serves
|
|
16
|
+
* `simulator.html` + its JS/CSS — a THIRD-PARTY-to-the-user-code origin the
|
|
17
|
+
* `attachSimulator` CDP session also observes, since it captures the whole
|
|
18
|
+
* simulator WebContentsView's network activity, not just the mini-app's own
|
|
19
|
+
* `wx.request` calls). `null`/`undefined` entries (a server not currently
|
|
20
|
+
* running, e.g. no project open) are skipped, not treated as a match.
|
|
21
|
+
*/
|
|
22
|
+
export function isUserFacingRequest(url, internalOrigins) {
|
|
23
|
+
let parsed;
|
|
24
|
+
try {
|
|
25
|
+
parsed = new URL(url);
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
// Real CDP `Network.requestWillBeSent.request.url` is always a fully
|
|
29
|
+
// qualified URL — this only happens for hand-authored test/placeholder
|
|
30
|
+
// input. Fail OPEN (treat as user-facing): hiding a request the caller
|
|
31
|
+
// couldn't even classify risks silently swallowing real business
|
|
32
|
+
// traffic, a worse outcome than occasionally over-showing something.
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
if (!USER_FACING_SCHEMES.has(parsed.protocol))
|
|
36
|
+
return false;
|
|
37
|
+
for (const baseUrl of internalOrigins ?? []) {
|
|
38
|
+
if (!baseUrl)
|
|
39
|
+
continue;
|
|
40
|
+
try {
|
|
41
|
+
if (parsed.origin === new URL(baseUrl).origin)
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// Malformed baseUrl — can't compare, so don't let it hide anything.
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=user-facing.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { NativeWebSocketTrace } from '../../ipc/bridge-router.js';
|
|
2
|
+
/** One CDP message ready for `DevToolsAPI.dispatchMessage` injection. */
|
|
3
|
+
export interface SynthesizedWebSocketMessage {
|
|
4
|
+
method: string;
|
|
5
|
+
params: unknown;
|
|
6
|
+
/**
|
|
7
|
+
* The verdict `isUserFacingRequest` produced for this socket's url at
|
|
8
|
+
* `created` time, cached for the socket's whole lifetime — every later
|
|
9
|
+
* event reuses it (they carry no url of their own). The user-facing sink
|
|
10
|
+
* gates on this; the global mirror ignores it.
|
|
11
|
+
*/
|
|
12
|
+
userFacing: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface WebSocketSynthesizerOptions {
|
|
15
|
+
/** Per-forwarder instance tag keeping virtual ids collision-free. */
|
|
16
|
+
epoch: string;
|
|
17
|
+
/**
|
|
18
|
+
* Origins the app itself serves (resource server / simulator shell), the
|
|
19
|
+
* same inputs `resolveUserFacing` feeds `isUserFacingRequest` for HTTP
|
|
20
|
+
* capture. Re-read at each `created`.
|
|
21
|
+
*/
|
|
22
|
+
internalOrigins?: () => ReadonlyArray<string | null | undefined>;
|
|
23
|
+
}
|
|
24
|
+
export declare class WebSocketTraceSynthesizer {
|
|
25
|
+
private readonly options;
|
|
26
|
+
private readonly sockets;
|
|
27
|
+
private seq;
|
|
28
|
+
constructor(options: WebSocketSynthesizerOptions);
|
|
29
|
+
/**
|
|
30
|
+
* Map one trace event to its CDP message, or null when the event must be
|
|
31
|
+
* dropped (a non-`created` event for a socketId this synthesizer never saw
|
|
32
|
+
* created — defensive against out-of-order delivery).
|
|
33
|
+
*/
|
|
34
|
+
synthesize(sessionId: string, event: NativeWebSocketTrace): SynthesizedWebSocketMessage | null;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=websocket.d.ts.map
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Synthesize Chrome DevTools Protocol `Network.webSocket*` messages from the
|
|
3
|
+
* main-process WebSocket trace stream (see electron-runtime
|
|
4
|
+
* `native-websocket/trace.ts`).
|
|
5
|
+
*
|
|
6
|
+
* Why this exists: `wx.connectSocket` sockets live on the Node `ws` transport
|
|
7
|
+
* in the MAIN process — no `webContents.debugger` can observe them — so the
|
|
8
|
+
* embedded DevTools Network tab would never show them. The trace stream gives
|
|
9
|
+
* one ordered fact per lifecycle moment; this module re-shapes each fact into
|
|
10
|
+
* the exact CDP event the DevTools front-end already renders natively
|
|
11
|
+
* (`webSocketCreated` creates the row, handshake events fill it, frames land
|
|
12
|
+
* in the Messages view, `webSocketClosed` settles it).
|
|
13
|
+
*
|
|
14
|
+
* Ordering contract this module relies on (guaranteed by the trace layer):
|
|
15
|
+
* `created` strictly precedes every other event for its socketId, and exactly
|
|
16
|
+
* one `closed` terminates each created socket. The front-end silently drops
|
|
17
|
+
* frame/closed events for an unknown requestId, so this module mirrors that
|
|
18
|
+
* discipline defensively: any non-created event for an unknown socketId is
|
|
19
|
+
* dropped rather than synthesized.
|
|
20
|
+
*
|
|
21
|
+
* Pure and self-contained (no Electron imports) so it is unit-testable.
|
|
22
|
+
*/
|
|
23
|
+
import { isUserFacingRequest } from './user-facing.js';
|
|
24
|
+
export class WebSocketTraceSynthesizer {
|
|
25
|
+
options;
|
|
26
|
+
sockets = new Map();
|
|
27
|
+
seq = 0;
|
|
28
|
+
constructor(options) {
|
|
29
|
+
this.options = options;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Map one trace event to its CDP message, or null when the event must be
|
|
33
|
+
* dropped (a non-`created` event for a socketId this synthesizer never saw
|
|
34
|
+
* created — defensive against out-of-order delivery).
|
|
35
|
+
*/
|
|
36
|
+
synthesize(sessionId, event) {
|
|
37
|
+
const key = `${sessionId} ${event.socketId}`;
|
|
38
|
+
if (event.type === 'created') {
|
|
39
|
+
const requestId = `dimina:ws:${this.options.epoch}:${this.seq++}`;
|
|
40
|
+
const userFacing = isUserFacingRequest(event.url, this.options.internalOrigins?.());
|
|
41
|
+
this.sockets.set(key, { requestId, userFacing });
|
|
42
|
+
return {
|
|
43
|
+
method: 'Network.webSocketCreated',
|
|
44
|
+
params: { requestId, url: event.url },
|
|
45
|
+
userFacing,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const state = this.sockets.get(key);
|
|
49
|
+
if (!state)
|
|
50
|
+
return null;
|
|
51
|
+
const { requestId, userFacing } = state;
|
|
52
|
+
const timestamp = event.time / 1000;
|
|
53
|
+
switch (event.type) {
|
|
54
|
+
case 'handshake-request':
|
|
55
|
+
return {
|
|
56
|
+
method: 'Network.webSocketWillSendHandshakeRequest',
|
|
57
|
+
params: {
|
|
58
|
+
requestId,
|
|
59
|
+
timestamp,
|
|
60
|
+
wallTime: timestamp,
|
|
61
|
+
request: { headers: event.headers },
|
|
62
|
+
},
|
|
63
|
+
userFacing,
|
|
64
|
+
};
|
|
65
|
+
case 'handshake-response':
|
|
66
|
+
return {
|
|
67
|
+
method: 'Network.webSocketHandshakeResponseReceived',
|
|
68
|
+
params: {
|
|
69
|
+
requestId,
|
|
70
|
+
timestamp,
|
|
71
|
+
wallTime: timestamp,
|
|
72
|
+
response: {
|
|
73
|
+
status: event.status,
|
|
74
|
+
statusText: event.statusText,
|
|
75
|
+
headers: event.headers,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
userFacing,
|
|
79
|
+
};
|
|
80
|
+
case 'frame-sent':
|
|
81
|
+
return {
|
|
82
|
+
method: 'Network.webSocketFrameSent',
|
|
83
|
+
params: { requestId, timestamp, response: frame(event, true) },
|
|
84
|
+
userFacing,
|
|
85
|
+
};
|
|
86
|
+
case 'frame-received':
|
|
87
|
+
return {
|
|
88
|
+
method: 'Network.webSocketFrameReceived',
|
|
89
|
+
params: { requestId, timestamp, response: frame(event, false) },
|
|
90
|
+
userFacing,
|
|
91
|
+
};
|
|
92
|
+
case 'frame-error':
|
|
93
|
+
return {
|
|
94
|
+
method: 'Network.webSocketFrameError',
|
|
95
|
+
params: { requestId, timestamp, errorMessage: event.errorMessage },
|
|
96
|
+
userFacing,
|
|
97
|
+
};
|
|
98
|
+
case 'closed':
|
|
99
|
+
// Terminal: release the id mapping so a long session can't grow it.
|
|
100
|
+
this.sockets.delete(key);
|
|
101
|
+
return {
|
|
102
|
+
method: 'Network.webSocketClosed',
|
|
103
|
+
params: { requestId, timestamp },
|
|
104
|
+
userFacing,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/** CDP `Network.WebSocketFrame`: client-sent frames are masked, received are not. */
|
|
110
|
+
function frame(event, mask) {
|
|
111
|
+
const result = {
|
|
112
|
+
opcode: event.opcode,
|
|
113
|
+
mask,
|
|
114
|
+
payloadData: event.payloadData,
|
|
115
|
+
};
|
|
116
|
+
if (event.base64Encoded)
|
|
117
|
+
result.base64Encoded = true;
|
|
118
|
+
return result;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=websocket.js.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { BrowserWindow, WebContents, WebContentsView } from 'electron';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CompileModeChange } from '../workspace/compile-mode-store.js';
|
|
3
3
|
import { type EditorOpenFilePayload } from '../../../shared/ipc-channels.js';
|
|
4
4
|
import type { WorkbenchSettings } from '../settings/index.js';
|
|
5
|
-
import type { ProjectSettings } from '../projects/project-repository.js';
|
|
5
|
+
import type { ProjectSettings, ProjectType } from '../projects/project-repository.js';
|
|
6
|
+
import type { UpdateInfo } from '../../../shared/types.js';
|
|
6
7
|
/**
|
|
7
8
|
* Payload for the `project:status` event sent whenever compile status changes.
|
|
8
9
|
*/
|
|
@@ -64,7 +65,6 @@ export interface CompileLogPayload {
|
|
|
64
65
|
*/
|
|
65
66
|
export interface SettingsInitPayload {
|
|
66
67
|
projectPath: string;
|
|
67
|
-
config: CompileConfig;
|
|
68
68
|
projectSettings: ProjectSettings;
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
@@ -94,28 +94,90 @@ export interface RendererNotifier {
|
|
|
94
94
|
compileLog(payload: CompileLogPayload): void;
|
|
95
95
|
/** Ask the main renderer to navigate back to its landing screen. */
|
|
96
96
|
windowNavigateBack(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Ask the main renderer to open a project (mount the project runtime and
|
|
99
|
+
* start the compile), exactly as if the user clicked it in the list. The
|
|
100
|
+
* renderer owns the open path — the simulator only mounts when the
|
|
101
|
+
* ProjectRuntime component does — so main-side callers (MCP `project_open`)
|
|
102
|
+
* push this instead of calling `workspace.openProject` directly.
|
|
103
|
+
*/
|
|
104
|
+
windowOpenProject(payload: {
|
|
105
|
+
name: string;
|
|
106
|
+
path: string;
|
|
107
|
+
}): void;
|
|
97
108
|
/** Tell the main renderer the compile popover has been closed. */
|
|
98
109
|
popoverClosed(): void;
|
|
99
|
-
/**
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
/**
|
|
111
|
+
* Push the open project's `CompileModeStore` after it advanced — via the
|
|
112
|
+
* popover or any other command source. `relaunch` is true when the change
|
|
113
|
+
* affects what is currently running, so the renderer restarts the
|
|
114
|
+
* simulator with it.
|
|
115
|
+
*/
|
|
116
|
+
compileModesChanged(change: CompileModeChange): void;
|
|
117
|
+
/**
|
|
118
|
+
* Push a rejected `applyCompileModeCommand` (e.g. a failed persist). The
|
|
119
|
+
* renderer surfaces this as a compile-status error without touching its
|
|
120
|
+
* mirrored `compileModes`.
|
|
121
|
+
*/
|
|
122
|
+
compileModesApplyFailed(payload: {
|
|
123
|
+
message: string;
|
|
124
|
+
}): void;
|
|
105
125
|
/**
|
|
106
126
|
* Push the reserved host-toolbar height to the main renderer so its toolbar
|
|
107
127
|
* placeholder div resizes (closes the host-toolbar dynamic-height loop).
|
|
108
128
|
*/
|
|
109
129
|
hostToolbarHeightChanged(height: number): void;
|
|
130
|
+
/**
|
|
131
|
+
* Push the reserved host-sidebar width to the main renderer so its sidebar
|
|
132
|
+
* placeholder div resizes, mirroring `hostToolbarHeightChanged` on the
|
|
133
|
+
* inline axis.
|
|
134
|
+
*/
|
|
135
|
+
hostSidebarWidthChanged(width: number): void;
|
|
136
|
+
/**
|
|
137
|
+
* Push the project category selected in the host-sidebar's content to the
|
|
138
|
+
* main renderer so `ProjectListScreen` filters `ProjectList` accordingly.
|
|
139
|
+
*/
|
|
140
|
+
hostSidebarCategorySelected(category: ProjectType): void;
|
|
110
141
|
/**
|
|
111
142
|
* Ask the main renderer's Monaco editor to open a project file at a position.
|
|
112
143
|
* Drives the "click a console file link → open in editor" pipeline.
|
|
113
144
|
*/
|
|
114
145
|
editorOpenFile(payload: EditorOpenFilePayload): void;
|
|
146
|
+
/**
|
|
147
|
+
* Relay a project-create-dialog submission from the overlay panel back to
|
|
148
|
+
* the main renderer, which owns the scaffold flow (createProject + list
|
|
149
|
+
* refresh) — the panel only collects the form and hands it off.
|
|
150
|
+
*/
|
|
151
|
+
projectCreateSubmitted(payload: {
|
|
152
|
+
name: string;
|
|
153
|
+
path: string;
|
|
154
|
+
templateId: string;
|
|
155
|
+
}): void;
|
|
156
|
+
/**
|
|
157
|
+
* Relay the device picked in the device-picker overlay back to the main
|
|
158
|
+
* renderer, whose simulator toolbar owns the device state — the panel only
|
|
159
|
+
* renders the list.
|
|
160
|
+
*/
|
|
161
|
+
devicePickerSelected(payload: {
|
|
162
|
+
deviceName: string;
|
|
163
|
+
}): void;
|
|
115
164
|
/** Initialise the currently shown compile popover overlay. */
|
|
116
165
|
popoverInit(popoverView: WebContentsView, payload: unknown): void;
|
|
117
166
|
/** Initialise the currently shown settings overlay (no-op if hidden). */
|
|
118
167
|
settingsInit(payload: SettingsInitPayload): void;
|
|
168
|
+
/** Push the label text (+ anchor) into the tooltip overlay's own renderer. */
|
|
169
|
+
tooltipInit(tooltipView: WebContentsView, payload: unknown): void;
|
|
170
|
+
/** Push the template catalog + base-dir defaults into the project-create overlay. */
|
|
171
|
+
projectCreateInit(dialogView: WebContentsView, payload: {
|
|
172
|
+
templates: unknown[];
|
|
173
|
+
defaultBaseDir: string;
|
|
174
|
+
}): void;
|
|
175
|
+
/** Push a discovered update's info into the update overlay. */
|
|
176
|
+
updateAvailable(dialogView: WebContentsView, payload: UpdateInfo): void;
|
|
177
|
+
/** Push the currently selected device into the device-picker overlay. */
|
|
178
|
+
devicePickerInit(pickerView: WebContentsView, payload: {
|
|
179
|
+
deviceName: string;
|
|
180
|
+
}): void;
|
|
119
181
|
/** Initialise the standalone workbench-settings window. */
|
|
120
182
|
workbenchSettingsInit(window: BrowserWindow, payload: WorkbenchSettingsInitPayload): void;
|
|
121
183
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ProjectChannel, SessionChannel, WindowChannel,
|
|
1
|
+
import { ProjectChannel, SessionChannel, WindowChannel, WorkbenchSettingsChannel, EditorChannel, } from '../../../shared/ipc-channels.js';
|
|
2
|
+
import { SettingsChannel, PopoverChannel, TooltipChannel, ProjectCreateChannel, DevicePickerChannel, UpdateChannel, ViewChannel, } from '../../../shared/ipc-channels-overlays.js';
|
|
2
3
|
/** Safely resolve a WebContents, skipping destroyed / missing targets. */
|
|
3
4
|
function liveWebContents(wc) {
|
|
4
5
|
if (!wc)
|
|
@@ -33,30 +34,66 @@ export function createRendererNotifier(ctx) {
|
|
|
33
34
|
windowNavigateBack() {
|
|
34
35
|
sendToMain(WindowChannel.NavigateBack);
|
|
35
36
|
},
|
|
37
|
+
windowOpenProject(payload) {
|
|
38
|
+
sendToMain(WindowChannel.OpenProject, payload);
|
|
39
|
+
},
|
|
36
40
|
popoverClosed() {
|
|
37
41
|
sendToMain(PopoverChannel.Closed);
|
|
38
42
|
},
|
|
39
|
-
|
|
40
|
-
sendToMain(
|
|
41
|
-
},
|
|
42
|
-
popoverSwitchLaunchConfig(id) {
|
|
43
|
-
sendToMain(PopoverChannel.SwitchLaunchConfig, id);
|
|
43
|
+
compileModesChanged(change) {
|
|
44
|
+
sendToMain(ProjectChannel.CompileModesChanged, change);
|
|
44
45
|
},
|
|
45
|
-
|
|
46
|
-
sendToMain(
|
|
46
|
+
compileModesApplyFailed(payload) {
|
|
47
|
+
sendToMain(ProjectChannel.CompileModesApplyFailed, payload);
|
|
47
48
|
},
|
|
48
49
|
hostToolbarHeightChanged(height) {
|
|
49
50
|
sendToMain(ViewChannel.HostToolbarHeightChanged, height);
|
|
50
51
|
},
|
|
52
|
+
hostSidebarWidthChanged(width) {
|
|
53
|
+
sendToMain(ViewChannel.HostSidebarWidthChanged, width);
|
|
54
|
+
},
|
|
55
|
+
hostSidebarCategorySelected(category) {
|
|
56
|
+
sendToMain(ViewChannel.HostSidebarCategorySelected, category);
|
|
57
|
+
},
|
|
51
58
|
editorOpenFile(payload) {
|
|
52
59
|
sendToMain(EditorChannel.OpenFile, payload);
|
|
53
60
|
},
|
|
61
|
+
projectCreateSubmitted(payload) {
|
|
62
|
+
sendToMain(ProjectCreateChannel.Submitted, payload);
|
|
63
|
+
},
|
|
64
|
+
devicePickerSelected(payload) {
|
|
65
|
+
sendToMain(DevicePickerChannel.Selected, payload);
|
|
66
|
+
},
|
|
54
67
|
popoverInit(popoverView, payload) {
|
|
55
68
|
const wc = liveWebContents(popoverView.webContents);
|
|
56
69
|
if (!wc)
|
|
57
70
|
return;
|
|
58
71
|
wc.send(PopoverChannel.Init, payload);
|
|
59
72
|
},
|
|
73
|
+
tooltipInit(tooltipView, payload) {
|
|
74
|
+
const wc = liveWebContents(tooltipView.webContents);
|
|
75
|
+
if (!wc)
|
|
76
|
+
return;
|
|
77
|
+
wc.send(TooltipChannel.Init, payload);
|
|
78
|
+
},
|
|
79
|
+
projectCreateInit(dialogView, payload) {
|
|
80
|
+
const wc = liveWebContents(dialogView.webContents);
|
|
81
|
+
if (!wc)
|
|
82
|
+
return;
|
|
83
|
+
wc.send(ProjectCreateChannel.Init, payload);
|
|
84
|
+
},
|
|
85
|
+
updateAvailable(dialogView, payload) {
|
|
86
|
+
const wc = liveWebContents(dialogView.webContents);
|
|
87
|
+
if (!wc)
|
|
88
|
+
return;
|
|
89
|
+
wc.send(UpdateChannel.Available, payload);
|
|
90
|
+
},
|
|
91
|
+
devicePickerInit(pickerView, payload) {
|
|
92
|
+
const wc = liveWebContents(pickerView.webContents);
|
|
93
|
+
if (!wc)
|
|
94
|
+
return;
|
|
95
|
+
wc.send(DevicePickerChannel.Init, payload);
|
|
96
|
+
},
|
|
60
97
|
settingsInit(payload) {
|
|
61
98
|
const wc = liveWebContents(ctx.views.getSettingsWebContents());
|
|
62
99
|
if (!wc)
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* 3. copies the template `source` directory into `input.path`, or invokes
|
|
9
9
|
* `template.generate(input.path, { name })` for programmatic templates.
|
|
10
10
|
* 4. rewrites `<input.path>/project.config.json`'s `projectname` to
|
|
11
|
-
* `input.name
|
|
11
|
+
* `encodeURIComponent(input.name)` — same encoding project-repository's
|
|
12
|
+
* `readProjectName`/`writeProjectName` use for the edit path.
|
|
12
13
|
* 5. registers the project with `ctx.projectsProvider.addProject(input.path)`
|
|
13
14
|
* and returns the resulting Project.
|
|
14
15
|
*/
|
|
@@ -63,9 +64,16 @@ async function materializeTemplate(target, template, name) {
|
|
|
63
64
|
if (!fs.existsSync(template.source.path)) {
|
|
64
65
|
throw new Error(`Template source missing on disk: ${template.source.path}`);
|
|
65
66
|
}
|
|
66
|
-
// `recursive: true` makes
|
|
67
|
-
//
|
|
68
|
-
fs.cpSync
|
|
67
|
+
// `recursive: true` makes cp mirror the entire tree (files, subdirs,
|
|
68
|
+
// symlinks). `force: true` mirrors over an empty target. `fs.promises.cp`
|
|
69
|
+
// (not the sync `fs.cpSync`) deliberately: cpSync's no-filter directory
|
|
70
|
+
// walk takes Node's native `cpSyncCopyDir` fast path, whose internal
|
|
71
|
+
// filesystem calls can `abort()` the whole process on certain errors
|
|
72
|
+
// (long/restricted/non-ASCII paths — nodejs/node#63970) instead of
|
|
73
|
+
// throwing a catchable JS exception. The async `cp` walks in pure JS and
|
|
74
|
+
// turns the same failures into a normal rejection this function already
|
|
75
|
+
// propagates to its IPC-boundary try/catch.
|
|
76
|
+
await fs.promises.cp(template.source.path, target, {
|
|
69
77
|
recursive: true,
|
|
70
78
|
force: true,
|
|
71
79
|
});
|
|
@@ -74,6 +82,12 @@ async function materializeTemplate(target, template, name) {
|
|
|
74
82
|
* Rewrite `<target>/project.config.json`'s `projectname` (best-effort: create
|
|
75
83
|
* the file if the template didn't ship one — gives the user a working
|
|
76
84
|
* starting point even for tiny generators).
|
|
85
|
+
*
|
|
86
|
+
* Encodes with `encodeURIComponent`, the same convention project-repository's
|
|
87
|
+
* `readProjectName`/`writeProjectName` use (aligned with WeChat DevTools:
|
|
88
|
+
* non-ASCII names go through URL encoding). Writing the raw name here would
|
|
89
|
+
* make this the one path that disagrees with the rename path, so a name with
|
|
90
|
+
* `%` or non-ASCII characters would come back different after an edit.
|
|
77
91
|
*/
|
|
78
92
|
function writeProjectConfig(target, name) {
|
|
79
93
|
const cfgPath = path.join(target, 'project.config.json');
|
|
@@ -86,7 +100,7 @@ function writeProjectConfig(target, name) {
|
|
|
86
100
|
cfg = {};
|
|
87
101
|
}
|
|
88
102
|
}
|
|
89
|
-
cfg.projectname = name;
|
|
103
|
+
cfg.projectname = encodeURIComponent(name);
|
|
90
104
|
fs.writeFileSync(cfgPath, JSON.stringify(cfg, null, 2));
|
|
91
105
|
}
|
|
92
106
|
export async function createProject(input, ctx) {
|
|
@@ -14,16 +14,20 @@ export function createLocalProjectsProvider() {
|
|
|
14
14
|
listProjects: () => repo.listProjects(),
|
|
15
15
|
addProject: (dirPath) => repo.addProject(dirPath),
|
|
16
16
|
removeProject: (dirPath) => repo.removeProject(dirPath),
|
|
17
|
+
updateProject: (dirPath, patch) => {
|
|
18
|
+
const updated = repo.updateProject(dirPath, patch);
|
|
19
|
+
if (!updated)
|
|
20
|
+
throw new Error(`No such project: ${dirPath}`);
|
|
21
|
+
return updated;
|
|
22
|
+
},
|
|
17
23
|
validateProjectDir: (dirPath) => repo.validateProjectDir(dirPath),
|
|
18
24
|
updateLastOpened: (dirPath) => repo.updateLastOpened(dirPath),
|
|
19
25
|
getCompileConfig: (dirPath) => repo.getCompileConfig(dirPath),
|
|
20
26
|
saveCompileConfig: (dirPath, cfg) => repo.saveCompileConfig(dirPath, cfg),
|
|
27
|
+
getCompileModes: (dirPath) => repo.getCompileModes(dirPath),
|
|
28
|
+
saveCompileModes: (dirPath, modes) => repo.saveCompileModes(dirPath, modes),
|
|
21
29
|
saveThumbnail: (dirPath, dataUrl) => saveThumbnailFromDataUrl(dirPath, dataUrl),
|
|
22
30
|
getThumbnail: (dirPath) => loadThumbnail(dirPath),
|
|
23
|
-
getLaunchConfigs: (dirPath) => repo.getLaunchConfigs(dirPath),
|
|
24
|
-
saveLaunchConfigs: (dirPath, configs) => repo.saveLaunchConfigs(dirPath, configs),
|
|
25
|
-
getActiveLaunchConfigId: (dirPath) => repo.getActiveLaunchConfigId(dirPath),
|
|
26
|
-
saveActiveLaunchConfigId: (dirPath, id) => repo.saveActiveLaunchConfigId(dirPath, id),
|
|
27
31
|
};
|
|
28
32
|
}
|
|
29
33
|
//# sourceMappingURL=local-provider.js.map
|
|
@@ -1,11 +1,28 @@
|
|
|
1
|
-
import type { CompileConfig,
|
|
1
|
+
import type { CompileConfig, CompileModes, ProjectType } from '../../../shared/types.js';
|
|
2
|
+
export type { ProjectType };
|
|
2
3
|
export interface Project {
|
|
3
4
|
name: string;
|
|
4
5
|
path: string;
|
|
5
6
|
lastOpened?: string | null;
|
|
6
7
|
compileConfig?: CompileConfig;
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
/** Absent on projects added before mini-game support — treat as 'miniprogram'. */
|
|
9
|
+
type?: ProjectType;
|
|
10
|
+
/**
|
|
11
|
+
* User-supplied icon for the project card. Absent means the card falls back
|
|
12
|
+
* to the first character of `name`.
|
|
13
|
+
*/
|
|
14
|
+
iconUrl?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The subset of a project record the user may edit after import. `path` is the
|
|
18
|
+
* record's identity (it keys every other per-project store — compile config,
|
|
19
|
+
* thumbnail, watcher) and is deliberately not patchable: pointing an existing
|
|
20
|
+
* record at another directory is an import, not an edit.
|
|
21
|
+
*/
|
|
22
|
+
export interface ProjectPatch {
|
|
23
|
+
name?: string;
|
|
24
|
+
/** Empty string clears the icon and restores the name-initial fallback. */
|
|
25
|
+
iconUrl?: string;
|
|
9
26
|
}
|
|
10
27
|
export interface ProjectPages {
|
|
11
28
|
pages: string[];
|
|
@@ -19,16 +36,51 @@ export declare function validateProjectDir(dirPath: string): string | null;
|
|
|
19
36
|
export declare function hasProject(dirPath: string): boolean;
|
|
20
37
|
export declare function addProject(dirPath: string): Project;
|
|
21
38
|
export declare function removeProject(dirPath: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* Apply a user edit to the record at `dirPath`. Returns the updated record, or
|
|
41
|
+
* `null` when no record matches — callers decide whether a missing project is
|
|
42
|
+
* an error (the IPC path) or a no-op.
|
|
43
|
+
*
|
|
44
|
+
* A name change is written through to the project's own config (see
|
|
45
|
+
* `writeProjectName`); the icon lives only in our list.
|
|
46
|
+
*/
|
|
47
|
+
export declare function updateProject(dirPath: string, patch: ProjectPatch): Project | null;
|
|
22
48
|
export declare function updateLastOpened(dirPath: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Read a project's compile modes from `project.config.json`'s
|
|
51
|
+
* `condition.miniprogram` — WeChat DevTools' own location and shape, so a
|
|
52
|
+
* project checked into git carries its modes to every machine, and the same
|
|
53
|
+
* directory opened in that tool shows the same list.
|
|
54
|
+
*
|
|
55
|
+
* Projects imported before compile modes existed fall back to migrating the
|
|
56
|
+
* legacy single config out of the project list file.
|
|
57
|
+
*/
|
|
58
|
+
export declare function getCompileModes(dirPath: string): CompileModes;
|
|
59
|
+
/**
|
|
60
|
+
* Persist compile modes, merged so the rest of the target file survives —
|
|
61
|
+
* including the rest of `condition`, which for a mini-game project holds its
|
|
62
|
+
* own `condition.game` block.
|
|
63
|
+
*/
|
|
64
|
+
export declare function saveCompileModes(dirPath: string, modes: CompileModes): void;
|
|
65
|
+
/**
|
|
66
|
+
* The launch parameters the selected mode resolves to. 普通编译 resolves to
|
|
67
|
+
* an empty start page; it is filled in here with the project's real entry
|
|
68
|
+
* page (mirrors getProjectPages: 'game' for mini-games, app.json's
|
|
69
|
+
* entryPagePath for mini-programs) rather than a mini-program-only literal —
|
|
70
|
+
* the simulator URL builders' own 'pages/index/index' fallback only fires
|
|
71
|
+
* when this is still empty (unreadable/malformed manifest).
|
|
72
|
+
*/
|
|
23
73
|
export declare function getCompileConfig(dirPath: string): CompileConfig;
|
|
24
74
|
export declare function getProjectPages(dirPath: string): ProjectPages;
|
|
75
|
+
/**
|
|
76
|
+
* @deprecated Compile modes are the stored form — call `saveCompileModes`.
|
|
77
|
+
* Kept working for embedding hosts still on the single-config setter: the
|
|
78
|
+
* config lands on the selected mode, or becomes a new selected mode when
|
|
79
|
+
* 普通编译 is selected and the config asks for more than it can express.
|
|
80
|
+
*/
|
|
25
81
|
export declare function saveCompileConfig(dirPath: string, config: CompileConfig): void;
|
|
26
82
|
/** Read a subset of `project.config.json` exposed to the settings panel. */
|
|
27
83
|
export declare function getProjectSettings(projectPath: string): ProjectSettings;
|
|
28
|
-
export declare function getLaunchConfigs(dirPath: string): LaunchConfig[];
|
|
29
|
-
export declare function saveLaunchConfigs(dirPath: string, configs: LaunchConfig[]): void;
|
|
30
|
-
export declare function getActiveLaunchConfigId(dirPath: string): string | null;
|
|
31
|
-
export declare function saveActiveLaunchConfigId(dirPath: string, id: string | null): void;
|
|
32
84
|
/** Persist a partial patch into the `setting` block of `project.config.json`. */
|
|
33
85
|
export declare function updateProjectSettings(projectPath: string, patch: Partial<ProjectSettings>): void;
|
|
34
86
|
//# sourceMappingURL=project-repository.d.ts.map
|