@yuriai/web 0.2.0 → 0.2.1

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 (53) hide show
  1. package/dist/assets/{AssistantView-C67p8xuJ.js → AssistantView-7qr-iEdP.js} +3 -3
  2. package/dist/assets/{DiagramView-DPcsLliB.js → DiagramView-CD2lyJo4.js} +1 -1
  3. package/dist/assets/{GuiPluginSurface-DYQotofG.js → GuiPluginSurface-DIPLwOYq.js} +1 -1
  4. package/dist/assets/{MarkdownRenderer-Qqpr2mPH.js → MarkdownRenderer-Db-If3tk.js} +2 -2
  5. package/dist/assets/{MarkdownRendererImpl-NsSkRpGi.js → MarkdownRendererImpl-B0JOirRM.js} +2 -2
  6. package/dist/assets/{MarkstreamRendererImpl-DQpFxOfX.js → MarkstreamRendererImpl-96Mp8TZ6.js} +1 -1
  7. package/dist/assets/{MobileDetailNavigation-BaXXR9xC.js → MobileDetailNavigation-9ZlwSUXP.js} +1 -1
  8. package/dist/assets/{MobileShareBridge-CbmVqEAx.js → MobileShareBridge-DM3xAVdm.js} +1 -1
  9. package/dist/assets/{MobileTabPageHeader-BIAkmiCb.js → MobileTabPageHeader-LVBIRzcs.js} +1 -1
  10. package/dist/assets/{MultiRunWindow-B_ptQuKi.js → MultiRunWindow-Bhl5GdPt.js} +1 -1
  11. package/dist/assets/{SettingsView-BbzGMK_z.js → SettingsView-NfjqTxIN.js} +1 -1
  12. package/dist/assets/{SettingsWindow-h25-n1wB.js → SettingsWindow-wet6Qnx3.js} +1 -1
  13. package/dist/assets/{TerminalView-DCQATs7S.js → TerminalView-BXulu3RW.js} +1 -1
  14. package/dist/assets/{ToolOutputDialog-Bm2kSYCn.js → ToolOutputDialog-UrL8sue9.js} +1 -1
  15. package/dist/assets/{appThemeRegistry-DNb0Emjp.js → appThemeRegistry-BlucERDr.js} +1 -1
  16. package/dist/assets/{capgoAdapter-vYSlprFh.js → capgoAdapter-BvTGibVJ.js} +1 -1
  17. package/dist/assets/{fileMentionTouchSelection-BkCvPXYn.js → fileMentionTouchSelection-BLvRkcZy.js} +1 -1
  18. package/dist/assets/{fileReferenceActions-CgsqIeIM.js → fileReferenceActions-ui8464r-.js} +1 -1
  19. package/dist/assets/{gitApi-DdK0IlIM.js → gitApi-DgBiaLFA.js} +1 -1
  20. package/dist/assets/{insertionBoundaries-B28Dk8Dp.js → insertionBoundaries-YFGFUgWP.js} +1 -1
  21. package/dist/assets/{main-hwetTT7m.js → main-BniroGdt.js} +2 -2
  22. package/dist/assets/{main-BqrjAS06.js → main-CdSf07-K.js} +21 -21
  23. package/dist/assets/{mcpQueries-DTbwg6z6.js → mcpQueries-C-nazLvB.js} +1 -1
  24. package/dist/assets/{miniChat-BMNB2ztD.js → miniChat-tsfTW6ta.js} +2 -2
  25. package/dist/assets/{mobile-BdQMBg5f.js → mobile-DKmqw9JK.js} +2 -2
  26. package/dist/assets/{mobileBackNavigation-CaxJVILv.js → mobileBackNavigation-CyumxcRr.js} +1 -1
  27. package/dist/assets/{multirun-CpWGs_sU.js → multirun-oqrPQGWy.js} +1 -1
  28. package/dist/assets/{native-config-BfIzLvxi.js → native-config-Ban8ER0D.js} +1 -1
  29. package/dist/assets/{projectMeta-DZFuF8rn.js → projectMeta-WDYXNks8.js} +1 -1
  30. package/dist/assets/{readiness-CdLdF_Pp.js → readiness-Dp48zAJz.js} +1 -1
  31. package/dist/assets/{renderElectronMiniChatApp-C_MTyWYO.js → renderElectronMiniChatApp-CD4LwiXX.js} +2 -2
  32. package/dist/assets/renderMobileApp-NSBm1xYQ.js +28 -0
  33. package/dist/assets/{runtimeConfig-BA2rxwwc.js → runtimeConfig-CG-Ua9P-.js} +1 -1
  34. package/dist/assets/{runtimeEndpointReset-BxlxF5X2.js → runtimeEndpointReset-BEXrIK9C.js} +4 -4
  35. package/dist/assets/{sessionChangeSummary-2Bt21ayX.js → sessionChangeSummary-BJbopgHT.js} +1 -1
  36. package/dist/assets/{sessionLookup-C1nNfbh0.js → sessionLookup-sLNgV6qV.js} +1 -1
  37. package/dist/assets/{speechSettingsQueries-B6_7YC3O.js → speechSettingsQueries-CHUF4UQ6.js} +1 -1
  38. package/dist/assets/src-DISp5rL3.css +2 -0
  39. package/dist/assets/{types-CfsdaRmC.js → types-BUsGt9HF.js} +1 -1
  40. package/dist/assets/{useAppFontEffects-dB996j53.js → useAppFontEffects-IGLoyUFr.js} +5 -5
  41. package/dist/assets/{useDesktopWindowControlsLayout-DyTyv6Rk.js → useDesktopWindowControlsLayout-DepZ1Abm.js} +1 -1
  42. package/dist/assets/{useEffectiveDirectory-Cxkuxd4u.js → useEffectiveDirectory-Dhn1RiMm.js} +1 -1
  43. package/dist/assets/{useMobileNavigationStore-M61L6rKt.js → useMobileNavigationStore-BPOHzqoM.js} +3 -3
  44. package/dist/assets/{useWorkerHighlightedLines-BjUDrhqD.js → useWorkerHighlightedLines-Cgiz5cUq.js} +1 -1
  45. package/dist/index.html +6 -6
  46. package/dist/mini-chat.html +6 -6
  47. package/dist/mobile.html +6 -6
  48. package/package.json +1 -1
  49. package/server/lib/llm/DOCUMENTATION.md +7 -0
  50. package/server/lib/llm/generate.js +33 -13
  51. package/server/lib/llm/generate.test.js +79 -2
  52. package/dist/assets/renderMobileApp-B-tmvQxg.js +0 -28
  53. package/dist/assets/src-D3pZqEZM.css +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-DqtgX2FB.js";import{n as i}from"./vendor-react-BP2cRVqX.js";import{d as a,r as o,t as s}from"./button-CT7WL0lp.js";import{n as c}from"./useThemeSystem-8jhE4Zyk.js";import{n as l}from"./Icon-DofI60x2.js";import{i as u,n as d,t as f}from"./tooltip-CnIKZ6bg.js";import{n as p}from"./MarkdownRenderer-Qqpr2mPH.js";import{n as m,r as h}from"./toolHelpers-DL452NVK.js";import{t as g}from"./vendor-tanstack-react-virtual-B_EO--9t.js";import{n as _}from"./markdownTheme-DHoKvD6O.js";import{n as v,t as y}from"./markdown-worker-oBGEB9Eg.js";var b=e(t(),1),x=i(),S=n(),C=`w-[min(30rem,calc(100cqw-1rem))] min-w-[280px] max-w-full overflow-hidden rounded-xl shadow-[inset_0_1px_0_0_rgba(255,255,255,0.8),inset_0_0_0_1px_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.10),0_1px_2px_-0.5px_rgba(0,0,0,0.08),0_4px_8px_-2px_rgba(0,0,0,0.08),0_12px_20px_-4px_rgba(0,0,0,0.08)] dark:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.12),inset_0_0_0_1px_rgba(255,255,255,0.08),0_0_0_1px_rgba(0,0,0,0.36),0_1px_1px_-0.5px_rgba(0,0,0,0.22),0_3px_3px_-1.5px_rgba(0,0,0,0.20),0_6px_6px_-3px_rgba(0,0,0,0.16)]`,w={maxWidth:`min(28rem, calc(100cqw - 4ch))`,backgroundColor:`var(--surface-elevated)`,color:`var(--surface-elevated-foreground)`},T=`flex items-center justify-between gap-3 border-b border-[var(--surface-subtle)] px-3 py-2.5`,E=`text-xs font-medium leading-4 text-foreground md:text-[0.8125rem] md:leading-5`,D=`text-xs tabular-nums leading-4 text-muted-foreground md:text-[0.8125rem] md:leading-5`,O=`m-0 list-none divide-y divide-[var(--surface-subtle)] p-0`,k=`${O} max-h-[min(22rem,50vh)] overflow-y-auto`,A=`${O} w-full`,ee={className:`p-0 rounded-none`,maxHeightClass:`max-h-[46vh]`,disableHorizontal:!0},j=`px-2.5 py-1.5 text-xs leading-4 md:py-2 md:text-[0.8125rem] md:leading-5`,M=`flex min-w-0 items-center gap-1 text-xs leading-4 text-muted-foreground md:gap-1.5 md:text-[0.8125rem] md:leading-5`,te=`min-w-0 truncate text-xs leading-4 text-foreground md:text-[0.8125rem] md:leading-5`,ne=`inline-flex shrink-0 items-center gap-1 text-xs leading-4 tabular-nums text-muted-foreground md:text-[0.8125rem] md:leading-5`,re=`h-3 w-3 shrink-0 md:h-3.5 md:w-3.5`,ie={in_progress:`text-foreground`,pending:`text-foreground`,completed:`text-muted-foreground line-through`,cancelled:`text-muted-foreground line-through`},ae={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`},N=e=>{let t=(0,x.c)(26),{todo:n,isActive:r,activeRef:i}=e,{t:s}=a(),c=oe.has(n.status)?n.status:`pending`,p=ae[c],m;t[0]!==s||t[1]!==p?(m=s(p),t[0]=s,t[1]=p,t[2]=m):m=t[2];let h=m,g;t[3]===c?g=t[4]:(g=c===`in_progress`?(0,S.jsx)(l,{name:`record-circle`,className:`h-3.5 w-3.5 text-[var(--status-info)]`,"aria-hidden":`true`}):c===`completed`?(0,S.jsx)(l,{name:`checkbox-circle`,className:`h-3.5 w-3.5 text-[var(--status-success)]`,"aria-hidden":`true`}):(0,S.jsx)(l,{name:`time`,className:`h-3.5 w-3.5 text-muted-foreground`,"aria-hidden":`true`}),t[3]=c,t[4]=g);let _=g,v=r?`step`:void 0,y=r&&`bg-[var(--surface-muted)] before:absolute before:inset-y-2 before:left-0 before:w-0.5 before:rounded-full before:bg-[var(--status-info)]`,b;t[5]===y?b=t[6]:(b=o(`group relative grid min-w-0 grid-cols-[1rem_minmax(0,1fr)] items-start gap-2.5`,j,y),t[5]=y,t[6]=b);let C;t[7]!==_||t[8]!==h?(C=(0,S.jsx)(u,{asChild:!0,children:(0,S.jsx)(`span`,{className:`flex size-4 items-center justify-center`,"aria-label":h,children:_})}),t[7]=_,t[8]=h,t[9]=C):C=t[9];let w;t[10]===h?w=t[11]:(w=(0,S.jsx)(d,{side:`left`,sideOffset:6,children:h}),t[10]=h,t[11]=w);let T;t[12]!==C||t[13]!==w?(T=(0,S.jsxs)(f,{children:[C,w]}),t[12]=C,t[13]=w,t[14]=T):T=t[14];let E=ie[c],D;t[15]===E?D=t[16]:(D=o(`block whitespace-normal break-words`,E),t[15]=E,t[16]=D);let O;t[17]!==D||t[18]!==n.content?(O=(0,S.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,S.jsx)(`span`,{className:D,children:n.content})}),t[17]=D,t[18]=n.content,t[19]=O):O=t[19];let k;return t[20]!==i||t[21]!==O||t[22]!==v||t[23]!==b||t[24]!==T?(k=(0,S.jsxs)(`li`,{ref:i,"aria-current":v,className:b,children:[T,O]}),t[20]=i,t[21]=O,t[22]=v,t[23]=b,t[24]=T,t[25]=k):k=t[25],k},oe=new Set([`in_progress`,`pending`,`completed`,`cancelled`]),P=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),F=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(``):``,I=(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=F(n);e&&i.setAttribute(`style`,`${i.getAttribute(`style`)??``}${e}`)}},L=e=>`<pre><code>${P(e)}</code></pre>`,R=e=>{let t=(0,x.c)(21),{code:n,language:r,className:i,style:a,codeStyle:s,wrap:l}=e,u=l!==void 0&&l,{currentTheme:d}=c(),f=b.useRef(null),p;t[0]===d?p=t[1]:(p=_(d),t[0]=d,t[1]=p);let m=p,h,g;t[2]!==n||t[3]!==s||t[4]!==u?(h=()=>{let e=f.current;e&&(e.innerHTML=L(n),I(e,u,s))},g=[n,u,s],t[2]=n,t[3]=s,t[4]=u,t[5]=h,t[6]=g):(h=t[5],g=t[6]),b.useLayoutEffect(h,g);let v,C;t[7]!==n||t[8]!==s||t[9]!==r||t[10]!==u?(v=()=>{let e=f.current;if(!e)return;let t=!0,i=new AbortController;return y(n,(r||`text`).toLowerCase(),{signal:i.signal,priority:`visible`}).then(n=>{!t||!e||!n||(e.innerHTML=n,I(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]=v,t[12]=C):(v=t[11],C=t[12]),b.useEffect(v,C);let w;t[13]===i?w=t[14]:(w=o(`typography-code`,i),t[13]=i,t[14]=w);let T=m,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,S.jsx)(`div`,{ref:f,className:w,style:E}),t[18]=w,t[19]=E,t[20]=D):D=t[20],D},z=e=>{let t=e.replace(/^<file>\s*\n?/,``).replace(/\n?<\/file>\s*$/,``);return t=t.replace(/^\s*\d{5}\|\s?/gm,``),t.trim()},B=(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}},V=e=>e?e.includes(`<diagnostics`)||e.includes(`<file_diagnostics>`)||e.includes(`LSP errors detected`)||e.includes(`This file has errors`):!1,H=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():``,U=(e,t)=>!e||typeof e!=`object`?String(e):h(e,t||``),W=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}}},G=e=>{if(!e||typeof e!=`object`)return;let t=W(e.patch)??W(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=W(e.patch)??W(e.diff);if(t)return t}},K=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}}},q=(e,t,n)=>{let r=z(e);if((t===`edit`||t===`multiedit`||t===`write`||t===`apply_patch`)&&V(r)&&(r=H(r)),(t===`edit`||t===`multiedit`||t===`apply_patch`)&&r.trim().length===0){let e=G(n);if(e)return e}return r},se=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-DqtgX2FB.js";import{n as i}from"./vendor-react-BP2cRVqX.js";import{d as a,r as o,t as s}from"./button-CT7WL0lp.js";import{n as c}from"./useThemeSystem-8jhE4Zyk.js";import{n as l}from"./Icon-DofI60x2.js";import{i as u,n as d,t as f}from"./tooltip-CnIKZ6bg.js";import{n as p}from"./MarkdownRenderer-Db-If3tk.js";import{n as m,r as h}from"./toolHelpers-DL452NVK.js";import{t as g}from"./vendor-tanstack-react-virtual-B_EO--9t.js";import{n as _}from"./markdownTheme-DHoKvD6O.js";import{n as v,t as y}from"./markdown-worker-oBGEB9Eg.js";var b=e(t(),1),x=i(),S=n(),C=`w-[min(30rem,calc(100cqw-1rem))] min-w-[280px] max-w-full overflow-hidden rounded-xl shadow-[inset_0_1px_0_0_rgba(255,255,255,0.8),inset_0_0_0_1px_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.10),0_1px_2px_-0.5px_rgba(0,0,0,0.08),0_4px_8px_-2px_rgba(0,0,0,0.08),0_12px_20px_-4px_rgba(0,0,0,0.08)] dark:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.12),inset_0_0_0_1px_rgba(255,255,255,0.08),0_0_0_1px_rgba(0,0,0,0.36),0_1px_1px_-0.5px_rgba(0,0,0,0.22),0_3px_3px_-1.5px_rgba(0,0,0,0.20),0_6px_6px_-3px_rgba(0,0,0,0.16)]`,w={maxWidth:`min(28rem, calc(100cqw - 4ch))`,backgroundColor:`var(--surface-elevated)`,color:`var(--surface-elevated-foreground)`},T=`flex items-center justify-between gap-3 border-b border-[var(--surface-subtle)] px-3 py-2.5`,E=`text-xs font-medium leading-4 text-foreground md:text-[0.8125rem] md:leading-5`,D=`text-xs tabular-nums leading-4 text-muted-foreground md:text-[0.8125rem] md:leading-5`,O=`m-0 list-none divide-y divide-[var(--surface-subtle)] p-0`,k=`${O} max-h-[min(22rem,50vh)] overflow-y-auto`,A=`${O} w-full`,ee={className:`p-0 rounded-none`,maxHeightClass:`max-h-[46vh]`,disableHorizontal:!0},j=`px-2.5 py-1.5 text-xs leading-4 md:py-2 md:text-[0.8125rem] md:leading-5`,M=`flex min-w-0 items-center gap-1 text-xs leading-4 text-muted-foreground md:gap-1.5 md:text-[0.8125rem] md:leading-5`,te=`min-w-0 truncate text-xs leading-4 text-foreground md:text-[0.8125rem] md:leading-5`,ne=`inline-flex shrink-0 items-center gap-1 text-xs leading-4 tabular-nums text-muted-foreground md:text-[0.8125rem] md:leading-5`,re=`h-3 w-3 shrink-0 md:h-3.5 md:w-3.5`,ie={in_progress:`text-foreground`,pending:`text-foreground`,completed:`text-muted-foreground line-through`,cancelled:`text-muted-foreground line-through`},ae={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`},N=e=>{let t=(0,x.c)(26),{todo:n,isActive:r,activeRef:i}=e,{t:s}=a(),c=oe.has(n.status)?n.status:`pending`,p=ae[c],m;t[0]!==s||t[1]!==p?(m=s(p),t[0]=s,t[1]=p,t[2]=m):m=t[2];let h=m,g;t[3]===c?g=t[4]:(g=c===`in_progress`?(0,S.jsx)(l,{name:`record-circle`,className:`h-3.5 w-3.5 text-[var(--status-info)]`,"aria-hidden":`true`}):c===`completed`?(0,S.jsx)(l,{name:`checkbox-circle`,className:`h-3.5 w-3.5 text-[var(--status-success)]`,"aria-hidden":`true`}):(0,S.jsx)(l,{name:`time`,className:`h-3.5 w-3.5 text-muted-foreground`,"aria-hidden":`true`}),t[3]=c,t[4]=g);let _=g,v=r?`step`:void 0,y=r&&`bg-[var(--surface-muted)] before:absolute before:inset-y-2 before:left-0 before:w-0.5 before:rounded-full before:bg-[var(--status-info)]`,b;t[5]===y?b=t[6]:(b=o(`group relative grid min-w-0 grid-cols-[1rem_minmax(0,1fr)] items-start gap-2.5`,j,y),t[5]=y,t[6]=b);let C;t[7]!==_||t[8]!==h?(C=(0,S.jsx)(u,{asChild:!0,children:(0,S.jsx)(`span`,{className:`flex size-4 items-center justify-center`,"aria-label":h,children:_})}),t[7]=_,t[8]=h,t[9]=C):C=t[9];let w;t[10]===h?w=t[11]:(w=(0,S.jsx)(d,{side:`left`,sideOffset:6,children:h}),t[10]=h,t[11]=w);let T;t[12]!==C||t[13]!==w?(T=(0,S.jsxs)(f,{children:[C,w]}),t[12]=C,t[13]=w,t[14]=T):T=t[14];let E=ie[c],D;t[15]===E?D=t[16]:(D=o(`block whitespace-normal break-words`,E),t[15]=E,t[16]=D);let O;t[17]!==D||t[18]!==n.content?(O=(0,S.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,S.jsx)(`span`,{className:D,children:n.content})}),t[17]=D,t[18]=n.content,t[19]=O):O=t[19];let k;return t[20]!==i||t[21]!==O||t[22]!==v||t[23]!==b||t[24]!==T?(k=(0,S.jsxs)(`li`,{ref:i,"aria-current":v,className:b,children:[T,O]}),t[20]=i,t[21]=O,t[22]=v,t[23]=b,t[24]=T,t[25]=k):k=t[25],k},oe=new Set([`in_progress`,`pending`,`completed`,`cancelled`]),P=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),F=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(``):``,I=(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=F(n);e&&i.setAttribute(`style`,`${i.getAttribute(`style`)??``}${e}`)}},L=e=>`<pre><code>${P(e)}</code></pre>`,R=e=>{let t=(0,x.c)(21),{code:n,language:r,className:i,style:a,codeStyle:s,wrap:l}=e,u=l!==void 0&&l,{currentTheme:d}=c(),f=b.useRef(null),p;t[0]===d?p=t[1]:(p=_(d),t[0]=d,t[1]=p);let m=p,h,g;t[2]!==n||t[3]!==s||t[4]!==u?(h=()=>{let e=f.current;e&&(e.innerHTML=L(n),I(e,u,s))},g=[n,u,s],t[2]=n,t[3]=s,t[4]=u,t[5]=h,t[6]=g):(h=t[5],g=t[6]),b.useLayoutEffect(h,g);let v,C;t[7]!==n||t[8]!==s||t[9]!==r||t[10]!==u?(v=()=>{let e=f.current;if(!e)return;let t=!0,i=new AbortController;return y(n,(r||`text`).toLowerCase(),{signal:i.signal,priority:`visible`}).then(n=>{!t||!e||!n||(e.innerHTML=n,I(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]=v,t[12]=C):(v=t[11],C=t[12]),b.useEffect(v,C);let w;t[13]===i?w=t[14]:(w=o(`typography-code`,i),t[13]=i,t[14]=w);let T=m,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,S.jsx)(`div`,{ref:f,className:w,style:E}),t[18]=w,t[19]=E,t[20]=D):D=t[20],D},z=e=>{let t=e.replace(/^<file>\s*\n?/,``).replace(/\n?<\/file>\s*$/,``);return t=t.replace(/^\s*\d{5}\|\s?/gm,``),t.trim()},B=(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}},V=e=>e?e.includes(`<diagnostics`)||e.includes(`<file_diagnostics>`)||e.includes(`LSP errors detected`)||e.includes(`This file has errors`):!1,H=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():``,U=(e,t)=>!e||typeof e!=`object`?String(e):h(e,t||``),W=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}}},G=e=>{if(!e||typeof e!=`object`)return;let t=W(e.patch)??W(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=W(e.patch)??W(e.diff);if(t)return t}},K=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}}},q=(e,t,n)=>{let r=z(e);if((t===`edit`||t===`multiedit`||t===`write`||t===`apply_patch`)&&V(r)&&(r=H(r)),(t===`edit`||t===`multiedit`||t===`apply_patch`)&&r.trim().length===0){let e=G(n);if(e)return e}return r},se=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)})}},ce=(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,S.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,S.jsx)(`div`,{className:`min-w-0`,style:{paddingLeft:`${e.depth*20}px`},children:e.isFile?(0,S.jsx)(`span`,{className:`text-foreground/90 block truncate`,children:e.name}):(0,S.jsxs)(`span`,{className:`font-semibold text-foreground block truncate`,children:[e.name,`/`]})},t))})}catch{return null}},le={backgroundColor:`var(--status-info)`,opacity:.6},ue=(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-hwetTT7m.js"></script>
563
+ <script type="module" crossorigin src="/assets/main-BniroGdt.js"></script>
564
564
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
565
565
  <link rel="modulepreload" crossorigin href="/assets/runtime-auth-ef9W7A43.js">
566
566
  <link rel="modulepreload" crossorigin href="/assets/runtime-switch-WzPG6NMR.js">
@@ -593,11 +593,11 @@
593
593
  <link rel="modulepreload" crossorigin href="/assets/terminalApi-B_oHorrS.js">
594
594
  <link rel="modulepreload" crossorigin href="/assets/runtime-file-download-J_Vcm3tT.js">
595
595
  <link rel="modulepreload" crossorigin href="/assets/platform-kv0OsX45.js">
596
- <link rel="modulepreload" crossorigin href="/assets/types-CfsdaRmC.js">
597
- <link rel="modulepreload" crossorigin href="/assets/capgoAdapter-vYSlprFh.js">
598
- <link rel="modulepreload" crossorigin href="/assets/native-config-BfIzLvxi.js">
599
- <link rel="modulepreload" crossorigin href="/assets/runtimeConfig-BA2rxwwc.js">
600
- <link rel="stylesheet" crossorigin href="/assets/src-D3pZqEZM.css">
596
+ <link rel="modulepreload" crossorigin href="/assets/types-BUsGt9HF.js">
597
+ <link rel="modulepreload" crossorigin href="/assets/capgoAdapter-BvTGibVJ.js">
598
+ <link rel="modulepreload" crossorigin href="/assets/native-config-Ban8ER0D.js">
599
+ <link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CG-Ua9P-.js">
600
+ <link rel="stylesheet" crossorigin href="/assets/src-DISp5rL3.css">
601
601
  </head>
602
602
  <body class="h-full bg-background text-foreground">
603
603
  <!-- Keep the startup layer outside #root. React replaces every child of
@@ -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-BMNB2ztD.js"></script>
80
+ <script type="module" crossorigin src="/assets/miniChat-tsfTW6ta.js"></script>
81
81
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
82
82
  <link rel="modulepreload" crossorigin href="/assets/runtime-auth-ef9W7A43.js">
83
83
  <link rel="modulepreload" crossorigin href="/assets/runtime-switch-WzPG6NMR.js">
@@ -110,11 +110,11 @@
110
110
  <link rel="modulepreload" crossorigin href="/assets/terminalApi-B_oHorrS.js">
111
111
  <link rel="modulepreload" crossorigin href="/assets/runtime-file-download-J_Vcm3tT.js">
112
112
  <link rel="modulepreload" crossorigin href="/assets/platform-kv0OsX45.js">
113
- <link rel="modulepreload" crossorigin href="/assets/types-CfsdaRmC.js">
114
- <link rel="modulepreload" crossorigin href="/assets/capgoAdapter-vYSlprFh.js">
115
- <link rel="modulepreload" crossorigin href="/assets/native-config-BfIzLvxi.js">
116
- <link rel="modulepreload" crossorigin href="/assets/runtimeConfig-BA2rxwwc.js">
117
- <link rel="stylesheet" crossorigin href="/assets/src-D3pZqEZM.css">
113
+ <link rel="modulepreload" crossorigin href="/assets/types-BUsGt9HF.js">
114
+ <link rel="modulepreload" crossorigin href="/assets/capgoAdapter-BvTGibVJ.js">
115
+ <link rel="modulepreload" crossorigin href="/assets/native-config-Ban8ER0D.js">
116
+ <link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CG-Ua9P-.js">
117
+ <link rel="stylesheet" crossorigin href="/assets/src-DISp5rL3.css">
118
118
  </head>
119
119
  <body class="h-full bg-background text-foreground">
120
120
  <div id="root" class="h-full">
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-BdQMBg5f.js"></script>
67
+ <script type="module" crossorigin src="/assets/mobile-DKmqw9JK.js"></script>
68
68
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
69
69
  <link rel="modulepreload" crossorigin href="/assets/runtime-auth-ef9W7A43.js">
70
70
  <link rel="modulepreload" crossorigin href="/assets/runtime-switch-WzPG6NMR.js">
@@ -97,11 +97,11 @@
97
97
  <link rel="modulepreload" crossorigin href="/assets/terminalApi-B_oHorrS.js">
98
98
  <link rel="modulepreload" crossorigin href="/assets/runtime-file-download-J_Vcm3tT.js">
99
99
  <link rel="modulepreload" crossorigin href="/assets/platform-kv0OsX45.js">
100
- <link rel="modulepreload" crossorigin href="/assets/types-CfsdaRmC.js">
101
- <link rel="modulepreload" crossorigin href="/assets/capgoAdapter-vYSlprFh.js">
102
- <link rel="modulepreload" crossorigin href="/assets/native-config-BfIzLvxi.js">
103
- <link rel="modulepreload" crossorigin href="/assets/runtimeConfig-BA2rxwwc.js">
104
- <link rel="stylesheet" crossorigin href="/assets/src-D3pZqEZM.css">
100
+ <link rel="modulepreload" crossorigin href="/assets/types-BUsGt9HF.js">
101
+ <link rel="modulepreload" crossorigin href="/assets/capgoAdapter-BvTGibVJ.js">
102
+ <link rel="modulepreload" crossorigin href="/assets/native-config-Ban8ER0D.js">
103
+ <link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CG-Ua9P-.js">
104
+ <link rel="stylesheet" crossorigin href="/assets/src-DISp5rL3.css">
105
105
  </head>
106
106
  <body class="h-full bg-background text-foreground">
107
107
  <div id="root" class="h-full">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuriai/web",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./server/index.js",
@@ -47,6 +47,13 @@ call Anthropic/OpenAI/plugin SDKs, and does not use the `openai` npm package.
47
47
  text is prepended into `prompt`.
48
48
  4. Always `session.remove` in `finally` (interrupt first on abort/timeout).
49
49
 
50
+ Empty text responses are retried at most twice, after 500ms and 1000ms, in the
51
+ same throwaway session with the same prompt. All attempts and backoff share the
52
+ original generation deadline (90s by default); cancellation interrupts backoff
53
+ immediately. Only empty responses are retried, not thrown upstream errors or
54
+ attachment/tool execution. Exhaustion preserves the explicit upstream error.
55
+ Application tools execute outside this text-only call and are not replayed.
56
+
50
57
  `generate.text` (sessionless) is not used: session-scoped providers such as
51
58
  OpenCode Go reject calls without a session (`x-opencode-session`).
52
59
  `onTextDelta` is skipped honestly (no fake typewriter).
@@ -7,6 +7,7 @@ const TEXT_AGENT_NAME = 'yuri-text';
7
7
  const GENERATE_TIMEOUT_MS = 90_000;
8
8
  const AGENT_READY_WAIT_MS = 5_000;
9
9
  const AGENT_READY_POLL_MS = 250;
10
+ const EMPTY_TEXT_RETRY_DELAYS_MS = [500, 1_000];
10
11
  /** Single attachment payload cap (decoded bytes). Composer UI allows larger drafts; gateway enforces this. */
11
12
  export const MAX_ATTACHMENT_BYTES = 20 * 1024 * 1024;
12
13
  const MAX_INLINE_FILE_CHARS = 100_000;
@@ -485,20 +486,39 @@ async function withThrowawaySession({
485
486
  */
486
487
  async function generateViaSessionGenerate({ client, prompt, signal, ...sessionOptions }) {
487
488
  return withThrowawaySession({ client, signal, ...sessionOptions }, async (sessionID) => {
488
- let result;
489
- try {
490
- result = await client.session.generate({ sessionID, prompt }, { signal });
491
- } catch (error) {
492
- rethrowIfAborted(error, signal);
493
- failGenerate(clientErrorMessage(error, 'OpenCode session.generate failed'));
489
+ for (let attempt = 0; ; attempt += 1) {
490
+ signal?.throwIfAborted();
491
+ let result;
492
+ try {
493
+ result = await client.session.generate({ sessionID, prompt }, { signal });
494
+ } catch (error) {
495
+ rethrowIfAborted(error, signal);
496
+ failGenerate(clientErrorMessage(error, 'OpenCode session.generate failed'));
497
+ }
498
+ signal?.throwIfAborted();
499
+ const text = typeof result?.text === 'string'
500
+ ? result.text.trim()
501
+ : typeof result?.data?.text === 'string'
502
+ ? result.data.text.trim()
503
+ : '';
504
+ if (text) return { text, source: 'session.generate' };
505
+ const delayMs = EMPTY_TEXT_RETRY_DELAYS_MS[attempt];
506
+ if (delayMs === undefined) failGenerate('OpenCode session.generate returned no text');
507
+ // This call produces text only; retrying it cannot replay application tools.
508
+ await new Promise((resolve, reject) => {
509
+ const onAbort = () => {
510
+ clearTimeout(timer);
511
+ signal.removeEventListener('abort', onAbort);
512
+ reject(signal.reason);
513
+ };
514
+ const timer = setTimeout(() => {
515
+ signal?.removeEventListener('abort', onAbort);
516
+ resolve();
517
+ }, delayMs);
518
+ signal?.addEventListener('abort', onAbort, { once: true });
519
+ if (signal?.aborted) onAbort();
520
+ });
494
521
  }
495
- const text = typeof result?.text === 'string'
496
- ? result.text.trim()
497
- : typeof result?.data?.text === 'string'
498
- ? result.data.text.trim()
499
- : '';
500
- if (!text) failGenerate('OpenCode session.generate returned no text');
501
- return { text, source: 'session.generate' };
502
522
  });
503
523
  }
504
524
 
@@ -259,7 +259,7 @@ describe('generateOpenCodeText — text path', () => {
259
259
  })
260
260
 
261
261
  it('surfaces session.generate errors and still removes the session', async () => {
262
- const { client, remove } = textSessionClient({
262
+ const { client, remove, generate } = textSessionClient({
263
263
  generate: vi.fn(async () => { throw new Error('Request is missing x-opencode-session') }),
264
264
  })
265
265
  await expect(generateOpenCodeText({
@@ -271,11 +271,86 @@ describe('generateOpenCodeText — text path', () => {
271
271
  clientFactory: () => client,
272
272
  ensureTempDirectory: async () => '/tmp/yuri-text',
273
273
  })).rejects.toMatchObject({ code: 'upstream_error', message: 'Request is missing x-opencode-session' })
274
+ expect(generate).toHaveBeenCalledTimes(1)
274
275
  expect(remove).toHaveBeenCalledWith({ sessionID: 'ses_text' })
275
276
  })
276
277
 
278
+ it('retries empty text with backoff in the same session and returns only the successful reply', async () => {
279
+ vi.useFakeTimers()
280
+ try {
281
+ const generate = vi.fn()
282
+ .mockResolvedValueOnce({ text: ' ' })
283
+ .mockResolvedValueOnce({ data: { text: '' } })
284
+ .mockResolvedValueOnce({ text: 'updated' })
285
+ const { client, create, remove, prompt } = textSessionClient({ generate })
286
+ const result = generateOpenCodeText({
287
+ buildOpenCodeUrl: () => 'http://127.0.0.1:4096',
288
+ getOpenCodeAuthHeaders: () => ({}),
289
+ providerID: 'opencode-go',
290
+ modelID: 'deepseek-v4-flash',
291
+ messages: [{ role: 'user', content: 'update schedule' }],
292
+ clientFactory: () => client,
293
+ ensureTempDirectory: async () => '/tmp/yuri-text',
294
+ })
295
+ const outcome = result.then(value => ({ value }), error => ({ error }))
296
+ await vi.advanceTimersByTimeAsync(499)
297
+ expect(generate).toHaveBeenCalledTimes(1)
298
+ await vi.advanceTimersByTimeAsync(1)
299
+ expect(generate).toHaveBeenCalledTimes(2)
300
+ await vi.advanceTimersByTimeAsync(999)
301
+ expect(generate).toHaveBeenCalledTimes(2)
302
+ await vi.advanceTimersByTimeAsync(1)
303
+ expect(await outcome).toMatchObject({ value: { text: 'updated' } })
304
+ expect(generate).toHaveBeenCalledTimes(3)
305
+ expect(generate.mock.calls[1]).toEqual(generate.mock.calls[0])
306
+ expect(generate.mock.calls[2]).toEqual(generate.mock.calls[0])
307
+ expect(create).toHaveBeenCalledTimes(1)
308
+ expect(remove).toHaveBeenCalledTimes(1)
309
+ expect(prompt).not.toHaveBeenCalled()
310
+ expect(vi.getTimerCount()).toBe(0)
311
+ } finally {
312
+ vi.useRealTimers()
313
+ }
314
+ })
315
+
316
+ it.each(['cancel', 'deadline'])('stops empty-text backoff on %s and cleans up', async (mode) => {
317
+ vi.useFakeTimers()
318
+ try {
319
+ const controller = new AbortController()
320
+ const { client, generate, remove, interrupt } = textSessionClient({
321
+ generate: vi.fn(async () => ({ text: '' })),
322
+ })
323
+ const result = generateOpenCodeText({
324
+ buildOpenCodeUrl: () => 'http://127.0.0.1:4096',
325
+ getOpenCodeAuthHeaders: () => ({}),
326
+ providerID: 'opencode-go',
327
+ modelID: 'deepseek-v4-flash',
328
+ messages: [{ role: 'user', content: 'hi' }],
329
+ clientFactory: () => client,
330
+ ensureTempDirectory: async () => '/tmp/yuri-text',
331
+ signal: controller.signal,
332
+ timeoutMs: 750,
333
+ })
334
+ const outcome = result.then(value => ({ value }), error => ({ error }))
335
+ await vi.advanceTimersByTimeAsync(500)
336
+ expect(generate).toHaveBeenCalledTimes(2)
337
+ if (mode === 'cancel') controller.abort()
338
+ else await vi.advanceTimersByTimeAsync(250)
339
+ expect(await outcome).toMatchObject({ error: mode === 'cancel'
340
+ ? { name: 'AbortError' }
341
+ : { message: 'OpenCode LLM generate timed out after 750ms' } })
342
+ await vi.advanceTimersByTimeAsync(2_000)
343
+ expect(generate).toHaveBeenCalledTimes(2)
344
+ expect(interrupt).toHaveBeenCalledExactlyOnceWith({ sessionID: 'ses_text', continue: false })
345
+ expect(remove).toHaveBeenCalledTimes(1)
346
+ expect(vi.getTimerCount()).toBe(0)
347
+ } finally {
348
+ vi.useRealTimers()
349
+ }
350
+ })
351
+
277
352
  it('rejects an empty session.generate reply instead of returning blank success', async () => {
278
- const { client } = textSessionClient({ generate: vi.fn(async () => ({ text: ' ' })) })
353
+ const { client, generate, remove } = textSessionClient({ generate: vi.fn(async () => ({ text: ' ' })) })
279
354
  await expect(generateOpenCodeText({
280
355
  buildOpenCodeUrl: () => 'http://127.0.0.1:4096',
281
356
  getOpenCodeAuthHeaders: () => ({}),
@@ -285,6 +360,8 @@ describe('generateOpenCodeText — text path', () => {
285
360
  clientFactory: () => client,
286
361
  ensureTempDirectory: async () => '/tmp/yuri-text',
287
362
  })).rejects.toMatchObject({ message: 'OpenCode session.generate returned no text' })
363
+ expect(generate).toHaveBeenCalledTimes(3)
364
+ expect(remove).toHaveBeenCalledTimes(1)
288
365
  })
289
366
 
290
367
  it('does not invent deltas on the session.generate path', async () => {