@yuriai/web 0.2.33 → 0.2.34-beta.3
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/{AssistantContactStatus-BecTSK5f.js → AssistantContactStatus-D3ScljGl.js} +3 -3
- package/dist/assets/{AssistantUnreadBadge-DXBINpQi.js → AssistantUnreadBadge-NkBCB4n9.js} +1 -1
- package/dist/assets/{AssistantView-CsTe7SbK.js → AssistantView-CI2lhkIT.js} +1 -1
- package/dist/assets/{DiagramView-xR1d8Ci2.js → DiagramView-DNQmqZTz.js} +1 -1
- package/dist/assets/{GuiPluginSurface-DWRx9_eT.js → GuiPluginSurface-Da61Xn7x.js} +1 -1
- package/dist/assets/MarkdownRenderer-D-7r0LeT.js +2 -0
- package/dist/assets/{MarkdownRendererImpl-CVuPLz_2.js → MarkdownRendererImpl-yQaid-kp.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-ChHTqL5i.js → MarkstreamRendererImpl-B1S_vvdw.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-CR8A8U_9.js → MobileDetailNavigation-Hd18mJ2l.js} +1 -1
- package/dist/assets/{MobileShareBridge-HTePwQfS.js → MobileShareBridge-CgAoZoO9.js} +1 -1
- package/dist/assets/{MobileTabPageHeader-DefPdEd9.js → MobileTabPageHeader-B9kurLFw.js} +1 -1
- package/dist/assets/{MultiRunWindow-BcZ0T4aM.js → MultiRunWindow-CdUZs6BA.js} +1 -1
- package/dist/assets/{SettingsView-23-CPGGR.js → SettingsView-C0P981Yx.js} +1 -1
- package/dist/assets/{SettingsWindow-BP17xUN4.js → SettingsWindow-Bep47gp_.js} +1 -1
- package/dist/assets/{SetupTourDialog-DpBf7CQD.js → SetupTourDialog-CngeU4Gl.js} +1 -1
- package/dist/assets/{TerminalView-D63MDq0o.js → TerminalView-BRuYIzl6.js} +1 -1
- package/dist/assets/{ToolOutputDialog-GHLioHaB.js → ToolOutputDialog-DvBKkPyY.js} +1 -1
- package/dist/assets/{VoiceSettings-CE3EP3rH.js → VoiceSettings-Bwq3L5vz.js} +1 -1
- package/dist/assets/{appThemeRegistry-CH4WssKX.js → appThemeRegistry-DSbTAzmO.js} +1 -1
- package/dist/assets/{capgoAdapter-Dy6n1WSE.js → capgoAdapter-D9oY9_ut.js} +1 -1
- package/dist/assets/{gitApi-C9-qJDQ6.js → gitApi-DSzxh9dp.js} +1 -1
- package/dist/assets/{insertionBoundaries-DBgOjaGM.js → insertionBoundaries-B_epKOnH.js} +1 -1
- package/dist/assets/{main-C9v4tzOp.js → main-C8bkHEMX.js} +2 -2
- package/dist/assets/{main-DqXuTHzy.js → main-DROYKEfx.js} +5 -5
- package/dist/assets/{mcpQueries-BtTn7vvF.js → mcpQueries-Daeejbnx.js} +1 -1
- package/dist/assets/{miniChat-bbNf-k6A.js → miniChat-CoUl0Vav.js} +2 -2
- package/dist/assets/{mobile-C90aX0Ai.js → mobile-LaGrgSUM.js} +2 -2
- package/dist/assets/{mobileBackNavigation-BdgpYYzc.js → mobileBackNavigation-goIeVVNl.js} +1 -1
- package/dist/assets/{multirun-CXgyUUR_.js → multirun-D_JGy3RU.js} +1 -1
- package/dist/assets/{native-config-Npmx-FHi.js → native-config-BFOCyZg2.js} +1 -1
- package/dist/assets/{projectMeta-Byov-Bf8.js → projectMeta-wNuM5rHW.js} +1 -1
- package/dist/assets/{pwa-BPywK9hc.js → pwa-xGAzXaZv.js} +1 -1
- package/dist/assets/{queue-abort-optimistic-Cd9goCtP.js → queue-abort-optimistic-BGuIwEZM.js} +1 -1
- package/dist/assets/{readiness-Ba0wqXJe.js → readiness-BPbnvr2e.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-Dgj_tRzV.js → renderElectronMiniChatApp-C3T22u2H.js} +2 -2
- package/dist/assets/{renderMobileApp-muVQ8WGb.js → renderMobileApp-DAQsqK1D.js} +7 -7
- package/dist/assets/{runtimeConfig-YOnCHT8o.js → runtimeConfig-DtKtvKA2.js} +1 -1
- package/dist/assets/{runtimeEndpointReset-BkJyMZon.js → runtimeEndpointReset-BwfxkwS0.js} +3 -3
- package/dist/assets/{sessionLookup-BjxeNni8.js → sessionLookup-pYkh3EU2.js} +1 -1
- package/dist/assets/{speechSettingsQueries-CvDICLsw.js → speechSettingsQueries-6Ea0FfKL.js} +1 -1
- package/dist/assets/src-BgE3FRXg.css +2 -0
- package/dist/assets/types-CNECQLeq.js +2 -0
- package/dist/assets/{useAppFontEffects-DoOyrAD1.js → useAppFontEffects-BW8yQWSG.js} +5 -5
- package/dist/assets/{useDesktopWindowControlsLayout-Dnn-eOUA.js → useDesktopWindowControlsLayout-BC2wTKdJ.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-DouDG4ZI.js → useEffectiveDirectory-OJzoI-nH.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-C2mIlnz9.js → useMobileNavigationStore-C8nCzxDH.js} +4 -4
- package/dist/assets/{usePluginsStore-CePF_bcX.js → usePluginsStore-B3584ktF.js} +1 -1
- package/dist/assets/{useWorkerHighlightedLines-D0Nf66Jj.js → useWorkerHighlightedLines-CZlfrVSP.js} +1 -1
- package/dist/index.html +6 -6
- package/dist/mini-chat.html +6 -6
- package/dist/mobile.html +6 -6
- package/package.json +1 -1
- package/server/lib/llm/DOCUMENTATION.md +17 -2
- package/server/lib/llm/bridge-plugin.bundle.js +10 -10
- package/server/lib/llm/bridge-plugin.js +30 -3
- package/server/lib/llm/bridge-plugin.test.js +49 -0
- package/dist/assets/MarkdownRenderer-WSxkmNai.js +0 -2
- package/dist/assets/src-GtPQ8f4o.css +0 -2
- package/dist/assets/types-BkSficP0.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,n as t}from"./runtime-switch-DEZ1K7qW.js";import{n}from"./runtime-fetch-D0YWp3FJ.js";import{a as r,i,r as a}from"./vendor-zustand-vDaAPGfl.js";import{o,ot as s,s as c}from"./vendor-base-ui-CzHs0bHY.js";import{At as l}from"./gitApiHttp-MWsHNHuo.js";import{x as u}from"./useUIStore-BerIUSLP.js";import{n as d}from"./vendor-react-DlzBev0S.js";import{s as f}from"./vendor-tanstack-react-query-B-Wpqq5J.js";import{a as p,i as m,o as h}from"./queryRuntime-2dx7jbt9.js";import{f as g,r as _,t as v}from"./button-C-gRcs_2.js";import{ga as y,va as b}from"./useMobileNavigationStore-C2mIlnz9.js";var x=d(),S=s();function ee(e){let t=(0,x.c)(17),{checked:n,onChange:r,disabled:i,ariaLabel:a,className:s}=e,l=i!==void 0&&i,{t:u}=g(),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=_(`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,S.jsxs)(c,{value:e,nativeButton:!0,render:(0,S.jsx)(v,{variant:`ghost`,size:`xs`}),className:`yuri-settings-switch-option`,children:[n===e&&(0,S.jsx)(`span`,{"aria-hidden":!0,className:`yuri-segmented-selected-pill yuri-settings-switch-pill`}),(0,S.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,S.jsx)(o,{value:n,onValueChange:d,disabled:l,"aria-label":a,"aria-orientation":`horizontal`,"data-slot":`settings-switch`,className:f,onClick:w,onKeyDown:C,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 C(e){return e.stopPropagation()}function w(e){return e.stopPropagation()}function T(e){let t=(0,x.c)(10),{children:n,actions:r,className:i}=e,a;t[0]===i?a=t[1]:(a=_(`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,S.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,S.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,S.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 E(e){let t=(0,x.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=_(`yuri-settings-group`,c),t[0]=c,t[1]=f);let p;t[2]!==r||t[3]!==n||t[4]!==d?(p=r?(0,S.jsx)(T,{className:`py-0`,actions:r,children:n?(0,S.jsx)(`div`,{className:`yuri-settings-group-label`,"data-settings-label-script":d,children:n}):null}):n?(0,S.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=_(`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,S.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,S.jsx)(`p`,{className:`yuri-settings-group-description text-muted-foreground`,children:a}):null,t[13]=a,t[14]=g);let v;return t[15]!==s||t[16]!==f||t[17]!==p||t[18]!==h||t[19]!==g?(v=(0,S.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]=v):v=t[20],v}function D(e){let t=(0,x.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,S.jsx)(O,{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,S.jsx)(E,{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 O(e){let t=(0,x.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=_(`yuri-settings-group-row yuri-settings-split-row`,s),t[0]=s,t[1]=u);let d;t[2]===c?d=t[3]:(d=_(`yuri-settings-split-row-copy`,c),t[2]=c,t[3]=d);let f;t[4]===n?f=t[5]:(f=n?(0,S.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,S.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,S.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=_(`yuri-settings-split-row-control`,l),t[12]=l,t[13]=h);let g;t[14]!==r||t[15]!==h?(g=(0,S.jsx)(`div`,{"data-settings-value":``,className:h,children:r}),t[14]=r,t[15]=h,t[16]=g):g=t[16];let v;t[17]===a?v=t[18]:(v=a?(0,S.jsx)(`div`,{"data-slot":`settings-row-footer`,className:`col-span-full min-w-0`,children:a}):null,t[17]=a,t[18]=v);let y;return t[19]!==o||t[20]!==u||t[21]!==m||t[22]!==g||t[23]!==v?(y=(0,S.jsxs)(`div`,{"data-settings-item":o,className:u,children:[m,g,v]}),t[19]=o,t[20]=u,t[21]=m,t[22]=g,t[23]=v,t[24]=y):y=t[24],y}function te(e){let t=(0,x.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=ne,m=u?`cursor-not-allowed`:`cursor-pointer`,h;t[4]!==l||t[5]!==m?(h=_(`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,v=u||void 0,y,b;t[7]===f?(y=t[8],b=t[9]):(y=e=>{p(e.target)||f()},b=e=>{p(e.target)||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),f())},t[7]=f,t[8]=y,t[9]=b);let C;t[10]===i?C=t[11]:(C=(0,S.jsx)(`span`,{className:`typography-ui-label text-foreground`,children:i}),t[10]=i,t[11]=C);let w;t[12]===o?w=t[13]:(w=o?(0,S.jsx)(`span`,{className:`typography-meta text-muted-foreground`,children:o}):null,t[12]=o,t[13]=w);let T;t[14]!==w||t[15]!==C?(T=(0,S.jsxs)(`div`,{className:`yuri-settings-split-row-copy`,children:[C,w]}),t[14]=w,t[15]=C,t[16]=T):T=t[16];let E;t[17]!==a||t[18]!==n||t[19]!==u||t[20]!==r?(E=(0,S.jsx)(`div`,{"data-settings-value":``,className:`yuri-settings-split-row-control`,children:(0,S.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]!==v||t[29]!==y||t[30]!==b?(D=(0,S.jsxs)(`div`,{"data-settings-item":s,className:h,role:`button`,tabIndex:g,"aria-pressed":n,"aria-disabled":v,onClick:y,onKeyDown:b,children:[T,E]}),t[22]=n,t[23]=s,t[24]=T,t[25]=E,t[26]=h,t[27]=g,t[28]=v,t[29]=y,t[30]=b,t[31]=D):D=t[31],D}function ne(e){return e instanceof HTMLElement&&e.closest(`button, a, input, select, textarea`)!==null}var k=e=>{let t=e?.trim();return t?{location:{directory:t}}:void 0},A=()=>{let e=l.getSdkClient().plugin;if(!e?.list||!e.check||!e.update)throw Error(`OpenCode plugin status is not available`);return e},re=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)}`)}},ie=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)}`)},ae=e=>({source:re(e.source),state:ie(e.state)}),oe=e=>{if(!Array.isArray(e))throw Error(`OpenCode plugin status payload is invalid`);return e.map(e=>ae(e))};async function j(e,t){return oe((await A().list(k(e),t?{signal:t}:void 0))?.data)}async function se(e,t,n){let r=t.trim();if(!r)throw Error(`plugin.update requires a target`);await A().update({...k(e),targets:[r]},n?{signal:n}:void 0)}function ce(e){return e instanceof Error&&e.message.trim()?e.message:typeof e==`string`&&e.trim()?e:`plugin operation failed`}var le=1500,M=e=>e?.trim()||null,N=(t,n=e())=>h.plugins.list(t,n),P=(t,n,r=!1,i=e())=>h.plugins.registry(t,n,r,i),F=(t,n=e())=>h.plugins.runtime(t,n),I=0,L=()=>(I+=1,I),R=(e,t,n)=>e.getQueryData(F(t,n)),z=(t=y(),r=e())=>{let i=M(t);return{queryKey:N(i,r),queryFn:async({signal:e})=>{let t=await n(he(`/api/config/plugins`,i),{headers:U(i),signal:e});if(!t.ok)throw Error(`Failed to load plugins`);let r=await t.json();return{entries:r.entries??[],files:r.files??[]}},staleTime:5e3,retry:2}},B=(t,r,i=!1,a=e(),o=!1)=>{let s=M(t),c=m(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 _e(c)){let a=ge(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}},ue=(t=y(),n=e())=>{let r=M(t);return{queryKey:F(r,n),queryFn:async({signal:e})=>{let t=L(),i=await j(r,e);if(t!==I){let e=R(p,r,n);if(e)return e;throw Error(`Stale plugin runtime read`)}return i},staleTime:5e3,retry:!1}},de=e=>{let t=(0,x.c)(7),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let r=n,i=b(ve),a;t[2]===i?a=t[3]:(a=z(M(i)??M(l.getDirectory())),t[2]=i,t[3]=a);let o;return t[4]!==r.enabled||t[5]!==a?(o={...a,enabled:r.enabled},t[4]=r.enabled,t[5]=a,t[6]=o):o=t[6],f(o)},fe=(e,t)=>{let n=(0,x.c)(6),r=t!==void 0&&t,i=b(ye),a;n[0]!==i||n[1]!==r||n[2]!==e?(a=B(M(i)??M(l.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,x.c)(2),t=b(be),n;return e[0]===t?n=e[1]:(n=M(t)??M(l.getDirectory()),e[0]=t,e[1]=n),n},pe=e=>{let t=(0,x.c)(7),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let r=n,i=V(),a;t[2]===i?a=t[3]:(a=ue(i),t[2]=i,t[3]=a);let o;return t[4]!==r.enabled||t[5]!==a?(o={...a,enabled:r.enabled},t[4]=r.enabled,t[5]=a,t[6]=o):o=t[6],f(o)},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:[]}},me=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 he(e,t){return`${e}${t?`?directory=${encodeURIComponent(t)}`:``}`}function ge(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 _e(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>le){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 ve(e){return e.getActiveProject?.()?.path??null}function ye(e){return e.getActiveProject?.()?.path??null}function be(e){return e.getActiveProject?.()?.path??null}var W=()=>{try{let e=b.getState().getActiveProject?.();if(e?.path?.trim())return e.path.trim();let t=l.getDirectory();if(t?.trim())return t.trim()}catch(e){console.warn(`[PluginsStore] Error resolving config directory:`,e)}return null},xe=5e3,Se=`__default__`,G=new Map,K=new Map,Ce=1500,q=e=>e?.trim()||Se,we=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<xe)return!0;let m=K.get(l);if(!n?.force&&m)return m;let h=(async()=>{r({isLoading:!0});try{let e=n?.force?await H(p,a,o):await p.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,h);try{return await h}finally{K.delete(l)}},loadRegistryInfo:async e=>{let t=Ee(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 De(t)){let t=await n(Te(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(Oe(e))}));return t.ok&&i().loadRegistryInfo({specs:[e.spec],force:!0}),t},updateEntry:async(t,r)=>{let a=(p.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(Oe(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:u(),partialize:e=>({selectedId:e.selectedId})}),{name:`plugins-store`}));function Y(e,t){return`${e}${t?`?directory=${encodeURIComponent(t)}`:``}`}function Te(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 Ee(e){return Array.from(new Set(e.map(e=>e.trim()).filter(Boolean)))}function De(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>Ce?(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 Oe(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};we(o);let l=await H(p,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,de as c,D as d,E as f,ee as g,T as h,me as i,ce as l,te as m,B as n,fe as o,O as p,z as r,pe as s,J as t,se as u};
|
|
1
|
+
import{i as e,n as t}from"./runtime-switch-DEZ1K7qW.js";import{n}from"./runtime-fetch-D0YWp3FJ.js";import{a as r,i,r as a}from"./vendor-zustand-vDaAPGfl.js";import{o,ot as s,s as c}from"./vendor-base-ui-CzHs0bHY.js";import{At as l}from"./gitApiHttp-MWsHNHuo.js";import{x as u}from"./useUIStore-BerIUSLP.js";import{n as d}from"./vendor-react-DlzBev0S.js";import{s as f}from"./vendor-tanstack-react-query-B-Wpqq5J.js";import{a as p,i as m,o as h}from"./queryRuntime-2dx7jbt9.js";import{f as g,r as _,t as v}from"./button-C-gRcs_2.js";import{ga as y,va as b}from"./useMobileNavigationStore-C8nCzxDH.js";var x=d(),S=s();function ee(e){let t=(0,x.c)(17),{checked:n,onChange:r,disabled:i,ariaLabel:a,className:s}=e,l=i!==void 0&&i,{t:u}=g(),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=_(`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,S.jsxs)(c,{value:e,nativeButton:!0,render:(0,S.jsx)(v,{variant:`ghost`,size:`xs`}),className:`yuri-settings-switch-option`,children:[n===e&&(0,S.jsx)(`span`,{"aria-hidden":!0,className:`yuri-segmented-selected-pill yuri-settings-switch-pill`}),(0,S.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,S.jsx)(o,{value:n,onValueChange:d,disabled:l,"aria-label":a,"aria-orientation":`horizontal`,"data-slot":`settings-switch`,className:f,onClick:w,onKeyDown:C,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 C(e){return e.stopPropagation()}function w(e){return e.stopPropagation()}function T(e){let t=(0,x.c)(10),{children:n,actions:r,className:i}=e,a;t[0]===i?a=t[1]:(a=_(`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,S.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,S.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,S.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 E(e){let t=(0,x.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=_(`yuri-settings-group`,c),t[0]=c,t[1]=f);let p;t[2]!==r||t[3]!==n||t[4]!==d?(p=r?(0,S.jsx)(T,{className:`py-0`,actions:r,children:n?(0,S.jsx)(`div`,{className:`yuri-settings-group-label`,"data-settings-label-script":d,children:n}):null}):n?(0,S.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=_(`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,S.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,S.jsx)(`p`,{className:`yuri-settings-group-description text-muted-foreground`,children:a}):null,t[13]=a,t[14]=g);let v;return t[15]!==s||t[16]!==f||t[17]!==p||t[18]!==h||t[19]!==g?(v=(0,S.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]=v):v=t[20],v}function D(e){let t=(0,x.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,S.jsx)(O,{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,S.jsx)(E,{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 O(e){let t=(0,x.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=_(`yuri-settings-group-row yuri-settings-split-row`,s),t[0]=s,t[1]=u);let d;t[2]===c?d=t[3]:(d=_(`yuri-settings-split-row-copy`,c),t[2]=c,t[3]=d);let f;t[4]===n?f=t[5]:(f=n?(0,S.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,S.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,S.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=_(`yuri-settings-split-row-control`,l),t[12]=l,t[13]=h);let g;t[14]!==r||t[15]!==h?(g=(0,S.jsx)(`div`,{"data-settings-value":``,className:h,children:r}),t[14]=r,t[15]=h,t[16]=g):g=t[16];let v;t[17]===a?v=t[18]:(v=a?(0,S.jsx)(`div`,{"data-slot":`settings-row-footer`,className:`col-span-full min-w-0`,children:a}):null,t[17]=a,t[18]=v);let y;return t[19]!==o||t[20]!==u||t[21]!==m||t[22]!==g||t[23]!==v?(y=(0,S.jsxs)(`div`,{"data-settings-item":o,className:u,children:[m,g,v]}),t[19]=o,t[20]=u,t[21]=m,t[22]=g,t[23]=v,t[24]=y):y=t[24],y}function te(e){let t=(0,x.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=ne,m=u?`cursor-not-allowed`:`cursor-pointer`,h;t[4]!==l||t[5]!==m?(h=_(`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,v=u||void 0,y,b;t[7]===f?(y=t[8],b=t[9]):(y=e=>{p(e.target)||f()},b=e=>{p(e.target)||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),f())},t[7]=f,t[8]=y,t[9]=b);let C;t[10]===i?C=t[11]:(C=(0,S.jsx)(`span`,{className:`typography-ui-label text-foreground`,children:i}),t[10]=i,t[11]=C);let w;t[12]===o?w=t[13]:(w=o?(0,S.jsx)(`span`,{className:`typography-meta text-muted-foreground`,children:o}):null,t[12]=o,t[13]=w);let T;t[14]!==w||t[15]!==C?(T=(0,S.jsxs)(`div`,{className:`yuri-settings-split-row-copy`,children:[C,w]}),t[14]=w,t[15]=C,t[16]=T):T=t[16];let E;t[17]!==a||t[18]!==n||t[19]!==u||t[20]!==r?(E=(0,S.jsx)(`div`,{"data-settings-value":``,className:`yuri-settings-split-row-control`,children:(0,S.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]!==v||t[29]!==y||t[30]!==b?(D=(0,S.jsxs)(`div`,{"data-settings-item":s,className:h,role:`button`,tabIndex:g,"aria-pressed":n,"aria-disabled":v,onClick:y,onKeyDown:b,children:[T,E]}),t[22]=n,t[23]=s,t[24]=T,t[25]=E,t[26]=h,t[27]=g,t[28]=v,t[29]=y,t[30]=b,t[31]=D):D=t[31],D}function ne(e){return e instanceof HTMLElement&&e.closest(`button, a, input, select, textarea`)!==null}var k=e=>{let t=e?.trim();return t?{location:{directory:t}}:void 0},A=()=>{let e=l.getSdkClient().plugin;if(!e?.list||!e.check||!e.update)throw Error(`OpenCode plugin status is not available`);return e},re=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)}`)}},ie=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)}`)},ae=e=>({source:re(e.source),state:ie(e.state)}),oe=e=>{if(!Array.isArray(e))throw Error(`OpenCode plugin status payload is invalid`);return e.map(e=>ae(e))};async function j(e,t){return oe((await A().list(k(e),t?{signal:t}:void 0))?.data)}async function se(e,t,n){let r=t.trim();if(!r)throw Error(`plugin.update requires a target`);await A().update({...k(e),targets:[r]},n?{signal:n}:void 0)}function ce(e){return e instanceof Error&&e.message.trim()?e.message:typeof e==`string`&&e.trim()?e:`plugin operation failed`}var le=1500,M=e=>e?.trim()||null,N=(t,n=e())=>h.plugins.list(t,n),P=(t,n,r=!1,i=e())=>h.plugins.registry(t,n,r,i),F=(t,n=e())=>h.plugins.runtime(t,n),I=0,L=()=>(I+=1,I),R=(e,t,n)=>e.getQueryData(F(t,n)),z=(t=y(),r=e())=>{let i=M(t);return{queryKey:N(i,r),queryFn:async({signal:e})=>{let t=await n(he(`/api/config/plugins`,i),{headers:U(i),signal:e});if(!t.ok)throw Error(`Failed to load plugins`);let r=await t.json();return{entries:r.entries??[],files:r.files??[]}},staleTime:5e3,retry:2}},B=(t,r,i=!1,a=e(),o=!1)=>{let s=M(t),c=m(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 _e(c)){let a=ge(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}},ue=(t=y(),n=e())=>{let r=M(t);return{queryKey:F(r,n),queryFn:async({signal:e})=>{let t=L(),i=await j(r,e);if(t!==I){let e=R(p,r,n);if(e)return e;throw Error(`Stale plugin runtime read`)}return i},staleTime:5e3,retry:!1}},de=e=>{let t=(0,x.c)(7),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let r=n,i=b(ve),a;t[2]===i?a=t[3]:(a=z(M(i)??M(l.getDirectory())),t[2]=i,t[3]=a);let o;return t[4]!==r.enabled||t[5]!==a?(o={...a,enabled:r.enabled},t[4]=r.enabled,t[5]=a,t[6]=o):o=t[6],f(o)},fe=(e,t)=>{let n=(0,x.c)(6),r=t!==void 0&&t,i=b(ye),a;n[0]!==i||n[1]!==r||n[2]!==e?(a=B(M(i)??M(l.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,x.c)(2),t=b(be),n;return e[0]===t?n=e[1]:(n=M(t)??M(l.getDirectory()),e[0]=t,e[1]=n),n},pe=e=>{let t=(0,x.c)(7),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let r=n,i=V(),a;t[2]===i?a=t[3]:(a=ue(i),t[2]=i,t[3]=a);let o;return t[4]!==r.enabled||t[5]!==a?(o={...a,enabled:r.enabled},t[4]=r.enabled,t[5]=a,t[6]=o):o=t[6],f(o)},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:[]}},me=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 he(e,t){return`${e}${t?`?directory=${encodeURIComponent(t)}`:``}`}function ge(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 _e(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>le){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 ve(e){return e.getActiveProject?.()?.path??null}function ye(e){return e.getActiveProject?.()?.path??null}function be(e){return e.getActiveProject?.()?.path??null}var W=()=>{try{let e=b.getState().getActiveProject?.();if(e?.path?.trim())return e.path.trim();let t=l.getDirectory();if(t?.trim())return t.trim()}catch(e){console.warn(`[PluginsStore] Error resolving config directory:`,e)}return null},xe=5e3,Se=`__default__`,G=new Map,K=new Map,Ce=1500,q=e=>e?.trim()||Se,we=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<xe)return!0;let m=K.get(l);if(!n?.force&&m)return m;let h=(async()=>{r({isLoading:!0});try{let e=n?.force?await H(p,a,o):await p.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,h);try{return await h}finally{K.delete(l)}},loadRegistryInfo:async e=>{let t=Ee(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 De(t)){let t=await n(Te(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(Oe(e))}));return t.ok&&i().loadRegistryInfo({specs:[e.spec],force:!0}),t},updateEntry:async(t,r)=>{let a=(p.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(Oe(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:u(),partialize:e=>({selectedId:e.selectedId})}),{name:`plugins-store`}));function Y(e,t){return`${e}${t?`?directory=${encodeURIComponent(t)}`:``}`}function Te(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 Ee(e){return Array.from(new Set(e.map(e=>e.trim()).filter(Boolean)))}function De(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>Ce?(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 Oe(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};we(o);let l=await H(p,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,de as c,D as d,E as f,ee as g,T as h,me as i,ce as l,te as m,B as n,fe as o,O as p,z as r,pe as s,J as t,se as u};
|
package/dist/assets/{useWorkerHighlightedLines-D0Nf66Jj.js → useWorkerHighlightedLines-CZlfrVSP.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-CzHs0bHY.js";import{y as r}from"./useUIStore-BerIUSLP.js";import{n as i}from"./vendor-react-DlzBev0S.js";import{f as a,r as o,t as s}from"./button-C-gRcs_2.js";import{n as c}from"./useThemeSystem-CNzUUkFn.js";import{n as l}from"./Icon-OJf0qBKf.js";import{n as u}from"./MarkdownRenderer-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-CzHs0bHY.js";import{y as r}from"./useUIStore-BerIUSLP.js";import{n as i}from"./vendor-react-DlzBev0S.js";import{f as a,r as o,t as s}from"./button-C-gRcs_2.js";import{n as c}from"./useThemeSystem-CNzUUkFn.js";import{n as l}from"./Icon-OJf0qBKf.js";import{n as u}from"./MarkdownRenderer-D-7r0LeT.js";import{n as d,r as f}from"./toolHelpers-iEHVHQ9p.js";import{n as p}from"./markdownTheme-CHNl6tUv.js";import{n as m,t as h}from"./markdown-worker-oBGEB9Eg.js";var g=e(n(),1),_=i(),v=t(),y=e=>e===`in_progress`||e===`completed`||e===`cancelled`?e:`pending`,b=e=>e.status===`completed`||e.status===`cancelled`,x={in_progress:`chat.statusRow.todo.status.inProgress`,pending:`chat.statusRow.todo.status.pending`,completed:`chat.statusRow.todo.status.completed`,cancelled:`chat.statusRow.todo.status.cancelled`},S={in_progress:`text-foreground`,pending:`text-muted-foreground/60`,completed:`text-muted-foreground`,cancelled:`text-muted-foreground/60`},C={in_progress:`text-foreground`,pending:`text-muted-foreground`,completed:`text-muted-foreground/60 line-through decoration-1`,cancelled:`text-muted-foreground/60 line-through decoration-1`},w=1.2,T=24,E=`1 1`,D=e=>{let t=(0,_.c)(23),{status:n,className:r}=e,{t:i}=a(),s=x[n],c;t[0]!==i||t[1]!==s?(c=i(s),t[0]=i,t[1]=s,t[2]=c):c=t[2];let l=S[n],u;t[3]!==r||t[4]!==l?(u=o(`size-[1em] shrink-0 transition-colors duration-300`,l,r),t[3]=r,t[4]=l,t[5]=u):u=t[5];let d=n===`pending`?w:void 0,f=n===`pending`?T:void 0,p=n===`pending`?E:void 0,m;t[6]!==d||t[7]!==f||t[8]!==p?(m=(0,v.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`,stroke:`currentColor`,strokeWidth:d,pathLength:f,strokeDasharray:p}),t[6]=d,t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;t[10]===n?h=t[11]:(h=n===`in_progress`?(0,v.jsx)(`path`,{d:`M4.8 8h6.4M8.6 5.4 11.2 8l-2.6 2.6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}):null,t[10]=n,t[11]=h);let g;t[12]===n?g=t[13]:(g=n===`completed`?(0,v.jsx)(`path`,{d:`M5 8 7.5 11 11 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}):null,t[12]=n,t[13]=g);let y;t[14]===n?y=t[15]:(y=n===`cancelled`?(0,v.jsx)(`path`,{d:`M3.5 12.5 12.5 3.5`,stroke:`currentColor`}):null,t[14]=n,t[15]=y);let b;return t[16]!==g||t[17]!==y||t[18]!==c||t[19]!==u||t[20]!==m||t[21]!==h?(b=(0,v.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,role:`img`,"aria-label":c,className:u,children:[m,h,g,y]}),t[16]=g,t[17]=y,t[18]=c,t[19]=u,t[20]=m,t[21]=h,t[22]=b):b=t[22],b},O=3.2,k=e=>{let t=Math.PI*2*e,n=8+O*Math.sin(t),r=8-O*Math.cos(t);return`M8 8 L8 4.8 A${O} ${O} 0 ${+(e>.5)} 1 ${n.toFixed(3)} ${r.toFixed(3)} Z`},A=e=>{let t=(0,_.c)(11),{done:n,total:r,spinning:i,className:a}=e,s=n===void 0?0:n,c=r===void 0?0:r,l=i!==void 0&&i,u=c>0?Math.min(1,s/c):0,d;t[0]===a?d=t[1]:(d=o(`size-[1.15em] shrink-0 text-foreground`,a),t[0]=a,t[1]=d);let f=l?`yuri-todo-spin`:void 0,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p={transformBox:`fill-box`,transformOrigin:`center`},t[2]=p):p=t[2];let m;t[3]===f?m=t[4]:(m=(0,v.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`,stroke:`currentColor`,strokeWidth:w,pathLength:T,strokeDasharray:E,className:f,style:p}),t[3]=f,t[4]=m);let h;t[5]===u?h=t[6]:(h=u>0?(0,v.jsx)(`path`,{d:k(u),fill:`currentColor`,className:`transition-opacity duration-300`}):null,t[5]=u,t[6]=h);let g;return t[7]!==d||t[8]!==m||t[9]!==h?(g=(0,v.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:d,children:[m,h]}),t[7]=d,t[8]=m,t[9]=h,t[10]=g):g=t[10],g},j=({done:e,total:t,className:n,animate:r=!0})=>{let i=g.useRef(e),a=r&&i.current!==e;return g.useEffect(()=>{i.current=e},[e]),(0,v.jsxs)(`span`,{className:o(`shrink-0 tabular-nums`,n),children:[(0,v.jsx)(`span`,{className:o(a&&`yuri-todo-count-tick`),children:e},e),`/${t}`]})},ee=e=>{let t=(0,_.c)(5),{className:n}=e,r;t[0]===n?r=t[1]:(r=o(`flex size-[1.15em] shrink-0 items-center justify-center rounded-full bg-[var(--status-success)] text-[var(--status-success-foreground)]`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,v.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:`size-[70%]`,children:(0,v.jsx)(`path`,{d:`M4.5 8.2 7 10.8 11.5 5.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,v.jsx)(`span`,{"data-todo-complete":!0,className:r,children:i}),t[3]=r,t[4]=a),a},M=e=>{let t=(0,_.c)(27),{todos:n,isWorking:r,animate:i,className:s,rowClassName:c,listRef:l,id:u}=e,d=r!==void 0&&r,f=i!==void 0&&i,{t:p}=a(),m=n.findIndex(N),h;t[0]!==m||t[1]!==n?(h=m>=0?m:n.findIndex(P),t[0]=m,t[1]=n,t[2]=h):h=t[2];let g=h,b;t[3]===n?b=t[4]:(b=n.some(F),t[3]=n,t[4]=b);let S=b,w;t[5]===s?w=t[6]:(w=o(`m-0 flex min-w-0 list-none flex-col gap-[0.125em] p-0`,s),t[5]=s,t[6]=w);let T;if(t[7]!==g||t[8]!==f||t[9]!==S||t[10]!==d||t[11]!==c||t[12]!==p||t[13]!==n){let e;t[15]!==g||t[16]!==f||t[17]!==S||t[18]!==d||t[19]!==c||t[20]!==p?(e=(e,t)=>{let n=y(e.status),r=d&&!S&&t===g&&n===`pending`?`in_progress`:n;return(0,v.jsxs)(`li`,{"data-status":r,"aria-current":t===g?`step`:void 0,className:o(`grid min-w-0 shrink-0 grid-cols-[auto_minmax(0,1fr)] items-start py-[0.25em]`,c??`gap-[0.6em] px-[0.5em]`,f&&`yuri-todo-row-in`),children:[(0,v.jsx)(`span`,{className:o(`flex h-[1.32em] w-[1.15em] items-center justify-center`,f&&`yuri-todo-icon-pop`),title:p(x[r]),children:(0,v.jsx)(D,{status:r})},r),(0,v.jsx)(`span`,{dir:`auto`,title:e.content,className:o(`line-clamp-3 min-w-0 whitespace-normal text-[0.88em] break-words leading-[1.5] transition-colors duration-300`,C[r]),children:(0,v.jsx)(`span`,{className:o(r===`in_progress`&&`animate-text-shimmer`),children:e.content})})]},e.id??`${t}:${e.content}`)},t[15]=g,t[16]=f,t[17]=S,t[18]=d,t[19]=c,t[20]=p,t[21]=e):e=t[21],T=n.map(e),t[7]=g,t[8]=f,t[9]=S,t[10]=d,t[11]=c,t[12]=p,t[13]=n,t[14]=T}else T=t[14];let E;return t[22]!==u||t[23]!==l||t[24]!==w||t[25]!==T?(E=(0,v.jsx)(`ul`,{id:u,ref:l,className:w,children:T}),t[22]=u,t[23]=l,t[24]=w,t[25]=T,t[26]=E):E=t[26],E};function N(e){return e.status===`in_progress`}function P(e){return e.status===`pending`}function F(e){return e.status===`in_progress`}var I=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`),L=e=>e?Object.entries(e).map(([e,t])=>t==null?``:`${e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}:${typeof t==`number`?`${t}px`:t};`).join(``):``,R=(e,t,n)=>{let r=e.querySelector(`pre`);r&&(r.style.margin=`0`,r.style.background=`transparent`,r.style.whiteSpace=t?`pre-wrap`:`pre`,t&&(r.style.wordBreak=`break-word`,r.style.overflowWrap=`break-word`));let i=e.querySelector(`code`);if(i){let e=L(n);e&&i.setAttribute(`style`,`${i.getAttribute(`style`)??``}${e}`)}},z=e=>`<pre><code>${I(e)}</code></pre>`,B=e=>{let t=(0,_.c)(21),{code:n,language:r,className:i,style:a,codeStyle:s,wrap:l}=e,u=l!==void 0&&l,{currentTheme:d}=c(),f=g.useRef(null),m;t[0]===d?m=t[1]:(m=p(d),t[0]=d,t[1]=m);let y=m,b,x;t[2]!==n||t[3]!==s||t[4]!==u?(b=()=>{let e=f.current;e&&(e.innerHTML=z(n),R(e,u,s))},x=[n,u,s],t[2]=n,t[3]=s,t[4]=u,t[5]=b,t[6]=x):(b=t[5],x=t[6]),g.useLayoutEffect(b,x);let S,C;t[7]!==n||t[8]!==s||t[9]!==r||t[10]!==u?(S=()=>{let e=f.current;if(!e)return;let t=!0,i=new AbortController;return h(n,(r||`text`).toLowerCase(),{signal:i.signal,priority:`visible`}).then(n=>{!t||!e||!n||(e.innerHTML=n,R(e,u,s))}),()=>{t=!1,i.abort()}},C=[n,r,u,s],t[7]=n,t[8]=s,t[9]=r,t[10]=u,t[11]=S,t[12]=C):(S=t[11],C=t[12]),g.useEffect(S,C);let w;t[13]===i?w=t[14]:(w=o(`typography-code`,i),t[13]=i,t[14]=w);let T=y,E;t[15]!==a||t[16]!==T?(E={...T,...a},t[15]=a,t[16]=T,t[17]=E):E=t[17];let D;return t[18]!==w||t[19]!==E?(D=(0,v.jsx)(`div`,{ref:f,className:w,style:E}),t[18]=w,t[19]=E,t[20]=D):D=t[20],D},V=e=>{let t=e.replace(/^<file>\s*\n?/,``).replace(/\n?<\/file>\s*$/,``);return t=t.replace(/^\s*\d{5}\|\s?/gm,``),t.trim()},H=(e,t=``)=>{if(typeof e==`string`)return e;if(e==null)return t;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e);try{return JSON.stringify(e)}catch{return t}},U=e=>e?e.includes(`<diagnostics`)||e.includes(`<file_diagnostics>`)||e.includes(`LSP errors detected`)||e.includes(`This file has errors`):!1,W=e=>e?e.replace(/\n{0,2}LSP errors detected[\s\S]*?<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/\n{0,2}This file has errors[\s\S]*?<\/file_diagnostics>/g,``).replace(/<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/<file_diagnostics>[\s\S]*?<\/file_diagnostics>/g,``).trim():``,G=(e,t)=>!e||typeof e!=`object`?String(e):f(e,t||``),K=e=>{if(typeof e==`string`){let t=e.trim();return t.length>0?t:void 0}if(e&&typeof e==`object`){let t=e.patch;if(typeof t==`string`){let e=t.trim();return e.length>0?e:void 0}}},q=e=>{if(!e||typeof e!=`object`)return;let t=K(e.patch)??K(e.diff);if(t)return t;let n=Array.isArray(e.files)?e.files:[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=K(e.patch)??K(e.diff);if(t)return t}},J=e=>{if(!e||typeof e!=`string`)return{data:null,isJson:!1};let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`)||!t.endsWith(`}`)&&!t.endsWith(`]`)||t.length<2)return{data:null,isJson:!1};try{let e=JSON.parse(t);return typeof e==`object`&&e?{data:e,isJson:!0}:{data:null,isJson:!1}}catch{return{data:null,isJson:!1}}},Y=(e,t,n)=>{let r=V(e);if((t===`edit`||t===`multiedit`||t===`write`||t===`apply_patch`)&&U(r)&&(r=W(r)),(t===`edit`||t===`multiedit`||t===`apply_patch`)&&r.trim().length===0){let e=q(n);if(e)return e}return r},X=e=>{let t=e.match(/<type>(file|directory)<\/type>/i)?.[1]?.toLowerCase()??`unknown`,n=(e.match(/<content>([\s\S]*?)<\/content>/i)?.[1]??e).replace(/\r\n/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`),r=e=>/\(\s*File has more lines\..*offset.*\)/i.test(e.trim());return{type:t,lines:n.map(e=>{let n=e.trim(),i=n.startsWith(`(`)&&n.endsWith(`)`)||r(n);if(t!==`directory`){let t=e.match(/^(\d+):\s?(.*)$/);if(t){let e=t[2],n=e.trim(),i=n.startsWith(`(`)&&n.endsWith(`)`)||r(n);return{lineNumber:i?null:Number(t[1]),text:e,isInfo:i}}}return{lineNumber:null,text:e,isInfo:i}}).filter((e,t,n)=>{if(e.text.trim().length>0)return!0;let r=n[t-1],i=n[t+1],a=!!(r?.isInfo||i?.isInfo),o=e.lineNumber!==null;return!(a&&o)})}},Z=(e,t)=>{try{let n=e.trim().split(`
|
|
4
4
|
`).filter(Boolean);if(n.length===0)return null;let i=[];return n.forEach(e=>{let t=e.match(/^(\s*)(.+)$/);if(t){let[,e,n]=t,r=Math.floor(e.length/2),a=!n.endsWith(`/`);i.push({name:n.replace(/\/$/,``),depth:r,isFile:a})}}),(0,v.jsx)(`div`,{className:o(`w-full min-w-0 font-mono space-y-0.5`,t?.unstyled?null:`p-3 bg-muted/20 rounded-xl border border-border/30`),style:r.tool.popup,children:i.map((e,t)=>(0,v.jsx)(`div`,{className:`min-w-0`,style:{paddingLeft:`${e.depth*20}px`},children:e.isFile?(0,v.jsx)(`span`,{className:`text-foreground/90 block truncate`,children:e.name}):(0,v.jsxs)(`span`,{className:`font-semibold text-foreground block truncate`,children:[e.name,`/`]})},t))})}catch{return null}},Q={backgroundColor:`var(--status-info)`,opacity:.6},te=(e,t,n)=>{try{let i=e.trim().split(`
|
package/dist/index.html
CHANGED
|
@@ -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-C8bkHEMX.js"></script>
|
|
575
575
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
576
576
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-DBn9yahL.js">
|
|
577
577
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-DEZ1K7qW.js">
|
|
@@ -604,11 +604,11 @@
|
|
|
604
604
|
<link rel="modulepreload" crossorigin href="/assets/terminalApi-BMWW_0wH.js">
|
|
605
605
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-D6bwc3Kj.js">
|
|
606
606
|
<link rel="modulepreload" crossorigin href="/assets/platform-sEg2IOLZ.js">
|
|
607
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
608
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
609
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
610
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
611
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
607
|
+
<link rel="modulepreload" crossorigin href="/assets/types-CNECQLeq.js">
|
|
608
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-D9oY9_ut.js">
|
|
609
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-BFOCyZg2.js">
|
|
610
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-DtKtvKA2.js">
|
|
611
|
+
<link rel="stylesheet" crossorigin href="/assets/src-BgE3FRXg.css">
|
|
612
612
|
</head>
|
|
613
613
|
<body class="h-full bg-background text-foreground">
|
|
614
614
|
<!-- 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-CoUl0Vav.js"></script>
|
|
81
81
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-DBn9yahL.js">
|
|
83
83
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-DEZ1K7qW.js">
|
|
@@ -110,11 +110,11 @@
|
|
|
110
110
|
<link rel="modulepreload" crossorigin href="/assets/terminalApi-BMWW_0wH.js">
|
|
111
111
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-D6bwc3Kj.js">
|
|
112
112
|
<link rel="modulepreload" crossorigin href="/assets/platform-sEg2IOLZ.js">
|
|
113
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
114
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
115
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
116
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
117
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
113
|
+
<link rel="modulepreload" crossorigin href="/assets/types-CNECQLeq.js">
|
|
114
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-D9oY9_ut.js">
|
|
115
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-BFOCyZg2.js">
|
|
116
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-DtKtvKA2.js">
|
|
117
|
+
<link rel="stylesheet" crossorigin href="/assets/src-BgE3FRXg.css">
|
|
118
118
|
</head>
|
|
119
119
|
<body class="h-full bg-background text-foreground">
|
|
120
120
|
<div id="root" class="h-full">
|
package/dist/mobile.html
CHANGED
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
</script>
|
|
65
65
|
|
|
66
66
|
<style>.dark #mobile-startup-logo img { filter: invert(1); }</style>
|
|
67
|
-
<script type="module" crossorigin src="/assets/mobile-
|
|
67
|
+
<script type="module" crossorigin src="/assets/mobile-LaGrgSUM.js"></script>
|
|
68
68
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
69
69
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-DBn9yahL.js">
|
|
70
70
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-DEZ1K7qW.js">
|
|
@@ -97,11 +97,11 @@
|
|
|
97
97
|
<link rel="modulepreload" crossorigin href="/assets/terminalApi-BMWW_0wH.js">
|
|
98
98
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-D6bwc3Kj.js">
|
|
99
99
|
<link rel="modulepreload" crossorigin href="/assets/platform-sEg2IOLZ.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-CNECQLeq.js">
|
|
101
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-D9oY9_ut.js">
|
|
102
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-BFOCyZg2.js">
|
|
103
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-DtKtvKA2.js">
|
|
104
|
+
<link rel="stylesheet" crossorigin href="/assets/src-BgE3FRXg.css">
|
|
105
105
|
</head>
|
|
106
106
|
<body class="h-full bg-background text-foreground">
|
|
107
107
|
<div id="root" class="h-full">
|
package/package.json
CHANGED
|
@@ -68,8 +68,17 @@ contracts, keyed by the compatible OpenCode runtime. Missing services fail
|
|
|
68
68
|
explicitly; protocol version alone does not prove compatibility with every future
|
|
69
69
|
OpenCode release. The bundled SDK normalizes the host model's wrapper while
|
|
70
70
|
retaining the host-owned route implementation; calls back into the host route
|
|
71
|
-
restore its original model wrapper so nominal SDK schemas remain valid.
|
|
72
|
-
OpenCode
|
|
71
|
+
restore its original model wrapper so nominal SDK schemas remain valid.
|
|
72
|
+
OpenCode 2.2.6 removed `route.defaults`, moved model presets to `model.options`,
|
|
73
|
+
and flattened generation parameters, headers and timeouts on requests. For that
|
|
74
|
+
host shape, the bridge projects presets into the bundled compiler's nested
|
|
75
|
+
defaults and converts requests back to flat fields at the host route's body,
|
|
76
|
+
header and transport boundaries. Host capabilities retain prompt-cache and
|
|
77
|
+
effort-update semantics. Both legacy defaults and flat options are checked for
|
|
78
|
+
context/tool body overrides. Legacy hosts retain their existing path; no host
|
|
79
|
+
version guessing, dependency upgrade or parallel model resolver is required.
|
|
80
|
+
It never instantiates an embedded OpenCode host. Requests use stateless HTTP,
|
|
81
|
+
including for providers whose durable
|
|
73
82
|
Agent sessions prefer WebSocket; providers requiring WebSocket-only operation are
|
|
74
83
|
not established by this path.
|
|
75
84
|
|
|
@@ -135,6 +144,12 @@ Provider-owned deadlines and Host process loss remain possible failures.
|
|
|
135
144
|
Focused tests cover clean wire messages, native empty-text tool calls, usage,
|
|
136
145
|
model override rejection, host-resolved OAuth, transport-hook body replacement, sanitized RPC errors,
|
|
137
146
|
session-free routing, long-running cancellation and retained side effects.
|
|
147
|
+
Source and prebundle regressions also cover the 2.2.6 flat model/route contract,
|
|
148
|
+
generation overrides, provider headers/body, phase timeouts and context-injection
|
|
149
|
+
rejection. Real OpenCode 2.2.6 smoke checks passed for OpenAI and Magpie after the
|
|
150
|
+
request-shape adaptation, plus the saved Summary AI model's connection probe,
|
|
151
|
+
session-title and commit generation and a native tool call without Session API
|
|
152
|
+
access. These do not establish all-provider compatibility.
|
|
138
153
|
`experiments/llm-provider-bridge/production-smoke.mjs` calls the real small-model
|
|
139
154
|
session-title path and the real pi Agent through the production gateway, external
|
|
140
155
|
OpenCode RPC and a selected real provider. OpenAI/Codex and DeepSeek both passed
|