@dimina-kit/devtools 0.4.0 → 0.5.0-dev.20260908120530

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.
Files changed (507) hide show
  1. package/README.md +51 -660
  2. package/dist/main/api.d.ts +2 -1
  3. package/dist/main/app/app.d.ts +41 -12
  4. package/dist/main/app/app.js +299 -514
  5. package/dist/main/app/bootstrap.d.ts +8 -5
  6. package/dist/main/app/bootstrap.js +15 -15
  7. package/dist/main/app/editor-view.d.ts +21 -0
  8. package/dist/main/app/editor-view.js +71 -0
  9. package/dist/main/app/global-mirrors.d.ts +23 -0
  10. package/dist/main/app/global-mirrors.js +37 -0
  11. package/dist/main/app/host-sidebar-default.d.ts +19 -0
  12. package/dist/main/app/host-sidebar-default.js +44 -0
  13. package/dist/main/app/lifecycle.d.ts +12 -1
  14. package/dist/main/app/lifecycle.js +27 -1
  15. package/dist/main/app/menu-setup.d.ts +13 -0
  16. package/dist/main/app/menu-setup.js +49 -0
  17. package/dist/main/app/native-overview.d.ts +1 -1
  18. package/dist/main/app/open-project-ipc.d.ts +13 -0
  19. package/dist/main/app/open-project-ipc.js +21 -0
  20. package/dist/main/app/project-list-surface.d.ts +31 -0
  21. package/dist/main/app/project-list-surface.js +20 -0
  22. package/dist/main/app/project-window.d.ts +36 -0
  23. package/dist/main/app/project-window.js +93 -0
  24. package/dist/main/app/servers.d.ts +17 -0
  25. package/dist/main/app/servers.js +60 -0
  26. package/dist/main/app/ui-extension-targets.d.ts +42 -0
  27. package/dist/main/app/ui-extension-targets.js +101 -0
  28. package/dist/main/app/window-close-reveal.harness.d.ts +34 -0
  29. package/dist/main/app/window-close-reveal.harness.js +65 -0
  30. package/dist/main/app/window-events.d.ts +15 -0
  31. package/dist/main/app/window-events.js +45 -0
  32. package/dist/main/app/window-runtime-services.d.ts +41 -0
  33. package/dist/main/app/window-runtime-services.js +197 -0
  34. package/dist/main/app/workbench-modules.d.ts +24 -0
  35. package/dist/main/app/workbench-modules.js +51 -0
  36. package/dist/main/app/workbench-window.d.ts +85 -0
  37. package/dist/main/app/workbench-window.js +310 -0
  38. package/dist/main/index.bundle.js +11712 -9986
  39. package/dist/main/index.js +49 -1
  40. package/dist/main/ipc/app-lifecycle.d.ts +1 -31
  41. package/dist/main/ipc/app-lifecycle.js +1 -53
  42. package/dist/main/ipc/app.d.ts +4 -1
  43. package/dist/main/ipc/app.js +4 -3
  44. package/dist/main/ipc/bridge-router.d.ts +19 -116
  45. package/dist/main/ipc/bridge-router.js +28 -2128
  46. package/dist/main/ipc/device-picker.d.ts +16 -0
  47. package/dist/main/ipc/device-picker.js +27 -0
  48. package/dist/main/ipc/index.d.ts +5 -0
  49. package/dist/main/ipc/index.js +5 -0
  50. package/dist/main/ipc/internal-devtools.d.ts +16 -0
  51. package/dist/main/ipc/internal-devtools.js +10 -0
  52. package/dist/main/ipc/page-scroll.d.ts +1 -13
  53. package/dist/main/ipc/page-scroll.js +1 -16
  54. package/dist/main/ipc/popover.d.ts +4 -1
  55. package/dist/main/ipc/popover.js +26 -19
  56. package/dist/main/ipc/project-create.d.ts +16 -0
  57. package/dist/main/ipc/project-create.js +27 -0
  58. package/dist/main/ipc/project-fs.d.ts +38 -3
  59. package/dist/main/ipc/project-fs.js +53 -22
  60. package/dist/main/ipc/projects.d.ts +3 -3
  61. package/dist/main/ipc/projects.js +47 -11
  62. package/dist/main/ipc/session-listener-bag.d.ts +1 -40
  63. package/dist/main/ipc/session-listener-bag.js +1 -39
  64. package/dist/main/ipc/session.d.ts +4 -1
  65. package/dist/main/ipc/session.js +26 -26
  66. package/dist/main/ipc/settings.d.ts +4 -1
  67. package/dist/main/ipc/settings.js +17 -19
  68. package/dist/main/ipc/simulator-module.d.ts +9 -3
  69. package/dist/main/ipc/simulator-module.js +13 -10
  70. package/dist/main/ipc/simulator.d.ts +4 -1
  71. package/dist/main/ipc/simulator.js +12 -18
  72. package/dist/main/ipc/tooltip.d.ts +14 -0
  73. package/dist/main/ipc/tooltip.js +29 -0
  74. package/dist/main/ipc/views.d.ts +19 -2
  75. package/dist/main/ipc/views.js +76 -8
  76. package/dist/main/runtime/devtools-backend-before-quit.harness.d.ts +43 -0
  77. package/dist/main/runtime/devtools-backend-before-quit.harness.js +87 -0
  78. package/dist/main/runtime/devtools-backend.js +60 -4
  79. package/dist/main/runtime/devtools-runtime-mock.harness.d.ts +21 -0
  80. package/dist/main/runtime/devtools-runtime-mock.harness.js +313 -0
  81. package/dist/main/runtime/miniapp-runtime.d.ts +91 -22
  82. package/dist/main/services/app-services.d.ts +62 -0
  83. package/dist/main/services/app-services.js +64 -0
  84. package/dist/main/services/automation/connection-target.d.ts +36 -0
  85. package/dist/main/services/automation/connection-target.js +29 -0
  86. package/dist/main/services/automation/console-bridge.d.ts +28 -0
  87. package/dist/main/services/automation/console-bridge.js +91 -0
  88. package/dist/main/services/automation/handlers/app.js +4 -4
  89. package/dist/main/services/automation/handlers/element.js +55 -21
  90. package/dist/main/services/automation/index.d.ts +12 -1
  91. package/dist/main/services/automation/index.js +54 -133
  92. package/dist/main/services/cdp-session/index.d.ts +87 -0
  93. package/dist/main/services/cdp-session/index.js +173 -0
  94. package/dist/main/services/compile-standby.js +4 -0
  95. package/dist/main/services/console-forward/cdp-inject.d.ts +18 -0
  96. package/dist/main/services/console-forward/cdp-inject.js +30 -0
  97. package/dist/main/services/console-forward/global-console-mirror.d.ts +33 -0
  98. package/dist/main/services/console-forward/global-console-mirror.js +71 -0
  99. package/dist/main/services/console-forward/global-diagnostics-mirror.d.ts +33 -0
  100. package/dist/main/services/console-forward/global-diagnostics-mirror.js +73 -0
  101. package/dist/main/services/console-forward/index.d.ts +1 -46
  102. package/dist/main/services/console-forward/index.js +1 -185
  103. package/dist/main/services/console-forward/internal-log.d.ts +2 -0
  104. package/dist/main/services/console-forward/internal-log.js +2 -0
  105. package/dist/main/services/console-forward/open-gated-relay.d.ts +67 -0
  106. package/dist/main/services/console-forward/open-gated-relay.js +55 -0
  107. package/dist/main/services/default-adapter.js +1 -1
  108. package/dist/main/services/diagnostics/index.d.ts +1 -48
  109. package/dist/main/services/diagnostics/index.js +1 -60
  110. package/dist/main/services/dimina-resource-server.d.ts +1 -6
  111. package/dist/main/services/dimina-resource-server.js +1 -98
  112. package/dist/main/services/elements-forward/index.d.ts +132 -15
  113. package/dist/main/services/elements-forward/index.js +155 -304
  114. package/dist/main/services/fs-bridge-protocol.d.ts +61 -0
  115. package/dist/main/services/fs-bridge-protocol.js +34 -0
  116. package/dist/main/services/fs-watch-sse.d.ts +40 -0
  117. package/dist/main/services/fs-watch-sse.js +113 -0
  118. package/dist/main/services/http-json.d.ts +9 -0
  119. package/dist/main/services/http-json.js +6 -0
  120. package/dist/main/services/layout/index.d.ts +11 -0
  121. package/dist/main/services/layout/index.js +23 -0
  122. package/dist/main/services/mcp/connection-owner.d.ts +38 -0
  123. package/dist/main/services/mcp/connection-owner.js +79 -0
  124. package/dist/main/services/mcp/index.d.ts +3 -1
  125. package/dist/main/services/mcp/index.js +4 -3
  126. package/dist/main/services/mcp/opened-project.d.ts +88 -0
  127. package/dist/main/services/mcp/opened-project.js +60 -0
  128. package/dist/main/services/mcp/server.d.ts +2 -1
  129. package/dist/main/services/mcp/server.js +29 -4
  130. package/dist/main/services/mcp/target-manager.d.ts +71 -23
  131. package/dist/main/services/mcp/target-manager.js +269 -138
  132. package/dist/main/services/mcp/target-selection.d.ts +47 -0
  133. package/dist/main/services/mcp/target-selection.js +71 -0
  134. package/dist/main/services/mcp/tools/context-tools.js +20 -5
  135. package/dist/main/services/mcp/tools/project-tools.d.ts +72 -0
  136. package/dist/main/services/mcp/tools/project-tools.js +133 -0
  137. package/dist/main/services/module.d.ts +13 -5
  138. package/dist/main/services/network-forward/body-cache.d.ts +72 -0
  139. package/dist/main/services/network-forward/body-cache.js +179 -0
  140. package/dist/main/services/network-forward/frontend-dispatch.d.ts +91 -0
  141. package/dist/main/services/network-forward/frontend-dispatch.js +148 -0
  142. package/dist/main/services/network-forward/global-body-gate.d.ts +46 -0
  143. package/dist/main/services/network-forward/global-body-gate.js +93 -0
  144. package/dist/main/services/network-forward/global-mirror-test-fixtures.d.ts +48 -0
  145. package/dist/main/services/network-forward/global-mirror-test-fixtures.js +96 -0
  146. package/dist/main/services/network-forward/http.d.ts +47 -0
  147. package/dist/main/services/network-forward/http.js +162 -0
  148. package/dist/main/services/network-forward/index.d.ts +135 -15
  149. package/dist/main/services/network-forward/index.js +854 -224
  150. package/dist/main/services/network-forward/request-ids.d.ts +5 -0
  151. package/dist/main/services/network-forward/request-ids.js +5 -0
  152. package/dist/main/services/network-forward/user-facing.d.ts +21 -0
  153. package/dist/main/services/network-forward/user-facing.js +50 -0
  154. package/dist/main/services/network-forward/websocket.d.ts +36 -0
  155. package/dist/main/services/network-forward/websocket.js +120 -0
  156. package/dist/main/services/notifications/renderer-notifier.d.ts +71 -9
  157. package/dist/main/services/notifications/renderer-notifier.js +45 -8
  158. package/dist/main/services/projects/create-project-service.js +19 -5
  159. package/dist/main/services/projects/local-provider.js +8 -4
  160. package/dist/main/services/projects/project-repository.d.ts +59 -7
  161. package/dist/main/services/projects/project-repository.js +285 -51
  162. package/dist/main/services/projects/types.d.ts +44 -34
  163. package/dist/main/services/render-inspect/index.d.ts +12 -2
  164. package/dist/main/services/render-inspect/index.js +21 -102
  165. package/dist/main/services/safe-area/index.d.ts +21 -6
  166. package/dist/main/services/safe-area/index.js +92 -46
  167. package/dist/main/services/service-host-pool/pool.d.ts +1 -196
  168. package/dist/main/services/service-host-pool/pool.js +1 -363
  169. package/dist/main/services/settings/index.d.ts +7 -1
  170. package/dist/main/services/settings/index.js +22 -2
  171. package/dist/main/services/simulator/custom-apis.d.ts +1 -42
  172. package/dist/main/services/simulator/custom-apis.js +1 -46
  173. package/dist/main/services/simulator/referer.d.ts +1 -9
  174. package/dist/main/services/simulator/referer.js +1 -19
  175. package/dist/main/services/simulator/ui-extensions.d.ts +21 -0
  176. package/dist/main/services/simulator/ui-extensions.js +176 -0
  177. package/dist/main/services/simulator-appdata/index.d.ts +6 -0
  178. package/dist/main/services/simulator-appdata/index.js +21 -2
  179. package/dist/main/services/simulator-current-page/index.d.ts +5 -3
  180. package/dist/main/services/simulator-current-page/index.js +8 -1
  181. package/dist/main/services/simulator-storage/index.d.ts +34 -5
  182. package/dist/main/services/simulator-storage/index.js +73 -71
  183. package/dist/main/services/simulator-storage/service-storage-ops.d.ts +1 -39
  184. package/dist/main/services/simulator-storage/service-storage-ops.js +1 -66
  185. package/dist/main/services/simulator-storage/window-scope.d.ts +20 -0
  186. package/dist/main/services/simulator-storage/window-scope.js +20 -0
  187. package/dist/main/services/simulator-temp-files/disk.d.ts +1 -54
  188. package/dist/main/services/simulator-temp-files/disk.js +1 -237
  189. package/dist/main/services/simulator-temp-files/fs-channels.d.ts +1 -68
  190. package/dist/main/services/simulator-temp-files/fs-channels.js +1 -107
  191. package/dist/main/services/simulator-temp-files/index.d.ts +1 -32
  192. package/dist/main/services/simulator-temp-files/index.js +1 -181
  193. package/dist/main/services/simulator-temp-files/request-handler.d.ts +1 -29
  194. package/dist/main/services/simulator-temp-files/request-handler.js +1 -177
  195. package/dist/main/services/simulator-temp-files/resolver.d.ts +1 -21
  196. package/dist/main/services/simulator-temp-files/resolver.js +1 -21
  197. package/dist/main/services/simulator-temp-files/store.d.ts +1 -13
  198. package/dist/main/services/simulator-temp-files/store.js +1 -23
  199. package/dist/main/services/update/github-release-checker.js +22 -3
  200. package/dist/main/services/update/update-manager.d.ts +21 -4
  201. package/dist/main/services/update/update-manager.js +55 -11
  202. package/dist/main/services/views/clear-console-filter.d.ts +44 -0
  203. package/dist/main/services/views/clear-console-filter.js +86 -0
  204. package/dist/main/services/views/console-filter-test-fixtures.d.ts +94 -0
  205. package/dist/main/services/views/console-filter-test-fixtures.js +82 -0
  206. package/dist/main/services/views/console-filter.d.ts +94 -0
  207. package/dist/main/services/views/console-filter.js +190 -0
  208. package/dist/main/services/views/devtools-tabs.d.ts +24 -4
  209. package/dist/main/services/views/devtools-tabs.js +40 -21
  210. package/dist/main/services/views/frontend-bootstrap-gate.d.ts +59 -0
  211. package/dist/main/services/views/frontend-bootstrap-gate.js +117 -0
  212. package/dist/main/services/views/host-dialog-port-channel.d.ts +18 -0
  213. package/dist/main/services/views/host-dialog-port-channel.js +15 -0
  214. package/dist/main/services/views/host-dialog-session-runtime.d.ts +10 -0
  215. package/dist/main/services/views/host-dialog-session-runtime.js +17 -0
  216. package/dist/main/services/views/host-dialog-view.d.ts +95 -0
  217. package/dist/main/services/views/host-dialog-view.js +147 -0
  218. package/dist/main/services/views/host-sidebar-port-channel.d.ts +18 -0
  219. package/dist/main/services/views/host-sidebar-port-channel.js +15 -0
  220. package/dist/main/services/views/host-sidebar-session-runtime.d.ts +10 -0
  221. package/dist/main/services/views/host-sidebar-session-runtime.js +17 -0
  222. package/dist/main/services/views/host-sidebar-view.d.ts +59 -0
  223. package/dist/main/services/views/host-sidebar-view.js +44 -0
  224. package/dist/main/services/views/host-slot-port-channel.d.ts +124 -0
  225. package/dist/main/services/views/host-slot-port-channel.js +289 -0
  226. package/dist/main/services/views/host-slot-session-runtime.d.ts +40 -0
  227. package/dist/main/services/views/host-slot-session-runtime.js +50 -0
  228. package/dist/main/services/views/host-slot-view.d.ts +109 -0
  229. package/dist/main/services/views/host-slot-view.js +147 -0
  230. package/dist/main/services/views/host-toolbar-port-channel.d.ts +6 -91
  231. package/dist/main/services/views/host-toolbar-port-channel.js +10 -243
  232. package/dist/main/services/views/host-toolbar-session-runtime.d.ts +5 -30
  233. package/dist/main/services/views/host-toolbar-session-runtime.js +9 -47
  234. package/dist/main/services/views/host-toolbar-view.d.ts +34 -7
  235. package/dist/main/services/views/host-toolbar-view.js +30 -237
  236. package/dist/main/services/views/managed-web-contents-view.d.ts +48 -0
  237. package/dist/main/services/views/managed-web-contents-view.js +143 -0
  238. package/dist/main/services/views/miniapp-partition.d.ts +1 -89
  239. package/dist/main/services/views/miniapp-partition.js +1 -158
  240. package/dist/main/services/views/native-simulator-devtools-host.js +206 -68
  241. package/dist/main/services/views/native-simulator-view.d.ts +6 -0
  242. package/dist/main/services/views/native-simulator-view.js +47 -40
  243. package/dist/main/services/views/native-view-tree.d.ts +25 -0
  244. package/dist/main/services/views/native-view-tree.js +69 -0
  245. package/dist/main/services/views/overlay-panels-view.d.ts +63 -4
  246. package/dist/main/services/views/overlay-panels-view.js +257 -108
  247. package/dist/main/services/views/placement-reconciler.d.ts +18 -18
  248. package/dist/main/services/views/placement-reconciler.js +91 -29
  249. package/dist/main/services/views/placement-test-driver.d.ts +27 -0
  250. package/dist/main/services/views/placement-test-driver.js +29 -0
  251. package/dist/main/services/views/refresh-styles.d.ts +10 -0
  252. package/dist/main/services/views/refresh-styles.js +57 -0
  253. package/dist/main/services/views/simulator-session-policy.d.ts +1 -27
  254. package/dist/main/services/views/simulator-session-policy.js +1 -98
  255. package/dist/main/services/views/view-manager-devtools-host-test-fixtures.d.ts +76 -0
  256. package/dist/main/services/views/view-manager-devtools-host-test-fixtures.js +184 -0
  257. package/dist/main/services/views/view-manager.d.ts +69 -88
  258. package/dist/main/services/views/view-manager.js +62 -7
  259. package/dist/main/services/views/workbench-view.d.ts +2 -0
  260. package/dist/main/services/views/workbench-view.js +104 -17
  261. package/dist/main/services/window-contexts/context-router.d.ts +36 -0
  262. package/dist/main/services/window-contexts/context-router.js +55 -0
  263. package/dist/main/services/workbench-coi-host.d.ts +52 -0
  264. package/dist/main/services/workbench-coi-host.js +227 -0
  265. package/dist/main/services/workbench-coi-server.d.ts +11 -0
  266. package/dist/main/services/workbench-coi-server.js +126 -126
  267. package/dist/main/services/workbench-coi-shutdown.d.ts +40 -0
  268. package/dist/main/services/workbench-coi-shutdown.js +69 -0
  269. package/dist/main/services/workbench-coi-static.d.ts +23 -0
  270. package/dist/main/services/workbench-coi-static.js +87 -0
  271. package/dist/main/services/workbench-context.d.ts +88 -8
  272. package/dist/main/services/workbench-context.js +54 -6
  273. package/dist/main/services/workspace/compile-log-buffer.d.ts +40 -0
  274. package/dist/main/services/workspace/compile-log-buffer.js +41 -0
  275. package/dist/main/services/workspace/compile-mode-adapter.d.ts +18 -0
  276. package/dist/main/services/workspace/compile-mode-adapter.js +57 -0
  277. package/dist/main/services/workspace/compile-mode-store.d.ts +25 -0
  278. package/dist/main/services/workspace/compile-mode-store.js +71 -0
  279. package/dist/main/services/workspace/open-project-guards.d.ts +16 -0
  280. package/dist/main/services/workspace/open-project-guards.js +42 -0
  281. package/dist/main/services/workspace/rebuild-status.d.ts +37 -0
  282. package/dist/main/services/workspace/rebuild-status.js +36 -0
  283. package/dist/main/services/workspace/session-status-store.d.ts +47 -0
  284. package/dist/main/services/workspace/session-status-store.js +73 -0
  285. package/dist/main/services/workspace/status-tap.d.ts +20 -0
  286. package/dist/main/services/workspace/status-tap.js +32 -0
  287. package/dist/main/services/workspace/workspace-compile-modes.d.ts +59 -0
  288. package/dist/main/services/workspace/workspace-compile-modes.js +93 -0
  289. package/dist/main/services/workspace/workspace-lifecycle-race.testutil.d.ts +22 -0
  290. package/dist/main/services/workspace/workspace-lifecycle-race.testutil.js +62 -0
  291. package/dist/main/services/workspace/workspace-referer.d.ts +17 -0
  292. package/dist/main/services/workspace/workspace-referer.js +26 -0
  293. package/dist/main/services/workspace/workspace-service.d.ts +7 -5
  294. package/dist/main/services/workspace/workspace-service.js +96 -135
  295. package/dist/main/services/workspace/workspace-thumbnails.d.ts +22 -0
  296. package/dist/main/services/workspace/workspace-thumbnails.js +67 -0
  297. package/dist/main/utils/ipc-context-source.d.ts +40 -0
  298. package/dist/main/utils/ipc-context-source.js +23 -0
  299. package/dist/main/utils/ipc-registry.d.ts +46 -21
  300. package/dist/main/utils/ipc-registry.js +166 -76
  301. package/dist/main/utils/paths.d.ts +18 -0
  302. package/dist/main/utils/paths.js +18 -0
  303. package/dist/main/utils/sender-policy.d.ts +10 -1
  304. package/dist/main/utils/sender-policy.js +42 -4
  305. package/dist/main/utils/theme.d.ts +18 -8
  306. package/dist/main/utils/theme.js +19 -9
  307. package/dist/main/windows/internal-devtools-window/index.d.ts +66 -0
  308. package/dist/main/windows/internal-devtools-window/index.js +160 -0
  309. package/dist/main/windows/main-window/create.d.ts +16 -0
  310. package/dist/main/windows/main-window/create.js +19 -11
  311. package/dist/main/windows/main-window/events.d.ts +1 -1
  312. package/dist/main/windows/main-window/events.js +26 -13
  313. package/dist/main/windows/main-window/index.d.ts +1 -1
  314. package/dist/main/windows/main-window/index.js +1 -1
  315. package/dist/main/windows/service-host-window/create.d.ts +1 -92
  316. package/dist/main/windows/service-host-window/create.js +1 -154
  317. package/dist/native-host/common/common.js +173 -53
  318. package/dist/native-host/container/pageFrame.css +1 -1
  319. package/dist/native-host/render/render.js +8278 -3659
  320. package/dist/native-host/service/service.js +2 -2
  321. package/dist/preload/index.d.ts +2 -0
  322. package/dist/preload/index.js +1 -0
  323. package/dist/preload/instrumentation/app-data.d.ts +2 -2
  324. package/dist/preload/instrumentation/app-data.js +1 -1
  325. package/dist/preload/instrumentation/wxml.js +1 -1
  326. package/dist/preload/runtime/bridge.d.ts +3 -3
  327. package/dist/preload/runtime/bridge.js +2 -2
  328. package/dist/preload/runtime/clipboard.d.ts +6 -0
  329. package/dist/preload/runtime/clipboard.js +12 -0
  330. package/dist/preload/runtime/host-dialog-advertiser.d.ts +22 -0
  331. package/dist/preload/runtime/host-dialog-advertiser.js +37 -0
  332. package/dist/preload/runtime/host-dialog-port.d.ts +44 -0
  333. package/dist/preload/runtime/host-dialog-port.js +53 -0
  334. package/dist/preload/runtime/host-dialog-runtime.d.ts +28 -0
  335. package/dist/preload/runtime/host-dialog-runtime.js +36 -0
  336. package/dist/preload/runtime/host-sidebar-advertiser.d.ts +19 -0
  337. package/dist/preload/runtime/host-sidebar-advertiser.js +35 -0
  338. package/dist/preload/runtime/host-sidebar-port.d.ts +44 -0
  339. package/dist/preload/runtime/host-sidebar-port.js +53 -0
  340. package/dist/preload/runtime/host-sidebar-runtime.d.ts +28 -0
  341. package/dist/preload/runtime/host-sidebar-runtime.js +36 -0
  342. package/dist/preload/runtime/host-slot-port-bridge.d.ts +18 -0
  343. package/dist/preload/runtime/host-slot-port-bridge.js +112 -0
  344. package/dist/preload/runtime/host-toolbar-advertiser.d.ts +5 -13
  345. package/dist/preload/runtime/host-toolbar-advertiser.js +18 -38
  346. package/dist/preload/runtime/host-toolbar-port.d.ts +9 -0
  347. package/dist/preload/runtime/host-toolbar-port.js +11 -95
  348. package/dist/preload/runtime/native-host.d.ts +14 -0
  349. package/dist/preload/runtime/native-host.js +5 -8
  350. package/dist/preload/runtime/node-bindings.d.ts +18 -0
  351. package/dist/preload/runtime/node-bindings.js +44 -0
  352. package/dist/preload/runtime/temp-files.js +9 -2
  353. package/dist/preload/runtime/wait-for-slot-root.d.ts +23 -0
  354. package/dist/preload/runtime/wait-for-slot-root.js +80 -0
  355. package/dist/preload/shared/api-compat.js +63 -41
  356. package/dist/preload/windows/host-dialog-runtime.cjs +360 -0
  357. package/dist/preload/windows/host-dialog-runtime.cjs.map +7 -0
  358. package/dist/preload/windows/host-dialog-runtime.d.ts +2 -0
  359. package/dist/preload/windows/host-dialog-runtime.js +13 -0
  360. package/dist/preload/windows/host-sidebar-runtime.cjs +361 -0
  361. package/dist/preload/windows/host-sidebar-runtime.cjs.map +7 -0
  362. package/dist/preload/windows/host-sidebar-runtime.d.ts +2 -0
  363. package/dist/preload/windows/host-sidebar-runtime.js +13 -0
  364. package/dist/preload/windows/host-toolbar-runtime.cjs +142 -52
  365. package/dist/preload/windows/host-toolbar-runtime.cjs.map +3 -3
  366. package/dist/preload/windows/main.cjs +4922 -1246
  367. package/dist/preload/windows/main.cjs.map +4 -4
  368. package/dist/preload/windows/main.css +428 -0
  369. package/dist/preload/windows/main.css.map +7 -0
  370. package/dist/preload/windows/simulator.cjs +376 -322
  371. package/dist/preload/windows/simulator.cjs.map +4 -4
  372. package/dist/preload/windows/simulator.js +376 -322
  373. package/dist/render-host/pageFrame.html +4 -4
  374. package/dist/render-host/preload.cjs +30 -0
  375. package/dist/render-host/render-inspect.js +184 -115
  376. package/dist/renderer/assets/button-CB2MWjHY.js +2 -0
  377. package/dist/renderer/assets/constants-CkoGPQTS.js +2 -0
  378. package/dist/renderer/assets/constants-zQZ2-y21.js +2 -0
  379. package/dist/renderer/assets/createLucideIcon-cZ9FlZZw.js +2 -0
  380. package/dist/renderer/assets/devicePicker-H2eIO4e1.js +2 -0
  381. package/dist/renderer/assets/dialog-pHzEA8Vx.js +46 -0
  382. package/dist/renderer/assets/dist-B5HADirS.js +2 -0
  383. package/dist/renderer/assets/dist-DIFlRMKe.js +2 -0
  384. package/dist/renderer/assets/hostSidebarDefault-DRWh6OCt.js +2 -0
  385. package/dist/renderer/assets/index-CEL_XFge.js +2 -0
  386. package/dist/renderer/assets/input-CAObw95L.js +2 -0
  387. package/dist/renderer/assets/ipc-channels-overlays-gIPUFnqc.js +2 -0
  388. package/dist/renderer/assets/jsx-runtime-DICEQH_0.css +1 -0
  389. package/dist/renderer/assets/jsx-runtime-DIw5wnYl.js +9 -0
  390. package/dist/renderer/assets/plus-BQ9u5EbL.js +2 -0
  391. package/dist/renderer/assets/popover-Cw7G2Ctp.js +2 -0
  392. package/dist/renderer/assets/presets-DMZOb9ay.js +2 -0
  393. package/dist/renderer/assets/project-api-YTOr_Yvo.js +2 -0
  394. package/dist/renderer/assets/projectCreateDialog-BmLqiYxn.js +2 -0
  395. package/dist/renderer/assets/search-BMvuYF48.js +2 -0
  396. package/dist/renderer/assets/select-nFP95TxM.js +2 -0
  397. package/dist/renderer/assets/settings-CnpVfSWt.js +2 -0
  398. package/dist/renderer/assets/settings-api-Ccsf-Nsj.js +2 -0
  399. package/dist/renderer/assets/settings-tab-bar-CAzrv32m.js +2 -0
  400. package/dist/renderer/assets/smartphone-Bb2GdIKy.js +2 -0
  401. package/dist/renderer/assets/tabs-CPKN3Mmq.js +2 -0
  402. package/dist/renderer/assets/tooltip-D6AxXRk5.js +2 -0
  403. package/dist/renderer/assets/types-Bh0hA7El.js +2 -0
  404. package/dist/renderer/assets/updateDialog-CwndJ0Bl.js +2 -0
  405. package/dist/renderer/assets/utils-sEB5OZEQ.js +2 -0
  406. package/dist/renderer/assets/view-api-B-2zPBR5.js +2 -0
  407. package/dist/renderer/assets/view-ids-BfaDVV5P.js +2 -0
  408. package/dist/renderer/assets/workbench-C0Jkdlps.js +5 -0
  409. package/dist/renderer/assets/workbenchSettings-YD0Ctbm_.js +8 -0
  410. package/dist/renderer/entries/device-picker/index.html +28 -0
  411. package/dist/renderer/entries/host-sidebar-default/index.html +22 -0
  412. package/dist/renderer/entries/main/index.html +16 -7
  413. package/dist/renderer/entries/popover/index.html +16 -6
  414. package/dist/renderer/entries/project-create-dialog/index.html +27 -0
  415. package/dist/renderer/entries/settings/index.html +10 -5
  416. package/dist/renderer/entries/tooltip/index.html +21 -0
  417. package/dist/renderer/entries/update-dialog/index.html +25 -0
  418. package/dist/renderer/entries/workbench/index.html +49 -0
  419. package/dist/renderer/entries/workbench-settings/index.html +12 -5
  420. package/dist/service-host/appdata-set-data.cjs +39 -0
  421. package/dist/service-host/host-env-update.cjs +23 -0
  422. package/dist/service-host/preload.cjs +54 -48
  423. package/dist/service-host/service-message-queue.cjs +71 -0
  424. package/dist/service-host/sync-impls/menu-button-geometry.js +16 -5
  425. package/dist/service-host/sync-impls/menu-button.js +5 -3
  426. package/dist/service-host/sync-impls/system-info.js +31 -9
  427. package/dist/shared/bridge-channels.d.ts +1 -416
  428. package/dist/shared/bridge-channels.js +1 -89
  429. package/dist/shared/compile-mode-state.d.ts +73 -0
  430. package/dist/shared/compile-mode-state.js +100 -0
  431. package/dist/shared/compile-modes.d.ts +152 -0
  432. package/dist/shared/compile-modes.js +237 -0
  433. package/dist/shared/constants.d.ts +22 -0
  434. package/dist/shared/constants.js +22 -0
  435. package/dist/shared/dmb-resource-url.d.ts +2 -0
  436. package/dist/shared/dmb-resource-url.js +2 -0
  437. package/dist/shared/ipc-channels-overlays.d.ts +162 -0
  438. package/dist/shared/ipc-channels-overlays.js +203 -0
  439. package/dist/shared/ipc-channels.d.ts +24 -154
  440. package/dist/shared/ipc-channels.js +48 -96
  441. package/dist/shared/ipc-schemas.d.ts +143 -54
  442. package/dist/shared/ipc-schemas.js +137 -45
  443. package/dist/shared/node-bindings.d.ts +2 -0
  444. package/dist/shared/node-bindings.js +2 -0
  445. package/dist/shared/project-window-types.d.ts +42 -0
  446. package/dist/shared/project-window-types.js +2 -0
  447. package/dist/shared/simulator-route.d.ts +8 -0
  448. package/dist/shared/simulator-route.js +15 -0
  449. package/dist/shared/simulator-ui.d.ts +61 -0
  450. package/dist/shared/simulator-ui.js +12 -0
  451. package/dist/shared/types.d.ts +126 -41
  452. package/dist/shared/view-ids.d.ts +10 -0
  453. package/dist/shared/view-ids.js +23 -0
  454. package/dist/simulator/assets/bridge-channels-B3JAmRfl.js +2 -0
  455. package/dist/simulator/assets/device-shell-ATEhHV2_.css +1 -0
  456. package/dist/simulator/assets/device-shell-DucLepkm.js +431 -0
  457. package/dist/simulator/assets/simulator-B4rbcOVt.js +10 -0
  458. package/dist/simulator/assets/simulator-mini-app-DFo7fhi5.js +2 -0
  459. package/dist/simulator/assets/simulator-ui-BupATgKo.css +1 -0
  460. package/dist/simulator/assets/simulator-ui-i3GCc7YJ.js +2 -0
  461. package/dist/simulator/simulator.html +4 -3
  462. package/dist/simulator/temp-files.d.ts +35 -0
  463. package/dist/simulator/temp-files.js +121 -0
  464. package/dist/simulator/types.d.ts +50 -0
  465. package/dist/simulator/types.js +2 -0
  466. package/dist/vscode-workbench/assets/__vite-browser-external-JIkWewFf.js +1 -0
  467. package/dist/vscode-workbench/assets/{dist-TpGpmMGi.js → dist-CXG-u1VB.js} +3 -3
  468. package/dist/vscode-workbench/assets/fs-core-worker-urls-DZ1nod84.js +1 -0
  469. package/dist/vscode-workbench/assets/fs-core.worker-Bnmpp6fo.js +1 -0
  470. package/dist/vscode-workbench/assets/fs-query.worker-cZ-7Fjch.js +2 -0
  471. package/dist/vscode-workbench/assets/{iconv-lite-umd-C9tiCAJa.js → iconv-lite-umd-Dxx9Qyb4.js} +1 -1
  472. package/dist/vscode-workbench/assets/{index-DJ1HyMZ7.js → index-6VJMsaWj.js} +475 -475
  473. package/dist/vscode-workbench/assets/{jschardet-DE1jV513.js → jschardet-Ba3D16vt.js} +1 -1
  474. package/dist/vscode-workbench/index.html +21 -1
  475. package/package.json +23 -13
  476. package/dist/main/services/views/destroy-child-view.d.ts +0 -9
  477. package/dist/main/services/views/destroy-child-view.js +0 -23
  478. package/dist/preload/instrumentation/wxml-extract.d.ts +0 -11
  479. package/dist/preload/instrumentation/wxml-extract.js +0 -382
  480. package/dist/preload/shared/sid-registry.d.ts +0 -11
  481. package/dist/preload/shared/sid-registry.js +0 -38
  482. package/dist/renderer/assets/constants-EAMiwL9_.js +0 -2
  483. package/dist/renderer/assets/index-BMqyDx71.js +0 -49
  484. package/dist/renderer/assets/input-CDAEwpBO.js +0 -2
  485. package/dist/renderer/assets/ipc-transport-B7eFOR68.css +0 -1
  486. package/dist/renderer/assets/ipc-transport-_G1k5V1p.js +0 -9
  487. package/dist/renderer/assets/popover-DEdjK14m.js +0 -2
  488. package/dist/renderer/assets/select-DpKPCh3y.js +0 -2
  489. package/dist/renderer/assets/settings-M5q2elUr.js +0 -2
  490. package/dist/renderer/assets/settings-api-CDlZoHiO.js +0 -2
  491. package/dist/renderer/assets/workbenchSettings-CT_H1WhV.js +0 -8
  492. package/dist/shared/appdata-accumulator.d.ts +0 -95
  493. package/dist/shared/appdata-accumulator.js +0 -218
  494. package/dist/shared/request-core.d.ts +0 -84
  495. package/dist/shared/request-core.js +0 -168
  496. package/dist/shared/simulator-api-metadata.d.ts +0 -26
  497. package/dist/shared/simulator-api-metadata.js +0 -59
  498. package/dist/shared/vpath.d.ts +0 -42
  499. package/dist/shared/vpath.js +0 -105
  500. package/dist/simulator/assets/bridge-channels-zhsumfky.js +0 -2
  501. package/dist/simulator/assets/device-shell-C-wcFq3Z.js +0 -2
  502. package/dist/simulator/assets/device-shell-CS1rqAQz.css +0 -1
  503. package/dist/simulator/assets/jsx-runtime-BDTY6fEq.js +0 -2
  504. package/dist/simulator/assets/simulator-DU3-fS3v.js +0 -10
  505. package/dist/simulator/assets/simulator-mini-app-DzfMfnVM.js +0 -2
  506. package/dist/simulator/device-shell/menu-button-geometry.js +0 -8
  507. package/dist/vscode-workbench/assets/__vite-browser-external-CXi6Kz9W.js +0 -1
