@yuriai/web 0.2.24-beta.9 → 0.2.24

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 (54) hide show
  1. package/dist/assets/{AssistantView-BGpLPZ6h.js → AssistantView-C-w3bUrv.js} +3 -3
  2. package/dist/assets/{DiagramView-CeDKFDy4.js → DiagramView-DG3ivTxa.js} +1 -1
  3. package/dist/assets/{GuiPluginSurface-6u4mem4c.js → GuiPluginSurface-BVnl7lAb.js} +1 -1
  4. package/dist/assets/MarkdownRenderer-BvAzySCw.js +2 -0
  5. package/dist/assets/{MarkdownRendererImpl-gefzhEUO.js → MarkdownRendererImpl-BNKrdLn6.js} +1 -1
  6. package/dist/assets/{MarkstreamRendererImpl-CgxiRR25.js → MarkstreamRendererImpl-D4UBaz2A.js} +1 -1
  7. package/dist/assets/{MobileDetailNavigation-DVLwAxEk.js → MobileDetailNavigation-C2dQ4cxR.js} +1 -1
  8. package/dist/assets/{MobileShareBridge-B7fl7mX9.js → MobileShareBridge-BAGwzKL9.js} +1 -1
  9. package/dist/assets/{MobileTabPageHeader-CAqSbI7j.js → MobileTabPageHeader-B8XecBxj.js} +1 -1
  10. package/dist/assets/{MultiRunWindow-DB5frFvZ.js → MultiRunWindow-wzhT2t36.js} +1 -1
  11. package/dist/assets/{SettingsView-CNEPUkpK.js → SettingsView-CUJaYbvx.js} +1 -1
  12. package/dist/assets/{SettingsWindow-PynOUqkf.js → SettingsWindow-Bj0swB6o.js} +1 -1
  13. package/dist/assets/{TerminalView-C25JYY_T.js → TerminalView-DxdoY20L.js} +1 -1
  14. package/dist/assets/{ToolOutputDialog-B7z78_Ta.js → ToolOutputDialog-T7WEKBA_.js} +1 -1
  15. package/dist/assets/{appThemeRegistry-DuavpziY.js → appThemeRegistry-B8xSNJj3.js} +1 -1
  16. package/dist/assets/{capgoAdapter-DSFuKChh.js → capgoAdapter-EJ9NoUtY.js} +1 -1
  17. package/dist/assets/{fileMentionTouchSelection-DsdDxLIo.js → fileMentionTouchSelection-BHQaa6JY.js} +1 -1
  18. package/dist/assets/{gitApi-DG8aUNRs.js → gitApi-CxEKzsxG.js} +1 -1
  19. package/dist/assets/{insertionBoundaries-BgU-eSwc.js → insertionBoundaries-BRe1eEJ8.js} +1 -1
  20. package/dist/assets/{main-kU0_IWyM.js → main-Bx5Hr212.js} +2 -2
  21. package/dist/assets/{main-DKy6-7TW.js → main-DrTZmnej.js} +4 -4
  22. package/dist/assets/{mcpQueries-DLhCFGWn.js → mcpQueries-CZhOdHBy.js} +1 -1
  23. package/dist/assets/{miniChat-BLTMgWZ3.js → miniChat-B9OCzzmD.js} +2 -2
  24. package/dist/assets/{mobile-D_W-R6_d.js → mobile-CWceFL9L.js} +2 -2
  25. package/dist/assets/{mobileBackNavigation-DtNNTdra.js → mobileBackNavigation-YpHutGKo.js} +1 -1
  26. package/dist/assets/{multirun-BgtEYk4a.js → multirun-CMHEBqrK.js} +1 -1
  27. package/dist/assets/{native-config-7CgHiT1F.js → native-config-BB2iYljF.js} +1 -1
  28. package/dist/assets/{projectMeta-D-C1rjmZ.js → projectMeta-Dg9OJmrW.js} +1 -1
  29. package/dist/assets/{readiness-DBY8BxwH.js → readiness-jjsKReaO.js} +1 -1
  30. package/dist/assets/{renderElectronMiniChatApp-DsOYCHJb.js → renderElectronMiniChatApp-DZwB5g10.js} +2 -2
  31. package/dist/assets/renderMobileApp-BR5Ewan-.js +28 -0
  32. package/dist/assets/{runtimeConfig-CMfIpwDR.js → runtimeConfig-Dltne9D7.js} +1 -1
  33. package/dist/assets/{runtimeEndpointReset-DW37x27P.js → runtimeEndpointReset-Cg5UpXxg.js} +3 -3
  34. package/dist/assets/{sessionChangeSummary-BygtiY0I.js → sessionChangeSummary-DEHSsyvw.js} +1 -1
  35. package/dist/assets/{sessionLookup-lGfzU3x7.js → sessionLookup-2R9LMoF8.js} +1 -1
  36. package/dist/assets/{speechSettingsQueries-B8xG8OoW.js → speechSettingsQueries-ozQ8Mhi0.js} +1 -1
  37. package/dist/assets/types-DP6as8RK.js +2 -0
  38. package/dist/assets/{useAppFontEffects-A4x-zGZD.js → useAppFontEffects-cZSrS9NV.js} +5 -5
  39. package/dist/assets/{useDesktopWindowControlsLayout-B9390mYN.js → useDesktopWindowControlsLayout-BSdFqddg.js} +1 -1
  40. package/dist/assets/{useEffectiveDirectory-DbFrzslf.js → useEffectiveDirectory-e-F-XtxW.js} +1 -1
  41. package/dist/assets/{useMobileNavigationStore-bSLdq45x.js → useMobileNavigationStore-BIYkf6Km.js} +3 -3
  42. package/dist/assets/{useWorkerHighlightedLines-C2kIXkWB.js → useWorkerHighlightedLines-B3gQr9bJ.js} +1 -1
  43. package/dist/index.html +5 -5
  44. package/dist/mini-chat.html +5 -5
  45. package/dist/mobile.html +5 -5
  46. package/package.json +1 -1
  47. package/server/lib/remote-desktop/DOCUMENTATION.md +28 -1
  48. package/server/lib/remote-desktop/protocol.js +1 -0
  49. package/server/lib/remote-desktop/protocol.test.js +3 -0
  50. package/server/lib/remote-desktop/runtime.js +4 -2
  51. package/server/lib/remote-desktop/runtime.test.js +21 -1
  52. package/dist/assets/MarkdownRenderer-KKDchnf1.js +0 -2
  53. package/dist/assets/renderMobileApp-UQ4ju-U-.js +0 -28
  54. package/dist/assets/types-B_QXO0R5.js +0 -2
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{it as t,rt as n}from"./vendor-base-ui-CdzJ6My_.js";import{v as r}from"./useUIStore-CEingF2z.js";import{n as i}from"./vendor-react-BP2cRVqX.js";import{f as a,r as o,t as s}from"./button-K_jXf_uP.js";import{n as c}from"./useThemeSystem-8jhE4Zyk.js";import{n as l}from"./Icon-_iMMNG9-.js";import{n as u}from"./MarkdownRenderer-KKDchnf1.js";import{n as d,r as f}from"./toolHelpers-iEHVHQ9p.js";import{n as p}from"./markdownTheme-DHoKvD6O.js";import{n as m,t as h}from"./markdown-worker-oBGEB9Eg.js";var g=e(t(),1),_=i(),v=n(),y=e=>e===`in_progress`||e===`completed`||e===`cancelled`?e:`pending`,b=e=>e.status===`completed`||e.status===`cancelled`,x={in_progress:`chat.statusRow.todo.status.inProgress`,pending:`chat.statusRow.todo.status.pending`,completed:`chat.statusRow.todo.status.completed`,cancelled:`chat.statusRow.todo.status.cancelled`},S={in_progress:`text-foreground`,pending:`text-muted-foreground/60`,completed:`text-muted-foreground`,cancelled:`text-muted-foreground/60`},C={in_progress:`text-foreground`,pending:`text-muted-foreground`,completed:`text-muted-foreground/60 line-through decoration-1`,cancelled:`text-muted-foreground/60 line-through decoration-1`},w=1.2,T=24,E=`1 1`,D=e=>{let t=(0,_.c)(23),{status:n,className:r}=e,{t:i}=a(),s=x[n],c;t[0]!==i||t[1]!==s?(c=i(s),t[0]=i,t[1]=s,t[2]=c):c=t[2];let l=S[n],u;t[3]!==r||t[4]!==l?(u=o(`size-[1em] shrink-0 transition-colors duration-300`,l,r),t[3]=r,t[4]=l,t[5]=u):u=t[5];let d=n===`pending`?w:void 0,f=n===`pending`?T:void 0,p=n===`pending`?E:void 0,m;t[6]!==d||t[7]!==f||t[8]!==p?(m=(0,v.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`,stroke:`currentColor`,strokeWidth:d,pathLength:f,strokeDasharray:p}),t[6]=d,t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;t[10]===n?h=t[11]:(h=n===`in_progress`?(0,v.jsx)(`path`,{d:`M4.8 8h6.4M8.6 5.4 11.2 8l-2.6 2.6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}):null,t[10]=n,t[11]=h);let g;t[12]===n?g=t[13]:(g=n===`completed`?(0,v.jsx)(`path`,{d:`M5 8 7.5 11 11 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}):null,t[12]=n,t[13]=g);let y;t[14]===n?y=t[15]:(y=n===`cancelled`?(0,v.jsx)(`path`,{d:`M3.5 12.5 12.5 3.5`,stroke:`currentColor`}):null,t[14]=n,t[15]=y);let b;return t[16]!==g||t[17]!==y||t[18]!==c||t[19]!==u||t[20]!==m||t[21]!==h?(b=(0,v.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,role:`img`,"aria-label":c,className:u,children:[m,h,g,y]}),t[16]=g,t[17]=y,t[18]=c,t[19]=u,t[20]=m,t[21]=h,t[22]=b):b=t[22],b},O=3.2,k=e=>{let t=Math.PI*2*e,n=8+O*Math.sin(t),r=8-O*Math.cos(t);return`M8 8 L8 4.8 A${O} ${O} 0 ${+(e>.5)} 1 ${n.toFixed(3)} ${r.toFixed(3)} Z`},A=e=>{let t=(0,_.c)(11),{done:n,total:r,spinning:i,className:a}=e,s=n===void 0?0:n,c=r===void 0?0:r,l=i!==void 0&&i,u=c>0?Math.min(1,s/c):0,d;t[0]===a?d=t[1]:(d=o(`size-[1.15em] shrink-0 text-foreground`,a),t[0]=a,t[1]=d);let f=l?`yuri-todo-spin`:void 0,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p={transformBox:`fill-box`,transformOrigin:`center`},t[2]=p):p=t[2];let m;t[3]===f?m=t[4]:(m=(0,v.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`,stroke:`currentColor`,strokeWidth:w,pathLength:T,strokeDasharray:E,className:f,style:p}),t[3]=f,t[4]=m);let h;t[5]===u?h=t[6]:(h=u>0?(0,v.jsx)(`path`,{d:k(u),fill:`currentColor`,className:`transition-opacity duration-300`}):null,t[5]=u,t[6]=h);let g;return t[7]!==d||t[8]!==m||t[9]!==h?(g=(0,v.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:d,children:[m,h]}),t[7]=d,t[8]=m,t[9]=h,t[10]=g):g=t[10],g},j=({done:e,total:t,className:n,animate:r=!0})=>{let i=g.useRef(e),a=r&&i.current!==e;return g.useEffect(()=>{i.current=e},[e]),(0,v.jsxs)(`span`,{className:o(`shrink-0 tabular-nums`,n),children:[(0,v.jsx)(`span`,{className:o(a&&`yuri-todo-count-tick`),children:e},e),`/${t}`]})},ee=e=>{let t=(0,_.c)(5),{className:n}=e,r;t[0]===n?r=t[1]:(r=o(`flex size-[1.15em] shrink-0 items-center justify-center rounded-full bg-[var(--status-success)] text-[var(--status-success-foreground)]`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,v.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:`size-[70%]`,children:(0,v.jsx)(`path`,{d:`M4.5 8.2 7 10.8 11.5 5.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,v.jsx)(`span`,{"data-todo-complete":!0,className:r,children:i}),t[3]=r,t[4]=a),a},M=e=>{let t=(0,_.c)(27),{todos:n,isWorking:r,animate:i,className:s,rowClassName:c,listRef:l,id:u}=e,d=r!==void 0&&r,f=i!==void 0&&i,{t:p}=a(),m=n.findIndex(N),h;t[0]!==m||t[1]!==n?(h=m>=0?m:n.findIndex(P),t[0]=m,t[1]=n,t[2]=h):h=t[2];let g=h,b;t[3]===n?b=t[4]:(b=n.some(F),t[3]=n,t[4]=b);let S=b,w;t[5]===s?w=t[6]:(w=o(`m-0 flex min-w-0 list-none flex-col gap-[0.125em] p-0`,s),t[5]=s,t[6]=w);let T;if(t[7]!==g||t[8]!==f||t[9]!==S||t[10]!==d||t[11]!==c||t[12]!==p||t[13]!==n){let e;t[15]!==g||t[16]!==f||t[17]!==S||t[18]!==d||t[19]!==c||t[20]!==p?(e=(e,t)=>{let n=y(e.status),r=d&&!S&&t===g&&n===`pending`?`in_progress`:n;return(0,v.jsxs)(`li`,{"data-status":r,"aria-current":t===g?`step`:void 0,className:o(`grid min-w-0 shrink-0 grid-cols-[auto_minmax(0,1fr)] items-start py-[0.25em]`,c??`gap-[0.6em] px-[0.5em]`,f&&`yuri-todo-row-in`),children:[(0,v.jsx)(`span`,{className:o(`flex h-[1.32em] w-[1.15em] items-center justify-center`,f&&`yuri-todo-icon-pop`),title:p(x[r]),children:(0,v.jsx)(D,{status:r})},r),(0,v.jsx)(`span`,{dir:`auto`,title:e.content,className:o(`line-clamp-3 min-w-0 whitespace-normal text-[0.88em] break-words leading-[1.5] transition-colors duration-300`,C[r]),children:(0,v.jsx)(`span`,{className:o(r===`in_progress`&&`animate-text-shimmer`),children:e.content})})]},e.id??`${t}:${e.content}`)},t[15]=g,t[16]=f,t[17]=S,t[18]=d,t[19]=c,t[20]=p,t[21]=e):e=t[21],T=n.map(e),t[7]=g,t[8]=f,t[9]=S,t[10]=d,t[11]=c,t[12]=p,t[13]=n,t[14]=T}else T=t[14];let E;return t[22]!==u||t[23]!==l||t[24]!==w||t[25]!==T?(E=(0,v.jsx)(`ul`,{id:u,ref:l,className:w,children:T}),t[22]=u,t[23]=l,t[24]=w,t[25]=T,t[26]=E):E=t[26],E};function N(e){return e.status===`in_progress`}function P(e){return e.status===`pending`}function F(e){return e.status===`in_progress`}var I=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),L=e=>e?Object.entries(e).map(([e,t])=>t==null?``:`${e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}:${typeof t==`number`?`${t}px`:t};`).join(``):``,R=(e,t,n)=>{let r=e.querySelector(`pre`);r&&(r.style.margin=`0`,r.style.background=`transparent`,r.style.whiteSpace=t?`pre-wrap`:`pre`,t&&(r.style.wordBreak=`break-word`,r.style.overflowWrap=`break-word`));let i=e.querySelector(`code`);if(i){let e=L(n);e&&i.setAttribute(`style`,`${i.getAttribute(`style`)??``}${e}`)}},z=e=>`<pre><code>${I(e)}</code></pre>`,B=e=>{let t=(0,_.c)(21),{code:n,language:r,className:i,style:a,codeStyle:s,wrap:l}=e,u=l!==void 0&&l,{currentTheme:d}=c(),f=g.useRef(null),m;t[0]===d?m=t[1]:(m=p(d),t[0]=d,t[1]=m);let y=m,b,x;t[2]!==n||t[3]!==s||t[4]!==u?(b=()=>{let e=f.current;e&&(e.innerHTML=z(n),R(e,u,s))},x=[n,u,s],t[2]=n,t[3]=s,t[4]=u,t[5]=b,t[6]=x):(b=t[5],x=t[6]),g.useLayoutEffect(b,x);let S,C;t[7]!==n||t[8]!==s||t[9]!==r||t[10]!==u?(S=()=>{let e=f.current;if(!e)return;let t=!0,i=new AbortController;return h(n,(r||`text`).toLowerCase(),{signal:i.signal,priority:`visible`}).then(n=>{!t||!e||!n||(e.innerHTML=n,R(e,u,s))}),()=>{t=!1,i.abort()}},C=[n,r,u,s],t[7]=n,t[8]=s,t[9]=r,t[10]=u,t[11]=S,t[12]=C):(S=t[11],C=t[12]),g.useEffect(S,C);let w;t[13]===i?w=t[14]:(w=o(`typography-code`,i),t[13]=i,t[14]=w);let T=y,E;t[15]!==a||t[16]!==T?(E={...T,...a},t[15]=a,t[16]=T,t[17]=E):E=t[17];let D;return t[18]!==w||t[19]!==E?(D=(0,v.jsx)(`div`,{ref:f,className:w,style:E}),t[18]=w,t[19]=E,t[20]=D):D=t[20],D},V=e=>{let t=e.replace(/^<file>\s*\n?/,``).replace(/\n?<\/file>\s*$/,``);return t=t.replace(/^\s*\d{5}\|\s?/gm,``),t.trim()},H=(e,t=``)=>{if(typeof e==`string`)return e;if(e==null)return t;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e);try{return JSON.stringify(e)}catch{return t}},U=e=>e?e.includes(`<diagnostics`)||e.includes(`<file_diagnostics>`)||e.includes(`LSP errors detected`)||e.includes(`This file has errors`):!1,W=e=>e?e.replace(/\n{0,2}LSP errors detected[\s\S]*?<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/\n{0,2}This file has errors[\s\S]*?<\/file_diagnostics>/g,``).replace(/<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/<file_diagnostics>[\s\S]*?<\/file_diagnostics>/g,``).trim():``,G=(e,t)=>!e||typeof e!=`object`?String(e):f(e,t||``),K=e=>{if(typeof e==`string`){let t=e.trim();return t.length>0?t:void 0}if(e&&typeof e==`object`){let t=e.patch;if(typeof t==`string`){let e=t.trim();return e.length>0?e:void 0}}},q=e=>{if(!e||typeof e!=`object`)return;let t=K(e.patch)??K(e.diff);if(t)return t;let n=Array.isArray(e.files)?e.files:[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=K(e.patch)??K(e.diff);if(t)return t}},J=e=>{if(!e||typeof e!=`string`)return{data:null,isJson:!1};let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`)||!t.endsWith(`}`)&&!t.endsWith(`]`)||t.length<2)return{data:null,isJson:!1};try{let e=JSON.parse(t);return typeof e==`object`&&e?{data:e,isJson:!0}:{data:null,isJson:!1}}catch{return{data:null,isJson:!1}}},Y=(e,t,n)=>{let r=V(e);if((t===`edit`||t===`multiedit`||t===`write`||t===`apply_patch`)&&U(r)&&(r=W(r)),(t===`edit`||t===`multiedit`||t===`apply_patch`)&&r.trim().length===0){let e=q(n);if(e)return e}return r},X=e=>{let t=e.match(/<type>(file|directory)<\/type>/i)?.[1]?.toLowerCase()??`unknown`,n=(e.match(/<content>([\s\S]*?)<\/content>/i)?.[1]??e).replace(/\r\n/g,`
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{it as t,rt as n}from"./vendor-base-ui-CdzJ6My_.js";import{v as r}from"./useUIStore-CEingF2z.js";import{n as i}from"./vendor-react-BP2cRVqX.js";import{f as a,r as o,t as s}from"./button-K_jXf_uP.js";import{n as c}from"./useThemeSystem-8jhE4Zyk.js";import{n as l}from"./Icon-_iMMNG9-.js";import{n as u}from"./MarkdownRenderer-BvAzySCw.js";import{n as d,r as f}from"./toolHelpers-iEHVHQ9p.js";import{n as p}from"./markdownTheme-DHoKvD6O.js";import{n as m,t as h}from"./markdown-worker-oBGEB9Eg.js";var g=e(t(),1),_=i(),v=n(),y=e=>e===`in_progress`||e===`completed`||e===`cancelled`?e:`pending`,b=e=>e.status===`completed`||e.status===`cancelled`,x={in_progress:`chat.statusRow.todo.status.inProgress`,pending:`chat.statusRow.todo.status.pending`,completed:`chat.statusRow.todo.status.completed`,cancelled:`chat.statusRow.todo.status.cancelled`},S={in_progress:`text-foreground`,pending:`text-muted-foreground/60`,completed:`text-muted-foreground`,cancelled:`text-muted-foreground/60`},C={in_progress:`text-foreground`,pending:`text-muted-foreground`,completed:`text-muted-foreground/60 line-through decoration-1`,cancelled:`text-muted-foreground/60 line-through decoration-1`},w=1.2,T=24,E=`1 1`,D=e=>{let t=(0,_.c)(23),{status:n,className:r}=e,{t:i}=a(),s=x[n],c;t[0]!==i||t[1]!==s?(c=i(s),t[0]=i,t[1]=s,t[2]=c):c=t[2];let l=S[n],u;t[3]!==r||t[4]!==l?(u=o(`size-[1em] shrink-0 transition-colors duration-300`,l,r),t[3]=r,t[4]=l,t[5]=u):u=t[5];let d=n===`pending`?w:void 0,f=n===`pending`?T:void 0,p=n===`pending`?E:void 0,m;t[6]!==d||t[7]!==f||t[8]!==p?(m=(0,v.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`,stroke:`currentColor`,strokeWidth:d,pathLength:f,strokeDasharray:p}),t[6]=d,t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;t[10]===n?h=t[11]:(h=n===`in_progress`?(0,v.jsx)(`path`,{d:`M4.8 8h6.4M8.6 5.4 11.2 8l-2.6 2.6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}):null,t[10]=n,t[11]=h);let g;t[12]===n?g=t[13]:(g=n===`completed`?(0,v.jsx)(`path`,{d:`M5 8 7.5 11 11 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}):null,t[12]=n,t[13]=g);let y;t[14]===n?y=t[15]:(y=n===`cancelled`?(0,v.jsx)(`path`,{d:`M3.5 12.5 12.5 3.5`,stroke:`currentColor`}):null,t[14]=n,t[15]=y);let b;return t[16]!==g||t[17]!==y||t[18]!==c||t[19]!==u||t[20]!==m||t[21]!==h?(b=(0,v.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,role:`img`,"aria-label":c,className:u,children:[m,h,g,y]}),t[16]=g,t[17]=y,t[18]=c,t[19]=u,t[20]=m,t[21]=h,t[22]=b):b=t[22],b},O=3.2,k=e=>{let t=Math.PI*2*e,n=8+O*Math.sin(t),r=8-O*Math.cos(t);return`M8 8 L8 4.8 A${O} ${O} 0 ${+(e>.5)} 1 ${n.toFixed(3)} ${r.toFixed(3)} Z`},A=e=>{let t=(0,_.c)(11),{done:n,total:r,spinning:i,className:a}=e,s=n===void 0?0:n,c=r===void 0?0:r,l=i!==void 0&&i,u=c>0?Math.min(1,s/c):0,d;t[0]===a?d=t[1]:(d=o(`size-[1.15em] shrink-0 text-foreground`,a),t[0]=a,t[1]=d);let f=l?`yuri-todo-spin`:void 0,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p={transformBox:`fill-box`,transformOrigin:`center`},t[2]=p):p=t[2];let m;t[3]===f?m=t[4]:(m=(0,v.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`,stroke:`currentColor`,strokeWidth:w,pathLength:T,strokeDasharray:E,className:f,style:p}),t[3]=f,t[4]=m);let h;t[5]===u?h=t[6]:(h=u>0?(0,v.jsx)(`path`,{d:k(u),fill:`currentColor`,className:`transition-opacity duration-300`}):null,t[5]=u,t[6]=h);let g;return t[7]!==d||t[8]!==m||t[9]!==h?(g=(0,v.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:d,children:[m,h]}),t[7]=d,t[8]=m,t[9]=h,t[10]=g):g=t[10],g},j=({done:e,total:t,className:n,animate:r=!0})=>{let i=g.useRef(e),a=r&&i.current!==e;return g.useEffect(()=>{i.current=e},[e]),(0,v.jsxs)(`span`,{className:o(`shrink-0 tabular-nums`,n),children:[(0,v.jsx)(`span`,{className:o(a&&`yuri-todo-count-tick`),children:e},e),`/${t}`]})},ee=e=>{let t=(0,_.c)(5),{className:n}=e,r;t[0]===n?r=t[1]:(r=o(`flex size-[1.15em] shrink-0 items-center justify-center rounded-full bg-[var(--status-success)] text-[var(--status-success-foreground)]`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,v.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:`size-[70%]`,children:(0,v.jsx)(`path`,{d:`M4.5 8.2 7 10.8 11.5 5.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,v.jsx)(`span`,{"data-todo-complete":!0,className:r,children:i}),t[3]=r,t[4]=a),a},M=e=>{let t=(0,_.c)(27),{todos:n,isWorking:r,animate:i,className:s,rowClassName:c,listRef:l,id:u}=e,d=r!==void 0&&r,f=i!==void 0&&i,{t:p}=a(),m=n.findIndex(N),h;t[0]!==m||t[1]!==n?(h=m>=0?m:n.findIndex(P),t[0]=m,t[1]=n,t[2]=h):h=t[2];let g=h,b;t[3]===n?b=t[4]:(b=n.some(F),t[3]=n,t[4]=b);let S=b,w;t[5]===s?w=t[6]:(w=o(`m-0 flex min-w-0 list-none flex-col gap-[0.125em] p-0`,s),t[5]=s,t[6]=w);let T;if(t[7]!==g||t[8]!==f||t[9]!==S||t[10]!==d||t[11]!==c||t[12]!==p||t[13]!==n){let e;t[15]!==g||t[16]!==f||t[17]!==S||t[18]!==d||t[19]!==c||t[20]!==p?(e=(e,t)=>{let n=y(e.status),r=d&&!S&&t===g&&n===`pending`?`in_progress`:n;return(0,v.jsxs)(`li`,{"data-status":r,"aria-current":t===g?`step`:void 0,className:o(`grid min-w-0 shrink-0 grid-cols-[auto_minmax(0,1fr)] items-start py-[0.25em]`,c??`gap-[0.6em] px-[0.5em]`,f&&`yuri-todo-row-in`),children:[(0,v.jsx)(`span`,{className:o(`flex h-[1.32em] w-[1.15em] items-center justify-center`,f&&`yuri-todo-icon-pop`),title:p(x[r]),children:(0,v.jsx)(D,{status:r})},r),(0,v.jsx)(`span`,{dir:`auto`,title:e.content,className:o(`line-clamp-3 min-w-0 whitespace-normal text-[0.88em] break-words leading-[1.5] transition-colors duration-300`,C[r]),children:(0,v.jsx)(`span`,{className:o(r===`in_progress`&&`animate-text-shimmer`),children:e.content})})]},e.id??`${t}:${e.content}`)},t[15]=g,t[16]=f,t[17]=S,t[18]=d,t[19]=c,t[20]=p,t[21]=e):e=t[21],T=n.map(e),t[7]=g,t[8]=f,t[9]=S,t[10]=d,t[11]=c,t[12]=p,t[13]=n,t[14]=T}else T=t[14];let E;return t[22]!==u||t[23]!==l||t[24]!==w||t[25]!==T?(E=(0,v.jsx)(`ul`,{id:u,ref:l,className:w,children:T}),t[22]=u,t[23]=l,t[24]=w,t[25]=T,t[26]=E):E=t[26],E};function N(e){return e.status===`in_progress`}function P(e){return e.status===`pending`}function F(e){return e.status===`in_progress`}var I=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),L=e=>e?Object.entries(e).map(([e,t])=>t==null?``:`${e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}:${typeof t==`number`?`${t}px`:t};`).join(``):``,R=(e,t,n)=>{let r=e.querySelector(`pre`);r&&(r.style.margin=`0`,r.style.background=`transparent`,r.style.whiteSpace=t?`pre-wrap`:`pre`,t&&(r.style.wordBreak=`break-word`,r.style.overflowWrap=`break-word`));let i=e.querySelector(`code`);if(i){let e=L(n);e&&i.setAttribute(`style`,`${i.getAttribute(`style`)??``}${e}`)}},z=e=>`<pre><code>${I(e)}</code></pre>`,B=e=>{let t=(0,_.c)(21),{code:n,language:r,className:i,style:a,codeStyle:s,wrap:l}=e,u=l!==void 0&&l,{currentTheme:d}=c(),f=g.useRef(null),m;t[0]===d?m=t[1]:(m=p(d),t[0]=d,t[1]=m);let y=m,b,x;t[2]!==n||t[3]!==s||t[4]!==u?(b=()=>{let e=f.current;e&&(e.innerHTML=z(n),R(e,u,s))},x=[n,u,s],t[2]=n,t[3]=s,t[4]=u,t[5]=b,t[6]=x):(b=t[5],x=t[6]),g.useLayoutEffect(b,x);let S,C;t[7]!==n||t[8]!==s||t[9]!==r||t[10]!==u?(S=()=>{let e=f.current;if(!e)return;let t=!0,i=new AbortController;return h(n,(r||`text`).toLowerCase(),{signal:i.signal,priority:`visible`}).then(n=>{!t||!e||!n||(e.innerHTML=n,R(e,u,s))}),()=>{t=!1,i.abort()}},C=[n,r,u,s],t[7]=n,t[8]=s,t[9]=r,t[10]=u,t[11]=S,t[12]=C):(S=t[11],C=t[12]),g.useEffect(S,C);let w;t[13]===i?w=t[14]:(w=o(`typography-code`,i),t[13]=i,t[14]=w);let T=y,E;t[15]!==a||t[16]!==T?(E={...T,...a},t[15]=a,t[16]=T,t[17]=E):E=t[17];let D;return t[18]!==w||t[19]!==E?(D=(0,v.jsx)(`div`,{ref:f,className:w,style:E}),t[18]=w,t[19]=E,t[20]=D):D=t[20],D},V=e=>{let t=e.replace(/^<file>\s*\n?/,``).replace(/\n?<\/file>\s*$/,``);return t=t.replace(/^\s*\d{5}\|\s?/gm,``),t.trim()},H=(e,t=``)=>{if(typeof e==`string`)return e;if(e==null)return t;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e);try{return JSON.stringify(e)}catch{return t}},U=e=>e?e.includes(`<diagnostics`)||e.includes(`<file_diagnostics>`)||e.includes(`LSP errors detected`)||e.includes(`This file has errors`):!1,W=e=>e?e.replace(/\n{0,2}LSP errors detected[\s\S]*?<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/\n{0,2}This file has errors[\s\S]*?<\/file_diagnostics>/g,``).replace(/<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/<file_diagnostics>[\s\S]*?<\/file_diagnostics>/g,``).trim():``,G=(e,t)=>!e||typeof e!=`object`?String(e):f(e,t||``),K=e=>{if(typeof e==`string`){let t=e.trim();return t.length>0?t:void 0}if(e&&typeof e==`object`){let t=e.patch;if(typeof t==`string`){let e=t.trim();return e.length>0?e:void 0}}},q=e=>{if(!e||typeof e!=`object`)return;let t=K(e.patch)??K(e.diff);if(t)return t;let n=Array.isArray(e.files)?e.files:[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=K(e.patch)??K(e.diff);if(t)return t}},J=e=>{if(!e||typeof e!=`string`)return{data:null,isJson:!1};let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`)||!t.endsWith(`}`)&&!t.endsWith(`]`)||t.length<2)return{data:null,isJson:!1};try{let e=JSON.parse(t);return typeof e==`object`&&e?{data:e,isJson:!0}:{data:null,isJson:!1}}catch{return{data:null,isJson:!1}}},Y=(e,t,n)=>{let r=V(e);if((t===`edit`||t===`multiedit`||t===`write`||t===`apply_patch`)&&U(r)&&(r=W(r)),(t===`edit`||t===`multiedit`||t===`apply_patch`)&&r.trim().length===0){let e=q(n);if(e)return e}return r},X=e=>{let t=e.match(/<type>(file|directory)<\/type>/i)?.[1]?.toLowerCase()??`unknown`,n=(e.match(/<content>([\s\S]*?)<\/content>/i)?.[1]??e).replace(/\r\n/g,`
2
2
  `).split(`
