@yuriai/web 0.1.10 → 0.1.12
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.
- package/dist/assets/{AgentAvatar-BVnp9gE9.js → AgentAvatar-BsXXkno4.js} +1 -1
- package/dist/assets/{AssistantView-wkkYwtVl.js → AssistantView-BRyJh6_0.js} +3 -3
- package/dist/assets/{DiagramView-Du11AFYw.js → DiagramView-BE0BG58g.js} +1 -1
- package/dist/assets/{FadeInOnReveal-CzC5UKnq.js → FadeInOnReveal-CJXal58M.js} +1 -1
- package/dist/assets/{Icon-BXTZRnIO.js → Icon-CZFN8X-2.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-Cv6IaJar.js → ImageLoadingPlaceholder-ysZN5rfI.js} +1 -1
- package/dist/assets/{LoadingImage-NxtWlewi.js → LoadingImage-meArDBtS.js} +1 -1
- package/dist/assets/{MarkdownRenderer-CNE2mGDE.js → MarkdownRenderer-Bi3za_gr.js} +2 -2
- package/dist/assets/{MarkdownRendererImpl-C3yRU-K_.js → MarkdownRendererImpl-ojlt0fUf.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-pF09I-pv.js → MarkstreamRendererImpl-D_U2_QOy.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-DoexJ13_.js → MobileDetailNavigation-D9yR39HJ.js} +1 -1
- package/dist/assets/{MobileShareBridge-CXnDqaX2.js → MobileShareBridge-BvbJx_bg.js} +1 -1
- package/dist/assets/{MobileTabPageHeader-CeKFE3sv.js → MobileTabPageHeader-CAtsLPgf.js} +1 -1
- package/dist/assets/{MultiRunWindow-BfCF3wXW.js → MultiRunWindow-CPECBxDl.js} +1 -1
- package/dist/assets/OnboardingScreen-P4-mX2Oa.js +1 -0
- package/dist/assets/{OverlayScrollbar-CbWvRXm6.js → OverlayScrollbar-DLRRQ8xw.js} +1 -1
- package/dist/assets/SettingsView-OSU-m0D0.js +26 -0
- package/dist/assets/{SettingsWindow-BOGE7Pjv.js → SettingsWindow-CCjh1wvl.js} +1 -1
- package/dist/assets/{TerminalView-CVNRWGn9.js → TerminalView-Dbd0C6jq.js} +1 -1
- package/dist/assets/{ToolOutputDialog-B9QjTtLH.js → ToolOutputDialog-CQ6VomzC.js} +1 -1
- package/dist/assets/YuriLogo-vNMmMKxV.js +1 -0
- package/dist/assets/{appThemeRegistry-BB8yyRpO.js → appThemeRegistry-CNwn7MsN.js} +1 -1
- package/dist/assets/{button-D_HdP1Oy.js → button-CcMfow51.js} +1 -1
- package/dist/assets/{capgoAdapter-C4iFatJM.js → capgoAdapter-qqkEpsVU.js} +1 -1
- package/dist/assets/{collapsible-sUU_ORMe.js → collapsible-BiSNWpgZ.js} +1 -1
- package/dist/assets/{desktopHosts-BDyl2P7W.js → desktopHosts-DW8THEMC.js} +1 -1
- package/dist/assets/desktopRelayRestore-BFn1FsR3.js +1 -0
- package/dist/assets/{diagram-BE50CEiR.js → diagram-CO4NSnCB.js} +1 -1
- package/dist/assets/{dialog-B_87Teec.js → dialog-CCD3bivZ.js} +1 -1
- package/dist/assets/{dropdown-menu.styles-C_b80jxk.js → dropdown-menu.styles-BJ80_XAj.js} +1 -1
- package/dist/assets/{fileMentionTouchSelection-BpLepfV5.js → fileMentionTouchSelection-ifJLPoS2.js} +1 -1
- package/dist/assets/{gitApi-Cu_4jign.js → gitApi-4lV0IO_T.js} +1 -1
- package/dist/assets/{input-DDfJnn8e.js → input-BvqIFDJg.js} +1 -1
- package/dist/assets/{insertionBoundaries-BYQ69Pqh.js → insertionBoundaries-_VOlC6Ay.js} +1 -1
- package/dist/assets/main-B5TmtyDx.js +2 -0
- package/dist/assets/{main-CP9RxYuF.js → main-DLnEF_bY.js} +8 -8
- package/dist/assets/markdown-worker-7FvUo2nm.js +2 -0
- package/dist/assets/{markdownHeightCache-Cbd62oWw.js → markdownHeightCache-BSSU7Bxn.js} +1 -1
- package/dist/assets/{mcpQueries-DsOXrW9p.js → mcpQueries-CZYJlcIT.js} +1 -1
- package/dist/assets/miniChat-CxikTIKy.js +2 -0
- package/dist/assets/mobile-aDnTnffS.js +2 -0
- package/dist/assets/{mobileBackNavigation-C9jQU0Bh.js → mobileBackNavigation-BJq2ZPk0.js} +1 -1
- package/dist/assets/{multirun-BNdPNUox.js → multirun-C57CelCJ.js} +1 -1
- package/dist/assets/{native-config-C293VauG.js → native-config-BBIKxqhh.js} +1 -1
- package/dist/assets/{projectMeta-CGgBOHXI.js → projectMeta-CvbcN8Gk.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-Do3rWe_d.js → renderElectronMiniChatApp-DDW7qWlB.js} +2 -2
- package/dist/assets/{renderMobileApp-BQDVCOJD.js → renderMobileApp-BWvLz2WX.js} +4 -4
- package/dist/assets/{runtimeConfig-ClIzDv2f.js → runtimeConfig-BUVmIEcB.js} +1 -1
- package/dist/assets/{runtimeEndpointReset-Co7CnD3Q.js → runtimeEndpointReset-DhhOwfNb.js} +5 -5
- package/dist/assets/{scheduledTaskNavigation-DvSpMLdG.js → scheduledTaskNavigation-Cnm1DAZg.js} +1 -1
- package/dist/assets/{sessionChangeSummary-BQOGLoBk.js → sessionChangeSummary-CpKIXZbD.js} +1 -1
- package/dist/assets/{sessionLookup-4ySz_bBp.js → sessionLookup-weg1wDvb.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-CrjW2aQk.js → sortable-tabs-strip-DwjmBdDS.js} +1 -1
- package/dist/assets/speechSettingsQueries-CqpReFaM.js +4 -0
- package/dist/assets/src-Ba2dKQ01.css +2 -0
- package/dist/assets/{store-szlu5Wxv.js → store-D6XK1qew.js} +3 -3
- package/dist/assets/{textarea-BkOdxUN0.js → textarea-DIebodlT.js} +1 -1
- package/dist/assets/{tooltip-BQQoK7L_.js → tooltip-BfZgnZ6x.js} +1 -1
- package/dist/assets/{types-hcX9kxpx.js → types-DHuWGSXB.js} +1 -1
- package/dist/assets/{useAppFontEffects-BlfY3rxF.js → useAppFontEffects-CVykprhp.js} +15 -15
- package/dist/assets/{useDesktopWindowControlsLayout-fOVuHhQm.js → useDesktopWindowControlsLayout-CIc6t8oI.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-By6zxtIy.js → useEffectiveDirectory-BzjFAgov.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-CMCCOPx5.js → useMobileNavigationStore-Bjy95iRt.js} +6 -6
- package/dist/assets/{useWorkerHighlightedLines-DaPePK5D.js → useWorkerHighlightedLines-3cjilkk1.js} +1 -1
- package/dist/index.html +20 -12
- package/dist/mini-chat.html +8 -8
- package/dist/mobile.html +8 -8
- package/package.json +1 -1
- package/server/lib/opencode/DOCUMENTATION.md +1 -1
- package/server/lib/opencode/routes.js +0 -11
- package/server/lib/opencode/routes.test.js +13 -6
- package/dist/assets/OnboardingScreen-BxS5LEOm.js +0 -1
- package/dist/assets/SettingsView-BucEse-K.js +0 -26
- package/dist/assets/desktopRelayRestore-C_23nlKD.js +0 -1
- package/dist/assets/main-DNoIWj1l.js +0 -2
- package/dist/assets/markdown-worker-CkO3sT4Y.js +0 -2
- package/dist/assets/miniChat-CdTSMOTX.js +0 -2
- package/dist/assets/mobile-CPmJIKmz.js +0 -2
- package/dist/assets/speechSettingsQueries-DdOvhitL.js +0 -4
- package/dist/assets/src-BrBsSmMt.css +0 -2
package/dist/assets/{useWorkerHighlightedLines-DaPePK5D.js → useWorkerHighlightedLines-3cjilkk1.js}
RENAMED
|
@@ -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-NMQx_cnG.js";import{n as i}from"./vendor-react-BP2cRVqX.js";import{f as a,r as o,t as s}from"./button-
|
|
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-NMQx_cnG.js";import{n as i}from"./vendor-react-BP2cRVqX.js";import{f as a,r as o,t as s}from"./button-CcMfow51.js";import{n as c}from"./useThemeSystem-8jhE4Zyk.js";import{n as l}from"./Icon-CZFN8X-2.js";import{i as u,n as d,t as f}from"./tooltip-BfZgnZ6x.js";import{n as p}from"./MarkdownRenderer-Bi3za_gr.js";import{n as m,o as h,s as g,t as _}from"./markdown-worker-7FvUo2nm.js";import{t as v}from"./vendor-tanstack-react-virtual-B_EO--9t.js";import{n as y}from"./markdownTheme-DHoKvD6O.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,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`),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=y(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 _(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):g(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
|
@@ -504,11 +504,10 @@
|
|
|
504
504
|
display: flex;
|
|
505
505
|
align-items: center;
|
|
506
506
|
justify-content: center;
|
|
507
|
-
height: 100vh;
|
|
508
507
|
font-family: system-ui, -apple-system, sans-serif;
|
|
509
508
|
transition: opacity 0.3s ease-out;
|
|
510
|
-
position:
|
|
511
|
-
|
|
509
|
+
position: fixed;
|
|
510
|
+
inset: 0;
|
|
512
511
|
z-index: 9999;
|
|
513
512
|
}
|
|
514
513
|
#initial-loading.fade-out {
|
|
@@ -516,13 +515,22 @@
|
|
|
516
515
|
pointer-events: none;
|
|
517
516
|
}
|
|
518
517
|
#initial-loading .splash-content {
|
|
518
|
+
position: relative;
|
|
519
519
|
display: flex;
|
|
520
520
|
width: min(280px, calc(100vw - 48px));
|
|
521
521
|
flex-direction: column;
|
|
522
522
|
align-items: center;
|
|
523
|
-
|
|
523
|
+
}
|
|
524
|
+
#initial-loading .splash-content > svg {
|
|
525
|
+
display: block;
|
|
526
|
+
width: 120px;
|
|
527
|
+
height: 120px;
|
|
528
|
+
flex: none;
|
|
524
529
|
}
|
|
525
530
|
#initial-loading .splash-session-progress {
|
|
531
|
+
position: absolute;
|
|
532
|
+
top: calc(100% + 20px);
|
|
533
|
+
left: 0;
|
|
526
534
|
width: 100%;
|
|
527
535
|
color: var(--splash-stroke);
|
|
528
536
|
}
|
|
@@ -552,7 +560,7 @@
|
|
|
552
560
|
opacity: 0.72;
|
|
553
561
|
}
|
|
554
562
|
</style>
|
|
555
|
-
<script type="module" crossorigin src="/assets/main-
|
|
563
|
+
<script type="module" crossorigin src="/assets/main-B5TmtyDx.js"></script>
|
|
556
564
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
557
565
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-ef9W7A43.js">
|
|
558
566
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-CAZiOV2G.js">
|
|
@@ -566,8 +574,8 @@
|
|
|
566
574
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BP2cRVqX.js">
|
|
567
575
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
568
576
|
<link rel="modulepreload" crossorigin href="/assets/persistence-Dzooc9Xg.js">
|
|
569
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-
|
|
570
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-
|
|
577
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-DW8THEMC.js">
|
|
578
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-BFn1FsR3.js">
|
|
571
579
|
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-MF2GBrFx.js">
|
|
572
580
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-CdqCAt40.js">
|
|
573
581
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
@@ -575,11 +583,11 @@
|
|
|
575
583
|
<link rel="modulepreload" crossorigin href="/assets/platform-7bX6qtBV.js">
|
|
576
584
|
<link rel="modulepreload" crossorigin href="/assets/terminalApi-BHXvha-U.js">
|
|
577
585
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-DAOam_oV.js">
|
|
578
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
579
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
580
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
581
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
582
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
586
|
+
<link rel="modulepreload" crossorigin href="/assets/types-DHuWGSXB.js">
|
|
587
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-qqkEpsVU.js">
|
|
588
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-BBIKxqhh.js">
|
|
589
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-BUVmIEcB.js">
|
|
590
|
+
<link rel="stylesheet" crossorigin href="/assets/src-Ba2dKQ01.css">
|
|
583
591
|
</head>
|
|
584
592
|
<body class="h-full bg-background text-foreground">
|
|
585
593
|
<!-- Keep the startup layer outside #root. React replaces every child of
|
package/dist/mini-chat.html
CHANGED
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
}
|
|
75
75
|
</style>
|
|
76
76
|
|
|
77
|
-
<script type="module" crossorigin src="/assets/miniChat-
|
|
77
|
+
<script type="module" crossorigin src="/assets/miniChat-CxikTIKy.js"></script>
|
|
78
78
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
79
79
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-ef9W7A43.js">
|
|
80
80
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-CAZiOV2G.js">
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BP2cRVqX.js">
|
|
89
89
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
90
90
|
<link rel="modulepreload" crossorigin href="/assets/persistence-Dzooc9Xg.js">
|
|
91
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-
|
|
92
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-
|
|
91
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-DW8THEMC.js">
|
|
92
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-BFn1FsR3.js">
|
|
93
93
|
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-MF2GBrFx.js">
|
|
94
94
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-CdqCAt40.js">
|
|
95
95
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
@@ -97,11 +97,11 @@
|
|
|
97
97
|
<link rel="modulepreload" crossorigin href="/assets/platform-7bX6qtBV.js">
|
|
98
98
|
<link rel="modulepreload" crossorigin href="/assets/terminalApi-BHXvha-U.js">
|
|
99
99
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-DAOam_oV.js">
|
|
100
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
101
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
102
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
103
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
104
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
100
|
+
<link rel="modulepreload" crossorigin href="/assets/types-DHuWGSXB.js">
|
|
101
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-qqkEpsVU.js">
|
|
102
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-BBIKxqhh.js">
|
|
103
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-BUVmIEcB.js">
|
|
104
|
+
<link rel="stylesheet" crossorigin href="/assets/src-Ba2dKQ01.css">
|
|
105
105
|
</head>
|
|
106
106
|
<body class="h-full bg-background text-foreground">
|
|
107
107
|
<div id="root" class="h-full">
|
package/dist/mobile.html
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
})();
|
|
64
64
|
</script>
|
|
65
65
|
|
|
66
|
-
<script type="module" crossorigin src="/assets/mobile-
|
|
66
|
+
<script type="module" crossorigin src="/assets/mobile-aDnTnffS.js"></script>
|
|
67
67
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
68
68
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-ef9W7A43.js">
|
|
69
69
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-CAZiOV2G.js">
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BP2cRVqX.js">
|
|
78
78
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
79
79
|
<link rel="modulepreload" crossorigin href="/assets/persistence-Dzooc9Xg.js">
|
|
80
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-
|
|
81
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-
|
|
80
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-DW8THEMC.js">
|
|
81
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-BFn1FsR3.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-MF2GBrFx.js">
|
|
83
83
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-CdqCAt40.js">
|
|
84
84
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
@@ -86,11 +86,11 @@
|
|
|
86
86
|
<link rel="modulepreload" crossorigin href="/assets/platform-7bX6qtBV.js">
|
|
87
87
|
<link rel="modulepreload" crossorigin href="/assets/terminalApi-BHXvha-U.js">
|
|
88
88
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-DAOam_oV.js">
|
|
89
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
90
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
91
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
92
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
93
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
89
|
+
<link rel="modulepreload" crossorigin href="/assets/types-DHuWGSXB.js">
|
|
90
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-qqkEpsVU.js">
|
|
91
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-BBIKxqhh.js">
|
|
92
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-BUVmIEcB.js">
|
|
93
|
+
<link rel="stylesheet" crossorigin href="/assets/src-Ba2dKQ01.css">
|
|
94
94
|
</head>
|
|
95
95
|
<body class="h-full bg-background text-foreground">
|
|
96
96
|
<div id="root" class="h-full"></div>
|
package/package.json
CHANGED
|
@@ -108,7 +108,7 @@ This module provides OpenCode server integration utilities for the web server ru
|
|
|
108
108
|
- `GET /api/config/opencode-resolution`
|
|
109
109
|
- `GET /api/behavior/agents-md`: returns an authoritative empty document only when the file is absent (`ENOENT`); permission and I/O failures return HTTP 500.
|
|
110
110
|
- `PUT /api/behavior/agents-md`
|
|
111
|
-
- `POST /api/opencode/upgrade` (ticket 12): upgrades the remote latest or explicitly targeted version. Shared services using a global CLI invoke that selected installation's `upgrade <version>` and verify its disk version; owned-cache installations download into `~/.config/yuri/opencode-cli/<version>/`. Shared services restart through the selected CLI entry path and adopt its registration again. Success requires fresh CLI/service version probes and runtime contract verification. Global upgrades never switch to an owned cache on failure. Arbitrary external servers, private processes using global CLI, and private bundled binaries return HTTP 409. Concurrent upgrades are single-flight (`operation` state). Active sessions require
|
|
111
|
+
- `POST /api/opencode/upgrade` (ticket 12): upgrades the remote latest or explicitly targeted version. Shared services using a global CLI invoke that selected installation's `upgrade <version>` and verify its disk version; owned-cache installations download into `~/.config/yuri/opencode-cli/<version>/`. Shared services restart through the selected CLI entry path and adopt its registration again. Success requires fresh CLI/service version probes and runtime contract verification. Global upgrades never switch to an owned cache on failure. Arbitrary external servers, private processes using global CLI, and private bundled binaries return HTTP 409. Concurrent upgrades are single-flight (`operation` state). Active sessions do not block an explicitly requested upgrade or require additional confirmation. Failure restores binary selection and reports the failed phase; it cannot undo package-manager changes and does not claim process restoration.
|
|
112
112
|
- `GET /api/opencode/upgrade-status`: returns `currentVersion`/`serveVersion`/`cliVersion`, `targetVersion`/`latestVersion` (official npm `@opencode/cli` latest stable 2.x release), `supplySource`, `ownership`, `canManage`, `management`, `guidance`, `contract`, and `operation`. Official shared services report `ownership: 'shared-service'`, `processOwnership: 'shared'`, and `canManage: true`. `available` is true only when `canManage` and target > current; unmanaged global/external runtimes report `available: null` plus manual guidance. `update-discovery.js` shares one in-flight registry request per host, caches successful checks for five minutes and failed checks for thirty seconds, with a five-second request deadline. Failed registry checks return HTTP 500 with `available: null`, never a false up-to-date result. An upgrade without an explicit target resolves this same remote release. Shared Web/Electron/hosted-mobile/Capacitor clients check after startup, every five minutes while visible, on focus/reconnect, and on runtime changes; query results and dismissed notifications are scoped to the host. Successful upgrade already includes process restart and live version verification, so no second reload is needed.
|
|
113
113
|
- `GET /api/opencode/compatibility`: startup upgrade-screen status. `compatible` requires the running OpenCode 2.x at `2.0.20` or newer; older/invalid versions are `incompatible`; unreadable running versions are `unavailable`. External serves are not replaced.
|
|
114
114
|
- `POST /api/opencode/install-required`: installs the pin (`2.0.23`, never below the `2.0.20` floor) through the selected shared global CLI or owned-cache installer and restarts through the existing lifecycle. `upgraded: true` requires live version verification. Concurrent installs are single-flight; failures remain errors.
|
|
@@ -348,17 +348,6 @@ export const registerOpenCodeRoutes = (app, dependencies) => {
|
|
|
348
348
|
});
|
|
349
349
|
}
|
|
350
350
|
const target = resolveOpenCode2UpgradeTarget(rawTarget ?? (await buildUpgradeStatus()).targetVersion);
|
|
351
|
-
const confirmActive = req.body?.confirmActiveTasks === true || req.body?.force === true;
|
|
352
|
-
const activeCount = typeof getActiveSessionCount === 'function' ? Number(getActiveSessionCount()) || 0 : 0;
|
|
353
|
-
if (activeCount > 0 && !confirmActive) {
|
|
354
|
-
return res.status(409).json({
|
|
355
|
-
success: false,
|
|
356
|
-
error: 'OpenCode has active sessions. Confirm upgrade to interrupt them, or wait until idle.',
|
|
357
|
-
errorCode: 'UPGRADE_ACTIVE_TASKS',
|
|
358
|
-
hasActiveTasks: true,
|
|
359
|
-
activeSessionCount: activeCount,
|
|
360
|
-
});
|
|
361
|
-
}
|
|
362
351
|
|
|
363
352
|
const begin = upgradeOperation.begin(target);
|
|
364
353
|
if (!begin.ok) {
|
|
@@ -355,20 +355,27 @@ describe('opencode2 upgrade pin (ticket 12)', () => {
|
|
|
355
355
|
expect(forceResolvedOpenCodeBinary).toHaveBeenLastCalledWith('/usr/local/bin/opencode', 'path');
|
|
356
356
|
});
|
|
357
357
|
|
|
358
|
-
it('
|
|
359
|
-
|
|
360
|
-
|
|
358
|
+
it('upgrades with active sessions without requiring confirmation', async () => {
|
|
359
|
+
let version = '2.0.22';
|
|
360
|
+
vi.stubGlobal('fetch', vi.fn(async () => new Response(JSON.stringify({ version, pid: 42 }))));
|
|
361
|
+
vi.mocked(readOpenCode2BinaryVersion).mockReturnValue('2.0.23');
|
|
362
|
+
const restartOpenCode = vi.fn(async () => { version = '2.0.23'; });
|
|
363
|
+
const upgradeOpenCodeCli = vi.fn();
|
|
361
364
|
const { app } = createUpgradeApp({
|
|
362
365
|
getIsExternalOpenCode: () => true,
|
|
363
366
|
getIsSharedOpenCodeService: () => true,
|
|
364
367
|
getActiveSessionCount: () => 1,
|
|
368
|
+
discoverOpenCodeUpdate: async () => ({ version: '2.0.23' }),
|
|
369
|
+
upgradeOpenCodeCli,
|
|
370
|
+
forceResolvedOpenCodeBinary: vi.fn(),
|
|
365
371
|
restartOpenCode,
|
|
366
372
|
});
|
|
367
373
|
const status = await request(app).get('/api/opencode/upgrade-status').expect(200);
|
|
368
374
|
expect(status.body).toMatchObject({ canManage: true, available: true, ownership: 'shared-service' });
|
|
369
|
-
const response = await request(app).post('/api/opencode/upgrade').send({}).expect(
|
|
370
|
-
expect(response.body
|
|
371
|
-
expect(
|
|
375
|
+
const response = await request(app).post('/api/opencode/upgrade').send({ target: '2.0.23' }).expect(200);
|
|
376
|
+
expect(response.body).toMatchObject({ success: true, version: '2.0.23' });
|
|
377
|
+
expect(upgradeOpenCodeCli).toHaveBeenCalledWith({ binaryPath: '/usr/local/bin/opencode', version: '2.0.23' });
|
|
378
|
+
expect(restartOpenCode).toHaveBeenCalledWith({ binaryPath: '/usr/local/bin/opencode' });
|
|
372
379
|
});
|
|
373
380
|
|
|
374
381
|
it.each(['unreachable', 'old-version'])('rejects shared upgrade verification when the running service is %s', async (mode) => {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{u as t}from"./queryRuntime-DKGLQtb9.js";import{Cn as n,en as r,hn as i,i as a,pn as o}from"./persistence-Dzooc9Xg.js";import{_ as s,h as c,i as l,n as u,r as d}from"./desktopHosts-BDyl2P7W.js";import{it as f,rt as p}from"./vendor-base-ui-CdzJ6My_.js";import{n as m}from"./vendor-react-BP2cRVqX.js";import{d as h,f as g,r as _,t as v}from"./button-D_HdP1Oy.js";import{n as y}from"./Icon-BXTZRnIO.js";import{o as b,r as x}from"./dialog-B_87Teec.js";import{t as S}from"./input-DDfJnn8e.js";var C=m(),w=e(f(),1),T=p();function E(e){switch(e){case`ok`:return null;case`auth`:return`onboarding.remoteConnection.probe.authMessage`;case`update-recommended`:return`onboarding.remoteConnection.probe.updateRecommendedMessage`;case`incompatible`:return`onboarding.remoteConnection.probe.incompatibleMessage`;case`wrong-service`:return`onboarding.remoteConnection.probe.wrongServiceMessage`;case`unreachable`:return`onboarding.remoteConnection.probe.unreachableMessage`;default:return null}}function D(e){return e===`wrong-service`||e===`unreachable`||e===`incompatible`}function O({onBack:e,showBackButton:t=!0,initialUrl:n=``,initialLabel:a=``,isRecoveryMode:o=!1,onConnect:c,onSwitchToLocal:f}){let{t:p}=g(),[m,h]=(0,w.useState)(n),[_,y]=(0,w.useState)(a),[b,x]=(0,w.useState)(`idle`),[C,O]=(0,w.useState)(null),[k,A]=(0,w.useState)(``),j=s(m),M=j?.persistedUrl??null,N=(0,w.useCallback)(e=>{h(e.target.value),x(`idle`),O(null),A(``)},[]),P=(0,w.useCallback)(e=>{y(e.target.value)},[]),F=(0,w.useCallback)(async()=>{if(M){x(`testing`),O(null),A(``);try{let e=await u(M);O(e),x(e.status===`ok`||e.status===`update-recommended`?`success`:`error`)}catch(e){A(e instanceof Error?e.message:p(`onboarding.remoteConnection.errors.connectionTestFailed`)),x(`error`)}}},[M,p]),I=(0,w.useCallback)(async()=>{if(!j)return;let e=j.persistedUrl;x(`testing`),O(null),A(``);try{let t=await u(e);if(O(t),D(t.status)){x(`error`);return}let n=await d(),a=_.trim()||e,o=n.hosts.find(t=>t.url===e),s=o?o.id:`host-${Date.now().toString(16)}`,f={id:s,label:a,url:e,apiUrl:e},p=o?n.hosts.map(e=>e.id===s?f:e):[...n.hosts,f];if(await l({hosts:p,defaultHostId:s,initialHostChoiceCompleted:!0}),c?.(),j.redeemUrl){window.location.assign(j.redeemUrl);return}r()&&await i()}catch(e){A(e instanceof Error?e.message:p(`onboarding.remoteConnection.errors.failedToSaveConnection`)),x(`error`)}},[j,_,c,p]),L=b===`testing`,R=M!==null&&!L,z=M!==null&&!L&&!D(C?.status??null),B=E(C?.status??null),V=C?.status===`ok`,H=C?.status===`update-recommended`,U=C?.status===`auth`,W=D(C?.status??null);return(0,T.jsx)(`div`,{className:`flex flex-col items-center justify-center h-full p-8`,children:(0,T.jsxs)(`div`,{className:`w-full max-w-md space-y-6`,children:[t&&(0,T.jsx)(`div`,{className:`flex items-center`,children:(0,T.jsx)(v,{variant:`ghost`,onClick:e,className:`p-0 text-muted-foreground hover:text-foreground`,children:p(`onboarding.common.actions.back`)})}),(0,T.jsxs)(`div`,{className:`space-y-2 text-center`,children:[(0,T.jsx)(`h1`,{className:`typography-ui-header text-xl font-semibold text-foreground`,children:p(o?`onboarding.remoteConnection.titleRecovery`:`onboarding.remoteConnection.title`)}),(0,T.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:p(`onboarding.remoteConnection.description`)})]}),(0,T.jsxs)(`div`,{className:`space-y-4`,children:[(0,T.jsxs)(`div`,{className:`space-y-2`,children:[(0,T.jsx)(`label`,{htmlFor:`remote-url`,className:`text-sm text-foreground`,children:p(`onboarding.remoteConnection.field.serverAddress`)}),(0,T.jsx)(S,{id:`remote-url`,type:`url`,value:m,onChange:N,placeholder:p(`onboarding.remoteConnection.field.serverAddressPlaceholder`),disabled:L})]}),(0,T.jsxs)(`div`,{className:`space-y-2`,children:[(0,T.jsx)(`label`,{htmlFor:`remote-label`,className:`text-sm text-foreground`,children:p(`onboarding.remoteConnection.field.nameOptional`)}),(0,T.jsx)(S,{id:`remote-label`,type:`text`,value:_,onChange:P,placeholder:p(`onboarding.remoteConnection.field.namePlaceholder`),disabled:L})]})]}),C&&V&&(0,T.jsx)(`div`,{className:`rounded-lg border p-3 text-sm`,style:{borderColor:`var(--status-success)`,color:`var(--status-success)`},children:p(`onboarding.remoteConnection.status.connectedSuccessfully`,{latencyMs:C.latencyMs})}),C&&U&&(0,T.jsx)(`div`,{className:`rounded-lg border p-3 text-sm`,style:{borderColor:`var(--status-warning)`,color:`var(--status-warning)`},children:p(`onboarding.remoteConnection.status.authWarning`)}),C&&H&&(0,T.jsx)(`div`,{className:`rounded-lg border p-3 text-sm`,style:{borderColor:`var(--status-warning)`,color:`var(--status-warning)`},children:B?p(B):null}),C&&W&&(0,T.jsxs)(`div`,{className:`rounded-lg border p-3 text-sm space-y-3`,style:{borderColor:`var(--status-error)`,color:`var(--status-error)`},children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`div`,{className:`font-semibold mb-1`,children:p(`onboarding.remoteConnection.status.connectionFailed`)}),(0,T.jsx)(`div`,{className:`opacity-90`,children:B?p(B):null})]}),(0,T.jsx)(`div`,{className:`text-xs opacity-80`,children:C.status===`unreachable`?p(`onboarding.remoteConnection.status.suggestionsUnreachable`):p(`onboarding.remoteConnection.status.suggestionsWrongService`)})]}),k&&(0,T.jsx)(`div`,{className:`rounded-lg border p-3 text-sm`,style:{borderColor:`var(--status-error)`,color:`var(--status-error)`},children:k}),(0,T.jsxs)(`div`,{className:`flex gap-3`,children:[(0,T.jsx)(v,{variant:`outline`,onClick:F,disabled:!R,children:p(L?`onboarding.remoteConnection.actions.testing`:`onboarding.remoteConnection.actions.testConnection`)}),(0,T.jsx)(v,{onClick:I,disabled:!z,children:p(`onboarding.remoteConnection.actions.connectAndRestart`)})]}),W&&(0,T.jsxs)(`div`,{className:`flex flex-col gap-2 pt-2 border-t border-border`,children:[(0,T.jsx)(`div`,{className:`text-xs text-muted-foreground text-center`,children:p(`onboarding.remoteConnection.actions.whatToDo`)}),(0,T.jsxs)(`div`,{className:`flex gap-2`,children:[(0,T.jsx)(v,{variant:`outline`,size:`sm`,onClick:e,className:`flex-1`,children:p(`onboarding.remoteConnection.actions.chooseDifferentServer`)}),!o&&f&&(0,T.jsx)(v,{variant:`outline`,size:`sm`,onClick:f,className:`flex-1`,children:p(`onboarding.remoteConnection.actions.useLocalInstead`)})]})]})]})})}async function k(){let e=await t(`/health`);if(!e.ok)return!1;let n=await e.json().catch(()=>null);return n?.openCodeRunning===!0||n?.isOpenCodeReady===!0}async function A(){return(await t(`/api/opencode/retry`,{method:`POST`})).ok?k():!1}var j=`curl -fsSL https://opencode.ai/v2/install | bash`,M=`https://opencode.ai/docs`,N=2500,P=1e4;function F(e){let t=(0,C.c)(5),{onCopy:n,copyTitle:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,T.jsxs)(`code`,{className:`flex-1 text-left overflow-x-auto whitespace-nowrap`,children:[(0,T.jsx)(`span`,{style:{color:`var(--syntax-keyword)`},children:`curl`}),(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:` -fsSL `}),(0,T.jsx)(`span`,{style:{color:`var(--syntax-string)`},children:`https://opencode.ai/v2/install`}),(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:` | `}),(0,T.jsx)(`span`,{style:{color:`var(--syntax-keyword)`},children:`bash`})]}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,T.jsx)(y,{name:`file-copy`,className:`h-4 w-4`}),t[1]=a):a=t[1];let o;return t[2]!==r||t[3]!==n?(o=(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-3 w-full`,children:[i,(0,T.jsx)(`button`,{onClick:n,className:`inline-flex items-center text-muted-foreground hover:text-foreground transition-colors shrink-0`,title:r,"aria-label":r,children:a})]}),t[2]=r,t[3]=n,t[4]=o):o=t[4],o}function I({onCliAvailable:e}){let{t:s}=g(),[c,u]=w.useState(!1),[f,p]=w.useState(!1),[m,b]=w.useState(!1),[x,C]=w.useState(!1),[E,D]=w.useState(``),[I,L]=w.useState(`unknown`),[R,z]=w.useState(`local`),[B,V]=w.useState(!1),[H,U]=w.useState(!1),[W,G]=w.useState(null),K=w.useRef(!1);w.useEffect(()=>{p(r())},[]),w.useEffect(()=>{if(typeof navigator>`u`){L(`unknown`);return}let e=navigator.userAgent||``;/Windows/i.test(e)?L(`windows`):/Macintosh|Mac OS X/i.test(e)?L(`macos`):/Linux/i.test(e)?L(`linux`):L(`unknown`)},[]),w.useEffect(()=>{let e=!1;return(async()=>{try{let n=await t(`/api/config/settings`,{method:`GET`,headers:{Accept:`application/json`}});if(!n.ok)return;let r=await n.json().catch(()=>null);if(!r||e)return;let i=typeof r.opencodeBinary==`string`?r.opencodeBinary.trim():``;i&&D(i)}catch{}})(),()=>{e=!0}},[]);let q=w.useCallback(async e=>{let t=e.target;t.closest(`.app-region-no-drag`)||t.closest(`button, a, input, select, textarea, code, summary, details`)||e.button===0&&f&&await n()},[f]),J=w.useCallback(async e=>{if(!f)return;let t=await d();await l({...t,...e===`local`?{defaultHostId:`local`}:{},initialHostChoiceCompleted:!0})},[f]),Y=w.useCallback(async()=>{if(!K.current){K.current=!0;try{f&&await J(`local`),await e?.()}catch(e){throw K.current=!1,e}}},[f,e,J]);w.useEffect(()=>{if(R!==`local`)return;let e=!1,t=null,n=0,r=async()=>{if(!e){try{let t=await k(),r=Date.now();if(!t&&r-n>=P&&(n=r,t=await A()),e)return;if(t){await Y();return}}catch{}e||(t=setTimeout(r,N))}};return t=setTimeout(r,N),()=>{e=!0,t&&clearTimeout(t)}},[R,Y]);let X=w.useCallback(async()=>{C(!0),G(null);try{let e=await k();e||=await A(),e?await Y():G(s(`onboarding.localSetup.errors.cliNotReady`))}catch{G(s(`onboarding.localSetup.errors.detectionFailed`))}finally{C(!1)}},[Y,s]),Z=w.useCallback(async()=>{if(!(typeof window>`u`)&&f)try{let e=await o();e.success&&e.path&&e.path.trim().length>0&&D(e.path.trim())}catch{}},[f]),Q=w.useCallback(async()=>{b(!0);try{if(await a({opencodeBinary:E.trim()}),f){await J(`local`),await i();return}await t(`/api/config/reload`,{method:`POST`})}finally{setTimeout(()=>b(!1),1e3)}},[f,E,J]),$=w.useCallback(async()=>{let e=await h(j);e.ok?(u(!0),setTimeout(()=>u(!1),2e3)):console.error(`Failed to copy:`,e.error)},[]),ee=M,te=I===`windows`?`C:\\Users\\you\\AppData\\Roaming\\npm\\opencode.cmd`:I===`linux`?`/home/you/.bun/bin/opencode`:`/Users/you/.bun/bin/opencode`,ne=!f||R===`local`;return(0,T.jsx)(`div`,{className:`app-region-drag h-full flex items-center justify-center bg-transparent p-8 cursor-default select-none overflow-y-auto`,onMouseDown:q,children:(0,T.jsxs)(`div`,{className:`w-full max-w-md space-y-7`,children:[(0,T.jsxs)(`header`,{className:`text-center space-y-1.5`,children:[(0,T.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-foreground`,children:s(`onboarding.chooser.title`)}),(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:s(`onboarding.chooser.description`)})]}),f&&(0,T.jsxs)(`div`,{className:`app-region-no-drag flex gap-1.5`,children:[(0,T.jsx)(`button`,{type:`button`,className:_(`flex-1 px-4 py-2 rounded-lg border transition-colors text-sm`,R===`local`?`border-[var(--interactive-selection)] text-foreground bg-[var(--interactive-selection)]/10`:`border-border text-muted-foreground hover:text-foreground hover:border-muted-foreground`),onClick:()=>z(`local`),children:s(`onboarding.chooser.tabs.localInstall`)}),(0,T.jsx)(`button`,{type:`button`,className:_(`flex-1 px-4 py-2 rounded-lg border transition-colors text-sm`,R===`remote`?`border-[var(--interactive-selection)] text-foreground bg-[var(--interactive-selection)]/10`:`border-border text-muted-foreground hover:text-foreground hover:border-muted-foreground`),onClick:()=>z(`remote`),children:s(`onboarding.chooser.tabs.connectRemote`)})]}),f&&R===`remote`?(0,T.jsx)(`div`,{className:`app-region-no-drag`,children:(0,T.jsx)(O,{onBack:()=>z(`local`),showBackButton:!1,onSwitchToLocal:()=>z(`local`)})}):null,ne&&(0,T.jsxs)(`div`,{className:`space-y-4`,children:[I===`windows`&&(0,T.jsxs)(`div`,{className:`rounded-lg border border-border bg-background/50 p-4`,children:[(0,T.jsx)(`div`,{className:`text-sm text-foreground`,children:s(`onboarding.localSetup.windows.title`)}),(0,T.jsxs)(`ol`,{className:`mt-2 list-decimal space-y-1 pl-5 text-sm text-muted-foreground`,children:[(0,T.jsx)(`li`,{children:s(`onboarding.localSetup.windows.stepRunInstallInWsl`)}),(0,T.jsx)(`li`,{children:s(`onboarding.localSetup.windows.stepSetBinaryPath`)})]})]}),(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground text-center leading-relaxed`,children:s(`onboarding.localSetup.intro`)}),(0,T.jsx)(`div`,{className:`app-region-no-drag rounded-lg border border-border bg-background/60 backdrop-blur-sm px-4 py-3 font-mono text-sm`,children:c?(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,style:{color:`var(--status-success)`},children:[(0,T.jsx)(y,{name:`check`,className:`h-4 w-4`}),s(`onboarding.common.status.copiedToClipboard`)]}):(0,T.jsx)(F,{onCopy:$,copyTitle:s(`onboarding.common.copyToClipboard`)})}),(0,T.jsxs)(`div`,{className:`app-region-no-drag flex items-center justify-between`,children:[(0,T.jsxs)(`a`,{href:ee,target:`_blank`,rel:`noopener noreferrer`,className:`text-xs text-muted-foreground hover:text-foreground transition-colors inline-flex items-center gap-1`,children:[s(I===`windows`?`onboarding.localSetup.docs.windows`:`onboarding.localSetup.docs.default`),(0,T.jsx)(y,{name:`external-link`,className:`h-3 w-3`})]}),(0,T.jsx)(`button`,{type:`button`,onClick:X,disabled:x,className:`text-xs text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50`,children:s(x?`onboarding.localSetup.actions.checking`:`onboarding.localSetup.actions.checkNow`)})]}),W&&(0,T.jsx)(`p`,{role:`alert`,className:`text-center text-xs text-[var(--status-error-foreground)]`,children:W}),(0,T.jsxs)(`div`,{className:`rounded-lg border px-4 py-3 flex items-center gap-3`,style:{borderColor:`color-mix(in srgb, var(--primary-base) 20%, transparent)`,backgroundColor:`color-mix(in srgb, var(--primary-base) 6%, transparent)`},role:`status`,"aria-live":`polite`,children:[(0,T.jsxs)(`span`,{className:`relative inline-flex h-2.5 w-2.5 shrink-0`,"aria-hidden":!0,children:[(0,T.jsx)(`span`,{className:`absolute inset-0 rounded-full`,style:{backgroundColor:`var(--primary-base)`,animation:`pulse-opacity 1.6s ease-in-out infinite`}}),(0,T.jsx)(`span`,{className:`absolute inset-[-4px] rounded-full`,style:{backgroundColor:`var(--primary-base)`,animation:`pulse-opacity-dim 1.6s ease-in-out infinite`,opacity:0}})]}),(0,T.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,T.jsx)(`div`,{className:`text-sm text-foreground leading-tight`,children:s(`onboarding.localSetup.status.watching`)}),(0,T.jsx)(`div`,{className:`text-xs text-muted-foreground leading-tight mt-0.5`,children:s(`onboarding.localSetup.status.autoContinue`)})]})]}),(0,T.jsxs)(`details`,{className:`app-region-no-drag group rounded-lg border border-border/60 px-4 open:bg-background/40 transition-colors`,open:B,onToggle:e=>V(e.currentTarget.open),children:[(0,T.jsxs)(`summary`,{className:`flex items-center justify-between cursor-pointer py-2.5 text-sm text-muted-foreground hover:text-foreground transition-colors list-none [&::-webkit-details-marker]:hidden`,children:[(0,T.jsx)(`span`,{children:s(`onboarding.localSetup.advanced.title`)}),(0,T.jsx)(y,{name:`arrow-down-s`,className:`h-4 w-4 transition-transform group-open:rotate-180`})]}),(0,T.jsxs)(`div`,{className:`pb-4 space-y-2`,children:[(0,T.jsxs)(`div`,{className:`flex gap-2`,children:[(0,T.jsx)(S,{value:E,onChange:e=>D(e.target.value),placeholder:te,disabled:m,className:`flex-1 font-mono text-xs`}),(0,T.jsx)(v,{type:`button`,variant:`secondary`,size:`sm`,onClick:Z,disabled:m||!f,children:s(`onboarding.localSetup.actions.browse`)}),(0,T.jsx)(v,{type:`button`,size:`sm`,onClick:Q,disabled:m||!E.trim(),children:s(`onboarding.localSetup.actions.apply`)})]}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground/70`,children:s(`onboarding.localSetup.helper.saveAndReload`)})]})]}),(0,T.jsxs)(`details`,{className:`app-region-no-drag group rounded-lg border border-border/60 px-4 open:bg-background/40 transition-colors`,open:H,onToggle:e=>U(e.currentTarget.open),children:[(0,T.jsxs)(`summary`,{className:`flex items-center justify-between cursor-pointer py-2.5 text-sm text-muted-foreground hover:text-foreground transition-colors list-none [&::-webkit-details-marker]:hidden`,children:[(0,T.jsx)(`span`,{children:s(`onboarding.localSetup.troubleshoot.title`)}),(0,T.jsx)(y,{name:`arrow-down-s`,className:`h-4 w-4 transition-transform group-open:rotate-180`})]}),(0,T.jsx)(`ul`,{className:`pb-4 space-y-1.5 text-xs text-muted-foreground list-disc pl-4`,children:I===`windows`?(0,T.jsx)(T.Fragment,{children:(0,T.jsx)(`li`,{children:s(`onboarding.localSetup.windows.hintDetectionFailed`)})}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`li`,{children:s(`onboarding.localSetup.hint.ensurePath`)}),(0,T.jsx)(`li`,{children:s(`onboarding.localSetup.hint.setEnv`)}),(0,T.jsx)(`li`,{children:s(`onboarding.localSetup.hint.missingRuntime`)})]})})]})]})]})})}var L=`curl -fsSL https://opencode.ai/v2/install | bash`,R=`https://opencode.ai/docs`;function z(e){let t=(0,C.c)(5),{onCopy:n,copyTitle:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,T.jsxs)(`code`,{children:[(0,T.jsx)(`span`,{style:{color:`var(--syntax-keyword)`},children:`curl`}),(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:` -fsSL `}),(0,T.jsx)(`span`,{style:{color:`var(--syntax-string)`},children:`https://opencode.ai/v2/install`}),(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:` | `}),(0,T.jsx)(`span`,{style:{color:`var(--syntax-keyword)`},children:`bash`})]}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,T.jsx)(y,{name:`file-copy`,className:`h-4 w-4`}),t[1]=a):a=t[1];let o;return t[2]!==r||t[3]!==n?(o=(0,T.jsxs)(`div`,{className:`flex items-center justify-center gap-3`,children:[i,(0,T.jsx)(`button`,{onClick:n,className:`inline-flex items-center text-muted-foreground hover:text-foreground transition-colors`,title:r,children:a})]}),t[2]=r,t[3]=n,t[4]=o):o=t[4],o}var B=3e4;function V({onBack:e,onCliAvailable:s,isFromRecovery:c=!1,onSwitchToRemote:l}){let{t:u}=g(),[d,f]=w.useState(!1),[p,m]=w.useState(!1),[_,b]=w.useState(!1),[x,C]=w.useState(!1),[E,D]=w.useState(!1),[O,j]=w.useState(null),[M,N]=w.useState(``),[P,F]=w.useState(`unknown`);w.useEffect(()=>{let e=setTimeout(()=>m(!0),B);return()=>clearTimeout(e)},[]),w.useEffect(()=>{b(r())},[]),w.useEffect(()=>{if(typeof navigator>`u`){F(`unknown`);return}let e=navigator.userAgent||``;if(/Windows/i.test(e)){F(`windows`);return}if(/Macintosh|Mac OS X/i.test(e)){F(`macos`);return}if(/Linux/i.test(e)){F(`linux`);return}F(`unknown`)},[]),w.useEffect(()=>{let e=!1;return(async()=>{try{let n=await t(`/api/config/settings`,{method:`GET`,headers:{Accept:`application/json`}});if(!n.ok)return;let r=await n.json().catch(()=>null);if(!r||e)return;let i=typeof r.opencodeBinary==`string`?r.opencodeBinary.trim():``;i&&N(i)}catch{}})(),()=>{e=!0}},[]);let I=w.useCallback(async e=>{e.target.closest(`button, a, input, select, textarea, code`)||e.button===0&&_&&await n()},[_]),V=w.useCallback(async()=>{if(!(typeof window>`u`)&&_)try{let e=await o();e.success&&e.path&&e.path.trim().length>0&&N(e.path.trim())}catch{}},[_]),H=w.useCallback(async()=>{C(!0);try{if(await a({opencodeBinary:M.trim()}),_){await i();return}await t(`/api/config/reload`,{method:`POST`})}finally{setTimeout(()=>C(!1),1e3)}},[_,M]),U=w.useCallback(async()=>{let e=await h(L);e.ok?(f(!0),setTimeout(()=>f(!1),2e3)):console.error(`Failed to copy:`,e.error)},[]),W=w.useCallback(async()=>{D(!0),j(null);try{let e=await k();e||=await A(),e?s?.():j(u(`onboarding.localSetup.errors.cliNotReady`))}catch(e){j(e instanceof Error?e.message:u(`onboarding.localSetup.errors.detectionFailed`))}finally{D(!1)}},[s,u]),G=R,K=P===`windows`?`C:\\Users\\you\\AppData\\Roaming\\npm\\opencode.cmd`:P===`linux`?`/home/you/.bun/bin/opencode`:`/Users/you/.bun/bin/opencode`;return(0,T.jsxs)(`div`,{className:`h-full flex items-center justify-center bg-transparent p-8 relative cursor-default select-none`,onMouseDown:I,children:[(0,T.jsxs)(`div`,{className:`w-full max-w-lg space-y-4 text-center`,children:[(0,T.jsx)(`div`,{className:`flex items-center`,children:(0,T.jsx)(v,{variant:`ghost`,onClick:e,className:`p-0 text-muted-foreground hover:text-foreground`,children:u(`onboarding.common.actions.back`)})}),(0,T.jsxs)(`div`,{className:`space-y-4`,children:[(0,T.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight text-foreground`,children:u(`onboarding.localSetup.title`)}),(0,T.jsx)(`p`,{className:`text-muted-foreground`,children:u(`onboarding.localSetup.description`)})]}),P===`windows`&&(0,T.jsxs)(`div`,{className:`mx-auto max-w-2xl rounded-lg border border-border bg-background/50 p-4 text-left`,children:[(0,T.jsx)(`div`,{className:`text-sm text-foreground`,children:u(`onboarding.localSetup.windows.title`)}),(0,T.jsxs)(`ol`,{className:`mt-2 list-decimal space-y-1 pl-5 text-sm text-muted-foreground`,children:[(0,T.jsx)(`li`,{children:u(`onboarding.localSetup.windows.stepRunInstallInWsl`)}),(0,T.jsx)(`li`,{children:u(`onboarding.localSetup.windows.stepSetBinaryPath`)})]})]}),(0,T.jsx)(`div`,{className:`flex justify-center`,children:(0,T.jsx)(`div`,{className:`bg-background/60 backdrop-blur-sm border border-border rounded-lg px-5 py-3 font-mono text-sm w-fit`,children:d?(0,T.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,style:{color:`var(--status-success)`},children:[(0,T.jsx)(y,{name:`check`,className:`h-4 w-4`}),u(`onboarding.common.status.copiedToClipboard`)]}):(0,T.jsx)(z,{onCopy:U,copyTitle:u(`onboarding.common.copyToClipboard`)})})}),(0,T.jsxs)(`a`,{href:G,target:`_blank`,rel:`noopener noreferrer`,className:`text-sm text-muted-foreground hover:text-foreground transition-colors inline-flex items-center gap-1 justify-center`,children:[u(P===`windows`?`onboarding.localSetup.docs.windows`:`onboarding.localSetup.docs.default`),(0,T.jsx)(y,{name:`external-link`,className:`h-3 w-3`})]}),O&&(0,T.jsx)(`div`,{className:`mx-auto max-w-md rounded-lg border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive`,children:O}),(0,T.jsxs)(`div`,{className:`space-y-3`,children:[(0,T.jsx)(v,{type:`button`,onClick:W,disabled:E,className:`w-full max-w-xs`,size:`lg`,children:u(E?`onboarding.localSetup.actions.checking`:`onboarding.localSetup.actions.checkAndContinue`)}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u(`onboarding.localSetup.helper.checkAndContinue`)})]}),(0,T.jsx)(`div`,{className:`mx-auto w-full max-w-xl pt-4`,children:(0,T.jsxs)(`div`,{className:`space-y-2`,children:[(0,T.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:u(`onboarding.localSetup.field.alreadyInstalled`)}),(0,T.jsxs)(`div`,{className:`flex gap-2`,children:[(0,T.jsx)(S,{value:M,onChange:e=>N(e.target.value),placeholder:K,disabled:x,className:`flex-1 font-mono text-xs`}),(0,T.jsx)(v,{type:`button`,variant:`secondary`,onClick:V,disabled:x||!_,children:u(`onboarding.localSetup.actions.browse`)}),(0,T.jsx)(v,{type:`button`,onClick:H,disabled:x,children:u(`onboarding.localSetup.actions.apply`)})]}),(0,T.jsx)(`div`,{className:`text-xs text-muted-foreground/70`,children:u(`onboarding.localSetup.helper.saveAndReload`)})]})}),c&&l&&(0,T.jsxs)(`div`,{className:`text-center pt-4`,children:[(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground mb-2`,children:u(`onboarding.localSetup.remotePreference`)}),(0,T.jsx)(v,{variant:`link`,onClick:l,children:u(`onboarding.localSetup.actions.connectRemoteServer`)})]})]}),p&&(0,T.jsx)(`div`,{className:`absolute bottom-8 left-0 right-0 text-center space-y-1`,children:P===`windows`?(0,T.jsx)(T.Fragment,{children:(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground/70`,children:u(`onboarding.localSetup.windows.hintDetectionFailed`)})}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground/70`,children:u(`onboarding.localSetup.hint.ensurePath`)}),(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground/70`,children:u(`onboarding.localSetup.hint.setEnv`)}),(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground/70`,children:u(`onboarding.localSetup.hint.missingRuntime`)})]})})]})}function H(e,t){if(e?.trim())return c(e.trim());if(t)return c(t)}function U(e,t,n){switch(e){case`local-unavailable`:return{title:`Local OpenCode Unavailable`,description:`OpenCode CLI could not be started or is not installed. Install OpenCode or connect to a remote server instead.`,titleKey:`onboarding.desktopRecovery.localUnavailable.title`,descriptionKey:`onboarding.desktopRecovery.localUnavailable.description`,iconKey:`local`,showRetry:!0,retryLabel:`Retry Local`,retryLabelKey:`onboarding.desktopRecovery.localUnavailable.retry`,showUseLocal:!0,showUseRemote:!0,useLocalLabel:`Set Up Local`,useLocalLabelKey:`onboarding.desktopRecovery.localUnavailable.useLocal`,useRemoteLabel:`Use Remote`,useRemoteLabelKey:`onboarding.desktopRecovery.common.useRemote`};case`remote-missing`:return{title:`No Default Connection`,description:`Your saved default connection could not be found. Choose how you want to connect.`,titleKey:`onboarding.desktopRecovery.noDefaultConnection.title`,descriptionKey:`onboarding.desktopRecovery.noDefaultConnection.description`,iconKey:`local`,showRetry:!1,showUseLocal:!0,showUseRemote:!0,useLocalLabel:`Use Local`,useLocalLabelKey:`onboarding.desktopRecovery.common.useLocal`,useRemoteLabel:`Use Remote`,useRemoteLabelKey:`onboarding.desktopRecovery.common.useRemote`};case`remote-unreachable`:{let e=H(t,n);return{title:`Remote Server Unreachable`,description:`Could not connect to "${e||`the remote server`}". Check your network connection and verify the server address.`,titleKey:`onboarding.desktopRecovery.remoteUnreachable.title`,descriptionKey:`onboarding.desktopRecovery.remoteUnreachable.description`,descriptionParams:e?{host:e}:void 0,iconKey:`remote`,showRetry:!0,retryLabel:`Retry Connection`,retryLabelKey:`onboarding.desktopRecovery.remoteUnreachable.retry`,showUseLocal:!0,showUseRemote:!0,useLocalLabel:`Use Local`,useLocalLabelKey:`onboarding.desktopRecovery.common.useLocal`,useRemoteLabel:`Use Remote`,useRemoteLabelKey:`onboarding.desktopRecovery.common.useRemote`}}case`remote-wrong-service`:{let e=H(t,n);return{title:`Incompatible Server`,description:`The server at "${e||`unknown`}" is not running Yuri. Verify the address points to an Yuri server.`,titleKey:`onboarding.desktopRecovery.incompatibleServer.title`,descriptionKey:`onboarding.desktopRecovery.incompatibleServer.description`,descriptionParams:e?{host:e}:void 0,iconKey:`remote`,showRetry:!1,showUseLocal:!0,showUseRemote:!0,useLocalLabel:`Use Local`,useLocalLabelKey:`onboarding.desktopRecovery.common.useLocal`,useRemoteLabel:`Use Remote`,useRemoteLabelKey:`onboarding.desktopRecovery.common.useRemote`}}case`remote-incompatible`:{let e=H(t,n);return{title:`Server Update Required`,description:`The Yuri server at "${e||`unknown`}" is not compatible with this app version. Update Yuri on the server, then try again.`,titleKey:`onboarding.desktopRecovery.remoteIncompatible.title`,descriptionKey:`onboarding.desktopRecovery.remoteIncompatible.description`,descriptionParams:e?{host:e}:void 0,iconKey:`remote`,showRetry:!0,retryLabel:`Retry Connection`,retryLabelKey:`onboarding.desktopRecovery.remoteUnreachable.retry`,showUseLocal:!0,showUseRemote:!0,useLocalLabel:`Use Local`,useLocalLabelKey:`onboarding.desktopRecovery.common.useLocal`,useRemoteLabel:`Use Remote`,useRemoteLabelKey:`onboarding.desktopRecovery.common.useRemote`}}case`missing-default-host`:return{title:`No Default Connection`,description:`Your saved default connection could not be found. Choose how you want to connect.`,titleKey:`onboarding.desktopRecovery.noDefaultConnection.title`,descriptionKey:`onboarding.desktopRecovery.noDefaultConnection.description`,iconKey:`local`,showRetry:!1,showUseLocal:!0,showUseRemote:!0,useLocalLabel:`Use Local`,useLocalLabelKey:`onboarding.desktopRecovery.common.useLocal`,useRemoteLabel:`Use Remote`,useRemoteLabelKey:`onboarding.desktopRecovery.common.useRemote`};default:throw Error(`Unknown recovery variant: ${e}`)}}function W(e){switch(e){case`local`:return(0,T.jsx)(y,{name:`macbook`,className:`h-8 w-8`});case`remote`:return(0,T.jsx)(y,{name:`server`,className:`h-8 w-8`})}}function G({variant:e,hostLabel:t,hostUrl:n,onRetry:r,onUseLocal:i,onUseRemote:a,isRetrying:o=!1}){let{t:s}=g(),l=U(e,t,n),u=l.retryLabelKey??`onboarding.desktopRecovery.actions.retryConnection`,d=w.useMemo(()=>{if(l.descriptionParams?.host)return l.descriptionParams;if(e===`remote-unreachable`)return{host:s(`onboarding.desktopRecovery.placeholders.remoteServer`)};if(e===`remote-wrong-service`||e===`remote-incompatible`)return{host:s(`onboarding.desktopRecovery.placeholders.unknownServer`)}},[l.descriptionParams,s,e]);return(0,T.jsx)(`div`,{className:`flex flex-col items-center justify-center h-full p-8`,children:(0,T.jsxs)(`div`,{className:`w-full max-w-md space-y-6`,children:[(0,T.jsxs)(`div`,{className:`flex flex-col items-center space-y-3 text-center`,children:[(0,T.jsx)(`div`,{className:`p-3 rounded-full`,style:{backgroundColor:`var(--status-warning)`,opacity:.15},children:(0,T.jsx)(`div`,{style:{color:`var(--status-warning)`},children:W(l.iconKey)})}),(0,T.jsx)(`h1`,{className:`typography-ui-header text-xl font-semibold text-foreground`,children:s(l.titleKey)}),(0,T.jsx)(`p`,{className:`text-muted-foreground text-sm max-w-sm`,children:s(l.descriptionKey,d)})]}),n&&(e===`remote-unreachable`||e===`remote-wrong-service`||e===`remote-incompatible`)&&(0,T.jsxs)(`div`,{className:`rounded-lg border border-border bg-background/50 p-3`,children:[(0,T.jsx)(`div`,{className:`text-xs text-muted-foreground mb-1`,children:s(`onboarding.remoteConnection.field.serverAddress`)}),(0,T.jsx)(`div`,{className:`font-mono text-sm text-foreground truncate`,children:c(n)})]}),(0,T.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[l.showRetry&&r&&(0,T.jsxs)(v,{onClick:r,disabled:o,className:`w-full`,children:[(0,T.jsx)(y,{name:`refresh`,className:_(`h-4 w-4`,o&&`animate-spin`)}),s(o?`onboarding.desktopRecovery.actions.retrying`:u)]}),(0,T.jsxs)(`div`,{className:`flex gap-2`,children:[l.showUseLocal&&i&&(0,T.jsxs)(v,{variant:`outline`,onClick:i,disabled:o,className:`flex-1`,children:[(0,T.jsx)(y,{name:`macbook`,className:`h-4 w-4`}),s(l.useLocalLabelKey)]}),l.showUseRemote&&a&&(0,T.jsxs)(v,{variant:`outline`,onClick:a,disabled:o,className:`flex-1`,children:[(0,T.jsx)(y,{name:`server`,className:`h-4 w-4`}),s(l.useRemoteLabelKey)]})]})]})]})})}function K(e,t){if(t===`use-remote`)return{kind:`remote-form`};switch(e){case`local-unavailable`:return{kind:`local-setup`};case`remote-unreachable`:case`remote-incompatible`:case`remote-wrong-service`:case`remote-missing`:case`missing-default-host`:return{kind:`switch-default-to-local`};default:throw Error(`Unhandled RecoveryVariant: ${e}`)}}function q(e){let n=(0,C.c)(27),{variant:a,hostUrl:o,hostLabel:s,onRetry:c,onChooseRemote:l,showRemoteForm:u,onCloseRemoteForm:d,onSwitchToLocalFromRemote:f,onEnterLocalSetup:p,isRetrying:m}=e,h=u!==void 0&&u,g=m!==void 0&&m,_=J,v;n[0]===c?v=n[1]:(v=async()=>{if(r()){await i();return}await t(`/api/config/reload`,{method:`POST`}),c?.()},n[0]=c,n[1]=v);let y=v,b;n[2]!==p||n[3]!==a?(b=async()=>{if(K(a,`use-local`).kind===`local-setup`){p?.();return}if(await _(`local`),r()){await i();return}window.location.reload()},n[2]=p,n[3]=a,n[4]=b):b=n[4];let x=b,S;n[5]!==l||n[6]!==a?(S=()=>{K(a,`use-remote`).kind===`remote-form`&&l?.()},n[5]=l,n[6]=a,n[7]=S):S=n[7];let w=S;if(h){let e=a===`remote-wrong-service`?``:o||``,t=a===`remote-wrong-service`?``:s||``,c;n[8]!==l||n[9]!==d?(c=d||(()=>l?.()),n[8]=l,n[9]=d,n[10]=c):c=n[10];let u;n[11]!==p||n[12]!==f?(u=f||(()=>{_(`local`).then(()=>{r()?i():p?.()})}),n[11]=p,n[12]=f,n[13]=u):u=n[13];let m;return n[14]!==t||n[15]!==e||n[16]!==c||n[17]!==u?(m=(0,T.jsx)(O,{onBack:c,initialUrl:e,initialLabel:t,isRecoveryMode:!0,onSwitchToLocal:u}),n[14]=t,n[15]=e,n[16]=c,n[17]=u,n[18]=m):m=n[18],m}let E;return n[19]!==y||n[20]!==x||n[21]!==w||n[22]!==s||n[23]!==o||n[24]!==g||n[25]!==a?(E=(0,T.jsx)(G,{variant:a,hostLabel:s,hostUrl:o,onRetry:y,onUseLocal:x,onUseRemote:w,isRetrying:g}),n[19]=y,n[20]=x,n[21]=w,n[22]=s,n[23]=o,n[24]=g,n[25]=a,n[26]=E):E=n[26],E}async function J(e){if(!r())return;let t=await d();await l({...t,...e===`local`?{defaultHostId:`local`}:{},initialHostChoiceCompleted:!0})}function Y(e){let t=(0,C.c)(47),{status:n,statusError:r,onContinueInBackground:i}=e,{t:a,locale:o}=g(),s=n?.total??0,c=n?.completed??0,l=r||n?.phase===`partial`||n?.phase===`error`,u=s>0?Math.min(1,Math.max(0,c/s)):null,d;t[0]===a?d=t[1]:(d=a(`onboarding.index.title`),t[0]=a,t[1]=d);let f=Math.max(s,1),p=s>0?c:void 0,m;t[2]!==c||t[3]!==a||t[4]!==s?(m=a(`commandPalette.index.progress`,{completed:c,total:s}),t[2]=c,t[3]=a,t[4]=s,t[5]=m):m=t[5];let h=`absolute inset-0 size-full -rotate-90 ${u===null&&!l?`motion-safe:animate-spin motion-safe:[animation-duration:3s]`:``}`,_;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,T.jsx)(`circle`,{cx:`96`,cy:`96`,r:`84`,stroke:`currentColor`,strokeWidth:`1.5`,className:`text-border`}),t[6]=_):_=t[6];let y=100-(u??.22)*100,S;t[7]===y?S=t[8]:(S=(0,T.jsx)(`circle`,{cx:`96`,cy:`96`,r:`84`,pathLength:`100`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:`100`,strokeDashoffset:y,className:`text-foreground/80 motion-safe:transition-[stroke-dashoffset] motion-safe:duration-700`}),t[7]=y,t[8]=S);let w;t[9]===u?w=t[10]:(w=u!==null&&u>0&&u<1&&(0,T.jsx)(`g`,{style:{transform:`rotate(${u*360}deg)`,transformOrigin:`96px 96px`},className:`motion-safe:transition-transform motion-safe:duration-700`,children:(0,T.jsx)(`circle`,{cx:`180`,cy:`96`,r:`3`,fill:`currentColor`,className:`text-foreground`})}),t[9]=u,t[10]=w);let E;t[11]!==h||t[12]!==S||t[13]!==w?(E=(0,T.jsxs)(`svg`,{viewBox:`0 0 192 192`,fill:`none`,"aria-hidden":`true`,className:h,children:[_,S,w]}),t[11]=h,t[12]=S,t[13]=w,t[14]=E):E=t[14];let D;t[15]!==o||t[16]!==u?(D=u!==null&&(0,T.jsx)(`span`,{"aria-hidden":`true`,className:`text-[2.5rem] font-light tabular-nums tracking-[-0.05em] text-foreground`,children:new Intl.NumberFormat(o,{style:`percent`,maximumFractionDigits:0}).format(u)}),t[15]=o,t[16]=u,t[17]=D):D=t[17];let O;t[18]!==d||t[19]!==E||t[20]!==D||t[21]!==f||t[22]!==p||t[23]!==m?(O=(0,T.jsxs)(`div`,{role:`progressbar`,"aria-label":d,"aria-valuemin":0,"aria-valuemax":f,"aria-valuenow":p,"aria-valuetext":m,className:`relative mb-9 flex size-40 items-center justify-center sm:size-44`,children:[E,D]}),t[18]=d,t[19]=E,t[20]=D,t[21]=f,t[22]=p,t[23]=m,t[24]=O):O=t[24];let k;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(k={fontSize:`1.0625rem`,fontWeight:450},t[25]=k):k=t[25];let A;t[26]===a?A=t[27]:(A=a(`onboarding.index.title`),t[26]=a,t[27]=A);let j;t[28]===A?j=t[29]:(j=(0,T.jsx)(b,{className:`tracking-tight`,style:k,children:A}),t[28]=A,t[29]=j);let M;t[30]!==l||t[31]!==a?(M=a(l?`onboarding.index.retrying`:`onboarding.index.description`),t[30]=l,t[31]=a,t[32]=M):M=t[32];let N;t[33]===M?N=t[34]:(N=(0,T.jsx)(x,{className:`text-xs text-muted-foreground`,children:M}),t[33]=M,t[34]=N);let P;t[35]!==j||t[36]!==N?(P=(0,T.jsxs)(`header`,{className:`space-y-2.5`,role:`status`,"aria-live":`polite`,children:[j,N]}),t[35]=j,t[36]=N,t[37]=P):P=t[37];let F;t[38]===a?F=t[39]:(F=a(`onboarding.index.background`),t[38]=a,t[39]=F);let I;t[40]!==i||t[41]!==F?(I=(0,T.jsx)(v,{variant:`ghost`,size:`sm`,className:`mt-8 text-xs font-normal text-muted-foreground`,onClick:i,children:F}),t[40]=i,t[41]=F,t[42]=I):I=t[42];let L;return t[43]!==O||t[44]!==P||t[45]!==I?(L=(0,T.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,"data-content-index-onboarding":!0,children:(0,T.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col items-center text-center`,children:[O,P,I]})}),t[43]=O,t[44]=P,t[45]=I,t[46]=L):L=t[46],L}function X(e){let t=(0,C.c)(30),{onBack:n,onCliAvailable:r,mode:i,recoveryVariant:a,recoveryHostUrl:o,recoveryHostLabel:s,onEnterLocalSetup:c,indexStatus:l,indexStatusError:u,onContinueInBackground:d}=e,f=i===void 0?`first-launch`:i,p=a===void 0?`missing-default-host`:a,[m,h]=w.useState(!1),[g,_]=w.useState(!1),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>{_(!1),h(!1)},t[0]=v):v=t[0];let y;t[1]!==f||t[2]!==s||t[3]!==o||t[4]!==p?(y=[f,p,o,s],t[1]=f,t[2]=s,t[3]=o,t[4]=p,t[5]=y):y=t[5],w.useEffect(v,y);let b=g?`local-setup`:f;if(b===`content-index`){let e;return t[6]!==l||t[7]!==u||t[8]!==d?(e=(0,T.jsx)(Y,{status:l,statusError:u,onContinueInBackground:d}),t[6]=l,t[7]=u,t[8]=d,t[9]=e):e=t[9],e}if(b===`recovery`){let e,n;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=()=>h(!1),n=()=>{h(!1),_(!0)},t[10]=e,t[11]=n):(e=t[10],n=t[11]);let r;t[12]===c?r=t[13]:(r=()=>{_(!0),c?.()},t[12]=c,t[13]=r);let i;return t[14]!==s||t[15]!==o||t[16]!==p||t[17]!==m||t[18]!==r?(i=(0,T.jsx)(q,{variant:p,hostUrl:o,hostLabel:s,showRemoteForm:m,onCloseRemoteForm:e,onSwitchToLocalFromRemote:n,onEnterLocalSetup:r}),t[14]=s,t[15]=o,t[16]=p,t[17]=m,t[18]=r,t[19]=i):i=t[19],i}if(b===`local-setup`){let e;t[20]!==n||t[21]!==g?(e=()=>{g?_(!1):n?.()},t[20]=n,t[21]=g,t[22]=e):e=t[22];let i;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>h(!0),t[23]=i):i=t[23];let a;return t[24]!==r||t[25]!==g||t[26]!==e?(a=(0,T.jsx)(V,{onBack:e,onCliAvailable:r,isFromRecovery:g,onSwitchToRemote:i}),t[24]=r,t[25]=g,t[26]=e,t[27]=a):a=t[27],a}let x;return t[28]===r?x=t[29]:(x=(0,T.jsx)(I,{onCliAvailable:r}),t[28]=r,t[29]=x),x}export{X as OnboardingScreen};
|