@yuriai/web 0.2.29-beta.9 → 0.2.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +3 -1
  2. package/dist/assets/{AgentAvatar-BtFNGIgH.js → AgentAvatar-CR6dX_XT.js} +1 -1
  3. package/dist/assets/{AssistantContactStatus-CxBF6Ay6.js → AssistantContactStatus-diuJawg6.js} +3 -3
  4. package/dist/assets/{AssistantUnreadBadge--5NJVTuh.js → AssistantUnreadBadge-Bm2v4QFf.js} +1 -1
  5. package/dist/assets/{AssistantView-BmpLCQuw.js → AssistantView-BfJ7SgWf.js} +1 -1
  6. package/dist/assets/{DiagramView-CRam7PmL.js → DiagramView-Doy9Dw3w.js} +1 -1
  7. package/dist/assets/{GuiPluginSurface-Cf4hIlkP.js → GuiPluginSurface-DD2js1dF.js} +1 -1
  8. package/dist/assets/MarkdownRenderer-DlwJOAKc.js +2 -0
  9. package/dist/assets/{MarkdownRendererImpl-DShGc2YZ.js → MarkdownRendererImpl-Bcew9khF.js} +1 -1
  10. package/dist/assets/{MarkstreamRendererImpl-DYmFf07T.js → MarkstreamRendererImpl-DhcURvX5.js} +1 -1
  11. package/dist/assets/{MobileDetailNavigation-CjoghpoB.js → MobileDetailNavigation-6ZzfZFN1.js} +1 -1
  12. package/dist/assets/{MobileShareBridge-Bii25Pjf.js → MobileShareBridge-gejXx1yh.js} +1 -1
  13. package/dist/assets/{MobileTabPageHeader-C6AI58D-.js → MobileTabPageHeader-DkT6g7Mg.js} +1 -1
  14. package/dist/assets/{MultiRunWindow-xrwgbnRZ.js → MultiRunWindow-CRgoeY0-.js} +1 -1
  15. package/dist/assets/{SettingsView-BHBG7CFA.js → SettingsView-Ds6O5lyc.js} +1 -1
  16. package/dist/assets/{SettingsWindow-D8hn7Jjd.js → SettingsWindow-BWn1_7aJ.js} +1 -1
  17. package/dist/assets/{SetupTourDialog-B2crxm_w.js → SetupTourDialog-CPIzaGRX.js} +1 -1
  18. package/dist/assets/{TerminalView-5ki5iNXt.js → TerminalView-c7zh5vLz.js} +1 -1
  19. package/dist/assets/{ToolOutputDialog-CMhix20T.js → ToolOutputDialog-CDOXuNnT.js} +1 -1
  20. package/dist/assets/{VoiceSettings-DawvV46L.js → VoiceSettings-C4dUe9aM.js} +1 -1
  21. package/dist/assets/{appThemeRegistry-D25YM694.js → appThemeRegistry-yYsjzEE3.js} +1 -1
  22. package/dist/assets/{capgoAdapter-Bas1D6ds.js → capgoAdapter-Bu3WngVl.js} +1 -1
  23. package/dist/assets/{gitApi-Cs08jIjA.js → gitApi-Qflz9_C8.js} +1 -1
  24. package/dist/assets/{insertionBoundaries-BoEG12_x.js → insertionBoundaries-BUw7PHl1.js} +1 -1
  25. package/dist/assets/{main-D00Zz44O.js → main-Bjl7PEcs.js} +4 -4
  26. package/dist/assets/{main-BGYY-hd1.js → main-D-GaWYGg.js} +2 -2
  27. package/dist/assets/{mcpQueries-4__hFxuf.js → mcpQueries-DHembIpw.js} +1 -1
  28. package/dist/assets/{miniChat-DJrq4mIe.js → miniChat-CmBB3uQK.js} +2 -2
  29. package/dist/assets/{mobile-BOrcaJMH.js → mobile-Dc6ZV3uE.js} +2 -2
  30. package/dist/assets/{mobileBackNavigation-DfKlarxw.js → mobileBackNavigation-CsrEjMEM.js} +1 -1
  31. package/dist/assets/{multirun-D35HrOK1.js → multirun-ruXWPXy8.js} +1 -1
  32. package/dist/assets/{native-config-DF7bq4tk.js → native-config-BcE2v-v8.js} +1 -1
  33. package/dist/assets/{projectMeta-Bu5flvhx.js → projectMeta-aZbJXiqn.js} +1 -1
  34. package/dist/assets/{pwa-CWEsl2Ow.js → pwa-BXcwcwBq.js} +1 -1
  35. package/dist/assets/{queue-abort-optimistic-DZc2cRj7.js → queue-abort-optimistic-p3-XNzC5.js} +1 -1
  36. package/dist/assets/{readiness-Dl790DNB.js → readiness-CG6k1v_D.js} +1 -1
  37. package/dist/assets/{renderElectronMiniChatApp-MI4k81uX.js → renderElectronMiniChatApp-DKbHyoWv.js} +2 -2
  38. package/dist/assets/{renderMobileApp-ClCiFay4.js → renderMobileApp-ouUhZ7cf.js} +4 -4
  39. package/dist/assets/{runtimeConfig-BuChFCqQ.js → runtimeConfig-pROQUB9G.js} +1 -1
  40. package/dist/assets/{runtimeEndpointReset-BHOxCpwZ.js → runtimeEndpointReset-DPIu6oI9.js} +3 -3
  41. package/dist/assets/{sessionLookup-K6ZLigY7.js → sessionLookup-CNrni3E6.js} +1 -1
  42. package/dist/assets/{speechSettingsQueries-DusLRL2i.js → speechSettingsQueries-Dz5sTpjO.js} +1 -1
  43. package/dist/assets/types-DodQbc1N.js +2 -0
  44. package/dist/assets/{useAppFontEffects-BTwyFf_W.js → useAppFontEffects-DtteQwrV.js} +5 -5
  45. package/dist/assets/{useDesktopWindowControlsLayout-GQRvPTBq.js → useDesktopWindowControlsLayout-BDhl0M6j.js} +1 -1
  46. package/dist/assets/{useEffectiveDirectory-n0L_esHA.js → useEffectiveDirectory-DcTO2pCq.js} +1 -1
  47. package/dist/assets/{useMobileNavigationStore-CN9JDH7h.js → useMobileNavigationStore-CWXCC9MY.js} +4 -4
  48. package/dist/assets/{usePluginsStore-D96HwGZy.js → usePluginsStore-B6vwvN4g.js} +1 -1
  49. package/dist/assets/{useWorkerHighlightedLines-Bs1Z-yjv.js → useWorkerHighlightedLines-B9uHlxuS.js} +1 -1
  50. package/dist/index.html +5 -5
  51. package/dist/mini-chat.html +5 -5
  52. package/dist/mobile.html +5 -5
  53. package/package.json +4 -3
  54. package/server/lib/assistants/DOCUMENTATION.md +1 -1
  55. package/server/lib/assistants/contact-tools.js +1 -1
  56. package/server/lib/assistants/harness.js +3 -3
  57. package/server/lib/client-auth/pairing.js +4 -1
  58. package/server/lib/client-auth/pairing.test.js +41 -0
  59. package/server/lib/client-auth/remote-clients.js +6 -2
  60. package/server/lib/client-auth/remote-clients.test.js +42 -0
  61. package/server/lib/llm/DOCUMENTATION.md +14 -1
  62. package/server/lib/llm/bridge-plugin.bundle.js +13 -1136
  63. package/server/lib/llm/bridge-plugin.js +4 -4
  64. package/server/lib/llm/bridge-plugin.test.js +31 -4
  65. package/server/lib/opencode/core-routes.js +3 -2
  66. package/server/lib/opencode/core-routes.test.js +12 -2
  67. package/server/lib/remote-desktop/DOCUMENTATION.md +4 -0
  68. package/server/lib/ui-auth/DOCUMENTATION.md +2 -0
  69. package/dist/assets/MarkdownRenderer-D3744fNd.js +0 -2
  70. package/dist/assets/types-O8iYyCQi.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-Ddik7PM_.js";import{x as u}from"./useUIStore-CoWJ3ROq.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-Cjciq1yh.js";import{_a as y,ha as b}from"./useMobileNavigationStore-CN9JDH7h.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)(te,{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 te(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 ne(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=re,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 re(e){return e instanceof HTMLElement&&e.closest(`button, a, input, select, textarea`)!==null}var O=e=>{let t=e?.trim();return t?{location:{directory:t}}:void 0},k=()=>{let e=l.getSdkClient().plugin;if(!e?.list||!e.check||!e.update)throw Error(`OpenCode plugin status is not available`);return e},ie=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)}`)}},ae=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)}`)},oe=e=>({source:ie(e.source),state:ae(e.state)}),A=e=>{if(!Array.isArray(e))throw Error(`OpenCode plugin status payload is invalid`);return e.map(e=>oe(e))};async function j(e,t){return A((await k().list(O(e),t?{signal:t}:void 0))?.data)}async function se(e,t){return A((await k().check(O(e),t?{signal:t}:void 0))?.data)}async function ce(e,t,n){let r=t.trim();if(!r)throw Error(`plugin.update requires a target`);await k().update({...O(e),targets:[r]},n?{signal:n}:void 0)}function le(e){return e instanceof Error&&e.message.trim()?e.message:typeof e==`string`&&e.trim()?e:`plugin operation failed`}var ue=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),de=()=>{I+=1},R=(e,t,n)=>e.getQueryData(F(t,n)),z=(t=b(),r=e())=>{let i=M(t);return{queryKey:N(i,r),queryFn:async({signal:e})=>{let t=await n(ve(`/api/config/plugins`,i),{headers:xe(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 be(c)){let a=ye(r,i,s),c=await n(o?`${a}&details=true`:a,{headers:xe(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}},V=(t=b(),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}},fe=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=y(Se),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)},pe=(e,t)=>{let n=(0,x.c)(6),r=t!==void 0&&t,i=y(Ce),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)},H=()=>{let e=(0,x.c)(2),t=y(we),n;return e[0]===t?n=e[1]:(n=M(t)??M(l.getDirectory()),e[0]=t,e[1]=n),n},me=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=H(),a;t[2]===i?a=t[3]:(a=V(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)},U=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:[]}},he=async(t=p,n,r)=>{let i=M(n),a=e(),o=await B(i,r,!0,a).queryFn({signal:new AbortController().signal});return t.setQueryData(P(i,r,!1,a),o),o},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)},_e=async(t=b(),n=p)=>{let r=M(t),i=e(),a=await se(r);return de(),e()===i&&n.setQueryData(F(r,i),a),a};function ve(e,t){return`${e}${t?`?directory=${encodeURIComponent(t)}`:``}`}function ye(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 be(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>ue){t.push(n),n=[i],r=e.length;continue}n.push(i),r=a}return n.length>0&&t.push(n),t}function xe(e){return e?{"x-opencode-directory":e}:void 0}function Se(e){return e.getActiveProject?.()?.path??null}function Ce(e){return e.getActiveProject?.()?.path??null}function we(e){return e.getActiveProject?.()?.path??null}var W=()=>{try{let e=y.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},Te=5e3,Ee=`__default__`,G=new Map,K=new Map,De=1500,q=e=>e?.trim()||Ee,Oe=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<Te)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 U(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=Ae(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 je(t)){let t=await n(ke(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(Me(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(Me(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 ke(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 Ae(e){return Array.from(new Set(e.map(e=>e.trim()).filter(Boolean)))}function je(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>De?(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 Me(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};Oe(o);let l=await U(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{te as _,z as a,ee as b,H as c,fe as d,j as f,E as g,D as h,V as i,pe as l,ce as m,_e as n,he as o,le as p,B as r,ge as s,J as t,me as u,ne as v,T as y};
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-Ddik7PM_.js";import{x as u}from"./useUIStore-CoWJ3ROq.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-Cjciq1yh.js";import{_a as y,ha as b}from"./useMobileNavigationStore-CWXCC9MY.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)(te,{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 te(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 ne(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=re,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 re(e){return e instanceof HTMLElement&&e.closest(`button, a, input, select, textarea`)!==null}var O=e=>{let t=e?.trim();return t?{location:{directory:t}}:void 0},k=()=>{let e=l.getSdkClient().plugin;if(!e?.list||!e.check||!e.update)throw Error(`OpenCode plugin status is not available`);return e},ie=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)}`)}},ae=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)}`)},oe=e=>({source:ie(e.source),state:ae(e.state)}),A=e=>{if(!Array.isArray(e))throw Error(`OpenCode plugin status payload is invalid`);return e.map(e=>oe(e))};async function j(e,t){return A((await k().list(O(e),t?{signal:t}:void 0))?.data)}async function se(e,t){return A((await k().check(O(e),t?{signal:t}:void 0))?.data)}async function ce(e,t,n){let r=t.trim();if(!r)throw Error(`plugin.update requires a target`);await k().update({...O(e),targets:[r]},n?{signal:n}:void 0)}function le(e){return e instanceof Error&&e.message.trim()?e.message:typeof e==`string`&&e.trim()?e:`plugin operation failed`}var ue=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),de=()=>{I+=1},R=(e,t,n)=>e.getQueryData(F(t,n)),z=(t=b(),r=e())=>{let i=M(t);return{queryKey:N(i,r),queryFn:async({signal:e})=>{let t=await n(ve(`/api/config/plugins`,i),{headers:xe(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 be(c)){let a=ye(r,i,s),c=await n(o?`${a}&details=true`:a,{headers:xe(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}},V=(t=b(),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}},fe=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=y(Se),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)},pe=(e,t)=>{let n=(0,x.c)(6),r=t!==void 0&&t,i=y(Ce),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)},H=()=>{let e=(0,x.c)(2),t=y(we),n;return e[0]===t?n=e[1]:(n=M(t)??M(l.getDirectory()),e[0]=t,e[1]=n),n},me=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=H(),a;t[2]===i?a=t[3]:(a=V(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)},U=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:[]}},he=async(t=p,n,r)=>{let i=M(n),a=e(),o=await B(i,r,!0,a).queryFn({signal:new AbortController().signal});return t.setQueryData(P(i,r,!1,a),o),o},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)},_e=async(t=b(),n=p)=>{let r=M(t),i=e(),a=await se(r);return de(),e()===i&&n.setQueryData(F(r,i),a),a};function ve(e,t){return`${e}${t?`?directory=${encodeURIComponent(t)}`:``}`}function ye(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 be(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>ue){t.push(n),n=[i],r=e.length;continue}n.push(i),r=a}return n.length>0&&t.push(n),t}function xe(e){return e?{"x-opencode-directory":e}:void 0}function Se(e){return e.getActiveProject?.()?.path??null}function Ce(e){return e.getActiveProject?.()?.path??null}function we(e){return e.getActiveProject?.()?.path??null}var W=()=>{try{let e=y.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},Te=5e3,Ee=`__default__`,G=new Map,K=new Map,De=1500,q=e=>e?.trim()||Ee,Oe=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<Te)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 U(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=Ae(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 je(t)){let t=await n(ke(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(Me(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(Me(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 ke(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 Ae(e){return Array.from(new Set(e.map(e=>e.trim()).filter(Boolean)))}function je(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>De?(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 Me(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};Oe(o);let l=await U(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{te as _,z as a,ee as b,H as c,fe as d,j as f,E as g,D as h,V as i,pe as l,ce as m,_e as n,he as o,le as p,B as r,ge as s,J as t,me as u,ne as v,T as y};
@@ -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-CoWJ3ROq.js";import{n as i}from"./vendor-react-DlzBev0S.js";import{f as a,r as o,t as s}from"./button-Cjciq1yh.js";import{n as c}from"./useThemeSystem-CNzUUkFn.js";import{n as l}from"./Icon-BQczEnxm.js";import{n as u}from"./MarkdownRenderer-D3744fNd.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,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),L=e=>e?Object.entries(e).map(([e,t])=>t==null?``:`${e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}:${typeof t==`number`?`${t}px`:t};`).join(``):``,R=(e,t,n)=>{let r=e.querySelector(`pre`);r&&(r.style.margin=`0`,r.style.background=`transparent`,r.style.whiteSpace=t?`pre-wrap`:`pre`,t&&(r.style.wordBreak=`break-word`,r.style.overflowWrap=`break-word`));let i=e.querySelector(`code`);if(i){let e=L(n);e&&i.setAttribute(`style`,`${i.getAttribute(`style`)??``}${e}`)}},z=e=>`<pre><code>${I(e)}</code></pre>`,B=e=>{let t=(0,_.c)(21),{code:n,language:r,className:i,style:a,codeStyle:s,wrap:l}=e,u=l!==void 0&&l,{currentTheme:d}=c(),f=g.useRef(null),m;t[0]===d?m=t[1]:(m=p(d),t[0]=d,t[1]=m);let y=m,b,x;t[2]!==n||t[3]!==s||t[4]!==u?(b=()=>{let e=f.current;e&&(e.innerHTML=z(n),R(e,u,s))},x=[n,u,s],t[2]=n,t[3]=s,t[4]=u,t[5]=b,t[6]=x):(b=t[5],x=t[6]),g.useLayoutEffect(b,x);let S,C;t[7]!==n||t[8]!==s||t[9]!==r||t[10]!==u?(S=()=>{let e=f.current;if(!e)return;let t=!0,i=new AbortController;return h(n,(r||`text`).toLowerCase(),{signal:i.signal,priority:`visible`}).then(n=>{!t||!e||!n||(e.innerHTML=n,R(e,u,s))}),()=>{t=!1,i.abort()}},C=[n,r,u,s],t[7]=n,t[8]=s,t[9]=r,t[10]=u,t[11]=S,t[12]=C):(S=t[11],C=t[12]),g.useEffect(S,C);let w;t[13]===i?w=t[14]:(w=o(`typography-code`,i),t[13]=i,t[14]=w);let T=y,E;t[15]!==a||t[16]!==T?(E={...T,...a},t[15]=a,t[16]=T,t[17]=E):E=t[17];let D;return t[18]!==w||t[19]!==E?(D=(0,v.jsx)(`div`,{ref:f,className:w,style:E}),t[18]=w,t[19]=E,t[20]=D):D=t[20],D},V=e=>{let t=e.replace(/^<file>\s*\n?/,``).replace(/\n?<\/file>\s*$/,``);return t=t.replace(/^\s*\d{5}\|\s?/gm,``),t.trim()},H=(e,t=``)=>{if(typeof e==`string`)return e;if(e==null)return t;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e);try{return JSON.stringify(e)}catch{return t}},U=e=>e?e.includes(`<diagnostics`)||e.includes(`<file_diagnostics>`)||e.includes(`LSP errors detected`)||e.includes(`This file has errors`):!1,W=e=>e?e.replace(/\n{0,2}LSP errors detected[\s\S]*?<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/\n{0,2}This file has errors[\s\S]*?<\/file_diagnostics>/g,``).replace(/<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/<file_diagnostics>[\s\S]*?<\/file_diagnostics>/g,``).trim():``,G=(e,t)=>!e||typeof e!=`object`?String(e):f(e,t||``),K=e=>{if(typeof e==`string`){let t=e.trim();return t.length>0?t:void 0}if(e&&typeof e==`object`){let t=e.patch;if(typeof t==`string`){let e=t.trim();return e.length>0?e:void 0}}},q=e=>{if(!e||typeof e!=`object`)return;let t=K(e.patch)??K(e.diff);if(t)return t;let n=Array.isArray(e.files)?e.files:[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=K(e.patch)??K(e.diff);if(t)return t}},J=e=>{if(!e||typeof e!=`string`)return{data:null,isJson:!1};let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`)||!t.endsWith(`}`)&&!t.endsWith(`]`)||t.length<2)return{data:null,isJson:!1};try{let e=JSON.parse(t);return typeof e==`object`&&e?{data:e,isJson:!0}:{data:null,isJson:!1}}catch{return{data:null,isJson:!1}}},Y=(e,t,n)=>{let r=V(e);if((t===`edit`||t===`multiedit`||t===`write`||t===`apply_patch`)&&U(r)&&(r=W(r)),(t===`edit`||t===`multiedit`||t===`apply_patch`)&&r.trim().length===0){let e=q(n);if(e)return e}return r},X=e=>{let t=e.match(/<type>(file|directory)<\/type>/i)?.[1]?.toLowerCase()??`unknown`,n=(e.match(/<content>([\s\S]*?)<\/content>/i)?.[1]??e).replace(/\r\n/g,`
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-CzHs0bHY.js";import{y as r}from"./useUIStore-CoWJ3ROq.js";import{n as i}from"./vendor-react-DlzBev0S.js";import{f as a,r as o,t as s}from"./button-Cjciq1yh.js";import{n as c}from"./useThemeSystem-CNzUUkFn.js";import{n as l}from"./Icon-BQczEnxm.js";import{n as u}from"./MarkdownRenderer-DlwJOAKc.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,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),L=e=>e?Object.entries(e).map(([e,t])=>t==null?``:`${e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}:${typeof t==`number`?`${t}px`:t};`).join(``):``,R=(e,t,n)=>{let r=e.querySelector(`pre`);r&&(r.style.margin=`0`,r.style.background=`transparent`,r.style.whiteSpace=t?`pre-wrap`:`pre`,t&&(r.style.wordBreak=`break-word`,r.style.overflowWrap=`break-word`));let i=e.querySelector(`code`);if(i){let e=L(n);e&&i.setAttribute(`style`,`${i.getAttribute(`style`)??``}${e}`)}},z=e=>`<pre><code>${I(e)}</code></pre>`,B=e=>{let t=(0,_.c)(21),{code:n,language:r,className:i,style:a,codeStyle:s,wrap:l}=e,u=l!==void 0&&l,{currentTheme:d}=c(),f=g.useRef(null),m;t[0]===d?m=t[1]:(m=p(d),t[0]=d,t[1]=m);let y=m,b,x;t[2]!==n||t[3]!==s||t[4]!==u?(b=()=>{let e=f.current;e&&(e.innerHTML=z(n),R(e,u,s))},x=[n,u,s],t[2]=n,t[3]=s,t[4]=u,t[5]=b,t[6]=x):(b=t[5],x=t[6]),g.useLayoutEffect(b,x);let S,C;t[7]!==n||t[8]!==s||t[9]!==r||t[10]!==u?(S=()=>{let e=f.current;if(!e)return;let t=!0,i=new AbortController;return h(n,(r||`text`).toLowerCase(),{signal:i.signal,priority:`visible`}).then(n=>{!t||!e||!n||(e.innerHTML=n,R(e,u,s))}),()=>{t=!1,i.abort()}},C=[n,r,u,s],t[7]=n,t[8]=s,t[9]=r,t[10]=u,t[11]=S,t[12]=C):(S=t[11],C=t[12]),g.useEffect(S,C);let w;t[13]===i?w=t[14]:(w=o(`typography-code`,i),t[13]=i,t[14]=w);let T=y,E;t[15]!==a||t[16]!==T?(E={...T,...a},t[15]=a,t[16]=T,t[17]=E):E=t[17];let D;return t[18]!==w||t[19]!==E?(D=(0,v.jsx)(`div`,{ref:f,className:w,style:E}),t[18]=w,t[19]=E,t[20]=D):D=t[20],D},V=e=>{let t=e.replace(/^<file>\s*\n?/,``).replace(/\n?<\/file>\s*$/,``);return t=t.replace(/^\s*\d{5}\|\s?/gm,``),t.trim()},H=(e,t=``)=>{if(typeof e==`string`)return e;if(e==null)return t;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e);try{return JSON.stringify(e)}catch{return t}},U=e=>e?e.includes(`<diagnostics`)||e.includes(`<file_diagnostics>`)||e.includes(`LSP errors detected`)||e.includes(`This file has errors`):!1,W=e=>e?e.replace(/\n{0,2}LSP errors detected[\s\S]*?<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/\n{0,2}This file has errors[\s\S]*?<\/file_diagnostics>/g,``).replace(/<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/<file_diagnostics>[\s\S]*?<\/file_diagnostics>/g,``).trim():``,G=(e,t)=>!e||typeof e!=`object`?String(e):f(e,t||``),K=e=>{if(typeof e==`string`){let t=e.trim();return t.length>0?t:void 0}if(e&&typeof e==`object`){let t=e.patch;if(typeof t==`string`){let e=t.trim();return e.length>0?e:void 0}}},q=e=>{if(!e||typeof e!=`object`)return;let t=K(e.patch)??K(e.diff);if(t)return t;let n=Array.isArray(e.files)?e.files:[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=K(e.patch)??K(e.diff);if(t)return t}},J=e=>{if(!e||typeof e!=`string`)return{data:null,isJson:!1};let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`)||!t.endsWith(`}`)&&!t.endsWith(`]`)||t.length<2)return{data:null,isJson:!1};try{let e=JSON.parse(t);return typeof e==`object`&&e?{data:e,isJson:!0}:{data:null,isJson:!1}}catch{return{data:null,isJson:!1}}},Y=(e,t,n)=>{let r=V(e);if((t===`edit`||t===`multiedit`||t===`write`||t===`apply_patch`)&&U(r)&&(r=W(r)),(t===`edit`||t===`multiedit`||t===`apply_patch`)&&r.trim().length===0){let e=q(n);if(e)return e}return r},X=e=>{let t=e.match(/<type>(file|directory)<\/type>/i)?.[1]?.toLowerCase()??`unknown`,n=(e.match(/<content>([\s\S]*?)<\/content>/i)?.[1]??e).replace(/\r\n/g,`
2
2
  `).split(`
3
3
  `),r=e=>/\(\s*File has more lines\..*offset.*\)/i.test(e.trim());return{type:t,lines:n.map(e=>{let n=e.trim(),i=n.startsWith(`(`)&&n.endsWith(`)`)||r(n);if(t!==`directory`){let t=e.match(/^(\d+):\s?(.*)$/);if(t){let e=t[2],n=e.trim(),i=n.startsWith(`(`)&&n.endsWith(`)`)||r(n);return{lineNumber:i?null:Number(t[1]),text:e,isInfo:i}}}return{lineNumber:null,text:e,isInfo:i}}).filter((e,t,n)=>{if(e.text.trim().length>0)return!0;let r=n[t-1],i=n[t+1],a=!!(r?.isInfo||i?.isInfo),o=e.lineNumber!==null;return!(a&&o)})}},Z=(e,t)=>{try{let n=e.trim().split(`
4
4
  `).filter(Boolean);if(n.length===0)return null;let i=[];return n.forEach(e=>{let t=e.match(/^(\s*)(.+)$/);if(t){let[,e,n]=t,r=Math.floor(e.length/2),a=!n.endsWith(`/`);i.push({name:n.replace(/\/$/,``),depth:r,isFile:a})}}),(0,v.jsx)(`div`,{className:o(`w-full min-w-0 font-mono space-y-0.5`,t?.unstyled?null:`p-3 bg-muted/20 rounded-xl border border-border/30`),style:r.tool.popup,children:i.map((e,t)=>(0,v.jsx)(`div`,{className:`min-w-0`,style:{paddingLeft:`${e.depth*20}px`},children:e.isFile?(0,v.jsx)(`span`,{className:`text-foreground/90 block truncate`,children:e.name}):(0,v.jsxs)(`span`,{className:`font-semibold text-foreground block truncate`,children:[e.name,`/`]})},t))})}catch{return null}},Q={backgroundColor:`var(--status-info)`,opacity:.6},te=(e,t,n)=>{try{let i=e.trim().split(`
package/dist/index.html CHANGED
@@ -560,7 +560,7 @@
560
560
  opacity: 0.72;
561
561
  }
562
562
  </style>
563
- <script type="module" crossorigin src="/assets/main-BGYY-hd1.js"></script>
563
+ <script type="module" crossorigin src="/assets/main-D-GaWYGg.js"></script>
564
564
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
565
565
  <link rel="modulepreload" crossorigin href="/assets/runtime-auth-DBn9yahL.js">
566
566
  <link rel="modulepreload" crossorigin href="/assets/runtime-switch-DEZ1K7qW.js">
@@ -592,10 +592,10 @@
592
592
  <link rel="modulepreload" crossorigin href="/assets/terminalApi-ChZhb60_.js">
593
593
  <link rel="modulepreload" crossorigin href="/assets/runtime-file-download-D6bwc3Kj.js">
594
594
  <link rel="modulepreload" crossorigin href="/assets/platform-DFJEtBlo.js">
595
- <link rel="modulepreload" crossorigin href="/assets/types-O8iYyCQi.js">
596
- <link rel="modulepreload" crossorigin href="/assets/capgoAdapter-Bas1D6ds.js">
597
- <link rel="modulepreload" crossorigin href="/assets/native-config-DF7bq4tk.js">
598
- <link rel="modulepreload" crossorigin href="/assets/runtimeConfig-BuChFCqQ.js">
595
+ <link rel="modulepreload" crossorigin href="/assets/types-DodQbc1N.js">
596
+ <link rel="modulepreload" crossorigin href="/assets/capgoAdapter-Bu3WngVl.js">
597
+ <link rel="modulepreload" crossorigin href="/assets/native-config-BcE2v-v8.js">
598
+ <link rel="modulepreload" crossorigin href="/assets/runtimeConfig-pROQUB9G.js">
599
599
  <link rel="stylesheet" crossorigin href="/assets/src-EZMbcCtg.css">
600
600
  </head>
601
601
  <body class="h-full bg-background text-foreground">
@@ -77,7 +77,7 @@
77
77
  .dark #initial-loading img { filter: invert(1); }
78
78
  </style>
79
79
 
80
- <script type="module" crossorigin src="/assets/miniChat-DJrq4mIe.js"></script>
80
+ <script type="module" crossorigin src="/assets/miniChat-CmBB3uQK.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">
@@ -109,10 +109,10 @@
109
109
  <link rel="modulepreload" crossorigin href="/assets/terminalApi-ChZhb60_.js">
110
110
  <link rel="modulepreload" crossorigin href="/assets/runtime-file-download-D6bwc3Kj.js">
111
111
  <link rel="modulepreload" crossorigin href="/assets/platform-DFJEtBlo.js">
112
- <link rel="modulepreload" crossorigin href="/assets/types-O8iYyCQi.js">
113
- <link rel="modulepreload" crossorigin href="/assets/capgoAdapter-Bas1D6ds.js">
114
- <link rel="modulepreload" crossorigin href="/assets/native-config-DF7bq4tk.js">
115
- <link rel="modulepreload" crossorigin href="/assets/runtimeConfig-BuChFCqQ.js">
112
+ <link rel="modulepreload" crossorigin href="/assets/types-DodQbc1N.js">
113
+ <link rel="modulepreload" crossorigin href="/assets/capgoAdapter-Bu3WngVl.js">
114
+ <link rel="modulepreload" crossorigin href="/assets/native-config-BcE2v-v8.js">
115
+ <link rel="modulepreload" crossorigin href="/assets/runtimeConfig-pROQUB9G.js">
116
116
  <link rel="stylesheet" crossorigin href="/assets/src-EZMbcCtg.css">
117
117
  </head>
118
118
  <body class="h-full bg-background text-foreground">
package/dist/mobile.html CHANGED
@@ -64,7 +64,7 @@
64
64
  </script>
65
65
 
66
66
  <style>.dark #mobile-startup-logo img { filter: invert(1); }</style>
67
- <script type="module" crossorigin src="/assets/mobile-BOrcaJMH.js"></script>
67
+ <script type="module" crossorigin src="/assets/mobile-Dc6ZV3uE.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">
@@ -96,10 +96,10 @@
96
96
  <link rel="modulepreload" crossorigin href="/assets/terminalApi-ChZhb60_.js">
97
97
  <link rel="modulepreload" crossorigin href="/assets/runtime-file-download-D6bwc3Kj.js">
98
98
  <link rel="modulepreload" crossorigin href="/assets/platform-DFJEtBlo.js">
99
- <link rel="modulepreload" crossorigin href="/assets/types-O8iYyCQi.js">
100
- <link rel="modulepreload" crossorigin href="/assets/capgoAdapter-Bas1D6ds.js">
101
- <link rel="modulepreload" crossorigin href="/assets/native-config-DF7bq4tk.js">
102
- <link rel="modulepreload" crossorigin href="/assets/runtimeConfig-BuChFCqQ.js">
99
+ <link rel="modulepreload" crossorigin href="/assets/types-DodQbc1N.js">
100
+ <link rel="modulepreload" crossorigin href="/assets/capgoAdapter-Bu3WngVl.js">
101
+ <link rel="modulepreload" crossorigin href="/assets/native-config-BcE2v-v8.js">
102
+ <link rel="modulepreload" crossorigin href="/assets/runtimeConfig-pROQUB9G.js">
103
103
  <link rel="stylesheet" crossorigin href="/assets/src-EZMbcCtg.css">
104
104
  </head>
105
105
  <body class="h-full bg-background text-foreground">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuriai/web",
3
- "version": "0.2.29-beta.9",
3
+ "version": "0.2.29",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./server/index.js",
@@ -31,9 +31,7 @@
31
31
  "@larksuite/channel": "0.7.1",
32
32
  "@larksuite/vercel-chat-adapter": "0.3.0",
33
33
  "@octokit/rest": "^22.0.1",
34
- "@opencode/ai": "2.2.1",
35
34
  "@opencode/client": "^2.0.23",
36
- "@opencode/core": "2.2.1",
37
35
  "@opencode/schema": "^2.0.23",
38
36
  "@simplewebauthn/server": "13.3.1",
39
37
  "adm-zip": "^0.5.16",
@@ -60,6 +58,8 @@
60
58
  "yaml": "^2.8.1"
61
59
  },
62
60
  "devDependencies": {
61
+ "@opencode/ai": "2.2.1",
62
+ "@opencode/core": "2.2.1",
63
63
  "@base-ui/react": "^1.4.0",
64
64
  "@codemirror/lang-cpp": "^6.0.3",
65
65
  "@codemirror/lang-go": "^6.0.1",
@@ -108,6 +108,7 @@
108
108
  "supertest": "^7.2.2",
109
109
  "tailwindcss": "^4.0.0",
110
110
  "tsx": "^4.20.6",
111
+ "tsdown": "0.23.5",
111
112
  "tw-animate-css": "^1.3.8",
112
113
  "typescript": "~5.9.0",
113
114
  "typescript-eslint": "^8.39.1",
@@ -510,7 +510,7 @@ and keep their existing error result handling.
510
510
 
511
511
  - Tools use native function calling only (`message.tool_calls`); text is never parsed for tool calls and no schema catalog is repeated in the prompt. A response without tool calls is the final reply.
512
512
  - Public progress uses the harness-owned `notify_user` tool `{ text }` (max 2,000 characters), usually batched with the next call. Its text emits `done:true` bubbles when the response arrives, before the batch executes. Batched notes are dropped from execution and stored as the assistant message's public text (`contactPublicText`); a notes-only response executes and the loop continues. Text beside tool calls is model narration and stays private. Later rounds replay delivered notes to the model as `notify_user` calls.
513
- - The model is prompted to send a progress message only when it adds information the user does not already have (a direction worth correcting, a meaningful finding, a blocker, or expected long work), then give a short final outcome. A message is not required before each tool call, and successful lookups need no separate confirmation. Public messages share the existing SSE, durable contact rows, and turn-global indices across web, desktop, VS Code, hosted mobile, and Capacitor. No timer narration, tool logs, progress widgets, or synthetic chat messages are added. Timing of model-authored milestones remains model policy; the transport guarantees immediate delivery once an explicit public record arrives.
513
+ - The model defaults to quiet execution and one short final reply, usually one or two sentences, expanding only as the requested deliverable needs. Before any public message it checks necessity, repetition against earlier delivered messages, and brevity. Progress is reserved for new information needing attention before the final answer (a decision/blocker, consequential direction change, or unexpected delay affecting expectations); novelty alone is insufficient. Updates that can wait are combined into the final outcome without recapping earlier messages. The `notify_user` description carries the same policy. Public messages share the existing SSE, durable contact rows, and turn-global indices across web, desktop, VS Code, hosted mobile, and Capacitor. No timer narration, tool logs, progress widgets, or synthetic chat messages are added. Timing of model-authored milestones remains model policy; the transport guarantees immediate delivery once an explicit public record arrives.
514
514
  - Completion notifications use the latest spoken message, keeping earlier progress out of the final notification body. Transcript persistence reconciles by stable bubble IDs and adds only remaining messages.
515
515
  - Tool results remain model context for every tool. The outcome projector uses assistant-authored text only. Terminal operations retain the mutation stop gate. Successful interactive assign/watch gets a result-only Agent on the same provider/model with **only** `reference_resource`, followed by a final reply; no coding, loader or business mutation tool is available. Other terminal operations, failures and resets retain their tools-disabled summary. A failed/empty summary surfaces a turn error; a completed side effect stays committed and is never replayed by the result phase.
516
516
  - Tools-disabled summaries project actual completed tool results into labeled, quoted user-role evidence (tool name, error flag and public text only), removing native call/result framing. Some providers reject historical native calls when their tool definitions are absent. The reference-only phase and ordinary Agent rounds retain native call/result association; no execution or permission fallback is introduced. Reset summaries still receive only the current user request and the successful reset result.
@@ -66,7 +66,7 @@ export function createNotifyUserTool() {
66
66
  return {
67
67
  name: NOTIFY_USER_TOOL_NAME,
68
68
  label: 'Notify user',
69
- description: 'Send the user a short progress message while you keep working; batch it with your next tool call. Use only when it tells them something they do not already know: a direction they may want to correct, a finding that matters, a blocker, or that the work will take a while. Never use it to announce the next step or repeat the plan. The final answer is your plain reply, not this tool.',
69
+ description: 'Send a brief progress message only when new information needs user attention before the final answer: a decision or blocker, a consequential change of direction, or an unexpected delay that changes expectations. Default to working quietly; if the information can wait, include it in the final answer instead. Check earlier public messages to avoid repetition and combine related updates. Batch with your next tool call. The final answer is your plain reply, not this tool.',
70
70
  parameters: typeboxObject({ text: typeboxString('Short message in the user language.') }),
71
71
  execute: async (_toolCallId, params) => {
72
72
  const text = typeof params?.text === 'string' ? params.text.trim() : '';
@@ -107,11 +107,11 @@ export const CONTACT_SYSTEM_PROMPT = [
107
107
  "You are Yuri's in-app assistant — a personable contact focused on understanding the user, communicating naturally, coordinating work, and following up on results.",
108
108
  'For substantive tasks, default to finding the relevant existing OpenCode workspace and handing the task to a worker session with assign_session. Carry the user goal, relevant context, constraints, and verification expectations into that session; follow its results and explain the outcome in normal conversation.',
109
109
  'Handle simple questions, file lookups, and small, clearly scoped configuration changes directly when their scope and verification are straightforward. As a task grows into implementation, multi-step debugging, or broad changes, hand it to a worker session. An explicit user request to handle a bounded task yourself can use the direct tools.',
110
- 'Reply in short chat bubbles: a few sentences each, separated by a blank line.',
111
- 'Talk like a person in the user\'s language. One short spoken bubble at a time — never a wall of paragraphs.',
110
+ 'Default to one short final reply per user request, usually one or two sentences. Lead with the answer and include only what the user needs; expand when the requested deliverable requires detail. Do not split one answer into multiple chat bubbles unnecessarily.',
111
+ 'Talk naturally and say less. Before sending any public message, check that it is necessary, adds information not already delivered in this conversation, and cannot be shortened without losing something the user needs. Omit repeated acknowledgments, plans, status, and conclusions; mention an earlier point again only when requested or needed to explain a change.',
112
112
  'Reply in the language of the user\'s messages, unless they explicitly request another language. Infer it from their latest substantive message and conversation context, never from the app interface locale. For ambiguous messages or background follow-ups, continue the established conversation language.',
113
113
  'Keep private reasoning and tool traces private.',
114
- 'Send a progress message when it tells the user something they do not already know: a direction they may want to correct, a finding that matters, a blocker, or that the work will take a while. Skip messages that would only repeat the plan or narrate a step. Keep the final answer to the remaining outcome instead of repeating earlier updates.',
114
+ 'Work quietly by default. Send a progress message only when new information needs the user\'s attention before the final answer: a decision or blocker, a consequential change of direction, or an unexpected delay that changes their expectations. Novelty alone is not a reason to send. If it can wait, fold it into the final reply; combine related updates instead of sending them separately. Keep the final answer to the remaining outcome without recapping earlier messages.',
115
115
  'Progress messages go only through notify_user, batched with your next tool call; it is delivered immediately. Any other text alongside a tool call is never shown to the user. A response without tool calls is your final reply. Tool results are evidence for you to summarize in your own words; never copy their stock confirmation wording into your reply.',
116
116
  'Do not expose tool traces, Activity, or editor actions.',
117
117
  'Use list_scheduled_tasks to review tasks. To create, change, enable or pause tasks, first load yuri.tasks and use its returned schemas with exact IDs from the listing.',
@@ -138,6 +138,7 @@ export const createClientPairingRuntime = ({
138
138
  allowedClientKinds: normalizeAllowedClientKinds(session.allowedClientKinds),
139
139
  createdByClientId: normalizeOptionalString(session.createdByClientId),
140
140
  usesRelay: session.usesRelay === true,
141
+ relayUrl: session.usesRelay === true ? normalizeOptionalString(session.relayUrl) : null,
141
142
  }))
142
143
  .filter((session) => session.secretHash.length > 0)
143
144
  : [],
@@ -176,7 +177,7 @@ export const createClientPairingRuntime = ({
176
177
  });
177
178
  };
178
179
 
179
- const createPairingSession = async ({ label, allowedClientKinds, createdByClientId, usesRelay } = {}) => {
180
+ const createPairingSession = async ({ label, allowedClientKinds, createdByClientId, usesRelay, relayUrl } = {}) => {
180
181
  return withStoreMutation(async () => {
181
182
  const store = await readStore();
182
183
  sweepExpiredSessionsFromStore(store);
@@ -194,6 +195,7 @@ export const createClientPairingRuntime = ({
194
195
  allowedClientKinds: normalizeAllowedClientKinds(allowedClientKinds),
195
196
  createdByClientId: normalizeOptionalString(createdByClientId),
196
197
  usesRelay: usesRelay === true,
198
+ relayUrl: usesRelay === true ? normalizeOptionalString(relayUrl) : null,
197
199
  };
198
200
  store.sessions.push(session);
199
201
  await writeStore(store);
@@ -279,6 +281,7 @@ export const createClientPairingRuntime = ({
279
281
  deviceModel,
280
282
  appVersion,
281
283
  usesRelay: session.usesRelay === true,
284
+ relayUrl: session.relayUrl,
282
285
  });
283
286
  session.usedAt = nowIso();
284
287
  session.clientId = result.client?.id || null;
@@ -5,6 +5,7 @@ import path from 'node:path';
5
5
  import crypto from 'node:crypto';
6
6
 
7
7
  import { createClientPairingRuntime } from './pairing.js';
8
+ import { createRemoteClientAuthRuntime } from './remote-clients.js';
8
9
 
9
10
  const makeRuntime = async (options = {}) => {
10
11
  const dir = await fs.mkdtemp(path.join(os.tmpdir(), 'yuri-pairing-test-'));
@@ -35,6 +36,46 @@ const makeRuntime = async (options = {}) => {
35
36
  };
36
37
 
37
38
  describe('client auth pairing runtime', () => {
39
+ it('keeps the same device paired through different relays independently across restart', async () => {
40
+ const dir = await fs.mkdtemp(path.join(os.tmpdir(), 'yuri-pairing-relays-test-'));
41
+ const authOptions = { fsPromises: fs, path, crypto, storePath: path.join(dir, 'clients.json') };
42
+ const clients = createRemoteClientAuthRuntime(authOptions);
43
+ const pairingOptions = {
44
+ fsPromises: fs, path, crypto, storePath: path.join(dir, 'pairing.json'), remoteClientAuthRuntime: clients,
45
+ };
46
+ const pair = async (relayUrl, label) => {
47
+ const { pairing } = await createClientPairingRuntime(pairingOptions).createPairingSession({
48
+ label, usesRelay: Boolean(relayUrl), relayUrl,
49
+ });
50
+ return createClientPairingRuntime(pairingOptions).redeemPairingSession({
51
+ pairingId: pairing.id, secret: pairing.secret, clientKind: 'mobile', dedupeKey: 'same-device',
52
+ });
53
+ };
54
+ try {
55
+ const first = await pair('wss://relay-one.example/ws', 'Phone via first relay');
56
+ const second = await pair('wss://relay-two.example/ws', 'Phone via second relay');
57
+ const reopened = createRemoteClientAuthRuntime(authOptions);
58
+ expect((await reopened.listClients()).map((client) => client.id)).toEqual([first.client.id, second.client.id]);
59
+ expect((await reopened.authenticateBearerToken(first.token))?.ok).toBe(true);
60
+ expect((await reopened.authenticateBearerToken(second.token))?.ok).toBe(true);
61
+
62
+ const replacement = await pair('wss://relay-one.example/ws', 'Phone via first relay again');
63
+ expect(await reopened.authenticateBearerToken(first.token)).toBe(null);
64
+ expect((await reopened.authenticateBearerToken(second.token))?.ok).toBe(true);
65
+ expect((await reopened.authenticateBearerToken(replacement.token))?.ok).toBe(true);
66
+ expect(await reopened.listClients()).toHaveLength(2);
67
+
68
+ const direct = await pair(null, 'Phone via LAN');
69
+ expect(await reopened.listClients()).toHaveLength(3);
70
+ await reopened.revokeClient(second.client.id);
71
+ expect(await reopened.authenticateBearerToken(second.token)).toBe(null);
72
+ expect((await reopened.authenticateBearerToken(replacement.token))?.ok).toBe(true);
73
+ expect((await reopened.authenticateBearerToken(direct.token))?.ok).toBe(true);
74
+ } finally {
75
+ await fs.rm(dir, { recursive: true, force: true });
76
+ }
77
+ });
78
+
38
79
  it('redeems a pairing session once and propagates client metadata', async () => {
39
80
  const { runtime, remoteClientAuthRuntime } = await makeRuntime();
40
81
  const created = await runtime.createPairingSession({ allowedClientKinds: ['mobile'] });
@@ -87,6 +87,7 @@ export const createRemoteClientAuthRuntime = ({ fsPromises, path, crypto, storeP
87
87
  clientKind: normalizeOptionalString(client.clientKind),
88
88
  dedupeKey: normalizeOptionalString(client.dedupeKey),
89
89
  usesRelay: client.usesRelay === true,
90
+ relayUrl: client.usesRelay === true ? normalizeOptionalString(client.relayUrl) : null,
90
91
  lastTransport: client.lastTransport === 'relay' || client.lastTransport === 'direct' ? client.lastTransport : null,
91
92
  ...normalizeMetadata(client),
92
93
  }))
@@ -164,6 +165,7 @@ export const createRemoteClientAuthRuntime = ({ fsPromises, path, crypto, storeP
164
165
  deviceModel,
165
166
  appVersion,
166
167
  usesRelay,
168
+ relayUrl,
167
169
  } = {}) => {
168
170
  return withStoreMutation(async () => {
169
171
  const store = await readStore();
@@ -186,16 +188,18 @@ export const createRemoteClientAuthRuntime = ({ fsPromises, path, crypto, storeP
186
188
  deviceModel: normalizeOptionalString(deviceModel),
187
189
  appVersion: normalizeOptionalString(appVersion),
188
190
  usesRelay: usesRelay === true,
191
+ relayUrl: usesRelay === true ? normalizeOptionalString(relayUrl) : null,
189
192
  };
190
193
  if (normalizedDedupeKey) {
191
- store.clients = store.clients.filter((entry) => entry.dedupeKey !== normalizedDedupeKey);
194
+ const sameConnection = (entry) => entry.usesRelay === client.usesRelay && entry.relayUrl === client.relayUrl;
195
+ store.clients = store.clients.filter((entry) => !(sameConnection(entry) && entry.dedupeKey === normalizedDedupeKey));
192
196
  // Migrate pre-clientKind desktop tokens: a deduped, kind-tagged mint
193
197
  // supersedes legacy records with the same label that carry neither a
194
198
  // kind nor a dedupe key — those tokens can no longer pass the
195
199
  // desktop-local client-create gate and would otherwise linger forever.
196
200
  if (client.clientKind) {
197
201
  store.clients = store.clients.filter((entry) =>
198
- !(entry.label === client.label && !entry.clientKind && !entry.dedupeKey));
202
+ !(sameConnection(entry) && entry.label === client.label && !entry.clientKind && !entry.dedupeKey));
199
203
  }
200
204
  }
201
205
  store.clients.push(client);
@@ -153,6 +153,48 @@ describe('remote client auth runtime', () => {
153
153
  }
154
154
  });
155
155
 
156
+ it('preserves legacy relay credentials whose endpoint is unknown', async () => {
157
+ const { dir, runtime } = await createRuntime();
158
+ try {
159
+ const legacy = await runtime.createClient({ label: 'Phone', clientKind: 'mobile', dedupeKey: 'phone', usesRelay: true });
160
+ const untagged = await runtime.createClient({ label: 'Phone', usesRelay: true });
161
+ const storePath = path.join(dir, 'remote-clients.json');
162
+ const store = JSON.parse(await fs.readFile(storePath, 'utf8'));
163
+ for (const client of store.clients) delete client.relayUrl;
164
+ await fs.writeFile(storePath, JSON.stringify(store));
165
+
166
+ const relay = await runtime.createClient({
167
+ label: 'Phone', clientKind: 'mobile', dedupeKey: 'phone', usesRelay: true, relayUrl: 'wss://relay.example/ws',
168
+ });
169
+ const direct = await runtime.createClient({ label: 'Phone', clientKind: 'mobile', dedupeKey: 'phone' });
170
+ expect(await runtime.listClients()).toHaveLength(4);
171
+ for (const connection of [legacy, untagged, relay, direct]) {
172
+ expect((await runtime.authenticateBearerToken(connection.token))?.ok).toBe(true);
173
+ }
174
+ } finally {
175
+ await fs.rm(dir, { recursive: true, force: true });
176
+ }
177
+ });
178
+
179
+ it('keeps every connection credential when a scoped replacement write fails', async () => {
180
+ const { dir, runtime } = await createRuntime();
181
+ try {
182
+ const input = { label: 'Phone', clientKind: 'mobile', dedupeKey: 'phone', usesRelay: true };
183
+ const first = await runtime.createClient({ ...input, relayUrl: 'wss://relay-one.example/ws' });
184
+ const second = await runtime.createClient({ ...input, relayUrl: 'wss://relay-two.example/ws' });
185
+ const failing = createRemoteClientAuthRuntime({
186
+ fsPromises: { ...fs, writeFile: async () => { throw new Error('Write failed'); } },
187
+ path, crypto, storePath: path.join(dir, 'remote-clients.json'),
188
+ });
189
+ await expect(failing.createClient({ ...input, relayUrl: 'wss://relay-one.example/ws' })).rejects.toThrow('Write failed');
190
+ expect((await runtime.listClients()).map((client) => client.id)).toEqual([first.client.id, second.client.id]);
191
+ expect((await runtime.authenticateBearerToken(first.token))?.ok).toBe(true);
192
+ expect((await runtime.authenticateBearerToken(second.token))?.ok).toBe(true);
193
+ } finally {
194
+ await fs.rm(dir, { recursive: true, force: true });
195
+ }
196
+ });
197
+
156
198
  it('does not resurrect revoked clients after concurrent auth traffic', async () => {
157
199
  const { dir, runtime } = await createRuntime();
158
200
  try {
@@ -80,7 +80,20 @@ on its own filesystem. No automatic remote installation or global config edit
80
80
  is performed. Web, Electron, hosted mobile and Capacitor clients use the Host's
81
81
  same bridge. VS Code's extension-owned runtime does not gain a local Host.
82
82
 
83
- `build:llm-bridge` generates `bridge-plugin.bundle.js` with the inference SDK and service tags, not a driver registry.
83
+ `build:llm-bridge` uses tsdown under the repository-pinned Bun runtime to generate `bridge-plugin.bundle.js`
84
+ with the inference SDK and service tags, not a driver registry. OpenCode core/AI
85
+ are build-only dependencies. The build reads the installed core's two service
86
+ keys and emits lookup-only Effect tags, excluding the host's service layers,
87
+ database and tool implementations. The plugin still gets the actual resolver
88
+ and hooks from the external service's Context. The output is one self-contained
89
+ ESM file because staging copies a single plugin file; no external chunks or
90
+ Yuri node_modules are required. The provider regression suite runs against both
91
+ source and the isolated prebundle, including a Bun import outside the workspace.
92
+ The build must not execute upstream core sources under Node 22: they contain
93
+ `await using`, which Node 22 cannot parse. `scripts/build-llm-bridge.test.js`
94
+ exercises the package command with the test runner's Node first on PATH and
95
+ loads the isolated output with that Node; run it on Node 22 and 24 for build
96
+ runtime changes. The generated plugin remains compatible with both runtimes.
84
97
  It is ignored in source control and included in the web package's `server`
85
98
  files. Web build, prepack and development API scripts build it. At runtime the
86
99
  Host copies its bytes into the temporary directory, including when the Host