@yuriai/web 0.2.0-beta.7 → 0.2.0-beta.9
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/README.md +4 -0
- package/dist/assets/{AgentAvatar-CMpCBSy_.js → AgentAvatar-RbwoyGL7.js} +1 -1
- package/dist/assets/{AssistantView-CfyUDUVG.js → AssistantView-CTu_YqYq.js} +3 -3
- package/dist/assets/{DiagramView-CZg5AAli.js → DiagramView-BIhEoeWx.js} +1 -1
- package/dist/assets/{FadeInOnReveal-ANDXEIE7.js → FadeInOnReveal-Dt1nUq5y.js} +1 -1
- package/dist/assets/{GuiPluginSurface-CqqJymvB.js → GuiPluginSurface-68HtzOv6.js} +1 -1
- package/dist/assets/{GuiPluginWindow-B2G2-nAK.js → GuiPluginWindow-CMUyR2_9.js} +1 -1
- package/dist/assets/{Icon-DgrlwLKs.js → Icon-GJTjieJN.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-DdaN0XMj.js → ImageLoadingPlaceholder-C4VZA5iQ.js} +1 -1
- package/dist/assets/{LoadingImage-BJc5SC-0.js → LoadingImage-BZjPXN_m.js} +1 -1
- package/dist/assets/{MarkdownRenderer-DZwskKzl.js → MarkdownRenderer-DnCTLWjR.js} +2 -2
- package/dist/assets/{MarkdownRendererImpl-BQhcJNsK.js → MarkdownRendererImpl-C8HsL6On.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-CsURmqQY.js → MarkstreamRendererImpl-B1M5pAJe.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-CH4Oyt33.js → MobileDetailNavigation-BdSsbh04.js} +1 -1
- package/dist/assets/MobileResizableSheet-B8kpq7AR.js +1 -0
- package/dist/assets/{MobileShareBridge-DEDl3YCM.js → MobileShareBridge-r5Q2J_Sc.js} +2 -2
- package/dist/assets/{MobileTabPageHeader-C7Bkm6-_.js → MobileTabPageHeader-BRtaISjE.js} +1 -1
- package/dist/assets/{MultiRunWindow-DI0-Ur1w.js → MultiRunWindow-BPORsCa7.js} +1 -1
- package/dist/assets/{OnboardingScreen-BH__JnO0.js → OnboardingScreen-BssiDW_8.js} +1 -1
- package/dist/assets/{OverlayScrollbar-bByT588g.js → OverlayScrollbar-DWZJpEVx.js} +1 -1
- package/dist/assets/SettingsView-BxRekjws.js +26 -0
- package/dist/assets/{SettingsWindow-BJQyV3do.js → SettingsWindow-BsEMguoj.js} +1 -1
- package/dist/assets/{TerminalView-DRwLYPvJ.js → TerminalView-6hKAHFJ7.js} +1 -1
- package/dist/assets/{ToolOutputDialog-O25CmHgA.js → ToolOutputDialog-CkZORaFS.js} +1 -1
- package/dist/assets/{YuriLogo-Qr_mhaKp.js → YuriLogo-jfvSPXYV.js} +1 -1
- package/dist/assets/{appThemeRegistry-B-rbBHC4.js → appThemeRegistry-DdmE_Iv3.js} +1 -1
- package/dist/assets/{assistant-attachment-cache-DNbxU1Fq.js → assistant-attachment-cache-DWMcn4cE.js} +1 -1
- package/dist/assets/{button-BuhP8T0R.js → button-BgnrCA96.js} +1 -1
- package/dist/assets/{capgoAdapter-BgDvFDUs.js → capgoAdapter-Czek7cOG.js} +1 -1
- package/dist/assets/{collapsible-CwLF0o1c.js → collapsible-gafrZ0Tr.js} +1 -1
- package/dist/assets/desktop-dp2Z0toS.js +1 -0
- package/dist/assets/{desktopHosts-CjH4TGh8.js → desktopHosts-ByGjetLz.js} +1 -1
- package/dist/assets/{desktopRelayRestore-BLJo3sm7.js → desktopRelayRestore-DIO6vl1K.js} +1 -1
- package/dist/assets/{device-BVEAUyle.js → device-Dd4YwDwq.js} +1 -1
- package/dist/assets/{diagram-BIYywJNf.js → diagram-BIjHGw1_.js} +1 -1
- package/dist/assets/{dialog-BUEUatKm.js → dialog-D6jRorvP.js} +1 -1
- package/dist/assets/{dropdown-menu.styles-tzNMk1yW.js → dropdown-menu.styles-BKQriop5.js} +1 -1
- package/dist/assets/{fileMentionTouchSelection-C6ylhQkG.js → fileMentionTouchSelection-BSSggGfQ.js} +1 -1
- package/dist/assets/{fileReferenceActions-DuYvTiGf.js → fileReferenceActions-D625rOTl.js} +1 -1
- package/dist/assets/{gitApi-4JPWt45Y.js → gitApi-BkhGiTtu.js} +1 -1
- package/dist/assets/gui-BCPFcL_m.js +1 -0
- package/dist/assets/host-C6DQGHTV.js +1 -0
- package/dist/assets/{image-loading-CU4V_A1c.js → image-loading-Ctpxfqla.js} +1 -1
- package/dist/assets/{input-BVgNVYou.js → input-CDVEeuDT.js} +1 -1
- package/dist/assets/{insertionBoundaries-BSPv205d.js → insertionBoundaries-8-NDZp_y.js} +1 -1
- package/dist/assets/{main-CETRwACI.js → main-C6Yw42Pk.js} +12 -12
- package/dist/assets/{main-foDhMZ24.js → main-UQKItVb4.js} +2 -2
- package/dist/assets/{markdownHeightCache-BceTKVDK.js → markdownHeightCache-Dv5LnHPc.js} +1 -1
- package/dist/assets/{mcpQueries-AswEbyXP.js → mcpQueries-CyI_Hol5.js} +1 -1
- package/dist/assets/miniChat-tf1jH68G.js +2 -0
- package/dist/assets/mobile-C7dS2AHt.js +2 -0
- package/dist/assets/{mobileBackNavigation-C03Z5phB.js → mobileBackNavigation-Bcg-mihS.js} +1 -1
- package/dist/assets/{multirun-CWGx21Ol.js → multirun-xh4jfDx_.js} +1 -1
- package/dist/assets/native-BMAEg2E6.js +1 -0
- package/dist/assets/{native-config-DC-Ccre6.js → native-config-CKpFI_5o.js} +1 -1
- package/dist/assets/native-errors-06if6eu-.js +1 -0
- package/dist/assets/{persistence-D-W3L37Z.js → persistence-BfjCXjLZ.js} +1 -1
- package/dist/assets/{platform-CQG2KlHW.js → platform-Dcd-lkPn.js} +3 -3
- package/dist/assets/{projectMeta-6Sbr-Iiw.js → projectMeta-QJd1QrkI.js} +1 -1
- package/dist/assets/readiness-C1vgtBOT.js +1 -0
- package/dist/assets/{renderElectronMiniChatApp-CQHm04xq.js → renderElectronMiniChatApp-B84E6SfM.js} +2 -2
- package/dist/assets/{renderMobileApp-D4lOGRzz.js → renderMobileApp-PhdK6y6v.js} +4 -4
- package/dist/assets/{runtime-file-download-BdNCQkDe.js → runtime-file-download-CwP-HoXN.js} +1 -1
- package/dist/assets/{runtime-file-resource-DdAheq3y.js → runtime-file-resource-h3yIw4HU.js} +1 -1
- package/dist/assets/{runtime-file-store-hFlndg-n.js → runtime-file-store-BVRgEtI-.js} +1 -1
- package/dist/assets/runtimeConfig-CJCKi9-y.js +2 -0
- package/dist/assets/runtimeEndpointReset-Dxl8XtfH.js +149 -0
- package/dist/assets/{scheduledTaskNavigation-Cy2nZl_A.js → scheduledTaskNavigation-B7WhY2Fp.js} +1 -1
- package/dist/assets/{sessionChangeSummary-C70M_uHA.js → sessionChangeSummary-CY9vQ5i1.js} +1 -1
- package/dist/assets/{sessionLookup-CCOa3Jeq.js → sessionLookup-D1uJyExH.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-CAkRGa2f.js → sortable-tabs-strip-C4STfRdG.js} +1 -1
- package/dist/assets/{speechSettingsQueries-CIcSgao2.js → speechSettingsQueries-tUWgMwuK.js} +2 -2
- package/dist/assets/src-r07HspQy.css +2 -0
- package/dist/assets/{terminalApi-DY0KJOiK.js → terminalApi-CJx_hK4K.js} +1 -1
- package/dist/assets/{textarea-BLvbQAIG.js → textarea-DI9j9018.js} +1 -1
- package/dist/assets/{tooltip-jf98dFQe.js → tooltip-BHHwyMVd.js} +1 -1
- package/dist/assets/{types-D5ocrnEK.js → types-BmLypFZI.js} +1 -1
- package/dist/assets/{useAppFontEffects-DSR2ev_Q.js → useAppFontEffects-BeFXBNUc.js} +16 -16
- package/dist/assets/{useDesktopWindowControlsLayout-pyawlD_R.js → useDesktopWindowControlsLayout-BkdDy7r3.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-W6wf50T7.js → useEffectiveDirectory-RivT6KwZ.js} +1 -1
- package/dist/assets/{useFontPreferences-CH3iNDUl.js → useFontPreferences-Bwzz0JNf.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-BTF3FUmY.js → useMobileNavigationStore-BQHfCZ55.js} +8 -8
- package/dist/assets/{useWorkerHighlightedLines-Dhr3xUQY.js → useWorkerHighlightedLines-BszN5sdj.js} +1 -1
- package/dist/assets/{vendor-effect-DXlObQuU.js → vendor-effect-DV9F8PTZ.js} +1 -1
- package/dist/assets/vendor-opencode-client-fxfj4IA_.js +12 -0
- package/dist/assets/{vendor-opencode-plugin-BglYYlJt.js → vendor-opencode-plugin-CQ5ogY33.js} +1 -1
- package/dist/assets/{vendor-solid-js-B2FO7pdm.js → vendor-solid-js-Dmt4_-Zk.js} +1 -1
- package/dist/index.html +17 -17
- package/dist/mini-chat.html +17 -17
- package/dist/mobile.html +17 -17
- package/package.json +1 -1
- package/server/index.d.ts +2 -0
- package/server/index.js +8 -1
- package/server/lib/content-search/DOCUMENTATION.md +5 -1
- package/server/lib/content-search/runtime.js +24 -0
- package/server/lib/content-search/runtime.test.js +19 -0
- package/server/lib/opencode/DOCUMENTATION.md +5 -0
- package/server/lib/opencode/gui-plugin-source.js +14 -0
- package/server/lib/opencode/gui-plugin-source.test.js +28 -0
- package/server/lib/opencode/plugin-gui-response.d.ts +7 -0
- package/server/lib/opencode/plugin-gui-response.js +62 -0
- package/server/lib/opencode/plugin-gui-response.test.js +89 -0
- package/server/lib/opencode/proxy.js +32 -0
- package/server/lib/relay/DOCUMENTATION.md +1 -0
- package/server/lib/request-cors.js +2 -2
- package/server/lib/request-cors.test.js +3 -0
- package/server/lib/session-index/DOCUMENTATION.md +4 -0
- package/server/lib/session-index/sync-runtime.js +3 -0
- package/server/lib/session-index/sync-runtime.test.js +18 -0
- package/server/plugin-gui-proxy.test.js +134 -0
- package/dist/assets/MobileResizableSheet-xE71zG4E.js +0 -1
- package/dist/assets/SettingsView-BVmOocRh.js +0 -26
- package/dist/assets/desktop-DpAcrF1h.js +0 -1
- package/dist/assets/gui-B56BgPNQ.js +0 -1
- package/dist/assets/host-Bs4ljApp.js +0 -1
- package/dist/assets/miniChat-Dsodcwqi.js +0 -2
- package/dist/assets/mobile-C4F47gek.js +0 -2
- package/dist/assets/readiness-DWh0yJFu.js +0 -1
- package/dist/assets/runtimeConfig-5btjngJ7.js +0 -2
- package/dist/assets/runtimeEndpointReset-NHpx5wGb.js +0 -149
- package/dist/assets/src-BR-siHj2.css +0 -2
- package/dist/assets/vendor-opencode-client-BcpAhe9I.js +0 -12
package/dist/assets/{vendor-opencode-plugin-BglYYlJt.js → vendor-opencode-plugin-CQ5ogY33.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-hePW80VL.js";import{A as t,C as n,E as r,F as i,O as a,P as o,S as s,_ as c,b as l,k as u,r as d,v as f,x as p}from"./vendor-opencode-client-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-hePW80VL.js";import{A as t,C as n,E as r,F as i,O as a,P as o,S as s,_ as c,b as l,k as u,r as d,v as f,x as p}from"./vendor-opencode-client-fxfj4IA_.js";var m=f(),h=f(),g=f(),_=f(),v=Symbol.for(`opencode.plugin.live`);function y(e){return Object.assign(e,{[v]:!0})}function b(e){return v in e}var x={global:(e,t,n)=>({scope:`global`,schema:e,initial:t,from:n}),session:(e,t,n)=>({scope:`session`,schema:e,initial:t,from:n})},S={define:e=>({kind:`registry`,id:e})},C={define:e=>({kind:`contract`,id:e})},w={define:e=>({kind:`ipc`,id:e.id,spec:e})},T=S.define(`command`),E=S.define(`menu-item`),D=S.define(`panel`),O=S.define(`settings-page`),k=S.define(`server`),A=S.define(`link-handler`),j=S.define(`titlebar-item`),M=S.define(`composer-pill`),N=S.define(`slot`),P=S.define(`style`);function F(){let e=i(m);if(!e)throw Error(`usePlugin must run inside a plugin contribution`);return e}function I(e){let t=F();return n=>c(m.Provider,{value:t,get children(){return c(e,n)}})}function L(){let e=i(g);if(!e)throw Error(`usePanel must run inside a panel render`);return e}function R(){return i(_)}function z(e,n,i){let o=e,c=i?.equals,d=b(o)?l(()=>{let e=o();return e.status===`active`?e:void 0},void 0,{equals:(e,t)=>e?.generation===t?.generation}):l(()=>{let e=o();return e==null||e===!1?void 0:{value:e}},void 0,{equals:(e,t)=>e===void 0||t===void 0?e===t:e.value===t.value||!!c?.(e.value,t.value)});p(a(d,e=>{let a=e===void 0?i?.otherwise:()=>n(e.value);if(!a)return;let o={ended:!1},c=s(e=>({owner:r(),dispose:e}));u(()=>{o.ended=!0,c.dispose()}),c.owner&&(c.owner.context={...c.owner.context,[h.id]:o}),t(c.owner,a)}))}function B(e,t){let[n,r]=d({latest:void 0,loading:!1,error:void 0});return z(e,e=>{let n=new AbortController;u(()=>n.abort()),r({loading:!0,error:void 0}),Promise.try(()=>t(e,n.signal)).then(e=>{n.signal.aborted||r({latest:e,loading:!1,error:void 0})},e=>{n.signal.aborted||r({loading:!1,error:e})})},{otherwise:()=>r({loading:!1,error:void 0})}),n}function V(e){let t=F().sessions,r=()=>t.current()?.visit,[i,a]=n({visit:void 0,value:e});return[()=>{let t=i();return t.visit!==void 0&&t.visit===r()?t.value:e},e=>void a({visit:o(r),value:e})]}var H=e({define:()=>U});function U(e){return e}var W=e({Command:()=>T,ComposerPill:()=>M,Contract:()=>C,Ipc:()=>w,LinkHandler:()=>A,MenuItem:()=>E,Panel:()=>D,Plugin:()=>H,Registry:()=>S,Server:()=>k,SettingsPage:()=>O,Slot:()=>N,Store:()=>x,Style:()=>P,TitlebarItem:()=>j,bindPlugin:()=>I,createKeyed:()=>z,createLatest:()=>B,createVisitState:()=>V,useDrawer:()=>R,usePanel:()=>L,usePlugin:()=>F}),G=e({FileTree:()=>K,FileViewer:()=>J,OpenInApp:()=>q}),K=C.define(`file.tree`),q=C.define(`file.openInApp`),J=S.define(`file.viewer`),Y=e({Changes:()=>X}),X=C.define(`review.changes`),Z=e({Browser:()=>Q}),Q=C.define(`browser`),$=e({Rpc:()=>$,define:()=>ee});function ee(e){let t=Object.values(e.methods).flatMap(e=>Object.keys(e.errors??{})).find(e=>e.startsWith(`rpc.`));if(t)throw Error(`RPC error names starting with "rpc." are reserved: ${t}`);return e}var te=e({Rpc:()=>$});export{G as a,A as c,O as d,h as f,y as h,Y as i,E as l,m,$ as n,W as o,g as p,Z as r,T as s,te as t,D as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-hePW80VL.js";import{A as t,C as n,D as r,E as i,N as a,P as o,S as s,_ as c,b as l,c as u,d,f,j as p,k as m,l as ee,m as te,p as ne,s as re,u as ie,w as ae,x as h,y as oe}from"./vendor-opencode-client-BcpAhe9I.js";var se=e({Aliases:()=>v,Assets:()=>J,ChildProperties:()=>_,DOMElements:()=>le,DelegatedEvents:()=>b,Dynamic:()=>ze,ErrorBoundary:()=>re,For:()=>u,Hydration:()=>Ce,HydrationScript:()=>J,Index:()=>ee,Match:()=>ie,NoHydration:()=>Se,Portal:()=>Le,Properties:()=>g,RequestContext:()=>we,SVGElements:()=>x,SVGNamespace:()=>S,Show:()=>d,Suspense:()=>f,SuspenseList:()=>ne,Switch:()=>te,addEventListener:()=>A,assign:()=>I,classList:()=>j,className:()=>k,clearDelegatedEvents:()=>pe,createComponent:()=>c,createDynamic:()=>Re,delegateEvents:()=>T,dynamicProperty:()=>ge,effect:()=>h,escape:()=>Ne,generateHydrationScript:()=>J,getAssets:()=>J,getHydrationKey:()=>q,getNextElement:()=>L,getNextMarker:()=>ye,getNextMatch:()=>ve,getOwner:()=>i,getPropAlias:()=>y,getRequestEvent:()=>J,hydrate:()=>Ie,innerHTML:()=>Te,insert:()=>F,isDev:()=>!1,isServer:()=>!1,memo:()=>ue,mergeProps:()=>r,render:()=>w,renderToStream:()=>Q,renderToString:()=>X,renderToStringAsync:()=>Z,resolveSSRNode:()=>Me,runHydrationEvents:()=>be,setAttribute:()=>E,setAttributeNS:()=>D,setBoolAttribute:()=>O,setProperty:()=>me,setStyleProperty:()=>he,spread:()=>N,ssr:()=>Ee,ssrAttribute:()=>Ae,ssrClassList:()=>Oe,ssrElement:()=>De,ssrHydrationKey:()=>je,ssrSpread:()=>Pe,ssrStyle:()=>ke,style:()=>M,template:()=>fe,untrack:()=>o,use:()=>P,useAssets:()=>J}),g=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),_=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),v=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),ce=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}});function y(e,t){let n=ce[e];return typeof n==`object`?n[t]?n.$:void 0:n}var b=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),x=new Set(`altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.color-profile.cursor.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.font.font-face.font-face-format.font-face-name.font-face-src.font-face-uri.foreignObject.g.glyph.glyphRef.hkern.image.line.linearGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.svg.switch.symbol.text.textPath.tref.tspan.use.view.vkern`.split(`.`)),S={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},le=new Set(`html.base.head.link.meta.style.title.body.address.article.aside.footer.header.main.nav.section.body.blockquote.dd.div.dl.dt.figcaption.figure.hr.li.ol.p.pre.ul.a.abbr.b.bdi.bdo.br.cite.code.data.dfn.em.i.kbd.mark.q.rp.rt.ruby.s.samp.small.span.strong.sub.sup.time.u.var.wbr.area.audio.img.map.track.video.embed.iframe.object.param.picture.portal.source.svg.math.canvas.noscript.script.del.ins.caption.col.colgroup.table.tbody.td.tfoot.th.thead.tr.button.datalist.fieldset.form.input.label.legend.meter.optgroup.option.output.progress.select.textarea.details.dialog.menu.summary.details.slot.template.acronym.applet.basefont.bgsound.big.blink.center.content.dir.font.frame.frameset.hgroup.image.keygen.marquee.menuitem.nobr.noembed.noframes.plaintext.rb.rtc.shadow.spacer.strike.tt.xmp.a.abbr.acronym.address.applet.area.article.aside.audio.b.base.basefont.bdi.bdo.bgsound.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.del.details.dfn.dialog.dir.div.dl.dt.em.embed.fieldset.figcaption.figure.font.footer.form.frame.frameset.head.header.hgroup.hr.html.i.iframe.image.img.input.ins.kbd.keygen.label.legend.li.link.main.map.mark.marquee.menu.menuitem.meta.meter.nav.nobr.noembed.noframes.noscript.object.ol.optgroup.option.output.p.param.picture.plaintext.portal.pre.progress.q.rb.rp.rt.rtc.ruby.s.samp.script.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.tt.u.ul.var.video.wbr.xmp.input.h1.h2.h3.h4.h5.h6.webview.isindex.listing.multicol.nextid.noindex.search`.split(`.`)),ue=e=>l(()=>e());function de(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null)if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&(d=l.get(t[c]))!=null&&d===r+u;)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}var C=`_$DX_DELEGATE`;function w(e,t,n,r={}){let i;return s(r=>{i=r,t===document?e():F(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function fe(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},s=t?()=>o(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return s.cloneNode=s,s}function T(e,t=window.document){let n=t[C]||(t[C]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,V))}}function pe(e=window.document){if(e[C]){for(let t of e[C].keys())e.removeEventListener(t,V);delete e[C]}}function me(e,t,n){R(e)||(e[t]=n)}function E(e,t,n){R(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function D(e,t,n,r){R(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function O(e,t,n){R(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function k(e,t){R(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function A(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function j(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];!r||r===`undefined`||t[r]||(z(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];!i||i===`undefined`||n[i]===o||!o||(z(e,i,!0),n[i]=o)}return n}function M(e,t,n){if(!t)return n?E(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function he(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function N(e,t={},n,r){let i={};return r||h(()=>i.children=H(e,t.children,i.children)),h(()=>typeof t.ref==`function`&&P(t.ref,e)),h(()=>I(e,t,n,!0,i,!0)),i}function ge(e,t){let n=e[t];return Object.defineProperty(e,t,{get(){return n()},enumerable:!0}),e}function P(e,t,n){return o(()=>e(t,n))}function F(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return H(e,t,r,n);h(r=>H(e,t(),r,n),r)}function I(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=B(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||H(e,t.children);continue}let s=t[o];i[o]=B(e,o,s,i[o],n,a,t)}}function _e(e,t,n={}){if(globalThis._$HY.done)return w(e,t,[...t.childNodes],n);p.completed=globalThis._$HY.completed,p.events=globalThis._$HY.events,p.load=e=>globalThis._$HY.r[e],p.has=e=>e in globalThis._$HY.r,p.gather=e=>K(t,e),p.registry=new Map,p.context={id:n.renderId||``,count:0};try{return K(t,n.renderId),w(e,t,[...t.childNodes],n)}finally{p.context=null}}function L(e){let t,n;return!R()||!(t=p.registry.get(n=q()))?e():(p.completed&&p.completed.add(t),p.registry.delete(n),t)}function ve(e,t){for(;e&&e.localName!==t;)e=e.nextSibling;return e}function ye(e){let t=e,n=0,r=[];if(R(e))for(;t;){if(t.nodeType===8){let e=t.nodeValue;if(e===`$`)n++;else if(e===`/`){if(n===0)return[t,r];n--}}r.push(t),t=t.nextSibling}return[t,r]}function be(){p.events&&!p.events.queued&&(queueMicrotask(()=>{let{completed:e,events:t}=p;if(t){for(t.queued=!1;t.length;){let[n,r]=t[0];if(!e.has(n))return;t.shift(),V(r)}p.done&&(p.events=_$HY.events=null,p.completed=_$HY.completed=null)}}),p.events.queued=!0)}function R(e){return!!p.context&&!p.done&&(!e||e.isConnected)}function xe(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function z(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function B(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return M(e,n,r);if(t===`classList`)return j(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=b.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(A(e,i,n,a),a&&T([i]))}else if(t.slice(0,5)===`attr:`)E(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)O(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=_.has(t))||!i&&((u=y(t,e.tagName))||(c=g.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(R(e))return n;t===`class`||t===`className`?k(e,n):s&&!c&&!l?e[xe(t)]=n:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&S[t.split(`:`)[0]];r?D(e,r,t,n):E(e,v[t]||t,n)}return n}function V(e){if(p.registry&&p.events&&p.events.find(([t,n])=>n===e))return;let t=e.target,n=`$$${e.type}`,r=e.target,i=e.currentTarget,a=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),o=()=>{let r=t[n];if(r&&!t.disabled){let i=t[`${n}Data`];if(i===void 0?r.call(t,e):r.call(t,i,e),e.cancelBubble)return}return t.host&&typeof t.host!=`string`&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),p.registry&&!p.done&&(p.done=_$HY.done=!0),e.composedPath){let n=e.composedPath();a(n[0]);for(let e=0;e<n.length-2&&(t=n[e],o());e++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();a(r)}function H(e,t,n,r,i){let a=R(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=G(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=G(e,n,r)}else if(o===`function`)return h(()=>{let i=t();for(;typeof i==`function`;)i=i();n=H(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(U(o,t,n,i))return h(()=>n=H(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=G(e,n,r),s)return n}else c?n.length===0?W(e,o,r):de(e,n,o):(n&&G(e),W(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=G(e,n,r,t);G(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function U(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(o!=null&&o!==!0&&o!==!1)if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=U(e,o,s)||i;else if(c===`function`)if(r){for(;typeof o==`function`;)o=o();i=U(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0;else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}return i}function W(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function G(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}function K(e,t){let n=e.querySelectorAll(`*[data-hk]`);for(let e=0;e<n.length;e++){let r=n[e],i=r.getAttribute(`data-hk`);(!t||i.startsWith(t))&&!p.registry.has(i)&&p.registry.set(i,r)}}function q(){return p.getNextContextId()}function Se(e){return p.context?void 0:e.children}function Ce(e){return e.children}var J=()=>void 0,we=Symbol();function Te(e,t){!p.context&&(e.innerHTML=t)}function Y(e){let t=Error(`${e.name} is not supported in the browser, returning undefined`);console.error(t)}function X(e,t){Y(X)}function Z(e,t){Y(Z)}function Q(e,t){Y(Q)}function Ee(e,...t){}function De(e,t,n,r){}function Oe(e){}function ke(e){}function Ae(e,t){}function je(){}function Me(e){}function Ne(e){}function Pe(e,t,n){}var Fe=`http://www.w3.org/2000/svg`;function $(e,t=!1,n=void 0){return t?document.createElementNS(Fe,e):document.createElement(e,{is:n})}var Ie=(...e)=>(ae(),_e(...e));function Le(e){let{useShadow:r}=e,a=document.createTextNode(``),o=()=>e.mount||document.body,c=i(),u,d=!!p.context;return oe(()=>{d&&(i().user=d=!1),u||=t(c,()=>l(()=>e.children));let f=o();if(f instanceof HTMLHeadElement){let[e,t]=n(!1);s(t=>F(f,()=>e()?t():u(),null)),m(()=>t(!0))}else{let t=$(e.isSVG?`g`:`div`,e.isSVG),n=r&&t.attachShadow?t.attachShadow({mode:`open`}):t;Object.defineProperty(t,"_$host",{get(){return a.parentNode},configurable:!0}),F(n,u),f.appendChild(t),e.ref&&e.ref(t),m(()=>f.removeChild(t))}},void 0,{render:!d}),a}function Re(e,t){let n=l(e);return l(()=>{let e=n();switch(typeof e){case`function`:return o(()=>e(t));case`string`:let n=x.has(e),r=p.context?L():$(e,n,o(()=>t.is));return N(r,t,n),r}})}function ze(e){let[,t]=a(e,[`component`]);return Re(()=>e.component,t)}export{se as n,w as t};
|
|
1
|
+
import{n as e}from"./rolldown-runtime-hePW80VL.js";import{A as t,C as n,D as r,E as i,N as a,P as o,S as s,_ as c,b as l,c as u,d,f,j as p,k as m,l as ee,m as te,p as ne,s as re,u as ie,w as ae,x as h,y as oe}from"./vendor-opencode-client-fxfj4IA_.js";var se=e({Aliases:()=>v,Assets:()=>J,ChildProperties:()=>_,DOMElements:()=>le,DelegatedEvents:()=>b,Dynamic:()=>ze,ErrorBoundary:()=>re,For:()=>u,Hydration:()=>Ce,HydrationScript:()=>J,Index:()=>ee,Match:()=>ie,NoHydration:()=>Se,Portal:()=>Le,Properties:()=>g,RequestContext:()=>we,SVGElements:()=>x,SVGNamespace:()=>S,Show:()=>d,Suspense:()=>f,SuspenseList:()=>ne,Switch:()=>te,addEventListener:()=>A,assign:()=>I,classList:()=>j,className:()=>k,clearDelegatedEvents:()=>pe,createComponent:()=>c,createDynamic:()=>Re,delegateEvents:()=>T,dynamicProperty:()=>ge,effect:()=>h,escape:()=>Ne,generateHydrationScript:()=>J,getAssets:()=>J,getHydrationKey:()=>q,getNextElement:()=>L,getNextMarker:()=>ye,getNextMatch:()=>ve,getOwner:()=>i,getPropAlias:()=>y,getRequestEvent:()=>J,hydrate:()=>Ie,innerHTML:()=>Te,insert:()=>F,isDev:()=>!1,isServer:()=>!1,memo:()=>ue,mergeProps:()=>r,render:()=>w,renderToStream:()=>Q,renderToString:()=>X,renderToStringAsync:()=>Z,resolveSSRNode:()=>Me,runHydrationEvents:()=>be,setAttribute:()=>E,setAttributeNS:()=>D,setBoolAttribute:()=>O,setProperty:()=>me,setStyleProperty:()=>he,spread:()=>N,ssr:()=>Ee,ssrAttribute:()=>Ae,ssrClassList:()=>Oe,ssrElement:()=>De,ssrHydrationKey:()=>je,ssrSpread:()=>Pe,ssrStyle:()=>ke,style:()=>M,template:()=>fe,untrack:()=>o,use:()=>P,useAssets:()=>J}),g=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),_=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),v=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),ce=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}});function y(e,t){let n=ce[e];return typeof n==`object`?n[t]?n.$:void 0:n}var b=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),x=new Set(`altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.color-profile.cursor.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.font.font-face.font-face-format.font-face-name.font-face-src.font-face-uri.foreignObject.g.glyph.glyphRef.hkern.image.line.linearGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.svg.switch.symbol.text.textPath.tref.tspan.use.view.vkern`.split(`.`)),S={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},le=new Set(`html.base.head.link.meta.style.title.body.address.article.aside.footer.header.main.nav.section.body.blockquote.dd.div.dl.dt.figcaption.figure.hr.li.ol.p.pre.ul.a.abbr.b.bdi.bdo.br.cite.code.data.dfn.em.i.kbd.mark.q.rp.rt.ruby.s.samp.small.span.strong.sub.sup.time.u.var.wbr.area.audio.img.map.track.video.embed.iframe.object.param.picture.portal.source.svg.math.canvas.noscript.script.del.ins.caption.col.colgroup.table.tbody.td.tfoot.th.thead.tr.button.datalist.fieldset.form.input.label.legend.meter.optgroup.option.output.progress.select.textarea.details.dialog.menu.summary.details.slot.template.acronym.applet.basefont.bgsound.big.blink.center.content.dir.font.frame.frameset.hgroup.image.keygen.marquee.menuitem.nobr.noembed.noframes.plaintext.rb.rtc.shadow.spacer.strike.tt.xmp.a.abbr.acronym.address.applet.area.article.aside.audio.b.base.basefont.bdi.bdo.bgsound.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.del.details.dfn.dialog.dir.div.dl.dt.em.embed.fieldset.figcaption.figure.font.footer.form.frame.frameset.head.header.hgroup.hr.html.i.iframe.image.img.input.ins.kbd.keygen.label.legend.li.link.main.map.mark.marquee.menu.menuitem.meta.meter.nav.nobr.noembed.noframes.noscript.object.ol.optgroup.option.output.p.param.picture.plaintext.portal.pre.progress.q.rb.rp.rt.rtc.ruby.s.samp.script.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.tt.u.ul.var.video.wbr.xmp.input.h1.h2.h3.h4.h5.h6.webview.isindex.listing.multicol.nextid.noindex.search`.split(`.`)),ue=e=>l(()=>e());function de(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null)if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&(d=l.get(t[c]))!=null&&d===r+u;)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}var C=`_$DX_DELEGATE`;function w(e,t,n,r={}){let i;return s(r=>{i=r,t===document?e():F(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function fe(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},s=t?()=>o(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return s.cloneNode=s,s}function T(e,t=window.document){let n=t[C]||(t[C]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,V))}}function pe(e=window.document){if(e[C]){for(let t of e[C].keys())e.removeEventListener(t,V);delete e[C]}}function me(e,t,n){R(e)||(e[t]=n)}function E(e,t,n){R(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function D(e,t,n,r){R(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function O(e,t,n){R(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function k(e,t){R(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function A(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function j(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];!r||r===`undefined`||t[r]||(z(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];!i||i===`undefined`||n[i]===o||!o||(z(e,i,!0),n[i]=o)}return n}function M(e,t,n){if(!t)return n?E(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function he(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function N(e,t={},n,r){let i={};return r||h(()=>i.children=H(e,t.children,i.children)),h(()=>typeof t.ref==`function`&&P(t.ref,e)),h(()=>I(e,t,n,!0,i,!0)),i}function ge(e,t){let n=e[t];return Object.defineProperty(e,t,{get(){return n()},enumerable:!0}),e}function P(e,t,n){return o(()=>e(t,n))}function F(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return H(e,t,r,n);h(r=>H(e,t(),r,n),r)}function I(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=B(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||H(e,t.children);continue}let s=t[o];i[o]=B(e,o,s,i[o],n,a,t)}}function _e(e,t,n={}){if(globalThis._$HY.done)return w(e,t,[...t.childNodes],n);p.completed=globalThis._$HY.completed,p.events=globalThis._$HY.events,p.load=e=>globalThis._$HY.r[e],p.has=e=>e in globalThis._$HY.r,p.gather=e=>K(t,e),p.registry=new Map,p.context={id:n.renderId||``,count:0};try{return K(t,n.renderId),w(e,t,[...t.childNodes],n)}finally{p.context=null}}function L(e){let t,n;return!R()||!(t=p.registry.get(n=q()))?e():(p.completed&&p.completed.add(t),p.registry.delete(n),t)}function ve(e,t){for(;e&&e.localName!==t;)e=e.nextSibling;return e}function ye(e){let t=e,n=0,r=[];if(R(e))for(;t;){if(t.nodeType===8){let e=t.nodeValue;if(e===`$`)n++;else if(e===`/`){if(n===0)return[t,r];n--}}r.push(t),t=t.nextSibling}return[t,r]}function be(){p.events&&!p.events.queued&&(queueMicrotask(()=>{let{completed:e,events:t}=p;if(t){for(t.queued=!1;t.length;){let[n,r]=t[0];if(!e.has(n))return;t.shift(),V(r)}p.done&&(p.events=_$HY.events=null,p.completed=_$HY.completed=null)}}),p.events.queued=!0)}function R(e){return!!p.context&&!p.done&&(!e||e.isConnected)}function xe(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function z(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function B(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return M(e,n,r);if(t===`classList`)return j(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=b.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(A(e,i,n,a),a&&T([i]))}else if(t.slice(0,5)===`attr:`)E(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)O(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=_.has(t))||!i&&((u=y(t,e.tagName))||(c=g.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(R(e))return n;t===`class`||t===`className`?k(e,n):s&&!c&&!l?e[xe(t)]=n:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&S[t.split(`:`)[0]];r?D(e,r,t,n):E(e,v[t]||t,n)}return n}function V(e){if(p.registry&&p.events&&p.events.find(([t,n])=>n===e))return;let t=e.target,n=`$$${e.type}`,r=e.target,i=e.currentTarget,a=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),o=()=>{let r=t[n];if(r&&!t.disabled){let i=t[`${n}Data`];if(i===void 0?r.call(t,e):r.call(t,i,e),e.cancelBubble)return}return t.host&&typeof t.host!=`string`&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),p.registry&&!p.done&&(p.done=_$HY.done=!0),e.composedPath){let n=e.composedPath();a(n[0]);for(let e=0;e<n.length-2&&(t=n[e],o());e++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();a(r)}function H(e,t,n,r,i){let a=R(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=G(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=G(e,n,r)}else if(o===`function`)return h(()=>{let i=t();for(;typeof i==`function`;)i=i();n=H(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(U(o,t,n,i))return h(()=>n=H(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=G(e,n,r),s)return n}else c?n.length===0?W(e,o,r):de(e,n,o):(n&&G(e),W(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=G(e,n,r,t);G(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function U(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(o!=null&&o!==!0&&o!==!1)if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=U(e,o,s)||i;else if(c===`function`)if(r){for(;typeof o==`function`;)o=o();i=U(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0;else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}return i}function W(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function G(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}function K(e,t){let n=e.querySelectorAll(`*[data-hk]`);for(let e=0;e<n.length;e++){let r=n[e],i=r.getAttribute(`data-hk`);(!t||i.startsWith(t))&&!p.registry.has(i)&&p.registry.set(i,r)}}function q(){return p.getNextContextId()}function Se(e){return p.context?void 0:e.children}function Ce(e){return e.children}var J=()=>void 0,we=Symbol();function Te(e,t){!p.context&&(e.innerHTML=t)}function Y(e){let t=Error(`${e.name} is not supported in the browser, returning undefined`);console.error(t)}function X(e,t){Y(X)}function Z(e,t){Y(Z)}function Q(e,t){Y(Q)}function Ee(e,...t){}function De(e,t,n,r){}function Oe(e){}function ke(e){}function Ae(e,t){}function je(){}function Me(e){}function Ne(e){}function Pe(e,t,n){}var Fe=`http://www.w3.org/2000/svg`;function $(e,t=!1,n=void 0){return t?document.createElementNS(Fe,e):document.createElement(e,{is:n})}var Ie=(...e)=>(ae(),_e(...e));function Le(e){let{useShadow:r}=e,a=document.createTextNode(``),o=()=>e.mount||document.body,c=i(),u,d=!!p.context;return oe(()=>{d&&(i().user=d=!1),u||=t(c,()=>l(()=>e.children));let f=o();if(f instanceof HTMLHeadElement){let[e,t]=n(!1);s(t=>F(f,()=>e()?t():u(),null)),m(()=>t(!0))}else{let t=$(e.isSVG?`g`:`div`,e.isSVG),n=r&&t.attachShadow?t.attachShadow({mode:`open`}):t;Object.defineProperty(t,"_$host",{get(){return a.parentNode},configurable:!0}),F(n,u),f.appendChild(t),e.ref&&e.ref(t),m(()=>f.removeChild(t))}},void 0,{render:!d}),a}function Re(e,t){let n=l(e);return l(()=>{let e=n();switch(typeof e){case`function`:return o(()=>e(t));case`string`:let n=x.has(e),r=p.context?L():$(e,n,o(()=>t.is));return N(r,t,n),r}})}function ze(e){let[,t]=a(e,[`component`]);return Re(()=>e.component,t)}export{se as n,w as t};
|
package/dist/index.html
CHANGED
|
@@ -560,19 +560,19 @@
|
|
|
560
560
|
opacity: 0.72;
|
|
561
561
|
}
|
|
562
562
|
</style>
|
|
563
|
-
<script type="module" crossorigin src="/assets/main-
|
|
563
|
+
<script type="module" crossorigin src="/assets/main-UQKItVb4.js"></script>
|
|
564
564
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
565
565
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-ef9W7A43.js">
|
|
566
566
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-CAZiOV2G.js">
|
|
567
567
|
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-BAN5Gnnp.js">
|
|
568
568
|
<link rel="modulepreload" crossorigin href="/assets/runtimeAPIRegistry-C2VogTny.js">
|
|
569
|
-
<link rel="modulepreload" crossorigin href="/assets/desktop-
|
|
570
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-
|
|
571
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-
|
|
569
|
+
<link rel="modulepreload" crossorigin href="/assets/desktop-dp2Z0toS.js">
|
|
570
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-ByGjetLz.js">
|
|
571
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-DIO6vl1K.js">
|
|
572
572
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-CdzJ6My_.js">
|
|
573
573
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-o69pgTEK.js">
|
|
574
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-
|
|
575
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-
|
|
574
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-DV9F8PTZ.js">
|
|
575
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-fxfj4IA_.js">
|
|
576
576
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-migration-Bhz6UOBJ.js">
|
|
577
577
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-bootstrap-D4BW3w-M.js">
|
|
578
578
|
<link rel="modulepreload" crossorigin href="/assets/useUIStore-NMQx_cnG.js">
|
|
@@ -581,21 +581,21 @@
|
|
|
581
581
|
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-BuRnpVtK.js">
|
|
582
582
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
583
583
|
<link rel="modulepreload" crossorigin href="/assets/pathNormalization-ewtPqJWn.js">
|
|
584
|
-
<link rel="modulepreload" crossorigin href="/assets/persistence-
|
|
584
|
+
<link rel="modulepreload" crossorigin href="/assets/persistence-BfjCXjLZ.js">
|
|
585
585
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-CdqCAt40.js">
|
|
586
586
|
<link rel="modulepreload" crossorigin href="/assets/fileQueries-DbUx7NwP.js">
|
|
587
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-
|
|
587
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
588
588
|
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
589
589
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
590
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-
|
|
591
|
-
<link rel="modulepreload" crossorigin href="/assets/platform-
|
|
592
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
593
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-
|
|
594
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
595
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
596
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
597
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
598
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
590
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-h3yIw4HU.js">
|
|
591
|
+
<link rel="modulepreload" crossorigin href="/assets/platform-Dcd-lkPn.js">
|
|
592
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-CJx_hK4K.js">
|
|
593
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-CwP-HoXN.js">
|
|
594
|
+
<link rel="modulepreload" crossorigin href="/assets/types-BmLypFZI.js">
|
|
595
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-Czek7cOG.js">
|
|
596
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-CKpFI_5o.js">
|
|
597
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CJCKi9-y.js">
|
|
598
|
+
<link rel="stylesheet" crossorigin href="/assets/src-r07HspQy.css">
|
|
599
599
|
</head>
|
|
600
600
|
<body class="h-full bg-background text-foreground">
|
|
601
601
|
<!-- Keep the startup layer outside #root. React replaces every child of
|
package/dist/mini-chat.html
CHANGED
|
@@ -74,19 +74,19 @@
|
|
|
74
74
|
}
|
|
75
75
|
</style>
|
|
76
76
|
|
|
77
|
-
<script type="module" crossorigin src="/assets/miniChat-
|
|
77
|
+
<script type="module" crossorigin src="/assets/miniChat-tf1jH68G.js"></script>
|
|
78
78
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
79
79
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-ef9W7A43.js">
|
|
80
80
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-CAZiOV2G.js">
|
|
81
81
|
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-BAN5Gnnp.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="/assets/runtimeAPIRegistry-C2VogTny.js">
|
|
83
|
-
<link rel="modulepreload" crossorigin href="/assets/desktop-
|
|
84
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-
|
|
85
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-
|
|
83
|
+
<link rel="modulepreload" crossorigin href="/assets/desktop-dp2Z0toS.js">
|
|
84
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-ByGjetLz.js">
|
|
85
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-DIO6vl1K.js">
|
|
86
86
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-CdzJ6My_.js">
|
|
87
87
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-o69pgTEK.js">
|
|
88
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-
|
|
89
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-
|
|
88
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-DV9F8PTZ.js">
|
|
89
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-fxfj4IA_.js">
|
|
90
90
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-migration-Bhz6UOBJ.js">
|
|
91
91
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-bootstrap-D4BW3w-M.js">
|
|
92
92
|
<link rel="modulepreload" crossorigin href="/assets/useUIStore-NMQx_cnG.js">
|
|
@@ -95,21 +95,21 @@
|
|
|
95
95
|
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-BuRnpVtK.js">
|
|
96
96
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
97
97
|
<link rel="modulepreload" crossorigin href="/assets/pathNormalization-ewtPqJWn.js">
|
|
98
|
-
<link rel="modulepreload" crossorigin href="/assets/persistence-
|
|
98
|
+
<link rel="modulepreload" crossorigin href="/assets/persistence-BfjCXjLZ.js">
|
|
99
99
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-CdqCAt40.js">
|
|
100
100
|
<link rel="modulepreload" crossorigin href="/assets/fileQueries-DbUx7NwP.js">
|
|
101
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-
|
|
101
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
102
102
|
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
103
103
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
104
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-
|
|
105
|
-
<link rel="modulepreload" crossorigin href="/assets/platform-
|
|
106
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
107
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-
|
|
108
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
109
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
110
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
111
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
112
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
104
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-h3yIw4HU.js">
|
|
105
|
+
<link rel="modulepreload" crossorigin href="/assets/platform-Dcd-lkPn.js">
|
|
106
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-CJx_hK4K.js">
|
|
107
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-CwP-HoXN.js">
|
|
108
|
+
<link rel="modulepreload" crossorigin href="/assets/types-BmLypFZI.js">
|
|
109
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-Czek7cOG.js">
|
|
110
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-CKpFI_5o.js">
|
|
111
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CJCKi9-y.js">
|
|
112
|
+
<link rel="stylesheet" crossorigin href="/assets/src-r07HspQy.css">
|
|
113
113
|
</head>
|
|
114
114
|
<body class="h-full bg-background text-foreground">
|
|
115
115
|
<div id="root" class="h-full">
|
package/dist/mobile.html
CHANGED
|
@@ -63,19 +63,19 @@
|
|
|
63
63
|
})();
|
|
64
64
|
</script>
|
|
65
65
|
|
|
66
|
-
<script type="module" crossorigin src="/assets/mobile-
|
|
66
|
+
<script type="module" crossorigin src="/assets/mobile-C7dS2AHt.js"></script>
|
|
67
67
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
68
68
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-ef9W7A43.js">
|
|
69
69
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-CAZiOV2G.js">
|
|
70
70
|
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-BAN5Gnnp.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="/assets/runtimeAPIRegistry-C2VogTny.js">
|
|
72
|
-
<link rel="modulepreload" crossorigin href="/assets/desktop-
|
|
73
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-
|
|
74
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-
|
|
72
|
+
<link rel="modulepreload" crossorigin href="/assets/desktop-dp2Z0toS.js">
|
|
73
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-ByGjetLz.js">
|
|
74
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-DIO6vl1K.js">
|
|
75
75
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-CdzJ6My_.js">
|
|
76
76
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-o69pgTEK.js">
|
|
77
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-
|
|
78
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-
|
|
77
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-DV9F8PTZ.js">
|
|
78
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-fxfj4IA_.js">
|
|
79
79
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-migration-Bhz6UOBJ.js">
|
|
80
80
|
<link rel="modulepreload" crossorigin href="/assets/brand-storage-bootstrap-D4BW3w-M.js">
|
|
81
81
|
<link rel="modulepreload" crossorigin href="/assets/useUIStore-NMQx_cnG.js">
|
|
@@ -84,21 +84,21 @@
|
|
|
84
84
|
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-BuRnpVtK.js">
|
|
85
85
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
86
86
|
<link rel="modulepreload" crossorigin href="/assets/pathNormalization-ewtPqJWn.js">
|
|
87
|
-
<link rel="modulepreload" crossorigin href="/assets/persistence-
|
|
87
|
+
<link rel="modulepreload" crossorigin href="/assets/persistence-BfjCXjLZ.js">
|
|
88
88
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-CdqCAt40.js">
|
|
89
89
|
<link rel="modulepreload" crossorigin href="/assets/fileQueries-DbUx7NwP.js">
|
|
90
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-
|
|
90
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
91
91
|
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
92
92
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
93
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-
|
|
94
|
-
<link rel="modulepreload" crossorigin href="/assets/platform-
|
|
95
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
96
|
-
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-
|
|
97
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
98
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
99
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
100
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
101
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
93
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-h3yIw4HU.js">
|
|
94
|
+
<link rel="modulepreload" crossorigin href="/assets/platform-Dcd-lkPn.js">
|
|
95
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-CJx_hK4K.js">
|
|
96
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-CwP-HoXN.js">
|
|
97
|
+
<link rel="modulepreload" crossorigin href="/assets/types-BmLypFZI.js">
|
|
98
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-Czek7cOG.js">
|
|
99
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-CKpFI_5o.js">
|
|
100
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-CJCKi9-y.js">
|
|
101
|
+
<link rel="stylesheet" crossorigin href="/assets/src-r07HspQy.css">
|
|
102
102
|
</head>
|
|
103
103
|
<body class="h-full bg-background text-foreground">
|
|
104
104
|
<div id="root" class="h-full"></div>
|
package/package.json
CHANGED
package/server/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export interface WebUiServerController {
|
|
|
6
6
|
httpServer: Server;
|
|
7
7
|
getPort: () => number | null;
|
|
8
8
|
getOpenCodePort: () => number | null;
|
|
9
|
+
/** Authenticated process-local client for the desktop GUI host; never expose over HTTP/IPC. */
|
|
10
|
+
getGuiPluginClient: () => import('@opencode/client').OpenCodeClient;
|
|
9
11
|
isReady: () => boolean;
|
|
10
12
|
restartOpenCode: () => Promise<void>;
|
|
11
13
|
stop: (options?: { exitProcess?: boolean; forceCloseConnections?: boolean }) => Promise<void>;
|
package/server/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import './lib/brand-migration-bootstrap.js';
|
|
2
2
|
import 'reflect-metadata';
|
|
3
3
|
import express from 'express';
|
|
4
|
-
import { configureOpenCodeCredentials, openCodeCredentialSource } from './lib/opencode/auth.js';
|
|
4
|
+
import { configureOpenCodeCredentials, openCodeCredentialSource, currentClient } from './lib/opencode/auth.js';
|
|
5
|
+
import { trustedGuiPluginClient } from './lib/opencode/gui-plugin-source.js';
|
|
5
6
|
import compression from 'compression';
|
|
6
7
|
import path from 'path';
|
|
7
8
|
import { spawn, spawnSync } from 'child_process';
|
|
@@ -2159,6 +2160,12 @@ async function main(options = {}) {
|
|
|
2159
2160
|
httpServer: server,
|
|
2160
2161
|
getPort: () => tunnelRuntimeContext.getActivePort(),
|
|
2161
2162
|
getOpenCodePort: () => openCodePort,
|
|
2163
|
+
// In-process desktop only: never serialize this authenticated client to a renderer.
|
|
2164
|
+
getGuiPluginClient: () => trustedGuiPluginClient({
|
|
2165
|
+
managed: Boolean(openCodeProcess && !isExternalOpenCode),
|
|
2166
|
+
shared: openCodeLifecycleRuntime.isSharedOpenCodeService(),
|
|
2167
|
+
ready: isOpenCodeReady, url: buildOpenCodeUrl('', ''), client: currentClient,
|
|
2168
|
+
}),
|
|
2162
2169
|
getQuitRiskStatus: () => ({
|
|
2163
2170
|
scheduledTasks: scheduledTasksRuntime.getStatus(),
|
|
2164
2171
|
}),
|
|
@@ -35,7 +35,11 @@ timestamps, not installation/version timestamps or browser onboarding flags.
|
|
|
35
35
|
An absent completion marker requires initialization. A completed runtime does not
|
|
36
36
|
walk the catalog on startup or on a timer. It resumes only the durable dirty-session
|
|
37
37
|
queue populated by live events. Each dirty session is read by ID and refreshes its
|
|
38
|
-
own messages; unrelated sessions incur no upstream work. Initialization
|
|
38
|
+
own messages; unrelated sessions incur no upstream work. Initialization passes
|
|
39
|
+
resolve pending IDs outside a bounded catalog through `session.get`; excluded
|
|
40
|
+
children and expired sessions leave the dirty queue, while failed reads retain it.
|
|
41
|
+
This prevents filtered-out dirty IDs from keeping initialization in a rescan loop.
|
|
42
|
+
Initialization failures
|
|
39
43
|
retry using committed per-session checkpoints. Explicit `sync()` remains deliberate
|
|
40
44
|
catalog reconciliation; automatic scheduling uses incremental mode.
|
|
41
45
|
The event-identity hotfix adds `search_coverage.event_identity_repaired` without
|
|
@@ -84,6 +84,30 @@ export function createContentSearchRuntime({ service, getRuntimeKey, getEventRun
|
|
|
84
84
|
state.total = sessions.length;
|
|
85
85
|
state.completed = 0;
|
|
86
86
|
const recentIDs = new Set(sessions.map((session) => session.id));
|
|
87
|
+
// A time-bounded catalog cannot classify pending IDs outside its pages.
|
|
88
|
+
// Resolve those IDs directly so excluded children/expired roots cannot
|
|
89
|
+
// keep initialization dirty forever. Failed reads remain pending.
|
|
90
|
+
if (scanCatalog && !completeCatalog) for (const sessionID of pendingDirty) if (!recentIDs.has(sessionID)) {
|
|
91
|
+
try {
|
|
92
|
+
const session = await getSession({ sessionID, signal });
|
|
93
|
+
if (!current()) return;
|
|
94
|
+
if (!session?.id || !Number.isFinite(session.time?.updated)) throw new Error('Invalid dirty session');
|
|
95
|
+
if (!session.parentID && session.time.updated >= state.since && !deleted.has(sessionID)) {
|
|
96
|
+
sessions.push(session);
|
|
97
|
+
recentIDs.add(sessionID);
|
|
98
|
+
} else {
|
|
99
|
+
service.removeSession(runtime, sessionID);
|
|
100
|
+
dirty.delete(sessionID);
|
|
101
|
+
}
|
|
102
|
+
} catch (error) {
|
|
103
|
+
if (!current()) return;
|
|
104
|
+
if ((error?.status ?? error?.response?.status) === 404) {
|
|
105
|
+
service.removeSession(runtime, sessionID);
|
|
106
|
+
dirty.delete(sessionID);
|
|
107
|
+
} else state.failed++;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
state.total = sessions.length;
|
|
87
111
|
if (scanCatalog && completeCatalog) for (const id of pendingDirty) if (!recentIDs.has(id)) {
|
|
88
112
|
dirty.delete(id);
|
|
89
113
|
service.acknowledge(runtime, id, revisions.get(id));
|
|
@@ -2,6 +2,25 @@ import { expect, test, vi } from 'vitest';
|
|
|
2
2
|
import { createContentSearchService } from './service.js';
|
|
3
3
|
import { createContentSearchRuntime } from './runtime.js';
|
|
4
4
|
|
|
5
|
+
test('bounded backfill drains excluded dirty children without repeating the catalog scan', async () => {
|
|
6
|
+
const service = createContentSearchService({ dbPath: ':memory:' });
|
|
7
|
+
const day = 86400000;
|
|
8
|
+
const now = 40 * day;
|
|
9
|
+
service.markDirty('host', 'child');
|
|
10
|
+
const listSessions = vi.fn(async () => ({ data: [{ id: 'old', time: { updated: 1 } }], cursor: { next: 'older' } }));
|
|
11
|
+
const runtime = createContentSearchRuntime({ service, getRuntimeKey: () => 'host', now: () => now,
|
|
12
|
+
listSessions, getSession: async () => ({ id: 'child', parentID: 'parent', time: { updated: now } }),
|
|
13
|
+
listMessages: vi.fn(),
|
|
14
|
+
});
|
|
15
|
+
try {
|
|
16
|
+
await runtime.sync({ incremental: true });
|
|
17
|
+
expect(service.pending('host')).toEqual([]);
|
|
18
|
+
expect(runtime.status().initializationRequired).toBe(false);
|
|
19
|
+
await runtime.sync({ incremental: true });
|
|
20
|
+
expect(listSessions).toHaveBeenCalledTimes(1);
|
|
21
|
+
} finally { await runtime.stop(); service.close(); }
|
|
22
|
+
});
|
|
23
|
+
|
|
5
24
|
test('warm startup and idle time do not scan history; durable dirty events refresh only their session', async () => {
|
|
6
25
|
vi.useFakeTimers();
|
|
7
26
|
const service = createContentSearchService({ dbPath: ':memory:' });
|
|
@@ -24,6 +24,7 @@ This module provides OpenCode server integration utilities for the web server ru
|
|
|
24
24
|
- `packages/web/server/lib/opencode/index.js`: public entrypoint (currently baseline placeholder).
|
|
25
25
|
- `packages/web/server/lib/opencode/auth.js`: host-only authoritative provider credential API reads and deletion.
|
|
26
26
|
- `packages/web/server/lib/opencode/auth-state-runtime.js`: managed OpenCode server auth password/header runtime.
|
|
27
|
+
- `gui-plugin-source.js`: process-local native GUI client admission. Requires ready managed-child/shared-service ownership plus loopback endpoint; external servers/SSH forwards cannot supply native code. The returned server controller's `getGuiPluginClient()` calls this gate, and throws stable `GUI_PLUGIN_UNTRUSTED_SOURCE` / `GUI_PLUGIN_UNAVAILABLE` codes. It is never an HTTP route or renderer-provided endpoint.
|
|
27
28
|
- `packages/web/server/lib/opencode/cli-options.js`: CLI/environment option parsing for server startup arguments.
|
|
28
29
|
- `packages/web/server/lib/opencode/cli-entry-runtime.js`: CLI entrypoint runtime that detects direct execution, forces `YURI_RUNTIME=web` unless already `ssh-remote` (so `dev:server` cannot inherit a leftover desktop env and host a relay, while SSH-managed remotes may), parses CLI options, and starts server bootstrap.
|
|
29
30
|
- `packages/web/server/lib/opencode/routes.js`: OpenCode/provider settings and auth-related route registration.
|
|
@@ -68,6 +69,10 @@ This module provides OpenCode server integration utilities for the web server ru
|
|
|
68
69
|
- `packages/web/server/lib/opencode/settings-normalization-runtime.js`: path/settings normalization and sanitization helpers runtime used by settings/routes/config wiring.
|
|
69
70
|
- `packages/web/server/lib/opencode/theme-runtime.js`: custom theme JSON validation and theme directory loading runtime for settings utility routes.
|
|
70
71
|
- `packages/web/server/lib/opencode/proxy.js`: OpenCode API/SSE forwarding and readiness-gate route registration.
|
|
72
|
+
- `plugin-gui-response.js`: shared Web/Electron/VS Code code-only revision response owner for exact `GET /api/plugin/gui?id=…` (one nonempty id). The installed GUI client alias is official `@opencode/client@2.2.0`: HTTP returns `{ location, data: { code, revision, options } }`. Every call still reads the complete current upstream response through the existing auth/readiness/abort boundary; there is no Host bundle cache.
|
|
73
|
+
- Request `X-Yuri-Gui-Revision: <lowercase SHA-256 hex of UTF-8 revision>` opts into code reuse. This header and HTTP condition/range headers are stripped before upstream so Yuri always requests a complete representation. Other query and request headers retain proxy semantics.
|
|
74
|
+
- A valid upstream 200 JSON bundle (`code` string, nonempty `revision` string, `options` object) receives `X-Yuri-Gui-Revision` and `Cache-Control: private, no-store`. Matching tokens additionally receive `X-Yuri-Gui-Code: cached` and only `data.code` becomes `''`; current `options`, `revision`, location and other fields remain. Unmatched/ordinary calls preserve original body bytes. No 304 or Yuri ETag is generated. Upstream failure statuses/bodies remain failures; malformed successful bodies remain unchanged without a revision receipt.
|
|
75
|
+
- Clients restore code before SDK decoding and may persist code/revision only, never options. Browser caches must not store these option-bearing responses. Stale validators and decoded compression/length headers are removed at the response boundary. Packaged/mobile cross-origin clients receive the two response headers through CORS; Relay forwards them transparently on the same `/api/plugin/gui` path.
|
|
71
76
|
- `packages/web/server/lib/opencode/instance-recovery-runtime.js`: directory-instance health recovery before turn admission (`prompt_async` / `command` / `shell`). When OpenCode's per-directory instance is poisoned (MCP probe returns 503 empty while HTTP still accepts prompts that immediately abort as `MessageAbortedError`), dispose the instance so the next admission recreates a healthy one.
|
|
72
77
|
- `packages/web/server/lib/opencode/session-runtime.js`: session status/attention/activity runtime for OpenCode SSE events.
|
|
73
78
|
- `packages/web/server/lib/opencode/watcher.js`: global SSE watcher runtime for push/session event fanout.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** A loopback URL alone is not ownership: external services and SSH forwards are excluded. */
|
|
2
|
+
export function trustedGuiPluginClient({ managed, shared, ready, url, client }) {
|
|
3
|
+
let local = false;
|
|
4
|
+
try {
|
|
5
|
+
const parsed = new URL(url);
|
|
6
|
+
local = ['http:', 'https:'].includes(parsed.protocol) && ['127.0.0.1', '[::1]', 'localhost'].includes(parsed.hostname)
|
|
7
|
+
&& !parsed.username && !parsed.password;
|
|
8
|
+
} catch { /* Missing or malformed endpoint is not a trusted source. */ }
|
|
9
|
+
if (!local || (!managed && !shared)) {
|
|
10
|
+
throw Object.assign(new Error('Native GUI source is not locally managed'), { code: 'GUI_PLUGIN_UNTRUSTED_SOURCE' });
|
|
11
|
+
}
|
|
12
|
+
if (!ready) throw Object.assign(new Error('Local GUI service is unavailable'), { code: 'GUI_PLUGIN_UNAVAILABLE' });
|
|
13
|
+
return client();
|
|
14
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import { trustedGuiPluginClient } from './gui-plugin-source.js';
|
|
3
|
+
|
|
4
|
+
describe('desktop native GUI code source', () => {
|
|
5
|
+
it.each([
|
|
6
|
+
{ managed: true, shared: false, url: 'http://127.0.0.1:4096' },
|
|
7
|
+
{ managed: false, shared: true, url: 'http://[::1]:4096' },
|
|
8
|
+
])('accepts authoritative local ownership: %j', (source) => {
|
|
9
|
+
const value = {}; const client = vi.fn(() => value);
|
|
10
|
+
expect(trustedGuiPluginClient({ ...source, ready: true, client })).toBe(value);
|
|
11
|
+
expect(client).toHaveBeenCalledOnce();
|
|
12
|
+
});
|
|
13
|
+
it.each([
|
|
14
|
+
{ managed: false, shared: false, url: 'http://127.0.0.1:4096' },
|
|
15
|
+
{ managed: true, shared: false, url: 'https://remote.example' },
|
|
16
|
+
{ managed: false, shared: true, url: 'https://localhost.remote.example' },
|
|
17
|
+
{ managed: true, shared: false, url: 'file:///plugin.cjs' },
|
|
18
|
+
{ managed: true, shared: false, url: 'http://name:password@localhost:4096' },
|
|
19
|
+
])('rejects external/forwarded or non-local sources before obtaining credentials: %j', (source) => {
|
|
20
|
+
const client = vi.fn();
|
|
21
|
+
expect(() => trustedGuiPluginClient({ ...source, ready: true, client })).toThrow(expect.objectContaining({ code: 'GUI_PLUGIN_UNTRUSTED_SOURCE' }));
|
|
22
|
+
expect(client).not.toHaveBeenCalled();
|
|
23
|
+
});
|
|
24
|
+
it('distinguishes temporarily unavailable local service from an untrusted source', () => {
|
|
25
|
+
expect(() => trustedGuiPluginClient({ managed: true, ready: false, url: 'http://localhost:4096', client: vi.fn() }))
|
|
26
|
+
.toThrow(expect.objectContaining({ code: 'GUI_PLUGIN_UNAVAILABLE' }));
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function preparePluginGuiRequest(
|
|
2
|
+
method: string,
|
|
3
|
+
requestPath: string,
|
|
4
|
+
headers: Record<string, string>,
|
|
5
|
+
): { headers: Record<string, string>; revision: string | null } | null;
|
|
6
|
+
|
|
7
|
+
export function projectPluginGuiResponse(response: Response, requestedRevision: string | null): Promise<Response>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
|
|
3
|
+
const REVISION_HEADER = 'x-yuri-gui-revision';
|
|
4
|
+
const CODE_HEADER = 'x-yuri-gui-code';
|
|
5
|
+
const FULL_RESPONSE_HEADERS = new Set([
|
|
6
|
+
REVISION_HEADER, CODE_HEADER, 'if-none-match', 'if-modified-since',
|
|
7
|
+
'if-match', 'if-unmodified-since', 'if-range', 'range',
|
|
8
|
+
]);
|
|
9
|
+
|
|
10
|
+
/** Only the official GUI read opts into Yuri's code-only reuse protocol. */
|
|
11
|
+
export const preparePluginGuiRequest = (method, requestPath, headers) => {
|
|
12
|
+
if (method !== 'GET') return null;
|
|
13
|
+
const url = new URL(requestPath, 'http://yuri.invalid');
|
|
14
|
+
if (url.pathname !== '/api/plugin/gui'
|
|
15
|
+
|| url.searchParams.getAll('id').length !== 1
|
|
16
|
+
|| !url.searchParams.get('id')) return null;
|
|
17
|
+
|
|
18
|
+
let revision = null;
|
|
19
|
+
const forwarded = {};
|
|
20
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
21
|
+
const name = key.toLowerCase();
|
|
22
|
+
if (name === REVISION_HEADER && /^[a-f0-9]{64}$/.test(value)) revision = value;
|
|
23
|
+
if (!FULL_RESPONSE_HEADERS.has(name)) forwarded[key] = value;
|
|
24
|
+
}
|
|
25
|
+
forwarded['accept-encoding'] = 'identity';
|
|
26
|
+
return { headers: forwarded, revision };
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const isRecord = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
30
|
+
|
|
31
|
+
/** No history/cache: only this request's complete, validated upstream 200 can omit code. */
|
|
32
|
+
export const projectPluginGuiResponse = async (response, requestedRevision) => {
|
|
33
|
+
if (response.status !== 200) return response;
|
|
34
|
+
const headers = new Headers(response.headers);
|
|
35
|
+
headers.set('cache-control', 'private, no-store');
|
|
36
|
+
headers.delete(REVISION_HEADER);
|
|
37
|
+
headers.delete(CODE_HEADER);
|
|
38
|
+
headers.delete('etag');
|
|
39
|
+
headers.delete('last-modified');
|
|
40
|
+
headers.delete('content-length');
|
|
41
|
+
headers.delete('content-encoding');
|
|
42
|
+
headers.delete('transfer-encoding');
|
|
43
|
+
|
|
44
|
+
// Fetch has decoded compression. Keep original bytes even for malformed JSON.
|
|
45
|
+
let body = Buffer.from(await response.arrayBuffer());
|
|
46
|
+
if (/^application\/(?:json|[^;]+\+json)(?:\s*;|$)/i.test(headers.get('content-type') || '')) {
|
|
47
|
+
let envelope;
|
|
48
|
+
try { envelope = JSON.parse(body.toString('utf8')); } catch { /* Preserve upstream bytes. */ }
|
|
49
|
+
const bundle = isRecord(envelope) && isRecord(envelope.location) ? envelope.data : null;
|
|
50
|
+
if (isRecord(bundle) && typeof bundle.code === 'string'
|
|
51
|
+
&& typeof bundle.revision === 'string' && bundle.revision.length > 0
|
|
52
|
+
&& isRecord(bundle.options)) {
|
|
53
|
+
const revision = createHash('sha256').update(bundle.revision).digest('hex');
|
|
54
|
+
headers.set(REVISION_HEADER, revision);
|
|
55
|
+
if (requestedRevision === revision) {
|
|
56
|
+
body = Buffer.from(JSON.stringify({ ...envelope, data: { ...bundle, code: '' } }));
|
|
57
|
+
headers.set(CODE_HEADER, 'cached');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return new Response(body, { status: response.status, statusText: response.statusText, headers });
|
|
62
|
+
};
|