@@ -0,0 +1,190 @@
1
+ /**
2
+ * Hides dimina framework internal log lines from the right-panel
3
+ * (user-facing) Console, WITHOUT occupying the panel's visible text-filter
4
+ * box (see console-forward/internal-log.ts for the prefix judge this
5
+ * mirrors). The framework prints these via a plain `console.log` call INSIDE
6
+ * the inspected service host itself; main has no interception point for a
7
+ * native console line (see console-forward/index.ts's header comment), so the
8
+ * lever has to live inside the front-end.
9
+ *
10
+ * ── Why not the text-filter box ──────────────────────────────────────────
11
+ * Writing `-/^\[service\]/` into the Console's filter input does hide the
12
+ * lines, but the string then sits in the box the developer uses for their own
13
+ * filtering: it looks like something they typed, it silently comes back after
14
+ * every re-point (an empty box is indistinguishable from "never set", so
15
+ * clearing it just invites the next injection to rewrite it), and it consumes
16
+ * the one filter slot the panel offers. Driving the panel's own visibility
17
+ * judge instead leaves the box genuinely empty and under the developer's sole
18
+ * control.
19
+ *
20
+ * ── Mechanism ────────────────────────────────────────────────────────────
21
+ * `Console.ConsoleView.instance().filter.currentFilter` is the ConsoleFilter
22
+ * object the panel consults for every message, through its prototype method
23
+ * `shouldBeVisible(viewMessage)`. Wrapping that PROTOTYPE method (not the
24
+ * instance) rejects internal-log lines ahead of the panel's normal logic:
25
+ * - `currentFilter` is not the only ConsoleFilter the panel judges with:
26
+ * `ConsoleFilter.clone()` returns `new ConsoleFilter(...)`, and the
27
+ * sidebar filters through those clones. They share the prototype, so one
28
+ * patch covers all of them — and keeps covering them if the panel ever
29
+ * replaces `currentFilter` outright. (Editing the filter box does NOT
30
+ * replace it today: `ConsoleViewFilter` builds `currentFilter` once in its
31
+ * constructor and `updateCurrentFilter()` mutates that same instance's
32
+ * `parsedFilters` / `levelsMask` / `executionContext` in place.)
33
+ * - The wrapper delegates to the original for everything else, so a
34
+ * developer's own filter keeps working exactly as before — this only ever
35
+ * subtracts internal-log lines.
36
+ * Verified end-to-end against the real bundled front-end
37
+ * (e2e/console-filter-live.spec.ts): filter box reads empty, a `[service]`
38
+ * line logged afterwards stays hidden, an ordinary business log stays visible.
39
+ *
40
+ * This patches only the realm of the wc it is injected into — the right-panel
41
+ * front-end. The standalone floating debug window is a separate front-end with
42
+ * its own realm, and its content arrives by a different route entirely
43
+ * (main-side CDP capture → console-forward → global-console-mirror, which is
44
+ * deliberately UNFILTERED), so framework internals stay fully visible there.
45
+ * That window is the escape hatch for anyone who needs to read them.
46
+ *
47
+ * ── Timing ───────────────────────────────────────────────────────────────
48
+ * `Console.ConsoleView` has no lifecycle EVENT marking "fully constructed" —
49
+ * only the checkable condition of whether `.instance()` and the reach into
50
+ * `.filter.currentFilter` throw. The injection therefore retries on a bounded
51
+ * interval (see `LIVE_FILTER_POLL_MAX_ATTEMPTS`/`_INTERVAL_MS`) rather than
52
+ * guessing a fixed delay, and stops as soon as the wrapper is installed.
53
+ *
54
+ * Every tick gates on the front-end bootstrap probe BEFORE touching
55
+ * `ConsoleView.instance()`: an early construction transitively creates
56
+ * IssuesManager and permanently kills the front-end's own bootstrap
57
+ * (`ensureFirst` conflict in MainImpl.#createAppUI) — see
58
+ * frontend-bootstrap-gate.ts for the full mechanism. The main process
59
+ * additionally holds this whole injection behind `whenFrontendBootstrapped`;
60
+ * the in-realm probe is defense in depth for any other caller.
61
+ */
62
+ /**
63
+ * First-arg prefix marking a dimina SERVICE-layer framework log. A line counts
64
+ * as internal when its text IS this tag or starts with the tag plus a space —
65
+ * the same shape console-forward/internal-log.ts requires of the first arg, so
66
+ * a business line like '[service]业务状态' stays visible on both sides.
67
+ * These entries are captured
68
+ * directly by the native CDP `Runtime.consoleAPICalled` attach on the service
69
+ * host (service-host/preload.cjs deliberately does not monkeypatch
70
+ * `console.*` there — see its header comment — so there is no main-owned code
71
+ * between the framework's call and the attached DevTools), which is why the
72
+ * front-end is the only place they can be hidden.
73
+ *
74
+ * RENDER-layer framework noise (`[system]`) needs nothing here:
75
+ * `console-forward/index.ts`'s `forwardRenderToServiceHost` gates on
76
+ * `isInternalLogMessage` and never injects those entries into the service
77
+ * host's console at all — filtered at the source, in main-owned code.
78
+ */
79
+ export const INTERNAL_LOG_HIDDEN_PREFIX = '[service]';
80
+ /** Marker property stamped on the patched prototype, so a re-point re-running
81
+ * this script wraps once rather than nesting a wrapper per injection. Also
82
+ * the signal e2e specs read to tell "wrapper installed" from "not yet". */
83
+ export const INTERNAL_LOG_WRAPPER_MARK = '__diminaInternalLogHidden';
84
+ // Bound on how long the in-realm poll retries before giving up — mirrors this
85
+ // module's other bounded waits (e.g. internal-devtools-window's
86
+ // CLOSE_WATCHDOG_MS): wait for the real condition, but never forever.
87
+ const LIVE_FILTER_POLL_MAX_ATTEMPTS = 100;
88
+ const LIVE_FILTER_POLL_INTERVAL_MS = 100;
89
+ /**
90
+ * Build the `executeJavaScript` source that installs the internal-log
91
+ * visibility wrapper described in this module's header comment.
92
+ *
93
+ * Failure is loud but non-fatal: a front-end whose ConsoleFilter prototype has
94
+ * no `shouldBeVisible` (a future Chromium reshuffle) warns once and gives up
95
+ * rather than retrying a structurally absent surface — the panel then simply
96
+ * shows framework lines, which is the pre-existing behavior, not a breakage.
97
+ */
98
+ export function buildInternalLogHideScript(hiddenPrefix = INTERNAL_LOG_HIDDEN_PREFIX) {
99
+ const prefixJson = JSON.stringify(hiddenPrefix);
100
+ const markJson = JSON.stringify(INTERNAL_LOG_WRAPPER_MARK);
101
+ const maxAttempts = JSON.stringify(LIVE_FILTER_POLL_MAX_ATTEMPTS);
102
+ const intervalMs = JSON.stringify(LIVE_FILTER_POLL_INTERVAL_MS);
103
+ return `(function(){
104
+ var PREFIX = ${prefixJson};
105
+ var MARK = ${markJson};
106
+ var attempts = 0;
107
+ function bootstrapReady() {
108
+ try {
109
+ var eui = globalThis.EUI;
110
+ if (!eui || !eui.ShortcutRegistry || !eui.ShortcutRegistry.ShortcutRegistry) return false;
111
+ eui.ShortcutRegistry.ShortcutRegistry.instance();
112
+ return true;
113
+ } catch (_) { return false; }
114
+ }
115
+ function isInternalLog(viewMessage) {
116
+ try {
117
+ var msg = viewMessage && typeof viewMessage.consoleMessage === 'function' ? viewMessage.consoleMessage() : null;
118
+ var text = msg ? String(msg.messageText == null ? '' : msg.messageText) : '';
119
+ // Exact tag (the rest of the line is in later arguments), or the tag
120
+ // followed by a space — same shape as main's isInternalLogMessage. A
121
+ // bare prefix test would also swallow '[service]业务状态', an ordinary
122
+ // business log the panel must keep showing.
123
+ return text === PREFIX || text.indexOf(PREFIX + ' ') === 0;
124
+ } catch (_) { return false; }
125
+ }
126
+ function tryApply() {
127
+ attempts++;
128
+ var scheduleRetry = attempts < ${maxAttempts};
129
+ // Distinguishes the two halves of this script when the tail throws:
130
+ // future messages are already handled once the wrapper is on the
131
+ // prototype, even if re-judging the rows already on screen keeps failing.
132
+ var wrapperInstalled = false;
133
+ // In-realm bootstrap probe FIRST (defense in depth on top of the
134
+ // main-process whenFrontendBootstrapped gate): touching
135
+ // Console.ConsoleView.instance() before the front-end's own MainImpl
136
+ // bootstrap completes constructs IssuesManager early and permanently
137
+ // kills that bootstrap (ensureFirst conflict) — the probe throws BEFORE
138
+ // constructing anything, so a not-ready tick costs nothing.
139
+ if (!bootstrapReady()) {
140
+ if (scheduleRetry) { setTimeout(tryApply, ${intervalMs}); return; }
141
+ console.warn('[console-filter] gave up hiding internal logs after ' + attempts + ' attempts — the front-end bootstrap never completed');
142
+ return;
143
+ }
144
+ try {
145
+ var ConsoleNS = globalThis.Console;
146
+ var view = ConsoleNS && ConsoleNS.ConsoleView ? ConsoleNS.ConsoleView.instance() : null;
147
+ var f = view ? view.filter : null;
148
+ var currentFilter = f ? f.currentFilter : null;
149
+ if (!currentFilter) {
150
+ if (scheduleRetry) { setTimeout(tryApply, ${intervalMs}); return; }
151
+ console.warn('[console-filter] gave up hiding internal logs after ' + attempts + ' attempts — Console.ConsoleView never became usable');
152
+ return;
153
+ }
154
+ // The prototype, NOT the instance: clone() mints further ConsoleFilters
155
+ // that judge the same messages, and they all share this one.
156
+ var proto = Object.getPrototypeOf(currentFilter);
157
+ if (!proto || typeof proto.shouldBeVisible !== 'function') {
158
+ console.warn('[console-filter] cannot hide internal logs — ConsoleFilter has no shouldBeVisible to wrap; framework log lines will show in the right panel');
159
+ return;
160
+ }
161
+ if (!proto[MARK]) {
162
+ var original = proto.shouldBeVisible;
163
+ proto.shouldBeVisible = function(viewMessage) {
164
+ if (isInternalLog(viewMessage)) return false;
165
+ return original.apply(this, arguments);
166
+ };
167
+ proto[MARK] = true;
168
+ }
169
+ wrapperInstalled = true;
170
+ // Re-run the panel's visibility pass so lines already on screen when
171
+ // the wrapper lands are re-judged, not just future ones.
172
+ if (view && typeof view.onFilterChanged === 'function') view.onFilterChanged();
173
+ } catch(err) {
174
+ if (scheduleRetry) { setTimeout(tryApply, ${intervalMs}); return; }
175
+ // Name which half survived: a wrapper that installed but could never
176
+ // refresh still hides everything logged from now on, and the panel is
177
+ // left holding the internal lines printed before it landed. Reporting
178
+ // that as plain "gave up" would send the next reader looking for a
179
+ // filter that is in fact working.
180
+ if (wrapperInstalled) {
181
+ console.warn('[console-filter] internal logs are hidden from here on, but the rows already on screen could not be re-judged:', err);
182
+ } else {
183
+ console.warn('[console-filter] gave up hiding internal logs after ' + attempts + ' attempts:', err);
184
+ }
185
+ }
186
+ }
187
+ tryApply();
188
+ })()`;
189
+ }
190
+ //# sourceMappingURL=console-filter.js.map
@@ -35,10 +35,14 @@
35
35
  */