3
3
  `),r=e=>/\(\s*File has more lines\..*offset.*\)/i.test(e.trim());return{type:t,lines:n.map(e=>{let n=e.trim(),i=n.startsWith(`(`)&&n.endsWith(`)`)||r(n);if(t!==`directory`){let t=e.match(/^(\d+):\s?(.*)$/);if(t){let e=t[2],n=e.trim(),i=n.startsWith(`(`)&&n.endsWith(`)`)||r(n);return{lineNumber:i?null:Number(t[1]),text:e,isInfo:i}}}return{lineNumber:null,text:e,isInfo:i}}).filter((e,t,n)=>{if(e.text.trim().length>0)return!0;let r=n[t-1],i=n[t+1],a=!!(r?.isInfo||i?.isInfo),o=e.lineNumber!==null;return!(a&&o)})}},Z=(e,t)=>{try{let n=e.trim().split(`
4
4
  `).filter(Boolean);if(n.length===0)return null;let i=[];return n.forEach(e=>{let t=e.match(/^(\s*)(.+)$/);if(t){let[,e,n]=t,r=Math.floor(e.length/2),a=!n.endsWith(`/`);i.push({name:n.replace(/\/$/,``),depth:r,isFile:a})}}),(0,v.jsx)(`div`,{className:o(`w-full min-w-0 font-mono space-y-0.5`,t?.unstyled?null:`p-3 bg-muted/20 rounded-xl border border-border/30`),style:r.tool.popup,children:i.map((e,t)=>(0,v.jsx)(`div`,{className:`min-w-0`,style:{paddingLeft:`${e.depth*20}px`},children:e.isFile?(0,v.jsx)(`span`,{className:`text-foreground/90 block truncate`,children:e.name}):(0,v.jsxs)(`span`,{className:`font-semibold text-foreground block truncate`,children:[e.name,`/`]})},t))})}catch{return null}},Q={backgroundColor:`var(--status-info)`,opacity:.6},te=(e,t,n)=>{try{let i=e.trim().split(`
