@yuriai/web 0.3.2 → 0.3.3-beta.2
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-DmvbnnMh.js → AgentAvatar-tFfpSF5F.js} +1 -1
- package/dist/assets/{AssistantConversationSurface-DxmQrzax.js → AssistantConversationSurface-B-iO-AUW.js} +3 -3
- package/dist/assets/{AssistantSessionCard-CsZIdhOH.js → AssistantSessionCard-DTPufGP2.js} +2 -2
- package/dist/assets/{AssistantUnreadBadge-0K84uUof.js → AssistantUnreadBadge-BV2cbiJo.js} +1 -1
- package/dist/assets/{AssistantView-eo7zU0tW.js → AssistantView-iKt4ZcoR.js} +1 -1
- package/dist/assets/{DiagramView-CwgPnPU8.js → DiagramView-SHoXhtXa.js} +1 -1
- package/dist/assets/{FadeInOnReveal-CIabuv8E.js → FadeInOnReveal-4E61VUmD.js} +1 -1
- package/dist/assets/{GuiPluginPage-CBWlpM7-.js → GuiPluginPage-Bt5j7vkr.js} +1 -1
- package/dist/assets/{GuiPluginSurface-4piMFmC2.js → GuiPluginSurface-Bs9Pauc8.js} +1 -1
- package/dist/assets/{GuiPluginWindow-D02tLdop.js → GuiPluginWindow-cnUkWFge.js} +1 -1
- package/dist/assets/{Icon-Br-W35tz.js → Icon-DebSeH2D.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-EHe_20yz.js → ImageLoadingPlaceholder-BBMhxtKr.js} +1 -1
- package/dist/assets/{LoadingImage-DNt-_HCJ.js → LoadingImage-6BZsPXXb.js} +1 -1
- package/dist/assets/MarkdownRenderer-Bjl6sXps.js +2 -0
- package/dist/assets/{MarkdownRendererImpl-CxfAdy1l.js → MarkdownRendererImpl-tZSoVcrU.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-B1ALcl04.js → MarkstreamRendererImpl-Br2_lE4f.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-DNLOs1n6.js → MobileDetailNavigation-B7vAsqVU.js} +1 -1
- package/dist/assets/{MobileResizableSheet-Bp_8Cf4j.js → MobileResizableSheet-BJs0jEqn.js} +1 -1
- package/dist/assets/{MobileShareBridge-9zfdEyQ_.js → MobileShareBridge-Cb9GvxGv.js} +1 -1
- package/dist/assets/{MobileSurface-B1O-lCca.js → MobileSurface-BaT1L70D.js} +1 -1
- package/dist/assets/{MultiRunWindow-DMvB8O02.js → MultiRunWindow-DPM25lxz.js} +1 -1
- package/dist/assets/{OnboardingScreen-DgxRaKDc.js → OnboardingScreen-D7ns1Tb2.js} +1 -1
- package/dist/assets/{OverlayScrollbar-CcX4ZP8W.js → OverlayScrollbar-B1PH1Jtv.js} +1 -1
- package/dist/assets/{RemoteAssistantSessionCard-BJz_SKef.js → RemoteAssistantSessionCard-BLp9NZhL.js} +1 -1
- package/dist/assets/{SettingsView-D7Kb5iGY.js → SettingsView-CaC2DI4Z.js} +1 -1
- package/dist/assets/{SettingsWindow-YzVAr8Bo.js → SettingsWindow-gVPRXQDh.js} +1 -1
- package/dist/assets/{SetupTourDialog-Dw9q3oII.js → SetupTourDialog-BoQIvdEP.js} +1 -1
- package/dist/assets/{TerminalView-DZChxb-F.js → TerminalView-CxlIRxha.js} +1 -1
- package/dist/assets/{ToolOutputDialog-2F74CchZ.js → ToolOutputDialog-Bsx1wpVW.js} +1 -1
- package/dist/assets/{VoiceSettings-CJh5q7QP.js → VoiceSettings-DhA9feRU.js} +1 -1
- package/dist/assets/{capgoAdapter-Q9jzJN69.js → capgoAdapter-vj-M8YQp.js} +1 -1
- package/dist/assets/{checkbox-CqeGKP3Z.js → checkbox-DVMeOiMB.js} +1 -1
- package/dist/assets/{collapsible-BSOetNHq.js → collapsible-D_R6x2Q_.js} +1 -1
- package/dist/assets/{context-menu-r_DjszgU.js → context-menu-BFDbtdmK.js} +1 -1
- package/dist/assets/{diagram-CxwT-HHn.js → diagram-CrjNCLmc.js} +1 -1
- package/dist/assets/{dialog-rXqw-6ab.js → dialog-CHzvxSP4.js} +1 -1
- package/dist/assets/{fileMentionTouchSelection-C0O4_Efn.js → fileMentionTouchSelection-D9GbR7zD.js} +1 -1
- package/dist/assets/{gitApi-BA93t0ww.js → gitApi-i_uT8MNk.js} +1 -1
- package/dist/assets/{input-9Y3tNEd9.js → input-Ck9_Qln_.js} +1 -1
- package/dist/assets/{insertionBoundaries-Dl5RMmA3.js → insertionBoundaries-BFmZupL3.js} +1 -1
- package/dist/assets/{main-Cli25Koo.js → main-RbzEHxam.js} +4 -4
- package/dist/assets/{main-Dj1N_rUJ.js → main-_RMi6lwy.js} +2 -2
- package/dist/assets/{markdownHeightCache-CaBnqn2C.js → markdownHeightCache-CnLR3-I2.js} +1 -1
- package/dist/assets/{mcpQueries-DCgOzZ7g.js → mcpQueries-MmcRk0_G.js} +1 -1
- package/dist/assets/{miniChat-Ct0NeLs3.js → miniChat-CEE6OnLk.js} +2 -2
- package/dist/assets/{mobile-Kg6aWex1.js → mobile-Cc6EYN5S.js} +2 -2
- package/dist/assets/{mobileBackNavigation-XjzoONfU.js → mobileBackNavigation-C6UPWCkI.js} +1 -1
- package/dist/assets/{mobileConnections-plT2Z1fc.js → mobileConnections-D8TC3-vN.js} +2 -2
- package/dist/assets/{multirun-1YatqupB.js → multirun-BJgG4Ymw.js} +1 -1
- package/dist/assets/{native-config-C0CpO-0Q.js → native-config-JMwpif8a.js} +1 -1
- package/dist/assets/{navigation-Bz_aROXw.js → navigation-toBhZ-X8.js} +1 -1
- package/dist/assets/{openRemoteProjectSession-9kfNj2Jy.js → openRemoteProjectSession-BD2tHXKw.js} +1 -1
- package/dist/assets/{projectMeta-CBxwAjHm.js → projectMeta-Bh7dUtdB.js} +1 -1
- package/dist/assets/{pwa-1EqcEjis.js → pwa-B2AKIaf6.js} +1 -1
- package/dist/assets/{queue-abort-optimistic-C6AsLSmI.js → queue-abort-optimistic-BizaMpYT.js} +1 -1
- package/dist/assets/{react-B_qpic0Y.js → react-DeCzn0Uc.js} +1 -1
- package/dist/assets/{readiness-DcOz5lOE.js → readiness-CekKZ6au.js} +2 -2
- package/dist/assets/{reference-history-DOMZlJml.js → reference-history-cPgFTsku.js} +1 -1
- package/dist/assets/{remoteSessionReference-Cn7Wzrg6.js → remoteSessionReference-Da4ThgtH.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-B-hPtyBl.js → renderElectronMiniChatApp-CmmEVsXV.js} +2 -2
- package/dist/assets/{renderMobileApp-CuOXMDN3.js → renderMobileApp-D1D1s_ia.js} +4 -4
- package/dist/assets/{runtimeConfig-C1A5pejN.js → runtimeConfig-CPU1CoUI.js} +1 -1
- package/dist/assets/{runtimeEndpointReset-oiLvIGYI.js → runtimeEndpointReset-Bwa7I9vS.js} +3 -3
- package/dist/assets/{select-CK1DjdEi.js → select-BnDfHG_T.js} +1 -1
- package/dist/assets/{sessionLookup-CmckqEe_.js → sessionLookup-mQtUvdep.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-Bd9uV_sY.js → sortable-tabs-strip-BwnT5maB.js} +1 -1
- package/dist/assets/{speechSettingsQueries-BHZs2Dyf.js → speechSettingsQueries-mH-OoFPq.js} +1 -1
- package/dist/assets/src-2lmG4z55.css +2 -0
- package/dist/assets/{textarea-DvCd0eUo.js → textarea-CVswImHY.js} +1 -1
- package/dist/assets/{tooltip-B93KmoPh.js → tooltip-DovnVenD.js} +1 -1
- package/dist/assets/types-CnPxR5yQ.js +2 -0
- package/dist/assets/{useAppFontEffects-EXiDcoNt.js → useAppFontEffects-wm0ojvh7.js} +5 -5
- package/dist/assets/{useDesktopWindowControlsLayout-4TLDMOLv.js → useDesktopWindowControlsLayout-BBizNJUb.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-DFe0GivQ.js → useEffectiveDirectory-BN5qbhev.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-BtHQN423.js → useMobileNavigationStore-oveTY29a.js} +4 -4
- package/dist/assets/{usePluginsStore-Ch1DaoBM.js → usePluginsStore-DErHgEFY.js} +1 -1
- package/dist/assets/{useProjectRuntimeAPIs-CnTyVRex.js → useProjectRuntimeAPIs-B-ShHy6s.js} +1 -1
- package/dist/assets/{useStreamingTextThrottle-DAr0FPKI.js → useStreamingTextThrottle-BOvHQRrH.js} +1 -1
- package/dist/index.html +6 -6
- package/dist/mini-chat.html +6 -6
- package/dist/mobile.html +2 -2
- package/package.json +1 -1
- package/dist/assets/MarkdownRenderer-BjRyxBUx.js +0 -2
- package/dist/assets/src-aLILBedG.css +0 -2
- package/dist/assets/types-ClAbMq1_.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,n as t}from"./runtime-switch-DEPKHgdL.js";import{n}from"./runtime-fetch-V-iMWR8t.js";import{a as r,i,r as a}from"./vendor-zustand-CNn3HHhT.js";import{o,ot as s,s as c}from"./vendor-base-ui-fom6orB6.js";import{t as l}from"./safeStorage-DTOhKN0V.js";import{n as u}from"./client-CzjApAA4.js";import{n as d}from"./vendor-react-D5BntRmA.js";import{s as f}from"./vendor-tanstack-react-query-ChSd65dm.js";import{E as p,J as m,K as h,q as g,z as _}from"./runtime-file-resource-CKQQEwNv.js";import{t as v}from"./i18n-BvjeIWrT.js";import{Ba as y,Ha as b,In as x,Rn as S}from"./useMobileNavigationStore-BtHQN423.js";var C=d(),w=s();function ee(e){let t=(0,C.c)(17),{checked:n,onChange:r,disabled:i,ariaLabel:a,className:s}=e,l=i!==void 0&&i,{t:u}=v(),d;t[0]!==n||t[1]!==l||t[2]!==r?(d=e=>{!l&&e!==n&&r(e)},t[0]=n,t[1]=l,t[2]=r,t[3]=d):d=t[3];let f;t[4]===s?f=t[5]:(f=S(`yuri-settings-switch`,s),t[4]=s,t[5]=f);let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=[!1,!0],t[6]=p):p=t[6];let m;t[7]!==n||t[8]!==u?(m=p.map(e=>(0,w.jsxs)(c,{value:e,nativeButton:!0,render:(0,w.jsx)(x,{variant:`ghost`,size:`xs`}),className:`yuri-settings-switch-option`,children:[n===e&&(0,w.jsx)(`span`,{"aria-hidden":!0,className:`yuri-segmented-selected-pill yuri-settings-switch-pill`}),(0,w.jsx)(`span`,{className:`relative`,children:u(e?`settings.switch.on`:`settings.switch.off`)})]},String(e))),t[7]=n,t[8]=u,t[9]=m):m=t[9];let h;return t[10]!==a||t[11]!==n||t[12]!==l||t[13]!==d||t[14]!==f||t[15]!==m?(h=(0,w.jsx)(o,{value:n,onValueChange:d,disabled:l,"aria-label":a,"aria-orientation":`horizontal`,"data-slot":`settings-switch`,className:f,onClick:E,onKeyDown:T,children:m}),t[10]=a,t[11]=n,t[12]=l,t[13]=d,t[14]=f,t[15]=m,t[16]=h):h=t[16],h}function T(e){return e.stopPropagation()}function E(e){return e.stopPropagation()}function D(e){let t=(0,C.c)(10),{children:n,actions:r,className:i}=e,a;t[0]===i?a=t[1]:(a=S(`flex shrink-0 items-center justify-between gap-3 py-3`,i),t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,w.jsx)(`div`,{className:`min-w-0 flex-1`,children:n}),t[2]=n,t[3]=o);let s;t[4]===r?s=t[5]:(s=(0,w.jsx)(`div`,{className:`flex max-w-[70%] shrink-0 flex-wrap items-center justify-end gap-2 [&_button]:max-w-full [&_button]:whitespace-normal`,children:r}),t[4]=r,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,w.jsxs)(`header`,{"data-settings-action-header":``,className:a,children:[o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function O(e){let t=(0,C.c)(21),{label:n,actions:r,children:i,description:a,itemId:o,ariaLabel:s,className:c,cardClassName:l,cardId:u}=e,d=typeof n==`string`&&/^[\p{Script=Latin}\p{Number}\p{Punctuation}\p{Separator}]+$/u.test(n)?`latin`:void 0,f;t[0]===c?f=t[1]:(f=S(`yuri-settings-group`,c),t[0]=c,t[1]=f);let p;t[2]!==r||t[3]!==n||t[4]!==d?(p=r?(0,w.jsx)(D,{className:`py-0`,actions:r,children:n?(0,w.jsx)(`div`,{className:`yuri-settings-group-label`,"data-settings-label-script":d,children:n}):null}):n?(0,w.jsx)(`div`,{className:`yuri-settings-group-label`,"data-settings-label-script":d,children:n}):null,t[2]=r,t[3]=n,t[4]=d,t[5]=p):p=t[5];let m;t[6]===l?m=t[7]:(m=S(`yuri-settings-group-card`,l),t[6]=l,t[7]=m);let h;t[8]!==u||t[9]!==i||t[10]!==o||t[11]!==m?(h=(0,w.jsx)(`div`,{id:u,"data-settings-item":o,className:m,children:i}),t[8]=u,t[9]=i,t[10]=o,t[11]=m,t[12]=h):h=t[12];let g;t[13]===a?g=t[14]:(g=a?(0,w.jsx)(`p`,{className:`yuri-settings-group-description text-muted-foreground`,children:a}):null,t[13]=a,t[14]=g);let _;return t[15]!==s||t[16]!==f||t[17]!==p||t[18]!==h||t[19]!==g?(_=(0,w.jsxs)(`section`,{className:f,"aria-label":s,children:[p,h,g]}),t[15]=s,t[16]=f,t[17]=p,t[18]=h,t[19]=g,t[20]=_):_=t[20],_}function te(e){let t=(0,C.c)(20),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({label:s,description:a,descriptionPlacement:l,ariaLabel:n,groupClassName:o,cardClassName:r,children:i,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u=l===void 0?`inside`:l,d=u===`outside`?a:void 0,f=u===`inside`?a:void 0,p;t[9]!==i||t[10]!==s||t[11]!==c||t[12]!==f?(p=(0,w.jsx)(k,{label:s,description:f,...c,children:i}),t[9]=i,t[10]=s,t[11]=c,t[12]=f,t[13]=p):p=t[13];let m;return t[14]!==n||t[15]!==r||t[16]!==o||t[17]!==d||t[18]!==p?(m=(0,w.jsx)(O,{ariaLabel:n,className:o,cardClassName:r,description:d,children:p}),t[14]=n,t[15]=r,t[16]=o,t[17]=d,t[18]=p,t[19]=m):m=t[19],m}function k(e){let t=(0,C.c)(25),{label:n,children:r,description:i,footer:a,itemId:o,className:s,copyClassName:c,controlClassName:l}=e,u;t[0]===s?u=t[1]:(u=S(`yuri-settings-group-row yuri-settings-split-row`,s),t[0]=s,t[1]=u);let d;t[2]===c?d=t[3]:(d=S(`yuri-settings-split-row-copy`,c),t[2]=c,t[3]=d);let f;t[4]===n?f=t[5]:(f=n?(0,w.jsx)(`div`,{className:`typography-ui-label text-foreground`,children:n}):null,t[4]=n,t[5]=f);let p;t[6]===i?p=t[7]:(p=i?(0,w.jsx)(`span`,{className:`typography-meta text-muted-foreground`,children:i}):null,t[6]=i,t[7]=p);let m;t[8]!==d||t[9]!==f||t[10]!==p?(m=(0,w.jsxs)(`div`,{className:d,children:[f,p]}),t[8]=d,t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]===l?h=t[13]:(h=S(`yuri-settings-split-row-control`,l),t[12]=l,t[13]=h);let g;t[14]!==r||t[15]!==h?(g=(0,w.jsx)(`div`,{"data-settings-value":``,className:h,children:r}),t[14]=r,t[15]=h,t[16]=g):g=t[16];let _;t[17]===a?_=t[18]:(_=a?(0,w.jsx)(`div`,{"data-slot":`settings-row-footer`,className:`col-span-full min-w-0`,children:a}):null,t[17]=a,t[18]=_);let v;return t[19]!==o||t[20]!==u||t[21]!==m||t[22]!==g||t[23]!==_?(v=(0,w.jsxs)(`div`,{"data-settings-item":o,className:u,children:[m,g,_]}),t[19]=o,t[20]=u,t[21]=m,t[22]=g,t[23]=_,t[24]=v):v=t[24],v}function ne(e){let t=(0,C.c)(32),{checked:n,onChange:r,label:i,ariaLabel:a,description:o,itemId:s,disabled:c,className:l}=e,u=c!==void 0&&c,d;t[0]!==n||t[1]!==u||t[2]!==r?(d=()=>{u||r(!n)},t[0]=n,t[1]=u,t[2]=r,t[3]=d):d=t[3];let f=d,p=re,m=u?`cursor-not-allowed`:`cursor-pointer`,h;t[4]!==l||t[5]!==m?(h=S(`yuri-settings-group-row yuri-settings-split-row group`,m,l),t[4]=l,t[5]=m,t[6]=h):h=t[6];let g=u?-1:0,_=u||void 0,v,y;t[7]===f?(v=t[8],y=t[9]):(v=e=>{p(e.target)||f()},y=e=>{p(e.target)||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),f())},t[7]=f,t[8]=v,t[9]=y);let b;t[10]===i?b=t[11]:(b=(0,w.jsx)(`span`,{className:`typography-ui-label text-foreground`,children:i}),t[10]=i,t[11]=b);let x;t[12]===o?x=t[13]:(x=o?(0,w.jsx)(`span`,{className:`typography-meta text-muted-foreground`,children:o}):null,t[12]=o,t[13]=x);let T;t[14]!==x||t[15]!==b?(T=(0,w.jsxs)(`div`,{className:`yuri-settings-split-row-copy`,children:[b,x]}),t[14]=x,t[15]=b,t[16]=T):T=t[16];let E;t[17]!==a||t[18]!==n||t[19]!==u||t[20]!==r?(E=(0,w.jsx)(`div`,{"data-settings-value":``,className:`yuri-settings-split-row-control`,children:(0,w.jsx)(ee,{checked:n,onChange:r,disabled:u,ariaLabel:a})}),t[17]=a,t[18]=n,t[19]=u,t[20]=r,t[21]=E):E=t[21];let D;return t[22]!==n||t[23]!==s||t[24]!==T||t[25]!==E||t[26]!==h||t[27]!==g||t[28]!==_||t[29]!==v||t[30]!==y?(D=(0,w.jsxs)(`div`,{"data-settings-item":s,className:h,role:`button`,tabIndex:g,"aria-pressed":n,"aria-disabled":_,onClick:v,onKeyDown:y,children:[T,E]}),t[22]=n,t[23]=s,t[24]=T,t[25]=E,t[26]=h,t[27]=g,t[28]=_,t[29]=v,t[30]=y,t[31]=D):D=t[31],D}function re(e){return e instanceof HTMLElement&&e.closest(`button, a, input, select, textarea`)!==null}var A=e=>{let t=e?.trim();return t?{location:{directory:t}}:void 0},ie=()=>{let e=u.getSdkClient().plugin;if(!e?.list||!e.check||!e.update)throw Error(`OpenCode plugin status is not available`);return e},ae=e=>{switch(e.type){case`package`:return{kind:`package`,target:e.target,version:e.version??null,outdated:e.outdated===!0,updating:e.updating===!0};case`local`:return{kind:`local`,path:e.path};case`builtin`:case`sdk`:return{kind:`builtin`};default:throw Error(`Unexpected plugin source: ${JSON.stringify(e)}`)}},oe=e=>{if(e.status===`active`)return{kind:`active`};if(e.status===`failed`)return{kind:`failed`,error:e.error,ref:e.ref??null};throw Error(`Unexpected plugin state: ${JSON.stringify(e)}`)},se=e=>({source:ae(e.source),state:oe(e.state)}),ce=e=>{if(!Array.isArray(e))throw Error(`OpenCode plugin status payload is invalid`);return e.map(e=>se(e))};async function j(e,t){return ce((await ie().list(A(e),t?{signal:t}:void 0))?.data)}async function le(e,t,n){let r=t.trim();if(!r)throw Error(`plugin.update requires a target`);await ie().update({...A(e),targets:[r]},n?{signal:n}:void 0)}function ue(e){return e instanceof Error&&e.message.trim()?e.message:typeof e==`string`&&e.trim()?e:`plugin operation failed`}var de=1500,M=e=>e?.trim()||null,N=(t,n=e())=>m.plugins.list(t,n),P=(t,n,r=!1,i=e())=>m.plugins.registry(t,n,r,i),F=(t,n=e())=>m.plugins.runtime(t,n),I=0,L=()=>(I+=1,I),R=(e,t,n)=>e.getQueryData(F(t,n)),z=(t=y(),n=e(),r)=>{let i=r?t??r.location.directory:M(t),a=_(r);return{queryKey:a.key(N(i,n)),queryFn:async({signal:e})=>{let t=await a.fetch(_e(`/api/config/plugins`,i),{headers:U(i),signal:e});if(!t.ok)throw Error(`Failed to load plugins`);let n=await t.json();return a.assertCurrent(e),{entries:n.entries??[],files:n.files??[]}},staleTime:5e3,retry:2}},B=(t,r,i=!1,a=e(),o=!1)=>{let s=M(t),c=h(r);return{queryKey:o?[...P(s,c,i,a),`details`]:P(s,c,i,a),queryFn:async({signal:e})=>{let t={};for(let r of ye(c)){let a=ve(r,i,s),c=await n(o?`${a}&details=true`:a,{headers:U(s),signal:e});if(!c.ok)throw Error(`Failed to load plugin registry info`);let l=await c.json();for(let e of l.results??[])t[e.spec]=e}return t},staleTime:i?0:3e5,retry:2}},fe=(t=y(),n=e(),r)=>{let i=r?t??r.location.directory:M(t),a=_(r);return{queryKey:a.key(F(i,n)),queryFn:async({signal:e})=>{if(r){let t=await r.sdk().plugin.list({location:{directory:i??r.location.directory}},{signal:e});if(a.assertCurrent(e),!Array.isArray(t.data))throw Error(`Failed to load remote plugin runtime`);return t.data.map(e=>({source:e.source.type===`package`?{kind:`package`,target:e.source.target,version:e.source.version??null,outdated:e.source.outdated===!0,updating:e.source.updating===!0}:e.source.type===`local`?{kind:`local`,path:e.source.path}:{kind:`builtin`},state:e.state.status===`failed`?{kind:`failed`,error:e.state.error,ref:e.state.ref??null}:{kind:`active`}}))}let t=L(),o=await j(i,e);if(t!==I){let e=R(g,i,n);if(e)return e;throw Error(`Stale plugin runtime read`)}return o},staleTime:5e3,retry:!1}},pe=e=>{let t=(0,C.c)(11),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let r=n,i=p(),a=b(be),o;t[2]!==a||t[3]!==i?.entry.location.directory?(o=i?.entry.location.directory??M(a)??M(u.getDirectory()),t[2]=a,t[3]=i?.entry.location.directory,t[4]=o):o=t[4];let s=i?.entry,c;t[5]!==o||t[6]!==s?(c=z(o,void 0,s),t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==r.enabled||t[9]!==c?(l={...c,enabled:r.enabled},t[8]=r.enabled,t[9]=c,t[10]=l):l=t[10],f(l)},me=(e,t)=>{let n=(0,C.c)(6),r=t!==void 0&&t,i=b(xe),a;n[0]!==i||n[1]!==r||n[2]!==e?(a=B(M(i)??M(u.getDirectory()),e,r),n[0]=i,n[1]=r,n[2]=e,n[3]=a):a=n[3];let o;return n[4]===a?o=n[5]:(o={...a},n[4]=a,n[5]=o),f(o)},V=()=>{let e=(0,C.c)(2),t=b(Se),n;return e[0]===t?n=e[1]:(n=M(t)??M(u.getDirectory()),e[0]=t,e[1]=n),n},he=e=>{let t=(0,C.c)(8),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let r=n,i=p(),a=V(),o=i?.entry.location.directory??a,s=i?.entry,c;t[2]!==o||t[3]!==s?(c=fe(o,void 0,s),t[2]=o,t[3]=s,t[4]=c):c=t[4];let l;return t[5]!==r.enabled||t[6]!==c?(l={...c,enabled:r.enabled},t[5]=r.enabled,t[6]=c,t[7]=l):l=t[7],f(l)},H=async(t,n,r)=>{let i=M(n);return e()===r?t.fetchQuery({...z(i,r),staleTime:0}):t.getQueryData(N(i,r))??{entries:[],files:[]}},ge=async(t,n,r)=>{let i=M(n);if(e()!==r)return R(t,i,r);let a=L(),o=await j(i);return a!==I||e()!==r?R(t,i,r):(t.setQueryData(F(i,r),o),o)};function _e(e,t){return`${e}${t?`?directory=${encodeURIComponent(t)}`:``}`}function ve(e,t,n){let r=new URLSearchParams;t&&r.set(`refresh`,`true`),n&&r.set(`directory`,n);let i=r.toString();return`/api/config/plugins/registry?${`specs=${e.map(encodeURIComponent).join(`,`)}`}${i?`&${i}`:``}`}function ye(e){let t=[],n=[],r=0;for(let i of e){let e=encodeURIComponent(i),a=n.length===0?e.length:r+1+e.length;if(n.length>0&&a>de){t.push(n),n=[i],r=e.length;continue}n.push(i),r=a}return n.length>0&&t.push(n),t}function U(e){return e?{"x-opencode-directory":e}:void 0}function be(e){return e.getActiveProject?.()?.path??null}function xe(e){return e.getActiveProject?.()?.path??null}function Se(e){return e.getActiveProject?.()?.path??null}var W=()=>{try{let e=b.getState().getActiveProject?.();if(e?.path?.trim())return e.path.trim();let t=u.getDirectory();if(t?.trim())return t.trim()}catch(e){console.warn(`[PluginsStore] Error resolving config directory:`,e)}return null},Ce=5e3,we=`__default__`,G=new Map,K=new Map,Te=1500,q=e=>e?.trim()||we,Ee=e=>{G.delete(q(e))},J=r()(a(i((r,i)=>({entries:[],files:[],selectedId:null,isLoading:!1,registryInfo:{},isLoadingRegistry:!1,draft:null,setSelected:e=>r({selectedId:e}),setDraft:e=>r({draft:e}),loadPlugins:async n=>{let a=W(),o=e(),s=t(),c=()=>o===e()&&s===t()&&a===W(),l=q(a),u=Date.now(),d=G.get(l)??0,f=i().entries.length>0||i().files.length>0;if(!n?.force&&f&&u-d<Ce)return!0;let p=K.get(l);if(!n?.force&&p)return p;let m=(async()=>{r({isLoading:!0});try{let e=n?.force?await H(g,a,o):await g.fetchQuery(z(a,o));return c()?(r({entries:e.entries??[],files:e.files??[],isLoading:!1}),G.set(l,Date.now()),n?.force||i().loadRegistryInfo(),!0):!1}catch(e){return console.error(`[PluginsStore] Failed to load plugins:`,e),c()&&r({isLoading:!1}),!1}})();K.set(l,m);try{return await m}finally{K.delete(l)}},loadRegistryInfo:async e=>{let t=Oe(e?.specs??i().entries.map(e=>e.spec));if(t.length===0){r({isLoadingRegistry:!1});return}r({isLoadingRegistry:!0});try{let a=W(),o={...i().registryInfo};for(let r of ke(t)){let t=await n(De(r,e?.force===!0,a),{headers:X(a)});if(!t.ok)throw Error(`Failed to load plugin registry info`);let i=await $(t);for(let e of i.results??[])o[e.spec]=e}r({registryInfo:o,isLoadingRegistry:!1})}catch(e){console.error(`[PluginsStore] Failed to load plugin registry info:`,e),r({isLoadingRegistry:!1})}},updateToLatest:async e=>{let t=i().entries.find(t=>t.id===e);if(!t)return{ok:!1};let n=i().registryInfo[t.spec];return!n||n.kind!==`npm-ok`||!n.hasUpdate||!n.latestVersion?{ok:!1}:await i().updateEntry(e,{spec:`${n.name}@${n.latestVersion}`})},createEntry:async e=>{let t=await Q(async t=>await n(Y(`/api/config/plugins/entry`,t),{method:`POST`,headers:Z(t),body:JSON.stringify(Ae(e))}));return t.ok&&i().loadRegistryInfo({specs:[e.spec],force:!0}),t},updateEntry:async(t,r)=>{let a=(g.getQueryData(z(W(),e()).queryKey)?.entries??i().entries).find(e=>e.id===t),o=a?.spec,s=r.spec??o,c=await Q(async e=>await n(Y(`/api/config/plugins/entry/${encodeURIComponent(t)}`,e),{method:`PATCH`,headers:Z(e),body:JSON.stringify(Ae(r))}),a&&s?{...a,spec:s}:void 0);return c.ok&&s&&i().loadRegistryInfo({specs:[s],force:!0}),c},deleteEntry:async e=>{let t=i().entries.find(t=>t.id===e),a=await Q(async t=>await n(Y(`/api/config/plugins/entry/${encodeURIComponent(e)}`,t),{method:`DELETE`,headers:X(t)}));if(a.ok&&i().selectedId===e&&r({selectedId:null}),a.ok&&t){let e={...i().registryInfo};delete e[t.spec],r({registryInfo:e})}return a},readFile:async e=>{try{let t=W(),r=await n(Y(`/api/config/plugins/file/${encodeURIComponent(e)}`,t),{headers:X(t)});if(!r.ok)throw Error(`Failed to read plugin file`);return await $(r)}catch(e){return console.error(`[PluginsStore] Failed to read plugin file:`,e),null}},createFile:async e=>Q(async t=>await n(Y(`/api/config/plugins/file`,t),{method:`POST`,headers:Z(t),body:JSON.stringify(e)})),updateFile:async(e,t)=>Q(async r=>await n(Y(`/api/config/plugins/file/${encodeURIComponent(e)}`,r),{method:`PUT`,headers:Z(r),body:JSON.stringify(t)})),deleteFile:async e=>{let t=await Q(async t=>await n(Y(`/api/config/plugins/file/${encodeURIComponent(e)}`,t),{method:`DELETE`,headers:X(t)}));return t.ok&&i().selectedId===e&&r({selectedId:null}),t},getById:e=>i().entries.find(t=>t.id===e)??i().files.find(t=>t.id===e)}),{name:`plugins-store`,storage:l(),partialize:e=>({selectedId:e.selectedId})}),{name:`plugins-store`}));function Y(e,t){return`${e}${t?`?directory=${encodeURIComponent(t)}`:``}`}function De(e,t,n){let r=new URLSearchParams;t&&r.set(`refresh`,`true`),n&&r.set(`directory`,n);let i=r.toString();return`/api/config/plugins/registry?${`specs=${e.map(encodeURIComponent).join(`,`)}`}${i?`&${i}`:``}`}function Oe(e){return Array.from(new Set(e.map(e=>e.trim()).filter(Boolean)))}function ke(e){let t=[],n=[],r=0;for(let i of e){let e=encodeURIComponent(i),a=n.length===0?e.length:r+1+e.length;n.length>0&&a>Te?(t.push(n),n=[i],r=e.length):(n.push(i),r=a)}return n.length>0&&t.push(n),t}function X(e){return e?{"x-opencode-directory":e}:void 0}function Z(e){return{"Content-Type":`application/json`,...e?{"x-opencode-directory":e}:{}}}function Ae(e){let t={};return e.spec!==void 0&&(t.spec=e.spec),e.options!==void 0&&(t.options=e.options),e.scope!==void 0&&(t.scope=e.scope),t}async function Q(n,r){let i=e(),a=t();try{let o=W(),s=await n(o),c=await $(s).catch(()=>null);if(!s.ok)throw Error(c?.error||`Failed to update plugin configuration`);if(i!==e()||a!==t())return{ok:!0};Ee(o);let l=await H(g,o,i);if(o===W()&&i===e()&&a===t()){let e=r&&J.getState().selectedId===r.id?l.entries.find(e=>e.spec===r.spec&&e.scope===r.scope&&e.sourcePath===r.sourcePath):void 0;J.setState({entries:l.entries,files:l.files,...e?{selectedId:e.id}:{}}),G.set(q(o),Date.now())}return{ok:!0,reloadFailed:c?.reloadFailed===!0,message:c?.message,warning:c?.warning}}catch(e){return console.error(`[PluginsStore] Failed to update plugin configuration:`,e),{ok:!1}}}async function $(e){return await e.json()}export{V as a,pe as c,te as d,O as f,ee as g,D as h,ge as i,ue as l,ne as m,B as n,me as o,k as p,z as r,he as s,J as t,le as u};
|
|
1
|
+
import{i as e,n as t}from"./runtime-switch-DEPKHgdL.js";import{n}from"./runtime-fetch-V-iMWR8t.js";import{a as r,i,r as a}from"./vendor-zustand-CNn3HHhT.js";import{o,ot as s,s as c}from"./vendor-base-ui-fom6orB6.js";import{t as l}from"./safeStorage-DTOhKN0V.js";import{n as u}from"./client-CzjApAA4.js";import{n as d}from"./vendor-react-D5BntRmA.js";import{s as f}from"./vendor-tanstack-react-query-ChSd65dm.js";import{E as p,J as m,K as h,q as g,z as _}from"./runtime-file-resource-CKQQEwNv.js";import{t as v}from"./i18n-BvjeIWrT.js";import{Ba as y,Ha as b,In as x,Rn as S}from"./useMobileNavigationStore-oveTY29a.js";var C=d(),w=s();function ee(e){let t=(0,C.c)(17),{checked:n,onChange:r,disabled:i,ariaLabel:a,className:s}=e,l=i!==void 0&&i,{t:u}=v(),d;t[0]!==n||t[1]!==l||t[2]!==r?(d=e=>{!l&&e!==n&&r(e)},t[0]=n,t[1]=l,t[2]=r,t[3]=d):d=t[3];let f;t[4]===s?f=t[5]:(f=S(`yuri-settings-switch`,s),t[4]=s,t[5]=f);let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=[!1,!0],t[6]=p):p=t[6];let m;t[7]!==n||t[8]!==u?(m=p.map(e=>(0,w.jsxs)(c,{value:e,nativeButton:!0,render:(0,w.jsx)(x,{variant:`ghost`,size:`xs`}),className:`yuri-settings-switch-option`,children:[n===e&&(0,w.jsx)(`span`,{"aria-hidden":!0,className:`yuri-segmented-selected-pill yuri-settings-switch-pill`}),(0,w.jsx)(`span`,{className:`relative`,children:u(e?`settings.switch.on`:`settings.switch.off`)})]},String(e))),t[7]=n,t[8]=u,t[9]=m):m=t[9];let h;return t[10]!==a||t[11]!==n||t[12]!==l||t[13]!==d||t[14]!==f||t[15]!==m?(h=(0,w.jsx)(o,{value:n,onValueChange:d,disabled:l,"aria-label":a,"aria-orientation":`horizontal`,"data-slot":`settings-switch`,className:f,onClick:E,onKeyDown:T,children:m}),t[10]=a,t[11]=n,t[12]=l,t[13]=d,t[14]=f,t[15]=m,t[16]=h):h=t[16],h}function T(e){return e.stopPropagation()}function E(e){return e.stopPropagation()}function D(e){let t=(0,C.c)(10),{children:n,actions:r,className:i}=e,a;t[0]===i?a=t[1]:(a=S(`flex shrink-0 items-center justify-between gap-3 py-3`,i),t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,w.jsx)(`div`,{className:`min-w-0 flex-1`,children:n}),t[2]=n,t[3]=o);let s;t[4]===r?s=t[5]:(s=(0,w.jsx)(`div`,{className:`flex max-w-[70%] shrink-0 flex-wrap items-center justify-end gap-2 [&_button]:max-w-full [&_button]:whitespace-normal`,children:r}),t[4]=r,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,w.jsxs)(`header`,{"data-settings-action-header":``,className:a,children:[o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function O(e){let t=(0,C.c)(21),{label:n,actions:r,children:i,description:a,itemId:o,ariaLabel:s,className:c,cardClassName:l,cardId:u}=e,d=typeof n==`string`&&/^[\p{Script=Latin}\p{Number}\p{Punctuation}\p{Separator}]+$/u.test(n)?`latin`:void 0,f;t[0]===c?f=t[1]:(f=S(`yuri-settings-group`,c),t[0]=c,t[1]=f);let p;t[2]!==r||t[3]!==n||t[4]!==d?(p=r?(0,w.jsx)(D,{className:`py-0`,actions:r,children:n?(0,w.jsx)(`div`,{className:`yuri-settings-group-label`,"data-settings-label-script":d,children:n}):null}):n?(0,w.jsx)(`div`,{className:`yuri-settings-group-label`,"data-settings-label-script":d,children:n}):null,t[2]=r,t[3]=n,t[4]=d,t[5]=p):p=t[5];let m;t[6]===l?m=t[7]:(m=S(`yuri-settings-group-card`,l),t[6]=l,t[7]=m);let h;t[8]!==u||t[9]!==i||t[10]!==o||t[11]!==m?(h=(0,w.jsx)(`div`,{id:u,"data-settings-item":o,className:m,children:i}),t[8]=u,t[9]=i,t[10]=o,t[11]=m,t[12]=h):h=t[12];let g;t[13]===a?g=t[14]:(g=a?(0,w.jsx)(`p`,{className:`yuri-settings-group-description text-muted-foreground`,children:a}):null,t[13]=a,t[14]=g);let _;return t[15]!==s||t[16]!==f||t[17]!==p||t[18]!==h||t[19]!==g?(_=(0,w.jsxs)(`section`,{className:f,"aria-label":s,children:[p,h,g]}),t[15]=s,t[16]=f,t[17]=p,t[18]=h,t[19]=g,t[20]=_):_=t[20],_}function te(e){let t=(0,C.c)(20),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({label:s,description:a,descriptionPlacement:l,ariaLabel:n,groupClassName:o,cardClassName:r,children:i,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u=l===void 0?`inside`:l,d=u===`outside`?a:void 0,f=u===`inside`?a:void 0,p;t[9]!==i||t[10]!==s||t[11]!==c||t[12]!==f?(p=(0,w.jsx)(k,{label:s,description:f,...c,children:i}),t[9]=i,t[10]=s,t[11]=c,t[12]=f,t[13]=p):p=t[13];let m;return t[14]!==n||t[15]!==r||t[16]!==o||t[17]!==d||t[18]!==p?(m=(0,w.jsx)(O,{ariaLabel:n,className:o,cardClassName:r,description:d,children:p}),t[14]=n,t[15]=r,t[16]=o,t[17]=d,t[18]=p,t[19]=m):m=t[19],m}function k(e){let t=(0,C.c)(25),{label:n,children:r,description:i,footer:a,itemId:o,className:s,copyClassName:c,controlClassName:l}=e,u;t[0]===s?u=t[1]:(u=S(`yuri-settings-group-row yuri-settings-split-row`,s),t[0]=s,t[1]=u);let d;t[2]===c?d=t[3]:(d=S(`yuri-settings-split-row-copy`,c),t[2]=c,t[3]=d);let f;t[4]===n?f=t[5]:(f=n?(0,w.jsx)(`div`,{className:`typography-ui-label text-foreground`,children:n}):null,t[4]=n,t[5]=f);let p;t[6]===i?p=t[7]:(p=i?(0,w.jsx)(`span`,{className:`typography-meta text-muted-foreground`,children:i}):null,t[6]=i,t[7]=p);let m;t[8]!==d||t[9]!==f||t[10]!==p?(m=(0,w.jsxs)(`div`,{className:d,children:[f,p]}),t[8]=d,t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]===l?h=t[13]:(h=S(`yuri-settings-split-row-control`,l),t[12]=l,t[13]=h);let g;t[14]!==r||t[15]!==h?(g=(0,w.jsx)(`div`,{"data-settings-value":``,className:h,children:r}),t[14]=r,t[15]=h,t[16]=g):g=t[16];let _;t[17]===a?_=t[18]:(_=a?(0,w.jsx)(`div`,{"data-slot":`settings-row-footer`,className:`col-span-full min-w-0`,children:a}):null,t[17]=a,t[18]=_);let v;return t[19]!==o||t[20]!==u||t[21]!==m||t[22]!==g||t[23]!==_?(v=(0,w.jsxs)(`div`,{"data-settings-item":o,className:u,children:[m,g,_]}),t[19]=o,t[20]=u,t[21]=m,t[22]=g,t[23]=_,t[24]=v):v=t[24],v}function ne(e){let t=(0,C.c)(32),{checked:n,onChange:r,label:i,ariaLabel:a,description:o,itemId:s,disabled:c,className:l}=e,u=c!==void 0&&c,d;t[0]!==n||t[1]!==u||t[2]!==r?(d=()=>{u||r(!n)},t[0]=n,t[1]=u,t[2]=r,t[3]=d):d=t[3];let f=d,p=re,m=u?`cursor-not-allowed`:`cursor-pointer`,h;t[4]!==l||t[5]!==m?(h=S(`yuri-settings-group-row yuri-settings-split-row group`,m,l),t[4]=l,t[5]=m,t[6]=h):h=t[6];let g=u?-1:0,_=u||void 0,v,y;t[7]===f?(v=t[8],y=t[9]):(v=e=>{p(e.target)||f()},y=e=>{p(e.target)||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),f())},t[7]=f,t[8]=v,t[9]=y);let b;t[10]===i?b=t[11]:(b=(0,w.jsx)(`span`,{className:`typography-ui-label text-foreground`,children:i}),t[10]=i,t[11]=b);let x;t[12]===o?x=t[13]:(x=o?(0,w.jsx)(`span`,{className:`typography-meta text-muted-foreground`,children:o}):null,t[12]=o,t[13]=x);let T;t[14]!==x||t[15]!==b?(T=(0,w.jsxs)(`div`,{className:`yuri-settings-split-row-copy`,children:[b,x]}),t[14]=x,t[15]=b,t[16]=T):T=t[16];let E;t[17]!==a||t[18]!==n||t[19]!==u||t[20]!==r?(E=(0,w.jsx)(`div`,{"data-settings-value":``,className:`yuri-settings-split-row-control`,children:(0,w.jsx)(ee,{checked:n,onChange:r,disabled:u,ariaLabel:a})}),t[17]=a,t[18]=n,t[19]=u,t[20]=r,t[21]=E):E=t[21];let D;return t[22]!==n||t[23]!==s||t[24]!==T||t[25]!==E||t[26]!==h||t[27]!==g||t[28]!==_||t[29]!==v||t[30]!==y?(D=(0,w.jsxs)(`div`,{"data-settings-item":s,className:h,role:`button`,tabIndex:g,"aria-pressed":n,"aria-disabled":_,onClick:v,onKeyDown:y,children:[T,E]}),t[22]=n,t[23]=s,t[24]=T,t[25]=E,t[26]=h,t[27]=g,t[28]=_,t[29]=v,t[30]=y,t[31]=D):D=t[31],D}function re(e){return e instanceof HTMLElement&&e.closest(`button, a, input, select, textarea`)!==null}var A=e=>{let t=e?.trim();return t?{location:{directory:t}}:void 0},ie=()=>{let e=u.getSdkClient().plugin;if(!e?.list||!e.check||!e.update)throw Error(`OpenCode plugin status is not available`);return e},ae=e=>{switch(e.type){case`package`:return{kind:`package`,target:e.target,version:e.version??null,outdated:e.outdated===!0,updating:e.updating===!0};case`local`:return{kind:`local`,path:e.path};case`builtin`:case`sdk`:return{kind:`builtin`};default:throw Error(`Unexpected plugin source: ${JSON.stringify(e)}`)}},oe=e=>{if(e.status===`active`)return{kind:`active`};if(e.status===`failed`)return{kind:`failed`,error:e.error,ref:e.ref??null};throw Error(`Unexpected plugin state: ${JSON.stringify(e)}`)},se=e=>({source:ae(e.source),state:oe(e.state)}),ce=e=>{if(!Array.isArray(e))throw Error(`OpenCode plugin status payload is invalid`);return e.map(e=>se(e))};async function j(e,t){return ce((await ie().list(A(e),t?{signal:t}:void 0))?.data)}async function le(e,t,n){let r=t.trim();if(!r)throw Error(`plugin.update requires a target`);await ie().update({...A(e),targets:[r]},n?{signal:n}:void 0)}function ue(e){return e instanceof Error&&e.message.trim()?e.message:typeof e==`string`&&e.trim()?e:`plugin operation failed`}var de=1500,M=e=>e?.trim()||null,N=(t,n=e())=>m.plugins.list(t,n),P=(t,n,r=!1,i=e())=>m.plugins.registry(t,n,r,i),F=(t,n=e())=>m.plugins.runtime(t,n),I=0,L=()=>(I+=1,I),R=(e,t,n)=>e.getQueryData(F(t,n)),z=(t=y(),n=e(),r)=>{let i=r?t??r.location.directory:M(t),a=_(r);return{queryKey:a.key(N(i,n)),queryFn:async({signal:e})=>{let t=await a.fetch(_e(`/api/config/plugins`,i),{headers:U(i),signal:e});if(!t.ok)throw Error(`Failed to load plugins`);let n=await t.json();return a.assertCurrent(e),{entries:n.entries??[],files:n.files??[]}},staleTime:5e3,retry:2}},B=(t,r,i=!1,a=e(),o=!1)=>{let s=M(t),c=h(r);return{queryKey:o?[...P(s,c,i,a),`details`]:P(s,c,i,a),queryFn:async({signal:e})=>{let t={};for(let r of ye(c)){let a=ve(r,i,s),c=await n(o?`${a}&details=true`:a,{headers:U(s),signal:e});if(!c.ok)throw Error(`Failed to load plugin registry info`);let l=await c.json();for(let e of l.results??[])t[e.spec]=e}return t},staleTime:i?0:3e5,retry:2}},fe=(t=y(),n=e(),r)=>{let i=r?t??r.location.directory:M(t),a=_(r);return{queryKey:a.key(F(i,n)),queryFn:async({signal:e})=>{if(r){let t=await r.sdk().plugin.list({location:{directory:i??r.location.directory}},{signal:e});if(a.assertCurrent(e),!Array.isArray(t.data))throw Error(`Failed to load remote plugin runtime`);return t.data.map(e=>({source:e.source.type===`package`?{kind:`package`,target:e.source.target,version:e.source.version??null,outdated:e.source.outdated===!0,updating:e.source.updating===!0}:e.source.type===`local`?{kind:`local`,path:e.source.path}:{kind:`builtin`},state:e.state.status===`failed`?{kind:`failed`,error:e.state.error,ref:e.state.ref??null}:{kind:`active`}}))}let t=L(),o=await j(i,e);if(t!==I){let e=R(g,i,n);if(e)return e;throw Error(`Stale plugin runtime read`)}return o},staleTime:5e3,retry:!1}},pe=e=>{let t=(0,C.c)(11),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let r=n,i=p(),a=b(be),o;t[2]!==a||t[3]!==i?.entry.location.directory?(o=i?.entry.location.directory??M(a)??M(u.getDirectory()),t[2]=a,t[3]=i?.entry.location.directory,t[4]=o):o=t[4];let s=i?.entry,c;t[5]!==o||t[6]!==s?(c=z(o,void 0,s),t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==r.enabled||t[9]!==c?(l={...c,enabled:r.enabled},t[8]=r.enabled,t[9]=c,t[10]=l):l=t[10],f(l)},me=(e,t)=>{let n=(0,C.c)(6),r=t!==void 0&&t,i=b(xe),a;n[0]!==i||n[1]!==r||n[2]!==e?(a=B(M(i)??M(u.getDirectory()),e,r),n[0]=i,n[1]=r,n[2]=e,n[3]=a):a=n[3];let o;return n[4]===a?o=n[5]:(o={...a},n[4]=a,n[5]=o),f(o)},V=()=>{let e=(0,C.c)(2),t=b(Se),n;return e[0]===t?n=e[1]:(n=M(t)??M(u.getDirectory()),e[0]=t,e[1]=n),n},he=e=>{let t=(0,C.c)(8),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let r=n,i=p(),a=V(),o=i?.entry.location.directory??a,s=i?.entry,c;t[2]!==o||t[3]!==s?(c=fe(o,void 0,s),t[2]=o,t[3]=s,t[4]=c):c=t[4];let l;return t[5]!==r.enabled||t[6]!==c?(l={...c,enabled:r.enabled},t[5]=r.enabled,t[6]=c,t[7]=l):l=t[7],f(l)},H=async(t,n,r)=>{let i=M(n);return e()===r?t.fetchQuery({...z(i,r),staleTime:0}):t.getQueryData(N(i,r))??{entries:[],files:[]}},ge=async(t,n,r)=>{let i=M(n);if(e()!==r)return R(t,i,r);let a=L(),o=await j(i);return a!==I||e()!==r?R(t,i,r):(t.setQueryData(F(i,r),o),o)};function _e(e,t){return`${e}${t?`?directory=${encodeURIComponent(t)}`:``}`}function ve(e,t,n){let r=new URLSearchParams;t&&r.set(`refresh`,`true`),n&&r.set(`directory`,n);let i=r.toString();return`/api/config/plugins/registry?${`specs=${e.map(encodeURIComponent).join(`,`)}`}${i?`&${i}`:``}`}function ye(e){let t=[],n=[],r=0;for(let i of e){let e=encodeURIComponent(i),a=n.length===0?e.length:r+1+e.length;if(n.length>0&&a>de){t.push(n),n=[i],r=e.length;continue}n.push(i),r=a}return n.length>0&&t.push(n),t}function U(e){return e?{"x-opencode-directory":e}:void 0}function be(e){return e.getActiveProject?.()?.path??null}function xe(e){return e.getActiveProject?.()?.path??null}function Se(e){return e.getActiveProject?.()?.path??null}var W=()=>{try{let e=b.getState().getActiveProject?.();if(e?.path?.trim())return e.path.trim();let t=u.getDirectory();if(t?.trim())return t.trim()}catch(e){console.warn(`[PluginsStore] Error resolving config directory:`,e)}return null},Ce=5e3,we=`__default__`,G=new Map,K=new Map,Te=1500,q=e=>e?.trim()||we,Ee=e=>{G.delete(q(e))},J=r()(a(i((r,i)=>({entries:[],files:[],selectedId:null,isLoading:!1,registryInfo:{},isLoadingRegistry:!1,draft:null,setSelected:e=>r({selectedId:e}),setDraft:e=>r({draft:e}),loadPlugins:async n=>{let a=W(),o=e(),s=t(),c=()=>o===e()&&s===t()&&a===W(),l=q(a),u=Date.now(),d=G.get(l)??0,f=i().entries.length>0||i().files.length>0;if(!n?.force&&f&&u-d<Ce)return!0;let p=K.get(l);if(!n?.force&&p)return p;let m=(async()=>{r({isLoading:!0});try{let e=n?.force?await H(g,a,o):await g.fetchQuery(z(a,o));return c()?(r({entries:e.entries??[],files:e.files??[],isLoading:!1}),G.set(l,Date.now()),n?.force||i().loadRegistryInfo(),!0):!1}catch(e){return console.error(`[PluginsStore] Failed to load plugins:`,e),c()&&r({isLoading:!1}),!1}})();K.set(l,m);try{return await m}finally{K.delete(l)}},loadRegistryInfo:async e=>{let t=Oe(e?.specs??i().entries.map(e=>e.spec));if(t.length===0){r({isLoadingRegistry:!1});return}r({isLoadingRegistry:!0});try{let a=W(),o={...i().registryInfo};for(let r of ke(t)){let t=await n(De(r,e?.force===!0,a),{headers:X(a)});if(!t.ok)throw Error(`Failed to load plugin registry info`);let i=await $(t);for(let e of i.results??[])o[e.spec]=e}r({registryInfo:o,isLoadingRegistry:!1})}catch(e){console.error(`[PluginsStore] Failed to load plugin registry info:`,e),r({isLoadingRegistry:!1})}},updateToLatest:async e=>{let t=i().entries.find(t=>t.id===e);if(!t)return{ok:!1};let n=i().registryInfo[t.spec];return!n||n.kind!==`npm-ok`||!n.hasUpdate||!n.latestVersion?{ok:!1}:await i().updateEntry(e,{spec:`${n.name}@${n.latestVersion}`})},createEntry:async e=>{let t=await Q(async t=>await n(Y(`/api/config/plugins/entry`,t),{method:`POST`,headers:Z(t),body:JSON.stringify(Ae(e))}));return t.ok&&i().loadRegistryInfo({specs:[e.spec],force:!0}),t},updateEntry:async(t,r)=>{let a=(g.getQueryData(z(W(),e()).queryKey)?.entries??i().entries).find(e=>e.id===t),o=a?.spec,s=r.spec??o,c=await Q(async e=>await n(Y(`/api/config/plugins/entry/${encodeURIComponent(t)}`,e),{method:`PATCH`,headers:Z(e),body:JSON.stringify(Ae(r))}),a&&s?{...a,spec:s}:void 0);return c.ok&&s&&i().loadRegistryInfo({specs:[s],force:!0}),c},deleteEntry:async e=>{let t=i().entries.find(t=>t.id===e),a=await Q(async t=>await n(Y(`/api/config/plugins/entry/${encodeURIComponent(e)}`,t),{method:`DELETE`,headers:X(t)}));if(a.ok&&i().selectedId===e&&r({selectedId:null}),a.ok&&t){let e={...i().registryInfo};delete e[t.spec],r({registryInfo:e})}return a},readFile:async e=>{try{let t=W(),r=await n(Y(`/api/config/plugins/file/${encodeURIComponent(e)}`,t),{headers:X(t)});if(!r.ok)throw Error(`Failed to read plugin file`);return await $(r)}catch(e){return console.error(`[PluginsStore] Failed to read plugin file:`,e),null}},createFile:async e=>Q(async t=>await n(Y(`/api/config/plugins/file`,t),{method:`POST`,headers:Z(t),body:JSON.stringify(e)})),updateFile:async(e,t)=>Q(async r=>await n(Y(`/api/config/plugins/file/${encodeURIComponent(e)}`,r),{method:`PUT`,headers:Z(r),body:JSON.stringify(t)})),deleteFile:async e=>{let t=await Q(async t=>await n(Y(`/api/config/plugins/file/${encodeURIComponent(e)}`,t),{method:`DELETE`,headers:X(t)}));return t.ok&&i().selectedId===e&&r({selectedId:null}),t},getById:e=>i().entries.find(t=>t.id===e)??i().files.find(t=>t.id===e)}),{name:`plugins-store`,storage:l(),partialize:e=>({selectedId:e.selectedId})}),{name:`plugins-store`}));function Y(e,t){return`${e}${t?`?directory=${encodeURIComponent(t)}`:``}`}function De(e,t,n){let r=new URLSearchParams;t&&r.set(`refresh`,`true`),n&&r.set(`directory`,n);let i=r.toString();return`/api/config/plugins/registry?${`specs=${e.map(encodeURIComponent).join(`,`)}`}${i?`&${i}`:``}`}function Oe(e){return Array.from(new Set(e.map(e=>e.trim()).filter(Boolean)))}function ke(e){let t=[],n=[],r=0;for(let i of e){let e=encodeURIComponent(i),a=n.length===0?e.length:r+1+e.length;n.length>0&&a>Te?(t.push(n),n=[i],r=e.length):(n.push(i),r=a)}return n.length>0&&t.push(n),t}function X(e){return e?{"x-opencode-directory":e}:void 0}function Z(e){return{"Content-Type":`application/json`,...e?{"x-opencode-directory":e}:{}}}function Ae(e){let t={};return e.spec!==void 0&&(t.spec=e.spec),e.options!==void 0&&(t.options=e.options),e.scope!==void 0&&(t.scope=e.scope),t}async function Q(n,r){let i=e(),a=t();try{let o=W(),s=await n(o),c=await $(s).catch(()=>null);if(!s.ok)throw Error(c?.error||`Failed to update plugin configuration`);if(i!==e()||a!==t())return{ok:!0};Ee(o);let l=await H(g,o,i);if(o===W()&&i===e()&&a===t()){let e=r&&J.getState().selectedId===r.id?l.entries.find(e=>e.spec===r.spec&&e.scope===r.scope&&e.sourcePath===r.sourcePath):void 0;J.setState({entries:l.entries,files:l.files,...e?{selectedId:e.id}:{}}),G.set(q(o),Date.now())}return{ok:!0,reloadFailed:c?.reloadFailed===!0,message:c?.message,warning:c?.warning}}catch(e){return console.error(`[PluginsStore] Failed to update plugin configuration:`,e),{ok:!1}}}async function $(e){return await e.json()}export{V as a,pe as c,te as d,O as f,ee as g,D as h,ge as i,ue as l,ne as m,B as n,me as o,k as p,z as r,he as s,J as t,le as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{st as t}from"./vendor-base-ui-fom6orB6.js";import{E as n,R as r,V as i}from"./runtime-file-resource-CKQQEwNv.js";import{r as a}from"./terminalApi-CwTOFYhX.js";import{$n as o}from"./useMobileNavigationStore-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{st as t}from"./vendor-base-ui-fom6orB6.js";import{E as n,R as r,V as i}from"./runtime-file-resource-CKQQEwNv.js";import{r as a}from"./terminalApi-CwTOFYhX.js";import{$n as o}from"./useMobileNavigationStore-oveTY29a.js";import{n as s}from"./useEffectiveDirectory-BN5qbhev.js";var c=e(t(),1);function l(){return s()}function u(){let e=i(),t=n(),s=t?.entry.location.hostId?t.entry:void 0,l=(0,c.useMemo)(()=>{if(!s)return null;let e,t=!1,n=()=>{if(t)throw new DOMException(`Project terminal owner ended`,`AbortError`);return e??=a(s)};return{files:r(s),git:o(s),terminal:{createSession:e=>n().createTerminalSession(e),restartSession:(e,t)=>n().restartTerminalSession(e,t),connect:(e,t,r)=>({close:n().connectTerminalStream(e,t.onEvent,t.onError,{maxRetries:r?.retry?.maxRetries,initialRetryDelay:r?.retry?.initialDelayMs,maxRetryDelay:r?.retry?.maxDelayMs,connectionTimeout:r?.connectionTimeoutMs})}),sendInput:(e,t)=>n().sendTerminalInput(e,t),resize:async({sessionId:e,cols:t,rows:r})=>{await n().resizeTerminal(e,t,r)},close:e=>n().closeTerminal(e)},activate:()=>{t=!1},dispose:()=>{t=!0,e?.dispose(),e=void 0}}},[s]);return(0,c.useEffect)(()=>(l?.activate(),()=>l?.dispose()),[l]),(0,c.useMemo)(()=>l?{...e,files:l.files,git:l.git,terminal:l.terminal,github:void 0,editor:void 0,projectScope:s}:{...e,projectScope:void 0},[e,l,s])}export{u as n,l as t};
|
package/dist/assets/{useStreamingTextThrottle-DAr0FPKI.js → useStreamingTextThrottle-BOvHQRrH.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./platform-CiUKDeXd.js";import{st as n}from"./vendor-base-ui-fom6orB6.js";import{r}from"./FadeInOnReveal-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./platform-CiUKDeXd.js";import{st as n}from"./vendor-base-ui-fom6orB6.js";import{r}from"./FadeInOnReveal-4E61VUmD.js";var i=e(n(),1),a=(e,t,n)=>{let r=t-e;return Math.max(0,n-r)},o=e=>{e.timer&&=(clearTimeout(e.timer),null)},s=({text:e,isStreaming:n,throttleMs:s=r(t()).textThrottleMs,identityKey:c})=>{let[l,u]=i.useState(e),d=i.useRef(e),f=i.useRef(l),p=i.useRef({timer:null,pendingText:e,lastEmitAt:0});return i.useEffect(()=>{d.current=e},[e]),i.useEffect(()=>{f.current=l},[l]),i.useEffect(()=>{let e=p.current;o(e),e.pendingText=d.current,e.lastEmitAt=0,u(d.current)},[c]),i.useEffect(()=>{let t=p.current;t.pendingText=e;let r=f.current,i=n&&r.length>e.length?r:e;if(!n){o(t),t.lastEmitAt=Date.now(),u(i);return}let c=Date.now(),l=a(t.lastEmitAt,c,s);if(l<=0){o(t),t.lastEmitAt=c,u(i);return}return o(t),t.timer=setTimeout(()=>{t.timer=null,t.lastEmitAt=Date.now(),u(e=>n&&e.length>t.pendingText.length?e:t.pendingText)},l),()=>{o(t)}},[n,e,s]),i.useEffect(()=>{let e=p.current;return()=>{o(e)}},[]),l};export{s as t};
|
package/dist/index.html
CHANGED
|
@@ -571,7 +571,7 @@
|
|
|
571
571
|
opacity: 0.72;
|
|
572
572
|
}
|
|
573
573
|
</style>
|
|
574
|
-
<script type="module" crossorigin src="/assets/main-
|
|
574
|
+
<script type="module" crossorigin src="/assets/main-_RMi6lwy.js"></script>
|
|
575
575
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
|
|
576
576
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
577
577
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
@@ -608,13 +608,13 @@
|
|
|
608
608
|
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-BgUDBfaJ.js">
|
|
609
609
|
<link rel="modulepreload" crossorigin href="/assets/terminalApi-CwTOFYhX.js">
|
|
610
610
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-DxL4XbME.js">
|
|
611
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
612
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
613
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
611
|
+
<link rel="modulepreload" crossorigin href="/assets/types-CnPxR5yQ.js">
|
|
612
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-vj-M8YQp.js">
|
|
613
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-JMwpif8a.js">
|
|
614
614
|
<link rel="modulepreload" crossorigin href="/assets/runtime-ead7P81A.js">
|
|
615
615
|
<link rel="modulepreload" crossorigin href="/assets/bootstrap-eLlfzqAI.js">
|
|
616
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
617
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
616
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CPU1CoUI.js">
|
|
617
|
+
<link rel="stylesheet" crossorigin href="/assets/src-2lmG4z55.css">
|
|
618
618
|
</head>
|
|
619
619
|
<body class="h-full bg-background text-foreground">
|
|
620
620
|
<!-- Keep the startup layer outside #root. React replaces every child of
|
package/dist/mini-chat.html
CHANGED
|
@@ -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-
|
|
80
|
+
<script type="module" crossorigin src="/assets/miniChat-CEE6OnLk.js"></script>
|
|
81
81
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
83
83
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
@@ -114,13 +114,13 @@
|
|
|
114
114
|
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-BgUDBfaJ.js">
|
|
115
115
|
<link rel="modulepreload" crossorigin href="/assets/terminalApi-CwTOFYhX.js">
|
|
116
116
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-DxL4XbME.js">
|
|
117
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
118
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
119
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
117
|
+
<link rel="modulepreload" crossorigin href="/assets/types-CnPxR5yQ.js">
|
|
118
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-vj-M8YQp.js">
|
|
119
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-JMwpif8a.js">
|
|
120
120
|
<link rel="modulepreload" crossorigin href="/assets/runtime-ead7P81A.js">
|
|
121
121
|
<link rel="modulepreload" crossorigin href="/assets/bootstrap-eLlfzqAI.js">
|
|
122
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
123
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
122
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CPU1CoUI.js">
|
|
123
|
+
<link rel="stylesheet" crossorigin href="/assets/src-2lmG4z55.css">
|
|
124
124
|
</head>
|
|
125
125
|
<body class="h-full bg-background text-foreground">
|
|
126
126
|
<div id="root" class="h-full">
|
package/dist/mobile.html
CHANGED
|
@@ -64,11 +64,11 @@
|
|
|
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-
|
|
67
|
+
<script type="module" crossorigin src="/assets/mobile-Cc6EYN5S.js"></script>
|
|
68
68
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
|
|
69
69
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
70
70
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
71
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
71
|
+
<link rel="stylesheet" crossorigin href="/assets/src-2lmG4z55.css">
|
|
72
72
|
</head>
|
|
73
73
|
<body class="h-full bg-background text-foreground">
|
|
74
74
|
<div id="root" class="h-full">
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkstreamRendererImpl-B1ALcl04.js","assets/rolldown-runtime-hePW80VL.js","assets/platform-CiUKDeXd.js","assets/runtime-auth-DA-qfGHk.js","assets/runtime-switch-DEPKHgdL.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-base-ui-fom6orB6.js","assets/vendor-react-D5BntRmA.js","assets/runtime-file-resource-CKQQEwNv.js","assets/runtime-fetch-V-iMWR8t.js","assets/reasoning-projection-client-BEhVknv9.js","assets/vendor-tanstack-query-core-BSjXNgF_.js","assets/vendor-tanstack-react-query-ChSd65dm.js","assets/path-utils-jGozTg9d.js","assets/vendor-reactuses-core-B8s-Rcd-.js","assets/vendor-lodash-es-BS45jPoZ.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/runtime-file-store-BVRgEtI-.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/useUIStore-DjizmHAt.js","assets/vendor-zustand-CNn3HHhT.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/safeStorage-DTOhKN0V.js","assets/useMobileHtmlPreviewStore-DzzgY1eS.js","assets/vendor-markstream-react-Cwc-VXWM.js","assets/vendor-markstream-core-Cm34iPLL.js","assets/vendor-floating-ui-dom-BHhLtF5l.js","assets/vendor-floating-ui-core-Co1I1lFV.js","assets/useMobileNavigationStore-BtHQN423.js","assets/gitApiHttp-BgUDBfaJ.js","assets/client-CzjApAA4.js","assets/vendor-opencode-client-BM2r1f0o.js","assets/vendor-effect-X1Hqc7ba.js","assets/prompt-attachment-upload-Bem87nmm.js","assets/uuid-D-SDZijH.js","assets/vendor-sonner-Y-KPX915.js","assets/i18n-BvjeIWrT.js","assets/runtime-ead7P81A.js","assets/bootstrap-eLlfzqAI.js","assets/store-Dj5cSf8B.js","assets/tour-CMXP3Kif.js","assets/useAssistantUIStore-CI42fWZh.js","assets/input-store-wWToFdzi.js","assets/remoteProjectQueries-yX3kOkR6.js","assets/vendor-zod-DZzbCm1s.js","assets/vendor-opencode-schema-DWT45VBX.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/toolHelpers-iEHVHQ9p.js","assets/useThemeSystem-D2YBbLma.js","assets/vendor-framer-motion-DiGWHm7K.js","assets/tooltip-B93KmoPh.js","assets/useEffectiveDirectory-DFe0GivQ.js","assets/image-loading-Dlh4FIPJ.js","assets/image-loading-DA9JEHD8.css","assets/LoadingImage-DNt-_HCJ.js","assets/ImageLoadingPlaceholder-EHe_20yz.js","assets/FadeInOnReveal-CIabuv8E.js","assets/markdownHeightCache-CaBnqn2C.js","assets/dualLimitLru-D8Sphgua.js","assets/useStreamingTextThrottle-DAr0FPKI.js","assets/MarkdownRendererImpl-CxfAdy1l.js","assets/vendor-katex-DNVSTX6g.js","assets/themes-BgDJcxRc.js","assets/vendor-marked-S3gCOYp1.js","assets/markdownTheme-C2LJ3cJo.js","assets/vendor-pierre-diffs-HJfPTtu2.js","assets/vendor-hast-util-to-html-Bw_SgZ1t.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-BMOrLc9L.js","assets/markdown-worker-oBGEB9Eg.js","assets/vendor-morphdom-BbKiNDAu.js","assets/vendor-dompurify-CeJNOzik.js","assets/vendor-pele-C1WTNWUm.js","assets/vendor-remend-C3cXc-tf.js","assets/fileReferenceActions-DLTUzjwi.js","assets/fileReferenceParser-1HHDBUum.js","assets/MarkstreamRendererImpl-C6aiJnjl.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{a as t}from"./vendor-zustand-CNn3HHhT.js";import{ot as n,st as r}from"./vendor-base-ui-fom6orB6.js";import"./brand-storage-bootstrap-D4BW3w-M.js";import{n as i}from"./vendor-react-D5BntRmA.js";import{o as a}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{Rn as o}from"./useMobileNavigationStore-BtHQN423.js";import{t as s}from"./useEffectiveDirectory-DFe0GivQ.js";import{i as c,n as l,t as u}from"./markdownHeightCache-CaBnqn2C.js";var d=e(r(),1),f=i(),p=(e,t)=>{try{let n=t??(typeof localStorage>`u`?null:localStorage);return!n||n.getItem(e)!==`0`}catch{return!0}},m=(e,t)=>{try{typeof localStorage<`u`&&localStorage.setItem(e,t?`1`:`0`)}catch{}},h=`yuri:markstream-react`,g=e=>p(h,e),_=t(e=>({markstreamReactEnabled:g(),setMarkstreamReactEnabled:t=>{m(h,t),e({markstreamReactEnabled:t})}})),v=null,y=()=>(v??=a(()=>import(`./MarkstreamRendererImpl-B1ALcl04.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85])).catch(e=>{throw v=null,e}),v),b=()=>{y().catch(()=>void 0)},x=null,S=()=>(x??=a(()=>import(`./MarkdownRendererImpl-CxfAdy1l.js`).then(e=>e.n),__vite__mapDeps([63,1,4,3,2,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,64,38,39,40,41,42,30,31,32,33,34,35,36,37,43,44,45,46,47,48,49,50,61,51,65,54,55,56,59,60,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84])).catch(e=>{throw x=null,e}),x),C=()=>{S().catch(()=>void 0),g()&&b()},w=`yuri:chunk-import-reload`,T=250,E=3e4,D=[/Importing a module script failed/i,/Failed to fetch dynamically imported module/i,/error loading dynamically imported module/i,/Loading chunk \S+ failed/i,/ChunkLoadError/i];function O(e){if(e instanceof Error)return`${e.name}\n${e.message}\n${e.stack??``}`;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function k(e){let t=O(e);return D.some(e=>e.test(t))}function A(e){return`0.3.2:${O(e).slice(0,500)}`}function j(e){if(typeof window>`u`)return;let t=Date.now(),n=A(e),r=null;try{let e=window.sessionStorage.getItem(w);if(e)try{r=JSON.parse(e)}catch{r=null}}catch{return}let i=typeof r?.timestamp==`number`?r.timestamp:0;if(!(r?.signature===n&&t-i<E)){try{window.sessionStorage.setItem(w,JSON.stringify({signature:n,timestamp:t}))}catch{return}console.error(`[refresh-debug] chunk-import-reload`,{error:O(e).slice(0,1e3)}),window.setTimeout(()=>{window.location.reload()},0)}}async function M(e,t={}){let n=t.retries??1,r;for(let t=0;t<=n;t+=1)try{return await e()}catch(e){if(r=e,!k(e)||t>=n)break;await new Promise(e=>setTimeout(e,T*(t+1)))}throw k(r)&&j(r),r}var N=e=>(0,d.lazy)(()=>M(e)),P=(e,t)=>!!t?.toLowerCase().startsWith(`video/`)||/^data:video\//i.test(e)||/\.(?:mp4|m4v|webm|mov|ogv|ogg)(?:[?#]|$)/i.test(e),F=class extends d.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){console.warn(`[markstream-react] falling back to the current Markdown renderer`,e)}render(){return this.state.hasError?this.props.fallback:this.props.children}},I=d.createContext(!0),L=()=>d.useContext(I),R=n(),z=N(()=>S().then(e=>({default:e.MarkdownRenderer}))),B=N(()=>y().then(e=>({default:e.MarkstreamRenderer}))),V=N(()=>S().then(e=>({default:e.SimpleMarkdownRenderer}))),H=e=>e===`tool`?`markdown-content markdown-tool`:e===`reasoning`?`markdown-content markdown-reasoning`:`markdown-content leading-relaxed`,U=e=>{let t=(0,f.c)(15),n=_(K),r=typeof e.content==`string`?e.content:``,i=typeof e.variant==`string`?e.variant:`assistant`,a;t[0]!==r||t[1]!==n||t[2]!==e.reserveMeasuredHeight||t[3]!==i?(a=e.reserveMeasuredHeight?l(u(r,n?`markstream:${i}`:i)):void 0,t[0]=r,t[1]=n,t[2]=e.reserveMeasuredHeight,t[3]=i,t[4]=a):a=t[4];let s=a,d;t[5]!==e.className||t[6]!==e.variant?(d=o(`relative break-words w-full min-w-0`,H(e.variant),typeof e.className==`string`?e.className:void 0),t[5]=e.className,t[6]=e.variant,t[7]=d):d=t[7];let p;t[8]!==r||t[9]!==e.animated||t[10]!==s?(p=(0,R.jsx)(c,{animated:e.animated,content:r,reservedHeight:s}),t[8]=r,t[9]=e.animated,t[10]=s,t[11]=p):p=t[11];let m;return t[12]!==d||t[13]!==p?(m=(0,R.jsx)(`div`,{className:d,"aria-busy":`true`,"data-markdown-hydration":`deferred`,"data-markdown-ready":`false`,children:p}),t[12]=d,t[13]=p,t[14]=m):m=t[14],m},W=e=>{let t=(0,f.c)(13),n=L(),r=_(q);if(!n&&e.isStreaming!==!0){let n;return t[0]===e?n=t[1]:(n=(0,R.jsx)(U,{...e,animated:!1,reserveMeasuredHeight:!0}),t[0]=e,t[1]=n),n}let i;t[2]===e?i=t[3]:(i=(0,R.jsx)(d.Suspense,{fallback:(0,R.jsx)(U,{...e,reserveMeasuredHeight:!0}),children:(0,R.jsx)(z,{...e})}),t[2]=e,t[3]=i);let a=i,o;t[4]!==a||t[5]!==r||t[6]!==e?(o=r?(0,R.jsx)(F,{fallback:a,children:(0,R.jsx)(d.Suspense,{fallback:(0,R.jsx)(U,{...e,reserveMeasuredHeight:!0}),children:(0,R.jsx)(B,{...e})})}):a,t[4]=a,t[5]=r,t[6]=e,t[7]=o):o=t[7];let c=o,l;t[8]===e?l=t[9]:(l=t=>{if(!e.onShowPopup||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let n=t.target instanceof Element?t.target.closest(`a[href]`):null,r=n?.getAttribute(`href`);if(!r||!P(r))return;t.preventDefault(),t.stopPropagation();let i=n?.textContent?.trim()||r.split(/[/?#]/).filter(Boolean).pop()||r;e.onShowPopup({open:!0,title:i,content:``,video:{url:r,filename:i,directory:s()??``}})},t[8]=e,t[9]=l);let u;return t[10]!==c||t[11]!==l?(u=(0,R.jsx)(`div`,{className:`contents`,onClickCapture:l,children:c}),t[10]=c,t[11]=l,t[12]=u):u=t[12],u},G=e=>{let t=(0,f.c)(4);if(!L()){let n;return t[0]===e?n=t[1]:(n=(0,R.jsx)(U,{...e,animated:!1}),t[0]=e,t[1]=n),n}let n;return t[2]===e?n=t[3]:(n=(0,R.jsx)(d.Suspense,{fallback:(0,R.jsx)(U,{...e}),children:(0,R.jsx)(V,{...e})}),t[2]=e,t[3]=n),n};function K(e){return e.markstreamReactEnabled}function q(e){return e.markstreamReactEnabled}export{N as a,P as i,G as n,C as o,I as r,W as t};
|