36
36
  /**
37
37
  * Canonical DevTools panel view ids kept in the DEFAULT tab bar (stable front-end
38
- * ids, unchanged for many Chromium releases): `elements`, `console`, `network`,
39
- * `sources`. Sources stays so a source-link click that isn't routed to Monaco
40
- * (build/runtime chunks, framework frames) still has a panel to reveal in instead
41
- * of silently no-op'ing.
38
+ * ids, unchanged for many Chromium releases): `elements`, `console`, `sources`,
39
+ * `network`. Sources stays so a source-link click NOT routed to Monaco (build/
40
+ * runtime chunks, framework frames) still has a panel to reveal in instead of
41
+ * silently no-op'ing. ORDERING NOTE: these stay in DevTools' DEFAULT visual
42
+ * order (Sources between Console and Network). We deliberately do NOT move
43
+ * Sources after Network: reordering the DOM nodes desyncs the front-end's
44
+ * click→panel mapping (it indexes tabs by child position), which made clicking
45
+ * Network activate Sources.
42
46
  */
43
47
  export declare const DEVTOOLS_KEPT_VIEW_IDS: readonly string[];
44
48
  /**
@@ -47,4 +51,20 @@ export declare const DEVTOOLS_KEPT_VIEW_IDS: readonly string[];
47
51
  * (never interpolated as bare code), same discipline as the other injectors.
48
52
  */