package/dist/index.html CHANGED
@@ -560,7 +560,7 @@
560
560
  opacity: 0.72;
561
561
  }
562
562
  </style>
563
- <script type="module" crossorigin src="/assets/main-kU0_IWyM.js"></script>
563
+ <script type="module" crossorigin src="/assets/main-Bx5Hr212.js"></script>
564
564
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
565
565
  <link rel="modulepreload" crossorigin href="/assets/runtime-auth-BaBM02zI.js">
566
566
  <link rel="modulepreload" crossorigin href="/assets/runtime-switch-DhMY9eiB.js">
@@ -592,10 +592,10 @@
592
592
  <link rel="modulepreload" crossorigin href="/assets/terminalApi-Cjd7Jry6.js">
593
593
  <link rel="modulepreload" crossorigin href="/assets/runtime-file-download-xvItwYMc.js">
594
594
  <link rel="modulepreload" crossorigin href="/assets/platform-wGCQUVxr.js">
595
- <link rel="modulepreload" crossorigin href="/assets/types-B_QXO0R5.js">
596
- <link rel="modulepreload" crossorigin href="/assets/capgoAdapter-DSFuKChh.js">
597
- <link rel="modulepreload" crossorigin href="/assets/native-config-7CgHiT1F.js">
598
- <link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CMfIpwDR.js">
595
+ <link rel="modulepreload" crossorigin href="/assets/types-DP6as8RK.js">
596
+ <link rel="modulepreload" crossorigin href="/assets/capgoAdapter-EJ9NoUtY.js">
597
+ <link rel="modulepreload" crossorigin href="/assets/native-config-BB2iYljF.js">
598
+ <link rel="modulepreload" crossorigin href="/assets/runtimeConfig-Dltne9D7.js">
599
599
  <link rel="stylesheet" crossorigin href="/assets/src-BxW5eh2m.css">
