@dimina-kit/devtools 0.3.2-dev.20260611063505 → 0.3.2-dev.20260611135124

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 (84) hide show
  1. package/README.md +53 -40
  2. package/dist/main/api.d.ts +4 -2
  3. package/dist/main/api.js +5 -1
  4. package/dist/main/app/app.d.ts +1 -5
  5. package/dist/main/app/app.js +4 -19
  6. package/dist/main/index.bundle.js +238 -392
  7. package/dist/main/ipc/app.d.ts +1 -1
  8. package/dist/main/ipc/app.js +0 -7
  9. package/dist/main/ipc/index.d.ts +0 -2
  10. package/dist/main/ipc/index.js +0 -2
  11. package/dist/main/ipc/settings.d.ts +1 -1
  12. package/dist/main/ipc/settings.js +1 -13
  13. package/dist/main/ipc/simulator-module.d.ts +3 -3
  14. package/dist/main/ipc/simulator-module.js +3 -7
  15. package/dist/main/ipc/simulator.js +1 -12
  16. package/dist/main/runtime/miniapp-runtime.d.ts +138 -28
  17. package/dist/main/runtime/miniapp-runtime.js +6 -11
  18. package/dist/main/services/layout/index.d.ts +0 -11
  19. package/dist/main/services/layout/index.js +0 -23
  20. package/dist/main/services/notifications/renderer-notifier.d.ts +0 -6
  21. package/dist/main/services/notifications/renderer-notifier.js +1 -10
  22. package/dist/main/services/service-host-pool/pool.d.ts +5 -4
  23. package/dist/main/services/views/host-toolbar-port-channel.d.ts +93 -0
  24. package/dist/main/services/views/host-toolbar-port-channel.js +169 -0
  25. package/dist/main/services/views/host-toolbar-session-runtime.d.ts +35 -0
  26. package/dist/main/services/views/host-toolbar-session-runtime.js +55 -0
  27. package/dist/main/services/views/view-manager.d.ts +68 -39
  28. package/dist/main/services/views/view-manager.js +143 -182
  29. package/dist/main/services/workbench-context.d.ts +6 -26
  30. package/dist/main/services/workbench-context.js +0 -14
  31. package/dist/main/services/workspace/workspace-service.js +7 -13
  32. package/dist/main/utils/paths.d.ts +11 -2
  33. package/dist/main/utils/paths.js +11 -2
  34. package/dist/preload/index.d.ts +15 -0
  35. package/dist/preload/index.js +15 -0
  36. package/dist/preload/runtime/host-toolbar-port.d.ts +44 -0
  37. package/dist/preload/runtime/host-toolbar-port.js +127 -0
  38. package/dist/preload/runtime/host-toolbar-runtime.d.ts +41 -0
  39. package/dist/preload/runtime/host-toolbar-runtime.js +49 -0
  40. package/dist/preload/windows/{host-toolbar.cjs → host-toolbar-runtime.cjs} +94 -3
  41. package/dist/preload/windows/host-toolbar-runtime.cjs.map +7 -0
  42. package/dist/preload/windows/host-toolbar-runtime.d.ts +2 -0
  43. package/dist/preload/windows/host-toolbar-runtime.js +13 -0
  44. package/dist/preload/windows/simulator.cjs +0 -2
  45. package/dist/preload/windows/simulator.cjs.map +2 -2
  46. package/dist/preload/windows/simulator.js +0 -2
  47. package/dist/renderer/assets/constants-DI382mTP.js +2 -0
  48. package/dist/renderer/assets/index-DLzjz1wv.js +50 -0
  49. package/dist/renderer/assets/{input-CFHmbOgz.js → input-6fpCXV-n.js} +2 -2
  50. package/dist/renderer/assets/ipc-transport-Bs8Sf1B2.css +1 -0
  51. package/dist/renderer/assets/{ipc-transport-BkKKww3u.js → ipc-transport-D22e4dv7.js} +6 -6
  52. package/dist/renderer/assets/popover-CdGdKkkc.js +2 -0
  53. package/dist/renderer/assets/select-X0sbjwdP.js +2 -0
  54. package/dist/renderer/assets/{settings-Cl4IcWnG.js → settings-CS4jYaCw.js} +2 -2
  55. package/dist/renderer/assets/settings-api-CCWTAao_.js +2 -0
  56. package/dist/renderer/assets/workbenchSettings-Bpzaj3bm.js +8 -0
  57. package/dist/renderer/entries/main/index.html +7 -6
  58. package/dist/renderer/entries/popover/index.html +6 -6
  59. package/dist/renderer/entries/settings/index.html +5 -5
  60. package/dist/renderer/entries/workbench-settings/index.html +5 -5
  61. package/dist/shared/constants.d.ts +18 -0
  62. package/dist/shared/constants.js +18 -0
  63. package/dist/shared/ipc-channels.d.ts +10 -23
  64. package/dist/shared/ipc-channels.js +13 -34
  65. package/dist/shared/ipc-schemas.d.ts +0 -12
  66. package/dist/shared/ipc-schemas.js +0 -12
  67. package/dist/shared/types.d.ts +14 -67
  68. package/package.json +6 -6
  69. package/dist/main/ipc/panels.d.ts +0 -4
  70. package/dist/main/ipc/panels.js +0 -46
  71. package/dist/main/ipc/toolbar.d.ts +0 -4
  72. package/dist/main/ipc/toolbar.js +0 -21
  73. package/dist/main/services/toolbar/toolbar-store.d.ts +0 -23
  74. package/dist/main/services/toolbar/toolbar-store.js +0 -40
  75. package/dist/preload/windows/host-toolbar.cjs.map +0 -7
  76. package/dist/preload/windows/host-toolbar.d.ts +0 -2
  77. package/dist/preload/windows/host-toolbar.js +0 -12
  78. package/dist/renderer/assets/constants-CLAQX6VZ.js +0 -2
  79. package/dist/renderer/assets/index-CZQOpCvg.js +0 -50
  80. package/dist/renderer/assets/ipc-transport-Bv_BVu4T.css +0 -1
  81. package/dist/renderer/assets/popover-h1M7n3tt.js +0 -2
  82. package/dist/renderer/assets/select-kj0n1oYf.js +0 -2
  83. package/dist/renderer/assets/settings-api-CCwo2eOi.js +0 -2
  84. package/dist/renderer/assets/workbenchSettings-BzlpQnve.js +0 -8
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./chunk-DPI0Y_ll.js";import{C as t,E as n,i as r,l as i,w as a}from"./ipc-transport-D22e4dv7.js";import{t as o}from"./input-6fpCXV-n.js";import{o as s,r as c,t as l,v as u}from"./select-X0sbjwdP.js";import{n as d}from"./constants-DI382mTP.js";function f(e){r(i.Relaunch,e)}var p=e(a(),1),m=e(n(),1),h=t();function g(){let[e,t]=(0,m.useState)({top:0,left:0}),[n,r]=(0,m.useState)({startPage:``,scene:d,queryParams:[]}),[i,a]=(0,m.useState)([]);(0,m.useEffect)(()=>s(e=>{a(e.pages),r(e.config);let n=window.innerWidth-340-8;t({top:e.top,left:Math.min(e.left,n)})}),[]);function p(){c()}function g(){r(e=>({...e,queryParams:[...e.queryParams,{key:``,value:``}]}))}function _(e){r(t=>({...t,queryParams:t.queryParams.filter((t,n)=>n!==e)}))}function v(e,t,n){r(r=>{let i=[...r.queryParams];return i[e]={...i[e]??{key:``,value:``},[t]:n},{...r,queryParams:i}})}function y(){f(n)}return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{className:`fixed inset-0`,onClick:p}),(0,h.jsxs)(`div`,{className:`fixed w-[340px] bg-surface border border-border-strong rounded-md p-3.5 shadow-[0_8px_24px_var(--color-overlay-heavy)] z-10`,style:{top:e.top,left:e.left},onClick:e=>e.stopPropagation(),children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2.5 mb-3`,children:[(0,h.jsx)(`label`,{className:`w-16 shrink-0 text-code-label text-[12px]`,children:`启动页面`}),(0,h.jsx)(l,{className:`flex-1 min-w-0 bg-surface-input border-text-dim text-text text-[12px] py-0.5`,value:n.startPage,onChange:e=>r(t=>({...t,startPage:e.target.value})),children:i.map(e=>(0,h.jsx)(`option`,{value:e,children:e},e))})]}),(0,h.jsxs)(`div`,{className:`flex items-center gap-2.5 mb-3`,children:[(0,h.jsx)(`label`,{className:`w-16 shrink-0 text-code-label text-[12px]`,children:`scene 值`}),(0,h.jsx)(o,{type:`number`,className:`w-20 bg-surface-input border-text-dim text-text text-[12px]`,value:n.scene,onChange:e=>r(t=>({...t,scene:Number(e.target.value)||1001}))})]}),(0,h.jsxs)(`div`,{className:`flex items-start gap-2.5 mb-3`,children:[(0,h.jsx)(`label`,{className:`w-16 shrink-0 text-code-label text-[12px] pt-1`,children:`启动参数`}),(0,h.jsxs)(`div`,{className:`flex flex-col gap-1.5 flex-1`,children:[n.queryParams.map((e,t)=>(0,h.jsxs)(`div`,{className:`flex gap-1.5 items-center`,children:[(0,h.jsx)(o,{className:`w-24 bg-surface-input border-text-dim text-text text-[12px]`,value:e.key,placeholder:`参数名`,onChange:e=>v(t,`key`,e.target.value)}),(0,h.jsx)(o,{className:`w-24 bg-surface-input border-text-dim text-text text-[12px]`,value:e.value,placeholder:`参数值`,onChange:e=>v(t,`value`,e.target.value)}),(0,h.jsx)(u,{variant:`ghost`,size:`icon-sm`,className:`text-text-secondary hover:text-status-error hover:bg-transparent`,onClick:()=>_(t),children:`×`})]},t)),(0,h.jsx)(u,{variant:`outline`,size:`xs`,className:`border-dashed border-text-dim text-text-secondary hover:border-accent hover:text-accent hover:bg-transparent`,onClick:g,children:`+ 添加参数`})]})]}),(0,h.jsx)(`div`,{className:`mt-3.5`,children:(0,h.jsx)(u,{onClick:y,children:`▶ 重新编译`})})]})]})}p.createRoot(document.getElementById(`root`)).render((0,h.jsx)(g,{}));
2
+ //# sourceMappingURL=popover-CdGdKkkc.js.map
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./chunk-DPI0Y_ll.js";import{C as t,E as n,b as r,h as i,l as a,r as o,t as s,x as c}from"./ipc-transport-D22e4dv7.js";import{i as l,n as u}from"./input-6fpCXV-n.js";var d=e(n(),1),f=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,p=l,m=(e,t)=>n=>{if(t?.variants==null)return p(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=f(t)||f(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return p(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},h=t(),g=m(`inline-flex items-center justify-center gap-1.5 font-medium transition-colors focus:outline-none disabled:opacity-35 disabled:cursor-not-allowed whitespace-nowrap shrink-0`,{variants:{variant:{default:`bg-accent text-text-white hover:bg-accent-hover rounded`,ghost:`text-text-secondary hover:bg-surface-3 hover:text-text rounded`,outline:`border border-border text-text-muted hover:border-border-subtle hover:text-text rounded`,icon:`text-text-secondary hover:bg-surface-3 hover:text-text-muted rounded`,tab:`text-text-muted hover:text-text hover:bg-surface-3 rounded`,"tab-active":`text-text bg-surface-active rounded`,danger:`border border-transparent text-text-secondary hover:text-status-error hover:bg-danger-bg rounded-full`},size:{default:`h-7 px-4 text-[13px]`,sm:`h-6 px-3 text-[12px]`,xs:`h-5 px-2 text-[11px]`,icon:`h-7 w-7 p-0 text-[15px]`,"icon-sm":`h-6 w-6 p-0 text-[14px]`}},defaultVariants:{variant:`default`,size:`default`}}),_=d.forwardRef(({className:e,variant:t,size:n,...r},i)=>(0,h.jsx)(`button`,{ref:i,className:u(g({variant:t,size:n}),e),...r}));_.displayName=`Button`;var v=[{name:`iPhone SE`,width:375,height:667,pixelRatio:2,statusBarHeight:20,system:`iOS 15.0`,safeAreaBottom:0,notchType:`none`,safeAreaInsets:{top:20,right:0,bottom:0,left:0}},{name:`iPhone X`,width:375,height:812,pixelRatio:3,statusBarHeight:44,system:`iOS 16.0`,safeAreaBottom:34,notchType:`notch`,safeAreaInsets:{top:44,right:0,bottom:34,left:0}},{name:`iPhone 14`,width:390,height:844,pixelRatio:3,statusBarHeight:47,system:`iOS 16.0`,safeAreaBottom:34,notchType:`notch`,safeAreaInsets:{top:47,right:0,bottom:34,left:0}},{name:`iPhone 14 Pro`,width:393,height:852,pixelRatio:3,statusBarHeight:54,system:`iOS 16.3`,safeAreaBottom:34,notchType:`dynamic-island`,safeAreaInsets:{top:54,right:0,bottom:34,left:0}},{name:`iPhone 16 Pro`,width:402,height:874,pixelRatio:3,statusBarHeight:59,system:`iOS 18.0`,safeAreaBottom:34,notchType:`dynamic-island`,safeAreaInsets:{top:59,right:0,bottom:34,left:0}},{name:`iPhone 17 Pro`,width:402,height:874,pixelRatio:3,statusBarHeight:59,system:`iOS 19.0`,safeAreaBottom:34,notchType:`dynamic-island`,safeAreaInsets:{top:59,right:0,bottom:34,left:0}}],y=[25,50,75,100],b=1500;function x(e,t){return s(i.AttachNative,e,t)}function S(e){return s(i.SetNativeBounds,e)}function C(e){return s(i.SetDeviceInfo,e)}function w(e){return s(a.Show,e)}function T(){return s(a.Hide)}function E(e){return o(a.Closed,()=>e())}function D(e){return o(a.Init,t=>e(t))}function O(e){return o(a.Relaunch,t=>e(t))}function k(e){return o(c.NavigateBack,()=>e())}function A(e){return o(i.CurrentPage,t=>e(t))}function j(e){return s(r.SimulatorDevtoolsBounds,e)}function M(e){return s(r.HostToolbarBounds,e)}function N(e){return o(r.HostToolbarHeightChanged,t=>e(t))}var P=d.forwardRef(({className:e,children:t,...n},r)=>(0,h.jsx)(`select`,{ref:r,className:u(`bg-surface border border-border text-text-secondary`,`px-1.5 py-0.5 rounded text-[11px] cursor-pointer`,`focus:outline-none focus:border-accent`,e),...n,children:t}));P.displayName=`Select`;export{y as _,E as a,A as c,j as d,C as f,v as g,b as h,N as i,k as l,w as m,x as n,D as o,S as p,T as r,O as s,P as t,M as u,_ as v};
2
+ //# sourceMappingURL=select-X0sbjwdP.js.map
@@ -1,2 +1,2 @@
1
- import{r as e}from"./chunk-DPI0Y_ll.js";import{E as t,O as n,T as r}from"./ipc-transport-BkKKww3u.js";import{t as i}from"./input-CFHmbOgz.js";import{n as a,o,t as s}from"./settings-api-CCwo2eOi.js";var c=e(t(),1),l=e(n(),1),u=r(),d=[{id:`local`,label:`本地设置`},{id:`project`,label:`项目配置`}];function f(){let[e,t]=(0,l.useState)(`local`),[n,r]=(0,l.useState)(``),[c,f]=(0,l.useState)({startPage:``,scene:1001,queryParams:[]}),[p,m]=(0,l.useState)({uploadWithSourceMap:!1});(0,l.useEffect)(()=>o(e=>{r(e.projectPath),f(e.config),m({uploadWithSourceMap:!!e.projectSettings?.uploadWithSourceMap})}),[]);function h(e){let t={...c,...e};f(t),a(t)}function g(e){let t={...p,...e};m(t),s(t)}function _(e,t,n){return(0,u.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`w-full flex items-center gap-3 px-3 py-2.5 rounded-md border border-border bg-bg hover:bg-surface-3 transition-colors text-left`,children:[(0,u.jsx)(`span`,{className:`h-4 w-4 rounded-sm border flex items-center justify-center text-[11px] ${t?`bg-accent border-accent text-white`:`border-border bg-surface text-transparent`}`,children:`✓`}),(0,u.jsx)(`span`,{className:`text-[12px] text-text`,children:e})]})}return(0,u.jsxs)(`div`,{className:`flex flex-col h-screen bg-surface text-text`,children:[(0,u.jsx)(`div`,{className:`flex items-center border-b border-border shrink-0`,children:d.map(n=>(0,u.jsx)(`button`,{className:`flex-1 py-2.5 text-[12px] text-center transition-colors ${e===n.id?`text-accent border-b-2 border-accent`:`text-text-secondary hover:text-text`}`,onClick:()=>t(n.id),children:n.label},n.id))}),(0,u.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[e===`local`&&(0,u.jsxs)(`div`,{className:`space-y-3`,children:[(0,u.jsx)(`div`,{className:`text-[12px] text-text-secondary`,children:`本地设置`}),_(`上传时启用 Sourcemap`,p.uploadWithSourceMap,e=>g({uploadWithSourceMap:e}))]}),e===`project`&&(0,u.jsxs)(`div`,{className:`space-y-4`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between py-2 border-b border-border`,children:[(0,u.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`本地目录`}),(0,u.jsx)(`span`,{className:`text-[12px] text-text truncate ml-4 max-w-[180px]`,title:n,children:n})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`label`,{className:`block text-[12px] text-text-secondary mb-1`,children:`启动页面`}),(0,u.jsx)(i,{value:c.startPage,onChange:e=>h({startPage:e.target.value}),className:`w-full h-8 px-2 text-[12px]`})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`label`,{className:`block text-[12px] text-text-secondary mb-1`,children:`Scene`}),(0,u.jsx)(i,{type:`number`,value:c.scene,onChange:e=>h({scene:parseInt(e.target.value||`1001`,10)}),className:`w-full h-8 px-2 text-[12px]`})]})]})]})]})}c.createRoot(document.getElementById(`root`)).render((0,u.jsx)(f,{}));
2
- //# sourceMappingURL=settings-Cl4IcWnG.js.map
1
+ import{r as e}from"./chunk-DPI0Y_ll.js";import{C as t,E as n,w as r}from"./ipc-transport-D22e4dv7.js";import{t as i}from"./input-6fpCXV-n.js";import{n as a,o,t as s}from"./settings-api-CCWTAao_.js";var c=e(r(),1),l=e(n(),1),u=t(),d=[{id:`local`,label:`本地设置`},{id:`project`,label:`项目配置`}];function f(){let[e,t]=(0,l.useState)(`local`),[n,r]=(0,l.useState)(``),[c,f]=(0,l.useState)({startPage:``,scene:1001,queryParams:[]}),[p,m]=(0,l.useState)({uploadWithSourceMap:!1});(0,l.useEffect)(()=>o(e=>{r(e.projectPath),f(e.config),m({uploadWithSourceMap:!!e.projectSettings?.uploadWithSourceMap})}),[]);function h(e){let t={...c,...e};f(t),a(t)}function g(e){let t={...p,...e};m(t),s(t)}function _(e,t,n){return(0,u.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`w-full flex items-center gap-3 px-3 py-2.5 rounded-md border border-border bg-bg hover:bg-surface-3 transition-colors text-left`,children:[(0,u.jsx)(`span`,{className:`h-4 w-4 rounded-sm border flex items-center justify-center text-[11px] ${t?`bg-accent border-accent text-white`:`border-border bg-surface text-transparent`}`,children:`✓`}),(0,u.jsx)(`span`,{className:`text-[12px] text-text`,children:e})]})}return(0,u.jsxs)(`div`,{className:`flex flex-col h-screen bg-surface text-text`,children:[(0,u.jsx)(`div`,{className:`flex items-center border-b border-border shrink-0`,children:d.map(n=>(0,u.jsx)(`button`,{className:`flex-1 py-2.5 text-[12px] text-center transition-colors ${e===n.id?`text-accent border-b-2 border-accent`:`text-text-secondary hover:text-text`}`,onClick:()=>t(n.id),children:n.label},n.id))}),(0,u.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[e===`local`&&(0,u.jsxs)(`div`,{className:`space-y-3`,children:[(0,u.jsx)(`div`,{className:`text-[12px] text-text-secondary`,children:`本地设置`}),_(`上传时启用 Sourcemap`,p.uploadWithSourceMap,e=>g({uploadWithSourceMap:e}))]}),e===`project`&&(0,u.jsxs)(`div`,{className:`space-y-4`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between py-2 border-b border-border`,children:[(0,u.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`本地目录`}),(0,u.jsx)(`span`,{className:`text-[12px] text-text truncate ml-4 max-w-[180px]`,title:n,children:n})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`label`,{className:`block text-[12px] text-text-secondary mb-1`,children:`启动页面`}),(0,u.jsx)(i,{value:c.startPage,onChange:e=>h({startPage:e.target.value}),className:`w-full h-8 px-2 text-[12px]`})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`label`,{className:`block text-[12px] text-text-secondary mb-1`,children:`Scene`}),(0,u.jsx)(i,{type:`number`,value:c.scene,onChange:e=>h({scene:parseInt(e.target.value||`1001`,10)}),className:`w-full h-8 px-2 text-[12px]`})]})]})]})]})}c.createRoot(document.getElementById(`root`)).render((0,u.jsx)(f,{}));
2
+ //# sourceMappingURL=settings-CS4jYaCw.js.map
@@ -0,0 +1,2 @@
1
+ import{S as e,i as t,n,p as r,r as i,t as a}from"./ipc-transport-D22e4dv7.js";function o(e){return a(r.SetVisible,e)}function s(e){t(r.ConfigChanged,e)}function c(e){t(r.ProjectSettingsChanged,e)}function l(e){return i(r.Init,t=>e(t))}function u(){return n(e.Get)}function d(t){return a(e.Save,t)}function f(t){return a(e.SetTheme,t)}function p(){return n(e.GetCdpStatus)}function m(){return n(e.GetMcpStatus)}function h(t){return i(e.Init,e=>t(e))}export{u as a,d as c,m as i,o as l,s as n,l as o,p as r,h as s,c as t,f as u};
2
+ //# sourceMappingURL=settings-api-CCWTAao_.js.map
@@ -0,0 +1,8 @@
1
+ import{r as e}from"./chunk-DPI0Y_ll.js";import{C as t,E as n,w as r}from"./ipc-transport-D22e4dv7.js";import{t as i}from"./constants-DI382mTP.js";import{a,c as o,i as s,r as c,s as l,u}from"./settings-api-CCWTAao_.js";var d=e(r(),1),f=e(n(),1),p=t(),m=[{id:`general`,label:`通用`},{id:`debug`,label:`调试`},{id:`mcp`,label:`MCP`}];function h({checked:e,onClick:t}){return(0,p.jsx)(`button`,{type:`button`,onClick:t,className:`relative inline-flex h-5 w-9 shrink-0 rounded-full transition-colors`,style:{background:e?`var(--color-accent)`:`var(--color-surface-3)`},children:(0,p.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform`,style:{marginTop:3,transform:e?`translateX(18px)`:`translateX(3px)`}})})}function g(){let[e,t]=(0,f.useState)({cdp:{enabled:!1,port:i},mcp:{enabled:!1,port:7789},compile:{watch:!0},theme:`system`}),[n,r]=(0,f.useState)(null),[d,g]=(0,f.useState)(null),[_,v]=(0,f.useState)(`general`),[y,b]=(0,f.useState)(!1),[x,S]=(0,f.useState)(String(i)),[C,w]=(0,f.useState)(`7789`);(0,f.useEffect)(()=>{let e=l(e=>{t(e.settings),S(String(e.settings.cdp.port)),w(String(e.settings.mcp.port))});return a().then(e=>{t(e),S(String(e.cdp.port)),w(String(e.mcp.port))}),c().then(r),s().then(g),e},[]);function T(){b(!0),window.setTimeout(()=>b(!1),2e3)}function E(){t(e=>({...e,cdp:{...e.cdp,enabled:!e.cdp.enabled}}))}function D(){t(e=>({...e,mcp:{...e.mcp,enabled:!e.mcp.enabled}}))}function O(n){let r={...e,theme:n};t(r),u(n),o(r)}function k(n){let r={...e,compile:{...e.compile,watch:n}};t(r),o(r).then(T)}async function A(){let n=parseInt(x,10);if(Number.isNaN(n)||n<1024||n>65535)return;let i=parseInt(C,10);if(Number.isNaN(i)||i<1024||i>65535)return;let a={...e,cdp:{...e.cdp,port:n},mcp:{...e.mcp,port:i}};t(a),await o(a),r(await c()),g(await s()),T()}let j=n&&!n.implicitDevDefault&&(e.cdp.enabled!==n.active||e.cdp.enabled&&n.active&&e.cdp.port!==n.activePort);return(0,p.jsxs)(`div`,{className:`flex flex-col h-screen bg-surface text-text`,children:[(0,p.jsx)(`div`,{className:`flex items-center border-b border-border shrink-0`,children:m.map(e=>(0,p.jsx)(`button`,{className:`flex-1 py-2.5 text-[12px] text-center transition-colors ${_===e.id?`text-accent border-b-2 border-accent`:`text-text-secondary hover:text-text`}`,onClick:()=>v(e.id),children:e.label},e.id))}),(0,p.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[_===`general`&&(0,p.jsxs)(`div`,{className:`space-y-4`,children:[(0,p.jsxs)(`section`,{className:`rounded-lg border border-border p-4 space-y-4 bg-bg`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h2`,{className:`text-[13px] font-medium mb-1`,children:`编译`}),(0,p.jsx)(`p`,{className:`text-[11px] leading-relaxed text-text-secondary`,children:`开启后,打开项目时会监听源文件改动并自动重新编译。关闭则只在打开/手动重新编译时构建。配置在下次打开项目时生效。`})]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`监听文件变化自动编译`}),(0,p.jsx)(h,{checked:e.compile.watch,onClick:()=>k(!e.compile.watch)})]})]}),(0,p.jsxs)(`section`,{className:`rounded-lg border border-border p-4 space-y-3 bg-bg`,children:[(0,p.jsx)(`div`,{children:(0,p.jsx)(`h2`,{className:`text-[13px] font-medium mb-1`,children:`外观`})}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`颜色模式`}),(0,p.jsx)(`div`,{className:`flex rounded overflow-hidden border border-border text-[11px]`,children:[`system`,`dark`,`light`].map((t,n)=>{let r=t===`system`?`跟随系统`:t===`dark`?`深色`:`浅色`,i=e.theme===t;return(0,p.jsx)(`button`,{onClick:()=>O(t),className:[`px-3 py-1 transition-colors`,n>0?`border-l border-border`:``,i?`bg-accent text-white`:`text-text-secondary hover:text-text hover:bg-surface-3`].join(` `),children:r},t)})})]})]}),y&&(0,p.jsx)(`div`,{className:`text-[11px] text-status-success`,children:`已保存`})]}),_===`debug`&&(0,p.jsxs)(`section`,{className:`rounded-lg border border-border p-4 space-y-4 bg-bg`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h2`,{className:`text-[13px] font-medium mb-1`,children:`DevTools Protocol`}),(0,p.jsx)(`p`,{className:`text-[11px] leading-relaxed text-text-secondary`,children:`开启后可通过 DevTools Protocol 连接调试模拟器。配置变更需要重启应用后生效。`})]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`启用 DevTools Protocol`}),(0,p.jsx)(h,{checked:e.cdp.enabled,onClick:E})]}),(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`label`,{className:`text-[12px] shrink-0 w-16 text-text-secondary`,children:`调试端口`}),(0,p.jsx)(`input`,{type:`number`,min:1024,max:65535,value:x,onChange:e=>S(e.target.value),disabled:!e.cdp.enabled,className:`w-24 h-7 px-2 rounded text-[12px] outline-none bg-surface border border-border text-text`,style:{opacity:e.cdp.enabled?1:.4}}),(0,p.jsxs)(`span`,{className:`text-[11px] text-text-dim`,children:[`默认 `,9222]})]}),(0,p.jsxs)(`div`,{className:`rounded p-3 space-y-2 border border-border bg-surface`,children:[(0,p.jsx)(`div`,{className:`text-[11px] font-medium text-text-secondary`,children:`当前状态`}),(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full`,style:{background:n?.active?`var(--color-status-success)`:`var(--color-text-dim)`}}),(0,p.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:n?.active?`CDP 已激活 - 端口 ${n.activePort}`:`CDP 未激活`})]}),n?.implicitDevDefault&&(0,p.jsx)(`div`,{className:`text-[11px] text-text-dim`,children:`当前为开发模式默认端口`}),n?.active&&(0,p.jsxs)(`div`,{className:`text-[11px] text-text-dim font-mono`,children:[`调试地址: http://localhost:`,n.activePort]})]}),j&&(0,p.jsx)(`div`,{className:`rounded px-3 py-2 text-[12px] border bg-warn-bg text-[var(--color-status-warn)]`,children:`配置已变更,需要重启应用后生效`}),(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`button`,{onClick:A,className:`h-7 px-4 rounded text-[13px] font-medium text-white bg-accent hover:bg-accent-hover`,children:`保存`}),y&&(0,p.jsx)(`span`,{className:`text-[11px] text-status-success`,children:`已保存`})]})]}),_===`mcp`&&(0,p.jsxs)(`section`,{className:`rounded-lg border border-border p-4 space-y-4 bg-bg`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h2`,{className:`text-[13px] font-medium mb-1`,children:`MCP 配置`}),(0,p.jsx)(`p`,{className:`text-[11px] leading-relaxed text-text-secondary`,children:`AI 助手可以通过 MCP 连接当前开发工具,读取 console、截图、执行 JS、查看 DOM / Storage / 网络请求。启用后开发工具启动时会自动监听 SSE 端点,并自动启用 CDP。`})]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`启用 MCP 服务`}),(0,p.jsx)(h,{checked:e.mcp.enabled,onClick:D})]}),(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`label`,{className:`text-[12px] shrink-0 w-16 text-text-secondary`,children:`SSE 端口`}),(0,p.jsx)(`input`,{type:`number`,min:1024,max:65535,value:C,onChange:e=>w(e.target.value),disabled:!e.mcp.enabled,className:`w-24 h-7 px-2 rounded text-[12px] outline-none bg-surface border border-border text-text`,style:{opacity:e.mcp.enabled?1:.4}}),(0,p.jsx)(`span`,{className:`text-[11px] text-text-dim`,children:`默认 7789`})]}),(0,p.jsxs)(`div`,{className:`rounded p-3 space-y-2 border border-border bg-surface`,children:[(0,p.jsx)(`div`,{className:`text-[11px] font-medium text-text-secondary`,children:`当前状态`}),e.mcp.enabled?d?.running?(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full`,style:{background:`var(--color-status-success)`}}),(0,p.jsxs)(`span`,{className:`text-[12px] text-text-secondary`,children:[`MCP 已运行 - 端口 `,d.activePort]})]}):(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full`,style:{background:`var(--color-status-error, #e54d4d)`}}),(0,p.jsxs)(`span`,{className:`text-[12px] text-text-secondary`,children:[`MCP 未运行`,d?.error===`port-in-use`?`(端口 ${d.configuredPort} 已被占用)`:d?.error?`(${d.error})`:``]})]}):(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full`,style:{background:`var(--color-text-dim)`}}),(0,p.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`MCP 未启用`})]})]}),(0,p.jsxs)(`div`,{className:`rounded p-3 border border-border bg-surface`,children:[(0,p.jsx)(`div`,{className:`text-[11px] font-medium mb-2 text-text-secondary`,children:"`.mcp.json` 示例(SSE 传输)"}),(0,p.jsx)(`pre`,{className:`text-[11px] whitespace-pre-wrap leading-relaxed text-[var(--color-code-blue)] font-mono`,children:`{
2
+ "mcpServers": {
3
+ "dimina-devtools": {
4
+ "url": "http://127.0.0.1:${e.mcp.port}/sse"
5
+ }
6
+ }
7
+ }`})]}),(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`button`,{onClick:A,className:`h-7 px-4 rounded text-[13px] font-medium text-white bg-accent hover:bg-accent-hover`,children:`保存`}),y&&(0,p.jsx)(`span`,{className:`text-[11px] text-status-success`,children:`已保存`})]})]})]})]})}d.createRoot(document.getElementById(`root`)).render((0,p.jsx)(g,{}));
8
+ //# sourceMappingURL=workbenchSettings-Bpzaj3bm.js.map
@@ -28,16 +28,17 @@
28
28
  overflow: hidden;
29
29
  }
30
30
  </style>
31
- <script type="module" crossorigin src="../../assets/index-CZQOpCvg.js"></script>
31
+ <script type="module" crossorigin src="../../assets/index-DLzjz1wv.js"></script>
32
32
  <link rel="modulepreload" crossorigin href="../../assets/chunk-DPI0Y_ll.js">
33
- <link rel="modulepreload" crossorigin href="../../assets/ipc-transport-BkKKww3u.js">
33
+ <link rel="modulepreload" crossorigin href="../../assets/ipc-transport-D22e4dv7.js">
34
34
  <link rel="modulepreload" crossorigin href="../../assets/editor.api2-BTaYmRq7.js">
35
35
  <link rel="modulepreload" crossorigin href="../../assets/monaco.contribution-B7rUMaEv.js">
36
- <link rel="modulepreload" crossorigin href="../../assets/input-CFHmbOgz.js">
37
- <link rel="modulepreload" crossorigin href="../../assets/select-kj0n1oYf.js">
36
+ <link rel="modulepreload" crossorigin href="../../assets/input-6fpCXV-n.js">
37
+ <link rel="modulepreload" crossorigin href="../../assets/select-X0sbjwdP.js">
38
38
  <link rel="modulepreload" crossorigin href="../../assets/workers-CRBS0W-v.js">
39
- <link rel="modulepreload" crossorigin href="../../assets/constants-CLAQX6VZ.js">
40
- <link rel="stylesheet" crossorigin href="../../assets/ipc-transport-Bv_BVu4T.css">
39
+ <link rel="modulepreload" crossorigin href="../../assets/settings-api-CCWTAao_.js">
40
+ <link rel="modulepreload" crossorigin href="../../assets/constants-DI382mTP.js">
41
+ <link rel="stylesheet" crossorigin href="../../assets/ipc-transport-Bs8Sf1B2.css">
41
42
  <link rel="stylesheet" crossorigin href="../../assets/editor-CWI9TnMM.css">
42
43
  </head>
43
44
  <body>
@@ -8,13 +8,13 @@
8
8
  <style>
9
9
  html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: transparent !important; }
10
10
  </style>
11
- <script type="module" crossorigin src="../../assets/popover-h1M7n3tt.js"></script>
11
+ <script type="module" crossorigin src="../../assets/popover-CdGdKkkc.js"></script>
12
12
  <link rel="modulepreload" crossorigin href="../../assets/chunk-DPI0Y_ll.js">
13
- <link rel="modulepreload" crossorigin href="../../assets/ipc-transport-BkKKww3u.js">
14
- <link rel="modulepreload" crossorigin href="../../assets/input-CFHmbOgz.js">
15
- <link rel="modulepreload" crossorigin href="../../assets/select-kj0n1oYf.js">
16
- <link rel="modulepreload" crossorigin href="../../assets/constants-CLAQX6VZ.js">
17
- <link rel="stylesheet" crossorigin href="../../assets/ipc-transport-Bv_BVu4T.css">
13
+ <link rel="modulepreload" crossorigin href="../../assets/ipc-transport-D22e4dv7.js">
14
+ <link rel="modulepreload" crossorigin href="../../assets/input-6fpCXV-n.js">
15
+ <link rel="modulepreload" crossorigin href="../../assets/select-X0sbjwdP.js">
16
+ <link rel="modulepreload" crossorigin href="../../assets/constants-DI382mTP.js">
17
+ <link rel="stylesheet" crossorigin href="../../assets/ipc-transport-Bs8Sf1B2.css">
18
18
  </head>
19
19
  <body>
20
20
  <div id="root"></div>
@@ -5,12 +5,12 @@
5
5
  <!-- See main/index.html for CSP rationale. -->
6
6
  <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: http: https:; font-src 'self' data:; media-src 'self' blob: http: https:; connect-src 'self' http: https: ws: wss:;" />
7
7
  <title>Settings</title>
8
- <script type="module" crossorigin src="../../assets/settings-Cl4IcWnG.js"></script>
8
+ <script type="module" crossorigin src="../../assets/settings-CS4jYaCw.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="../../assets/chunk-DPI0Y_ll.js">
10
- <link rel="modulepreload" crossorigin href="../../assets/ipc-transport-BkKKww3u.js">
11
- <link rel="modulepreload" crossorigin href="../../assets/input-CFHmbOgz.js">
12
- <link rel="modulepreload" crossorigin href="../../assets/settings-api-CCwo2eOi.js">
13
- <link rel="stylesheet" crossorigin href="../../assets/ipc-transport-Bv_BVu4T.css">
10
+ <link rel="modulepreload" crossorigin href="../../assets/ipc-transport-D22e4dv7.js">
11
+ <link rel="modulepreload" crossorigin href="../../assets/input-6fpCXV-n.js">
12
+ <link rel="modulepreload" crossorigin href="../../assets/settings-api-CCWTAao_.js">
13
+ <link rel="stylesheet" crossorigin href="../../assets/ipc-transport-Bs8Sf1B2.css">
14
14
  </head>
15
15
  <body>
16
16
  <div id="root"></div>
@@ -6,12 +6,12 @@
6
6
  <!-- See entries/main/index.html for CSP rationale. -->
7
7
  <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: http: https:; font-src 'self' data:; media-src 'self' blob: http: https:; connect-src 'self' http: https: ws: wss:;" />
8
8
  <title>开发工具设置</title>
9
- <script type="module" crossorigin src="../../assets/workbenchSettings-BzlpQnve.js"></script>
9
+ <script type="module" crossorigin src="../../assets/workbenchSettings-Bpzaj3bm.js"></script>
10
10
  <link rel="modulepreload" crossorigin href="../../assets/chunk-DPI0Y_ll.js">
11
- <link rel="modulepreload" crossorigin href="../../assets/ipc-transport-BkKKww3u.js">
12
- <link rel="modulepreload" crossorigin href="../../assets/settings-api-CCwo2eOi.js">
13
- <link rel="modulepreload" crossorigin href="../../assets/constants-CLAQX6VZ.js">
14
- <link rel="stylesheet" crossorigin href="../../assets/ipc-transport-Bv_BVu4T.css">
11
+ <link rel="modulepreload" crossorigin href="../../assets/ipc-transport-D22e4dv7.js">
12
+ <link rel="modulepreload" crossorigin href="../../assets/settings-api-CCWTAao_.js">
13
+ <link rel="modulepreload" crossorigin href="../../assets/constants-DI382mTP.js">
14
+ <link rel="stylesheet" crossorigin href="../../assets/ipc-transport-Bs8Sf1B2.css">
15
15
  </head>
16
16
  <body>
17
17
  <div id="root"></div>
@@ -3,4 +3,22 @@
3
3
  export declare const DEFAULT_CDP_PORT = 9222;
4
4
  /** Default scene value for mini-app launch. */
5
5
  export declare const DEFAULT_SCENE = 1001;
6
+ /**
7
+ * Fixed devtools toolbar header height (px). Single source of truth shared by
8
+ * the main process (overlay view layout) and the renderer (toolbar/popover
9
+ * layout). Not host-configurable — the deprecated
10
+ * `WorkbenchAppConfig.headerHeight` is ignored; hosts that need their own
11
+ * toolbar use the host toolbar WCV instead.
12
+ */
13
+ export declare const HEADER_H = 40;
14
+ /**
15
+ * Process-level argv marker injected (via `webPreferences.additionalArguments`)
16
+ * into the host-toolbar WebContentsView. The session-registered toolbar-runtime
17
+ * preload (`src/preload/runtime/host-toolbar-runtime.ts`) executes in EVERY
18
+ * defaultSession renderer; its guard activates the height advertiser only when
19
+ * `process.argv` carries this marker AND `process.isMainFrame` is true (the
20
+ * marker is process-level, so subframes of the toolbar window see it too —
21
+ * both guard wings are required; see .repro/wave3-spike/RESULTS.md items 3/4).
22
+ */
23
+ export declare const HOST_TOOLBAR_RUNTIME_MARKER = "--dimina-host-toolbar";
6
24
  //# sourceMappingURL=constants.d.ts.map
@@ -3,4 +3,22 @@
3
3
  export const DEFAULT_CDP_PORT = 9222;
4
4
  /** Default scene value for mini-app launch. */
5
5
  export const DEFAULT_SCENE = 1001;
6
+ /**
7
+ * Fixed devtools toolbar header height (px). Single source of truth shared by
8
+ * the main process (overlay view layout) and the renderer (toolbar/popover
9
+ * layout). Not host-configurable — the deprecated
10
+ * `WorkbenchAppConfig.headerHeight` is ignored; hosts that need their own
11
+ * toolbar use the host toolbar WCV instead.
12
+ */
13
+ export const HEADER_H = 40;
14
+ /**
15
+ * Process-level argv marker injected (via `webPreferences.additionalArguments`)
16
+ * into the host-toolbar WebContentsView. The session-registered toolbar-runtime
17
+ * preload (`src/preload/runtime/host-toolbar-runtime.ts`) executes in EVERY
18
+ * defaultSession renderer; its guard activates the height advertiser only when
19
+ * `process.argv` carries this marker AND `process.isMainFrame` is true (the
20
+ * marker is process-level, so subframes of the toolbar window see it too —
21
+ * both guard wings are required; see .repro/wave3-spike/RESULTS.md items 3/4).
22
+ */
23
+ export const HOST_TOOLBAR_RUNTIME_MARKER = '--dimina-host-toolbar';
6
24
  //# sourceMappingURL=constants.js.map
@@ -10,8 +10,6 @@ export declare const SimulatorChannel: {
10
10
  readonly SetNativeBounds: "simulator:set-native-bounds";
11
11
  readonly SetDeviceInfo: "simulator:set-device-info";
12
12
  readonly Detach: "simulator:detach";
13
- readonly Resize: "simulator:resize";
14
- readonly SetVisible: "simulator:setVisible";
15
13
  readonly Console: "simulator:console";
16
14
  readonly CurrentPage: "simulator:current-page";
17
15
  };
@@ -55,7 +53,6 @@ export declare const ServiceHostChannel: {
55
53
  readonly HostEnvUpdate: "service-host:host-env:update";
56
54
  };
57
55
  export declare const SimulatorCustomApiChannel: {
58
- readonly List: "simulator:custom-apis:list";
59
56
  readonly Invoke: "simulator:custom-apis:invoke";
60
57
  };
61
58
  export declare const SimulatorCustomApiBridgeChannel: {
@@ -100,9 +97,6 @@ export declare const SimulatorElementChannel: {
100
97
  readonly Inspect: "simulator:element:inspect";
101
98
  readonly Clear: "simulator:element:clear";
102
99
  };
103
- export declare const WorkbenchRuntimeChannel: {
104
- readonly GetNativeHost: "workbench:runtime:native-host";
105
- };
106
100
  export declare const SimulatorWxmlChannel: {
107
101
  readonly GetSnapshot: "simulator:wxml:snapshot";
108
102
  readonly Event: "simulator:wxml:event";
@@ -136,7 +130,6 @@ export declare const WorkbenchSettingsChannel: {
136
130
  readonly SetTheme: "workbenchSettings:setTheme";
137
131
  readonly GetCdpStatus: "workbenchSettings:getCdpStatus";
138
132
  readonly GetMcpStatus: "workbenchSettings:getMcpStatus";
139
- readonly SetVisible: "workbenchSettings:setVisible";
140
133
  readonly Init: "workbenchSettings:init";
141
134
  };
142
135
  export declare const ProjectChannel: {
@@ -197,12 +190,6 @@ export interface ProjectCreateDefaults {
197
190
  export declare const DialogChannel: {
198
191
  readonly OpenDirectory: "dialog:openDirectory";
199
192
  };
200
- export declare const PanelChannel: {
201
- readonly List: "panel:list";
202
- readonly Eval: "panel:eval";
203
- readonly Select: "panel:select";
204
- readonly SelectSimulator: "panel:selectSimulator";
205
- };
206
193
  export declare const ViewChannel: {
207
194
  /** Update the simulator DevTools view's bounds (or hide if w/h = 0). */
208
195
  readonly SimulatorDevtoolsBounds: "view:simulator:devtools-bounds";
@@ -218,6 +205,16 @@ export declare const ViewChannel: {
218
205
  * `{ axis: 'block', extent }`. fire-and-forget (send), NOT invoke.
219
206
  */
220
207
  readonly HostToolbarAdvertiseHeight: "view:host-toolbar:advertise-height";
208
+ /**
209
+ * main → host-toolbar WCV renderer: per-load MessagePort handshake for the
210
+ * gated narrow channel. On every toolbar `did-finish-load` main creates a
211
+ * `MessageChannelMain` and transfers port2 here
212
+ * (`wc.postMessage(HostToolbarPort, null, [port2])`); the session-resident
213
+ * toolbar runtime preload receives it via `event.ports[0]` and bridges it to
214
+ * the page as `window.diminaHostToolbar`. Envelope both directions:
215
+ * `{ channel: string, payload: unknown }`.
216
+ */
217
+ readonly HostToolbarPort: "view:host-toolbar:port";
221
218
  /**
222
219
  * main → main-window renderer: push the reserved host-toolbar height so the
223
220
  * renderer placeholder div resizes (closing the dynamic-height loop).
@@ -237,19 +234,11 @@ export declare const PopoverChannel: {
237
234
  readonly Closed: "popover:closed";
238
235
  readonly Init: "popover:init";
239
236
  };
240
- export declare const ToolbarChannel: {
241
- readonly GetActions: "toolbar:getActions";
242
- readonly ActionsChanged: "toolbar:actionsChanged";
243
- /** Invoke a toolbar action by id: `invoke(Invoke, actionId)`. */
244
- readonly Invoke: "toolbar:invoke";
245
- };
246
237
  export declare const WindowChannel: {
247
238
  readonly NavigateBack: "window:navigateBack";
248
239
  };
249
240
  export declare const AppChannel: {
250
- readonly GetPreloadPath: "app:getPreloadPath";
251
241
  readonly GetBranding: "app:getBranding";
252
- readonly GetHeaderHeight: "app:getHeaderHeight";
253
242
  };
254
243
  export declare const MiniappSnapshotChannel: {
255
244
  readonly Push: "miniapp-snapshot:push";
@@ -263,8 +252,6 @@ export declare const SettingsChannel: {
263
252
  readonly ConfigChanged: "settings:configChanged";
264
253
  readonly ProjectSettingsChanged: "settings:projectSettingsChanged";
265
254
  readonly Init: "settings:init";
266
- readonly Closed: "settings:closed";
267
- readonly Changed: "settings:changed";
268
255
  };
269
256
  export declare const UpdateChannel: {
270
257
  readonly Check: "updates:check";
@@ -20,8 +20,6 @@ export const SimulatorChannel = {
20
20
  // mini-app sees the selected device without a relaunch.
21
21
  SetDeviceInfo: 'simulator:set-device-info',
22
22
  Detach: 'simulator:detach',
23
- Resize: 'simulator:resize',
24
- SetVisible: 'simulator:setVisible',
25
23
  Console: 'simulator:console',
26
24
  // Main → renderer push of the visible top-of-stack page route whenever the
27
25
  // mini-app navigates (navigateTo / switchTab / back). Payload: the page path
@@ -39,15 +37,13 @@ export const ServiceHostChannel = {
39
37
  HostEnvUpdate: 'service-host:host-env:update',
40
38
  };
41
39
  // ── Custom simulator APIs (downstream-registered, main-process handlers) ──
42
- // list: simulator queries the names registered via instance.registerSimulatorApi().
43
- // invoke: simulator forwards an API call to the registry; result/reject propagates.
40
+ // invoke: forwards an API call to the registry; result/reject propagates.
44
41
  //
45
- // These are ipcMain.handle channels invoked by the **main-window renderer**
46
- // only (trusted host). The simulator guest never reaches them directly — it
42
+ // This is an ipcMain.handle channel invoked by the **main-window renderer**
43
+ // only (trusted host). The simulator guest never reaches it directly — it
47
44
  // reaches the host via the bridge channels below, so the sender-policy can keep
48
45
  // the simulator off the IPC white-list.
49
46
  export const SimulatorCustomApiChannel = {
50
- List: 'simulator:custom-apis:list',
51
47
  Invoke: 'simulator:custom-apis:invoke',
52
48
  };
53
49
  // ── Custom APIs bridge (simulator → host) ──
@@ -82,14 +78,6 @@ export const SimulatorElementChannel = {
82
78
  Inspect: 'simulator:element:inspect',
83
79
  Clear: 'simulator:element:clear',
84
80
  };
85
- // ── Workbench runtime info (renderer reads once to pick panel data sources) ──
86
- // Under native-host the page DOM / service logic live in separate webContents,
87
- // so WXML + AppData are sourced from the main process instead of the simulator
88
- // guest's miniappSnapshot transport. The renderer queries this flag once and
89
- // branches usePanelData accordingly.
90
- export const WorkbenchRuntimeChannel = {
91
- GetNativeHost: 'workbench:runtime:native-host',
92
- };
93
81
  // ── WXML tree (native-host: main pulls the tree from the active render-host
94
82
  // <webview> guest via render-inspect, and pushes/answers here — mirroring the
95
83
  // Storage panel's main→renderer contract so the renderer panel is unchanged) ──
@@ -111,7 +99,6 @@ export const WorkbenchSettingsChannel = {
111
99
  SetTheme: 'workbenchSettings:setTheme',
112
100
  GetCdpStatus: 'workbenchSettings:getCdpStatus',
113
101
  GetMcpStatus: 'workbenchSettings:getMcpStatus',
114
- SetVisible: 'workbenchSettings:setVisible',
115
102
  Init: 'workbenchSettings:init',
116
103
  };
117
104
  // ── Project session ──────────────────────────────────────────────────────
@@ -176,13 +163,6 @@ export const ProjectsChannel = {
176
163
  export const DialogChannel = {
177
164
  OpenDirectory: 'dialog:openDirectory',
178
165
  };
179
- // ── Panels ───────────────────────────────────────────────────────────────
180
- export const PanelChannel = {
181
- List: 'panel:list',
182
- Eval: 'panel:eval',
183
- Select: 'panel:select',
184
- SelectSimulator: 'panel:selectSimulator',
185
- };
186
166
  // ── Embedded views (renderer → main) ─────────────────────────────────────
187
167
  //
188
168
  // The main window's React layout owns the *positions* of the editor +
@@ -210,6 +190,16 @@ export const ViewChannel = {
210
190
  * `{ axis: 'block', extent }`. fire-and-forget (send), NOT invoke.
211
191
  */
212
192
  HostToolbarAdvertiseHeight: 'view:host-toolbar:advertise-height',
193
+ /**
194
+ * main → host-toolbar WCV renderer: per-load MessagePort handshake for the
195
+ * gated narrow channel. On every toolbar `did-finish-load` main creates a
196
+ * `MessageChannelMain` and transfers port2 here
197
+ * (`wc.postMessage(HostToolbarPort, null, [port2])`); the session-resident
198
+ * toolbar runtime preload receives it via `event.ports[0]` and bridges it to
199
+ * the page as `window.diminaHostToolbar`. Envelope both directions:
200
+ * `{ channel: string, payload: unknown }`.
201
+ */
202
+ HostToolbarPort: 'view:host-toolbar:port',
213
203
  /**
214
204
  * main → main-window renderer: push the reserved host-toolbar height so the
215
205
  * renderer placeholder div resizes (closing the dynamic-height loop).
@@ -224,22 +214,13 @@ export const PopoverChannel = {
224
214
  Closed: 'popover:closed',
225
215
  Init: 'popover:init',
226
216
  };
227
- // ── Toolbar ──────────────────────────────────────────────────────────────
228
- export const ToolbarChannel = {
229
- GetActions: 'toolbar:getActions',
230
- ActionsChanged: 'toolbar:actionsChanged',
231
- /** Invoke a toolbar action by id: `invoke(Invoke, actionId)`. */
232
- Invoke: 'toolbar:invoke',
233
- };
234
217
  // ── Window ───────────────────────────────────────────────────────────────
235
218
  export const WindowChannel = {
236
219
  NavigateBack: 'window:navigateBack',
237
220
  };
238
221
  // ── App ──────────────────────────────────────────────────────────────────
239
222
  export const AppChannel = {
240
- GetPreloadPath: 'app:getPreloadPath',
241
223
  GetBranding: 'app:getBranding',
242
- GetHeaderHeight: 'app:getHeaderHeight',
243
224
  };
244
225
  // ── miniappSnapshot (unified panel snapshot framework) ───────────────────
245
226
  //
@@ -261,8 +242,6 @@ export const SettingsChannel = {
261
242
  ConfigChanged: 'settings:configChanged',
262
243
  ProjectSettingsChanged: 'settings:projectSettingsChanged',
263
244
  Init: 'settings:init',
264
- Closed: 'settings:closed',
265
- Changed: 'settings:changed',
266
245
  };
267
246
  // ── Updates (UpdateManager) ──────────────────────────────────────────────
268
247
  //
@@ -6,8 +6,6 @@
6
6
  * `ipcMain.handle` callback receives (event is stripped before validation).
7
7
  */
8
8
  import { z } from 'zod';
9
- /** panel:eval — single JS expression string. Cap at 50_000 chars to avoid DoS. */
10
- export declare const PanelEvalSchema: z.ZodTuple<[z.ZodString], null>;
11
9
  /** projects:add — absolute directory path. */
12
10
  export declare const ProjectsAddSchema: z.ZodTuple<[z.ZodString], null>;
13
11
  /** project:open — absolute project path. */
@@ -33,8 +31,6 @@ export declare const PopoverShowSchema: z.ZodTuple<[z.ZodObject<{}, z.core.$loos
33
31
  * arbitrary origins (will-navigate hardening re-checks at navigation time).
34
32
  */
35
33
  export declare const SimulatorAttachNativeSchema: z.ZodTuple<[z.ZodString, z.ZodNumber], null>;
36
- /** simulator:resize — simulator width. */
37
- export declare const SimulatorResizeSchema: z.ZodTuple<[z.ZodNumber], null>;
38
34
  /**
39
35
  * simulator:set-native-bounds (native-host only) — the renderer-measured
40
36
  * device-bezel inner-screen rect (CSS px, from `getBoundingClientRect()`, may
@@ -92,8 +88,6 @@ export declare const HostToolbarAdvertiseHeightSchema: z.ZodTuple<[z.ZodObject<{
92
88
  axis: z.ZodLiteral<"block">;
93
89
  extent: z.ZodNumber;
94
90
  }, z.core.$strip>], null>;
95
- /** simulator:setVisible — visible flag + simulator width. */
96
- export declare const SimulatorSetVisibleSchema: z.ZodTuple<[z.ZodBoolean, z.ZodNumber], null>;
97
91
  /**
98
92
  * simulator:custom-apis:invoke — API name + arbitrary JSON-serialisable params.
99
93
  *
@@ -101,8 +95,6 @@ export declare const SimulatorSetVisibleSchema: z.ZodTuple<[z.ZodBoolean, z.ZodN
101
95
  * name is a non-empty bounded string (cheap DoS guard) and accept any payload.
102
96
  */
103
97
  export declare const SimulatorCustomApiInvokeSchema: z.ZodTuple<[z.ZodString, z.ZodUnknown], null>;
104
- /** toolbar:invoke — a non-empty bounded toolbar action id. */
105
- export declare const ToolbarInvokeSchema: z.ZodTuple<[z.ZodString], null>;
106
98
  /** project:getPages — absolute project path. */
107
99
  export declare const ProjectGetPagesSchema: z.ZodTuple<[z.ZodString], null>;
108
100
  /** project:getCompileConfig — absolute project path. */
@@ -142,8 +134,6 @@ export declare const WorkbenchSettingsSetThemeSchema: z.ZodTuple<[z.ZodEnum<{
142
134
  dark: "dark";
143
135
  light: "light";
144
136
  }>], null>;
145
- /** workbenchSettings:setVisible — boolean. */
146
- export declare const WorkbenchSettingsSetVisibleSchema: z.ZodTuple<[z.ZodBoolean], null>;
147
137
  /** settings:setVisible — boolean. */
148
138
  export declare const SettingsSetVisibleSchema: z.ZodTuple<[z.ZodBoolean], null>;
149
139
  /** settings:configChanged — full CompileConfig object (see shared/types.ts). */
@@ -174,8 +164,6 @@ export declare const PopoverRelaunchSchema: z.ZodTuple<[z.ZodObject<{
174
164
  export declare const SettingsProjectSettingsChangedSchema: z.ZodTuple<[z.ZodObject<{
175
165
  uploadWithSourceMap: z.ZodOptional<z.ZodBoolean>;
176
166
  }, z.core.$loose>], null>;
177
- /** panel:select — single panel id string. */
178
- export declare const PanelSelectSchema: z.ZodTuple<[z.ZodString], null>;
179
167
  /** project:captureThumbnail — absolute project path. */
180
168
  export declare const ProjectCaptureThumbnailSchema: z.ZodTuple<[z.ZodString], null>;
181
169
  /** project:getThumbnail — absolute project path. */
@@ -17,8 +17,6 @@ const AbsolutePath = z
17
17
  .string()
18
18
  .min(1)
19
19
  .refine((p) => p.startsWith('/') || /^[a-zA-Z]:\\/.test(p) || /^[a-zA-Z]:\//.test(p), 'must be an absolute path');
20
- /** panel:eval — single JS expression string. Cap at 50_000 chars to avoid DoS. */
21
- export const PanelEvalSchema = z.tuple([z.string().min(1).max(50_000)]);
22
20
  /** projects:add — absolute directory path. */
23
21
  export const ProjectsAddSchema = z.tuple([AbsolutePath]);
24
22
  /** project:open — absolute project path. */
@@ -63,8 +61,6 @@ export const SimulatorAttachNativeSchema = z.tuple([
63
61
  }),
64
62
  SimWidth,
65
63
  ]);
66
- /** simulator:resize — simulator width. */
67
- export const SimulatorResizeSchema = z.tuple([SimWidth]);
68
64
  /**
69
65
  * simulator:set-native-bounds (native-host only) — the renderer-measured
70
66
  * device-bezel inner-screen rect (CSS px, from `getBoundingClientRect()`, may
@@ -133,8 +129,6 @@ export const HostToolbarAdvertiseHeightSchema = z.tuple([
133
129
  extent: NonNegInt,
134
130
  }),
135
131
  ]);
136
- /** simulator:setVisible — visible flag + simulator width. */
137
- export const SimulatorSetVisibleSchema = z.tuple([z.boolean(), SimWidth]);
138
132
  /**
139
133
  * simulator:custom-apis:invoke — API name + arbitrary JSON-serialisable params.
140
134
  *
@@ -145,8 +139,6 @@ export const SimulatorCustomApiInvokeSchema = z.tuple([
145
139
  z.string().min(1).max(256),
146
140
  z.unknown(),
147
141
  ]);
148
- /** toolbar:invoke — a non-empty bounded toolbar action id. */
149
- export const ToolbarInvokeSchema = z.tuple([z.string().min(1).max(256)]);
150
142
  /** project:getPages — absolute project path. */
151
143
  export const ProjectGetPagesSchema = z.tuple([AbsolutePath]);
152
144
  /** project:getCompileConfig — absolute project path. */
@@ -182,8 +174,6 @@ export const WorkbenchSettingsSaveSchema = z.tuple([
182
174
  export const WorkbenchSettingsSetThemeSchema = z.tuple([
183
175
  z.enum(['system', 'light', 'dark']),
184
176
  ]);
185
- /** workbenchSettings:setVisible — boolean. */
186
- export const WorkbenchSettingsSetVisibleSchema = z.tuple([z.boolean()]);
187
177
  /** settings:setVisible — boolean. */
188
178
  export const SettingsSetVisibleSchema = z.tuple([z.boolean()]);
189
179
  /** settings:configChanged — full CompileConfig object (see shared/types.ts). */
@@ -202,8 +192,6 @@ export const SettingsProjectSettingsChangedSchema = z.tuple([
202
192
  uploadWithSourceMap: z.boolean().optional(),
203
193
  }),
204
194
  ]);
205
- /** panel:select — single panel id string. */
206
- export const PanelSelectSchema = z.tuple([z.string().min(1).max(200)]);
207
195
  /** project:captureThumbnail — absolute project path. */
208
196
  export const ProjectCaptureThumbnailSchema = z.tuple([AbsolutePath]);
209
197
  /** project:getThumbnail — absolute project path. */