@yuriai/web 0.2.0-beta.1 → 0.2.0-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/README.md +1 -1
- package/dist/assets/{AssistantView-CKSBN9HQ.js → AssistantView-CLKNSmK0.js} +3 -3
- package/dist/assets/{DiagramView-RmE0gXVx.js → DiagramView-C_urOuXu.js} +1 -1
- package/dist/assets/{GuiPluginSurface-DWGYdQLr.js → GuiPluginSurface-736HcjIN.js} +1 -1
- package/dist/assets/{GuiPluginWindow-CLgceKTX.js → GuiPluginWindow-BHbqKl7P.js} +1 -1
- package/dist/assets/{MarkdownRenderer-7zj1J9EY.js → MarkdownRenderer-CRYQRJ6O.js} +2 -2
- package/dist/assets/{MarkdownRendererImpl-lXwdc-kG.js → MarkdownRendererImpl-DJcRI0hT.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-B5or38qI.js → MarkstreamRendererImpl-BffzWk4G.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-K8AyOZUE.js → MobileDetailNavigation-BEB3hlJ1.js} +1 -1
- package/dist/assets/{MobileShareBridge-9RP7ni2F.js → MobileShareBridge-9gdwpoAb.js} +1 -1
- package/dist/assets/{MobileTabPageHeader-ZZTO3phT.js → MobileTabPageHeader-Dh5mqOcK.js} +1 -1
- package/dist/assets/{MultiRunWindow-CLGnrnLn.js → MultiRunWindow-Bi3aly9b.js} +1 -1
- package/dist/assets/{SettingsView-BlruenEQ.js → SettingsView-CIPoAFnD.js} +1 -1
- package/dist/assets/{SettingsWindow-B-z25PVS.js → SettingsWindow-B24JgZnf.js} +1 -1
- package/dist/assets/{TerminalView-CRyh7cpp.js → TerminalView-BWutwGtP.js} +1 -1
- package/dist/assets/{ToolOutputDialog-CMiPmx7q.js → ToolOutputDialog-gcD1fSaB.js} +1 -1
- package/dist/assets/{appThemeRegistry-e1zU7R2C.js → appThemeRegistry-ktbSDOFk.js} +1 -1
- package/dist/assets/{capgoAdapter-CEzjhZ15.js → capgoAdapter-3Uy_m4Za.js} +1 -1
- package/dist/assets/{device-CCFr0Aht.js → device-B-trKdcC.js} +1 -1
- package/dist/assets/{dropdown-menu.styles-4tACRbYU.js → dropdown-menu.styles-B-E_v3QZ.js} +1 -1
- package/dist/assets/{fileMentionTouchSelection-BCTXha9_.js → fileMentionTouchSelection-bVnePHdS.js} +1 -1
- package/dist/assets/{fileReferenceActions-B0iaTe0c.js → fileReferenceActions-Ca5wtvOa.js} +1 -1
- package/dist/assets/{gitApi-DIwsfb2k.js → gitApi-DccSJMYl.js} +1 -1
- package/dist/assets/gui-DpIvy9qB.js +1 -0
- package/dist/assets/host-u2MH0QSP.js +1 -0
- package/dist/assets/{insertionBoundaries-CFDcBxaK.js → insertionBoundaries-BZgMtXXz.js} +1 -1
- package/dist/assets/{main-XMhFdW0K.js → main-DSa1W5SA.js} +2 -2
- package/dist/assets/{main-DBJ19laz.js → main-HBpfFsY-.js} +4 -4
- package/dist/assets/{mcpQueries-f0cDQQKu.js → mcpQueries-CFR_danB.js} +1 -1
- package/dist/assets/{miniChat-BVTtOggs.js → miniChat-DcG2PyMu.js} +2 -2
- package/dist/assets/{mobile-0X6dYZAB.js → mobile-DGUDmzLl.js} +2 -2
- package/dist/assets/{mobileBackNavigation-htjL23a2.js → mobileBackNavigation-i40NmwxE.js} +1 -1
- package/dist/assets/{multirun-mBD1Y3Eb.js → multirun-D-E3RJbf.js} +1 -1
- package/dist/assets/{native-config-B9V18QgV.js → native-config-BU8ochmh.js} +1 -1
- package/dist/assets/{platform-HIkm-CHn.js → platform-CxNhofMC.js} +3 -3
- package/dist/assets/{projectMeta-tXx77gZG.js → projectMeta-Ddp_NxcI.js} +1 -1
- package/dist/assets/{readiness-Da7jHHss.js → readiness-CydU25xC.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-DwIydDUm.js → renderElectronMiniChatApp-C11y4O8g.js} +2 -2
- package/dist/assets/{renderMobileApp-TNkNM5Zx.js → renderMobileApp-BeJqGLid.js} +4 -4
- package/dist/assets/{runtimeConfig-ChR1FQv1.js → runtimeConfig-xiF5snk3.js} +1 -1
- package/dist/assets/{runtimeEndpointReset-CxMEqgDx.js → runtimeEndpointReset-CWOI8alW.js} +3 -3
- package/dist/assets/{scheduledTaskNavigation-B71VHwFK.js → scheduledTaskNavigation-CE4sIXxf.js} +1 -1
- package/dist/assets/{sessionChangeSummary-DDbB-N5p.js → sessionChangeSummary-DA1ZMfkC.js} +1 -1
- package/dist/assets/{sessionLookup-CsJ8Vrq8.js → sessionLookup-Mz6LvD5p.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-CnaQoAAB.js → sortable-tabs-strip-dKp0SH4C.js} +1 -1
- package/dist/assets/{speechSettingsQueries-X0jStYkm.js → speechSettingsQueries-CYiiOuya.js} +1 -1
- package/dist/assets/{terminalApi-DVZUO2Uv.js → terminalApi-Bs5skvIp.js} +1 -1
- package/dist/assets/{types-Dfj_Rn0L.js → types-DoaGaihV.js} +1 -1
- package/dist/assets/{useAppFontEffects-DDdQeaoM.js → useAppFontEffects-sz1UI2pZ.js} +5 -5
- package/dist/assets/{useDesktopWindowControlsLayout-BFyKfmUX.js → useDesktopWindowControlsLayout-D_0gn_5u.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-CST6AXTm.js → useEffectiveDirectory-Ct1Akmfw.js} +1 -1
- package/dist/assets/{useFontPreferences-D-XYUHOV.js → useFontPreferences-n13Q1-rH.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-BdWv0Da4.js → useMobileNavigationStore-BdTMlKQU.js} +5 -5
- package/dist/assets/{useWorkerHighlightedLines-OsRfq7LD.js → useWorkerHighlightedLines-B3R3cGBi.js} +1 -1
- package/dist/assets/vendor-opencode-client-BcpAhe9I.js +12 -0
- package/dist/assets/{vendor-opencode-plugin-DhwD3Tat.js → vendor-opencode-plugin-BglYYlJt.js} +1 -1
- package/dist/assets/vendor-solid-js-B2FO7pdm.js +1 -0
- package/dist/index.html +8 -8
- package/dist/mini-chat.html +8 -8
- package/dist/mobile.html +8 -8
- package/package.json +3 -3
- package/server/lib/content-search/DOCUMENTATION.md +17 -11
- package/server/lib/content-search/index.js +1 -0
- package/server/lib/content-search/runtime.js +50 -9
- package/server/lib/content-search/runtime.test.js +72 -1
- package/server/lib/content-search/service.js +12 -1
- package/server/lib/opencode/DOCUMENTATION.md +9 -9
- package/server/lib/opencode/ensure-cli.js +12 -14
- package/server/lib/opencode/ensure-cli.test.js +8 -8
- package/server/lib/opencode/env-runtime.test.js +1 -1
- package/server/lib/opencode/opencode2-pin.js +3 -4
- package/server/lib/opencode/opencode2-pin.test.js +5 -4
- package/server/lib/opencode/owned-runtime-upgrade.js +4 -11
- package/server/lib/opencode/owned-runtime-upgrade.test.js +4 -0
- package/server/lib/opencode/routes.js +2 -1
- package/server/lib/opencode/routes.test.js +1 -1
- package/server/lib/opencode/runtime-contract.js +3 -4
- package/server/lib/opencode/session-directory-runtime.js +2 -13
- package/server/lib/opencode/session-directory-runtime.test.js +69 -4
- package/server/lib/opencode/upgrade-screen.js +9 -5
- package/server/lib/opencode/upgrade-screen.test.js +20 -0
- package/server/lib/opencode/version-alignment.test.js +6 -6
- package/server/lib/session-index/DOCUMENTATION.md +18 -8
- package/server/lib/session-index/routes.js +3 -1
- package/server/lib/session-index/routes.test.js +2 -0
- package/server/lib/session-index/service.js +23 -0
- package/server/lib/session-index/sync-runtime.js +75 -20
- package/server/lib/session-index/sync-runtime.test.js +5 -5
- package/dist/assets/gui-CTnzY_cr.js +0 -1
- package/dist/assets/host-CEMl6ZlP.js +0 -1
- package/dist/assets/vendor-opencode-client-Eb-_7KbZ.js +0 -23
- package/dist/assets/vendor-solid-js-CXSXbuQO.js +0 -1
package/dist/assets/{vendor-opencode-plugin-DhwD3Tat.js → vendor-opencode-plugin-BglYYlJt.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-hePW80VL.js";import{A as t,C as n,
|
|
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-BcpAhe9I.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};
|
|
@@ -0,0 +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};
|
package/dist/index.html
CHANGED
|
@@ -560,7 +560,7 @@
|
|
|
560
560
|
opacity: 0.72;
|
|
561
561
|
}
|
|
562
562
|
</style>
|
|
563
|
-
<script type="module" crossorigin src="/assets/main-
|
|
563
|
+
<script type="module" crossorigin src="/assets/main-DSa1W5SA.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">
|
|
@@ -580,18 +580,18 @@
|
|
|
580
580
|
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-DNc_ga0E.js">
|
|
581
581
|
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-BWl7Zy8M.js">
|
|
582
582
|
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-DXlObQuU.js">
|
|
583
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-
|
|
583
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-BcpAhe9I.js">
|
|
584
584
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-CdqCAt40.js">
|
|
585
585
|
<link rel="modulepreload" crossorigin href="/assets/path-utils-QNmCUIdP.js">
|
|
586
586
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
587
587
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-yx0xpKe-.js">
|
|
588
|
-
<link rel="modulepreload" crossorigin href="/assets/platform-
|
|
589
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
588
|
+
<link rel="modulepreload" crossorigin href="/assets/platform-CxNhofMC.js">
|
|
589
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-Bs5skvIp.js">
|
|
590
590
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-CwMwe_O9.js">
|
|
591
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
592
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
593
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
594
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
591
|
+
<link rel="modulepreload" crossorigin href="/assets/types-DoaGaihV.js">
|
|
592
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-3Uy_m4Za.js">
|
|
593
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-BU8ochmh.js">
|
|
594
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-xiF5snk3.js">
|
|
595
595
|
<link rel="stylesheet" crossorigin href="/assets/src-CZA3gFyl.css">
|
|
596
596
|
</head>
|
|
597
597
|
<body class="h-full bg-background text-foreground">
|
package/dist/mini-chat.html
CHANGED
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
}
|
|
75
75
|
</style>
|
|
76
76
|
|
|
77
|
-
<script type="module" crossorigin src="/assets/miniChat-
|
|
77
|
+
<script type="module" crossorigin src="/assets/miniChat-DcG2PyMu.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">
|
|
@@ -94,18 +94,18 @@
|
|
|
94
94
|
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-DNc_ga0E.js">
|
|
95
95
|
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-BWl7Zy8M.js">
|
|
96
96
|
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-DXlObQuU.js">
|
|
97
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-
|
|
97
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-BcpAhe9I.js">
|
|
98
98
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-CdqCAt40.js">
|
|
99
99
|
<link rel="modulepreload" crossorigin href="/assets/path-utils-QNmCUIdP.js">
|
|
100
100
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
101
101
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-yx0xpKe-.js">
|
|
102
|
-
<link rel="modulepreload" crossorigin href="/assets/platform-
|
|
103
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
102
|
+
<link rel="modulepreload" crossorigin href="/assets/platform-CxNhofMC.js">
|
|
103
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-Bs5skvIp.js">
|
|
104
104
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-CwMwe_O9.js">
|
|
105
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
106
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
107
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
108
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
105
|
+
<link rel="modulepreload" crossorigin href="/assets/types-DoaGaihV.js">
|
|
106
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-3Uy_m4Za.js">
|
|
107
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-BU8ochmh.js">
|
|
108
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-xiF5snk3.js">
|
|
109
109
|
<link rel="stylesheet" crossorigin href="/assets/src-CZA3gFyl.css">
|
|
110
110
|
</head>
|
|
111
111
|
<body class="h-full bg-background text-foreground">
|
package/dist/mobile.html
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
})();
|
|
64
64
|
</script>
|
|
65
65
|
|
|
66
|
-
<script type="module" crossorigin src="/assets/mobile-
|
|
66
|
+
<script type="module" crossorigin src="/assets/mobile-DGUDmzLl.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">
|
|
@@ -83,18 +83,18 @@
|
|
|
83
83
|
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-DNc_ga0E.js">
|
|
84
84
|
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-BWl7Zy8M.js">
|
|
85
85
|
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-DXlObQuU.js">
|
|
86
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-
|
|
86
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-opencode-client-BcpAhe9I.js">
|
|
87
87
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-CdqCAt40.js">
|
|
88
88
|
<link rel="modulepreload" crossorigin href="/assets/path-utils-QNmCUIdP.js">
|
|
89
89
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
90
90
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-yx0xpKe-.js">
|
|
91
|
-
<link rel="modulepreload" crossorigin href="/assets/platform-
|
|
92
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
91
|
+
<link rel="modulepreload" crossorigin href="/assets/platform-CxNhofMC.js">
|
|
92
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-Bs5skvIp.js">
|
|
93
93
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-CwMwe_O9.js">
|
|
94
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
95
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
96
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
97
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
94
|
+
<link rel="modulepreload" crossorigin href="/assets/types-DoaGaihV.js">
|
|
95
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-3Uy_m4Za.js">
|
|
96
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-BU8ochmh.js">
|
|
97
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-xiF5snk3.js">
|
|
98
98
|
<link rel="stylesheet" crossorigin href="/assets/src-CZA3gFyl.css">
|
|
99
99
|
</head>
|
|
100
100
|
<body class="h-full bg-background text-foreground">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuriai/web",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./server/index.js",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@clack/prompts": "^1.1.0",
|
|
27
27
|
"@earendil-works/pi-agent-core": "0.84.4",
|
|
28
28
|
"@octokit/rest": "^22.0.1",
|
|
29
|
-
"@opencode/client": "2.0.23",
|
|
30
|
-
"@opencode/schema": "2.0.23",
|
|
29
|
+
"@opencode/client": "^2.0.23",
|
|
30
|
+
"@opencode/schema": "^2.0.23",
|
|
31
31
|
"@simplewebauthn/server": "13.3.1",
|
|
32
32
|
"adm-zip": "^0.5.16",
|
|
33
33
|
"better-sqlite3": "^12.10.0",
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
The Host owns `content-search.sqlite` alongside the session index. This index is
|
|
4
4
|
independent of browser transcript caches and includes all projects exposed by the
|
|
5
5
|
active OpenCode runtime. `session.list` is called without a project/directory
|
|
6
|
-
filter
|
|
6
|
+
filter during initial backfill; descending opaque cursors stop at the thirty-day
|
|
7
|
+
boundary or exhaustion. The default coverage is
|
|
7
8
|
messages created in the last thirty days in recently updated root sessions.
|
|
8
9
|
Sessions with a non-empty `parentID` (subagents) are excluded before message
|
|
9
10
|
fetching and progress counting. Only root IDs enter the authoritative pruning
|
|
10
|
-
set, so a
|
|
11
|
+
set, so a fully exhausted catalog scan also removes previously indexed subagent
|
|
11
12
|
messages, FTS entries and checkpoints. Failed catalog reads preserve the old index.
|
|
12
13
|
|
|
13
14
|
Two workers page native `message.list` directly, normalize via the shared server
|
|
@@ -31,12 +32,13 @@ and checkpoint until a complete replacement succeeds.
|
|
|
31
32
|
`search_coverage` durably records each runtime's `indexStartedAt`,
|
|
32
33
|
`indexCompletedAt`, `coveredSince`, and `verifiedAt`. These are index operation
|
|
33
34
|
timestamps, not installation/version timestamps or browser onboarding flags.
|
|
34
|
-
An absent completion marker requires initialization.
|
|
35
|
-
the
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
An absent completion marker requires initialization. A completed runtime does not
|
|
36
|
+
walk the catalog on startup or on a timer. It resumes only the durable dirty-session
|
|
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 failures
|
|
39
|
+
retry using committed per-session checkpoints. Explicit `sync()` remains deliberate
|
|
40
|
+
catalog reconciliation; automatic scheduling uses incremental mode.
|
|
41
|
+
Already verified unchanged sessions are reused, including
|
|
40
42
|
sessions with no searchable text. Each session now commits an `indexed_at`
|
|
41
43
|
completion timestamp atomically with its projection, source update time and
|
|
42
44
|
coverage boundary. Existing databases gain this nullable column and the coverage
|
|
@@ -60,7 +62,7 @@ coverage (for example after a system-clock correction).
|
|
|
60
62
|
The status response adds `initializationRequired` and these durable timestamps.
|
|
61
63
|
`updatedAt` remains the current process's latest completed pass, including partial
|
|
62
64
|
passes; clients must not confuse it with successful durable completion. A warm
|
|
63
|
-
startup may be `pending` with `initializationRequired: false`;
|
|
65
|
+
startup may be `pending` with `initializationRequired: false`; queued dirty sessions
|
|
64
66
|
remain background work. `initializationRequired` indicates unfinished first-time
|
|
65
67
|
initialization, not whether the latest incremental pass has caught up. No
|
|
66
68
|
UI-triggered import or OpenCode database conversion is needed:
|
|
@@ -80,8 +82,12 @@ dismissal; runtime changes recheck. Older Hosts without the new status fields
|
|
|
80
82
|
keep their existing behavior. VS Code's direct OpenCode connection has no Host
|
|
81
83
|
FTS service and does not mount this step.
|
|
82
84
|
|
|
83
|
-
Global upstream events mark sessions dirty and coalesce
|
|
84
|
-
|
|
85
|
+
Global upstream events durably mark sessions dirty and coalesce work within one
|
|
86
|
+
second. Successful writes acknowledge only the captured dirty revision, so an event
|
|
87
|
+
during the fetch survives for another pass. Thirty-second retries are scheduled
|
|
88
|
+
only for unfinished initialization or pending dirty sessions, never idle catalog
|
|
89
|
+
polling. Deleted-session events and confirmed 404 remove that session; a time-bounded
|
|
90
|
+
catalog is not authoritative absence for unvisited IDs. Indexing does not depend on
|
|
85
91
|
any UI session being opened. Runtime identity is owned by the Host session index;
|
|
86
92
|
in-flight results are rejected if it changes. Stop aborts reads and drains the
|
|
87
93
|
active pass before closing SQLite.
|
|
@@ -7,6 +7,7 @@ export function createGlobalContentSearch({ dataDir, getRuntimeKey, buildOpenCod
|
|
|
7
7
|
const service = createContentSearchService({ dbPath: path.join(dataDir, 'content-search.sqlite') });
|
|
8
8
|
const client = () => makeOpenCodeV2Client({ baseUrl: buildOpenCodeUrl('/', ''), authHeaders: getOpenCodeAuthHeaders() });
|
|
9
9
|
const runtime = createContentSearchRuntime({ service, getRuntimeKey,
|
|
10
|
+
getSession: ({ sessionID, signal }) => client().session.get({ sessionID }, { signal: AbortSignal.any([signal, AbortSignal.timeout(30_000)]) }),
|
|
10
11
|
listSessions: async ({ signal, ...query }) => {
|
|
11
12
|
await waitForReady();
|
|
12
13
|
return client().session.list(query, { signal: AbortSignal.any([signal, AbortSignal.timeout(30_000)]) });
|
|
@@ -5,7 +5,7 @@ import { normalizeSessionEventType } from '../session-metadata/session-projectio
|
|
|
5
5
|
const RETENTION = 30 * 24 * 60 * 60 * 1000;
|
|
6
6
|
const nextCursor = (page) => typeof page?.cursor?.next === 'string' ? page.cursor.next : null;
|
|
7
7
|
|
|
8
|
-
export function createContentSearchRuntime({ service, getRuntimeKey, listSessions, listMessages, now = Date.now }) {
|
|
8
|
+
export function createContentSearchRuntime({ service, getRuntimeKey, listSessions, getSession, listMessages, now = Date.now }) {
|
|
9
9
|
let stopped = false;
|
|
10
10
|
let flight;
|
|
11
11
|
let timer;
|
|
@@ -16,11 +16,12 @@ export function createContentSearchRuntime({ service, getRuntimeKey, listSession
|
|
|
16
16
|
const deleted = new Set();
|
|
17
17
|
const status = () => {
|
|
18
18
|
const runtime = getRuntimeKey();
|
|
19
|
+
if (!stopped && state.runtime !== runtime) schedule(0);
|
|
19
20
|
const coverage = service.coverage(runtime);
|
|
20
21
|
return { ...(state.runtime === runtime ? state : { runtime, phase: 'pending', since: now() - RETENTION, total: 0, completed: 0, failed: 0, updatedAt: null }),
|
|
21
22
|
...coverage, initializationRequired: coverage.indexCompletedAt === null, ...service.stats(runtime) };
|
|
22
23
|
};
|
|
23
|
-
const sync = () => {
|
|
24
|
+
const sync = ({ incremental = false } = {}) => {
|
|
24
25
|
if (stopped) return Promise.resolve();
|
|
25
26
|
if (flight) return flight;
|
|
26
27
|
const runtime = getRuntimeKey();
|
|
@@ -32,13 +33,37 @@ export function createContentSearchRuntime({ service, getRuntimeKey, listSession
|
|
|
32
33
|
state = { runtime, phase: previous ? 'ready' : 'indexing', since: now() - RETENTION, total: state.total, completed: 0, failed: 0, updatedAt: previous };
|
|
33
34
|
flight = (async () => {
|
|
34
35
|
if (service.coverage(runtime).indexCompletedAt === null) service.beginInitialization(runtime, now());
|
|
36
|
+
const revisions = new Map(service.pending(runtime).map(({ id, revision }) => [id, revision]));
|
|
37
|
+
for (const id of revisions.keys()) dirty.add(id);
|
|
35
38
|
const pendingDirty = new Set(dirty);
|
|
39
|
+
const initialized = service.coverage(runtime).indexCompletedAt !== null;
|
|
40
|
+
const scanCatalog = !incremental || !initialized;
|
|
36
41
|
const sessions = [];
|
|
37
42
|
const ids = new Set();
|
|
38
43
|
let cursor;
|
|
44
|
+
let completeCatalog = scanCatalog;
|
|
39
45
|
const cursors = new Set();
|
|
40
|
-
|
|
41
|
-
|
|
46
|
+
if (!scanCatalog) {
|
|
47
|
+
for (const sessionID of pendingDirty) {
|
|
48
|
+
try {
|
|
49
|
+
const session = await getSession({ sessionID, signal });
|
|
50
|
+
if (!current()) return;
|
|
51
|
+
if (!session?.id || !Number.isFinite(session.time?.updated)) throw new Error('Invalid dirty session');
|
|
52
|
+
if (!session.parentID && session.time.updated >= state.since && !deleted.has(sessionID)) sessions.push(session);
|
|
53
|
+
else {
|
|
54
|
+
service.removeSession(runtime, sessionID);
|
|
55
|
+
dirty.delete(sessionID);
|
|
56
|
+
}
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (!current()) return;
|
|
59
|
+
if ((error?.status ?? error?.response?.status) === 404) {
|
|
60
|
+
service.removeSession(runtime, sessionID);
|
|
61
|
+
dirty.delete(sessionID);
|
|
62
|
+
} else state.failed++;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
} else do {
|
|
66
|
+
const page = await listSessions({ limit: 100, ...(cursor ? { cursor } : { order: 'desc' }), signal });
|
|
42
67
|
if (!current()) return;
|
|
43
68
|
if (!Array.isArray(page?.data)) throw new Error('Invalid global session page');
|
|
44
69
|
for (const session of page.data) {
|
|
@@ -51,11 +76,18 @@ export function createContentSearchRuntime({ service, getRuntimeKey, listSession
|
|
|
51
76
|
cursor = nextCursor(page);
|
|
52
77
|
if (cursor && cursors.has(cursor)) throw new Error('Repeated session cursor');
|
|
53
78
|
if (cursor) cursors.add(cursor);
|
|
79
|
+
if (page.data.some((session) => session.time.updated < state.since)) {
|
|
80
|
+
completeCatalog = !cursor;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
54
83
|
} while (cursor && current());
|
|
55
84
|
state.total = sessions.length;
|
|
56
85
|
state.completed = 0;
|
|
57
86
|
const recentIDs = new Set(sessions.map((session) => session.id));
|
|
58
|
-
for (const id of pendingDirty) if (!recentIDs.has(id))
|
|
87
|
+
if (scanCatalog && completeCatalog) for (const id of pendingDirty) if (!recentIDs.has(id)) {
|
|
88
|
+
dirty.delete(id);
|
|
89
|
+
service.acknowledge(runtime, id, revisions.get(id));
|
|
90
|
+
}
|
|
59
91
|
if (service.coverage(runtime).indexCompletedAt === null) state.phase = 'indexing';
|
|
60
92
|
let index = 0;
|
|
61
93
|
const worker = async () => {
|
|
@@ -85,7 +117,10 @@ export function createContentSearchRuntime({ service, getRuntimeKey, listSession
|
|
|
85
117
|
// Native pages are newest-first, including control records.
|
|
86
118
|
if (page.data.length && page.data.every((record) => Number(record.time?.created) < state.since)) break;
|
|
87
119
|
} while (before && current());
|
|
88
|
-
if (current() && !deleted.has(session.id))
|
|
120
|
+
if (current() && !deleted.has(session.id)) {
|
|
121
|
+
service.replaceSession(runtime, session, [...records.values()], state.since, now());
|
|
122
|
+
if (revisions.has(session.id)) service.acknowledge(runtime, session.id, revisions.get(session.id));
|
|
123
|
+
}
|
|
89
124
|
state.completed++;
|
|
90
125
|
} catch {
|
|
91
126
|
if (!current()) return;
|
|
@@ -96,7 +131,7 @@ export function createContentSearchRuntime({ service, getRuntimeKey, listSession
|
|
|
96
131
|
};
|
|
97
132
|
await Promise.all([worker(), worker()]);
|
|
98
133
|
if (current()) {
|
|
99
|
-
service.prune(runtime, state.since, ids);
|
|
134
|
+
service.prune(runtime, state.since, completeCatalog ? ids : undefined);
|
|
100
135
|
state.phase = state.failed ? 'partial' : 'ready';
|
|
101
136
|
state.updatedAt = now();
|
|
102
137
|
if (!state.failed && !dirty.size) service.completeInitialization(runtime, state.since, state.updatedAt);
|
|
@@ -110,7 +145,11 @@ export function createContentSearchRuntime({ service, getRuntimeKey, listSession
|
|
|
110
145
|
if (stopped || (timer && due <= Date.now() + delay)) return;
|
|
111
146
|
if (timer) clearTimeout(timer);
|
|
112
147
|
due = Date.now() + delay;
|
|
113
|
-
timer = setTimeout(async () => {
|
|
148
|
+
timer = setTimeout(async () => {
|
|
149
|
+
timer = undefined;
|
|
150
|
+
await sync({ incremental: true });
|
|
151
|
+
if (service.coverage(getRuntimeKey()).indexCompletedAt === null || service.pending(getRuntimeKey()).length) schedule(30_000);
|
|
152
|
+
}, delay);
|
|
114
153
|
timer.unref?.();
|
|
115
154
|
};
|
|
116
155
|
return {
|
|
@@ -118,6 +157,7 @@ export function createContentSearchRuntime({ service, getRuntimeKey, listSession
|
|
|
118
157
|
start() { schedule(0); },
|
|
119
158
|
observe(event) {
|
|
120
159
|
if (event.runtimeIdentity?.runtimeKey && event.runtimeIdentity.runtimeKey !== getRuntimeKey()) return;
|
|
160
|
+
if (state.runtime !== getRuntimeKey()) schedule(0);
|
|
121
161
|
const payload = event.payload?.payload ?? event.payload;
|
|
122
162
|
const type = normalizeSessionEventType(payload?.type ?? '');
|
|
123
163
|
if (!(type.startsWith('message.') || type.startsWith('session.'))) return;
|
|
@@ -125,7 +165,8 @@ export function createContentSearchRuntime({ service, getRuntimeKey, listSession
|
|
|
125
165
|
const data = payload.properties ?? payload.data ?? {};
|
|
126
166
|
const id = data.sessionID ?? data.info?.sessionID ?? data.session?.id ?? (type.startsWith('session.') ? data.id ?? data.info?.id : undefined);
|
|
127
167
|
if (id && type === 'session.deleted') { dirty.delete(id); deleted.add(id); service.removeSession(getRuntimeKey(), id); }
|
|
128
|
-
else if (id) dirty.add(id);
|
|
168
|
+
else if (id) { dirty.add(id); service.markDirty(getRuntimeKey(), id); }
|
|
169
|
+
if (!id) return;
|
|
129
170
|
// Coalesce bursts; ongoing scans retain dirty IDs for the next pass.
|
|
130
171
|
schedule(1000);
|
|
131
172
|
},
|
|
@@ -1,7 +1,78 @@
|
|
|
1
|
-
import { expect, test } from 'vitest';
|
|
1
|
+
import { expect, test, vi } from 'vitest';
|
|
2
2
|
import { createContentSearchService } from './service.js';
|
|
3
3
|
import { createContentSearchRuntime } from './runtime.js';
|
|
4
4
|
|
|
5
|
+
test('warm startup and idle time do not scan history; durable dirty events refresh only their session', async () => {
|
|
6
|
+
vi.useFakeTimers();
|
|
7
|
+
const service = createContentSearchService({ dbPath: ':memory:' });
|
|
8
|
+
service.beginInitialization('host', 1);
|
|
9
|
+
service.completeInitialization('host', 0, 2);
|
|
10
|
+
const listSessions = vi.fn(async () => ({ data: [], cursor: {} }));
|
|
11
|
+
const getSession = vi.fn(async ({ sessionID }) => ({ id: sessionID, time: { updated: Date.now() } }));
|
|
12
|
+
const listMessages = vi.fn(async () => ({ data: [], cursor: {} }));
|
|
13
|
+
let runtime = createContentSearchRuntime({ service, getRuntimeKey: () => 'host', listSessions, getSession, listMessages });
|
|
14
|
+
try {
|
|
15
|
+
runtime.start();
|
|
16
|
+
await vi.advanceTimersByTimeAsync(120_000);
|
|
17
|
+
expect(listSessions).not.toHaveBeenCalled();
|
|
18
|
+
expect(listMessages).not.toHaveBeenCalled();
|
|
19
|
+
runtime.observe({ payload: { type: 'message.updated', data: { sessionID: 'one' } } });
|
|
20
|
+
await runtime.stop();
|
|
21
|
+
runtime = createContentSearchRuntime({ service, getRuntimeKey: () => 'host', listSessions, getSession, listMessages });
|
|
22
|
+
runtime.start();
|
|
23
|
+
await vi.advanceTimersByTimeAsync(120_000);
|
|
24
|
+
expect(listSessions).not.toHaveBeenCalled();
|
|
25
|
+
expect(getSession).toHaveBeenCalledTimes(1);
|
|
26
|
+
expect(getSession.mock.calls[0][0].sessionID).toBe('one');
|
|
27
|
+
expect(listMessages).toHaveBeenCalledTimes(1);
|
|
28
|
+
} finally { await runtime.stop(); service.close(); vi.useRealTimers(); }
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('initial history stops at thirty days without pruning unseen sessions as deleted', async () => {
|
|
32
|
+
const service = createContentSearchService({ dbPath: ':memory:' });
|
|
33
|
+
const day = 86400000;
|
|
34
|
+
const now = 40 * day;
|
|
35
|
+
service.replaceSession('host', { id: 'unseen', time: { updated: now } }, [], 0);
|
|
36
|
+
const listSessions = vi.fn(async () => ({ data: [
|
|
37
|
+
{ id: 'recent', time: { updated: now } },
|
|
38
|
+
{ id: 'old', time: { updated: now - 31 * day } },
|
|
39
|
+
], cursor: { next: 'older-history' } }));
|
|
40
|
+
const listMessages = vi.fn(async () => ({ data: [], cursor: {} }));
|
|
41
|
+
const runtime = createContentSearchRuntime({ service, getRuntimeKey: () => 'host', now: () => now, listSessions, listMessages });
|
|
42
|
+
try {
|
|
43
|
+
await runtime.sync();
|
|
44
|
+
expect(listSessions).toHaveBeenCalledTimes(1);
|
|
45
|
+
expect(listMessages).toHaveBeenCalledTimes(1);
|
|
46
|
+
expect(listMessages.mock.calls[0][0].sessionID).toBe('recent');
|
|
47
|
+
expect(service.updated('host', 'unseen')).toBe(now);
|
|
48
|
+
expect(runtime.status().initializationRequired).toBe(false);
|
|
49
|
+
} finally { await runtime.stop(); service.close(); }
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test('an event received while indexing survives acknowledgement and retries only that session', async () => {
|
|
53
|
+
const service = createContentSearchService({ dbPath: ':memory:' });
|
|
54
|
+
service.beginInitialization('host', 1);
|
|
55
|
+
service.completeInitialization('host', 0, 2);
|
|
56
|
+
const listSessions = vi.fn();
|
|
57
|
+
let reads = 0;
|
|
58
|
+
const runtime = createContentSearchRuntime({ service, getRuntimeKey: () => 'host', now: () => 100,
|
|
59
|
+
listSessions, getSession: async ({ sessionID }) => ({ id: sessionID, time: { updated: 10 } }),
|
|
60
|
+
listMessages: async () => {
|
|
61
|
+
if (++reads === 1) runtime.observe({ payload: { type: 'message.updated', data: { sessionID: 's' } } });
|
|
62
|
+
return { data: [], cursor: {} };
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
try {
|
|
66
|
+
runtime.observe({ payload: { type: 'message.updated', data: { sessionID: 's' } } });
|
|
67
|
+
await runtime.sync({ incremental: true });
|
|
68
|
+
expect(service.pending('host')).toHaveLength(1);
|
|
69
|
+
await runtime.sync({ incremental: true });
|
|
70
|
+
expect(reads).toBe(2);
|
|
71
|
+
expect(service.pending('host')).toEqual([]);
|
|
72
|
+
expect(listSessions).not.toHaveBeenCalled();
|
|
73
|
+
} finally { await runtime.stop(); service.close(); }
|
|
74
|
+
});
|
|
75
|
+
|
|
5
76
|
test('indexes only roots and prunes legacy subagents after a complete catalog, including dirty children', async () => {
|
|
6
77
|
const service = createContentSearchService({ dbPath: ':memory:' });
|
|
7
78
|
const root = { id: 'root', time: { updated: 10 } };
|
|
@@ -22,6 +22,7 @@ export function createContentSearchService({ dbPath }) {
|
|
|
22
22
|
CREATE TABLE IF NOT EXISTS search_message(id INTEGER PRIMARY KEY, runtime TEXT, session TEXT, message TEXT, role TEXT, created REAL, body TEXT, UNIQUE(runtime,session,message));
|
|
23
23
|
CREATE INDEX IF NOT EXISTS search_message_scope ON search_message(runtime,session);
|
|
24
24
|
CREATE TABLE IF NOT EXISTS search_coverage(runtime TEXT PRIMARY KEY, started_at REAL NOT NULL, completed_at REAL, since REAL, verified_at REAL);
|
|
25
|
+
CREATE TABLE IF NOT EXISTS search_dirty(runtime TEXT, id TEXT, revision INTEGER NOT NULL, PRIMARY KEY(runtime,id));
|
|
25
26
|
CREATE VIRTUAL TABLE IF NOT EXISTS search_fts USING fts5(body, content='search_message', content_rowid='id', tokenize='trigram');
|
|
26
27
|
CREATE TRIGGER IF NOT EXISTS search_insert AFTER INSERT ON search_message BEGIN
|
|
27
28
|
INSERT INTO search_fts(rowid,body) VALUES(new.id,new.body); END;
|
|
@@ -40,8 +41,18 @@ export function createContentSearchService({ dbPath }) {
|
|
|
40
41
|
const removeSession = db.transaction((runtime, id) => {
|
|
41
42
|
remove.run(runtime, id);
|
|
42
43
|
db.prepare('DELETE FROM search_session WHERE runtime=? AND id=?').run(runtime, id);
|
|
44
|
+
db.prepare('DELETE FROM search_dirty WHERE runtime=? AND id=?').run(runtime, id);
|
|
43
45
|
});
|
|
44
46
|
return {
|
|
47
|
+
markDirty(runtime, id) {
|
|
48
|
+
db.prepare('INSERT INTO search_dirty(runtime,id,revision) VALUES(?,?,1) ON CONFLICT(runtime,id) DO UPDATE SET revision=revision+1').run(runtime, id);
|
|
49
|
+
},
|
|
50
|
+
pending(runtime) {
|
|
51
|
+
return db.prepare('SELECT id,revision FROM search_dirty WHERE runtime=?').all(runtime);
|
|
52
|
+
},
|
|
53
|
+
acknowledge(runtime, id, revision) {
|
|
54
|
+
return db.prepare('DELETE FROM search_dirty WHERE runtime=? AND id=? AND revision=?').run(runtime, id, revision).changes > 0;
|
|
55
|
+
},
|
|
45
56
|
coverage(runtime) {
|
|
46
57
|
return db.prepare('SELECT started_at AS indexStartedAt, completed_at AS indexCompletedAt, since AS coveredSince, verified_at AS verifiedAt FROM search_coverage WHERE runtime=?').get(runtime)
|
|
47
58
|
?? { indexStartedAt: null, indexCompletedAt: null, coveredSince: null, verifiedAt: null };
|
|
@@ -73,7 +84,7 @@ export function createContentSearchService({ dbPath }) {
|
|
|
73
84
|
prune: db.transaction((runtime, since, ids) => {
|
|
74
85
|
db.prepare('DELETE FROM search_message WHERE runtime=? AND created<?').run(runtime, since);
|
|
75
86
|
db.prepare('UPDATE search_session SET since=MAX(since,?) WHERE runtime=? AND since IS NOT NULL').run(since, runtime);
|
|
76
|
-
for (const row of db.prepare('SELECT id FROM search_session WHERE runtime=?').all(runtime)) {
|
|
87
|
+
if (ids) for (const row of db.prepare('SELECT id FROM search_session WHERE runtime=?').all(runtime)) {
|
|
77
88
|
if (!ids.has(row.id)) removeSession(runtime, row.id);
|
|
78
89
|
}
|
|
79
90
|
}),
|
|
@@ -20,7 +20,7 @@ This module provides OpenCode server integration utilities for the web server ru
|
|
|
20
20
|
connection shortcuts to exclude themselves without changing management lists.
|
|
21
21
|
- `plugins.js`: config entries and plugin-directory files are inventory, not compatibility checks. They do not synthesize `compatibility` or `compatible` fields; Settings uses the OpenCode runtime inventory for actual load status and errors.
|
|
22
22
|
- Reads native V2 `plugins` (strings or `{ package, options }`) with legacy `plugin`/tuple fallback. A native array, including an empty one, wins within each document. Entry mutations write only `plugins`, convert retained legacy tuples, and remove the shadowed legacy key in the touched source file. Options, ordering, unrelated configuration and JSONC comments are preserved through the shared atomic config writer; malformed entries or write failures do not replace the original file. Web, Electron and mobile use this host implementation; VS Code mirrors the same persistence contract.
|
|
23
|
-
- `session-directory-runtime.js`: Host-side physical directory identity for session index/list/detail/live projection. Uses a runtime-scoped, bounded 256-entry cache (60s success / 5s failed resolution), cleared when the upstream URL changes. Local directory lists use
|
|
23
|
+
- `session-directory-runtime.js`: Host-side physical directory identity for session index/list/detail/live projection. Uses a runtime-scoped, bounded 256-entry cache (60s success / 5s failed resolution), cleared when the upstream URL changes. Local directory lists use session pages and physical-directory filtering to include legacy symlink sessions without mixing worktrees; they never request `/location` to discover project identity. Startup backfill reads one global session stream rather than one stream per project. One request reads one page and preserves opaque cursors; consumers must follow continuations even after filtered-empty pages. Non-loopback upstreams keep their own path namespace.
|
|
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.
|
|
@@ -32,8 +32,8 @@ This module provides OpenCode server integration utilities for the web server ru
|
|
|
32
32
|
- `packages/web/server/lib/opencode/v1-migration-gate.js`: pure V1→v2 migration admission gate (`GET /api/experimental/migration/v1` → whether transcript may be fetched).
|
|
33
33
|
- `packages/web/server/lib/opencode/managed-capabilities-runtime.js`: managed-child scheduled-task resources, config injection, rotating bridge identity, and bridge authorization.
|
|
34
34
|
- `packages/web/server/lib/opencode/env-runtime.js`: OpenCode CLI/binary resolution and shell environment runtime.
|
|
35
|
-
- `packages/web/server/lib/opencode/ensure-cli.js`: detect local `opencode` version and install the latest stable official V2 into the Yuri data dir when no usable CLI exists
|
|
36
|
-
- `packages/web/server/lib/opencode/upgrade-screen.js`: startup gate for the running OpenCode below `2.0.20`. Client/schema dependencies
|
|
35
|
+
- `packages/web/server/lib/opencode/ensure-cli.js`: detect local `opencode` version and install the latest stable official V2 into the Yuri data dir when no usable CLI exists. Registry lookup failures remain errors; verified cached installations can be reused offline. Never uses a packaged/bundled binary.
|
|
36
|
+
- `packages/web/server/lib/opencode/upgrade-screen.js`: startup gate for the running OpenCode below `2.0.20`. Client/schema dependencies accept compatible 2.x updates; fresh installations and required upgrades resolve latest stable 2.x at installation time. The compatible execution floor is independently `2.0.20` (credential API). An unreadable running version is unavailable even when the local CLI is compatible. `POST /api/opencode/install-required` upgrades the selected shared global CLI in place; other supported local installations use the owned-cache installer. Global upgrades do not persist a binary override, so subsequent launches still follow shell discovery. Success requires the running service to meet both the floor and selected target. External services are not replaced; compatible newer shared services are not automatically downgraded. Failure restores binary selection and reports `upgraded: false`, without claiming process or package-manager rollback.
|
|
37
37
|
- `packages/web/server/lib/opencode/env-config.js`: OpenCode-related environment variable parsing and validation (host/port/hostname).
|
|
38
38
|
- `packages/web/server/lib/opencode/hmr-state-runtime.js`: HMR-persistent runtime state initialization, auth-state bootstrap, and HMR sync helpers.
|
|
39
39
|
- `packages/web/server/lib/opencode/bootstrap-runtime.js`: base app bootstrap runtime for status/auth/tts/notification/Yuri route wiring.
|
|
@@ -111,8 +111,8 @@ This module provides OpenCode server integration utilities for the web server ru
|
|
|
111
111
|
- `POST /api/opencode/upgrade` (ticket 12): upgrades the remote latest or explicitly targeted version. Shared services using a global CLI invoke that selected installation's `upgrade <version>` and verify its disk version; owned-cache installations download into `~/.config/yuri/opencode-cli/<version>/`. Shared services restart through the selected CLI entry path and adopt its registration again. Success requires fresh CLI/service version probes and runtime contract verification. Global upgrades never switch to an owned cache on failure. Arbitrary external servers, private processes using global CLI, and private bundled binaries return HTTP 409. Concurrent upgrades are single-flight (`operation` state). Active sessions do not block an explicitly requested upgrade or require additional confirmation. Failure restores binary selection and reports the failed phase; it cannot undo package-manager changes and does not claim process restoration.
|
|
112
112
|
- `GET /api/opencode/upgrade-status`: returns `currentVersion`/`serveVersion`/`cliVersion`, `targetVersion`/`latestVersion` (official npm `@opencode/cli` latest stable 2.x release), `supplySource`, `ownership`, `canManage`, `management`, `guidance`, `contract`, and `operation`. Official shared services report `ownership: 'shared-service'`, `processOwnership: 'shared'`, and `canManage: true`. `available` is true only when `canManage` and target > current; unmanaged global/external runtimes report `available: null` plus manual guidance. `update-discovery.js` shares one in-flight registry request per host, caches successful checks for five minutes and failed checks for thirty seconds, with a five-second request deadline. Failed registry checks return HTTP 500 with `available: null`, never a false up-to-date result. An upgrade without an explicit target resolves this same remote release. Shared Web/Electron/hosted-mobile/Capacitor clients check after startup, every five minutes while visible, on focus/reconnect, and on runtime changes; query results and dismissed notifications are scoped to the host. Successful upgrade already includes process restart and live version verification, so no second reload is needed.
|
|
113
113
|
- `GET /api/opencode/compatibility`: startup upgrade-screen status. `compatible` requires the running OpenCode 2.x at `2.0.20` or newer; older/invalid versions are `incompatible`; unreadable running versions are `unavailable`. External serves are not replaced.
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
- `POST /api/opencode/install-required`: resolves the latest stable 2.x release (never below the `2.0.20` floor), upgrades the selected shared global CLI or owned cache, and restarts through the existing lifecycle. Discovery failure does not install a historical fallback. `upgraded: true` requires live version verification. Concurrent installs are single-flight; failures remain errors. Compatibility status reports the minimum before installation resolves its actual target.
|
|
115
|
+
- `GET /api/opencode/contract`: runtime contract admission for the **running serve**. Reachability, auth, execution, migration, and CLI↔serve mismatch are separate. The `2.0.20` floor is independent of installation targets; compatible newer 2.x services remain admitted. The legacy `pinnedVersion` response field is null.
|
|
116
116
|
- `GET /api/opencode/health`: probes managed OpenCode `GET /api/info` (Basic auth, 4s timeout). `healthy` is reachability/version shape via `evaluateOpenCodeHealthBody` (admits official 2.x `ServerInfo` and classic `{ healthy: true, version }`; rejects 1.x / missing / `healthy: false`). Response also includes `executionAllowed`, `protocolCompatible`, and `contract` so clients do not treat health success as full execution semantics. Upstream non-OK responses pass through status with `{ healthy: false, error, contract }`; transport failures return HTTP 503.
|
|
117
117
|
- `GET /api/opencode/version`: serve + CLI versions, mismatch flag, and contract snapshot
|
|
118
118
|
- `POST /api/opencode/directory`
|
|
@@ -145,12 +145,12 @@ This module provides OpenCode server integration utilities for the web server ru
|
|
|
145
145
|
- Native `session.execution.started/succeeded/failed/interrupted` and `session.retry.scheduled` feed the same status/activity/attention transitions. Shutdown interruption retains busy ownership; other terminal events settle idle. `extractSessionStatusUpdate` is shared by Host forwarding, index ingestion and Goal timer handling so retry metadata and shutdown semantics stay aligned.
|
|
146
146
|
|
|
147
147
|
## Public exports (opencode2-pin.js)
|
|
148
|
-
- `
|
|
148
|
+
- `MINIMUM_OPENCODE2_VERSION`: compatibility floor, not an installation pin.
|
|
149
149
|
- `OPENCODE2_NPM_PACKAGE`: `@opencode/cli` (global install that ships the official `opencode` v2 binary; not 1.x `opencode-ai`).
|
|
150
150
|
- `parseOpenCode2VersionOutput(stdout)` / `compareOpenCode2Versions(left, right)` / `isOpenCode2VersionAtLeast(version, minimum)`: CLI `--version` parse and pin comparison.
|
|
151
151
|
- `openCode2BinaryName(platform)` / `npmPackageForOpenCode2(platform, arch)`: staged binary name `opencode` (`opencode.exe` on Windows) and official platform package `@opencode/cli-<os>-<arch>[-baseline]`.
|
|
152
152
|
- `isOpenCode1xVersion(value)` / `isAcceptableOpenCode2HealthVersion(value)` / `evaluateOpenCodeHealthBody(body)`: health admission accepts only 2.x. 1.x, `0.x` pre-2 binaries, and missing/unknown versions are rejected even when `healthy: true`.
|
|
153
|
-
- `resolveOpenCode2UpgradeTarget(target)` / `rejectOpenCode1xUpgradeTarget(target)`:
|
|
153
|
+
- `resolveOpenCode2UpgradeTarget(target)` / `rejectOpenCode1xUpgradeTarget(target)`: require a resolved upgrade target and refuse 1.x; no historical default.
|
|
154
154
|
|
|
155
155
|
## Public exports (runtime-contract.js)
|
|
156
156
|
- Pure admission matrix. `RUNTIME_CONTRACT_MIN_VERIFIED` (`2.0.20`) is the documented 2.x floor, shared with the startup gate through `MINIMUM_OPENCODE2_VERSION`; the VS Code sidecar mirrors this floor. Capabilities include `core.protocol`, `session.prompt`, `session.queuedInput`, `session.background`, `session.generationFallback`, `migration.v1Read`.
|
|
@@ -167,8 +167,8 @@ This module provides OpenCode server integration utilities for the web server ru
|
|
|
167
167
|
- `buildUpgradeStatusSnapshot` / `evaluateOwnedUpgradeResult` / `createUpgradeOperationState` / `resolveOwnedCacheBinaryPath`.
|
|
168
168
|
|
|
169
169
|
## Public exports (ensure-cli.js)
|
|
170
|
-
- `ensurePinnedOpenCode2Cli({ discoveredPath, pin, autoInstall, install, readVersion })`: reuse any discovered acceptable 2.x CLI (official name `opencode`), then the newest verified owned cache. Only a fresh installation queries the stable 2.x release via `update-discovery.js`;
|
|
171
|
-
- `installPinnedOpenCode2Cli(options)`: download `@opencode/cli-<os>-<arch
|
|
170
|
+
- `ensurePinnedOpenCode2Cli({ discoveredPath, pin, autoInstall, install, readVersion })`: reuse any discovered acceptable 2.x CLI (official name `opencode`), then the newest verified owned cache. Only a fresh installation queries the stable 2.x release via `update-discovery.js`; the optional explicit `pin` remains an override, not a product default. Registry errors propagate without a historical fallback. Downloads stay under `~/.config/yuri/opencode-cli/<version>/opencode`. `YURI_OPENCODE2_AUTO_INSTALL=0` disables download (`OPENCODE_CLI_MISSING`).
|
|
171
|
+
- `installPinnedOpenCode2Cli(options)`: resolve latest stable 2.x unless a concrete version was supplied, download its `@opencode/cli-<os>-<arch>` package, extract, copy as `opencode`, chmod, verify `--version` against the resolved version.
|
|
172
172
|
- `installedOpenCode2BinaryPath(version)` / `installedOpenCode2BinaryCandidates(options)` / `readOpenCode2BinaryVersion(path)` / `isOpenCode2AutoInstallEnabled()`. Cache candidates are stable 2.x directories ordered by numeric version, so an offline restart discovers a newer installation rather than reverting to the packaged pin.
|
|
173
173
|
- `terminal-path.js` exposes owned-cache CLIs to new terminals on installation/reuse. It writes an idempotent source line to zsh `.zprofile`/`.zshrc` (including `ZDOTDIR`), bash `.bashrc` and the active login profile, POSIX `.profile`, or fish `config.fish`. The sourced file in the Yuri data directory selects the verified executable directory. Windows updates only user PATH, retaining unrelated entries, broadcasts the environment change, and records `opencode-path.windows` in the data directory. Subsequent owned-cache upgrades refresh an existing terminal integration after binary verification. Existing global installations do not trigger shell edits. PATH-setup failure warns and keeps the working Yuri runtime; a later startup retries. Existing terminal processes need a new shell, and shell-file changes already completed before a failure are retained.
|
|
174
174
|
- `upgradeSelectedOpenCodeCli({ binaryPath, version, launchSpec, env })`: runs the selected CLI's official `upgrade <version>` without a shell, with a five-minute deadline and bounded captured output. Returns the original CLI entry path, preserving Homebrew symlinks. Windows launch specs unwrap native/runtime shims; unresolved batch wrappers require terminal upgrade instead of spawning console grandchildren. Child output is not returned or logged. Package-manager failures never fall back to another installation; callers verify the original entry's version before restarting. Package-manager file changes cannot be rolled back by restoring Yuri's binary selection.
|