600
600
  </head>
601
601
  <body class="h-full bg-background text-foreground">
@@ -77,7 +77,7 @@
77
77
  .dark #initial-loading img { filter: invert(1); }
78
78
  </style>
79
79
 
80
- <script type="module" crossorigin src="/assets/miniChat-BLTMgWZ3.js"></script>
80
+ <script type="module" crossorigin src="/assets/miniChat-B9OCzzmD.js"></script>
81
81
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
82
82
  <link rel="modulepreload" crossorigin href="/assets/runtime-auth-BaBM02zI.js">
83
83
  <link rel="modulepreload" crossorigin href="/assets/runtime-switch-DhMY9eiB.js">
@@ -109,10 +109,10 @@
109
109
  <link rel="modulepreload" crossorigin href="/assets/terminalApi-Cjd7Jry6.js">
110
110
  <link rel="modulepreload" crossorigin href="/assets/runtime-file-download-xvItwYMc.js">
111
111
  <link rel="modulepreload" crossorigin href="/assets/platform-wGCQUVxr.js">
112
- <link rel="modulepreload" crossorigin href="/assets/types-B_QXO0R5.js">
113
- <link rel="modulepreload" crossorigin href="/assets/capgoAdapter-DSFuKChh.js">
114
- <link rel="modulepreload" crossorigin href="/assets/native-config-7CgHiT1F.js">
115
- <link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CMfIpwDR.js">
112
+ <link rel="modulepreload" crossorigin href="/assets/types-DP6as8RK.js">
113
+ <link rel="modulepreload" crossorigin href="/assets/capgoAdapter-EJ9NoUtY.js">
114
+ <link rel="modulepreload" crossorigin href="/assets/native-config-BB2iYljF.js">
115
+ <link rel="modulepreload" crossorigin href="/assets/runtimeConfig-Dltne9D7.js">
116
116
  <link rel="stylesheet" crossorigin href="/assets/src-BxW5eh2m.css">
