@yuriai/web 0.2.39 → 0.2.40-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/{AgentAvatar-BPihSrmD.js → AgentAvatar-kQhfwlay.js} +1 -1
- package/dist/assets/{AssistantConversationSurface-CjY5PL5-.js → AssistantConversationSurface-CW3U6Lhp.js} +3 -3
- package/dist/assets/{AssistantConversationSurface-B60CYrok.css → AssistantConversationSurface-n9w_Av0k.css} +1 -1
- package/dist/assets/{AssistantUnreadBadge-Cqm9s7su.js → AssistantUnreadBadge-B2SY-_-u.js} +1 -1
- package/dist/assets/{AssistantView-DQYpQy2m.js → AssistantView-C_hiAuTd.js} +1 -1
- package/dist/assets/{DiagramView-B0BtdArn.js → DiagramView-CzhdZEw4.js} +1 -1
- package/dist/assets/{FadeInOnReveal-tft8IuZn.js → FadeInOnReveal-CMeIdEKz.js} +1 -1
- package/dist/assets/{GuiPluginPage-DbRaxEMz.js → GuiPluginPage-WXqykPAg.js} +1 -1
- package/dist/assets/{GuiPluginSurface-slfiNhjw.js → GuiPluginSurface-BG3hENTt.js} +1 -1
- package/dist/assets/{GuiPluginWindow-CncIyWAp.js → GuiPluginWindow-BLzchKn7.js} +1 -1
- package/dist/assets/{Icon-CGEMyGrr.js → Icon-DygEqfgq.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-DPV84_Pj.js → ImageLoadingPlaceholder-kbBRpDSD.js} +1 -1
- package/dist/assets/{LoadingImage-C54k9D10.js → LoadingImage-DmucvXdY.js} +1 -1
- package/dist/assets/MarkdownRenderer-BkOMcK8x.js +2 -0
- package/dist/assets/{MarkdownRendererImpl-QZCYT1B1.js → MarkdownRendererImpl-B5vJtPoa.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-CH0XdDB8.js → MarkstreamRendererImpl-1J-Gu2M2.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-doWZ3QnX.js → MobileDetailNavigation-48o8aG28.js} +1 -1
- package/dist/assets/{MobileResizableSheet-DmBfNDpy.js → MobileResizableSheet-Dt2U0JHY.js} +1 -1
- package/dist/assets/{MobileShareBridge-CCRDZ5at.js → MobileShareBridge-DnYT3Dbz.js} +1 -1
- package/dist/assets/{MobileTabPageHeader-RIJ0Tv9a.js → MobileTabPageHeader-D6kqRFm0.js} +1 -1
- package/dist/assets/{MultiRunWindow-FISLdCRZ.js → MultiRunWindow-BuRo90Ma.js} +1 -1
- package/dist/assets/{OnboardingScreen-D4OnZuHF.js → OnboardingScreen-Bn0RgrJU.js} +1 -1
- package/dist/assets/{OverlayScrollbar-B5tpZ8bV.js → OverlayScrollbar-B0X61qR-.js} +1 -1
- package/dist/assets/{SettingsView-B9qVD3Y-.js → SettingsView-Bla2lVqS.js} +1 -1
- package/dist/assets/{SettingsWindow-DUlTQkFw.js → SettingsWindow-kCbf8IoB.js} +1 -1
- package/dist/assets/{SetupTourDialog-Cfc1h-8p.js → SetupTourDialog-GDRS3gDa.js} +1 -1
- package/dist/assets/{TerminalView-D0nGaGQc.js → TerminalView-B1u3s7IN.js} +1 -1
- package/dist/assets/{ToolOutputDialog-RBSVUj7J.js → ToolOutputDialog-CYUPmbtq.js} +1 -1
- package/dist/assets/{VoiceSettings-B6L3hyGL.js → VoiceSettings-Dy6-nkQo.js} +1 -1
- package/dist/assets/{appThemeRegistry-CvThoPJW.js → appThemeRegistry--G1XaYmo.js} +1 -1
- package/dist/assets/{capgoAdapter-Bj8RLSP5.js → capgoAdapter-DO1rEVQf.js} +1 -1
- package/dist/assets/{checkbox-CnTrXcOT.js → checkbox-BW80bcK5.js} +1 -1
- package/dist/assets/{collapsible-Brxkw3Ad.js → collapsible-BOL5Wx2J.js} +1 -1
- package/dist/assets/{context-menu-V40RXF6h.js → context-menu-CiFnjP1q.js} +1 -1
- package/dist/assets/{diagram-DmtDqCEH.js → diagram-DRn8iIs1.js} +1 -1
- package/dist/assets/{dialog-wNy9dklb.js → dialog-DQp289fr.js} +1 -1
- package/dist/assets/{fileMentionTouchSelection-B35c9M1S.js → fileMentionTouchSelection-582p0uCX.js} +1 -1
- package/dist/assets/{gitApi-B6T5guw-.js → gitApi-vYBmQIuU.js} +1 -1
- package/dist/assets/{input-DKLf8ixL.js → input-B281XcMR.js} +1 -1
- package/dist/assets/{insertionBoundaries-BT7QMdXR.js → insertionBoundaries-CB4gv9rr.js} +1 -1
- package/dist/assets/{main-Bto3lVGC.js → main-B1KrAdkh.js} +2 -2
- package/dist/assets/{main-wQpnkA8l.js → main-Caf-6KmT.js} +4 -4
- package/dist/assets/{markdownHeightCache-CDLGxKMx.js → markdownHeightCache-BgYJswDy.js} +1 -1
- package/dist/assets/{mcpQueries-W4pdjGH6.js → mcpQueries-CQyOFjX2.js} +1 -1
- package/dist/assets/{miniChat-5-Hv0t6L.js → miniChat-zEoOVjOQ.js} +2 -2
- package/dist/assets/{mobile-CIfJVgvD.js → mobile-Dt8wAkc4.js} +2 -2
- package/dist/assets/{mobileBackNavigation-DEYDDBvo.js → mobileBackNavigation-BbKMa0Jb.js} +1 -1
- package/dist/assets/{mobileConnections-Ciduwjrk.js → mobileConnections-CXYj4P9M.js} +2 -2
- package/dist/assets/{multirun-DH5YM6eW.js → multirun-9v2r_beX.js} +1 -1
- package/dist/assets/{native-config-tZKBxKlJ.js → native-config-BOaqa45X.js} +1 -1
- package/dist/assets/{projectMeta-ByznasuE.js → projectMeta-ZouOo-T_.js} +1 -1
- package/dist/assets/{pwa-6LwD5mEU.js → pwa-syKJBLoe.js} +1 -1
- package/dist/assets/{queue-abort-optimistic-BxQHPU5z.js → queue-abort-optimistic-BYH5yLM2.js} +1 -1
- package/dist/assets/{react-KWIP7CQs.js → react-DPhQUTaH.js} +1 -1
- package/dist/assets/{readiness-aRoinILZ.js → readiness-BpVAjFhF.js} +2 -2
- package/dist/assets/{renderElectronMiniChatApp-CZScT8zj.js → renderElectronMiniChatApp-DprABvit.js} +2 -2
- package/dist/assets/{renderMobileApp-DuXuzELH.js → renderMobileApp-DQmX6iak.js} +4 -4
- package/dist/assets/{runtimeConfig-D6tyDSf2.js → runtimeConfig-7Umh9QWi.js} +1 -1
- package/dist/assets/{runtimeEndpointReset-CTScNTQk.js → runtimeEndpointReset-BYtLmSuX.js} +3 -3
- package/dist/assets/{select-CM7BZ8sO.js → select-CyPxbnW8.js} +1 -1
- package/dist/assets/{sessionLookup-BU5wx0-q.js → sessionLookup-D_fPlqqT.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-DucBEuLZ.js → sortable-tabs-strip-BclS0Hnd.js} +1 -1
- package/dist/assets/{speechSettingsQueries-BP-b2-GN.js → speechSettingsQueries-CTsBn-Ib.js} +1 -1
- package/dist/assets/{src-CCKR0Tmd.css → src-HgtAe3Q4.css} +1 -1
- package/dist/assets/{textarea-C8G6xLAC.js → textarea-CjJsstUF.js} +1 -1
- package/dist/assets/{tooltip-CeCFnNNR.js → tooltip-Di_DSZ8p.js} +1 -1
- package/dist/assets/types-wnqkJWYs.js +2 -0
- package/dist/assets/{useAppFontEffects-B2DfbicL.js → useAppFontEffects-BRMf55oN.js} +5 -5
- package/dist/assets/{useDesktopWindowControlsLayout-CD1Nr6Ms.js → useDesktopWindowControlsLayout-Bq9DFNYn.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-DT950TGk.js → useEffectiveDirectory-5RwQ_nuK.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-CXnVqWpM.js → useMobileNavigationStore-ePbEoQwb.js} +4 -4
- package/dist/assets/{usePluginsStore-DIah6ngo.js → usePluginsStore-HJJZ65gd.js} +1 -1
- package/dist/assets/{useStreamingTextThrottle-BrP3Yc-q.js → useStreamingTextThrottle-CjMALEr7.js} +1 -1
- package/dist/assets/{useWorkerHighlightedLines-tpb9bWVl.js → useWorkerHighlightedLines-6x1R4afJ.js} +1 -1
- package/dist/index.html +6 -6
- package/dist/mini-chat.html +6 -6
- package/dist/mobile.html +2 -2
- package/package.json +1 -1
- package/server/lib/assistants/DOCUMENTATION.md +15 -3
- package/server/lib/assistants/builtin-skills.js +19 -0
- package/server/lib/assistants/builtin-skills.test.js +38 -0
- package/server/lib/assistants/harness.js +2 -0
- package/server/lib/assistants/harness.test.js +41 -1
- package/server/lib/assistants/service.test.js +3 -0
- package/server/lib/gui-customization/DOCUMENTATION.md +6 -0
- package/dist/assets/MarkdownRenderer-DBZS1O3m.js +0 -2
- package/dist/assets/types-Zl9uYRiX.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,n as t}from"./runtime-switch-BMjl5Y5W.js";import{n}from"./runtime-fetch-DKZOpfzo.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{kn as l}from"./gitApiHttp-D4d-rgcR.js";import{w as u}from"./useUIStore-vvNwcOk3.js";import{n as d}from"./vendor-react-DlzBev0S.js";import{s as f}from"./vendor-tanstack-react-query-B-Wpqq5J.js";import{_ as p,g as m,h}from"./fileQueries-D9l0crnM.js";import{t as g}from"./i18n-UaLestuf.js";import{Ea as _,Jn as v,Kn as y,wa as b}from"./useMobileNavigationStore-CXnVqWpM.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=v(`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)(y,{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=v(`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=v(`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=v(`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 _;return t[15]!==s||t[16]!==f||t[17]!==p||t[18]!==h||t[19]!==g?(_=(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]=_):_=t[20],_}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=v(`yuri-settings-group-row yuri-settings-split-row`,s),t[0]=s,t[1]=u);let d;t[2]===c?d=t[3]:(d=v(`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=v(`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 _;t[17]===a?_=t[18]:(_=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]=_);let y;return t[19]!==o||t[20]!==u||t[21]!==m||t[22]!==g||t[23]!==_?(y=(0,S.jsxs)(`div`,{"data-settings-item":o,className:u,children:[m,g,_]}),t[19]=o,t[20]=u,t[21]=m,t[22]=g,t[23]=_,t[24]=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=v(`yuri-settings-group-row yuri-settings-split-row group`,m,l),t[4]=l,t[5]=m,t[6]=h):h=t[6];let g=u?-1:0,_=u||void 0,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]!==_||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":_,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]=_,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())=>p.plugins.list(t,n),P=(t,n,r=!1,i=e())=>p.plugins.registry(t,n,r,i),F=(t,n=e())=>p.plugins.runtime(t,n),I=0,L=()=>(I+=1,I),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(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=h(r);return{queryKey:o?[...P(s,c,i,a),`details`]:P(s,c,i,a),queryFn:async({signal:e})=>{let t={};for(let r of _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=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(m,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=_(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=_(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=_(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=_.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 p=K.get(l);if(!n?.force&&p)return p;let h=(async()=>{r({isLoading:!0});try{let e=n?.force?await H(m,a,o):await m.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=(m.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(m,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-BMjl5Y5W.js";import{n}from"./runtime-fetch-DKZOpfzo.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{kn as l}from"./gitApiHttp-D4d-rgcR.js";import{w as u}from"./useUIStore-vvNwcOk3.js";import{n as d}from"./vendor-react-DlzBev0S.js";import{s as f}from"./vendor-tanstack-react-query-B-Wpqq5J.js";import{_ as p,g as m,h}from"./fileQueries-D9l0crnM.js";import{t as g}from"./i18n-UaLestuf.js";import{Ea as _,Jn as v,Kn as y,wa as b}from"./useMobileNavigationStore-ePbEoQwb.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=v(`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)(y,{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=v(`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=v(`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=v(`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 _;return t[15]!==s||t[16]!==f||t[17]!==p||t[18]!==h||t[19]!==g?(_=(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]=_):_=t[20],_}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=v(`yuri-settings-group-row yuri-settings-split-row`,s),t[0]=s,t[1]=u);let d;t[2]===c?d=t[3]:(d=v(`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=v(`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 _;t[17]===a?_=t[18]:(_=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]=_);let y;return t[19]!==o||t[20]!==u||t[21]!==m||t[22]!==g||t[23]!==_?(y=(0,S.jsxs)(`div`,{"data-settings-item":o,className:u,children:[m,g,_]}),t[19]=o,t[20]=u,t[21]=m,t[22]=g,t[23]=_,t[24]=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=v(`yuri-settings-group-row yuri-settings-split-row group`,m,l),t[4]=l,t[5]=m,t[6]=h):h=t[6];let g=u?-1:0,_=u||void 0,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]!==_||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":_,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]=_,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())=>p.plugins.list(t,n),P=(t,n,r=!1,i=e())=>p.plugins.registry(t,n,r,i),F=(t,n=e())=>p.plugins.runtime(t,n),I=0,L=()=>(I+=1,I),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(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=h(r);return{queryKey:o?[...P(s,c,i,a),`details`]:P(s,c,i,a),queryFn:async({signal:e})=>{let t={};for(let r of _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=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(m,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=_(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=_(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=_(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=_.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 p=K.get(l);if(!n?.force&&p)return p;let h=(async()=>{r({isLoading:!0});try{let e=n?.force?await H(m,a,o):await m.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=(m.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(m,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/{useStreamingTextThrottle-BrP3Yc-q.js → useStreamingTextThrottle-CjMALEr7.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./platform-DMsFWy1a.js";import{st as n}from"./vendor-base-ui-CzHs0bHY.js";import{r}from"./FadeInOnReveal-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./platform-DMsFWy1a.js";import{st as n}from"./vendor-base-ui-CzHs0bHY.js";import{r}from"./FadeInOnReveal-CMeIdEKz.js";var i=e(n(),1),a=(e,t,n)=>{let r=t-e;return Math.max(0,n-r)},o=e=>{e.timer&&=(clearTimeout(e.timer),null)},s=({text:e,isStreaming:n,throttleMs:s=r(t()).textThrottleMs,identityKey:c})=>{let[l,u]=i.useState(e),d=i.useRef(e),f=i.useRef(l),p=i.useRef({timer:null,pendingText:e,lastEmitAt:0});return i.useEffect(()=>{d.current=e},[e]),i.useEffect(()=>{f.current=l},[l]),i.useEffect(()=>{let e=p.current;o(e),e.pendingText=d.current,e.lastEmitAt=0,u(d.current)},[c]),i.useEffect(()=>{let t=p.current;t.pendingText=e;let r=f.current,i=n&&r.length>e.length?r:e;if(!n){o(t),t.lastEmitAt=Date.now(),u(i);return}let c=Date.now(),l=a(t.lastEmitAt,c,s);if(l<=0){o(t),t.lastEmitAt=c,u(i);return}return o(t),t.timer=setTimeout(()=>{t.timer=null,t.lastEmitAt=Date.now(),u(e=>n&&e.length>t.pendingText.length?e:t.pendingText)},l),()=>{o(t)}},[n,e,s]),i.useEffect(()=>{let e=p.current;return()=>{o(e)}},[]),l};export{s as t};
|
package/dist/assets/{useWorkerHighlightedLines-tpb9bWVl.js → useWorkerHighlightedLines-6x1R4afJ.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{S as r}from"./useUIStore-vvNwcOk3.js";import{n as i}from"./vendor-react-DlzBev0S.js";import{t as a}from"./i18n-UaLestuf.js";import{Jn as o,Kn as s}from"./useMobileNavigationStore-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-CzHs0bHY.js";import{S as r}from"./useUIStore-vvNwcOk3.js";import{n as i}from"./vendor-react-DlzBev0S.js";import{t as a}from"./i18n-UaLestuf.js";import{Jn as o,Kn as s}from"./useMobileNavigationStore-ePbEoQwb.js";import{n as c}from"./useThemeSystem-CNzUUkFn.js";import{n as l}from"./Icon-DygEqfgq.js";import{n as u}from"./MarkdownRenderer-BkOMcK8x.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-B1KrAdkh.js"></script>
|
|
575
575
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
|
|
576
576
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
577
577
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
@@ -605,11 +605,11 @@
|
|
|
605
605
|
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-D4d-rgcR.js">
|
|
606
606
|
<link rel="modulepreload" crossorigin href="/assets/terminalApi-DK4KmfFn.js">
|
|
607
607
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-DMY1k1af.js">
|
|
608
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
609
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
610
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
611
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
612
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
608
|
+
<link rel="modulepreload" crossorigin href="/assets/types-wnqkJWYs.js">
|
|
609
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-DO1rEVQf.js">
|
|
610
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-BOaqa45X.js">
|
|
611
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-7Umh9QWi.js">
|
|
612
|
+
<link rel="stylesheet" crossorigin href="/assets/src-HgtAe3Q4.css">
|
|
613
613
|
</head>
|
|
614
614
|
<body class="h-full bg-background text-foreground">
|
|
615
615
|
<!-- 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-zEoOVjOQ.js"></script>
|
|
81
81
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
83
83
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
@@ -111,11 +111,11 @@
|
|
|
111
111
|
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-D4d-rgcR.js">
|
|
112
112
|
<link rel="modulepreload" crossorigin href="/assets/terminalApi-DK4KmfFn.js">
|
|
113
113
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-DMY1k1af.js">
|
|
114
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
115
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
116
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
117
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
118
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
114
|
+
<link rel="modulepreload" crossorigin href="/assets/types-wnqkJWYs.js">
|
|
115
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-DO1rEVQf.js">
|
|
116
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-BOaqa45X.js">
|
|
117
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-7Umh9QWi.js">
|
|
118
|
+
<link rel="stylesheet" crossorigin href="/assets/src-HgtAe3Q4.css">
|
|
119
119
|
</head>
|
|
120
120
|
<body class="h-full bg-background text-foreground">
|
|
121
121
|
<div id="root" class="h-full">
|
package/dist/mobile.html
CHANGED
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
</script>
|
|
65
65
|
|
|
66
66
|
<style>.dark #mobile-startup-logo img { filter: invert(1); }</style>
|
|
67
|
-
<script type="module" crossorigin src="/assets/mobile-
|
|
67
|
+
<script type="module" crossorigin src="/assets/mobile-Dt8wAkc4.js"></script>
|
|
68
68
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
|
|
69
69
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
70
70
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
71
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
71
|
+
<link rel="stylesheet" crossorigin href="/assets/src-HgtAe3Q4.css">
|
|
72
72
|
</head>
|
|
73
73
|
<body class="h-full bg-background text-foreground">
|
|
74
74
|
<div id="root" class="h-full">
|
package/package.json
CHANGED
|
@@ -469,10 +469,22 @@ also exercised the real provider: the contact selected provider discovery and
|
|
|
469
469
|
`websearch`, then returned actual source links, without a CLI or worker session.
|
|
470
470
|
|
|
471
471
|
Interactive turns no longer fetch or inject the OpenCode built-in skill by default.
|
|
472
|
-
|
|
472
|
+
`builtin-skills.js` adds only two short discovery pointers, gated by the granted
|
|
473
|
+
readers: `opencode` uses `load_tools({ domain: 'opencode.catalog' })` followed by
|
|
474
|
+
`read_opencode_skill({ id: 'opencode' })`; `yuri-customization` uses pi `read` on
|
|
475
|
+
the existing shipped `../gui-customization/skill/SKILL.md`, then matching references
|
|
476
|
+
relative to that file's directory. No body or reference is read during prompt
|
|
477
|
+
construction, no additional skill directories are scanned, and no skill/config
|
|
478
|
+
copy, tool registration or permission is created. Missing/failed OpenCode skill
|
|
479
|
+
reads retain the existing explicit tool errors. These pointers are absent from
|
|
480
|
+
read-only background reviews and do not change ordinary Session instructions.
|
|
481
|
+
The customization pointer explicitly has no bound desktop helper: SSH, config
|
|
482
|
+
sync and Relay pairing remain unavailable in the contact, without a filesystem,
|
|
483
|
+
credential or internal-HTTP fallback. GUI authoring instructions do not authorize
|
|
484
|
+
installation; substantive implementation still belongs in a worker.
|
|
473
485
|
CLI authentication instructions, endpoint URLs and skill bodies are not duplicated
|
|
474
|
-
|
|
475
|
-
`read_opencode_skill`
|
|
486
|
+
in the permanent prompt. For other connected skills, load `opencode.catalog`,
|
|
487
|
+
discover the applicable skill ID, and call `read_opencode_skill` on demand. The virtual
|
|
476
488
|
`/builtin/opencode.md` / `<built-in>` markers are not local files. A skill result is
|
|
477
489
|
instruction content, not tool registration or evidence of execution. Local skill
|
|
478
490
|
indexes and `read` retain their existing separate instruction-loading behavior.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
|
|
4
|
+
const customizationSkillPath = fileURLToPath(new URL('../gui-customization/skill/SKILL.md', import.meta.url));
|
|
5
|
+
|
|
6
|
+
export function formatAssistantBuiltinSkillsPrompt(tools) {
|
|
7
|
+
const names = new Set(tools.map((tool) => tool.name));
|
|
8
|
+
const skills = [];
|
|
9
|
+
if (names.has('read_opencode_skill')) {
|
|
10
|
+
skills.push('- opencode: For OpenCode itself: configuration, agents, skills, tools, permissions, MCP, providers, plugins, CLI, SDK/API and troubleshooting. Load load_tools({"domain":"opencode.catalog"}), then read_opencode_skill({"id":"opencode"}); continue with nextOffset when partial. Use the current connected catalog, not a copied skill body or a virtual built-in file path.');
|
|
11
|
+
}
|
|
12
|
+
if (names.has('read')) {
|
|
13
|
+
skills.push(`- yuri-customization: For Yuri appearance, themes/CSS/layout, logos/Dock, GUI plugins, pages/tabs, widgets, file previews/exports, panels and settings, or SSH/config-sync/Relay capability boundaries. Load with read({"path":${JSON.stringify(customizationSkillPath)}}), then read only the matching references relative to ${JSON.stringify(path.dirname(customizationSkillPath))}. This contact has no bound local desktop helper for SSH, configuration sync or Relay pairing; those operations are unavailable here. Reading the skill does not create that authorization.`);
|
|
14
|
+
}
|
|
15
|
+
return skills.length > 0 ? [
|
|
16
|
+
'Built-in skills (progressive instructions): load the matching skill before following its workflow. Reading instructions does not mount tools or grant permissions; use the actual contact tools, or assign substantive implementation to a worker with the relevant context.',
|
|
17
|
+
...skills,
|
|
18
|
+
].join('\n') : '';
|
|
19
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { describe, expect, it } from 'vitest';
|
|
5
|
+
import { formatAssistantBuiltinSkillsPrompt } from './builtin-skills.js';
|
|
6
|
+
|
|
7
|
+
describe('assistant built-in skill pointers', () => {
|
|
8
|
+
it('advertises only the two requested skills, with existing instruction readers', () => {
|
|
9
|
+
const prompt = formatAssistantBuiltinSkillsPrompt([{ name: 'read' }, { name: 'read_opencode_skill' }]);
|
|
10
|
+
expect(prompt.match(/^- /gm)).toHaveLength(2);
|
|
11
|
+
expect(prompt).toContain('load_tools({"domain":"opencode.catalog"})');
|
|
12
|
+
expect(prompt).toContain('read_opencode_skill({"id":"opencode"})');
|
|
13
|
+
expect(prompt).toContain('nextOffset');
|
|
14
|
+
expect(prompt).toContain('no bound local desktop helper');
|
|
15
|
+
expect(prompt).toContain('does not create that authorization');
|
|
16
|
+
expect(prompt).not.toContain('.opencode/skills');
|
|
17
|
+
|
|
18
|
+
const file = JSON.parse(prompt.match(/read\(\{"path":(".*?")\}\)/)[1]);
|
|
19
|
+
const expected = fileURLToPath(new URL('../gui-customization/skill/SKILL.md', import.meta.url));
|
|
20
|
+
expect(file).toBe(expected);
|
|
21
|
+
expect(prompt).toContain(JSON.stringify(path.dirname(expected)));
|
|
22
|
+
const source = fs.readFileSync(file, 'utf8');
|
|
23
|
+
expect(prompt).not.toContain('## Workflow');
|
|
24
|
+
for (const [, reference] of source.matchAll(/\]\((references\/[^)]+)\)/g)) {
|
|
25
|
+
expect(fs.existsSync(path.join(path.dirname(file), reference))).toBe(true);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('omits pointers whose readers were not granted', () => {
|
|
30
|
+
expect(formatAssistantBuiltinSkillsPrompt([])).toBe('');
|
|
31
|
+
const local = formatAssistantBuiltinSkillsPrompt([{ name: 'read' }]);
|
|
32
|
+
expect(local).toContain('- yuri-customization:');
|
|
33
|
+
expect(local).not.toContain('- opencode:');
|
|
34
|
+
const connected = formatAssistantBuiltinSkillsPrompt([{ name: 'read_opencode_skill' }]);
|
|
35
|
+
expect(connected).toContain('- opencode:');
|
|
36
|
+
expect(connected).not.toContain('- yuri-customization:');
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -5,6 +5,7 @@ import { createProgressiveTools } from './progressive-tools.js';
|
|
|
5
5
|
import { createYuriContactToolGroups } from './yuri-tools.js';
|
|
6
6
|
import { createOpenCodeContactToolGroups } from './opencode-tools.js';
|
|
7
7
|
import { createContactToolLimiter } from './tool-execution.js';
|
|
8
|
+
import { formatAssistantBuiltinSkillsPrompt } from './builtin-skills.js';
|
|
8
9
|
import {
|
|
9
10
|
contactTurnClearedChatHistory,
|
|
10
11
|
contactTurnHasSuccessfulReset,
|
|
@@ -536,6 +537,7 @@ export async function runContactTurn({
|
|
|
536
537
|
cwd: runtime?.cwd,
|
|
537
538
|
skillsPrompt: runtime?.skillsPrompt,
|
|
538
539
|
}),
|
|
540
|
+
readOnly ? '' : formatAssistantBuiltinSkillsPrompt([...codingTools, ...contactTools]),
|
|
539
541
|
assistant.defaultPrompt,
|
|
540
542
|
codingTools.length > 0 ? WORKSPACE_RESPONSE_PROTOCOL : '',
|
|
541
543
|
'Actual tool results arrive in tool-role messages; never manufacture them.',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs'
|
|
2
2
|
import os from 'node:os'
|
|
3
3
|
import path from 'node:path'
|
|
4
|
+
import { fileURLToPath } from 'node:url'
|
|
4
5
|
import { describe, expect, it, vi } from 'vitest'
|
|
5
6
|
import {
|
|
6
7
|
CLEAR_CHAT_HISTORY_TOOL_NAME,
|
|
@@ -98,12 +99,51 @@ describe('createContactStreamFn', () => {
|
|
|
98
99
|
const seen = [];
|
|
99
100
|
const tools = createContactTools({ listScheduledTasks: vi.fn(), updateScheduledTask: vi.fn() });
|
|
100
101
|
await runContactTurn({ assistant: { providerID: 'p', modelID: 'm' }, history: [], userText: '后台复盘', tools, readOnly: true,
|
|
101
|
-
createChatCompletion: async ({ body }) => {
|
|
102
|
+
createChatCompletion: async ({ body }) => {
|
|
103
|
+
seen.push(...body.tools.map(tool => tool.function.name));
|
|
104
|
+
expect(body.messages.find((message) => message.role === 'system').content).not.toContain('Built-in skills (progressive instructions)');
|
|
105
|
+
return { text: '已检查。' };
|
|
106
|
+
},
|
|
102
107
|
});
|
|
103
108
|
expect(seen).toContain('list_scheduled_tasks');
|
|
104
109
|
expect(seen).not.toContain('update_scheduled_task');
|
|
105
110
|
expect(seen).not.toContain('bash');
|
|
106
111
|
});
|
|
112
|
+
|
|
113
|
+
it('progressively reads the shared Yuri skill and its matching reference through real pi tools', async () => {
|
|
114
|
+
const workspace = fs.mkdtempSync(path.join(os.tmpdir(), 'yuri-builtin-skill-'));
|
|
115
|
+
const skill = fileURLToPath(new URL('../gui-customization/skill/SKILL.md', import.meta.url));
|
|
116
|
+
const reference = path.join(path.dirname(skill), 'references', 'plugin-styles.md');
|
|
117
|
+
let round = 0;
|
|
118
|
+
try {
|
|
119
|
+
const result = await runContactTurn({
|
|
120
|
+
assistant: { providerID: 'p', modelID: 'm', workspacePath: workspace },
|
|
121
|
+
history: [], userText: '看看 Yuri 插件可以用哪些样式变量,不要修改。', skillHomeDir: workspace,
|
|
122
|
+
createChatCompletion: async ({ body }) => {
|
|
123
|
+
round++;
|
|
124
|
+
const system = body.messages.find((message) => message.role === 'system').content;
|
|
125
|
+
expect(system).toContain('- yuri-customization:');
|
|
126
|
+
expect(system).toContain(JSON.stringify(skill));
|
|
127
|
+
expect(system).toContain('no bound local desktop helper');
|
|
128
|
+
expect(system).not.toContain('## Workflow');
|
|
129
|
+
if (round === 1) {
|
|
130
|
+
expect(body.messages.some((message) => message.role === 'tool')).toBe(false);
|
|
131
|
+
return toolCall('read', { path: skill }, 'read-yuri-skill');
|
|
132
|
+
}
|
|
133
|
+
const loaded = body.messages.find((message) => message.tool_call_id === 'read-yuri-skill');
|
|
134
|
+
expect(loaded.content).toContain('## Workflow');
|
|
135
|
+
expect(loaded.content).toContain('references/plugin-styles.md');
|
|
136
|
+
if (round === 2) return toolCall('read', { path: reference, limit: 30 }, 'read-yuri-reference');
|
|
137
|
+
const styles = body.messages.find((message) => message.tool_call_id === 'read-yuri-reference');
|
|
138
|
+
expect(styles.content).toContain(fs.readFileSync(reference, 'utf8').split('\n')[0]);
|
|
139
|
+
return { text: '可以使用 Yuri 提供的 CSS 变量;未做修改。' };
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
expect(result.text).toContain('未做修改');
|
|
143
|
+
expect(round).toBe(3);
|
|
144
|
+
expect(fs.readdirSync(workspace)).toEqual([]);
|
|
145
|
+
} finally { fs.rmSync(workspace, { recursive: true, force: true }); }
|
|
146
|
+
});
|
|
107
147
|
it('runs scheduled-task listing and updating through native schemas and the real pi loop', async () => {
|
|
108
148
|
const listScheduledTasks = vi.fn(async () => ({ tasks: [{ id: 'task1', projectID: 'project1' }] }));
|
|
109
149
|
const updateScheduledTask = vi.fn(async () => ({ task: { id: 'task1', name: 'Task', schedule: { kind: 'daily', times: ['09:00'] }, execution: { providerID: 'p', modelID: 'm' } } }));
|
|
@@ -4277,6 +4277,9 @@ describe('assistants service', () => {
|
|
|
4277
4277
|
const createChatCompletion = vi.fn(async ({ body }) => {
|
|
4278
4278
|
round++;
|
|
4279
4279
|
const system = body.messages.find((message) => message.role === 'system').content;
|
|
4280
|
+
expect(system).toContain('- opencode: For OpenCode itself:');
|
|
4281
|
+
expect(system).toContain('read_opencode_skill({"id":"opencode"})');
|
|
4282
|
+
expect(system).toContain('- yuri-customization:');
|
|
4280
4283
|
expect(system).not.toContain(skillContent);
|
|
4281
4284
|
expect(system).not.toContain('opencode api without --server');
|
|
4282
4285
|
expect(system).not.toContain('Unrelated skill content');
|
|
@@ -7,6 +7,12 @@ short discovery pointer enters `session.instructions.entry` under
|
|
|
7
7
|
no global OpenCode config, installed user skills, project files or old sessions
|
|
8
8
|
are modified.
|
|
9
9
|
|
|
10
|
+
Interactive Yuri contacts reuse this same shipped entry and references through
|
|
11
|
+
the assistant-only pointer in `../assistants/builtin-skills.js`. Their pi tools
|
|
12
|
+
run on the Host, so the pointer names the package-local resource directly rather
|
|
13
|
+
than staging a Session instruction. It advertises no bound desktop helper and
|
|
14
|
+
grants no SSH/config-sync/Relay capability. Read-only background reviews omit it.
|
|
15
|
+
|
|
10
16
|
References are organized by capability: window APIs, appearance, UI surfaces, plugin styles, global pages, work-status widgets, icons,
|
|
11
17
|
file parsing/previews, preview actions/exports, and package workflow. Host contracts
|
|
12
18
|
and verification criteria are separate from illustrative templates and case
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkstreamRendererImpl-CH0XdDB8.js","assets/rolldown-runtime-hePW80VL.js","assets/platform-DMsFWy1a.js","assets/runtime-auth-mjIpsk3N.js","assets/runtime-switch-BMjl5Y5W.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/vendor-base-ui-CzHs0bHY.js","assets/useUIStore-vvNwcOk3.js","assets/reasoning-projection-client-BEhVknv9.js","assets/vendor-zustand-vDaAPGfl.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/useMobileHtmlPreviewStore-C03uVLfX.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/vendor-react-DlzBev0S.js","assets/fileQueries-D9l0crnM.js","assets/runtime-fetch-DKZOpfzo.js","assets/vendor-tanstack-query-core-Y_YoRHtC.js","assets/vendor-tanstack-react-query-B-Wpqq5J.js","assets/vendor-markstream-react-6zxyQLCD.js","assets/vendor-markstream-core-Cm34iPLL.js","assets/vendor-floating-ui-dom-BHhLtF5l.js","assets/vendor-floating-ui-core-Co1I1lFV.js","assets/vendor-reactuses-core-CuTmqEMK.js","assets/vendor-lodash-es-BS45jPoZ.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/useMobileNavigationStore-CXnVqWpM.js","assets/gitApiHttp-D4d-rgcR.js","assets/vendor-opencode-client-cQ47ywrT.js","assets/vendor-effect-X1Hqc7ba.js","assets/vendor-pathe-vBmvQE8f.js","assets/runtime-file-resource-CL7EVzOG.js","assets/runtime-file-store-BVRgEtI-.js","assets/path-utils-jGozTg9d.js","assets/bootstrap-BhC95qVC.js","assets/runtime-ead7P81A.js","assets/pathNormalization-ewtPqJWn.js","assets/vendor-sonner-BEHGipm5.js","assets/i18n-UaLestuf.js","assets/store-CzVMz42v.js","assets/tour-DDI0Zg7l.js","assets/useAssistantUIStore-nNYL140o.js","assets/vendor-zod-DZzbCm1s.js","assets/vendor-opencode-schema-DWT45VBX.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/useThemeSystem-CNzUUkFn.js","assets/vendor-framer-motion-DDMKlXiP.js","assets/tooltip-CeCFnNNR.js","assets/useEffectiveDirectory-DT950TGk.js","assets/image-loading-BrDob6MW.js","assets/image-loading-DA9JEHD8.css","assets/LoadingImage-C54k9D10.js","assets/ImageLoadingPlaceholder-DPV84_Pj.js","assets/FadeInOnReveal-tft8IuZn.js","assets/markdownHeightCache-CDLGxKMx.js","assets/dualLimitLru-D8Sphgua.js","assets/useStreamingTextThrottle-BrP3Yc-q.js","assets/MarkdownRendererImpl-QZCYT1B1.js","assets/vendor-katex-DNVSTX6g.js","assets/themes-BgDJcxRc.js","assets/vendor-marked-S3gCOYp1.js","assets/markdownTheme-CHNl6tUv.js","assets/vendor-pierre-diffs-BFiZ3IhI.js","assets/vendor-hast-util-to-html-Bw_SgZ1t.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-BMOrLc9L.js","assets/markdown-worker-oBGEB9Eg.js","assets/vendor-morphdom-BbKiNDAu.js","assets/vendor-dompurify-CeJNOzik.js","assets/vendor-pele-C1WTNWUm.js","assets/vendor-remend-C3cXc-tf.js","assets/fileReferenceActions-BmquJskG.js","assets/toolHelpers-iEHVHQ9p.js","assets/fileReferenceParser-1HHDBUum.js","assets/MarkstreamRendererImpl-C6aiJnjl.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{a as t}from"./vendor-zustand-vDaAPGfl.js";import{ot as n,st as r}from"./vendor-base-ui-CzHs0bHY.js";import"./brand-storage-bootstrap-D4BW3w-M.js";import{n as i}from"./vendor-react-DlzBev0S.js";import{o as a}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{Jn as o}from"./useMobileNavigationStore-CXnVqWpM.js";import{t as s}from"./useEffectiveDirectory-DT950TGk.js";import{i as c,n as l,t as u}from"./markdownHeightCache-CDLGxKMx.js";var d=e(r(),1),f=i(),p=(e,t)=>{try{let n=t??(typeof localStorage>`u`?null:localStorage);return!n||n.getItem(e)!==`0`}catch{return!0}},m=(e,t)=>{try{typeof localStorage<`u`&&localStorage.setItem(e,t?`1`:`0`)}catch{}},h=`yuri:markstream-react`,g=e=>p(h,e),_=t(e=>({markstreamReactEnabled:g(),setMarkstreamReactEnabled:t=>{m(h,t),e({markstreamReactEnabled:t})}})),v=null,y=()=>(v??=a(()=>import(`./MarkstreamRendererImpl-CH0XdDB8.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81])).catch(e=>{throw v=null,e}),v),b=()=>{y().catch(()=>void 0)},x=null,S=()=>(x??=a(()=>import(`./MarkdownRendererImpl-QZCYT1B1.js`).then(e=>e.n),__vite__mapDeps([58,1,4,3,2,5,6,7,8,9,10,11,12,13,14,15,16,17,18,59,23,24,25,38,34,35,39,40,26,27,28,29,30,31,32,33,36,37,41,42,43,44,45,56,46,60,49,50,51,54,55,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80])).catch(e=>{throw x=null,e}),x),C=()=>{S().catch(()=>void 0),g()&&b()},w=`yuri:chunk-import-reload`,T=250,E=3e4,D=[/Importing a module script failed/i,/Failed to fetch dynamically imported module/i,/error loading dynamically imported module/i,/Loading chunk \S+ failed/i,/ChunkLoadError/i];function O(e){if(e instanceof Error)return`${e.name}\n${e.message}\n${e.stack??``}`;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function k(e){let t=O(e);return D.some(e=>e.test(t))}function A(e){return`0.2.39:${O(e).slice(0,500)}`}function j(e){if(typeof window>`u`)return;let t=Date.now(),n=A(e),r=null;try{let e=window.sessionStorage.getItem(w);if(e)try{r=JSON.parse(e)}catch{r=null}}catch{return}let i=typeof r?.timestamp==`number`?r.timestamp:0;if(!(r?.signature===n&&t-i<E)){try{window.sessionStorage.setItem(w,JSON.stringify({signature:n,timestamp:t}))}catch{return}console.error(`[refresh-debug] chunk-import-reload`,{error:O(e).slice(0,1e3)}),window.setTimeout(()=>{window.location.reload()},0)}}async function M(e,t={}){let n=t.retries??1,r;for(let t=0;t<=n;t+=1)try{return await e()}catch(e){if(r=e,!k(e)||t>=n)break;await new Promise(e=>setTimeout(e,T*(t+1)))}throw k(r)&&j(r),r}var N=e=>(0,d.lazy)(()=>M(e)),P=(e,t)=>!!t?.toLowerCase().startsWith(`video/`)||/^data:video\//i.test(e)||/\.(?:mp4|m4v|webm|mov|ogv|ogg)(?:[?#]|$)/i.test(e),F=class extends d.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){console.warn(`[markstream-react] falling back to the current Markdown renderer`,e)}render(){return this.state.hasError?this.props.fallback:this.props.children}},I=d.createContext(!0),L=()=>d.useContext(I),R=n(),z=N(()=>S().then(e=>({default:e.MarkdownRenderer}))),B=N(()=>y().then(e=>({default:e.MarkstreamRenderer}))),V=N(()=>S().then(e=>({default:e.SimpleMarkdownRenderer}))),H=e=>e===`tool`?`markdown-content markdown-tool`:e===`reasoning`?`markdown-content markdown-reasoning`:`markdown-content leading-relaxed`,U=e=>{let t=(0,f.c)(15),n=_(K),r=typeof e.content==`string`?e.content:``,i=typeof e.variant==`string`?e.variant:`assistant`,a;t[0]!==r||t[1]!==n||t[2]!==e.reserveMeasuredHeight||t[3]!==i?(a=e.reserveMeasuredHeight?l(u(r,n?`markstream:${i}`:i)):void 0,t[0]=r,t[1]=n,t[2]=e.reserveMeasuredHeight,t[3]=i,t[4]=a):a=t[4];let s=a,d;t[5]!==e.className||t[6]!==e.variant?(d=o(`relative break-words w-full min-w-0`,H(e.variant),typeof e.className==`string`?e.className:void 0),t[5]=e.className,t[6]=e.variant,t[7]=d):d=t[7];let p;t[8]!==r||t[9]!==e.animated||t[10]!==s?(p=(0,R.jsx)(c,{animated:e.animated,content:r,reservedHeight:s}),t[8]=r,t[9]=e.animated,t[10]=s,t[11]=p):p=t[11];let m;return t[12]!==d||t[13]!==p?(m=(0,R.jsx)(`div`,{className:d,"aria-busy":`true`,"data-markdown-hydration":`deferred`,"data-markdown-ready":`false`,children:p}),t[12]=d,t[13]=p,t[14]=m):m=t[14],m},W=e=>{let t=(0,f.c)(13),n=L(),r=_(q);if(!n&&e.isStreaming!==!0){let n;return t[0]===e?n=t[1]:(n=(0,R.jsx)(U,{...e,animated:!1,reserveMeasuredHeight:!0}),t[0]=e,t[1]=n),n}let i;t[2]===e?i=t[3]:(i=(0,R.jsx)(d.Suspense,{fallback:(0,R.jsx)(U,{...e,reserveMeasuredHeight:!0}),children:(0,R.jsx)(z,{...e})}),t[2]=e,t[3]=i);let a=i,o;t[4]!==a||t[5]!==r||t[6]!==e?(o=r?(0,R.jsx)(F,{fallback:a,children:(0,R.jsx)(d.Suspense,{fallback:(0,R.jsx)(U,{...e,reserveMeasuredHeight:!0}),children:(0,R.jsx)(B,{...e})})}):a,t[4]=a,t[5]=r,t[6]=e,t[7]=o):o=t[7];let c=o,l;t[8]===e?l=t[9]:(l=t=>{if(!e.onShowPopup||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let n=t.target instanceof Element?t.target.closest(`a[href]`):null,r=n?.getAttribute(`href`);if(!r||!P(r))return;t.preventDefault(),t.stopPropagation();let i=n?.textContent?.trim()||r.split(/[/?#]/).filter(Boolean).pop()||r;e.onShowPopup({open:!0,title:i,content:``,video:{url:r,filename:i,directory:s()??``}})},t[8]=e,t[9]=l);let u;return t[10]!==c||t[11]!==l?(u=(0,R.jsx)(`div`,{className:`contents`,onClickCapture:l,children:c}),t[10]=c,t[11]=l,t[12]=u):u=t[12],u},G=e=>{let t=(0,f.c)(4);if(!L()){let n;return t[0]===e?n=t[1]:(n=(0,R.jsx)(U,{...e,animated:!1}),t[0]=e,t[1]=n),n}let n;return t[2]===e?n=t[3]:(n=(0,R.jsx)(d.Suspense,{fallback:(0,R.jsx)(U,{...e}),children:(0,R.jsx)(V,{...e})}),t[2]=e,t[3]=n),n};function K(e){return e.markstreamReactEnabled}function q(e){return e.markstreamReactEnabled}export{N as a,P as i,G as n,C as o,I as r,W as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-capacitor-app-B5H_XtmE.js","assets/rolldown-runtime-hePW80VL.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e}from"./platform-DMsFWy1a.js";import{o as t}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";var n=async()=>{if(!e())return null;let{App:n}=await t(async()=>{let{App:e}=await import(`./vendor-capacitor-app-B5H_XtmE.js`).then(e=>e.t);return{App:e}},__vite__mapDeps([0,1,2])),{id:r}=await n.getInfo();if(typeof r!=`string`||!/^[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+$/.test(r))throw Error(`Native app identity unavailable`);return r},r=e=>typeof e==`string`&&e.trim().length>0?e.trim():null,i=()=>r(`0.2.39`),a=(e,t)=>r(t)||r(e),o=(e,t)=>{let n=r(e);return n?typeof t!=`number`||!Number.isFinite(t)?n:`${n} (${t})`:null},s=async()=>{let n=i();if(!e())return n;try{let{App:e}=await t(async()=>{let{App:e}=await import(`./vendor-capacitor-app-B5H_XtmE.js`).then(e=>e.t);return{App:e}},__vite__mapDeps([0,1,2]));return a((await e.getInfo()).version,n)}catch{return n}},c=async()=>{if(!e())return null;try{let{App:e}=await t(async()=>{let{App:e}=await import(`./vendor-capacitor-app-B5H_XtmE.js`).then(e=>e.t);return{App:e}},__vite__mapDeps([0,1,2])),n=await e.getInfo(),r=typeof n.build==`string`?n.build.trim():``;if(r.length===0)return null;let i=Number.parseInt(r,10);return Number.isFinite(i)?i:null}catch{return null}},l=class extends Error{code=`mobile_updates_unsupported`;constructor(e=`Mobile OTA updates are only available in the Capacitor native app`){super(e),this.name=`MobileUpdatesUnsupportedError`}};export{s as a,c as i,o as n,n as r,l as t};
|