@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,152 @@
1
+ /**
2
+ * Single source of truth for the compile-mode model: the named modes a
3
+ * project defines, which one is selected, and how that selection resolves
4
+ * into the launch parameters a compile runs with.
5
+ *
6
+ * The stored form (`CompileModes`) is WeChat DevTools' `condition.miniprogram`
7
+ * shape, so `project.config.json` round-trips between both tools. Everything
8
+ * here is pure — the storage side lives in main's `project-repository.ts`,
9
+ * the UI side in the compile-mode popover.
10
+ */
11
+ /**
12
+ * The launch parameters a compile actually runs with, after resolving the
13
+ * selected compile mode. Derived, never the stored form — see `CompileModes`.
14
+ */
15
+ export interface CompileConfig {
16
+ startPage: string;
17
+ scene: number;
18
+ queryParams: {
19
+ key: string;
20
+ value: string;
21
+ }[];
22
+ }
23
+ /**
24
+ * One named compile mode. Field names and shape mirror WeChat DevTools'
25
+ * `project.config.json` → `condition.miniprogram.list[]` entry so the same
26
+ * file round-trips between both tools; `query` is therefore the raw
27
+ * `k=v&k2=v2` string it stores, not parsed pairs.
28
+ *
29
+ * `launchMode` / `partialCompile` are WeChat's own fields. We neither read
30
+ * nor write them, but they ride along on every mode so saving from here
31
+ * never drops what the other tool put in the file.
32
+ */
33
+ export interface CompileMode {
34
+ name: string;
35
+ pathName: string;
36
+ query: string;
37
+ /** `null` means "unset" — the resolver falls back to `DEFAULT_SCENE`. */
38
+ scene: number | null;
39
+ launchMode?: unknown;
40
+ partialCompile?: unknown;
41
+ }
42
+ /**
43
+ * A project's compile modes plus which one is selected. This is the stored
44
+ * form; the effective `CompileConfig` is resolved from it
45
+ * (`resolveCompileConfig` below).
46
+ */
47
+ export interface CompileModes {
48
+ /** Index into `list`. `-1` (`NORMAL_COMPILE_INDEX`) selects 普通编译. */
49
+ current: number;
50
+ list: CompileMode[];
51
+ }
52
+ /**
53
+ * `CompileModes.current` value selecting 普通编译 — launch the app's own
54
+ * entry page with the default scene and no params. It is not an entry in
55
+ * `list`: 普通编译 is fixed and has nothing to edit, matching WeChat, where
56
+ * the same fixed item sits above the custom list at index -1.
57
+ */
58
+ export declare const NORMAL_COMPILE_INDEX = -1;
59
+ /**
60
+ * Stand-in for a custom mode the user never named. It must not read as
61
+ * 普通编译: a mode can legitimately have an empty name AND an empty
62
+ * `pathName` (its 启动页面 left on 默认为首页) while still carrying params or
63
+ * a scene, and calling that 普通编译 would tell the user they are running
64
+ * something they are not.
65
+ */
66
+ export declare const UNNAMED_MODE_LABEL = "\u672A\u547D\u540D\u6A21\u5F0F";
67
+ /**
68
+ * Parse a raw `k=v&k2=v2` query string into ordered pairs.
69
+ *
70
+ * Unlike `decodePageSpec` (which yields a `Record` and so silently collapses
71
+ * repeats), this preserves order and duplicate keys — the k/v editor shows
72
+ * exactly what the user typed into the raw field, including `a=1&a=2`.
73
+ * A bare segment with no `=` parses to an empty value.
74
+ */
75
+ export declare function parseQueryString(query: string): {
76
+ key: string;
77
+ value: string;
78
+ }[];
79
+ /**
80
+ * Serialize ordered pairs back into a raw query string. Rows with an empty
81
+ * key are dropped — the k/v editor keeps a blank row around while the user
82
+ * is still typing, and a blank row is not a parameter.
83
+ */
84
+ export declare function stringifyQueryParams(params: {
85
+ key: string;
86
+ value: string;
87
+ }[]): string;
88
+ /**
89
+ * Resolve the selected mode into the launch parameters. 普通编译 (and any
90
+ * out-of-range `current`, which a hand-edited config file can produce)
91
+ * resolves to an empty `startPage`; the caller substitutes the project's own
92
+ * entry page for it, since only the caller knows the project.
93
+ */
94
+ export declare function resolveCompileConfig(modes: CompileModes): CompileConfig;
95
+ /**
96
+ * The id-based model's counterpart to `resolveCompileConfig`: derives the
97
+ * launch parameters straight from a single already-selected mode (or the
98
+ * normal-compile default for `null`) without any index/list to consult.
99
+ */
100
+ export declare function compileConfigFromMode(mode: CompileMode | null): CompileConfig;
101
+ /**
102
+ * Text for the toolbar's compile-mode button: the selected mode's name,
103
+ * falling back to its start page when the user left the name blank, so an
104
+ * unnamed mode is still identifiable. Only `null` (nothing selected) may
105
+ * produce the 普通编译 label — see {@link UNNAMED_MODE_LABEL}.
106
+ */
107
+ export declare function compileModeLabel(mode: CompileMode | null): string;
108
+ /**
109
+ * Coerce whatever is on disk into a usable `CompileModes`. The source is a
110
+ * user-editable JSON file that another tool also writes, so every field is
111
+ * treated as untrusted: a malformed file degrades to 普通编译 rather than
112
+ * failing the project open.
113
+ */
114
+ export declare function normalizeCompileModes(raw: unknown): CompileModes;
115
+ /** An empty model — no custom modes, 普通编译 selected. */
116
+ export declare function emptyCompileModes(): CompileModes;
117
+ /**
118
+ * Build a mode out of resolved launch parameters. Used to migrate a legacy
119
+ * single compile config into the list, and by the popover when the user
120
+ * turns the simulator's current page into a mode.
121
+ */
122
+ export declare function compileConfigToMode(config: CompileConfig, name: string): CompileMode;
123
+ /**
124
+ * Whether resolved launch parameters are exactly what 普通编译 already
125
+ * launches, and so carry nothing worth surfacing as a named mode. An empty
126
+ * `startPage` means "the app's own entry page", which is what 普通编译 is;
127
+ * `entryPagePath` lets a caller that knows the project also recognize a config
128
+ * that names that page outright.
129
+ */
130
+ export declare function isNormalCompile(config: CompileConfig, entryPagePath: string): boolean;
131
+ /**
132
+ * Project a single legacy compile config into the mode list, as one unnamed
133
+ * selected mode — unless it asks for nothing 普通编译 can't already do, in
134
+ * which case the list stays empty rather than gaining a mode that says the
135
+ * same thing as the fixed entry above it.
136
+ *
137
+ * Both places that meet the older single-config form go through here: the
138
+ * project repository migrating `dimina-projects.json`, and the workspace
139
+ * adapter reading a host that only implements `getCompileConfig`. Callers that
140
+ * can resolve the project's entry page pass it so a config naming that page
141
+ * counts as 普通编译 too.
142
+ */
143
+ export declare function compileConfigToModes(config: CompileConfig, entryPagePath?: string): CompileModes;
144
+ /**
145
+ * Build a mode from a `pagePath?k=v&…` route string — the format
146
+ * `getCurrentPageRoute` reports for the simulator's visible page, which is
147
+ * what "以当前页面新建编译模式" starts from. Scene is left unset so the new
148
+ * mode launches with the default rather than inheriting whatever scene the
149
+ * running session happened to use.
150
+ */
151
+ export declare function routeToMode(route: string, name: string): CompileMode;
152
+ //# sourceMappingURL=compile-modes.d.ts.map
@@ -0,0 +1,237 @@
1
+ /**
2
+ * Single source of truth for the compile-mode model: the named modes a
3
+ * project defines, which one is selected, and how that selection resolves
4
+ * into the launch parameters a compile runs with.
5
+ *
6
+ * The stored form (`CompileModes`) is WeChat DevTools' `condition.miniprogram`
7
+ * shape, so `project.config.json` round-trips between both tools. Everything
8
+ * here is pure — the storage side lives in main's `project-repository.ts`,
9
+ * the UI side in the compile-mode popover.
10
+ */
11
+ import { DEFAULT_SCENE } from './constants.js';
12
+ /**
13
+ * `CompileModes.current` value selecting 普通编译 — launch the app's own
14
+ * entry page with the default scene and no params. It is not an entry in
15
+ * `list`: 普通编译 is fixed and has nothing to edit, matching WeChat, where
16
+ * the same fixed item sits above the custom list at index -1.
17
+ */
18
+ export const NORMAL_COMPILE_INDEX = -1;
19
+ /** Label shown when no custom mode is selected. */
20
+ const NORMAL_COMPILE_LABEL = '普通编译';
21
+ /**
22
+ * Stand-in for a custom mode the user never named. It must not read as
23
+ * 普通编译: a mode can legitimately have an empty name AND an empty
24
+ * `pathName` (its 启动页面 left on 默认为首页) while still carrying params or
25
+ * a scene, and calling that 普通编译 would tell the user they are running
26
+ * something they are not.
27
+ */
28
+ export const UNNAMED_MODE_LABEL = '未命名模式';
29
+ /**
30
+ * Parse a raw `k=v&k2=v2` query string into ordered pairs.
31
+ *
32
+ * Unlike `decodePageSpec` (which yields a `Record` and so silently collapses
33
+ * repeats), this preserves order and duplicate keys — the k/v editor shows
34
+ * exactly what the user typed into the raw field, including `a=1&a=2`.
35
+ * A bare segment with no `=` parses to an empty value.
36
+ */
37
+ export function parseQueryString(query) {
38
+ const pairs = [];
39
+ for (const segment of query.split('&')) {
40
+ if (!segment)
41
+ continue;
42
+ const eqIdx = segment.indexOf('=');
43
+ const rawKey = eqIdx >= 0 ? segment.slice(0, eqIdx) : segment;
44
+ const rawValue = eqIdx >= 0 ? segment.slice(eqIdx + 1) : '';
45
+ if (!rawKey)
46
+ continue;
47
+ pairs.push({ key: safeDecode(rawKey), value: safeDecode(rawValue) });
48
+ }
49
+ return pairs;
50
+ }
51
+ /**
52
+ * Serialize ordered pairs back into a raw query string. Rows with an empty
53
+ * key are dropped — the k/v editor keeps a blank row around while the user
54
+ * is still typing, and a blank row is not a parameter.
55
+ */
56
+ export function stringifyQueryParams(params) {
57
+ return params
58
+ .filter((p) => p.key)
59
+ .map((p) => `${encodeURIComponent(p.key)}=${encodeURIComponent(p.value)}`)
60
+ .join('&');
61
+ }
62
+ /**
63
+ * Resolve the selected mode into the launch parameters. 普通编译 (and any
64
+ * out-of-range `current`, which a hand-edited config file can produce)
65
+ * resolves to an empty `startPage`; the caller substitutes the project's own
66
+ * entry page for it, since only the caller knows the project.
67
+ */
68
+ export function resolveCompileConfig(modes) {
69
+ const { current, list } = modes;
70
+ const mode = Number.isInteger(current) && current >= 0 && current < list.length
71
+ ? list[current] ?? null
72
+ : null;
73
+ return compileConfigFromMode(mode);
74
+ }
75
+ /**
76
+ * The id-based model's counterpart to `resolveCompileConfig`: derives the
77
+ * launch parameters straight from a single already-selected mode (or the
78
+ * normal-compile default for `null`) without any index/list to consult.
79
+ */
80
+ export function compileConfigFromMode(mode) {
81
+ if (!mode) {
82
+ return { startPage: '', scene: DEFAULT_SCENE, queryParams: [] };
83
+ }
84
+ return {
85
+ startPage: mode.pathName,
86
+ scene: mode.scene ?? DEFAULT_SCENE,
87
+ queryParams: parseQueryString(mode.query),
88
+ };
89
+ }
90
+ /**
91
+ * Text for the toolbar's compile-mode button: the selected mode's name,
92
+ * falling back to its start page when the user left the name blank, so an
93
+ * unnamed mode is still identifiable. Only `null` (nothing selected) may
94
+ * produce the 普通编译 label — see {@link UNNAMED_MODE_LABEL}.
95
+ */
96
+ export function compileModeLabel(mode) {
97
+ if (!mode)
98
+ return NORMAL_COMPILE_LABEL;
99
+ return mode.name || mode.pathName || UNNAMED_MODE_LABEL;
100
+ }
101
+ /**
102
+ * Coerce whatever is on disk into a usable `CompileModes`. The source is a
103
+ * user-editable JSON file that another tool also writes, so every field is
104
+ * treated as untrusted: a malformed file degrades to 普通编译 rather than
105
+ * failing the project open.
106
+ */
107
+ export function normalizeCompileModes(raw) {
108
+ if (!isRecord(raw))
109
+ return emptyCompileModes();
110
+ const rawCurrent = Number.isInteger(raw.current)
111
+ ? raw.current
112
+ : NORMAL_COMPILE_INDEX;
113
+ // Dropping a malformed entry shifts every later entry down, so the selection
114
+ // is remapped while the list is built. Keeping the raw index would select a
115
+ // DIFFERENT mode than the file did — the file says 首页, the simulator
116
+ // launches 购物车. A selected entry that is itself dropped falls back to
117
+ // 普通编译.
118
+ const list = [];
119
+ let current = NORMAL_COMPILE_INDEX;
120
+ if (Array.isArray(raw.list)) {
121
+ for (const [index, item] of raw.list.entries()) {
122
+ const mode = normalizeCompileMode(item);
123
+ if (!mode)
124
+ continue;
125
+ if (index === rawCurrent)
126
+ current = list.length;
127
+ list.push(mode);
128
+ }
129
+ }
130
+ return { current, list };
131
+ }
132
+ /** An empty model — no custom modes, 普通编译 selected. */
133
+ export function emptyCompileModes() {
134
+ return { current: NORMAL_COMPILE_INDEX, list: [] };
135
+ }
136
+ /**
137
+ * Build a mode out of resolved launch parameters. Used to migrate a legacy
138
+ * single compile config into the list, and by the popover when the user
139
+ * turns the simulator's current page into a mode.
140
+ */
141
+ export function compileConfigToMode(config, name) {
142
+ return {
143
+ name,
144
+ pathName: config.startPage,
145
+ query: stringifyQueryParams(config.queryParams ?? []),
146
+ scene: config.scene,
147
+ };
148
+ }
149
+ /**
150
+ * Whether resolved launch parameters are exactly what 普通编译 already
151
+ * launches, and so carry nothing worth surfacing as a named mode. An empty
152
+ * `startPage` means "the app's own entry page", which is what 普通编译 is;
153
+ * `entryPagePath` lets a caller that knows the project also recognize a config
154
+ * that names that page outright.
155
+ */
156
+ export function isNormalCompile(config, entryPagePath) {
157
+ return (!config.startPage || config.startPage === entryPagePath)
158
+ && (config.scene ?? DEFAULT_SCENE) === DEFAULT_SCENE
159
+ && (config.queryParams?.length ?? 0) === 0;
160
+ }
161
+ /**
162
+ * Project a single legacy compile config into the mode list, as one unnamed
163
+ * selected mode — unless it asks for nothing 普通编译 can't already do, in
164
+ * which case the list stays empty rather than gaining a mode that says the
165
+ * same thing as the fixed entry above it.
166
+ *
167
+ * Both places that meet the older single-config form go through here: the
168
+ * project repository migrating `dimina-projects.json`, and the workspace
169
+ * adapter reading a host that only implements `getCompileConfig`. Callers that
170
+ * can resolve the project's entry page pass it so a config naming that page
171
+ * counts as 普通编译 too.
172
+ */
173
+ export function compileConfigToModes(config, entryPagePath = '') {
174
+ if (isNormalCompile(config, entryPagePath))
175
+ return emptyCompileModes();
176
+ return { current: 0, list: [compileConfigToMode(config, '')] };
177
+ }
178
+ /**
179
+ * Build a mode from a `pagePath?k=v&…` route string — the format
180
+ * `getCurrentPageRoute` reports for the simulator's visible page, which is
181
+ * what "以当前页面新建编译模式" starts from. Scene is left unset so the new
182
+ * mode launches with the default rather than inheriting whatever scene the
183
+ * running session happened to use.
184
+ */
185
+ export function routeToMode(route, name) {
186
+ const qIdx = route.indexOf('?');
187
+ return {
188
+ name,
189
+ pathName: qIdx >= 0 ? route.slice(0, qIdx) : route,
190
+ query: qIdx >= 0 ? route.slice(qIdx + 1) : '',
191
+ scene: null,
192
+ };
193
+ }
194
+ /**
195
+ * A mode needs a start page to mean anything, so an entry without a string
196
+ * `pathName` is dropped rather than kept as an unlaunchable row. Unknown
197
+ * fields WeChat writes are carried through untouched.
198
+ */
199
+ function normalizeCompileMode(raw) {
200
+ if (!isRecord(raw))
201
+ return null;
202
+ if (typeof raw.pathName !== 'string')
203
+ return null;
204
+ const scene = typeof raw.scene === 'number'
205
+ ? raw.scene
206
+ : typeof raw.scene === 'string' && raw.scene.trim() !== '' && Number.isFinite(Number(raw.scene))
207
+ ? Number(raw.scene)
208
+ : null;
209
+ const mode = {
210
+ name: typeof raw.name === 'string' ? raw.name : '',
211
+ pathName: raw.pathName,
212
+ query: typeof raw.query === 'string' ? raw.query : '',
213
+ scene,
214
+ };
215
+ if ('launchMode' in raw)
216
+ mode.launchMode = raw.launchMode;
217
+ if ('partialCompile' in raw)
218
+ mode.partialCompile = raw.partialCompile;
219
+ return mode;
220
+ }
221
+ /**
222
+ * `decodeURIComponent` throws on a lone `%` — which a user editing the raw
223
+ * query field types on the way to `%20`. Keep the literal text instead of
224
+ * losing the whole field to an exception.
225
+ */
226
+ function safeDecode(value) {
227
+ try {
228
+ return decodeURIComponent(value);
229
+ }
230
+ catch {
231
+ return value;
232
+ }
233
+ }
234
+ function isRecord(value) {
235
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
236
+ }
237
+ //# sourceMappingURL=compile-modes.js.map
@@ -21,4 +21,26 @@ export declare const HEADER_H = 40;
21
21
  * both guard wings are required).