49
53
  export declare function buildCustomizeTabsScript(keptIds?: readonly string[]): string;
54
+ /**
55
+ * Build the `executeJavaScript` source that forces the DevTools front-end to
56
+ * render its context menus as PAGE menus (soft menus) instead of asking the
57
+ * host via `showContextMenuAtPoint()`.
58
+ *
59
+ * The embedded DevTools front-end decides per-menu in `ContextMenu#show()`:
60
+ * `this.useSoftMenu || InspectorFrontendHostInstance.isHostedMode()`. On a
61
+ * self-built WebContentsView Electron leaves both false and does not answer
62
+ * `showContextMenuAtPoint()`, so right-click menus (复制为 cURL / Copy / …)
63
+ * never appear. Forcing the host-wide `isHostedMode()` true instead breaks the
64
+ * front-end's target data flow (Console/Network panels go empty), so we take
65
+ * the narrow path: patch the ContextMenu prototype so every menu shows as a
66
+ * page-rendered soft menu — same rendering the VS Code embedding uses, without
67
+ * touching the host-mode flag or any other front-end behaviour.
68
+ */
69
+ export declare function buildDevtoolsSoftMenuScript(): string;
50
70
  //# sourceMappingURL=devtools-tabs.d.ts.map
@@ -35,12 +35,16 @@
35
35
  */
