@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
@@ -1,417 +1,2 @@
1
- import type { NativeDeviceInfo } from './ipc-channels.js';
2
- export declare const BRIDGE_CHANNELS: {
3
- readonly SPAWN: "dmb:spawn";
4
- readonly DISPOSE: "dmb:dispose";
5
- readonly PAGE_OPEN: "dmb:page:open";
6
- readonly PAGE_CLOSE: "dmb:page:close";
7
- readonly PAGE_LIFECYCLE: "dmb:page:lifecycle";
8
- readonly NAV_CALLBACK: "dmb:nav:callback";
9
- readonly SERVICE_INVOKE: "dmb:service:invoke";
10
- readonly SERVICE_PUBLISH: "dmb:service:publish";
11
- readonly RENDER_INVOKE: "dmb:render:invoke";
12
- readonly RENDER_PUBLISH: "dmb:render:publish";
13
- readonly TO_SERVICE: "dmb:to-service";
14
- readonly TO_RENDER: "dmb:to-render";
15
- readonly SIMULATOR_API: "dmb:simulator-api";
16
- /** simulator → main: ack of an API_CALL request (carries success/fail args). */
17
- readonly API_RESPONSE: "dmb:api:response";
18
- /**
19
- * simulator webview preload → main (sendSync): "is native-host mode on?".
20
- * The guest preload can't read the launch `process.env`, so it asks main
21
- * (which can) at install time. Reply is `e.returnValue = boolean`.
22
- */
23
- readonly NATIVE_HOST_ENABLED: "dmb:native-host-enabled";
24
- /**
25
- * simulator (DeviceShell) → main: the visible top-of-stack page bridgeId.
26
- * Main has no z-order concept — the active page lives only in DeviceShell's
27
- * ShellState — so devtools panels / automation that must target "the current
28
- * page's render webContents" resolve it through this signal. Fire-and-forget.
29
- */
30
- readonly ACTIVE_PAGE: "dmb:active-page";
31
- /**
32
- * simulator (DeviceShell) → main: the FULL ordered page stack (bottom→top)
33
- * whenever it changes. Main has no stack of its own (it only learns the
34
- * active bridgeId via ACTIVE_PAGE), so automation's `App.getPageStack` needs
35
- * this to report multi-page stacks. Fire-and-forget.
36
- */
37
- readonly PAGE_STACK: "dmb:page-stack";
38
- };
39
- export declare const SIMULATOR_EVENTS: {
40
- readonly DOM_READY: "simulator:dom-ready";
41
- readonly NAV_BAR: "simulator:navigation-bar";
42
- readonly NAV_ACTION: "simulator:nav-action";
43
- readonly TAB_ACTION: "simulator:tab-action";
44
- /** main → simulator: invoke a wx.* API on the simulator-resident MiniApp. */
45
- readonly API_CALL: "simulator:api-call";
46
- /**
47
- * main → simulator: the renderer toolbar picked a different device. Carries a
48
- * NativeDeviceInfo; DeviceShell resizes the bezel + re-renders status bar /
49
- * notch. The race-free INITIAL device rides NativeHostConfig.device (read
50
- * synchronously at preload bridge-install); this event covers live changes.
51
- */
52
- readonly DEVICE_CHANGE: "simulator:device-change";
53
- /**
54
- * main → simulator: a watcher rebuild finished; boot a NEW app session for
55
- * the carried url ({@link RelaunchPayload}) IN PLACE, keeping the live
56
- * DeviceShell painted, and swap once the new session's root page reports
57
- * DOM_READY (ready-then-swap soft reload). Main sends this only when the
58
- * shell is live+ready; otherwise the renderer falls back to the hard
59
- * attachNativeSimulator rebuild.
60
- */
61
- readonly RELAUNCH: "simulator:relaunch";
62
- };
63
- /**
64
- * `simulator:relaunch` payload. `url` is a full simulator URL (same format as
65
- * the simulator page's own location / AttachNative), carrying the appId and
66
- * the page route the new session must boot at.
67
- */
68
- export interface RelaunchPayload {
69
- url: string;
70
- }
71
- export declare const CHANNELS: {
72
- readonly SPAWN: "dmb:spawn";
73
- readonly DISPOSE: "dmb:dispose";
74
- readonly PAGE_OPEN: "dmb:page:open";
75
- readonly PAGE_CLOSE: "dmb:page:close";
76
- readonly PAGE_LIFECYCLE: "dmb:page:lifecycle";
77
- readonly NAV_CALLBACK: "dmb:nav:callback";
78
- readonly SERVICE_INVOKE: "dmb:service:invoke";
79
- readonly SERVICE_PUBLISH: "dmb:service:publish";
80
- readonly RENDER_INVOKE: "dmb:render:invoke";
81
- readonly RENDER_PUBLISH: "dmb:render:publish";
82
- readonly TO_SERVICE: "dmb:to-service";
83
- readonly TO_RENDER: "dmb:to-render";
84
- readonly SIMULATOR_API: "dmb:simulator-api";
85
- /** simulator → main: ack of an API_CALL request (carries success/fail args). */
86
- readonly API_RESPONSE: "dmb:api:response";
87
- /**
88
- * simulator webview preload → main (sendSync): "is native-host mode on?".
89
- * The guest preload can't read the launch `process.env`, so it asks main
90
- * (which can) at install time. Reply is `e.returnValue = boolean`.
91
- */
92
- readonly NATIVE_HOST_ENABLED: "dmb:native-host-enabled";
93
- /**
94
- * simulator (DeviceShell) → main: the visible top-of-stack page bridgeId.
95
- * Main has no z-order concept — the active page lives only in DeviceShell's
96
- * ShellState — so devtools panels / automation that must target "the current
97
- * page's render webContents" resolve it through this signal. Fire-and-forget.
98
- */
99
- readonly ACTIVE_PAGE: "dmb:active-page";
100
- /**
101
- * simulator (DeviceShell) → main: the FULL ordered page stack (bottom→top)
102
- * whenever it changes. Main has no stack of its own (it only learns the
103
- * active bridgeId via ACTIVE_PAGE), so automation's `App.getPageStack` needs
104
- * this to report multi-page stacks. Fire-and-forget.
105
- */
106
- readonly PAGE_STACK: "dmb:page-stack";
107
- };
108
- /**
109
- * Reply to a `NATIVE_HOST_ENABLED` sendSync. Main supplies the render-host
110
- * file:// URLs (computed with node:path/url, which the simulator webview's
111
- * preload lacks) so the preload can build the native-host bridge.
112
- */
113
- export interface NativeHostConfig {
114
- enabled: boolean;
115
- renderHostHtmlUrl: string;
116
- renderPreloadUrl: string;
117
- /**
118
- * The currently-selected device, if the renderer already pushed it before the
119
- * simulator WCV's preload installed (it does — SetDeviceInfo precedes
120
- * AttachNative). DeviceShell reads this as its initial device so it never
121
- * mounts with the wrong bezel size while waiting for the first DEVICE_CHANGE.
122
- * Absent only on the pre-spawn default path.
123
- */
124
- device?: NativeDeviceInfo;
125
- }
126
- export type BridgeChannel = typeof BRIDGE_CHANNELS[keyof typeof BRIDGE_CHANNELS];
127
- export type BridgeTarget = 'service' | 'render' | 'container';
128
- export type BridgeMessageType = 'loadResource' | 'serviceResourceLoaded' | 'renderResourceLoaded' | 'resourceLoaded' | 'firstRender' | 'appShow' | 'appHide' | 'stackShow' | 'stackHide' | 'pageShow' | 'pageHide' | 'pageReady' | 'pageUnload' | 'pageScroll' | 'pageResize' | 'pageRouteDone' | 'mC' | 'mR' | 'mU' | 't' | 'u' | 'ub' | 'triggerCallback' | 'invokeAPI' | 'h5SdkAction' | 'componentError' | 'domReady' | 'print' | 'renderHostReady' | 'serviceHostError' | string;
129
- export interface MessageEnvelope<TBody extends Record<string, unknown> = Record<string, unknown>> {
130
- type: BridgeMessageType;
131
- target: BridgeTarget;
132
- body: TBody;
133
- }
134
- export interface HostEnvSnapshot {
135
- brand: string;
136
- model: string;
137
- platform: string;
138
- system: string;
139
- version: string;
140
- SDKVersion: string;
141
- pixelRatio: number;
142
- screenWidth: number;
143
- screenHeight: number;
144
- windowWidth: number;
145
- windowHeight: number;
146
- statusBarHeight: number;
147
- language: string;
148
- theme: string;
149
- [key: string]: unknown;
150
- }
151
- /**
152
- * Map the renderer's logical device metrics onto the subset of a
153
- * HostEnvSnapshot the service-host window's `getSystemInfoSync` consumes.
154
- * `windowHeight` excludes the status bar (the page area); `windowWidth` has no
155
- * horizontal chrome. Zoom is intentionally absent — it is a display scale, not
156
- * a logical-size change.
157
- *
158
- * Single source of truth for the device→host-env mapping, shared by the live
159
- * `SetDeviceInfo` IPC path (main/ipc/simulator.ts) and the per-spawn host-env
160
- * seeding (main/ipc/bridge-router.ts). Keeping them identical guarantees a
161
- * service-host RESPAWN after a device change reports the same dims the live
162
- * update pushed — otherwise a respawn would silently revert to the boot device.
163
- */
164
- export declare function deviceInfoToHostEnv(d: NativeDeviceInfo): Partial<HostEnvSnapshot>;
165
- /**
166
- * Subset of WeChat page `window` config plus tabBar list, parsed from
167
- * `app-config.json` (`{app:{window,tabBar,pages,entryPagePath}, modules:{[pagePath]:{window}}}`).
168
- * Mirrors mergePageConfig in dimina-fe: page-level keys override app-level.
169
- */
170
- export interface PageWindowConfig {
171
- navigationBarTitleText?: string;
172
- navigationBarBackgroundColor?: string;
173
- navigationBarTextStyle?: 'black' | 'white';
174
- navigationStyle?: 'default' | 'custom';
175
- homeButton?: boolean;
176
- backgroundColor?: string;
177
- backgroundTextStyle?: 'dark' | 'light';
178
- enablePullDownRefresh?: boolean;
179
- disableScroll?: boolean;
180
- [key: string]: unknown;
181
- }
182
- export interface TabBarItem {
183
- pagePath: string;
184
- text?: string;
185
- iconPath?: string;
186
- selectedIconPath?: string;
187
- }
188
- export interface TabBarConfig {
189
- color?: string;
190
- selectedColor?: string;
191
- backgroundColor?: string;
192
- borderStyle?: 'black' | 'white';
193
- position?: 'bottom' | 'top';
194
- custom?: boolean;
195
- list: TabBarItem[];
196
- }
197
- export interface AppManifest {
198
- entryPagePath: string;
199
- pages: string[];
200
- tabBar?: TabBarConfig;
201
- /**
202
- * Provenance of this manifest: `'app-config'` when built from a real
203
- * compiled `app-config.json` (its `pages` list is authoritative, so mount
204
- * gates can validate membership against it); `'fallback'` when
205
- * app-config.json was unreachable and the manifest is a single-page stand-in
206
- * built from the spawn request. Mount gates only enforce against
207
- * `'app-config'` — a `'fallback'` manifest has no compiled truth to check
208
- * membership against, so it must let every page/nav target through.
209
- */
210
- source: 'app-config' | 'fallback';
211
- }
212
- export interface SpawnRequest {
213
- simulatorWcId?: number;
214
- appId: string;
215
- bridgeId?: string;
216
- pagePath?: string;
217
- scene?: number;
218
- query?: Record<string, unknown>;
219
- apiNamespaces?: string[];
220
- hostEnvSnapshot?: Partial<HostEnvSnapshot>;
221
- pkgRoot?: string;
222
- root?: string;
223
- /**
224
- * Base URL of the dev server that serves the compiled mini-app, i.e. the
225
- * SAME origin the simulator page was loaded from (`http://localhost:<port>/`).
226
- * The dev server statically serves `<appId>/<root>/…` (app-config.json,
227
- * logic.js, page bundles, styles) — exactly what the default dimina-fe
228
- * `<webview>` fetches. The native-host render + service hosts source every
229
- * resource from here, so we don't need a second resource server or a local
230
- * compiled-output path. Trailing slash expected.
231
- */
232
- resourceBaseUrl?: string;
233
- }
234
- export interface SpawnResult {
235
- appSessionId: string;
236
- bridgeId: string;
237
- /** The pagePath originally requested (unchanged even when a fallback applied — see `resolvedPagePath`). */
238
- pagePath: string;
239
- /**
240
- * The pagePath the root PageSession was ACTUALLY spawned with. Equal to
241
- * `pagePath` unless `pageFallbackApplied` is true, in which case the request
242
- * was absent from `manifest.pages` and this is `manifest.entryPagePath`
243
- * (or `manifest.pages[0]` when even that isn't a member). Callers that cache
244
- * "the current page" (e.g. `SimulatorMiniApp`) must reconcile against this,
245
- * not the original request.
246
- */
247
- resolvedPagePath: string;
248
- /** Whether `resolvedPagePath` differs from the request because it was absent from the compiled manifest. Always false for a `'fallback'` manifest (nothing to validate against). */
249
- pageFallbackApplied: boolean;
250
- serviceWcId: number;
251
- resourceBaseUrl: string;
252
- manifest: AppManifest;
253
- rootWindowConfig: PageWindowConfig;
254
- }
255
- export interface PageOpenRequest {
256
- appSessionId: string;
257
- pagePath: string;
258
- query?: Record<string, unknown>;
259
- bridgeId?: string;
260
- }
261
- export interface PageOpenResult {
262
- bridgeId: string;
263
- pagePath: string;
264
- windowConfig: PageWindowConfig;
265
- isTab: boolean;
266
- }
267
- export interface PageClosePayload {
268
- bridgeId: string;
269
- }
270
- export interface DisposePayload {
271
- /** AppSession root bridgeId (legacy) or any page bridgeId. */
272
- bridgeId: string;
273
- }
274
- export type PageLifecycleEvent = 'pageShow' | 'pageHide' | 'pageUnload' | 'stackShow' | 'stackHide' | 'appShow' | 'appHide';
275
- export interface PageLifecyclePayload {
276
- appSessionId: string;
277
- bridgeId: string;
278
- event: PageLifecycleEvent;
279
- }
280
- /**
281
- * Sent by simulator after a routing action (navigateTo etc.) completes so the
282
- * main process can call sendCallback() against the original service-issued
283
- * success/fail/complete ids.
284
- */
285
- export interface NavCallbackPayload {
286
- appSessionId: string;
287
- ok: boolean;
288
- errMsg: string;
289
- callbacks: {
290
- success?: unknown;
291
- fail?: unknown;
292
- complete?: unknown;
293
- };
294
- }
295
- export interface ServiceInvokePayload {
296
- bridgeId: string;
297
- msg: MessageEnvelope;
298
- }
299
- export interface ServicePublishPayload {
300
- bridgeId: string;
301
- targetBridgeId?: string;
302
- msg: MessageEnvelope;
303
- }
304
- /**
305
- * `dmb:active-page` — simulator (DeviceShell) → main. Records which page is the
306
- * visible top-of-stack so main-side services (WXML/element-inspect, automation)
307
- * can resolve "the active page's render webContents" by bridgeId.
308
- */
309
- export interface ActivePagePayload {
310
- appSessionId: string;
311
- bridgeId: string;
312
- }
313
- /**
314
- * `dmb:page-stack` — simulator (DeviceShell) → main. The full ordered page
315
- * stack (bottom→top) so `App.getPageStack` can report multi-page stacks.
316
- */
317
- export interface PageStackEntry {
318
- pagePath: string;
319
- query: Record<string, unknown>;
320
- }
321
- export interface PageStackPayload {
322
- appSessionId: string;
323
- stack: PageStackEntry[];
324
- }
325
- export interface RenderInvokePayload {
326
- bridgeId: string;
327
- msg: MessageEnvelope;
328
- }
329
- export interface RenderPublishPayload {
330
- bridgeId: string;
331
- msg: MessageEnvelope;
332
- }
333
- export interface ToServicePayload {
334
- msg: MessageEnvelope;
335
- }
336
- export interface ToRenderPayload {
337
- msg: MessageEnvelope;
338
- }
339
- export interface SimulatorApiInvokePayload {
340
- bridgeId: string;
341
- name: string;
342
- params: unknown;
343
- }
344
- /**
345
- * `simulator:nav-action` — main → simulator window, carries router/tabBar
346
- * intentions. Simulator owns the visual stack state and decides whether to
347
- * push/pop webviews; it then calls back PAGE_LIFECYCLE + NAV_CALLBACK.
348
- */
349
- export interface NavActionPayload {
350
- appSessionId: string;
351
- bridgeId: string;
352
- name: 'navigateTo' | 'navigateBack' | 'redirectTo' | 'reLaunch' | 'switchTab';
353
- params: Record<string, unknown>;
354
- callbacks: {
355
- success?: unknown;
356
- fail?: unknown;
357
- complete?: unknown;
358
- };
359
- }
360
- /**
361
- * `simulator:api-call` — main → simulator. Fallback path used when an
362
- * invokeAPI name is not registered in the main-process `ctx.simulatorApis`
363
- * registry: the simulator-resident MiniApp owns the wx.* handler (it can
364
- * read DOM, open file pickers, etc.), so we forward the call there and wait
365
- * for an `API_RESPONSE` ack.
366
- */
367
- export interface ApiCallPayload {
368
- appSessionId: string;
369
- bridgeId: string;
370
- requestId: string;
371
- name: string;
372
- params: Record<string, unknown>;
373
- callbacks: {
374
- success?: unknown;
375
- fail?: unknown;
376
- complete?: unknown;
377
- };
378
- }
379
- /**
380
- * `dmb:api:response` — simulator → main. Ack for an `API_CALL`. Main looks
381
- * up `requestId` in its pending map and fires the original service-side
382
- * success/fail/complete callbacks accordingly.
383
- */
384
- export interface ApiResponsePayload {
385
- appSessionId: string;
386
- requestId: string;
387
- ok: boolean;
388
- /** Argument the simulator-side success/fail callback was invoked with. */
389
- result?: unknown;
390
- errMsg?: string;
391
- /**
392
- * Persistent-subscription marker (`keep: true` APIs, e.g.
393
- * `audioListen`). When set, this response is one of potentially many
394
- * fires of the same subscription: main re-fires the service-side success
395
- * callback but keeps the pendingApiCall alive (does not delete it or fire
396
- * `complete`) so subsequent fires of the same `requestId` are delivered.
397
- * Cleanup happens on page/app teardown instead.
398
- */
399
- keep?: boolean;
400
- }
401
- /**
402
- * `simulator:tab-action` — main → simulator window, carries dynamic TabBar
403
- * API calls. Simulator updates TabBar React state and acknowledges via
404
- * NAV_CALLBACK so the service-side wx.* callback fires.
405
- */
406
- export interface TabActionPayload {
407
- appSessionId: string;
408
- bridgeId: string;
409
- name: 'setTabBarStyle' | 'setTabBarItem' | 'showTabBar' | 'hideTabBar' | 'setTabBarBadge' | 'removeTabBarBadge' | 'showTabBarRedDot' | 'hideTabBarRedDot';
410
- params: Record<string, unknown>;
411
- callbacks: {
412
- success?: unknown;
413
- fail?: unknown;
414
- complete?: unknown;
415
- };
416
- }
1
+ export * from '@dimina-kit/electron-runtime/shared/bridge-channels';
417
2
  //# sourceMappingURL=bridge-channels.d.ts.map