22
22
  */
23
23
  export declare const HOST_TOOLBAR_RUNTIME_MARKER = "--dimina-host-toolbar";
24
+ /**
25
+ * Same guard-marker contract as {@link HOST_TOOLBAR_RUNTIME_MARKER}, for the
26
+ * host-sidebar WebContentsView (`src/preload/runtime/host-sidebar-runtime.ts`).
27
+ */
28
+ export declare const HOST_SIDEBAR_RUNTIME_MARKER = "--dimina-host-sidebar";
29
+ /**
30
+ * Same guard-marker contract as {@link HOST_TOOLBAR_RUNTIME_MARKER}, for the
31
+ * host-dialog WebContentsView (`src/preload/runtime/host-dialog-runtime.ts`).
32
+ */
33
+ export declare const HOST_DIALOG_RUNTIME_MARKER = "--dimina-host-dialog";
34
+ /**
35
+ * Intrinsic width (px) of devtools' own default host-sidebar content (the
36
+ * project-category icon rail). Single source of truth shared by the renderer
37
+ * (`host-sidebar-default.tsx`, which gives its `[data-host-sidebar-root]` this
38
+ * exact width so the width advertiser reports it) and anything in main that
39
+ * needs to reason about the default rail's size. The slot is NOT left pinned
40
+ * at this width: main pushes it once as a seed and immediately returns the
41
+ * slot to 'auto' (see `createDevtoolsRuntime`), so the rail — and any
42
+ * downstream `loadURL`/`loadFile` content that replaces it — advertises its
43
+ * own width from then on, exactly like any other host-sidebar content.
44
+ */
45
+ export declare const HOST_SIDEBAR_DEFAULT_WIDTH = 56;
24
46
  //# sourceMappingURL=constants.d.ts.map