117
117
  </head>
118
118
  <body class="h-full bg-background text-foreground">
package/dist/mobile.html CHANGED
@@ -64,7 +64,7 @@
64
64
  </script>
65
65
 
66
66
  <style>.dark #mobile-startup-logo img { filter: invert(1); }</style>
67
- <script type="module" crossorigin src="/assets/mobile-D_W-R6_d.js"></script>
67
+ <script type="module" crossorigin src="/assets/mobile-CWceFL9L.js"></script>
68
68
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
69
69
  <link rel="modulepreload" crossorigin href="/assets/runtime-auth-BaBM02zI.js">
70
70
  <link rel="modulepreload" crossorigin href="/assets/runtime-switch-DhMY9eiB.js">
@@ -96,10 +96,10 @@
96
96
  <link rel="modulepreload" crossorigin href="/assets/terminalApi-Cjd7Jry6.js">
97
97
  <link rel="modulepreload" crossorigin href="/assets/runtime-file-download-xvItwYMc.js">
98
98
  <link rel="modulepreload" crossorigin href="/assets/platform-wGCQUVxr.js">
99
- <link rel="modulepreload" crossorigin href="/assets/types-B_QXO0R5.js">
100
- <link rel="modulepreload" crossorigin href="/assets/capgoAdapter-DSFuKChh.js">
101
- <link rel="modulepreload" crossorigin href="/assets/native-config-7CgHiT1F.js">
102
- <link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CMfIpwDR.js">
99
+ <link rel="modulepreload" crossorigin href="/assets/types-DP6as8RK.js">
100
+ <link rel="modulepreload" crossorigin href="/assets/capgoAdapter-EJ9NoUtY.js">
101
+ <link rel="modulepreload" crossorigin href="/assets/native-config-BB2iYljF.js">
102
+ <link rel="modulepreload" crossorigin href="/assets/runtimeConfig-Dltne9D7.js">
103
103
  <link rel="stylesheet" crossorigin href="/assets/src-BxW5eh2m.css">
104
104
  </head>
105
105
  <body class="h-full bg-background text-foreground">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuriai/web",
3
- "version": "0.2.24-beta.9",
3
+ "version": "0.2.24",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./server/index.js",
@@ -23,12 +23,35 @@ Runtime generation/transport identity are captured when opening the view. No inp
23
23
 
24
24
  ## Media and control
25
25
 
26
- The isolated file-origin capture window uses Electron's `desktopCapturer` screen identity and Chromium's desktop `getUserMedia`, constrained to 1920×1080 and 30 fps. Chromium owns negotiated video codec and hardware acceleration; H.264 is not forced. A WebRTC offer/answer and trickle ICE pass over the authenticated WS. Media uses WebRTC DTLS-SRTP. Over Relay, the fingerprint-bearing signaling and control are also protected by the existing E2EE tunnel; media does not use Yuri's tunnel encryption format.
26
+ The isolated file-origin capture window uses Electron's `desktopCapturer` screen identity and Chromium's desktop `getUserMedia`, constrained to 2560×1440 and 30 fps so zoom can request more detail. Normal encoder output remains bounded by the ordinary adaptive tiers below. Chromium owns negotiated video codec and hardware acceleration; H.264 is not forced. A WebRTC offer/answer and trickle ICE pass over the authenticated WS. Media uses WebRTC DTLS-SRTP. Over Relay, the fingerprint-bearing signaling and control are also protected by the existing E2EE tunnel; media does not use Yuri's tunnel encryption format.
27
+
28
+ The capture renderer's `remote-desktop-quality.mjs` adds encoder ceilings alongside Chromium's own congestion control, with `degradationPreference: balanced`. Initial output is the 720p tier, not full quality. For a 1920×1080 capture, the tiers are:
29
+
30
+ | Output ceiling | FPS ceiling | Bitrate ceiling | 1080p reference divisor |
31
+ | --- | --- | --- | --- |
32
+ | 640×360 | 8 | 350 kbps | 3 |
33
+ | 960×540 | 12 | 750 kbps | 2 |
34
+ | 1280×720 (initial) | 20 | 1.5 Mbps | 1.5 |
35
+ | 1920×1080 | 30 | 3 Mbps | 1 |
36
+
37
+ Normal dimensions are bounded independently of source size while preserving its aspect ratio, with no upscaling of smaller captures. The reference divisor is multiplied by `max(sourceWidth / 1920, sourceHeight / 1080)` and clamped to at least 1: for a 2560×1440 source, the initial divisor is 2 and output is still 1280×720, not 960p. These are ceilings, not guaranteed throughput or bandwidth reservations. Every 2 seconds while connected, the renderer reads current video outbound stats and their linked remote RTP/selected ICE pair, ignoring unrelated streams/pairs. Two consecutive pressured samples step down one tier: bandwidth/CPU limitation, fresh loss ≥5%, selected-path capacity below 75% of the current ceiling, RTT >450ms, or RTT above 250ms and 150ms above its session minimum. Eight consecutive healthy samples step up one tier, requiring no limitation, loss <2% when present, RTT <250ms when present and estimated capacity ≥110% of the next tier when available. Without capacity estimates, fresh loss and RTT feedback are required for recovery. Missing, repeated and idle samples reset the streaks rather than proving spare bandwidth; stalled sends with explicit bandwidth/CPU limitation still count as pressure. Low bytes-per-second alone is never treated as congestion. Unsupported/failed stats or parameter calls retain the last working settings and retry without forcing JPEG fallback. Updates preserve encoding identity and sender transaction parameters; sampling never overlaps and stops on fallback/unload. No user-facing quality toggle is introduced.
38
+
39
+ ### Zoom detail priority and mixed versions
40
+
41
+ Pinch or Drag double-tap zoom enters detail priority above 1.05× and leaves at or below 1.01× (hysteresis avoids near-Fit chatter). The panel sends only state transitions, not a message per movement/frame, and retains no extra React/server cache state. The session connection negotiates this through `ready.zoomQuality: true` before sending `{ type: 'view', zoomed: boolean }`; startup retains only the latest desired state. Runtime switching/close forbids late messages. Old/non-advertising Hosts receive no new message and keep existing local zoom. New Hosts with old clients default to ordinary adaptive quality.
42
+
43
+ The backend explicitly passes `zoomQuality: true` when starting a supporting adapter; the native adapter defaults this flag false and passes it into capture startup. Only a full supporting backend/native/capture path advertises support. This also covers a newer installer running an older OTA backend. The server ignores valid `view` controls if its native adapter did not advertise support; the parser accepts only a Boolean and projects away client-supplied bitrate/resolution values. Electron forwards the view control to capture, never to the Quartz input helper. Authentication/origin, session lifetime, rate/size limits and Relay framing remain unchanged.
44
+
45
+ While zoomed, all four WebRTC tiers use `scaleResolutionDownBy: 1` (up to the captured 1440p source) and `degradationPreference: maintain-resolution`. They keep the same adaptive bitrate ceilings but reduce FPS ceilings to 2 / 5 / 10 / 15 respectively, prioritizing text detail over motion instead of blindly raising bandwidth. Fit immediately restores the ordinary resolution/FPS of the current tier, not a new high-quality default. Chromium still owns actual congestion handling; this is a resolution preference, not a guarantee that a severely constrained network can deliver a sharp frame immediately. Parameter writes are serialized, latest zoom state wins over an in-flight update, and failed tuning is retried by the stats loop without disconnecting working video.
27
46
 