@@ -1,90 +1,2 @@
1
- export const BRIDGE_CHANNELS = {
2
- SPAWN: 'dmb:spawn',
3
- DISPOSE: 'dmb:dispose',
4
- PAGE_OPEN: 'dmb:page:open',
5
- PAGE_CLOSE: 'dmb:page:close',
6
- PAGE_LIFECYCLE: 'dmb:page:lifecycle',
7
- NAV_CALLBACK: 'dmb:nav:callback',
8
- SERVICE_INVOKE: 'dmb:service:invoke',
9
- SERVICE_PUBLISH: 'dmb:service:publish',
10
- RENDER_INVOKE: 'dmb:render:invoke',
11
- RENDER_PUBLISH: 'dmb:render:publish',
12
- TO_SERVICE: 'dmb:to-service',
13
- TO_RENDER: 'dmb:to-render',
14
- SIMULATOR_API: 'dmb:simulator-api',
15
- /** simulator → main: ack of an API_CALL request (carries success/fail args). */
16
- API_RESPONSE: 'dmb:api:response',
17
- /**
18
- * simulator webview preload → main (sendSync): "is native-host mode on?".
19
- * The guest preload can't read the launch `process.env`, so it asks main
20
- * (which can) at install time. Reply is `e.returnValue = boolean`.
21
- */
22
- NATIVE_HOST_ENABLED: 'dmb:native-host-enabled',
23
- /**
24
- * simulator (DeviceShell) → main: the visible top-of-stack page bridgeId.
25
- * Main has no z-order concept — the active page lives only in DeviceShell's
26
- * ShellState — so devtools panels / automation that must target "the current
27
- * page's render webContents" resolve it through this signal. Fire-and-forget.
28
- */
29
- ACTIVE_PAGE: 'dmb:active-page',
30
- /**
31
- * simulator (DeviceShell) → main: the FULL ordered page stack (bottom→top)
32
- * whenever it changes. Main has no stack of its own (it only learns the
33
- * active bridgeId via ACTIVE_PAGE), so automation's `App.getPageStack` needs
34
- * this to report multi-page stacks. Fire-and-forget.
35
- */
36
- PAGE_STACK: 'dmb:page-stack',
37
- };
38
- export const SIMULATOR_EVENTS = {
39
- DOM_READY: 'simulator:dom-ready',
40
- NAV_BAR: 'simulator:navigation-bar',
41
- NAV_ACTION: 'simulator:nav-action',
42
- TAB_ACTION: 'simulator:tab-action',
43
- /** main → simulator: invoke a wx.* API on the simulator-resident MiniApp. */
44
- API_CALL: 'simulator:api-call',
45
- /**
46
- * main → simulator: the renderer toolbar picked a different device. Carries a
47
- * NativeDeviceInfo; DeviceShell resizes the bezel + re-renders status bar /
48
- * notch. The race-free INITIAL device rides NativeHostConfig.device (read
49
- * synchronously at preload bridge-install); this event covers live changes.
50
- */
51
- DEVICE_CHANGE: 'simulator:device-change',
52
- /**
53
- * main → simulator: a watcher rebuild finished; boot a NEW app session for
54
- * the carried url ({@link RelaunchPayload}) IN PLACE, keeping the live
55
- * DeviceShell painted, and swap once the new session's root page reports
56
- * DOM_READY (ready-then-swap soft reload). Main sends this only when the
57
- * shell is live+ready; otherwise the renderer falls back to the hard
58
- * attachNativeSimulator rebuild.
59
- */
60
- RELAUNCH: 'simulator:relaunch',
61
- };
62
- export const CHANNELS = BRIDGE_CHANNELS;
63
- /**
64
- * Map the renderer's logical device metrics onto the subset of a
65
- * HostEnvSnapshot the service-host window's `getSystemInfoSync` consumes.
66
- * `windowHeight` excludes the status bar (the page area); `windowWidth` has no
67
- * horizontal chrome. Zoom is intentionally absent — it is a display scale, not
68
- * a logical-size change.
69
- *
70
- * Single source of truth for the device→host-env mapping, shared by the live
71
- * `SetDeviceInfo` IPC path (main/ipc/simulator.ts) and the per-spawn host-env
72
- * seeding (main/ipc/bridge-router.ts). Keeping them identical guarantees a
73
- * service-host RESPAWN after a device change reports the same dims the live
74
- * update pushed — otherwise a respawn would silently revert to the boot device.
75
- */
76
- export function deviceInfoToHostEnv(d) {
77
- return {
78
- brand: d.brand,
79
- model: d.model,
80
- system: d.system,
81
- platform: d.platform,
82
- pixelRatio: d.pixelRatio,
83
- screenWidth: d.screenWidth,
84
- screenHeight: d.screenHeight,
85
- windowWidth: d.screenWidth,
86
- windowHeight: Math.max(0, d.screenHeight - d.statusBarHeight),
87
- statusBarHeight: d.statusBarHeight,
88
- };
89
- }
1
+ export * from '@dimina-kit/electron-runtime/shared/bridge-channels';
90
2
  //# sourceMappingURL=bridge-channels.js.map