@@ -21,4 +21,26 @@ export const HEADER_H = 40;
21
21
  * both guard wings are required).
22
22
  */
23
23
  export const HOST_TOOLBAR_RUNTIME_MARKER = '--dimina-host-toolbar';
24
+ /**
25
+ * Same guard-marker contract as {@link HOST_TOOLBAR_RUNTIME_MARKER}, for the
26
+ * host-sidebar WebContentsView (`src/preload/runtime/host-sidebar-runtime.ts`).
27
+ */
28
+ export const HOST_SIDEBAR_RUNTIME_MARKER = '--dimina-host-sidebar';
29
+ /**
30
+ * Same guard-marker contract as {@link HOST_TOOLBAR_RUNTIME_MARKER}, for the
31
+ * host-dialog WebContentsView (`src/preload/runtime/host-dialog-runtime.ts`).
32
+ */
33
+ export const HOST_DIALOG_RUNTIME_MARKER = '--dimina-host-dialog';
34
+ /**
35
+ * Intrinsic width (px) of devtools' own default host-sidebar content (the
36
+ * project-category icon rail). Single source of truth shared by the renderer
37
+ * (`host-sidebar-default.tsx`, which gives its `[data-host-sidebar-root]` this
38
+ * exact width so the width advertiser reports it) and anything in main that
39
+ * needs to reason about the default rail's size. The slot is NOT left pinned
40
+ * at this width: main pushes it once as a seed and immediately returns the
41
+ * slot to 'auto' (see `createDevtoolsRuntime`), so the rail — and any
42
+ * downstream `loadURL`/`loadFile` content that replaces it — advertises its
43
+ * own width from then on, exactly like any other host-sidebar content.
44
+ */
45
+ export const HOST_SIDEBAR_DEFAULT_WIDTH = 56;
24
46
  //# sourceMappingURL=constants.js.map