28
47
  `YURI_REMOTE_DESKTOP_ICE_SERVERS` optionally supplies an RTCIceServer JSON array (maximum 8 entries). It is configured on the Desktop Host, not the Relay, and passed to both peers for that session. No external STUN service is contacted by default. Deployment-managed TURN credentials are visible to the paired receiving client as necessary for WebRTC and are never persisted or logged by this feature. Prefer short-lived credentials. A TURN credential minting service is not included.
29
48
 
30
49
  If WebRTC fails, is unavailable, or produces no decoded video within 7 seconds of the answer, the client requests JPEG fallback through the existing runtime WS. This works over Relay without TURN. Fallback is at most 1440×900, JPEG quality 0.65, maximum 512 KiB per frame, and at most approximately 12 frames/second. Only one frame is outstanding: the receiver ACKs after image decode, and capture skips work until ACK. Thus effective frame rate also depends on RTT/encode/decode time; this is not a 30-fps WAN guarantee. WS buffering is capped at 512 KiB. The video fallback shares the connection with other Relay traffic.
31
50
 
51
+ Before sending JPEG, the capture page compares its complete encoded bytes with the previous sent frame, retaining at most one 512 KiB JPEG in memory for that session. Identical frames send nothing; any encoded change (including a small text edit) sends normally. This is exact comparison, not a low-resolution image/hash heuristic. Static-frame suppression saves network/Relay bytes, but the polling draw/encode work still occurs: it is not a capture-CPU optimization. A failed main-process `send()` returns a local-only `ack` with `dropped: true`, clearing duplicate history so an unchanged frame is retried instead of leaving the receiver stale. The wire ACK format, one-outstanding-frame bound and maximum frame size are unchanged. Teardown clears retained bytes and ignores late encoding completion. ACK-based JPEG quality/interval adaptation is not part of this change.
52
+
53
+ Zoomed JPEG raises its cap to 2560×1440 and quality to 0.8, with at most 4 capture cycles/second rather than the normal approximately 12 fps. Oversized frames retry at 0.5 then 0.25 JPEG quality while preserving resolution, and frames still over 512 KiB are skipped. Zoom/Fit invalidates duplicate history for a detail refresh, but never bypasses an outstanding decode ACK. An encode completed for an obsolete zoom state is discarded rather than sent stale. Fit restores 1440×900 / 0.65. These are bounded zoom profiles, not ACK-based adaptive JPEG quality.
54
+
32
55
  The UI calls JPEG fallback “Compatibility stream”, not “Encrypted tunnel”: direct `ws://` transport is not E2EE. Use HTTPS/WSS for direct network connections and TLS for public Relay ingress. JPEG carried through Relay benefits from the existing endpoint-to-endpoint encrypted tunnel; a plain direct LAN connection does not acquire that property merely by using this feature.
33
56
 
34
57
  Control always stays on the authenticated WS, including when video is P2P. `protocol.js` bounds and projects pointer coordinates, scroll deltas, text (1024 UTF-16 code units), key names, SDP (64 KiB), and ICE candidate fields. There is no arbitrary shell/keycode/file/clipboard API. WS messages are capped at 96 KiB; input is serialized with at most 32 queued commands and 150 messages/second. The native helper checks permission and active display again, and accepts only its own bounded JSON command vocabulary.
@@ -57,6 +80,10 @@ Regression checks cover manual switching, ignored sensor events, no sensor permi
57
80
 
58
81
  Focused tests cover message validation, real auth/origin gates, revocation, single ownership, delayed startup/abort, real Relay WS dispatch/fragmentation, runtime switching, decoded-frame ACK, coordinate mapping, pinch cancellation, and 50 unrelated homepage renders. The Electron evidence fixture runs the production capture page/preload with a synthetic canvas, a real Chromium WebRTC receiver and JPEG fallback; it does not capture or control the user's desktop. A separate local visual fixture was checked in Chromium at 390×844 and 844×390 using the production panel and synthetic screen data. That checks panel layout, not physical-phone rendering or real desktop capture.
59
82
 
83
+ Adaptive-media regression tests cover tier bounds/hysteresis, active-pair selection, stale/missing/idle feedback, rejected tuning, non-overlapping stats and fallback/unload cleanup. A 1000-frame duplicate burst sends only the first frame; one-byte changes remain observable. The real Electron evidence fixture stages the capture assets from the installer file list, loads their file-origin ES modules under CSP, sends a synthetic 1440p canvas through native WebRTC and applies controlled poor/healthy stats to verify real encoder downshift/recovery. It then freezes the canvas to verify zero repeated JPEG sends, changes a small patch and tests dropped-frame retry plus ACK gating. This is a controlled local feedback/encoding check, not evidence of weak-WAN latency, actual network estimation, release signing or physical-phone decode behavior.
84
+
85
+ Zoom checks additionally cover negotiated/missing support, old backend/native combinations, strict Boolean projection, direct/Relay view routing, no Quartz injection, zoomed bitrate preservation, serialized tuning, stale encodes and restoration to the current normal tier. Source-size tests keep the initial tier at 720p for 1440p, 1080p and 720p inputs. UI tests exercise double-tap/Fit and repeated pinch frames with only one detail transition, and confirm encoder-size changes do not reset local zoom. The real Electron receiver observes 2560×1440 WebRTC after zoom (at the initial 1.5 Mbps ceiling and 10 fps cap), returns to ordinary encoding on Fit, and decodes zoomed JPEG at 2560×1440 then normal JPEG at 1440×810. This synthetic-source run does not establish physical-phone zoom-to-sharp latency on a real weak network.
86
+
60
87
  The standalone-page update was previously checked at both viewport sizes with a synthetic remote screen. Actual Chromium CDP touch dispatch verified inverse cursor coordinates, Drag double-tap zoom/restore and 1× pan snap-back. Real browser history Back unmounted the page and retained the source draft. Orientation is now manual-only; focused tests cover ignored sensor events, both inverse coordinate mappings, native back routing and no reconnection on direction/mode changes. Native dock/composer behavior and keyboard/safe areas on physical hardware remain device acceptance checks.
61
88
 
62
89
  Development-only native acceptance additionally exercised the production adapter and input helper against the real macOS desktop: JPEG frames decoded at 1440×810, and a fixed 26-character test string reached an isolated test textarea through Quartz input. The focused test window reported native/window/DOM keyboard focus. An earlier run received frames but not the text; that run did not measure focus and its cause is unresolved. This is not yet a repeatability guarantee. No real screen images or user-entered text were retained. The permission probe returned granted Screen Recording and Accessibility when Electron was started through macOS Launch Services; starting the same executable as a shell child reported denied/untrusted. Permission checks must be made under the actual launch context rather than inferred from the app's path or a Settings toggle.