36
36
  /**
37
37
  * Canonical DevTools panel view ids kept in the DEFAULT tab bar (stable front-end
38
- * ids, unchanged for many Chromium releases): `elements`, `console`, `network`,
39
- * `sources`. Sources stays so a source-link click that isn't routed to Monaco
40
- * (build/runtime chunks, framework frames) still has a panel to reveal in instead
41
- * of silently no-op'ing.
38
+ * ids, unchanged for many Chromium releases): `elements`, `console`, `sources`,
39
+ * `network`. Sources stays so a source-link click NOT routed to Monaco (build/
40
+ * runtime chunks, framework frames) still has a panel to reveal in instead of
41
+ * silently no-op'ing. ORDERING NOTE: these stay in DevTools' DEFAULT visual
42
+ * order (Sources between Console and Network). We deliberately do NOT move
43
+ * Sources after Network: reordering the DOM nodes desyncs the front-end's
44
+ * click→panel mapping (it indexes tabs by child position), which made clicking
45
+ * Network activate Sources.
42
46
  */
43
- export const DEVTOOLS_KEPT_VIEW_IDS = ['elements', 'console', 'network', 'sources'];
47
+ export const DEVTOOLS_KEPT_VIEW_IDS = ['elements', 'console', 'sources', 'network'];
44
48
  /**
45
49
  * Build the `executeJavaScript` source injected into the DevTools front-end
46
50
  * WebContents. The kept ids + display names are carried as JSON data literals
@@ -50,20 +54,15 @@ export function buildCustomizeTabsScript(keptIds = DEVTOOLS_KEPT_VIEW_IDS) {
50
54
  // Kept panels are matched by view id (registry path) and by visible NAME (DOM
51
55
  // fallback path); the DevTools UI may be EN or ZH, so include both.
52
56
  const NAME_MAP = {
53
- elements: ['Elements', '元素'], console: ['Console', '控制台'], network: ['Network', '网络'],
54
- sources: ['Sources', '来源', '源代码'],
57
+ elements: ['Elements', '元素'], console: ['Console', '控制台'],
58
+ sources: ['Sources', '来源', '源代码'], network: ['Network', '网络'],
55
59
  };
56
60
  const keepNames = keptIds.flatMap((id) => NAME_MAP[id] ?? [id]);
57
61
  const keepIdsJson = JSON.stringify(JSON.stringify([...keptIds]));
58
62
  const keepNamesJson = JSON.stringify(JSON.stringify(keepNames));
59
- const srcNamesJson = JSON.stringify(JSON.stringify(NAME_MAP.sources));
60
- const netNamesJson = JSON.stringify(JSON.stringify(NAME_MAP.network));
61
63
  return `(function(){try{
62
64
  var KEEPID = new Set(JSON.parse(${keepIdsJson}));
63
65
  var KEEPNAME = new Set(JSON.parse(${keepNamesJson}));
64
- var SRCNAME = new Set(JSON.parse(${srcNamesJson}));
65
- var NETNAME = new Set(JSON.parse(${netNamesJson}));
66
- var WANT_SOURCES_LAST = KEEPID.has('sources');
67
66
  // (1) Locale infobar — official host-preference suppression (NOT localStorage).
68
67
  try { var IFH=globalThis.InspectorFrontendHost; if(IFH&&typeof IFH.setPreference==='function'){ IFH.setPreference('disable-locale-info-bar','true'); } }catch(_){}
69
68
  function deepCollect(sel,cap){ var out=[],seen=0,stack=[document]; while(stack.length&&seen<(cap||40000)){ var root=stack.pop(); try{var m=root.querySelectorAll?root.querySelectorAll(sel):[];for(var i=0;i<m.length;i++)out.push(m[i]);}catch(_){} try{var all=root.querySelectorAll?root.querySelectorAll('*'):[];for(var j=0;j<all.length;j++){seen++;if(all[j].shadowRoot)stack.push(all[j].shadowRoot);}}catch(_){} } return out; }
@@ -94,15 +93,6 @@ export function buildCustomizeTabsScript(keptIds = DEVTOOLS_KEPT_VIEW_IDS) {
94
93
  if(!handled){ var FALL=['timeline','resources','heap-profiler','security','lighthouse','chrome-recorder','coverage','linear-memory-inspector','sensors','rendering','animations','autofill-view','medias','issues-pane']; for(var fr=0;fr<FALL.length;fr++){ try{ if(!KEEPID.has(FALL[fr])) maybeRemove(FALL[fr]); }catch(_){} } }
95
94
  } else { domFallback(); }
96
95
  })();
97
- // Keep Sources LAST in the bar (after Network). Default DevTools order puts
98
- // Sources between Console and Network; nudge it to just after Network. Runs in
99
- // BOTH paths (registry removal leaves the kept tabs in default order). Self-
100
- // stable: once Sources follows Network the condition no longer holds.
101
- if(WANT_SOURCES_LAST){ var ro=0,rt=setInterval(function(){ ro++; try{
102
- var tabs=deepCollect('[role="tab"]'),src=null,net=null;
103
- for(var i=0;i<tabs.length;i++){ var n=txt(tabs[i]); if(SRCNAME.has(n))src=tabs[i]; else if(NETNAME.has(n))net=tabs[i]; }
104
- if(src&&net&&src.parentElement&&src.parentElement===net.parentElement&&(src.compareDocumentPosition(net)&Node.DOCUMENT_POSITION_FOLLOWING)){ net.parentElement.insertBefore(src,net.nextSibling); }
105
- }catch(_){} if(ro>120)clearInterval(rt); },60); }
106
96
  // DOM fallback: only if the ESM module couldn't be resolved at all.
107
97
  function domFallback(){ var cachedBar=null;
108
98
  function findBar(){ if(cachedBar&&cachedBar.isConnected)return cachedBar; cachedBar=null; var tabs=deepCollect('[role="tab"]'); var a=null; for(var i=0;i<tabs.length;i++){if(KEEPNAME.has(txt(tabs[i]))){a=tabs[i];break;}} if(!a)return null; var p=a.parentElement; while(p){try{if(p.querySelectorAll('[role="tab"]').length>1){cachedBar=p;return p;}}catch(_){} p=p.parentElement;} cachedBar=a.parentElement; return cachedBar; }
@@ -110,4 +100,33 @@ export function buildCustomizeTabsScript(keptIds = DEVTOOLS_KEPT_VIEW_IDS) {
110
100
  var tr=0,t=setInterval(function(){tr++;try{apply();}catch(_){}if(tr>120)clearInterval(t);},60); try{apply();}catch(_){} }
111
101
  }catch(_){}})()`;
112
102
  }
103
+ /**
104
+ * Build the `executeJavaScript` source that forces the DevTools front-end to
105
+ * render its context menus as PAGE menus (soft menus) instead of asking the
106
+ * host via `showContextMenuAtPoint()`.
107
+ *
108
+ * The embedded DevTools front-end decides per-menu in `ContextMenu#show()`:
109
+ * `this.useSoftMenu || InspectorFrontendHostInstance.isHostedMode()`. On a
110
+ * self-built WebContentsView Electron leaves both false and does not answer
111
+ * `showContextMenuAtPoint()`, so right-click menus (复制为 cURL / Copy / …)
112
+ * never appear. Forcing the host-wide `isHostedMode()` true instead breaks the
113
+ * front-end's target data flow (Console/Network panels go empty), so we take
114
+ * the narrow path: patch the ContextMenu prototype so every menu shows as a
115
+ * page-rendered soft menu — same rendering the VS Code embedding uses, without
116
+ * touching the host-mode flag or any other front-end behaviour.
117
+ */
118
+ export function buildDevtoolsSoftMenuScript() {
119
+ return `(function(){
120
+ try {
121
+ var C = globalThis.EUI && globalThis.EUI.ContextMenu && globalThis.EUI.ContextMenu.ContextMenu;
122
+ if (C && C.prototype && typeof C.prototype.show === 'function') {
123
+ var origShow = C.prototype.show;
124
+ C.prototype.show = function() {
125
+ this.useSoftMenu = true;
126
+ return origShow.apply(this, arguments);
127
+ };
128
+ }
129
+ } catch (_) {}
130
+ })()`;
131
+ }
113
132
  //# sourceMappingURL=devtools-tabs.js.map