@@ -0,0 +1,73 @@
1
+ /**
2
+ * In-memory compile-mode model: selection tracks a minted id, not an index
3
+ * into a list. Storage (`CompileModes`, WeChat's `condition.miniprogram`
4
+ * shape) stays index-based so `project.config.json` keeps round-tripping —
5
+ * `stateFromStored`/`storedFromState` are the only two places index
6
+ * arithmetic happens at all. Everywhere else (in particular
7
+ * `applyCompileModeCommand`) only ever compares/reassigns ids, so deleting or
8
+ * reordering entries can never select the wrong mode by shifting a stale
9
+ * index onto it.
10
+ */
11
+ import { type CompileMode, type CompileModes } from './compile-modes.js';
12
+ export type CompileModeId = string;
13
+ export interface CompileModeEntry {
14
+ id: CompileModeId;
15
+ mode: CompileMode;
16
+ }
17
+ export interface CompileModeState {
18
+ /** `null` selects 普通编译. */
19
+ selectedId: CompileModeId | null;
20
+ entries: CompileModeEntry[];
21
+ }
22
+ export type MintId = () => CompileModeId;
23
+ /** An empty model — no custom modes, 普通编译 selected. */
24
+ export declare function emptyCompileModeState(): CompileModeState;
25
+ /**
26
+ * Build the in-memory state from whatever is on disk, minting a fresh id for
27
+ * each surviving entry in list order. Selection is carried across as the
28
+ * entry's identity (the freshly minted id), not the raw numeric `current` —
29
+ * `normalizeCompileModes` may have already remapped `current` when dropping
30
+ * a malformed earlier entry, so the id assigned here already points at the
31
+ * same data the stored `current` named.
32
+ */
33
+ export declare function stateFromStored(raw: unknown, mintId: MintId): CompileModeState;
34
+ /** Project the in-memory state back into the on-disk index-based shape. */
35
+ export declare function storedFromState(state: CompileModeState): CompileModes;
36
+ /** The selected entry's mode, or `null` for 普通编译 (including a ghost id). */
37
+ export declare function selectedMode(state: CompileModeState): CompileMode | null;
38
+ export type CompileModeCommand = {
39
+ type: 'select';
40
+ id: CompileModeId | null;
41
+ } | {
42
+ type: 'add';
43
+ mode: CompileMode;
44
+ } | {
45
+ type: 'update';
46
+ id: CompileModeId;
47
+ mode: CompileMode;
48
+ } | {
49
+ type: 'remove';
50
+ id: CompileModeId;
51
+ };
52
+ export interface CompileModeApplyResult {
53
+ state: CompileModeState;
54
+ relaunch: boolean;
55
+ }
56
+ /** A `CompileModeStore`'s current contents, tagged with a monotonic revision so a stale fetch racing a push can be told apart from a fresher one. */
57
+ export interface CompileModeSnapshot {
58
+ revision: number;
59
+ state: CompileModeState;
60
+ }
61
+ /** A snapshot plus whether the change affects what's currently running, for `RendererNotifier.compileModesChanged` pushes. */
62
+ export interface CompileModeChange extends CompileModeSnapshot {
63
+ relaunch: boolean;
64
+ }
65
+ /**
66
+ * Interpret one command against the current state. `relaunch` reports
67
+ * whether the running configuration changed, so a caller only restarts the
68
+ * simulator when the selected mode itself moved. A command that names an id
69
+ * nothing matches is a no-op and returns the SAME state reference (not a
70
+ * copy) so a caller can cheaply tell "nothing changed" from "changed".
71
+ */
72
+ export declare function applyCompileModeCommand(state: CompileModeState, command: CompileModeCommand, mintId: MintId): CompileModeApplyResult;
73
+ //# sourceMappingURL=compile-mode-state.d.ts.map
@@ -0,0 +1,100 @@
1
+ /**
2
+ * In-memory compile-mode model: selection tracks a minted id, not an index
3
+ * into a list. Storage (`CompileModes`, WeChat's `condition.miniprogram`
4
+ * shape) stays index-based so `project.config.json` keeps round-tripping —
5
+ * `stateFromStored`/`storedFromState` are the only two places index
6
+ * arithmetic happens at all. Everywhere else (in particular
7
+ * `applyCompileModeCommand`) only ever compares/reassigns ids, so deleting or
8
+ * reordering entries can never select the wrong mode by shifting a stale
9
+ * index onto it.
10
+ */
11
+ import { NORMAL_COMPILE_INDEX, normalizeCompileModes, } from './compile-modes.js';
12
+ /** An empty model — no custom modes, 普通编译 selected. */
13
+ export function emptyCompileModeState() {
14
+ return { selectedId: null, entries: [] };
15
+ }
16
+ /**
17
+ * Build the in-memory state from whatever is on disk, minting a fresh id for
18
+ * each surviving entry in list order. Selection is carried across as the
19
+ * entry's identity (the freshly minted id), not the raw numeric `current` —
20
+ * `normalizeCompileModes` may have already remapped `current` when dropping
21
+ * a malformed earlier entry, so the id assigned here already points at the
22
+ * same data the stored `current` named.
23
+ */
24
+ export function stateFromStored(raw, mintId) {
25
+ const stored = normalizeCompileModes(raw);
26
+ const entries = stored.list.map((mode) => ({ id: mintId(), mode }));
27
+ const selectedId = stored.current >= 0 && stored.current < entries.length
28
+ ? entries[stored.current].id
29
+ : null;
30
+ return { selectedId, entries };
31
+ }
32
+ /** Project the in-memory state back into the on-disk index-based shape. */
33
+ export function storedFromState(state) {
34
+ const list = state.entries.map((entry) => entry.mode);
35
+ const current = state.selectedId === null
36
+ ? NORMAL_COMPILE_INDEX
37
+ : state.entries.findIndex((entry) => entry.id === state.selectedId);
38
+ return { current: current < 0 ? NORMAL_COMPILE_INDEX : current, list };
39
+ }
40
+ /** The selected entry's mode, or `null` for 普通编译 (including a ghost id). */
41
+ export function selectedMode(state) {
42
+ if (state.selectedId === null)
43
+ return null;
44
+ return state.entries.find((entry) => entry.id === state.selectedId)?.mode ?? null;
45
+ }
46
+ /**
47
+ * Interpret one command against the current state. `relaunch` reports
48
+ * whether the running configuration changed, so a caller only restarts the
49
+ * simulator when the selected mode itself moved. A command that names an id
50
+ * nothing matches is a no-op and returns the SAME state reference (not a
51
+ * copy) so a caller can cheaply tell "nothing changed" from "changed".
52
+ */
53
+ export function applyCompileModeCommand(state, command, mintId) {
54
+ switch (command.type) {
55
+ case 'select': {
56
+ if (command.id === null) {
57
+ return { state: { ...state, selectedId: null }, relaunch: true };
58
+ }
59
+ if (!state.entries.some((entry) => entry.id === command.id)) {
60
+ return { state, relaunch: false };
61
+ }
62
+ return { state: { ...state, selectedId: command.id }, relaunch: true };
63
+ }
64
+ case 'add': {
65
+ const entry = { id: mintId(), mode: command.mode };
66
+ return {
67
+ state: { selectedId: entry.id, entries: [...state.entries, entry] },
68
+ relaunch: true,
69
+ };
70
+ }
71
+ case 'update': {
72
+ const index = state.entries.findIndex((entry) => entry.id === command.id);
73
+ if (index < 0) {
74
+ const entry = { id: mintId(), mode: command.mode };
75
+ return {
76
+ state: { selectedId: entry.id, entries: [...state.entries, entry] },
77
+ relaunch: true,
78
+ };
79
+ }
80
+ const entries = [...state.entries];
81
+ entries[index] = { id: command.id, mode: command.mode };
82
+ return {
83
+ state: { ...state, entries },
84
+ relaunch: state.selectedId === command.id,
85
+ };
86
+ }
87
+ case 'remove': {
88
+ if (!state.entries.some((entry) => entry.id === command.id)) {
89
+ return { state, relaunch: false };
90
+ }
91
+ const entries = state.entries.filter((entry) => entry.id !== command.id);
92
+ const wasSelected = state.selectedId === command.id;
93
+ return {
94
+ state: { selectedId: wasSelected ? null : state.selectedId, entries },
95
+ relaunch: wasSelected,
96
+ };
97
+ }
98
+ }
99
+ }
100
+ //# sourceMappingURL=compile-mode-state.js.map