@@ -5,6 +5,7 @@ export function parseDesktopMessage(value) {
5
5
  if (!value || typeof value !== 'object' || Array.isArray(value)) throw new Error('invalid_message');
6
6
  const { type } = value;
7
7
  if (type === 'ack' || type === 'fallback' || type === 'ping' || type === 'release') return { type };
8
+ if (type === 'view' && typeof value.zoomed === 'boolean') return { type, zoomed: value.zoomed };
8
9
  if (type === 'answer' && typeof value.sdp === 'string' && value.sdp.length <= 65536) return { type, sdp: value.sdp };
9
10
  if (type === 'ice' && (value.candidate === null || (typeof value.candidate === 'object'
10
11
  && typeof value.candidate.candidate === 'string' && value.candidate.candidate.length <= 2048))) {
@@ -5,6 +5,7 @@ it.each([null, [], {}, { type: 'exec', command: 'something' }, { type: 'text', t
5
5
  { type: 'key', key: 'arbitrary' }, { type: 'pointer', action: 'down', x: NaN, y: 0 },
6
6
  { type: 'pointer', action: 'click', x: 2, y: 0 }, { type: 'scroll', dx: Infinity, dy: 0 },
7
7
  { type: 'answer', sdp: 'x'.repeat(65537) }, { type: 'ice', candidate: { candidate: 'x'.repeat(2049) } },
8
+ { type: 'view' }, { type: 'view', zoomed: 'true' }, { type: 'view', zoomed: 1 },
8
9
  ])('rejects invalid or oversized messages %#', value => {
9
10
  expect(() => parseDesktopMessage(value)).toThrow('invalid_message');
10
11
  });
@@ -12,6 +13,8 @@ it('projects only permitted fields and bounds scroll and input', () => {
12
13
  expect(parseDesktopMessage({ type: 'pointer', action: 'down', x: 0.2, y: 0.7, command: 'ignored' })).toEqual({ type: 'pointer', action: 'down', x: 0.2, y: 0.7 });
13
14
  expect(parseDesktopMessage({ type: 'scroll', dx: -2000, dy: 5000 })).toEqual({ type: 'scroll', dx: -1000, dy: 1000 });
14
15
  expect(parseDesktopMessage({ type: 'text', text: '中文🙂' })).toEqual({ type: 'text', text: '中文🙂' });
16
+ expect(parseDesktopMessage({ type: 'view', zoomed: true, maxBitrate: Infinity, command: 'ignored' })).toEqual({ type: 'view', zoomed: true });
17
+ expect(parseDesktopMessage({ type: 'view', zoomed: false })).toEqual({ type: 'view', zoomed: false });
15
18
  expect(parseDesktopMessage({ type: 'ice', candidate: { candidate: 'candidate:test', sdpMid: '0', sdpMLineIndex: 0, unexpected: 'ignored' } })).toEqual({
16
19
  type: 'ice', candidate: { candidate: 'candidate:test', sdpMid: '0', sdpMLineIndex: 0 },
17
20
  });
@@ -18,6 +18,7 @@ export function attachRemoteDesktop({ app, server, adapter, uiAuthController, is
18
18
  wss.on('connection', (ws, req, auth) => {
19
19
  let session;
20
20
  let closed = false;
21
+ let zoomQuality = false;
21
22
  let lastPing = Date.now();
22
23
  let count = 0;
23
24
  let windowStart = Date.now();
@@ -27,6 +28,7 @@ export function attachRemoteDesktop({ app, server, adapter, uiAuthController, is
27
28
  const abort = new AbortController();
28
29
  const send = (value) => {
29
30
  if (closed || ws.readyState !== 1 || ws.bufferedAmount > 512 * 1024) return false;
31
+ if (value?.type === 'ready') zoomQuality = value.zoomQuality === true;
30
32
  ws.send(Buffer.isBuffer(value) ? value : JSON.stringify(value));
31
33
  return true;
32
34
  };
@@ -63,12 +65,12 @@ export function attachRemoteDesktop({ app, server, adapter, uiAuthController, is
63
65
  queued++;
64
66
  chain = chain.then(async () => {
65
67
  await start;
66
- if (!closed && session) await session.handle(message);
68
+ if (!closed && session && (message.type !== 'view' || zoomQuality)) await session.handle(message);
67
69
  }).catch(() => fail('desktop_failed')).finally(() => { queued--; });
68
70
  });
69
71
  const start = (async () => {
70
72
  try {
71
- session = await adapter.start({ send, onEnded: () => fail('desktop_ended'), signal: abort.signal,
73
+ session = await adapter.start({ send, onEnded: () => fail('desktop_ended'), signal: abort.signal, zoomQuality: true,
72
74
  client: auth.type === 'client' ? { id: auth.clientId ?? auth.client?.id, label: auth.client?.label ?? '' } : null });
73
75
  if (closed) { session.close(); occupied = false; }
74
76
  } catch (error) {
@@ -27,7 +27,7 @@ beforeEach(async () => {
27
27
  app.post('/auth/url-token', auth.handleUrlAuthToken);
28
28
  app.use(auth.requireAuth);
29
29
  adapter = { supported: true, enabled: true, start: vi.fn(async ({ send }) => {
30
- send({ type: 'ready', width: 1600, height: 900 });
30
+ send({ type: 'ready', width: 1600, height: 900, zoomQuality: true });
31
31
  return { handle: vi.fn(), close: vi.fn() };
32
32
  }), stop: vi.fn() };
33
33
  server = http.createServer(app);
@@ -72,6 +72,8 @@ it('allows a scoped device, handles input and pong, rejects simultaneous control
72
72
  const desktop = await adapter.start.mock.results[0].value;
73
73
  ws.send(JSON.stringify({ type: 'pointer', action: 'click', x: 0.4, y: 0.6 }));
74
74
  await vi.waitFor(() => expect(desktop.handle).toHaveBeenCalledWith({ type: 'pointer', action: 'click', x: 0.4, y: 0.6 }));
75
+ ws.send(JSON.stringify({ type: 'view', zoomed: true, maxBitrate: 999999999 }));
76
+ await vi.waitFor(() => expect(desktop.handle).toHaveBeenCalledWith({ type: 'view', zoomed: true }));
75
77
  const pong = once(ws, 'message'); ws.send('{"type":"ping"}');
76
78
  expect(JSON.parse((await pong)[0].toString()).type).toBe('pong');
77
79
  expect(await rejected(socket())).toBe(409);
@@ -90,6 +92,22 @@ it('keeps an early SDP answer until asynchronous capture startup finishes', asyn
90
92
  await vi.waitFor(() => expect(finish).toBeDefined()); finish();
91
93
  await vi.waitFor(() => expect(handle).toHaveBeenCalledWith({ type: 'answer', sdp: 'answer' }));
92
94
  });
95
+
96
+ it('does not forward view commands into an older native adapter that did not advertise support', async () => {
97
+ const handle = vi.fn();
98
+ adapter.start.mockImplementation(async ({ send, zoomQuality }) => {
99
+ expect(zoomQuality).toBe(true);
100
+ send({ type: 'ready', width: 1600, height: 900 });
101
+ return { handle, close: vi.fn() };
102
+ });
103
+ const ws = socket(); await once(ws, 'open');
104
+ ws.send('{"type":"view","zoomed":true}');
105
+ const pong = new Promise(resolve => ws.on('message', data => { if (JSON.parse(data.toString()).type === 'pong') resolve(); }));
106
+ ws.send('{"type":"ping"}');
107
+ await pong;
108
+ await vi.waitFor(() => expect(adapter.start).toHaveBeenCalledOnce());
109
+ expect(handle).not.toHaveBeenCalled();
110
+ });
93
111
  it('aborts pending native consent on disconnect and frees the single capture slot', async () => {
94
112
  let signal;
95
113
  adapter.start.mockImplementation(options => {
@@ -119,6 +137,8 @@ it('carries screen frames and validated input through the real Relay WS dispatch
119
137
  await host.handleFrame(encodeTunnelFrame(TunnelFrameType.WsText, 2, Buffer.from('{"type":"key","key":"Enter"}')));
120
138
  const desktop = await adapter.start.mock.results[0].value;
121
139
  await vi.waitFor(() => expect(desktop.handle).toHaveBeenCalledWith({ type: 'key', key: 'Enter' }));
140
+ await host.handleFrame(encodeTunnelFrame(TunnelFrameType.WsText, 2, Buffer.from('{"type":"view","zoomed":true}')));
141
+ await vi.waitFor(() => expect(desktop.handle).toHaveBeenCalledWith({ type: 'view', zoomed: true }));
122
142
  const jpeg = Buffer.alloc(200000, 17);
123
143
  adapter.start.mock.calls[0][0].send(jpeg);
124
144
  let reassembled;
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkstreamRendererImpl-CgxiRR25.js","assets/rolldown-runtime-hePW80VL.js","assets/vendor-base-ui-CdzJ6My_.js","assets/useUIStore-CEingF2z.js","assets/runtime-switch-DhMY9eiB.js","assets/runtime-auth-BaBM02zI.js","assets/vendor-zustand-o69pgTEK.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/vendor-react-BP2cRVqX.js","assets/fileQueries-Bd-OEFmO.js","assets/vendor-tanstack-react-query-CdqCAt40.js","assets/vendor-tanstack-query-core-BWz0ose6.js","assets/queryRuntime-DWgXfxGx.js","assets/runtime-fetch-DfALP7-b.js","assets/vendor-markstream-react-Bm0cO70Z.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/vendor-markstream-core-Cm34iPLL.js","assets/vendor-floating-ui-dom-BHhLtF5l.js","assets/vendor-floating-ui-core-Co1I1lFV.js","assets/vendor-reactuses-core-BJ-jJ4YM.js","assets/vendor-lodash-es-DfLbG5Af.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/button-K_jXf_uP.js","assets/desktop-5DP3-Bao.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/store-7wItZZ7_.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/useMobileNavigationStore-bSLdq45x.js","assets/gitApiHttp-Bnr4_wxy.js","assets/vendor-opencode-client-fxfj4IA_.js","assets/vendor-effect-DV9F8PTZ.js","assets/persistence-BPb2hZ3c.js","assets/pathNormalization-ewtPqJWn.js","assets/vendor-pathe-vBmvQE8f.js","assets/runtime-file-resource-DtsKbFf3.js","assets/runtime-file-store-BVRgEtI-.js","assets/path-utils-jGozTg9d.js","assets/platform-wGCQUVxr.js","assets/vendor-sonner-ZS8XIOVl.js","assets/useAssistantUIStore-BZt-lLlW.js","assets/vendor-zod-Dzk5kdUU.js","assets/vendor-fuse.js-DB5wDJbI.js","assets/vendor-fuzzysort-ukaRp9PC.js","assets/useThemeSystem-8jhE4Zyk.js","assets/tooltip-8gf-KZqb.js","assets/image-loading-DVZlFuU5.js","assets/image-loading-D9Z_BASK.css","assets/url-MRa-FtQa.js","assets/useEffectiveDirectory-DbFrzslf.js","assets/LoadingImage-COJSLMyx.js","assets/ImageLoadingPlaceholder-BPEqdGkV.js","assets/markdownHeightCache-BaLmCxOF.js","assets/dualLimitLru-D8Sphgua.js","assets/MarkdownRendererImpl-gefzhEUO.js","assets/vendor-katex-DNVSTX6g.js","assets/FadeInOnReveal-DAByozhu.js","assets/markdownTheme-DHoKvD6O.js","assets/vendor-pierre-diffs-DPBtNDJ5.js","assets/vendor-hast-util-to-html-Bw_SgZ1t.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-BMOrLc9L.js","assets/markdown-worker-oBGEB9Eg.js","assets/vendor-morphdom-BbKiNDAu.js","assets/vendor-dompurify-CeJNOzik.js","assets/vendor-pele-C1WTNWUm.js","assets/vendor-marked-WVekxjAN.js","assets/vendor-remend-C3cXc-tf.js","assets/fileReferenceActions-DkLLKj6A.js","assets/toolHelpers-iEHVHQ9p.js","assets/fileReferenceParser-1HHDBUum.js","assets/MarkstreamRendererImpl-EpBnVy9J.css"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{a as t}from"./vendor-zustand-o69pgTEK.js";import{it as n,rt as r}from"./vendor-base-ui-CdzJ6My_.js";import"./brand-storage-bootstrap-D4BW3w-M.js";import{n as i}from"./vendor-react-BP2cRVqX.js";import{o as a}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{r as o}from"./button-K_jXf_uP.js";import{t as s}from"./useEffectiveDirectory-DbFrzslf.js";import{i as c,n as l,t as u}from"./markdownHeightCache-BaLmCxOF.js";var d=i(),f=e(n(),1),p=`yuri:chunk-import-reload`,m=250,h=3e4,g=[/Importing a module script failed/i,/Failed to fetch dynamically imported module/i,/error loading dynamically imported module/i,/Loading chunk \S+ failed/i,/ChunkLoadError/i];function _(e){if(e instanceof Error)return`${e.name}\n${e.message}\n${e.stack??``}`;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function v(e){let t=_(e);return g.some(e=>e.test(t))}function y(e){return`0.2.24-beta.9:${_(e).slice(0,500)}`}function b(e){if(typeof window>`u`)return;let t=Date.now(),n=y(e),r=null;try{let e=window.sessionStorage.getItem(p);if(e)try{r=JSON.parse(e)}catch{r=null}}catch{return}let i=typeof r?.timestamp==`number`?r.timestamp:0;if(!(r?.signature===n&&t-i<h)){try{window.sessionStorage.setItem(p,JSON.stringify({signature:n,timestamp:t}))}catch{return}console.error(`[refresh-debug] chunk-import-reload`,{error:_(e).slice(0,1e3)}),window.setTimeout(()=>{window.location.reload()},0)}}async function x(e,t={}){let n=t.retries??1,r;for(let t=0;t<=n;t+=1)try{return await e()}catch(e){if(r=e,!v(e)||t>=n)break;await new Promise(e=>setTimeout(e,m*(t+1)))}throw v(r)&&b(r),r}var S=e=>(0,f.lazy)(()=>x(e)),C=(e,t)=>!!t?.toLowerCase().startsWith(`video/`)||/^data:video\//i.test(e)||/\.(?:mp4|m4v|webm|mov|ogv|ogg)(?:[?#]|$)/i.test(e),w=(e,t)=>{try{let n=t??(typeof localStorage>`u`?null:localStorage);return!n||n.getItem(e)!==`0`}catch{return!0}},T=(e,t)=>{try{typeof localStorage<`u`&&localStorage.setItem(e,t?`1`:`0`)}catch{}},E=`yuri:markstream-react`,D=e=>w(E,e),O=t(e=>({markstreamReactEnabled:D(),setMarkstreamReactEnabled:t=>{T(E,t),e({markstreamReactEnabled:t})}})),k=null,A=()=>(k??=a(()=>import(`./MarkstreamRendererImpl-CgxiRR25.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78])).catch(e=>{throw k=null,e}),k),j=()=>{A().catch(()=>void 0)},M=null,N=()=>(M??=a(()=>import(`./MarkdownRendererImpl-gefzhEUO.js`).then(e=>e.n),__vite__mapDeps([55,1,4,5,24,25,2,3,6,7,8,9,10,11,12,13,14,39,56,20,21,22,23,26,16,27,28,29,30,31,32,33,34,35,36,37,38,40,41,42,43,44,54,45,47,48,49,50,57,53,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77])).catch(e=>{throw M=null,e}),M),P=()=>{N().catch(()=>void 0),D()&&j()},F=class extends f.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){console.warn(`[markstream-react] falling back to the current Markdown renderer`,e)}render(){return this.state.hasError?this.props.fallback:this.props.children}},I=f.createContext(!0),L=()=>f.useContext(I),R=r(),z=S(()=>N().then(e=>({default:e.MarkdownRenderer}))),B=S(()=>A().then(e=>({default:e.MarkstreamRenderer}))),V=S(()=>N().then(e=>({default:e.SimpleMarkdownRenderer}))),H=e=>e===`tool`?`markdown-content markdown-tool`:e===`reasoning`?`markdown-content markdown-reasoning`:`markdown-content leading-relaxed`,U=e=>{let t=(0,d.c)(15),n=O(K),r=typeof e.content==`string`?e.content:``,i=typeof e.variant==`string`?e.variant:`assistant`,a;t[0]!==r||t[1]!==n||t[2]!==e.reserveMeasuredHeight||t[3]!==i?(a=e.reserveMeasuredHeight?l(u(r,n?`markstream:${i}`:i)):void 0,t[0]=r,t[1]=n,t[2]=e.reserveMeasuredHeight,t[3]=i,t[4]=a):a=t[4];let s=a,f;t[5]!==e.className||t[6]!==e.variant?(f=o(`relative break-words w-full min-w-0`,H(e.variant),typeof e.className==`string`?e.className:void 0),t[5]=e.className,t[6]=e.variant,t[7]=f):f=t[7];let p;t[8]!==r||t[9]!==e.animated||t[10]!==s?(p=(0,R.jsx)(c,{animated:e.animated,content:r,reservedHeight:s}),t[8]=r,t[9]=e.animated,t[10]=s,t[11]=p):p=t[11];let m;return t[12]!==f||t[13]!==p?(m=(0,R.jsx)(`div`,{className:f,"aria-busy":`true`,"data-markdown-hydration":`deferred`,"data-markdown-ready":`false`,children:p}),t[12]=f,t[13]=p,t[14]=m):m=t[14],m},W=e=>{let t=(0,d.c)(13),n=L(),r=O(q);if(!n&&e.isStreaming!==!0){let n;return t[0]===e?n=t[1]:(n=(0,R.jsx)(U,{...e,animated:!1,reserveMeasuredHeight:!0}),t[0]=e,t[1]=n),n}let i;t[2]===e?i=t[3]:(i=(0,R.jsx)(f.Suspense,{fallback:(0,R.jsx)(U,{...e,reserveMeasuredHeight:!0}),children:(0,R.jsx)(z,{...e})}),t[2]=e,t[3]=i);let a=i,o;t[4]!==a||t[5]!==r||t[6]!==e?(o=r?(0,R.jsx)(F,{fallback:a,children:(0,R.jsx)(f.Suspense,{fallback:(0,R.jsx)(U,{...e,reserveMeasuredHeight:!0}),children:(0,R.jsx)(B,{...e})})}):a,t[4]=a,t[5]=r,t[6]=e,t[7]=o):o=t[7];let c=o,l;t[8]===e?l=t[9]:(l=t=>{if(!e.onShowPopup||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let n=t.target instanceof Element?t.target.closest(`a[href]`):null,r=n?.getAttribute(`href`);if(!r||!C(r))return;t.preventDefault(),t.stopPropagation();let i=n?.textContent?.trim()||r.split(/[/?#]/).filter(Boolean).pop()||r;e.onShowPopup({open:!0,title:i,content:``,video:{url:r,filename:i,directory:s()??``}})},t[8]=e,t[9]=l);let u;return t[10]!==c||t[11]!==l?(u=(0,R.jsx)(`div`,{className:`contents`,onClickCapture:l,children:c}),t[10]=c,t[11]=l,t[12]=u):u=t[12],u},G=e=>{let t=(0,d.c)(4);if(!L()){let n;return t[0]===e?n=t[1]:(n=(0,R.jsx)(U,{...e,animated:!1}),t[0]=e,t[1]=n),n}let n;return t[2]===e?n=t[3]:(n=(0,R.jsx)(f.Suspense,{fallback:(0,R.jsx)(U,{...e}),children:(0,R.jsx)(V,{...e})}),t[2]=e,t[3]=n),n};function K(e){return e.markstreamReactEnabled}function q(e){return e.markstreamReactEnabled}export{C as a,P as i,G as n,S as o,I as r,W as t};