@@ -0,0 +1,59 @@
1
+ import type { WebContents } from 'electron';
2
+ /**
3
+ * The single "front-end bootstrap finished" gate every DevTools front-end
4
+ * injector must pass BEFORE running any `.instance()`-style script in the
5
+ * front-end realm.
6
+ *
7
+ * Why this must exist: the bundled front-end's own `MainImpl.#createAppUI`
8
+ * constructs its singletons in a fixed order, and several of them assert
9
+ * first-creation (`IssuesManager.instance({ensureFirst: true})`). An injected
10
+ * script that constructs a panel singleton early — e.g. a bare
11
+ * `Console.ConsoleView.instance()`, whose field initializers transitively
12
+ * create IssuesManager — makes that assertion throw, and the front-end's
13
+ * bootstrap dies as an unhandled rejection it NEVER recovers from:
14
+ * ActionRegistry/ShortcutRegistry are then never created and the panel
15
+ * renders no tabs at all (the "Missing actionRegistry for shortcutRegistry"
16
+ * permanent-failure mode, confirmed against the real bundled front-end with
17
+ * first-creator stack captures and the matching Chromium 146 source).
18
+ *
19
+ * Iron rule for injectors: BEFORE this gate reports ready, an injected
20
+ * script may only touch registries and InspectorFrontendHost preferences —
21
+ * never any `.instance()` call. (`customizeDevtoolsTabs` is the one
22
+ * documented pre-gate exception: it must run before ViewManager snapshots
23
+ * the view registry, and it only edits the registry.)
24
+ */
25
+ /**
26
+ * Side-effect-free in-realm readiness probe, safe to feed directly to
27
+ * `wc.executeJavaScript`. `ShortcutRegistry.instance()` (no args) throws
28
+ * BEFORE constructing anything when the registry does not exist yet, so a
29
+ * false answer costs nothing — and a true answer proves `MainImpl` already
30
+ * passed the point where every bootstrap singleton (IssuesManager included)
31
+ * exists, making singleton-touching injections safe. `EUI` is the bundle's
32
+ * real exposure of the ui/legacy namespace (`globalThis.UI` does not exist
33
+ * on this front-end build). An expression, not a statement list: the value
34
+ * `executeJavaScript` resolves is the IIFE's completion value.
35
+ */
36
+ export declare const FRONTEND_BOOTSTRAP_PROBE_SCRIPT = "(() => {\n try {\n const eui = globalThis.EUI\n if (!eui || !eui.ShortcutRegistry || !eui.ShortcutRegistry.ShortcutRegistry) return false\n eui.ShortcutRegistry.ShortcutRegistry.instance()\n return true\n } catch (_) {\n return false\n }\n})()";
37
+ export interface WhenFrontendBootstrappedOptions {
38
+ /** Wall-clock give-up bound. Past it the promise resolves false with a
39
+ * single warn — callers degrade silently, matching the surrounding
40
+ * modules' convention. */
41
+ timeoutMs?: number;
42
+ /** Probe cadence while the front-end is still booting. */
43
+ intervalMs?: number;
44
+ }
45
+ /**
46
+ * Poll the probe against `wc` until the front-end bootstrap is provably
47
+ * complete. Resolves true on readiness; false on timeout (one warn) or a
48
+ * destroyed wc — never rejects, and never leaves a live timer behind after
49
+ * settling. A rejected probe call (execution context torn down mid-load,
50
+ * navigation in flight) counts as "not ready yet", not as an error.
51
+ *
52
+ * The timeout is an INDEPENDENT hard deadline racing the poll — not a check
53
+ * inside the poll chain. A probe `executeJavaScript` promise that never
54
+ * settles (frame destroyed mid-call / a wc permanently stuck loading) would
55
+ * stall a chain-embedded check forever; the deadline settles this promise
56
+ * regardless.
57
+ */
58
+ export declare function whenFrontendBootstrapped(wc: WebContents, opts?: WhenFrontendBootstrappedOptions): Promise<boolean>;
59
+ //# sourceMappingURL=frontend-bootstrap-gate.d.ts.map
@@ -0,0 +1,117 @@
1
+ /**
2
+ * The single "front-end bootstrap finished" gate every DevTools front-end
3
+ * injector must pass BEFORE running any `.instance()`-style script in the
4
+ * front-end realm.
5
+ *
6
+ * Why this must exist: the bundled front-end's own `MainImpl.#createAppUI`
7
+ * constructs its singletons in a fixed order, and several of them assert
8
+ * first-creation (`IssuesManager.instance({ensureFirst: true})`). An injected
9
+ * script that constructs a panel singleton early — e.g. a bare
10
+ * `Console.ConsoleView.instance()`, whose field initializers transitively
11
+ * create IssuesManager — makes that assertion throw, and the front-end's
12
+ * bootstrap dies as an unhandled rejection it NEVER recovers from:
13
+ * ActionRegistry/ShortcutRegistry are then never created and the panel
14
+ * renders no tabs at all (the "Missing actionRegistry for shortcutRegistry"
15
+ * permanent-failure mode, confirmed against the real bundled front-end with
16
+ * first-creator stack captures and the matching Chromium 146 source).
17
+ *
18
+ * Iron rule for injectors: BEFORE this gate reports ready, an injected
19
+ * script may only touch registries and InspectorFrontendHost preferences —
20
+ * never any `.instance()` call. (`customizeDevtoolsTabs` is the one
21
+ * documented pre-gate exception: it must run before ViewManager snapshots
22
+ * the view registry, and it only edits the registry.)
23
+ */
24
+ /**
25
+ * Side-effect-free in-realm readiness probe, safe to feed directly to
26
+ * `wc.executeJavaScript`. `ShortcutRegistry.instance()` (no args) throws
27
+ * BEFORE constructing anything when the registry does not exist yet, so a
28
+ * false answer costs nothing — and a true answer proves `MainImpl` already
29
+ * passed the point where every bootstrap singleton (IssuesManager included)
30
+ * exists, making singleton-touching injections safe. `EUI` is the bundle's
31
+ * real exposure of the ui/legacy namespace (`globalThis.UI` does not exist
32
+ * on this front-end build). An expression, not a statement list: the value
33
+ * `executeJavaScript` resolves is the IIFE's completion value.
34
+ */
35
+ export const FRONTEND_BOOTSTRAP_PROBE_SCRIPT = `(() => {
36
+ try {
37
+ const eui = globalThis.EUI
38
+ if (!eui || !eui.ShortcutRegistry || !eui.ShortcutRegistry.ShortcutRegistry) return false
39
+ eui.ShortcutRegistry.ShortcutRegistry.instance()
40
+ return true
41
+ } catch (_) {
42
+ return false
43
+ }
44
+ })()`;
45
+ // Matches the e2e suite's own bootstrap-wait window (console-filter-live's
46
+ // 45s probe poll) so a slow-but-alive bootstrap never lands in a band where
47
+ // production has given up while the spec still expects the injections.
48
+ const DEFAULT_TIMEOUT_MS = 45_000;
49
+ const DEFAULT_INTERVAL_MS = 150;
50
+ /**
51
+ * Poll the probe against `wc` until the front-end bootstrap is provably
52
+ * complete. Resolves true on readiness; false on timeout (one warn) or a
53
+ * destroyed wc — never rejects, and never leaves a live timer behind after
54
+ * settling. A rejected probe call (execution context torn down mid-load,
55
+ * navigation in flight) counts as "not ready yet", not as an error.
56
+ *
57
+ * The timeout is an INDEPENDENT hard deadline racing the poll — not a check
58
+ * inside the poll chain. A probe `executeJavaScript` promise that never
59
+ * settles (frame destroyed mid-call / a wc permanently stuck loading) would
60
+ * stall a chain-embedded check forever; the deadline settles this promise
61
+ * regardless.
62
+ */
63
+ export function whenFrontendBootstrapped(wc, opts) {
64
+ const timeoutMs = opts?.timeoutMs ?? DEFAULT_TIMEOUT_MS;
65
+ const intervalMs = opts?.intervalMs ?? DEFAULT_INTERVAL_MS;
66
+ return new Promise((resolve) => {
67
+ let timer = null;
68
+ let settled = false;
69
+ const finish = (ready) => {
70
+ if (settled)
71
+ return;
72
+ settled = true;
73
+ clearTimeout(deadline);
74
+ if (timer) {
75
+ clearTimeout(timer);
76
+ timer = null;
77
+ }
78
+ resolve(ready);
79
+ };
80
+ const deadline = setTimeout(() => {
81
+ // Within one call "ready" was never observed — a dead bootstrap and a
82
+ // merely-slow one are indistinguishable from out here; say so.
83
+ console.warn(`[frontend-bootstrap-gate] front-end bootstrap probe never reported ready within ${timeoutMs}ms — bootstrap-gated injections stay skipped for this host`);
84
+ finish(false);
85
+ }, timeoutMs);
86
+ deadline.unref?.();
87
+ const attempt = () => {
88
+ if (wc.isDestroyed()) {
89
+ finish(false);
90
+ return;
91
+ }
92
+ Promise.resolve()
93
+ .then(() => wc.executeJavaScript(FRONTEND_BOOTSTRAP_PROBE_SCRIPT))
94
+ .then((ready) => ready === true, () => false)
95
+ .then((ready) => {
96
+ if (settled)
97
+ return;
98
+ // Destroyed-check BEFORE honoring a ready answer: a probe that was
99
+ // in flight when the wc got destroyed can still resolve true, and
100
+ // reporting "bootstrapped" for a dead target contradicts this
101
+ // function's contract (destroyed ⇒ false).
102
+ if (wc.isDestroyed()) {
103
+ finish(false);
104
+ return;
105
+ }
106
+ if (ready) {
107
+ finish(true);
108
+ return;
109
+ }
110
+ timer = setTimeout(attempt, intervalMs);
111
+ timer.unref?.();
112
+ });
113
+ };
114
+ attempt();
115
+ });
116
+ }
117
+ //# sourceMappingURL=frontend-bootstrap-gate.js.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Dialog-specific instantiation of `createHostSlotPortChannel` (see that
3
+ * module for the full per-load handshake / navigation-invalidation
4
+ * contract).
5
+ */
6
+ import type { WebContents } from 'electron';
7
+ import { type HostSlotMessageSubscription, type HostSlotPortChannel } from './host-slot-port-channel.js';
8
+ export type HostDialogMessageSubscription = HostSlotMessageSubscription;
9
+ export type HostDialogPortChannel = HostSlotPortChannel;
10
+ export declare function createHostDialogPortChannel(opts: {
11
+ /**
12
+ * Is `wc` still the manager's CURRENT live dialog webContents? Guards a
13
+ * stale wc's late `did-finish-load` from hijacking the channel after a
14
+ * rebuild swapped the view out underneath it.
15
+ */
16
+ isCurrent: (wc: WebContents) => boolean;
17
+ }): HostDialogPortChannel;
18
+ //# sourceMappingURL=host-dialog-port-channel.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Dialog-specific instantiation of `createHostSlotPortChannel` (see that
3
+ * module for the full per-load handshake / navigation-invalidation
4
+ * contract).
5
+ */
6
+ import { ViewChannel } from '../../../shared/ipc-channels-overlays.js';
7
+ import { createHostSlotPortChannel, } from './host-slot-port-channel.js';
8
+ export function createHostDialogPortChannel(opts) {
9
+ return createHostSlotPortChannel({
10
+ isCurrent: opts.isCurrent,
11
+ channel: ViewChannel.HostDialogPort,
12
+ logPrefix: '[host-dialog]',
13
+ });
14
+ }
15
+ //# sourceMappingURL=host-dialog-port-channel.js.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Dialog-specific instantiation of `createHostSlotSessionRuntime` (see that
3
+ * module for the full ref-counting contract). Kept as a thin, independently
4
+ * named wrapper — same rationale as `host-toolbar-session-runtime.ts` — so
5
+ * a dialog-focused test can `vi.resetModules()` this module's state without
6
+ * touching the toolbar/sidebar's independent ref-counts.
7
+ */
8
+ export declare function acquireHostDialogSessionRuntime(): void;
9
+ export declare function releaseHostDialogSessionRuntime(): void;
10
+ //# sourceMappingURL=host-dialog-session-runtime.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Dialog-specific instantiation of `createHostSlotSessionRuntime` (see that
3
+ * module for the full ref-counting contract). Kept as a thin, independently
4
+ * named wrapper — same rationale as `host-toolbar-session-runtime.ts` — so
5
+ * a dialog-focused test can `vi.resetModules()` this module's state without
6
+ * touching the toolbar/sidebar's independent ref-counts.
7
+ */
8
+ import { createHostSlotSessionRuntime } from './host-slot-session-runtime.js';
9
+ import { hostDialogRuntimePreloadPath } from '../../utils/paths.js';
10
+ const runtime = createHostSlotSessionRuntime(hostDialogRuntimePreloadPath);
11
+ export function acquireHostDialogSessionRuntime() {
12
+ runtime.acquire();
13
+ }
14
+ export function releaseHostDialogSessionRuntime() {
15
+ runtime.release();
16
+ }
17
+ //# sourceMappingURL=host-dialog-session-runtime.js.map