@@ -0,0 +1,2 @@
1
+ export * from '@dimina-kit/electron-runtime/shared/dmb-resource-url';
2
+ //# sourceMappingURL=dmb-resource-url.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from '@dimina-kit/electron-runtime/shared/dmb-resource-url';
2
+ //# sourceMappingURL=dmb-resource-url.js.map
@@ -0,0 +1,162 @@
1
+ /**
2
+ * IPC channel name constants for dimina-devtools' overlay/panel
3
+ * WebContentsViews — layout slots (host-toolbar/host-sidebar/host-dialog),
4
+ * the popover, tooltip, project-create dialog and settings overlays, plus
5
+ * the update flow. Split out of `ipc-channels.ts` (see that file's header)
6
+ * once this group alone pushed it past the repo's file-length threshold —
7
+ * these constants share no runtime dependency on the rest of that file, so
8
+ * the split is a pure line-count relief valve, not a behavior change.
9
+ */
10
+ export declare const ViewChannel: {
11
+ /**
12
+ * Reverse size-advertiser: the host-toolbar WCV's OWN renderer advertises its
13
+ * intrinsic content height so main reserves exactly that much. Payload
14
+ * `{ axis: 'block', extent }`. fire-and-forget (send), NOT invoke.
15
+ */
16
+ readonly HostToolbarAdvertiseHeight: "view:host-toolbar:advertise-height";
17
+ /**
18
+ * main → host-toolbar WCV renderer: per-load MessagePort handshake for the
19
+ * gated narrow channel. On every toolbar `did-finish-load` main creates a
20
+ * `MessageChannelMain` and transfers port2 here
21
+ * (`wc.postMessage(HostToolbarPort, null, [port2])`); the session-resident
22
+ * toolbar runtime preload receives it via `event.ports[0]` and bridges it to
23
+ * the page as `window.diminaHostToolbar`. Envelope both directions:
24
+ * `{ channel: string, payload: unknown }`.
25
+ */
26
+ readonly HostToolbarPort: "view:host-toolbar:port";
27
+ /**
28
+ * main → main-window renderer: push the reserved host-toolbar height so the
29
+ * renderer placeholder div resizes (closing the dynamic-height loop).
30
+ */
31
+ readonly HostToolbarHeightChanged: "view:host-toolbar:height-changed";
32
+ /**
33
+ * main ← main-window renderer (invoke): pull the last NOTIFIED toolbar
34
+ * height retained in main. Mount-time replay companion to
35
+ * `HostToolbarHeightChanged`: the push listener mounts with the project
36
+ * view and the toolbar's size-advertiser deduplicates (never re-reports),
37
+ * so a height pushed while no project view was mounted would otherwise be
38
+ * lost forever (cold start on the project list races it; close-project →
39
+ * reopen hits it deterministically). No payload; resolves a number.
40
+ */
41
+ readonly HostToolbarGetHeight: "view:host-toolbar:get-height";
42
+ /**
43
+ * Reverse size-advertiser for the host-sidebar WCV, mirroring
44
+ * `HostToolbarAdvertiseHeight` on the inline (width) axis instead of block.
45
+ * Payload `{ axis: 'inline', extent }`. fire-and-forget (send), NOT invoke.
46
+ */
47
+ readonly HostSidebarAdvertiseWidth: "view:host-sidebar:advertise-width";
48
+ /**
49
+ * main → host-sidebar WCV renderer: per-load MessagePort handshake, same
50
+ * contract as `HostToolbarPort` (see that entry).
51
+ */
52
+ readonly HostSidebarPort: "view:host-sidebar:port";
53
+ /**
54
+ * main → main-window renderer: push the reserved host-sidebar width so the
55
+ * renderer placeholder div resizes, mirroring `HostToolbarHeightChanged`.
56
+ */
57
+ readonly HostSidebarWidthChanged: "view:host-sidebar:width-changed";
58
+ /**
59
+ * main ← main-window renderer (invoke): pull the last NOTIFIED sidebar
60
+ * width, mirroring `HostToolbarGetHeight`'s mount-time replay role.
61
+ */
62
+ readonly HostSidebarGetWidth: "view:host-sidebar:get-width";
63
+ /**
64
+ * main → main-window renderer: push the project category (`Project.type`)
65
+ * selected in the host-sidebar's content — devtools' own default icon rail,
66
+ * or any downstream replacement that sends on the same channel. No
67
+ * pull/replay companion like `HostSidebarGetWidth`: the default category is
68
+ * a stable initial value regardless of load-order, and nothing is ever sent
69
+ * before the main-window renderer (and thus `ProjectListScreen`) is already
70
+ * mounted.
71
+ */
72
+ readonly HostSidebarCategorySelected: "view:host-sidebar:category-selected";
73
+ /**
74
+ * Reverse size-advertiser for the host-dialog WCV. Unlike the toolbar/sidebar
75
+ * (single-axis, `setBaseDesired`-placed strips), the dialog is a BOTH-AXES
76
+ * overlay positioned by `setOverlayDesired` — main centers it in the main
77
+ * window once it knows both dimensions. One channel carries either axis'
78
+ * report (`{ axis: 'block' | 'inline', extent }`); the dialog's own content
79
+ * advertises both from the same root (see `host-dialog-advertiser.ts`).
80
+ * fire-and-forget (send), NOT invoke.
81
+ *
82
+ * No `HostDialogSizeChanged` / `HostDialogGetSize` counterparts: those exist
83
+ * for toolbar/sidebar so a renderer-owned PLACEHOLDER can replay a size it
84
+ * missed. The dialog has no such placeholder — it is a main-driven overlay
85
+ * shown/hidden on demand (`hostDialog.show()`/`hide()`), so there is nothing
86
+ * in the renderer to replay a size into.
87
+ */
88
+ readonly HostDialogAdvertiseSize: "view:host-dialog:advertise-size";
89
+ /**
90
+ * main → host-dialog WCV renderer: per-load MessagePort handshake, same
91
+ * contract as `HostToolbarPort` (see that entry).
92
+ */
93
+ readonly HostDialogPort: "view:host-dialog:port";
94
+ /**
95
+ * Renderer → main: the window-level placement snapshot (one monotonic epoch
96
+ * per commit tick, one generation per renderer lifetime) that drives the view
97
+ * reconciler. The single source of truth for every managed native view's
98
+ * bounds/visibility/z-order — supersedes the per-view bounds channels above.
99
+ * invoke.
100
+ */
101
+ readonly PlacementSnapshot: "view:placement-snapshot";
102
+ /**
103
+ * main ← main-window renderer (invoke): allocate a fresh placement
104
+ * generation seed for this renderer bootstrap. See
105
+ * renderer-placement-generation.ts for why the seed comes from main
106
+ * (a wall-clock `Date.now()` seed is not guaranteed to exceed main's
107
+ * still-standing high-water mark across two reloads that happen faster
108
+ * than the clock's resolution). No payload; resolves a number.
109
+ */
110
+ readonly AllocatePlacementGeneration: "view:allocate-placement-generation";
111
+ };
112
+ export interface ViewBounds {
113
+ x: number;
114
+ y: number;
115
+ width: number;
116
+ height: number;
117
+ }
118
+ export declare const PopoverChannel: {
119
+ readonly Show: "popover:show";
120
+ readonly Hide: "popover:hide";
121
+ readonly Apply: "popover:apply";
122
+ readonly Closed: "popover:closed";
123
+ readonly Init: "popover:init";
124
+ };
125
+ export declare const OverlayChannel: {
126
+ readonly Ready: "overlay:ready";
127
+ };
128
+ export declare const TooltipChannel: {
129
+ readonly Prepare: "tooltip:prepare";
130
+ readonly Show: "tooltip:show";
131
+ readonly Hide: "tooltip:hide";
132
+ readonly Init: "tooltip:init";
133
+ readonly Measured: "tooltip:measured";
134
+ };
135
+ export declare const ProjectCreateChannel: {
136
+ readonly Show: "projectCreate:show";
137
+ readonly Init: "projectCreate:init";
138
+ readonly Submit: "projectCreate:submit";
139
+ readonly Cancel: "projectCreate:cancel";
140
+ readonly Submitted: "projectCreate:submitted";
141
+ };
142
+ export declare const DevicePickerChannel: {
143
+ readonly Show: "devicePicker:show";
144
+ readonly Init: "devicePicker:init";
145
+ readonly Select: "devicePicker:select";
146
+ readonly Cancel: "devicePicker:cancel";
147
+ readonly Selected: "devicePicker:selected";
148
+ };
149
+ export declare const SettingsChannel: {
150
+ readonly SetVisible: "settings:setVisible";
151
+ readonly ProjectSettingsChanged: "settings:projectSettingsChanged";
152
+ readonly Init: "settings:init";
153
+ };
154
+ export declare const UpdateChannel: {
155
+ readonly Check: "updates:check";
156
+ readonly Download: "updates:download";
157
+ readonly Install: "updates:install";
158
+ readonly DownloadProgress: "updates:downloadProgress";
159
+ readonly Available: "updates:available";
160
+ readonly Close: "updates:close";
161
+ };
162
+ //# sourceMappingURL=ipc-channels-overlays.d.ts.map