@kabmo-labs/kabmo 0.3.0 → 0.3.1
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.
|
@@ -4996,7 +4996,7 @@ out vec4 outColor;
|
|
|
4996
4996
|
void main() {
|
|
4997
4997
|
outColor = v_color;
|
|
4998
4998
|
}`,E2=8,w9e,BFr,QQt=class{constructor(){this.attributes=new Float32Array(BFr),this.count=0}},S2=0,een=0,ten=0,nen=0,ren=0,aen=0,ien=0,zFr,jFr,UFr,G0,D9e=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new _o,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new _o,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,n){if(this.getZoomLevel(n)===t)return;let r=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(r,t),this._onDidChangeZoomLevel.fire(r)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),t)}setFullscreen(t,n){if(this.isFullscreen(n)===t)return;let r=this.getWindowId(n);this.mapWindowIdToFullScreen.set(r,t),this._onDidChangeFullscreen.fire(r)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}},$en,Bml,zml,rL,jml,C9e,WFr,GFr,Uml,qml,zae=!1,eL="en",$9e=!1,O9e=!1,jae=!1,VFr=!1,Oen=!1,Fen=!1,ZFr=!1,KFr=!1,YFr=!1,XFr=!1,Pae,Uae,oen,JFr,T2,R2,tf,Ben,QFr,S9e=0,T9e,eBr,Wml,dy,I4,tBr,nBr,rBr,aBr,Gml,Hml,Vml,Zml,M4,Kml,U9e=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},E9e,sen,len,Yml,iBr,zen,oBr,sBr=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?zen:(this._emitter||(this._emitter=new _o),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Xml,lBr,A9e,cBr,cen,bBr=class e{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(t){let n=t.length;if(n===0)return;let r=this._buff,a=this._buffLen,i=this._leftoverHighSurrogate,o,s;for(i!==0?(o=i,s=-1,i=0):(o=t.charCodeAt(0),s=0);;){let l=o;if(uBr(o))if(s+1<n){let u=t.charCodeAt(s+1);uen(u)?(s++,l=dBr(o,u)):l=65533}else{i=o;break}else uen(o)&&(l=65533);if(a=this._push(r,a,l),s++,s<n)o=t.charCodeAt(s);else break}this._buffLen=a,this._leftoverHighSurrogate=i}_push(t,n,r){return r<128?t[n++]=r:r<2048?(t[n++]=192|(r&1984)>>>6,t[n++]=128|(r&63)>>>0):r<65536?(t[n++]=224|(r&61440)>>>12,t[n++]=128|(r&4032)>>>6,t[n++]=128|(r&63)>>>0):(t[n++]=240|(r&1835008)>>>18,t[n++]=128|(r&258048)>>>12,t[n++]=128|(r&4032)>>>6,t[n++]=128|(r&63)>>>0),n>=64&&(this._step(),n-=64,this._totalLen+=64,t[0]=t[64],t[1]=t[65],t[2]=t[66]),n}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),wz(this._h0)+wz(this._h1)+wz(this._h2)+wz(this._h3)+wz(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,den(this._buff,this._buffLen),this._buffLen>56&&(this._step(),den(this._buff));let t=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(t/4294967296),!1),this._buffDV.setUint32(60,t%4294967296,!1),this._step()}_step(){let t=e._bigBlock32,n=this._buffDV;for(let p=0;p<64;p+=4)t.setUint32(p,n.getUint32(p,!1),!1);for(let p=64;p<320;p+=4)t.setUint32(p,L9e(t.getUint32(p-12,!1)^t.getUint32(p-32,!1)^t.getUint32(p-56,!1)^t.getUint32(p-64,!1),1),!1);let r=this._h0,a=this._h1,i=this._h2,o=this._h3,s=this._h4,l,u,d;for(let p=0;p<80;p++)p<20?(l=a&i|~a&o,u=1518500249):p<40?(l=a^i^o,u=1859775393):p<60?(l=a&i|a&o|i&o,u=2400959708):(l=a^i^o,u=3395469782),d=L9e(r,5)+l+s+u+t.getUint32(p*4,!1)&4294967295,s=o,o=i,i=L9e(a,30),a=r,r=d;this._h0=this._h0+r&4294967295,this._h1=this._h1+a&4294967295,this._h2=this._h2+i&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+s&4294967295}},Jml,yBr,Qml,ehl,thl,pen,nhl,rhl,ahl,ihl,ohl,vBr=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}},xBr,men,R9e=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Dae(e)}}static sort(e,t){return t.priority-e.priority}},hen=class e{constructor(t,n){this.width=t,this.height=n}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(t){return typeof t=="object"&&typeof t.height=="number"&&typeof t.width=="number"}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(t,n){return t===n?!0:!t||!n?!1:t.width===n.width&&t.height===n.height}},shl,kBr,_Br,CBr,SBr,gen="di$target",ben="di$dependencies",N9e,lhl,chl,uhl,dhl,phl,mhl,EBr,hhl,fhl,ghl,ABr,LBr="xterm.js: ",yen,qen,NBr;var Wen=O(()=>{xOr=Object.defineProperty,kOr=Object.getOwnPropertyDescriptor,SOr=new COr;EOr=class extends Error{constructor(){super(I9e),this.name=this.message}},$Qt=class e extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}};LOr.assertInvariants=!1;((e)=>{function t(i){return i<0}e.isLessThan=t;function n(i){return i<=0}e.isLessThanOrEqual=n;function r(i){return i>0}e.isGreaterThan=r;function a(i){return i===0}e.isNeitherLessOrGreaterThan=a,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(ven||={});OQt.empty=new OQt((e)=>{});Pml=class{constructor(e,t){this.toKey=t,this._map=new Map,this[FQt]="SetWithKey";for(let n of e)this.add(n)}get size(){return this._map.size}add(e){let t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach((n)=>e.call(t,n,n,this))}[(BQt=Symbol.iterator,FQt=Symbol.toStringTag,BQt)](){return this.values()}};((e)=>{function t(C){return C&&typeof C=="object"&&typeof C[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*a(C){yield C}e.single=a;function i(C){return t(C)?C:a(C)}e.wrap=i;function o(C){return C||n}e.from=o;function*s(C){for(let _=C.length-1;_>=0;_--)yield C[_]}e.reverse=s;function l(C){return!C||C[Symbol.iterator]().next().done===!0}e.isEmpty=l;function u(C){return C[Symbol.iterator]().next().value}e.first=u;function d(C,_){let w=0;for(let T of C)if(_(T,w++))return!0;return!1}e.some=d;function p(C,_){for(let w of C)if(_(w))return w}e.find=p;function*h(C,_){for(let w of C)_(w)&&(yield w)}e.filter=h;function*f(C,_){let w=0;for(let T of C)yield _(T,w++)}e.map=f;function*g(C,_){let w=0;for(let T of C)yield*_(T,w++)}e.flatMap=g;function*b(...C){for(let _ of C)yield*_}e.concat=b;function y(C,_,w){let T=w;for(let E of C)T=_(T,E);return T}e.reduce=y;function*v(C,_,w=C.length){for(_<0&&(_+=C.length),w<0?w+=C.length:w>C.length&&(w=C.length);_<w;_++)yield C[_]}e.slice=v;function x(C,_=Number.POSITIVE_INFINITY){let w=[];if(_===0)return[w,C];let T=C[Symbol.iterator]();for(let E=0;E<_;E++){let L=T.next();if(L.done)return[w,e.empty()];w.push(L.value)}return[w,{[Symbol.iterator](){return T}}]}e.consume=x;async function k(C){let _=[];for await(let w of C)_.push(w);return Promise.resolve(_)}e.asyncToArray=k})(xen||={});$Or.idx=0;if(DOr){let e="__is_disposable_tracked__";OOr(new class{trackDisposable(t){let n=Error("Potentially leaked disposable").stack;setTimeout(()=>{t[e]||console.log(n)},3000)}setParent(t,n){if(t&&t!==nf.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==nf.None)try{t[e]=!0}catch{}}markAsSingleton(t){}})}wen.DISABLE_DISPOSED_WARNING=!1;tL=wen;nf.None=Object.freeze({dispose(){}});B9e=typeof process<"u"&&"title"in process,Ez=B9e?"node":navigator.userAgent,z9e=B9e?"node":navigator.platform,BOr=Ez.includes("Firefox"),zOr=Ez.includes("Edge"),Cen=/^((?!chrome|android).)*safari/i.test(Ez);Dml=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(z9e),$ml=["Windows","Win16","Win32","WinCE"].includes(z9e),Oml=z9e.indexOf("Linux")>=0,Fml=/\bCrOS\b/.test(Ez),dg={css:"#00000000",rgba:0};((e)=>{function t(a,i,o,s){return s!==void 0?`#${vT(a)}${vT(i)}${vT(o)}${vT(s)}`:`#${vT(a)}${vT(i)}${vT(o)}`}e.toCss=t;function n(a,i,o,s=255){return(a<<24|i<<16|o<<8|s)>>>0}e.toRgba=n;function r(a,i,o,s){return{css:e.toCss(a,i,o,s),rgba:e.toRgba(a,i,o,s)}}e.toColor=r})(Qp||={});((e)=>{function t(l,u){if(ll=(u.rgba&255)/255,ll===1)return{css:u.css,rgba:u.rgba};let d=u.rgba>>24&255,p=u.rgba>>16&255,h=u.rgba>>8&255,f=l.rgba>>24&255,g=l.rgba>>16&255,b=l.rgba>>8&255;Eu=f+Math.round((d-f)*ll),Au=g+Math.round((p-g)*ll),Lu=b+Math.round((h-b)*ll);let y=Qp.toCss(Eu,Au,Lu),v=Qp.toRgba(Eu,Au,Lu);return{css:y,rgba:v}}e.blend=t;function n(l){return(l.rgba&255)===255}e.isOpaque=n;function r(l,u,d){let p=xT.ensureContrastRatio(l.rgba,u.rgba,d);if(p)return Qp.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=r;function a(l){let u=(l.rgba|255)>>>0;return[Eu,Au,Lu]=xT.toChannels(u),{css:Qp.toCss(Eu,Au,Lu),rgba:u}}e.opaque=a;function i(l,u){return ll=Math.round(u*255),[Eu,Au,Lu]=xT.toChannels(l.rgba),{css:Qp.toCss(Eu,Au,Lu,ll),rgba:Qp.toRgba(Eu,Au,Lu,ll)}}e.opacity=i;function o(l,u){return ll=l.rgba&255,i(l,ll*u/255)}e.multiplyOpacity=o;function s(l){return[l.rgba>>24&255,l.rgba>>16&255,l.rgba>>8&255]}e.toColorRGB=s})(Cz||={});((e)=>{let t,n;try{let a=document.createElement("canvas");a.width=1,a.height=1;let i=a.getContext("2d",{willReadFrequently:!0});i&&(t=i,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function r(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return Eu=parseInt(a.slice(1,2).repeat(2),16),Au=parseInt(a.slice(2,3).repeat(2),16),Lu=parseInt(a.slice(3,4).repeat(2),16),Qp.toColor(Eu,Au,Lu);case 5:return Eu=parseInt(a.slice(1,2).repeat(2),16),Au=parseInt(a.slice(2,3).repeat(2),16),Lu=parseInt(a.slice(3,4).repeat(2),16),ll=parseInt(a.slice(4,5).repeat(2),16),Qp.toColor(Eu,Au,Lu,ll);case 7:return{css:a,rgba:(parseInt(a.slice(1),16)<<8|255)>>>0};case 9:return{css:a,rgba:parseInt(a.slice(1),16)>>>0}}let i=a.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(i)return Eu=parseInt(i[1]),Au=parseInt(i[2]),Lu=parseInt(i[3]),ll=Math.round((i[5]===void 0?1:parseFloat(i[5]))*255),Qp.toColor(Eu,Au,Lu,ll);if(!t||!n)throw Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=a,typeof t.fillStyle!="string")throw Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Eu,Au,Lu,ll]=t.getImageData(0,0,1,1).data,ll!==255)throw Error("css.toColor: Unsupported css format");return{rgba:Qp.toRgba(Eu,Au,Lu,ll),css:a}}e.toColor=r})(qOr||={});((e)=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,a,i){let o=r/255,s=a/255,l=i/255,u=o<=0.03928?o/12.92:Math.pow((o+0.055)/1.055,2.4),d=s<=0.03928?s/12.92:Math.pow((s+0.055)/1.055,2.4),p=l<=0.03928?l/12.92:Math.pow((l+0.055)/1.055,2.4);return u*0.2126+d*0.7152+p*0.0722}e.relativeLuminance2=n})(Jp||={});((e)=>{function t(o,s){if(ll=(s&255)/255,ll===1)return s;let l=s>>24&255,u=s>>16&255,d=s>>8&255,p=o>>24&255,h=o>>16&255,f=o>>8&255;return Eu=p+Math.round((l-p)*ll),Au=h+Math.round((u-h)*ll),Lu=f+Math.round((d-f)*ll),Qp.toRgba(Eu,Au,Lu)}e.blend=t;function n(o,s,l){let u=Jp.relativeLuminance(o>>8),d=Jp.relativeLuminance(s>>8);if(w2(u,d)<l){if(d<u){let f=r(o,s,l),g=w2(u,Jp.relativeLuminance(f>>8));if(g<l){let b=a(o,s,l),y=w2(u,Jp.relativeLuminance(b>>8));return g>y?f:b}return f}let p=a(o,s,l),h=w2(u,Jp.relativeLuminance(p>>8));if(h<l){let f=r(o,s,l),g=w2(u,Jp.relativeLuminance(f>>8));return h>g?p:f}return p}}e.ensureContrastRatio=n;function r(o,s,l){let u=o>>24&255,d=o>>16&255,p=o>>8&255,h=s>>24&255,f=s>>16&255,g=s>>8&255,b=w2(Jp.relativeLuminance2(h,f,g),Jp.relativeLuminance2(u,d,p));for(;b<l&&(h>0||f>0||g>0);)h-=Math.max(0,Math.ceil(h*0.1)),f-=Math.max(0,Math.ceil(f*0.1)),g-=Math.max(0,Math.ceil(g*0.1)),b=w2(Jp.relativeLuminance2(h,f,g),Jp.relativeLuminance2(u,d,p));return(h<<24|f<<16|g<<8|255)>>>0}e.reduceLuminance=r;function a(o,s,l){let u=o>>24&255,d=o>>16&255,p=o>>8&255,h=s>>24&255,f=s>>16&255,g=s>>8&255,b=w2(Jp.relativeLuminance2(h,f,g),Jp.relativeLuminance2(u,d,p));for(;b<l&&(h<255||f<255||g<255);)h=Math.min(255,h+Math.ceil((255-h)*0.1)),f=Math.min(255,f+Math.ceil((255-f)*0.1)),g=Math.min(255,g+Math.ceil((255-g)*0.1)),b=w2(Jp.relativeLuminance2(h,f,g),Jp.relativeLuminance2(u,d,p));return(h<<24|f<<16|g<<8|255)>>>0}e.increaseLuminance=a;function i(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}e.toChannels=i})(xT||={});Ten=BOr||zOr?"bottom":"ideographic",QOr={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\uD83E\uDF70":[{x:1,y:0,w:1,h:8}],"\uD83E\uDF71":[{x:2,y:0,w:1,h:8}],"\uD83E\uDF72":[{x:3,y:0,w:1,h:8}],"\uD83E\uDF73":[{x:4,y:0,w:1,h:8}],"\uD83E\uDF74":[{x:5,y:0,w:1,h:8}],"\uD83E\uDF75":[{x:6,y:0,w:1,h:8}],"\uD83E\uDF76":[{x:0,y:1,w:8,h:1}],"\uD83E\uDF77":[{x:0,y:2,w:8,h:1}],"\uD83E\uDF78":[{x:0,y:3,w:8,h:1}],"\uD83E\uDF79":[{x:0,y:4,w:8,h:1}],"\uD83E\uDF7A":[{x:0,y:5,w:8,h:1}],"\uD83E\uDF7B":[{x:0,y:6,w:8,h:1}],"\uD83E\uDF7C":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\uD83E\uDF7D":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\uD83E\uDF7E":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\uD83E\uDF7F":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\uD83E\uDF80":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"\uD83E\uDF81":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"\uD83E\uDF82":[{x:0,y:0,w:8,h:2}],"\uD83E\uDF83":[{x:0,y:0,w:8,h:3}],"\uD83E\uDF84":[{x:0,y:0,w:8,h:5}],"\uD83E\uDF85":[{x:0,y:0,w:8,h:6}],"\uD83E\uDF86":[{x:0,y:0,w:8,h:7}],"\uD83E\uDF87":[{x:6,y:0,w:2,h:8}],"\uD83E\uDF88":[{x:5,y:0,w:3,h:8}],"\uD83E\uDF89":[{x:3,y:0,w:5,h:8}],"\uD83E\uDF8A":[{x:2,y:0,w:6,h:8}],"\uD83E\uDF8B":[{x:1,y:0,w:7,h:8}],"\uD83E\uDF95":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"\uD83E\uDF96":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"\uD83E\uDF97":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},eFr={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},tFr={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(e,t)=>`M0,${0.5-t} L1,${0.5-t} M0,${0.5+t} L1,${0.5+t}`},"║":{1:(e,t)=>`M${0.5-e},0 L${0.5-e},1 M${0.5+e},0 L${0.5+e},1`},"╒":{1:(e,t)=>`M.5,1 L.5,${0.5-t} L1,${0.5-t} M.5,${0.5+t} L1,${0.5+t}`},"╓":{1:(e,t)=>`M${0.5-e},1 L${0.5-e},.5 L1,.5 M${0.5+e},.5 L${0.5+e},1`},"╔":{1:(e,t)=>`M1,${0.5-t} L${0.5-e},${0.5-t} L${0.5-e},1 M1,${0.5+t} L${0.5+e},${0.5+t} L${0.5+e},1`},"╕":{1:(e,t)=>`M0,${0.5-t} L.5,${0.5-t} L.5,1 M0,${0.5+t} L.5,${0.5+t}`},"╖":{1:(e,t)=>`M${0.5+e},1 L${0.5+e},.5 L0,.5 M${0.5-e},.5 L${0.5-e},1`},"╗":{1:(e,t)=>`M0,${0.5+t} L${0.5-e},${0.5+t} L${0.5-e},1 M0,${0.5-t} L${0.5+e},${0.5-t} L${0.5+e},1`},"╘":{1:(e,t)=>`M.5,0 L.5,${0.5+t} L1,${0.5+t} M.5,${0.5-t} L1,${0.5-t}`},"╙":{1:(e,t)=>`M1,.5 L${0.5-e},.5 L${0.5-e},0 M${0.5+e},.5 L${0.5+e},0`},"╚":{1:(e,t)=>`M1,${0.5-t} L${0.5+e},${0.5-t} L${0.5+e},0 M1,${0.5+t} L${0.5-e},${0.5+t} L${0.5-e},0`},"╛":{1:(e,t)=>`M0,${0.5+t} L.5,${0.5+t} L.5,0 M0,${0.5-t} L.5,${0.5-t}`},"╜":{1:(e,t)=>`M0,.5 L${0.5+e},.5 L${0.5+e},0 M${0.5-e},.5 L${0.5-e},0`},"╝":{1:(e,t)=>`M0,${0.5-t} L${0.5-e},${0.5-t} L${0.5-e},0 M0,${0.5+t} L${0.5+e},${0.5+t} L${0.5+e},0`},"╞":{1:(e,t)=>`M.5,0 L.5,1 M.5,${0.5-t} L1,${0.5-t} M.5,${0.5+t} L1,${0.5+t}`},"╟":{1:(e,t)=>`M${0.5-e},0 L${0.5-e},1 M${0.5+e},0 L${0.5+e},1 M${0.5+e},.5 L1,.5`},"╠":{1:(e,t)=>`M${0.5-e},0 L${0.5-e},1 M1,${0.5+t} L${0.5+e},${0.5+t} L${0.5+e},1 M1,${0.5-t} L${0.5+e},${0.5-t} L${0.5+e},0`},"╡":{1:(e,t)=>`M.5,0 L.5,1 M0,${0.5-t} L.5,${0.5-t} M0,${0.5+t} L.5,${0.5+t}`},"╢":{1:(e,t)=>`M0,.5 L${0.5-e},.5 M${0.5-e},0 L${0.5-e},1 M${0.5+e},0 L${0.5+e},1`},"╣":{1:(e,t)=>`M${0.5+e},0 L${0.5+e},1 M0,${0.5+t} L${0.5-e},${0.5+t} L${0.5-e},1 M0,${0.5-t} L${0.5-e},${0.5-t} L${0.5-e},0`},"╤":{1:(e,t)=>`M0,${0.5-t} L1,${0.5-t} M0,${0.5+t} L1,${0.5+t} M.5,${0.5+t} L.5,1`},"╥":{1:(e,t)=>`M0,.5 L1,.5 M${0.5-e},.5 L${0.5-e},1 M${0.5+e},.5 L${0.5+e},1`},"╦":{1:(e,t)=>`M0,${0.5-t} L1,${0.5-t} M0,${0.5+t} L${0.5-e},${0.5+t} L${0.5-e},1 M1,${0.5+t} L${0.5+e},${0.5+t} L${0.5+e},1`},"╧":{1:(e,t)=>`M.5,0 L.5,${0.5-t} M0,${0.5-t} L1,${0.5-t} M0,${0.5+t} L1,${0.5+t}`},"╨":{1:(e,t)=>`M0,.5 L1,.5 M${0.5-e},.5 L${0.5-e},0 M${0.5+e},.5 L${0.5+e},0`},"╩":{1:(e,t)=>`M0,${0.5+t} L1,${0.5+t} M0,${0.5-t} L${0.5-e},${0.5-t} L${0.5-e},0 M1,${0.5-t} L${0.5+e},${0.5-t} L${0.5+e},0`},"╪":{1:(e,t)=>`M.5,0 L.5,1 M0,${0.5-t} L1,${0.5-t} M0,${0.5+t} L1,${0.5+t}`},"╫":{1:(e,t)=>`M0,.5 L1,.5 M${0.5-e},0 L${0.5-e},1 M${0.5+e},0 L${0.5+e},1`},"╬":{1:(e,t)=>`M0,${0.5+t} L${0.5-e},${0.5+t} L${0.5-e},1 M1,${0.5+t} L${0.5+e},${0.5+t} L${0.5+e},1 M0,${0.5-t} L${0.5-e},${0.5-t} L${0.5-e},0 M1,${0.5-t} L${0.5+e},${0.5-t} L${0.5+e},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(e,t)=>`M.5,1 L.5,${0.5+t/0.15*0.5} C.5,${0.5+t/0.15*0.5},.5,.5,1,.5`},"╮":{1:(e,t)=>`M.5,1 L.5,${0.5+t/0.15*0.5} C.5,${0.5+t/0.15*0.5},.5,.5,0,.5`},"╯":{1:(e,t)=>`M.5,0 L.5,${0.5-t/0.15*0.5} C.5,${0.5-t/0.15*0.5},.5,.5,0,.5`},"╰":{1:(e,t)=>`M.5,0 L.5,${0.5-t/0.15*0.5} C.5,${0.5-t/0.15*0.5},.5,.5,1,.5`}},Tz={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}};Tz[""]=Tz[""];Tz[""]=Tz[""];zQt=new Map;Een={C:(e,t)=>e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]),L:(e,t)=>e.lineTo(t[0],t[1]),M:(e,t)=>e.moveTo(t[0],t[1])};sFr=class extends Len{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},lFr=class extends Len{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},cFr=!B9e&&"requestIdleCallback"in window?lFr:sFr;WQt.Undefined=new WQt(void 0);uFr=globalThis.performance&&typeof globalThis.performance.now=="function";((e)=>{e.None=()=>nf.None;function t(A){if(mFr){let{onDidAddListener:N}=A,I=P9e.create(),D=0;A.onDidAddListener=()=>{++D===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),I.print()),N?.()}}}function n(A,N){return h(A,()=>{},0,void 0,!0,void 0,N)}e.defer=n;function r(A){return(N,I=null,D)=>{let B=!1,F;return F=A((j)=>{if(!B)return F?F.dispose():B=!0,N.call(I,j)},null,D),B&&F.dispose(),F}}e.once=r;function a(A,N,I){return d((D,B=null,F)=>A((j)=>D.call(B,N(j)),null,F),I)}e.map=a;function i(A,N,I){return d((D,B=null,F)=>A((j)=>{N(j),D.call(B,j)},null,F),I)}e.forEach=i;function o(A,N,I){return d((D,B=null,F)=>A((j)=>N(j)&&D.call(B,j),null,F),I)}e.filter=o;function s(A){return A}e.signal=s;function l(...A){return(N,I=null,D)=>{let B=_en(...A.map((F)=>F((j)=>N.call(I,j))));return p(B,D)}}e.any=l;function u(A,N,I,D){let B=I;return a(A,(F)=>(B=N(B,F),B),D)}e.reduce=u;function d(A,N){let I,D={onWillAddFirstListener(){I=A(B.fire,B)},onDidRemoveLastListener(){I?.dispose()}};N||t(D);let B=new _o(D);return N?.add(B),B.event}function p(A,N){return N instanceof Array?N.push(A):N&&N.add(A),A}function h(A,N,I=100,D=!1,B=!1,F,j){let z,q,W,H=0,Y,X={leakWarningThreshold:F,onWillAddFirstListener(){z=A((Z)=>{H++,q=N(q,Z),D&&!W&&(Q.fire(q),q=void 0),Y=()=>{let le=q;q=void 0,W=void 0,(!D||H>1)&&Q.fire(le),H=0},typeof I=="number"?(clearTimeout(W),W=setTimeout(Y,I)):W===void 0&&(W=0,queueMicrotask(Y))})},onWillRemoveListener(){B&&H>0&&Y?.()},onDidRemoveLastListener(){Y=void 0,z.dispose()}};j||t(X);let Q=new _o(X);return j?.add(Q),Q.event}e.debounce=h;function f(A,N=0,I){return e.debounce(A,(D,B)=>D?(D.push(B),D):[B],N,void 0,!0,void 0,I)}e.accumulate=f;function g(A,N=(D,B)=>D===B,I){let D=!0,B;return o(A,(F)=>{let j=D||!N(F,B);return D=!1,B=F,j},I)}e.latch=g;function b(A,N,I){return[e.filter(A,N,I),e.filter(A,(D)=>!N(D),I)]}e.split=b;function y(A,N=!1,I=[],D){let B=I.slice(),F=A((q)=>{B?B.push(q):z.fire(q)});D&&D.add(F);let j=()=>{B?.forEach((q)=>z.fire(q)),B=null},z=new _o({onWillAddFirstListener(){F||(F=A((q)=>z.fire(q)),D&&D.add(F))},onDidAddFirstListener(){B&&(N?setTimeout(j):j())},onDidRemoveLastListener(){F&&F.dispose(),F=null}});return D&&D.add(z),z.event}e.buffer=y;function v(A,N){return(I,D,B)=>{let F=N(new k);return A(function(j){let z=F.evaluate(j);z!==x&&I.call(D,z)},void 0,B)}}e.chain=v;let x=Symbol("HaltChainable");class k{constructor(){this.steps=[]}map(A){return this.steps.push(A),this}forEach(A){return this.steps.push((N)=>(A(N),N)),this}filter(A){return this.steps.push((N)=>A(N)?N:x),this}reduce(A,N){let I=N;return this.steps.push((D)=>(I=A(I,D),I)),this}latch(A=(N,I)=>N===I){let N=!0,I;return this.steps.push((D)=>{let B=N||!A(D,I);return N=!1,I=D,B?D:x}),this}evaluate(A){for(let N of this.steps)if(A=N(A),A===x)break;return A}}function C(A,N,I=(D)=>D){let D=(...z)=>j.fire(I(...z)),B=()=>A.on(N,D),F=()=>A.removeListener(N,D),j=new _o({onWillAddFirstListener:B,onDidRemoveLastListener:F});return j.event}e.fromNodeEventEmitter=C;function _(A,N,I=(D)=>D){let D=(...z)=>j.fire(I(...z)),B=()=>A.addEventListener(N,D),F=()=>A.removeEventListener(N,D),j=new _o({onWillAddFirstListener:B,onDidRemoveLastListener:F});return j.event}e.fromDOMEventEmitter=_;function w(A){return new Promise((N)=>r(A)(N))}e.toPromise=w;function T(A){let N=new _o;return A.then((I)=>{N.fire(I)},()=>{N.fire(void 0)}).finally(()=>{N.dispose()}),N.event}e.fromPromise=T;function E(A,N){return A((I)=>N.fire(I))}e.forward=E;function L(A,N,I){return N(I),A((D)=>N(D))}e.runAndSubscribe=L;class P{constructor(A,N){this._observable=A,this._counter=0,this._hasChanged=!1;let I={onWillAddFirstListener:()=>{A.addObserver(this)},onDidRemoveLastListener:()=>{A.removeObserver(this)}};N||t(I),this.emitter=new _o(I),N&&N.add(this.emitter)}beginUpdate(A){this._counter++}handlePossibleChange(A){}handleChange(A,N){this._hasChanged=!0}endUpdate(A){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function R(A,N){return new P(A,N).emitter.event}e.fromObservable=R;function M(A){return(N,I,D)=>{let B=0,F=!1,j={beginUpdate(){B++},endUpdate(){B--,B===0&&(A.reportChanges(),F&&(F=!1,N.call(I)))},handlePossibleChange(){},handleChange(){F=!0}};A.addObserver(j),A.reportChanges();let z={dispose(){A.removeObserver(j)}};return D instanceof tL?D.add(z):Array.isArray(D)&&D.push(z),z}}e.fromObservableLight=M})(A2||={});M9e.all=new Set,M9e._idPool=0;hFr=M9e;Nen._idPool=1;fFr=Nen,gFr=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},bFr=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}};if(pFr){let e=[];setInterval(()=>{e.length!==0&&(console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:"),console.warn(e.join(`
|
|
4999
|
-
`)),e.length=0)},3000),Oae=new FinalizationRegistry((t)=>{typeof t=="string"&&e.push(t)})}VQt={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};pg=[];XQt=class e extends Q9{constructor(){super(...arguments);this.content=0,this.fg=0,this.bg=0,this.extended=new Ren,this.combinedData=""}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?TFr(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let n=!1;if(t[1].length>2)n=!0;else if(t[1].length===2){let r=t[1].charCodeAt(0);if(55296<=r&&r<=56319){let a=t[1].charCodeAt(1);56320<=a&&a<=57343?this.content=(r-55296)*1024+a-56320+65536|t[2]<<22:n=!0}else n=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;n&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Pen=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);J9=D4*Float32Array.BYTES_PER_ELEMENT,IFr=class extends nf{constructor(e,t,n,r){super();this._terminal=e,this._gl=t,this._dimensions=n,this._optionsService=r,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let a=this._gl;P4.maxAtlasPages===void 0&&(P4.maxAtlasPages=Math.min(32,uc(a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS))),P4.maxTextureSize=uc(a.getParameter(a.MAX_TEXTURE_SIZE))),this._program=uc(Den(a,LFr,RFr(P4.maxAtlasPages))),this._register(pd(()=>a.deleteProgram(this._program))),this._projectionLocation=uc(a.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=uc(a.getUniformLocation(this._program,"u_resolution")),this._textureLocation=uc(a.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=a.createVertexArray(),a.bindVertexArray(this._vertexArrayObject);let i=new Float32Array([0,0,1,0,0,1,1,1]),o=a.createBuffer();this._register(pd(()=>a.deleteBuffer(o))),a.bindBuffer(a.ARRAY_BUFFER,o),a.bufferData(a.ARRAY_BUFFER,i,a.STATIC_DRAW),a.enableVertexAttribArray(0),a.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let s=new Uint8Array([0,1,2,3]),l=a.createBuffer();this._register(pd(()=>a.deleteBuffer(l))),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,l),a.bufferData(a.ELEMENT_ARRAY_BUFFER,s,a.STATIC_DRAW),this._attributesBuffer=uc(a.createBuffer()),this._register(pd(()=>a.deleteBuffer(this._attributesBuffer))),a.bindBuffer(a.ARRAY_BUFFER,this._attributesBuffer),a.enableVertexAttribArray(2),a.vertexAttribPointer(2,2,a.FLOAT,!1,J9,0),a.vertexAttribDivisor(2,1),a.enableVertexAttribArray(3),a.vertexAttribPointer(3,2,a.FLOAT,!1,J9,2*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(3,1),a.enableVertexAttribArray(4),a.vertexAttribPointer(4,1,a.FLOAT,!1,J9,4*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(4,1),a.enableVertexAttribArray(5),a.vertexAttribPointer(5,2,a.FLOAT,!1,J9,5*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(5,1),a.enableVertexAttribArray(6),a.vertexAttribPointer(6,2,a.FLOAT,!1,J9,7*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(6,1),a.enableVertexAttribArray(1),a.vertexAttribPointer(1,2,a.FLOAT,!1,J9,9*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(1,1),a.useProgram(this._program);let u=new Int32Array(P4.maxAtlasPages);for(let d=0;d<P4.maxAtlasPages;d++)u[d]=d;a.uniform1iv(this._textureLocation,u),a.uniformMatrix4fv(this._projectionLocation,!1,Pen),this._atlasTextures=[];for(let d=0;d<P4.maxAtlasPages;d++){let p=new AFr(uc(a.createTexture()));this._register(pd(()=>a.deleteTexture(p.texture))),a.activeTexture(a.TEXTURE0+d),a.bindTexture(a.TEXTURE_2D,p.texture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,1,1,0,a.RGBA,a.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[d]=p}a.enable(a.BLEND),a.blendFunc(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(e,t,n,r,a,i,o,s,l){this._updateCell(this._vertices.attributes,e,t,n,r,a,i,o,s,l)}_updateCell(e,t,n,r,a,i,o,s,l,u){if(sl=(n*this._terminal.cols+t)*D4,r===0||r===void 0){e.fill(0,sl,sl+D4-1-NFr);return}this._atlas&&(s&&s.length>1?Uo=this._atlas.getRasterizedGlyphCombinedChar(s,a,i,o,!1,this._terminal.element):Uo=this._atlas.getRasterizedGlyph(r,a,i,o,!1,this._terminal.element),k9e=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),a!==u&&Uo.offset.x>k9e?(_z=Uo.offset.x-k9e,e[sl]=-(Uo.offset.x-_z)+this._dimensions.device.char.left,e[sl+1]=-Uo.offset.y+this._dimensions.device.char.top,e[sl+2]=(Uo.size.x-_z)/this._dimensions.device.canvas.width,e[sl+3]=Uo.size.y/this._dimensions.device.canvas.height,e[sl+4]=Uo.texturePage,e[sl+5]=Uo.texturePositionClipSpace.x+_z/this._atlas.pages[Uo.texturePage].canvas.width,e[sl+6]=Uo.texturePositionClipSpace.y,e[sl+7]=Uo.sizeClipSpace.x-_z/this._atlas.pages[Uo.texturePage].canvas.width,e[sl+8]=Uo.sizeClipSpace.y):(e[sl]=-Uo.offset.x+this._dimensions.device.char.left,e[sl+1]=-Uo.offset.y+this._dimensions.device.char.top,e[sl+2]=Uo.size.x/this._dimensions.device.canvas.width,e[sl+3]=Uo.size.y/this._dimensions.device.canvas.height,e[sl+4]=Uo.texturePage,e[sl+5]=Uo.texturePositionClipSpace.x,e[sl+6]=Uo.texturePositionClipSpace.y,e[sl+7]=Uo.sizeClipSpace.x,e[sl+8]=Uo.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&ZOr(r,l,Uo.size.x,this._dimensions.device.cell.width)&&(e[sl+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let e=this._terminal,t=e.cols*e.rows*D4;this._vertices.count!==t?this._vertices.attributes=new Float32Array(t):this._vertices.attributes.fill(0);let n=0;for(;n<this._vertices.attributesBuffers.length;n++)this._vertices.count!==t?this._vertices.attributesBuffers[n]=new Float32Array(t):this._vertices.attributesBuffers[n].fill(0);this._vertices.count=t,n=0;for(let r=0;r<e.rows;r++)for(let a=0;a<e.cols;a++)this._vertices.attributes[n+9]=a/e.cols,this._vertices.attributes[n+10]=r/e.rows,n+=D4}handleResize(){let e=this._gl;e.useProgram(this._program),e.viewport(0,0,e.canvas.width,e.canvas.height),e.uniform2f(this._resolutionLocation,e.canvas.width,e.canvas.height),this.clear()}render(e){if(!this._atlas)return;let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let n=this._vertices.attributesBuffers[this._activeBuffer],r=0;for(let a=0;a<e.lineLengths.length;a++){let i=a*this._terminal.cols*D4,o=this._vertices.attributes.subarray(i,i+e.lineLengths[a]*D4);n.set(o,r),r+=o.length}t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,n.subarray(0,r),t.STREAM_DRAW);for(let a=0;a<this._atlas.pages.length;a++)this._atlas.pages[a].version!==this._atlasTextures[a].version&&this._bindAtlasPageTexture(t,this._atlas,a);t.drawElementsInstanced(t.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,r/D4)}setAtlas(e){this._atlas=e;for(let t of this._atlasTextures)t.version=-1}_bindAtlasPageTexture(e,t,n){e.activeTexture(e.TEXTURE0+n),e.bindTexture(e.TEXTURE_2D,this._atlasTextures[n].texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.pages[n].canvas),e.generateMipmap(e.TEXTURE_2D),this._atlasTextures[n].version=t.pages[n].version}setDimensions(e){this._dimensions=e}};w9e=E2*Float32Array.BYTES_PER_ELEMENT,BFr=20*E2,zFr=class extends nf{constructor(e,t,n,r){super();this._terminal=e,this._gl=t,this._dimensions=n,this._themeService=r,this._vertices=new QQt,this._verticesCursor=new QQt;let a=this._gl;this._program=uc(Den(a,OFr,FFr)),this._register(pd(()=>a.deleteProgram(this._program))),this._projectionLocation=uc(a.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=a.createVertexArray(),a.bindVertexArray(this._vertexArrayObject);let i=new Float32Array([0,0,1,0,0,1,1,1]),o=a.createBuffer();this._register(pd(()=>a.deleteBuffer(o))),a.bindBuffer(a.ARRAY_BUFFER,o),a.bufferData(a.ARRAY_BUFFER,i,a.STATIC_DRAW),a.enableVertexAttribArray(3),a.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let s=new Uint8Array([0,1,2,3]),l=a.createBuffer();this._register(pd(()=>a.deleteBuffer(l))),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,l),a.bufferData(a.ELEMENT_ARRAY_BUFFER,s,a.STATIC_DRAW),this._attributesBuffer=uc(a.createBuffer()),this._register(pd(()=>a.deleteBuffer(this._attributesBuffer))),a.bindBuffer(a.ARRAY_BUFFER,this._attributesBuffer),a.enableVertexAttribArray(0),a.vertexAttribPointer(0,2,a.FLOAT,!1,w9e,0),a.vertexAttribDivisor(0,1),a.enableVertexAttribArray(1),a.vertexAttribPointer(1,2,a.FLOAT,!1,w9e,2*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(1,1),a.enableVertexAttribArray(2),a.vertexAttribPointer(2,4,a.FLOAT,!1,w9e,4*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(2,1),this._updateCachedColors(r.colors),this._register(this._themeService.onChangeColors((u)=>{this._updateCachedColors(u),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,Pen),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,n=this._vertices,r=1,a,i,o,s,l,u,d,p,h,f,g;for(a=0;a<t.rows;a++){for(o=-1,s=0,l=0,u=!1,i=0;i<t.cols;i++)d=(a*t.cols+i)*qae,p=e.cells[d+Fae],h=e.cells[d+Bae],f=!!(h&67108864),(p!==s||h!==l&&(u||f))&&((s!==0||u&&l!==0)&&(g=r++*E2,this._updateRectangle(n,g,l,s,o,i,a)),o=i,s=p,l=h,u=f);(s!==0||u&&l!==0)&&(g=r++*E2,this._updateRectangle(n,g,l,s,o,t.cols,a))}n.count=r}updateCursor(e){let t=this._verticesCursor,n=e.cursor;if(!n||n.style==="block"){t.count=0;return}let r,a=0;(n.style==="bar"||n.style==="outline")&&(r=a++*E2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.style==="bar"?n.dpr*n.cursorWidth:n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(n.style==="underline"||n.style==="outline")&&(r=a++*E2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,(n.y+1)*this._dimensions.device.cell.height-n.dpr,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat)),n.style==="outline"&&(r=a++*E2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat),r=a++*E2,this._addRectangleFloat(t.attributes,r,(n.x+n.width)*this._dimensions.device.cell.width-n.dpr,n.y*this._dimensions.device.cell.height,n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=a}_updateRectangle(e,t,n,r,a,i,o){if(n&67108864)switch(n&50331648){case 16777216:case 33554432:S2=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:S2=(n&16777215)<<8;break;case 0:default:S2=this._themeService.colors.foreground.rgba}else switch(r&50331648){case 16777216:case 33554432:S2=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:S2=(r&16777215)<<8;break;case 0:default:S2=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=EFr(e.attributes,this._terminal.rows*this._terminal.cols*E2)),een=a*this._dimensions.device.cell.width,ten=o*this._dimensions.device.cell.height,nen=(S2>>24&255)/255,ren=(S2>>16&255)/255,aen=(S2>>8&255)/255,ien=1,this._addRectangle(e.attributes,t,een,ten,(i-a)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,nen,ren,aen,ien)}_addRectangle(e,t,n,r,a,i,o,s,l,u){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=a/this._dimensions.device.canvas.width,e[t+3]=i/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=s,e[t+6]=l,e[t+7]=u}_addRectangleFloat(e,t,n,r,a,i,o){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=a/this._dimensions.device.canvas.width,e[t+3]=i/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},jFr=class extends nf{constructor(e,t,n,r,a,i,o,s){super();this._container=t,this._alpha=a,this._coreBrowserService=i,this._optionsService=o,this._themeService=s,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${n}-layer`),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors((l)=>{this._refreshCharAtlas(e,l),this.reset(e)})),this._register(pd(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=uc(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,n){}handleSelectionChanged(e,t,n,r=!1){}_setTransparency(e,t){if(t===this._alpha)return;let n=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=Men(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,n=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,n*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,n,r){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight))}_fillCharTrueColor(e,t,n,r){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=Ten,this._clipCell(n,r,t.getWidth()),this._ctx.fillText(t.getChars(),n*this._deviceCellWidth+this._deviceCharLeft,r*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,n){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,n){let r=t?e.options.fontWeightBold:e.options.fontWeight;return`${n?"italic":""} ${r} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},UFr=class extends jFr{constructor(e,t,n,r,a,i,o){super(n,e,"link",t,!0,a,i,o),this._register(r.onShowLinkUnderline((s)=>this._handleShowLinkUnderline(s))),this._register(r.onHideLinkUnderline((s)=>this._handleHideLinkUnderline(s)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&CFr(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},G0=typeof window=="object"?window:globalThis;D9e.INSTANCE=new D9e;$en=D9e;Bml=$en.INSTANCE.onDidChangeZoomLevel,zml=$en.INSTANCE.onDidChangeFullscreen,rL=typeof navigator=="object"?navigator.userAgent:"",jml=rL.indexOf("Firefox")>=0,C9e=rL.indexOf("AppleWebKit")>=0,WFr=rL.indexOf("Chrome")>=0,GFr=!WFr&&rL.indexOf("Safari")>=0,Uml=rL.indexOf("Electron/")>=0,qml=rL.indexOf("Android")>=0;if(typeof G0.matchMedia=="function"){let e=G0.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=G0.matchMedia("(display-mode: fullscreen)");zae=e.matches,qFr(G0,e,({matches:n})=>{zae&&t.matches||(zae=n)})}Uae=eL,oen=eL,R2=globalThis;typeof R2.vscode<"u"&&typeof R2.vscode.process<"u"?tf=R2.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(tf=process);Ben=typeof tf?.versions?.electron=="string",QFr=Ben&&tf?.type==="renderer";if(typeof tf=="object"){$9e=tf.platform==="win32",O9e=tf.platform==="darwin",jae=tf.platform==="linux",VFr=jae&&!!tf.env.SNAP&&!!tf.env.SNAP_REVISION,ZFr=Ben,YFr=!!tf.env.CI||!!tf.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Pae=eL,Uae=eL;let e=tf.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Pae=t.userLocale,oen=t.osLocale,Uae=t.resolvedLanguage||eL,JFr=t.languagePack?.translationsConfigFile}catch{}Oen=!0}else typeof navigator=="object"&&!QFr?(T2=navigator.userAgent,$9e=T2.indexOf("Windows")>=0,O9e=T2.indexOf("Macintosh")>=0,KFr=(T2.indexOf("Macintosh")>=0||T2.indexOf("iPad")>=0||T2.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,jae=T2.indexOf("Linux")>=0,XFr=T2?.indexOf("Mobi")>=0,Fen=!0,Uae=globalThis._VSCODE_NLS_LANGUAGE||eL,Pae=navigator.language.toLowerCase(),oen=Pae):console.error("Unable to resolve platform.");O9e?S9e=1:$9e?S9e=3:jae&&(S9e=2);T9e=Oen,eBr=Fen&&typeof R2.importScripts=="function",Wml=eBr?R2.origin:void 0,dy=T2,I4=Uae;((e)=>{function t(){return I4}e.value=t;function n(){return I4.length===2?I4==="en":I4.length>=3?I4[0]==="e"&&I4[1]==="n"&&I4[2]==="-":!1}e.isDefaultVariant=n;function r(){return I4==="en"}e.isDefault=r})(tBr||={});nBr=typeof R2.postMessage=="function"&&!R2.importScripts,rBr=(()=>{if(nBr){let e=[];R2.addEventListener("message",(n)=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,a=e.length;r<a;r++){let i=e[r];if(i.id===n.data.vscodeScheduleAsyncWork){e.splice(r,1),i.callback();return}}});let t=0;return(n)=>{let r=++t;e.push({id:r,callback:n}),R2.postMessage({vscodeScheduleAsyncWork:r},"*")}}return(e)=>setTimeout(e)})(),aBr=!!(dy&&dy.indexOf("Chrome")>=0),Gml=!!(dy&&dy.indexOf("Firefox")>=0),Hml=!!(!aBr&&dy&&dy.indexOf("Safari")>=0),Vml=!!(dy&&dy.indexOf("Edg/")>=0),Zml=!!(dy&&dy.indexOf("Android")>=0),M4=typeof navigator=="object"?navigator:{},Kml={clipboard:{writeText:T9e||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(M4&&M4.clipboard&&M4.clipboard.writeText),readText:T9e||!!(M4&&M4.clipboard&&M4.clipboard.readText)},keyboard:T9e||HFr()?0:M4.keyboard||GFr?1:2,touch:"ontouchstart"in G0||M4.maxTouchPoints>0,pointerEvents:G0.PointerEvent&&(("ontouchstart"in G0)||navigator.maxTouchPoints>0)},E9e=new U9e,sen=new U9e,len=new U9e,Yml=Array(230);((e)=>{function t(s){return E9e.keyCodeToStr(s)}e.toString=t;function n(s){return E9e.strToKeyCode(s)}e.fromString=n;function r(s){return sen.keyCodeToStr(s)}e.toUserSettingsUS=r;function a(s){return len.keyCodeToStr(s)}e.toUserSettingsGeneral=a;function i(s){return sen.strToKeyCode(s)||len.strToKeyCode(s)}e.fromUserSettings=i;function o(s){if(s>=98&&s<=113)return null;switch(s){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return E9e.keyCodeToStr(s)}e.toElectronAccelerator=o})(iBr||={});zen=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}});((e)=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof sBr?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:A2.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:zen})})(oBr||={});Xml=Symbol("MicrotaskDelay");(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?A9e=(e,t)=>{rBr(()=>{if(n)return;let r=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,r-Date.now())}}))});let n=!1;return{dispose(){n||(n=!0)}}}:A9e=(e,t,n)=>{let r=e.requestIdleCallback(t,typeof n=="number"?{timeout:n}:void 0),a=!1;return{dispose(){a||(a=!0,e.cancelIdleCallback(r))}}},lBr=(e)=>A9e(globalThis,e)})();((e)=>{async function t(r){let a,i=await Promise.all(r.map((o)=>o.then((s)=>s,(s)=>{a||(a=s)})));if(typeof a<"u")throw a;return i}e.settled=t;function n(r){return new Promise(async(a,i)=>{try{await r(a,i)}catch(o){i(o)}})}e.withAsyncBody=n})(cBr||={});cen=class e{static fromArray(t){return new e((n)=>{n.emitMany(t)})}static fromPromise(t){return new e(async(n)=>{n.emitMany(await t)})}static fromPromises(t){return new e(async(n)=>{await Promise.all(t.map(async(r)=>n.emitOne(await r)))})}static merge(t){return new e(async(n)=>{await Promise.all(t.map(async(r)=>{for await(let a of r)n.emitOne(a)}))})}constructor(t,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new _o,queueMicrotask(async()=>{let r={emitOne:(a)=>this.emitOne(a),emitMany:(a)=>this.emitMany(a),reject:(a)=>this.reject(a)};try{await Promise.resolve(t(r)),this.resolve()}catch(a){this.reject(a)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await A2.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async(r)=>{for await(let a of t)r.emitOne(n(a))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async(r)=>{for await(let a of t)n(a)&&r.emitOne(a)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,(n)=>!!n)}coalesce(){return e.coalesce(this)}static async toPromise(t){let n=[];for await(let r of t)n.push(r);return n}toPromise(){return e.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};cen.EMPTY=cen.fromArray([]);bBr._bigBlock32=new DataView(new ArrayBuffer(320));({registerWindow:Jml,getWindow:yBr,getDocument:Qml,getWindows:ehl,getWindowsCount:thl,getWindowId:pen,getWindowById:nhl,hasWindow:rhl,onDidRegisterWindow:ahl,onWillUnregisterWindow:ihl,onDidUnregisterWindow:ohl}=function(){let e=new Map,t={window:G0,disposables:new tL};e.set(G0.vscodeWindowId,t);let n=new _o,r=new _o,a=new _o;function i(o,s){return(typeof o=="number"?e.get(o):void 0)??(s?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:a.event,onDidUnregisterWindow:r.event,registerWindow(o){if(e.has(o.vscodeWindowId))return nf.None;let s=new tL,l={window:o,disposables:s.add(new tL)};return e.set(o.vscodeWindowId,l),s.add(pd(()=>{e.delete(o.vscodeWindowId),r.fire(o)})),s.add(F9e(o,kBr.BEFORE_UNLOAD,()=>{a.fire(o)})),n.fire(l),s},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return e.has(o)},getWindowById:i,getWindow(o){let s=o;if(s?.ownerDocument?.defaultView)return s.ownerDocument.defaultView.window;let l=o;return l?.view?l.view.window:G0},getDocument(o){return yBr(o).document}}}());(function(){let e=new Map,t=new Map,n=new Map,r=new Map,a=(i)=>{n.set(i,!1);let o=e.get(i)??[];for(t.set(i,o),e.set(i,[]),r.set(i,!0);o.length>0;)o.sort(R9e.sort),o.shift().execute();r.set(i,!1)};men=(i,o,s=0)=>{let l=pen(i),u=new R9e(o,s),d=e.get(l);return d||(d=[],e.set(l,d)),d.push(u),n.get(l)||(n.set(l,!0),i.requestAnimationFrame(()=>a(l))),u},xBr=(i,o,s)=>{let l=pen(i);if(r.get(l)){let u=new R9e(o,s),d=t.get(l);return d||(d=[],t.set(l,d)),d.push(u),u}else return men(i,o,s)}})();hen.None=new hen(0,0);shl=new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let a=pBr(n),i=r.get(a);if(i)i.users+=1;else{let o=new _o,s=new MutationObserver((u)=>o.fire(u));s.observe(e,n);let l=i={users:1,observer:s,onDidMutate:o.event};t.add(pd(()=>{l.users-=1,l.users===0&&(o.dispose(),s.disconnect(),r?.delete(a),r?.size===0&&this.mutationObservers.delete(e))})),r.set(a,i)}return i.onDidMutate}},kBr={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:C9e?"webkitAnimationStart":"animationstart",ANIMATION_END:C9e?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:C9e?"webkitAnimationIteration":"animationiteration"},_Br=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;wBr.SVG=function(e,t,...n){return Uen("http://www.w3.org/2000/svg",e,t,...n)};CBr=class extends nf{constructor(e,t,n,r,a,i,o,s,l){super();this._terminal=e,this._characterJoinerService=t,this._charSizeService=n,this._coreBrowserService=r,this._coreService=a,this._decorationService=i,this._optionsService=o,this._themeService=s,this._cursorBlinkStateManager=new vz,this._charAtlasDisposable=this._register(new vz),this._observerDisposable=this._register(new vz),this._model=new $Fr,this._workCell=new XQt,this._workCell2=new XQt,this._rectangleRenderer=this._register(new vz),this._glyphRenderer=this._register(new vz),this._onChangeTextureAtlas=this._register(new _o),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new _o),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new _o),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new _o),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new _o),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let u={antialias:!1,depth:!1,preserveDrawingBuffer:l};if(this._gl=this._canvas.getContext("webgl2",u),!this._gl)throw Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new XOr(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new UFr(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=KOr(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(F9e(this._canvas,"webglcontextlost",(d)=>{console.log("webglcontextlost event received"),d.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(d)},3000)})),this._register(F9e(this._canvas,"webglcontextrestored",(d)=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,KQt(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=YQt(this._canvas,this._coreBrowserService.window,(d,p)=>this._setCanvasDevicePixelDimensions(d,p)),this._register(this._coreBrowserService.onWindowChange((d)=>{this._observerDisposable.value=YQt(this._canvas,d,(p,h)=>this._setCanvasDevicePixelDimensions(p,h))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(pd(()=>{for(let d of this._renderLayers)d.dispose();this._canvas.parentElement?.removeChild(this._canvas),KQt(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let n of this._renderLayers)n.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,n){for(let r of this._renderLayers)r.handleSelectionChanged(this._terminal,e,t,n);this._model.selection.update(this._core,e,t,n),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new zFr(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new IFr(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=Men(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=_en(A2.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),A2.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let n of this._renderLayers)n.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new SFr(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let n=this._core,r=this._workCell,a,i,o,s,l,u,d=0,p=!0,h,f,g,b,y,v,x,k,C;e=fen(e,n.rows-1,0),t=fen(t,n.rows-1,0);let _=this._coreService.decPrivateModes.cursorStyle??n.options.cursorStyle??"block",w=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,T=w-n.buffer.ydisp,E=Math.min(this._terminal.buffer.active.cursorX,n.cols-1),L=-1,P=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let R=!1;for(i=e;i<=t;i++)for(o=i+n.buffer.ydisp,s=n.buffer.lines.get(o),this._model.lineLengths[i]=0,g=w===o,d=0,l=this._characterJoinerService.getJoinedCharacters(o),k=0;k<n.cols;k++){if(a=this._cellColorResolver.result.bg,s.loadCell(k,r),k===0&&(a=this._cellColorResolver.result.bg),u=!1,p=k>=d,h=k,l.length>0&&k===l[0][0]&&p){f=l.shift();let M=this._model.selection.isCellSelected(this._terminal,f[0],o);for(x=f[0]+1;x<f[1];x++)p&&=M===this._model.selection.isCellSelected(this._terminal,x,o);p&&=!g||E<f[0]||E>=f[1],p?(u=!0,r=new SBr(r,s.translateToString(!0,f[0],f[1]),f[1]-f[0]),h=f[1]-1):d=f[1]}if(b=r.getChars(),y=r.getCode(),x=(i*n.cols+k)*qae,this._cellColorResolver.resolve(r,k,o,this.dimensions.device.cell.width),P&&o===w&&(k===E&&(this._model.cursor={x:E,y:T,width:r.getWidth(),style:this._coreBrowserService.isFocused?_:n.options.cursorInactiveStyle,cursorWidth:n.options.cursorWidth,dpr:this._devicePixelRatio},L=E+r.getWidth()-1),k>=E&&k<=L&&(this._coreBrowserService.isFocused&&_==="block"||this._coreBrowserService.isFocused===!1&&n.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),y!==0&&(this._model.lineLengths[i]=k+1),!(this._model.cells[x]===y&&this._model.cells[x+Fae]===this._cellColorResolver.result.bg&&this._model.cells[x+Bae]===this._cellColorResolver.result.fg&&this._model.cells[x+_9e]===this._cellColorResolver.result.ext)&&(R=!0,b.length>1&&(y|=DFr),this._model.cells[x]=y,this._model.cells[x+Fae]=this._cellColorResolver.result.bg,this._model.cells[x+Bae]=this._cellColorResolver.result.fg,this._model.cells[x+_9e]=this._cellColorResolver.result.ext,v=r.getWidth(),this._glyphRenderer.value.updateCell(k,i,y,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,b,v,a),u)){for(r=this._workCell,k++;k<=h;k++)C=(i*n.cols+k)*qae,this._glyphRenderer.value.updateCell(k,i,0,0,0,0,UOr,0,0),this._model.cells[C]=0,this._model.cells[C+Fae]=this._cellColorResolver.result.bg,this._model.cells[C+Bae]=this._cellColorResolver.result.fg,this._model.cells[C+_9e]=this._cellColorResolver.result.ext;k--}}R&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},SBr=class extends Q9{constructor(e,t,n){super();this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};N9e=new Map;lhl=py("BufferService"),chl=py("CoreMouseService"),uhl=py("CoreService"),dhl=py("CharsetService"),phl=py("InstantiationService"),mhl=py("LogService"),EBr=py("OptionsService"),hhl=py("OscLinkService"),fhl=py("UnicodeService"),ghl=py("DecorationService"),ABr={trace:0,debug:1,info:2,warn:3,error:4,off:5},yen=class extends nf{constructor(e){super();this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),qen=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=ABr[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":LBr)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};yen=_Or([wOr(0,EBr)],yen);NBr=class extends nf{constructor(e){if(Cen&&jOr()<16){let t={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",t))throw Error("Webgl2 is only supported on Safari 16 and above")}super();this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new _o),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new _o),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new _o),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new _o),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element){this._register(t.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let{coreService:n,optionsService:r}=t,a=t,{_renderService:i,_characterJoinerService:o,_charSizeService:s,_coreBrowserService:l,_decorationService:u,_logService:d,_themeService:p}=a;RBr(d),this._renderer=this._register(new CBr(e,o,s,l,n,u,r,p,this._preserveDrawingBuffer)),this._register(A2.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(A2.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(A2.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(A2.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),i.setRenderer(this._renderer),this._register(pd(()=>{if(this._terminal._core._store._isDisposed)return;let h=this._terminal._core._renderService;h.setRenderer(this._terminal._core._createRenderer()),h.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}}});async function Gen(e,t,n,r){let a=await Promise.resolve().then(() => (PQt(),{})),i=await Promise.resolve().then(() => (DQt(),{})),o=gOr||(void 0)?.Terminal||void 0,s=vOr||(void 0)?.FitAddon||void 0;if(!o||!s||r())return null;WXt(s);let l=new o({cursorBlink:!0,cursorStyle:"block",fontSize:12,lineHeight:1.25,fontFamily:qXt,theme:nae(t),scrollback:1e4,scrollSensitivity:1.5,fastScrollSensitivity:5,smoothScrollDuration:0,allowProposedApi:!0});l.open(e),GXt(l);try{let w=await Promise.resolve().then(() => (Wen(),{})),T=NBr||(void 0)?.WebglAddon||void 0;if(T){let E=new T;E.onContextLoss(()=>E.dispose()),l.loadAddon(E)}}catch{}let u=new s;l.loadAddon(u);let d=IBr(l);l.attachCustomKeyEventHandler((w)=>MBr(l,w));let p=[l.onScroll(()=>{let w=l.buffer.active;n.onScrolledUpChange(w.viewportY<w.baseY)}),l.onData((w)=>n.onInput(w)),l.onBinary((w)=>n.onBinaryInput(w)),l.onResize(({cols:w,rows:T})=>{if(b)return;n.onGridChange(w,T)})],h=!1,f=null,g=null,b=!1,y=()=>{if(r())return;if(e.clientWidth<=0||e.clientHeight<=0)return;let T=l._core?._renderService?.dimensions;if(!T?.css?.cell?.width||!T?.css?.cell?.height)return;try{u.fit()}catch{}},v=()=>{l.write("",()=>{if(r())return;b=!1,y()})},x=(w,T,E)=>{if(b=!0,l.cols!==T||l.rows!==E)l.resize(T,E);if(w.length===0){v();return}l.write(w,v)},k=()=>{if(h||r())return;if(e.clientWidth<=0||e.clientHeight<=0)return;if(!l._core?._renderService?.dimensions?.css?.cell?.width)return;h=!0,n.onReady(l.cols,l.rows),l.focus()},C=new ResizeObserver(()=>{if(f)clearTimeout(f);f=setTimeout(()=>{y(),k()},35)});C.observe(e);let _=PBr(e,l);return g=requestAnimationFrame(()=>{y(),k()}),{term:l,fitAddon:u,writeReplay:x,dispose(){if(g!==null)cancelAnimationFrame(g);clearTimeout(f??void 0),d(),_();for(let w of p)w.dispose();C.disconnect();try{u.dispose()}catch{}try{l.dispose()}catch{}}}}function IBr(e){if(typeof document>"u"||!document.fonts)return()=>{};let t=(n)=>{if(![...n.fontfaces].some((a)=>a.family.replace(/['"]/g,"")===h7e))return;try{e.clearTextureAtlas()}catch{}};return document.fonts.addEventListener("loadingdone",t),()=>document.fonts.removeEventListener("loadingdone",t)}function MBr(e,t){if(t.type!=="keydown"||!t.shiftKey)return!0;if(t.key==="PageUp")return e.scrollPages(-1),!1;if(t.key==="PageDown")return e.scrollPages(1),!1;if(t.key==="Home")return e.scrollToTop(),!1;if(t.key==="End")return e.scrollToBottom(),!1;if(t.key==="ArrowUp")return e.scrollLines(-1),!1;if(t.key==="ArrowDown")return e.scrollLines(1),!1;return!0}function PBr(e,t){let n=0,r=(i)=>{if(i.touches.length===1)n=i.touches[0].clientY},a=(i)=>{if(i.touches.length!==1)return;let o=n-i.touches[0].clientY;if(Math.abs(o)<16)return;t.scrollLines(Math.trunc(o/16)),n=i.touches[0].clientY};return e.addEventListener("touchstart",r,{passive:!0}),e.addEventListener("touchmove",a,{passive:!0}),()=>{e.removeEventListener("touchstart",r),e.removeEventListener("touchmove",a)}}var Hen=O(()=>{f7e()});var W9e;var Ven=O(()=>{Je();Ma();pt();m6();f7e();Hen();de();W9e=e6(({onInput:e,onBinaryInput:t,onGridChange:n,onReady:r},a)=>{let{theme:i}=EU(),o=Re(null),s=Re(null),[l,u]=ae(!1),d=Re(e);d.current=e;let p=Re(t);p.current=t;let h=Re(n);h.current=n;let f=Re(r);f.current=r;let g=Re(i);g.current=i,Ee(()=>{let y=s.current?.term;if(!y)return;y.options.theme=nae(i),y.refresh(0,y.rows-1)},[i]),yg(a,()=>({write(y){s.current?.term.write(y)},writeReplay(y,v,x){s.current?.writeReplay(y,v,x)},reset(){s.current?.term.reset()},focus(){s.current?.term.focus()},applicationCursorKeys(){return s.current?.term.modes.applicationCursorKeysMode??!1},getSelection(){return s.current?.term.getSelection()??""},paste(y){s.current?.term.paste(y)}}),[]);let b=Le(()=>{s.current?.term.scrollToBottom(),u(!1)},[]);return Ee(()=>{let y=o.current;if(!y)return;let v=!1;return Gen(y,g.current,{onInput:(x)=>d.current(x),onBinaryInput:(x)=>p.current(x),onGridChange:(x,k)=>h.current(x,k),onReady:(x,k)=>f.current(x,k),onScrolledUpChange:u},()=>v).then((x)=>{if(!x)return;if(v){x.dispose();return}s.current=x}),()=>{v=!0,s.current?.dispose(),s.current=null}},[]),m("div",{className:"relative flex-1 w-full h-full bg-canvas overflow-hidden",children:[m("div",{ref:o,className:"w-full h-full cursor-text p-1.5",style:{height:"100%",width:"100%"}}),l&&m("button",{type:"button",onClick:b,className:"absolute bottom-3 right-4 z-20 flex items-center space-x-1.5 px-2.5 py-1 bg-paper hover:bg-canvas text-ink border border-ink/20 rounded-full shadow-lg text-[11px] font-mono transition-all animate-fade-in cursor-pointer active:scale-95",title:"Scroll to latest output (Shift+End)",children:[m(_g,{size:12,className:"text-warning"}),m("span",{children:"Latest"})]})]})});W9e.displayName="RealtimeXtermView"});function DBr({className:e="",enabled:t=!0,rootPath:n,showHeader:r=!0}){let a=Re(null),{isDark:i}=EU(),o=AXt(),s=Re(null),l=tae(s),[u,d]=ae(HB),{activeRepo:p,setActiveRepo:h}=U0(n),{repos:f,scanning:g,rescan:b}=q0(n,t),y=Re(null),v=Re(u);v.current=u;let x=Le((H)=>{a.current?.write(H)},[]),k=Le((H,Y)=>{a.current?.writeReplay(H,Y.replayCols,Y.replayRows)},[]),C=Le(()=>{a.current?.reset()},[]),{status:_,shell:w,exitCode:T,error:E,attach:L,resize:P,input:R,restart:M}=wXt({root:t?n:void 0,repo:p,theme:i?"dark":"light",onOutput:x,onReplay:k,onRestart:C}),A=Le((H,Y)=>{y.current={cols:H,rows:Y},L(H,Y)},[L]),N=Le((H,Y)=>{let X=y.current;if(y.current={cols:H,rows:Y},!X)return;P(H,Y)},[P]),I=Le((H)=>{let Y=v.current,X=Y.ctrl||Y.alt,Q=$Xt(H,Y);if(X&&H.length===1)d(HB);R(G9e.encode(Q))},[R]),D=Le((H)=>{d((Y)=>({...Y,[H]:!Y[H]})),a.current?.focus()},[]),B=Le((H)=>{let Y=DXt(H,{applicationCursorKeys:a.current?.applicationCursorKeys()??!1,modifiers:v.current});if(!Y)return;R(G9e.encode(Y)),d(HB),a.current?.focus()},[R]),F=Le(async()=>{let H=a.current?.getSelection()??"";if(!H)return!1;return Vh(H)},[]),j=Le(async()=>{let H=await aVt();if(H===null||H.length===0)return!1;return a.current?.paste(H),a.current?.focus(),!0},[]),z=Le((H)=>{let Y=new Uint8Array(H.length);for(let X=0;X<H.length;X+=1)Y[X]=H.charCodeAt(X)&255;R(Y)},[R]),q=Le((H)=>{R(G9e.encode(`${H}\r`)),a.current?.focus()},[R]),W=Le(()=>{M()},[M]);if(!t)return m("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${e}`,children:m("span",{className:"text-xs font-mono",children:"No session selected"})});return m("div",{ref:s,className:`flex flex-col h-full w-full bg-paper text-ink overflow-hidden ${e}`,style:l>0?{paddingBottom:l}:void 0,children:[r&&m(RXt,{status:_,exitCode:T,rootPath:n,activeRepo:p,onSelectRepo:h,repos:f,reposScanning:g,onRefreshRepos:b,shell:w,onRestart:W}),m(IXt,{onSelectCommand:q,disabled:_!=="running"}),E&&m("div",{className:"px-3 py-1.5 border-b border-error/20 bg-error/5 text-[11px] font-mono text-error flex-shrink-0",children:E}),m("div",{className:"flex-1 w-full min-h-0 bg-canvas overflow-hidden",children:m(W9e,{ref:a,onInput:I,onBinaryInput:z,onReady:A,onGridChange:N})}),o&&m(FXt,{modifiers:u,onToggleModifier:D,onKey:B,onCopy:F,onPaste:j,disabled:_!=="running"})]})}var G9e;var Zen=O(()=>{Je();CXt();g2();m6();LXt();c7e();NXt();MXt();BXt();Ven();p7e();de();G9e=new TextEncoder});function Yen({viewportMode:e,onChangeViewport:t,zoomLevel:n=100,onSetZoom:r}){let[a,i]=ae(!1),o=Re(null);return Yr(o,()=>i(!1)),m("div",{className:"flex items-center space-x-1.5 flex-shrink-0",children:[m("div",{className:"hidden sm:flex items-center bg-canvas border border-ink/10 rounded-md p-0.5",children:[m("button",{type:"button",onClick:()=>t("responsive"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${e==="responsive"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Responsive (100% Fluid)",children:m(ck,{size:12})}),m("button",{type:"button",onClick:()=>t("desktop-16-9"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${e==="desktop-16-9"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Desktop 16:9 (Auto Height following Width)",children:m(o6,{size:12})}),m("button",{type:"button",onClick:()=>t("tablet"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${e==="tablet"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Tablet (768px)",children:m(l6,{size:12})}),m("button",{type:"button",onClick:()=>t("mobile"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${e==="mobile"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Mobile (375px)",children:m(lp,{size:12})})]}),m("div",{className:"relative",ref:o,children:[m("button",{type:"button",onClick:()=>i((l)=>!l),className:"flex items-center space-x-1 px-2 py-1 rounded bg-canvas border border-ink/15 hover:border-ink/30 text-ink text-[11px] font-mono transition-colors cursor-pointer",title:"Device & Responsive Testing Menu",children:[m("span",{className:"hidden md:inline text-[10px] font-medium",children:((l)=>{switch(l){case"desktop-16-9":return"Desktop 16:9";case"laptop":return"Laptop 1024p";case"tablet":return"Tablet 768p";case"mobile":return"Mobile 375p";case"mobile-lg":return"Mobile Lg 414p";case"responsive":default:return"Responsive"}})(e)}),m(Zn,{size:11,className:"text-ink/60"})]}),a&&m("div",{className:"absolute right-0 top-full mt-1 w-56 bg-paper border border-ink/15 rounded-lg shadow-xl py-1 z-50 text-xs font-mono",children:[m("div",{className:"px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold",children:"Responsive Testing"}),Ken.filter((l)=>l.category==="responsive").map((l)=>{let u=l.icon,d=e===l.id;return m("button",{type:"button",onClick:()=>{t(l.id),i(!1)},className:`w-full px-2.5 py-1.5 flex items-center justify-between text-left hover:bg-ink/5 cursor-pointer ${d?"bg-ink/10 font-semibold text-ink":"text-ink/75"}`,children:[m("div",{className:"flex items-center space-x-2",children:[m(u,{size:13,className:"text-ink/60"}),m("span",{children:l.label})]}),d&&m(Xt,{size:12,className:"text-success"})]},l.id)}),m("div",{className:"mt-1 pt-1 border-t border-ink/10 px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold",children:"Mobile Testing"}),Ken.filter((l)=>l.category==="mobile").map((l)=>{let u=l.icon,d=e===l.id;return m("button",{type:"button",onClick:()=>{t(l.id),i(!1)},className:`w-full px-2.5 py-1.5 flex items-center justify-between text-left hover:bg-ink/5 cursor-pointer ${d?"bg-ink/10 font-semibold text-ink":"text-ink/75"}`,children:[m("div",{className:"flex items-center space-x-2",children:[m(u,{size:13,className:"text-ink/60"}),m("span",{children:l.label})]}),d&&m(Xt,{size:12,className:"text-success"})]},l.id)}),r&&m(kt,{children:[m("div",{className:"mt-1 pt-1 border-t border-ink/10 px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold",children:["Zoom Scale (",n,"%)"]}),m("div",{className:"grid grid-cols-3 gap-1 px-2 py-1",children:[50,75,100,125,150,200].map((l)=>m("button",{type:"button",onClick:()=>{r(l),i(!1)},className:`px-1.5 py-1 text-center rounded text-[11px] font-mono cursor-pointer transition-colors ${n===l?"bg-ink text-canvas font-semibold":"bg-canvas border border-ink/10 text-ink/75 hover:bg-ink/5"}`,children:[l,"%"]},l))})]})]})]})]})}var Ken;var Xen=O(()=>{Je();pt();So();de();Ken=[{id:"responsive",label:"Responsive (100% Fluid)",category:"responsive",icon:ck},{id:"desktop-16-9",label:"Desktop 16:9 (Auto H:W)",category:"responsive",icon:o6},{id:"laptop",label:"Laptop (1024 × 768)",category:"responsive",icon:uN},{id:"tablet",label:"Tablet (768 × 1024)",category:"mobile",icon:l6},{id:"mobile",label:"Mobile Phone (375 × 667)",category:"mobile",icon:lp},{id:"mobile-lg",label:"Mobile Large (414 × 896)",category:"mobile",icon:lp}]});function Jen({zoomLevel:e,onZoomIn:t,onZoomOut:n,onResetZoom:r}){return m("div",{className:"flex items-center bg-canvas border border-ink/10 rounded-md p-0.5 space-x-0.5 text-xs font-mono",children:[m("button",{type:"button",onClick:n,disabled:e<=50,"aria-label":"Perkecil tampilan",title:"Zoom Out (-10%)",className:"p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors",children:m(Qy,{size:12})}),m("button",{type:"button",onClick:r,className:"px-1 text-[10px] font-medium text-ink/75 hover:text-ink hover:underline cursor-pointer select-none",title:"Reset Zoom (100%)",children:[e,"%"]}),m("button",{type:"button",onClick:t,disabled:e>=200,"aria-label":"Perbesar tampilan",title:"Zoom In (+10%)",className:"p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors",children:m(Jy,{size:12})})]})}var Qen=O(()=>{pt();de()});function Hae({url:e,statusDotClass:t,statusLabel:n,viewportMode:r,zoomLevel:a,onChangeViewport:i,onZoomIn:o,onZoomOut:s,onResetZoom:l,onSetZoom:u,onIncludeInChat:d,onOpenExternal:p,trailingControls:h,openExternalLabel:f,openExternalTitle:g,children:b}){let[y,v]=ae(!1),[x,k]=ae(!1),C=()=>{if(!e)return;navigator.clipboard.writeText(e).then(()=>{v(!0),setTimeout(()=>v(!1),2000)}).catch(()=>{})},_=()=>{d(),k(!0),setTimeout(()=>k(!1),2500)};return m("div",{className:"h-10 px-2.5 border-b border-ink/10 bg-paper flex items-center justify-between flex-shrink-0 select-none space-x-2",children:[m("div",{className:"flex items-center space-x-1.5 flex-shrink-0",title:n,children:[m("span",{className:`w-1.5 h-1.5 rounded-full ${t}`}),m("span",{className:"text-[10px] font-mono uppercase tracking-wide text-ink/60",children:n})]}),b,m("div",{className:"flex items-center space-x-1.5 flex-shrink-0",children:[r&&i&&m(Yen,{viewportMode:r,onChangeViewport:i,zoomLevel:a,onSetZoom:u}),m(Jen,{zoomLevel:a,onZoomIn:o,onZoomOut:s,onResetZoom:l}),m("button",{type:"button",onClick:_,disabled:!e,"aria-label":"Sertakan halaman ini di draft chat",title:x?"Konteks halaman ditambahkan ke draft":"Sertakan halaman ini di draft chat",className:Az,children:x?m(Xt,{size:14,className:"text-success"}):m(pb,{size:14})}),m("button",{type:"button",onClick:C,disabled:!e,"aria-label":"Salin URL",title:y?"Copied URL!":"Copy URL",className:Az,children:y?m(Xt,{size:14,className:"text-success"}):m(yi,{size:14})}),h,m("button",{type:"button",onClick:p,disabled:!e,"aria-label":f,title:g,className:Az,children:m(so,{size:14})})]})]})}var Az="p-1.5 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink transition-colors cursor-pointer disabled:cursor-not-allowed";var H9e=O(()=>{Je();pt();Xen();Qen();de()});function etn({url:e,input:t,loading:n,error:r,canGoBack:a,canGoForward:i,viewportMode:o,zoomLevel:s,onInputChange:l,onSubmit:u,onBack:d,onForward:p,onReload:h,onOpenExternal:f,onIncludeInChat:g,onChangeViewport:b,onZoomIn:y,onZoomOut:v,onResetZoom:x,onSetZoom:k}){let C=Re(void 0);Ee(()=>{if(C.current===e)return;if(C.current=e,e)l(e)},[e,l]);let _=!e?"idle":n?"loading":"ready",w=_==="ready"?"bg-success animate-pulse":_==="loading"?"bg-ink/40 animate-pulse":"bg-ink/25",T=m("div",{className:"flex items-center bg-canvas border border-ink/10 rounded-md p-0.5 space-x-0.5 flex-shrink-0",children:[m("button",{type:"button",onClick:d,disabled:!a,"aria-label":"Kembali",title:"Kembali",className:V9e,children:m(ip,{size:12})}),m("button",{type:"button",onClick:p,disabled:!i,"aria-label":"Maju",title:"Maju",className:V9e,children:m(Sy,{size:12})}),m("button",{type:"button",onClick:h,disabled:!e,"aria-label":"Muat ulang",title:"Muat ulang",className:V9e,children:m(Mn,{size:12,className:n?"animate-spin":void 0})})]});return m(Hae,{url:e,statusDotClass:w,statusLabel:$Br[_],viewportMode:o,zoomLevel:s,onChangeViewport:b,onZoomIn:y,onZoomOut:v,onResetZoom:x,onSetZoom:k,onIncludeInChat:g,onOpenExternal:f,openExternalLabel:"Buka di tab baru",openExternalTitle:"Buka di tab baru (untuk situs yang menolak iframe)",children:m("div",{className:"flex items-center flex-1 min-w-0 space-x-1.5",children:[T,m("form",{className:`flex-1 min-w-0 flex items-center bg-canvas border rounded-md px-2 py-0.5 space-x-1 focus-within:border-ink/40 ${r?"border-error":"border-ink/15"}`,onSubmit:(E)=>{E.preventDefault(),u(t)},children:[m(Pa,{size:12,className:"text-ink/40 flex-shrink-0"}),m("input",{type:"text",value:t,onChange:(E)=>l(E.currentTarget.value),placeholder:"Ketik alamat (mis. localhost:5173) lalu Enter…","aria-label":"Alamat browser pengguna","aria-invalid":r!==void 0&&r!==null,title:r??void 0,spellcheck:!1,autoComplete:"off",className:`w-full min-w-0 bg-transparent outline-none font-mono text-[11px] placeholder:text-ink/30 ${r?"text-error":"text-ink/90"}`})]})]})})}var $Br,V9e="p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors";var ttn=O(()=>{Je();pt();H9e();de();$Br={idle:"Kosong",loading:"Memuat",ready:"Siap"}});var ntn;var rtn=O(()=>{ntn={"desktop-16-9":"w-full max-w-[1280px] aspect-video max-h-full border border-ink/20 rounded-lg shadow-md overflow-hidden my-auto",laptop:"w-[1024px] max-w-full h-[768px] max-h-full border border-ink/20 rounded-lg shadow-md overflow-hidden my-auto",tablet:"w-[768px] max-w-full h-[1024px] max-h-full border border-ink/20 rounded-lg shadow-md overflow-hidden my-auto",mobile:"w-[375px] max-w-full h-[667px] max-h-full border border-ink/20 rounded-xl shadow-md overflow-hidden my-auto","mobile-lg":"w-[414px] max-w-full h-[896px] max-h-full border border-ink/20 rounded-xl shadow-md overflow-hidden my-auto",responsive:"w-full h-full border-0"}});function atn({url:e,frameKey:t,loading:n,viewportMode:r,zoomLevel:a,onLoad:i,active:o=!0}){if(!o)return null;if(!e)return m("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center select-none",children:[m("div",{className:"w-12 h-12 rounded-xl bg-ink/5 border border-ink/10 flex items-center justify-center text-ink/40 mb-3",children:m(Pa,{size:22})}),m("h3",{className:"text-sm font-semibold text-ink mb-1",children:"Browser Anda"}),m("p",{className:"text-xs text-ink/60 max-w-sm",children:"Ketik alamat di atas lalu Enter. Halaman dimuat langsung di panel ini."}),m("p",{className:"text-[11px] text-ink/45 max-w-sm mt-2",children:"Sebagian situs (Google, GitHub) menolak ditampilkan dalam iframe — pakai tombol buka di tab baru."})]});return m("div",{className:"flex-1 min-h-0 relative flex items-center justify-center p-2 overflow-auto bg-canvas/60",children:[n?m("div",{className:"absolute inset-0 z-10 flex items-center justify-center pointer-events-none",children:m("div",{className:"flex items-center space-x-2 px-3 py-1.5 rounded-md bg-paper border border-ink/15",children:[m(nn,{size:13,className:"animate-spin text-ink/50"}),m("span",{className:"text-[11px] font-mono text-ink/60",children:"Memuat…"})]})}):null,m("div",{className:`relative flex flex-col bg-white ${ntn[r]} transition-all duration-200`,style:{zoom:a!==100?`${a}%`:void 0,transformOrigin:"top center"},children:m("iframe",{src:e,title:"Browser pengguna",onLoad:i,referrerPolicy:"no-referrer",allow:OBr,className:"w-full h-full bg-white border-0"},t)})]})}var OBr="clipboard-read; clipboard-write; fullscreen";var itn=O(()=>{pt();rtn();de()});function otn(e){let t=e.trim();if(!t)return t;let n=/^[a-z][a-z0-9+.-]*:/i.test(t)?t:`https://${t}`,r=new URL(n);if(r.protocol!=="http:"&&r.protocol!=="https:")throw Error("Only http and https URLs are allowed");return r.toString()}function stn(){let[e,t]=qn(FBr,[]),[n,r]=qn(BBr,-1),[a,i]=qn(zBr,""),[o,s]=ae(0),[l,u]=ae(!1),[d,p]=ae(void 0),h=n>=0&&n<e.length?e[n]??"":"",f=Le((x)=>{let k=x.trim();if(!k)return;let C;try{C=otn(k)}catch(T){p(T instanceof Error?T.message:"Alamat tidak valid");return}p(void 0),u(!0);let w=[...e.slice(0,n+1),C];t(w),r(w.length-1),i(C),s((T)=>T+1)},[e,n,t,r,i]),g=Le(()=>{if(n<=0)return;u(!0),r(n-1)},[n,r]),b=Le(()=>{if(n>=e.length-1)return;u(!0),r(n+1)},[e.length,n,r]),y=Le(()=>{if(!h)return;u(!0),s((x)=>x+1)},[h]),v=Le(()=>{u(!1)},[]);return{url:h,input:a,setInput:i,frameKey:o,loading:l,error:d,canGoBack:n>0,canGoForward:n>=0&&n<e.length-1,submit:f,goBack:g,goForward:b,reload:y,markLoaded:v}}var FBr="userBrowser.history",BBr="userBrowser.historyIndex",zBr="userBrowser.inputUrl";var ltn=O(()=>{Je();Yi()});function Vae(e){if(typeof window>"u")return;window.dispatchEvent(new CustomEvent("omp:browser-include-page",{detail:e}))}var Z9e="omp:browser-include-page";function jBr({className:e="",active:t=!0}){let[n,r]=qn("userBrowser.viewportMode","responsive"),[a,i]=qn("userBrowser.zoomLevel",100),{url:o,input:s,setInput:l,frameKey:u,loading:d,error:p,canGoBack:h,canGoForward:f,submit:g,goBack:b,goForward:y,reload:v,markLoaded:x}=stn(),k=Le(()=>{if(!o)return;window.open(o,"_blank","noopener,noreferrer")},[o]),C=Le(()=>{if(!o)return;Vae({url:o})},[o]);return m("div",{className:`flex flex-col h-full w-full bg-paper text-ink overflow-hidden ${e}`,children:[m(etn,{url:o,input:s,loading:d,error:p,canGoBack:h,canGoForward:f,viewportMode:n,zoomLevel:a,onInputChange:l,onSubmit:g,onBack:b,onForward:y,onReload:v,onOpenExternal:k,onIncludeInChat:C,onChangeViewport:r,onZoomIn:()=>i((_)=>Math.min(200,_+10)),onZoomOut:()=>i((_)=>Math.max(50,_-10)),onResetZoom:()=>i(100),onSetZoom:i}),m(atn,{url:o,frameKey:u,loading:d,viewportMode:n,zoomLevel:a,onLoad:x,active:t})]})}var ctn=O(()=>{Je();ttn();itn();ltn();Yi();de()});function utn({url:e,status:t,zoomLevel:n=100,onIncludeInChat:r,onReconnect:a,onOpenExternal:i,onZoomIn:o,onZoomOut:s,onResetZoom:l}){return m(Hae,{url:e??"",statusDotClass:t==="live"?"bg-success animate-pulse":"bg-ink/25",statusLabel:UBr[t],zoomLevel:n,onZoomIn:o,onZoomOut:s,onResetZoom:l,onIncludeInChat:r,onOpenExternal:i,openExternalLabel:"Buka di jendela baru",openExternalTitle:e?"Open in new window":"No URL loaded",trailingControls:m("button",{type:"button",onClick:a,"aria-label":"Sambungkan ulang live view",title:"Reconnect live view",className:Az,children:m(Rg,{size:14})}),children:m("div",{className:"flex-1 min-w-0 flex items-center bg-canvas border border-ink/15 rounded-md px-2 py-0.5",children:[m(Pa,{size:12,className:"text-ink/40 mr-1.5 flex-shrink-0"}),m("span",{className:"w-full truncate text-ink/80 font-mono text-[11px]",title:e??"",children:e||"Agent belum membuka halaman"})]})})}var UBr;var dtn=O(()=>{pt();H9e();de();UBr={live:"Live","agent-offline":"Agent offline","browser-offline":"Browser offline","no-tab":"Tanpa tab"}});function ptn({actions:e}){if(e.length===0)return null;return m("div",{className:"absolute bottom-3 left-3 z-20 flex flex-col gap-1.5 pointer-events-none max-w-[320px]",children:e.map((t)=>{let n=qBr[t.kind],r=t.kind==="error";return m("div",{className:`flex items-center gap-2 rounded-md border px-2.5 py-1.5 text-[11px] shadow-sm backdrop-blur-sm ${r?"border-error/30 bg-error/10 text-error":"border-ink/15 bg-paper/95 text-ink"}`,children:[m(n,{size:12,className:`flex-shrink-0 ${r?"text-error":"text-ink/60"}`}),m("span",{className:"truncate",children:t.label})]},t.id)})})}var qBr;var mtn=O(()=>{pt();de();qBr={open:Pa,navigate:Pa,loaded:Ur,click:wN,type:Pg,press:Du,submit:Ng,wait:sf,screenshot:_d,scroll:CN,upload:A5,close:Nu,error:Nu}});function htn({status:e,url:t,tabs:n,targetId:r,frameSrc:a,actions:i,onSelectTarget:o,zoomLevel:s}){let l=e==="live",u=l?null:WBr[e];return m("div",{className:"flex-1 flex flex-col min-h-0 bg-canvas/60 relative overflow-hidden",children:[m(ptn,{actions:i}),l&&n.length>1&&m("div",{className:"px-2 py-1 border-b border-ink/10 bg-paper flex items-center gap-1 overflow-x-auto flex-shrink-0",children:n.map((d)=>{let p=d.targetId===r;return m("button",{type:"button",onClick:()=>o(p?"":d.targetId),className:`px-2 py-0.5 rounded text-[11px] font-mono max-w-[220px] truncate border transition-colors cursor-pointer ${p?"bg-ink text-canvas border-ink":"bg-paper text-ink/70 border-ink/15 hover:border-ink/35 hover:text-ink"}`,title:d.url||d.title||d.targetId,children:d.title||d.url||d.targetId},d.targetId)})}),m("div",{className:"flex-1 flex items-center justify-center p-2 min-h-0 overflow-auto",children:l?m("div",{className:"relative flex flex-col bg-paper w-full h-full transition-all duration-200",style:{zoom:s!==100?`${s}%`:void 0,transformOrigin:"top center"},children:a?m("img",{src:a,alt:t||"Live browser view",className:"w-full h-full object-contain bg-paper",draggable:!1}):m("div",{className:"w-full h-full flex flex-col items-center justify-center text-center p-6 select-none",children:[m(nn,{size:20,className:"animate-spin text-ink/40 mb-2"}),m("p",{className:"text-xs text-ink/60",children:"Menunggu frame pertama dari browser…"})]})}):m("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center select-none my-auto",children:[m("div",{className:"w-12 h-12 rounded-xl bg-ink/5 border border-ink/10 flex items-center justify-center text-ink/40 mb-3",children:e==="agent-offline"?m(Zy,{size:24}):m(Pa,{size:24})}),m("h3",{className:"text-sm font-semibold text-ink mb-1",children:u?.title}),m("p",{className:"text-xs text-ink/60 max-w-sm",children:u?.body})]})})]})}var WBr;var ftn=O(()=>{pt();mtn();de();WBr={"agent-offline":{title:"Agent belum berjalan",body:"Aktifkan sesi ini agar browser bisa dikendalikan agent."},"browser-offline":{title:"Belum ada browser aktif",body:"Minta agent membuka sebuah halaman; tampilan live akan muncul di sini."},"no-tab":{title:"Browser aktif, belum ada tab",body:"Sesi ini belum membuka tab di browser bersama."}}});function vtn(e=!0){let{sessionId:t,ready:n}=rl(),[r,a]=ae(gtn),[i,o]=ae(void 0),[s,l]=ae([]),[u,d]=ae(""),[p,h]=ae(0),f=Re(null),g=Re(null),b=Re(void 0),y=Re(0),v=Re([]),x=Le((C)=>{d(C.trim())},[]),k=Le(()=>{h((C)=>C+1)},[]);return Ee(()=>{let C=setInterval(()=>{l((_)=>{let w=Date.now(),T=_.filter((L)=>L.expiresAt>w),E=v.current.shift();if(!E)return T.length===_.length?_:T;return[...T.slice(-(VBr-1)),{...E,expiresAt:w+GBr}]})},HBr);return()=>clearInterval(C)},[]),Ee(()=>{a(gtn),o(void 0),d(""),v.current=[],l([])},[t]),Ee(()=>{if(!n||!t||!e)return;let C=!1,_=()=>{if(C)return;let T=u?`?target=${encodeURIComponent(u)}`:"",E=new EventSource(`/api/browser/${encodeURIComponent(t)}/stream${T}`);f.current=E,E.addEventListener("open",()=>{y.current=0}),E.addEventListener("state",(L)=>{try{let P=JSON.parse(L.data);if(P.targetId!==b.current)o(void 0);if(b.current=P.targetId,a(P),P.status!=="live")o(void 0)}catch{}}),E.addEventListener("frame",(L)=>{try{let P=JSON.parse(L.data),R=b.current;if(R&&P.targetId&&P.targetId!==R)return;o(`data:${P.mimeType};base64,${P.data}`)}catch{}}),E.addEventListener("action",(L)=>{try{let P=JSON.parse(L.data);if(typeof P?.label!=="string"||!P.label)return;if(v.current.push(P),v.current.length>ytn)v.current.splice(0,v.current.length-ytn)}catch{}}),E.addEventListener("error",()=>{if(E.readyState===EventSource.CLOSED)w()})},w=()=>{if(C||g.current)return;let T=Math.min(y.current+1,btn/1000);y.current=T,g.current=setTimeout(()=>{g.current=null,f.current?.close(),f.current=null,_()},Math.min(T*1000,btn))};return _(),()=>{if(C=!0,g.current)clearTimeout(g.current),g.current=null;f.current?.close(),f.current=null}},[n,t,u,p,e]),{status:r.status,url:r.url,title:r.title,tabs:r.tabs,targetId:r.targetId,frameSrc:i,actions:s,selectTarget:x,reconnect:k}}var gtn,btn=5000,GBr=4000,HBr=500,VBr=3,ytn=16;var xtn=O(()=>{Je();Kh();gtn={status:"agent-offline",tabs:[]}});function ZBr({className:e="",active:t=!0}){let[n,r]=qn("browser.zoomLevel",100),{status:a,url:i,title:o,tabs:s,targetId:l,frameSrc:u,actions:d,selectTarget:p,reconnect:h}=vtn(t),f=()=>{if(!i)return;let b=i.startsWith("/")&&typeof window<"u"?`${window.location.origin}${i}`:i;window.open(b,"_blank","noopener,noreferrer")},g=Le(()=>{if(!i)return;Vae({url:i,title:o})},[i,o]);return m("div",{className:`flex flex-col h-full w-full bg-paper text-ink overflow-hidden select-none ${e}`,children:[m(utn,{url:i,status:a,zoomLevel:n,onIncludeInChat:g,onReconnect:h,onOpenExternal:f,onZoomIn:()=>r((b)=>Math.min(200,b+10)),onZoomOut:()=>r((b)=>Math.max(50,b-10)),onResetZoom:()=>r(100)}),m(htn,{status:a,url:i,tabs:s,targetId:l,frameSrc:u,actions:d,onSelectTarget:p,zoomLevel:n})]})}var ktn=O(()=>{Je();dtn();ftn();xtn();Yi();de()});function _tn({providerName:e,credentialSources:t,error:n,note:r,children:a}){return m("section",{className:"bg-paper border border-ink/15 rounded-lg shadow-xs",children:[m("header",{className:"flex items-center justify-between gap-2 px-3.5 py-2.5 border-b border-ink/10",children:[m("span",{className:"text-xs font-semibold text-ink",children:e}),m("span",{className:"text-[10px] font-mono uppercase tracking-wider text-ink/50 truncate",title:`Credentials from ${t.join(", ")}`,children:t.join(" · ")})]}),m("div",{className:"p-3.5 space-y-4",children:[n&&m("p",{className:"flex items-start gap-2 text-error text-xs leading-relaxed",children:[m(Qn,{size:14,className:"shrink-0 mt-0.5"}),m("span",{className:"break-words",children:n})]}),a,r&&m("p",{className:"text-[10px] text-ink/50 leading-relaxed border-t border-ink/10 pt-2.5",children:r})]})]})}var wtn=O(()=>{pt();de()});function H0(e){return KBr.format(e)}function my(e){return YBr.format(e)}function V0(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;return XBr.format(t)}function Ctn(e,t){if(t<=0)return 0;return Math.min(100,Math.max(0,e/t*100))}function Stn(e,t){if(t<=0)return"0%";return`${new Intl.NumberFormat("id-ID",{maximumFractionDigits:1}).format(e/t*100)}%`}function $4(e){if(!Number.isFinite(e))return"0";let t=Math.abs(e);if(t>=1e9)return`${K9e.format(e/1e9)}B`;if(t>=1e6)return`${K9e.format(e/1e6)}M`;if(t>=1000)return`${K9e.format(e/1000)}K`;return my(e)}function aL(e){let t=Number(e);if(e.trim()===""||!Number.isFinite(t))return e;return my(t)}function Y9e(e){if(!Number.isFinite(e))return"$0,00";return`$${JBr.format(e)}`}function Zae(e,t){if(!Number.isFinite(e))return"—";switch(t){case"percent":return`${new Intl.NumberFormat("id-ID",{maximumFractionDigits:1}).format(e)}%`;case"usd":return Y9e(e);case"tokens":case"bytes":return $4(e);default:return my(e)}}function Ttn(e){if(!Number.isFinite(e))return"0%";return`${new Intl.NumberFormat("id-ID",{maximumFractionDigits:1}).format(e*100)}%`}var KBr,YBr,K9e,XBr,JBr;var hy=O(()=>{KBr=new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR",maximumFractionDigits:0}),YBr=new Intl.NumberFormat("id-ID"),K9e=new Intl.NumberFormat("id-ID",{minimumFractionDigits:2,maximumFractionDigits:2,useGrouping:!1}),XBr=new Intl.DateTimeFormat("id-ID",{dateStyle:"medium",timeStyle:"short"});JBr=new Intl.NumberFormat("id-ID",{minimumFractionDigits:2,maximumFractionDigits:2})});function QBr({window:e}){let t=e.usedRp+e.remainingRp,n=Ctn(e.usedRp,t);return m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs space-y-2",children:[m("div",{className:"flex items-center justify-between gap-2",children:[m("span",{className:"text-[11px] font-semibold text-ink",children:e.label}),m("span",{className:"text-[10px] text-ink/50",children:["Resets ",V0(e.resetsAt)]})]}),m("div",{className:"h-1.5 w-full bg-ink/10 rounded-full overflow-hidden",children:m("div",{className:"h-full bg-ink/80 rounded-full",style:{width:`${n}%`}})}),m("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-0.5 text-[10px] text-ink/60",children:[m("span",{children:["Used ",m("span",{className:"font-semibold text-ink",children:H0(e.usedRp)})," ·"," ",Stn(e.usedRp,t)]}),m("span",{children:["Remaining ",m("span",{className:"font-semibold text-ink",children:H0(e.remainingRp)})]})]})]})}function ezr({coupon:e}){return m("div",{className:"bg-ink/5 border border-ink/10 rounded-lg p-3 shadow-xs",children:[m("div",{className:"flex items-center gap-1.5 mb-1.5",children:[m(BN,{size:12,className:"text-ink/60"}),m("span",{className:"text-[11px] font-semibold text-ink",children:["Active coupon · ",e.name]})]}),m("div",{className:"text-[10px] text-ink/60 space-y-0.5",children:[m("div",{children:["Remaining"," ",m("span",{className:"font-semibold text-ink",children:e.remainingRp===null?"Unlimited":H0(e.remainingRp)})," ","· Used ",m("span",{className:"font-semibold text-ink",children:H0(e.usedRp)})]}),m("div",{children:["Expires ",V0(e.expiresAt)]}),e.scopeModels.length>0&&m("div",{children:["Models: ",e.scopeModels.join(", ")]})]})]})}function Etn({quota:e}){if(!e)return m("p",{className:"text-[11px] text-ink/50",children:"Quota data is not available for this account."});return m("div",{className:"space-y-2",children:[m("div",{className:"flex items-center justify-between gap-2",children:[m("h4",{className:"text-[10px] font-mono font-semibold uppercase tracking-wider text-ink/40",children:"Quota windows"}),e.planName&&m("span",{className:"text-[10px] text-ink/60",children:["Plan ",m("span",{className:"font-semibold text-ink",children:e.planName})]})]}),e.windows.length===0?m("p",{className:"text-[11px] text-ink/50",children:"No quota windows reported."}):m("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2.5",children:e.windows.map((t)=>m(QBr,{window:t},t.key))}),e.coupon&&m(ezr,{coupon:e.coupon})]})}var Atn=O(()=>{pt();hy();de()});function Ltn({usage:e}){if(!e)return m("p",{className:"text-[11px] text-ink/50",children:"The 30-day usage report is not available."});let t=e.rows.reduce((r,a)=>r+a.inputTokens,0),n=e.rows.reduce((r,a)=>r+a.outputTokens,0);return m("div",{className:"space-y-2",children:[m("h4",{className:"text-[10px] font-mono font-semibold uppercase tracking-wider text-ink/40",children:"30-day usage by model"}),m("div",{className:"overflow-x-auto border border-ink/15 rounded-lg shadow-xs",children:m("table",{className:"w-full text-[11px]",children:[m("thead",{className:"bg-ink/5 text-ink/60",children:m("tr",{children:[m("th",{className:"text-left font-semibold px-3 py-2 whitespace-nowrap",children:"Model"}),m("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Requests"}),m("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Input tokens"}),m("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Output tokens"}),m("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Cost"})]})}),m("tbody",{className:"divide-y divide-ink/10",children:e.rows.length===0?m("tr",{children:m("td",{colSpan:5,className:"px-3 py-3 text-center text-ink/50",children:"No usage recorded in the last 30 days."})}):e.rows.map((r)=>m("tr",{children:[m("td",{className:"px-3 py-1.5 font-mono text-ink whitespace-nowrap",children:r.model}),m("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:my(r.requests)}),m("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:$4(r.inputTokens)}),m("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:$4(r.outputTokens)}),m("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:H0(r.costRp)})]},r.model))}),m("tfoot",{className:"bg-ink/5 border-t border-ink/15 font-semibold text-ink",children:m("tr",{children:[m("td",{className:"px-3 py-2",children:"Total"}),m("td",{className:"px-3 py-2 text-right tabular-nums",children:my(e.totalRequests)}),m("td",{className:"px-3 py-2 text-right tabular-nums",children:$4(t)}),m("td",{className:"px-3 py-2 text-right tabular-nums",children:$4(n)}),m("td",{className:"px-3 py-2 text-right tabular-nums",children:H0(e.totalCostRp)})]})})]})})]})}var Rtn=O(()=>{hy();de()});function Ntn({report:e}){let{balance:t,usage:n,quota:r}=e;if(!t&&!n&&!r)return m("p",{className:"text-[11px] text-ink/50",children:"No kenari data was returned for this account."});let a=t?t.amountRp!==null?H0(t.amountRp):t.raw:"—",i=t?t.amountRp!==null?t.raw:"Amount could not be parsed":"Balance unavailable",o=n?n.rows.reduce((s,l)=>s+l.inputTokens+l.outputTokens,0):0;return m(kt,{children:[m("div",{className:"@container",children:m("div",{className:"grid grid-cols-3 @[540px]:grid-cols-5 gap-2.5 items-stretch",children:[m(xo,{value:a,label:"Wallet balance",hint:i}),m(xo,{value:r?.planName??"—",label:"Active plan",hint:r?"kenari quota plan":"Quota unavailable"}),m(xo,{value:n?my(n.totalRequests):"—",label:"Requests (30 days)",hint:n?"Across all models":"Usage report unavailable"}),m(xo,{value:n?H0(n.totalCostRp):"—",label:"Cost (30 days)",hint:n?"Billed in Rupiah":"Usage report unavailable"}),m(xo,{value:n?$4(o):"—",label:"Tokens processed (30 days)",hint:n?"Input + output":"Usage report unavailable",tone:"muted",className:"col-span-2 @[540px]:col-span-1"})]})}),m(Etn,{quota:r}),m(Ltn,{usage:n})]})}var Itn=O(()=>{D9();Atn();Rtn();hy();de()});function Mtn({report:e}){let t=e.balance;if(!t)return m("p",{className:"text-[11px] text-ink/50",children:"DeepSeek balance data is not available."});return m(kt,{children:[m("div",{className:"@container",children:m("div",{className:"grid grid-cols-3 @[540px]:grid-cols-5 gap-2.5 items-stretch",children:[m(xo,{value:t.isAvailable?"Available":"Unavailable",label:"Prepaid balance",hint:t.isAvailable?"Account can spend":"Top up required",tone:t.isAvailable?"default":"muted"}),m(xo,{value:my(t.entries.length),label:"Currency buckets",hint:t.entries.length>0?"From the balance endpoint":"No entries returned",tone:"muted"})]})}),t.entries.length===0?m("p",{className:"text-[11px] text-ink/50",children:"The balance endpoint returned no currency entries."}):m("div",{className:"grid grid-cols-1 gap-2.5",children:t.entries.map((n)=>m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs",children:[m("div",{className:"flex items-center justify-between gap-2 mb-2",children:[m("span",{className:"text-[11px] font-semibold text-ink",children:n.currency}),m("span",{className:"text-[10px] font-mono uppercase tracking-wider text-ink/40",children:"Balance"})]}),m("dl",{className:"grid grid-cols-3 gap-2 text-[10px]",children:[m("div",{children:[m("dt",{className:"text-ink/50",children:"Total"}),m("dd",{className:"font-semibold text-ink tabular-nums break-words",children:aL(n.totalBalance)})]}),m("div",{children:[m("dt",{className:"text-ink/50",children:"Granted"}),m("dd",{className:"font-semibold text-ink tabular-nums break-words",children:aL(n.grantedBalance)})]}),m("div",{children:[m("dt",{className:"text-ink/50",children:"Topped up"}),m("dd",{className:"font-semibold text-ink tabular-nums break-words",children:aL(n.toppedUpBalance)})]})]})]},n.currency))})]})}var Ptn=O(()=>{D9();hy();de()});function tzr({limit:e}){let t=Math.min(100,Math.max(0,(e.usedFraction??0)*100)),n=e.modelId??e.accountId,r=e.used!==void 0?Zae(e.used,e.unit):void 0,a=e.limit!==void 0?Zae(e.limit,e.unit):void 0,i=e.remaining!==void 0?Zae(e.remaining,e.unit):void 0;return m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs space-y-2",children:[m("div",{className:"flex items-start justify-between gap-2",children:[m("div",{className:"min-w-0",children:[m("div",{className:"text-[11px] font-semibold text-ink truncate",children:e.label}),n&&m("div",{className:"text-[10px] text-ink/50 truncate",children:n})]}),m("span",{className:"text-[10px] text-ink/50 flex-shrink-0 whitespace-nowrap",children:e.resetsAt!==void 0?`Resets ${V0(new Date(e.resetsAt).toISOString())}`:""})]}),m("div",{className:"h-1.5 w-full bg-ink/10 rounded-full overflow-hidden",children:m("div",{className:`h-full rounded-full ${e.status==="exhausted"?"bg-error/70":"bg-ink/80"}`,style:{width:`${t}%`}})}),m("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-0.5 text-[10px] text-ink/60",children:[m("span",{children:["Used"," ",m("span",{className:"font-semibold text-ink",children:e.unit==="percent"||!r?Ttn(e.usedFraction??0):r}),e.unit!=="percent"&&r&&a?` of ${a}`:""]}),m("span",{className:"flex items-center gap-2",children:[e.status!=="ok"&&e.status!=="unknown"&&m("span",{className:"text-[10px] font-mono uppercase px-1.5 py-0.5 rounded bg-ink/10 text-ink/70",children:e.status}),i&&m("span",{children:["Remaining ",m("span",{className:"font-semibold text-ink",children:i})]})]})]}),e.notes&&e.notes.length>0&&m("ul",{className:"text-[10px] text-ink/50 leading-relaxed space-y-0.5",children:e.notes.map((o)=>m("li",{children:o},o))})]})}function Dtn({limits:e,tracked:t,unavailable:n,notes:r}){return m("div",{className:"space-y-2",children:[m("h4",{className:"text-[10px] font-mono font-semibold uppercase tracking-wider text-ink/40",children:"Quota windows"}),r&&r.length>0&&m("ul",{className:"text-[10px] text-ink/50 leading-relaxed space-y-0.5",children:r.map((a)=>m("li",{children:a},a))}),e.length===0?m("p",{className:"text-[11px] text-ink/50",children:!t?"No quota source for this provider: omp ships no usage adapter for it and it exposes no balance endpoint Kabmo knows.":n?"omp tracks this provider but its usage endpoint returned no data — an invalid or expired credential, an unreachable endpoint, or a plan without quota windows.":"No quota windows were reported for this provider."}):m("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2.5",children:e.map((a)=>m(tzr,{limit:a},a.id))})]})}var $tn=O(()=>{hy();de()});function Kae({summary:e}){let t=Boolean(e.kenari||e.deepseek);return m(_tn,{providerName:e.name,credentialSources:e.credentialSources,error:e.error,note:e.deepseek?nzr:void 0,children:[e.kenari&&m(Ntn,{report:e.kenari}),e.deepseek&&m(Mtn,{report:e.deepseek}),!t&&(e.limits.length>0||!e.error)&&m(Dtn,{limits:e.limits,tracked:e.tracked,unavailable:e.limitsUnavailable,notes:e.notes})]})}var nzr="DeepSeek exposes no usage or quota API — only the prepaid balance (and the web console at platform.deepseek.com) is available.";var X9e=O(()=>{wtn();Itn();Ptn();$tn();de()});function rzr(e){let t=e.filter((a)=>a.usedFraction!==void 0);if(t.length===0){let a=e.find((i)=>i.unit==="usd"&&i.remaining!==void 0);if(a)return`${Y9e(a.remaining??0)} left`;return e[0]?.label}let n=t.reduce((a,i)=>(i.usedFraction??0)>(a.usedFraction??0)?i:a),r=Math.round((n.usedFraction??0)*100);return n.windowLabel?`${r}% · ${n.windowLabel}`:`${r}% used`}function iL(e){return e.providers.map((t)=>({id:t.id,name:t.name,error:t.error,hint:azr(t),limits:t.limits,tracked:t.tracked,limitsUnavailable:t.limitsUnavailable,summary:t}))}function azr(e){let t=e.kenari?.quota?.planName;if(t)return t;let n=e.deepseek?.balance?.entries[0];if(n)return`${n.currency} ${aL(n.totalBalance)}`;return rzr(e.limits)??"No quota reported"}function oL(e){return e.error?"Error":"Connected"}var Lz=O(()=>{hy()});function Ftn({providers:e,value:t,onChange:n}){let[r,a]=ae(!1),[i,o]=ae(""),[s,l]=ae(0),u=Re(null),d=Re(null),p=Re(null),h=Re([]),f=e.find((k)=>k.id===t)??e[0],g=ut(()=>{let k=i.trim().toLowerCase();if(!k)return e;return e.filter((C)=>`${C.name} ${oL(C)} ${C.hint}`.toLowerCase().includes(k))},[e,i]),b=()=>{let k=Math.max(0,e.findIndex((C)=>C.id===t));o(""),l(k),a(!0)},y=(k=!1)=>{if(a(!1),o(""),k)d.current?.focus()},v=(k)=>{n(k),y(!0)};return Ee(()=>{if(!r)return;h.current[s]?.scrollIntoView({block:"nearest"})},[r,s]),Yr(u,()=>a(!1)),m("div",{className:"relative min-w-0",ref:u,onKeyDown:(k)=>{let C=k.target===p.current;if(!r){if(k.key==="ArrowDown"||k.key==="Enter"||k.key===" ")k.preventDefault(),b();return}switch(k.key){case"Escape":k.preventDefault(),y(!0);break;case"ArrowDown":k.preventDefault(),l((_)=>Math.max(0,Math.min(g.length-1,_+1)));break;case"ArrowUp":k.preventDefault(),l((_)=>Math.max(0,_-1));break;case"Home":k.preventDefault(),l(0);break;case"End":k.preventDefault(),l(Math.max(0,g.length-1));break;case"Enter":if(k.preventDefault(),g[s])v(g[s].id);break;case" ":if(C)return;if(k.preventDefault(),g[s])v(g[s].id);break;default:break}},children:[m("button",{ref:d,type:"button",onClick:()=>r?y():b(),"aria-haspopup":"listbox","aria-expanded":r,"aria-controls":Otn,title:"Select usage provider",className:"flex w-full min-w-0 items-center justify-between gap-2 bg-paper border border-ink/15 rounded-lg px-3 py-1.5 text-xs text-ink hover:bg-ink/5 transition-colors",children:[m("span",{className:"flex min-w-0 items-center gap-2",children:[f&&m(To,{slug:f.id,name:f.name,size:13,className:"text-ink/60"}),m("span",{className:"truncate font-medium",children:f?.name??"Select provider"}),f&&m("span",{className:"truncate text-[10px] text-ink/50",children:oL(f)})]}),m(Zn,{size:12,className:`flex-shrink-0 text-ink/40 transition-transform ${r?"rotate-180":""}`})]}),r&&m("div",{className:"absolute top-full left-0 mt-1 w-52 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs",children:[m("div",{className:"px-2 py-1.5 border-b border-ink/10 flex items-center gap-1.5",children:[m(na,{size:11,className:"text-ink/40 flex-shrink-0"}),m("input",{ref:p,type:"text",value:i,onChange:(k)=>{o(k.currentTarget.value),l(0)},placeholder:"Search providers...",title:"Search providers",className:"w-full min-w-0 bg-transparent outline-none text-xs text-ink placeholder-ink/40",autoFocus:!0}),i&&m("button",{type:"button",onClick:()=>{o(""),l(0),p.current?.focus()},title:"Clear search",className:"text-ink/40 hover:text-ink flex-shrink-0",children:"×"})]}),m("div",{id:Otn,role:"listbox","aria-label":"Usage providers",className:"max-h-48 scrollbar-overlay-container py-1",children:g.length===0?m("div",{className:"px-3 py-2 text-ink/40 italic",children:"No providers found"}):g.map((k,C)=>m("button",{ref:(_)=>{h.current[C]=_},type:"button",role:"option","aria-selected":k.id===t,onClick:()=>v(k.id),onMouseEnter:()=>l(C),title:k.hint,className:`w-full text-left px-3 py-2 flex items-center justify-between gap-2 transition-colors ${C===s?"bg-ink/5":"hover:bg-ink/5"}`,children:[m("span",{className:"flex min-w-0 items-center gap-2",children:[m(To,{slug:k.id,name:k.name,size:14,className:"text-ink/60"}),m("span",{className:"min-w-0",children:[m("span",{className:"block truncate font-medium text-ink",children:k.name}),m("span",{className:"block truncate text-[10px] text-ink/50",children:[oL(k)," · ",k.hint]})]})]}),k.id===t&&m(Xt,{size:12,className:"flex-shrink-0 text-ink"})]},k.id))})]})]})}var Otn="usage-provider-listbox";var Btn=O(()=>{Je();pt();Lz();mh();So();de()});function ztn(){let[e,t]=ae([]),[n,r]=ae(null),[a,i]=ae(!0),o=Le(()=>{i(!0),fetch("/api/settings/usage/reset").then((l)=>l.json()).then((l)=>{t(Array.isArray(l.accounts)?l.accounts:[]),r(typeof l.error==="string"?l.error:null)}).catch((l)=>{t([]),r(l instanceof Error?l.message:"Failed to load saved resets")}).finally(()=>i(!1))},[]);Ee(()=>{o()},[o]);let s=Le(async(l)=>{try{let d=await(await fetch("/api/settings/usage/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:l})})).json();if(d.ok)o();return{ok:Boolean(d.ok),message:d.message||"No result reported."}}catch(u){return{ok:!1,message:u instanceof Error?u.message:"Failed to spend the saved reset"}}},[o]);return{accounts:e,error:n,isLoading:a,reload:o,spend:s}}var jtn=O(()=>{Je()});function izr({account:e,onSpend:t,spending:n}){let r=`${e.provider}/${e.credentialId}`,a=e.email??e.accountId??e.credentialId,i=e.orgName??e.orgId,o=e.availableCount??e.credits.length,s=e.redeemableCount??0,l=e.error??e.unavailableReason;return m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs space-y-2",children:[m("div",{className:"flex items-start justify-between gap-2",children:[m("div",{className:"min-w-0",children:[m("div",{className:"text-[11px] font-semibold text-ink truncate",children:[a,i?m("span",{className:"text-ink/50 font-normal",children:[" · ",i]}):null]}),m("div",{className:"text-[10px] text-ink/50 font-mono truncate",children:r})]}),m("span",{className:"text-[10px] text-ink/60 flex-shrink-0 whitespace-nowrap",children:s>0?`${s} of ${o} usable`:`${o} saved`})]}),e.soonestExpiry!==void 0&&m("div",{className:"text-[10px] text-ink/60",children:["Soonest expires ",V0(new Date(e.soonestExpiry).toISOString())]}),e.credits.length>0&&m("div",{className:"space-y-1",children:e.credits.map((u)=>m("div",{className:"flex items-center justify-between gap-2 text-[10px] text-ink/70",children:[m("span",{className:"truncate",children:u.title??u.program??u.id}),m("span",{className:"flex items-center gap-1.5 flex-shrink-0",children:[u.clears&&u.clears.length>0&&m("span",{className:"font-mono text-ink/50",children:u.clears.join(", ")}),u.usable===!1&&m("span",{className:"font-mono uppercase px-1.5 py-0.5 rounded bg-ink/10 text-ink/60",children:"blocked"})]})]},u.id))}),l&&m("div",{className:"text-[10px] text-ink/60 leading-snug",children:l}),m("button",{type:"button",onClick:()=>t(r),disabled:n||s===0,title:s===0?l??"Nothing to spend on this account right now.":`Spend a saved reset on ${r}`,className:"w-full rounded-md border border-ink/15 px-2 py-1 text-[11px] font-medium text-ink/80 hover:bg-ink/5 transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",children:n?"Spending…":"Spend saved reset"})]})}function Yae(){let{accounts:e,error:t,isLoading:n,reload:r,spend:a}=ztn(),[i,o]=ae(null),[s,l]=ae(null),u=(p)=>{o(p),l(null),a(p).then((h)=>{l(h),o(null)})},d=!n&&!t&&e.length===0;return m("div",{className:"space-y-2",children:[m("div",{className:"flex items-center justify-between gap-2",children:[m("div",{className:"min-w-0",children:[m("div",{className:"text-[11px] font-semibold text-ink",children:"Saved rate-limit resets"}),m("div",{className:"text-[10px] text-ink/50 leading-snug",children:"Provider-issued resets for Codex and Claude accounts. Spending one clears the window it covers."})]}),m("button",{type:"button",onClick:r,disabled:n,title:"Re-read saved resets",className:"p-1.5 bg-paper border border-ink/15 rounded-md hover:bg-ink/5 text-ink/80 transition-colors disabled:opacity-50 flex-shrink-0",children:m(Mn,{size:12,className:n?"animate-spin text-ink":""})})]}),t&&m("div",{className:"flex items-start gap-1.5 text-[10px] text-error leading-snug",children:[m(Qn,{size:12,className:"flex-shrink-0 mt-px"}),m("span",{children:t})]}),e.map((p)=>m(izr,{account:p,onSpend:u,spending:i===`${p.provider}/${p.credentialId}`},`${p.provider}/${p.credentialId}`)),d&&m("p",{className:"text-[10px] text-ink/50 leading-snug",children:"No saved resets on any account."}),s&&m("div",{className:`text-[10px] leading-snug ${s.ok?"text-ink/70":"text-error"}`,children:s.message})]})}var J9e=O(()=>{Je();pt();hy();jtn();de()});function Utn(e,t){if(!e)return t;if(!t)return e;let n=Date.parse(e.generatedAt),r=Date.parse(t.generatedAt);if(Number.isNaN(n)||Number.isNaN(r))return e;return r>n?t:e}function Xae(){let[e,t]=ae(null),[n,r]=ae(!0),[a,i]=ae(null),o=Le(async(s)=>{if(!s?.silent)r(!0);i(null);try{let l=s?.force?"/api/settings/usage?refresh=1":"/api/settings/usage",u=await fetch(l);if(!u.ok)throw Error(`Usage request failed (${u.status})`);let d=await u.json();t(d)}catch(l){i(l instanceof Error?l.message:"Failed to load provider usage")}finally{if(!s?.silent)r(!1)}},[]);return Ee(()=>{o()},[o]),{report:e,isLoading:n,error:a,reload:o}}var Q9e=O(()=>{Je()});function ozr({className:e="",active:t=!0}){let{report:n,isLoading:r,error:a,reload:i}=Xae(),[o,s]=qn("usage.selectedProviderId",""),l=Ui(GBe,{enabled:t}),u=Utn(l.data,n),d=u?iL(u):[],p=d.find((h)=>h.id===o)??d[0];if(Ee(()=>{if(p&&p.id!==o)s(p.id)},[p,o,s]),a&&!u)return m("div",{className:`flex h-full w-full flex-col items-center justify-center gap-2 p-8 text-center text-xs ${e}`,children:[m(Qn,{size:16,className:"text-error"}),m("p",{className:"text-error text-xs",children:a}),m("button",{type:"button",onClick:()=>i(),className:"text-[11px] font-semibold text-ink/70 hover:text-ink underline underline-offset-2",children:"Try again"})]});if(!u)return m("div",{className:`flex h-full w-full items-center justify-center text-ink/40 text-xs ${e}`,children:"Loading provider usage..."});return m("div",{className:`flex h-full w-full min-w-0 min-h-0 flex-col overflow-hidden bg-paper text-xs text-ink ${e}`,children:[m("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex items-center justify-between gap-3 flex-shrink-0 min-w-0",children:[m("div",{className:"flex items-center gap-2 min-w-0",children:[m("h2",{className:"text-xs font-semibold text-ink uppercase tracking-wider",children:"Usage"}),m("span",{className:"text-[11px] text-ink/50 truncate",children:["Updated ",V0(u.generatedAt)]}),u.isMock&&m("span",{className:"text-[10px] font-mono uppercase tracking-wider bg-ink/5 border border-ink/15 rounded px-1.5 py-0.5 text-ink/60",children:"Mock"})]}),m("button",{type:"button",onClick:()=>i({force:!0}),disabled:r,className:"p-1.5 bg-paper border border-ink/15 rounded-md hover:bg-ink/5 text-ink/80 transition-colors disabled:opacity-50 flex-shrink-0",title:"Refresh usage",children:m(Mn,{size:12,className:r||l.refreshing?"animate-spin text-ink":""})})]}),d.length>0&&m("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex-shrink-0 min-w-0",children:m("div",{className:"flex items-center gap-2 min-w-0",children:[m("span",{className:"text-[11px] font-semibold text-ink/60 flex-shrink-0",children:"Provider"}),m(Ftn,{providers:d,value:p?.id??"",onChange:s})]})}),m("div",{className:"flex-1 min-w-0 min-h-0 w-full overflow-y-auto scrollbar-overlay-container p-3.5 space-y-4",children:[a&&m("p",{className:"text-error text-xs",children:a}),p?m(Kae,{summary:p.summary}):m("p",{className:"text-[11px] text-ink/50 leading-relaxed",children:"No provider credentials detected. Add an API key in Settings → Providers and it will appear here."}),m(Yae,{})]})]})}var qtn=O(()=>{Je();pt();X9e();Lz();hy();Btn();J9e();Q9e();Yi();cm();Ps();de()});function Gtn(e){return Wtn[e]??Wtn.pending}function Rz(e){if(e.total===0)return"No tasks";let t=[`${e.closed}/${e.total} done`];if(e.inProgress>0)t.push(`${e.inProgress} in progress`);if(e.blocked>0)t.push(`${e.blocked} blocked`);if(e.abandoned>0)t.push(`${e.abandoned} abandoned`);return t.join(" · ")}function Jae(e){if(e.total===0)return 0;return Math.round(e.closed/e.total*100)}function Htn(e){for(let t=0;t<e.length;t++){let n=e[t].tasks;for(let r=0;r<n.length;r++)if(n[r].status==="in_progress")return{phase:t,task:r}}for(let t=0;t<e.length;t++){let n=e[t].tasks;for(let r=0;r<n.length;r++)if(n[r].status==="pending")return{phase:t,task:r}}return null}function Qae(e){return e.tasks.filter((t)=>t.status==="completed"||t.status==="abandoned").length}function Vtn(e){let t=e.blocker?.trim()||e.details?.trim();return t?t:void 0}var Wtn;var Nz=O(()=>{Wtn={pending:{label:"Pending",tone:"text-ink/45",active:!1,closed:!1},in_progress:{label:"In progress",tone:"text-ink",active:!0,closed:!1},completed:{label:"Completed",tone:"text-success",active:!1,closed:!0},abandoned:{label:"Abandoned",tone:"text-error/70",active:!1,closed:!0},blocked:{label:"Blocked",tone:"text-warning",active:!1,closed:!1}}});function sL(e){let t=e.trim();if(!t.startsWith("{")||!t.endsWith("}"))return;let n;try{n=JSON.parse(t)}catch{return}if(!xn(n))return;let{phase:r,items:a}=n;if(typeof r!=="string"||r.trim()==="")return;if(!Array.isArray(a)||a.length===0)return;if(!a.every((i)=>typeof i==="string"))return;return{phase:r.trim(),items:a}}function eie(e){return e.replace(/\s*\((?:in progress|dropped|blocked(?::[^()]*)?)\)\s*$/i,"").trim()}var eLe=()=>{};function szr({status:e,className:t}){switch(e){case"completed":return m(Ur,{size:13,className:t});case"in_progress":return m(nn,{size:13,className:`${t} animate-spin`});case"abandoned":return m(op,{size:13,className:t});case"blocked":return m(Y2,{size:13,className:t});default:return m(Ry,{size:13,className:t})}}function tie({task:e,current:t}){let n=Gtn(e.status),r=Vtn(e),a=sL(e.content),i=a?a.phase:e.content,o=a?a.items:e.notes;return m("div",{className:`flex items-start gap-2.5 px-2.5 py-1.5 transition-colors ${t?"bg-ink/[0.04]":""}`,children:[m(szr,{status:e.status,className:`mt-[2px] shrink-0 ${n.tone}`}),m("div",{className:"min-w-0 flex-1",children:[m("div",{className:`text-[11.5px] leading-snug ${n.closed?"text-ink/40 line-through":n.active?"font-medium text-ink":"text-ink/75"}`,children:i}),o&&o.length>0&&m("ul",{className:"mt-0.5 space-y-0.5",children:o.map((s,l)=>m("li",{className:"text-[10.5px] leading-snug text-ink/55 break-words",children:["· ",s]},l))}),r&&m("div",{className:"mt-0.5 text-[10.5px] leading-snug text-warning/90 break-words",children:r})]}),n.active&&m("span",{className:"shrink-0 rounded bg-ink/8 px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wider text-ink/70",children:"Now"})]})}var tLe=O(()=>{pt();Nz();eLe();de()});function Ztn({phase:e,index:t,collapsed:n,currentKey:r,onToggle:a}){let i=Qae(e),o=e.tasks.length>0&&i===e.tasks.length;return m("div",{className:"overflow-hidden rounded-lg border border-ink/10 bg-paper",children:[m("button",{type:"button",onClick:a,"aria-expanded":!n,className:"flex w-full items-center gap-1.5 border-b border-ink/8 bg-canvas/40 px-2.5 py-1.5 text-left hover:bg-ink/5",children:[n?m(bi,{size:12,className:"shrink-0 text-ink/40"}):m(Zn,{size:12,className:"shrink-0 text-ink/40"}),m("span",{className:`min-w-0 flex-1 truncate text-[10px] font-semibold uppercase tracking-wider ${o?"text-ink/35":"text-ink/60"}`,title:e.name,children:[t+1,". ",e.name]}),m("span",{className:"shrink-0 font-mono text-[9.5px] text-ink/40",children:[i,"/",e.tasks.length]})]}),!n&&m("div",{className:"divide-y divide-ink/[0.05] p-0.5",children:e.tasks.length===0?m("div",{className:"px-2.5 py-1.5 text-[11px] text-ink/40",children:"No tasks in this phase"}):e.tasks.map((s,l)=>m(tie,{task:s,current:r===`${t}:${l}`},`${l}-${s.content}`))})]})}var Ktn=O(()=>{pt();Nz();tLe();de()});function lzr({className:e="",active:t=!0}){let[n]=Ha(),r=n.get("sessionId"),[a,i]=I9("todo.collapsedPhases",{}),{data:o,isLoading:s,refreshing:l,stale:u,refresh:d}=Ui(r?BBe(r):null,{enabled:t}),p=o?.snapshot??null,h=o?.progress??null,f=ut(()=>{let g=Htn(p?.phases??[]);return g?`${g.phase}:${g.task}`:null},[p]);if(!r)return m("div",{className:`flex h-full flex-col items-center justify-center bg-paper text-ink/40 ${e}`,children:m("span",{className:"text-xs font-mono",children:"No session selected"})});return m("div",{className:`flex h-full w-full min-w-0 flex-col overflow-hidden bg-paper text-ink ${e}`,children:[m("div",{className:"flex flex-shrink-0 items-center justify-between gap-3 border-b border-ink/10 px-3.5 py-2.5",children:[m("div",{className:"flex min-w-0 items-center gap-2",children:[m("h2",{className:"text-xs font-semibold uppercase tracking-wider text-ink",children:"Todos"}),p&&m("span",{className:"truncate font-mono text-[10.5px] text-ink/50",title:Rz(h),children:Rz(h)}),o?.isMock&&m("span",{className:"flex-shrink-0 rounded border border-ink/15 bg-ink/5 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wider text-ink/60",children:"Mock"})]}),m("button",{type:"button",onClick:d,disabled:s,title:"Refresh todos","aria-label":"Refresh todos",className:"flex-shrink-0 rounded-md border border-ink/15 bg-paper p-1.5 text-ink/80 transition-colors hover:bg-ink/5 disabled:opacity-50",children:m(Mn,{size:12,className:s||l?"animate-spin text-ink":""})})]}),h&&h.total>0&&m("div",{className:"flex-shrink-0 border-b border-ink/10 px-3.5 py-2.5",children:m("div",{className:"h-1.5 overflow-hidden rounded-full bg-ink/8",children:m("div",{className:"h-full rounded-full bg-success transition-all duration-300",style:{width:`${Jae(h)}%`}})})}),m("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto scrollbar-overlay-container p-3.5",children:[u&&m("div",{className:"flex items-start gap-2 rounded-lg border border-ink/15 bg-ink/5 px-3 py-2 text-[11px] text-ink/60",children:[m(Qn,{size:13,className:"mt-[1px] shrink-0"}),m("span",{className:"min-w-0 break-words",children:"Reconnecting — this list may be out of date."})]}),!p?m("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-center text-ink/40",children:[m(im,{size:20}),m("p",{className:"max-w-[240px] text-[11.5px] leading-relaxed",children:["No todo list in this session. The agent writes one with the ",m("span",{className:"font-mono",children:"todo"})," tool when a task is worth planning."]})]}):m(kt,{children:[p.phases.map((g,b)=>m(Ztn,{phase:g,index:b,collapsed:Boolean(a[String(b)]),currentKey:f,onToggle:()=>i((y)=>({...y,[String(b)]:!y[String(b)]}))},`${b}-${g.name}`)),m("p",{className:"pt-1 text-[10.5px] leading-relaxed text-ink/35",children:["Read from this session's transcript",p.updatedAt?` · updated ${czr(p.updatedAt)}`:"",p.source==="custom"?" · edited by hand":"","."]})]})]})]})}function czr(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;return t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var Ytn=O(()=>{Je();pt();Kc();xu();Ktn();Nz();cm();Ps();de()});function uzr(e){if(!Number.isFinite(e)||e<=0)return"";return new Date(e).toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})}function Xtn({files:e,selected:t,onSelect:n}){let[r,a]=ae(""),i=ut(()=>{let o=r.trim().toLowerCase();if(!o)return e;return e.filter((s)=>s.title.toLowerCase().includes(o))},[e,r]);return m("div",{className:"flex h-full min-h-0 w-full flex-col bg-canvas/40",children:[m("div",{className:"flex flex-shrink-0 items-center gap-1.5 border-b border-ink/10 px-2 py-1.5",children:[m(na,{size:12,className:"flex-shrink-0 text-ink/40"}),m("input",{type:"search",value:r,onChange:(o)=>a(o.target.value),placeholder:"Filter plans…","aria-label":"Filter plans",className:"min-w-0 flex-1 bg-transparent text-[11px] text-ink outline-none placeholder:text-ink/35"})]}),m("div",{className:"flex-1 min-h-0 overflow-y-auto scrollbar-overlay-container",children:i.length===0?m("p",{className:"px-3 py-2 text-[11px] text-ink/40 italic",children:e.length===0?"No plan yet":"No plan matches the filter"}):m("ul",{className:"py-1",children:i.map((o)=>{let s=o.path===t,l=uzr(o.modifiedAt);return m("li",{children:m("button",{type:"button",onClick:()=>n(o.path),"aria-current":s?"true":void 0,title:`${o.path}${l?` · ${l}`:""}`,className:`flex w-full items-start gap-1.5 px-2.5 py-1.5 text-left transition-colors ${s?"bg-ink/10 font-semibold text-ink":"text-ink/80 hover:bg-ink/5 hover:text-ink"}`,children:[m(Qa,{size:12,className:`mt-0.5 flex-shrink-0 ${s?"text-ink":"text-ink/40"}`}),m("span",{className:"min-w-0 flex-1",children:[m("span",{className:"block truncate text-[11.5px]",children:o.title}),l&&m("span",{className:"block truncate font-mono text-[10px] text-ink/40",children:l})]})]})},o.path)})})})]})}var Jtn=O(()=>{Je();pt();de()});function Qtn({file:e,content:t,isLoading:n,error:r,truncated:a,onBack:i}){return m("div",{className:"flex h-full min-h-0 w-full flex-col bg-paper",children:[m("div",{className:"flex flex-shrink-0 items-center gap-1.5 border-b border-ink/10 px-2.5 py-1.5",children:[m("button",{type:"button",onClick:i,title:"Back to the plan list","aria-label":"Back to the plan list",className:"flex-shrink-0 rounded p-1 text-ink/60 hover:bg-ink/5 hover:text-ink @[520px]:hidden",children:m(ip,{size:13})}),m("span",{className:"min-w-0 flex-1 truncate text-[11px] text-ink/50",title:e?.path??"",children:e?.path??"Plan"}),n&&m(nn,{size:12,className:"flex-shrink-0 animate-spin text-ink/40"})]}),m("div",{className:"flex-1 min-h-0 overflow-y-auto scrollbar-overlay-container",children:r?m("div",{className:"flex flex-col items-center gap-2 px-6 py-8 text-center",children:[m(Qn,{size:16,className:"text-error"}),m("p",{className:"text-xs text-error",children:r})]}):!t?m("div",{className:"px-6 py-8 text-center text-xs text-ink/40",children:n?"Reading the plan…":"This plan is empty."}):m("article",{className:"mx-auto max-w-4xl px-5 py-4",children:[m(vr,{content:t,className:"max-w-none"}),a&&m("p",{className:"mt-4 border-t border-ink/10 pt-2 text-[11px] text-ink/50",children:"This plan is longer than the reader's budget and was cut off."})]})})]})}var enn=O(()=>{pt();Fo();de()});function dzr({className:e="",active:t=!0}){let[n]=Ha(),r=n.get("sessionId"),[a,i]=I9("plan.selectedFile",null),[o,s]=ae(!1),l=a&&a.sessionId===r?a.path:null,u=Ui(r?zBe(r):null,{enabled:t}),d=u.data?.files??[],p=u.data?.current??null,h=ut(()=>{if(l&&d.some((y)=>y.path===l))return l;return p},[l,d,p]),f=ut(()=>d.find((y)=>y.path===h)??null,[d,h]);Ee(()=>{if(!r||!h||h===l)return;i({sessionId:r,path:h})},[r,h,l,i]),Ee(()=>{s(!1)},[r]);let g=(y)=>{if(r)i({sessionId:r,path:y});s(!0)};if(!r)return m("div",{className:`flex h-full flex-col items-center justify-center bg-paper text-ink/40 ${e}`,children:m("span",{className:"text-xs font-mono",children:"No session selected"})});let b=d.length>0;return m("div",{className:`@container flex h-full min-h-0 w-full flex-col bg-paper text-xs text-ink ${e}`,children:[m("div",{className:"flex flex-shrink-0 items-center justify-between gap-2 border-b border-ink/10 px-2 py-1.5",children:[m("div",{className:"flex min-w-0 items-center gap-1.5",children:[m(Qa,{size:12,className:"flex-shrink-0 text-ink/50"}),m("span",{className:"truncate text-[11px] font-medium text-ink/70",children:"Plan mode"}),b&&m("span",{className:"flex-shrink-0 rounded border border-ink/15 bg-ink/5 px-1.5 py-0.5 font-mono text-[9.5px] text-ink/60",children:d.length})]}),m("button",{type:"button",onClick:u.refresh,disabled:u.isLoading,title:"Re-read the plan","aria-label":"Re-read the plan",className:"flex-shrink-0 rounded p-1 text-ink/60 transition-colors hover:bg-ink/5 hover:text-ink disabled:opacity-50",children:m(Mn,{size:13,className:u.isLoading||u.refreshing?"animate-spin":""})})]}),u.stale&&!u.data?m("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[m(Qn,{size:16,className:"text-error"}),m("p",{className:"text-error",children:"The plan could not be read."}),m("button",{type:"button",onClick:u.refresh,className:"text-[11px] font-semibold text-ink/70 underline underline-offset-2 hover:text-ink",children:"Try again"})]}):!u.data?m("div",{className:"flex flex-1 items-center justify-center gap-2 text-ink/40",children:[m(nn,{size:14,className:"animate-spin"}),m("span",{children:"Reading the plan…"})]}):!b?m("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[m(Qa,{size:18,className:"text-ink/30"}),m("p",{className:"max-w-sm text-[11px] leading-relaxed text-ink/60",children:"No plan yet. Turn on Plan mode in the composer, and the plan this session writes will appear here."})]}):m("div",{className:"flex min-h-0 flex-1 flex-col @[520px]:flex-row-reverse",children:[m("div",{className:`min-h-0 w-full @[520px]:w-52 @[520px]:flex-shrink-0 border-b border-ink/10 @[520px]:border-b-0 @[520px]:border-l ${o?"hidden @[520px]:flex":"flex"} flex-col`,children:m(Xtn,{files:d,selected:h,onSelect:g})}),m("div",{className:`min-w-0 min-h-0 flex-1 ${o?"flex":"hidden @[520px]:flex"} flex-col`,children:m(Qtn,{file:f,content:u.data.content,isLoading:u.isLoading,error:u.stale?"The plan could not be read.":null,truncated:u.data.truncated,onBack:()=>s(!1)})})]})]})}var tnn=O(()=>{Je();pt();Kc();xu();Jtn();enn();cm();Ps();de()});function nnn(e){if(e.length===0)return[...N2];let t=new Set(e);return N2.filter((n)=>!t.has(n.id))}var pzr,mzr,N2;var nie=O(()=>{Ma();pt();t6();de();pzr={context:{title:"Context & Telemetry",label:"Context",icon:m(yd,{size:bd}),requiresWorkspace:!0},files:{title:"Files",label:"Files",icon:m(JR,{size:bd}),requiresWorkspace:!0},search:{title:"Search",label:"Search",icon:m(na,{size:bd}),requiresWorkspace:!0},git:{title:"Source Control",label:"GIT",icon:m(hc,{size:bd}),requiresWorkspace:!0},wiki:{title:"Wiki",label:"Wiki",icon:m(ls,{size:bd}),requiresWorkspace:!0},terminal:{title:"Terminal (Bun)",label:"Terminal",icon:m(Da,{size:bd}),requiresWorkspace:!0,liveWhileHidden:!0},"user-browser":{title:"Browser (Anda)",label:"Browser",icon:m(Pa,{size:bd}),requiresWorkspace:!1},browser:{title:"Browser Agent",label:"Agent",icon:m(Wo,{size:bd}),requiresWorkspace:!1},usage:{title:"Usage",label:"Usage",icon:m(ib,{size:bd}),requiresWorkspace:!1},todo:{title:"Todos",label:"Todos",icon:m(im,{size:bd}),requiresWorkspace:!1},plan:{title:"Plan (sesi ini)",label:"Plan",icon:m(m5,{size:bd}),requiresWorkspace:!1}},mzr={context:Mi(()=>Promise.resolve().then(() => (ZVt(),{})).then((e)=>({default:bIr}))),files:Mi(()=>Promise.resolve().then(() => (MKt(),{})).then((e)=>({default:ZIr}))),search:Mi(()=>Promise.resolve().then(() => (tYt(),{})).then((e)=>({default:rMr}))),git:Mi(()=>Promise.resolve().then(() => (sXt(),{})).then((e)=>({default:cMr}))),wiki:Mi(()=>Promise.resolve().then(() => (yXt(),{})).then((e)=>({default:pMr}))),terminal:Mi(()=>Promise.resolve().then(() => (Zen(),{})).then((e)=>({default:DBr}))),"user-browser":Mi(()=>Promise.resolve().then(() => (ctn(),{})).then((e)=>({default:jBr}))),browser:Mi(()=>Promise.resolve().then(() => (ktn(),{})).then((e)=>({default:ZBr}))),usage:Mi(()=>Promise.resolve().then(() => (qtn(),{})).then((e)=>({default:ozr}))),todo:Mi(()=>Promise.resolve().then(() => (Ytn(),{})).then((e)=>({default:lzr}))),plan:Mi(()=>Promise.resolve().then(() => (tnn(),{})).then((e)=>({default:dzr})))},N2=oU.map((e)=>({id:e,...pzr[e],Component:mzr[e],minWidth:IPe[e],defaultWidth:NPe[e],defaultFraction:sU}))});function rnn({disabled:e,busy:t,onSetEnabled:n}){let r=new Set(e);return m("section",{children:[m("header",{className:"flex items-center gap-2 mb-2",children:[m("h3",{className:"text-sm font-medium text-ink",children:"Built-in"}),m("span",{className:"ml-auto text-[11px] text-ink/50",children:[N2.length-N2.filter((a)=>r.has(a.id)).length," of"," ",N2.length," on"]})]}),m("p",{className:"text-[11px] text-ink/50 mb-2",children:"The views Kabmo ships. Switch one off to put it away — its code stays in the app, so this is reversible at any time and needs no reinstall."}),m("div",{className:"grid gap-2 [grid-template-columns:repeat(auto-fill,minmax(200px,1fr))]",children:N2.map((a)=>{let i=!r.has(a.id),o=t===`enable:${a.id}`||t===`disable:${a.id}`;return m("div",{className:`flex items-center gap-2.5 border border-ink/10 rounded-lg px-2.5 py-2 transition-colors ${i?"bg-paper":"bg-ink/[0.02]"}`,children:[m("span",{className:i?"text-ink/70 flex-shrink-0":"text-ink/30 flex-shrink-0",children:a.icon}),m("span",{className:"min-w-0 flex-1",children:[m("span",{className:`block text-xs truncate ${i?"text-ink":"text-ink/45"}`,title:a.title,children:a.title}),m("span",{className:"block text-[10px] font-mono text-ink/40 truncate",children:a.id})]}),m("button",{type:"button",role:"switch","aria-checked":i,"aria-label":`${i?"Disable":"Enable"} ${a.title}`,disabled:t!==null,onClick:()=>void n(a.id,!i),title:i?"Switch off — remove its button":"Switch on",className:`relative w-8 h-4 rounded-full transition-colors flex-shrink-0 disabled:opacity-40 ${i?"bg-ink/70":"bg-ink/20"}`,children:o?m(nn,{size:9,className:"absolute inset-0 m-auto animate-spin text-canvas"}):m("span",{className:`absolute top-0.5 w-3 h-3 rounded-full bg-canvas transition-all ${i?"left-[18px]":"left-0.5"}`})})]},a.id)})})]})}var ann=O(()=>{pt();nie();de()});function inn({autoUpdate:e,busy:t,gitCount:n,onSetAutoUpdate:r,onCheckUpdates:a,onRefresh:i}){return m("div",{className:"flex flex-wrap items-center gap-2",children:[m("button",{type:"button",role:"checkbox","aria-checked":e,disabled:t!==null,onClick:()=>void r(!e),title:e?"Stop updating git-installed plugins automatically":"Fetch and apply the remote’s latest commit for every git-installed plugin, hourly",className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded border border-ink/15 hover:bg-ink/5 disabled:opacity-50",children:[e?m(ak,{size:13}):m(Mg,{size:13}),"Auto-update git plugins"]}),m("button",{type:"button",onClick:()=>void a(),disabled:t!==null||n===0,title:n===0?"No git-installed plugins to check":"Ask each git-installed plugin’s remote whether a newer commit exists",className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded border border-ink/15 hover:bg-ink/5 disabled:opacity-50",children:[m(Mn,{size:13,className:t==="check_updates"?"animate-spin":""}),"Check for updates"]}),m("button",{type:"button",onClick:i,disabled:t!==null,className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded border border-ink/15 hover:bg-ink/5 disabled:opacity-50",title:"Re-read the marketplace from disk",children:[m(Mn,{size:13}),"Refresh"]}),m("span",{className:"text-[11px] text-ink/45",children:e?"Git plugins are updated from their remote about once an hour, with no confirmation.":"Off — updates are applied only when you press Update."})]})}var onn=O(()=>{pt();de()});function snn({blocked:e,busy:t,onForceSync:n}){let r=Object.entries(e);if(r.length===0)return null;return m("div",{className:"space-y-2",children:r.map(([a,i])=>{let o=i.changed.slice(0,hzr),s=i.changed.length-o.length;return m("div",{className:"border border-warning/40 rounded p-3 space-y-1.5",children:[m("div",{className:"flex items-center gap-2 text-warning",children:[m(pr,{size:14,className:"flex-shrink-0"}),m("span",{className:"text-xs",children:[m("span",{className:"font-medium",children:a})," has local changes — its bundled update is paused"]})]}),m("p",{className:"text-[11px] text-ink/60",children:["Kabmo installed this plugin, and ",i.changed.length," of its files no longer match what it wrote. Your files are left as they are."]}),m("ul",{className:"text-[10px] font-mono text-ink/50 space-y-0.5",children:[o.map((l)=>m("li",{className:"truncate",title:l,children:l},l)),s>0?m("li",{children:["… and ",s," more"]}):null]}),m("div",{className:"flex items-center gap-2 pt-0.5",children:[m("button",{type:"button",disabled:t!==null,onClick:()=>void n(a),title:`Replace ${i.changed.length} changed file(s) with the copy Kabmo ships — your edits are lost`,className:"flex items-center gap-1.5 px-2 py-1 text-[11px] rounded border border-warning/50 text-warning hover:bg-warning/10 disabled:opacity-50",children:[t===`force_sync:${a}`?m(nn,{size:12,className:"animate-spin"}):m(Xc,{size:12}),"Replace my changes with the store's copy"]}),m("span",{className:"text-[11px] text-ink/45",children:"This discards the files listed above."})]})]},a)})})}var hzr=5;var lnn=O(()=>{pt();de()});function fzr({error:e,busy:t,onForget:n}){let r=e.source;return m("div",{className:"border border-error/30 rounded p-3",children:[m("div",{className:"flex items-center gap-2 text-error",children:[m(pr,{size:14,className:"flex-shrink-0"}),m("span",{className:"text-xs",children:"Rejected"})]}),m("div",{className:"mt-1 text-[11px] font-mono text-ink/50 break-all",children:e.dir}),m("div",{className:"mt-1 text-xs text-ink/70",children:e.reason}),r?m("div",{className:"mt-2 flex items-center gap-2",children:[m("button",{type:"button",disabled:t,onClick:()=>void n(r),className:"flex items-center gap-1.5 px-2 py-1 text-[11px] rounded border border-error/40 text-error hover:bg-error/10 disabled:opacity-50",title:`Drop the catalog entry "${r}" — the directory it names is already gone`,children:[m(Tr,{size:12}),"Forget this entry"]}),m("span",{className:"text-[11px] text-ink/45",children:"Removes the record from marketplace.json. No files are touched."})]}):null]})}function cnn(){let{panels:e,errors:t,plugins:n,catalog:r,disabledPanels:a,gitStatus:i,autoUpdate:o,syncBlocked:s,ready:l}=up(),{slots:u,failures:d}=kk(),p=eq(),h=()=>void lWe(),f=r.filter((x)=>!x.installed),g=new Map(d.map((x)=>[x.pluginId,x.reason])),b=new Map(e.map((x)=>[x.pluginId,x.iconUrl])),y=new Map(e.map((x)=>[x.pluginId,x.readmeUrl])),v=n.filter((x)=>x.gitOrigin).length;return m("div",{className:"space-y-4",children:[m("div",{className:"flex items-start justify-between gap-3",children:m("p",{className:"text-xs text-ink/60 max-w-xl",children:"Panels bundled with Kabmo, plus the ones you install from a git URL. A plugin is local code Kabmo loads into this page and renders in its own tree, so it looks and behaves like the rest of the app — treat it the way you would a VS Code extension."})}),m(inn,{autoUpdate:o,busy:p.busy,gitCount:v,onSetAutoUpdate:p.setAutoUpdate,onCheckUpdates:p.checkUpdates,onRefresh:h}),p.error?m("div",{className:"flex items-start gap-1.5 px-3 py-2 rounded-lg border border-error/30 bg-error/5 text-[11px] text-error leading-snug",children:[m(pr,{size:13,className:"mt-0.5 flex-shrink-0"}),m("span",{className:"flex-1 break-words",children:p.error}),m("button",{type:"button",onClick:p.clearError,"aria-label":"Dismiss",className:"cursor-pointer",children:m(vn,{size:12})})]}):null,m(cWe,{busy:p.busy==="install",onInstall:p.install,onClearError:p.clearError}),!l?m("p",{className:"text-xs text-ink/50",children:"Reading…"}):null,m(rnn,{disabled:a,busy:p.busy,onSetEnabled:p.setEnabled}),l&&f.length===0&&n.length===0&&t.length===0?m("div",{className:"text-xs text-ink/60 space-y-1.5",children:[m("p",{children:"No panel plugins installed."}),m("p",{className:"font-mono text-[11px] text-ink/45 leading-relaxed",children:["~/.kabmo/marketplace/marketplace.json",m("br",{}),"~/.kabmo/marketplace/plugins/<plugin>/package.json"]})]}):null,m(dVt,{entries:f,busy:p.busy,onInstall:p.installBundled}),m(snn,{blocked:s,busy:p.busy,onForceSync:p.forceSync}),n.length>0?m(fVt,{plugins:n,slots:u,failures:g,iconUrls:b,readmeUrls:y,busy:p.busy,onBuild:p.build,onRemove:p.remove,onSetEnabled:p.setEnabled,gitStatus:i,onUpdateGit:p.updateGit}):null,t.map((x)=>m(fzr,{error:x,busy:p.busy!==null,onForget:p.forget},x.dir+x.reason))]})}var unn=O(()=>{pt();T6();fue();pVt();gVt();ann();onn();lnn();de()});function dnn(){return m("div",{className:"flex-1 min-h-0 overflow-auto p-6 md:p-8",children:m("div",{className:"max-w-3xl",children:m(cnn,{})})})}var pnn=O(()=>{unn();de()});function mnn({isOpen:e,onClose:t,onAddSource:n}){let[r,a]=ae(""),[i,o]=ae(""),[s,l]=ae(null);if(!e)return null;return m("div",{className:"fixed inset-0 z-50 bg-ink/40 backdrop-blur-[2px] flex items-center justify-center p-4",onClick:t,children:m("div",{className:"bg-paper border border-ink/20 rounded-xl max-w-md w-full p-6 shadow-2xl space-y-4 text-ink animate-in fade-in zoom-in-95 duration-150 max-h-full overflow-y-auto scrollbar-overlay-container",onClick:(d)=>d.stopPropagation(),children:[m("div",{className:"flex items-center justify-between pb-3 border-b border-ink/10",children:[m("div",{className:"flex items-center gap-2",children:[m(hc,{className:"w-4 h-4 text-ink/70"}),m("h2",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Add Custom Skill Source"})]}),m("button",{type:"button",onClick:t,className:"p-1 rounded-md text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:m(vn,{className:"w-4 h-4"})})]}),m("p",{className:"text-xs text-ink/70 leading-relaxed",children:"Connect any public or private Git repository containing skill definitions and prompt directives."}),m("form",{onSubmit:(d)=>{d.preventDefault();let p=r.trim().replace(/^https?:\/\/github\.com\//,"").replace(/\/$/,"");if(!p){l("Please provide a valid GitHub repository path (e.g. owner/repo).");return}let h=i.trim()||p.split("/")[1]||p,f={id:`custom-${Date.now()}`,name:h,repo:p,stars:"1.2K",updatedAt:"Just now",skillCount:3,isCustom:!0};n(f),a(""),o(""),l(null),t()},className:"space-y-4",children:[m("div",{children:[m("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:"Source Name"}),m("input",{type:"text",value:i,onChange:(d)=>o(d.currentTarget.value),placeholder:"e.g. Acme Internal Skills",className:"w-full px-3 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs text-ink transition-colors"})]}),m("div",{children:[m("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:["Git Repository ",m("span",{className:"text-error",children:"*"})]}),m("input",{type:"text",value:r,onChange:(d)=>{a(d.currentTarget.value),l(null)},placeholder:"e.g. owner/skills-repo or https://github.com/...",className:"w-full px-3 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs font-mono text-ink transition-colors"})]}),s&&m("div",{className:"flex items-center gap-2 text-xs text-error p-2.5 rounded-lg bg-error/10 border border-error/20",children:[m(Qn,{className:"w-4 h-4 flex-shrink-0"}),m("span",{className:"font-medium",children:s})]}),m("div",{className:"pt-3 border-t border-ink/10 flex items-center justify-end gap-2",children:[m("button",{type:"button",onClick:t,className:"px-3.5 py-2 rounded-lg border border-ink/20 hover:border-ink/40 text-xs font-medium text-ink/80 hover:text-ink transition-colors cursor-pointer",children:"Cancel"}),m("button",{type:"submit",className:"flex items-center gap-1.5 px-4 py-2 rounded-lg bg-ink text-paper text-xs font-medium hover:bg-ink/90 transition-colors shadow-xs cursor-pointer",children:[m(Er,{size:14}),m("span",{children:"Add Source"})]})]})]})]})})}var hnn=O(()=>{Je();pt();de()});function fnn(){let[e,t]=ae([]),[n,r]=ae([]),[a,i]=ae([]),o=Le(async()=>{let l=await(await fetch("/api/settings/skills")).json();if(l?.catalogSources)t(l.catalogSources);if(l?.catalogSkills)r(l.catalogSkills);if(l?.skills)i(l.skills)},[]);return Ee(()=>{o().catch(console.error)},[o]),{sources:e,catalogSkills:n,userSkills:a,setSources:t,setUserSkills:i,reload:o}}var gnn=O(()=>{Je()});function bnn(){let{sources:e,catalogSkills:t,userSkills:n,setSources:r,setUserSkills:a,reload:i}=fnn(),[o,s]=ae("anthropic"),[l,u]=ae(""),[d,p]=ae(!1),[h,f]=ae(!1),[g,b]=ae(null),y=new Set(n.map((T)=>T?.name).filter(Boolean)),v=(T)=>{b(T),setTimeout(()=>b(null),2500)},x=()=>{p(!0),i().then(()=>v("Catalog index synchronized")).catch(console.error).finally(()=>p(!1))},k=(T)=>{let E=n.find((L)=>L.name===T.name);fetch("/api/settings/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"install_toggle",skill:T,install:!E})}).then((L)=>L.json()).then((L)=>{if(L?.error){v(`Failed: ${L.error}`);return}if(Array.isArray(L?.skills))a(L.skills);tv("command"),v(E?`Uninstalled skill "${T.name}"`:`Installed skill "${T.name}"`)}).catch((L)=>{console.error(L),v(`Failed to ${E?"uninstall":"install"} "${T.name}"`)})},C=(T)=>{let E=[...e,T];r(E),s(T.id),fetch("/api/settings/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({catalogSources:E})}).catch(console.error),v(`Added source "${T.name}"`)},_=t.filter((T)=>{let E=!l.trim()||T.name.toLowerCase().includes(l.toLowerCase())||T.description.toLowerCase().includes(l.toLowerCase())||T.repoTag.toLowerCase().includes(l.toLowerCase());if(l.trim())return E;return T.sourceId===o}),w=e.find((T)=>T.id===o)||e[0]||null;return m("div",{className:"flex-1 flex flex-col h-full w-full scrollbar-overlay-container bg-paper text-ink p-6 md:p-8 space-y-6",children:[m("div",{children:m("p",{className:"text-xs text-ink/70 leading-relaxed",children:"Install ready-made skills from curated repositories, or add your own source."})}),m("div",{className:"relative",children:[m(na,{size:15,className:"absolute left-3 top-2.5 text-ink/40 pointer-events-none"}),m("input",{type:"text",value:l,onChange:(T)=>u(T.currentTarget.value),placeholder:"Search skills across all sources...",className:"w-full pl-9 pr-4 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs text-ink transition-colors"})]}),m("div",{className:"space-y-3",children:[m("h3",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Sources"}),m("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.map((T)=>{let E=o===T.id&&!l.trim();return m("div",{onClick:()=>{s(T.id),u("")},className:`p-3.5 rounded-xl border transition-all cursor-pointer select-none relative ${E?"border-ink bg-ink/5 shadow-xs":"border-ink/20 hover:border-ink/40 bg-paper"}`,children:[m("div",{className:"flex items-center justify-between",children:[m("div",{className:"flex items-center gap-2",children:[m("span",{className:"text-xs font-bold text-ink",children:T.name}),m("span",{className:"text-[10px] text-ink/50 font-mono",children:[T.skillCount," skills"]})]}),m(Mn,{size:13,className:`text-ink/40 hover:text-ink transition-colors ${d&&E?"animate-spin":""}`})]}),m("div",{className:"mt-1 font-mono text-[11px] text-ink/60 truncate",children:T.repo}),m("div",{className:"mt-2.5 flex items-center gap-3 text-[10px] text-ink/50",children:[m("span",{className:"flex items-center gap-1",children:[m(Xy,{size:11,className:"text-ink/50"}),m("span",{children:T.stars})]}),m("span",{children:T.updatedAt})]})]},T.id)}),m("div",{onClick:()=>f(!0),className:"p-3.5 rounded-xl border border-dashed border-ink/25 hover:border-ink/50 bg-paper hover:bg-ink/[0.02] transition-all cursor-pointer flex items-center gap-3 select-none",children:[m("div",{className:"w-8 h-8 rounded-lg border border-ink/20 flex items-center justify-center text-ink/60 flex-shrink-0",children:m(Er,{size:16})}),m("div",{children:[m("div",{className:"text-xs font-bold text-ink",children:"Add your own source"}),m("div",{className:"text-[11px] text-ink/60",children:"Any Git repository with skills"})]})]})]})]}),m("div",{className:"border-t border-ink/10 pt-4",children:[m("div",{className:"flex items-center justify-between pb-3",children:[m("div",{className:"flex items-center gap-2",children:[m("span",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:l.trim()?"Search Results":w?.name?w.name.toUpperCase():"SKILL CATALOG"}),m("span",{className:"text-xs text-ink/50",children:[_.length," skill(s) found"]})]}),m("button",{type:"button",onClick:x,title:"Refresh skills",className:"p-1 rounded-md text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:m(Mn,{size:14,className:d?"animate-spin":""})})]}),m("div",{className:"space-y-3",children:_.length===0?m("div",{className:"text-center py-10 border border-dashed border-ink/15 rounded-xl",children:m("p",{className:"text-xs text-ink/60",children:"No skills found matching your query."})}):_.map((T)=>{let E=y.has(T.name);return m("div",{className:"p-4 rounded-xl border border-ink/15 hover:border-ink/30 bg-paper transition-all flex flex-col sm:flex-row sm:items-start justify-between gap-3",children:[m("div",{className:"space-y-1.5 flex-1 min-w-0",children:[m("div",{className:"flex items-center gap-2",children:m("span",{className:"text-xs font-bold text-ink tracking-tight font-mono",children:T.name})}),m("p",{className:"text-xs text-ink/75 leading-relaxed line-clamp-2",children:T.description}),m("div",{className:"flex items-center gap-1.5 text-[11px] text-ink/50 font-mono pt-1",children:[m(hc,{size:12,className:"flex-shrink-0"}),m("span",{className:"truncate",children:T.repoTag})]})]}),m("div",{className:"flex items-center gap-2 flex-shrink-0 self-end sm:self-center",children:[T.githubUrl&&m("a",{href:T.githubUrl,target:"_blank",rel:"noreferrer",className:"p-1.5 rounded-lg text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",title:"View repository",children:m(so,{size:14})}),m("button",{type:"button",onClick:()=>k(T),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-all flex items-center gap-1.5 cursor-pointer ${E?"border border-ink/20 text-ink/80 hover:border-error hover:text-error hover:bg-error/5":"bg-ink text-paper hover:bg-ink/90 shadow-xs"}`,children:E?m(kt,{children:[m(Xt,{size:12}),m("span",{children:"Installed"})]}):m(kt,{children:[m(xi,{size:12}),m("span",{children:"install"})]})})]})]},T.id)})})]}),m(mnn,{isOpen:h,onClose:()=>f(!1),onAddSource:C}),g&&m("div",{className:"fixed bottom-6 right-6 z-50 bg-ink text-paper text-xs font-medium px-4 py-2.5 rounded-lg shadow-lg animate-in fade-in slide-in-from-bottom-2 duration-150 flex items-center gap-2",children:[m(Xt,{size:14}),m("span",{children:g})]})]})}var ynn=O(()=>{Je();pt();hnn();I5();gnn();de()});function vnn({category:e}){return m("div",{className:"space-y-6 text-ink flex flex-col items-center justify-center py-16",children:[m("div",{className:"text-sm font-semibold capitalize",children:[e.replace("-"," ")," Settings"]}),m("div",{className:"text-xs text-ink/60 text-center max-w-sm mt-2",children:"This settings category is currently under construction and will be available soon."})]})}var xnn=O(()=>{de()});var _nn;var knn=O(()=>{_nn={source:"@oh-my-pi/pi-coding-agent 10 tabs / 559 settings",tabs:[{id:"appearance",label:"Appearance",groups:["Theme","Composer","Status Line","Images","Display"]},{id:"model",label:"Model",groups:["Prompt","Prewalk","Vision","Thinking","Sampling","Retry & Fallback","Advisor"]},{id:"interaction",label:"Interaction",groups:["Startup & Updates","Git","Input","Magic Keywords","Notifications","Power","Agent","Approvals","Skills","Speech","Collab","Stream"]},{id:"context",label:"Context",groups:["General","Compaction","Experimental","Rules (TTSR)"]},{id:"memory",label:"Memory",groups:["General","Sharpshooter","Auto-Learn","Mnemopi","Hindsight"]},{id:"files",label:"Files",groups:["Editing","Reading","Read Summaries","LSP"]},{id:"shell",label:"Shell",groups:["Bash","Eval & Runtimes"]},{id:"tools",label:"Tools",groups:["Output Limits","Available Tools","Todos","Grep & Browser","Computer","Execution","GitHub","Discovery & MCP","Developer","Extensions","IDA Pro"]},{id:"tasks",label:"Tasks",groups:["Isolation","Subagents","Modes","Commands & Skills"]},{id:"providers",label:"Providers",groups:["Services","Fireworks","Tiny Model","Protocol","Timeouts","Privacy"]}],entries:{modelRoleStorage:{type:"enum",default:"global",values:["global","project"],ui:{tab:"model",group:"Prompt",label:"Model Role Storage",description:"Where model selector role assignments are saved",options:[{value:"global",label:"Global",description:"Save role models in the active profile config (current behavior)"},{value:"project",label:"Per-project",description:"Save project role models in .omp/config.yml; missing project roles use global defaults"}]}},autoResume:{type:"boolean",default:!1,ui:{tab:"interaction",group:"Startup & Updates",label:"Auto Resume",description:"Automatically resume the most recent session in the current directory"}},"git.enabled":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Git",label:"Enable Git Integration",description:"Show git branch, status, and PR information in the TUI and watch repository metadata."}},"theme.dark":{type:"string",default:"titanium",ui:{tab:"appearance",group:"Theme",label:"Dark Theme",description:"Theme used when the terminal has a dark background",options:"runtime"}},"theme.light":{type:"string",default:"light",ui:{tab:"appearance",group:"Theme",label:"Light Theme",description:"Theme used when the terminal has a light background",options:"runtime"}},symbolPreset:{type:"enum",default:"unicode",values:["unicode","nerd","ascii"],ui:{tab:"appearance",group:"Theme",label:"Symbol Preset",description:"Glyph set for icons and symbols (Unicode, Nerd Font, or ASCII)",options:[{value:"unicode",label:"Unicode",description:"Standard symbols (default)"},{value:"nerd",label:"Nerd Font",description:"Requires a Nerd Font, or a Glyph Protocol terminal (icons ship in-band)"},{value:"ascii",label:"ASCII",description:"Maximum compatibility"}]}},colorBlindMode:{type:"boolean",default:!1,ui:{tab:"appearance",group:"Theme",label:"Color-Blind Mode",description:"Use blue instead of green for diff additions"}},"composer.shape":{type:"string",default:"band",ui:{tab:"appearance",group:"Composer",label:"Composer Shape",description:"Visual layout of the input editor and status line",options:"runtime"}},"composer.tokenRate":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Composer",label:"Generation Rate",description:"Show a live generation tok/s readout: on the working row next to the session title, or in the native composer bar right after the thinking level, where the last reading stays between turns. Estimated from streamed deltas and corrected by the provider's billed output count as each message completes."}},"statusLine.preset":{type:"enum",default:"default",values:["default","minimal","compact","full","nerd","ascii","custom"],ui:{tab:"appearance",group:"Status Line",label:"Status Line Preset",description:"Pre-built status line configurations",options:[{value:"default",label:"Default",description:"Model, path, git, context, tokens, cost"},{value:"minimal",label:"Minimal",description:"Path and git only"},{value:"compact",label:"Compact",description:"Model, git, cost, context"},{value:"full",label:"Full",description:"All segments including time"},{value:"nerd",label:"Nerd",description:"Maximum info with Nerd Font icons"},{value:"ascii",label:"ASCII",description:"No special characters"},{value:"custom",label:"Custom",description:"User-defined segments"}]}},"statusLine.separator":{type:"enum",default:"powerline-thin",values:["powerline","powerline-thin","slash","pipe","block","none","ascii"],ui:{tab:"appearance",group:"Status Line",label:"Status Line Separator",description:"Style of separators between segments",options:[{value:"powerline",label:"Powerline",description:"Solid arrows (Nerd Font)"},{value:"powerline-thin",label:"Thin chevron",description:"Thin arrows (Nerd Font)"},{value:"slash",label:"Slash",description:"Forward slashes"},{value:"pipe",label:"Pipe",description:"Vertical pipes"},{value:"block",label:"Block",description:"Solid blocks"},{value:"none",label:"None",description:"Space only"},{value:"ascii",label:"ASCII",description:"Greater-than signs"}]}},"statusLine.contextLine":{type:"enum",default:"embedded",values:["off","percentage","annotated","embedded"],ui:{tab:"appearance",group:"Status Line",label:"Context-Reactive Line",description:"How the line between the left and right segments reflects context usage (box composer only)",options:[{value:"off",label:"Off",description:"Solid accent line, no context feedback"},{value:"percentage",label:"Percentage",description:"Used portion in accent color, remainder dimmed"},{value:"annotated",label:"Annotated",description:"Percentage plus ticks at the speculative and auto-compaction boundaries"},{value:"embedded",label:"Embedded",description:"Annotated line with the context percentage and window embedded in the gauge"}]}},"statusLine.sessionAccent":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Status Line",label:"Session Accent",description:"Use the session name color for the editor border and status line gap"}},"statusLine.transparent":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Status Line",label:"Transparent Status Line",description:"Use the terminal's default background for the status line instead of the theme's `statusLineBg`. Powerline end caps are dropped because they need a contrasting fill to bridge into the surrounding terminal."}},"statusLine.compactThinkingLevel":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Status Line",label:"Compact Thinking Level",description:"Show the thinking level as a single icon on the model name instead of a separate ` · <level>` suffix; in Tern's composer, as the model chip's icon instead of a separate chip (click the icon to cycle it)."}},"statusLine.showHookStatus":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Status Line",label:"Show Hook Status",description:"Display hook status messages below the status line"}},"terminal.showImages":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Images",label:"Show Inline Images",description:"Render images inline in the terminal",condition:"hasImageProtocol"}},"images.autoResize":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Images",label:"Auto-Resize Images",description:"Resize large images to 2000x2000 max for better model compatibility"}},"images.blockImages":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Images",label:"Block Images",description:"Prevent images from being sent to LLM providers"}},"tui.resizeScrollback":{type:"enum",default:"rebuild",values:["append","rebuild","preserve"],ui:{tab:"appearance",group:"Display",label:"Resize Scrollback",description:"How a settled terminal resize refreshes transcript rows retained in terminal scrollback",options:[{value:"append",label:"Append",description:"Replay the transcript at the new width below retained history"},{value:"rebuild",label:"Rebuild",description:"Erase all terminal scrollback, then replay one current-width transcript"},{value:"preserve",label:"Preserve",description:"Repaint only the viewport and keep history wrapped at its old width"}]}},"tui.completeScrollback":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Complete Scrollback",description:"Send transcript rows pushed off screen by a growing HUD or dialog straight to scrollback; when it shrinks, blank rows sit between the transcript and the input until new output fills them"}},"terminal.showProgress":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Native Terminal Progress",description:"Emit OSC 9;4 indeterminate progress while the agent or context maintenance is running (always on in Tern)"}},"terminal.programStatus":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Program Status (OSC 7501)",description:"Report whether the agent is working, waiting on you, done, or failed over OSC 7501, for terminal tab indicators and agent inboxes"}},"tui.textSizing":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Large Headings (Kitty)",description:"Render Markdown H1 headings at 2x scale using Kitty's OSC 66 text-sizing protocol. Only takes effect on Kitty terminals; ignored everywhere else. Off by default."}},"tui.renderMermaid":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Render Mermaid Diagrams",description:"Render Mermaid fenced code blocks as ASCII diagrams"}},"tui.renderSvg":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Render SVG Figures",description:"Invite the agent to draw diagrams and charts as SVG, rendered inline as images on terminals that show graphics"}},"tui.autoGraph":{type:"enum",default:"always",values:["smart","always","off"],ui:{tab:"appearance",group:"Display",label:"Auto-Graph Tables",description:"Draw a chart under numeric tables in the agent's answers, in your theme's colors, on terminals that show graphics",options:[{value:"smart",label:"Smart",description:"The judge model refines each chart: kind, columns, row names and grouping, scales, which way is better, and its title"},{value:"always",label:"Always",description:"Chart every table that reads as numeric, using the built-in best guess"},{value:"off",label:"Off",description:"Leave tables as tables"}]}},"tui.reactions":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Agent Reactions",description:"Invite the agent to react to your message with an emoji badge on its bubble"}},"tui.codexResetFireworks":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Codex Reset Fireworks",description:"Celebrate unscheduled Codex weekly usage resets and newly banked saved resets with a top-third fireworks overlay that remains until Esc"}},"tui.titleState":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Terminal Title Run State",description:"Show the agent run state in the terminal title's separator — an animated spinner while working (a static ':' under WSL), '>' when it's your turn, '!' when the agent is waiting on you"}},"tui.titleSpinner":{type:"enum",default:"braille",values:["braille","pulse","dots","line"],ui:{tab:"appearance",group:"Display",label:"Terminal Title Spinner",description:"Glyph set for the working-state spinner in the terminal title — braille sweep, filling moon, single-dot cycle, or ASCII-safe line",options:[{value:"braille",label:"Braille",description:"Classic ⠋⠙⠹ sweep (default)"},{value:"pulse",label:"Pulse",description:"Moon filling ○◑● then emptying"},{value:"dots",label:"Dots",description:"Single braille dots cycling"},{value:"line",label:"Line",description:"ASCII - \\ | / for fonts without braille coverage"}]}},"tui.hyperlinks":{type:"enum",default:"auto",values:["off","auto","always"],ui:{tab:"appearance",group:"Display",label:"Terminal Hyperlinks",description:"Wrap paths and URLs in OSC 8 hyperlinks for terminal-native click-to-open (auto: detect support; off: never; always: unconditional)"}},"tui.mouse":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Mouse Click-to-Focus",description:"Capture mouse clicks in the main session so live subagent cards and HUD rows focus on click, with a hover highlight on the target. Native text selection becomes Shift+drag and wheel scroll becomes Shift+wheel while on"}},"tui.tight":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Tight Layout",description:"Remove the 1-character horizontal padding from the left and right of the terminal output"}},"display.shimmer":{type:"enum",default:"classic",values:["classic","kitt","disabled"],ui:{tab:"appearance",group:"Display",label:"Shimmer",description:"Animation style for working/loading messages",options:[{value:"classic",label:"Classic",description:"Soft cosine wave sweeping across the text"},{value:"kitt",label:"KITT Scanner",description:"Knight Rider 1982 red light bouncing left-right"},{value:"disabled",label:"Disabled",description:"No animation; static muted text"}]}},"display.pinnedAgents":{type:"enum",default:"collapsed",values:["off","collapsed","full"],ui:{tab:"appearance",group:"Display",label:"Pinned Agents",description:"Pinned live-agent jump list above the editor (off hides it; collapsed shows a few rows with an expander; full lists all)",options:[{value:"off",label:"Off",description:"Hide the pinned jump list"},{value:"collapsed",label:"Collapsed",description:"Show a few rows with an expander"},{value:"full",label:"Full",description:"Always list every live agent"}]}},"display.subagentLivePreview":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Subagent Live Preview",description:"Show each pinned subagent's current (or most recent) tool call beneath its row"}},"display.smoothStreaming":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Smooth Streaming",description:"Reveal assistant text and streamed tool input smoothly while chunks arrive"}},"display.hideToolActivity":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Hide Tool Activity",description:"Hide model-initiated tool calls and results from the transcript"}},"display.showTokenUsage":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Show Token Usage",description:"Show per-turn token usage on assistant messages"}},"display.showTurnTime":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Show Turn Time",description:"Show the total prompt-to-yield time (including tool calls) on assistant message usage rows"}},"display.cacheMissMarker":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Cache Miss Marker",description:"Show a divider after an assistant turn whose request lost (missed) the prompt cache"}},"display.collapseCompacted":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Collapse Compacted History",description:"Collapse pre-compaction history behind the summary divider on the live transcript; disable to keep the full transcript inline with dividers at each compaction point"}},showHardwareCursor:{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Show Hardware Cursor",description:"Show terminal cursor for IME support"}},"tui.imeSafeCursor":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"IME-Safe Prompt Layout",description:"Move the prompt's bottom border to a separate row so macOS IME preedit cannot displace it"}},steeringMode:{type:"enum",default:"one-at-a-time",values:["all","one-at-a-time"],ui:{tab:"interaction",group:"Input",label:"Steering Mode",description:"How to process queued messages while agent is working"}},followUpMode:{type:"enum",default:"one-at-a-time",values:["all","one-at-a-time"],ui:{tab:"interaction",group:"Input",label:"Follow-Up Mode",description:"How to drain follow-up messages after a turn completes"}},interruptMode:{type:"enum",default:"immediate",values:["immediate","wait"],ui:{tab:"interaction",group:"Input",label:"Interrupt Mode",description:"When steering messages interrupt tool execution"}},"tui.vimMode":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Input",label:"Vim Editing Mode",description:"Modal prompt editing. Esc leaves Insert mode; Normal mode has hjkl, 0, $, ^, w, b, e, gg, G, counts, x/D/C, dd/yy, p and u; operators take motions or text objects (diw, ca(, dap); v/V start a Visual selection that y copies and d deletes"}},"tui.vimModeDisplay":{type:"enum",default:"text",values:["text","icon","none"],ui:{tab:"interaction",group:"Input",label:"Vim Mode Indicator",description:"How the current Vim mode appears in the status line",condition:"vimModeEnabled",options:[{value:"text",label:"Text",description:"Full mode name — NORMAL, INSERT, VISUAL, V-LINE, REPLACE"},{value:"icon",label:"Icon",description:"Single compact glyph per mode"},{value:"none",label:"Hidden",description:"Do not show the mode in the status line"}]}},"loop.mode":{type:"enum",default:"prompt",values:["prompt","compact","reset"],ui:{tab:"interaction",group:"Input",label:"Loop Mode",description:"What happens between /loop iterations before re-submitting the prompt",options:[{value:"prompt",label:"Prompt",description:"Re-submit the prompt as a follow-up message (current behavior)"},{value:"compact",label:"Compact",description:"Compact the session context, then re-submit the prompt"},{value:"reset",label:"Reset",description:"Start a new session, then re-submit the prompt"}]}},"loop.conditionTimeoutMs":{type:"number",default:30000,ui:{tab:"interaction",group:"Input",label:"Loop Condition Timeout (ms)",description:"Max wait for a `/loop --while` / `--until` condition command before treating it as broken and stopping the loop. Set to 0 to wait indefinitely",options:[{value:"0",label:"Unlimited"},{value:"10000",label:"10 seconds"},{value:"30000",label:"30 seconds"},{value:"120000",label:"2 minutes"}]}},"composer.recallClearedDrafts":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Input",label:"Recall Cleared Drafts",description:"Keep drafts cleared with Ctrl+C in local Up/Down history until exit; disabling affects future clears"}},doubleEscapeAction:{type:"enum",default:"rewind",values:["rewind","tree","none"],ui:{tab:"interaction",group:"Input",label:"Double-Escape Action",description:"What pressing Esc twice with an empty editor does: open the transcript rewind selector, open the session tree, or nothing"}},"input.bareExitOnEmptySession":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Input",label:"Bare Exit on Empty Session",description:"Submitting exactly `exit`, `quit`, or `q` (any case) before the first message quits instead of prompting the model"}},"input.bareSlashCommands":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Input",label:"Bare Slash Commands",description:"Submitting exactly a command name without the leading `/` (e.g. `model`, `compact`) runs that slash command; once the session has messages, press Enter twice to confirm"}},treeFilterMode:{type:"enum",default:"default",values:["default","no-tools","user-only","labeled-only","all"],ui:{tab:"interaction",group:"Input",label:"Session Tree Filter",description:"Default filter mode when opening the session tree"}},autocompleteMaxVisible:{type:"number",default:10,ui:{tab:"interaction",group:"Input",label:"Autocomplete Items",description:"Max visible items in autocomplete dropdown (3-20)",options:[{value:"3",label:"3 items"},{value:"5",label:"5 items"},{value:"7",label:"7 items"},{value:"10",label:"10 items"},{value:"15",label:"15 items"},{value:"20",label:"20 items"}]}},"spelling.typoDetection":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Input",label:"Typo Detection (macOS)",description:"Mark misspelled prompt words with the active macOS dictionaries",condition:"macOS"}},"spelling.autocomplete":{type:"enum",default:"auto",values:["off","auto","ngram","smollm","apple"],ui:{tab:"interaction",group:"Input",label:"Word Autocomplete",description:"Show predicted word completions as inline hints: Tab accepts with a space, Right without",options:[{value:"off",label:"Off",description:"No word completion"},{value:"auto",label:"Auto",description:"N-gram (nothing to download)"},{value:"ngram",label:"N-gram",description:"Learns your vocabulary from prompt history"},{value:"smollm",label:"SmolLM",description:"Small on-device language model blended with N-gram (downloads weights on first use)"},{value:"apple",label:"Apple",description:"macOS dictionary completions"}]}},"composer.predictions":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Input",label:"Composer Predictions",description:"After a completed turn, ask the active model to predict your next message and show it as ghost text in the empty composer; Tab or Right inserts it without sending. Extra usage: every completed turn sends one more billed request over the whole conversation (counted in /stats)"}},"spelling.autocorrect":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Input",label:"Autocorrect (macOS)",description:"Apply confident macOS spelling corrections after completed words",condition:"macOS"}},emojiAutocomplete:{type:"boolean",default:!0,ui:{tab:"interaction",group:"Input",label:"Emoji Autocomplete",description:"Suggest emojis from `:name:` shortcodes and expand text emoticons like `:D` or `:-)`"}},"paste.largeMenuThreshold":{type:"number",default:100,ui:{tab:"interaction",group:"Input",label:"Large Paste Menu",description:"When a paste reaches this many lines, offer a menu to wrap it in a code block, wrap it in XML tags, or save it to a file. 0 disables the menu (large pastes still collapse to a [Paste] marker).",options:[{value:"0",label:"Off"},{value:"100",label:"100 lines"},{value:"250",label:"250 lines"},{value:"500",label:"500 lines"},{value:"1000",label:"1000 lines"}]}},"startup.quiet":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Startup & Updates",label:"Quiet Startup",description:"Skip welcome screen and startup status messages"}},"startup.showSplash":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Startup & Updates",label:"Show Startup Splash",description:"Show the full animated setup splash on normal interactive startup without rerunning setup. Quiet Startup still suppresses it."}},"startup.setupWizard":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Startup & Updates",label:"Setup Wizard",description:"Show newly added onboarding steps once per setup version"}},"startup.checkUpdate":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Startup & Updates",label:"Check for Updates",description:"Check for omp updates on startup"}},"update.channel":{type:"enum",default:"stable",values:["stable","canary"],ui:{tab:"interaction",group:"Startup & Updates",label:"Update Channel",description:"Update channel used by omp update and the startup update check",options:[{value:"stable",label:"Stable"},{value:"canary",label:"Canary"}]}},"marketplace.autoUpdate":{type:"enum",default:"notify",values:["off","notify","auto"],ui:{tab:"interaction",group:"Startup & Updates",label:"Marketplace Auto-Update",description:"Check for plugin updates on startup",options:[{value:"off",label:"Off",description:"Don't check for plugin updates"},{value:"notify",label:"Notify",description:"Check on startup and notify when updates are available"},{value:"auto",label:"Auto",description:"Check on startup and auto-install updates"}]}},"startup.changelogMode":{type:"enum",default:"summary",values:["summary","expanded","hidden"],ui:{tab:"interaction",group:"Startup & Updates",label:"Startup Changelog",description:"Choose whether update notes start as a summary, full details, or stay hidden",options:[{value:"summary",label:"Summary",description:"Show release and change counts with a /changelog hint"},{value:"expanded",label:"Expanded",description:"Show the recent release notes in full"},{value:"hidden",label:"Hidden",description:"Do not show release notes on startup"}]}},"magicKeywords.enabled":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Magic Keywords",description:"Enable hidden notices for standalone ultrathink, orchestrate, workflowz, jevify keywords"}},"magicKeywords.ultrathink":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Ultrathink Keyword",description:"Let standalone ultrathink request maximum automatic thinking and append its hidden notice"}},"magicKeywords.orchestrate":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Orchestrate Keyword",description:"Let standalone orchestrate append its hidden multi-agent orchestration notice"}},"magicKeywords.workflow":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Workflow Keyword",description:"Let standalone workflowz append its hidden eval workflow notice"}},"magicKeywords.jevify":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Jevify Keyword",description:"Let standalone jevify append its hidden bulk-judge classification notice"}},"completion.notify":{type:"enum",default:"on",values:["on","off"],ui:{tab:"interaction",group:"Notifications",label:"Completion Notification",description:"Notify when the agent finishes a turn"}},"error.notify":{type:"enum",default:"off",values:["on","off"],ui:{tab:"interaction",group:"Notifications",label:"Error Notification",description:"Notify when the agent stops with an error"}},"ask.timeout":{type:"number",default:0,ui:{tab:"interaction",group:"Notifications",label:"Ask Timeout",description:"Auto-select the recommended ask option after this many seconds (0 disables). Also bounds cfg:// approval prompts; an unanswered approval denies the write instead of auto-selecting",options:[{value:"0",label:"Disabled"},{value:"15",label:"15 seconds"},{value:"30",label:"30 seconds"},{value:"60",label:"60 seconds"},{value:"120",label:"120 seconds"}]}},"ask.notify":{type:"enum",default:"on",values:["on","off"],ui:{tab:"interaction",group:"Notifications",label:"Ask Notification",description:"Notify when the ask tool is waiting for input"}},"recap.enabled":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Notifications",label:"Idle Recap",description:"Generate a brief LLM recap of where things stand after the terminal has been idle"}},"recap.idleSeconds":{type:"number",default:240,ui:{tab:"interaction",group:"Notifications",label:"Idle Recap Delay",description:"Seconds to wait while idle before showing the recap",options:[{value:"60",label:"1 minute"},{value:"120",label:"2 minutes"},{value:"240",label:"4 minutes"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"}]}},"power.sleepPrevention":{type:"enum",default:"idle",values:["off","idle","display","system"],ui:{tab:"interaction",group:"Power",label:"Sleep Prevention",description:"Prevent the system sleeping during active sessions. Each level is cumulative — it adds the flags of all lower levels.",options:[{value:"off",label:"Off",description:"Do not prevent any sleep"},{value:"idle",label:"Prevent Idle Sleep",description:"Keep the system awake while a session is open (macOS `caffeinate -i`)"},{value:"display",label:"Prevent Display Sleep",description:"Also keep the display from idle-sleeping (macOS `caffeinate -i -d`)"},{value:"system",label:"Prevent System Sleep",description:"Also block all system sleep on AC and declare the user active (macOS `caffeinate -i -d -s -u`)"}]}},"prewalk.enabled":{type:"boolean",default:!1,ui:{tab:"model",group:"Prewalk",label:"Enable Prewalk",description:"Start on the active model, then switch to a fast/cheap model (default the 'smol' role) at the first edit/write after the plan nudge's todo list exists — the strong model plans, commits the todos, and starts the implementation before handing off. Overridable per session with --prewalk / --no-prewalk."}},"prewalk.auto":{type:"enum",default:"off",values:["off","suggest","on"],ui:{tab:"model",group:"Prewalk",label:"Auto Prewalk",description:"Ask the native judge resolved through the 'judge' role whether each new top-level user task front-loads its hard reasoning. Needs a native judge; without one nothing is classified. Independent of Enable Prewalk.",options:[{value:"off",label:"Off",description:"Never classify prompts for prewalk"},{value:"suggest",label:"Suggest",description:"Classify each task and report the decision without arming prewalk"},{value:"on",label:"On",description:"For confidently front-loaded tasks, arm a handoff from the active model to the auto target; the next task starts back on the planning model"}]}},"prewalk.autoTarget":{type:"string",default:"@smol",ui:{tab:"model",group:"Prewalk",label:"Auto-prewalk target",description:"Model or role (default '@smol') auto-prewalk hands off to at the first edit/write."}},"providers.maxInFlightRequests":{type:"record",default:{},ui:{tab:"providers",group:"Services",label:"Max In-Flight Requests",description:'Maximum concurrent LLM requests per provider id (for example "openai" or "anthropic"), shared across local OMP processes with this config root. Omitted providers are unlimited.'}},"images.describeForTextModels":{type:"boolean",default:!0,ui:{tab:"model",group:"Vision",label:"Describe Images for Text Models",description:"When an image is attached to a model without vision support, save it under local:// and inject a description from a vision-capable model instead of dropping it"}},defaultThinkingLevel:{type:"enum",default:"high",values:["minimal","low","medium","high","xhigh","max","auto"],ui:{tab:"model",group:"Thinking",label:"Thinking Level",description:"Reasoning depth for thinking-capable models",options:[{value:"auto",label:"auto",description:"Auto-detect per prompt"},{value:"minimal",label:"min",description:"Very brief reasoning (~1k tokens)"},{value:"low",label:"low",description:"Light reasoning (~2k tokens)"},{value:"medium",label:"medium",description:"Moderate reasoning (~8k tokens)"},{value:"high",label:"high",description:"Deep reasoning (~16k tokens)"},{value:"xhigh",label:"xhigh",description:"Extended reasoning (~32k tokens)"},{value:"max",label:"max",description:"Maximum reasoning the model supports"}]}},hideThinkingBlock:{type:"boolean",default:!1,ui:{tab:"model",group:"Thinking",label:"Hide Thinking Blocks",description:"Hide thinking blocks in assistant responses"}},expandThinkingBlocks:{type:"boolean",default:!1,ui:{tab:"model",group:"Thinking",label:"Expand Thinking Blocks",description:"Keep finished thinking blocks expanded instead of collapsing them when the turn ends",condition:"nativeRendering"}},proseOnlyThinking:{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Prose Only Thinking",description:"Omit code blocks from thinking summaries and replace them with an ellipsis"}},omitThinking:{type:"boolean",default:!1,ui:{tab:"model",group:"Thinking",label:"Omit Thinking summaries",description:"Instruct upstream providers to completely omit thinking summaries from responses (where supported)"}},externalThinking:{type:"boolean",default:!1,ui:{tab:"model",group:"Thinking",label:"External Thinking",description:"Private scratchpad; not shown to user. Disables supported GPT, Claude, and Gemini reasoning",warning:"At your own risk: providers have flagged this request shape as abuse, up to account-level enforcement"}},"model.loopGuard.enabled":{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Loop Guard",description:"Enable automatic stream loop detection for model reasoning and prose"}},"model.loopGuard.checkAssistantContent":{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Loop Guard Scan Prose",description:"Apply loop guard to assistant prose messages in addition to thinking logs"}},"model.loopGuard.toolCallReminder":{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Loop Guard Tool-Call Reminder",description:"When a Gemini reasoning stream emits many consecutive planning headers without calling a tool, interrupt it and inject a reminder to issue a tool call (requires Loop Guard)"}},"model.toolCallLoopGuard.enabled":{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Tool-Call Loop Guard",description:"Detect consecutive identical tool calls across turns and inject a corrective steer"}},"model.toolCallLoopGuard.threshold":{type:"number",default:5,ui:{tab:"model",group:"Thinking",label:"Tool-Call Loop Threshold",description:"Consecutive identical tool calls required before the corrective steer is injected"}},"model.toolCallLoopGuard.exemptTools":{type:"array",default:["wait"],ui:{tab:"model",group:"Thinking",label:"Tool-Call Loop Exempt Tools",description:"Tool names that may repeat consecutively without triggering the cross-turn loop guard"}},inlineToolDescriptors:{type:"enum",default:"auto",values:["auto","on","off"],ui:{tab:"model",group:"Prompt",label:"Inline Tool Descriptors",description:"Render full tool descriptors in the system prompt and strip top-level/nested descriptions from provider tool schemas so descriptor text is sent once. Auto enables this for Gemini models and disables it otherwise",options:[{value:"auto",label:"Auto",description:"Inline descriptors for Gemini models; keep them in tool schemas otherwise"},{value:"on",label:"On",description:"Always inline descriptors in the system prompt"},{value:"off",label:"Off",description:"Keep descriptors in provider tool schemas only"}]}},includeModelInPrompt:{type:"boolean",default:!0,ui:{tab:"model",group:"Prompt",label:"Include Model in Prompt",description:"Surface the active model identifier in the system prompt so the agent knows which model it is"}},includeWorkspaceTree:{type:"boolean",default:!1,ui:{tab:"model",group:"Prompt",label:"Include Workspace Tree",description:"Render the workspace directory tree in the system prompt. WARNING: This can bust prompt caching across sessions when files are modified."}},skillful:{type:"boolean",default:!0,ui:{tab:"model",group:"Prompt",label:"List Skills in Prompt",description:"List available skills in the system prompt; disable to save context and toggle per-session with /skillful"}},personality:{type:"enum",default:"default",values:["default","friendly","pragmatic","none"],ui:{tab:"model",group:"Prompt",label:"Personality",description:"Communication style rendered into the system prompt's personality block",options:[{value:"default",label:"Default",description:"Terse, evidence-first engineer; dense, action-oriented replies"},{value:"friendly",label:"Friendly",description:"Warm, encouraging collaborator focused on momentum and morale"},{value:"pragmatic",label:"Pragmatic",description:"Direct, efficient engineer focused on clarity and rigor"},{value:"none",label:"None",description:"Omit the personality block entirely"}]}},temperature:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Temperature",description:"Sampling temperature (0 = deterministic, 1 = creative, -1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0",label:"0",description:"Deterministic"},{value:"0.2",label:"0.2",description:"Focused"},{value:"0.5",label:"0.5",description:"Balanced"},{value:"0.7",label:"0.7",description:"Creative"},{value:"1",label:"1",description:"Maximum variety"}]}},topP:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Top P",description:"Nucleus sampling cutoff (0-1, -1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0.1",label:"0.1",description:"Very focused"},{value:"0.3",label:"0.3",description:"Focused"},{value:"0.5",label:"0.5",description:"Balanced"},{value:"0.9",label:"0.9",description:"Broad"},{value:"1",label:"1",description:"No nucleus filtering"}]}},topK:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Top K",description:"Sample from top-K tokens (-1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"1",label:"1",description:"Greedy top token"},{value:"20",label:"20",description:"Focused"},{value:"40",label:"40",description:"Balanced"},{value:"100",label:"100",description:"Broad"}]}},minP:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Min P",description:"Minimum probability threshold (0-1, -1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0.01",label:"0.01",description:"Very permissive"},{value:"0.05",label:"0.05",description:"Balanced"},{value:"0.1",label:"0.1",description:"Strict"}]}},presencePenalty:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Presence Penalty",description:"Penalty for introducing already-present tokens (-1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0",label:"0",description:"No penalty"},{value:"0.5",label:"0.5",description:"Mild novelty"},{value:"1",label:"1",description:"Encourage novelty"},{value:"2",label:"2",description:"Strong novelty"}]}},repetitionPenalty:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Repetition Penalty",description:"Penalty for repeated tokens (-1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0.8",label:"0.8",description:"Allow repetition"},{value:"1",label:"1",description:"No penalty"},{value:"1.1",label:"1.1",description:"Mild penalty"},{value:"1.2",label:"1.2",description:"Balanced"},{value:"1.5",label:"1.5",description:"Strong penalty"}]}},textVerbosity:{type:"enum",default:"medium",values:["low","medium","high"],ui:{tab:"model",group:"Sampling",label:"Text Verbosity",description:"OpenAI Responses and Codex response verbosity (low, medium, or high)",options:[{value:"low",label:"Low",description:"Prefer concise responses"},{value:"medium",label:"Medium",description:"Balance brevity and detail (default)"},{value:"high",label:"High",description:"Prefer detailed responses"}]}},"tier.openai":{type:"enum",default:"none",values:["none","auto","default","flex","scale","priority","ultrafast"],ui:{tab:"model",group:"Sampling",label:"Service Tier — OpenAI",description:"Processing tier for OpenAI / OpenAI-Codex requests, and OpenAI-family models routed via OpenRouter (none = omit). Sent as `service_tier`.",options:[{value:"none",label:"None",description:"Omit service_tier (standard processing)"},{value:"auto",label:"Auto",description:"Provider default tier selection"},{value:"default",label:"Default",description:"Standard priority processing"},{value:"flex",label:"Flex",description:"Lower cost, higher latency when available"},{value:"scale",label:"Scale",description:"Scale Tier credits when available"},{value:"priority",label:"Priority",description:"Faster, higher cost (premium request)"},{value:"ultrafast",label:"Ultrafast",description:"Lowest-latency serving; OpenAI API preview access, or Codex models that advertise it"}]}},"tier.anthropic":{type:"enum",default:"none",values:["none","priority"],ui:{tab:"model",group:"Sampling",label:"Service Tier — Anthropic",description:'Processing tier for Claude requests. `priority` realizes fast mode (`speed: "fast"`) on supported direct Anthropic models; ignored on Bedrock/Vertex Claude and via OpenRouter.',options:[{value:"none",label:"None",description:"Standard processing"},{value:"priority",label:"Priority",description:'Fast mode (`speed: "fast"`) on supported direct Claude models; ignored on Bedrock/Vertex'}]}},"tier.google":{type:"enum",default:"none",values:["none","flex","priority"],ui:{tab:"model",group:"Sampling",label:"Service Tier — Google",description:"Processing tier for Gemini (Google AI Studio + Vertex) requests, and Google-family models routed via OpenRouter (none = omit). Sent as the top-level `serviceTier` field.",options:[{value:"none",label:"None",description:"Standard processing"},{value:"flex",label:"Flex",description:"Lower cost, higher latency (Gemini API + Vertex)"},{value:"priority",label:"Priority",description:"Faster, higher reliability (Gemini API + Vertex)"}]}},"tier.subagent":{type:"enum",default:"inherit",values:["inherit","none","auto","default","flex","scale","priority","ultrafast"],ui:{tab:"model",group:"Sampling",label:"Service Tier — Subagent",description:"Service Tier for spawned task/eval subagents. Inherit = match the main agent's live per-family tiers (tracks /fast); pick a value to apply it to whichever family the subagent's model belongs to.",options:[{value:"inherit",label:"Inherit",description:"Match the main agent's live per-family tiers"},{value:"none",label:"None",description:"Standard processing"},{value:"auto",label:"Auto",description:"Provider default tier selection (OpenAI family)"},{value:"default",label:"Default",description:"Standard priority processing (OpenAI family)"},{value:"flex",label:"Flex",description:"Flexible capacity tier (OpenAI/Google families)"},{value:"scale",label:"Scale",description:"Scale Tier credits (OpenAI family)"},{value:"priority",label:"Priority",description:"Priority on every supported family of the spawned model"},{value:"ultrafast",label:"Ultrafast",description:"Ultrafast serving (OpenAI family, where available)"}]}},"tier.advisor":{type:"enum",default:"none",values:["inherit","none","auto","default","flex","scale","priority","ultrafast"],ui:{tab:"model",group:"Sampling",label:"Service Tier — Advisor",description:"Service Tier for the advisor model. None = standard processing; Inherit = match the main agent's live per-family tiers; pick a value to apply it to the advisor model's family.",options:[{value:"inherit",label:"Inherit",description:"Match the main agent's live per-family tiers"},{value:"none",label:"None",description:"Standard processing"},{value:"auto",label:"Auto",description:"Provider default tier selection (OpenAI family)"},{value:"default",label:"Default",description:"Standard priority processing (OpenAI family)"},{value:"flex",label:"Flex",description:"Flexible capacity tier (OpenAI/Google families)"},{value:"scale",label:"Scale",description:"Scale Tier credits (OpenAI family)"},{value:"priority",label:"Priority",description:"Priority on every supported family of the spawned model"},{value:"ultrafast",label:"Ultrafast",description:"Ultrafast serving (OpenAI family, where available)"}],condition:"advisorEnabled"}},"retry.maxRetries":{type:"number",default:10,ui:{tab:"model",group:"Retry & Fallback",label:"Retry Attempts",description:"Maximum retry attempts on API errors",options:[{value:"1",label:"1 retry"},{value:"2",label:"2 retries"},{value:"3",label:"3 retries"},{value:"5",label:"5 retries"},{value:"10",label:"10 retries"}]}},"retry.maxDelayMs":{type:"number",default:300000,ui:{tab:"model",group:"Retry & Fallback",label:"Max Retry Delay",description:"Maximum wait between retries, in ms. When the provider asks us to wait longer than this and no credential or model fallback succeeds, the request fails fast instead of sleeping (e.g. 3-hour Anthropic rate-limit windows). 0 disables the ceiling — to let the session auto-resume through provider-stated quota resets."}},"retry.waitForUsageReset":{type:"boolean",default:!1,ui:{tab:"model",group:"Retry & Fallback",label:"Wait For Usage Reset",description:"When a provider reports usage-limit exhaustion with a reset time (5-hour or weekly quota windows on any provider), sleep until the reset instead of failing fast past retry.maxDelayMs. Waits are abortable (Esc) but also hold subagents, so leave off for unattended runs."}},"retry.modelFallback":{type:"boolean",default:!0,ui:{tab:"model",group:"Retry & Fallback",label:"Retry Model Fallback",description:"Allow retry recovery to switch to models in retry.fallbackChains after provider errors. Independent of Auto-Promote Context"}},"retry.fallbackOn":{type:"enum",default:"any",values:["any","usage-limit","except-usage-limit"],ui:{tab:"model",group:"Retry & Fallback",label:"Fallback Trigger",description:"Which failed requests may switch to a configured fallback model",options:[{value:"any",label:"Any error",description:"Every provider error may switch models"},{value:"usage-limit",label:"Usage limits only",description:"Switch only on a usage limit; retry other errors on the same model, then surface them"},{value:"except-usage-limit",label:"All but usage limits",description:"Wait out or surface a usage limit; switch on other errors"}]}},"retry.usageAwareFallback":{type:"boolean",default:!1,ui:{tab:"model",group:"Retry & Fallback",label:"Usage-Aware Fallback",description:"Use reliable coding-plan quota reports to prefer same-provider accounts, then configured fallback models, before a hard usage limit. Ordinary configured API keys are excluded."}},"retry.usageReservePct":{type:"number",default:10,ui:{tab:"model",group:"Retry & Fallback",label:"Reserve Margin",description:"Treat a coding-plan model as near its limit below this remaining percentage. Unknown or unmapped usage keeps the primary model.",condition:"usageAwareFallbackEnabled",options:[{value:"5",label:"5%",description:"Act only when nearly exhausted"},{value:"10",label:"10%",description:"Balanced safety margin"},{value:"15",label:"15%",description:"Conservative"},{value:"20",label:"20%",description:"Early protection"},{value:"25",label:"25%",description:"Very conservative"}]}},"retry.usageReservePolicy":{type:"enum",default:"confirm",values:["confirm","auto","fail-closed"],ui:{tab:"model",group:"Retry & Fallback",label:"Reserve Policy",description:"What to do when every same-provider coding-plan account is inside the reserve margin.",condition:"usageAwareFallbackEnabled",options:[{value:"confirm",label:"Confirm interactively",description:"Keep interactive sessions on the primary until confirmed; background agents auto-fallback"},{value:"auto",label:"Auto-fallback",description:"Always select the next eligible configured fallback"},{value:"fail-closed",label:"Fail closed",description:"Do not spend reserve quota or select a fallback"}]}},"retry.fallbackChains":{type:"record",default:{},ui:{tab:"model",group:"Retry & Fallback",label:"Retry Fallback Chains",description:`JSON object mapping model roles, model selectors ("provider/model-id"), or provider wildcards ("provider/*") to ordered fallback selectors, e.g. {"default":["openai/gpt-4o-mini"],"google-antigravity/*":["google/*","google-vertex/*"]}. Model-oriented keys apply whenever that model/provider is active, regardless of role; a "provider/*" entry keeps the failing model's id and swaps the provider. An id-prefixed wildcard ("openrouter/google/*") re-prefixes the failing model's bare id (google-antigravity/gemini-x -> openrouter/google/gemini-x) and, used as a key, matches only that provider's ids under the prefix. A fallback entry may carry an explicit thinking suffix ("provider/model:low", ":high", ":max", ":off"); a bare entry inherits the failing turn's effort, and "provider/*" entries always inherit.`}},"retry.fallbackRevertPolicy":{type:"enum",default:"cooldown-expiry",values:["cooldown-expiry","never"],ui:{tab:"model",group:"Retry & Fallback",label:"Fallback Revert Policy",description:"When to return to the primary model after a fallback",options:[{value:"cooldown-expiry",label:"Cooldown expiry",description:"Return to the primary model after its suppression window ends"},{value:"never",label:"Never",description:"Stay on the fallback model until manually changed"}]}},"providers.anthropic.serverSideFallback":{type:"boolean",default:!1,ui:{tab:"model",group:"Retry & Fallback",label:"Anthropic Server-Side Fallback (Fable 5)",description:"When a Claude Fable 5 / Mythos 5 request is blocked by Anthropic's safety classifier, retry it on Claude Opus 5 server-side (Anthropic `server-side-fallback-2026-06-01` beta). Opt-in — leaving this off preserves the pre-fallback behavior for every request."}},"providers.ollama-cloud.maxConcurrency":{type:"number",default:3,ui:{tab:"providers",group:"Services",label:"Ollama Cloud Max Concurrency",description:"Maximum concurrent Ollama Cloud subagent runs per process; 0 disables the provider-specific limit"}},"providers.webSearchTimeoutSeconds":{type:"number",default:60,ui:{tab:"providers",group:"Services",label:"Web Search Timeout",description:"Hard timeout for each provider's search transport before web_search advances to the next fallback, in seconds (maximum 300)",options:[{value:"30",label:"30 seconds"},{value:"60",label:"1 minute"},{value:"120",label:"2 minutes"},{value:"180",label:"3 minutes"},{value:"300",label:"5 minutes"}]}},"providers.antigravityEndpoint":{type:"enum",default:"auto",values:["auto","production","sandbox"],ui:{tab:"providers",group:"Services",label:"Antigravity Endpoint Mode",description:"Endpoint routing strategy for google-antigravity providers (chat, search, image, discovery)",options:[{value:"auto",label:"Auto",description:"Try production endpoint, fail over to sandbox on 5xx/429"},{value:"production",label:"Production Only",description:"Force production endpoint only"},{value:"sandbox",label:"Sandbox Only",description:"Force sandbox endpoint only"}]}},"providers.fireworksTier":{type:"enum",default:"standard",values:["standard","priority"],ui:{tab:"providers",group:"Fireworks",label:"Fireworks Tier",description:'Serving path for Fireworks requests. Priority sends `service_tier: "priority"` for higher reliability during peak traffic at a higher price; Standard omits it. Fast (`-fast`) models ignore this — Fast is its own serving path.',options:[{value:"standard",label:"Standard",description:"Default serving path (no service_tier)"},{value:"priority",label:"Priority",description:"Priority serving path: higher reliability, premium per-token pricing"}]}},"providers.tinyModelDevice":{type:"enum",default:"default",values:["default","gpu","cpu","mlx","metal","webgpu","cuda","dml","coreml","auto","wasm","webnn","webnn-gpu","webnn-cpu","webnn-npu"],ui:{tab:"providers",group:"Tiny Model",label:"Tiny Model Device",description:"Inference backend for local tiny models (titles + memory): an ONNX execution provider, or `mlx` to download MLX weights and run them through mlx-lm on Apple silicon. Default uses CPU-only ONNX. The PI_TINY_DEVICE env var overrides this.",options:[{value:"default",label:"Default",description:"CPU-only inference"},{value:"gpu",label:"GPU",description:"Accelerated provider (WebGPU/Metal, CUDA, or DirectML)"},{value:"cpu",label:"CPU",description:"CPU-only inference"},{value:"mlx",label:"MLX",description:"Apple silicon GPU via mlx-lm (Python subprocess; macOS arm64)"},{value:"metal",label:"Metal",description:"Alias for MLX"},{value:"webgpu",label:"WebGPU",description:"WebGPU/Metal backend"},{value:"cuda",label:"CUDA",description:"NVIDIA CUDA (Linux x64)"},{value:"dml",label:"DirectML",description:"DirectML backend (Windows)"},{value:"coreml",label:"CoreML",description:"Apple CoreML (opt-in; can fail to load)"},{value:"auto",label:"Auto",description:"Let ONNX Runtime choose a provider"},{value:"wasm",label:"WASM",description:"WebAssembly backend"},{value:"webnn",label:"WebNN",description:"WebNN backend"},{value:"webnn-gpu",label:"WebNN GPU",description:"WebNN GPU device"},{value:"webnn-cpu",label:"WebNN CPU",description:"WebNN CPU device"},{value:"webnn-npu",label:"WebNN NPU",description:"WebNN NPU device"}]}},"providers.tinyModelDtype":{type:"enum",default:"default",values:["default","q4","q4f16","q8","fp16","fp32","int8","uint8","bnb4","q2","q2f16","q1","q1f16","auto"],ui:{tab:"providers",group:"Tiny Model",label:"Tiny Model Precision",description:"ONNX quantization/precision for local tiny models. Default uses each model's shipped dtype (q4); lower precision is faster, higher is more faithful. Ignored by the MLX backend (its repos are pre-quantized 4-bit). The PI_TINY_DTYPE env var overrides this.",options:[{value:"default",label:"Default",description:"Each model's shipped dtype (currently q4)"},{value:"q4",label:"q4",description:"4-bit weights; smallest and fastest"},{value:"q4f16",label:"q4f16",description:"4-bit weights with fp16 activations"},{value:"q8",label:"q8",description:"8-bit quantization"},{value:"fp16",label:"fp16",description:"16-bit float; higher fidelity, larger"},{value:"fp32",label:"fp32",description:"Full precision; largest and slowest"},{value:"int8",label:"int8",description:"Signed 8-bit integer"},{value:"uint8",label:"uint8",description:"Unsigned 8-bit integer"},{value:"bnb4",label:"bnb4",description:"bitsandbytes 4-bit"},{value:"q2",label:"q2",description:"2-bit weights"},{value:"q2f16",label:"q2f16",description:"2-bit weights with fp16 activations"},{value:"q1",label:"q1",description:"1-bit weights"},{value:"q1f16",label:"q1f16",description:"1-bit weights with fp16 activations"},{value:"auto",label:"Auto",description:"Let transformers.js choose per device"}]}},"providers.autoThinkingMaxEffort":{type:"enum",default:"xhigh",values:["xhigh","max"],ui:{tab:"model",group:"Thinking",label:"Auto Thinking Ceiling",description:"Highest effort the `auto` classifier may resolve. `xhigh` keeps the classifier one tier below the top, so only an explicit `ultrathink` reaches `max`; `max` lets a turn the classifier judges exceptional bill the top tier on models that expose it.",condition:"autoThinkingActive",options:[{value:"xhigh",label:"xhigh",description:"Classifier stops at xhigh (default)"},{value:"max",label:"max",description:"Classifier may resolve max where the model supports it"}]}},"features.unexpectedStopDetection":{type:"enum",default:"mechanical",values:["none","mechanical","smart"],ui:{tab:"interaction",group:"Agent",label:"Unexpected Stops",description:"Automatically recover when the assistant stops without a visible message. Smart also classifies text-only stops with a small model.",options:[{value:"none",label:"None",description:"Disabled"},{value:"mechanical",label:"Mechanical",description:"Retry stops with no visible assistant message; tool calls are excluded (default)"},{value:"smart",label:"Smart",description:"Mechanical + small-model classification of text-only stops"}]}},"providers.kimiApiFormat":{type:"enum",default:"auto",values:["auto","openai","anthropic"],ui:{tab:"providers",group:"Protocol",label:"Kimi API Format",description:"API format for Kimi Code provider (auto follows live model metadata)",options:[{value:"auto",label:"Auto",description:"Use the model's server-declared protocol"},{value:"openai",label:"OpenAI",description:"api.kimi.com"},{value:"anthropic",label:"Anthropic",description:"api.moonshot.ai"}]}},"providers.openaiWebsockets":{type:"enum",default:"auto",values:["auto","off","on"],ui:{tab:"providers",group:"Protocol",label:"OpenAI WebSockets",description:"Websocket policy for OpenAI Codex models (auto uses model defaults, on forces, off disables)",options:[{value:"auto",label:"Auto",description:"Use model/provider default websocket behavior"},{value:"off",label:"Off",description:"Disable websockets for OpenAI Codex models"},{value:"on",label:"On",description:"Force websockets for OpenAI Codex models"}]}},"providers.openaiLiveSteering":{type:"boolean",default:!0,ui:{tab:"providers",group:"Protocol",label:"OpenAI Live Steering",description:"Deliver messages typed while a GPT-6 response streams into that response over the Codex WebSocket, instead of waiting for the next tool boundary"}},"providers.muse-code.storeResponses":{type:"boolean",default:!1,ui:{tab:"providers",group:"Protocol",label:"Muse Code Stored Responses",description:"Store Muse Code results on Meta's servers so a turn whose connection drops is recovered instead of re-run. Stored runs keep prompts and outputs on Meta's side."}},"providers.cacheRetention":{type:"enum",default:"auto",values:["auto","short","long","none"],ui:{tab:"providers",group:"Protocol",label:"Prompt Cache Retention",description:"Prompt-cache retention forwarded to providers that support it (Anthropic, Bedrock, OpenRouter, OpenAI)",options:[{value:"auto",label:"Auto",description:"Provider default — Anthropic OAuth subscriber sessions default to 1h, API keys use 5m; PI_CACHE_RETENTION still applies"},{value:"short",label:"Short (5m)",description:"Cheapest cache writes; pair with cache warming to keep short entries alive while idle"},{value:"long",label:"Long (1h)",description:"1h TTL where the provider supports it; pricier writes, only warmed during active runs"},{value:"none",label:"Off",description:"Disable prompt caching and cache-affinity routing"}]}},"providers.cacheWarming":{type:"enum",default:"idle",values:["off","streaming","idle"],ui:{tab:"providers",group:"Protocol",label:"Cache Warming",description:"Re-send the last request with a one-token output budget shortly before its prompt-cache entry expires",options:[{value:"off",label:"Off",description:"Disable cache warming"},{value:"streaming",label:"Streaming",description:"Protect expensive prefixes during long tool executions; stops when the agent settles"},{value:"idle",label:"Idle",description:"Also refresh 5-minute entries between runs while the expected savings stay above the cost floor"}]}},"providers.streamFirstEventTimeoutSeconds":{type:"number",default:-1,ui:{tab:"providers",group:"Timeouts",label:"Stream First Event Timeout",description:"Seconds to wait for the first model stream event; -1 uses provider/env defaults, 0 disables the watchdog",options:[{value:"-1",label:"Auto",description:"Use provider defaults and PI_* timeout env vars"},{value:"0",label:"Off",description:"Disable first-event timeout"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"},{value:"1800",label:"30 minutes"}]}},"providers.streamIdleTimeoutSeconds":{type:"number",default:-1,ui:{tab:"providers",group:"Timeouts",label:"Stream Idle Timeout",description:"Seconds a model stream may stay silent between events; -1 uses provider/env defaults, 0 disables the watchdog",options:[{value:"-1",label:"Auto",description:"Use provider defaults and PI_* timeout env vars"},{value:"0",label:"Off",description:"Disable idle timeout"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"},{value:"1800",label:"30 minutes"}]}},"providers.openrouterVariant":{type:"enum",default:"default",values:["default","nitro","floor","online","exacto"],ui:{tab:"providers",group:"Protocol",label:"OpenRouter Routing",description:"Default routing-variant suffix appended to OpenRouter model IDs (overridden when the selector already names a variant)",options:[{value:"default",label:"Default",description:"No suffix; use OpenRouter's default routing"},{value:"nitro",label:":nitro",description:"Prioritize throughput / lowest latency"},{value:"floor",label:":floor",description:"Prioritize cheapest available provider"},{value:"online",label:":online",description:"Enable OpenRouter's web-search plugin"},{value:"exacto",label:":exacto",description:"Cherry-picked high-quality providers (only defined for select models)"}]}},"live.voice":{type:"enum",default:"sol",values:["arbor","breeze","cove","ember","juniper","maple","sol","spruce","vale"],ui:{tab:"providers",group:"Services",label:"Live Voice",description:"Voice used by Codex-backed realtime voice sessions",options:[{value:"arbor",label:"Arbor"},{value:"breeze",label:"Breeze"},{value:"cove",label:"Cove"},{value:"ember",label:"Ember"},{value:"juniper",label:"Juniper"},{value:"maple",label:"Maple"},{value:"sol",label:"Sol"},{value:"spruce",label:"Spruce"},{value:"vale",label:"Vale"}]}},"tts.localVoice":{type:"enum",default:"af_heart",values:["af_heart","af_bella","af_nicole","af_aoede","af_kore","af_sarah","am_michael","am_fenrir","am_puck","bf_emma","bm_george","bm_fable"],ui:{tab:"providers",group:"Services",label:"Local TTS Voice",description:"Kokoro voice used by the local TTS backend (American/British, female/male)",options:[{value:"af_heart",label:"Heart (American female)"},{value:"af_bella",label:"Bella (American female)"},{value:"af_nicole",label:"Nicole (American female)"},{value:"af_aoede",label:"Aoede (American female)"},{value:"af_kore",label:"Kore (American female)"},{value:"af_sarah",label:"Sarah (American female)"},{value:"am_michael",label:"Michael (American male)"},{value:"am_fenrir",label:"Fenrir (American male)"},{value:"am_puck",label:"Puck (American male)"},{value:"bf_emma",label:"Emma (British female)"},{value:"bm_george",label:"George (British male)"},{value:"bm_fable",label:"Fable (British male)"}]}},"tts.localSpeed":{type:"number",default:1,ui:{tab:"providers",group:"Services",label:"Local TTS Speed",description:"Speaking rate of the local TTS backend (tts tool, omp say). 1 = normal; clamped to 0.5–2.5",options:[{value:"0.5",label:"0.5×"},{value:"0.75",label:"0.75×"},{value:"1",label:"1× (normal)"},{value:"1.25",label:"1.25×"},{value:"1.5",label:"1.5×"},{value:"1.75",label:"1.75×"},{value:"2",label:"2×"},{value:"2.5",label:"2.5×"}]}},"speech.enabled":{type:"boolean",default:!1,ui:{tab:"providers",group:"Services",label:"Speech Vocalization",description:"Speak the assistant's output aloud through the speakers as it streams"}},"speech.mode":{type:"enum",default:"assistant",values:["all","assistant","yield"],ui:{tab:"providers",group:"Services",label:"Speech Vocalization Mode",description:"What to speak: all = assistant messages + thinking; assistant = messages only; yield = only the final message at turn end",options:[{value:"all",label:"All (messages + thinking)"},{value:"assistant",label:"Assistant messages"},{value:"yield",label:"Final message only"}]}},"speech.enhanced":{type:"boolean",default:!1,ui:{tab:"providers",group:"Services",label:"Enhanced Speech Rewriting",description:"Rewrite assistant output into natural spoken prose with the tiny/smol model before synthesis (describes code, drops links and markdown). Falls back to mechanical cleanup on failure"}},"speech.voice":{type:"enum",default:"af_heart",values:["af_heart","af_bella","af_nicole","af_aoede","af_kore","af_sarah","am_michael","am_fenrir","am_puck","bf_emma","bm_george","bm_fable"],ui:{tab:"providers",group:"Services",label:"Speech Vocalization Voice",description:"Kokoro voice used when speaking the assistant's output aloud",options:[{value:"af_heart",label:"Heart (American female)"},{value:"af_bella",label:"Bella (American female)"},{value:"af_nicole",label:"Nicole (American female)"},{value:"af_aoede",label:"Aoede (American female)"},{value:"af_kore",label:"Kore (American female)"},{value:"af_sarah",label:"Sarah (American female)"},{value:"am_michael",label:"Michael (American male)"},{value:"am_fenrir",label:"Fenrir (American male)"},{value:"am_puck",label:"Puck (American male)"},{value:"bf_emma",label:"Emma (British female)"},{value:"bm_george",label:"George (British male)"},{value:"bm_fable",label:"Fable (British male)"}]}},"speech.speed":{type:"number",default:1,ui:{tab:"providers",group:"Services",label:"Speech Vocalization Speed",description:"Speaking rate when reading the assistant's output aloud. 1 = normal; clamped to 0.5–2.5",options:[{value:"0.5",label:"0.5×"},{value:"0.75",label:"0.75×"},{value:"1",label:"1× (normal)"},{value:"1.25",label:"1.25×"},{value:"1.5",label:"1.5×"},{value:"1.75",label:"1.75×"},{value:"2",label:"2×"},{value:"2.5",label:"2.5×"}]}},"providers.fetch":{type:"enum",default:"auto",values:["auto","native","trafilatura","lynx","parallel","firecrawl","jina"],ui:{tab:"providers",group:"Services",label:"Fetch Provider",description:"Reader backend priority for the fetch/read URL tool",options:[{value:"auto",label:"Auto",description:"Priority: native > trafilatura > lynx > parallel > firecrawl > jina"},{value:"native",label:"Native",description:"In-process HTML→Markdown converter (always available)"},{value:"trafilatura",label:"Trafilatura",description:"Auto-installs via uv/pip"},{value:"lynx",label:"Lynx",description:"Requires lynx system package"},{value:"parallel",label:"Parallel",description:"Requires PARALLEL_API_KEY"},{value:"firecrawl",label:"Firecrawl",description:"Requires FIRECRAWL_API_KEY"},{value:"jina",label:"Jina",description:"Uses r.jina.ai reader (JINA_API_KEY optional)"}]}},"codexResets.autoRedeem":{type:"enum",default:"unset",values:["unset","yes","no"],ui:{tab:"providers",group:"Services",label:"Codex Auto-Redeem Saved Resets",description:"Spend saved Codex rate-limit resets automatically: restore an account blocked by an exhausted 5h or weekly window when a turn is stuck and no other account can take over, and salvage credits that are about to expire. unset asks before the first spend (with no prompt UI, it spends only a reset expiring within 5 minutes), yes spends without prompting, and no disables both checks.",options:[{value:"unset",label:"Unset",description:"Check eligibility, then ask before spending the first saved reset. With no prompt UI, spend only a reset expiring within 5 minutes."},{value:"yes",label:"Yes",description:"Spend eligible saved resets without prompting."},{value:"no",label:"No",description:"Do not run the saved-reset auto-redeem check."}]}},"codexResets.minBlockedMinutes":{type:"number",default:60,ui:{tab:"providers",group:"Services",label:"Codex Auto-Redeem Min Block",description:"Only auto-redeem when the natural unblock — the latest reset among the exhausted 5h/weekly windows — is at least this many minutes away (don't spend a scarce credit to save a short wait). Raise it (e.g. 360) to ignore 5h-only blocks."}},"codexResets.keepCredits":{type:"number",default:0,ui:{tab:"providers",group:"Services",label:"Codex Auto-Redeem Reserve",description:"Never auto-spend below this many saved resets (0 = the last credit may be spent automatically). Credits about to expire are exempt — a reserved credit that expires preserves nothing."}},"codexResets.salvageHorizonHours":{type:"number",default:12,ui:{tab:"providers",group:"Services",label:"Codex Reset Salvage Horizon",description:"With auto-redeem enabled, spend a saved Codex reset within this many hours of expiry when either chat window has meaningful usage. 0 disables early salvage; credits expiring within 5 minutes are still attempted regardless of usage."}},"claudeResets.autoRedeem":{type:"enum",default:"unset",values:["unset","yes","no"],ui:{tab:"providers",group:"Services",label:"Claude Auto-Redeem Resets",description:"Spend eligible Claude Cedar or Juniper resets automatically. Cedar is spent only for covered limits; Juniper can only recover a sole 5-hour block. unset asks before the first spend (with no prompt UI, it spends only a reset expiring within 5 minutes), yes spends without prompting, and no disables blocked recovery and expiry salvage.",options:[{value:"unset",label:"Unset",description:"Check live eligibility, then ask before spending the first Claude reset. With no prompt UI, spend only a reset expiring within 5 minutes."},{value:"yes",label:"Yes",description:"Spend eligible Claude resets without prompting."},{value:"no",label:"No",description:"Do not run Claude reset auto-redeem checks."}]}},"claudeResets.minBlockedMinutes":{type:"number",default:60,ui:{tab:"providers",group:"Services",label:"Claude Auto-Redeem Min Block",description:"Only auto-redeem when the natural unblock — the latest reset among the exhausted covered windows — is at least this many minutes away. A 5-hour-only reset is never used for a weekly or model-scoped block."}},"claudeResets.keepCredits":{type:"number",default:0,ui:{tab:"providers",group:"Services",label:"Claude Auto-Redeem Reserve",description:"Keep at least this many Claude resets banked (0 allows the last eligible reset to be spent automatically). The reserve applies to early salvage, but not to eligible resets expiring within 5 minutes."}},"claudeResets.salvageHorizonHours":{type:"number",default:12,ui:{tab:"providers",group:"Services",label:"Claude Reset Salvage Horizon",description:"With auto-redeem enabled, use a server-selected Cedar reset within this many hours of expiry when its covered windows have meaningful usage. 0 disables early salvage; eligible Cedar or Juniper resets expiring within 5 minutes are still attempted regardless of usage or reserve. Provider limit requirements still apply."}},"provider.appendOnlyContext":{type:"enum",default:"auto",values:["auto","on","off"],ui:{tab:"providers",group:"Protocol",label:"Append-Only Context",description:"Cache system prompt + tool specs and keep an append-only message log so provider prefix caches (DeepSeek, Xiaomi/SGLang, Anthropic) hit at maximum rate. Auto enables for known prefix-cache providers.",options:[{value:"auto",label:"Auto",description:"Enable for known prefix-cache providers (recommended)"},{value:"on",label:"On",description:"Always enable append-only context"},{value:"off",label:"Off",description:"Disable append-only context"}]}},"telemetry.otlpExportEnabled":{type:"boolean",default:!0,ui:{tab:"providers",group:"Privacy",label:"OTLP Telemetry Export",description:"Allow OMP to export traces, logs, and metrics using OTEL_* endpoints. Changes take effect on the next launch."}},"advisor.enabled":{type:"boolean",default:!1,ui:{tab:"model",group:"Advisor",label:"Enable Advisor",description:"Pair a second model (assigned to the 'advisor' role) that passively reviews each turn and injects notes."}},"advisor.syncBacklog":{type:"enum",default:"off",values:["off","1","3","5","strict"],ui:{tab:"model",group:"Advisor",label:"Advisor Sync Backlog",description:"Pause main agent until advisor backlog falls below threshold. Numeric values cap wait at 30 seconds; strict waits for all scheduled reviews without a wall-clock cap. Off disables catch-up delays. Abort, failure, and disposal release waits.",condition:"advisorEnabled"}},"advisor.immuneTurns":{type:"number",default:3,ui:{tab:"model",group:"Advisor",label:"Advisor Immune Turns",description:"After an advisor concern or blocker interrupts, route further concerns as non-interrupting asides for this many primary turns. Blockers are exempt from the cooldown.",options:[{value:"0",label:"0 steps",description:"No cooldown."},{value:"1",label:"1 step"},{value:"2",label:"2 steps"},{value:"3",label:"3 steps",description:"Default."},{value:"4",label:"4 steps"},{value:"5",label:"5 steps"}],condition:"advisorEnabled"}},"advisor.continueSeverity":{type:"enum",default:"concern",values:["nit","concern","blocker"],ui:{tab:"model",group:"Advisor",label:"Advisor Continue Severity",description:"Minimum severity of an advisor note that wakes the agent after it finished with a final answer. Lower-severity notes stay as a card at the end of the transcript and reach the agent with your next message.",options:[{value:"nit",label:"Nit",description:"Every note continues the run."},{value:"concern",label:"Concern",description:"Concerns and blockers continue the run. Default."},{value:"blocker",label:"Blocker",description:"Only blockers continue the run."}],condition:"advisorEnabled"}},"advisor.reviewMode":{type:"enum",default:"turn",values:["turn","agent-end"],ui:{tab:"model",group:"Advisor",label:"Advisor Review Mode",description:"Default advisor cadence when no WATCHDOG.yml roster is present. turn reviews every primary turn; agent-end reviews only final yields.",options:[{value:"turn",label:"Every turn",description:"Review every primary update (tool-call round)."},{value:"agent-end",label:"Agent end",description:"Review only at final yields (once per run)."}],condition:"advisorEnabled"}},"advisor.reviewInterval":{type:"number",default:1,ui:{tab:"model",group:"Advisor",label:"Advisor Review Interval",description:"Default advisor cadence when no WATCHDOG.yml roster is present: review every Nth eligible primary update. 1 = every update. Skipped updates are sent with the next scheduled review.",options:[{value:"1",label:"Every eligible update",description:"Default."},{value:"2",label:"Every 2nd"},{value:"3",label:"Every 3rd"},{value:"5",label:"Every 5th"},{value:"10",label:"Every 10th"}],condition:"advisorEnabled"}},"advisor.maxNotesPerUpdate":{type:"number",default:4,ui:{tab:"model",group:"Advisor",label:"Advisor Max Notes Per Update",description:"Maximum non-blocker advice notes accepted per advisor prompt update (1–32; UI offers 1–5 quick picks). Blockers are exempt.",options:[{value:"1",label:"1 note",description:"Anti-flood (strict)."},{value:"2",label:"2 notes"},{value:"3",label:"3 notes"},{value:"4",label:"4 notes",description:"Frontier reasoning models. Default."},{value:"5",label:"5 notes"}],condition:"advisorEnabled"}},"advisor.evictStaleResults":{type:"boolean",default:!0,ui:{tab:"model",group:"Advisor",label:"Advisor Evict Stale Results",description:"Before each review, replace the advisor's read/grep/glob output from older reviews with a short placeholder. The latest review is kept.",condition:"advisorEnabled"}},"workspace.additionalDirectories":{type:"array",default:[],ui:{tab:"context",group:"General",label:"Additional Workspace Dirs",description:"Extra workspace directories added to every session as additional roots (multi-root workspace). Managed live via /add-dir and /remove-dir. Paths resolve relative to cwd; absolute paths recommended. The agent is told these roots exist and can read/grep/glob them."}},"contextFiles.extra":{type:"array",default:[],ui:{tab:"context",group:"General",label:"Extra Context Files",editor:"json",description:'Extra instruction filenames loaded beside AGENTS.md. Use a JSON list of names, not paths, e.g. ["AGENTS.local.md"]; [] disables extras. Start a new session to load them.',condition:"contextFilesExtraNotProject"}},"contextPromotion.enabled":{type:"boolean",default:!1,ui:{tab:"context",group:"General",label:"Auto-Promote Context",description:"Promote to the model's contextPromotionTarget on context overflow instead of compacting. Retry fallback switches are controlled by Retry Model Fallback"}},extendedContext:{type:"boolean",default:!1,ui:{tab:"context",group:"General",label:"Extended Context",description:"Use larger context windows where supported; may incur premium pricing. Off keeps default or standard-pricing windows"}},"compaction.enabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Auto-Compact",description:"Automatically compact context when it gets too large"}},"compaction.experimentalContextManagement":{type:"boolean",default:!1,ui:{tab:"context",group:"Compaction",label:"Notes-backed context windows (experimental)",description:"Keep persistent notes and searchable raw history across context windows."}},"compaction.midTurnEnabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Mid-Turn Compaction",description:"Check thresholds at safe mid-turn tool-loop boundaries before the next provider request; subagents always check, since their whole assignment is one turn"}},"compaction.methodOrder":{type:"array",default:["remote","snapcompact","handoff","shake","soft"],ui:{tab:"context",group:"Compaction",label:"Compaction Method Order",description:"Preferred fallback order for automatic context maintenance; unavailable or failed methods advance to the next choice",options:[{value:"remote",label:"Server compaction",description:"Use provider-native server compaction (OpenAI Responses compact, Anthropic compaction beta, including on Bedrock) when the active route supports it"},{value:"snapcompact",label:"Snapcompact",description:"Archive history onto dense bitmap images the active vision model reads back; no LLM call"},{value:"handoff",label:"Handoff",description:"Generate a handoff document and continue from it as the compaction summary"},{value:"soft",label:"Soft compaction",description:"Summarize in place with a compaction model without using server compaction"},{value:"shake",label:"Shake",description:"Drop recoverable heavy content in place without an LLM call"}],ordered:!0}},"compaction.thresholdPercent":{type:"number",default:-1,ui:{tab:"context",group:"Compaction",label:"Compaction Threshold",description:"Percent threshold for context maintenance; set to Default to use legacy reserve-based behavior",options:[{value:"default",label:"Default",description:"Legacy reserve-based threshold"},{value:"10",label:"10%",description:"Extremely early maintenance"},{value:"20",label:"20%",description:"Very early maintenance"},{value:"30",label:"30%",description:"Early maintenance"},{value:"40",label:"40%",description:"Moderately early maintenance"},{value:"50",label:"50%",description:"Halfway point"},{value:"60",label:"60%",description:"Moderate context usage"},{value:"70",label:"70%",description:"Balanced"},{value:"75",label:"75%",description:"Slightly aggressive"},{value:"80",label:"80%",description:"Typical threshold"},{value:"85",label:"85%",description:"Aggressive context usage"},{value:"90",label:"90%",description:"Very aggressive"},{value:"95",label:"95%",description:"Near context limit"}]}},"compaction.thresholdTokens":{type:"number",default:-1,ui:{tab:"context",group:"Compaction",label:"Compaction Token Limit",description:"Fixed token limit for context maintenance; overrides percentage if set",options:[{value:"default",label:"Default",description:"Use percentage-based threshold"},{value:"25000",label:"25K tokens",description:"1/8 of a 200K window"},{value:"50000",label:"50K tokens",description:"1/4 of a 200K window"},{value:"100000",label:"100K tokens",description:"1/2 of a 200K window"},{value:"150000",label:"150K tokens",description:"3/4 of a 200K window"},{value:"200000",label:"200K tokens",description:"Full standard context window"},{value:"300000",label:"300K tokens",description:"Large context window"},{value:"500000",label:"500K tokens",description:"Very large context window"}]}},"compaction.handoffSaveToDisk":{type:"boolean",default:!1,ui:{tab:"context",group:"Compaction",label:"Save Handoff Docs",description:"Save generated handoff documents to markdown files for the auto-handoff flow"}},"compaction.remoteStreamingV2Enabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Remote Compaction V2",description:"Use Responses streaming compaction for compatible remote compaction models"}},"compaction.asyncEnabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Async Compaction",description:"Speculatively summarize in the background as context nears the compaction threshold, then splice the ready result in when the threshold is crossed"}},"compaction.idleEnabled":{type:"boolean",default:!1,ui:{tab:"context",group:"Compaction",label:"Idle Compaction",description:"Compact context while idle when token count exceeds threshold"}},"compaction.idleThresholdTokens":{type:"number",default:200000,ui:{tab:"context",group:"Compaction",label:"Idle Compaction Threshold",description:"Token count above which idle compaction triggers",options:[{value:"100000",label:"100K tokens"},{value:"200000",label:"200K tokens"},{value:"300000",label:"300K tokens"},{value:"400000",label:"400K tokens"},{value:"500000",label:"500K tokens"},{value:"600000",label:"600K tokens"},{value:"700000",label:"700K tokens"},{value:"800000",label:"800K tokens"},{value:"900000",label:"900K tokens"}]}},"compaction.idleTimeoutSeconds":{type:"number",default:300,ui:{tab:"context",group:"Compaction",label:"Idle Compaction Delay",description:"Seconds to wait while idle before compacting; with a 1-hour prompt cache, compaction instead runs just before the cache expires",options:[{value:"60",label:"1 minute"},{value:"120",label:"2 minutes"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"},{value:"1800",label:"30 minutes"},{value:"3600",label:"1 hour"}]}},"compaction.supersedeReads":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Supersede Stale Reads",description:"Prune older read results when the same file is read again (cache-aware, runs every turn)"}},"compaction.dropUseless":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Elide Uneventful Results",description:"Prune tool results flagged contextually useless (no matches, timed-out waits) once consumed (cache-aware)"}},"snapcompact.systemPrompt":{type:"enum",default:"none",values:["none","agents-md","all"],ui:{tab:"context",group:"Experimental",label:"Snapcompact System Prompt",description:"Experimental: render selected system prompt text as dense PNG image(s) and attach to the first user message (vision models only). Saves tokens; loses prompt caching for imaged text.",options:[{value:"none",label:"None",description:"Keep the system prompt as text."},{value:"agents-md",label:"AGENTS.md",description:"Only move loaded context-file instructions to images, when that saves tokens."},{value:"all",label:"All",description:"Move the full system prompt to images, when that saves tokens."}]}},"snapcompact.toolResults":{type:"boolean",default:!1,ui:{tab:"context",group:"Experimental",label:"Snapcompact Tool Results",description:"Experimental: render large tool results, the newest one included, as dense PNG image(s) instead of text (vision models only). Saves tokens on accumulated search and command output; read results stay text unless the model is known to edit exactly from images."}},"tools.format":{type:"enum",default:"auto",values:["auto","native","glm","hermes","kimi","xml","anthropic","deepseek","harmony","qwen3","gemini","gemma","minimax"],ui:{tab:"context",group:"Experimental",label:"Tool Calling Mode",description:"Controls how tools are exposed to the model. Auto uses provider-native tool calls unless the selected model is marked as not supporting them, then falls back to the GLM owned dialect. Native forces provider-native tools; the other values force the named owned dialect.",options:[{value:"auto",label:"Auto",description:"Use native tool calls unless the model is known not to support them."},{value:"native",label:"Native",description:"Use provider-native tool calls."},{value:"glm",label:"GLM",description:"Use GLM-style in-band tool calls."},{value:"hermes",label:"Hermes",description:"Use Hermes-style in-band tool calls."},{value:"kimi",label:"Kimi",description:"Use Kimi-style in-band tool calls."},{value:"xml",label:"XML",description:"Use generic XML in-band tool calls."},{value:"anthropic",label:"Anthropic",description:"Use Anthropic-style in-band tool calls."},{value:"deepseek",label:"DeepSeek",description:"Use DeepSeek-style in-band tool calls."},{value:"harmony",label:"Harmony",description:"Use Harmony-style in-band tool calls."},{value:"qwen3",label:"Qwen3",description:"Use the Qwen3 owned dialect."},{value:"gemini",label:"Gemini",description:"Use the Gemini owned dialect."},{value:"gemma",label:"Gemma",description:"Use the Gemma owned dialect."},{value:"minimax",label:"MiniMax",description:"Use the MiniMax owned dialect."}]}},"snapcompact.shape":{type:"enum",default:"auto",values:["auto","8x8r-bw","8x8r-sent","8x8u-bw","8x8u-sent","6x6u-bw","6x6u-sent","5x8-bw","5x8-sent","6x12-dim","8x13-bw","8on16-bw","8on22-bw","11on16-bw","silver16-bw","doc-8on16-bw","doc-8on16-sent","doc-8on16-sent-dim"],ui:{tab:"context",group:"Experimental",label:"Snapcompact Shape",description:"Frame shape snapcompact prints text with (compaction archive and inline imaging). Auto picks a shape tuned for the current model.",options:[{value:"auto",label:"Auto",description:"Picks a shape tuned for the current model, falling back to its provider family."},{value:"8x8r-bw",label:"8x8 repeated, black",description:"unscii square cell, black ink, every line printed twice with the copy on a pale highlight band."},{value:"8x8r-sent",label:"8x8 repeated, sentence hues",description:"Repeated grid with ink cycling six hues at sentence boundaries."},{value:"8x8u-bw",label:"8x8, black",description:"Plain unscii square cell, single-printed lines, black ink."},{value:"8x8u-sent",label:"8x8, sentence hues",description:"Plain unscii square cell with sentence-hue ink."},{value:"6x6u-bw",label:"6x6 dense, black",description:"unscii squeezed to 6x6 — densest readable cell, fewest frames — in black ink."},{value:"6x6u-sent",label:"6x6 dense, sentence hues",description:"Densest cell with sentence-hue ink."},{value:"5x8-bw",label:"5x8 legacy, black",description:"Original X.org 5x8 glyphs on the 2576px frame, black ink."},{value:"5x8-sent",label:"5x8 legacy, sentence hues",description:"The original snapcompact shape (pre-shape-table sessions rendered this)."},{value:"6x12-dim",label:"6x12, dimmed stopwords",description:"X.org 6x12 glyphs, black ink, function words dimmed gray."},{value:"8x13-bw",label:"8x13, black",description:"X.org 8x13 glyphs, black ink."},{value:"8on16-bw",label:"8x13 on 16px pitch, black",description:"8x13 glyphs on an 8x16 cell (extra leading), black ink."},{value:"8on22-bw",label:"8x13 on 22px pitch (leading), black",description:"8x13 glyphs on an 8x22 cell — extra line spacing so rows don't crowd. Default for OpenAI/Google."},{value:"11on16-bw",label:"8x13 on 11px advance (tracking), black",description:"8x13 glyphs on an 11x16 cell — extra letter spacing so characters don't merge. Default for Anthropic."},{value:"silver16-bw",label:"Silver 16, CJK",description:"Embedded Silver TrueType font on a 16px grid for CJK and other non-Latin text."},{value:"doc-8on16-bw",label:"Doc 8on16, black",description:"Two word-wrapped newspaper columns of 8x13 glyphs on a 16px pitch, black ink."},{value:"doc-8on16-sent",label:"Doc 8on16, sentence hues",description:"Two-column doc layout with sentence-hue ink."},{value:"doc-8on16-sent-dim",label:"Doc 8on16, sentence hues + dimmed stopwords",description:"Two-column doc layout, sentence-hue ink, function words dimmed gray."}]}},"branchSummary.enabled":{type:"boolean",default:!1,ui:{tab:"context",group:"General",label:"Branch Summaries",description:"Prompt to summarize when leaving a branch"}},"memory.backend":{type:"enum",default:"off",values:["off","local","hindsight","mnemopi","sharpshooter"],ui:{tab:"memory",group:"General",label:"Memory Backend",description:"Off, local summary pipeline, Mnemopi SQLite, Hindsight remote memory, or Sharpshooter",options:[{value:"off",label:"Off",description:"No memory subsystem runs"},{value:"local",label:"Local",description:"Local rollout summarisation pipeline (memory_summary.md)"},{value:"hindsight",label:"Hindsight",description:"Vectorize Hindsight remote memory service"},{value:"mnemopi",label:"Mnemopi",description:"Local SQLite recall/retain backend with optional embeddings"},{value:"sharpshooter",label:"Sharpshooter",description:"Friction-gated project decision files (architecture/product/style), consolidated in the background"}]}},"sharpshooter.model":{type:"string",ui:{tab:"memory",group:"Sharpshooter",label:"Sharpshooter Model",description:"Model selector for extraction/consolidation, empty = smol role"}},"autolearn.enabled":{type:"boolean",default:!1,ui:{tab:"memory",group:"Auto-Learn",label:"Auto-Learn (experimental)",description:"After the agent stops, nudge it to capture lessons to memory and create/enhance isolated managed skills"}},"autolearn.autoContinue":{type:"boolean",default:!1,ui:{tab:"memory",group:"Auto-Learn",label:"Auto-run capture at stop",description:"When on, auto-run one private capture turn at stop (uses extra tokens). When off, only standing auto-learn guidance remains.",condition:"autolearnActive"}},"mnemopi.dbPath":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi DB Path",description:"Optional SQLite DB path. Defaults to the agent memories directory.",condition:"mnemopiActive"}},"mnemopi.bank":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Bank",description:"Optional shared bank base name. Per-project modes derive project-local banks from it.",condition:"mnemopiActive"}},"mnemopi.scoping":{type:"enum",default:"per-project",values:["global","per-project","per-project-tagged"],ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Scoping",description:"global = one shared bank; per-project = isolated bank per cwd; per-project-tagged = project-local writes plus global recall visibility",options:[{value:"global",label:"Global",description:"One shared Mnemopi bank for every project"},{value:"per-project",label:"Per project",description:"Project-local Mnemopi bank per cwd basename"},{value:"per-project-tagged",label:"Per project (tagged)",description:"Write to a project-local bank but merge project + shared recall results"}],condition:"mnemopiActive"}},"mnemopi.embeddingVariant":{type:"enum",default:"en",values:["en","multilingual"],ui:{tab:"memory",group:"Mnemopi",label:"Embedding variant",description:"Local embedding model family. en = stronger English model; multilingual = cross-language model. Changing this rebuilds existing memory embeddings on next start.",options:[{value:"en",label:"English (bge-base-en-v1.5)",description:"BAAI/bge-base-en-v1.5 (768d), English-only"},{value:"multilingual",label:"Multilingual (multilingual-e5-large)",description:"intfloat/multilingual-e5-large (1024d), cross-language recall"}],condition:"mnemopiActive"}},"mnemopi.autoRecall":{type:"boolean",default:!0,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Auto Recall",description:"Recall local memories into the first turn of each session",condition:"mnemopiActive"}},"mnemopi.autoRetain":{type:"boolean",default:!0,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Auto Retain",description:"Retain completed conversation turns into local Mnemopi memory",condition:"mnemopiActive"}},"mnemopi.polyphonicRecall":{type:"boolean",default:!1,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Polyphonic Recall",description:"Fuse recall with graph, fact, vector and temporal voices so linked memories surface without a keyword match",condition:"mnemopiActive"}},"mnemopi.enhancedRecall":{type:"boolean",default:!1,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Enhanced Recall",description:"Cache recall results for repeated and similar queries with identical options; any memory write clears it",condition:"mnemopiActive"}},"mnemopi.proactiveLinking":{type:"boolean",default:!1,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Proactive Linking",description:"Ingest new memories into the episodic graph as they are stored, linking them to related entities and memories",condition:"mnemopiActive"}},"mnemopi.noEmbeddings":{type:"boolean",default:!1,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Disable Embeddings",description:"Force deterministic FTS-only recall instead of vector embeddings",condition:"mnemopiActive"}},"mnemopi.embeddingModel":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Embedding Model",description:"Advanced: explicit embedding model id that overrides the variant. Leave empty to use mnemopi.embeddingVariant.",condition:"mnemopiActive"}},"mnemopi.embeddingApiUrl":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Embedding API URL",description:"Optional OpenAI-compatible embedding endpoint passed to Mnemopi",condition:"mnemopiActive"}},"mnemopi.embeddingApiKey":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Embedding API Key",description:"Optional embedding API key passed to Mnemopi",condition:"mnemopiActive"}},"mnemopi.llmMode":{type:"enum",default:"smol",values:["none","smol","remote"],ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi LLM Mode",description:"Use no LLM, the online tiny model (the TINY role from /models, else @smol), or a remote OpenAI-compatible endpoint",condition:"mnemopiActive",options:[{value:"none",label:"None",description:"Disable Mnemopi LLM-backed extraction"},{value:"smol",label:"Online (tiny)",description:"Use the online tiny model (the TINY role from /models, else @smol)"},{value:"remote",label:"Remote",description:"Use the Mnemopi remote LLM settings below"}]}},"mnemopi.llmBaseUrl":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi LLM Base URL",description:"Optional OpenAI-compatible LLM endpoint for Mnemopi remote mode",condition:"mnemopiActive"}},"mnemopi.llmApiKey":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi LLM API Key",description:"Optional LLM API key for Mnemopi remote mode",condition:"mnemopiActive"}},"mnemopi.llmModel":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi LLM Model",description:"Optional LLM model name for Mnemopi remote mode",condition:"mnemopiActive"}},"hindsight.apiUrl":{type:"string",default:"http://localhost:8888",ui:{tab:"memory",group:"Hindsight",label:"Hindsight API URL",description:"Hindsight server URL (Cloud or self-hosted)",condition:"hindsightActive"}},"hindsight.apiToken":{type:"string",ui:{tab:"memory",group:"Hindsight",label:"Hindsight API Token",description:"Bearer token for authenticated Hindsight servers",condition:"hindsightActive"}},"hindsight.bankId":{type:"string",ui:{tab:"memory",group:"Hindsight",label:"Hindsight Bank ID",description:"Memory bank identifier (default: project name)",condition:"hindsightActive"}},"hindsight.scoping":{type:"enum",default:"per-project-tagged",values:["global","per-project","per-project-tagged"],ui:{tab:"memory",group:"Hindsight",label:"Hindsight Scoping",description:"global = one shared bank; per-project = isolated bank per cwd; per-project-tagged = shared bank with project tags so global + project memories merge on recall",options:[{value:"global",label:"Global",description:"One shared bank — every project sees the same memories"},{value:"per-project",label:"Per project",description:"Isolated bank per cwd basename — projects cannot see each other's memories"},{value:"per-project-tagged",label:"Per project (tagged)",description:"Shared bank, retains tagged with project:<cwd>. Recall surfaces project + untagged global memories together"}],condition:"hindsightActive"}},"hindsight.autoRecall":{type:"boolean",default:!0,ui:{tab:"memory",group:"Hindsight",label:"Hindsight Auto Recall",description:"Recall memories on the first turn of each session",condition:"hindsightActive"}},"hindsight.autoRetain":{type:"boolean",default:!0,ui:{tab:"memory",group:"Hindsight",label:"Hindsight Auto Retain",description:"Retain transcript every N turns and at session boundaries",condition:"hindsightActive"}},"hindsight.retainMode":{type:"enum",default:"full-session",values:["full-session","last-turn"],ui:{tab:"memory",group:"Hindsight",label:"Hindsight Retain Mode",description:"full-session = upsert one document per session, last-turn = chunked",options:[{value:"full-session",label:"Full session",description:"Upsert one document per session (recommended)"},{value:"last-turn",label:"Last turn",description:"Chunked retention sliced by turn boundaries"}],condition:"hindsightActive"}},"hindsight.mentalModelsEnabled":{type:"boolean",default:!0,ui:{tab:"memory",group:"Hindsight",label:"Hindsight Mental Models",description:"Read curated reflect summaries (mental models) into developer instructions at boot. Loads existing models on the bank — does not write. Pair with hindsight.mentalModelAutoSeed to also auto-create the built-in seed set.",condition:"hindsightActive"}},"hindsight.mentalModelAutoSeed":{type:"boolean",default:!0,ui:{tab:"memory",group:"Hindsight",label:"Hindsight Mental Model Auto-Seed",description:"At session start, create any built-in mental models (project-conventions, project-decisions, user-preferences) that do not yet exist on the bank.",condition:"hindsightActive"}},"ttsr.enabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR",description:"Interrupt the agent mid-stream when output matches rule patterns (Time-Traveling Stream Rules)"}},"ttsr.judge":{type:"enum",default:"auto",values:["auto","on","off"],ui:{tab:"context",group:"Rules (TTSR)",label:"Judged Rules",description:"Ask the judge model role each `question` rule about completed replies, reasoning, and tool calls; a yes injects the rule as a warning",options:[{value:"auto",label:"Auto",description:"Judge only when the judge role resolves to a native TypeSafe jev model"},{value:"on",label:"On",description:"Always judge, whichever model the judge role resolves to"},{value:"off",label:"Off",description:"Never judge; question rules stay inactive"}]}},"ttsr.contextMode":{type:"enum",default:"discard",values:["discard","keep"],ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR Context Mode",description:"What to do with partial output when TTSR triggers"}},"ttsr.interruptMode":{type:"enum",default:"always",values:["never","prose-only","tool-only","always"],ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR Interrupt Mode",description:"When to interrupt mid-stream vs inject warning after completion",options:[{value:"always",label:"always",description:"Interrupt on prose and tool streams"},{value:"prose-only",label:"prose-only",description:"Interrupt only on reply/thinking matches"},{value:"tool-only",label:"tool-only",description:"Interrupt only on tool-call argument matches"},{value:"never",label:"never",description:"Never interrupt; inject warning after completion"}]}},"ttsr.repeatMode":{type:"enum",default:"once",values:["once","after-gap"],ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR Repeat Mode",description:"How rules can repeat: once per session or after a message gap"}},"ttsr.repeatGap":{type:"number",default:10,ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR Repeat Gap",description:"Messages before a rule can trigger again",options:[{value:"5",label:"5 messages"},{value:"10",label:"10 messages"},{value:"15",label:"15 messages"},{value:"20",label:"20 messages"},{value:"30",label:"30 messages"}]}},"ttsr.builtinRules":{type:"boolean",default:!0,ui:{tab:"context",group:"Rules (TTSR)",label:"Built-in Rules",description:"Load the default rules shipped with the agent (override individually with ttsr.disabledRules)"}},"ttsr.disabledRules":{type:"array",default:[],ui:{tab:"context",group:"Rules (TTSR)",label:"Disabled Rules",description:"Rule names to ignore entirely (applies to bundled defaults and your own rules)"}},"edit.mode":{type:"enum",default:"hashline",values:["apply_patch","hashline","patch","replace","sloppy"],ui:{tab:"files",group:"Editing",label:"Edit Mode",description:"Select the edit tool variant (replace, patch, hashline, or apply_patch)"}},"edit.fuzzyMatch":{type:"boolean",default:!0,ui:{tab:"files",group:"Editing",label:"Fuzzy Match",description:"Accept high-confidence fuzzy matches for whitespace differences"}},"edit.fuzzyThreshold":{type:"number",default:0.95,ui:{tab:"files",group:"Editing",label:"Fuzzy Match Threshold",description:"Similarity threshold (0-1) for accepting fuzzy matches",options:[{value:"0.85",label:"0.85",description:"Lenient"},{value:"0.90",label:"0.90",description:"Moderate"},{value:"0.95",label:"0.95",description:"Default"},{value:"0.98",label:"0.98",description:"Strict"}]}},"edit.streamingAbort":{type:"boolean",default:!1,ui:{tab:"files",group:"Editing",label:"Abort on Failed Preview",description:"Abort streaming edit tool calls when patch preview fails"}},"edit.recoverInlineEdits":{type:"boolean",default:!0,ui:{tab:"files",group:"Editing",label:"Recover Inline Edit Payloads",description:"Execute edit payloads the model emits as plain text by converting them into edit tool calls"}},"edit.blockAutoGenerated":{type:"boolean",default:!0,ui:{tab:"files",group:"Editing",label:"Block Auto-Generated Files",description:"Prevent editing of files that appear to be auto-generated (protoc, sqlc, swagger, etc.)"}},"edit.enforceSeenLines":{type:"boolean",default:!0,ui:{tab:"files",group:"Editing",label:"Enforce Seen-Line Guard",description:"Reject edits anchored on lines a prior read/search never displayed in full"}},"edit.blackbox.enabled":{type:"boolean",default:!1,ui:{tab:"files",group:"Editing",label:"Record Parse Regressions",description:"Append full before/after source when an edit introduces an AST parse failure"}},"edit.autoRepair.enabled":{type:"boolean",default:!1,ui:{tab:"files",group:"Editing",label:"Auto-Repair Parse Regressions",description:"When an edit breaks a file's AST parse, ask the smol model to fix the broken region (validated by re-parse; falls back to a warning)"}},"tools.artifactSpillThreshold":{type:"number",default:50,ui:{tab:"tools",group:"Output Limits",label:"Artifact Spill Threshold (KB)",description:"Tool output above this size is saved as an artifact; tail is kept inline",options:[{value:"1",label:"1 KB",description:"~250 tokens"},{value:"2.5",label:"2.5 KB",description:"~625 tokens"},{value:"5",label:"5 KB",description:"~1.25K tokens"},{value:"10",label:"10 KB",description:"~2.5K tokens"},{value:"20",label:"20 KB",description:"~5K tokens"},{value:"30",label:"30 KB",description:"~7.5K tokens"},{value:"50",label:"50 KB",description:"Default; ~12.5K tokens"},{value:"75",label:"75 KB",description:"~19K tokens"},{value:"100",label:"100 KB",description:"~25K tokens"},{value:"200",label:"200 KB",description:"~50K tokens"},{value:"500",label:"500 KB",description:"~125K tokens"},{value:"1000",label:"1 MB",description:"~250K tokens"}]}},"tools.artifactTailBytes":{type:"number",default:20,ui:{tab:"tools",group:"Output Limits",label:"Artifact Tail Size (KB)",description:"Amount of tail content kept inline when output spills to artifact",options:[{value:"1",label:"1 KB",description:"~250 tokens"},{value:"2.5",label:"2.5 KB",description:"~625 tokens"},{value:"5",label:"5 KB",description:"~1.25K tokens"},{value:"10",label:"10 KB",description:"~2.5K tokens"},{value:"20",label:"20 KB",description:"Default; ~5K tokens"},{value:"50",label:"50 KB",description:"~12.5K tokens"},{value:"100",label:"100 KB",description:"~25K tokens"},{value:"200",label:"200 KB",description:"~50K tokens"}]}},"tools.artifactHeadBytes":{type:"number",default:20,ui:{tab:"tools",group:"Output Limits",label:"Artifact Head Size (KB)",description:"Amount of head content kept inline alongside the tail when output spills to artifact (middle elision). 0 disables — keep tail only.",options:[{value:"0",label:"0 KB",description:"Disabled; tail-only truncation"},{value:"1",label:"1 KB",description:"~250 tokens"},{value:"2.5",label:"2.5 KB",description:"~625 tokens"},{value:"5",label:"5 KB",description:"~1.25K tokens"},{value:"10",label:"10 KB",description:"~2.5K tokens"},{value:"20",label:"20 KB",description:"Default; ~5K tokens"},{value:"50",label:"50 KB",description:"~12.5K tokens"},{value:"100",label:"100 KB",description:"~25K tokens"},{value:"200",label:"200 KB",description:"~50K tokens"}]}},"tools.outputMaxColumns":{type:"number",default:768,ui:{tab:"tools",group:"Output Limits",label:"Output Column Cap",description:"Per-line byte cap for streaming tool outputs (bash, python, js eval) and `read`. Lines wider than this are ellipsis-truncated; remaining bytes up to the next newline are dropped. 0 disables.",options:[{value:"0",label:"Off",description:"No per-line cap"},{value:"256",label:"256",description:"Tight"},{value:"512",label:"512"},{value:"768",label:"768",description:"Default"},{value:"1024",label:"1024"},{value:"2048",label:"2048"},{value:"4096",label:"4096",description:"Loose"}]}},"tools.artifactTailLines":{type:"number",default:500,ui:{tab:"tools",group:"Output Limits",label:"Artifact Tail Lines",description:"Maximum lines of tail content kept inline when output spills to artifact",options:[{value:"50",label:"50 lines",description:"~250 tokens"},{value:"100",label:"100 lines",description:"~500 tokens"},{value:"250",label:"250 lines",description:"~1.25K tokens"},{value:"500",label:"500 lines",description:"Default; ~2.5K tokens"},{value:"1000",label:"1000 lines",description:"~5K tokens"},{value:"2000",label:"2000 lines",description:"~10K tokens"},{value:"5000",label:"5000 lines",description:"~25K tokens"}]}},"tools.artifactMaxBytes":{type:"number",default:16,ui:{tab:"tools",group:"Output Limits",label:"Artifact File Cap (MB)",description:"Maximum size of the artifact file saved for streaming tool output (bash, python, js eval). Larger output keeps its beginning (up to 3 MB) and its most recent remainder, with a truncation notice between them. 0 = unlimited.",options:[{value:"0",label:"Unlimited",description:"Save the complete output"},{value:"4",label:"4 MB"},{value:"16",label:"16 MB",description:"Default"},{value:"64",label:"64 MB"},{value:"256",label:"256 MB"},{value:"1024",label:"1 GB"}]}},readLineNumbers:{type:"boolean",default:!1,ui:{tab:"files",group:"Reading",label:"Line Numbers",description:"Prepend line numbers to read tool output by default"}},"read.defaultLimit":{type:"number",default:300,ui:{tab:"files",group:"Reading",label:"Default Read Limit",description:"Default number of lines returned when agent calls read without a limit",options:[{value:"200",label:"200 lines"},{value:"300",label:"300 lines"},{value:"500",label:"500 lines"},{value:"1000",label:"1000 lines"},{value:"5000",label:"5000 lines"}]}},"read.renderMarkdown":{type:"boolean",default:!1,ui:{tab:"files",group:"Reading",label:"Markdown Previews",description:"Render Markdown read results as formatted terminal Markdown previews instead of raw source"}},"read.summarize.enabled":{type:"boolean",default:!0,ui:{tab:"files",group:"Read Summaries",label:"Read Summaries",description:"Return structural code summaries when read is called without an explicit selector"}},"read.summarize.prose":{type:"boolean",default:!1,ui:{tab:"files",group:"Read Summaries",label:"Prose Summaries",description:"Return structural summaries for Markdown and plain text reads"}},"read.summarize.minBodyLines":{type:"number",default:4,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Body Lines",description:"Minimum multiline body or literal length before read summaries collapse it"}},"read.summarize.minCommentLines":{type:"number",default:6,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Comment Lines",description:"Minimum multiline block comment length before read summaries collapse it"}},"read.summarize.minTotalLines":{type:"number",default:100,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Minimum File Length",description:"Files with fewer total lines are read verbatim instead of structurally summarized"}},"read.summarize.unfoldUntil":{type:"number",default:50,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Unfold Target",description:"BFS-unfold elidable spans until the summary is at least this many visible lines. 0 keeps only the outermost elisions."}},"read.summarize.unfoldLimit":{type:"number",default:100,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Unfold Ceiling",description:"Hard ceiling on summary size while BFS-unfolding. An unfold whose revealed lines would exceed this is skipped (that span stays folded) and unfolding continues with the remaining spans."}},"read.toolResultPreview":{type:"boolean",default:!1,ui:{tab:"files",group:"Reading",label:"Inline Read Previews",description:"Render read tool results inline in the transcript instead of summary rows"}},"tools.approval":{type:"record",default:{},ui:{tab:"interaction",group:"Approvals",label:"Tool Approval Policies",description:"Per-tool approval policies. Set to 'allow' to auto-approve, 'prompt' to require confirmation, or 'deny' to block. Overrides are honored in every approval mode."}},"tools.approvalMode":{type:"enum",default:"yolo",values:["always-ask","always-ask-cached","write","yolo"],ui:{tab:"interaction",group:"Approvals",label:"Tool Approval",description:"Default approval behavior for tool calls. 'Always ask' auto-approves read-only tools only. 'Ask and remember' also asks before file reads, and can remember a file or folder. 'Write' auto-approves read and workspace-write tools. 'Yolo' auto-approves all tiers; user policy may still prompt or block.",options:[{value:"always-ask",label:"Always ask",description:"Auto-approve read-only tools; require confirmation for write and exec tools."},{value:"always-ask-cached",label:"Ask and remember",description:"Ask before reading or writing a file, with answers that remember the file or its folder for this session or every session; require confirmation for exec tools."},{value:"write",label:"Write",description:"Auto-approve read-only and write tools; require confirmation for exec tools such as bash, eval, browser, and task."},{value:"yolo",label:"Yolo",description:"Auto-approve read, write, and exec tools. User policy can still require confirmation or block calls."}]}},"todo.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Todos",description:"Enable the todo tool for task tracking"}},"todo.reminders":{type:"boolean",default:!0,ui:{tab:"tools",group:"Todos",label:"Todo Reminders",description:"Remind the agent to complete todos before stopping"}},"todo.remindersMax":{type:"number",default:3,ui:{tab:"tools",group:"Todos",label:"Todo Reminder Limit",description:"Maximum number of todo reminders before giving up",options:[{value:"1",label:"1 reminder"},{value:"2",label:"2 reminders"},{value:"3",label:"3 reminders"},{value:"5",label:"5 reminders"}]}},"todo.eager":{type:"enum",default:"default",values:["default","preferred","always"],ui:{tab:"tools",group:"Todos",label:"Create Todos Automatically",description:"How strongly to push automatic todo-list creation after the first message",options:[{value:"default",label:"Default",description:"Model decides; no automatic todo list"},{value:"preferred",label:"Preferred",description:"Suggests a todo list on the first message (reminder, not forced)"},{value:"always",label:"Always",description:"Forces a comprehensive todo list on the first message"}]}},"tasks.todoClearDelay":{type:"number",default:60,ui:{tab:"tools",group:"Todos",label:"Todo Auto-Clear Delay",description:"Delay before completed or abandoned todos are removed from the todo widget",options:[{value:"0",label:"Instant"},{value:"60",label:"1 minute",description:"Default"},{value:"300",label:"5 minutes"},{value:"900",label:"15 minutes"},{value:"1800",label:"30 minutes"},{value:"3600",label:"1 hour"},{value:"-1",label:"Never"}]}},"glob.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Glob",description:"Enable the glob tool for glob-based file lookup"}},"grep.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Grep",description:"Enable the grep tool for regex content search"}},"grep.contextBefore":{type:"number",default:1,ui:{tab:"tools",group:"Grep & Browser",label:"Grep Context Before",description:"Lines of context before each grep match",options:[{value:"0",label:"0 lines"},{value:"1",label:"1 line"},{value:"2",label:"2 lines"},{value:"3",label:"3 lines"},{value:"5",label:"5 lines"}]}},"grep.contextAfter":{type:"number",default:3,ui:{tab:"tools",group:"Grep & Browser",label:"Grep Context After",description:"Lines of context after each grep match",options:[{value:"0",label:"0 lines"},{value:"1",label:"1 line"},{value:"2",label:"2 lines"},{value:"3",label:"3 lines"},{value:"5",label:"5 lines"},{value:"10",label:"10 lines"}]}},"astGrep.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"AST Grep",description:"Enable the ast_grep tool for structural AST search"}},"astEdit.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"AST Edit",description:"Enable the ast_edit tool for structural AST rewrites"}},"find.enabled":{type:"enum",default:"auto",values:["auto","on","off"],ui:{tab:"tools",group:"Available Tools",label:"Find (semantic grep)",description:"Enable the find tool: natural-language search for files and line ranges, judged by the judge model role. Auto enables it only when the judge role resolves to a native TypeSafe jev model",options:[{value:"auto",label:"Auto",description:"Enable when the judge role resolves to a native TypeSafe jev model"},{value:"on",label:"On",description:"Always enable, whichever model the judge role resolves to"},{value:"off",label:"Off",description:"Disable the find tool"}]}},"debug.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Debug",description:"Enable the debug tool for DAP-based debugging"}},"launch.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Services",description:"Enable named bash services and proc:// supervision for shared long-running project processes"}},"speechgen.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Speech Generation",description:"Enable the tts tool for on-device (Kokoro) or xAI Grok Voice speech-file synthesis"}},"generate_image.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Generate Image",description:"Enable the generate_image tool (text-to-image generation and editing). Exposed as an xd:// device when tools.xdev is on."}},"computer.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Computer",description:"Enable the scriptable host-desktop eval prelude (screenshots, input, accessibility)"}},"ratchet.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Ratchet",description:"Enable the ratchet eval/hillclimb prelude; /ratchet turns it on for the current session"}},"archive.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Archive",description:"Enable the read-only archive eval prelude: prompt history, recent projects, past sessions and recaps"}},"computer.display":{type:"string",default:"active",ui:{tab:"tools",group:"Computer",label:"Computer Display",description:"Active window's display (active), all displays (all), or a native display id"}},"computer.maxWidth":{type:"number",default:3840,ui:{tab:"tools",group:"Computer",label:"Computer Screenshot Width",description:"Maximum screenshot width in pixels"}},"computer.maxHeight":{type:"number",default:2400,ui:{tab:"tools",group:"Computer",label:"Computer Screenshot Height",description:"Maximum screenshot height in pixels"}},"computer.backgroundFallback":{type:"enum",default:"takeover",values:["takeover","refuse"],ui:{tab:"tools",group:"Computer",label:"Computer Background Fallback",description:"What window input does when its background route is unavailable: rerun it in takeover and return focus to your app (macOS; elsewhere plain takeover), or refuse, which also keeps the agent from taking the foreground or opening macOS menus itself",options:[{value:"takeover",label:"Takeover",description:"Briefly bring the target forward for that one call, then return focus to your app (on macOS even if you kept typing)"},{value:"refuse",label:"Refuse",description:"Fail the call; nothing takes over, and the agent's own takeover, raise, activating open, desktop input and macOS menus (context menus, popup and menu buttons; they take your keyboard while open) are refused too"}]}},"images.questionTimeoutMs":{type:"number",default:300000,ui:{tab:"tools",group:"Execution",label:"Image Question Timeout",description:"Per-request timeout for the vision-model call behind read's ?q= image questions, in milliseconds. A stalled provider fails fast with a timeout error instead of blocking until manual abort. Set to 0 to disable the timeout.",options:[{value:"0",label:"Disabled"},{value:"60000",label:"1 minute"},{value:"120000",label:"2 minutes"},{value:"180000",label:"3 minutes"},{value:"300000",label:"5 minutes"}]}},"checkpoint.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Checkpoint/Rewind",description:"Enable the checkpoint and rewind tools for context checkpointing"}},"fetch.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Read URLs",description:"Allow the read tool to fetch and process URLs"}},"vault.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Obsidian Vault",description:"Enable the vault:// internal URL for reading and editing Obsidian vault content via the Obsidian CLI. When disabled, vault:// resolution is refused and the vault:// entry is omitted from the system prompt."}},"github.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"GitHub CLI",description:"Enable the github tool (op-based dispatch for repository, issue, pull request, diff, search, checkout, push, and Actions watch workflows)"}},"github.cache.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"GitHub",label:"GitHub View Cache",description:"Cache rendered issue/PR view output in ~/.omp/cache/github-cache.db so repeated reads are free"}},"github.cache.softTtlSec":{type:"number",default:300,ui:{tab:"tools",group:"GitHub",label:"GitHub Cache Soft TTL",description:"Within this window, cached issue/PR view rows are returned directly (seconds; default 5 minutes)"}},"github.cache.hardTtlSec":{type:"number",default:604800,ui:{tab:"tools",group:"GitHub",label:"GitHub Cache Hard TTL",description:"Past the soft TTL the cached row is returned and refreshed in the background; past the hard TTL it is dropped (seconds; default 7 days)"}},"web_search.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Web Search",description:"Enable the web_search tool for live web results"}},"security.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Security",description:"Enable OMP-native security scan planning, execution, and the read-only security:// resource namespace"}},"ask.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Ask",description:"Enable the ask tool for interactive user questions"}},"tools.intentTracing":{type:"boolean",default:!0,ui:{tab:"tools",group:"Execution",label:"Intent Tracing",description:"Ask the agent to describe the intent of each tool call before executing it"}},"tools.abortOnFabricatedResult":{type:"boolean",default:!0,ui:{tab:"tools",group:"Execution",label:"Abort On Fabricated Tool Result",description:"With in-band tool calls, stop the model immediately when it starts hallucinating a tool result mid-turn. Disable to let the model finish generating and discard the fabricated continuation instead."}},"tools.speculativeExecution.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Execution",label:"Experimental Speculative Execution",description:"Enable the discard-safe first slice: validated local reads through direct read calls and nested eval. Network requests, provider completions, and live filesystem writes are not part of this baseline."}},"tools.speculativeExecution.maxInFlight":{type:"number",default:2,ui:{tab:"tools",group:"Execution",label:"Speculative Execution Concurrency",description:"Maximum number of validated local reads allowed to run before normal dispatch.",options:[{value:"1",label:"1 operation"},{value:"2",label:"2 operations"},{value:"3",label:"3 operations"},{value:"4",label:"4 operations"}]}},"tools.maxTimeout":{type:"number",default:0,ui:{tab:"tools",group:"Execution",label:"Max Tool Timeout",description:"Maximum timeout in seconds the agent can set for any tool (0 = no limit)",options:[{value:"0",label:"No limit"},{value:"30",label:"30 seconds"},{value:"60",label:"60 seconds"},{value:"120",label:"120 seconds"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"}]}},"async.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Execution",label:"Async Execution",description:"Enable async bash commands and background task execution"}},"async.widgets":{type:"boolean",default:!0,ui:{tab:"tools",group:"Execution",label:"Live Job Widgets",description:"Draw a live widget for each running background job (charts, bars, status grids derived from its output) in the wait card, the jobs pill and the jobs sheet. The `widget` model role (default: `smol`) writes one spec per job; updates need no further model calls"}},"tools.xdev":{type:"boolean",default:!0,ui:{tab:"tools",group:"Discovery & MCP",label:"xd:// Tools",description:"Mount rarely-used (discoverable) tools under xd:// device URLs driven via read/write instead of shipping their schemas on every request. Sessions whose explicit tool list grants read but omits write mount devices through a device-only write transport (only local:// scratch stays writable besides devices). Disable to expose every enabled tool top-level."}},"tools.xdevDocs":{type:"enum",default:"catalog",values:["inline","builtins","catalog"],ui:{tab:"tools",group:"Discovery & MCP",label:"xd:// Prompt Docs",description:"Choose which mounted-device docs and schemas are inlined in the system prompt. Built-ins keeps core tools inline while MCP and extension tools stay on-demand.",options:[{value:"inline",label:"All Devices",description:"Inline docs and schemas for every mounted device."},{value:"builtins",label:"Built-ins Only",description:"Inline built-in docs; fetch MCP and extension docs on demand."},{value:"catalog",label:"Catalog Only",description:"List every device; fetch all docs on demand."}]}},"tools.xdevInlineDevices":{type:"array",default:[],ui:{tab:"tools",group:"Discovery & MCP",label:"xd:// Inline Devices",description:"When xd:// Prompt Docs is Built-ins Only, inline dynamic devices whose names match these glob patterns (for example mcp__context_mode_*). Catalog Only ignores this setting."}},"dev.autoqa":{type:"boolean",default:!0,ui:{tab:"tools",group:"Developer",label:"Auto QA",description:"Automated tool issue reporting (xd://report_issue). On by default; the first report asks for consent, and denying it disables reporting until re-enabled explicitly"}},"dev.autoqaPush.endpoint":{type:"string",default:"https://qa.omp.sh/v1/grievances",ui:{tab:"tools",group:"Developer",label:"Auto QA Push Endpoint",description:"Full URL receiving Auto QA JSON reports (default https://qa.omp.sh/v1/grievances)"}},"lsp.enabled":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"LSP",description:"Enable the lsp tool for code intelligence (definitions, references, diagnostics, rename)"}},"lsp.lazy":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"Lazy LSP Startup",description:"Start language servers on first use (lsp tool or editing a matching file type) instead of at session startup"}},"lsp.shared":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"Shared Language Servers",description:"Start language servers through the per-project daemon broker. Each connection gets its own server. While another omp instance in the project is running, a released server stays warm and the next connection reuses it instead of cold-starting (falls back to private servers when unavailable)"}},"lsp.formatOnWrite":{type:"boolean",default:!1,ui:{tab:"files",group:"LSP",label:"Format on Write",description:"Automatically format code files using LSP after writing"}},"lsp.diagnosticsOnWrite":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"Diagnostics on Write",description:"Return LSP diagnostics after writing code files"}},"lsp.diagnosticsOnEdit":{type:"boolean",default:!1,ui:{tab:"files",group:"LSP",label:"Diagnostics on Edit",description:"Return LSP diagnostics after editing code files"}},"lsp.diagnosticsDeduplicate":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"Deduplicate Diagnostics",description:"Suppress post-edit LSP diagnostics already shown for a file; only surface new or changed ones"}},"lsp.requestTimeout":{type:"number",default:10,ui:{tab:"files",group:"LSP",label:"Request Timeout",description:"Seconds to wait for a language server's diagnostics, hover and other answers when the agent sets no timeout; late post-edit diagnostics wait at least this long. Raise it for servers that are slow on a cold start. The lsp tool's timeout argument can still raise or lower it per call",options:[{value:"10",label:"10 seconds",description:"Default"},{value:"20",label:"20 seconds"},{value:"30",label:"30 seconds"},{value:"60",label:"1 minute"},{value:"120",label:"2 minutes"},{value:"300",label:"5 minutes"}]}},"bash.enabled":{type:"boolean",default:!0,ui:{tab:"shell",group:"Bash",label:"Bash",description:"Enable the bash tool for shell command execution"}},"bash.allowCompoundCommands":{type:"boolean",default:!1,ui:{tab:"shell",group:"Bash",label:"Allow Compound Commands",description:"Evaluate literal && chains per command; unmatched commands use normal bash approval policy and mode"}},"bash.autoBackground.enabled":{type:"boolean",default:!0,ui:{tab:"shell",group:"Bash",label:"Bash Auto-Background",description:"Automatically background long-running bash commands and deliver the result later"}},"bash.gitGuard":{type:"boolean",default:!1,ui:{tab:"shell",group:"Bash",label:"Git Guard",description:"Refuse git commands that discard or move shared work in the bash tool: stash, reset --hard or to another commit, and checkout/switch/restore outside a merge or rebase conflict"}},"bash.patterns":{type:"array",default:[],ui:{tab:"shell",group:"Bash",label:"Bash Approval Patterns",description:"Ordered bash command approval rules. Each item has match and approval fields; only '*' wildcards are supported."}},"bashInterceptor.enabled":{type:"boolean",default:!1,ui:{tab:"shell",group:"Bash",label:"Bash Interceptor",description:"Block shell commands that have dedicated tools"}},"bash.direnv":{type:"enum",default:"auto",values:["auto","off"],ui:{tab:"shell",group:"Bash",label:"direnv Auto-Load",description:"Auto-load a repo's direnv/devenv `.envrc` into the bash session so devenv tools and env vars are present without manual `direnv exec`. Honors direnv's allow list: an `.envrc` you haven't `direnv allow`ed is never executed"}},"bash.direnvLoadTimeoutMs":{type:"number",default:30000,ui:{tab:"shell",group:"Bash",label:"direnv Load Timeout (ms)",description:"Max wait for the first `direnv export` (a cold devenv shell can be slow); on timeout the session runs without the direnv env"}},"shellMinimizer.enabled":{type:"boolean",default:!0,ui:{tab:"shell",group:"Bash",label:"Shell Minimizer",description:"Compress verbose shell output (git, npm, cargo, etc.) before returning it to the agent"}},"shellMinimizer.sourceOutlineLevel":{type:"enum",default:"default",values:["default","aggressive"],ui:{tab:"shell",group:"Bash",label:"Shell Minimizer Source Outline",description:"Source outline mode for cat/read of source files: default or aggressive"}},"eval.py":{type:"boolean",default:!0,ui:{tab:"shell",group:"Eval & Runtimes",label:"Python Eval Backend",description:"Allow the eval tool to dispatch Python cells to the IPython kernel"}},"eval.js":{type:"boolean",default:!0,ui:{tab:"shell",group:"Eval & Runtimes",label:"JavaScript Eval Backend",description:"Allow the eval tool to dispatch JavaScript cells to the in-process runtime"}},"eval.autoProvision":{type:"boolean",default:!0,ui:{tab:"shell",group:"Eval & Runtimes",label:"Eval Environment Provisioning",description:"Automatically create the managed JavaScript eval package environment on first install"}},"eval.tools.enabled":{type:"boolean",default:!0,ui:{tab:"shell",group:"Eval & Runtimes",label:"Eval-Defined Tools",description:"Let eval cells define tools (@tool in Python, tool(fn) in JS) that task, agent(), and workpool() subagents can call"}},"eval.workpool.freshAgents":{type:"boolean",default:!1,ui:{tab:"shell",group:"Eval & Runtimes",label:"Fresh Workpool Agents",description:"Spawn a new subagent for every workpool item instead of reusing workers or batching queued items"}},"eval.autoBackground.enabled":{type:"boolean",default:!1,ui:{tab:"shell",group:"Eval & Runtimes",label:"Eval Auto-Background",description:"Automatically background long-running eval cells and deliver the result later"}},"python.kernelMode":{type:"enum",default:"session",values:["session","per-call"],ui:{tab:"shell",group:"Eval & Runtimes",label:"Python Kernel Mode",description:"Keep the IPython kernel alive across eval calls or start fresh each time"}},"python.interpreter":{type:"string",default:"",ui:{tab:"shell",group:"Eval & Runtimes",label:"Python Interpreter",description:"Optional path to an exact Python executable. When set, automatic Python runtime discovery is skipped."}},"task.isolation.enabled":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Isolation",label:"Allow Isolated Subagents",description:"Allow per-task isolation with `isolated: true`; tasks without it run in the shared checkout"}},"isolation.backend":{type:"enum",default:"auto",values:["auto","apfs","btrfs","zfs","reflink","overlayfs","projfs","block-clone","rcopy"],ui:{tab:"tasks",group:"Isolation",label:"Isolation Backend",description:"Backend used for subagent isolation and worktree cloning",options:[{value:"auto",label:"Auto",description:"Let the PAL pick the best available backend"},{value:"apfs",label:"APFS",description:"macOS clonefile reflink (APFS)"},{value:"btrfs",label:"btrfs",description:"btrfs subvolume snapshot"},{value:"zfs",label:"ZFS",description:"ZFS snapshot + clone"},{value:"reflink",label:"Reflink",description:"Linux FICLONE per-file reflink"},{value:"overlayfs",label:"Overlayfs",description:"Linux kernel overlay (or fuse-overlayfs fallback)"},{value:"projfs",label:"ProjFS",description:"Windows Projected File System"},{value:"block-clone",label:"Block clone",description:"Windows FSCTL_DUPLICATE_EXTENTS_TO_FILE (NTFS/ReFS)"},{value:"rcopy",label:"Recursive copy",description:"git worktree if available, otherwise recursive copy"}]}},"worktree.clone":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Isolation",label:"Clone Checkout into Worktrees",description:"New worktrees from `github pr_checkout` and `git worktree add` in bash start as a copy-on-write clone of the current checkout so ignored build artifacts (node_modules, target) carry over; falls back to a plain checkout when the filesystem cannot clone"}},"worktree.cleanSource":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Isolation",label:"Clean Source Checkout on /wt",description:"When creating a worktree with `/wt`, reset tracked changes and remove untracked files from the original checkout after carrying them over"}},"worktree.onStart":{type:"enum",default:"off",values:["off","ask","create"],ui:{tab:"tasks",group:"Isolation",label:"Worktree on Start",description:"Whether fresh interactive sessions start in a new linked worktree",options:[{value:"off",label:"Off",description:"Start in the current checkout"},{value:"ask",label:"Ask",description:"Ask at session start"},{value:"create",label:"Create",description:"Always start in a new worktree on a `wt/*` branch"}]}},"worktree.onExit":{type:"enum",default:"keep",values:["keep","ask","remove"],ui:{tab:"tasks",group:"Isolation",label:"Worktree on Exit",description:"What to do on exit with worktrees created since omp started (on start or with `/wt`)",options:[{value:"keep",label:"Keep",description:"Leave worktrees in place"},{value:"ask",label:"Ask",description:"Ask on exit"},{value:"remove",label:"Remove",description:"Remove clean worktrees; ask when they have uncommitted changes or new commits. Gitignored files (e.g. `.env`) are deleted too"}]}},"task.isolation.apply":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Isolation",label:"Apply Isolated Changes",description:"Automatically apply successful isolated task changes to the parent checkout; disable to retain patch or branch artifacts"}},"task.isolation.merge":{type:"enum",default:"patch",values:["patch","branch"],ui:{tab:"tasks",group:"Isolation",label:"Isolation Merge Strategy",description:"How isolated task changes are integrated (patch apply or branch merge)",options:[{value:"patch",label:"Patch",description:"Combine diffs and git apply"},{value:"branch",label:"Branch",description:"Commit per task, merge with --no-ff"}]}},"task.isolation.commits":{type:"enum",default:"generic",values:["generic","ai"],ui:{tab:"tasks",group:"Isolation",label:"Isolation Commit Style",description:"Commit message style for nested repo changes (generic or AI-generated)",options:[{value:"generic",label:"Generic",description:"Static commit message"},{value:"ai",label:"AI",description:"AI-generated commit message from diff"}]}},"worktree.base":{type:"string",ui:{tab:"tasks",group:"Isolation",label:"Worktree Base Directory",description:"Base directory for agent-managed worktrees — task-isolation copies, `github` PR checkouts, and `omp worktree` cleanup all live here. Unset uses ~/.omp/wt. Must be an absolute or ~-relative path; relative paths are ignored. The OMP_WORKTREE_DIR env var overrides this."}},"task.eager":{type:"enum",default:"default",values:["default","preferred","always"],ui:{tab:"tasks",group:"Subagents",label:"Prefer Task Delegation",description:"How strongly to push delegating work to subagents",options:[{value:"default",label:"Default",description:"Uses the selected model's policy; some models require an explicit delegation request"},{value:"preferred",label:"Preferred",description:"Adds delegation guidance to the system prompt"},{value:"always",label:"Always",description:"Prompt guidance plus a first-turn delegation reminder"}]}},"task.batch":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Subagents",label:"Batch Task Calls",description:"Switch the task tool to its batch shape: one call carries { context, tasks[] } — one subagent per item, with an optional per-item agent (defaulting to the session spawn-policy agent), per-item isolation, and a required shared context prepended to every assignment. With async.enabled=true, each spawn runs as an independent background agent with the normal idle/parked lifecycle; otherwise the call blocks for merged results. Disable to restore the flat single-spawn schema."}},"task.structured":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Subagents",label:"Structured Task Results",description:"Expose outputSchema/schemaMode on the task tool and return subagent results through the yield tool, validated against caller or agent output schemas. Off: task subagents have no yield tool and return their final message as plain text, except agents whose definition sets structured: true. Eval agent()/workpool spawns always keep structured results."}},"task.speculativeLaunch":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Subagents",label:"Speculative Task Launch",description:"Start each batch subagent as soon as its tasks[] item finishes streaming instead of waiting for the whole task call. Launched agents are aborted if the finished call fails validation, is blocked, or its arguments change. Requires auto-allowed task approval and no extension tool lifecycle handlers."}},"task.enableEffort":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Subagents",label:"Per-Task Effort",description:"Expose the optional effort parameter on task spawns, allowing callers to override each subagent's thinking level"}},"task.maxConcurrency":{type:"number",default:32,ui:{tab:"tasks",group:"Subagents",label:"Max Concurrent Tasks",description:"Maximum number of subagents running concurrently",options:[{value:"0",label:"Unlimited"},{value:"1",label:"1 task"},{value:"2",label:"2 tasks"},{value:"4",label:"4 tasks"},{value:"8",label:"8 tasks"},{value:"16",label:"16 tasks"},{value:"32",label:"32 tasks"},{value:"64",label:"64 tasks"}]}},"task.enableLsp":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Subagents",label:"LSP in Subagents",description:"Allow subagents spawned via the task tool to use the lsp tool. Off by default to keep subagents cheap; enable when LSP-aware delegation is worth the extra tokens."}},"task.maxRecursionDepth":{type:"number",default:2,ui:{tab:"tasks",group:"Subagents",label:"Max Task Recursion",description:"How many levels deep subagents can spawn their own subagents",options:[{value:"-1",label:"Unlimited"},{value:"0",label:"None"},{value:"1",label:"Single"},{value:"2",label:"Double"},{value:"3",label:"Triple"}]}},"task.maxRuntimeMs":{type:"number",default:0,ui:{tab:"tasks",group:"Subagents",label:"Max Subagent Runtime",description:"Hard wall-clock limit per subagent (ms). 0 disables it. Defense-in-depth against provider-side stream hangs that escape the inference-layer watchdog; triggers a normal subagent abort with a 'timed out' reason.",options:[{value:"0",label:"Unlimited",description:"Default"},{value:"300000",label:"5 minutes"},{value:"900000",label:"15 minutes"},{value:"1800000",label:"30 minutes"},{value:"3600000",label:"1 hour"}]}},"task.completionProbe":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Subagents",label:"Subagent Completion Probe",description:"Ask a working subagent, through a cached side request like /btw, to estimate how complete its task is: after 2, 5, 10 and 30 more minutes, then hourly. The estimate shows next to the subagent in wait and task views. Only subagents spawned by the main agent of an interactive session are asked; print, RPC, ACP and SDK runs never probe."}},"task.agentIdleTtlMs":{type:"number",default:420000,ui:{tab:"tasks",group:"Subagents",label:"Agent Idle TTL",description:"How long an idle subagent stays live in memory before being parked to disk (ms). Parked agents are revived automatically when messaged or resumed. 0 keeps idle agents live until exit."}},"task.softRequestBudget":{type:"number",default:200,ui:{tab:"tasks",group:"Subagents",label:"Soft Subagent Request Budget",description:"Soft per-subagent request budget (assistant requests per run). Crossing it injects a wrap-up steering notice (see task.softRequestBudgetNotice); at 1.5x the budget the run is force-stopped and the agent must hand back its partial findings. 0 disables the guard. Bundled scout/sonic agents cap out at a lower built-in budget, so a value below that cap still applies to them. A task.agentSoftRequestBudget entry replaces this budget for the agent it names.",options:[{value:"0",label:"Disabled"},{value:"90",label:"90 requests"},{value:"150",label:"150 requests"},{value:"200",label:"200 requests",description:"Default"}]}},"task.softRequestBudgetNotice":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Subagents",label:"Soft Request Budget Notice",description:"Inject one steering notice when a subagent crosses its soft request budget, asking it to wrap up before the 1.5x forced-yield stop."}},"task.maxEffort":{type:"enum",default:"max",values:["minimal","low","medium","high","xhigh","max"],ui:{tab:"tasks",group:"Subagents",label:"Maximum Per-Spawn Effort",description:"Maximum reasoning effort allowed for the task tool's per-spawn effort hint. Lower values prevent callers from escalating subagents above this ceiling; the default preserves the model's full range.",options:[{value:"minimal",label:"min",description:"Very brief reasoning (~1k tokens)"},{value:"low",label:"low",description:"Light reasoning (~2k tokens)"},{value:"medium",label:"medium",description:"Moderate reasoning (~8k tokens)"},{value:"high",label:"high",description:"Deep reasoning (~16k tokens)"},{value:"xhigh",label:"xhigh",description:"Extended reasoning (~32k tokens)"},{value:"max",label:"max",description:"Maximum reasoning the model supports"}]}},"task.prewalk":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Subagents",label:"Generic Task Prewalk",description:"Arm prewalk for the bundled generic `task` subagent: it starts on its resolved model, plans and begins the implementation, then hands off to the 'smol' role at its first edit/write. Per-agent overrides (task.agentPrewalk, configured from the /agents hub) and user agent `prewalk` frontmatter apply regardless of this toggle."}},"task.showResolvedModelBadge":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Show Resolved Model Badge",description:"Display the actual model ID used by each subagent in the task widget status line"}},"plan.enabled":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Modes",label:"Plan Mode",description:"Enable plan mode for read-only exploration and planning before execution"}},"plan.defaultOnStartup":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Modes",label:"Start in Plan Mode",description:"Automatically enter plan mode at the start of every new session",condition:"planModeEnabled"}},"plan.autosave":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Modes",label:"Autosave Plans",description:"Automatically save approved plans to disk when plan mode completes",condition:"planModeEnabled"}},"plan.autosaveDir":{type:"string",ui:{tab:"tasks",group:"Modes",label:"Autosave Directory",description:"Directory for autosaved plans. Supports ~, absolute, and cwd-relative paths. Empty uses <project>/.omp/plans/.",condition:"planAutosaveEnabled"}},"goal.enabled":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Modes",label:"Goal Mode",description:"Enable per-session goal mode and the hidden goal tool"}},"goal.statusInFooter":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Modes",label:"Goal Status in Footer",description:"Show token budget alongside the goal indicator in the status line"}},"goal.continuationModes":{type:"array",default:["interactive"],ui:{tab:"tasks",group:"Modes",label:"Goal Continuation Modes",description:'Run modes where active goals may auto-continue between turns ("interactive", "rpc")'}},"title.icons":{type:"enum",default:"nf+emoji",values:["nf+emoji","emoji","boring"],ui:{tab:"appearance",group:"Display",label:"Title Icons",description:"Icon and short code that head new generated or /rename session titles",options:[{value:"nf+emoji",label:"Nerd Font + Emoji",description:"Nerd Font glyph where the Nerd Font symbol preset renders it, else the emoji (default)"},{value:"emoji",label:"Emoji",description:"Always the emoji"},{value:"boring",label:"Boring",description:"Plain title: no icon or code"}]}},"title.generator":{type:"enum",default:"fork",values:["fork","tiny"],ui:{tab:"tasks",group:"Modes",label:"Title Generator",description:"What names an untitled session from the user's messages",options:[{value:"fork",label:"Fork",description:"A side turn of the reply on the session's model: reads its prompt cache, adds the card icon (default)"},{value:"tiny",label:"Tiny",description:"The title model role only; plain titles without a card"}]}},"title.refreshOnReplan":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Modes",label:"Refresh Title on Replan",description:"Refresh generated session titles after todo init replans unless the title was set by the user"}},"skills.registryUrl":{type:"string",default:"https://skills.omp.sh",ui:{tab:"interaction",group:"Skills",label:"Skill Registry",description:"Skillshare registry used by `omp skill` to install, search, and publish skills (https://host[:port])"}},"skills.enableSkillCommands":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Commands & Skills",label:"Skill Commands",description:"Register skills as /skill:name commands"}},"commands.enableClaudeUser":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Commands & Skills",label:"Claude User Commands",description:"Load commands from ~/.claude/commands/"}},"commands.enableClaudeProject":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Commands & Skills",label:"Claude Project Commands",description:"Load commands from .claude/commands/"}},"commands.enableOpencodeUser":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Commands & Skills",label:"OpenCode User Commands",description:"Load commands from ~/.config/opencode/commands/"}},"commands.enableOpencodeProject":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Commands & Skills",label:"OpenCode Project Commands",description:"Load commands from .opencode/commands/"}},"extensionHandlers.toolCallTimeoutMs":{type:"number",default:30000,ui:{tab:"tools",group:"Extensions",label:"Tool Call Handler Timeout (ms)",description:"Positive finite active-work timeout for extension tool_call handlers; invalid values use 30000ms, and time awaiting OMP-owned dialogs does not count"}},"exa.enabled":{type:"boolean",default:!0,ui:{tab:"providers",group:"Services",label:"Exa",description:"Enable the Exa web search provider"}},"exa.searchDelayMs":{type:"number",default:1000,ui:{tab:"providers",group:"Services",label:"Exa Search Delay",description:"Minimum delay between Exa web search requests in milliseconds; set 0 to disable pacing"}},"searxng.endpoint":{type:"string",ui:{tab:"providers",group:"Services",label:"SearXNG Endpoint",description:"Base URL of a self-hosted SearXNG instance used for web search"}},"browser.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Browser",description:"Enable the browser eval prelude for scripted Chromium automation (Puppeteer)"}},"browser.cdpUrl":{type:"string",ui:{tab:"tools",group:"Grep & Browser",label:"Browser CDP URL",description:"Default HTTP CDP discovery endpoint (for example http://127.0.0.1:9222) to attach to instead of launching a browser. Explicit app.cdp_url or app.path on the tool call take precedence."}},"browser.relay":{type:"boolean",default:!1,ui:{tab:"tools",group:"Grep & Browser",label:"Browser Relay",description:"Drive your own Chrome tabs through the omp browser relay. Install the extension once (`omp browser-relay install`); the relay server auto-starts when the browser prelude needs it. Takes precedence over Browser CDP URL; set PI_BROWSER_RELAY=0 or PI_BROWSER_RELAY=1 to override."}},"browser.relayUrl":{type:"string",ui:{tab:"tools",group:"Grep & Browser",label:"Browser Relay URL",description:"omp browser relay endpoint (default http://127.0.0.1:9224)."}},"browser.headless":{type:"boolean",default:!0,ui:{tab:"tools",group:"Grep & Browser",label:"Headless Browser",description:"Launch browser in headless mode (disable to show browser UI)"}},"browser.cmux":{type:"boolean",default:!0,ui:{tab:"tools",group:"Grep & Browser",label:"cmux Browser",description:"Use cmux WKWebView surfaces for browser automation when a cmux socket is available. Set PI_BROWSER_CMUX=0 or PI_BROWSER_CMUX=1 to override."}},"browser.tern":{type:"boolean",default:!0,ui:{tab:"tools",group:"Grep & Browser",label:"Tern Browser",description:"Inside a Tern pane, open browser tabs as picture-in-pictures over omp's pane (native web view) instead of headless Chromium; falls back to Chromium when no Tern window can host them. Explicit app options, the relay and Browser CDP URL take precedence; app.tern:false opts one open out. Set PI_BROWSER_TERN=0 or PI_BROWSER_TERN=1 to override."}},"browser.freezeOnTurnEnd":{type:"boolean",default:!0,ui:{tab:"tools",group:"Grep & Browser",label:"Freeze Browser Tabs On Turn End",description:"Freeze OMP-owned headless browser tabs when a turn settles so animated pages stop burning CPU/GPU while idle. Tabs unfreeze automatically on next use; pass persist:true on open to opt a tab out."}},"browser.idleCloseSec":{type:"number",default:1800,ui:{tab:"tools",group:"Grep & Browser",label:"Browser Idle Close Timeout",description:"Close OMP-owned headless browser tabs and Tern browser picture-in-pictures idle longer than this many seconds (0 = never; session dispose still reaps). Never touches relay/CDP/spawned browsers or other sessions' tabs.",options:[{value:"0",label:"Never"},{value:"900",label:"15 minutes"},{value:"1800",label:"30 minutes"},{value:"3600",label:"1 hour"}]}},"browser.screenshotDir":{type:"string",ui:{tab:"tools",group:"Grep & Browser",label:"Screenshot Directory",description:"Directory to save screenshots. If unset, screenshots go to a temp file. Supports ~. Examples: ~/Downloads, ~/Desktop, /sdcard/Download (Android)"}},"ida.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"IDA Pro",description:"Open executables read with `read` in IDA Pro (idalib) and enable the `ida` tool; inert when no IDA install is found"}},"ida.python":{type:"string",default:"",ui:{tab:"tools",group:"IDA Pro",label:"IDA Python",description:"Python interpreter that can import ida_domain and idapro; empty auto-detects"}},"ida.installDir":{type:"string",default:"",ui:{tab:"tools",group:"IDA Pro",label:"IDA Install Dir",description:"Directory containing libidalib, exported as IDADIR; empty auto-detects ($IDADIR, ida-config.json, standard install paths)"}},"ida.maxOpen":{type:"number",default:4,ui:{tab:"tools",group:"IDA Pro",label:"IDA Max Open Databases",description:"Most IDA databases (omp.ida.* daemons in omp ps) open at once per project; opening another saves and closes the least recently used idle one",options:[{value:"2",label:"2"},{value:"4",label:"4"},{value:"8",label:"8"},{value:"16",label:"16"}]}},"ida.idleCloseSec":{type:"number",default:900,ui:{tab:"tools",group:"IDA Pro",label:"IDA Idle Close Timeout",description:"Save and close IDA databases idle longer than this many seconds (0 = never); the exec namespace resets on reopen",options:[{value:"0",label:"Never"},{value:"300",label:"5 minutes"},{value:"900",label:"15 minutes"},{value:"1800",label:"30 minutes"},{value:"3600",label:"1 hour"}]}},"mcp.enableProjectConfig":{type:"boolean",default:!0,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Project Config",description:"Load .mcp.json/mcp.json from project root"}},"mcp.startupTimeoutMs":{type:"number",default:250,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Startup Window",description:"Wait this many milliseconds for initial MCP tool discovery; 0 waits until connections settle"}},"mcp.renderMarkdownResults":{type:"boolean",default:!0,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Markdown Results",description:"Render non-JSON MCP text results as Markdown in the transcript"}},"mcp.notifications":{type:"boolean",default:!1,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Update Injection",description:"Inject MCP resource updates into the agent conversation"}},"mcp.notificationDebounceMs":{type:"number",default:500,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Notification Debounce",description:"Debounce window in milliseconds for MCP resource updates before injecting them into the conversation"}},"images.urls.enabled":{type:"boolean",default:!1,ui:{tab:"model",group:"Vision",label:"Serve Images as URLs",description:"Publish outgoing images through the configured backend chain and send URL-fetching providers short URLs instead of inline base64. Falls back to inline automatically when every backend or a provider fetch fails"}},"images.urls.backends":{type:"array",default:["provider-files","tailscale","cloudflared","litterbox"],ui:{tab:"model",group:"Vision",label:"Image URL Backends",description:"Ordered destinations tried when publishing images for provider access",options:[{value:"imgur",label:"Imgur",description:"Uploads require either an Imgur access token or client ID."},{value:"imageshack",label:"ImageShack",description:"The API requires a paid subscription."},{value:"flickr",label:"Flickr",description:"image-host"},{value:"chevereto",label:"Chevereto",description:"self-hosted"},{value:"vgyme",label:"vgy.me",description:"image-host"},{value:"dropbox",label:"Dropbox",description:"cloud-files"},{value:"ftp",label:"FTP / FTPS / SFTP",description:"file-transfer"},{value:"onedrive",label:"OneDrive",description:"cloud-files"},{value:"google-drive",label:"Google Drive",description:"cloud-files"},{value:"puush",label:"puush-compatible endpoint",description:"The public service is defunct; a replacement endpoint is required."},{value:"box",label:"Box",description:"cloud-files"},{value:"amazon-s3",label:"Amazon S3",description:"s3"},{value:"google-cloud-storage",label:"Google Cloud Storage",description:"object-storage"},{value:"azure-storage",label:"Azure Blob Storage",description:"object-storage"},{value:"backblaze-b2",label:"Backblaze B2",description:"Configure either native B2 application keys or S3-compatible access keys."},{value:"owncloud",label:"ownCloud / Nextcloud",description:"webdav"},{value:"mediafire",label:"MediaFire-compatible endpoint",description:"The public API is deprecated; a replacement endpoint is required."},{value:"sendspace",label:"SendSpace-compatible endpoint",description:"The public discovery API is deprecated; a replacement endpoint is required."},{value:"localhostr",label:"Hostr-compatible endpoint",description:"The public service is offline; a replacement endpoint is required."},{value:"lambda",label:"Lambda-compatible endpoint",description:"The public service is offline; a replacement endpoint is required."},{value:"pomf",label:"Pomf",description:"pomf"},{value:"uguu",label:"Uguu",description:"Public uploads expire after approximately three hours."},{value:"seafile",label:"Seafile",description:"cloud-files"},{value:"s-ul",label:"s-ul",description:"file-host"},{value:"lobfile",label:"LobFile-compatible endpoint",description:"The public service is offline; a replacement endpoint is required."},{value:"transfer-sh",label:"transfer.sh-compatible endpoint",description:"The defunct public endpoint is blocked; a self-hosted replacement is required."},{value:"plik",label:"Plik",description:"self-hosted"},{value:"shared-folder",label:"Shared folder",description:"filesystem"},{value:"catbox",label:"Catbox",description:"anonymous-host"},{value:"litterbox",label:"Litterbox",description:"Uploads are temporary."},{value:"0x0",label:"0x0.st",description:"Public uploads expire after a retention window determined by file size."},{value:"tmpfiles",label:"tmpfiles.org",description:"Public uploads are temporary."},{value:"discord",label:"Discord",description:"messaging"},{value:"provider-files",label:"Model provider files",description:"Provider file references are API-local rather than public image URLs."},{value:"direct",label:"Direct public URL",description:"local-serving"},{value:"cloudflared",label:"Cloudflare quick tunnel",description:"tunnel"},{value:"ngrok",label:"ngrok",description:"tunnel"},{value:"tailscale",label:"Tailscale Funnel",description:"tunnel"},{value:"ssh",label:"SSH reverse tunnel",description:"tunnel"},{value:"command",label:"Uploader command",description:"external-command"},{value:"localhost-run",label:"localhost.run",description:"tunnel"},{value:"pinggy",label:"Pinggy",description:"tunnel"},{value:"devtunnel",label:"Microsoft dev tunnel",description:"The devtunnel CLI must be logged in locally."},{value:"zrok",label:"zrok",description:"The local zrok environment must be enabled."},{value:"bore",label:"bore",description:"tunnel"},{value:"named-cloudflared",label:"Named Cloudflare Tunnel",description:"tunnel"},{value:"r2",label:"Cloudflare R2",description:"s3"},{value:"tigris",label:"Tigris",description:"s3"},{value:"minio",label:"MinIO",description:"s3"},{value:"garage",label:"Garage",description:"s3"}],ordered:!0}},"images.urls.command":{type:"string",ui:{tab:"model",group:"Vision",label:"Image Upload Command",description:"Argv template for the command backend; {file} is the image path, {mime}/{ext} optional. The last URL printed on stdout is used (e.g. pasta -b -f {file})"}},"images.urls.publicBaseUrl":{type:"string",ui:{tab:"model",group:"Vision",label:"Image URL Public Base",description:"Externally reachable base URL fronting the blob server (required for ssh, optional for direct)"}},"images.urls.ttlHours":{type:"number",default:72,ui:{tab:"model",group:"Vision",label:"Image URL Lifetime (hours)",description:"Serving window for locally hosted image URLs, measured from the last time a conversation sent them; resuming a conversation re-arms the window at the same link. 0 keeps links alive while the broker runs"}},"images.urls.bindHost":{type:"string",default:"127.0.0.1",ui:{tab:"model",group:"Vision",label:"Image URL Bind Host",description:"Host the blob server binds to; loopback for tunnels, 0.0.0.0 for direct serving"}},"images.urls.sshTarget":{type:"string",ui:{tab:"model",group:"Vision",label:"Image URL SSH Target",description:"user@host destination for the ssh reverse forward"}},"images.urls.sshRemotePort":{type:"number",default:8787,ui:{tab:"model",group:"Vision",label:"Image URL SSH Remote Port",description:"Remote listen port of the ssh reverse forward that your web server proxies to"}},"secrets.enabled":{type:"boolean",default:!1,ui:{tab:"providers",group:"Privacy",label:"Hide Secrets",description:"Obfuscate configured secrets and redact credential-shaped tokens before sending to AI providers"}},"stt.enabled":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Speech",label:"Speech-to-Text",description:"Enable speech-to-text input via microphone"}},"stt.submitTrigger":{type:"enum",default:"never",values:["never","release","release-complete","say-submit"],ui:{tab:"interaction",group:"Speech",label:"Speech-to-Text Submit Trigger",description:"Choose when speech dictation automatically submits: Never, Release (2+ words), Release with complete sentence, or When I Say Submit.",options:[{value:"never",label:"Never",description:"Never automatically submit; insert dictation and remain in editor."},{value:"release",label:"Release",description:"Submit on release if the utterance has 2+ words to avoid accidental sends."},{value:"release-complete",label:"Release with complete sentence",description:"Submit on release if the utterance ends with sentence-terminal punctuation (. ? ! etc.)."},{value:"say-submit",label:"When I Say Submit",description:"Submit if the utterance ends with a word containing 'submit' (strips that word before submitting)."}]}},"collab.relayUrl":{type:"string",default:"wss://my.omp.sh",ui:{tab:"interaction",group:"Collab",label:"Relay URL",description:"Relay used by /collab (wss://host[:port])"}},"collab.webUrl":{type:"string",default:"",ui:{tab:"interaction",group:"Collab",label:"Web UI URL",description:"Browser UI used by /collab links; empty derives from collab.relayUrl; explicit http:// is localhost-only"}},"collab.displayName":{type:"string",default:"",ui:{tab:"interaction",group:"Collab",label:"Display Name",description:"Name shown to other collab participants (default: OS username)"}},"collab.autoStart":{type:"enum",default:"off",values:["off","view","control"],ui:{tab:"interaction",group:"Collab",label:"Auto Start",description:"Host every interactive session via collab.relayUrl as it starts and publish it to the local registry (omp collab list); rooms rotate on session switch",options:[{value:"off",label:"Off",description:"Share only when /collab is run"},{value:"view",label:"View",description:"Auto-host; the registry hands out view-only links (omp collab link --view)"},{value:"control",label:"Control",description:"Auto-host; the registry hands out control links that can prompt the session"}]}},"share.serverUrl":{type:"string",default:"https://my.omp.sh/s",ui:{tab:"interaction",group:"Collab",label:"Share Server",description:"Share viewer/upload base used by /share (encrypted blob upload + viewer; links are <base>/<id>#<key>)"}},"share.store":{type:"enum",default:"blob",values:["blob","gist"],ui:{tab:"interaction",group:"Collab",label:"Share Store",description:"Where /share uploads the encrypted session blob",options:[{value:"blob",label:"Encrypted Blob",description:"Upload to the share server (no GitHub account needed; avoids gist API rate limits)"},{value:"gist",label:"GitHub Gist",description:"Push to a secret gist (needs authenticated gh), falling back to the share server"}]}},"share.redactSecrets":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Collab",label:"Share Secret Redaction",description:"Run the secret obfuscator over /share snapshots before upload (uses the secrets.* config)"}},"stream.serverUrl":{type:"string",default:"https://live.omp.sh",ui:{tab:"interaction",group:"Stream",label:"Stream Server",description:"Live stream server used by `omp stream` (https://host[:port]); viewers watch at <base>/<your Stencil username>"}},"stream.redactPatterns":{type:"array",default:[],ui:{tab:"interaction",group:"Stream",label:"Extra Redaction Patterns",description:"Additional regular expressions redacted from every streamed row, on top of env/secrets.yml values and built-in credential shapes"}}}}});var wnn;var Cnn=O(()=>{wnn={"retry.enabled":{type:"boolean",default:!0,ui:{tab:"model",group:"Retry & Fallback",label:"Retry Enabled",description:"Retry transient provider errors (rate limits, outages, quota walls)."}},"retry.baseDelayMs":{type:"number",default:500,ui:{tab:"model",group:"Retry & Fallback",label:"Retry Base Delay (ms)",description:"Initial backoff before the first retry."}},"thinkingBudgets.minimal":{type:"number",default:1024,ui:{tab:"model",group:"Thinking",label:"Minimal Thinking Budget",description:"Token budget for the minimal thinking level."}},"thinkingBudgets.low":{type:"number",default:2048,ui:{tab:"model",group:"Thinking",label:"Low Thinking Budget",description:"Token budget for the low thinking level."}},"thinkingBudgets.medium":{type:"number",default:8192,ui:{tab:"model",group:"Thinking",label:"Medium Thinking Budget",description:"Token budget for the medium thinking level."}},"thinkingBudgets.high":{type:"number",default:16384,ui:{tab:"model",group:"Thinking",label:"High Thinking Budget",description:"Token budget for the high thinking level."}},"thinkingBudgets.xhigh":{type:"number",default:32768,ui:{tab:"model",group:"Thinking",label:"XHigh Thinking Budget",description:"Token budget for the xhigh thinking level."}},"thinkingBudgets.max":{type:"number",default:32768,ui:{tab:"model",group:"Thinking",label:"Max Thinking Budget",description:"Token budget for the max thinking level."}},"stt.language":{type:"string",default:"en",ui:{tab:"interaction",group:"Speech",label:"Speech-to-Text Language",description:'Source language for dictation (ISO-639-1, e.g. "id", "en"). Sent to the recognizer as a hint; leave it as "en" only if your dictation is English.'}},modelTags:{type:"record",default:{},ui:{tab:"model",group:"Prompt",label:"Model Tags",description:"Custom role/tag metadata; can introduce additional roles. JSON record."}},modelProviderOrder:{type:"array",default:[],ui:{tab:"model",group:"Prompt",label:"Model Provider Order",description:"Preferred provider order when a model id is ambiguous. JSON array."}},cycleOrder:{type:"array",default:["smol","default","slow"],ui:{tab:"model",group:"Prompt",label:"Model Cycle Order",description:"Roles cycled by the model switcher. JSON array."}},enabledModels:{type:"array",default:[],ui:{tab:"model",group:"Prompt",label:"Enabled Models",description:"Allow-list of models; supports path-scoped entries. Empty means all available models. JSON array."}},"task.agentServiceTierOverrides":{type:"record",default:{},ui:{tab:"model",group:"Sampling",label:"Agent Service Tier Overrides",description:"Sparse exact-name service-tier overrides for agents spawned by task/eval dispatch. JSON record."}},"compaction.reserveTokens":{type:"number",ui:{tab:"context",group:"Compaction",label:"Compaction Reserve Tokens",description:"Absolute reserve floor. Unset = larger of 16384 and 15% of the context window."}},"compaction.keepRecentTokens":{type:"number",default:20000,ui:{tab:"context",group:"Compaction",label:"Keep Recent Tokens",description:"Recent tokens always preserved through compaction."}},"compaction.autoContinue":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Auto-Continue",description:"Continue automatically after compaction."}},"autolearn.minToolCalls":{type:"number",default:5,ui:{tab:"memory",group:"Auto-Learn",label:"Min Tool Calls",description:"Only nudge after a turn that used at least this many tools.",condition:"autolearnActive"}},shellPath:{type:"string",ui:{tab:"shell",group:"Bash",label:"Shell Path",description:"Override the shell binary used by bash."}},"bash.autoBackground.thresholdMs":{type:"number",default:60000,ui:{tab:"shell",group:"Bash",label:"Auto-Background Threshold (ms)",description:"Threshold before auto-backgrounding long-running commands."}},"task.agentAdvisor":{type:"record",default:{},ui:{tab:"tasks",group:"Subagents",label:"Agent Advisor Overrides",description:'Per-agent subagent advisor: agent name → "on" / "off" / advisor model pattern. JSON record.'}},enabledProviders:{type:"array",default:[],ui:{tab:"providers",group:"Services",label:"Enabled Providers",description:"Foreign user-level discovery sources to load; supports path-scoped entries. JSON array."}},disabledProviders:{type:"array",default:[],ui:{tab:"providers",group:"Services",label:"Disabled Providers",description:"Disabled model/discovery providers; supports path-scoped entries. JSON array."}}}});function Z0(e,t){return e[t]?.value}function Snn(e,t){switch(e){case void 0:return!0;case"advisorEnabled":return Z0(t,"advisor.enabled")===!0;case"vimModeEnabled":return Z0(t,"tui.vimMode")===!0;case"hindsightActive":return Z0(t,"memory.backend")==="hindsight";case"mnemopiActive":return Z0(t,"memory.backend")==="mnemopi";case"autolearnActive":return Z0(t,"autolearn.enabled")===!0;case"autoThinkingActive":return Z0(t,"defaultThinkingLevel")==="auto";case"usageAwareFallbackEnabled":return Z0(t,"retry.usageAwareFallback")===!0;case"planModeEnabled":return Z0(t,"plan.enabled")===!0;case"planAutosaveEnabled":return Z0(t,"plan.enabled")===!0&&Z0(t,"plan.autosave")===!0;case"unexpectedStopSmart":return Z0(t,"features.unexpectedStopDetection")==="smart";case"macOS":case"hasImageProtocol":return!0;default:return!0}}function Tnn(e){return Object.entries(lL).filter(([,t])=>t.ui.tab===e)}function Enn(e,t,n){if(!n)return!0;return e.toLowerCase().includes(n)||t.ui.label.toLowerCase().includes(n)||t.ui.description.toLowerCase().includes(n)}var rie,lL;var nLe=O(()=>{knn();Cnn();rie=_nn,lL={...rie.entries,...wnn}});function Rnn({entryKey:e,entry:t,value:n,initialValue:r,onChangeDirty:a,onCommit:i,saving:o,saveError:s}){let[l,u]=ae(()=>{if(n===void 0||n===null)return"";return Array.isArray(n)||typeof n==="object"?JSON.stringify(n):String(n)}),d=Re(!1),p=Re(r),h=ut(()=>Array.isArray(t.ui.options)?t.ui.options:null,[t.ui.options]);Ee(()=>{let x=n===void 0||n===null?"":Array.isArray(n)||typeof n==="object"?JSON.stringify(n):String(n);u(x),d.current=!1},[n]);let f=()=>{let x=p.current,k=x===void 0||x===null?"":Array.isArray(x)||typeof x==="object"?JSON.stringify(x):String(x);u(k),d.current=!1,a(e,!1,()=>{})},g=(x)=>{let k=l;u(typeof x==="string"?x:JSON.stringify(x)),d.current=!1,i(e,x).then((C)=>{if(C)a(e,!1,()=>{});else u(k),a(e,!0,f)}).catch(()=>{u(k),a(e,!0,f)})},b=()=>{if(!d.current)return;if(t.type==="number"){let x=Lnn(l);if(x===null||x===n){f();return}g(x);return}if(t.type==="string"){let x=l.trim();if(x===n){f();return}g(x);return}if(t.type==="array"){let x=bzr(l);if(x===null||Ann(x,n)){f();return}g(x);return}if(t.type==="record"){let x=yzr(l);if(x===null||Ann(x,n)){f();return}g(x)}},y=()=>{let x=d.current;if(d.current=!0,!x)a(e,!0,f)};if(t.type==="boolean"){let x=n===!0;return m("button",{type:"button",role:"switch","aria-checked":x,"aria-label":t.ui.label,onClick:()=>{a(e,!1,()=>{}),g(!x)},disabled:o,className:`relative h-5 w-9 shrink-0 rounded-full transition-colors cursor-pointer ${x?"bg-ink":"bg-ink/15"} ${o?"opacity-50":""}`,children:m("span",{className:`absolute top-0.5 h-4 w-4 rounded-full bg-paper shadow-sm transition-all ${x?"left-[18px]":"left-0.5"}`})})}if(t.type==="array"&&t.ui.ordered&&h){let x=Array.isArray(n)?n.filter((_)=>typeof _==="string"):[],k=(_)=>{g(x.includes(_)?x.filter((w)=>w!==_):[...x,_])},C=(_,w)=>{let T=_+w;if(T<0||T>=x.length)return;let E=[...x],[L]=E.splice(_,1);E.splice(T,0,L),g(E)};return m("div",{className:"flex flex-wrap items-center gap-1.5 justify-end max-w-72",children:[x.map((_,w)=>{let T=h.find((E)=>E.value===_);return m("span",{className:"inline-flex items-center gap-1 rounded-md border border-ink/15 bg-ink/[0.03] px-2 py-0.5 text-[10px] text-ink",children:[w>0&&m("button",{type:"button","aria-label":`${T?.label??_} left`,onClick:()=>C(w,-1),className:"text-ink/40 hover:text-ink cursor-pointer",disabled:o,children:"←"}),T?.label??_,w<x.length-1&&m("button",{type:"button","aria-label":`${T?.label??_} right`,onClick:()=>C(w,1),className:"text-ink/40 hover:text-ink cursor-pointer",disabled:o,children:"→"}),m("button",{type:"button","aria-label":`Remove ${T?.label??_}`,onClick:()=>k(_),className:"text-ink/40 hover:text-error cursor-pointer",disabled:o,children:m(vn,{size:10})})]},_)}),x.length===0&&m("span",{className:"text-[10px] text-ink/40",children:"empty"}),m("details",{className:"relative",children:[m("summary",{className:"cursor-pointer rounded-md border border-ink/15 px-2 py-0.5 text-[10px] text-ink/70 hover:text-ink select-none",children:"add…"}),m("div",{className:"absolute right-0 top-full z-10 mt-1 max-h-44 w-48 overflow-auto rounded-md border border-ink/15 bg-paper p-1 shadow-lg",children:[h.filter((_)=>!x.includes(_.value)).map((_)=>m("button",{type:"button",onClick:()=>k(_.value),className:"block w-full rounded px-2 py-1 text-left text-[11px] text-ink/80 hover:bg-ink/5",children:_.label||_.value},_.value)),h.every((_)=>x.includes(_.value))&&m("div",{className:"px-2 py-1 text-[10px] text-ink/40",children:"all selected"})]})]})]})}let v=h??(t.type==="enum"&&t.values?t.values.map((x)=>({value:x,label:x,description:""})):null);if(v){let x=n===void 0||n===null?"":String(n);return m("div",{className:"flex items-center gap-2 shrink-0",children:m("select",{"aria-label":t.ui.label,value:x,onChange:(k)=>{let C=k.currentTarget.value;if(t.type==="number"){let _=Lnn(C);if(_===null||_===n)return;g(_)}else{if(C===n)return;g(C)}},disabled:o,className:`bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink max-w-56 ${o?"opacity-50":""}`,children:[x===""&&m("option",{value:"",disabled:!0,children:"select…"}),v.map((k)=>m("option",{value:k.value,children:k.label||k.value},k.value))]})})}if(t.type==="array")return m("input",{"aria-label":t.ui.label,type:"text",value:l,onChange:(x)=>{u(x.currentTarget.value),y()},onBlur:b,disabled:o,placeholder:'["anthropic","openai"]',className:`w-48 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${o?"opacity-50":""}`});if(t.type==="record")return m("input",{"aria-label":t.ui.label,type:"text",value:l,onChange:(x)=>{u(x.currentTarget.value),y()},onBlur:b,disabled:o,placeholder:'{"bash":"prompt"}',className:`w-48 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${o?"opacity-50":""}`});if(t.type==="number")return m("input",{"aria-label":t.ui.label,type:"text",inputMode:"decimal",value:l,onChange:(x)=>{u(x.currentTarget.value),y()},onBlur:b,disabled:o,className:`w-28 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${o?"opacity-50":""}`});return m("input",{"aria-label":t.ui.label,type:t.credential?"password":"text",value:l,onChange:(x)=>{u(x.currentTarget.value),y()},onBlur:b,disabled:o,className:`w-48 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${o?"opacity-50":""} ${s?"border-error":""}`})}var Ann=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Lnn=(e)=>{let t=e.trim();if(t===""||t==="-"||t==="+")return null;let n=Number(t);return Number.isFinite(n)?n:null},bzr=(e)=>{let t=e.trim();if(t==="")return[];try{let n=JSON.parse(t);return Array.isArray(n)?n:null}catch{return null}},yzr=(e)=>{let t=e.trim();if(t==="")return{};try{let n=JSON.parse(t);return typeof n==="object"&&n!==null&&!Array.isArray(n)?n:null}catch{return null}};var Nnn=O(()=>{Je();pt();de()});function Mnn({tabs:e,entries:t,activeTabId:n,onSelectTab:r,searchQuery:a,dirtyKeys:i,savingKeys:o,saveErrors:s,onCommit:l,onReset:u,onDirty:d}){let p=e.find((g)=>g.id===n)??e[0],h=ut(()=>{let g=a.trim().toLowerCase();if(g)return Object.entries(lL).filter(([b,y])=>Enn(b,y,g)).map(([b])=>b).slice(0,80);return Tnn(p.id).filter(([,b])=>Snn(b.ui.condition,t)).map(([b])=>b)},[t,p.id,a]),f=ut(()=>{if(!a.trim())return[];let g=[],b=new Map;for(let y of h){let v=lL[y],x=e.find((_)=>_.id===v?.ui.tab),k=`${v?.ui.tab??"?"}\x00${v?.ui.group??""}`,C=b.get(k);if(!C)C={label:v?.ui.group?`${x?.label??v?.ui.tab} · ${v.ui.group}`:x?.label??v?.ui.tab??"Other",keys:[]},b.set(k,C),g.push({id:k,...C});C.keys.push(y)}return g},[h,a,e]);return m("div",{className:"w-full flex flex-col gap-3 text-xs",children:[m("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 scrollbar-overlay-container",children:e.map((g)=>m("button",{type:"button",onClick:()=>r(g.id),className:`shrink-0 rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors cursor-pointer ${g.id===p.id?"bg-ink/10 text-ink":"text-ink/55 hover:bg-ink/5 hover:text-ink"}`,children:g.label},g.id))}),m("div",{className:"w-full rounded-lg border border-ink/10 divide-y divide-ink/5",children:[a.trim()?f.map((g)=>m(Inn,{keys:g.keys,entries:t,groupLabel:g.label,dirtyKeys:i,savingKeys:o,saveErrors:s,onCommit:l,onReset:u,onDirty:d},g.id)):p.groups.map((g)=>{let b=h.filter((y)=>lL[y]?.ui.group===g);if(b.length===0)return null;return m(Inn,{keys:b,entries:t,groupLabel:g,dirtyKeys:i,savingKeys:o,saveErrors:s,onCommit:l,onReset:u,onDirty:d},g)}),h.length===0&&m("div",{className:"px-3 py-6 text-center text-ink/40",children:a.trim()?"No settings match your search.":"No settings in this tab."})]})]})}function Inn({keys:e,entries:t,groupLabel:n,dirtyKeys:r,savingKeys:a,saveErrors:i,onCommit:o,onReset:s,onDirty:l}){return m("div",{children:[m("div",{className:"px-3 py-1.5 bg-ink/[0.02] text-[10px] uppercase tracking-wide text-ink/40 font-medium",children:n}),e.map((u)=>{let d=lL[u];if(!d?.ui)return null;let p=t[u]?.value,h=r.has(u),f=a.has(u),g=i.get(u);return m("div",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[m("div",{className:"min-w-0 flex-1",children:[m("div",{className:"flex items-center gap-1.5",children:[m("span",{className:"font-medium text-ink",children:d.ui.label}),m("span",{className:"font-mono text-[9px] text-ink/30",title:"config key",children:u}),h&&!f&&m("span",{className:"shrink-0 rounded bg-warning/15 px-1 py-px text-[9px] font-semibold text-warning",children:"unsaved"}),f&&m("span",{className:"shrink-0 text-[9px] text-ink/40",children:"saving…"}),g&&!f&&m("span",{className:"shrink-0 rounded bg-error/10 px-1 py-px text-[9px] font-semibold text-error",title:g,children:"save failed"})]}),d.ui.description&&m("div",{className:"text-[10px] text-ink/40 leading-snug",children:d.ui.description}),g&&!f&&m("div",{className:"text-[10px] text-error leading-snug",children:g}),d.ui.warning&&m("div",{className:"text-[10px] text-error/80 leading-snug",children:d.ui.warning})]}),m("div",{className:"flex items-center gap-1.5 shrink-0",children:[m(Rnn,{entryKey:u,entry:d,value:p,initialValue:p,onChangeDirty:l,onCommit:o,saving:f,saveError:Boolean(g)}),m("button",{type:"button","aria-label":`Reset ${d.ui.label}`,title:"Reset to schema default",onClick:()=>s(u),disabled:f,className:`rounded p-1 text-ink/30 hover:text-ink transition-colors cursor-pointer disabled:opacity-40 ${f?"":"hover:bg-ink/5"}`,children:m(Xc,{size:11})}),h&&m(Xt,{size:11,className:"text-ink/30"})]})]},u)})]})}var Pnn=O(()=>{Je();pt();nLe();Nnn();de()});function xzr({role:e,value:t,onCommit:n}){let[r,a]=ae(t),i=rLe[e];return m("div",{className:"flex items-center justify-between gap-3 px-3 py-2.5",children:[m("div",{className:"min-w-0",children:[m("div",{className:"font-medium text-ink",children:i.label}),m("div",{className:"font-mono text-[9px] text-ink/30",children:e})]}),m("input",{"aria-label":`${i.label} (${e}) model`,type:"text",value:r,onChange:(o)=>a(o.currentTarget.value),onBlur:(o)=>n(e,o.currentTarget.value),placeholder:"provider/model",className:"w-56 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono"})]})}function Dnn({modelRoles:e,onSaveRole:t,savedRole:n}){let r=(i,o)=>{let s=o.trim();if((e[i]??"")===s)return;t(i,s)};return m("div",{className:"pt-2",children:[m("div",{className:"flex items-center justify-between pb-2",children:[m("div",{children:[m("h3",{className:"text-sm font-semibold text-ink",children:"Model Roles"}),m("p",{className:"text-ink/50 mt-0.5",children:"Role → model selectors from config.yml. Empty removes the role override."})]}),n&&m("span",{className:"inline-flex items-center gap-1 text-[10px] text-ink/60",children:[m(Xt,{size:11})," saved"]})]}),[{id:"chat",title:"Chat roles",note:"Each takes a chat model. Empty removes the override and omp falls back to its own resolution."},{id:"kind",title:"Model-kind roles",note:"Each takes a model of that kind only — a chat model here is silently unusable."}].map((i)=>{let o=vzr.filter((s)=>rLe[s].section===i.id);return m("div",{className:"mb-3",children:[m("div",{className:"pb-1",children:[m("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-ink/50",children:i.title}),m("div",{className:"text-[10px] text-ink/40 leading-snug",children:i.note})]}),m("div",{className:"rounded-lg border border-ink/10 divide-y divide-ink/5",children:o.map((s)=>m(xzr,{role:s,value:e[s]??"",onCommit:r},s))})]},i.id)})]})}var rLe,vzr;var $nn=O(()=>{Je();pt();de();rLe={default:{label:"Default",section:"chat"},smol:{label:"Fast",section:"chat"},slow:{label:"Thinking",section:"chat"},vision:{label:"Vision",section:"chat"},plan:{label:"Architect",section:"chat"},commit:{label:"Commit",section:"chat"},tiny:{label:"Tiny",section:"chat"},memory:{label:"Memory",section:"chat"},task:{label:"Subtask",section:"chat"},advisor:{label:"Advisor",section:"chat"},image:{label:"Image generation",section:"kind"},web:{label:"Web search",section:"kind"},speech:{label:"Speech (TTS)",section:"kind"},dictation:{label:"Dictation (STT)",section:"kind"},judge:{label:"Judge",section:"kind"}},vzr=Object.keys(rLe)});function Onn({extensions:e,savedExtension:t,onToggle:n}){if(e.length===0)return null;return m("div",{className:"pt-2",children:[m("div",{className:"flex items-center justify-between pb-2",children:[m("div",{children:[m("h3",{className:"text-sm font-semibold text-ink",children:"Extensions"}),m("p",{className:"text-ink/50 mt-0.5",children:"TS/JS modules loaded from .omp/extensions. Disable writes to config.yml."})]}),t&&m("span",{className:"inline-flex items-center gap-1 text-[10px] text-ink/60",children:[m(Xt,{size:11})," saved"]})]}),m("div",{className:"rounded-lg border border-ink/10 divide-y divide-ink/5",children:e.map((r)=>m("div",{className:"flex items-center justify-between gap-3 px-3 py-2.5",children:[m("div",{className:"min-w-0",children:[m("div",{className:"font-medium text-ink",children:r.name}),m("div",{className:"text-[10px] text-ink/40 truncate font-mono",children:[r.sourceRoot," · ",r.filePath]})]}),m("select",{"aria-label":`${r.name} enabled`,value:r.disabled?"false":"true",onChange:()=>n(r),className:"bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink",children:[m("option",{value:"true",children:"enabled"}),m("option",{value:"false",children:"disabled"})]})]},r.id))})]})}var Fnn=O(()=>{pt();de()});function Bnn(e){let[t,n]=ae(null),[r,a]=ae(!1),[i,o]=ae({}),[s,l]=ae({}),[u,d]=ae([]),[p,h]=ae(!0),[f,g]=ae(rie.tabs[0]?.id??"model"),[b,y]=ae(""),[v,x]=ae(null),[k,C]=ae(new Set),[_,w]=ae(new Set),[T,E]=ae(new Map),L=Le(()=>{h(!0),Promise.all([fetch("/api/omp/state").then((B)=>B.json()),fetch("/api/settings/omp-config").then((B)=>B.json()),fetch("/api/model-roles").then((B)=>B.json()),fetch("/api/omp/extensions").then((B)=>B.json())]).then(([B,F,j,z])=>{if(B.running&&B.state)n(B.state);if(a(Boolean(B.running)),F.entries)o(F.entries);if(j.roles&&typeof j.roles==="object")l(j.roles);if(Array.isArray(z.extensions))d(z.extensions)}).catch((B)=>console.error("Failed to load omp settings:",B)).finally(()=>h(!1))},[]);Ee(()=>{L()},[L]);let P=(B)=>{x(B),setTimeout(()=>x((F)=>F===B?null:F),2000)},R=(B,F,j,z)=>{if(w((q)=>{let W=new Set(q);return W.delete(B),W}),C((q)=>{let W=new Set(q);return W.delete(B),W}),F){if(E((q)=>{if(!q.has(B))return q;let W=new Map(q);return W.delete(B),W}),j!==void 0)o((q)=>({...q,[B]:{...q[B],value:j}}));P(B)}else E((q)=>new Map(q).set(B,z??"omp rejected the write"))},M=Le(async(B,F)=>{w((j)=>new Set(j).add(B)),C((j)=>{let z=new Set(j);return z.delete(B),z});try{let z=await(await fetch("/api/settings/omp-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:B,value:F})})).json(),q=Boolean(z.success);return R(B,q,z.value,typeof z.error==="string"?z.error:void 0),q}catch(j){return console.error("Failed to save omp config:",j),R(B,!1,void 0,j instanceof Error?j.message:void 0),!1}},[]),A=Le(async(B)=>{w((F)=>new Set(F).add(B));try{let j=await(await fetch("/api/settings/omp-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:B,action:"reset"})})).json(),z=Boolean(j.success);return R(B,z,j.value,typeof j.error==="string"?j.error:void 0),z}catch(F){return console.error("Failed to reset omp config:",F),R(B,!1,void 0,F instanceof Error?F.message:void 0),!1}},[]),N=Le((B,F)=>{C((j)=>{let z=new Set(j);if(F)z.add(B);else z.delete(B);return z})},[]),I=(B,F)=>{let j={...s};if(F.trim())j[B]=F.trim();else delete j[B];l(j),fetch("/api/model-roles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({roles:j})}).then((z)=>z.json()).then((z)=>{if(z.success)P(`role-${B}`)}).catch((z)=>console.error("Failed to save model roles:",z))},D=(B)=>{fetch("/api/omp/extensions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:B.id,disabled:!B.disabled})}).then((F)=>F.json()).then((F)=>{if(F.success)d((j)=>j.map((z)=>z.id===B.id?{...z,disabled:!B.disabled}:z)),P(`ext-${B.id}`)}).catch((F)=>console.error("Failed to toggle extension:",F))};if(p)return m("div",{className:"flex items-center justify-center p-8 text-ink/40 text-xs",children:"Loading OMP settings..."});return m("div",{className:"w-full space-y-4 text-ink pb-2 text-xs",children:[m("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 pb-3 border-b border-ink/10",children:[m("div",{children:[m("h2",{className:"text-sm font-semibold text-ink",children:"OMP Engine"}),m("p",{className:"text-ink/50 mt-0.5",children:"Live agent state and the full native config schema from oh-my-pi."})]}),m("div",{className:"flex items-center gap-2",children:[m("div",{className:"relative",children:[m(na,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-ink/40 pointer-events-none"}),m("input",{"aria-label":"Search settings",type:"text",value:b,onChange:(B)=>y(B.currentTarget.value),placeholder:"Search settings…",className:"w-44 bg-paper border border-ink/15 rounded-md pl-6 pr-6 py-1 text-ink placeholder:text-ink/40"}),b&&m("button",{type:"button","aria-label":"Clear search",onClick:()=>y(""),className:"absolute right-1.5 top-1/2 -translate-y-1/2 text-ink/40 hover:text-ink cursor-pointer",children:m(vn,{size:11})})]}),m("button",{type:"button",onClick:L,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-ink/15 text-ink/70 hover:text-ink hover:bg-ink/5 transition-all cursor-pointer",children:[m(Mn,{size:12})," Refresh"]})]})]}),m("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:[m("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[m("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Engine"}),m("div",{className:"font-semibold text-ink mt-0.5",children:r?"Running":"Idle"})]}),m("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[m("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Model"}),m("div",{className:"font-semibold text-ink mt-0.5 truncate",children:t?.model?.id??"—"})]}),m("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[m("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Thinking"}),m("div",{className:"font-semibold text-ink mt-0.5",children:t?.thinkingLevel??"—"})]}),m("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[m("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Context"}),m("div",{className:"font-semibold text-ink mt-0.5",children:t?.contextUsage?.percent!=null?`${t.contextUsage.percent.toFixed(1)}%`:"—"})]})]}),m("div",{className:"pt-1",children:[m("div",{className:"flex items-center justify-between pb-2",children:[m("div",{children:[m("h3",{className:"text-sm font-semibold text-ink",children:"Config"}),m("p",{className:"text-ink/50 mt-0.5",children:["Schema-driven settings backed by ",m("span",{className:"font-mono",children:"omp config"}),".",b.trim()&&" — matching keys only"]})]}),v&&!v.startsWith("role-")&&!v.startsWith("ext-")&&m("span",{className:"inline-flex items-center gap-1 text-[10px] text-ink/60",children:["saved ",v]})]}),m(Mnn,{tabs:rie.tabs,entries:i,activeTabId:f,onSelectTab:g,searchQuery:b,dirtyKeys:k,savingKeys:_,saveErrors:T,onCommit:M,onReset:A,onDirty:N})]}),m(Dnn,{modelRoles:s,onSaveRole:I,savedRole:v?.startsWith("role-")?v.slice(5):null}),m(Onn,{extensions:u,savedExtension:v?.startsWith("ext-")?v.slice(4):null,onToggle:D})]})}var znn=O(()=>{Je();pt();nLe();Pnn();$nn();Fnn();de()});function jnn({activeMetrics:e}){return m("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-2.5 items-stretch",children:[m(xo,{value:e.processedTokens,label:"Processed tokens",hint:e.activeRate}),m(xo,{value:e.cachedInput,label:"Cached input",hint:e.cachedPercent}),m(xo,{value:e.uncachedInput,label:"Uncached input",hint:"0 cache writes"}),m(xo,{value:e.outputTokens,label:"Output",hint:e.reasoning}),m(xo,{value:e.cacheSavings,label:"Cache savings",hint:"0.0x the raw token cost",tone:"muted",className:"col-span-2 sm:col-span-1"})]})}var Unn=O(()=>{D9();de()});function Wnn({breakdownTab:e,setBreakdownTab:t,activeBreakdownRows:n,activeMetrics:r,cadence:a}){return m("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-3",children:[m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs xl:col-span-2",children:[m("div",{className:"flex justify-between items-center mb-3",children:[m("span",{className:"font-semibold text-xs text-ink",children:"Breakdown"}),m("div",{className:"flex bg-ink/5 rounded p-0.5",children:[m("button",{onClick:()=>t("model"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${e==="model"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"MODEL"}),m("button",{onClick:()=>t("day"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${e==="day"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:qnn[a]}),m("button",{onClick:()=>t("project"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${e==="project"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"PROJECT"})]})]}),m("div",{className:"overflow-x-auto",children:m("table",{className:"w-full text-[11px]",children:[m("thead",{children:m("tr",{className:"text-ink/40 border-b border-ink/10",children:[m("th",{className:"font-medium text-left pb-2 capitalize",children:e==="day"?qnn[a].toLowerCase():e}),m("th",{className:"font-medium text-right pb-2",children:"Cost"}),m("th",{className:"font-medium text-right pb-2",children:"Share"}),m("th",{className:"font-medium text-right pb-2",children:"Tokens"})]})}),m("tbody",{className:"divide-y divide-ink/5",children:n.map((i)=>m("tr",{children:[m("td",{className:"py-2.5 flex items-center gap-2",children:[m("div",{className:`w-1.5 h-1.5 rounded-full ${i.dotColorClass}`}),m("span",{className:"font-semibold text-ink whitespace-nowrap",children:i.name})]}),m("td",{className:"py-2.5 text-right font-bold text-ink",children:i.cost}),m("td",{className:"py-2.5 text-right text-ink/60",children:i.share}),m("td",{className:"py-2.5 text-right text-ink/60",children:i.tokens})]},i.name))})]})}),m("div",{className:"h-1.5 w-full bg-ink/5 rounded-full mt-3 overflow-hidden flex",children:n.map((i,o)=>m("div",{className:`h-full ${o===0?"bg-ink/80":o===1?"bg-ink/45 border-l border-paper":"bg-ink/20 border-l border-paper"}`,style:{width:`${i.sharePercent}%`}},i.name))})]}),m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs xl:col-span-1",children:[m("div",{className:"font-semibold text-xs mb-3 text-ink",children:"Cost quality"}),m("div",{className:"space-y-2 text-[11px]",children:[m("div",{className:"flex justify-between items-center",children:[m("span",{className:"text-ink/60",children:"Provider reported"}),m("span",{className:"font-semibold text-ink",children:"100.0%"})]}),m("div",{className:"flex justify-between items-center",children:[m("span",{className:"text-ink/60",children:"Model priced"}),m("span",{className:"font-semibold text-ink",children:"0.0%"})]}),m("div",{className:"flex justify-between items-center",children:[m("span",{className:"text-ink/60",children:"Unpriced"}),m("span",{className:"font-semibold text-ink",children:"0.0%"})]})]}),m("div",{className:"border-t border-ink/10 mt-3 pt-2.5",children:m("div",{className:"flex justify-between items-center text-[11px]",children:[m("span",{className:"text-ink/60",children:"Cache savings"}),m("span",{className:"font-semibold text-ink",children:r.cacheSavings})]})})]})]})}var qnn;var Gnn=O(()=>{de();qnn={daily:"DAY",weekly:"WEEK",monthly:"MONTH"}});function kzr(e,t,n){if(e.length===0)return"";if(e.length===1)return"M0,98 L100,98";let r=n>0?n:1;return e.map((a,i)=>{let o=i/(e.length-1)*100,s=98-t[i]/r*94;return`${i===0?"M":"L"}${o.toFixed(2)},${s.toFixed(2)}`}).join(" ")}function Hnn({cadence:e,metric:t,series:n}){let r=n.map((p)=>t==="cost"?p.cost:p.tokens),a=r.length>0?Math.max(...r):0,i=kzr(n,r,a),o=t==="cost"?tI(a)||"$0.00":dm(a)??"0",s=t==="cost"?tI(a/2)||"$0.00":dm(a/2)??"0",l=n[0]?.label??"",u=n.length>2?n[Math.floor(n.length/2)]?.label??"":"",d=n.length>1?n[n.length-1]?.label??"":"";if(n.length===0)return m("div",{className:"h-28 flex items-center justify-center text-[11px] text-ink/40",children:"No usage data in this period"});return m("div",{className:"h-28 relative",children:[m("div",{className:"absolute inset-0 flex flex-col justify-between pt-1 pb-4",children:[m("div",{className:"border-t border-ink/5 w-full border-dashed"}),m("div",{className:"border-t border-ink/5 w-full border-dashed"}),m("div",{className:"border-t border-ink/15 w-full"})]}),m("div",{className:"absolute left-0 top-0 bottom-4 flex flex-col justify-between text-[9px] font-mono text-ink/40 w-9",children:[m("span",{children:o}),m("span",{children:s}),m("span",{children:"0"})]}),m("div",{className:"absolute left-10 right-0 bottom-4 top-0 flex items-end",children:m("svg",{className:"w-full h-full",preserveAspectRatio:"none",viewBox:"0 0 100 100",children:m("path",{d:i,fill:"none",stroke:"currentColor",className:"text-ink/60 transition-all duration-300",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),m("div",{className:"absolute left-10 right-0 bottom-0 h-4 flex justify-between text-[9px] text-ink/40 items-end",children:[m("span",{children:l}),u&&m("span",{children:u}),m("span",{children:d})]}),m("span",{className:"sr-only",children:`${e} ${t} trend`})]})}var Vnn=O(()=>{de()});function Znn({settings:e,onUpdate:t}){let[n,r]=ae("daily"),[a,i]=ae("30d"),[o,s]=ae(!1),[l,u]=ae("cost"),[d,p]=ae("model"),[h,f]=ae(!1),g=new Date().toISOString().slice(0,10),b=new Date(Date.now()-2592000000).toISOString().slice(0,10),[y,v]=ae(b),[x,k]=ae(g),[C,_]=ae([]),[w,T]=ae(null),[E,L]=ae([]),[P,R]=ae([]),M=Re(null);Yr(M,()=>s(!1));let A=Le(()=>{f(!0);let B=a==="custom"?`&customFrom=${y}&customTo=${x}`:"";fetch(`/api/telemetry/tokens?timeRange=${a}&breakdownTab=${d}&cadence=${n}${B}`).then((F)=>F.json()).then((F)=>{if(F.timeRanges)_(F.timeRanges);if(F.metrics)T(F.metrics);if(F.breakdownRows)L(F.breakdownRows);if(F.chartSeries)R(F.chartSeries)}).catch((F)=>console.error("Failed to load token telemetry:",F)).finally(()=>f(!1))},[a,d,n,y,x]);Ee(()=>{A()},[A]);let N=()=>{A()},I=C.find((B)=>B.id===a)||C[0]||{id:a,label:a,dateRange:"Current Period"},D=a==="custom"?`${y} to ${x}`:I.dateRange;if(!w)return m("div",{className:"flex items-center justify-center p-8 text-ink/40 text-xs",children:"Loading token usage telemetry..."});return m("div",{className:"w-full space-y-4 text-ink pb-2 text-xs",children:[m("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 pb-3 border-b border-ink/10",children:[m("div",{className:"flex items-center gap-2",children:m("span",{className:"text-xs font-semibold text-ink/75",children:D})}),m("div",{className:"flex flex-wrap items-center gap-2",children:[m("div",{className:"flex items-center bg-paper border border-ink/15 rounded-md text-[11px] font-medium overflow-hidden",children:[m("button",{onClick:()=>r("daily"),className:`px-2.5 py-1 transition-colors ${n==="daily"?"bg-ink/10 text-ink font-semibold":"text-ink/65 hover:bg-ink/5 hover:text-ink"}`,children:"Daily"}),m("button",{onClick:()=>r("weekly"),className:`px-2.5 py-1 transition-colors ${n==="weekly"?"bg-ink/10 text-ink font-semibold":"text-ink/65 hover:bg-ink/5 hover:text-ink"}`,children:"Weekly"}),m("button",{onClick:()=>r("monthly"),className:`px-2.5 py-1 transition-colors ${n==="monthly"?"bg-ink/10 text-ink font-semibold":"text-ink/65 hover:bg-ink/5 hover:text-ink"}`,children:"Monthly"})]}),m("div",{className:"relative",ref:M,children:[m("button",{onClick:()=>s(!o),className:"flex items-center gap-1.5 px-2.5 py-1 bg-paper border border-ink/15 rounded-md text-[11px] font-medium hover:bg-ink/5 text-ink/80 transition-colors",children:[m("span",{children:I.label}),m(Zn,{size:12,className:`transition-transform duration-150 ${o?"rotate-180":""}`})]}),o&&m("div",{className:"absolute right-0 top-full mt-1 w-44 bg-paper border border-ink/15 rounded-md shadow-lg z-30 py-1 text-[11px] divide-y divide-ink/5",children:[C.map((B)=>m("button",{onClick:()=>{if(i(B.id),B.id!=="custom")s(!1)},className:`w-full flex items-center justify-between px-3 py-1.5 text-left hover:bg-ink/5 transition-colors ${a===B.id?"font-semibold text-ink bg-ink/5":"text-ink/70"}`,children:[m("span",{children:B.label}),a===B.id&&m(Xt,{size:12,className:"text-ink"})]},B.id)),a==="custom"&&m("div",{className:"px-3 py-2 space-y-2",children:[m("label",{className:"block",children:[m("span",{className:"text-[9px] font-mono uppercase tracking-wider text-ink/40",children:"From"}),m("input",{type:"date",value:y,max:x,onChange:(B)=>v(B.currentTarget.value),className:"mt-0.5 w-full bg-paper border border-ink/15 rounded px-1.5 py-1 text-[11px] text-ink focus:outline-none focus:border-ink/40"})]}),m("label",{className:"block",children:[m("span",{className:"text-[9px] font-mono uppercase tracking-wider text-ink/40",children:"To"}),m("input",{type:"date",value:x,min:y,max:g,onChange:(B)=>k(B.currentTarget.value),className:"mt-0.5 w-full bg-paper border border-ink/15 rounded px-1.5 py-1 text-[11px] text-ink focus:outline-none focus:border-ink/40"})]}),m("button",{onClick:()=>s(!1),className:"w-full bg-ink/10 hover:bg-ink/20 text-ink font-semibold rounded px-2 py-1 transition-colors",children:"Apply"})]})]})]}),m("button",{onClick:N,className:"p-1.5 bg-paper border border-ink/15 rounded-md hover:bg-ink/5 text-ink/80 transition-colors",title:"Refresh Token Telemetry",children:m(Mn,{size:12,className:h?"animate-spin text-ink":""})})]})]}),m("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:[m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs flex flex-col justify-between",children:[m("div",{children:[m("div",{className:"text-[10px] font-mono font-semibold text-ink/40 tracking-wider uppercase mb-2",children:"USAGECONFIG.RAWTOKENCOST"}),m("div",{className:"flex items-baseline gap-1 mb-0.5",children:[m("span",{className:"text-2xl font-bold tracking-tight text-ink",children:w.rawCost}),m("span",{className:"text-xs font-semibold text-ink/50",children:"*"})]}),m("p",{className:"text-[11px] text-ink/50 mb-4",children:"* if billed at full API rate"})]}),m("div",{children:[m("div",{className:"h-1.5 w-full bg-ink/10 rounded-full mb-2 overflow-hidden flex",children:m("div",{className:"h-full bg-ink/80 rounded-full",style:{width:"100%"}})}),m("div",{className:"flex items-center justify-between text-[11px]",children:[m("div",{className:"flex items-center gap-1.5",children:[m("div",{className:"w-2 h-2 rounded-full bg-ink/80"}),m("span",{className:"font-semibold text-ink",children:"DeepSeek"})]}),m("div",{className:"flex items-center gap-3 text-ink/70",children:[m("span",{className:"font-bold text-ink",children:w.rawCost}),m("span",{children:"100.0% share"}),m("span",{children:w.processedTokens})]})]})]})]}),m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs flex flex-col",children:[m("div",{className:"flex justify-between items-start mb-3",children:[m("div",{className:"flex items-center gap-2",children:[m("span",{className:"font-semibold text-xs text-ink capitalize",children:[n," ",l]}),m("div",{className:"flex items-center gap-1",children:[m("div",{className:"w-1.5 h-1.5 rounded-full bg-ink/80"}),m("span",{className:"text-[11px] text-ink/60",children:"DeepSeek"})]})]}),m("div",{className:"flex bg-ink/5 rounded p-0.5",children:[m("button",{onClick:()=>u("cost"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${l==="cost"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"COST"}),m("button",{onClick:()=>u("tokens"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${l==="tokens"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"TOKENS"})]})]}),m(Hnn,{cadence:n,metric:l,series:P})]})]}),m(jnn,{activeMetrics:w}),m(Wnn,{breakdownTab:d,setBreakdownTab:p,activeBreakdownRows:E,activeMetrics:w,cadence:n}),m("div",{className:"text-center text-[10px] text-ink/40 pt-2",children:["Scanned ",w.scannedTranscripts," transcripts (1 outside the window) · ",w.usageRecords," usage records · 0.1s"]})]})}var Knn=O(()=>{Je();pt();Unn();Gnn();Vnn();So();de()});function _zr({provider:e,selected:t}){return m("span",{className:t?"text-ink/80":"text-ink/60",children:m(To,{slug:e.id,name:e.name,size:14})})}function Ynn({report:e,selectedProviderId:t,onSelectProvider:n}){let r=iL(e);return m("div",{className:"w-full md:w-64 md:border-r border-ink/10 h-full flex flex-col bg-paper/50 flex-shrink-0 select-none",children:[m("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex items-center justify-between",children:m("span",{className:"text-xs font-semibold text-ink",children:[r.length," provider",r.length===1?"":"s"," with keys"]})}),m("div",{className:"flex-1 scrollbar-overlay-container p-1.5 space-y-3 text-xs",children:r.length===0?m("p",{className:"px-2.5 py-3 text-[11px] text-ink/50 leading-relaxed",children:"No provider credentials detected. Add an API key in Settings → Providers."}):m("div",{children:[m("div",{className:"px-2.5 pt-1.5 pb-1 text-[10px] font-bold text-ink/50 uppercase tracking-wider",children:"Providers"}),m("div",{className:"space-y-0.5",children:r.map((a)=>{let i=a.id===t;return m("button",{type:"button",onClick:()=>n(a.id),className:`w-full text-left px-2.5 py-2 rounded-lg transition-colors cursor-pointer flex flex-col gap-0.5 group ${i?"bg-ink/10 text-ink font-medium shadow-2xs":"text-ink/80 hover:bg-ink/5 hover:text-ink"}`,children:[m("div",{className:"flex items-center justify-between gap-1.5",children:[m("div",{className:"flex items-center gap-1.5 min-w-0",children:[m("div",{className:"relative",children:[m(_zr,{provider:a,selected:i}),m("span",{className:`absolute -top-0.5 -right-0.5 w-1.5 h-1.5 rounded-full ${a.error?"bg-error/60":"bg-ink"}`})]}),m("span",{className:"font-semibold text-xs text-ink truncate",children:a.name})]}),m("span",{className:`text-[10px] font-mono uppercase px-1.5 py-0.5 rounded bg-ink/10 font-medium ${a.error?"text-error":"text-ink/70"}`,children:oL(a)})]}),m("p",{className:"text-[11px] text-ink/60 line-clamp-1 leading-snug pl-5",children:a.hint})]},a.id)})})]})})]})}var Xnn=O(()=>{Lz();mh();de()});function Jnn(){let e=Sd(),{report:t,isLoading:n,error:r,reload:a}=Xae(),[i,o]=ae(""),s=t?iL(t):[],l=s.find((u)=>u.id===i)??s[0];if(Ee(()=>{if(l&&l.id!==i)o(l.id)},[l,i]),r&&!t)return m("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-8 text-center text-xs",children:[m(Qn,{size:16,className:"text-error"}),m("p",{className:"text-error text-xs",children:r}),m("button",{type:"button",onClick:()=>a(),className:"text-[11px] font-semibold text-ink/70 hover:text-ink underline underline-offset-2",children:"Try again"})]});if(!t)return m("div",{className:"flex h-full w-full items-center justify-center text-ink/40 text-xs",children:"Loading provider usage..."});return m("div",{className:"flex h-full w-full overflow-hidden bg-paper text-xs text-ink",children:m(Td,{pane:e.pane,onBack:e.back,listLabel:"Usage",list:m(Ynn,{report:t,selectedProviderId:l?.id??"",onSelectProvider:(u)=>{o(u),e.openDetail()}}),detail:m("div",{className:"flex-1 h-full overflow-hidden flex flex-col",children:[m("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex items-center justify-between gap-3 flex-shrink-0",children:[m("div",{className:"flex items-center gap-2 min-w-0",children:[m("span",{className:"text-xs font-semibold text-ink/75 truncate",children:["Updated ",V0(t.generatedAt)]}),t.isMock&&m("span",{className:"text-[10px] font-mono uppercase tracking-wider bg-ink/5 border border-ink/15 rounded px-1.5 py-0.5 text-ink/60",children:"Mock"})]}),m("button",{type:"button",onClick:()=>a({force:!0}),disabled:n,className:"p-1.5 bg-paper border border-ink/15 rounded-md hover:bg-ink/5 text-ink/80 transition-colors disabled:opacity-50 flex-shrink-0",title:"Refresh usage",children:m(Mn,{size:12,className:n?"animate-spin text-ink":""})})]}),m("div",{className:"flex-1 overflow-y-auto scrollbar-overlay-container p-3.5 space-y-4",children:[r&&m("p",{className:"text-error text-xs",children:r}),l?m(Kae,{summary:l.summary}):m("p",{className:"text-[11px] text-ink/50 leading-relaxed",children:"No provider credentials detected. Add an API key in Settings → Providers and it will appear here."}),m(Yae,{})]})]})})})}var Qnn=O(()=>{Je();pt();Xnn();Lz();X9e();J9e();hy();Q9e();rv();ov();de()});function ern({settings:e,onUpdate:t}){let[n,r]=ae(!1),a=()=>{r(!0),FU(),setTimeout(()=>r(!1),600)},i=e.chatCompletionSound??e.soundAlerts??!0;return m("div",{className:"w-full space-y-6 text-xs text-ink",children:m("div",{className:"bg-paper border border-ink/15 rounded-lg p-4 shadow-xs space-y-4",children:[m("div",{className:"flex items-start justify-between gap-4",children:[m("div",{className:"flex items-start gap-3",children:[m("div",{className:"w-8 h-8 rounded-md bg-ink/5 border border-ink/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:i?m(c6,{size:16,className:"text-ink"}):m(jN,{size:16,className:"text-ink/40"})}),m("div",{children:[m("div",{className:"text-sm font-semibold text-ink flex items-center gap-2",children:[m("span",{children:"AI Response Completion Sound"}),m("span",{className:"text-[10px] uppercase font-mono px-1.5 py-0.5 rounded bg-ink/10 text-ink/80 font-bold",children:"Audio Chime"})]}),m("p",{className:"text-ink/65 text-[11px] mt-1 leading-relaxed",children:"Play an audible notification chime when the AI completes generating its response, thinking blocks, or diagnostic execution."})]})]}),m("button",{type:"button",role:"switch","aria-checked":i,onClick:()=>{let o=!i;if(t({chatCompletionSound:o,soundAlerts:o}),o)FU()},className:`relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none ${i?"bg-ink":"bg-ink/20"}`,children:m("span",{"aria-hidden":"true",className:`pointer-events-none inline-block h-5 w-5 transform rounded-full bg-paper shadow ring-0 transition duration-200 ease-in-out ${i?"translate-x-5":"translate-x-0"}`})})]}),m("div",{className:"pt-3 border-t border-ink/10 flex items-center justify-between",children:[m("span",{className:"text-[11px] text-ink/60 flex items-center gap-1.5",children:[m(ji,{size:13,className:"text-ink/60"}),"Warm harmonic chime synthesized natively via Web Audio"]}),m("button",{type:"button",onClick:a,className:`px-3 py-1.5 rounded-md border border-ink/20 bg-paper hover:bg-ink/5 text-ink font-medium text-[11px] flex items-center gap-1.5 transition-all shadow-xs active:scale-95 ${n?"border-ink bg-ink/10":""}`,children:[m(c6,{size:13,className:n?"animate-bounce text-ink":"text-ink/70"}),m("span",{children:n?"Playing...":"Test Sound"})]})]})]})})}var trn=O(()=>{Je();pt();QN();de()});function Czr({isOpen:e,onClose:t,initialCategory:n="appearance",appSettings:r={},autoOpenAddProvider:a=!1}){let[i,o]=ae(n),[s,l]=ae(a),[u,d]=ae(""),[p,h]=ae(!1),[f,g]=ae(null),[b,y]=ae("success"),v=dU(),{isReloading:x,reload:k}=hze(),{isRestarting:C,restart:_}=gze(),w=(I,D="success")=>{g(I),y(D),setTimeout(()=>g((B)=>B===I?null:B),3000)},[T,E]=ae(()=>TBe(wzr,r));Ee(()=>{if(e)o(n),l(a),h(a),d("")},[e,n,a]),Ds("omp:open-settings",(I)=>{let D=I;if(D.detail?.category)o(D.detail.category);if(D.detail?.autoOpenAdd)l(!0)});let L=(I)=>{E((D)=>{let B=typeof I==="function"?I(D):{...D,...I};if(typeof document<"u"&&B.theme)TU(B.theme);if(typeof window<"u"&&B.editorFont!==D.editorFont)window.dispatchEvent(new CustomEvent(NU,{detail:B.editorFont}));return v(LBe(D,B,I)),B}),w("Setting was saved")},P=async()=>{let I=await k();w(I.message,I.ok?"success":"error")},R=async()=>{let I=await _();w(I.message,I.ok?"success":"error")},M=(I)=>{o(I),h(!0)};if(!e)return null;let A=PU.find((I)=>I.id===i)||PU[0],N=()=>{switch(i){case"appearance":return m(Gze,{settings:T,onUpdate:L});case"chats":return m(nje,{settings:T,onUpdate:L});case"projects":return m(Rje,{});case"providers":return m(aqe,{autoOpenAdd:s,onAddModalClose:()=>l(!1)});case"agents":return m(uqe,{settings:T,onUpdate:L});case"behavior":return m(fqe,{});case"commands":return m(kqe,{settings:T,onUpdate:L});case"mcp":return m(Nqe,{settings:T,onUpdate:L});case"token-usage":return m(Znn,{settings:T,onUpdate:L});case"notifications":return m(ern,{settings:T,onUpdate:L});case"plugins":return m(Yqe,{});case"panel-plugins":return m(dnn,{});case"skills":return m(Oqe,{settings:T,onUpdate:L,onNavigateToCatalog:()=>o("skills-catalog")});case"skills-catalog":return m(bnn,{});case"omp":return m(Bnn,{settings:T,onUpdate:L});case"usage":return m(Jnn,{});default:return m(vnn,{category:i})}};return m("div",{className:"fixed inset-0 bg-ink/40 backdrop-blur-[2px] z-50 flex items-center justify-center p-0 md:p-6 animate-in fade-in duration-150",onClick:t,children:m("div",{className:"relative bg-paper border border-ink/15 md:rounded-2xl shadow-2xl w-full h-full md:max-w-4xl lg:max-w-5xl xl:max-w-[1150px] md:h-[782px] md:max-h-[92vh] flex flex-col md:flex-row overflow-hidden text-ink",onClick:(I)=>I.stopPropagation(),children:[m("div",{className:"hidden md:flex w-64 flex-shrink-0 h-full",children:m(Wce,{activeCategory:i,onSelectCategory:(I)=>o(I),searchQuery:u,onSearchChange:d,onReloadOmp:P,isReloading:x,onRestartKabmo:R,isRestarting:C,className:"w-full"})}),m("div",{className:`flex-1 flex-col h-full bg-paper overflow-hidden ${p?"flex":"hidden md:flex"}`,children:[m("div",{className:"px-6 border-b border-ink/10 flex items-center justify-between flex-shrink-0 bg-paper",style:{height:"calc(4rem + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",paddingLeft:"max(1.5rem, env(safe-area-inset-left, 0px))",paddingRight:"max(1.5rem, env(safe-area-inset-right, 0px))"},children:[m("div",{className:"flex items-center space-x-3 min-w-0",children:[m("button",{type:"button",onClick:()=>h(!1),className:"md:hidden p-1.5 -ml-2 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink","aria-label":"Back to categories",children:m(Ay,{size:20})}),m("div",{className:"truncate",children:[m("h3",{className:"font-semibold text-base tracking-tight text-ink leading-tight",children:A.label}),m("p",{className:"text-[11px] text-ink/60 truncate hidden sm:block",children:A.description})]})]}),m("button",{type:"button",onClick:t,className:"p-1.5 rounded-lg text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer","aria-label":"Close settings",children:m(vn,{size:18,strokeWidth:2.2})})]}),m("div",{className:`flex-1 scrollbar-overlay-container w-full ${["projects","providers","agents","behavior","commands","mcp","plugins","skills","skills-catalog","usage","panel-plugins"].includes(i)?"p-0 flex flex-col":"p-6 md:p-8 flex flex-col"}`,style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:m("div",{className:"w-full h-full flex-1 flex flex-col",children:N()})})]}),m("div",{className:`flex-1 flex-col h-full bg-canvas md:hidden ${p?"hidden":"flex"}`,children:[m("div",{className:"px-4 border-b border-ink/10 flex items-center justify-between flex-shrink-0 bg-canvas",style:{height:"calc(3.5rem + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",paddingLeft:"max(1rem, env(safe-area-inset-left, 0px))",paddingRight:"max(1rem, env(safe-area-inset-right, 0px))"},children:[m("span",{className:"font-bold text-sm tracking-tight text-ink",children:"Settings"}),m("button",{type:"button",onClick:t,className:"p-1.5 rounded-lg text-ink/50 hover:text-ink","aria-label":"Close",children:m(vn,{size:18})})]}),m("div",{className:"flex-1 overflow-hidden",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:m(Wce,{activeCategory:i,onSelectCategory:M,searchQuery:u,onSearchChange:d,onReloadOmp:P,isReloading:x,onRestartKabmo:R,isRestarting:C,className:"w-full border-r-0"})})]}),f&&m("div",{className:"absolute bottom-6 left-1/2 transform -translate-x-1/2 bg-ink text-canvas px-4 py-2 rounded-lg text-xs font-semibold shadow-lg animate-in fade-in slide-in-from-bottom-2 z-50 flex items-center space-x-2 max-w-[calc(100%-2rem)]",children:[b==="error"?m(Qn,{size:14,className:"text-error shrink-0"}):m(Xt,{size:14,className:"text-success shrink-0"}),m("span",{children:f})]})]})})}var wzr;var nrn=O(()=>{Je();pt();Cd();Ece();fze();bze();m6();bb();fk();MU();yb();Fze();Hze();rje();Nje();iqe();dqe();gqe();_qe();Iqe();Fqe();Xqe();pnn();ynn();xnn();znn();Knn();Qnn();trn();de();wzr={theme:P5,editorFont:JN,autoSessionTitle:!0,soundAlerts:!0,chatCompletionSound:!0,goalAuditEnabled:!0,goalAuditModel:"",goalDefaultBudget:null,followUpBehavior:"queue",keybindingSend:"Enter",keybindingNewLine:"Shift + Enter",keybindingSteering:"Ctrl / Cmd + Enter"}});function kT({isOpen:e,...t}){if(!e)return null;return m(Is,{fallback:null,children:m(Szr,{isOpen:e,...t})})}var Szr;var aie=O(()=>{Ma();de();Szr=Mi(()=>Promise.resolve().then(() => (nrn(),{})).then((e)=>({default:Czr})))});var iie;var aLe=O(()=>{iie={name:"@kabmo-labs/kabmo",version:"0.3.0",description:"Web console and diagnostic workbench for AI coding agents — Elysia + Preact on Bun.",license:"UNLICENSED",author:"Wijanarko Putra Rajeb <wijanarko.rajeb@gmail.com>",type:"module",engines:{bun:">=1.4.0"},publishConfig:{access:"public"},bin:{kabmo:"./src/cli/kabmo.js"},repository:{type:"git",url:"git+https://github.com/kabmo-labs/kabmo.git"},homepage:"https://github.com/kabmo-labs/kabmo#readme",bugs:{url:"https://github.com/kabmo-labs/kabmo/issues"},keywords:["kabmo","coding-agent","agent","console","elysia","preact","bun"],files:["src","extensions","index.html","bunfig.toml","public","tsconfig.json","marketplace","dist/client"],scripts:{dev:"bun run --hot src/server/index.ts --kabmo-server","dev:lan":"HOST=0.0.0.0 bun run --hot src/server/index.ts --kabmo-server",build:"bun run scripts/build-client.ts","omp:schema":"bun run scripts/omp-schema.mjs","omp:schema:check":"bun run scripts/omp-schema.mjs --check",start:"NODE_ENV=production bun run src/server/index.ts --kabmo-server",typecheck:"tsc",clean:"rm -rf dist",lint:"tsc --noEmit",test:"bun test","test:e2e":"playwright test --config tests/e2e/playwright.config.ts","readme:media":"bun run scripts/readme-media.ts","typecheck:e2e":"tsc --noEmit -p tests/e2e","publish:plugins":"bash .github/scripts/publish-plugin-packages.sh packages/kabmo-sdk packages/kabmo-ui"},dependencies:{"@fontsource/fira-code":"^5.3.0","@kabmo-labs/kabmo-sdk":"workspace:*","@kabmo-labs/kabmo-ui":"workspace:*","@shikijs/langs":"^4.4.3","@shikijs/themes":"^4.4.3","@tailwindcss/postcss":"^4.1.14","@xterm/addon-fit":"^0.11.0","@xterm/addon-webgl":"^0.19.0","@xterm/xterm":"^6.0.0",dompurify:"^3.4.15",elysia:"^1.4.30",katex:"^0.18.7","lucide-preact":"^1.47.0",mammoth:"^1.13.0",marked:"^18.0.11","marked-linkify-it":"^4.0.2",mermaid:"^12.0.0",postcss:"^8.5.16",preact:"^10.29.8","read-excel-file":"^9.3.12",remend:"^1.3.1",ripgrep:"^0.3.1",shiki:"^4.4.3",tailwindcss:"^4.1.14",yaml:"^2.9.1"},devDependencies:{"@playwright/test":"^1.64.0","@semantic-release/changelog":"^7.0.0","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/git":"^11.0.1","@semantic-release/github":"^12.0.10","@semantic-release/npm":"^13.2.0","@semantic-release/release-notes-generator":"^14.1.1","@types/bun":"^1.4.2","@types/node":"^22.14.0","bun-types":"^1.4.2","conventional-changelog-conventionalcommits":"^9.3.1","happy-dom":"^20.14.5","semantic-release":"^25.0.9",typescript:"~5.8.2"},workspaces:["packages/*"]}});function rrn({className:e=""}){return m("svg",{viewBox:"0 0 64 64",className:`inline-block h-[1.1009em] w-auto flex-none [vertical-align:-0.1982em] ${e}`,style:{height:"1.5625cap",verticalAlign:"-0.28125cap",marginRight:"-0.28em"},"aria-hidden":"true",focusable:"false",children:[m("rect",{width:"64",height:"64",rx:"14",style:{fill:"var(--color-brand-tile)"}}),m("g",{fill:"none",strokeWidth:7,strokeLinecap:"round",strokeLinejoin:"round",children:[m("path",{d:"M20 15v34",style:{stroke:"var(--color-brand-cream)"}}),m("path",{d:"M20 32 42 15",style:{stroke:"var(--color-brand)"}}),m("path",{d:"M20 32 42 49",style:{stroke:"var(--color-brand-cream)"}})]})]})}var arn=O(()=>{de()});function mg({className:e="text-[15px]"}){return m("span",{className:`font-extrabold tracking-tight ${e}`,children:[m(rrn,{}),m("span",{className:"sr-only",children:"K"}),m("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-amber-500 to-orange-600",style:{paddingRight:"0.06em",marginRight:"-0.06em"},children:"ab"}),m("span",{className:"text-ink",style:{marginLeft:"0.02em"},children:"mo"})]})}var _T=O(()=>{arn();de()});function irn(){return m("div",{className:"flex flex-col items-center gap-4 mt-6 pt-1",children:[m("div",{className:"flex items-center justify-center gap-6",children:[m("a",{href:"https://discord.gg/TWYp6K2jd",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[m("svg",{className:"w-4 h-4 fill-current",viewBox:"-1.611 -1.611 27.223 27.223",children:m("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994.021-.041.001-.09-.041-.106a13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.929 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.894.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.028zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})}),m("span",{children:"Discord"})]}),m("a",{href:"https://www.instagram.com/kabmo-labs/",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[m("svg",{className:"w-4 h-4 fill-current",viewBox:"0 0 24 24",children:m("path",{d:"M7.0301.084c-1.2768.0602-2.1487.264-2.911.5634-.7888.3075-1.4575.72-2.1228 1.3877-.6652.6677-1.075 1.3368-1.3802 2.127-.2954.7638-.4956 1.6365-.552 2.914-.0564 1.2775-.0689 1.6882-.0626 4.947.0062 3.2586.0206 3.6671.0825 4.9473.061 1.2765.264 2.1482.5635 2.9107.308.7889.72 1.4573 1.388 2.1228.6679.6655 1.3365 1.0743 2.1285 1.38.7632.295 1.6361.4961 2.9134.552 1.2773.056 1.6884.069 4.9462.0627 3.2578-.0062 3.668-.0207 4.9478-.0814 1.28-.0607 2.147-.2652 2.9098-.5633.7889-.3086 1.4578-.72 2.1228-1.3881.665-.6682 1.0745-1.3378 1.3795-2.1284.2957-.7632.4966-1.636.552-2.9124.056-1.2809.0692-1.6898.063-4.948-.0063-3.2583-.021-3.6668-.0817-4.9465-.0607-1.2797-.264-2.1487-.5633-2.9117-.3084-.7889-.72-1.4568-1.3876-2.1228C21.2982 1.33 20.628.9208 19.8378.6165 19.074.321 18.2017.1197 16.9244.0645 15.6471.0093 15.236-.005 11.977.0014 8.718.0076 8.31.0215 7.0301.0839m.1402 21.6932c-1.17-.0509-1.8053-.2453-2.2287-.408-.5606-.216-.96-.4771-1.3819-.895-.422-.4178-.6811-.8186-.9-1.378-.1644-.4234-.3624-1.058-.4171-2.228-.0595-1.2645-.072-1.6442-.079-4.848-.007-3.2037.0053-3.583.0607-4.848.05-1.169.2456-1.805.408-2.2282.216-.5613.4762-.96.895-1.3816.4188-.4217.8184-.6814 1.3783-.9003.423-.1651 1.0575-.3614 2.227-.4171 1.2655-.06 1.6447-.072 4.848-.079 3.2033-.007 3.5835.005 4.8495.0608 1.169.0508 1.8053.2445 2.228.408.5608.216.96.4754 1.3816.895.4217.4194.6816.8176.9005 1.3787.1653.4217.3617 1.056.4169 2.2263.0602 1.2655.0739 1.645.0796 4.848.0058 3.203-.0055 3.5834-.061 4.848-.051 1.17-.245 1.8055-.408 2.2294-.216.5604-.4763.96-.8954 1.3814-.419.4215-.8181.6811-1.3783.9-.4224.1649-1.0577.3617-2.2262.4174-1.2656.0595-1.6448.072-4.8493.079-3.2045.007-3.5825-.006-4.848-.0608M16.953 5.5864A1.44 1.44 0 1 0 18.39 4.144a1.44 1.44 0 0 0-1.437 1.4424M5.8385 12.012c.0067 3.4032 2.7706 6.1557 6.173 6.1493 3.4026-.0065 6.157-2.7701 6.1506-6.1733-.0065-3.4032-2.771-6.1565-6.174-6.1498-3.403.0067-6.156 2.771-6.1496 6.1738M8 12.0077a4 4 0 1 1 4.008 3.9921A3.9996 3.9996 0 0 1 8 12.0077"})}),m("span",{children:"Instagram"})]}),m("a",{href:"https://www.threads.com/@kabmo-labs",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[m("svg",{className:"w-4 h-4 fill-current",viewBox:"0 0 24 24",children:m("path",{d:"M18.263 11.097c-.03-3.486-1.92-5.586-5.111-5.586-2.13 0-3.922.963-4.863 2.499l2.062 1.438c.535-.843 1.272-1.543 2.628-1.543 1.528 0 2.318.85 2.544 2.431a15 15 0 0 0-2.236-.173c-4.125 0-6.068 1.867-6.068 4.336s1.943 3.99 4.804 3.99c3.139 0 5.013-2.115 5.781-4.735.798.361 1.348 1.204 1.348 2.47 0 3.387-3.907 5.232-7.22 5.232-4.885 0-8.077-3.207-8.077-8.424 0-6.392 4.223-10.487 9.9-10.487 3.808 0 5.69 1.671 6.97 3.914l2.108-1.475C21.44 2.078 18.331 0 13.663 0 6.227 0 1.168 5.277 1.168 12.934c0 7 4.953 11.066 10.856 11.066 4.878 0 9.809-2.846 9.809-7.716 0-2.545-1.46-4.231-3.569-5.187m-6.33 4.855c-1.077 0-2.026-.512-2.026-1.453 0-1.483 1.822-1.934 3.606-1.934.678 0 1.34.045 1.927.173-.422 1.927-1.671 3.215-3.508 3.214Z"})}),m("span",{children:"Threads"})]})]}),m("div",{className:"flex items-center justify-center gap-6",children:m("a",{href:"https://github.com/kabmo-labs/kabmo",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[m("svg",{className:"w-4 h-4 fill-current",viewBox:"1.902 1.902 20.196 20.196",children:m("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.53 1.032 1.53 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"})}),m("span",{children:"GitHub"})]})})]})}var orn=O(()=>{de()});function oie(e,t){let n=(e.pending+t).split(`
|
|
4999
|
+
`)),e.length=0)},3000),Oae=new FinalizationRegistry((t)=>{typeof t=="string"&&e.push(t)})}VQt={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};pg=[];XQt=class e extends Q9{constructor(){super(...arguments);this.content=0,this.fg=0,this.bg=0,this.extended=new Ren,this.combinedData=""}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?TFr(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let n=!1;if(t[1].length>2)n=!0;else if(t[1].length===2){let r=t[1].charCodeAt(0);if(55296<=r&&r<=56319){let a=t[1].charCodeAt(1);56320<=a&&a<=57343?this.content=(r-55296)*1024+a-56320+65536|t[2]<<22:n=!0}else n=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;n&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Pen=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);J9=D4*Float32Array.BYTES_PER_ELEMENT,IFr=class extends nf{constructor(e,t,n,r){super();this._terminal=e,this._gl=t,this._dimensions=n,this._optionsService=r,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let a=this._gl;P4.maxAtlasPages===void 0&&(P4.maxAtlasPages=Math.min(32,uc(a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS))),P4.maxTextureSize=uc(a.getParameter(a.MAX_TEXTURE_SIZE))),this._program=uc(Den(a,LFr,RFr(P4.maxAtlasPages))),this._register(pd(()=>a.deleteProgram(this._program))),this._projectionLocation=uc(a.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=uc(a.getUniformLocation(this._program,"u_resolution")),this._textureLocation=uc(a.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=a.createVertexArray(),a.bindVertexArray(this._vertexArrayObject);let i=new Float32Array([0,0,1,0,0,1,1,1]),o=a.createBuffer();this._register(pd(()=>a.deleteBuffer(o))),a.bindBuffer(a.ARRAY_BUFFER,o),a.bufferData(a.ARRAY_BUFFER,i,a.STATIC_DRAW),a.enableVertexAttribArray(0),a.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let s=new Uint8Array([0,1,2,3]),l=a.createBuffer();this._register(pd(()=>a.deleteBuffer(l))),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,l),a.bufferData(a.ELEMENT_ARRAY_BUFFER,s,a.STATIC_DRAW),this._attributesBuffer=uc(a.createBuffer()),this._register(pd(()=>a.deleteBuffer(this._attributesBuffer))),a.bindBuffer(a.ARRAY_BUFFER,this._attributesBuffer),a.enableVertexAttribArray(2),a.vertexAttribPointer(2,2,a.FLOAT,!1,J9,0),a.vertexAttribDivisor(2,1),a.enableVertexAttribArray(3),a.vertexAttribPointer(3,2,a.FLOAT,!1,J9,2*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(3,1),a.enableVertexAttribArray(4),a.vertexAttribPointer(4,1,a.FLOAT,!1,J9,4*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(4,1),a.enableVertexAttribArray(5),a.vertexAttribPointer(5,2,a.FLOAT,!1,J9,5*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(5,1),a.enableVertexAttribArray(6),a.vertexAttribPointer(6,2,a.FLOAT,!1,J9,7*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(6,1),a.enableVertexAttribArray(1),a.vertexAttribPointer(1,2,a.FLOAT,!1,J9,9*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(1,1),a.useProgram(this._program);let u=new Int32Array(P4.maxAtlasPages);for(let d=0;d<P4.maxAtlasPages;d++)u[d]=d;a.uniform1iv(this._textureLocation,u),a.uniformMatrix4fv(this._projectionLocation,!1,Pen),this._atlasTextures=[];for(let d=0;d<P4.maxAtlasPages;d++){let p=new AFr(uc(a.createTexture()));this._register(pd(()=>a.deleteTexture(p.texture))),a.activeTexture(a.TEXTURE0+d),a.bindTexture(a.TEXTURE_2D,p.texture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,1,1,0,a.RGBA,a.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[d]=p}a.enable(a.BLEND),a.blendFunc(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(e,t,n,r,a,i,o,s,l){this._updateCell(this._vertices.attributes,e,t,n,r,a,i,o,s,l)}_updateCell(e,t,n,r,a,i,o,s,l,u){if(sl=(n*this._terminal.cols+t)*D4,r===0||r===void 0){e.fill(0,sl,sl+D4-1-NFr);return}this._atlas&&(s&&s.length>1?Uo=this._atlas.getRasterizedGlyphCombinedChar(s,a,i,o,!1,this._terminal.element):Uo=this._atlas.getRasterizedGlyph(r,a,i,o,!1,this._terminal.element),k9e=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),a!==u&&Uo.offset.x>k9e?(_z=Uo.offset.x-k9e,e[sl]=-(Uo.offset.x-_z)+this._dimensions.device.char.left,e[sl+1]=-Uo.offset.y+this._dimensions.device.char.top,e[sl+2]=(Uo.size.x-_z)/this._dimensions.device.canvas.width,e[sl+3]=Uo.size.y/this._dimensions.device.canvas.height,e[sl+4]=Uo.texturePage,e[sl+5]=Uo.texturePositionClipSpace.x+_z/this._atlas.pages[Uo.texturePage].canvas.width,e[sl+6]=Uo.texturePositionClipSpace.y,e[sl+7]=Uo.sizeClipSpace.x-_z/this._atlas.pages[Uo.texturePage].canvas.width,e[sl+8]=Uo.sizeClipSpace.y):(e[sl]=-Uo.offset.x+this._dimensions.device.char.left,e[sl+1]=-Uo.offset.y+this._dimensions.device.char.top,e[sl+2]=Uo.size.x/this._dimensions.device.canvas.width,e[sl+3]=Uo.size.y/this._dimensions.device.canvas.height,e[sl+4]=Uo.texturePage,e[sl+5]=Uo.texturePositionClipSpace.x,e[sl+6]=Uo.texturePositionClipSpace.y,e[sl+7]=Uo.sizeClipSpace.x,e[sl+8]=Uo.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&ZOr(r,l,Uo.size.x,this._dimensions.device.cell.width)&&(e[sl+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let e=this._terminal,t=e.cols*e.rows*D4;this._vertices.count!==t?this._vertices.attributes=new Float32Array(t):this._vertices.attributes.fill(0);let n=0;for(;n<this._vertices.attributesBuffers.length;n++)this._vertices.count!==t?this._vertices.attributesBuffers[n]=new Float32Array(t):this._vertices.attributesBuffers[n].fill(0);this._vertices.count=t,n=0;for(let r=0;r<e.rows;r++)for(let a=0;a<e.cols;a++)this._vertices.attributes[n+9]=a/e.cols,this._vertices.attributes[n+10]=r/e.rows,n+=D4}handleResize(){let e=this._gl;e.useProgram(this._program),e.viewport(0,0,e.canvas.width,e.canvas.height),e.uniform2f(this._resolutionLocation,e.canvas.width,e.canvas.height),this.clear()}render(e){if(!this._atlas)return;let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let n=this._vertices.attributesBuffers[this._activeBuffer],r=0;for(let a=0;a<e.lineLengths.length;a++){let i=a*this._terminal.cols*D4,o=this._vertices.attributes.subarray(i,i+e.lineLengths[a]*D4);n.set(o,r),r+=o.length}t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,n.subarray(0,r),t.STREAM_DRAW);for(let a=0;a<this._atlas.pages.length;a++)this._atlas.pages[a].version!==this._atlasTextures[a].version&&this._bindAtlasPageTexture(t,this._atlas,a);t.drawElementsInstanced(t.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,r/D4)}setAtlas(e){this._atlas=e;for(let t of this._atlasTextures)t.version=-1}_bindAtlasPageTexture(e,t,n){e.activeTexture(e.TEXTURE0+n),e.bindTexture(e.TEXTURE_2D,this._atlasTextures[n].texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.pages[n].canvas),e.generateMipmap(e.TEXTURE_2D),this._atlasTextures[n].version=t.pages[n].version}setDimensions(e){this._dimensions=e}};w9e=E2*Float32Array.BYTES_PER_ELEMENT,BFr=20*E2,zFr=class extends nf{constructor(e,t,n,r){super();this._terminal=e,this._gl=t,this._dimensions=n,this._themeService=r,this._vertices=new QQt,this._verticesCursor=new QQt;let a=this._gl;this._program=uc(Den(a,OFr,FFr)),this._register(pd(()=>a.deleteProgram(this._program))),this._projectionLocation=uc(a.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=a.createVertexArray(),a.bindVertexArray(this._vertexArrayObject);let i=new Float32Array([0,0,1,0,0,1,1,1]),o=a.createBuffer();this._register(pd(()=>a.deleteBuffer(o))),a.bindBuffer(a.ARRAY_BUFFER,o),a.bufferData(a.ARRAY_BUFFER,i,a.STATIC_DRAW),a.enableVertexAttribArray(3),a.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let s=new Uint8Array([0,1,2,3]),l=a.createBuffer();this._register(pd(()=>a.deleteBuffer(l))),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,l),a.bufferData(a.ELEMENT_ARRAY_BUFFER,s,a.STATIC_DRAW),this._attributesBuffer=uc(a.createBuffer()),this._register(pd(()=>a.deleteBuffer(this._attributesBuffer))),a.bindBuffer(a.ARRAY_BUFFER,this._attributesBuffer),a.enableVertexAttribArray(0),a.vertexAttribPointer(0,2,a.FLOAT,!1,w9e,0),a.vertexAttribDivisor(0,1),a.enableVertexAttribArray(1),a.vertexAttribPointer(1,2,a.FLOAT,!1,w9e,2*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(1,1),a.enableVertexAttribArray(2),a.vertexAttribPointer(2,4,a.FLOAT,!1,w9e,4*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(2,1),this._updateCachedColors(r.colors),this._register(this._themeService.onChangeColors((u)=>{this._updateCachedColors(u),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,Pen),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,n=this._vertices,r=1,a,i,o,s,l,u,d,p,h,f,g;for(a=0;a<t.rows;a++){for(o=-1,s=0,l=0,u=!1,i=0;i<t.cols;i++)d=(a*t.cols+i)*qae,p=e.cells[d+Fae],h=e.cells[d+Bae],f=!!(h&67108864),(p!==s||h!==l&&(u||f))&&((s!==0||u&&l!==0)&&(g=r++*E2,this._updateRectangle(n,g,l,s,o,i,a)),o=i,s=p,l=h,u=f);(s!==0||u&&l!==0)&&(g=r++*E2,this._updateRectangle(n,g,l,s,o,t.cols,a))}n.count=r}updateCursor(e){let t=this._verticesCursor,n=e.cursor;if(!n||n.style==="block"){t.count=0;return}let r,a=0;(n.style==="bar"||n.style==="outline")&&(r=a++*E2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.style==="bar"?n.dpr*n.cursorWidth:n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(n.style==="underline"||n.style==="outline")&&(r=a++*E2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,(n.y+1)*this._dimensions.device.cell.height-n.dpr,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat)),n.style==="outline"&&(r=a++*E2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat),r=a++*E2,this._addRectangleFloat(t.attributes,r,(n.x+n.width)*this._dimensions.device.cell.width-n.dpr,n.y*this._dimensions.device.cell.height,n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=a}_updateRectangle(e,t,n,r,a,i,o){if(n&67108864)switch(n&50331648){case 16777216:case 33554432:S2=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:S2=(n&16777215)<<8;break;case 0:default:S2=this._themeService.colors.foreground.rgba}else switch(r&50331648){case 16777216:case 33554432:S2=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:S2=(r&16777215)<<8;break;case 0:default:S2=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=EFr(e.attributes,this._terminal.rows*this._terminal.cols*E2)),een=a*this._dimensions.device.cell.width,ten=o*this._dimensions.device.cell.height,nen=(S2>>24&255)/255,ren=(S2>>16&255)/255,aen=(S2>>8&255)/255,ien=1,this._addRectangle(e.attributes,t,een,ten,(i-a)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,nen,ren,aen,ien)}_addRectangle(e,t,n,r,a,i,o,s,l,u){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=a/this._dimensions.device.canvas.width,e[t+3]=i/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=s,e[t+6]=l,e[t+7]=u}_addRectangleFloat(e,t,n,r,a,i,o){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=a/this._dimensions.device.canvas.width,e[t+3]=i/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},jFr=class extends nf{constructor(e,t,n,r,a,i,o,s){super();this._container=t,this._alpha=a,this._coreBrowserService=i,this._optionsService=o,this._themeService=s,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${n}-layer`),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors((l)=>{this._refreshCharAtlas(e,l),this.reset(e)})),this._register(pd(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=uc(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,n){}handleSelectionChanged(e,t,n,r=!1){}_setTransparency(e,t){if(t===this._alpha)return;let n=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=Men(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,n=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,n*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,n,r){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight))}_fillCharTrueColor(e,t,n,r){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=Ten,this._clipCell(n,r,t.getWidth()),this._ctx.fillText(t.getChars(),n*this._deviceCellWidth+this._deviceCharLeft,r*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,n){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,n){let r=t?e.options.fontWeightBold:e.options.fontWeight;return`${n?"italic":""} ${r} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},UFr=class extends jFr{constructor(e,t,n,r,a,i,o){super(n,e,"link",t,!0,a,i,o),this._register(r.onShowLinkUnderline((s)=>this._handleShowLinkUnderline(s))),this._register(r.onHideLinkUnderline((s)=>this._handleHideLinkUnderline(s)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&CFr(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},G0=typeof window=="object"?window:globalThis;D9e.INSTANCE=new D9e;$en=D9e;Bml=$en.INSTANCE.onDidChangeZoomLevel,zml=$en.INSTANCE.onDidChangeFullscreen,rL=typeof navigator=="object"?navigator.userAgent:"",jml=rL.indexOf("Firefox")>=0,C9e=rL.indexOf("AppleWebKit")>=0,WFr=rL.indexOf("Chrome")>=0,GFr=!WFr&&rL.indexOf("Safari")>=0,Uml=rL.indexOf("Electron/")>=0,qml=rL.indexOf("Android")>=0;if(typeof G0.matchMedia=="function"){let e=G0.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=G0.matchMedia("(display-mode: fullscreen)");zae=e.matches,qFr(G0,e,({matches:n})=>{zae&&t.matches||(zae=n)})}Uae=eL,oen=eL,R2=globalThis;typeof R2.vscode<"u"&&typeof R2.vscode.process<"u"?tf=R2.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(tf=process);Ben=typeof tf?.versions?.electron=="string",QFr=Ben&&tf?.type==="renderer";if(typeof tf=="object"){$9e=tf.platform==="win32",O9e=tf.platform==="darwin",jae=tf.platform==="linux",VFr=jae&&!!tf.env.SNAP&&!!tf.env.SNAP_REVISION,ZFr=Ben,YFr=!!tf.env.CI||!!tf.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Pae=eL,Uae=eL;let e=tf.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Pae=t.userLocale,oen=t.osLocale,Uae=t.resolvedLanguage||eL,JFr=t.languagePack?.translationsConfigFile}catch{}Oen=!0}else typeof navigator=="object"&&!QFr?(T2=navigator.userAgent,$9e=T2.indexOf("Windows")>=0,O9e=T2.indexOf("Macintosh")>=0,KFr=(T2.indexOf("Macintosh")>=0||T2.indexOf("iPad")>=0||T2.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,jae=T2.indexOf("Linux")>=0,XFr=T2?.indexOf("Mobi")>=0,Fen=!0,Uae=globalThis._VSCODE_NLS_LANGUAGE||eL,Pae=navigator.language.toLowerCase(),oen=Pae):console.error("Unable to resolve platform.");O9e?S9e=1:$9e?S9e=3:jae&&(S9e=2);T9e=Oen,eBr=Fen&&typeof R2.importScripts=="function",Wml=eBr?R2.origin:void 0,dy=T2,I4=Uae;((e)=>{function t(){return I4}e.value=t;function n(){return I4.length===2?I4==="en":I4.length>=3?I4[0]==="e"&&I4[1]==="n"&&I4[2]==="-":!1}e.isDefaultVariant=n;function r(){return I4==="en"}e.isDefault=r})(tBr||={});nBr=typeof R2.postMessage=="function"&&!R2.importScripts,rBr=(()=>{if(nBr){let e=[];R2.addEventListener("message",(n)=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,a=e.length;r<a;r++){let i=e[r];if(i.id===n.data.vscodeScheduleAsyncWork){e.splice(r,1),i.callback();return}}});let t=0;return(n)=>{let r=++t;e.push({id:r,callback:n}),R2.postMessage({vscodeScheduleAsyncWork:r},"*")}}return(e)=>setTimeout(e)})(),aBr=!!(dy&&dy.indexOf("Chrome")>=0),Gml=!!(dy&&dy.indexOf("Firefox")>=0),Hml=!!(!aBr&&dy&&dy.indexOf("Safari")>=0),Vml=!!(dy&&dy.indexOf("Edg/")>=0),Zml=!!(dy&&dy.indexOf("Android")>=0),M4=typeof navigator=="object"?navigator:{},Kml={clipboard:{writeText:T9e||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(M4&&M4.clipboard&&M4.clipboard.writeText),readText:T9e||!!(M4&&M4.clipboard&&M4.clipboard.readText)},keyboard:T9e||HFr()?0:M4.keyboard||GFr?1:2,touch:"ontouchstart"in G0||M4.maxTouchPoints>0,pointerEvents:G0.PointerEvent&&(("ontouchstart"in G0)||navigator.maxTouchPoints>0)},E9e=new U9e,sen=new U9e,len=new U9e,Yml=Array(230);((e)=>{function t(s){return E9e.keyCodeToStr(s)}e.toString=t;function n(s){return E9e.strToKeyCode(s)}e.fromString=n;function r(s){return sen.keyCodeToStr(s)}e.toUserSettingsUS=r;function a(s){return len.keyCodeToStr(s)}e.toUserSettingsGeneral=a;function i(s){return sen.strToKeyCode(s)||len.strToKeyCode(s)}e.fromUserSettings=i;function o(s){if(s>=98&&s<=113)return null;switch(s){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return E9e.keyCodeToStr(s)}e.toElectronAccelerator=o})(iBr||={});zen=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}});((e)=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof sBr?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:A2.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:zen})})(oBr||={});Xml=Symbol("MicrotaskDelay");(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?A9e=(e,t)=>{rBr(()=>{if(n)return;let r=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,r-Date.now())}}))});let n=!1;return{dispose(){n||(n=!0)}}}:A9e=(e,t,n)=>{let r=e.requestIdleCallback(t,typeof n=="number"?{timeout:n}:void 0),a=!1;return{dispose(){a||(a=!0,e.cancelIdleCallback(r))}}},lBr=(e)=>A9e(globalThis,e)})();((e)=>{async function t(r){let a,i=await Promise.all(r.map((o)=>o.then((s)=>s,(s)=>{a||(a=s)})));if(typeof a<"u")throw a;return i}e.settled=t;function n(r){return new Promise(async(a,i)=>{try{await r(a,i)}catch(o){i(o)}})}e.withAsyncBody=n})(cBr||={});cen=class e{static fromArray(t){return new e((n)=>{n.emitMany(t)})}static fromPromise(t){return new e(async(n)=>{n.emitMany(await t)})}static fromPromises(t){return new e(async(n)=>{await Promise.all(t.map(async(r)=>n.emitOne(await r)))})}static merge(t){return new e(async(n)=>{await Promise.all(t.map(async(r)=>{for await(let a of r)n.emitOne(a)}))})}constructor(t,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new _o,queueMicrotask(async()=>{let r={emitOne:(a)=>this.emitOne(a),emitMany:(a)=>this.emitMany(a),reject:(a)=>this.reject(a)};try{await Promise.resolve(t(r)),this.resolve()}catch(a){this.reject(a)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await A2.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async(r)=>{for await(let a of t)r.emitOne(n(a))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async(r)=>{for await(let a of t)n(a)&&r.emitOne(a)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,(n)=>!!n)}coalesce(){return e.coalesce(this)}static async toPromise(t){let n=[];for await(let r of t)n.push(r);return n}toPromise(){return e.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};cen.EMPTY=cen.fromArray([]);bBr._bigBlock32=new DataView(new ArrayBuffer(320));({registerWindow:Jml,getWindow:yBr,getDocument:Qml,getWindows:ehl,getWindowsCount:thl,getWindowId:pen,getWindowById:nhl,hasWindow:rhl,onDidRegisterWindow:ahl,onWillUnregisterWindow:ihl,onDidUnregisterWindow:ohl}=function(){let e=new Map,t={window:G0,disposables:new tL};e.set(G0.vscodeWindowId,t);let n=new _o,r=new _o,a=new _o;function i(o,s){return(typeof o=="number"?e.get(o):void 0)??(s?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:a.event,onDidUnregisterWindow:r.event,registerWindow(o){if(e.has(o.vscodeWindowId))return nf.None;let s=new tL,l={window:o,disposables:s.add(new tL)};return e.set(o.vscodeWindowId,l),s.add(pd(()=>{e.delete(o.vscodeWindowId),r.fire(o)})),s.add(F9e(o,kBr.BEFORE_UNLOAD,()=>{a.fire(o)})),n.fire(l),s},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return e.has(o)},getWindowById:i,getWindow(o){let s=o;if(s?.ownerDocument?.defaultView)return s.ownerDocument.defaultView.window;let l=o;return l?.view?l.view.window:G0},getDocument(o){return yBr(o).document}}}());(function(){let e=new Map,t=new Map,n=new Map,r=new Map,a=(i)=>{n.set(i,!1);let o=e.get(i)??[];for(t.set(i,o),e.set(i,[]),r.set(i,!0);o.length>0;)o.sort(R9e.sort),o.shift().execute();r.set(i,!1)};men=(i,o,s=0)=>{let l=pen(i),u=new R9e(o,s),d=e.get(l);return d||(d=[],e.set(l,d)),d.push(u),n.get(l)||(n.set(l,!0),i.requestAnimationFrame(()=>a(l))),u},xBr=(i,o,s)=>{let l=pen(i);if(r.get(l)){let u=new R9e(o,s),d=t.get(l);return d||(d=[],t.set(l,d)),d.push(u),u}else return men(i,o,s)}})();hen.None=new hen(0,0);shl=new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let a=pBr(n),i=r.get(a);if(i)i.users+=1;else{let o=new _o,s=new MutationObserver((u)=>o.fire(u));s.observe(e,n);let l=i={users:1,observer:s,onDidMutate:o.event};t.add(pd(()=>{l.users-=1,l.users===0&&(o.dispose(),s.disconnect(),r?.delete(a),r?.size===0&&this.mutationObservers.delete(e))})),r.set(a,i)}return i.onDidMutate}},kBr={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:C9e?"webkitAnimationStart":"animationstart",ANIMATION_END:C9e?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:C9e?"webkitAnimationIteration":"animationiteration"},_Br=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;wBr.SVG=function(e,t,...n){return Uen("http://www.w3.org/2000/svg",e,t,...n)};CBr=class extends nf{constructor(e,t,n,r,a,i,o,s,l){super();this._terminal=e,this._characterJoinerService=t,this._charSizeService=n,this._coreBrowserService=r,this._coreService=a,this._decorationService=i,this._optionsService=o,this._themeService=s,this._cursorBlinkStateManager=new vz,this._charAtlasDisposable=this._register(new vz),this._observerDisposable=this._register(new vz),this._model=new $Fr,this._workCell=new XQt,this._workCell2=new XQt,this._rectangleRenderer=this._register(new vz),this._glyphRenderer=this._register(new vz),this._onChangeTextureAtlas=this._register(new _o),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new _o),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new _o),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new _o),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new _o),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let u={antialias:!1,depth:!1,preserveDrawingBuffer:l};if(this._gl=this._canvas.getContext("webgl2",u),!this._gl)throw Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new XOr(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new UFr(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=KOr(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(F9e(this._canvas,"webglcontextlost",(d)=>{console.log("webglcontextlost event received"),d.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(d)},3000)})),this._register(F9e(this._canvas,"webglcontextrestored",(d)=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,KQt(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=YQt(this._canvas,this._coreBrowserService.window,(d,p)=>this._setCanvasDevicePixelDimensions(d,p)),this._register(this._coreBrowserService.onWindowChange((d)=>{this._observerDisposable.value=YQt(this._canvas,d,(p,h)=>this._setCanvasDevicePixelDimensions(p,h))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(pd(()=>{for(let d of this._renderLayers)d.dispose();this._canvas.parentElement?.removeChild(this._canvas),KQt(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let n of this._renderLayers)n.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,n){for(let r of this._renderLayers)r.handleSelectionChanged(this._terminal,e,t,n);this._model.selection.update(this._core,e,t,n),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new zFr(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new IFr(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=Men(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=_en(A2.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),A2.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let n of this._renderLayers)n.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new SFr(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let n=this._core,r=this._workCell,a,i,o,s,l,u,d=0,p=!0,h,f,g,b,y,v,x,k,C;e=fen(e,n.rows-1,0),t=fen(t,n.rows-1,0);let _=this._coreService.decPrivateModes.cursorStyle??n.options.cursorStyle??"block",w=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,T=w-n.buffer.ydisp,E=Math.min(this._terminal.buffer.active.cursorX,n.cols-1),L=-1,P=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let R=!1;for(i=e;i<=t;i++)for(o=i+n.buffer.ydisp,s=n.buffer.lines.get(o),this._model.lineLengths[i]=0,g=w===o,d=0,l=this._characterJoinerService.getJoinedCharacters(o),k=0;k<n.cols;k++){if(a=this._cellColorResolver.result.bg,s.loadCell(k,r),k===0&&(a=this._cellColorResolver.result.bg),u=!1,p=k>=d,h=k,l.length>0&&k===l[0][0]&&p){f=l.shift();let M=this._model.selection.isCellSelected(this._terminal,f[0],o);for(x=f[0]+1;x<f[1];x++)p&&=M===this._model.selection.isCellSelected(this._terminal,x,o);p&&=!g||E<f[0]||E>=f[1],p?(u=!0,r=new SBr(r,s.translateToString(!0,f[0],f[1]),f[1]-f[0]),h=f[1]-1):d=f[1]}if(b=r.getChars(),y=r.getCode(),x=(i*n.cols+k)*qae,this._cellColorResolver.resolve(r,k,o,this.dimensions.device.cell.width),P&&o===w&&(k===E&&(this._model.cursor={x:E,y:T,width:r.getWidth(),style:this._coreBrowserService.isFocused?_:n.options.cursorInactiveStyle,cursorWidth:n.options.cursorWidth,dpr:this._devicePixelRatio},L=E+r.getWidth()-1),k>=E&&k<=L&&(this._coreBrowserService.isFocused&&_==="block"||this._coreBrowserService.isFocused===!1&&n.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),y!==0&&(this._model.lineLengths[i]=k+1),!(this._model.cells[x]===y&&this._model.cells[x+Fae]===this._cellColorResolver.result.bg&&this._model.cells[x+Bae]===this._cellColorResolver.result.fg&&this._model.cells[x+_9e]===this._cellColorResolver.result.ext)&&(R=!0,b.length>1&&(y|=DFr),this._model.cells[x]=y,this._model.cells[x+Fae]=this._cellColorResolver.result.bg,this._model.cells[x+Bae]=this._cellColorResolver.result.fg,this._model.cells[x+_9e]=this._cellColorResolver.result.ext,v=r.getWidth(),this._glyphRenderer.value.updateCell(k,i,y,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,b,v,a),u)){for(r=this._workCell,k++;k<=h;k++)C=(i*n.cols+k)*qae,this._glyphRenderer.value.updateCell(k,i,0,0,0,0,UOr,0,0),this._model.cells[C]=0,this._model.cells[C+Fae]=this._cellColorResolver.result.bg,this._model.cells[C+Bae]=this._cellColorResolver.result.fg,this._model.cells[C+_9e]=this._cellColorResolver.result.ext;k--}}R&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},SBr=class extends Q9{constructor(e,t,n){super();this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};N9e=new Map;lhl=py("BufferService"),chl=py("CoreMouseService"),uhl=py("CoreService"),dhl=py("CharsetService"),phl=py("InstantiationService"),mhl=py("LogService"),EBr=py("OptionsService"),hhl=py("OscLinkService"),fhl=py("UnicodeService"),ghl=py("DecorationService"),ABr={trace:0,debug:1,info:2,warn:3,error:4,off:5},yen=class extends nf{constructor(e){super();this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),qen=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=ABr[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":LBr)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};yen=_Or([wOr(0,EBr)],yen);NBr=class extends nf{constructor(e){if(Cen&&jOr()<16){let t={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",t))throw Error("Webgl2 is only supported on Safari 16 and above")}super();this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new _o),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new _o),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new _o),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new _o),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element){this._register(t.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let{coreService:n,optionsService:r}=t,a=t,{_renderService:i,_characterJoinerService:o,_charSizeService:s,_coreBrowserService:l,_decorationService:u,_logService:d,_themeService:p}=a;RBr(d),this._renderer=this._register(new CBr(e,o,s,l,n,u,r,p,this._preserveDrawingBuffer)),this._register(A2.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(A2.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(A2.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(A2.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),i.setRenderer(this._renderer),this._register(pd(()=>{if(this._terminal._core._store._isDisposed)return;let h=this._terminal._core._renderService;h.setRenderer(this._terminal._core._createRenderer()),h.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}}});async function Gen(e,t,n,r){let a=await Promise.resolve().then(() => (PQt(),{})),i=await Promise.resolve().then(() => (DQt(),{})),o=gOr||(void 0)?.Terminal||void 0,s=vOr||(void 0)?.FitAddon||void 0;if(!o||!s||r())return null;WXt(s);let l=new o({cursorBlink:!0,cursorStyle:"block",fontSize:12,lineHeight:1.25,fontFamily:qXt,theme:nae(t),scrollback:1e4,scrollSensitivity:1.5,fastScrollSensitivity:5,smoothScrollDuration:0,allowProposedApi:!0});l.open(e),GXt(l);try{let w=await Promise.resolve().then(() => (Wen(),{})),T=NBr||(void 0)?.WebglAddon||void 0;if(T){let E=new T;E.onContextLoss(()=>E.dispose()),l.loadAddon(E)}}catch{}let u=new s;l.loadAddon(u);let d=IBr(l);l.attachCustomKeyEventHandler((w)=>MBr(l,w));let p=[l.onScroll(()=>{let w=l.buffer.active;n.onScrolledUpChange(w.viewportY<w.baseY)}),l.onData((w)=>n.onInput(w)),l.onBinary((w)=>n.onBinaryInput(w)),l.onResize(({cols:w,rows:T})=>{if(b)return;n.onGridChange(w,T)})],h=!1,f=null,g=null,b=!1,y=()=>{if(r())return;if(e.clientWidth<=0||e.clientHeight<=0)return;let T=l._core?._renderService?.dimensions;if(!T?.css?.cell?.width||!T?.css?.cell?.height)return;try{u.fit()}catch{}},v=()=>{l.write("",()=>{if(r())return;b=!1,y()})},x=(w,T,E)=>{if(b=!0,l.cols!==T||l.rows!==E)l.resize(T,E);if(w.length===0){v();return}l.write(w,v)},k=()=>{if(h||r())return;if(e.clientWidth<=0||e.clientHeight<=0)return;if(!l._core?._renderService?.dimensions?.css?.cell?.width)return;h=!0,n.onReady(l.cols,l.rows),l.focus()},C=new ResizeObserver(()=>{if(f)clearTimeout(f);f=setTimeout(()=>{y(),k()},35)});C.observe(e);let _=PBr(e,l);return g=requestAnimationFrame(()=>{y(),k()}),{term:l,fitAddon:u,writeReplay:x,dispose(){if(g!==null)cancelAnimationFrame(g);clearTimeout(f??void 0),d(),_();for(let w of p)w.dispose();C.disconnect();try{u.dispose()}catch{}try{l.dispose()}catch{}}}}function IBr(e){if(typeof document>"u"||!document.fonts)return()=>{};let t=(n)=>{if(![...n.fontfaces].some((a)=>a.family.replace(/['"]/g,"")===h7e))return;try{e.clearTextureAtlas()}catch{}};return document.fonts.addEventListener("loadingdone",t),()=>document.fonts.removeEventListener("loadingdone",t)}function MBr(e,t){if(t.type!=="keydown"||!t.shiftKey)return!0;if(t.key==="PageUp")return e.scrollPages(-1),!1;if(t.key==="PageDown")return e.scrollPages(1),!1;if(t.key==="Home")return e.scrollToTop(),!1;if(t.key==="End")return e.scrollToBottom(),!1;if(t.key==="ArrowUp")return e.scrollLines(-1),!1;if(t.key==="ArrowDown")return e.scrollLines(1),!1;return!0}function PBr(e,t){let n=0,r=(i)=>{if(i.touches.length===1)n=i.touches[0].clientY},a=(i)=>{if(i.touches.length!==1)return;let o=n-i.touches[0].clientY;if(Math.abs(o)<16)return;t.scrollLines(Math.trunc(o/16)),n=i.touches[0].clientY};return e.addEventListener("touchstart",r,{passive:!0}),e.addEventListener("touchmove",a,{passive:!0}),()=>{e.removeEventListener("touchstart",r),e.removeEventListener("touchmove",a)}}var Hen=O(()=>{f7e()});var W9e;var Ven=O(()=>{Je();Ma();pt();m6();f7e();Hen();de();W9e=e6(({onInput:e,onBinaryInput:t,onGridChange:n,onReady:r},a)=>{let{theme:i}=EU(),o=Re(null),s=Re(null),[l,u]=ae(!1),d=Re(e);d.current=e;let p=Re(t);p.current=t;let h=Re(n);h.current=n;let f=Re(r);f.current=r;let g=Re(i);g.current=i,Ee(()=>{let y=s.current?.term;if(!y)return;y.options.theme=nae(i),y.refresh(0,y.rows-1)},[i]),yg(a,()=>({write(y){s.current?.term.write(y)},writeReplay(y,v,x){s.current?.writeReplay(y,v,x)},reset(){s.current?.term.reset()},focus(){s.current?.term.focus()},applicationCursorKeys(){return s.current?.term.modes.applicationCursorKeysMode??!1},getSelection(){return s.current?.term.getSelection()??""},paste(y){s.current?.term.paste(y)}}),[]);let b=Le(()=>{s.current?.term.scrollToBottom(),u(!1)},[]);return Ee(()=>{let y=o.current;if(!y)return;let v=!1;return Gen(y,g.current,{onInput:(x)=>d.current(x),onBinaryInput:(x)=>p.current(x),onGridChange:(x,k)=>h.current(x,k),onReady:(x,k)=>f.current(x,k),onScrolledUpChange:u},()=>v).then((x)=>{if(!x)return;if(v){x.dispose();return}s.current=x}),()=>{v=!0,s.current?.dispose(),s.current=null}},[]),m("div",{className:"relative flex-1 w-full h-full bg-canvas overflow-hidden",children:[m("div",{ref:o,className:"w-full h-full cursor-text p-1.5",style:{height:"100%",width:"100%"}}),l&&m("button",{type:"button",onClick:b,className:"absolute bottom-3 right-4 z-20 flex items-center space-x-1.5 px-2.5 py-1 bg-paper hover:bg-canvas text-ink border border-ink/20 rounded-full shadow-lg text-[11px] font-mono transition-all animate-fade-in cursor-pointer active:scale-95",title:"Scroll to latest output (Shift+End)",children:[m(_g,{size:12,className:"text-warning"}),m("span",{children:"Latest"})]})]})});W9e.displayName="RealtimeXtermView"});function DBr({className:e="",enabled:t=!0,rootPath:n,showHeader:r=!0}){let a=Re(null),{isDark:i}=EU(),o=AXt(),s=Re(null),l=tae(s),[u,d]=ae(HB),{activeRepo:p,setActiveRepo:h}=U0(n),{repos:f,scanning:g,rescan:b}=q0(n,t),y=Re(null),v=Re(u);v.current=u;let x=Le((H)=>{a.current?.write(H)},[]),k=Le((H,Y)=>{a.current?.writeReplay(H,Y.replayCols,Y.replayRows)},[]),C=Le(()=>{a.current?.reset()},[]),{status:_,shell:w,exitCode:T,error:E,attach:L,resize:P,input:R,restart:M}=wXt({root:t?n:void 0,repo:p,theme:i?"dark":"light",onOutput:x,onReplay:k,onRestart:C}),A=Le((H,Y)=>{y.current={cols:H,rows:Y},L(H,Y)},[L]),N=Le((H,Y)=>{let X=y.current;if(y.current={cols:H,rows:Y},!X)return;P(H,Y)},[P]),I=Le((H)=>{let Y=v.current,X=Y.ctrl||Y.alt,Q=$Xt(H,Y);if(X&&H.length===1)d(HB);R(G9e.encode(Q))},[R]),D=Le((H)=>{d((Y)=>({...Y,[H]:!Y[H]})),a.current?.focus()},[]),B=Le((H)=>{let Y=DXt(H,{applicationCursorKeys:a.current?.applicationCursorKeys()??!1,modifiers:v.current});if(!Y)return;R(G9e.encode(Y)),d(HB),a.current?.focus()},[R]),F=Le(async()=>{let H=a.current?.getSelection()??"";if(!H)return!1;return Vh(H)},[]),j=Le(async()=>{let H=await aVt();if(H===null||H.length===0)return!1;return a.current?.paste(H),a.current?.focus(),!0},[]),z=Le((H)=>{let Y=new Uint8Array(H.length);for(let X=0;X<H.length;X+=1)Y[X]=H.charCodeAt(X)&255;R(Y)},[R]),q=Le((H)=>{R(G9e.encode(`${H}\r`)),a.current?.focus()},[R]),W=Le(()=>{M()},[M]);if(!t)return m("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${e}`,children:m("span",{className:"text-xs font-mono",children:"No session selected"})});return m("div",{ref:s,className:`flex flex-col h-full w-full bg-paper text-ink overflow-hidden ${e}`,style:l>0?{paddingBottom:l}:void 0,children:[r&&m(RXt,{status:_,exitCode:T,rootPath:n,activeRepo:p,onSelectRepo:h,repos:f,reposScanning:g,onRefreshRepos:b,shell:w,onRestart:W}),m(IXt,{onSelectCommand:q,disabled:_!=="running"}),E&&m("div",{className:"px-3 py-1.5 border-b border-error/20 bg-error/5 text-[11px] font-mono text-error flex-shrink-0",children:E}),m("div",{className:"flex-1 w-full min-h-0 bg-canvas overflow-hidden",children:m(W9e,{ref:a,onInput:I,onBinaryInput:z,onReady:A,onGridChange:N})}),o&&m(FXt,{modifiers:u,onToggleModifier:D,onKey:B,onCopy:F,onPaste:j,disabled:_!=="running"})]})}var G9e;var Zen=O(()=>{Je();CXt();g2();m6();LXt();c7e();NXt();MXt();BXt();Ven();p7e();de();G9e=new TextEncoder});function Yen({viewportMode:e,onChangeViewport:t,zoomLevel:n=100,onSetZoom:r}){let[a,i]=ae(!1),o=Re(null);return Yr(o,()=>i(!1)),m("div",{className:"flex items-center space-x-1.5 flex-shrink-0",children:[m("div",{className:"hidden sm:flex items-center bg-canvas border border-ink/10 rounded-md p-0.5",children:[m("button",{type:"button",onClick:()=>t("responsive"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${e==="responsive"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Responsive (100% Fluid)",children:m(ck,{size:12})}),m("button",{type:"button",onClick:()=>t("desktop-16-9"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${e==="desktop-16-9"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Desktop 16:9 (Auto Height following Width)",children:m(o6,{size:12})}),m("button",{type:"button",onClick:()=>t("tablet"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${e==="tablet"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Tablet (768px)",children:m(l6,{size:12})}),m("button",{type:"button",onClick:()=>t("mobile"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${e==="mobile"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Mobile (375px)",children:m(lp,{size:12})})]}),m("div",{className:"relative",ref:o,children:[m("button",{type:"button",onClick:()=>i((l)=>!l),className:"flex items-center space-x-1 px-2 py-1 rounded bg-canvas border border-ink/15 hover:border-ink/30 text-ink text-[11px] font-mono transition-colors cursor-pointer",title:"Device & Responsive Testing Menu",children:[m("span",{className:"hidden md:inline text-[10px] font-medium",children:((l)=>{switch(l){case"desktop-16-9":return"Desktop 16:9";case"laptop":return"Laptop 1024p";case"tablet":return"Tablet 768p";case"mobile":return"Mobile 375p";case"mobile-lg":return"Mobile Lg 414p";case"responsive":default:return"Responsive"}})(e)}),m(Zn,{size:11,className:"text-ink/60"})]}),a&&m("div",{className:"absolute right-0 top-full mt-1 w-56 bg-paper border border-ink/15 rounded-lg shadow-xl py-1 z-50 text-xs font-mono",children:[m("div",{className:"px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold",children:"Responsive Testing"}),Ken.filter((l)=>l.category==="responsive").map((l)=>{let u=l.icon,d=e===l.id;return m("button",{type:"button",onClick:()=>{t(l.id),i(!1)},className:`w-full px-2.5 py-1.5 flex items-center justify-between text-left hover:bg-ink/5 cursor-pointer ${d?"bg-ink/10 font-semibold text-ink":"text-ink/75"}`,children:[m("div",{className:"flex items-center space-x-2",children:[m(u,{size:13,className:"text-ink/60"}),m("span",{children:l.label})]}),d&&m(Xt,{size:12,className:"text-success"})]},l.id)}),m("div",{className:"mt-1 pt-1 border-t border-ink/10 px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold",children:"Mobile Testing"}),Ken.filter((l)=>l.category==="mobile").map((l)=>{let u=l.icon,d=e===l.id;return m("button",{type:"button",onClick:()=>{t(l.id),i(!1)},className:`w-full px-2.5 py-1.5 flex items-center justify-between text-left hover:bg-ink/5 cursor-pointer ${d?"bg-ink/10 font-semibold text-ink":"text-ink/75"}`,children:[m("div",{className:"flex items-center space-x-2",children:[m(u,{size:13,className:"text-ink/60"}),m("span",{children:l.label})]}),d&&m(Xt,{size:12,className:"text-success"})]},l.id)}),r&&m(kt,{children:[m("div",{className:"mt-1 pt-1 border-t border-ink/10 px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold",children:["Zoom Scale (",n,"%)"]}),m("div",{className:"grid grid-cols-3 gap-1 px-2 py-1",children:[50,75,100,125,150,200].map((l)=>m("button",{type:"button",onClick:()=>{r(l),i(!1)},className:`px-1.5 py-1 text-center rounded text-[11px] font-mono cursor-pointer transition-colors ${n===l?"bg-ink text-canvas font-semibold":"bg-canvas border border-ink/10 text-ink/75 hover:bg-ink/5"}`,children:[l,"%"]},l))})]})]})]})]})}var Ken;var Xen=O(()=>{Je();pt();So();de();Ken=[{id:"responsive",label:"Responsive (100% Fluid)",category:"responsive",icon:ck},{id:"desktop-16-9",label:"Desktop 16:9 (Auto H:W)",category:"responsive",icon:o6},{id:"laptop",label:"Laptop (1024 × 768)",category:"responsive",icon:uN},{id:"tablet",label:"Tablet (768 × 1024)",category:"mobile",icon:l6},{id:"mobile",label:"Mobile Phone (375 × 667)",category:"mobile",icon:lp},{id:"mobile-lg",label:"Mobile Large (414 × 896)",category:"mobile",icon:lp}]});function Jen({zoomLevel:e,onZoomIn:t,onZoomOut:n,onResetZoom:r}){return m("div",{className:"flex items-center bg-canvas border border-ink/10 rounded-md p-0.5 space-x-0.5 text-xs font-mono",children:[m("button",{type:"button",onClick:n,disabled:e<=50,"aria-label":"Perkecil tampilan",title:"Zoom Out (-10%)",className:"p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors",children:m(Qy,{size:12})}),m("button",{type:"button",onClick:r,className:"px-1 text-[10px] font-medium text-ink/75 hover:text-ink hover:underline cursor-pointer select-none",title:"Reset Zoom (100%)",children:[e,"%"]}),m("button",{type:"button",onClick:t,disabled:e>=200,"aria-label":"Perbesar tampilan",title:"Zoom In (+10%)",className:"p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors",children:m(Jy,{size:12})})]})}var Qen=O(()=>{pt();de()});function Hae({url:e,statusDotClass:t,statusLabel:n,viewportMode:r,zoomLevel:a,onChangeViewport:i,onZoomIn:o,onZoomOut:s,onResetZoom:l,onSetZoom:u,onIncludeInChat:d,onOpenExternal:p,trailingControls:h,openExternalLabel:f,openExternalTitle:g,children:b}){let[y,v]=ae(!1),[x,k]=ae(!1),C=()=>{if(!e)return;navigator.clipboard.writeText(e).then(()=>{v(!0),setTimeout(()=>v(!1),2000)}).catch(()=>{})},_=()=>{d(),k(!0),setTimeout(()=>k(!1),2500)};return m("div",{className:"h-10 px-2.5 border-b border-ink/10 bg-paper flex items-center justify-between flex-shrink-0 select-none space-x-2",children:[m("div",{className:"flex items-center space-x-1.5 flex-shrink-0",title:n,children:[m("span",{className:`w-1.5 h-1.5 rounded-full ${t}`}),m("span",{className:"text-[10px] font-mono uppercase tracking-wide text-ink/60",children:n})]}),b,m("div",{className:"flex items-center space-x-1.5 flex-shrink-0",children:[r&&i&&m(Yen,{viewportMode:r,onChangeViewport:i,zoomLevel:a,onSetZoom:u}),m(Jen,{zoomLevel:a,onZoomIn:o,onZoomOut:s,onResetZoom:l}),m("button",{type:"button",onClick:_,disabled:!e,"aria-label":"Sertakan halaman ini di draft chat",title:x?"Konteks halaman ditambahkan ke draft":"Sertakan halaman ini di draft chat",className:Az,children:x?m(Xt,{size:14,className:"text-success"}):m(pb,{size:14})}),m("button",{type:"button",onClick:C,disabled:!e,"aria-label":"Salin URL",title:y?"Copied URL!":"Copy URL",className:Az,children:y?m(Xt,{size:14,className:"text-success"}):m(yi,{size:14})}),h,m("button",{type:"button",onClick:p,disabled:!e,"aria-label":f,title:g,className:Az,children:m(so,{size:14})})]})]})}var Az="p-1.5 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink transition-colors cursor-pointer disabled:cursor-not-allowed";var H9e=O(()=>{Je();pt();Xen();Qen();de()});function etn({url:e,input:t,loading:n,error:r,canGoBack:a,canGoForward:i,viewportMode:o,zoomLevel:s,onInputChange:l,onSubmit:u,onBack:d,onForward:p,onReload:h,onOpenExternal:f,onIncludeInChat:g,onChangeViewport:b,onZoomIn:y,onZoomOut:v,onResetZoom:x,onSetZoom:k}){let C=Re(void 0);Ee(()=>{if(C.current===e)return;if(C.current=e,e)l(e)},[e,l]);let _=!e?"idle":n?"loading":"ready",w=_==="ready"?"bg-success animate-pulse":_==="loading"?"bg-ink/40 animate-pulse":"bg-ink/25",T=m("div",{className:"flex items-center bg-canvas border border-ink/10 rounded-md p-0.5 space-x-0.5 flex-shrink-0",children:[m("button",{type:"button",onClick:d,disabled:!a,"aria-label":"Kembali",title:"Kembali",className:V9e,children:m(ip,{size:12})}),m("button",{type:"button",onClick:p,disabled:!i,"aria-label":"Maju",title:"Maju",className:V9e,children:m(Sy,{size:12})}),m("button",{type:"button",onClick:h,disabled:!e,"aria-label":"Muat ulang",title:"Muat ulang",className:V9e,children:m(Mn,{size:12,className:n?"animate-spin":void 0})})]});return m(Hae,{url:e,statusDotClass:w,statusLabel:$Br[_],viewportMode:o,zoomLevel:s,onChangeViewport:b,onZoomIn:y,onZoomOut:v,onResetZoom:x,onSetZoom:k,onIncludeInChat:g,onOpenExternal:f,openExternalLabel:"Buka di tab baru",openExternalTitle:"Buka di tab baru (untuk situs yang menolak iframe)",children:m("div",{className:"flex items-center flex-1 min-w-0 space-x-1.5",children:[T,m("form",{className:`flex-1 min-w-0 flex items-center bg-canvas border rounded-md px-2 py-0.5 space-x-1 focus-within:border-ink/40 ${r?"border-error":"border-ink/15"}`,onSubmit:(E)=>{E.preventDefault(),u(t)},children:[m(Pa,{size:12,className:"text-ink/40 flex-shrink-0"}),m("input",{type:"text",value:t,onChange:(E)=>l(E.currentTarget.value),placeholder:"Ketik alamat (mis. localhost:5173) lalu Enter…","aria-label":"Alamat browser pengguna","aria-invalid":r!==void 0&&r!==null,title:r??void 0,spellcheck:!1,autoComplete:"off",className:`w-full min-w-0 bg-transparent outline-none font-mono text-[11px] placeholder:text-ink/30 ${r?"text-error":"text-ink/90"}`})]})]})})}var $Br,V9e="p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors";var ttn=O(()=>{Je();pt();H9e();de();$Br={idle:"Kosong",loading:"Memuat",ready:"Siap"}});var ntn;var rtn=O(()=>{ntn={"desktop-16-9":"w-full max-w-[1280px] aspect-video max-h-full border border-ink/20 rounded-lg shadow-md overflow-hidden my-auto",laptop:"w-[1024px] max-w-full h-[768px] max-h-full border border-ink/20 rounded-lg shadow-md overflow-hidden my-auto",tablet:"w-[768px] max-w-full h-[1024px] max-h-full border border-ink/20 rounded-lg shadow-md overflow-hidden my-auto",mobile:"w-[375px] max-w-full h-[667px] max-h-full border border-ink/20 rounded-xl shadow-md overflow-hidden my-auto","mobile-lg":"w-[414px] max-w-full h-[896px] max-h-full border border-ink/20 rounded-xl shadow-md overflow-hidden my-auto",responsive:"w-full h-full border-0"}});function atn({url:e,frameKey:t,loading:n,viewportMode:r,zoomLevel:a,onLoad:i,active:o=!0}){if(!o)return null;if(!e)return m("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center select-none",children:[m("div",{className:"w-12 h-12 rounded-xl bg-ink/5 border border-ink/10 flex items-center justify-center text-ink/40 mb-3",children:m(Pa,{size:22})}),m("h3",{className:"text-sm font-semibold text-ink mb-1",children:"Browser Anda"}),m("p",{className:"text-xs text-ink/60 max-w-sm",children:"Ketik alamat di atas lalu Enter. Halaman dimuat langsung di panel ini."}),m("p",{className:"text-[11px] text-ink/45 max-w-sm mt-2",children:"Sebagian situs (Google, GitHub) menolak ditampilkan dalam iframe — pakai tombol buka di tab baru."})]});return m("div",{className:"flex-1 min-h-0 relative flex items-center justify-center p-2 overflow-auto bg-canvas/60",children:[n?m("div",{className:"absolute inset-0 z-10 flex items-center justify-center pointer-events-none",children:m("div",{className:"flex items-center space-x-2 px-3 py-1.5 rounded-md bg-paper border border-ink/15",children:[m(nn,{size:13,className:"animate-spin text-ink/50"}),m("span",{className:"text-[11px] font-mono text-ink/60",children:"Memuat…"})]})}):null,m("div",{className:`relative flex flex-col bg-white ${ntn[r]} transition-all duration-200`,style:{zoom:a!==100?`${a}%`:void 0,transformOrigin:"top center"},children:m("iframe",{src:e,title:"Browser pengguna",onLoad:i,referrerPolicy:"no-referrer",allow:OBr,className:"w-full h-full bg-white border-0"},t)})]})}var OBr="clipboard-read; clipboard-write; fullscreen";var itn=O(()=>{pt();rtn();de()});function otn(e){let t=e.trim();if(!t)return t;let n=/^[a-z][a-z0-9+.-]*:/i.test(t)?t:`https://${t}`,r=new URL(n);if(r.protocol!=="http:"&&r.protocol!=="https:")throw Error("Only http and https URLs are allowed");return r.toString()}function stn(){let[e,t]=qn(FBr,[]),[n,r]=qn(BBr,-1),[a,i]=qn(zBr,""),[o,s]=ae(0),[l,u]=ae(!1),[d,p]=ae(void 0),h=n>=0&&n<e.length?e[n]??"":"",f=Le((x)=>{let k=x.trim();if(!k)return;let C;try{C=otn(k)}catch(T){p(T instanceof Error?T.message:"Alamat tidak valid");return}p(void 0),u(!0);let w=[...e.slice(0,n+1),C];t(w),r(w.length-1),i(C),s((T)=>T+1)},[e,n,t,r,i]),g=Le(()=>{if(n<=0)return;u(!0),r(n-1)},[n,r]),b=Le(()=>{if(n>=e.length-1)return;u(!0),r(n+1)},[e.length,n,r]),y=Le(()=>{if(!h)return;u(!0),s((x)=>x+1)},[h]),v=Le(()=>{u(!1)},[]);return{url:h,input:a,setInput:i,frameKey:o,loading:l,error:d,canGoBack:n>0,canGoForward:n>=0&&n<e.length-1,submit:f,goBack:g,goForward:b,reload:y,markLoaded:v}}var FBr="userBrowser.history",BBr="userBrowser.historyIndex",zBr="userBrowser.inputUrl";var ltn=O(()=>{Je();Yi()});function Vae(e){if(typeof window>"u")return;window.dispatchEvent(new CustomEvent("omp:browser-include-page",{detail:e}))}var Z9e="omp:browser-include-page";function jBr({className:e="",active:t=!0}){let[n,r]=qn("userBrowser.viewportMode","responsive"),[a,i]=qn("userBrowser.zoomLevel",100),{url:o,input:s,setInput:l,frameKey:u,loading:d,error:p,canGoBack:h,canGoForward:f,submit:g,goBack:b,goForward:y,reload:v,markLoaded:x}=stn(),k=Le(()=>{if(!o)return;window.open(o,"_blank","noopener,noreferrer")},[o]),C=Le(()=>{if(!o)return;Vae({url:o})},[o]);return m("div",{className:`flex flex-col h-full w-full bg-paper text-ink overflow-hidden ${e}`,children:[m(etn,{url:o,input:s,loading:d,error:p,canGoBack:h,canGoForward:f,viewportMode:n,zoomLevel:a,onInputChange:l,onSubmit:g,onBack:b,onForward:y,onReload:v,onOpenExternal:k,onIncludeInChat:C,onChangeViewport:r,onZoomIn:()=>i((_)=>Math.min(200,_+10)),onZoomOut:()=>i((_)=>Math.max(50,_-10)),onResetZoom:()=>i(100),onSetZoom:i}),m(atn,{url:o,frameKey:u,loading:d,viewportMode:n,zoomLevel:a,onLoad:x,active:t})]})}var ctn=O(()=>{Je();ttn();itn();ltn();Yi();de()});function utn({url:e,status:t,zoomLevel:n=100,onIncludeInChat:r,onReconnect:a,onOpenExternal:i,onZoomIn:o,onZoomOut:s,onResetZoom:l}){return m(Hae,{url:e??"",statusDotClass:t==="live"?"bg-success animate-pulse":"bg-ink/25",statusLabel:UBr[t],zoomLevel:n,onZoomIn:o,onZoomOut:s,onResetZoom:l,onIncludeInChat:r,onOpenExternal:i,openExternalLabel:"Buka di jendela baru",openExternalTitle:e?"Open in new window":"No URL loaded",trailingControls:m("button",{type:"button",onClick:a,"aria-label":"Sambungkan ulang live view",title:"Reconnect live view",className:Az,children:m(Rg,{size:14})}),children:m("div",{className:"flex-1 min-w-0 flex items-center bg-canvas border border-ink/15 rounded-md px-2 py-0.5",children:[m(Pa,{size:12,className:"text-ink/40 mr-1.5 flex-shrink-0"}),m("span",{className:"w-full truncate text-ink/80 font-mono text-[11px]",title:e??"",children:e||"Agent belum membuka halaman"})]})})}var UBr;var dtn=O(()=>{pt();H9e();de();UBr={live:"Live","agent-offline":"Agent offline","browser-offline":"Browser offline","no-tab":"Tanpa tab"}});function ptn({actions:e}){if(e.length===0)return null;return m("div",{className:"absolute bottom-3 left-3 z-20 flex flex-col gap-1.5 pointer-events-none max-w-[320px]",children:e.map((t)=>{let n=qBr[t.kind],r=t.kind==="error";return m("div",{className:`flex items-center gap-2 rounded-md border px-2.5 py-1.5 text-[11px] shadow-sm backdrop-blur-sm ${r?"border-error/30 bg-error/10 text-error":"border-ink/15 bg-paper/95 text-ink"}`,children:[m(n,{size:12,className:`flex-shrink-0 ${r?"text-error":"text-ink/60"}`}),m("span",{className:"truncate",children:t.label})]},t.id)})})}var qBr;var mtn=O(()=>{pt();de();qBr={open:Pa,navigate:Pa,loaded:Ur,click:wN,type:Pg,press:Du,submit:Ng,wait:sf,screenshot:_d,scroll:CN,upload:A5,close:Nu,error:Nu}});function htn({status:e,url:t,tabs:n,targetId:r,frameSrc:a,actions:i,onSelectTarget:o,zoomLevel:s}){let l=e==="live",u=l?null:WBr[e];return m("div",{className:"flex-1 flex flex-col min-h-0 bg-canvas/60 relative overflow-hidden",children:[m(ptn,{actions:i}),l&&n.length>1&&m("div",{className:"px-2 py-1 border-b border-ink/10 bg-paper flex items-center gap-1 overflow-x-auto flex-shrink-0",children:n.map((d)=>{let p=d.targetId===r;return m("button",{type:"button",onClick:()=>o(p?"":d.targetId),className:`px-2 py-0.5 rounded text-[11px] font-mono max-w-[220px] truncate border transition-colors cursor-pointer ${p?"bg-ink text-canvas border-ink":"bg-paper text-ink/70 border-ink/15 hover:border-ink/35 hover:text-ink"}`,title:d.url||d.title||d.targetId,children:d.title||d.url||d.targetId},d.targetId)})}),m("div",{className:"flex-1 flex items-center justify-center p-2 min-h-0 overflow-auto",children:l?m("div",{className:"relative flex flex-col bg-paper w-full h-full transition-all duration-200",style:{zoom:s!==100?`${s}%`:void 0,transformOrigin:"top center"},children:a?m("img",{src:a,alt:t||"Live browser view",className:"w-full h-full object-contain bg-paper",draggable:!1}):m("div",{className:"w-full h-full flex flex-col items-center justify-center text-center p-6 select-none",children:[m(nn,{size:20,className:"animate-spin text-ink/40 mb-2"}),m("p",{className:"text-xs text-ink/60",children:"Menunggu frame pertama dari browser…"})]})}):m("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center select-none my-auto",children:[m("div",{className:"w-12 h-12 rounded-xl bg-ink/5 border border-ink/10 flex items-center justify-center text-ink/40 mb-3",children:e==="agent-offline"?m(Zy,{size:24}):m(Pa,{size:24})}),m("h3",{className:"text-sm font-semibold text-ink mb-1",children:u?.title}),m("p",{className:"text-xs text-ink/60 max-w-sm",children:u?.body})]})})]})}var WBr;var ftn=O(()=>{pt();mtn();de();WBr={"agent-offline":{title:"Agent belum berjalan",body:"Aktifkan sesi ini agar browser bisa dikendalikan agent."},"browser-offline":{title:"Belum ada browser aktif",body:"Minta agent membuka sebuah halaman; tampilan live akan muncul di sini."},"no-tab":{title:"Browser aktif, belum ada tab",body:"Sesi ini belum membuka tab di browser bersama."}}});function vtn(e=!0){let{sessionId:t,ready:n}=rl(),[r,a]=ae(gtn),[i,o]=ae(void 0),[s,l]=ae([]),[u,d]=ae(""),[p,h]=ae(0),f=Re(null),g=Re(null),b=Re(void 0),y=Re(0),v=Re([]),x=Le((C)=>{d(C.trim())},[]),k=Le(()=>{h((C)=>C+1)},[]);return Ee(()=>{let C=setInterval(()=>{l((_)=>{let w=Date.now(),T=_.filter((L)=>L.expiresAt>w),E=v.current.shift();if(!E)return T.length===_.length?_:T;return[...T.slice(-(VBr-1)),{...E,expiresAt:w+GBr}]})},HBr);return()=>clearInterval(C)},[]),Ee(()=>{a(gtn),o(void 0),d(""),v.current=[],l([])},[t]),Ee(()=>{if(!n||!t||!e)return;let C=!1,_=()=>{if(C)return;let T=u?`?target=${encodeURIComponent(u)}`:"",E=new EventSource(`/api/browser/${encodeURIComponent(t)}/stream${T}`);f.current=E,E.addEventListener("open",()=>{y.current=0}),E.addEventListener("state",(L)=>{try{let P=JSON.parse(L.data);if(P.targetId!==b.current)o(void 0);if(b.current=P.targetId,a(P),P.status!=="live")o(void 0)}catch{}}),E.addEventListener("frame",(L)=>{try{let P=JSON.parse(L.data),R=b.current;if(R&&P.targetId&&P.targetId!==R)return;o(`data:${P.mimeType};base64,${P.data}`)}catch{}}),E.addEventListener("action",(L)=>{try{let P=JSON.parse(L.data);if(typeof P?.label!=="string"||!P.label)return;if(v.current.push(P),v.current.length>ytn)v.current.splice(0,v.current.length-ytn)}catch{}}),E.addEventListener("error",()=>{if(E.readyState===EventSource.CLOSED)w()})},w=()=>{if(C||g.current)return;let T=Math.min(y.current+1,btn/1000);y.current=T,g.current=setTimeout(()=>{g.current=null,f.current?.close(),f.current=null,_()},Math.min(T*1000,btn))};return _(),()=>{if(C=!0,g.current)clearTimeout(g.current),g.current=null;f.current?.close(),f.current=null}},[n,t,u,p,e]),{status:r.status,url:r.url,title:r.title,tabs:r.tabs,targetId:r.targetId,frameSrc:i,actions:s,selectTarget:x,reconnect:k}}var gtn,btn=5000,GBr=4000,HBr=500,VBr=3,ytn=16;var xtn=O(()=>{Je();Kh();gtn={status:"agent-offline",tabs:[]}});function ZBr({className:e="",active:t=!0}){let[n,r]=qn("browser.zoomLevel",100),{status:a,url:i,title:o,tabs:s,targetId:l,frameSrc:u,actions:d,selectTarget:p,reconnect:h}=vtn(t),f=()=>{if(!i)return;let b=i.startsWith("/")&&typeof window<"u"?`${window.location.origin}${i}`:i;window.open(b,"_blank","noopener,noreferrer")},g=Le(()=>{if(!i)return;Vae({url:i,title:o})},[i,o]);return m("div",{className:`flex flex-col h-full w-full bg-paper text-ink overflow-hidden select-none ${e}`,children:[m(utn,{url:i,status:a,zoomLevel:n,onIncludeInChat:g,onReconnect:h,onOpenExternal:f,onZoomIn:()=>r((b)=>Math.min(200,b+10)),onZoomOut:()=>r((b)=>Math.max(50,b-10)),onResetZoom:()=>r(100)}),m(htn,{status:a,url:i,tabs:s,targetId:l,frameSrc:u,actions:d,onSelectTarget:p,zoomLevel:n})]})}var ktn=O(()=>{Je();dtn();ftn();xtn();Yi();de()});function _tn({providerName:e,credentialSources:t,error:n,note:r,children:a}){return m("section",{className:"bg-paper border border-ink/15 rounded-lg shadow-xs",children:[m("header",{className:"flex items-center justify-between gap-2 px-3.5 py-2.5 border-b border-ink/10",children:[m("span",{className:"text-xs font-semibold text-ink",children:e}),m("span",{className:"text-[10px] font-mono uppercase tracking-wider text-ink/50 truncate",title:`Credentials from ${t.join(", ")}`,children:t.join(" · ")})]}),m("div",{className:"p-3.5 space-y-4",children:[n&&m("p",{className:"flex items-start gap-2 text-error text-xs leading-relaxed",children:[m(Qn,{size:14,className:"shrink-0 mt-0.5"}),m("span",{className:"break-words",children:n})]}),a,r&&m("p",{className:"text-[10px] text-ink/50 leading-relaxed border-t border-ink/10 pt-2.5",children:r})]})]})}var wtn=O(()=>{pt();de()});function H0(e){return KBr.format(e)}function my(e){return YBr.format(e)}function V0(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;return XBr.format(t)}function Ctn(e,t){if(t<=0)return 0;return Math.min(100,Math.max(0,e/t*100))}function Stn(e,t){if(t<=0)return"0%";return`${new Intl.NumberFormat("id-ID",{maximumFractionDigits:1}).format(e/t*100)}%`}function $4(e){if(!Number.isFinite(e))return"0";let t=Math.abs(e);if(t>=1e9)return`${K9e.format(e/1e9)}B`;if(t>=1e6)return`${K9e.format(e/1e6)}M`;if(t>=1000)return`${K9e.format(e/1000)}K`;return my(e)}function aL(e){let t=Number(e);if(e.trim()===""||!Number.isFinite(t))return e;return my(t)}function Y9e(e){if(!Number.isFinite(e))return"$0,00";return`$${JBr.format(e)}`}function Zae(e,t){if(!Number.isFinite(e))return"—";switch(t){case"percent":return`${new Intl.NumberFormat("id-ID",{maximumFractionDigits:1}).format(e)}%`;case"usd":return Y9e(e);case"tokens":case"bytes":return $4(e);default:return my(e)}}function Ttn(e){if(!Number.isFinite(e))return"0%";return`${new Intl.NumberFormat("id-ID",{maximumFractionDigits:1}).format(e*100)}%`}var KBr,YBr,K9e,XBr,JBr;var hy=O(()=>{KBr=new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR",maximumFractionDigits:0}),YBr=new Intl.NumberFormat("id-ID"),K9e=new Intl.NumberFormat("id-ID",{minimumFractionDigits:2,maximumFractionDigits:2,useGrouping:!1}),XBr=new Intl.DateTimeFormat("id-ID",{dateStyle:"medium",timeStyle:"short"});JBr=new Intl.NumberFormat("id-ID",{minimumFractionDigits:2,maximumFractionDigits:2})});function QBr({window:e}){let t=e.usedRp+e.remainingRp,n=Ctn(e.usedRp,t);return m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs space-y-2",children:[m("div",{className:"flex items-center justify-between gap-2",children:[m("span",{className:"text-[11px] font-semibold text-ink",children:e.label}),m("span",{className:"text-[10px] text-ink/50",children:["Resets ",V0(e.resetsAt)]})]}),m("div",{className:"h-1.5 w-full bg-ink/10 rounded-full overflow-hidden",children:m("div",{className:"h-full bg-ink/80 rounded-full",style:{width:`${n}%`}})}),m("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-0.5 text-[10px] text-ink/60",children:[m("span",{children:["Used ",m("span",{className:"font-semibold text-ink",children:H0(e.usedRp)})," ·"," ",Stn(e.usedRp,t)]}),m("span",{children:["Remaining ",m("span",{className:"font-semibold text-ink",children:H0(e.remainingRp)})]})]})]})}function ezr({coupon:e}){return m("div",{className:"bg-ink/5 border border-ink/10 rounded-lg p-3 shadow-xs",children:[m("div",{className:"flex items-center gap-1.5 mb-1.5",children:[m(BN,{size:12,className:"text-ink/60"}),m("span",{className:"text-[11px] font-semibold text-ink",children:["Active coupon · ",e.name]})]}),m("div",{className:"text-[10px] text-ink/60 space-y-0.5",children:[m("div",{children:["Remaining"," ",m("span",{className:"font-semibold text-ink",children:e.remainingRp===null?"Unlimited":H0(e.remainingRp)})," ","· Used ",m("span",{className:"font-semibold text-ink",children:H0(e.usedRp)})]}),m("div",{children:["Expires ",V0(e.expiresAt)]}),e.scopeModels.length>0&&m("div",{children:["Models: ",e.scopeModels.join(", ")]})]})]})}function Etn({quota:e}){if(!e)return m("p",{className:"text-[11px] text-ink/50",children:"Quota data is not available for this account."});return m("div",{className:"space-y-2",children:[m("div",{className:"flex items-center justify-between gap-2",children:[m("h4",{className:"text-[10px] font-mono font-semibold uppercase tracking-wider text-ink/40",children:"Quota windows"}),e.planName&&m("span",{className:"text-[10px] text-ink/60",children:["Plan ",m("span",{className:"font-semibold text-ink",children:e.planName})]})]}),e.windows.length===0?m("p",{className:"text-[11px] text-ink/50",children:"No quota windows reported."}):m("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2.5",children:e.windows.map((t)=>m(QBr,{window:t},t.key))}),e.coupon&&m(ezr,{coupon:e.coupon})]})}var Atn=O(()=>{pt();hy();de()});function Ltn({usage:e}){if(!e)return m("p",{className:"text-[11px] text-ink/50",children:"The 30-day usage report is not available."});let t=e.rows.reduce((r,a)=>r+a.inputTokens,0),n=e.rows.reduce((r,a)=>r+a.outputTokens,0);return m("div",{className:"space-y-2",children:[m("h4",{className:"text-[10px] font-mono font-semibold uppercase tracking-wider text-ink/40",children:"30-day usage by model"}),m("div",{className:"overflow-x-auto border border-ink/15 rounded-lg shadow-xs",children:m("table",{className:"w-full text-[11px]",children:[m("thead",{className:"bg-ink/5 text-ink/60",children:m("tr",{children:[m("th",{className:"text-left font-semibold px-3 py-2 whitespace-nowrap",children:"Model"}),m("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Requests"}),m("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Input tokens"}),m("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Output tokens"}),m("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Cost"})]})}),m("tbody",{className:"divide-y divide-ink/10",children:e.rows.length===0?m("tr",{children:m("td",{colSpan:5,className:"px-3 py-3 text-center text-ink/50",children:"No usage recorded in the last 30 days."})}):e.rows.map((r)=>m("tr",{children:[m("td",{className:"px-3 py-1.5 font-mono text-ink whitespace-nowrap",children:r.model}),m("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:my(r.requests)}),m("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:$4(r.inputTokens)}),m("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:$4(r.outputTokens)}),m("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:H0(r.costRp)})]},r.model))}),m("tfoot",{className:"bg-ink/5 border-t border-ink/15 font-semibold text-ink",children:m("tr",{children:[m("td",{className:"px-3 py-2",children:"Total"}),m("td",{className:"px-3 py-2 text-right tabular-nums",children:my(e.totalRequests)}),m("td",{className:"px-3 py-2 text-right tabular-nums",children:$4(t)}),m("td",{className:"px-3 py-2 text-right tabular-nums",children:$4(n)}),m("td",{className:"px-3 py-2 text-right tabular-nums",children:H0(e.totalCostRp)})]})})]})})]})}var Rtn=O(()=>{hy();de()});function Ntn({report:e}){let{balance:t,usage:n,quota:r}=e;if(!t&&!n&&!r)return m("p",{className:"text-[11px] text-ink/50",children:"No kenari data was returned for this account."});let a=t?t.amountRp!==null?H0(t.amountRp):t.raw:"—",i=t?t.amountRp!==null?t.raw:"Amount could not be parsed":"Balance unavailable",o=n?n.rows.reduce((s,l)=>s+l.inputTokens+l.outputTokens,0):0;return m(kt,{children:[m("div",{className:"@container",children:m("div",{className:"grid grid-cols-3 @[540px]:grid-cols-5 gap-2.5 items-stretch",children:[m(xo,{value:a,label:"Wallet balance",hint:i}),m(xo,{value:r?.planName??"—",label:"Active plan",hint:r?"kenari quota plan":"Quota unavailable"}),m(xo,{value:n?my(n.totalRequests):"—",label:"Requests (30 days)",hint:n?"Across all models":"Usage report unavailable"}),m(xo,{value:n?H0(n.totalCostRp):"—",label:"Cost (30 days)",hint:n?"Billed in Rupiah":"Usage report unavailable"}),m(xo,{value:n?$4(o):"—",label:"Tokens processed (30 days)",hint:n?"Input + output":"Usage report unavailable",tone:"muted",className:"col-span-2 @[540px]:col-span-1"})]})}),m(Etn,{quota:r}),m(Ltn,{usage:n})]})}var Itn=O(()=>{D9();Atn();Rtn();hy();de()});function Mtn({report:e}){let t=e.balance;if(!t)return m("p",{className:"text-[11px] text-ink/50",children:"DeepSeek balance data is not available."});return m(kt,{children:[m("div",{className:"@container",children:m("div",{className:"grid grid-cols-3 @[540px]:grid-cols-5 gap-2.5 items-stretch",children:[m(xo,{value:t.isAvailable?"Available":"Unavailable",label:"Prepaid balance",hint:t.isAvailable?"Account can spend":"Top up required",tone:t.isAvailable?"default":"muted"}),m(xo,{value:my(t.entries.length),label:"Currency buckets",hint:t.entries.length>0?"From the balance endpoint":"No entries returned",tone:"muted"})]})}),t.entries.length===0?m("p",{className:"text-[11px] text-ink/50",children:"The balance endpoint returned no currency entries."}):m("div",{className:"grid grid-cols-1 gap-2.5",children:t.entries.map((n)=>m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs",children:[m("div",{className:"flex items-center justify-between gap-2 mb-2",children:[m("span",{className:"text-[11px] font-semibold text-ink",children:n.currency}),m("span",{className:"text-[10px] font-mono uppercase tracking-wider text-ink/40",children:"Balance"})]}),m("dl",{className:"grid grid-cols-3 gap-2 text-[10px]",children:[m("div",{children:[m("dt",{className:"text-ink/50",children:"Total"}),m("dd",{className:"font-semibold text-ink tabular-nums break-words",children:aL(n.totalBalance)})]}),m("div",{children:[m("dt",{className:"text-ink/50",children:"Granted"}),m("dd",{className:"font-semibold text-ink tabular-nums break-words",children:aL(n.grantedBalance)})]}),m("div",{children:[m("dt",{className:"text-ink/50",children:"Topped up"}),m("dd",{className:"font-semibold text-ink tabular-nums break-words",children:aL(n.toppedUpBalance)})]})]})]},n.currency))})]})}var Ptn=O(()=>{D9();hy();de()});function tzr({limit:e}){let t=Math.min(100,Math.max(0,(e.usedFraction??0)*100)),n=e.modelId??e.accountId,r=e.used!==void 0?Zae(e.used,e.unit):void 0,a=e.limit!==void 0?Zae(e.limit,e.unit):void 0,i=e.remaining!==void 0?Zae(e.remaining,e.unit):void 0;return m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs space-y-2",children:[m("div",{className:"flex items-start justify-between gap-2",children:[m("div",{className:"min-w-0",children:[m("div",{className:"text-[11px] font-semibold text-ink truncate",children:e.label}),n&&m("div",{className:"text-[10px] text-ink/50 truncate",children:n})]}),m("span",{className:"text-[10px] text-ink/50 flex-shrink-0 whitespace-nowrap",children:e.resetsAt!==void 0?`Resets ${V0(new Date(e.resetsAt).toISOString())}`:""})]}),m("div",{className:"h-1.5 w-full bg-ink/10 rounded-full overflow-hidden",children:m("div",{className:`h-full rounded-full ${e.status==="exhausted"?"bg-error/70":"bg-ink/80"}`,style:{width:`${t}%`}})}),m("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-0.5 text-[10px] text-ink/60",children:[m("span",{children:["Used"," ",m("span",{className:"font-semibold text-ink",children:e.unit==="percent"||!r?Ttn(e.usedFraction??0):r}),e.unit!=="percent"&&r&&a?` of ${a}`:""]}),m("span",{className:"flex items-center gap-2",children:[e.status!=="ok"&&e.status!=="unknown"&&m("span",{className:"text-[10px] font-mono uppercase px-1.5 py-0.5 rounded bg-ink/10 text-ink/70",children:e.status}),i&&m("span",{children:["Remaining ",m("span",{className:"font-semibold text-ink",children:i})]})]})]}),e.notes&&e.notes.length>0&&m("ul",{className:"text-[10px] text-ink/50 leading-relaxed space-y-0.5",children:e.notes.map((o)=>m("li",{children:o},o))})]})}function Dtn({limits:e,tracked:t,unavailable:n,notes:r}){return m("div",{className:"space-y-2",children:[m("h4",{className:"text-[10px] font-mono font-semibold uppercase tracking-wider text-ink/40",children:"Quota windows"}),r&&r.length>0&&m("ul",{className:"text-[10px] text-ink/50 leading-relaxed space-y-0.5",children:r.map((a)=>m("li",{children:a},a))}),e.length===0?m("p",{className:"text-[11px] text-ink/50",children:!t?"No quota source for this provider: omp ships no usage adapter for it and it exposes no balance endpoint Kabmo knows.":n?"omp tracks this provider but its usage endpoint returned no data — an invalid or expired credential, an unreachable endpoint, or a plan without quota windows.":"No quota windows were reported for this provider."}):m("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2.5",children:e.map((a)=>m(tzr,{limit:a},a.id))})]})}var $tn=O(()=>{hy();de()});function Kae({summary:e}){let t=Boolean(e.kenari||e.deepseek);return m(_tn,{providerName:e.name,credentialSources:e.credentialSources,error:e.error,note:e.deepseek?nzr:void 0,children:[e.kenari&&m(Ntn,{report:e.kenari}),e.deepseek&&m(Mtn,{report:e.deepseek}),!t&&(e.limits.length>0||!e.error)&&m(Dtn,{limits:e.limits,tracked:e.tracked,unavailable:e.limitsUnavailable,notes:e.notes})]})}var nzr="DeepSeek exposes no usage or quota API — only the prepaid balance (and the web console at platform.deepseek.com) is available.";var X9e=O(()=>{wtn();Itn();Ptn();$tn();de()});function rzr(e){let t=e.filter((a)=>a.usedFraction!==void 0);if(t.length===0){let a=e.find((i)=>i.unit==="usd"&&i.remaining!==void 0);if(a)return`${Y9e(a.remaining??0)} left`;return e[0]?.label}let n=t.reduce((a,i)=>(i.usedFraction??0)>(a.usedFraction??0)?i:a),r=Math.round((n.usedFraction??0)*100);return n.windowLabel?`${r}% · ${n.windowLabel}`:`${r}% used`}function iL(e){return e.providers.map((t)=>({id:t.id,name:t.name,error:t.error,hint:azr(t),limits:t.limits,tracked:t.tracked,limitsUnavailable:t.limitsUnavailable,summary:t}))}function azr(e){let t=e.kenari?.quota?.planName;if(t)return t;let n=e.deepseek?.balance?.entries[0];if(n)return`${n.currency} ${aL(n.totalBalance)}`;return rzr(e.limits)??"No quota reported"}function oL(e){return e.error?"Error":"Connected"}var Lz=O(()=>{hy()});function Ftn({providers:e,value:t,onChange:n}){let[r,a]=ae(!1),[i,o]=ae(""),[s,l]=ae(0),u=Re(null),d=Re(null),p=Re(null),h=Re([]),f=e.find((k)=>k.id===t)??e[0],g=ut(()=>{let k=i.trim().toLowerCase();if(!k)return e;return e.filter((C)=>`${C.name} ${oL(C)} ${C.hint}`.toLowerCase().includes(k))},[e,i]),b=()=>{let k=Math.max(0,e.findIndex((C)=>C.id===t));o(""),l(k),a(!0)},y=(k=!1)=>{if(a(!1),o(""),k)d.current?.focus()},v=(k)=>{n(k),y(!0)};return Ee(()=>{if(!r)return;h.current[s]?.scrollIntoView({block:"nearest"})},[r,s]),Yr(u,()=>a(!1)),m("div",{className:"relative min-w-0",ref:u,onKeyDown:(k)=>{let C=k.target===p.current;if(!r){if(k.key==="ArrowDown"||k.key==="Enter"||k.key===" ")k.preventDefault(),b();return}switch(k.key){case"Escape":k.preventDefault(),y(!0);break;case"ArrowDown":k.preventDefault(),l((_)=>Math.max(0,Math.min(g.length-1,_+1)));break;case"ArrowUp":k.preventDefault(),l((_)=>Math.max(0,_-1));break;case"Home":k.preventDefault(),l(0);break;case"End":k.preventDefault(),l(Math.max(0,g.length-1));break;case"Enter":if(k.preventDefault(),g[s])v(g[s].id);break;case" ":if(C)return;if(k.preventDefault(),g[s])v(g[s].id);break;default:break}},children:[m("button",{ref:d,type:"button",onClick:()=>r?y():b(),"aria-haspopup":"listbox","aria-expanded":r,"aria-controls":Otn,title:"Select usage provider",className:"flex w-full min-w-0 items-center justify-between gap-2 bg-paper border border-ink/15 rounded-lg px-3 py-1.5 text-xs text-ink hover:bg-ink/5 transition-colors",children:[m("span",{className:"flex min-w-0 items-center gap-2",children:[f&&m(To,{slug:f.id,name:f.name,size:13,className:"text-ink/60"}),m("span",{className:"truncate font-medium",children:f?.name??"Select provider"}),f&&m("span",{className:"truncate text-[10px] text-ink/50",children:oL(f)})]}),m(Zn,{size:12,className:`flex-shrink-0 text-ink/40 transition-transform ${r?"rotate-180":""}`})]}),r&&m("div",{className:"absolute top-full left-0 mt-1 w-52 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs",children:[m("div",{className:"px-2 py-1.5 border-b border-ink/10 flex items-center gap-1.5",children:[m(na,{size:11,className:"text-ink/40 flex-shrink-0"}),m("input",{ref:p,type:"text",value:i,onChange:(k)=>{o(k.currentTarget.value),l(0)},placeholder:"Search providers...",title:"Search providers",className:"w-full min-w-0 bg-transparent outline-none text-xs text-ink placeholder-ink/40",autoFocus:!0}),i&&m("button",{type:"button",onClick:()=>{o(""),l(0),p.current?.focus()},title:"Clear search",className:"text-ink/40 hover:text-ink flex-shrink-0",children:"×"})]}),m("div",{id:Otn,role:"listbox","aria-label":"Usage providers",className:"max-h-48 scrollbar-overlay-container py-1",children:g.length===0?m("div",{className:"px-3 py-2 text-ink/40 italic",children:"No providers found"}):g.map((k,C)=>m("button",{ref:(_)=>{h.current[C]=_},type:"button",role:"option","aria-selected":k.id===t,onClick:()=>v(k.id),onMouseEnter:()=>l(C),title:k.hint,className:`w-full text-left px-3 py-2 flex items-center justify-between gap-2 transition-colors ${C===s?"bg-ink/5":"hover:bg-ink/5"}`,children:[m("span",{className:"flex min-w-0 items-center gap-2",children:[m(To,{slug:k.id,name:k.name,size:14,className:"text-ink/60"}),m("span",{className:"min-w-0",children:[m("span",{className:"block truncate font-medium text-ink",children:k.name}),m("span",{className:"block truncate text-[10px] text-ink/50",children:[oL(k)," · ",k.hint]})]})]}),k.id===t&&m(Xt,{size:12,className:"flex-shrink-0 text-ink"})]},k.id))})]})]})}var Otn="usage-provider-listbox";var Btn=O(()=>{Je();pt();Lz();mh();So();de()});function ztn(){let[e,t]=ae([]),[n,r]=ae(null),[a,i]=ae(!0),o=Le(()=>{i(!0),fetch("/api/settings/usage/reset").then((l)=>l.json()).then((l)=>{t(Array.isArray(l.accounts)?l.accounts:[]),r(typeof l.error==="string"?l.error:null)}).catch((l)=>{t([]),r(l instanceof Error?l.message:"Failed to load saved resets")}).finally(()=>i(!1))},[]);Ee(()=>{o()},[o]);let s=Le(async(l)=>{try{let d=await(await fetch("/api/settings/usage/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:l})})).json();if(d.ok)o();return{ok:Boolean(d.ok),message:d.message||"No result reported."}}catch(u){return{ok:!1,message:u instanceof Error?u.message:"Failed to spend the saved reset"}}},[o]);return{accounts:e,error:n,isLoading:a,reload:o,spend:s}}var jtn=O(()=>{Je()});function izr({account:e,onSpend:t,spending:n}){let r=`${e.provider}/${e.credentialId}`,a=e.email??e.accountId??e.credentialId,i=e.orgName??e.orgId,o=e.availableCount??e.credits.length,s=e.redeemableCount??0,l=e.error??e.unavailableReason;return m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs space-y-2",children:[m("div",{className:"flex items-start justify-between gap-2",children:[m("div",{className:"min-w-0",children:[m("div",{className:"text-[11px] font-semibold text-ink truncate",children:[a,i?m("span",{className:"text-ink/50 font-normal",children:[" · ",i]}):null]}),m("div",{className:"text-[10px] text-ink/50 font-mono truncate",children:r})]}),m("span",{className:"text-[10px] text-ink/60 flex-shrink-0 whitespace-nowrap",children:s>0?`${s} of ${o} usable`:`${o} saved`})]}),e.soonestExpiry!==void 0&&m("div",{className:"text-[10px] text-ink/60",children:["Soonest expires ",V0(new Date(e.soonestExpiry).toISOString())]}),e.credits.length>0&&m("div",{className:"space-y-1",children:e.credits.map((u)=>m("div",{className:"flex items-center justify-between gap-2 text-[10px] text-ink/70",children:[m("span",{className:"truncate",children:u.title??u.program??u.id}),m("span",{className:"flex items-center gap-1.5 flex-shrink-0",children:[u.clears&&u.clears.length>0&&m("span",{className:"font-mono text-ink/50",children:u.clears.join(", ")}),u.usable===!1&&m("span",{className:"font-mono uppercase px-1.5 py-0.5 rounded bg-ink/10 text-ink/60",children:"blocked"})]})]},u.id))}),l&&m("div",{className:"text-[10px] text-ink/60 leading-snug",children:l}),m("button",{type:"button",onClick:()=>t(r),disabled:n||s===0,title:s===0?l??"Nothing to spend on this account right now.":`Spend a saved reset on ${r}`,className:"w-full rounded-md border border-ink/15 px-2 py-1 text-[11px] font-medium text-ink/80 hover:bg-ink/5 transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",children:n?"Spending…":"Spend saved reset"})]})}function Yae(){let{accounts:e,error:t,isLoading:n,reload:r,spend:a}=ztn(),[i,o]=ae(null),[s,l]=ae(null),u=(p)=>{o(p),l(null),a(p).then((h)=>{l(h),o(null)})},d=!n&&!t&&e.length===0;return m("div",{className:"space-y-2",children:[m("div",{className:"flex items-center justify-between gap-2",children:[m("div",{className:"min-w-0",children:[m("div",{className:"text-[11px] font-semibold text-ink",children:"Saved rate-limit resets"}),m("div",{className:"text-[10px] text-ink/50 leading-snug",children:"Provider-issued resets for Codex and Claude accounts. Spending one clears the window it covers."})]}),m("button",{type:"button",onClick:r,disabled:n,title:"Re-read saved resets",className:"p-1.5 bg-paper border border-ink/15 rounded-md hover:bg-ink/5 text-ink/80 transition-colors disabled:opacity-50 flex-shrink-0",children:m(Mn,{size:12,className:n?"animate-spin text-ink":""})})]}),t&&m("div",{className:"flex items-start gap-1.5 text-[10px] text-error leading-snug",children:[m(Qn,{size:12,className:"flex-shrink-0 mt-px"}),m("span",{children:t})]}),e.map((p)=>m(izr,{account:p,onSpend:u,spending:i===`${p.provider}/${p.credentialId}`},`${p.provider}/${p.credentialId}`)),d&&m("p",{className:"text-[10px] text-ink/50 leading-snug",children:"No saved resets on any account."}),s&&m("div",{className:`text-[10px] leading-snug ${s.ok?"text-ink/70":"text-error"}`,children:s.message})]})}var J9e=O(()=>{Je();pt();hy();jtn();de()});function Utn(e,t){if(!e)return t;if(!t)return e;let n=Date.parse(e.generatedAt),r=Date.parse(t.generatedAt);if(Number.isNaN(n)||Number.isNaN(r))return e;return r>n?t:e}function Xae(){let[e,t]=ae(null),[n,r]=ae(!0),[a,i]=ae(null),o=Le(async(s)=>{if(!s?.silent)r(!0);i(null);try{let l=s?.force?"/api/settings/usage?refresh=1":"/api/settings/usage",u=await fetch(l);if(!u.ok)throw Error(`Usage request failed (${u.status})`);let d=await u.json();t(d)}catch(l){i(l instanceof Error?l.message:"Failed to load provider usage")}finally{if(!s?.silent)r(!1)}},[]);return Ee(()=>{o()},[o]),{report:e,isLoading:n,error:a,reload:o}}var Q9e=O(()=>{Je()});function ozr({className:e="",active:t=!0}){let{report:n,isLoading:r,error:a,reload:i}=Xae(),[o,s]=qn("usage.selectedProviderId",""),l=Ui(GBe,{enabled:t}),u=Utn(l.data,n),d=u?iL(u):[],p=d.find((h)=>h.id===o)??d[0];if(Ee(()=>{if(p&&p.id!==o)s(p.id)},[p,o,s]),a&&!u)return m("div",{className:`flex h-full w-full flex-col items-center justify-center gap-2 p-8 text-center text-xs ${e}`,children:[m(Qn,{size:16,className:"text-error"}),m("p",{className:"text-error text-xs",children:a}),m("button",{type:"button",onClick:()=>i(),className:"text-[11px] font-semibold text-ink/70 hover:text-ink underline underline-offset-2",children:"Try again"})]});if(!u)return m("div",{className:`flex h-full w-full items-center justify-center text-ink/40 text-xs ${e}`,children:"Loading provider usage..."});return m("div",{className:`flex h-full w-full min-w-0 min-h-0 flex-col overflow-hidden bg-paper text-xs text-ink ${e}`,children:[m("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex items-center justify-between gap-3 flex-shrink-0 min-w-0",children:[m("div",{className:"flex items-center gap-2 min-w-0",children:[m("h2",{className:"text-xs font-semibold text-ink uppercase tracking-wider",children:"Usage"}),m("span",{className:"text-[11px] text-ink/50 truncate",children:["Updated ",V0(u.generatedAt)]}),u.isMock&&m("span",{className:"text-[10px] font-mono uppercase tracking-wider bg-ink/5 border border-ink/15 rounded px-1.5 py-0.5 text-ink/60",children:"Mock"})]}),m("button",{type:"button",onClick:()=>i({force:!0}),disabled:r,className:"p-1.5 bg-paper border border-ink/15 rounded-md hover:bg-ink/5 text-ink/80 transition-colors disabled:opacity-50 flex-shrink-0",title:"Refresh usage",children:m(Mn,{size:12,className:r||l.refreshing?"animate-spin text-ink":""})})]}),d.length>0&&m("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex-shrink-0 min-w-0",children:m("div",{className:"flex items-center gap-2 min-w-0",children:[m("span",{className:"text-[11px] font-semibold text-ink/60 flex-shrink-0",children:"Provider"}),m(Ftn,{providers:d,value:p?.id??"",onChange:s})]})}),m("div",{className:"flex-1 min-w-0 min-h-0 w-full overflow-y-auto scrollbar-overlay-container p-3.5 space-y-4",children:[a&&m("p",{className:"text-error text-xs",children:a}),p?m(Kae,{summary:p.summary}):m("p",{className:"text-[11px] text-ink/50 leading-relaxed",children:"No provider credentials detected. Add an API key in Settings → Providers and it will appear here."}),m(Yae,{})]})]})}var qtn=O(()=>{Je();pt();X9e();Lz();hy();Btn();J9e();Q9e();Yi();cm();Ps();de()});function Gtn(e){return Wtn[e]??Wtn.pending}function Rz(e){if(e.total===0)return"No tasks";let t=[`${e.closed}/${e.total} done`];if(e.inProgress>0)t.push(`${e.inProgress} in progress`);if(e.blocked>0)t.push(`${e.blocked} blocked`);if(e.abandoned>0)t.push(`${e.abandoned} abandoned`);return t.join(" · ")}function Jae(e){if(e.total===0)return 0;return Math.round(e.closed/e.total*100)}function Htn(e){for(let t=0;t<e.length;t++){let n=e[t].tasks;for(let r=0;r<n.length;r++)if(n[r].status==="in_progress")return{phase:t,task:r}}for(let t=0;t<e.length;t++){let n=e[t].tasks;for(let r=0;r<n.length;r++)if(n[r].status==="pending")return{phase:t,task:r}}return null}function Qae(e){return e.tasks.filter((t)=>t.status==="completed"||t.status==="abandoned").length}function Vtn(e){let t=e.blocker?.trim()||e.details?.trim();return t?t:void 0}var Wtn;var Nz=O(()=>{Wtn={pending:{label:"Pending",tone:"text-ink/45",active:!1,closed:!1},in_progress:{label:"In progress",tone:"text-ink",active:!0,closed:!1},completed:{label:"Completed",tone:"text-success",active:!1,closed:!0},abandoned:{label:"Abandoned",tone:"text-error/70",active:!1,closed:!0},blocked:{label:"Blocked",tone:"text-warning",active:!1,closed:!1}}});function sL(e){let t=e.trim();if(!t.startsWith("{")||!t.endsWith("}"))return;let n;try{n=JSON.parse(t)}catch{return}if(!xn(n))return;let{phase:r,items:a}=n;if(typeof r!=="string"||r.trim()==="")return;if(!Array.isArray(a)||a.length===0)return;if(!a.every((i)=>typeof i==="string"))return;return{phase:r.trim(),items:a}}function eie(e){return e.replace(/\s*\((?:in progress|dropped|blocked(?::[^()]*)?)\)\s*$/i,"").trim()}var eLe=()=>{};function szr({status:e,className:t}){switch(e){case"completed":return m(Ur,{size:13,className:t});case"in_progress":return m(nn,{size:13,className:`${t} animate-spin`});case"abandoned":return m(op,{size:13,className:t});case"blocked":return m(Y2,{size:13,className:t});default:return m(Ry,{size:13,className:t})}}function tie({task:e,current:t}){let n=Gtn(e.status),r=Vtn(e),a=sL(e.content),i=a?a.phase:e.content,o=a?a.items:e.notes;return m("div",{className:`flex items-start gap-2.5 px-2.5 py-1.5 transition-colors ${t?"bg-ink/[0.04]":""}`,children:[m(szr,{status:e.status,className:`mt-[2px] shrink-0 ${n.tone}`}),m("div",{className:"min-w-0 flex-1",children:[m("div",{className:`text-[11.5px] leading-snug ${n.closed?"text-ink/40 line-through":n.active?"font-medium text-ink":"text-ink/75"}`,children:i}),o&&o.length>0&&m("ul",{className:"mt-0.5 space-y-0.5",children:o.map((s,l)=>m("li",{className:"text-[10.5px] leading-snug text-ink/55 break-words",children:["· ",s]},l))}),r&&m("div",{className:"mt-0.5 text-[10.5px] leading-snug text-warning/90 break-words",children:r})]}),n.active&&m("span",{className:"shrink-0 rounded bg-ink/8 px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wider text-ink/70",children:"Now"})]})}var tLe=O(()=>{pt();Nz();eLe();de()});function Ztn({phase:e,index:t,collapsed:n,currentKey:r,onToggle:a}){let i=Qae(e),o=e.tasks.length>0&&i===e.tasks.length;return m("div",{className:"overflow-hidden rounded-lg border border-ink/10 bg-paper",children:[m("button",{type:"button",onClick:a,"aria-expanded":!n,className:"flex w-full items-center gap-1.5 border-b border-ink/8 bg-canvas/40 px-2.5 py-1.5 text-left hover:bg-ink/5",children:[n?m(bi,{size:12,className:"shrink-0 text-ink/40"}):m(Zn,{size:12,className:"shrink-0 text-ink/40"}),m("span",{className:`min-w-0 flex-1 truncate text-[10px] font-semibold uppercase tracking-wider ${o?"text-ink/35":"text-ink/60"}`,title:e.name,children:[t+1,". ",e.name]}),m("span",{className:"shrink-0 font-mono text-[9.5px] text-ink/40",children:[i,"/",e.tasks.length]})]}),!n&&m("div",{className:"divide-y divide-ink/[0.05] p-0.5",children:e.tasks.length===0?m("div",{className:"px-2.5 py-1.5 text-[11px] text-ink/40",children:"No tasks in this phase"}):e.tasks.map((s,l)=>m(tie,{task:s,current:r===`${t}:${l}`},`${l}-${s.content}`))})]})}var Ktn=O(()=>{pt();Nz();tLe();de()});function lzr({className:e="",active:t=!0}){let[n]=Ha(),r=n.get("sessionId"),[a,i]=I9("todo.collapsedPhases",{}),{data:o,isLoading:s,refreshing:l,stale:u,refresh:d}=Ui(r?BBe(r):null,{enabled:t}),p=o?.snapshot??null,h=o?.progress??null,f=ut(()=>{let g=Htn(p?.phases??[]);return g?`${g.phase}:${g.task}`:null},[p]);if(!r)return m("div",{className:`flex h-full flex-col items-center justify-center bg-paper text-ink/40 ${e}`,children:m("span",{className:"text-xs font-mono",children:"No session selected"})});return m("div",{className:`flex h-full w-full min-w-0 flex-col overflow-hidden bg-paper text-ink ${e}`,children:[m("div",{className:"flex flex-shrink-0 items-center justify-between gap-3 border-b border-ink/10 px-3.5 py-2.5",children:[m("div",{className:"flex min-w-0 items-center gap-2",children:[m("h2",{className:"text-xs font-semibold uppercase tracking-wider text-ink",children:"Todos"}),p&&m("span",{className:"truncate font-mono text-[10.5px] text-ink/50",title:Rz(h),children:Rz(h)}),o?.isMock&&m("span",{className:"flex-shrink-0 rounded border border-ink/15 bg-ink/5 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wider text-ink/60",children:"Mock"})]}),m("button",{type:"button",onClick:d,disabled:s,title:"Refresh todos","aria-label":"Refresh todos",className:"flex-shrink-0 rounded-md border border-ink/15 bg-paper p-1.5 text-ink/80 transition-colors hover:bg-ink/5 disabled:opacity-50",children:m(Mn,{size:12,className:s||l?"animate-spin text-ink":""})})]}),h&&h.total>0&&m("div",{className:"flex-shrink-0 border-b border-ink/10 px-3.5 py-2.5",children:m("div",{className:"h-1.5 overflow-hidden rounded-full bg-ink/8",children:m("div",{className:"h-full rounded-full bg-success transition-all duration-300",style:{width:`${Jae(h)}%`}})})}),m("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto scrollbar-overlay-container p-3.5",children:[u&&m("div",{className:"flex items-start gap-2 rounded-lg border border-ink/15 bg-ink/5 px-3 py-2 text-[11px] text-ink/60",children:[m(Qn,{size:13,className:"mt-[1px] shrink-0"}),m("span",{className:"min-w-0 break-words",children:"Reconnecting — this list may be out of date."})]}),!p?m("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-center text-ink/40",children:[m(im,{size:20}),m("p",{className:"max-w-[240px] text-[11.5px] leading-relaxed",children:["No todo list in this session. The agent writes one with the ",m("span",{className:"font-mono",children:"todo"})," tool when a task is worth planning."]})]}):m(kt,{children:[p.phases.map((g,b)=>m(Ztn,{phase:g,index:b,collapsed:Boolean(a[String(b)]),currentKey:f,onToggle:()=>i((y)=>({...y,[String(b)]:!y[String(b)]}))},`${b}-${g.name}`)),m("p",{className:"pt-1 text-[10.5px] leading-relaxed text-ink/35",children:["Read from this session's transcript",p.updatedAt?` · updated ${czr(p.updatedAt)}`:"",p.source==="custom"?" · edited by hand":"","."]})]})]})]})}function czr(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;return t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var Ytn=O(()=>{Je();pt();Kc();xu();Ktn();Nz();cm();Ps();de()});function uzr(e){if(!Number.isFinite(e)||e<=0)return"";return new Date(e).toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})}function Xtn({files:e,selected:t,onSelect:n}){let[r,a]=ae(""),i=ut(()=>{let o=r.trim().toLowerCase();if(!o)return e;return e.filter((s)=>s.title.toLowerCase().includes(o))},[e,r]);return m("div",{className:"flex h-full min-h-0 w-full flex-col bg-canvas/40",children:[m("div",{className:"flex flex-shrink-0 items-center gap-1.5 border-b border-ink/10 px-2 py-1.5",children:[m(na,{size:12,className:"flex-shrink-0 text-ink/40"}),m("input",{type:"search",value:r,onChange:(o)=>a(o.target.value),placeholder:"Filter plans…","aria-label":"Filter plans",className:"min-w-0 flex-1 bg-transparent text-[11px] text-ink outline-none placeholder:text-ink/35"})]}),m("div",{className:"flex-1 min-h-0 overflow-y-auto scrollbar-overlay-container",children:i.length===0?m("p",{className:"px-3 py-2 text-[11px] text-ink/40 italic",children:e.length===0?"No plan yet":"No plan matches the filter"}):m("ul",{className:"py-1",children:i.map((o)=>{let s=o.path===t,l=uzr(o.modifiedAt);return m("li",{children:m("button",{type:"button",onClick:()=>n(o.path),"aria-current":s?"true":void 0,title:`${o.path}${l?` · ${l}`:""}`,className:`flex w-full items-start gap-1.5 px-2.5 py-1.5 text-left transition-colors ${s?"bg-ink/10 font-semibold text-ink":"text-ink/80 hover:bg-ink/5 hover:text-ink"}`,children:[m(Qa,{size:12,className:`mt-0.5 flex-shrink-0 ${s?"text-ink":"text-ink/40"}`}),m("span",{className:"min-w-0 flex-1",children:[m("span",{className:"block truncate text-[11.5px]",children:o.title}),l&&m("span",{className:"block truncate font-mono text-[10px] text-ink/40",children:l})]})]})},o.path)})})})]})}var Jtn=O(()=>{Je();pt();de()});function Qtn({file:e,content:t,isLoading:n,error:r,truncated:a,onBack:i}){return m("div",{className:"flex h-full min-h-0 w-full flex-col bg-paper",children:[m("div",{className:"flex flex-shrink-0 items-center gap-1.5 border-b border-ink/10 px-2.5 py-1.5",children:[m("button",{type:"button",onClick:i,title:"Back to the plan list","aria-label":"Back to the plan list",className:"flex-shrink-0 rounded p-1 text-ink/60 hover:bg-ink/5 hover:text-ink @[520px]:hidden",children:m(ip,{size:13})}),m("span",{className:"min-w-0 flex-1 truncate text-[11px] text-ink/50",title:e?.path??"",children:e?.path??"Plan"}),n&&m(nn,{size:12,className:"flex-shrink-0 animate-spin text-ink/40"})]}),m("div",{className:"flex-1 min-h-0 overflow-y-auto scrollbar-overlay-container",children:r?m("div",{className:"flex flex-col items-center gap-2 px-6 py-8 text-center",children:[m(Qn,{size:16,className:"text-error"}),m("p",{className:"text-xs text-error",children:r})]}):!t?m("div",{className:"px-6 py-8 text-center text-xs text-ink/40",children:n?"Reading the plan…":"This plan is empty."}):m("article",{className:"mx-auto max-w-4xl px-5 py-4",children:[m(vr,{content:t,className:"max-w-none"}),a&&m("p",{className:"mt-4 border-t border-ink/10 pt-2 text-[11px] text-ink/50",children:"This plan is longer than the reader's budget and was cut off."})]})})]})}var enn=O(()=>{pt();Fo();de()});function dzr({className:e="",active:t=!0}){let[n]=Ha(),r=n.get("sessionId"),[a,i]=I9("plan.selectedFile",null),[o,s]=ae(!1),l=a&&a.sessionId===r?a.path:null,u=Ui(r?zBe(r):null,{enabled:t}),d=u.data?.files??[],p=u.data?.current??null,h=ut(()=>{if(l&&d.some((y)=>y.path===l))return l;return p},[l,d,p]),f=ut(()=>d.find((y)=>y.path===h)??null,[d,h]);Ee(()=>{if(!r||!h||h===l)return;i({sessionId:r,path:h})},[r,h,l,i]),Ee(()=>{s(!1)},[r]);let g=(y)=>{if(r)i({sessionId:r,path:y});s(!0)};if(!r)return m("div",{className:`flex h-full flex-col items-center justify-center bg-paper text-ink/40 ${e}`,children:m("span",{className:"text-xs font-mono",children:"No session selected"})});let b=d.length>0;return m("div",{className:`@container flex h-full min-h-0 w-full flex-col bg-paper text-xs text-ink ${e}`,children:[m("div",{className:"flex flex-shrink-0 items-center justify-between gap-2 border-b border-ink/10 px-2 py-1.5",children:[m("div",{className:"flex min-w-0 items-center gap-1.5",children:[m(Qa,{size:12,className:"flex-shrink-0 text-ink/50"}),m("span",{className:"truncate text-[11px] font-medium text-ink/70",children:"Plan mode"}),b&&m("span",{className:"flex-shrink-0 rounded border border-ink/15 bg-ink/5 px-1.5 py-0.5 font-mono text-[9.5px] text-ink/60",children:d.length})]}),m("button",{type:"button",onClick:u.refresh,disabled:u.isLoading,title:"Re-read the plan","aria-label":"Re-read the plan",className:"flex-shrink-0 rounded p-1 text-ink/60 transition-colors hover:bg-ink/5 hover:text-ink disabled:opacity-50",children:m(Mn,{size:13,className:u.isLoading||u.refreshing?"animate-spin":""})})]}),u.stale&&!u.data?m("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[m(Qn,{size:16,className:"text-error"}),m("p",{className:"text-error",children:"The plan could not be read."}),m("button",{type:"button",onClick:u.refresh,className:"text-[11px] font-semibold text-ink/70 underline underline-offset-2 hover:text-ink",children:"Try again"})]}):!u.data?m("div",{className:"flex flex-1 items-center justify-center gap-2 text-ink/40",children:[m(nn,{size:14,className:"animate-spin"}),m("span",{children:"Reading the plan…"})]}):!b?m("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[m(Qa,{size:18,className:"text-ink/30"}),m("p",{className:"max-w-sm text-[11px] leading-relaxed text-ink/60",children:"No plan yet. Turn on Plan mode in the composer, and the plan this session writes will appear here."})]}):m("div",{className:"flex min-h-0 flex-1 flex-col @[520px]:flex-row-reverse",children:[m("div",{className:`min-h-0 w-full @[520px]:w-52 @[520px]:flex-shrink-0 border-b border-ink/10 @[520px]:border-b-0 @[520px]:border-l ${o?"hidden @[520px]:flex":"flex"} flex-col`,children:m(Xtn,{files:d,selected:h,onSelect:g})}),m("div",{className:`min-w-0 min-h-0 flex-1 ${o?"flex":"hidden @[520px]:flex"} flex-col`,children:m(Qtn,{file:f,content:u.data.content,isLoading:u.isLoading,error:u.stale?"The plan could not be read.":null,truncated:u.data.truncated,onBack:()=>s(!1)})})]})]})}var tnn=O(()=>{Je();pt();Kc();xu();Jtn();enn();cm();Ps();de()});function nnn(e){if(e.length===0)return[...N2];let t=new Set(e);return N2.filter((n)=>!t.has(n.id))}var pzr,mzr,N2;var nie=O(()=>{Ma();pt();t6();de();pzr={context:{title:"Context & Telemetry",label:"Context",icon:m(yd,{size:bd}),requiresWorkspace:!0},files:{title:"Files",label:"Files",icon:m(JR,{size:bd}),requiresWorkspace:!0},search:{title:"Search",label:"Search",icon:m(na,{size:bd}),requiresWorkspace:!0},git:{title:"Source Control",label:"GIT",icon:m(hc,{size:bd}),requiresWorkspace:!0},wiki:{title:"Wiki",label:"Wiki",icon:m(ls,{size:bd}),requiresWorkspace:!0},terminal:{title:"Terminal (Bun)",label:"Terminal",icon:m(Da,{size:bd}),requiresWorkspace:!0,liveWhileHidden:!0},"user-browser":{title:"Browser (Anda)",label:"Browser",icon:m(Pa,{size:bd}),requiresWorkspace:!1},browser:{title:"Browser Agent",label:"Agent",icon:m(Wo,{size:bd}),requiresWorkspace:!1},usage:{title:"Usage",label:"Usage",icon:m(ib,{size:bd}),requiresWorkspace:!1},todo:{title:"Todos",label:"Todos",icon:m(im,{size:bd}),requiresWorkspace:!1},plan:{title:"Plan (sesi ini)",label:"Plan",icon:m(m5,{size:bd}),requiresWorkspace:!1}},mzr={context:Mi(()=>Promise.resolve().then(() => (ZVt(),{})).then((e)=>({default:bIr}))),files:Mi(()=>Promise.resolve().then(() => (MKt(),{})).then((e)=>({default:ZIr}))),search:Mi(()=>Promise.resolve().then(() => (tYt(),{})).then((e)=>({default:rMr}))),git:Mi(()=>Promise.resolve().then(() => (sXt(),{})).then((e)=>({default:cMr}))),wiki:Mi(()=>Promise.resolve().then(() => (yXt(),{})).then((e)=>({default:pMr}))),terminal:Mi(()=>Promise.resolve().then(() => (Zen(),{})).then((e)=>({default:DBr}))),"user-browser":Mi(()=>Promise.resolve().then(() => (ctn(),{})).then((e)=>({default:jBr}))),browser:Mi(()=>Promise.resolve().then(() => (ktn(),{})).then((e)=>({default:ZBr}))),usage:Mi(()=>Promise.resolve().then(() => (qtn(),{})).then((e)=>({default:ozr}))),todo:Mi(()=>Promise.resolve().then(() => (Ytn(),{})).then((e)=>({default:lzr}))),plan:Mi(()=>Promise.resolve().then(() => (tnn(),{})).then((e)=>({default:dzr})))},N2=oU.map((e)=>({id:e,...pzr[e],Component:mzr[e],minWidth:IPe[e],defaultWidth:NPe[e],defaultFraction:sU}))});function rnn({disabled:e,busy:t,onSetEnabled:n}){let r=new Set(e);return m("section",{children:[m("header",{className:"flex items-center gap-2 mb-2",children:[m("h3",{className:"text-sm font-medium text-ink",children:"Built-in"}),m("span",{className:"ml-auto text-[11px] text-ink/50",children:[N2.length-N2.filter((a)=>r.has(a.id)).length," of"," ",N2.length," on"]})]}),m("p",{className:"text-[11px] text-ink/50 mb-2",children:"The views Kabmo ships. Switch one off to put it away — its code stays in the app, so this is reversible at any time and needs no reinstall."}),m("div",{className:"grid gap-2 [grid-template-columns:repeat(auto-fill,minmax(200px,1fr))]",children:N2.map((a)=>{let i=!r.has(a.id),o=t===`enable:${a.id}`||t===`disable:${a.id}`;return m("div",{className:`flex items-center gap-2.5 border border-ink/10 rounded-lg px-2.5 py-2 transition-colors ${i?"bg-paper":"bg-ink/[0.02]"}`,children:[m("span",{className:i?"text-ink/70 flex-shrink-0":"text-ink/30 flex-shrink-0",children:a.icon}),m("span",{className:"min-w-0 flex-1",children:[m("span",{className:`block text-xs truncate ${i?"text-ink":"text-ink/45"}`,title:a.title,children:a.title}),m("span",{className:"block text-[10px] font-mono text-ink/40 truncate",children:a.id})]}),m("button",{type:"button",role:"switch","aria-checked":i,"aria-label":`${i?"Disable":"Enable"} ${a.title}`,disabled:t!==null,onClick:()=>void n(a.id,!i),title:i?"Switch off — remove its button":"Switch on",className:`relative w-8 h-4 rounded-full transition-colors flex-shrink-0 disabled:opacity-40 ${i?"bg-ink/70":"bg-ink/20"}`,children:o?m(nn,{size:9,className:"absolute inset-0 m-auto animate-spin text-canvas"}):m("span",{className:`absolute top-0.5 w-3 h-3 rounded-full bg-canvas transition-all ${i?"left-[18px]":"left-0.5"}`})})]},a.id)})})]})}var ann=O(()=>{pt();nie();de()});function inn({autoUpdate:e,busy:t,gitCount:n,onSetAutoUpdate:r,onCheckUpdates:a,onRefresh:i}){return m("div",{className:"flex flex-wrap items-center gap-2",children:[m("button",{type:"button",role:"checkbox","aria-checked":e,disabled:t!==null,onClick:()=>void r(!e),title:e?"Stop updating git-installed plugins automatically":"Fetch and apply the remote’s latest commit for every git-installed plugin, hourly",className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded border border-ink/15 hover:bg-ink/5 disabled:opacity-50",children:[e?m(ak,{size:13}):m(Mg,{size:13}),"Auto-update git plugins"]}),m("button",{type:"button",onClick:()=>void a(),disabled:t!==null||n===0,title:n===0?"No git-installed plugins to check":"Ask each git-installed plugin’s remote whether a newer commit exists",className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded border border-ink/15 hover:bg-ink/5 disabled:opacity-50",children:[m(Mn,{size:13,className:t==="check_updates"?"animate-spin":""}),"Check for updates"]}),m("button",{type:"button",onClick:i,disabled:t!==null,className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded border border-ink/15 hover:bg-ink/5 disabled:opacity-50",title:"Re-read the marketplace from disk",children:[m(Mn,{size:13}),"Refresh"]}),m("span",{className:"text-[11px] text-ink/45",children:e?"Git plugins are updated from their remote about once an hour, with no confirmation.":"Off — updates are applied only when you press Update."})]})}var onn=O(()=>{pt();de()});function snn({blocked:e,busy:t,onForceSync:n}){let r=Object.entries(e);if(r.length===0)return null;return m("div",{className:"space-y-2",children:r.map(([a,i])=>{let o=i.changed.slice(0,hzr),s=i.changed.length-o.length;return m("div",{className:"border border-warning/40 rounded p-3 space-y-1.5",children:[m("div",{className:"flex items-center gap-2 text-warning",children:[m(pr,{size:14,className:"flex-shrink-0"}),m("span",{className:"text-xs",children:[m("span",{className:"font-medium",children:a})," has local changes — its bundled update is paused"]})]}),m("p",{className:"text-[11px] text-ink/60",children:["Kabmo installed this plugin, and ",i.changed.length," of its files no longer match what it wrote. Your files are left as they are."]}),m("ul",{className:"text-[10px] font-mono text-ink/50 space-y-0.5",children:[o.map((l)=>m("li",{className:"truncate",title:l,children:l},l)),s>0?m("li",{children:["… and ",s," more"]}):null]}),m("div",{className:"flex items-center gap-2 pt-0.5",children:[m("button",{type:"button",disabled:t!==null,onClick:()=>void n(a),title:`Replace ${i.changed.length} changed file(s) with the copy Kabmo ships — your edits are lost`,className:"flex items-center gap-1.5 px-2 py-1 text-[11px] rounded border border-warning/50 text-warning hover:bg-warning/10 disabled:opacity-50",children:[t===`force_sync:${a}`?m(nn,{size:12,className:"animate-spin"}):m(Xc,{size:12}),"Replace my changes with the store's copy"]}),m("span",{className:"text-[11px] text-ink/45",children:"This discards the files listed above."})]})]},a)})})}var hzr=5;var lnn=O(()=>{pt();de()});function fzr({error:e,busy:t,onForget:n}){let r=e.source;return m("div",{className:"border border-error/30 rounded p-3",children:[m("div",{className:"flex items-center gap-2 text-error",children:[m(pr,{size:14,className:"flex-shrink-0"}),m("span",{className:"text-xs",children:"Rejected"})]}),m("div",{className:"mt-1 text-[11px] font-mono text-ink/50 break-all",children:e.dir}),m("div",{className:"mt-1 text-xs text-ink/70",children:e.reason}),r?m("div",{className:"mt-2 flex items-center gap-2",children:[m("button",{type:"button",disabled:t,onClick:()=>void n(r),className:"flex items-center gap-1.5 px-2 py-1 text-[11px] rounded border border-error/40 text-error hover:bg-error/10 disabled:opacity-50",title:`Drop the catalog entry "${r}" — the directory it names is already gone`,children:[m(Tr,{size:12}),"Forget this entry"]}),m("span",{className:"text-[11px] text-ink/45",children:"Removes the record from marketplace.json. No files are touched."})]}):null]})}function cnn(){let{panels:e,errors:t,plugins:n,catalog:r,disabledPanels:a,gitStatus:i,autoUpdate:o,syncBlocked:s,ready:l}=up(),{slots:u,failures:d}=kk(),p=eq(),h=()=>void lWe(),f=r.filter((x)=>!x.installed),g=new Map(d.map((x)=>[x.pluginId,x.reason])),b=new Map(e.map((x)=>[x.pluginId,x.iconUrl])),y=new Map(e.map((x)=>[x.pluginId,x.readmeUrl])),v=n.filter((x)=>x.gitOrigin).length;return m("div",{className:"space-y-4",children:[m("div",{className:"flex items-start justify-between gap-3",children:m("p",{className:"text-xs text-ink/60 max-w-xl",children:"Panels bundled with Kabmo, plus the ones you install from a git URL. A plugin is local code Kabmo loads into this page and renders in its own tree, so it looks and behaves like the rest of the app — treat it the way you would a VS Code extension."})}),m(inn,{autoUpdate:o,busy:p.busy,gitCount:v,onSetAutoUpdate:p.setAutoUpdate,onCheckUpdates:p.checkUpdates,onRefresh:h}),p.error?m("div",{className:"flex items-start gap-1.5 px-3 py-2 rounded-lg border border-error/30 bg-error/5 text-[11px] text-error leading-snug",children:[m(pr,{size:13,className:"mt-0.5 flex-shrink-0"}),m("span",{className:"flex-1 break-words",children:p.error}),m("button",{type:"button",onClick:p.clearError,"aria-label":"Dismiss",className:"cursor-pointer",children:m(vn,{size:12})})]}):null,m(cWe,{busy:p.busy==="install",onInstall:p.install,onClearError:p.clearError}),!l?m("p",{className:"text-xs text-ink/50",children:"Reading…"}):null,m(rnn,{disabled:a,busy:p.busy,onSetEnabled:p.setEnabled}),l&&f.length===0&&n.length===0&&t.length===0?m("div",{className:"text-xs text-ink/60 space-y-1.5",children:[m("p",{children:"No panel plugins installed."}),m("p",{className:"font-mono text-[11px] text-ink/45 leading-relaxed",children:["~/.kabmo/marketplace/marketplace.json",m("br",{}),"~/.kabmo/marketplace/plugins/<plugin>/package.json"]})]}):null,m(dVt,{entries:f,busy:p.busy,onInstall:p.installBundled}),m(snn,{blocked:s,busy:p.busy,onForceSync:p.forceSync}),n.length>0?m(fVt,{plugins:n,slots:u,failures:g,iconUrls:b,readmeUrls:y,busy:p.busy,onBuild:p.build,onRemove:p.remove,onSetEnabled:p.setEnabled,gitStatus:i,onUpdateGit:p.updateGit}):null,t.map((x)=>m(fzr,{error:x,busy:p.busy!==null,onForget:p.forget},x.dir+x.reason))]})}var unn=O(()=>{pt();T6();fue();pVt();gVt();ann();onn();lnn();de()});function dnn(){return m("div",{className:"flex-1 min-h-0 overflow-auto p-6 md:p-8",children:m("div",{className:"max-w-3xl",children:m(cnn,{})})})}var pnn=O(()=>{unn();de()});function mnn({isOpen:e,onClose:t,onAddSource:n}){let[r,a]=ae(""),[i,o]=ae(""),[s,l]=ae(null);if(!e)return null;return m("div",{className:"fixed inset-0 z-50 bg-ink/40 backdrop-blur-[2px] flex items-center justify-center p-4",onClick:t,children:m("div",{className:"bg-paper border border-ink/20 rounded-xl max-w-md w-full p-6 shadow-2xl space-y-4 text-ink animate-in fade-in zoom-in-95 duration-150 max-h-full overflow-y-auto scrollbar-overlay-container",onClick:(d)=>d.stopPropagation(),children:[m("div",{className:"flex items-center justify-between pb-3 border-b border-ink/10",children:[m("div",{className:"flex items-center gap-2",children:[m(hc,{className:"w-4 h-4 text-ink/70"}),m("h2",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Add Custom Skill Source"})]}),m("button",{type:"button",onClick:t,className:"p-1 rounded-md text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:m(vn,{className:"w-4 h-4"})})]}),m("p",{className:"text-xs text-ink/70 leading-relaxed",children:"Connect any public or private Git repository containing skill definitions and prompt directives."}),m("form",{onSubmit:(d)=>{d.preventDefault();let p=r.trim().replace(/^https?:\/\/github\.com\//,"").replace(/\/$/,"");if(!p){l("Please provide a valid GitHub repository path (e.g. owner/repo).");return}let h=i.trim()||p.split("/")[1]||p,f={id:`custom-${Date.now()}`,name:h,repo:p,stars:"1.2K",updatedAt:"Just now",skillCount:3,isCustom:!0};n(f),a(""),o(""),l(null),t()},className:"space-y-4",children:[m("div",{children:[m("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:"Source Name"}),m("input",{type:"text",value:i,onChange:(d)=>o(d.currentTarget.value),placeholder:"e.g. Acme Internal Skills",className:"w-full px-3 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs text-ink transition-colors"})]}),m("div",{children:[m("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:["Git Repository ",m("span",{className:"text-error",children:"*"})]}),m("input",{type:"text",value:r,onChange:(d)=>{a(d.currentTarget.value),l(null)},placeholder:"e.g. owner/skills-repo or https://github.com/...",className:"w-full px-3 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs font-mono text-ink transition-colors"})]}),s&&m("div",{className:"flex items-center gap-2 text-xs text-error p-2.5 rounded-lg bg-error/10 border border-error/20",children:[m(Qn,{className:"w-4 h-4 flex-shrink-0"}),m("span",{className:"font-medium",children:s})]}),m("div",{className:"pt-3 border-t border-ink/10 flex items-center justify-end gap-2",children:[m("button",{type:"button",onClick:t,className:"px-3.5 py-2 rounded-lg border border-ink/20 hover:border-ink/40 text-xs font-medium text-ink/80 hover:text-ink transition-colors cursor-pointer",children:"Cancel"}),m("button",{type:"submit",className:"flex items-center gap-1.5 px-4 py-2 rounded-lg bg-ink text-paper text-xs font-medium hover:bg-ink/90 transition-colors shadow-xs cursor-pointer",children:[m(Er,{size:14}),m("span",{children:"Add Source"})]})]})]})]})})}var hnn=O(()=>{Je();pt();de()});function fnn(){let[e,t]=ae([]),[n,r]=ae([]),[a,i]=ae([]),o=Le(async()=>{let l=await(await fetch("/api/settings/skills")).json();if(l?.catalogSources)t(l.catalogSources);if(l?.catalogSkills)r(l.catalogSkills);if(l?.skills)i(l.skills)},[]);return Ee(()=>{o().catch(console.error)},[o]),{sources:e,catalogSkills:n,userSkills:a,setSources:t,setUserSkills:i,reload:o}}var gnn=O(()=>{Je()});function bnn(){let{sources:e,catalogSkills:t,userSkills:n,setSources:r,setUserSkills:a,reload:i}=fnn(),[o,s]=ae("anthropic"),[l,u]=ae(""),[d,p]=ae(!1),[h,f]=ae(!1),[g,b]=ae(null),y=new Set(n.map((T)=>T?.name).filter(Boolean)),v=(T)=>{b(T),setTimeout(()=>b(null),2500)},x=()=>{p(!0),i().then(()=>v("Catalog index synchronized")).catch(console.error).finally(()=>p(!1))},k=(T)=>{let E=n.find((L)=>L.name===T.name);fetch("/api/settings/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"install_toggle",skill:T,install:!E})}).then((L)=>L.json()).then((L)=>{if(L?.error){v(`Failed: ${L.error}`);return}if(Array.isArray(L?.skills))a(L.skills);tv("command"),v(E?`Uninstalled skill "${T.name}"`:`Installed skill "${T.name}"`)}).catch((L)=>{console.error(L),v(`Failed to ${E?"uninstall":"install"} "${T.name}"`)})},C=(T)=>{let E=[...e,T];r(E),s(T.id),fetch("/api/settings/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({catalogSources:E})}).catch(console.error),v(`Added source "${T.name}"`)},_=t.filter((T)=>{let E=!l.trim()||T.name.toLowerCase().includes(l.toLowerCase())||T.description.toLowerCase().includes(l.toLowerCase())||T.repoTag.toLowerCase().includes(l.toLowerCase());if(l.trim())return E;return T.sourceId===o}),w=e.find((T)=>T.id===o)||e[0]||null;return m("div",{className:"flex-1 flex flex-col h-full w-full scrollbar-overlay-container bg-paper text-ink p-6 md:p-8 space-y-6",children:[m("div",{children:m("p",{className:"text-xs text-ink/70 leading-relaxed",children:"Install ready-made skills from curated repositories, or add your own source."})}),m("div",{className:"relative",children:[m(na,{size:15,className:"absolute left-3 top-2.5 text-ink/40 pointer-events-none"}),m("input",{type:"text",value:l,onChange:(T)=>u(T.currentTarget.value),placeholder:"Search skills across all sources...",className:"w-full pl-9 pr-4 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs text-ink transition-colors"})]}),m("div",{className:"space-y-3",children:[m("h3",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Sources"}),m("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.map((T)=>{let E=o===T.id&&!l.trim();return m("div",{onClick:()=>{s(T.id),u("")},className:`p-3.5 rounded-xl border transition-all cursor-pointer select-none relative ${E?"border-ink bg-ink/5 shadow-xs":"border-ink/20 hover:border-ink/40 bg-paper"}`,children:[m("div",{className:"flex items-center justify-between",children:[m("div",{className:"flex items-center gap-2",children:[m("span",{className:"text-xs font-bold text-ink",children:T.name}),m("span",{className:"text-[10px] text-ink/50 font-mono",children:[T.skillCount," skills"]})]}),m(Mn,{size:13,className:`text-ink/40 hover:text-ink transition-colors ${d&&E?"animate-spin":""}`})]}),m("div",{className:"mt-1 font-mono text-[11px] text-ink/60 truncate",children:T.repo}),m("div",{className:"mt-2.5 flex items-center gap-3 text-[10px] text-ink/50",children:[m("span",{className:"flex items-center gap-1",children:[m(Xy,{size:11,className:"text-ink/50"}),m("span",{children:T.stars})]}),m("span",{children:T.updatedAt})]})]},T.id)}),m("div",{onClick:()=>f(!0),className:"p-3.5 rounded-xl border border-dashed border-ink/25 hover:border-ink/50 bg-paper hover:bg-ink/[0.02] transition-all cursor-pointer flex items-center gap-3 select-none",children:[m("div",{className:"w-8 h-8 rounded-lg border border-ink/20 flex items-center justify-center text-ink/60 flex-shrink-0",children:m(Er,{size:16})}),m("div",{children:[m("div",{className:"text-xs font-bold text-ink",children:"Add your own source"}),m("div",{className:"text-[11px] text-ink/60",children:"Any Git repository with skills"})]})]})]})]}),m("div",{className:"border-t border-ink/10 pt-4",children:[m("div",{className:"flex items-center justify-between pb-3",children:[m("div",{className:"flex items-center gap-2",children:[m("span",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:l.trim()?"Search Results":w?.name?w.name.toUpperCase():"SKILL CATALOG"}),m("span",{className:"text-xs text-ink/50",children:[_.length," skill(s) found"]})]}),m("button",{type:"button",onClick:x,title:"Refresh skills",className:"p-1 rounded-md text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:m(Mn,{size:14,className:d?"animate-spin":""})})]}),m("div",{className:"space-y-3",children:_.length===0?m("div",{className:"text-center py-10 border border-dashed border-ink/15 rounded-xl",children:m("p",{className:"text-xs text-ink/60",children:"No skills found matching your query."})}):_.map((T)=>{let E=y.has(T.name);return m("div",{className:"p-4 rounded-xl border border-ink/15 hover:border-ink/30 bg-paper transition-all flex flex-col sm:flex-row sm:items-start justify-between gap-3",children:[m("div",{className:"space-y-1.5 flex-1 min-w-0",children:[m("div",{className:"flex items-center gap-2",children:m("span",{className:"text-xs font-bold text-ink tracking-tight font-mono",children:T.name})}),m("p",{className:"text-xs text-ink/75 leading-relaxed line-clamp-2",children:T.description}),m("div",{className:"flex items-center gap-1.5 text-[11px] text-ink/50 font-mono pt-1",children:[m(hc,{size:12,className:"flex-shrink-0"}),m("span",{className:"truncate",children:T.repoTag})]})]}),m("div",{className:"flex items-center gap-2 flex-shrink-0 self-end sm:self-center",children:[T.githubUrl&&m("a",{href:T.githubUrl,target:"_blank",rel:"noreferrer",className:"p-1.5 rounded-lg text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",title:"View repository",children:m(so,{size:14})}),m("button",{type:"button",onClick:()=>k(T),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-all flex items-center gap-1.5 cursor-pointer ${E?"border border-ink/20 text-ink/80 hover:border-error hover:text-error hover:bg-error/5":"bg-ink text-paper hover:bg-ink/90 shadow-xs"}`,children:E?m(kt,{children:[m(Xt,{size:12}),m("span",{children:"Installed"})]}):m(kt,{children:[m(xi,{size:12}),m("span",{children:"install"})]})})]})]},T.id)})})]}),m(mnn,{isOpen:h,onClose:()=>f(!1),onAddSource:C}),g&&m("div",{className:"fixed bottom-6 right-6 z-50 bg-ink text-paper text-xs font-medium px-4 py-2.5 rounded-lg shadow-lg animate-in fade-in slide-in-from-bottom-2 duration-150 flex items-center gap-2",children:[m(Xt,{size:14}),m("span",{children:g})]})]})}var ynn=O(()=>{Je();pt();hnn();I5();gnn();de()});function vnn({category:e}){return m("div",{className:"space-y-6 text-ink flex flex-col items-center justify-center py-16",children:[m("div",{className:"text-sm font-semibold capitalize",children:[e.replace("-"," ")," Settings"]}),m("div",{className:"text-xs text-ink/60 text-center max-w-sm mt-2",children:"This settings category is currently under construction and will be available soon."})]})}var xnn=O(()=>{de()});var _nn;var knn=O(()=>{_nn={source:"@oh-my-pi/pi-coding-agent 10 tabs / 559 settings",tabs:[{id:"appearance",label:"Appearance",groups:["Theme","Composer","Status Line","Images","Display"]},{id:"model",label:"Model",groups:["Prompt","Prewalk","Vision","Thinking","Sampling","Retry & Fallback","Advisor"]},{id:"interaction",label:"Interaction",groups:["Startup & Updates","Git","Input","Magic Keywords","Notifications","Power","Agent","Approvals","Skills","Speech","Collab","Stream"]},{id:"context",label:"Context",groups:["General","Compaction","Experimental","Rules (TTSR)"]},{id:"memory",label:"Memory",groups:["General","Sharpshooter","Auto-Learn","Mnemopi","Hindsight"]},{id:"files",label:"Files",groups:["Editing","Reading","Read Summaries","LSP"]},{id:"shell",label:"Shell",groups:["Bash","Eval & Runtimes"]},{id:"tools",label:"Tools",groups:["Output Limits","Available Tools","Todos","Grep & Browser","Computer","Execution","GitHub","Discovery & MCP","Developer","Extensions","IDA Pro"]},{id:"tasks",label:"Tasks",groups:["Isolation","Subagents","Modes","Commands & Skills"]},{id:"providers",label:"Providers",groups:["Services","Fireworks","Tiny Model","Protocol","Timeouts","Privacy"]}],entries:{modelRoleStorage:{type:"enum",default:"global",values:["global","project"],ui:{tab:"model",group:"Prompt",label:"Model Role Storage",description:"Where model selector role assignments are saved",options:[{value:"global",label:"Global",description:"Save role models in the active profile config (current behavior)"},{value:"project",label:"Per-project",description:"Save project role models in .omp/config.yml; missing project roles use global defaults"}]}},autoResume:{type:"boolean",default:!1,ui:{tab:"interaction",group:"Startup & Updates",label:"Auto Resume",description:"Automatically resume the most recent session in the current directory"}},"git.enabled":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Git",label:"Enable Git Integration",description:"Show git branch, status, and PR information in the TUI and watch repository metadata."}},"theme.dark":{type:"string",default:"titanium",ui:{tab:"appearance",group:"Theme",label:"Dark Theme",description:"Theme used when the terminal has a dark background",options:"runtime"}},"theme.light":{type:"string",default:"light",ui:{tab:"appearance",group:"Theme",label:"Light Theme",description:"Theme used when the terminal has a light background",options:"runtime"}},symbolPreset:{type:"enum",default:"unicode",values:["unicode","nerd","ascii"],ui:{tab:"appearance",group:"Theme",label:"Symbol Preset",description:"Glyph set for icons and symbols (Unicode, Nerd Font, or ASCII)",options:[{value:"unicode",label:"Unicode",description:"Standard symbols (default)"},{value:"nerd",label:"Nerd Font",description:"Requires a Nerd Font, or a Glyph Protocol terminal (icons ship in-band)"},{value:"ascii",label:"ASCII",description:"Maximum compatibility"}]}},colorBlindMode:{type:"boolean",default:!1,ui:{tab:"appearance",group:"Theme",label:"Color-Blind Mode",description:"Use blue instead of green for diff additions"}},"composer.shape":{type:"string",default:"band",ui:{tab:"appearance",group:"Composer",label:"Composer Shape",description:"Visual layout of the input editor and status line",options:"runtime"}},"composer.tokenRate":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Composer",label:"Generation Rate",description:"Show a live generation tok/s readout: on the working row next to the session title, or in the native composer bar right after the thinking level, where the last reading stays between turns. Estimated from streamed deltas and corrected by the provider's billed output count as each message completes."}},"statusLine.preset":{type:"enum",default:"default",values:["default","minimal","compact","full","nerd","ascii","custom"],ui:{tab:"appearance",group:"Status Line",label:"Status Line Preset",description:"Pre-built status line configurations",options:[{value:"default",label:"Default",description:"Model, path, git, context, tokens, cost"},{value:"minimal",label:"Minimal",description:"Path and git only"},{value:"compact",label:"Compact",description:"Model, git, cost, context"},{value:"full",label:"Full",description:"All segments including time"},{value:"nerd",label:"Nerd",description:"Maximum info with Nerd Font icons"},{value:"ascii",label:"ASCII",description:"No special characters"},{value:"custom",label:"Custom",description:"User-defined segments"}]}},"statusLine.separator":{type:"enum",default:"powerline-thin",values:["powerline","powerline-thin","slash","pipe","block","none","ascii"],ui:{tab:"appearance",group:"Status Line",label:"Status Line Separator",description:"Style of separators between segments",options:[{value:"powerline",label:"Powerline",description:"Solid arrows (Nerd Font)"},{value:"powerline-thin",label:"Thin chevron",description:"Thin arrows (Nerd Font)"},{value:"slash",label:"Slash",description:"Forward slashes"},{value:"pipe",label:"Pipe",description:"Vertical pipes"},{value:"block",label:"Block",description:"Solid blocks"},{value:"none",label:"None",description:"Space only"},{value:"ascii",label:"ASCII",description:"Greater-than signs"}]}},"statusLine.contextLine":{type:"enum",default:"embedded",values:["off","percentage","annotated","embedded"],ui:{tab:"appearance",group:"Status Line",label:"Context-Reactive Line",description:"How the line between the left and right segments reflects context usage (box composer only)",options:[{value:"off",label:"Off",description:"Solid accent line, no context feedback"},{value:"percentage",label:"Percentage",description:"Used portion in accent color, remainder dimmed"},{value:"annotated",label:"Annotated",description:"Percentage plus ticks at the speculative and auto-compaction boundaries"},{value:"embedded",label:"Embedded",description:"Annotated line with the context percentage and window embedded in the gauge"}]}},"statusLine.sessionAccent":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Status Line",label:"Session Accent",description:"Use the session name color for the editor border and status line gap"}},"statusLine.transparent":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Status Line",label:"Transparent Status Line",description:"Use the terminal's default background for the status line instead of the theme's `statusLineBg`. Powerline end caps are dropped because they need a contrasting fill to bridge into the surrounding terminal."}},"statusLine.compactThinkingLevel":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Status Line",label:"Compact Thinking Level",description:"Show the thinking level as a single icon on the model name instead of a separate ` · <level>` suffix; in Tern's composer, as the model chip's icon instead of a separate chip (click the icon to cycle it)."}},"statusLine.showHookStatus":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Status Line",label:"Show Hook Status",description:"Display hook status messages below the status line"}},"terminal.showImages":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Images",label:"Show Inline Images",description:"Render images inline in the terminal",condition:"hasImageProtocol"}},"images.autoResize":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Images",label:"Auto-Resize Images",description:"Resize large images to 2000x2000 max for better model compatibility"}},"images.blockImages":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Images",label:"Block Images",description:"Prevent images from being sent to LLM providers"}},"tui.resizeScrollback":{type:"enum",default:"rebuild",values:["append","rebuild","preserve"],ui:{tab:"appearance",group:"Display",label:"Resize Scrollback",description:"How a settled terminal resize refreshes transcript rows retained in terminal scrollback",options:[{value:"append",label:"Append",description:"Replay the transcript at the new width below retained history"},{value:"rebuild",label:"Rebuild",description:"Erase all terminal scrollback, then replay one current-width transcript"},{value:"preserve",label:"Preserve",description:"Repaint only the viewport and keep history wrapped at its old width"}]}},"tui.completeScrollback":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Complete Scrollback",description:"Send transcript rows pushed off screen by a growing HUD or dialog straight to scrollback; when it shrinks, blank rows sit between the transcript and the input until new output fills them"}},"terminal.showProgress":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Native Terminal Progress",description:"Emit OSC 9;4 indeterminate progress while the agent or context maintenance is running (always on in Tern)"}},"terminal.programStatus":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Program Status (OSC 7501)",description:"Report whether the agent is working, waiting on you, done, or failed over OSC 7501, for terminal tab indicators and agent inboxes"}},"tui.textSizing":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Large Headings (Kitty)",description:"Render Markdown H1 headings at 2x scale using Kitty's OSC 66 text-sizing protocol. Only takes effect on Kitty terminals; ignored everywhere else. Off by default."}},"tui.renderMermaid":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Render Mermaid Diagrams",description:"Render Mermaid fenced code blocks as ASCII diagrams"}},"tui.renderSvg":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Render SVG Figures",description:"Invite the agent to draw diagrams and charts as SVG, rendered inline as images on terminals that show graphics"}},"tui.autoGraph":{type:"enum",default:"always",values:["smart","always","off"],ui:{tab:"appearance",group:"Display",label:"Auto-Graph Tables",description:"Draw a chart under numeric tables in the agent's answers, in your theme's colors, on terminals that show graphics",options:[{value:"smart",label:"Smart",description:"The judge model refines each chart: kind, columns, row names and grouping, scales, which way is better, and its title"},{value:"always",label:"Always",description:"Chart every table that reads as numeric, using the built-in best guess"},{value:"off",label:"Off",description:"Leave tables as tables"}]}},"tui.reactions":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Agent Reactions",description:"Invite the agent to react to your message with an emoji badge on its bubble"}},"tui.codexResetFireworks":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Codex Reset Fireworks",description:"Celebrate unscheduled Codex weekly usage resets and newly banked saved resets with a top-third fireworks overlay that remains until Esc"}},"tui.titleState":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Terminal Title Run State",description:"Show the agent run state in the terminal title's separator — an animated spinner while working (a static ':' under WSL), '>' when it's your turn, '!' when the agent is waiting on you"}},"tui.titleSpinner":{type:"enum",default:"braille",values:["braille","pulse","dots","line"],ui:{tab:"appearance",group:"Display",label:"Terminal Title Spinner",description:"Glyph set for the working-state spinner in the terminal title — braille sweep, filling moon, single-dot cycle, or ASCII-safe line",options:[{value:"braille",label:"Braille",description:"Classic ⠋⠙⠹ sweep (default)"},{value:"pulse",label:"Pulse",description:"Moon filling ○◑● then emptying"},{value:"dots",label:"Dots",description:"Single braille dots cycling"},{value:"line",label:"Line",description:"ASCII - \\ | / for fonts without braille coverage"}]}},"tui.hyperlinks":{type:"enum",default:"auto",values:["off","auto","always"],ui:{tab:"appearance",group:"Display",label:"Terminal Hyperlinks",description:"Wrap paths and URLs in OSC 8 hyperlinks for terminal-native click-to-open (auto: detect support; off: never; always: unconditional)"}},"tui.mouse":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Mouse Click-to-Focus",description:"Capture mouse clicks in the main session so live subagent cards and HUD rows focus on click, with a hover highlight on the target. Native text selection becomes Shift+drag and wheel scroll becomes Shift+wheel while on"}},"tui.tight":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Tight Layout",description:"Remove the 1-character horizontal padding from the left and right of the terminal output"}},"display.shimmer":{type:"enum",default:"classic",values:["classic","kitt","disabled"],ui:{tab:"appearance",group:"Display",label:"Shimmer",description:"Animation style for working/loading messages",options:[{value:"classic",label:"Classic",description:"Soft cosine wave sweeping across the text"},{value:"kitt",label:"KITT Scanner",description:"Knight Rider 1982 red light bouncing left-right"},{value:"disabled",label:"Disabled",description:"No animation; static muted text"}]}},"display.pinnedAgents":{type:"enum",default:"collapsed",values:["off","collapsed","full"],ui:{tab:"appearance",group:"Display",label:"Pinned Agents",description:"Pinned live-agent jump list above the editor (off hides it; collapsed shows a few rows with an expander; full lists all)",options:[{value:"off",label:"Off",description:"Hide the pinned jump list"},{value:"collapsed",label:"Collapsed",description:"Show a few rows with an expander"},{value:"full",label:"Full",description:"Always list every live agent"}]}},"display.subagentLivePreview":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Subagent Live Preview",description:"Show each pinned subagent's current (or most recent) tool call beneath its row"}},"display.smoothStreaming":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Smooth Streaming",description:"Reveal assistant text and streamed tool input smoothly while chunks arrive"}},"display.hideToolActivity":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Hide Tool Activity",description:"Hide model-initiated tool calls and results from the transcript"}},"display.showTokenUsage":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Show Token Usage",description:"Show per-turn token usage on assistant messages"}},"display.showTurnTime":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Show Turn Time",description:"Show the total prompt-to-yield time (including tool calls) on assistant message usage rows"}},"display.cacheMissMarker":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Cache Miss Marker",description:"Show a divider after an assistant turn whose request lost (missed) the prompt cache"}},"display.collapseCompacted":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Collapse Compacted History",description:"Collapse pre-compaction history behind the summary divider on the live transcript; disable to keep the full transcript inline with dividers at each compaction point"}},showHardwareCursor:{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Show Hardware Cursor",description:"Show terminal cursor for IME support"}},"tui.imeSafeCursor":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"IME-Safe Prompt Layout",description:"Move the prompt's bottom border to a separate row so macOS IME preedit cannot displace it"}},steeringMode:{type:"enum",default:"one-at-a-time",values:["all","one-at-a-time"],ui:{tab:"interaction",group:"Input",label:"Steering Mode",description:"How to process queued messages while agent is working"}},followUpMode:{type:"enum",default:"one-at-a-time",values:["all","one-at-a-time"],ui:{tab:"interaction",group:"Input",label:"Follow-Up Mode",description:"How to drain follow-up messages after a turn completes"}},interruptMode:{type:"enum",default:"immediate",values:["immediate","wait"],ui:{tab:"interaction",group:"Input",label:"Interrupt Mode",description:"When steering messages interrupt tool execution"}},"tui.vimMode":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Input",label:"Vim Editing Mode",description:"Modal prompt editing. Esc leaves Insert mode; Normal mode has hjkl, 0, $, ^, w, b, e, gg, G, counts, x/D/C, dd/yy, p and u; operators take motions or text objects (diw, ca(, dap); v/V start a Visual selection that y copies and d deletes"}},"tui.vimModeDisplay":{type:"enum",default:"text",values:["text","icon","none"],ui:{tab:"interaction",group:"Input",label:"Vim Mode Indicator",description:"How the current Vim mode appears in the status line",condition:"vimModeEnabled",options:[{value:"text",label:"Text",description:"Full mode name — NORMAL, INSERT, VISUAL, V-LINE, REPLACE"},{value:"icon",label:"Icon",description:"Single compact glyph per mode"},{value:"none",label:"Hidden",description:"Do not show the mode in the status line"}]}},"loop.mode":{type:"enum",default:"prompt",values:["prompt","compact","reset"],ui:{tab:"interaction",group:"Input",label:"Loop Mode",description:"What happens between /loop iterations before re-submitting the prompt",options:[{value:"prompt",label:"Prompt",description:"Re-submit the prompt as a follow-up message (current behavior)"},{value:"compact",label:"Compact",description:"Compact the session context, then re-submit the prompt"},{value:"reset",label:"Reset",description:"Start a new session, then re-submit the prompt"}]}},"loop.conditionTimeoutMs":{type:"number",default:30000,ui:{tab:"interaction",group:"Input",label:"Loop Condition Timeout (ms)",description:"Max wait for a `/loop --while` / `--until` condition command before treating it as broken and stopping the loop. Set to 0 to wait indefinitely",options:[{value:"0",label:"Unlimited"},{value:"10000",label:"10 seconds"},{value:"30000",label:"30 seconds"},{value:"120000",label:"2 minutes"}]}},"composer.recallClearedDrafts":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Input",label:"Recall Cleared Drafts",description:"Keep drafts cleared with Ctrl+C in local Up/Down history until exit; disabling affects future clears"}},doubleEscapeAction:{type:"enum",default:"rewind",values:["rewind","tree","none"],ui:{tab:"interaction",group:"Input",label:"Double-Escape Action",description:"What pressing Esc twice with an empty editor does: open the transcript rewind selector, open the session tree, or nothing"}},"input.bareExitOnEmptySession":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Input",label:"Bare Exit on Empty Session",description:"Submitting exactly `exit`, `quit`, or `q` (any case) before the first message quits instead of prompting the model"}},"input.bareSlashCommands":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Input",label:"Bare Slash Commands",description:"Submitting exactly a command name without the leading `/` (e.g. `model`, `compact`) runs that slash command; once the session has messages, press Enter twice to confirm"}},treeFilterMode:{type:"enum",default:"default",values:["default","no-tools","user-only","labeled-only","all"],ui:{tab:"interaction",group:"Input",label:"Session Tree Filter",description:"Default filter mode when opening the session tree"}},autocompleteMaxVisible:{type:"number",default:10,ui:{tab:"interaction",group:"Input",label:"Autocomplete Items",description:"Max visible items in autocomplete dropdown (3-20)",options:[{value:"3",label:"3 items"},{value:"5",label:"5 items"},{value:"7",label:"7 items"},{value:"10",label:"10 items"},{value:"15",label:"15 items"},{value:"20",label:"20 items"}]}},"spelling.typoDetection":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Input",label:"Typo Detection (macOS)",description:"Mark misspelled prompt words with the active macOS dictionaries",condition:"macOS"}},"spelling.autocomplete":{type:"enum",default:"auto",values:["off","auto","ngram","smollm","apple"],ui:{tab:"interaction",group:"Input",label:"Word Autocomplete",description:"Show predicted word completions as inline hints: Tab accepts with a space, Right without",options:[{value:"off",label:"Off",description:"No word completion"},{value:"auto",label:"Auto",description:"N-gram (nothing to download)"},{value:"ngram",label:"N-gram",description:"Learns your vocabulary from prompt history"},{value:"smollm",label:"SmolLM",description:"Small on-device language model blended with N-gram (downloads weights on first use)"},{value:"apple",label:"Apple",description:"macOS dictionary completions"}]}},"composer.predictions":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Input",label:"Composer Predictions",description:"After a completed turn, ask the active model to predict your next message and show it as ghost text in the empty composer; Tab or Right inserts it without sending. Extra usage: every completed turn sends one more billed request over the whole conversation (counted in /stats)"}},"spelling.autocorrect":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Input",label:"Autocorrect (macOS)",description:"Apply confident macOS spelling corrections after completed words",condition:"macOS"}},emojiAutocomplete:{type:"boolean",default:!0,ui:{tab:"interaction",group:"Input",label:"Emoji Autocomplete",description:"Suggest emojis from `:name:` shortcodes and expand text emoticons like `:D` or `:-)`"}},"paste.largeMenuThreshold":{type:"number",default:100,ui:{tab:"interaction",group:"Input",label:"Large Paste Menu",description:"When a paste reaches this many lines, offer a menu to wrap it in a code block, wrap it in XML tags, or save it to a file. 0 disables the menu (large pastes still collapse to a [Paste] marker).",options:[{value:"0",label:"Off"},{value:"100",label:"100 lines"},{value:"250",label:"250 lines"},{value:"500",label:"500 lines"},{value:"1000",label:"1000 lines"}]}},"startup.quiet":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Startup & Updates",label:"Quiet Startup",description:"Skip welcome screen and startup status messages"}},"startup.showSplash":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Startup & Updates",label:"Show Startup Splash",description:"Show the full animated setup splash on normal interactive startup without rerunning setup. Quiet Startup still suppresses it."}},"startup.setupWizard":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Startup & Updates",label:"Setup Wizard",description:"Show newly added onboarding steps once per setup version"}},"startup.checkUpdate":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Startup & Updates",label:"Check for Updates",description:"Check for omp updates on startup"}},"update.channel":{type:"enum",default:"stable",values:["stable","canary"],ui:{tab:"interaction",group:"Startup & Updates",label:"Update Channel",description:"Update channel used by omp update and the startup update check",options:[{value:"stable",label:"Stable"},{value:"canary",label:"Canary"}]}},"marketplace.autoUpdate":{type:"enum",default:"notify",values:["off","notify","auto"],ui:{tab:"interaction",group:"Startup & Updates",label:"Marketplace Auto-Update",description:"Check for plugin updates on startup",options:[{value:"off",label:"Off",description:"Don't check for plugin updates"},{value:"notify",label:"Notify",description:"Check on startup and notify when updates are available"},{value:"auto",label:"Auto",description:"Check on startup and auto-install updates"}]}},"startup.changelogMode":{type:"enum",default:"summary",values:["summary","expanded","hidden"],ui:{tab:"interaction",group:"Startup & Updates",label:"Startup Changelog",description:"Choose whether update notes start as a summary, full details, or stay hidden",options:[{value:"summary",label:"Summary",description:"Show release and change counts with a /changelog hint"},{value:"expanded",label:"Expanded",description:"Show the recent release notes in full"},{value:"hidden",label:"Hidden",description:"Do not show release notes on startup"}]}},"magicKeywords.enabled":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Magic Keywords",description:"Enable hidden notices for standalone ultrathink, orchestrate, workflowz, jevify keywords"}},"magicKeywords.ultrathink":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Ultrathink Keyword",description:"Let standalone ultrathink request maximum automatic thinking and append its hidden notice"}},"magicKeywords.orchestrate":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Orchestrate Keyword",description:"Let standalone orchestrate append its hidden multi-agent orchestration notice"}},"magicKeywords.workflow":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Workflow Keyword",description:"Let standalone workflowz append its hidden eval workflow notice"}},"magicKeywords.jevify":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Jevify Keyword",description:"Let standalone jevify append its hidden bulk-judge classification notice"}},"completion.notify":{type:"enum",default:"on",values:["on","off"],ui:{tab:"interaction",group:"Notifications",label:"Completion Notification",description:"Notify when the agent finishes a turn"}},"error.notify":{type:"enum",default:"off",values:["on","off"],ui:{tab:"interaction",group:"Notifications",label:"Error Notification",description:"Notify when the agent stops with an error"}},"ask.timeout":{type:"number",default:0,ui:{tab:"interaction",group:"Notifications",label:"Ask Timeout",description:"Auto-select the recommended ask option after this many seconds (0 disables). Also bounds cfg:// approval prompts; an unanswered approval denies the write instead of auto-selecting",options:[{value:"0",label:"Disabled"},{value:"15",label:"15 seconds"},{value:"30",label:"30 seconds"},{value:"60",label:"60 seconds"},{value:"120",label:"120 seconds"}]}},"ask.notify":{type:"enum",default:"on",values:["on","off"],ui:{tab:"interaction",group:"Notifications",label:"Ask Notification",description:"Notify when the ask tool is waiting for input"}},"recap.enabled":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Notifications",label:"Idle Recap",description:"Generate a brief LLM recap of where things stand after the terminal has been idle"}},"recap.idleSeconds":{type:"number",default:240,ui:{tab:"interaction",group:"Notifications",label:"Idle Recap Delay",description:"Seconds to wait while idle before showing the recap",options:[{value:"60",label:"1 minute"},{value:"120",label:"2 minutes"},{value:"240",label:"4 minutes"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"}]}},"power.sleepPrevention":{type:"enum",default:"idle",values:["off","idle","display","system"],ui:{tab:"interaction",group:"Power",label:"Sleep Prevention",description:"Prevent the system sleeping during active sessions. Each level is cumulative — it adds the flags of all lower levels.",options:[{value:"off",label:"Off",description:"Do not prevent any sleep"},{value:"idle",label:"Prevent Idle Sleep",description:"Keep the system awake while a session is open (macOS `caffeinate -i`)"},{value:"display",label:"Prevent Display Sleep",description:"Also keep the display from idle-sleeping (macOS `caffeinate -i -d`)"},{value:"system",label:"Prevent System Sleep",description:"Also block all system sleep on AC and declare the user active (macOS `caffeinate -i -d -s -u`)"}]}},"prewalk.enabled":{type:"boolean",default:!1,ui:{tab:"model",group:"Prewalk",label:"Enable Prewalk",description:"Start on the active model, then switch to a fast/cheap model (default the 'smol' role) at the first edit/write after the plan nudge's todo list exists — the strong model plans, commits the todos, and starts the implementation before handing off. Overridable per session with --prewalk / --no-prewalk."}},"prewalk.auto":{type:"enum",default:"off",values:["off","suggest","on"],ui:{tab:"model",group:"Prewalk",label:"Auto Prewalk",description:"Ask the native judge resolved through the 'judge' role whether each new top-level user task front-loads its hard reasoning. Needs a native judge; without one nothing is classified. Independent of Enable Prewalk.",options:[{value:"off",label:"Off",description:"Never classify prompts for prewalk"},{value:"suggest",label:"Suggest",description:"Classify each task and report the decision without arming prewalk"},{value:"on",label:"On",description:"For confidently front-loaded tasks, arm a handoff from the active model to the auto target; the next task starts back on the planning model"}]}},"prewalk.autoTarget":{type:"string",default:"@smol",ui:{tab:"model",group:"Prewalk",label:"Auto-prewalk target",description:"Model or role (default '@smol') auto-prewalk hands off to at the first edit/write."}},"providers.maxInFlightRequests":{type:"record",default:{},ui:{tab:"providers",group:"Services",label:"Max In-Flight Requests",description:'Maximum concurrent LLM requests per provider id (for example "openai" or "anthropic"), shared across local OMP processes with this config root. Omitted providers are unlimited.'}},"images.describeForTextModels":{type:"boolean",default:!0,ui:{tab:"model",group:"Vision",label:"Describe Images for Text Models",description:"When an image is attached to a model without vision support, save it under local:// and inject a description from a vision-capable model instead of dropping it"}},defaultThinkingLevel:{type:"enum",default:"high",values:["minimal","low","medium","high","xhigh","max","auto"],ui:{tab:"model",group:"Thinking",label:"Thinking Level",description:"Reasoning depth for thinking-capable models",options:[{value:"auto",label:"auto",description:"Auto-detect per prompt"},{value:"minimal",label:"min",description:"Very brief reasoning (~1k tokens)"},{value:"low",label:"low",description:"Light reasoning (~2k tokens)"},{value:"medium",label:"medium",description:"Moderate reasoning (~8k tokens)"},{value:"high",label:"high",description:"Deep reasoning (~16k tokens)"},{value:"xhigh",label:"xhigh",description:"Extended reasoning (~32k tokens)"},{value:"max",label:"max",description:"Maximum reasoning the model supports"}]}},hideThinkingBlock:{type:"boolean",default:!1,ui:{tab:"model",group:"Thinking",label:"Hide Thinking Blocks",description:"Hide thinking blocks in assistant responses"}},expandThinkingBlocks:{type:"boolean",default:!1,ui:{tab:"model",group:"Thinking",label:"Expand Thinking Blocks",description:"Keep finished thinking blocks expanded instead of collapsing them when the turn ends",condition:"nativeRendering"}},proseOnlyThinking:{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Prose Only Thinking",description:"Omit code blocks from thinking summaries and replace them with an ellipsis"}},omitThinking:{type:"boolean",default:!1,ui:{tab:"model",group:"Thinking",label:"Omit Thinking summaries",description:"Instruct upstream providers to completely omit thinking summaries from responses (where supported)"}},externalThinking:{type:"boolean",default:!1,ui:{tab:"model",group:"Thinking",label:"External Thinking",description:"Private scratchpad; not shown to user. Disables supported GPT, Claude, and Gemini reasoning",warning:"At your own risk: providers have flagged this request shape as abuse, up to account-level enforcement"}},"model.loopGuard.enabled":{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Loop Guard",description:"Enable automatic stream loop detection for model reasoning and prose"}},"model.loopGuard.checkAssistantContent":{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Loop Guard Scan Prose",description:"Apply loop guard to assistant prose messages in addition to thinking logs"}},"model.loopGuard.toolCallReminder":{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Loop Guard Tool-Call Reminder",description:"When a Gemini reasoning stream emits many consecutive planning headers without calling a tool, interrupt it and inject a reminder to issue a tool call (requires Loop Guard)"}},"model.toolCallLoopGuard.enabled":{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Tool-Call Loop Guard",description:"Detect consecutive identical tool calls across turns and inject a corrective steer"}},"model.toolCallLoopGuard.threshold":{type:"number",default:5,ui:{tab:"model",group:"Thinking",label:"Tool-Call Loop Threshold",description:"Consecutive identical tool calls required before the corrective steer is injected"}},"model.toolCallLoopGuard.exemptTools":{type:"array",default:["wait"],ui:{tab:"model",group:"Thinking",label:"Tool-Call Loop Exempt Tools",description:"Tool names that may repeat consecutively without triggering the cross-turn loop guard"}},inlineToolDescriptors:{type:"enum",default:"auto",values:["auto","on","off"],ui:{tab:"model",group:"Prompt",label:"Inline Tool Descriptors",description:"Render full tool descriptors in the system prompt and strip top-level/nested descriptions from provider tool schemas so descriptor text is sent once. Auto enables this for Gemini models and disables it otherwise",options:[{value:"auto",label:"Auto",description:"Inline descriptors for Gemini models; keep them in tool schemas otherwise"},{value:"on",label:"On",description:"Always inline descriptors in the system prompt"},{value:"off",label:"Off",description:"Keep descriptors in provider tool schemas only"}]}},includeModelInPrompt:{type:"boolean",default:!0,ui:{tab:"model",group:"Prompt",label:"Include Model in Prompt",description:"Surface the active model identifier in the system prompt so the agent knows which model it is"}},includeWorkspaceTree:{type:"boolean",default:!1,ui:{tab:"model",group:"Prompt",label:"Include Workspace Tree",description:"Render the workspace directory tree in the system prompt. WARNING: This can bust prompt caching across sessions when files are modified."}},skillful:{type:"boolean",default:!0,ui:{tab:"model",group:"Prompt",label:"List Skills in Prompt",description:"List available skills in the system prompt; disable to save context and toggle per-session with /skillful"}},personality:{type:"enum",default:"default",values:["default","friendly","pragmatic","none"],ui:{tab:"model",group:"Prompt",label:"Personality",description:"Communication style rendered into the system prompt's personality block",options:[{value:"default",label:"Default",description:"Terse, evidence-first engineer; dense, action-oriented replies"},{value:"friendly",label:"Friendly",description:"Warm, encouraging collaborator focused on momentum and morale"},{value:"pragmatic",label:"Pragmatic",description:"Direct, efficient engineer focused on clarity and rigor"},{value:"none",label:"None",description:"Omit the personality block entirely"}]}},temperature:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Temperature",description:"Sampling temperature (0 = deterministic, 1 = creative, -1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0",label:"0",description:"Deterministic"},{value:"0.2",label:"0.2",description:"Focused"},{value:"0.5",label:"0.5",description:"Balanced"},{value:"0.7",label:"0.7",description:"Creative"},{value:"1",label:"1",description:"Maximum variety"}]}},topP:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Top P",description:"Nucleus sampling cutoff (0-1, -1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0.1",label:"0.1",description:"Very focused"},{value:"0.3",label:"0.3",description:"Focused"},{value:"0.5",label:"0.5",description:"Balanced"},{value:"0.9",label:"0.9",description:"Broad"},{value:"1",label:"1",description:"No nucleus filtering"}]}},topK:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Top K",description:"Sample from top-K tokens (-1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"1",label:"1",description:"Greedy top token"},{value:"20",label:"20",description:"Focused"},{value:"40",label:"40",description:"Balanced"},{value:"100",label:"100",description:"Broad"}]}},minP:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Min P",description:"Minimum probability threshold (0-1, -1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0.01",label:"0.01",description:"Very permissive"},{value:"0.05",label:"0.05",description:"Balanced"},{value:"0.1",label:"0.1",description:"Strict"}]}},presencePenalty:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Presence Penalty",description:"Penalty for introducing already-present tokens (-1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0",label:"0",description:"No penalty"},{value:"0.5",label:"0.5",description:"Mild novelty"},{value:"1",label:"1",description:"Encourage novelty"},{value:"2",label:"2",description:"Strong novelty"}]}},repetitionPenalty:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Repetition Penalty",description:"Penalty for repeated tokens (-1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0.8",label:"0.8",description:"Allow repetition"},{value:"1",label:"1",description:"No penalty"},{value:"1.1",label:"1.1",description:"Mild penalty"},{value:"1.2",label:"1.2",description:"Balanced"},{value:"1.5",label:"1.5",description:"Strong penalty"}]}},textVerbosity:{type:"enum",default:"medium",values:["low","medium","high"],ui:{tab:"model",group:"Sampling",label:"Text Verbosity",description:"OpenAI Responses and Codex response verbosity (low, medium, or high)",options:[{value:"low",label:"Low",description:"Prefer concise responses"},{value:"medium",label:"Medium",description:"Balance brevity and detail (default)"},{value:"high",label:"High",description:"Prefer detailed responses"}]}},"tier.openai":{type:"enum",default:"none",values:["none","auto","default","flex","scale","priority","ultrafast"],ui:{tab:"model",group:"Sampling",label:"Service Tier — OpenAI",description:"Processing tier for OpenAI / OpenAI-Codex requests, and OpenAI-family models routed via OpenRouter (none = omit). Sent as `service_tier`.",options:[{value:"none",label:"None",description:"Omit service_tier (standard processing)"},{value:"auto",label:"Auto",description:"Provider default tier selection"},{value:"default",label:"Default",description:"Standard priority processing"},{value:"flex",label:"Flex",description:"Lower cost, higher latency when available"},{value:"scale",label:"Scale",description:"Scale Tier credits when available"},{value:"priority",label:"Priority",description:"Faster, higher cost (premium request)"},{value:"ultrafast",label:"Ultrafast",description:"Lowest-latency serving; OpenAI API preview access, or Codex models that advertise it"}]}},"tier.anthropic":{type:"enum",default:"none",values:["none","priority"],ui:{tab:"model",group:"Sampling",label:"Service Tier — Anthropic",description:'Processing tier for Claude requests. `priority` realizes fast mode (`speed: "fast"`) on supported direct Anthropic models; ignored on Bedrock/Vertex Claude and via OpenRouter.',options:[{value:"none",label:"None",description:"Standard processing"},{value:"priority",label:"Priority",description:'Fast mode (`speed: "fast"`) on supported direct Claude models; ignored on Bedrock/Vertex'}]}},"tier.google":{type:"enum",default:"none",values:["none","flex","priority"],ui:{tab:"model",group:"Sampling",label:"Service Tier — Google",description:"Processing tier for Gemini (Google AI Studio + Vertex) requests, and Google-family models routed via OpenRouter (none = omit). Sent as the top-level `serviceTier` field.",options:[{value:"none",label:"None",description:"Standard processing"},{value:"flex",label:"Flex",description:"Lower cost, higher latency (Gemini API + Vertex)"},{value:"priority",label:"Priority",description:"Faster, higher reliability (Gemini API + Vertex)"}]}},"tier.subagent":{type:"enum",default:"inherit",values:["inherit","none","auto","default","flex","scale","priority","ultrafast"],ui:{tab:"model",group:"Sampling",label:"Service Tier — Subagent",description:"Service Tier for spawned task/eval subagents. Inherit = match the main agent's live per-family tiers (tracks /fast); pick a value to apply it to whichever family the subagent's model belongs to.",options:[{value:"inherit",label:"Inherit",description:"Match the main agent's live per-family tiers"},{value:"none",label:"None",description:"Standard processing"},{value:"auto",label:"Auto",description:"Provider default tier selection (OpenAI family)"},{value:"default",label:"Default",description:"Standard priority processing (OpenAI family)"},{value:"flex",label:"Flex",description:"Flexible capacity tier (OpenAI/Google families)"},{value:"scale",label:"Scale",description:"Scale Tier credits (OpenAI family)"},{value:"priority",label:"Priority",description:"Priority on every supported family of the spawned model"},{value:"ultrafast",label:"Ultrafast",description:"Ultrafast serving (OpenAI family, where available)"}]}},"tier.advisor":{type:"enum",default:"none",values:["inherit","none","auto","default","flex","scale","priority","ultrafast"],ui:{tab:"model",group:"Sampling",label:"Service Tier — Advisor",description:"Service Tier for the advisor model. None = standard processing; Inherit = match the main agent's live per-family tiers; pick a value to apply it to the advisor model's family.",options:[{value:"inherit",label:"Inherit",description:"Match the main agent's live per-family tiers"},{value:"none",label:"None",description:"Standard processing"},{value:"auto",label:"Auto",description:"Provider default tier selection (OpenAI family)"},{value:"default",label:"Default",description:"Standard priority processing (OpenAI family)"},{value:"flex",label:"Flex",description:"Flexible capacity tier (OpenAI/Google families)"},{value:"scale",label:"Scale",description:"Scale Tier credits (OpenAI family)"},{value:"priority",label:"Priority",description:"Priority on every supported family of the spawned model"},{value:"ultrafast",label:"Ultrafast",description:"Ultrafast serving (OpenAI family, where available)"}],condition:"advisorEnabled"}},"retry.maxRetries":{type:"number",default:10,ui:{tab:"model",group:"Retry & Fallback",label:"Retry Attempts",description:"Maximum retry attempts on API errors",options:[{value:"1",label:"1 retry"},{value:"2",label:"2 retries"},{value:"3",label:"3 retries"},{value:"5",label:"5 retries"},{value:"10",label:"10 retries"}]}},"retry.maxDelayMs":{type:"number",default:300000,ui:{tab:"model",group:"Retry & Fallback",label:"Max Retry Delay",description:"Maximum wait between retries, in ms. When the provider asks us to wait longer than this and no credential or model fallback succeeds, the request fails fast instead of sleeping (e.g. 3-hour Anthropic rate-limit windows). 0 disables the ceiling — to let the session auto-resume through provider-stated quota resets."}},"retry.waitForUsageReset":{type:"boolean",default:!1,ui:{tab:"model",group:"Retry & Fallback",label:"Wait For Usage Reset",description:"When a provider reports usage-limit exhaustion with a reset time (5-hour or weekly quota windows on any provider), sleep until the reset instead of failing fast past retry.maxDelayMs. Waits are abortable (Esc) but also hold subagents, so leave off for unattended runs."}},"retry.modelFallback":{type:"boolean",default:!0,ui:{tab:"model",group:"Retry & Fallback",label:"Retry Model Fallback",description:"Allow retry recovery to switch to models in retry.fallbackChains after provider errors. Independent of Auto-Promote Context"}},"retry.fallbackOn":{type:"enum",default:"any",values:["any","usage-limit","except-usage-limit"],ui:{tab:"model",group:"Retry & Fallback",label:"Fallback Trigger",description:"Which failed requests may switch to a configured fallback model",options:[{value:"any",label:"Any error",description:"Every provider error may switch models"},{value:"usage-limit",label:"Usage limits only",description:"Switch only on a usage limit; retry other errors on the same model, then surface them"},{value:"except-usage-limit",label:"All but usage limits",description:"Wait out or surface a usage limit; switch on other errors"}]}},"retry.usageAwareFallback":{type:"boolean",default:!1,ui:{tab:"model",group:"Retry & Fallback",label:"Usage-Aware Fallback",description:"Use reliable coding-plan quota reports to prefer same-provider accounts, then configured fallback models, before a hard usage limit. Ordinary configured API keys are excluded."}},"retry.usageReservePct":{type:"number",default:10,ui:{tab:"model",group:"Retry & Fallback",label:"Reserve Margin",description:"Treat a coding-plan model as near its limit below this remaining percentage. Unknown or unmapped usage keeps the primary model.",condition:"usageAwareFallbackEnabled",options:[{value:"5",label:"5%",description:"Act only when nearly exhausted"},{value:"10",label:"10%",description:"Balanced safety margin"},{value:"15",label:"15%",description:"Conservative"},{value:"20",label:"20%",description:"Early protection"},{value:"25",label:"25%",description:"Very conservative"}]}},"retry.usageReservePolicy":{type:"enum",default:"confirm",values:["confirm","auto","fail-closed"],ui:{tab:"model",group:"Retry & Fallback",label:"Reserve Policy",description:"What to do when every same-provider coding-plan account is inside the reserve margin.",condition:"usageAwareFallbackEnabled",options:[{value:"confirm",label:"Confirm interactively",description:"Keep interactive sessions on the primary until confirmed; background agents auto-fallback"},{value:"auto",label:"Auto-fallback",description:"Always select the next eligible configured fallback"},{value:"fail-closed",label:"Fail closed",description:"Do not spend reserve quota or select a fallback"}]}},"retry.fallbackChains":{type:"record",default:{},ui:{tab:"model",group:"Retry & Fallback",label:"Retry Fallback Chains",description:`JSON object mapping model roles, model selectors ("provider/model-id"), or provider wildcards ("provider/*") to ordered fallback selectors, e.g. {"default":["openai/gpt-4o-mini"],"google-antigravity/*":["google/*","google-vertex/*"]}. Model-oriented keys apply whenever that model/provider is active, regardless of role; a "provider/*" entry keeps the failing model's id and swaps the provider. An id-prefixed wildcard ("openrouter/google/*") re-prefixes the failing model's bare id (google-antigravity/gemini-x -> openrouter/google/gemini-x) and, used as a key, matches only that provider's ids under the prefix. A fallback entry may carry an explicit thinking suffix ("provider/model:low", ":high", ":max", ":off"); a bare entry inherits the failing turn's effort, and "provider/*" entries always inherit.`}},"retry.fallbackRevertPolicy":{type:"enum",default:"cooldown-expiry",values:["cooldown-expiry","never"],ui:{tab:"model",group:"Retry & Fallback",label:"Fallback Revert Policy",description:"When to return to the primary model after a fallback",options:[{value:"cooldown-expiry",label:"Cooldown expiry",description:"Return to the primary model after its suppression window ends"},{value:"never",label:"Never",description:"Stay on the fallback model until manually changed"}]}},"providers.anthropic.serverSideFallback":{type:"boolean",default:!1,ui:{tab:"model",group:"Retry & Fallback",label:"Anthropic Server-Side Fallback (Fable 5)",description:"When a Claude Fable 5 / Mythos 5 request is blocked by Anthropic's safety classifier, retry it on Claude Opus 5 server-side (Anthropic `server-side-fallback-2026-06-01` beta). Opt-in — leaving this off preserves the pre-fallback behavior for every request."}},"providers.ollama-cloud.maxConcurrency":{type:"number",default:3,ui:{tab:"providers",group:"Services",label:"Ollama Cloud Max Concurrency",description:"Maximum concurrent Ollama Cloud subagent runs per process; 0 disables the provider-specific limit"}},"providers.webSearchTimeoutSeconds":{type:"number",default:60,ui:{tab:"providers",group:"Services",label:"Web Search Timeout",description:"Hard timeout for each provider's search transport before web_search advances to the next fallback, in seconds (maximum 300)",options:[{value:"30",label:"30 seconds"},{value:"60",label:"1 minute"},{value:"120",label:"2 minutes"},{value:"180",label:"3 minutes"},{value:"300",label:"5 minutes"}]}},"providers.antigravityEndpoint":{type:"enum",default:"auto",values:["auto","production","sandbox"],ui:{tab:"providers",group:"Services",label:"Antigravity Endpoint Mode",description:"Endpoint routing strategy for google-antigravity providers (chat, search, image, discovery)",options:[{value:"auto",label:"Auto",description:"Try production endpoint, fail over to sandbox on 5xx/429"},{value:"production",label:"Production Only",description:"Force production endpoint only"},{value:"sandbox",label:"Sandbox Only",description:"Force sandbox endpoint only"}]}},"providers.fireworksTier":{type:"enum",default:"standard",values:["standard","priority"],ui:{tab:"providers",group:"Fireworks",label:"Fireworks Tier",description:'Serving path for Fireworks requests. Priority sends `service_tier: "priority"` for higher reliability during peak traffic at a higher price; Standard omits it. Fast (`-fast`) models ignore this — Fast is its own serving path.',options:[{value:"standard",label:"Standard",description:"Default serving path (no service_tier)"},{value:"priority",label:"Priority",description:"Priority serving path: higher reliability, premium per-token pricing"}]}},"providers.tinyModelDevice":{type:"enum",default:"default",values:["default","gpu","cpu","mlx","metal","webgpu","cuda","dml","coreml","auto","wasm","webnn","webnn-gpu","webnn-cpu","webnn-npu"],ui:{tab:"providers",group:"Tiny Model",label:"Tiny Model Device",description:"Inference backend for local tiny models (titles + memory): an ONNX execution provider, or `mlx` to download MLX weights and run them through mlx-lm on Apple silicon. Default uses CPU-only ONNX. The PI_TINY_DEVICE env var overrides this.",options:[{value:"default",label:"Default",description:"CPU-only inference"},{value:"gpu",label:"GPU",description:"Accelerated provider (WebGPU/Metal, CUDA, or DirectML)"},{value:"cpu",label:"CPU",description:"CPU-only inference"},{value:"mlx",label:"MLX",description:"Apple silicon GPU via mlx-lm (Python subprocess; macOS arm64)"},{value:"metal",label:"Metal",description:"Alias for MLX"},{value:"webgpu",label:"WebGPU",description:"WebGPU/Metal backend"},{value:"cuda",label:"CUDA",description:"NVIDIA CUDA (Linux x64)"},{value:"dml",label:"DirectML",description:"DirectML backend (Windows)"},{value:"coreml",label:"CoreML",description:"Apple CoreML (opt-in; can fail to load)"},{value:"auto",label:"Auto",description:"Let ONNX Runtime choose a provider"},{value:"wasm",label:"WASM",description:"WebAssembly backend"},{value:"webnn",label:"WebNN",description:"WebNN backend"},{value:"webnn-gpu",label:"WebNN GPU",description:"WebNN GPU device"},{value:"webnn-cpu",label:"WebNN CPU",description:"WebNN CPU device"},{value:"webnn-npu",label:"WebNN NPU",description:"WebNN NPU device"}]}},"providers.tinyModelDtype":{type:"enum",default:"default",values:["default","q4","q4f16","q8","fp16","fp32","int8","uint8","bnb4","q2","q2f16","q1","q1f16","auto"],ui:{tab:"providers",group:"Tiny Model",label:"Tiny Model Precision",description:"ONNX quantization/precision for local tiny models. Default uses each model's shipped dtype (q4); lower precision is faster, higher is more faithful. Ignored by the MLX backend (its repos are pre-quantized 4-bit). The PI_TINY_DTYPE env var overrides this.",options:[{value:"default",label:"Default",description:"Each model's shipped dtype (currently q4)"},{value:"q4",label:"q4",description:"4-bit weights; smallest and fastest"},{value:"q4f16",label:"q4f16",description:"4-bit weights with fp16 activations"},{value:"q8",label:"q8",description:"8-bit quantization"},{value:"fp16",label:"fp16",description:"16-bit float; higher fidelity, larger"},{value:"fp32",label:"fp32",description:"Full precision; largest and slowest"},{value:"int8",label:"int8",description:"Signed 8-bit integer"},{value:"uint8",label:"uint8",description:"Unsigned 8-bit integer"},{value:"bnb4",label:"bnb4",description:"bitsandbytes 4-bit"},{value:"q2",label:"q2",description:"2-bit weights"},{value:"q2f16",label:"q2f16",description:"2-bit weights with fp16 activations"},{value:"q1",label:"q1",description:"1-bit weights"},{value:"q1f16",label:"q1f16",description:"1-bit weights with fp16 activations"},{value:"auto",label:"Auto",description:"Let transformers.js choose per device"}]}},"providers.autoThinkingMaxEffort":{type:"enum",default:"xhigh",values:["xhigh","max"],ui:{tab:"model",group:"Thinking",label:"Auto Thinking Ceiling",description:"Highest effort the `auto` classifier may resolve. `xhigh` keeps the classifier one tier below the top, so only an explicit `ultrathink` reaches `max`; `max` lets a turn the classifier judges exceptional bill the top tier on models that expose it.",condition:"autoThinkingActive",options:[{value:"xhigh",label:"xhigh",description:"Classifier stops at xhigh (default)"},{value:"max",label:"max",description:"Classifier may resolve max where the model supports it"}]}},"features.unexpectedStopDetection":{type:"enum",default:"mechanical",values:["none","mechanical","smart"],ui:{tab:"interaction",group:"Agent",label:"Unexpected Stops",description:"Automatically recover when the assistant stops without a visible message. Smart also classifies text-only stops with a small model.",options:[{value:"none",label:"None",description:"Disabled"},{value:"mechanical",label:"Mechanical",description:"Retry stops with no visible assistant message; tool calls are excluded (default)"},{value:"smart",label:"Smart",description:"Mechanical + small-model classification of text-only stops"}]}},"providers.kimiApiFormat":{type:"enum",default:"auto",values:["auto","openai","anthropic"],ui:{tab:"providers",group:"Protocol",label:"Kimi API Format",description:"API format for Kimi Code provider (auto follows live model metadata)",options:[{value:"auto",label:"Auto",description:"Use the model's server-declared protocol"},{value:"openai",label:"OpenAI",description:"api.kimi.com"},{value:"anthropic",label:"Anthropic",description:"api.moonshot.ai"}]}},"providers.openaiWebsockets":{type:"enum",default:"auto",values:["auto","off","on"],ui:{tab:"providers",group:"Protocol",label:"OpenAI WebSockets",description:"Websocket policy for OpenAI Codex models (auto uses model defaults, on forces, off disables)",options:[{value:"auto",label:"Auto",description:"Use model/provider default websocket behavior"},{value:"off",label:"Off",description:"Disable websockets for OpenAI Codex models"},{value:"on",label:"On",description:"Force websockets for OpenAI Codex models"}]}},"providers.openaiLiveSteering":{type:"boolean",default:!0,ui:{tab:"providers",group:"Protocol",label:"OpenAI Live Steering",description:"Deliver messages typed while a GPT-6 response streams into that response over the Codex WebSocket, instead of waiting for the next tool boundary"}},"providers.muse-code.storeResponses":{type:"boolean",default:!1,ui:{tab:"providers",group:"Protocol",label:"Muse Code Stored Responses",description:"Store Muse Code results on Meta's servers so a turn whose connection drops is recovered instead of re-run. Stored runs keep prompts and outputs on Meta's side."}},"providers.cacheRetention":{type:"enum",default:"auto",values:["auto","short","long","none"],ui:{tab:"providers",group:"Protocol",label:"Prompt Cache Retention",description:"Prompt-cache retention forwarded to providers that support it (Anthropic, Bedrock, OpenRouter, OpenAI)",options:[{value:"auto",label:"Auto",description:"Provider default — Anthropic OAuth subscriber sessions default to 1h, API keys use 5m; PI_CACHE_RETENTION still applies"},{value:"short",label:"Short (5m)",description:"Cheapest cache writes; pair with cache warming to keep short entries alive while idle"},{value:"long",label:"Long (1h)",description:"1h TTL where the provider supports it; pricier writes, only warmed during active runs"},{value:"none",label:"Off",description:"Disable prompt caching and cache-affinity routing"}]}},"providers.cacheWarming":{type:"enum",default:"idle",values:["off","streaming","idle"],ui:{tab:"providers",group:"Protocol",label:"Cache Warming",description:"Re-send the last request with a one-token output budget shortly before its prompt-cache entry expires",options:[{value:"off",label:"Off",description:"Disable cache warming"},{value:"streaming",label:"Streaming",description:"Protect expensive prefixes during long tool executions; stops when the agent settles"},{value:"idle",label:"Idle",description:"Also refresh 5-minute entries between runs while the expected savings stay above the cost floor"}]}},"providers.streamFirstEventTimeoutSeconds":{type:"number",default:-1,ui:{tab:"providers",group:"Timeouts",label:"Stream First Event Timeout",description:"Seconds to wait for the first model stream event; -1 uses provider/env defaults, 0 disables the watchdog",options:[{value:"-1",label:"Auto",description:"Use provider defaults and PI_* timeout env vars"},{value:"0",label:"Off",description:"Disable first-event timeout"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"},{value:"1800",label:"30 minutes"}]}},"providers.streamIdleTimeoutSeconds":{type:"number",default:-1,ui:{tab:"providers",group:"Timeouts",label:"Stream Idle Timeout",description:"Seconds a model stream may stay silent between events; -1 uses provider/env defaults, 0 disables the watchdog",options:[{value:"-1",label:"Auto",description:"Use provider defaults and PI_* timeout env vars"},{value:"0",label:"Off",description:"Disable idle timeout"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"},{value:"1800",label:"30 minutes"}]}},"providers.openrouterVariant":{type:"enum",default:"default",values:["default","nitro","floor","online","exacto"],ui:{tab:"providers",group:"Protocol",label:"OpenRouter Routing",description:"Default routing-variant suffix appended to OpenRouter model IDs (overridden when the selector already names a variant)",options:[{value:"default",label:"Default",description:"No suffix; use OpenRouter's default routing"},{value:"nitro",label:":nitro",description:"Prioritize throughput / lowest latency"},{value:"floor",label:":floor",description:"Prioritize cheapest available provider"},{value:"online",label:":online",description:"Enable OpenRouter's web-search plugin"},{value:"exacto",label:":exacto",description:"Cherry-picked high-quality providers (only defined for select models)"}]}},"live.voice":{type:"enum",default:"sol",values:["arbor","breeze","cove","ember","juniper","maple","sol","spruce","vale"],ui:{tab:"providers",group:"Services",label:"Live Voice",description:"Voice used by Codex-backed realtime voice sessions",options:[{value:"arbor",label:"Arbor"},{value:"breeze",label:"Breeze"},{value:"cove",label:"Cove"},{value:"ember",label:"Ember"},{value:"juniper",label:"Juniper"},{value:"maple",label:"Maple"},{value:"sol",label:"Sol"},{value:"spruce",label:"Spruce"},{value:"vale",label:"Vale"}]}},"tts.localVoice":{type:"enum",default:"af_heart",values:["af_heart","af_bella","af_nicole","af_aoede","af_kore","af_sarah","am_michael","am_fenrir","am_puck","bf_emma","bm_george","bm_fable"],ui:{tab:"providers",group:"Services",label:"Local TTS Voice",description:"Kokoro voice used by the local TTS backend (American/British, female/male)",options:[{value:"af_heart",label:"Heart (American female)"},{value:"af_bella",label:"Bella (American female)"},{value:"af_nicole",label:"Nicole (American female)"},{value:"af_aoede",label:"Aoede (American female)"},{value:"af_kore",label:"Kore (American female)"},{value:"af_sarah",label:"Sarah (American female)"},{value:"am_michael",label:"Michael (American male)"},{value:"am_fenrir",label:"Fenrir (American male)"},{value:"am_puck",label:"Puck (American male)"},{value:"bf_emma",label:"Emma (British female)"},{value:"bm_george",label:"George (British male)"},{value:"bm_fable",label:"Fable (British male)"}]}},"tts.localSpeed":{type:"number",default:1,ui:{tab:"providers",group:"Services",label:"Local TTS Speed",description:"Speaking rate of the local TTS backend (tts tool, omp say). 1 = normal; clamped to 0.5–2.5",options:[{value:"0.5",label:"0.5×"},{value:"0.75",label:"0.75×"},{value:"1",label:"1× (normal)"},{value:"1.25",label:"1.25×"},{value:"1.5",label:"1.5×"},{value:"1.75",label:"1.75×"},{value:"2",label:"2×"},{value:"2.5",label:"2.5×"}]}},"speech.enabled":{type:"boolean",default:!1,ui:{tab:"providers",group:"Services",label:"Speech Vocalization",description:"Speak the assistant's output aloud through the speakers as it streams"}},"speech.mode":{type:"enum",default:"assistant",values:["all","assistant","yield"],ui:{tab:"providers",group:"Services",label:"Speech Vocalization Mode",description:"What to speak: all = assistant messages + thinking; assistant = messages only; yield = only the final message at turn end",options:[{value:"all",label:"All (messages + thinking)"},{value:"assistant",label:"Assistant messages"},{value:"yield",label:"Final message only"}]}},"speech.enhanced":{type:"boolean",default:!1,ui:{tab:"providers",group:"Services",label:"Enhanced Speech Rewriting",description:"Rewrite assistant output into natural spoken prose with the tiny/smol model before synthesis (describes code, drops links and markdown). Falls back to mechanical cleanup on failure"}},"speech.voice":{type:"enum",default:"af_heart",values:["af_heart","af_bella","af_nicole","af_aoede","af_kore","af_sarah","am_michael","am_fenrir","am_puck","bf_emma","bm_george","bm_fable"],ui:{tab:"providers",group:"Services",label:"Speech Vocalization Voice",description:"Kokoro voice used when speaking the assistant's output aloud",options:[{value:"af_heart",label:"Heart (American female)"},{value:"af_bella",label:"Bella (American female)"},{value:"af_nicole",label:"Nicole (American female)"},{value:"af_aoede",label:"Aoede (American female)"},{value:"af_kore",label:"Kore (American female)"},{value:"af_sarah",label:"Sarah (American female)"},{value:"am_michael",label:"Michael (American male)"},{value:"am_fenrir",label:"Fenrir (American male)"},{value:"am_puck",label:"Puck (American male)"},{value:"bf_emma",label:"Emma (British female)"},{value:"bm_george",label:"George (British male)"},{value:"bm_fable",label:"Fable (British male)"}]}},"speech.speed":{type:"number",default:1,ui:{tab:"providers",group:"Services",label:"Speech Vocalization Speed",description:"Speaking rate when reading the assistant's output aloud. 1 = normal; clamped to 0.5–2.5",options:[{value:"0.5",label:"0.5×"},{value:"0.75",label:"0.75×"},{value:"1",label:"1× (normal)"},{value:"1.25",label:"1.25×"},{value:"1.5",label:"1.5×"},{value:"1.75",label:"1.75×"},{value:"2",label:"2×"},{value:"2.5",label:"2.5×"}]}},"providers.fetch":{type:"enum",default:"auto",values:["auto","native","trafilatura","lynx","parallel","firecrawl","jina"],ui:{tab:"providers",group:"Services",label:"Fetch Provider",description:"Reader backend priority for the fetch/read URL tool",options:[{value:"auto",label:"Auto",description:"Priority: native > trafilatura > lynx > parallel > firecrawl > jina"},{value:"native",label:"Native",description:"In-process HTML→Markdown converter (always available)"},{value:"trafilatura",label:"Trafilatura",description:"Auto-installs via uv/pip"},{value:"lynx",label:"Lynx",description:"Requires lynx system package"},{value:"parallel",label:"Parallel",description:"Requires PARALLEL_API_KEY"},{value:"firecrawl",label:"Firecrawl",description:"Requires FIRECRAWL_API_KEY"},{value:"jina",label:"Jina",description:"Uses r.jina.ai reader (JINA_API_KEY optional)"}]}},"codexResets.autoRedeem":{type:"enum",default:"unset",values:["unset","yes","no"],ui:{tab:"providers",group:"Services",label:"Codex Auto-Redeem Saved Resets",description:"Spend saved Codex rate-limit resets automatically: restore an account blocked by an exhausted 5h or weekly window when a turn is stuck and no other account can take over, and salvage credits that are about to expire. unset asks before the first spend (with no prompt UI, it spends only a reset expiring within 5 minutes), yes spends without prompting, and no disables both checks.",options:[{value:"unset",label:"Unset",description:"Check eligibility, then ask before spending the first saved reset. With no prompt UI, spend only a reset expiring within 5 minutes."},{value:"yes",label:"Yes",description:"Spend eligible saved resets without prompting."},{value:"no",label:"No",description:"Do not run the saved-reset auto-redeem check."}]}},"codexResets.minBlockedMinutes":{type:"number",default:60,ui:{tab:"providers",group:"Services",label:"Codex Auto-Redeem Min Block",description:"Only auto-redeem when the natural unblock — the latest reset among the exhausted 5h/weekly windows — is at least this many minutes away (don't spend a scarce credit to save a short wait). Raise it (e.g. 360) to ignore 5h-only blocks."}},"codexResets.keepCredits":{type:"number",default:0,ui:{tab:"providers",group:"Services",label:"Codex Auto-Redeem Reserve",description:"Never auto-spend below this many saved resets (0 = the last credit may be spent automatically). Credits about to expire are exempt — a reserved credit that expires preserves nothing."}},"codexResets.salvageHorizonHours":{type:"number",default:12,ui:{tab:"providers",group:"Services",label:"Codex Reset Salvage Horizon",description:"With auto-redeem enabled, spend a saved Codex reset within this many hours of expiry when either chat window has meaningful usage. 0 disables early salvage; credits expiring within 5 minutes are still attempted regardless of usage."}},"claudeResets.autoRedeem":{type:"enum",default:"unset",values:["unset","yes","no"],ui:{tab:"providers",group:"Services",label:"Claude Auto-Redeem Resets",description:"Spend eligible Claude Cedar or Juniper resets automatically. Cedar is spent only for covered limits; Juniper can only recover a sole 5-hour block. unset asks before the first spend (with no prompt UI, it spends only a reset expiring within 5 minutes), yes spends without prompting, and no disables blocked recovery and expiry salvage.",options:[{value:"unset",label:"Unset",description:"Check live eligibility, then ask before spending the first Claude reset. With no prompt UI, spend only a reset expiring within 5 minutes."},{value:"yes",label:"Yes",description:"Spend eligible Claude resets without prompting."},{value:"no",label:"No",description:"Do not run Claude reset auto-redeem checks."}]}},"claudeResets.minBlockedMinutes":{type:"number",default:60,ui:{tab:"providers",group:"Services",label:"Claude Auto-Redeem Min Block",description:"Only auto-redeem when the natural unblock — the latest reset among the exhausted covered windows — is at least this many minutes away. A 5-hour-only reset is never used for a weekly or model-scoped block."}},"claudeResets.keepCredits":{type:"number",default:0,ui:{tab:"providers",group:"Services",label:"Claude Auto-Redeem Reserve",description:"Keep at least this many Claude resets banked (0 allows the last eligible reset to be spent automatically). The reserve applies to early salvage, but not to eligible resets expiring within 5 minutes."}},"claudeResets.salvageHorizonHours":{type:"number",default:12,ui:{tab:"providers",group:"Services",label:"Claude Reset Salvage Horizon",description:"With auto-redeem enabled, use a server-selected Cedar reset within this many hours of expiry when its covered windows have meaningful usage. 0 disables early salvage; eligible Cedar or Juniper resets expiring within 5 minutes are still attempted regardless of usage or reserve. Provider limit requirements still apply."}},"provider.appendOnlyContext":{type:"enum",default:"auto",values:["auto","on","off"],ui:{tab:"providers",group:"Protocol",label:"Append-Only Context",description:"Cache system prompt + tool specs and keep an append-only message log so provider prefix caches (DeepSeek, Xiaomi/SGLang, Anthropic) hit at maximum rate. Auto enables for known prefix-cache providers.",options:[{value:"auto",label:"Auto",description:"Enable for known prefix-cache providers (recommended)"},{value:"on",label:"On",description:"Always enable append-only context"},{value:"off",label:"Off",description:"Disable append-only context"}]}},"telemetry.otlpExportEnabled":{type:"boolean",default:!0,ui:{tab:"providers",group:"Privacy",label:"OTLP Telemetry Export",description:"Allow OMP to export traces, logs, and metrics using OTEL_* endpoints. Changes take effect on the next launch."}},"advisor.enabled":{type:"boolean",default:!1,ui:{tab:"model",group:"Advisor",label:"Enable Advisor",description:"Pair a second model (assigned to the 'advisor' role) that passively reviews each turn and injects notes."}},"advisor.syncBacklog":{type:"enum",default:"off",values:["off","1","3","5","strict"],ui:{tab:"model",group:"Advisor",label:"Advisor Sync Backlog",description:"Pause main agent until advisor backlog falls below threshold. Numeric values cap wait at 30 seconds; strict waits for all scheduled reviews without a wall-clock cap. Off disables catch-up delays. Abort, failure, and disposal release waits.",condition:"advisorEnabled"}},"advisor.immuneTurns":{type:"number",default:3,ui:{tab:"model",group:"Advisor",label:"Advisor Immune Turns",description:"After an advisor concern or blocker interrupts, route further concerns as non-interrupting asides for this many primary turns. Blockers are exempt from the cooldown.",options:[{value:"0",label:"0 steps",description:"No cooldown."},{value:"1",label:"1 step"},{value:"2",label:"2 steps"},{value:"3",label:"3 steps",description:"Default."},{value:"4",label:"4 steps"},{value:"5",label:"5 steps"}],condition:"advisorEnabled"}},"advisor.continueSeverity":{type:"enum",default:"concern",values:["nit","concern","blocker"],ui:{tab:"model",group:"Advisor",label:"Advisor Continue Severity",description:"Minimum severity of an advisor note that wakes the agent after it finished with a final answer. Lower-severity notes stay as a card at the end of the transcript and reach the agent with your next message.",options:[{value:"nit",label:"Nit",description:"Every note continues the run."},{value:"concern",label:"Concern",description:"Concerns and blockers continue the run. Default."},{value:"blocker",label:"Blocker",description:"Only blockers continue the run."}],condition:"advisorEnabled"}},"advisor.reviewMode":{type:"enum",default:"turn",values:["turn","agent-end"],ui:{tab:"model",group:"Advisor",label:"Advisor Review Mode",description:"Default advisor cadence when no WATCHDOG.yml roster is present. turn reviews every primary turn; agent-end reviews only final yields.",options:[{value:"turn",label:"Every turn",description:"Review every primary update (tool-call round)."},{value:"agent-end",label:"Agent end",description:"Review only at final yields (once per run)."}],condition:"advisorEnabled"}},"advisor.reviewInterval":{type:"number",default:1,ui:{tab:"model",group:"Advisor",label:"Advisor Review Interval",description:"Default advisor cadence when no WATCHDOG.yml roster is present: review every Nth eligible primary update. 1 = every update. Skipped updates are sent with the next scheduled review.",options:[{value:"1",label:"Every eligible update",description:"Default."},{value:"2",label:"Every 2nd"},{value:"3",label:"Every 3rd"},{value:"5",label:"Every 5th"},{value:"10",label:"Every 10th"}],condition:"advisorEnabled"}},"advisor.maxNotesPerUpdate":{type:"number",default:4,ui:{tab:"model",group:"Advisor",label:"Advisor Max Notes Per Update",description:"Maximum non-blocker advice notes accepted per advisor prompt update (1–32; UI offers 1–5 quick picks). Blockers are exempt.",options:[{value:"1",label:"1 note",description:"Anti-flood (strict)."},{value:"2",label:"2 notes"},{value:"3",label:"3 notes"},{value:"4",label:"4 notes",description:"Frontier reasoning models. Default."},{value:"5",label:"5 notes"}],condition:"advisorEnabled"}},"advisor.evictStaleResults":{type:"boolean",default:!0,ui:{tab:"model",group:"Advisor",label:"Advisor Evict Stale Results",description:"Before each review, replace the advisor's read/grep/glob output from older reviews with a short placeholder. The latest review is kept.",condition:"advisorEnabled"}},"workspace.additionalDirectories":{type:"array",default:[],ui:{tab:"context",group:"General",label:"Additional Workspace Dirs",description:"Extra workspace directories added to every session as additional roots (multi-root workspace). Managed live via /add-dir and /remove-dir. Paths resolve relative to cwd; absolute paths recommended. The agent is told these roots exist and can read/grep/glob them."}},"contextFiles.extra":{type:"array",default:[],ui:{tab:"context",group:"General",label:"Extra Context Files",editor:"json",description:'Extra instruction filenames loaded beside AGENTS.md. Use a JSON list of names, not paths, e.g. ["AGENTS.local.md"]; [] disables extras. Start a new session to load them.',condition:"contextFilesExtraNotProject"}},"contextPromotion.enabled":{type:"boolean",default:!1,ui:{tab:"context",group:"General",label:"Auto-Promote Context",description:"Promote to the model's contextPromotionTarget on context overflow instead of compacting. Retry fallback switches are controlled by Retry Model Fallback"}},extendedContext:{type:"boolean",default:!1,ui:{tab:"context",group:"General",label:"Extended Context",description:"Use larger context windows where supported; may incur premium pricing. Off keeps default or standard-pricing windows"}},"compaction.enabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Auto-Compact",description:"Automatically compact context when it gets too large"}},"compaction.experimentalContextManagement":{type:"boolean",default:!1,ui:{tab:"context",group:"Compaction",label:"Notes-backed context windows (experimental)",description:"Keep persistent notes and searchable raw history across context windows."}},"compaction.midTurnEnabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Mid-Turn Compaction",description:"Check thresholds at safe mid-turn tool-loop boundaries before the next provider request; subagents always check, since their whole assignment is one turn"}},"compaction.methodOrder":{type:"array",default:["remote","snapcompact","handoff","shake","soft"],ui:{tab:"context",group:"Compaction",label:"Compaction Method Order",description:"Preferred fallback order for automatic context maintenance; unavailable or failed methods advance to the next choice",options:[{value:"remote",label:"Server compaction",description:"Use provider-native server compaction (OpenAI Responses compact, Anthropic compaction beta, including on Bedrock) when the active route supports it"},{value:"snapcompact",label:"Snapcompact",description:"Archive history onto dense bitmap images the active vision model reads back; no LLM call"},{value:"handoff",label:"Handoff",description:"Generate a handoff document and continue from it as the compaction summary"},{value:"soft",label:"Soft compaction",description:"Summarize in place with a compaction model without using server compaction"},{value:"shake",label:"Shake",description:"Drop recoverable heavy content in place without an LLM call"}],ordered:!0}},"compaction.thresholdPercent":{type:"number",default:-1,ui:{tab:"context",group:"Compaction",label:"Compaction Threshold",description:"Percent threshold for context maintenance; set to Default to use legacy reserve-based behavior",options:[{value:"default",label:"Default",description:"Legacy reserve-based threshold"},{value:"10",label:"10%",description:"Extremely early maintenance"},{value:"20",label:"20%",description:"Very early maintenance"},{value:"30",label:"30%",description:"Early maintenance"},{value:"40",label:"40%",description:"Moderately early maintenance"},{value:"50",label:"50%",description:"Halfway point"},{value:"60",label:"60%",description:"Moderate context usage"},{value:"70",label:"70%",description:"Balanced"},{value:"75",label:"75%",description:"Slightly aggressive"},{value:"80",label:"80%",description:"Typical threshold"},{value:"85",label:"85%",description:"Aggressive context usage"},{value:"90",label:"90%",description:"Very aggressive"},{value:"95",label:"95%",description:"Near context limit"}]}},"compaction.thresholdTokens":{type:"number",default:-1,ui:{tab:"context",group:"Compaction",label:"Compaction Token Limit",description:"Fixed token limit for context maintenance; overrides percentage if set",options:[{value:"default",label:"Default",description:"Use percentage-based threshold"},{value:"25000",label:"25K tokens",description:"1/8 of a 200K window"},{value:"50000",label:"50K tokens",description:"1/4 of a 200K window"},{value:"100000",label:"100K tokens",description:"1/2 of a 200K window"},{value:"150000",label:"150K tokens",description:"3/4 of a 200K window"},{value:"200000",label:"200K tokens",description:"Full standard context window"},{value:"300000",label:"300K tokens",description:"Large context window"},{value:"500000",label:"500K tokens",description:"Very large context window"}]}},"compaction.handoffSaveToDisk":{type:"boolean",default:!1,ui:{tab:"context",group:"Compaction",label:"Save Handoff Docs",description:"Save generated handoff documents to markdown files for the auto-handoff flow"}},"compaction.remoteStreamingV2Enabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Remote Compaction V2",description:"Use Responses streaming compaction for compatible remote compaction models"}},"compaction.asyncEnabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Async Compaction",description:"Speculatively summarize in the background as context nears the compaction threshold, then splice the ready result in when the threshold is crossed"}},"compaction.idleEnabled":{type:"boolean",default:!1,ui:{tab:"context",group:"Compaction",label:"Idle Compaction",description:"Compact context while idle when token count exceeds threshold"}},"compaction.idleThresholdTokens":{type:"number",default:200000,ui:{tab:"context",group:"Compaction",label:"Idle Compaction Threshold",description:"Token count above which idle compaction triggers",options:[{value:"100000",label:"100K tokens"},{value:"200000",label:"200K tokens"},{value:"300000",label:"300K tokens"},{value:"400000",label:"400K tokens"},{value:"500000",label:"500K tokens"},{value:"600000",label:"600K tokens"},{value:"700000",label:"700K tokens"},{value:"800000",label:"800K tokens"},{value:"900000",label:"900K tokens"}]}},"compaction.idleTimeoutSeconds":{type:"number",default:300,ui:{tab:"context",group:"Compaction",label:"Idle Compaction Delay",description:"Seconds to wait while idle before compacting; with a 1-hour prompt cache, compaction instead runs just before the cache expires",options:[{value:"60",label:"1 minute"},{value:"120",label:"2 minutes"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"},{value:"1800",label:"30 minutes"},{value:"3600",label:"1 hour"}]}},"compaction.supersedeReads":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Supersede Stale Reads",description:"Prune older read results when the same file is read again (cache-aware, runs every turn)"}},"compaction.dropUseless":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Elide Uneventful Results",description:"Prune tool results flagged contextually useless (no matches, timed-out waits) once consumed (cache-aware)"}},"snapcompact.systemPrompt":{type:"enum",default:"none",values:["none","agents-md","all"],ui:{tab:"context",group:"Experimental",label:"Snapcompact System Prompt",description:"Experimental: render selected system prompt text as dense PNG image(s) and attach to the first user message (vision models only). Saves tokens; loses prompt caching for imaged text.",options:[{value:"none",label:"None",description:"Keep the system prompt as text."},{value:"agents-md",label:"AGENTS.md",description:"Only move loaded context-file instructions to images, when that saves tokens."},{value:"all",label:"All",description:"Move the full system prompt to images, when that saves tokens."}]}},"snapcompact.toolResults":{type:"boolean",default:!1,ui:{tab:"context",group:"Experimental",label:"Snapcompact Tool Results",description:"Experimental: render large tool results, the newest one included, as dense PNG image(s) instead of text (vision models only). Saves tokens on accumulated search and command output; read results stay text unless the model is known to edit exactly from images."}},"tools.format":{type:"enum",default:"auto",values:["auto","native","glm","hermes","kimi","xml","anthropic","deepseek","harmony","qwen3","gemini","gemma","minimax"],ui:{tab:"context",group:"Experimental",label:"Tool Calling Mode",description:"Controls how tools are exposed to the model. Auto uses provider-native tool calls unless the selected model is marked as not supporting them, then falls back to the GLM owned dialect. Native forces provider-native tools; the other values force the named owned dialect.",options:[{value:"auto",label:"Auto",description:"Use native tool calls unless the model is known not to support them."},{value:"native",label:"Native",description:"Use provider-native tool calls."},{value:"glm",label:"GLM",description:"Use GLM-style in-band tool calls."},{value:"hermes",label:"Hermes",description:"Use Hermes-style in-band tool calls."},{value:"kimi",label:"Kimi",description:"Use Kimi-style in-band tool calls."},{value:"xml",label:"XML",description:"Use generic XML in-band tool calls."},{value:"anthropic",label:"Anthropic",description:"Use Anthropic-style in-band tool calls."},{value:"deepseek",label:"DeepSeek",description:"Use DeepSeek-style in-band tool calls."},{value:"harmony",label:"Harmony",description:"Use Harmony-style in-band tool calls."},{value:"qwen3",label:"Qwen3",description:"Use the Qwen3 owned dialect."},{value:"gemini",label:"Gemini",description:"Use the Gemini owned dialect."},{value:"gemma",label:"Gemma",description:"Use the Gemma owned dialect."},{value:"minimax",label:"MiniMax",description:"Use the MiniMax owned dialect."}]}},"snapcompact.shape":{type:"enum",default:"auto",values:["auto","8x8r-bw","8x8r-sent","8x8u-bw","8x8u-sent","6x6u-bw","6x6u-sent","5x8-bw","5x8-sent","6x12-dim","8x13-bw","8on16-bw","8on22-bw","11on16-bw","silver16-bw","doc-8on16-bw","doc-8on16-sent","doc-8on16-sent-dim"],ui:{tab:"context",group:"Experimental",label:"Snapcompact Shape",description:"Frame shape snapcompact prints text with (compaction archive and inline imaging). Auto picks a shape tuned for the current model.",options:[{value:"auto",label:"Auto",description:"Picks a shape tuned for the current model, falling back to its provider family."},{value:"8x8r-bw",label:"8x8 repeated, black",description:"unscii square cell, black ink, every line printed twice with the copy on a pale highlight band."},{value:"8x8r-sent",label:"8x8 repeated, sentence hues",description:"Repeated grid with ink cycling six hues at sentence boundaries."},{value:"8x8u-bw",label:"8x8, black",description:"Plain unscii square cell, single-printed lines, black ink."},{value:"8x8u-sent",label:"8x8, sentence hues",description:"Plain unscii square cell with sentence-hue ink."},{value:"6x6u-bw",label:"6x6 dense, black",description:"unscii squeezed to 6x6 — densest readable cell, fewest frames — in black ink."},{value:"6x6u-sent",label:"6x6 dense, sentence hues",description:"Densest cell with sentence-hue ink."},{value:"5x8-bw",label:"5x8 legacy, black",description:"Original X.org 5x8 glyphs on the 2576px frame, black ink."},{value:"5x8-sent",label:"5x8 legacy, sentence hues",description:"The original snapcompact shape (pre-shape-table sessions rendered this)."},{value:"6x12-dim",label:"6x12, dimmed stopwords",description:"X.org 6x12 glyphs, black ink, function words dimmed gray."},{value:"8x13-bw",label:"8x13, black",description:"X.org 8x13 glyphs, black ink."},{value:"8on16-bw",label:"8x13 on 16px pitch, black",description:"8x13 glyphs on an 8x16 cell (extra leading), black ink."},{value:"8on22-bw",label:"8x13 on 22px pitch (leading), black",description:"8x13 glyphs on an 8x22 cell — extra line spacing so rows don't crowd. Default for OpenAI/Google."},{value:"11on16-bw",label:"8x13 on 11px advance (tracking), black",description:"8x13 glyphs on an 11x16 cell — extra letter spacing so characters don't merge. Default for Anthropic."},{value:"silver16-bw",label:"Silver 16, CJK",description:"Embedded Silver TrueType font on a 16px grid for CJK and other non-Latin text."},{value:"doc-8on16-bw",label:"Doc 8on16, black",description:"Two word-wrapped newspaper columns of 8x13 glyphs on a 16px pitch, black ink."},{value:"doc-8on16-sent",label:"Doc 8on16, sentence hues",description:"Two-column doc layout with sentence-hue ink."},{value:"doc-8on16-sent-dim",label:"Doc 8on16, sentence hues + dimmed stopwords",description:"Two-column doc layout, sentence-hue ink, function words dimmed gray."}]}},"branchSummary.enabled":{type:"boolean",default:!1,ui:{tab:"context",group:"General",label:"Branch Summaries",description:"Prompt to summarize when leaving a branch"}},"memory.backend":{type:"enum",default:"off",values:["off","local","hindsight","mnemopi","sharpshooter"],ui:{tab:"memory",group:"General",label:"Memory Backend",description:"Off, local summary pipeline, Mnemopi SQLite, Hindsight remote memory, or Sharpshooter",options:[{value:"off",label:"Off",description:"No memory subsystem runs"},{value:"local",label:"Local",description:"Local rollout summarisation pipeline (memory_summary.md)"},{value:"hindsight",label:"Hindsight",description:"Vectorize Hindsight remote memory service"},{value:"mnemopi",label:"Mnemopi",description:"Local SQLite recall/retain backend with optional embeddings"},{value:"sharpshooter",label:"Sharpshooter",description:"Friction-gated project decision files (architecture/product/style), consolidated in the background"}]}},"sharpshooter.model":{type:"string",ui:{tab:"memory",group:"Sharpshooter",label:"Sharpshooter Model",description:"Model selector for extraction/consolidation, empty = smol role"}},"autolearn.enabled":{type:"boolean",default:!1,ui:{tab:"memory",group:"Auto-Learn",label:"Auto-Learn (experimental)",description:"After the agent stops, nudge it to capture lessons to memory and create/enhance isolated managed skills"}},"autolearn.autoContinue":{type:"boolean",default:!1,ui:{tab:"memory",group:"Auto-Learn",label:"Auto-run capture at stop",description:"When on, auto-run one private capture turn at stop (uses extra tokens). When off, only standing auto-learn guidance remains.",condition:"autolearnActive"}},"mnemopi.dbPath":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi DB Path",description:"Optional SQLite DB path. Defaults to the agent memories directory.",condition:"mnemopiActive"}},"mnemopi.bank":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Bank",description:"Optional shared bank base name. Per-project modes derive project-local banks from it.",condition:"mnemopiActive"}},"mnemopi.scoping":{type:"enum",default:"per-project",values:["global","per-project","per-project-tagged"],ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Scoping",description:"global = one shared bank; per-project = isolated bank per cwd; per-project-tagged = project-local writes plus global recall visibility",options:[{value:"global",label:"Global",description:"One shared Mnemopi bank for every project"},{value:"per-project",label:"Per project",description:"Project-local Mnemopi bank per cwd basename"},{value:"per-project-tagged",label:"Per project (tagged)",description:"Write to a project-local bank but merge project + shared recall results"}],condition:"mnemopiActive"}},"mnemopi.embeddingVariant":{type:"enum",default:"en",values:["en","multilingual"],ui:{tab:"memory",group:"Mnemopi",label:"Embedding variant",description:"Local embedding model family. en = stronger English model; multilingual = cross-language model. Changing this rebuilds existing memory embeddings on next start.",options:[{value:"en",label:"English (bge-base-en-v1.5)",description:"BAAI/bge-base-en-v1.5 (768d), English-only"},{value:"multilingual",label:"Multilingual (multilingual-e5-large)",description:"intfloat/multilingual-e5-large (1024d), cross-language recall"}],condition:"mnemopiActive"}},"mnemopi.autoRecall":{type:"boolean",default:!0,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Auto Recall",description:"Recall local memories into the first turn of each session",condition:"mnemopiActive"}},"mnemopi.autoRetain":{type:"boolean",default:!0,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Auto Retain",description:"Retain completed conversation turns into local Mnemopi memory",condition:"mnemopiActive"}},"mnemopi.polyphonicRecall":{type:"boolean",default:!1,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Polyphonic Recall",description:"Fuse recall with graph, fact, vector and temporal voices so linked memories surface without a keyword match",condition:"mnemopiActive"}},"mnemopi.enhancedRecall":{type:"boolean",default:!1,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Enhanced Recall",description:"Cache recall results for repeated and similar queries with identical options; any memory write clears it",condition:"mnemopiActive"}},"mnemopi.proactiveLinking":{type:"boolean",default:!1,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Proactive Linking",description:"Ingest new memories into the episodic graph as they are stored, linking them to related entities and memories",condition:"mnemopiActive"}},"mnemopi.noEmbeddings":{type:"boolean",default:!1,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Disable Embeddings",description:"Force deterministic FTS-only recall instead of vector embeddings",condition:"mnemopiActive"}},"mnemopi.embeddingModel":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Embedding Model",description:"Advanced: explicit embedding model id that overrides the variant. Leave empty to use mnemopi.embeddingVariant.",condition:"mnemopiActive"}},"mnemopi.embeddingApiUrl":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Embedding API URL",description:"Optional OpenAI-compatible embedding endpoint passed to Mnemopi",condition:"mnemopiActive"}},"mnemopi.embeddingApiKey":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Embedding API Key",description:"Optional embedding API key passed to Mnemopi",condition:"mnemopiActive"}},"mnemopi.llmMode":{type:"enum",default:"smol",values:["none","smol","remote"],ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi LLM Mode",description:"Use no LLM, the online tiny model (the TINY role from /models, else @smol), or a remote OpenAI-compatible endpoint",condition:"mnemopiActive",options:[{value:"none",label:"None",description:"Disable Mnemopi LLM-backed extraction"},{value:"smol",label:"Online (tiny)",description:"Use the online tiny model (the TINY role from /models, else @smol)"},{value:"remote",label:"Remote",description:"Use the Mnemopi remote LLM settings below"}]}},"mnemopi.llmBaseUrl":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi LLM Base URL",description:"Optional OpenAI-compatible LLM endpoint for Mnemopi remote mode",condition:"mnemopiActive"}},"mnemopi.llmApiKey":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi LLM API Key",description:"Optional LLM API key for Mnemopi remote mode",condition:"mnemopiActive"}},"mnemopi.llmModel":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi LLM Model",description:"Optional LLM model name for Mnemopi remote mode",condition:"mnemopiActive"}},"hindsight.apiUrl":{type:"string",default:"http://localhost:8888",ui:{tab:"memory",group:"Hindsight",label:"Hindsight API URL",description:"Hindsight server URL (Cloud or self-hosted)",condition:"hindsightActive"}},"hindsight.apiToken":{type:"string",ui:{tab:"memory",group:"Hindsight",label:"Hindsight API Token",description:"Bearer token for authenticated Hindsight servers",condition:"hindsightActive"}},"hindsight.bankId":{type:"string",ui:{tab:"memory",group:"Hindsight",label:"Hindsight Bank ID",description:"Memory bank identifier (default: project name)",condition:"hindsightActive"}},"hindsight.scoping":{type:"enum",default:"per-project-tagged",values:["global","per-project","per-project-tagged"],ui:{tab:"memory",group:"Hindsight",label:"Hindsight Scoping",description:"global = one shared bank; per-project = isolated bank per cwd; per-project-tagged = shared bank with project tags so global + project memories merge on recall",options:[{value:"global",label:"Global",description:"One shared bank — every project sees the same memories"},{value:"per-project",label:"Per project",description:"Isolated bank per cwd basename — projects cannot see each other's memories"},{value:"per-project-tagged",label:"Per project (tagged)",description:"Shared bank, retains tagged with project:<cwd>. Recall surfaces project + untagged global memories together"}],condition:"hindsightActive"}},"hindsight.autoRecall":{type:"boolean",default:!0,ui:{tab:"memory",group:"Hindsight",label:"Hindsight Auto Recall",description:"Recall memories on the first turn of each session",condition:"hindsightActive"}},"hindsight.autoRetain":{type:"boolean",default:!0,ui:{tab:"memory",group:"Hindsight",label:"Hindsight Auto Retain",description:"Retain transcript every N turns and at session boundaries",condition:"hindsightActive"}},"hindsight.retainMode":{type:"enum",default:"full-session",values:["full-session","last-turn"],ui:{tab:"memory",group:"Hindsight",label:"Hindsight Retain Mode",description:"full-session = upsert one document per session, last-turn = chunked",options:[{value:"full-session",label:"Full session",description:"Upsert one document per session (recommended)"},{value:"last-turn",label:"Last turn",description:"Chunked retention sliced by turn boundaries"}],condition:"hindsightActive"}},"hindsight.mentalModelsEnabled":{type:"boolean",default:!0,ui:{tab:"memory",group:"Hindsight",label:"Hindsight Mental Models",description:"Read curated reflect summaries (mental models) into developer instructions at boot. Loads existing models on the bank — does not write. Pair with hindsight.mentalModelAutoSeed to also auto-create the built-in seed set.",condition:"hindsightActive"}},"hindsight.mentalModelAutoSeed":{type:"boolean",default:!0,ui:{tab:"memory",group:"Hindsight",label:"Hindsight Mental Model Auto-Seed",description:"At session start, create any built-in mental models (project-conventions, project-decisions, user-preferences) that do not yet exist on the bank.",condition:"hindsightActive"}},"ttsr.enabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR",description:"Interrupt the agent mid-stream when output matches rule patterns (Time-Traveling Stream Rules)"}},"ttsr.judge":{type:"enum",default:"auto",values:["auto","on","off"],ui:{tab:"context",group:"Rules (TTSR)",label:"Judged Rules",description:"Ask the judge model role each `question` rule about completed replies, reasoning, and tool calls; a yes injects the rule as a warning",options:[{value:"auto",label:"Auto",description:"Judge only when the judge role resolves to a native TypeSafe jev model"},{value:"on",label:"On",description:"Always judge, whichever model the judge role resolves to"},{value:"off",label:"Off",description:"Never judge; question rules stay inactive"}]}},"ttsr.contextMode":{type:"enum",default:"discard",values:["discard","keep"],ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR Context Mode",description:"What to do with partial output when TTSR triggers"}},"ttsr.interruptMode":{type:"enum",default:"always",values:["never","prose-only","tool-only","always"],ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR Interrupt Mode",description:"When to interrupt mid-stream vs inject warning after completion",options:[{value:"always",label:"always",description:"Interrupt on prose and tool streams"},{value:"prose-only",label:"prose-only",description:"Interrupt only on reply/thinking matches"},{value:"tool-only",label:"tool-only",description:"Interrupt only on tool-call argument matches"},{value:"never",label:"never",description:"Never interrupt; inject warning after completion"}]}},"ttsr.repeatMode":{type:"enum",default:"once",values:["once","after-gap"],ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR Repeat Mode",description:"How rules can repeat: once per session or after a message gap"}},"ttsr.repeatGap":{type:"number",default:10,ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR Repeat Gap",description:"Messages before a rule can trigger again",options:[{value:"5",label:"5 messages"},{value:"10",label:"10 messages"},{value:"15",label:"15 messages"},{value:"20",label:"20 messages"},{value:"30",label:"30 messages"}]}},"ttsr.builtinRules":{type:"boolean",default:!0,ui:{tab:"context",group:"Rules (TTSR)",label:"Built-in Rules",description:"Load the default rules shipped with the agent (override individually with ttsr.disabledRules)"}},"ttsr.disabledRules":{type:"array",default:[],ui:{tab:"context",group:"Rules (TTSR)",label:"Disabled Rules",description:"Rule names to ignore entirely (applies to bundled defaults and your own rules)"}},"edit.mode":{type:"enum",default:"hashline",values:["apply_patch","hashline","patch","replace","sloppy"],ui:{tab:"files",group:"Editing",label:"Edit Mode",description:"Select the edit tool variant (replace, patch, hashline, or apply_patch)"}},"edit.fuzzyMatch":{type:"boolean",default:!0,ui:{tab:"files",group:"Editing",label:"Fuzzy Match",description:"Accept high-confidence fuzzy matches for whitespace differences"}},"edit.fuzzyThreshold":{type:"number",default:0.95,ui:{tab:"files",group:"Editing",label:"Fuzzy Match Threshold",description:"Similarity threshold (0-1) for accepting fuzzy matches",options:[{value:"0.85",label:"0.85",description:"Lenient"},{value:"0.90",label:"0.90",description:"Moderate"},{value:"0.95",label:"0.95",description:"Default"},{value:"0.98",label:"0.98",description:"Strict"}]}},"edit.streamingAbort":{type:"boolean",default:!1,ui:{tab:"files",group:"Editing",label:"Abort on Failed Preview",description:"Abort streaming edit tool calls when patch preview fails"}},"edit.recoverInlineEdits":{type:"boolean",default:!0,ui:{tab:"files",group:"Editing",label:"Recover Inline Edit Payloads",description:"Execute edit payloads the model emits as plain text by converting them into edit tool calls"}},"edit.blockAutoGenerated":{type:"boolean",default:!0,ui:{tab:"files",group:"Editing",label:"Block Auto-Generated Files",description:"Prevent editing of files that appear to be auto-generated (protoc, sqlc, swagger, etc.)"}},"edit.enforceSeenLines":{type:"boolean",default:!0,ui:{tab:"files",group:"Editing",label:"Enforce Seen-Line Guard",description:"Reject edits anchored on lines a prior read/search never displayed in full"}},"edit.blackbox.enabled":{type:"boolean",default:!1,ui:{tab:"files",group:"Editing",label:"Record Parse Regressions",description:"Append full before/after source when an edit introduces an AST parse failure"}},"edit.autoRepair.enabled":{type:"boolean",default:!1,ui:{tab:"files",group:"Editing",label:"Auto-Repair Parse Regressions",description:"When an edit breaks a file's AST parse, ask the smol model to fix the broken region (validated by re-parse; falls back to a warning)"}},"tools.artifactSpillThreshold":{type:"number",default:50,ui:{tab:"tools",group:"Output Limits",label:"Artifact Spill Threshold (KB)",description:"Tool output above this size is saved as an artifact; tail is kept inline",options:[{value:"1",label:"1 KB",description:"~250 tokens"},{value:"2.5",label:"2.5 KB",description:"~625 tokens"},{value:"5",label:"5 KB",description:"~1.25K tokens"},{value:"10",label:"10 KB",description:"~2.5K tokens"},{value:"20",label:"20 KB",description:"~5K tokens"},{value:"30",label:"30 KB",description:"~7.5K tokens"},{value:"50",label:"50 KB",description:"Default; ~12.5K tokens"},{value:"75",label:"75 KB",description:"~19K tokens"},{value:"100",label:"100 KB",description:"~25K tokens"},{value:"200",label:"200 KB",description:"~50K tokens"},{value:"500",label:"500 KB",description:"~125K tokens"},{value:"1000",label:"1 MB",description:"~250K tokens"}]}},"tools.artifactTailBytes":{type:"number",default:20,ui:{tab:"tools",group:"Output Limits",label:"Artifact Tail Size (KB)",description:"Amount of tail content kept inline when output spills to artifact",options:[{value:"1",label:"1 KB",description:"~250 tokens"},{value:"2.5",label:"2.5 KB",description:"~625 tokens"},{value:"5",label:"5 KB",description:"~1.25K tokens"},{value:"10",label:"10 KB",description:"~2.5K tokens"},{value:"20",label:"20 KB",description:"Default; ~5K tokens"},{value:"50",label:"50 KB",description:"~12.5K tokens"},{value:"100",label:"100 KB",description:"~25K tokens"},{value:"200",label:"200 KB",description:"~50K tokens"}]}},"tools.artifactHeadBytes":{type:"number",default:20,ui:{tab:"tools",group:"Output Limits",label:"Artifact Head Size (KB)",description:"Amount of head content kept inline alongside the tail when output spills to artifact (middle elision). 0 disables — keep tail only.",options:[{value:"0",label:"0 KB",description:"Disabled; tail-only truncation"},{value:"1",label:"1 KB",description:"~250 tokens"},{value:"2.5",label:"2.5 KB",description:"~625 tokens"},{value:"5",label:"5 KB",description:"~1.25K tokens"},{value:"10",label:"10 KB",description:"~2.5K tokens"},{value:"20",label:"20 KB",description:"Default; ~5K tokens"},{value:"50",label:"50 KB",description:"~12.5K tokens"},{value:"100",label:"100 KB",description:"~25K tokens"},{value:"200",label:"200 KB",description:"~50K tokens"}]}},"tools.outputMaxColumns":{type:"number",default:768,ui:{tab:"tools",group:"Output Limits",label:"Output Column Cap",description:"Per-line byte cap for streaming tool outputs (bash, python, js eval) and `read`. Lines wider than this are ellipsis-truncated; remaining bytes up to the next newline are dropped. 0 disables.",options:[{value:"0",label:"Off",description:"No per-line cap"},{value:"256",label:"256",description:"Tight"},{value:"512",label:"512"},{value:"768",label:"768",description:"Default"},{value:"1024",label:"1024"},{value:"2048",label:"2048"},{value:"4096",label:"4096",description:"Loose"}]}},"tools.artifactTailLines":{type:"number",default:500,ui:{tab:"tools",group:"Output Limits",label:"Artifact Tail Lines",description:"Maximum lines of tail content kept inline when output spills to artifact",options:[{value:"50",label:"50 lines",description:"~250 tokens"},{value:"100",label:"100 lines",description:"~500 tokens"},{value:"250",label:"250 lines",description:"~1.25K tokens"},{value:"500",label:"500 lines",description:"Default; ~2.5K tokens"},{value:"1000",label:"1000 lines",description:"~5K tokens"},{value:"2000",label:"2000 lines",description:"~10K tokens"},{value:"5000",label:"5000 lines",description:"~25K tokens"}]}},"tools.artifactMaxBytes":{type:"number",default:16,ui:{tab:"tools",group:"Output Limits",label:"Artifact File Cap (MB)",description:"Maximum size of the artifact file saved for streaming tool output (bash, python, js eval). Larger output keeps its beginning (up to 3 MB) and its most recent remainder, with a truncation notice between them. 0 = unlimited.",options:[{value:"0",label:"Unlimited",description:"Save the complete output"},{value:"4",label:"4 MB"},{value:"16",label:"16 MB",description:"Default"},{value:"64",label:"64 MB"},{value:"256",label:"256 MB"},{value:"1024",label:"1 GB"}]}},readLineNumbers:{type:"boolean",default:!1,ui:{tab:"files",group:"Reading",label:"Line Numbers",description:"Prepend line numbers to read tool output by default"}},"read.defaultLimit":{type:"number",default:300,ui:{tab:"files",group:"Reading",label:"Default Read Limit",description:"Default number of lines returned when agent calls read without a limit",options:[{value:"200",label:"200 lines"},{value:"300",label:"300 lines"},{value:"500",label:"500 lines"},{value:"1000",label:"1000 lines"},{value:"5000",label:"5000 lines"}]}},"read.renderMarkdown":{type:"boolean",default:!1,ui:{tab:"files",group:"Reading",label:"Markdown Previews",description:"Render Markdown read results as formatted terminal Markdown previews instead of raw source"}},"read.summarize.enabled":{type:"boolean",default:!0,ui:{tab:"files",group:"Read Summaries",label:"Read Summaries",description:"Return structural code summaries when read is called without an explicit selector"}},"read.summarize.prose":{type:"boolean",default:!1,ui:{tab:"files",group:"Read Summaries",label:"Prose Summaries",description:"Return structural summaries for Markdown and plain text reads"}},"read.summarize.minBodyLines":{type:"number",default:4,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Body Lines",description:"Minimum multiline body or literal length before read summaries collapse it"}},"read.summarize.minCommentLines":{type:"number",default:6,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Comment Lines",description:"Minimum multiline block comment length before read summaries collapse it"}},"read.summarize.minTotalLines":{type:"number",default:100,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Minimum File Length",description:"Files with fewer total lines are read verbatim instead of structurally summarized"}},"read.summarize.unfoldUntil":{type:"number",default:50,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Unfold Target",description:"BFS-unfold elidable spans until the summary is at least this many visible lines. 0 keeps only the outermost elisions."}},"read.summarize.unfoldLimit":{type:"number",default:100,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Unfold Ceiling",description:"Hard ceiling on summary size while BFS-unfolding. An unfold whose revealed lines would exceed this is skipped (that span stays folded) and unfolding continues with the remaining spans."}},"read.toolResultPreview":{type:"boolean",default:!1,ui:{tab:"files",group:"Reading",label:"Inline Read Previews",description:"Render read tool results inline in the transcript instead of summary rows"}},"tools.approval":{type:"record",default:{},ui:{tab:"interaction",group:"Approvals",label:"Tool Approval Policies",description:"Per-tool approval policies. Set to 'allow' to auto-approve, 'prompt' to require confirmation, or 'deny' to block. Overrides are honored in every approval mode."}},"tools.approvalMode":{type:"enum",default:"yolo",values:["always-ask","always-ask-cached","write","yolo"],ui:{tab:"interaction",group:"Approvals",label:"Tool Approval",description:"Default approval behavior for tool calls. 'Always ask' auto-approves read-only tools only. 'Ask and remember' also asks before file reads, and can remember a file or folder. 'Write' auto-approves read and workspace-write tools. 'Yolo' auto-approves all tiers; user policy may still prompt or block.",options:[{value:"always-ask",label:"Always ask",description:"Auto-approve read-only tools; require confirmation for write and exec tools."},{value:"always-ask-cached",label:"Ask and remember",description:"Ask before reading or writing a file, with answers that remember the file or its folder for this session or every session; require confirmation for exec tools."},{value:"write",label:"Write",description:"Auto-approve read-only and write tools; require confirmation for exec tools such as bash, eval, browser, and task."},{value:"yolo",label:"Yolo",description:"Auto-approve read, write, and exec tools. User policy can still require confirmation or block calls."}]}},"todo.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Todos",description:"Enable the todo tool for task tracking"}},"todo.reminders":{type:"boolean",default:!0,ui:{tab:"tools",group:"Todos",label:"Todo Reminders",description:"Remind the agent to complete todos before stopping"}},"todo.remindersMax":{type:"number",default:3,ui:{tab:"tools",group:"Todos",label:"Todo Reminder Limit",description:"Maximum number of todo reminders before giving up",options:[{value:"1",label:"1 reminder"},{value:"2",label:"2 reminders"},{value:"3",label:"3 reminders"},{value:"5",label:"5 reminders"}]}},"todo.eager":{type:"enum",default:"default",values:["default","preferred","always"],ui:{tab:"tools",group:"Todos",label:"Create Todos Automatically",description:"How strongly to push automatic todo-list creation after the first message",options:[{value:"default",label:"Default",description:"Model decides; no automatic todo list"},{value:"preferred",label:"Preferred",description:"Suggests a todo list on the first message (reminder, not forced)"},{value:"always",label:"Always",description:"Forces a comprehensive todo list on the first message"}]}},"tasks.todoClearDelay":{type:"number",default:60,ui:{tab:"tools",group:"Todos",label:"Todo Auto-Clear Delay",description:"Delay before completed or abandoned todos are removed from the todo widget",options:[{value:"0",label:"Instant"},{value:"60",label:"1 minute",description:"Default"},{value:"300",label:"5 minutes"},{value:"900",label:"15 minutes"},{value:"1800",label:"30 minutes"},{value:"3600",label:"1 hour"},{value:"-1",label:"Never"}]}},"glob.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Glob",description:"Enable the glob tool for glob-based file lookup"}},"grep.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Grep",description:"Enable the grep tool for regex content search"}},"grep.contextBefore":{type:"number",default:1,ui:{tab:"tools",group:"Grep & Browser",label:"Grep Context Before",description:"Lines of context before each grep match",options:[{value:"0",label:"0 lines"},{value:"1",label:"1 line"},{value:"2",label:"2 lines"},{value:"3",label:"3 lines"},{value:"5",label:"5 lines"}]}},"grep.contextAfter":{type:"number",default:3,ui:{tab:"tools",group:"Grep & Browser",label:"Grep Context After",description:"Lines of context after each grep match",options:[{value:"0",label:"0 lines"},{value:"1",label:"1 line"},{value:"2",label:"2 lines"},{value:"3",label:"3 lines"},{value:"5",label:"5 lines"},{value:"10",label:"10 lines"}]}},"astGrep.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"AST Grep",description:"Enable the ast_grep tool for structural AST search"}},"astEdit.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"AST Edit",description:"Enable the ast_edit tool for structural AST rewrites"}},"find.enabled":{type:"enum",default:"auto",values:["auto","on","off"],ui:{tab:"tools",group:"Available Tools",label:"Find (semantic grep)",description:"Enable the find tool: natural-language search for files and line ranges, judged by the judge model role. Auto enables it only when the judge role resolves to a native TypeSafe jev model",options:[{value:"auto",label:"Auto",description:"Enable when the judge role resolves to a native TypeSafe jev model"},{value:"on",label:"On",description:"Always enable, whichever model the judge role resolves to"},{value:"off",label:"Off",description:"Disable the find tool"}]}},"debug.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Debug",description:"Enable the debug tool for DAP-based debugging"}},"launch.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Services",description:"Enable named bash services and proc:// supervision for shared long-running project processes"}},"speechgen.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Speech Generation",description:"Enable the tts tool for on-device (Kokoro) or xAI Grok Voice speech-file synthesis"}},"generate_image.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Generate Image",description:"Enable the generate_image tool (text-to-image generation and editing). Exposed as an xd:// device when tools.xdev is on."}},"computer.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Computer",description:"Enable the scriptable host-desktop eval prelude (screenshots, input, accessibility)"}},"ratchet.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Ratchet",description:"Enable the ratchet eval/hillclimb prelude; /ratchet turns it on for the current session"}},"archive.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Archive",description:"Enable the read-only archive eval prelude: prompt history, recent projects, past sessions and recaps"}},"computer.display":{type:"string",default:"active",ui:{tab:"tools",group:"Computer",label:"Computer Display",description:"Active window's display (active), all displays (all), or a native display id"}},"computer.maxWidth":{type:"number",default:3840,ui:{tab:"tools",group:"Computer",label:"Computer Screenshot Width",description:"Maximum screenshot width in pixels"}},"computer.maxHeight":{type:"number",default:2400,ui:{tab:"tools",group:"Computer",label:"Computer Screenshot Height",description:"Maximum screenshot height in pixels"}},"computer.backgroundFallback":{type:"enum",default:"takeover",values:["takeover","refuse"],ui:{tab:"tools",group:"Computer",label:"Computer Background Fallback",description:"What window input does when its background route is unavailable: rerun it in takeover and return focus to your app (macOS; elsewhere plain takeover), or refuse, which also keeps the agent from taking the foreground or opening macOS menus itself",options:[{value:"takeover",label:"Takeover",description:"Briefly bring the target forward for that one call, then return focus to your app (on macOS even if you kept typing)"},{value:"refuse",label:"Refuse",description:"Fail the call; nothing takes over, and the agent's own takeover, raise, activating open, desktop input and macOS menus (context menus, popup and menu buttons; they take your keyboard while open) are refused too"}]}},"images.questionTimeoutMs":{type:"number",default:300000,ui:{tab:"tools",group:"Execution",label:"Image Question Timeout",description:"Per-request timeout for the vision-model call behind read's ?q= image questions, in milliseconds. A stalled provider fails fast with a timeout error instead of blocking until manual abort. Set to 0 to disable the timeout.",options:[{value:"0",label:"Disabled"},{value:"60000",label:"1 minute"},{value:"120000",label:"2 minutes"},{value:"180000",label:"3 minutes"},{value:"300000",label:"5 minutes"}]}},"checkpoint.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Checkpoint/Rewind",description:"Enable the checkpoint and rewind tools for context checkpointing"}},"fetch.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Read URLs",description:"Allow the read tool to fetch and process URLs"}},"vault.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Obsidian Vault",description:"Enable the vault:// internal URL for reading and editing Obsidian vault content via the Obsidian CLI. When disabled, vault:// resolution is refused and the vault:// entry is omitted from the system prompt."}},"github.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"GitHub CLI",description:"Enable the github tool (op-based dispatch for repository, issue, pull request, diff, search, checkout, push, and Actions watch workflows)"}},"github.cache.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"GitHub",label:"GitHub View Cache",description:"Cache rendered issue/PR view output in ~/.omp/cache/github-cache.db so repeated reads are free"}},"github.cache.softTtlSec":{type:"number",default:300,ui:{tab:"tools",group:"GitHub",label:"GitHub Cache Soft TTL",description:"Within this window, cached issue/PR view rows are returned directly (seconds; default 5 minutes)"}},"github.cache.hardTtlSec":{type:"number",default:604800,ui:{tab:"tools",group:"GitHub",label:"GitHub Cache Hard TTL",description:"Past the soft TTL the cached row is returned and refreshed in the background; past the hard TTL it is dropped (seconds; default 7 days)"}},"web_search.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Web Search",description:"Enable the web_search tool for live web results"}},"security.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Security",description:"Enable OMP-native security scan planning, execution, and the read-only security:// resource namespace"}},"ask.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Ask",description:"Enable the ask tool for interactive user questions"}},"tools.intentTracing":{type:"boolean",default:!0,ui:{tab:"tools",group:"Execution",label:"Intent Tracing",description:"Ask the agent to describe the intent of each tool call before executing it"}},"tools.abortOnFabricatedResult":{type:"boolean",default:!0,ui:{tab:"tools",group:"Execution",label:"Abort On Fabricated Tool Result",description:"With in-band tool calls, stop the model immediately when it starts hallucinating a tool result mid-turn. Disable to let the model finish generating and discard the fabricated continuation instead."}},"tools.speculativeExecution.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Execution",label:"Experimental Speculative Execution",description:"Enable the discard-safe first slice: validated local reads through direct read calls and nested eval. Network requests, provider completions, and live filesystem writes are not part of this baseline."}},"tools.speculativeExecution.maxInFlight":{type:"number",default:2,ui:{tab:"tools",group:"Execution",label:"Speculative Execution Concurrency",description:"Maximum number of validated local reads allowed to run before normal dispatch.",options:[{value:"1",label:"1 operation"},{value:"2",label:"2 operations"},{value:"3",label:"3 operations"},{value:"4",label:"4 operations"}]}},"tools.maxTimeout":{type:"number",default:0,ui:{tab:"tools",group:"Execution",label:"Max Tool Timeout",description:"Maximum timeout in seconds the agent can set for any tool (0 = no limit)",options:[{value:"0",label:"No limit"},{value:"30",label:"30 seconds"},{value:"60",label:"60 seconds"},{value:"120",label:"120 seconds"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"}]}},"async.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Execution",label:"Async Execution",description:"Enable async bash commands and background task execution"}},"async.widgets":{type:"boolean",default:!0,ui:{tab:"tools",group:"Execution",label:"Live Job Widgets",description:"Draw a live widget for each running background job (charts, bars, status grids derived from its output) in the wait card, the jobs pill and the jobs sheet. The `widget` model role (default: `smol`) writes one spec per job; updates need no further model calls"}},"tools.xdev":{type:"boolean",default:!0,ui:{tab:"tools",group:"Discovery & MCP",label:"xd:// Tools",description:"Mount rarely-used (discoverable) tools under xd:// device URLs driven via read/write instead of shipping their schemas on every request. Sessions whose explicit tool list grants read but omits write mount devices through a device-only write transport (only local:// scratch stays writable besides devices). Disable to expose every enabled tool top-level."}},"tools.xdevDocs":{type:"enum",default:"catalog",values:["inline","builtins","catalog"],ui:{tab:"tools",group:"Discovery & MCP",label:"xd:// Prompt Docs",description:"Choose which mounted-device docs and schemas are inlined in the system prompt. Built-ins keeps core tools inline while MCP and extension tools stay on-demand.",options:[{value:"inline",label:"All Devices",description:"Inline docs and schemas for every mounted device."},{value:"builtins",label:"Built-ins Only",description:"Inline built-in docs; fetch MCP and extension docs on demand."},{value:"catalog",label:"Catalog Only",description:"List every device; fetch all docs on demand."}]}},"tools.xdevInlineDevices":{type:"array",default:[],ui:{tab:"tools",group:"Discovery & MCP",label:"xd:// Inline Devices",description:"When xd:// Prompt Docs is Built-ins Only, inline dynamic devices whose names match these glob patterns (for example mcp__context_mode_*). Catalog Only ignores this setting."}},"dev.autoqa":{type:"boolean",default:!0,ui:{tab:"tools",group:"Developer",label:"Auto QA",description:"Automated tool issue reporting (xd://report_issue). On by default; the first report asks for consent, and denying it disables reporting until re-enabled explicitly"}},"dev.autoqaPush.endpoint":{type:"string",default:"https://qa.omp.sh/v1/grievances",ui:{tab:"tools",group:"Developer",label:"Auto QA Push Endpoint",description:"Full URL receiving Auto QA JSON reports (default https://qa.omp.sh/v1/grievances)"}},"lsp.enabled":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"LSP",description:"Enable the lsp tool for code intelligence (definitions, references, diagnostics, rename)"}},"lsp.lazy":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"Lazy LSP Startup",description:"Start language servers on first use (lsp tool or editing a matching file type) instead of at session startup"}},"lsp.shared":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"Shared Language Servers",description:"Start language servers through the per-project daemon broker. Each connection gets its own server. While another omp instance in the project is running, a released server stays warm and the next connection reuses it instead of cold-starting (falls back to private servers when unavailable)"}},"lsp.formatOnWrite":{type:"boolean",default:!1,ui:{tab:"files",group:"LSP",label:"Format on Write",description:"Automatically format code files using LSP after writing"}},"lsp.diagnosticsOnWrite":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"Diagnostics on Write",description:"Return LSP diagnostics after writing code files"}},"lsp.diagnosticsOnEdit":{type:"boolean",default:!1,ui:{tab:"files",group:"LSP",label:"Diagnostics on Edit",description:"Return LSP diagnostics after editing code files"}},"lsp.diagnosticsDeduplicate":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"Deduplicate Diagnostics",description:"Suppress post-edit LSP diagnostics already shown for a file; only surface new or changed ones"}},"lsp.requestTimeout":{type:"number",default:10,ui:{tab:"files",group:"LSP",label:"Request Timeout",description:"Seconds to wait for a language server's diagnostics, hover and other answers when the agent sets no timeout; late post-edit diagnostics wait at least this long. Raise it for servers that are slow on a cold start. The lsp tool's timeout argument can still raise or lower it per call",options:[{value:"10",label:"10 seconds",description:"Default"},{value:"20",label:"20 seconds"},{value:"30",label:"30 seconds"},{value:"60",label:"1 minute"},{value:"120",label:"2 minutes"},{value:"300",label:"5 minutes"}]}},"bash.enabled":{type:"boolean",default:!0,ui:{tab:"shell",group:"Bash",label:"Bash",description:"Enable the bash tool for shell command execution"}},"bash.allowCompoundCommands":{type:"boolean",default:!1,ui:{tab:"shell",group:"Bash",label:"Allow Compound Commands",description:"Evaluate literal && chains per command; unmatched commands use normal bash approval policy and mode"}},"bash.autoBackground.enabled":{type:"boolean",default:!0,ui:{tab:"shell",group:"Bash",label:"Bash Auto-Background",description:"Automatically background long-running bash commands and deliver the result later"}},"bash.gitGuard":{type:"boolean",default:!1,ui:{tab:"shell",group:"Bash",label:"Git Guard",description:"Refuse git commands that discard or move shared work in the bash tool: stash, reset --hard or to another commit, and checkout/switch/restore outside a merge or rebase conflict"}},"bash.patterns":{type:"array",default:[],ui:{tab:"shell",group:"Bash",label:"Bash Approval Patterns",description:"Ordered bash command approval rules. Each item has match and approval fields; only '*' wildcards are supported."}},"bashInterceptor.enabled":{type:"boolean",default:!1,ui:{tab:"shell",group:"Bash",label:"Bash Interceptor",description:"Block shell commands that have dedicated tools"}},"bash.direnv":{type:"enum",default:"auto",values:["auto","off"],ui:{tab:"shell",group:"Bash",label:"direnv Auto-Load",description:"Auto-load a repo's direnv/devenv `.envrc` into the bash session so devenv tools and env vars are present without manual `direnv exec`. Honors direnv's allow list: an `.envrc` you haven't `direnv allow`ed is never executed"}},"bash.direnvLoadTimeoutMs":{type:"number",default:30000,ui:{tab:"shell",group:"Bash",label:"direnv Load Timeout (ms)",description:"Max wait for the first `direnv export` (a cold devenv shell can be slow); on timeout the session runs without the direnv env"}},"shellMinimizer.enabled":{type:"boolean",default:!0,ui:{tab:"shell",group:"Bash",label:"Shell Minimizer",description:"Compress verbose shell output (git, npm, cargo, etc.) before returning it to the agent"}},"shellMinimizer.sourceOutlineLevel":{type:"enum",default:"default",values:["default","aggressive"],ui:{tab:"shell",group:"Bash",label:"Shell Minimizer Source Outline",description:"Source outline mode for cat/read of source files: default or aggressive"}},"eval.py":{type:"boolean",default:!0,ui:{tab:"shell",group:"Eval & Runtimes",label:"Python Eval Backend",description:"Allow the eval tool to dispatch Python cells to the IPython kernel"}},"eval.js":{type:"boolean",default:!0,ui:{tab:"shell",group:"Eval & Runtimes",label:"JavaScript Eval Backend",description:"Allow the eval tool to dispatch JavaScript cells to the in-process runtime"}},"eval.autoProvision":{type:"boolean",default:!0,ui:{tab:"shell",group:"Eval & Runtimes",label:"Eval Environment Provisioning",description:"Automatically create the managed JavaScript eval package environment on first install"}},"eval.tools.enabled":{type:"boolean",default:!0,ui:{tab:"shell",group:"Eval & Runtimes",label:"Eval-Defined Tools",description:"Let eval cells define tools (@tool in Python, tool(fn) in JS) that task, agent(), and workpool() subagents can call"}},"eval.workpool.freshAgents":{type:"boolean",default:!1,ui:{tab:"shell",group:"Eval & Runtimes",label:"Fresh Workpool Agents",description:"Spawn a new subagent for every workpool item instead of reusing workers or batching queued items"}},"eval.autoBackground.enabled":{type:"boolean",default:!1,ui:{tab:"shell",group:"Eval & Runtimes",label:"Eval Auto-Background",description:"Automatically background long-running eval cells and deliver the result later"}},"python.kernelMode":{type:"enum",default:"session",values:["session","per-call"],ui:{tab:"shell",group:"Eval & Runtimes",label:"Python Kernel Mode",description:"Keep the IPython kernel alive across eval calls or start fresh each time"}},"python.interpreter":{type:"string",default:"",ui:{tab:"shell",group:"Eval & Runtimes",label:"Python Interpreter",description:"Optional path to an exact Python executable. When set, automatic Python runtime discovery is skipped."}},"task.isolation.enabled":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Isolation",label:"Allow Isolated Subagents",description:"Allow per-task isolation with `isolated: true`; tasks without it run in the shared checkout"}},"isolation.backend":{type:"enum",default:"auto",values:["auto","apfs","btrfs","zfs","reflink","overlayfs","projfs","block-clone","rcopy"],ui:{tab:"tasks",group:"Isolation",label:"Isolation Backend",description:"Backend used for subagent isolation and worktree cloning",options:[{value:"auto",label:"Auto",description:"Let the PAL pick the best available backend"},{value:"apfs",label:"APFS",description:"macOS clonefile reflink (APFS)"},{value:"btrfs",label:"btrfs",description:"btrfs subvolume snapshot"},{value:"zfs",label:"ZFS",description:"ZFS snapshot + clone"},{value:"reflink",label:"Reflink",description:"Linux FICLONE per-file reflink"},{value:"overlayfs",label:"Overlayfs",description:"Linux kernel overlay (or fuse-overlayfs fallback)"},{value:"projfs",label:"ProjFS",description:"Windows Projected File System"},{value:"block-clone",label:"Block clone",description:"Windows FSCTL_DUPLICATE_EXTENTS_TO_FILE (NTFS/ReFS)"},{value:"rcopy",label:"Recursive copy",description:"git worktree if available, otherwise recursive copy"}]}},"worktree.clone":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Isolation",label:"Clone Checkout into Worktrees",description:"New worktrees from `github pr_checkout` and `git worktree add` in bash start as a copy-on-write clone of the current checkout so ignored build artifacts (node_modules, target) carry over; falls back to a plain checkout when the filesystem cannot clone"}},"worktree.cleanSource":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Isolation",label:"Clean Source Checkout on /wt",description:"When creating a worktree with `/wt`, reset tracked changes and remove untracked files from the original checkout after carrying them over"}},"worktree.onStart":{type:"enum",default:"off",values:["off","ask","create"],ui:{tab:"tasks",group:"Isolation",label:"Worktree on Start",description:"Whether fresh interactive sessions start in a new linked worktree",options:[{value:"off",label:"Off",description:"Start in the current checkout"},{value:"ask",label:"Ask",description:"Ask at session start"},{value:"create",label:"Create",description:"Always start in a new worktree on a `wt/*` branch"}]}},"worktree.onExit":{type:"enum",default:"keep",values:["keep","ask","remove"],ui:{tab:"tasks",group:"Isolation",label:"Worktree on Exit",description:"What to do on exit with worktrees created since omp started (on start or with `/wt`)",options:[{value:"keep",label:"Keep",description:"Leave worktrees in place"},{value:"ask",label:"Ask",description:"Ask on exit"},{value:"remove",label:"Remove",description:"Remove clean worktrees; ask when they have uncommitted changes or new commits. Gitignored files (e.g. `.env`) are deleted too"}]}},"task.isolation.apply":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Isolation",label:"Apply Isolated Changes",description:"Automatically apply successful isolated task changes to the parent checkout; disable to retain patch or branch artifacts"}},"task.isolation.merge":{type:"enum",default:"patch",values:["patch","branch"],ui:{tab:"tasks",group:"Isolation",label:"Isolation Merge Strategy",description:"How isolated task changes are integrated (patch apply or branch merge)",options:[{value:"patch",label:"Patch",description:"Combine diffs and git apply"},{value:"branch",label:"Branch",description:"Commit per task, merge with --no-ff"}]}},"task.isolation.commits":{type:"enum",default:"generic",values:["generic","ai"],ui:{tab:"tasks",group:"Isolation",label:"Isolation Commit Style",description:"Commit message style for nested repo changes (generic or AI-generated)",options:[{value:"generic",label:"Generic",description:"Static commit message"},{value:"ai",label:"AI",description:"AI-generated commit message from diff"}]}},"worktree.base":{type:"string",ui:{tab:"tasks",group:"Isolation",label:"Worktree Base Directory",description:"Base directory for agent-managed worktrees — task-isolation copies, `github` PR checkouts, and `omp worktree` cleanup all live here. Unset uses ~/.omp/wt. Must be an absolute or ~-relative path; relative paths are ignored. The OMP_WORKTREE_DIR env var overrides this."}},"task.eager":{type:"enum",default:"default",values:["default","preferred","always"],ui:{tab:"tasks",group:"Subagents",label:"Prefer Task Delegation",description:"How strongly to push delegating work to subagents",options:[{value:"default",label:"Default",description:"Uses the selected model's policy; some models require an explicit delegation request"},{value:"preferred",label:"Preferred",description:"Adds delegation guidance to the system prompt"},{value:"always",label:"Always",description:"Prompt guidance plus a first-turn delegation reminder"}]}},"task.batch":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Subagents",label:"Batch Task Calls",description:"Switch the task tool to its batch shape: one call carries { context, tasks[] } — one subagent per item, with an optional per-item agent (defaulting to the session spawn-policy agent), per-item isolation, and a required shared context prepended to every assignment. With async.enabled=true, each spawn runs as an independent background agent with the normal idle/parked lifecycle; otherwise the call blocks for merged results. Disable to restore the flat single-spawn schema."}},"task.structured":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Subagents",label:"Structured Task Results",description:"Expose outputSchema/schemaMode on the task tool and return subagent results through the yield tool, validated against caller or agent output schemas. Off: task subagents have no yield tool and return their final message as plain text, except agents whose definition sets structured: true. Eval agent()/workpool spawns always keep structured results."}},"task.speculativeLaunch":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Subagents",label:"Speculative Task Launch",description:"Start each batch subagent as soon as its tasks[] item finishes streaming instead of waiting for the whole task call. Launched agents are aborted if the finished call fails validation, is blocked, or its arguments change. Requires auto-allowed task approval and no extension tool lifecycle handlers."}},"task.enableEffort":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Subagents",label:"Per-Task Effort",description:"Expose the optional effort parameter on task spawns, allowing callers to override each subagent's thinking level"}},"task.maxConcurrency":{type:"number",default:32,ui:{tab:"tasks",group:"Subagents",label:"Max Concurrent Tasks",description:"Maximum number of subagents running concurrently",options:[{value:"0",label:"Unlimited"},{value:"1",label:"1 task"},{value:"2",label:"2 tasks"},{value:"4",label:"4 tasks"},{value:"8",label:"8 tasks"},{value:"16",label:"16 tasks"},{value:"32",label:"32 tasks"},{value:"64",label:"64 tasks"}]}},"task.enableLsp":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Subagents",label:"LSP in Subagents",description:"Allow subagents spawned via the task tool to use the lsp tool. Off by default to keep subagents cheap; enable when LSP-aware delegation is worth the extra tokens."}},"task.maxRecursionDepth":{type:"number",default:2,ui:{tab:"tasks",group:"Subagents",label:"Max Task Recursion",description:"How many levels deep subagents can spawn their own subagents",options:[{value:"-1",label:"Unlimited"},{value:"0",label:"None"},{value:"1",label:"Single"},{value:"2",label:"Double"},{value:"3",label:"Triple"}]}},"task.maxRuntimeMs":{type:"number",default:0,ui:{tab:"tasks",group:"Subagents",label:"Max Subagent Runtime",description:"Hard wall-clock limit per subagent (ms). 0 disables it. Defense-in-depth against provider-side stream hangs that escape the inference-layer watchdog; triggers a normal subagent abort with a 'timed out' reason.",options:[{value:"0",label:"Unlimited",description:"Default"},{value:"300000",label:"5 minutes"},{value:"900000",label:"15 minutes"},{value:"1800000",label:"30 minutes"},{value:"3600000",label:"1 hour"}]}},"task.completionProbe":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Subagents",label:"Subagent Completion Probe",description:"Ask a working subagent, through a cached side request like /btw, to estimate how complete its task is: after 2, 5, 10 and 30 more minutes, then hourly. The estimate shows next to the subagent in wait and task views. Only subagents spawned by the main agent of an interactive session are asked; print, RPC, ACP and SDK runs never probe."}},"task.agentIdleTtlMs":{type:"number",default:420000,ui:{tab:"tasks",group:"Subagents",label:"Agent Idle TTL",description:"How long an idle subagent stays live in memory before being parked to disk (ms). Parked agents are revived automatically when messaged or resumed. 0 keeps idle agents live until exit."}},"task.softRequestBudget":{type:"number",default:200,ui:{tab:"tasks",group:"Subagents",label:"Soft Subagent Request Budget",description:"Soft per-subagent request budget (assistant requests per run). Crossing it injects a wrap-up steering notice (see task.softRequestBudgetNotice); at 1.5x the budget the run is force-stopped and the agent must hand back its partial findings. 0 disables the guard. Bundled scout/sonic agents cap out at a lower built-in budget, so a value below that cap still applies to them. A task.agentSoftRequestBudget entry replaces this budget for the agent it names.",options:[{value:"0",label:"Disabled"},{value:"90",label:"90 requests"},{value:"150",label:"150 requests"},{value:"200",label:"200 requests",description:"Default"}]}},"task.softRequestBudgetNotice":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Subagents",label:"Soft Request Budget Notice",description:"Inject one steering notice when a subagent crosses its soft request budget, asking it to wrap up before the 1.5x forced-yield stop."}},"task.maxEffort":{type:"enum",default:"max",values:["minimal","low","medium","high","xhigh","max"],ui:{tab:"tasks",group:"Subagents",label:"Maximum Per-Spawn Effort",description:"Maximum reasoning effort allowed for the task tool's per-spawn effort hint. Lower values prevent callers from escalating subagents above this ceiling; the default preserves the model's full range.",options:[{value:"minimal",label:"min",description:"Very brief reasoning (~1k tokens)"},{value:"low",label:"low",description:"Light reasoning (~2k tokens)"},{value:"medium",label:"medium",description:"Moderate reasoning (~8k tokens)"},{value:"high",label:"high",description:"Deep reasoning (~16k tokens)"},{value:"xhigh",label:"xhigh",description:"Extended reasoning (~32k tokens)"},{value:"max",label:"max",description:"Maximum reasoning the model supports"}]}},"task.prewalk":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Subagents",label:"Generic Task Prewalk",description:"Arm prewalk for the bundled generic `task` subagent: it starts on its resolved model, plans and begins the implementation, then hands off to the 'smol' role at its first edit/write. Per-agent overrides (task.agentPrewalk, configured from the /agents hub) and user agent `prewalk` frontmatter apply regardless of this toggle."}},"task.showResolvedModelBadge":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Show Resolved Model Badge",description:"Display the actual model ID used by each subagent in the task widget status line"}},"plan.enabled":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Modes",label:"Plan Mode",description:"Enable plan mode for read-only exploration and planning before execution"}},"plan.defaultOnStartup":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Modes",label:"Start in Plan Mode",description:"Automatically enter plan mode at the start of every new session",condition:"planModeEnabled"}},"plan.autosave":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Modes",label:"Autosave Plans",description:"Automatically save approved plans to disk when plan mode completes",condition:"planModeEnabled"}},"plan.autosaveDir":{type:"string",ui:{tab:"tasks",group:"Modes",label:"Autosave Directory",description:"Directory for autosaved plans. Supports ~, absolute, and cwd-relative paths. Empty uses <project>/.omp/plans/.",condition:"planAutosaveEnabled"}},"goal.enabled":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Modes",label:"Goal Mode",description:"Enable per-session goal mode and the hidden goal tool"}},"goal.statusInFooter":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Modes",label:"Goal Status in Footer",description:"Show token budget alongside the goal indicator in the status line"}},"goal.continuationModes":{type:"array",default:["interactive"],ui:{tab:"tasks",group:"Modes",label:"Goal Continuation Modes",description:'Run modes where active goals may auto-continue between turns ("interactive", "rpc")'}},"title.icons":{type:"enum",default:"nf+emoji",values:["nf+emoji","emoji","boring"],ui:{tab:"appearance",group:"Display",label:"Title Icons",description:"Icon and short code that head new generated or /rename session titles",options:[{value:"nf+emoji",label:"Nerd Font + Emoji",description:"Nerd Font glyph where the Nerd Font symbol preset renders it, else the emoji (default)"},{value:"emoji",label:"Emoji",description:"Always the emoji"},{value:"boring",label:"Boring",description:"Plain title: no icon or code"}]}},"title.generator":{type:"enum",default:"fork",values:["fork","tiny"],ui:{tab:"tasks",group:"Modes",label:"Title Generator",description:"What names an untitled session from the user's messages",options:[{value:"fork",label:"Fork",description:"A side turn of the reply on the session's model: reads its prompt cache, adds the card icon (default)"},{value:"tiny",label:"Tiny",description:"The title model role only; plain titles without a card"}]}},"title.refreshOnReplan":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Modes",label:"Refresh Title on Replan",description:"Refresh generated session titles after todo init replans unless the title was set by the user"}},"skills.registryUrl":{type:"string",default:"https://skills.omp.sh",ui:{tab:"interaction",group:"Skills",label:"Skill Registry",description:"Skillshare registry used by `omp skill` to install, search, and publish skills (https://host[:port])"}},"skills.enableSkillCommands":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Commands & Skills",label:"Skill Commands",description:"Register skills as /skill:name commands"}},"commands.enableClaudeUser":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Commands & Skills",label:"Claude User Commands",description:"Load commands from ~/.claude/commands/"}},"commands.enableClaudeProject":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Commands & Skills",label:"Claude Project Commands",description:"Load commands from .claude/commands/"}},"commands.enableOpencodeUser":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Commands & Skills",label:"OpenCode User Commands",description:"Load commands from ~/.config/opencode/commands/"}},"commands.enableOpencodeProject":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Commands & Skills",label:"OpenCode Project Commands",description:"Load commands from .opencode/commands/"}},"extensionHandlers.toolCallTimeoutMs":{type:"number",default:30000,ui:{tab:"tools",group:"Extensions",label:"Tool Call Handler Timeout (ms)",description:"Positive finite active-work timeout for extension tool_call handlers; invalid values use 30000ms, and time awaiting OMP-owned dialogs does not count"}},"exa.enabled":{type:"boolean",default:!0,ui:{tab:"providers",group:"Services",label:"Exa",description:"Enable the Exa web search provider"}},"exa.searchDelayMs":{type:"number",default:1000,ui:{tab:"providers",group:"Services",label:"Exa Search Delay",description:"Minimum delay between Exa web search requests in milliseconds; set 0 to disable pacing"}},"searxng.endpoint":{type:"string",ui:{tab:"providers",group:"Services",label:"SearXNG Endpoint",description:"Base URL of a self-hosted SearXNG instance used for web search"}},"browser.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Browser",description:"Enable the browser eval prelude for scripted Chromium automation (Puppeteer)"}},"browser.cdpUrl":{type:"string",ui:{tab:"tools",group:"Grep & Browser",label:"Browser CDP URL",description:"Default HTTP CDP discovery endpoint (for example http://127.0.0.1:9222) to attach to instead of launching a browser. Explicit app.cdp_url or app.path on the tool call take precedence."}},"browser.relay":{type:"boolean",default:!1,ui:{tab:"tools",group:"Grep & Browser",label:"Browser Relay",description:"Drive your own Chrome tabs through the omp browser relay. Install the extension once (`omp browser-relay install`); the relay server auto-starts when the browser prelude needs it. Takes precedence over Browser CDP URL; set PI_BROWSER_RELAY=0 or PI_BROWSER_RELAY=1 to override."}},"browser.relayUrl":{type:"string",ui:{tab:"tools",group:"Grep & Browser",label:"Browser Relay URL",description:"omp browser relay endpoint (default http://127.0.0.1:9224)."}},"browser.headless":{type:"boolean",default:!0,ui:{tab:"tools",group:"Grep & Browser",label:"Headless Browser",description:"Launch browser in headless mode (disable to show browser UI)"}},"browser.cmux":{type:"boolean",default:!0,ui:{tab:"tools",group:"Grep & Browser",label:"cmux Browser",description:"Use cmux WKWebView surfaces for browser automation when a cmux socket is available. Set PI_BROWSER_CMUX=0 or PI_BROWSER_CMUX=1 to override."}},"browser.tern":{type:"boolean",default:!0,ui:{tab:"tools",group:"Grep & Browser",label:"Tern Browser",description:"Inside a Tern pane, open browser tabs as picture-in-pictures over omp's pane (native web view) instead of headless Chromium; falls back to Chromium when no Tern window can host them. Explicit app options, the relay and Browser CDP URL take precedence; app.tern:false opts one open out. Set PI_BROWSER_TERN=0 or PI_BROWSER_TERN=1 to override."}},"browser.freezeOnTurnEnd":{type:"boolean",default:!0,ui:{tab:"tools",group:"Grep & Browser",label:"Freeze Browser Tabs On Turn End",description:"Freeze OMP-owned headless browser tabs when a turn settles so animated pages stop burning CPU/GPU while idle. Tabs unfreeze automatically on next use; pass persist:true on open to opt a tab out."}},"browser.idleCloseSec":{type:"number",default:1800,ui:{tab:"tools",group:"Grep & Browser",label:"Browser Idle Close Timeout",description:"Close OMP-owned headless browser tabs and Tern browser picture-in-pictures idle longer than this many seconds (0 = never; session dispose still reaps). Never touches relay/CDP/spawned browsers or other sessions' tabs.",options:[{value:"0",label:"Never"},{value:"900",label:"15 minutes"},{value:"1800",label:"30 minutes"},{value:"3600",label:"1 hour"}]}},"browser.screenshotDir":{type:"string",ui:{tab:"tools",group:"Grep & Browser",label:"Screenshot Directory",description:"Directory to save screenshots. If unset, screenshots go to a temp file. Supports ~. Examples: ~/Downloads, ~/Desktop, /sdcard/Download (Android)"}},"ida.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"IDA Pro",description:"Open executables read with `read` in IDA Pro (idalib) and enable the `ida` tool; inert when no IDA install is found"}},"ida.python":{type:"string",default:"",ui:{tab:"tools",group:"IDA Pro",label:"IDA Python",description:"Python interpreter that can import ida_domain and idapro; empty auto-detects"}},"ida.installDir":{type:"string",default:"",ui:{tab:"tools",group:"IDA Pro",label:"IDA Install Dir",description:"Directory containing libidalib, exported as IDADIR; empty auto-detects ($IDADIR, ida-config.json, standard install paths)"}},"ida.maxOpen":{type:"number",default:4,ui:{tab:"tools",group:"IDA Pro",label:"IDA Max Open Databases",description:"Most IDA databases (omp.ida.* daemons in omp ps) open at once per project; opening another saves and closes the least recently used idle one",options:[{value:"2",label:"2"},{value:"4",label:"4"},{value:"8",label:"8"},{value:"16",label:"16"}]}},"ida.idleCloseSec":{type:"number",default:900,ui:{tab:"tools",group:"IDA Pro",label:"IDA Idle Close Timeout",description:"Save and close IDA databases idle longer than this many seconds (0 = never); the exec namespace resets on reopen",options:[{value:"0",label:"Never"},{value:"300",label:"5 minutes"},{value:"900",label:"15 minutes"},{value:"1800",label:"30 minutes"},{value:"3600",label:"1 hour"}]}},"mcp.enableProjectConfig":{type:"boolean",default:!0,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Project Config",description:"Load .mcp.json/mcp.json from project root"}},"mcp.startupTimeoutMs":{type:"number",default:250,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Startup Window",description:"Wait this many milliseconds for initial MCP tool discovery; 0 waits until connections settle"}},"mcp.renderMarkdownResults":{type:"boolean",default:!0,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Markdown Results",description:"Render non-JSON MCP text results as Markdown in the transcript"}},"mcp.notifications":{type:"boolean",default:!1,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Update Injection",description:"Inject MCP resource updates into the agent conversation"}},"mcp.notificationDebounceMs":{type:"number",default:500,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Notification Debounce",description:"Debounce window in milliseconds for MCP resource updates before injecting them into the conversation"}},"images.urls.enabled":{type:"boolean",default:!1,ui:{tab:"model",group:"Vision",label:"Serve Images as URLs",description:"Publish outgoing images through the configured backend chain and send URL-fetching providers short URLs instead of inline base64. Falls back to inline automatically when every backend or a provider fetch fails"}},"images.urls.backends":{type:"array",default:["provider-files","tailscale","cloudflared","litterbox"],ui:{tab:"model",group:"Vision",label:"Image URL Backends",description:"Ordered destinations tried when publishing images for provider access",options:[{value:"imgur",label:"Imgur",description:"Uploads require either an Imgur access token or client ID."},{value:"imageshack",label:"ImageShack",description:"The API requires a paid subscription."},{value:"flickr",label:"Flickr",description:"image-host"},{value:"chevereto",label:"Chevereto",description:"self-hosted"},{value:"vgyme",label:"vgy.me",description:"image-host"},{value:"dropbox",label:"Dropbox",description:"cloud-files"},{value:"ftp",label:"FTP / FTPS / SFTP",description:"file-transfer"},{value:"onedrive",label:"OneDrive",description:"cloud-files"},{value:"google-drive",label:"Google Drive",description:"cloud-files"},{value:"puush",label:"puush-compatible endpoint",description:"The public service is defunct; a replacement endpoint is required."},{value:"box",label:"Box",description:"cloud-files"},{value:"amazon-s3",label:"Amazon S3",description:"s3"},{value:"google-cloud-storage",label:"Google Cloud Storage",description:"object-storage"},{value:"azure-storage",label:"Azure Blob Storage",description:"object-storage"},{value:"backblaze-b2",label:"Backblaze B2",description:"Configure either native B2 application keys or S3-compatible access keys."},{value:"owncloud",label:"ownCloud / Nextcloud",description:"webdav"},{value:"mediafire",label:"MediaFire-compatible endpoint",description:"The public API is deprecated; a replacement endpoint is required."},{value:"sendspace",label:"SendSpace-compatible endpoint",description:"The public discovery API is deprecated; a replacement endpoint is required."},{value:"localhostr",label:"Hostr-compatible endpoint",description:"The public service is offline; a replacement endpoint is required."},{value:"lambda",label:"Lambda-compatible endpoint",description:"The public service is offline; a replacement endpoint is required."},{value:"pomf",label:"Pomf",description:"pomf"},{value:"uguu",label:"Uguu",description:"Public uploads expire after approximately three hours."},{value:"seafile",label:"Seafile",description:"cloud-files"},{value:"s-ul",label:"s-ul",description:"file-host"},{value:"lobfile",label:"LobFile-compatible endpoint",description:"The public service is offline; a replacement endpoint is required."},{value:"transfer-sh",label:"transfer.sh-compatible endpoint",description:"The defunct public endpoint is blocked; a self-hosted replacement is required."},{value:"plik",label:"Plik",description:"self-hosted"},{value:"shared-folder",label:"Shared folder",description:"filesystem"},{value:"catbox",label:"Catbox",description:"anonymous-host"},{value:"litterbox",label:"Litterbox",description:"Uploads are temporary."},{value:"0x0",label:"0x0.st",description:"Public uploads expire after a retention window determined by file size."},{value:"tmpfiles",label:"tmpfiles.org",description:"Public uploads are temporary."},{value:"discord",label:"Discord",description:"messaging"},{value:"provider-files",label:"Model provider files",description:"Provider file references are API-local rather than public image URLs."},{value:"direct",label:"Direct public URL",description:"local-serving"},{value:"cloudflared",label:"Cloudflare quick tunnel",description:"tunnel"},{value:"ngrok",label:"ngrok",description:"tunnel"},{value:"tailscale",label:"Tailscale Funnel",description:"tunnel"},{value:"ssh",label:"SSH reverse tunnel",description:"tunnel"},{value:"command",label:"Uploader command",description:"external-command"},{value:"localhost-run",label:"localhost.run",description:"tunnel"},{value:"pinggy",label:"Pinggy",description:"tunnel"},{value:"devtunnel",label:"Microsoft dev tunnel",description:"The devtunnel CLI must be logged in locally."},{value:"zrok",label:"zrok",description:"The local zrok environment must be enabled."},{value:"bore",label:"bore",description:"tunnel"},{value:"named-cloudflared",label:"Named Cloudflare Tunnel",description:"tunnel"},{value:"r2",label:"Cloudflare R2",description:"s3"},{value:"tigris",label:"Tigris",description:"s3"},{value:"minio",label:"MinIO",description:"s3"},{value:"garage",label:"Garage",description:"s3"}],ordered:!0}},"images.urls.command":{type:"string",ui:{tab:"model",group:"Vision",label:"Image Upload Command",description:"Argv template for the command backend; {file} is the image path, {mime}/{ext} optional. The last URL printed on stdout is used (e.g. pasta -b -f {file})"}},"images.urls.publicBaseUrl":{type:"string",ui:{tab:"model",group:"Vision",label:"Image URL Public Base",description:"Externally reachable base URL fronting the blob server (required for ssh, optional for direct)"}},"images.urls.ttlHours":{type:"number",default:72,ui:{tab:"model",group:"Vision",label:"Image URL Lifetime (hours)",description:"Serving window for locally hosted image URLs, measured from the last time a conversation sent them; resuming a conversation re-arms the window at the same link. 0 keeps links alive while the broker runs"}},"images.urls.bindHost":{type:"string",default:"127.0.0.1",ui:{tab:"model",group:"Vision",label:"Image URL Bind Host",description:"Host the blob server binds to; loopback for tunnels, 0.0.0.0 for direct serving"}},"images.urls.sshTarget":{type:"string",ui:{tab:"model",group:"Vision",label:"Image URL SSH Target",description:"user@host destination for the ssh reverse forward"}},"images.urls.sshRemotePort":{type:"number",default:8787,ui:{tab:"model",group:"Vision",label:"Image URL SSH Remote Port",description:"Remote listen port of the ssh reverse forward that your web server proxies to"}},"secrets.enabled":{type:"boolean",default:!1,ui:{tab:"providers",group:"Privacy",label:"Hide Secrets",description:"Obfuscate configured secrets and redact credential-shaped tokens before sending to AI providers"}},"stt.enabled":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Speech",label:"Speech-to-Text",description:"Enable speech-to-text input via microphone"}},"stt.submitTrigger":{type:"enum",default:"never",values:["never","release","release-complete","say-submit"],ui:{tab:"interaction",group:"Speech",label:"Speech-to-Text Submit Trigger",description:"Choose when speech dictation automatically submits: Never, Release (2+ words), Release with complete sentence, or When I Say Submit.",options:[{value:"never",label:"Never",description:"Never automatically submit; insert dictation and remain in editor."},{value:"release",label:"Release",description:"Submit on release if the utterance has 2+ words to avoid accidental sends."},{value:"release-complete",label:"Release with complete sentence",description:"Submit on release if the utterance ends with sentence-terminal punctuation (. ? ! etc.)."},{value:"say-submit",label:"When I Say Submit",description:"Submit if the utterance ends with a word containing 'submit' (strips that word before submitting)."}]}},"collab.relayUrl":{type:"string",default:"wss://my.omp.sh",ui:{tab:"interaction",group:"Collab",label:"Relay URL",description:"Relay used by /collab (wss://host[:port])"}},"collab.webUrl":{type:"string",default:"",ui:{tab:"interaction",group:"Collab",label:"Web UI URL",description:"Browser UI used by /collab links; empty derives from collab.relayUrl; explicit http:// is localhost-only"}},"collab.displayName":{type:"string",default:"",ui:{tab:"interaction",group:"Collab",label:"Display Name",description:"Name shown to other collab participants (default: OS username)"}},"collab.autoStart":{type:"enum",default:"off",values:["off","view","control"],ui:{tab:"interaction",group:"Collab",label:"Auto Start",description:"Host every interactive session via collab.relayUrl as it starts and publish it to the local registry (omp collab list); rooms rotate on session switch",options:[{value:"off",label:"Off",description:"Share only when /collab is run"},{value:"view",label:"View",description:"Auto-host; the registry hands out view-only links (omp collab link --view)"},{value:"control",label:"Control",description:"Auto-host; the registry hands out control links that can prompt the session"}]}},"share.serverUrl":{type:"string",default:"https://my.omp.sh/s",ui:{tab:"interaction",group:"Collab",label:"Share Server",description:"Share viewer/upload base used by /share (encrypted blob upload + viewer; links are <base>/<id>#<key>)"}},"share.store":{type:"enum",default:"blob",values:["blob","gist"],ui:{tab:"interaction",group:"Collab",label:"Share Store",description:"Where /share uploads the encrypted session blob",options:[{value:"blob",label:"Encrypted Blob",description:"Upload to the share server (no GitHub account needed; avoids gist API rate limits)"},{value:"gist",label:"GitHub Gist",description:"Push to a secret gist (needs authenticated gh), falling back to the share server"}]}},"share.redactSecrets":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Collab",label:"Share Secret Redaction",description:"Run the secret obfuscator over /share snapshots before upload (uses the secrets.* config)"}},"stream.serverUrl":{type:"string",default:"https://live.omp.sh",ui:{tab:"interaction",group:"Stream",label:"Stream Server",description:"Live stream server used by `omp stream` (https://host[:port]); viewers watch at <base>/<your Stencil username>"}},"stream.redactPatterns":{type:"array",default:[],ui:{tab:"interaction",group:"Stream",label:"Extra Redaction Patterns",description:"Additional regular expressions redacted from every streamed row, on top of env/secrets.yml values and built-in credential shapes"}}}}});var wnn;var Cnn=O(()=>{wnn={"retry.enabled":{type:"boolean",default:!0,ui:{tab:"model",group:"Retry & Fallback",label:"Retry Enabled",description:"Retry transient provider errors (rate limits, outages, quota walls)."}},"retry.baseDelayMs":{type:"number",default:500,ui:{tab:"model",group:"Retry & Fallback",label:"Retry Base Delay (ms)",description:"Initial backoff before the first retry."}},"thinkingBudgets.minimal":{type:"number",default:1024,ui:{tab:"model",group:"Thinking",label:"Minimal Thinking Budget",description:"Token budget for the minimal thinking level."}},"thinkingBudgets.low":{type:"number",default:2048,ui:{tab:"model",group:"Thinking",label:"Low Thinking Budget",description:"Token budget for the low thinking level."}},"thinkingBudgets.medium":{type:"number",default:8192,ui:{tab:"model",group:"Thinking",label:"Medium Thinking Budget",description:"Token budget for the medium thinking level."}},"thinkingBudgets.high":{type:"number",default:16384,ui:{tab:"model",group:"Thinking",label:"High Thinking Budget",description:"Token budget for the high thinking level."}},"thinkingBudgets.xhigh":{type:"number",default:32768,ui:{tab:"model",group:"Thinking",label:"XHigh Thinking Budget",description:"Token budget for the xhigh thinking level."}},"thinkingBudgets.max":{type:"number",default:32768,ui:{tab:"model",group:"Thinking",label:"Max Thinking Budget",description:"Token budget for the max thinking level."}},"stt.language":{type:"string",default:"en",ui:{tab:"interaction",group:"Speech",label:"Speech-to-Text Language",description:'Source language for dictation (ISO-639-1, e.g. "id", "en"). Sent to the recognizer as a hint; leave it as "en" only if your dictation is English.'}},modelTags:{type:"record",default:{},ui:{tab:"model",group:"Prompt",label:"Model Tags",description:"Custom role/tag metadata; can introduce additional roles. JSON record."}},modelProviderOrder:{type:"array",default:[],ui:{tab:"model",group:"Prompt",label:"Model Provider Order",description:"Preferred provider order when a model id is ambiguous. JSON array."}},cycleOrder:{type:"array",default:["smol","default","slow"],ui:{tab:"model",group:"Prompt",label:"Model Cycle Order",description:"Roles cycled by the model switcher. JSON array."}},enabledModels:{type:"array",default:[],ui:{tab:"model",group:"Prompt",label:"Enabled Models",description:"Allow-list of models; supports path-scoped entries. Empty means all available models. JSON array."}},"task.agentServiceTierOverrides":{type:"record",default:{},ui:{tab:"model",group:"Sampling",label:"Agent Service Tier Overrides",description:"Sparse exact-name service-tier overrides for agents spawned by task/eval dispatch. JSON record."}},"compaction.reserveTokens":{type:"number",ui:{tab:"context",group:"Compaction",label:"Compaction Reserve Tokens",description:"Absolute reserve floor. Unset = larger of 16384 and 15% of the context window."}},"compaction.keepRecentTokens":{type:"number",default:20000,ui:{tab:"context",group:"Compaction",label:"Keep Recent Tokens",description:"Recent tokens always preserved through compaction."}},"compaction.autoContinue":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Auto-Continue",description:"Continue automatically after compaction."}},"autolearn.minToolCalls":{type:"number",default:5,ui:{tab:"memory",group:"Auto-Learn",label:"Min Tool Calls",description:"Only nudge after a turn that used at least this many tools.",condition:"autolearnActive"}},shellPath:{type:"string",ui:{tab:"shell",group:"Bash",label:"Shell Path",description:"Override the shell binary used by bash."}},"bash.autoBackground.thresholdMs":{type:"number",default:60000,ui:{tab:"shell",group:"Bash",label:"Auto-Background Threshold (ms)",description:"Threshold before auto-backgrounding long-running commands."}},"task.agentAdvisor":{type:"record",default:{},ui:{tab:"tasks",group:"Subagents",label:"Agent Advisor Overrides",description:'Per-agent subagent advisor: agent name → "on" / "off" / advisor model pattern. JSON record.'}},enabledProviders:{type:"array",default:[],ui:{tab:"providers",group:"Services",label:"Enabled Providers",description:"Foreign user-level discovery sources to load; supports path-scoped entries. JSON array."}},disabledProviders:{type:"array",default:[],ui:{tab:"providers",group:"Services",label:"Disabled Providers",description:"Disabled model/discovery providers; supports path-scoped entries. JSON array."}}}});function Z0(e,t){return e[t]?.value}function Snn(e,t){switch(e){case void 0:return!0;case"advisorEnabled":return Z0(t,"advisor.enabled")===!0;case"vimModeEnabled":return Z0(t,"tui.vimMode")===!0;case"hindsightActive":return Z0(t,"memory.backend")==="hindsight";case"mnemopiActive":return Z0(t,"memory.backend")==="mnemopi";case"autolearnActive":return Z0(t,"autolearn.enabled")===!0;case"autoThinkingActive":return Z0(t,"defaultThinkingLevel")==="auto";case"usageAwareFallbackEnabled":return Z0(t,"retry.usageAwareFallback")===!0;case"planModeEnabled":return Z0(t,"plan.enabled")===!0;case"planAutosaveEnabled":return Z0(t,"plan.enabled")===!0&&Z0(t,"plan.autosave")===!0;case"unexpectedStopSmart":return Z0(t,"features.unexpectedStopDetection")==="smart";case"macOS":case"hasImageProtocol":return!0;default:return!0}}function Tnn(e){return Object.entries(lL).filter(([,t])=>t.ui.tab===e)}function Enn(e,t,n){if(!n)return!0;return e.toLowerCase().includes(n)||t.ui.label.toLowerCase().includes(n)||t.ui.description.toLowerCase().includes(n)}var rie,lL;var nLe=O(()=>{knn();Cnn();rie=_nn,lL={...rie.entries,...wnn}});function Rnn({entryKey:e,entry:t,value:n,initialValue:r,onChangeDirty:a,onCommit:i,saving:o,saveError:s}){let[l,u]=ae(()=>{if(n===void 0||n===null)return"";return Array.isArray(n)||typeof n==="object"?JSON.stringify(n):String(n)}),d=Re(!1),p=Re(r),h=ut(()=>Array.isArray(t.ui.options)?t.ui.options:null,[t.ui.options]);Ee(()=>{let x=n===void 0||n===null?"":Array.isArray(n)||typeof n==="object"?JSON.stringify(n):String(n);u(x),d.current=!1},[n]);let f=()=>{let x=p.current,k=x===void 0||x===null?"":Array.isArray(x)||typeof x==="object"?JSON.stringify(x):String(x);u(k),d.current=!1,a(e,!1,()=>{})},g=(x)=>{let k=l;u(typeof x==="string"?x:JSON.stringify(x)),d.current=!1,i(e,x).then((C)=>{if(C)a(e,!1,()=>{});else u(k),a(e,!0,f)}).catch(()=>{u(k),a(e,!0,f)})},b=()=>{if(!d.current)return;if(t.type==="number"){let x=Lnn(l);if(x===null||x===n){f();return}g(x);return}if(t.type==="string"){let x=l.trim();if(x===n){f();return}g(x);return}if(t.type==="array"){let x=bzr(l);if(x===null||Ann(x,n)){f();return}g(x);return}if(t.type==="record"){let x=yzr(l);if(x===null||Ann(x,n)){f();return}g(x)}},y=()=>{let x=d.current;if(d.current=!0,!x)a(e,!0,f)};if(t.type==="boolean"){let x=n===!0;return m("button",{type:"button",role:"switch","aria-checked":x,"aria-label":t.ui.label,onClick:()=>{a(e,!1,()=>{}),g(!x)},disabled:o,className:`relative h-5 w-9 shrink-0 rounded-full transition-colors cursor-pointer ${x?"bg-ink":"bg-ink/15"} ${o?"opacity-50":""}`,children:m("span",{className:`absolute top-0.5 h-4 w-4 rounded-full bg-paper shadow-sm transition-all ${x?"left-[18px]":"left-0.5"}`})})}if(t.type==="array"&&t.ui.ordered&&h){let x=Array.isArray(n)?n.filter((_)=>typeof _==="string"):[],k=(_)=>{g(x.includes(_)?x.filter((w)=>w!==_):[...x,_])},C=(_,w)=>{let T=_+w;if(T<0||T>=x.length)return;let E=[...x],[L]=E.splice(_,1);E.splice(T,0,L),g(E)};return m("div",{className:"flex flex-wrap items-center gap-1.5 justify-end max-w-72",children:[x.map((_,w)=>{let T=h.find((E)=>E.value===_);return m("span",{className:"inline-flex items-center gap-1 rounded-md border border-ink/15 bg-ink/[0.03] px-2 py-0.5 text-[10px] text-ink",children:[w>0&&m("button",{type:"button","aria-label":`${T?.label??_} left`,onClick:()=>C(w,-1),className:"text-ink/40 hover:text-ink cursor-pointer",disabled:o,children:"←"}),T?.label??_,w<x.length-1&&m("button",{type:"button","aria-label":`${T?.label??_} right`,onClick:()=>C(w,1),className:"text-ink/40 hover:text-ink cursor-pointer",disabled:o,children:"→"}),m("button",{type:"button","aria-label":`Remove ${T?.label??_}`,onClick:()=>k(_),className:"text-ink/40 hover:text-error cursor-pointer",disabled:o,children:m(vn,{size:10})})]},_)}),x.length===0&&m("span",{className:"text-[10px] text-ink/40",children:"empty"}),m("details",{className:"relative",children:[m("summary",{className:"cursor-pointer rounded-md border border-ink/15 px-2 py-0.5 text-[10px] text-ink/70 hover:text-ink select-none",children:"add…"}),m("div",{className:"absolute right-0 top-full z-10 mt-1 max-h-44 w-48 overflow-auto rounded-md border border-ink/15 bg-paper p-1 shadow-lg",children:[h.filter((_)=>!x.includes(_.value)).map((_)=>m("button",{type:"button",onClick:()=>k(_.value),className:"block w-full rounded px-2 py-1 text-left text-[11px] text-ink/80 hover:bg-ink/5",children:_.label||_.value},_.value)),h.every((_)=>x.includes(_.value))&&m("div",{className:"px-2 py-1 text-[10px] text-ink/40",children:"all selected"})]})]})]})}let v=h??(t.type==="enum"&&t.values?t.values.map((x)=>({value:x,label:x,description:""})):null);if(v){let x=n===void 0||n===null?"":String(n);return m("div",{className:"flex items-center gap-2 shrink-0",children:m("select",{"aria-label":t.ui.label,value:x,onChange:(k)=>{let C=k.currentTarget.value;if(t.type==="number"){let _=Lnn(C);if(_===null||_===n)return;g(_)}else{if(C===n)return;g(C)}},disabled:o,className:`bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink max-w-56 ${o?"opacity-50":""}`,children:[x===""&&m("option",{value:"",disabled:!0,children:"select…"}),v.map((k)=>m("option",{value:k.value,children:k.label||k.value},k.value))]})})}if(t.type==="array")return m("input",{"aria-label":t.ui.label,type:"text",value:l,onChange:(x)=>{u(x.currentTarget.value),y()},onBlur:b,disabled:o,placeholder:'["anthropic","openai"]',className:`w-48 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${o?"opacity-50":""}`});if(t.type==="record")return m("input",{"aria-label":t.ui.label,type:"text",value:l,onChange:(x)=>{u(x.currentTarget.value),y()},onBlur:b,disabled:o,placeholder:'{"bash":"prompt"}',className:`w-48 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${o?"opacity-50":""}`});if(t.type==="number")return m("input",{"aria-label":t.ui.label,type:"text",inputMode:"decimal",value:l,onChange:(x)=>{u(x.currentTarget.value),y()},onBlur:b,disabled:o,className:`w-28 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${o?"opacity-50":""}`});return m("input",{"aria-label":t.ui.label,type:t.credential?"password":"text",value:l,onChange:(x)=>{u(x.currentTarget.value),y()},onBlur:b,disabled:o,className:`w-48 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${o?"opacity-50":""} ${s?"border-error":""}`})}var Ann=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Lnn=(e)=>{let t=e.trim();if(t===""||t==="-"||t==="+")return null;let n=Number(t);return Number.isFinite(n)?n:null},bzr=(e)=>{let t=e.trim();if(t==="")return[];try{let n=JSON.parse(t);return Array.isArray(n)?n:null}catch{return null}},yzr=(e)=>{let t=e.trim();if(t==="")return{};try{let n=JSON.parse(t);return typeof n==="object"&&n!==null&&!Array.isArray(n)?n:null}catch{return null}};var Nnn=O(()=>{Je();pt();de()});function Mnn({tabs:e,entries:t,activeTabId:n,onSelectTab:r,searchQuery:a,dirtyKeys:i,savingKeys:o,saveErrors:s,onCommit:l,onReset:u,onDirty:d}){let p=e.find((g)=>g.id===n)??e[0],h=ut(()=>{let g=a.trim().toLowerCase();if(g)return Object.entries(lL).filter(([b,y])=>Enn(b,y,g)).map(([b])=>b).slice(0,80);return Tnn(p.id).filter(([,b])=>Snn(b.ui.condition,t)).map(([b])=>b)},[t,p.id,a]),f=ut(()=>{if(!a.trim())return[];let g=[],b=new Map;for(let y of h){let v=lL[y],x=e.find((_)=>_.id===v?.ui.tab),k=`${v?.ui.tab??"?"}\x00${v?.ui.group??""}`,C=b.get(k);if(!C)C={label:v?.ui.group?`${x?.label??v?.ui.tab} · ${v.ui.group}`:x?.label??v?.ui.tab??"Other",keys:[]},b.set(k,C),g.push({id:k,...C});C.keys.push(y)}return g},[h,a,e]);return m("div",{className:"w-full flex flex-col gap-3 text-xs",children:[m("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 scrollbar-overlay-container",children:e.map((g)=>m("button",{type:"button",onClick:()=>r(g.id),className:`shrink-0 rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors cursor-pointer ${g.id===p.id?"bg-ink/10 text-ink":"text-ink/55 hover:bg-ink/5 hover:text-ink"}`,children:g.label},g.id))}),m("div",{className:"w-full rounded-lg border border-ink/10 divide-y divide-ink/5",children:[a.trim()?f.map((g)=>m(Inn,{keys:g.keys,entries:t,groupLabel:g.label,dirtyKeys:i,savingKeys:o,saveErrors:s,onCommit:l,onReset:u,onDirty:d},g.id)):p.groups.map((g)=>{let b=h.filter((y)=>lL[y]?.ui.group===g);if(b.length===0)return null;return m(Inn,{keys:b,entries:t,groupLabel:g,dirtyKeys:i,savingKeys:o,saveErrors:s,onCommit:l,onReset:u,onDirty:d},g)}),h.length===0&&m("div",{className:"px-3 py-6 text-center text-ink/40",children:a.trim()?"No settings match your search.":"No settings in this tab."})]})]})}function Inn({keys:e,entries:t,groupLabel:n,dirtyKeys:r,savingKeys:a,saveErrors:i,onCommit:o,onReset:s,onDirty:l}){return m("div",{children:[m("div",{className:"px-3 py-1.5 bg-ink/[0.02] text-[10px] uppercase tracking-wide text-ink/40 font-medium",children:n}),e.map((u)=>{let d=lL[u];if(!d?.ui)return null;let p=t[u]?.value,h=r.has(u),f=a.has(u),g=i.get(u);return m("div",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[m("div",{className:"min-w-0 flex-1",children:[m("div",{className:"flex items-center gap-1.5",children:[m("span",{className:"font-medium text-ink",children:d.ui.label}),m("span",{className:"font-mono text-[9px] text-ink/30",title:"config key",children:u}),h&&!f&&m("span",{className:"shrink-0 rounded bg-warning/15 px-1 py-px text-[9px] font-semibold text-warning",children:"unsaved"}),f&&m("span",{className:"shrink-0 text-[9px] text-ink/40",children:"saving…"}),g&&!f&&m("span",{className:"shrink-0 rounded bg-error/10 px-1 py-px text-[9px] font-semibold text-error",title:g,children:"save failed"})]}),d.ui.description&&m("div",{className:"text-[10px] text-ink/40 leading-snug",children:d.ui.description}),g&&!f&&m("div",{className:"text-[10px] text-error leading-snug",children:g}),d.ui.warning&&m("div",{className:"text-[10px] text-error/80 leading-snug",children:d.ui.warning})]}),m("div",{className:"flex items-center gap-1.5 shrink-0",children:[m(Rnn,{entryKey:u,entry:d,value:p,initialValue:p,onChangeDirty:l,onCommit:o,saving:f,saveError:Boolean(g)}),m("button",{type:"button","aria-label":`Reset ${d.ui.label}`,title:"Reset to schema default",onClick:()=>s(u),disabled:f,className:`rounded p-1 text-ink/30 hover:text-ink transition-colors cursor-pointer disabled:opacity-40 ${f?"":"hover:bg-ink/5"}`,children:m(Xc,{size:11})}),h&&m(Xt,{size:11,className:"text-ink/30"})]})]},u)})]})}var Pnn=O(()=>{Je();pt();nLe();Nnn();de()});function xzr({role:e,value:t,onCommit:n}){let[r,a]=ae(t),i=rLe[e];return m("div",{className:"flex items-center justify-between gap-3 px-3 py-2.5",children:[m("div",{className:"min-w-0",children:[m("div",{className:"font-medium text-ink",children:i.label}),m("div",{className:"font-mono text-[9px] text-ink/30",children:e})]}),m("input",{"aria-label":`${i.label} (${e}) model`,type:"text",value:r,onChange:(o)=>a(o.currentTarget.value),onBlur:(o)=>n(e,o.currentTarget.value),placeholder:"provider/model",className:"w-56 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono"})]})}function Dnn({modelRoles:e,onSaveRole:t,savedRole:n}){let r=(i,o)=>{let s=o.trim();if((e[i]??"")===s)return;t(i,s)};return m("div",{className:"pt-2",children:[m("div",{className:"flex items-center justify-between pb-2",children:[m("div",{children:[m("h3",{className:"text-sm font-semibold text-ink",children:"Model Roles"}),m("p",{className:"text-ink/50 mt-0.5",children:"Role → model selectors from config.yml. Empty removes the role override."})]}),n&&m("span",{className:"inline-flex items-center gap-1 text-[10px] text-ink/60",children:[m(Xt,{size:11})," saved"]})]}),[{id:"chat",title:"Chat roles",note:"Each takes a chat model. Empty removes the override and omp falls back to its own resolution."},{id:"kind",title:"Model-kind roles",note:"Each takes a model of that kind only — a chat model here is silently unusable."}].map((i)=>{let o=vzr.filter((s)=>rLe[s].section===i.id);return m("div",{className:"mb-3",children:[m("div",{className:"pb-1",children:[m("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-ink/50",children:i.title}),m("div",{className:"text-[10px] text-ink/40 leading-snug",children:i.note})]}),m("div",{className:"rounded-lg border border-ink/10 divide-y divide-ink/5",children:o.map((s)=>m(xzr,{role:s,value:e[s]??"",onCommit:r},s))})]},i.id)})]})}var rLe,vzr;var $nn=O(()=>{Je();pt();de();rLe={default:{label:"Default",section:"chat"},smol:{label:"Fast",section:"chat"},slow:{label:"Thinking",section:"chat"},vision:{label:"Vision",section:"chat"},plan:{label:"Architect",section:"chat"},commit:{label:"Commit",section:"chat"},tiny:{label:"Tiny",section:"chat"},memory:{label:"Memory",section:"chat"},task:{label:"Subtask",section:"chat"},advisor:{label:"Advisor",section:"chat"},image:{label:"Image generation",section:"kind"},web:{label:"Web search",section:"kind"},speech:{label:"Speech (TTS)",section:"kind"},dictation:{label:"Dictation (STT)",section:"kind"},judge:{label:"Judge",section:"kind"}},vzr=Object.keys(rLe)});function Onn({extensions:e,savedExtension:t,onToggle:n}){if(e.length===0)return null;return m("div",{className:"pt-2",children:[m("div",{className:"flex items-center justify-between pb-2",children:[m("div",{children:[m("h3",{className:"text-sm font-semibold text-ink",children:"Extensions"}),m("p",{className:"text-ink/50 mt-0.5",children:"TS/JS modules loaded from .omp/extensions. Disable writes to config.yml."})]}),t&&m("span",{className:"inline-flex items-center gap-1 text-[10px] text-ink/60",children:[m(Xt,{size:11})," saved"]})]}),m("div",{className:"rounded-lg border border-ink/10 divide-y divide-ink/5",children:e.map((r)=>m("div",{className:"flex items-center justify-between gap-3 px-3 py-2.5",children:[m("div",{className:"min-w-0",children:[m("div",{className:"font-medium text-ink",children:r.name}),m("div",{className:"text-[10px] text-ink/40 truncate font-mono",children:[r.sourceRoot," · ",r.filePath]})]}),m("select",{"aria-label":`${r.name} enabled`,value:r.disabled?"false":"true",onChange:()=>n(r),className:"bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink",children:[m("option",{value:"true",children:"enabled"}),m("option",{value:"false",children:"disabled"})]})]},r.id))})]})}var Fnn=O(()=>{pt();de()});function Bnn(e){let[t,n]=ae(null),[r,a]=ae(!1),[i,o]=ae({}),[s,l]=ae({}),[u,d]=ae([]),[p,h]=ae(!0),[f,g]=ae(rie.tabs[0]?.id??"model"),[b,y]=ae(""),[v,x]=ae(null),[k,C]=ae(new Set),[_,w]=ae(new Set),[T,E]=ae(new Map),L=Le(()=>{h(!0),Promise.all([fetch("/api/omp/state").then((B)=>B.json()),fetch("/api/settings/omp-config").then((B)=>B.json()),fetch("/api/model-roles").then((B)=>B.json()),fetch("/api/omp/extensions").then((B)=>B.json())]).then(([B,F,j,z])=>{if(B.running&&B.state)n(B.state);if(a(Boolean(B.running)),F.entries)o(F.entries);if(j.roles&&typeof j.roles==="object")l(j.roles);if(Array.isArray(z.extensions))d(z.extensions)}).catch((B)=>console.error("Failed to load omp settings:",B)).finally(()=>h(!1))},[]);Ee(()=>{L()},[L]);let P=(B)=>{x(B),setTimeout(()=>x((F)=>F===B?null:F),2000)},R=(B,F,j,z)=>{if(w((q)=>{let W=new Set(q);return W.delete(B),W}),C((q)=>{let W=new Set(q);return W.delete(B),W}),F){if(E((q)=>{if(!q.has(B))return q;let W=new Map(q);return W.delete(B),W}),j!==void 0)o((q)=>({...q,[B]:{...q[B],value:j}}));P(B)}else E((q)=>new Map(q).set(B,z??"omp rejected the write"))},M=Le(async(B,F)=>{w((j)=>new Set(j).add(B)),C((j)=>{let z=new Set(j);return z.delete(B),z});try{let z=await(await fetch("/api/settings/omp-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:B,value:F})})).json(),q=Boolean(z.success);return R(B,q,z.value,typeof z.error==="string"?z.error:void 0),q}catch(j){return console.error("Failed to save omp config:",j),R(B,!1,void 0,j instanceof Error?j.message:void 0),!1}},[]),A=Le(async(B)=>{w((F)=>new Set(F).add(B));try{let j=await(await fetch("/api/settings/omp-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:B,action:"reset"})})).json(),z=Boolean(j.success);return R(B,z,j.value,typeof j.error==="string"?j.error:void 0),z}catch(F){return console.error("Failed to reset omp config:",F),R(B,!1,void 0,F instanceof Error?F.message:void 0),!1}},[]),N=Le((B,F)=>{C((j)=>{let z=new Set(j);if(F)z.add(B);else z.delete(B);return z})},[]),I=(B,F)=>{let j={...s};if(F.trim())j[B]=F.trim();else delete j[B];l(j),fetch("/api/model-roles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({roles:j})}).then((z)=>z.json()).then((z)=>{if(z.success)P(`role-${B}`)}).catch((z)=>console.error("Failed to save model roles:",z))},D=(B)=>{fetch("/api/omp/extensions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:B.id,disabled:!B.disabled})}).then((F)=>F.json()).then((F)=>{if(F.success)d((j)=>j.map((z)=>z.id===B.id?{...z,disabled:!B.disabled}:z)),P(`ext-${B.id}`)}).catch((F)=>console.error("Failed to toggle extension:",F))};if(p)return m("div",{className:"flex items-center justify-center p-8 text-ink/40 text-xs",children:"Loading OMP settings..."});return m("div",{className:"w-full space-y-4 text-ink pb-2 text-xs",children:[m("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 pb-3 border-b border-ink/10",children:[m("div",{children:[m("h2",{className:"text-sm font-semibold text-ink",children:"OMP Engine"}),m("p",{className:"text-ink/50 mt-0.5",children:"Live agent state and the full native config schema from oh-my-pi."})]}),m("div",{className:"flex items-center gap-2",children:[m("div",{className:"relative",children:[m(na,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-ink/40 pointer-events-none"}),m("input",{"aria-label":"Search settings",type:"text",value:b,onChange:(B)=>y(B.currentTarget.value),placeholder:"Search settings…",className:"w-44 bg-paper border border-ink/15 rounded-md pl-6 pr-6 py-1 text-ink placeholder:text-ink/40"}),b&&m("button",{type:"button","aria-label":"Clear search",onClick:()=>y(""),className:"absolute right-1.5 top-1/2 -translate-y-1/2 text-ink/40 hover:text-ink cursor-pointer",children:m(vn,{size:11})})]}),m("button",{type:"button",onClick:L,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-ink/15 text-ink/70 hover:text-ink hover:bg-ink/5 transition-all cursor-pointer",children:[m(Mn,{size:12})," Refresh"]})]})]}),m("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:[m("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[m("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Engine"}),m("div",{className:"font-semibold text-ink mt-0.5",children:r?"Running":"Idle"})]}),m("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[m("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Model"}),m("div",{className:"font-semibold text-ink mt-0.5 truncate",children:t?.model?.id??"—"})]}),m("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[m("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Thinking"}),m("div",{className:"font-semibold text-ink mt-0.5",children:t?.thinkingLevel??"—"})]}),m("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[m("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Context"}),m("div",{className:"font-semibold text-ink mt-0.5",children:t?.contextUsage?.percent!=null?`${t.contextUsage.percent.toFixed(1)}%`:"—"})]})]}),m("div",{className:"pt-1",children:[m("div",{className:"flex items-center justify-between pb-2",children:[m("div",{children:[m("h3",{className:"text-sm font-semibold text-ink",children:"Config"}),m("p",{className:"text-ink/50 mt-0.5",children:["Schema-driven settings backed by ",m("span",{className:"font-mono",children:"omp config"}),".",b.trim()&&" — matching keys only"]})]}),v&&!v.startsWith("role-")&&!v.startsWith("ext-")&&m("span",{className:"inline-flex items-center gap-1 text-[10px] text-ink/60",children:["saved ",v]})]}),m(Mnn,{tabs:rie.tabs,entries:i,activeTabId:f,onSelectTab:g,searchQuery:b,dirtyKeys:k,savingKeys:_,saveErrors:T,onCommit:M,onReset:A,onDirty:N})]}),m(Dnn,{modelRoles:s,onSaveRole:I,savedRole:v?.startsWith("role-")?v.slice(5):null}),m(Onn,{extensions:u,savedExtension:v?.startsWith("ext-")?v.slice(4):null,onToggle:D})]})}var znn=O(()=>{Je();pt();nLe();Pnn();$nn();Fnn();de()});function jnn({activeMetrics:e}){return m("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-2.5 items-stretch",children:[m(xo,{value:e.processedTokens,label:"Processed tokens",hint:e.activeRate}),m(xo,{value:e.cachedInput,label:"Cached input",hint:e.cachedPercent}),m(xo,{value:e.uncachedInput,label:"Uncached input",hint:"0 cache writes"}),m(xo,{value:e.outputTokens,label:"Output",hint:e.reasoning}),m(xo,{value:e.cacheSavings,label:"Cache savings",hint:"0.0x the raw token cost",tone:"muted",className:"col-span-2 sm:col-span-1"})]})}var Unn=O(()=>{D9();de()});function Wnn({breakdownTab:e,setBreakdownTab:t,activeBreakdownRows:n,activeMetrics:r,cadence:a}){return m("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-3",children:[m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs xl:col-span-2",children:[m("div",{className:"flex justify-between items-center mb-3",children:[m("span",{className:"font-semibold text-xs text-ink",children:"Breakdown"}),m("div",{className:"flex bg-ink/5 rounded p-0.5",children:[m("button",{onClick:()=>t("model"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${e==="model"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"MODEL"}),m("button",{onClick:()=>t("day"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${e==="day"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:qnn[a]}),m("button",{onClick:()=>t("project"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${e==="project"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"PROJECT"})]})]}),m("div",{className:"overflow-x-auto",children:m("table",{className:"w-full text-[11px]",children:[m("thead",{children:m("tr",{className:"text-ink/40 border-b border-ink/10",children:[m("th",{className:"font-medium text-left pb-2 capitalize",children:e==="day"?qnn[a].toLowerCase():e}),m("th",{className:"font-medium text-right pb-2",children:"Cost"}),m("th",{className:"font-medium text-right pb-2",children:"Share"}),m("th",{className:"font-medium text-right pb-2",children:"Tokens"})]})}),m("tbody",{className:"divide-y divide-ink/5",children:n.map((i)=>m("tr",{children:[m("td",{className:"py-2.5 flex items-center gap-2",children:[m("div",{className:`w-1.5 h-1.5 rounded-full ${i.dotColorClass}`}),m("span",{className:"font-semibold text-ink whitespace-nowrap",children:i.name})]}),m("td",{className:"py-2.5 text-right font-bold text-ink",children:i.cost}),m("td",{className:"py-2.5 text-right text-ink/60",children:i.share}),m("td",{className:"py-2.5 text-right text-ink/60",children:i.tokens})]},i.name))})]})}),m("div",{className:"h-1.5 w-full bg-ink/5 rounded-full mt-3 overflow-hidden flex",children:n.map((i,o)=>m("div",{className:`h-full ${o===0?"bg-ink/80":o===1?"bg-ink/45 border-l border-paper":"bg-ink/20 border-l border-paper"}`,style:{width:`${i.sharePercent}%`}},i.name))})]}),m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs xl:col-span-1",children:[m("div",{className:"font-semibold text-xs mb-3 text-ink",children:"Cost quality"}),m("div",{className:"space-y-2 text-[11px]",children:[m("div",{className:"flex justify-between items-center",children:[m("span",{className:"text-ink/60",children:"Provider reported"}),m("span",{className:"font-semibold text-ink",children:"100.0%"})]}),m("div",{className:"flex justify-between items-center",children:[m("span",{className:"text-ink/60",children:"Model priced"}),m("span",{className:"font-semibold text-ink",children:"0.0%"})]}),m("div",{className:"flex justify-between items-center",children:[m("span",{className:"text-ink/60",children:"Unpriced"}),m("span",{className:"font-semibold text-ink",children:"0.0%"})]})]}),m("div",{className:"border-t border-ink/10 mt-3 pt-2.5",children:m("div",{className:"flex justify-between items-center text-[11px]",children:[m("span",{className:"text-ink/60",children:"Cache savings"}),m("span",{className:"font-semibold text-ink",children:r.cacheSavings})]})})]})]})}var qnn;var Gnn=O(()=>{de();qnn={daily:"DAY",weekly:"WEEK",monthly:"MONTH"}});function kzr(e,t,n){if(e.length===0)return"";if(e.length===1)return"M0,98 L100,98";let r=n>0?n:1;return e.map((a,i)=>{let o=i/(e.length-1)*100,s=98-t[i]/r*94;return`${i===0?"M":"L"}${o.toFixed(2)},${s.toFixed(2)}`}).join(" ")}function Hnn({cadence:e,metric:t,series:n}){let r=n.map((p)=>t==="cost"?p.cost:p.tokens),a=r.length>0?Math.max(...r):0,i=kzr(n,r,a),o=t==="cost"?tI(a)||"$0.00":dm(a)??"0",s=t==="cost"?tI(a/2)||"$0.00":dm(a/2)??"0",l=n[0]?.label??"",u=n.length>2?n[Math.floor(n.length/2)]?.label??"":"",d=n.length>1?n[n.length-1]?.label??"":"";if(n.length===0)return m("div",{className:"h-28 flex items-center justify-center text-[11px] text-ink/40",children:"No usage data in this period"});return m("div",{className:"h-28 relative",children:[m("div",{className:"absolute inset-0 flex flex-col justify-between pt-1 pb-4",children:[m("div",{className:"border-t border-ink/5 w-full border-dashed"}),m("div",{className:"border-t border-ink/5 w-full border-dashed"}),m("div",{className:"border-t border-ink/15 w-full"})]}),m("div",{className:"absolute left-0 top-0 bottom-4 flex flex-col justify-between text-[9px] font-mono text-ink/40 w-9",children:[m("span",{children:o}),m("span",{children:s}),m("span",{children:"0"})]}),m("div",{className:"absolute left-10 right-0 bottom-4 top-0 flex items-end",children:m("svg",{className:"w-full h-full",preserveAspectRatio:"none",viewBox:"0 0 100 100",children:m("path",{d:i,fill:"none",stroke:"currentColor",className:"text-ink/60 transition-all duration-300",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),m("div",{className:"absolute left-10 right-0 bottom-0 h-4 flex justify-between text-[9px] text-ink/40 items-end",children:[m("span",{children:l}),u&&m("span",{children:u}),m("span",{children:d})]}),m("span",{className:"sr-only",children:`${e} ${t} trend`})]})}var Vnn=O(()=>{de()});function Znn({settings:e,onUpdate:t}){let[n,r]=ae("daily"),[a,i]=ae("30d"),[o,s]=ae(!1),[l,u]=ae("cost"),[d,p]=ae("model"),[h,f]=ae(!1),g=new Date().toISOString().slice(0,10),b=new Date(Date.now()-2592000000).toISOString().slice(0,10),[y,v]=ae(b),[x,k]=ae(g),[C,_]=ae([]),[w,T]=ae(null),[E,L]=ae([]),[P,R]=ae([]),M=Re(null);Yr(M,()=>s(!1));let A=Le(()=>{f(!0);let B=a==="custom"?`&customFrom=${y}&customTo=${x}`:"";fetch(`/api/telemetry/tokens?timeRange=${a}&breakdownTab=${d}&cadence=${n}${B}`).then((F)=>F.json()).then((F)=>{if(F.timeRanges)_(F.timeRanges);if(F.metrics)T(F.metrics);if(F.breakdownRows)L(F.breakdownRows);if(F.chartSeries)R(F.chartSeries)}).catch((F)=>console.error("Failed to load token telemetry:",F)).finally(()=>f(!1))},[a,d,n,y,x]);Ee(()=>{A()},[A]);let N=()=>{A()},I=C.find((B)=>B.id===a)||C[0]||{id:a,label:a,dateRange:"Current Period"},D=a==="custom"?`${y} to ${x}`:I.dateRange;if(!w)return m("div",{className:"flex items-center justify-center p-8 text-ink/40 text-xs",children:"Loading token usage telemetry..."});return m("div",{className:"w-full space-y-4 text-ink pb-2 text-xs",children:[m("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 pb-3 border-b border-ink/10",children:[m("div",{className:"flex items-center gap-2",children:m("span",{className:"text-xs font-semibold text-ink/75",children:D})}),m("div",{className:"flex flex-wrap items-center gap-2",children:[m("div",{className:"flex items-center bg-paper border border-ink/15 rounded-md text-[11px] font-medium overflow-hidden",children:[m("button",{onClick:()=>r("daily"),className:`px-2.5 py-1 transition-colors ${n==="daily"?"bg-ink/10 text-ink font-semibold":"text-ink/65 hover:bg-ink/5 hover:text-ink"}`,children:"Daily"}),m("button",{onClick:()=>r("weekly"),className:`px-2.5 py-1 transition-colors ${n==="weekly"?"bg-ink/10 text-ink font-semibold":"text-ink/65 hover:bg-ink/5 hover:text-ink"}`,children:"Weekly"}),m("button",{onClick:()=>r("monthly"),className:`px-2.5 py-1 transition-colors ${n==="monthly"?"bg-ink/10 text-ink font-semibold":"text-ink/65 hover:bg-ink/5 hover:text-ink"}`,children:"Monthly"})]}),m("div",{className:"relative",ref:M,children:[m("button",{onClick:()=>s(!o),className:"flex items-center gap-1.5 px-2.5 py-1 bg-paper border border-ink/15 rounded-md text-[11px] font-medium hover:bg-ink/5 text-ink/80 transition-colors",children:[m("span",{children:I.label}),m(Zn,{size:12,className:`transition-transform duration-150 ${o?"rotate-180":""}`})]}),o&&m("div",{className:"absolute right-0 top-full mt-1 w-44 bg-paper border border-ink/15 rounded-md shadow-lg z-30 py-1 text-[11px] divide-y divide-ink/5",children:[C.map((B)=>m("button",{onClick:()=>{if(i(B.id),B.id!=="custom")s(!1)},className:`w-full flex items-center justify-between px-3 py-1.5 text-left hover:bg-ink/5 transition-colors ${a===B.id?"font-semibold text-ink bg-ink/5":"text-ink/70"}`,children:[m("span",{children:B.label}),a===B.id&&m(Xt,{size:12,className:"text-ink"})]},B.id)),a==="custom"&&m("div",{className:"px-3 py-2 space-y-2",children:[m("label",{className:"block",children:[m("span",{className:"text-[9px] font-mono uppercase tracking-wider text-ink/40",children:"From"}),m("input",{type:"date",value:y,max:x,onChange:(B)=>v(B.currentTarget.value),className:"mt-0.5 w-full bg-paper border border-ink/15 rounded px-1.5 py-1 text-[11px] text-ink focus:outline-none focus:border-ink/40"})]}),m("label",{className:"block",children:[m("span",{className:"text-[9px] font-mono uppercase tracking-wider text-ink/40",children:"To"}),m("input",{type:"date",value:x,min:y,max:g,onChange:(B)=>k(B.currentTarget.value),className:"mt-0.5 w-full bg-paper border border-ink/15 rounded px-1.5 py-1 text-[11px] text-ink focus:outline-none focus:border-ink/40"})]}),m("button",{onClick:()=>s(!1),className:"w-full bg-ink/10 hover:bg-ink/20 text-ink font-semibold rounded px-2 py-1 transition-colors",children:"Apply"})]})]})]}),m("button",{onClick:N,className:"p-1.5 bg-paper border border-ink/15 rounded-md hover:bg-ink/5 text-ink/80 transition-colors",title:"Refresh Token Telemetry",children:m(Mn,{size:12,className:h?"animate-spin text-ink":""})})]})]}),m("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:[m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs flex flex-col justify-between",children:[m("div",{children:[m("div",{className:"text-[10px] font-mono font-semibold text-ink/40 tracking-wider uppercase mb-2",children:"USAGECONFIG.RAWTOKENCOST"}),m("div",{className:"flex items-baseline gap-1 mb-0.5",children:[m("span",{className:"text-2xl font-bold tracking-tight text-ink",children:w.rawCost}),m("span",{className:"text-xs font-semibold text-ink/50",children:"*"})]}),m("p",{className:"text-[11px] text-ink/50 mb-4",children:"* if billed at full API rate"})]}),m("div",{children:[m("div",{className:"h-1.5 w-full bg-ink/10 rounded-full mb-2 overflow-hidden flex",children:m("div",{className:"h-full bg-ink/80 rounded-full",style:{width:"100%"}})}),m("div",{className:"flex items-center justify-between text-[11px]",children:[m("div",{className:"flex items-center gap-1.5",children:[m("div",{className:"w-2 h-2 rounded-full bg-ink/80"}),m("span",{className:"font-semibold text-ink",children:"DeepSeek"})]}),m("div",{className:"flex items-center gap-3 text-ink/70",children:[m("span",{className:"font-bold text-ink",children:w.rawCost}),m("span",{children:"100.0% share"}),m("span",{children:w.processedTokens})]})]})]})]}),m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs flex flex-col",children:[m("div",{className:"flex justify-between items-start mb-3",children:[m("div",{className:"flex items-center gap-2",children:[m("span",{className:"font-semibold text-xs text-ink capitalize",children:[n," ",l]}),m("div",{className:"flex items-center gap-1",children:[m("div",{className:"w-1.5 h-1.5 rounded-full bg-ink/80"}),m("span",{className:"text-[11px] text-ink/60",children:"DeepSeek"})]})]}),m("div",{className:"flex bg-ink/5 rounded p-0.5",children:[m("button",{onClick:()=>u("cost"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${l==="cost"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"COST"}),m("button",{onClick:()=>u("tokens"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${l==="tokens"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"TOKENS"})]})]}),m(Hnn,{cadence:n,metric:l,series:P})]})]}),m(jnn,{activeMetrics:w}),m(Wnn,{breakdownTab:d,setBreakdownTab:p,activeBreakdownRows:E,activeMetrics:w,cadence:n}),m("div",{className:"text-center text-[10px] text-ink/40 pt-2",children:["Scanned ",w.scannedTranscripts," transcripts (1 outside the window) · ",w.usageRecords," usage records · 0.1s"]})]})}var Knn=O(()=>{Je();pt();Unn();Gnn();Vnn();So();de()});function _zr({provider:e,selected:t}){return m("span",{className:t?"text-ink/80":"text-ink/60",children:m(To,{slug:e.id,name:e.name,size:14})})}function Ynn({report:e,selectedProviderId:t,onSelectProvider:n}){let r=iL(e);return m("div",{className:"w-full md:w-64 md:border-r border-ink/10 h-full flex flex-col bg-paper/50 flex-shrink-0 select-none",children:[m("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex items-center justify-between",children:m("span",{className:"text-xs font-semibold text-ink",children:[r.length," provider",r.length===1?"":"s"," with keys"]})}),m("div",{className:"flex-1 scrollbar-overlay-container p-1.5 space-y-3 text-xs",children:r.length===0?m("p",{className:"px-2.5 py-3 text-[11px] text-ink/50 leading-relaxed",children:"No provider credentials detected. Add an API key in Settings → Providers."}):m("div",{children:[m("div",{className:"px-2.5 pt-1.5 pb-1 text-[10px] font-bold text-ink/50 uppercase tracking-wider",children:"Providers"}),m("div",{className:"space-y-0.5",children:r.map((a)=>{let i=a.id===t;return m("button",{type:"button",onClick:()=>n(a.id),className:`w-full text-left px-2.5 py-2 rounded-lg transition-colors cursor-pointer flex flex-col gap-0.5 group ${i?"bg-ink/10 text-ink font-medium shadow-2xs":"text-ink/80 hover:bg-ink/5 hover:text-ink"}`,children:[m("div",{className:"flex items-center justify-between gap-1.5",children:[m("div",{className:"flex items-center gap-1.5 min-w-0",children:[m("div",{className:"relative",children:[m(_zr,{provider:a,selected:i}),m("span",{className:`absolute -top-0.5 -right-0.5 w-1.5 h-1.5 rounded-full ${a.error?"bg-error/60":"bg-ink"}`})]}),m("span",{className:"font-semibold text-xs text-ink truncate",children:a.name})]}),m("span",{className:`text-[10px] font-mono uppercase px-1.5 py-0.5 rounded bg-ink/10 font-medium ${a.error?"text-error":"text-ink/70"}`,children:oL(a)})]}),m("p",{className:"text-[11px] text-ink/60 line-clamp-1 leading-snug pl-5",children:a.hint})]},a.id)})})]})})]})}var Xnn=O(()=>{Lz();mh();de()});function Jnn(){let e=Sd(),{report:t,isLoading:n,error:r,reload:a}=Xae(),[i,o]=ae(""),s=t?iL(t):[],l=s.find((u)=>u.id===i)??s[0];if(Ee(()=>{if(l&&l.id!==i)o(l.id)},[l,i]),r&&!t)return m("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-8 text-center text-xs",children:[m(Qn,{size:16,className:"text-error"}),m("p",{className:"text-error text-xs",children:r}),m("button",{type:"button",onClick:()=>a(),className:"text-[11px] font-semibold text-ink/70 hover:text-ink underline underline-offset-2",children:"Try again"})]});if(!t)return m("div",{className:"flex h-full w-full items-center justify-center text-ink/40 text-xs",children:"Loading provider usage..."});return m("div",{className:"flex h-full w-full overflow-hidden bg-paper text-xs text-ink",children:m(Td,{pane:e.pane,onBack:e.back,listLabel:"Usage",list:m(Ynn,{report:t,selectedProviderId:l?.id??"",onSelectProvider:(u)=>{o(u),e.openDetail()}}),detail:m("div",{className:"flex-1 h-full overflow-hidden flex flex-col",children:[m("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex items-center justify-between gap-3 flex-shrink-0",children:[m("div",{className:"flex items-center gap-2 min-w-0",children:[m("span",{className:"text-xs font-semibold text-ink/75 truncate",children:["Updated ",V0(t.generatedAt)]}),t.isMock&&m("span",{className:"text-[10px] font-mono uppercase tracking-wider bg-ink/5 border border-ink/15 rounded px-1.5 py-0.5 text-ink/60",children:"Mock"})]}),m("button",{type:"button",onClick:()=>a({force:!0}),disabled:n,className:"p-1.5 bg-paper border border-ink/15 rounded-md hover:bg-ink/5 text-ink/80 transition-colors disabled:opacity-50 flex-shrink-0",title:"Refresh usage",children:m(Mn,{size:12,className:n?"animate-spin text-ink":""})})]}),m("div",{className:"flex-1 overflow-y-auto scrollbar-overlay-container p-3.5 space-y-4",children:[r&&m("p",{className:"text-error text-xs",children:r}),l?m(Kae,{summary:l.summary}):m("p",{className:"text-[11px] text-ink/50 leading-relaxed",children:"No provider credentials detected. Add an API key in Settings → Providers and it will appear here."}),m(Yae,{})]})]})})})}var Qnn=O(()=>{Je();pt();Xnn();Lz();X9e();J9e();hy();Q9e();rv();ov();de()});function ern({settings:e,onUpdate:t}){let[n,r]=ae(!1),a=()=>{r(!0),FU(),setTimeout(()=>r(!1),600)},i=e.chatCompletionSound??e.soundAlerts??!0;return m("div",{className:"w-full space-y-6 text-xs text-ink",children:m("div",{className:"bg-paper border border-ink/15 rounded-lg p-4 shadow-xs space-y-4",children:[m("div",{className:"flex items-start justify-between gap-4",children:[m("div",{className:"flex items-start gap-3",children:[m("div",{className:"w-8 h-8 rounded-md bg-ink/5 border border-ink/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:i?m(c6,{size:16,className:"text-ink"}):m(jN,{size:16,className:"text-ink/40"})}),m("div",{children:[m("div",{className:"text-sm font-semibold text-ink flex items-center gap-2",children:[m("span",{children:"AI Response Completion Sound"}),m("span",{className:"text-[10px] uppercase font-mono px-1.5 py-0.5 rounded bg-ink/10 text-ink/80 font-bold",children:"Audio Chime"})]}),m("p",{className:"text-ink/65 text-[11px] mt-1 leading-relaxed",children:"Play an audible notification chime when the AI completes generating its response, thinking blocks, or diagnostic execution."})]})]}),m("button",{type:"button",role:"switch","aria-checked":i,onClick:()=>{let o=!i;if(t({chatCompletionSound:o,soundAlerts:o}),o)FU()},className:`relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none ${i?"bg-ink":"bg-ink/20"}`,children:m("span",{"aria-hidden":"true",className:`pointer-events-none inline-block h-5 w-5 transform rounded-full bg-paper shadow ring-0 transition duration-200 ease-in-out ${i?"translate-x-5":"translate-x-0"}`})})]}),m("div",{className:"pt-3 border-t border-ink/10 flex items-center justify-between",children:[m("span",{className:"text-[11px] text-ink/60 flex items-center gap-1.5",children:[m(ji,{size:13,className:"text-ink/60"}),"Warm harmonic chime synthesized natively via Web Audio"]}),m("button",{type:"button",onClick:a,className:`px-3 py-1.5 rounded-md border border-ink/20 bg-paper hover:bg-ink/5 text-ink font-medium text-[11px] flex items-center gap-1.5 transition-all shadow-xs active:scale-95 ${n?"border-ink bg-ink/10":""}`,children:[m(c6,{size:13,className:n?"animate-bounce text-ink":"text-ink/70"}),m("span",{children:n?"Playing...":"Test Sound"})]})]})]})})}var trn=O(()=>{Je();pt();QN();de()});function Czr({isOpen:e,onClose:t,initialCategory:n="appearance",appSettings:r={},autoOpenAddProvider:a=!1}){let[i,o]=ae(n),[s,l]=ae(a),[u,d]=ae(""),[p,h]=ae(!1),[f,g]=ae(null),[b,y]=ae("success"),v=dU(),{isReloading:x,reload:k}=hze(),{isRestarting:C,restart:_}=gze(),w=(I,D="success")=>{g(I),y(D),setTimeout(()=>g((B)=>B===I?null:B),3000)},[T,E]=ae(()=>TBe(wzr,r));Ee(()=>{if(e)o(n),l(a),h(a),d("")},[e,n,a]),Ds("omp:open-settings",(I)=>{let D=I;if(D.detail?.category)o(D.detail.category);if(D.detail?.autoOpenAdd)l(!0)});let L=(I)=>{E((D)=>{let B=typeof I==="function"?I(D):{...D,...I};if(typeof document<"u"&&B.theme)TU(B.theme);if(typeof window<"u"&&B.editorFont!==D.editorFont)window.dispatchEvent(new CustomEvent(NU,{detail:B.editorFont}));return v(LBe(D,B,I)),B}),w("Setting was saved")},P=async()=>{let I=await k();w(I.message,I.ok?"success":"error")},R=async()=>{let I=await _();w(I.message,I.ok?"success":"error")},M=(I)=>{o(I),h(!0)};if(!e)return null;let A=PU.find((I)=>I.id===i)||PU[0],N=()=>{switch(i){case"appearance":return m(Gze,{settings:T,onUpdate:L});case"chats":return m(nje,{settings:T,onUpdate:L});case"projects":return m(Rje,{});case"providers":return m(aqe,{autoOpenAdd:s,onAddModalClose:()=>l(!1)});case"agents":return m(uqe,{settings:T,onUpdate:L});case"behavior":return m(fqe,{});case"commands":return m(kqe,{settings:T,onUpdate:L});case"mcp":return m(Nqe,{settings:T,onUpdate:L});case"token-usage":return m(Znn,{settings:T,onUpdate:L});case"notifications":return m(ern,{settings:T,onUpdate:L});case"plugins":return m(Yqe,{});case"panel-plugins":return m(dnn,{});case"skills":return m(Oqe,{settings:T,onUpdate:L,onNavigateToCatalog:()=>o("skills-catalog")});case"skills-catalog":return m(bnn,{});case"omp":return m(Bnn,{settings:T,onUpdate:L});case"usage":return m(Jnn,{});default:return m(vnn,{category:i})}};return m("div",{className:"fixed inset-0 bg-ink/40 backdrop-blur-[2px] z-50 flex items-center justify-center p-0 md:p-6 animate-in fade-in duration-150",onClick:t,children:m("div",{className:"relative bg-paper border border-ink/15 md:rounded-2xl shadow-2xl w-full h-full md:max-w-4xl lg:max-w-5xl xl:max-w-[1150px] md:h-[782px] md:max-h-[92vh] flex flex-col md:flex-row overflow-hidden text-ink",onClick:(I)=>I.stopPropagation(),children:[m("div",{className:"hidden md:flex w-64 flex-shrink-0 h-full",children:m(Wce,{activeCategory:i,onSelectCategory:(I)=>o(I),searchQuery:u,onSearchChange:d,onReloadOmp:P,isReloading:x,onRestartKabmo:R,isRestarting:C,className:"w-full"})}),m("div",{className:`flex-1 flex-col h-full bg-paper overflow-hidden ${p?"flex":"hidden md:flex"}`,children:[m("div",{className:"px-6 border-b border-ink/10 flex items-center justify-between flex-shrink-0 bg-paper",style:{height:"calc(4rem + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",paddingLeft:"max(1.5rem, env(safe-area-inset-left, 0px))",paddingRight:"max(1.5rem, env(safe-area-inset-right, 0px))"},children:[m("div",{className:"flex items-center space-x-3 min-w-0",children:[m("button",{type:"button",onClick:()=>h(!1),className:"md:hidden p-1.5 -ml-2 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink","aria-label":"Back to categories",children:m(Ay,{size:20})}),m("div",{className:"truncate",children:[m("h3",{className:"font-semibold text-base tracking-tight text-ink leading-tight",children:A.label}),m("p",{className:"text-[11px] text-ink/60 truncate hidden sm:block",children:A.description})]})]}),m("button",{type:"button",onClick:t,className:"p-1.5 rounded-lg text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer","aria-label":"Close settings",children:m(vn,{size:18,strokeWidth:2.2})})]}),m("div",{className:`flex-1 scrollbar-overlay-container w-full ${["projects","providers","agents","behavior","commands","mcp","plugins","skills","skills-catalog","usage","panel-plugins"].includes(i)?"p-0 flex flex-col":"p-6 md:p-8 flex flex-col"}`,style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:m("div",{className:"w-full h-full flex-1 flex flex-col",children:N()})})]}),m("div",{className:`flex-1 flex-col h-full bg-canvas md:hidden ${p?"hidden":"flex"}`,children:[m("div",{className:"px-4 border-b border-ink/10 flex items-center justify-between flex-shrink-0 bg-canvas",style:{height:"calc(3.5rem + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",paddingLeft:"max(1rem, env(safe-area-inset-left, 0px))",paddingRight:"max(1rem, env(safe-area-inset-right, 0px))"},children:[m("span",{className:"font-bold text-sm tracking-tight text-ink",children:"Settings"}),m("button",{type:"button",onClick:t,className:"p-1.5 rounded-lg text-ink/50 hover:text-ink","aria-label":"Close",children:m(vn,{size:18})})]}),m("div",{className:"flex-1 overflow-hidden",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:m(Wce,{activeCategory:i,onSelectCategory:M,searchQuery:u,onSearchChange:d,onReloadOmp:P,isReloading:x,onRestartKabmo:R,isRestarting:C,className:"w-full border-r-0"})})]}),f&&m("div",{className:"absolute bottom-6 left-1/2 transform -translate-x-1/2 bg-ink text-canvas px-4 py-2 rounded-lg text-xs font-semibold shadow-lg animate-in fade-in slide-in-from-bottom-2 z-50 flex items-center space-x-2 max-w-[calc(100%-2rem)]",children:[b==="error"?m(Qn,{size:14,className:"text-error shrink-0"}):m(Xt,{size:14,className:"text-success shrink-0"}),m("span",{children:f})]})]})})}var wzr;var nrn=O(()=>{Je();pt();Cd();Ece();fze();bze();m6();bb();fk();MU();yb();Fze();Hze();rje();Nje();iqe();dqe();gqe();_qe();Iqe();Fqe();Xqe();pnn();ynn();xnn();znn();Knn();Qnn();trn();de();wzr={theme:P5,editorFont:JN,autoSessionTitle:!0,soundAlerts:!0,chatCompletionSound:!0,goalAuditEnabled:!0,goalAuditModel:"",goalDefaultBudget:null,followUpBehavior:"queue",keybindingSend:"Enter",keybindingNewLine:"Shift + Enter",keybindingSteering:"Ctrl / Cmd + Enter"}});function kT({isOpen:e,...t}){if(!e)return null;return m(Is,{fallback:null,children:m(Szr,{isOpen:e,...t})})}var Szr;var aie=O(()=>{Ma();de();Szr=Mi(()=>Promise.resolve().then(() => (nrn(),{})).then((e)=>({default:Czr})))});var iie;var aLe=O(()=>{iie={name:"@kabmo-labs/kabmo",version:"0.3.1",description:"Web console and diagnostic workbench for AI coding agents — Elysia + Preact on Bun.",license:"UNLICENSED",author:"Wijanarko Putra Rajeb <wijanarko.rajeb@gmail.com>",type:"module",engines:{bun:">=1.4.0"},publishConfig:{access:"public"},bin:{kabmo:"./src/cli/kabmo.js"},repository:{type:"git",url:"git+https://github.com/kabmo-labs/kabmo.git"},homepage:"https://github.com/kabmo-labs/kabmo#readme",bugs:{url:"https://github.com/kabmo-labs/kabmo/issues"},keywords:["kabmo","coding-agent","agent","console","elysia","preact","bun"],files:["src","extensions","index.html","bunfig.toml","public","tsconfig.json","marketplace","dist/client"],scripts:{dev:"bun run --hot src/server/index.ts --kabmo-server","dev:lan":"HOST=0.0.0.0 bun run --hot src/server/index.ts --kabmo-server",build:"bun run scripts/build-client.ts","omp:schema":"bun run scripts/omp-schema.mjs","omp:schema:check":"bun run scripts/omp-schema.mjs --check",start:"NODE_ENV=production bun run src/server/index.ts --kabmo-server",typecheck:"tsc",clean:"rm -rf dist",lint:"tsc --noEmit",test:"bun test","test:e2e":"playwright test --config tests/e2e/playwright.config.ts","readme:media":"bun run scripts/readme-media.ts","typecheck:e2e":"tsc --noEmit -p tests/e2e","publish:plugins":"bash .github/scripts/publish-plugin-packages.sh packages/kabmo-sdk packages/kabmo-ui"},dependencies:{"@fontsource/fira-code":"^5.3.0","@kabmo-labs/kabmo-sdk":"workspace:*","@kabmo-labs/kabmo-ui":"workspace:*","@shikijs/langs":"^4.4.3","@shikijs/themes":"^4.4.3","@tailwindcss/postcss":"^4.1.14","@xterm/addon-fit":"^0.11.0","@xterm/addon-webgl":"^0.19.0","@xterm/xterm":"^6.0.0",dompurify:"^3.4.15",elysia:"^1.4.30",katex:"^0.18.7","lucide-preact":"^1.47.0",mammoth:"^1.13.0",marked:"^18.0.11","marked-linkify-it":"^4.0.2",mermaid:"^12.0.0",postcss:"^8.5.16",preact:"^10.29.8","read-excel-file":"^9.3.12",remend:"^1.3.1",ripgrep:"^0.3.1",shiki:"^4.4.3",tailwindcss:"^4.1.14",yaml:"^2.9.1"},devDependencies:{"@playwright/test":"^1.64.0","@semantic-release/changelog":"^7.0.0","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/git":"^11.0.1","@semantic-release/github":"^12.0.10","@semantic-release/npm":"^13.2.0","@semantic-release/release-notes-generator":"^14.1.1","@types/bun":"^1.4.2","@types/node":"^22.14.0","bun-types":"^1.4.2","conventional-changelog-conventionalcommits":"^9.3.1","happy-dom":"^20.14.5","semantic-release":"^25.0.9",typescript:"~5.8.2"},workspaces:["packages/*"]}});function rrn({className:e=""}){return m("svg",{viewBox:"0 0 64 64",className:`inline-block h-[1.1009em] w-auto flex-none [vertical-align:-0.1982em] ${e}`,style:{height:"1.5625cap",verticalAlign:"-0.28125cap",marginRight:"-0.28em"},"aria-hidden":"true",focusable:"false",children:[m("rect",{width:"64",height:"64",rx:"14",style:{fill:"var(--color-brand-tile)"}}),m("g",{fill:"none",strokeWidth:7,strokeLinecap:"round",strokeLinejoin:"round",children:[m("path",{d:"M20 15v34",style:{stroke:"var(--color-brand-cream)"}}),m("path",{d:"M20 32 42 15",style:{stroke:"var(--color-brand)"}}),m("path",{d:"M20 32 42 49",style:{stroke:"var(--color-brand-cream)"}})]})]})}var arn=O(()=>{de()});function mg({className:e="text-[15px]"}){return m("span",{className:`font-extrabold tracking-tight ${e}`,children:[m(rrn,{}),m("span",{className:"sr-only",children:"K"}),m("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-amber-500 to-orange-600",style:{paddingRight:"0.06em",marginRight:"-0.06em"},children:"ab"}),m("span",{className:"text-ink",style:{marginLeft:"0.02em"},children:"mo"})]})}var _T=O(()=>{arn();de()});function irn(){return m("div",{className:"flex flex-col items-center gap-4 mt-6 pt-1",children:[m("div",{className:"flex items-center justify-center gap-6",children:[m("a",{href:"https://discord.gg/TWYp6K2jd",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[m("svg",{className:"w-4 h-4 fill-current",viewBox:"-1.611 -1.611 27.223 27.223",children:m("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994.021-.041.001-.09-.041-.106a13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.929 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.894.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.028zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})}),m("span",{children:"Discord"})]}),m("a",{href:"https://www.instagram.com/kabmo-labs/",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[m("svg",{className:"w-4 h-4 fill-current",viewBox:"0 0 24 24",children:m("path",{d:"M7.0301.084c-1.2768.0602-2.1487.264-2.911.5634-.7888.3075-1.4575.72-2.1228 1.3877-.6652.6677-1.075 1.3368-1.3802 2.127-.2954.7638-.4956 1.6365-.552 2.914-.0564 1.2775-.0689 1.6882-.0626 4.947.0062 3.2586.0206 3.6671.0825 4.9473.061 1.2765.264 2.1482.5635 2.9107.308.7889.72 1.4573 1.388 2.1228.6679.6655 1.3365 1.0743 2.1285 1.38.7632.295 1.6361.4961 2.9134.552 1.2773.056 1.6884.069 4.9462.0627 3.2578-.0062 3.668-.0207 4.9478-.0814 1.28-.0607 2.147-.2652 2.9098-.5633.7889-.3086 1.4578-.72 2.1228-1.3881.665-.6682 1.0745-1.3378 1.3795-2.1284.2957-.7632.4966-1.636.552-2.9124.056-1.2809.0692-1.6898.063-4.948-.0063-3.2583-.021-3.6668-.0817-4.9465-.0607-1.2797-.264-2.1487-.5633-2.9117-.3084-.7889-.72-1.4568-1.3876-2.1228C21.2982 1.33 20.628.9208 19.8378.6165 19.074.321 18.2017.1197 16.9244.0645 15.6471.0093 15.236-.005 11.977.0014 8.718.0076 8.31.0215 7.0301.0839m.1402 21.6932c-1.17-.0509-1.8053-.2453-2.2287-.408-.5606-.216-.96-.4771-1.3819-.895-.422-.4178-.6811-.8186-.9-1.378-.1644-.4234-.3624-1.058-.4171-2.228-.0595-1.2645-.072-1.6442-.079-4.848-.007-3.2037.0053-3.583.0607-4.848.05-1.169.2456-1.805.408-2.2282.216-.5613.4762-.96.895-1.3816.4188-.4217.8184-.6814 1.3783-.9003.423-.1651 1.0575-.3614 2.227-.4171 1.2655-.06 1.6447-.072 4.848-.079 3.2033-.007 3.5835.005 4.8495.0608 1.169.0508 1.8053.2445 2.228.408.5608.216.96.4754 1.3816.895.4217.4194.6816.8176.9005 1.3787.1653.4217.3617 1.056.4169 2.2263.0602 1.2655.0739 1.645.0796 4.848.0058 3.203-.0055 3.5834-.061 4.848-.051 1.17-.245 1.8055-.408 2.2294-.216.5604-.4763.96-.8954 1.3814-.419.4215-.8181.6811-1.3783.9-.4224.1649-1.0577.3617-2.2262.4174-1.2656.0595-1.6448.072-4.8493.079-3.2045.007-3.5825-.006-4.848-.0608M16.953 5.5864A1.44 1.44 0 1 0 18.39 4.144a1.44 1.44 0 0 0-1.437 1.4424M5.8385 12.012c.0067 3.4032 2.7706 6.1557 6.173 6.1493 3.4026-.0065 6.157-2.7701 6.1506-6.1733-.0065-3.4032-2.771-6.1565-6.174-6.1498-3.403.0067-6.156 2.771-6.1496 6.1738M8 12.0077a4 4 0 1 1 4.008 3.9921A3.9996 3.9996 0 0 1 8 12.0077"})}),m("span",{children:"Instagram"})]}),m("a",{href:"https://www.threads.com/@kabmo-labs",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[m("svg",{className:"w-4 h-4 fill-current",viewBox:"0 0 24 24",children:m("path",{d:"M18.263 11.097c-.03-3.486-1.92-5.586-5.111-5.586-2.13 0-3.922.963-4.863 2.499l2.062 1.438c.535-.843 1.272-1.543 2.628-1.543 1.528 0 2.318.85 2.544 2.431a15 15 0 0 0-2.236-.173c-4.125 0-6.068 1.867-6.068 4.336s1.943 3.99 4.804 3.99c3.139 0 5.013-2.115 5.781-4.735.798.361 1.348 1.204 1.348 2.47 0 3.387-3.907 5.232-7.22 5.232-4.885 0-8.077-3.207-8.077-8.424 0-6.392 4.223-10.487 9.9-10.487 3.808 0 5.69 1.671 6.97 3.914l2.108-1.475C21.44 2.078 18.331 0 13.663 0 6.227 0 1.168 5.277 1.168 12.934c0 7 4.953 11.066 10.856 11.066 4.878 0 9.809-2.846 9.809-7.716 0-2.545-1.46-4.231-3.569-5.187m-6.33 4.855c-1.077 0-2.026-.512-2.026-1.453 0-1.483 1.822-1.934 3.606-1.934.678 0 1.34.045 1.927.173-.422 1.927-1.671 3.215-3.508 3.214Z"})}),m("span",{children:"Threads"})]})]}),m("div",{className:"flex items-center justify-center gap-6",children:m("a",{href:"https://github.com/kabmo-labs/kabmo",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[m("svg",{className:"w-4 h-4 fill-current",viewBox:"1.902 1.902 20.196 20.196",children:m("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.53 1.032 1.53 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"})}),m("span",{children:"GitHub"})]})})]})}var orn=O(()=>{de()});function oie(e,t){let n=(e.pending+t).split(`
|
|
5000
5000
|
`),r=n.pop()??"";if(n.length===0)return{...e,pending:r};let a=[...e.lines,...n],i=e.truncated,o=a.reduce((l,u)=>l+u.length+1,0),s=0;while(o>20000&&s<a.length-1)o-=(a[s]?.length??0)+1,s+=1;if(s>0)a=a.slice(s),i=!0;return{lines:a,pending:r,truncated:i}}function srn(e){return(e.pending?[...e.lines,e.pending]:e.lines).join(`
|
|
5001
5001
|
`)}function lrn({state:e,active:t}){let n=Re(null),r=srn(e);if(Ee(()=>{let a=n.current;if(a)a.scrollTop=a.scrollHeight},[r]),!r&&!t)return null;return m("div",{className:"mt-2.5",children:[m("div",{className:"mb-1 flex items-center gap-1.5 text-[10px] text-ink/50",children:[t?m(nn,{size:11,className:"animate-spin motion-reduce:animate-none"}):m(Da,{size:11}),m("span",{children:t?"Updating…":"Update output"}),e.truncated&&m("span",{className:"text-ink/35",children:"· older lines trimmed"})]}),m("pre",{ref:n,className:"max-h-40 overflow-auto rounded-md border border-ink/10 bg-canvas px-2 py-1.5 font-mono text-[10px] leading-4 whitespace-pre-wrap break-words text-ink/70 select-text",children:r||"…"})]})}var crn=O(()=>{Je();pt();de()});function Ezr(){let e=cs(urn);return typeof e==="string"&&e.trim().length>0?e.trim():null}function drn(e,t=Ezr()){if(!e)return!1;return e!==t}function prn(e){om(urn,e)}var urn="omp_update_popup_version",cL="omp:update-popup",uL="omp:update-request";var dL=O(()=>{Cd()});function Azr({target:e,info:t,applying:n,disabled:r,onApply:a}){let i=e==="kabmo"?"Kabmo":"Oh-My-Pi",o=`v${t.current??"…"} → v${t.latest??"…"}`;return m("div",{className:"flex items-center justify-between gap-3 border-t border-ink/10 py-2.5 first:border-t-0",children:[m("div",{className:"min-w-0",children:[m("p",{className:"text-xs font-medium text-ink",children:i}),m("p",{className:"font-mono text-[10px] text-ink/60",children:t.installed?o:"not detected"})]}),t.installed?m("button",{type:"button",onClick:()=>a(e),disabled:r,className:wT,children:[n?m(nn,{size:12,className:"animate-spin motion-reduce:animate-none"}):m(xi,{size:12}),m("span",{children:"Update"})]}):m("span",{className:"shrink-0 text-[10px] text-ink/40",children:"not detected"})]})}function mrn({updates:e,onToast:t}){let n=e.info?[{target:"kabmo",info:e.info.kabmo},{target:"omp",info:e.info.omp}].filter(({info:i})=>i.updateAvailable&&i.latest!==null):[],r=async(i)=>{let o=await e.apply(i);if(!t)return;if(!o)return;t(o.message,o.success&&!o.manual?"success":"error")},a=Boolean(e.info&&!e.checking&&!e.error);return m("section",{className:"mt-5 border-y border-ink/10 py-3 text-left","aria-labelledby":"updates-heading",children:[m("div",{className:"flex items-center justify-between gap-3",children:[m("h3",{id:"updates-heading",className:"text-xs font-semibold text-ink",children:"Updates"}),e.info&&m("span",{className:"font-mono text-[9px] text-ink/40",children:"checked"})]}),e.progress&&m(lrn,{state:e.progress,active:e.applying!==null}),m("div",{className:"mt-2.5",children:[e.checking&&m("button",{type:"button",disabled:!0,className:`${wT} w-full justify-center`,children:[m(nn,{size:13,className:"animate-spin motion-reduce:animate-none"}),m("span",{children:"Checking…"})]}),e.error&&!e.checking&&m("div",{className:"flex items-start gap-2",children:[m(Qn,{size:14,className:"mt-0.5 shrink-0 text-error"}),m("div",{className:"min-w-0 flex-1",children:[m("p",{className:"text-[11px] leading-4 text-error",children:e.error}),m("button",{type:"button",onClick:()=>void e.check(),className:`${wT} mt-2`,children:[m(Mn,{size:12}),m("span",{children:"Retry"})]})]})]}),!e.info&&!e.checking&&!e.error&&m("button",{type:"button",onClick:()=>void e.check(),className:`${wT} w-full justify-center`,children:[m(Mn,{size:13}),m("span",{children:"Check for updates"})]}),a&&n.length===0&&m("div",{className:"flex items-center justify-between gap-3",children:[m("p",{className:"flex items-center gap-1.5 text-[11px] text-success",children:[m(Xt,{size:13}),m("span",{children:"You're up to date"})]}),m("button",{type:"button",onClick:()=>void e.check(),className:wT,children:[m(Mn,{size:12}),m("span",{children:"Check again"})]})]}),a&&n.length>0&&m("div",{children:[n.map(({target:i,info:o})=>m(Azr,{target:i,info:o,applying:e.applying===i,disabled:e.applying!==null,onApply:(s)=>void r(s)},i)),e.info?.kabmo.updateAvailable&&m("button",{type:"button",onClick:()=>window.dispatchEvent(new CustomEvent(cL)),disabled:e.applying!==null,className:`${wT} mt-2 w-full justify-center`,children:[m(ji,{size:12}),m("span",{children:["What's new in ",e.info.kabmo.latest]})]}),m("button",{type:"button",onClick:()=>void e.check(),disabled:e.applying!==null,className:`${wT} mt-2 w-full justify-center`,children:[m(Mn,{size:12}),m("span",{children:"Check again"})]})]})]})]})}var wT="inline-flex items-center gap-1.5 rounded-md border border-ink/20 px-2.5 py-1.5 text-[11px] font-medium text-ink transition-colors hover:border-ink/40 disabled:cursor-not-allowed disabled:opacity-50";var hrn=O(()=>{pt();crn();dL();de()});function Iz({isOpen:e,onClose:t,updates:n,onToast:r}){if(Ds(cL,()=>{if(e)t()}),!e)return null;return Co(m("div",{className:"fixed inset-0 bg-ink/40 backdrop-blur-[2px] z-50 flex items-center justify-center p-4 animate-in fade-in duration-200",onClick:t,children:m("div",{className:"relative bg-paper border border-ink/15 rounded-2xl shadow-2xl w-full max-w-[340px] p-6 text-center text-ink select-none",onClick:(a)=>a.stopPropagation(),children:[m("button",{onClick:t,className:"absolute top-4 right-4 text-ink/40 hover:text-ink transition-colors p-1 rounded-md","aria-label":"Close",children:m(vn,{size:18,className:"stroke-[2.5]"})}),m("div",{className:"flex justify-center pt-2 pb-1",children:m("img",{src:"/icon.svg",alt:"Kabmo",width:96,height:96,draggable:!1})}),m("h2",{className:"text-xl font-bold tracking-tight mt-3 flex items-center justify-center",children:m(mg,{className:"text-2xl"})}),m("div",{className:"text-xs text-ink/60 space-y-1 mt-1.5 font-mono",children:[m("p",{children:["Kabmo v",iie.version]}),m("p",{children:["Oh-My-Pi ",n.info?.omp.current??"…"]})]}),m(mrn,{updates:n,onToast:r}),m(irn,{}),m("p",{className:"text-[11px] text-ink/50 font-normal mt-8 flex items-center justify-center gap-1.5",children:[m(Lg,{size:12,className:"fill-current text-error shrink-0","aria-hidden":"true"}),"Made with love for the community"]})]})}),document.body)}var frn=O(()=>{Ma();pt();aLe();_T();orn();hrn();yb();dL();de()});async function sie(e){let t=e?`?path=${encodeURIComponent(e)}`:"",n=await fetch(`/api/fs/browse${t}`),r=await n.json();if(!n.ok||r.error)throw Error(r.error||`HTTP ${n.status}`);return r}function grn({initialPath:e,onSelect:t,onClose:n}){let[r,a]=ae(e??""),[i,o]=ae(""),[s,l]=ae([]),[u,d]=ae(null),[p,h]=ae(!0),[f,g]=ae(null),[b,y]=ae(null),v=Re(null),x=Le(async(E)=>{h(!0),g(null);try{let L=await sie(E);a(L.path??E??""),d(L.parentPath??null),o(L.path??E??""),l(L.directories??[])}catch(L){g(L instanceof Error?L.message:String(L))}finally{h(!1)}},[]);Ee(()=>{x(e)},[e,x]);let k=()=>{if(u)x(u)},C=(E)=>{E.preventDefault();let L=i.trim();if(L)x(L)},_=(E)=>{x(E.path)},w=(E)=>{y(E.path),t(E.path)},T=()=>{if(r)y(r),t(r)};return m("div",{className:"fixed inset-0 bg-ink/30 z-[60] flex items-center justify-center p-4",onClick:n,children:m("div",{className:"bg-paper border border-ink/15 rounded-lg shadow-2xl w-full max-w-lg flex flex-col overflow-hidden",onClick:(E)=>E.stopPropagation(),children:[m("div",{className:"flex items-center justify-between px-4 py-3 border-b border-ink/10",children:[m("h3",{className:"font-semibold text-sm flex items-center space-x-2",children:[m(wd,{size:15,className:"text-ink/70"}),m("span",{children:"Choose Project Folder"})]}),m("button",{type:"button",onClick:n,className:"p-1 rounded hover:bg-ink/10 text-ink/60 hover:text-ink transition-colors","aria-label":"Close picker",children:m(vn,{size:15})})]}),m("div",{className:"px-4 py-2 border-b border-ink/10 bg-canvas/50",children:[m("form",{onSubmit:C,className:"flex items-center space-x-2",children:[m(Iu,{size:14,className:"text-ink/40 flex-shrink-0"}),m("input",{ref:v,type:"text",value:i,onChange:(E)=>o(E.currentTarget.value),placeholder:"~ or /absolute/path",className:"flex-1 bg-transparent outline-none text-xs font-mono text-ink placeholder-ink/30 py-1",spellcheck:!1}),m("button",{type:"submit",className:"px-2 py-1 rounded bg-ink/5 border border-ink/10 text-[11px] font-medium hover:bg-ink/10 transition-colors",children:"Go"})]}),m("div",{className:"flex items-center space-x-1 mt-1 text-[11px] text-ink/40 truncate",children:[m("button",{type:"button",onClick:()=>void x(),className:"hover:text-ink transition-colors flex items-center",children:[m(Iu,{size:11,className:"mr-0.5"})," home"]}),r.split("/").filter(Boolean).map((E,L,P)=>{let R="/"+r.split("/").filter(Boolean).slice(0,L+1).join("/"),M=L===P.length-1;return m("span",{className:"flex items-center space-x-1 min-w-0",children:[m(bi,{size:10,className:"text-ink/20 flex-shrink-0"}),M?m("span",{className:"text-ink/70 truncate",children:E}):m("button",{type:"button",onClick:()=>void x(R),className:"hover:text-ink transition-colors truncate max-w-[120px]",children:E})]},R)})]})]}),m("div",{className:"flex-1 min-h-[240px] max-h-[360px] scrollbar-overlay-container p-2",children:p?m("div",{className:"flex items-center justify-center h-40 text-ink/40",children:m(nn,{size:18,className:"animate-spin"})}):f?m("div",{className:"flex flex-col items-center justify-center h-40 text-xs text-red-600 space-y-2 px-4",children:[m("span",{children:f}),m("button",{type:"button",onClick:()=>void x(r||void 0),className:"px-2 py-1 rounded bg-ink/5 border border-ink/10 text-ink/70 hover:bg-ink/10 flex items-center space-x-1",children:[m(Mn,{size:11})," Retry"]})]}):s.length===0?m("div",{className:"text-center py-16 text-xs text-ink/40",children:"No subfolders"}):s.map((E)=>m("div",{className:`group flex items-center justify-between px-2.5 py-2 rounded cursor-pointer transition-colors ${b===E.path?"bg-ink/10":"hover:bg-ink/5"}`,onDblClick:()=>_(E),children:[m("button",{type:"button",onClick:()=>_(E),className:"flex items-center space-x-2 min-w-0 flex-1 text-left",children:[m(Pi,{size:15,className:"text-ink/50 flex-shrink-0"}),m("span",{className:"text-xs truncate text-ink/85",children:E.name})]}),m("button",{type:"button",onClick:()=>w(E),className:"touch-shown-flex hidden group-hover:flex px-2 py-0.5 rounded bg-ink text-canvas text-[10px] font-semibold hover:bg-ink/80 transition-colors flex-shrink-0",children:"Choose"})]},E.path))}),m("div",{className:"flex items-center justify-between px-4 py-3 border-t border-ink/10",children:[m("div",{className:"flex items-center space-x-2 min-w-0",children:[m("button",{type:"button",onClick:k,disabled:!u,className:"px-2.5 py-1.5 rounded bg-ink/5 border border-ink/10 text-[11px] font-medium hover:bg-ink/10 disabled:opacity-40 transition-colors flex items-center space-x-1",children:[m("span",{children:"↑"}),m("span",{children:"Up"})]}),m("button",{type:"button",onClick:()=>void x(),className:"px-2.5 py-1.5 rounded bg-ink/5 border border-ink/10 text-[11px] font-medium hover:bg-ink/10 transition-colors",children:"Home"})]}),m("div",{className:"flex items-center space-x-2",children:[m("button",{type:"button",onClick:n,className:"px-3 py-1.5 text-xs font-medium text-ink/60 hover:text-ink transition-colors",children:"Cancel"}),m("button",{type:"button",onClick:T,disabled:!r,className:"px-3.5 py-1.5 text-xs font-medium bg-ink text-canvas rounded hover:bg-ink/90 disabled:opacity-50 transition-colors",children:"Use This Folder"})]})]})]})})}var brn=O(()=>{Je();pt();de()});function yrn({value:e,onInput:t,onSubmit:n,onRefresh:r,onNewFolder:a,loading:i,creating:o,resolved:s}){return m("div",{children:[m("div",{className:"flex items-center space-x-2",children:[m("form",{onSubmit:(u)=>{u.preventDefault(),n()},className:"flex-1 flex items-center bg-paper border border-ink/20 rounded overflow-hidden focus-within:border-ink/50",children:[m("div",{className:"px-2 text-ink/40 bg-ink/5 h-full flex items-center border-r border-ink/10",children:m(Iu,{size:14})}),m("input",{type:"text",value:e,onChange:(u)=>t(u.currentTarget.value),placeholder:"~/projects/my-project",spellcheck:!1,"aria-label":"Project path",className:"w-full px-3 py-2 outline-none text-sm bg-transparent font-mono"})]}),m("button",{type:"button",onClick:r,disabled:i,title:"Refresh folders","aria-label":"Refresh folders","aria-busy":i,className:"px-2.5 py-2 bg-ink/5 border border-ink/10 rounded text-ink/70 hover:bg-ink/10 hover:text-ink disabled:opacity-40 transition-colors flex-shrink-0",children:m(Mn,{size:13,className:i?"animate-spin":void 0})}),m("button",{type:"button",onClick:a,disabled:o||i||!s,title:"New folder here","aria-label":"New folder here","aria-busy":o,className:"px-2.5 py-2 bg-ink/5 border border-ink/10 rounded text-ink/70 hover:bg-ink/10 hover:text-ink disabled:opacity-40 transition-colors flex-shrink-0",children:o?m(nn,{size:13,className:"animate-spin"}):m(Ag,{size:13})})]}),s&&s!==e.trim()&&m("p",{className:"mt-1 text-[10px] text-ink/40 font-mono truncate",children:["Listing: ",s]})]})}var vrn=O(()=>{pt();de()});function xrn({directories:e,loading:t,error:n,onOpen:r,onRetry:a,creating:i,name:o,onNameChange:s,onCreate:l,onCancelCreate:u,createError:d,creatingBusy:p}){return m("div",{className:"border border-ink/15 rounded overflow-hidden",children:[i&&m("form",{onSubmit:(f)=>{if(f.preventDefault(),o.trim())l(o.trim())},className:"flex items-center space-x-1.5 px-2 py-1.5 border-b border-ink/10 bg-ink/5",children:[m(Pi,{size:13,className:"text-ink/40 flex-shrink-0"}),m("input",{type:"text",value:o,onChange:(f)=>s(f.currentTarget.value),placeholder:"new-folder-name","aria-label":"New folder name",spellcheck:!1,className:"flex-1 bg-paper border border-ink/20 rounded px-2 py-1 outline-none focus:border-ink/50 text-xs"}),m("button",{type:"submit",disabled:p||!o.trim(),className:"px-2 py-1 rounded bg-ink text-canvas text-[11px] font-medium hover:bg-ink/90 disabled:opacity-40 transition-colors",children:p?"Creating…":"Create"}),m("button",{type:"button",onClick:u,"aria-label":"Cancel new folder",className:"p-1 rounded text-ink/40 hover:text-ink hover:bg-ink/10 transition-colors",children:m(vn,{size:12})})]}),i&&d&&m("p",{className:"px-2.5 py-1.5 text-[11px] text-error border-b border-ink/10",children:d}),m("div",{className:"max-h-52 overflow-y-auto scrollbar-overlay-container",children:t?m("div",{className:"flex items-center justify-center py-8 text-ink/40",children:m(nn,{size:16,className:"animate-spin"})}):n?m("div",{className:"flex flex-col items-center justify-center py-6 px-3 text-xs text-error space-y-2",children:[m("span",{className:"text-center",children:n}),m("button",{type:"button",onClick:a,className:"px-2 py-1 rounded bg-ink/5 border border-ink/10 text-ink/70 hover:bg-ink/10 flex items-center space-x-1",children:[m(Mn,{size:11})," ",m("span",{children:"Retry"})]})]}):e.length===0?m("div",{className:"text-center py-8 text-xs text-ink/40",children:"No subfolders"}):e.map((f)=>m("button",{type:"button",onClick:()=>r(f),title:f.path,className:"w-full flex items-center space-x-2 px-2.5 py-1.5 text-left hover:bg-ink/5 transition-colors group",children:[m(Pi,{size:14,className:"text-ink/50 flex-shrink-0"}),m("span",{className:"text-xs truncate text-ink/85 flex-1",children:f.name}),m(Du,{size:11,className:"text-ink/20 group-hover:text-ink/50 flex-shrink-0 transition-colors"})]},f.path))})]})}var krn=O(()=>{pt();de()});function _rn(e){let t=e.trim();if(!t||/\s/.test(t))return!1;if(/^https?:\/\/\S+$/i.test(t))return!0;if(/^ssh:\/\/\S+$/i.test(t))return!0;if(/^git@[^:/\s]+:\S+$/.test(t))return!0;if(/^file:\/\/\S+$/i.test(t))return!0;if(t.startsWith("/")||t.startsWith("~"))return!0;if(/^[a-z]:[\\/]/i.test(t))return!0;if(/^\\\\[^\\]+\\/.test(t))return!0;return!1}function wrn(e){let r=e.replace(/^[a-z]:/i,"").replace(/\\/g,"/").replace(/\/+$/,"").split(/[/:]/).filter(Boolean),a=r.length===0?"":r[r.length-1];if(a===""||/^[a-z]+:$/i.test(a)||/^https?:?$/i.test(a))return"";return a.replace(/\.git$/i,"").replace(/[^a-z0-9._-]/gi,"-")}function Crn({parent:e,busy:t,onClone:n}){let[r,a]=ae(""),i=r.trim(),o=_rn(i),s=o?wrn(i):"",l=()=>{if(o&&!t)n(i)};return m("div",{children:[m("label",{className:"block text-xs font-semibold mb-1 text-ink",children:["Clone Git Repository"," ",m("span",{className:"text-ink/40 font-normal",children:"(optional — clones into the path above)"})]}),m("div",{className:"flex items-center space-x-2",children:[m("input",{type:"text",value:r,onChange:(u)=>a(u.currentTarget.value),onKeyDown:(u)=>{if(u.key==="Enter")u.preventDefault(),l()},disabled:t,placeholder:"https://github.com/org/repo.git",spellcheck:!1,"aria-label":"Git repository URL",className:"flex-1 bg-paper border border-ink/20 rounded px-3 py-2 outline-none focus:border-ink/50 text-sm font-mono disabled:opacity-60"}),m("button",{type:"button",onClick:l,disabled:!o||t,title:o?`Clone into ${e}/${s}`:"Enter an https, ssh, git@ or local path","aria-label":"Clone repository",className:"px-3 py-2 bg-ink/5 border border-ink/10 rounded text-xs font-medium hover:bg-ink/10 disabled:opacity-40 transition-colors flex items-center space-x-1.5 flex-shrink-0",children:[t?m(nn,{size:13,className:"animate-spin"}):m(nN,{size:13}),m("span",{children:t?"Cloning…":"Clone"})]})]}),o&&s&&!t&&m("p",{className:"mt-1 text-[10px] text-ink/40 font-mono truncate",children:["Creates workspace “",s.toLowerCase(),"” at ",e,"/",s]})]})}var Srn=O(()=>{Je();pt();de()});function Trn(e){let[t,n]=ae(e??""),[r,a]=ae([]),[i,o]=ae(null),[s,l]=ae(!1),[u,d]=ae(null),p=Re(0),h=Le(async(g)=>{let b=++p.current;l(!0),d(null);try{let y=await sie(g);if(b!==p.current)return;n(y.path??g??""),o(y.parentPath??null),a(y.directories??[])}catch(y){if(b!==p.current)return;d(y instanceof Error?y.message:String(y)),a([])}finally{if(b===p.current)l(!1)}},[]);Ee(()=>{h(e||void 0)},[h]);let f=Le(()=>h(t||void 0),[h,t]);return{current:t,directories:r,parentPath:i,loading:s,error:u,navigate:h,refresh:f}}var Ern=O(()=>{Je()});function Mz({isOpen:e,onClose:t,onCreate:n,onClone:r}){if(!e)return null;return m(Lzr,{onClose:t,onCreate:n,onClone:r})}function Lzr({onClose:e,onCreate:t,onClone:n}){let[r,a]=ae("create"),[i,o]=ae(""),[s,l]=ae(""),[u,d]=ae(!1),[p,h]=ae(null),[f,g]=ae(!1),[b,y]=ae(!1),[v,x]=ae(""),[k,C]=ae(null),[_,w]=ae(!1),T=Trn(),E=async(R)=>{w(!0),C(null);try{let M=await fetch("/api/folders/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parent:T.current,name:R})}),A=await M.json().catch(()=>({}));if(!M.ok||!A.success)throw Error(A.error||`HTTP ${M.status}`);y(!1),await T.refresh()}catch(M){C(M instanceof Error?M.message:String(M))}finally{w(!1)}},L=async()=>{if(!t)return e();if(!i.trim()&&!s.trim()){h("Enter a name or a project path.");return}d(!0),h(null);try{await t({name:i.trim(),path:s.trim()||void 0}),e()}catch(R){h(R instanceof Error?R.message:String(R)),d(!1)}},P=async(R)=>{if(!n)return e();if(!T.current){h("Enter the folder the repository should be cloned into.");return}d(!0),h(null);try{await n({url:R,parent:T.current,name:i.trim()||void 0}),e()}catch(M){h(M instanceof Error?M.message:String(M)),d(!1)}};return m("div",{className:"fixed inset-0 bg-ink/20 z-50 flex items-center justify-center p-4",children:[m("div",{className:"bg-paper border border-ink/10 rounded-lg shadow-xl w-[30rem] max-w-full max-h-full overflow-y-auto flex flex-col",children:[m("div",{className:"flex justify-between items-center px-4 pt-4 pb-2 border-b border-ink/10",children:[m("h3",{className:"font-semibold text-sm",children:"New Workspace"}),m("button",{type:"button",onClick:e,"aria-label":"Close",className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/10 transition-colors",children:m(vn,{size:14})})]}),m("div",{className:"flex px-4 pt-2 space-x-1",children:["create","clone"].map((R)=>m("button",{type:"button",onClick:()=>{a(R),h(null)},"aria-pressed":r===R,className:`px-3 py-1.5 text-xs font-medium rounded-t transition-colors ${r===R?"text-ink border-b-2 border-ink":"text-ink/50 hover:text-ink"}`,children:R==="create"?"Create":"Clone"},R))}),m("div",{className:"px-4 py-3 space-y-3 text-sm text-ink/80",children:[m("div",{children:[m("label",{className:"block text-xs font-semibold mb-1 text-ink",children:["Workspace Name"," ",m("span",{className:"text-ink/40 font-normal",children:r==="clone"?"(optional — defaults to the repository name)":""})]}),m("input",{type:"text",value:i,onChange:(R)=>o(R.currentTarget.value),placeholder:"e.g. bofis-pro",className:"w-full bg-paper border border-ink/20 rounded px-3 py-2 outline-none focus:border-ink/50 text-sm"})]}),m("div",{children:[m("label",{className:"block text-xs font-semibold mb-1 text-ink",children:[r==="clone"?"Clone Into":"Project Path"," ",m("span",{className:"text-ink/40 font-normal",children:r==="create"?"(optional — binds omp sessions)":""})]}),m(yrn,{value:s,onInput:l,onSubmit:()=>void T.navigate(s.trim()||void 0),onRefresh:()=>void T.refresh(),onNewFolder:()=>{x(""),y(!0),C(null)},loading:T.loading,creating:_,resolved:T.current})]}),m(xrn,{directories:T.directories,loading:T.loading,error:T.error,onOpen:(R)=>{l(R.path),T.navigate(R.path)},onRetry:()=>void T.refresh(),creating:b,name:v,onNameChange:x,onCreate:(R)=>void E(R),onCancelCreate:()=>{y(!1),x(""),C(null)},createError:k,creatingBusy:_}),m("div",{className:"flex items-center justify-between",children:[m("button",{type:"button",onClick:()=>g(!0),className:"px-3 py-1.5 bg-ink/5 border border-ink/10 rounded text-xs font-medium hover:bg-ink/10 transition-colors flex items-center space-x-1.5",children:[m(wd,{size:13}),m("span",{children:"Browse…"})]}),T.parentPath&&m("button",{type:"button",onClick:()=>void T.navigate(T.parentPath??void 0),className:"text-[11px] text-ink/50 hover:text-ink transition-colors",children:"↑ Up one level"})]}),r==="clone"&&m(Crn,{parent:T.current,busy:u,onClone:(R)=>void P(R)}),p&&m("div",{className:"text-xs text-error",children:p})]}),m("div",{className:"px-4 py-3 border-t border-ink/10 flex justify-end space-x-2",children:[m("button",{type:"button",className:"px-3 py-1.5 text-xs font-medium text-ink/60 hover:text-ink transition-colors",onClick:e,disabled:u,children:"Cancel"}),r==="create"&&m("button",{type:"button",className:"px-4 py-1.5 text-xs font-medium bg-ink text-canvas rounded hover:bg-ink/90 transition-colors disabled:opacity-50",onClick:()=>void L(),disabled:u,children:u?"Creating…":"Create Workspace"})]})]}),f&&m(grn,{initialPath:s||void 0,onSelect:(R)=>{if(l(R),g(!1),!i.trim()){let M=R.replace(/[\\/]+$/,"").split(/[\\/]/).pop()||"";if(M)o(M)}T.navigate(R)},onClose:()=>g(!1)})]})}var Arn=O(()=>{Je();pt();brn();vrn();krn();Srn();Ern();de()});var iLe=O(()=>{aie();frn();Arn()});async function Rzr(e){let t=await e.json().catch(()=>null);if(!e.ok||!t||t.error)return null;return t.tasks??[]}function Lrn(e){let[t,n]=ae([]),[r,a]=ae(!1),[i,o]=ae(null),s=Le(async()=>{a(!0);try{let b=await Rzr(await fetch("/api/schedule"));if(b)n(b),o(null);else o("Could not load scheduled tasks.")}catch(b){o(b instanceof Error?b.message:String(b))}finally{a(!1)}},[]),l=Ui(Rce,{enabled:e});Ee(()=>{if(!l.data)return;n(l.data),a(!1),o(null)},[l.data]);let u=Le(async(b,y)=>{try{let v=await fetch(b,y),x=await v.json().catch(()=>null);if(!v.ok||!x||x.error){let k=x?.error??`HTTP ${v.status}`;return o(k),k}if(x.tasks)n(x.tasks);return o(null),null}catch(v){let x=v instanceof Error?v.message:String(v);return o(x),x}},[]),d=Le(async(b)=>await u("/api/schedule",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),[u]),p=Le(async(b,y)=>u(`/api/schedule?id=${encodeURIComponent(b)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(y)}),[u]),h=Le(async(b)=>u(`/api/schedule?id=${encodeURIComponent(b)}`,{method:"DELETE"}),[u]),f=Le(async(b)=>await u(`/api/schedule?id=${encodeURIComponent(b)}&run=now`,{method:"POST"}),[u]),g=Le(async(b)=>{try{let y=await fetch(`/api/schedule/${encodeURIComponent(b)}/runs`),v=await y.json().catch(()=>null);return y.ok?v?.runs??[]:[]}catch{return[]}},[]);return{tasks:t,loading:r,error:i,refresh:s,create:d,patch:p,remove:h,runNow:f,loadRuns:g}}function lie(){let e=Ui(Rce);return ut(()=>(e.data??[]).filter((t)=>t.enabled).length,[e.data])}var cie=O(()=>{Je();cm();Ps()});function Nrn(e){let t=e.trim().toLowerCase();if(!t)return null;if(/^\d+(\.\d+)?$/.test(t)){let i=Number(t);return i>0?Math.round(i*60000):null}let n=t.match(/(\d+(?:\.\d+)?)\s*([a-z]+)/g);if(!n)return null;if(n.join("").replace(/\s+/g,"").length!==t.replace(/\s+/g,"").length)return null;let a=0;for(let i of n){let o=i.match(/^(\d+(?:\.\d+)?)\s*([a-z]+)$/);if(!o)return null;let s=Nzr[o[2]];if(!s)return null;a+=Number(o[1])*s}return a>0?Math.round(a):null}function Mzr(e,t,n){let r=new Set;for(let a of e.split(",")){let[i,o]=a.split("/"),s=o===void 0?1:Number(o);if(!Number.isInteger(s)||s<1)return null;let l,u;if(i==="*")l=t,u=n;else if(i.includes("-")){let[d,p]=i.split("-");l=Number(d),u=Number(p)}else l=Number(i),u=o===void 0?l:n;if(!Number.isInteger(l)||!Number.isInteger(u))return null;if(l<t||u>n||l>u)return null;for(let d=l;d<=u;d+=s)r.add(d)}return r.size?[...r].sort((a,i)=>a-i):null}function Pzr(e){let t=e.trim().split(/\s+/);if(t.length!==5)return null;let n=t.map((l,u)=>{let[d,p]=Izr[u];return Mzr(l,d,p)});if(n.some((l)=>l===null))return null;let[r,a,i,o,s]=n;return{minutes:r,hours:a,daysOfMonth:i,months:o,daysOfWeek:[...new Set(s.map((l)=>l===7?0:l))].sort((l,u)=>l-u),domRestricted:t[2].trim()!=="*",dowRestricted:t[4].trim()!=="*"}}function Dzr(e,t){let n=t.getDate(),r=t.getDay(),a=e.daysOfMonth.includes(n),i=e.daysOfWeek.includes(r);if(e.domRestricted&&e.dowRestricted)return a||i;if(e.domRestricted)return a;if(e.dowRestricted)return i;return!0}function Rrn(e,t){for(let n of e)if(n>=t)return n;return null}function $zr(e,t){let n=new Date(t.getTime());n.setSeconds(0,0),n.setMinutes(n.getMinutes()+1);let r=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),a=new Date(r);a.setFullYear(a.getFullYear()+8);for(let i=new Date(r);i.getTime()<=a.getTime();){if(!e.months.includes(i.getMonth()+1)){i=new Date(i.getFullYear(),i.getMonth()+1,1);continue}if(Dzr(e,i)){let o=i.getTime()===r,s=o?n.getHours():0,l=Rrn(e.hours,s);if(l!==null){let u=o&&l===n.getHours()?n.getMinutes():0,d=Rrn(e.minutes,u);if(d!==null)return new Date(i.getFullYear(),i.getMonth(),i.getDate(),l,d,0,0).getTime()}}i=new Date(i.getFullYear(),i.getMonth(),i.getDate()+1)}return null}function Irn(e){let t=e.trim();if(!t)return null;if(/^\d+$/.test(t)){let r=Number(t);return r>0?r:null}let n=Date.parse(t);return Number.isNaN(n)?null:n}function Mrn(e,t,n=Date.now()){if(!t.trim())return{ok:!1,error:"Enter a schedule."};if(e==="once"){let i=Irn(t);if(i===null)return{ok:!1,error:"Use an ISO timestamp, e.g. 2026-10-01T09:00."};if(i<=n)return{ok:!1,error:"That time is already in the past."};return{ok:!0,nextRunAt:i}}if(e==="every"){let i=Nrn(t);if(i===null)return{ok:!1,error:"Use a duration, e.g. 30m, 1h30m, 2 days."};if(i<60000)return{ok:!1,error:"The shortest interval is 1 minute."};return{ok:!0,nextRunAt:n+i}}let r=Pzr(t);if(!r)return{ok:!1,error:"Use 5 fields: minute hour day-of-month month day-of-week."};let a=$zr(r,new Date(n));if(a===null)return{ok:!1,error:"That expression never matches a date."};return{ok:!0,nextRunAt:a}}function Prn(e,t){let n=t.trim();if(e==="once"){let r=Irn(n);return r===null?n:`Once at ${new Date(r).toLocaleString()}`}if(e==="every"){let r=Nrn(n);return r===null?n:`Every ${Ozr(r)}`}return`Cron ${n}`}function Ozr(e){let t=Math.round(e/1000),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),a=Math.floor(t%3600/60),i=t%60,o=[];if(n)o.push(`${n}d`);if(r)o.push(`${r}h`);if(a)o.push(`${a}m`);if(i&&!n)o.push(`${i}s`);return o.length?o.join(" "):"0s"}var Nzr,Izr;var oLe=O(()=>{Nzr={s:1000,sec:1000,secs:1000,second:1000,seconds:1000,m:60000,min:60000,mins:60000,minute:60000,minutes:60000,h:3600000,hr:3600000,hrs:3600000,hour:3600000,hours:3600000,d:86400000,day:86400000,days:86400000,w:604800000,week:604800000,weeks:604800000};Izr=[[0,59],[0,23],[1,31],[1,12],[0,7]]});function zzr(e){let t=e-Date.now();if(t<=0)return"due now";let n=Math.round(t/60000);if(n<60)return`in ${n}m`;let r=Math.round(n/60);if(r<24)return`in ${r}h`;return`in ${Math.round(r/24)}d`}function $rn({folders:e,initial:t,activeSessionId:n,busy:r,onSubmit:a,onCancel:i}){let[o,s]=ae(""),[l,u]=ae(""),[d,p]=ae("every"),[h,f]=ae("1h"),[g,b]=ae(null),[y,v]=ae(!1);Ee(()=>{s(t?.name??""),u(t?.prompt??""),p(t?.kind??"every"),f(t?.spec??"1h"),b(t?.folderId??null),v(Boolean(t?.sessionId))},[t?.id]);let x=Mrn(d,h),k=Boolean(l.trim())&&x.ok&&!r,C=()=>{if(!k||!x.ok)return;a({name:o.trim(),prompt:l.trim(),kind:d,spec:h.trim(),folderId:g,sessionId:y?t?.sessionId??n:null,model:t?.model??null})};return m("div",{className:"space-y-3 text-xs",children:[m("div",{children:[m("label",{className:"block font-semibold mb-1 text-ink",children:["Name ",m("span",{className:"text-ink/40 font-normal",children:"(optional)"})]}),m("input",{type:"text",value:o,onInput:(_)=>s(_.currentTarget.value),placeholder:"Morning standup digest",className:"w-full bg-paper border border-ink/20 rounded px-2.5 py-1.5 outline-none focus:border-ink/50 text-xs"})]}),m("div",{children:[m("label",{className:"block font-semibold mb-1 text-ink",children:"Prompt"}),m("textarea",{value:l,onInput:(_)=>u(_.currentTarget.value),placeholder:"Describe the task, ask a question, or paste commands…",rows:4,className:"w-full bg-paper border border-ink/20 rounded px-2.5 py-1.5 outline-none focus:border-ink/50 text-xs resize-y min-h-[80px]"})]}),m("div",{className:"flex items-end gap-2",children:[m("div",{className:"w-28 flex-shrink-0",children:[m("label",{className:"block font-semibold mb-1 text-ink",children:"Schedule"}),m("select",{value:d,onChange:(_)=>p(_.currentTarget.value),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 outline-none focus:border-ink/50 text-xs",children:Object.keys(Drn).map((_)=>m("option",{value:_,children:Drn[_]},_))})]}),m("div",{className:"flex-1",children:[m("label",{className:"block font-semibold mb-1 text-ink",children:"When"}),m("input",{type:"text",value:h,onInput:(_)=>f(_.currentTarget.value),placeholder:Bzr[d],className:`w-full bg-paper border rounded px-2.5 py-1.5 outline-none text-xs font-mono ${x.ok?"border-ink/20 focus:border-ink/50":"border-error/50 focus:border-error"}`})]})]}),m("p",{className:`text-[11px] ${x.ok?"text-ink/50":"text-error"}`,children:x.ok?`Next run ${zzr(x.nextRunAt)} · ${new Date(x.nextRunAt).toLocaleString()}`:x.error}),m("p",{className:"text-[11px] text-ink/40",children:Fzr[d]}),m("div",{className:"grid grid-cols-2 gap-2",children:[m("div",{children:[m("label",{className:"block font-semibold mb-1 text-ink",children:"Run in"}),m("select",{value:g===null?"":String(g),onChange:(_)=>b(_.currentTarget.value?Number(_.currentTarget.value):null),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 outline-none focus:border-ink/50 text-xs",children:[m("option",{value:"",children:"Server default directory"}),e.map((_)=>m("option",{value:_.id,children:_.name},_.id))]})]}),m("div",{className:"flex items-end",children:m("label",{className:`flex items-center gap-2 text-[11px] ${n?"text-ink/70":"text-ink/30"}`,children:[m("input",{type:"checkbox",checked:y,disabled:!n,onChange:(_)=>v(_.currentTarget.checked),className:"accent-ink"}),m("span",{children:"Resume the open session each run"})]})})]}),m("div",{className:"flex justify-end gap-2 pt-1",children:[m("button",{type:"button",onClick:i,disabled:r,className:"px-3 py-1.5 text-xs font-medium text-ink/60 hover:text-ink transition-colors",children:"Cancel"}),m("button",{type:"button",onClick:C,disabled:!k,className:"inline-flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium bg-ink text-canvas rounded hover:bg-ink/90 transition-colors disabled:opacity-40",children:[r&&m(nn,{size:12,className:"animate-spin"}),t?"Save changes":"Schedule task"]})]})]})}var Drn,Fzr,Bzr;var Orn=O(()=>{Je();pt();oLe();de();Drn={once:"Once",every:"Every",cron:"Cron"},Fzr={once:"An ISO timestamp, e.g. 2026-10-01T09:00",every:"A duration, e.g. 30m, 1h30m, 2 days",cron:"5 fields: minute hour day-of-month month day-of-week"},Bzr={once:"2026-10-01T09:00",every:"1h30m",cron:"0 9 * * 1-5"}});function jzr(e){return e===null?"—":new Date(e).toLocaleString()}function Uzr(e){if(e.name)return e.name;let t=e.prompt.replace(/\s+/g," ").trim();return t.length>60?`${t.slice(0,57)}…`:t||"(empty prompt)"}function Frn({tasks:e,loading:t,pending:n,onRunNow:r,onToggleEnabled:a,onEdit:i,onDelete:o,loadRuns:s}){let[l,u]=ae(null),[d,p]=ae([]),[h,f]=ae(!1);if(Ee(()=>{if(!l)return;let g=!0;return f(!0),s(l).then((b)=>{if(!g)return;p(b),f(!1)}),()=>{g=!1}},[l,s]),e.length===0)return m("div",{className:"px-3 py-8 text-center text-[11px] text-ink/50 border border-dashed border-ink/15 rounded-lg",children:t?"Loading…":"No scheduled tasks yet. Create one above."});return m("ul",{className:"space-y-2",children:e.map((g)=>{let b=n===g.id,y=l===g.id;return m("li",{className:"border border-ink/10 rounded-lg bg-paper",children:[m("div",{className:"flex items-start gap-2 p-2.5",children:[m("span",{className:"mt-0.5 shrink-0","aria-hidden":"true",children:!g.enabled?m(Gy,{size:14,className:"text-ink/40"}):g.lastStatus==="error"?m(Qn,{size:14,className:"text-error"}):g.lastStatus==="success"?m(Ur,{size:14,className:"text-ink/60"}):m(Pu,{size:14,className:"text-ink/60"})}),m("div",{className:"min-w-0 flex-1",children:[m("p",{className:"text-xs font-medium text-ink truncate",children:Uzr(g)}),m("p",{className:"text-[11px] text-ink/60 mt-0.5",children:[Prn(g.kind,g.spec),m("span",{className:"text-ink/30",children:" · "}),!g.enabled?g.kind==="once"&&g.lastRunAt!==null?"Ran once — no next run":"Paused":`Next ${jzr(g.nextRunAt)}`]}),g.cwd&&m("p",{className:"text-[10.5px] text-ink/40 font-mono truncate mt-0.5",children:g.cwd}),g.sessionId&&m("p",{className:"text-[10.5px] text-ink/40 font-mono truncate mt-0.5",children:["resumes ",g.sessionId.slice(0,8)]}),g.lastStatus==="error"&&g.lastError&&m("p",{className:"text-[10.5px] text-error mt-0.5 break-words",children:g.lastError}),g.runCount>0&&m("p",{className:"text-[10.5px] text-ink/40 mt-0.5",children:["Fired ",g.runCount,"×"]})]}),m("div",{className:"flex items-center gap-1 shrink-0",children:[m("button",{type:"button",title:"Run now","aria-label":"Run now",disabled:b,onClick:()=>r(g.id),className:"p-1.5 rounded hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors disabled:opacity-40",children:b?m(nn,{size:13,className:"animate-spin"}):m(Vy,{size:13})}),m("button",{type:"button",title:g.enabled?"Pause":"Resume","aria-label":g.enabled?"Pause":"Resume","aria-pressed":g.enabled,disabled:b,onClick:()=>a(g),className:"p-1.5 rounded hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors disabled:opacity-40",children:m(Mn,{size:13})}),m("button",{type:"button",title:"Edit","aria-label":"Edit",disabled:b,onClick:()=>i(g),className:"p-1.5 rounded hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors disabled:opacity-40",children:m(Rg,{size:13})}),m("button",{type:"button",title:"Delete","aria-label":"Delete",disabled:b,onClick:()=>o(g.id),className:"p-1.5 rounded hover:bg-ink/5 text-ink/60 hover:text-error transition-colors disabled:opacity-40",children:m(Tr,{size:13})})]})]}),m("button",{type:"button",onClick:()=>u(y?null:g.id),"aria-expanded":y,className:"w-full text-left px-2.5 py-1.5 border-t border-ink/5 text-[10.5px] text-ink/50 hover:text-ink transition-colors",children:y?"Hide run history":"Run history"}),y&&m("div",{className:"px-2.5 pb-2.5 space-y-1",children:[h&&m("p",{className:"text-[10.5px] text-ink/40",children:"Loading…"}),!h&&d.length===0&&m("p",{className:"text-[10.5px] text-ink/40",children:"This task has not run yet."}),!h&&d.map((v)=>m("div",{className:"flex items-start gap-2 text-[10.5px]",children:[m("span",{className:"w-16 shrink-0 text-ink/50",children:new Date(v.startedAt).toLocaleTimeString()}),m("span",{className:`w-14 shrink-0 font-medium ${v.status==="error"?"text-error":v.status==="running"?"text-ink/60":"text-ink/70"}`,children:v.status}),m("span",{className:"min-w-0 flex-1 text-ink/60 break-words",children:v.detail||"—"})]},v.id))]})]},g.id)})})}var Brn=O(()=>{Je();pt();oLe();de()});function zrn(){let[e,t]=ae([]);return Ee(()=>{let n=!0;return fetch("/api/settings/projects").then((r)=>r.json()).then((r)=>{if(!n)return;t((r.projects??[]).filter((a)=>typeof a.folderId==="number").map((a)=>({id:a.folderId,name:a.name})))}).catch((r)=>console.error("Failed to load workspace folders:",r)),()=>{n=!1}},[]),e}var jrn=O(()=>{Je()});function uie({isOpen:e,onClose:t,activeSessionId:n=null,onToast:r}){let a=Lrn(e),i=zrn(),[o,s]=ae(null),[l,u]=ae(!1),[d,p]=ae(!1),[h,f]=ae(null);if(Ee(()=>{if(e)return;s(null),u(!1),p(!1),f(null)},[e]),Ee(()=>{let k=(C)=>{if(C.key!=="Escape"||d)return;if(C.preventDefault(),o||l){s(null),u(!1);return}t()};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[t,d,o,l]),!e)return null;let g=async(k)=>{p(!0);let C=o?await a.patch(o.id,k):await a.create(k);if(p(!1),C){r?.(C,"error");return}r?.(o?"Scheduled task updated.":"Scheduled task created.","success"),s(null),u(!1)},b=async(k)=>{f(k.id);let C=await a.patch(k.id,{enabled:!k.enabled});if(f(null),C)r?.(C,"error")},y=async(k)=>{f(k);let C=await a.runNow(k);if(f(null),C){r?.(C,"error");return}r?.("Task dispatched — open the session to watch it run.","success")},v=async(k)=>{f(k);let C=await a.remove(k);if(f(null),C){r?.(C,"error");return}if(o?.id===k)s(null)},x=o!==null||l;return m("div",{className:"fixed inset-0 bg-ink/30 backdrop-blur-[2px] z-50 flex items-center justify-center p-4",onClick:d?void 0:t,role:"dialog","aria-modal":"true","aria-label":"Scheduled tasks",children:m("div",{className:"bg-paper border border-ink/15 rounded-xl shadow-2xl w-[min(94vw,640px)] max-h-[88vh] flex flex-col overflow-hidden text-ink",onClick:(k)=>k.stopPropagation(),children:[m("div",{className:"flex items-center justify-between px-4 py-3 border-b border-ink/10",children:[m("div",{className:"flex items-center gap-2",children:[m(wg,{size:15}),m("h3",{className:"font-semibold text-sm",children:"Scheduled Tasks"})]}),m("button",{type:"button",onClick:t,"aria-label":"Close",className:"p-1.5 -m-1.5 rounded text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors",children:m(vn,{size:16})})]}),m("div",{className:"p-4 overflow-y-auto space-y-4",children:[a.error&&!x&&m("p",{className:"text-[11px] text-error border border-error/30 bg-error/5 rounded px-2.5 py-1.5",children:a.error}),x?m($rn,{folders:i,initial:o,activeSessionId:n,busy:d,onSubmit:g,onCancel:()=>{s(null),u(!1)}}):m("button",{type:"button",onClick:()=>u(!0),className:"w-full py-2 rounded-lg border border-dashed border-ink/20 text-xs font-medium text-ink/70 hover:text-ink hover:border-ink/40 transition-colors",children:"+ New scheduled task"}),!x&&m(Frn,{tasks:a.tasks,loading:a.loading,pending:h,onRunNow:y,onToggleEnabled:b,onEdit:(k)=>s({id:k.id,name:k.name,prompt:k.prompt,kind:k.kind,spec:k.spec,folderId:k.folderId,sessionId:k.sessionId,model:k.model}),onDelete:v,loadRuns:a.loadRuns})]})]})})}var sLe=O(()=>{Je();pt();cie();Orn();Brn();jrn();de()});function die(e=2000){let[t,n]=ae(!1),r=Re(null),a=Le(()=>{if(n(!0),r.current)clearTimeout(r.current);r.current=setTimeout(()=>n(!1),e)},[e]);return Ee(()=>()=>{if(r.current)clearTimeout(r.current)},[]),{copied:t,flagCopied:a}}var lLe=O(()=>{Je()});function qzr({command:e,reason:t}){let{copied:n,flagCopied:r}=die(),a=async()=>{if(await Vh(e))r()};return m("div",{className:"min-w-0 flex-1",children:[m("div",{className:"flex items-center gap-2",children:[m("code",{className:"min-w-0 flex-1 truncate rounded-md border border-ink/15 bg-canvas px-2 py-1.5 font-mono text-[11px] text-ink select-text",children:e}),m("button",{type:"button",onClick:()=>void a(),className:`${pie} border border-ink/20 text-ink hover:border-ink/40`,title:"Copy command","aria-label":"Copy update command",children:n?m(Xt,{size:12,className:"text-success"}):m(yi,{size:12})})]}),m("p",{className:"mt-1 text-[10px] leading-4 text-ink/45",children:["This copy cannot update itself (",t,"). Run the command above, then restart the server."]})]})}function Urn({data:e,updates:t,onClose:n,onRequestUpdate:r}){let a=t.applying!==null,i=Boolean(e?.install.manual&&e.install.command);return m("div",{className:"sticky bottom-0 z-10 border-t border-ink/10 bg-paper px-5 py-3",children:m("div",{className:"flex items-center justify-between gap-3",children:[i?m(qzr,{command:e.install.command,reason:e.install.reason}):m("button",{type:"button",onClick:r,disabled:a,className:`${pie} bg-ink text-canvas hover:bg-ink/90`,children:[m(xi,{size:12}),m("span",{children:a?"Updating…":"Update now"})]}),m("div",{className:"flex shrink-0 items-center gap-2",children:[e?.releaseUrl&&m("a",{href:e.releaseUrl,target:"_blank",rel:"noopener noreferrer",className:`${pie} border border-ink/20 text-ink hover:border-ink/40`,children:[m(so,{size:12}),m("span",{children:"Release notes"})]}),m("button",{type:"button",onClick:n,className:`${pie} text-ink/60 hover:text-ink`,children:"Later"})]})]})})}var pie="inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-[11px] font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50";var qrn=O(()=>{pt();lLe();de()});function Wzr(e){let t=e.target.closest("a[href]");if(!t)return;e.preventDefault(),e.stopPropagation(),window.open(t.href,"_blank","noopener,noreferrer")}function Gzr({note:e}){return m("article",{className:"border-t border-ink/10 pt-4 first:border-t-0 first:pt-0",children:[m("header",{className:"flex items-baseline justify-between gap-3",children:[m("div",{className:"min-w-0",children:[m("h3",{className:"font-mono text-[13px] font-semibold text-ink",children:["v",e.version]}),e.date&&m("p",{className:"font-mono text-[10px] text-ink/40",children:e.date})]}),e.url&&m("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:`${Wrn} shrink-0`,children:[m(so,{size:11}),m("span",{children:"Release"})]})]}),e.body?m(vr,{content:e.body,className:"mt-2 text-[12px]"}):m("p",{className:"mt-2 text-[11px] text-ink/40",children:"This release was published without notes."})]})}function Grn({data:e}){return m("div",{className:"space-y-4",onClick:Wzr,children:[e.truncated&&m("p",{className:"flex flex-wrap items-center gap-1.5 text-[11px] text-ink/50",children:[m("span",{children:["Showing the ",e.versions.length," newest of ",e.total," releases since v",e.current,"."]}),e.releaseUrl&&m("a",{href:e.releaseUrl,target:"_blank",rel:"noopener noreferrer",className:Wrn,children:[m("span",{children:"Full changelog"}),m(so,{size:11})]})]}),e.versions.map((t)=>m(Gzr,{note:t},t.version))]})}var Wrn="inline-flex items-center gap-1 text-[10px] font-medium text-ink/50 hover:text-ink transition-colors";var Hrn=O(()=>{pt();Fo();de()});function Vrn(e){let[t,n]=ae(null),[r,a]=ae(!1),[i,o]=ae(null),[s,l]=ae(0),u=Re(null);Ee(()=>{if(!e)return;let p=new AbortController;return u.current=p,a(!0),o(null),(async()=>{try{let h=await fetch("/api/updates/changelog",{signal:p.signal}),f=await h.json();if(!h.ok)throw Error(`Could not load release notes (HTTP ${h.status})`);n(f),o(f.error)}catch(h){if(p.signal.aborted)return;o(h instanceof Error?h.message:"Could not load release notes")}finally{if(!p.signal.aborted)a(!1)}})(),()=>p.abort()},[e,s]);let d=Le(()=>l((p)=>p+1),[]);return{data:t,loading:r,error:i,reload:d}}var Zrn=O(()=>{Je()});function mie({updates:e}){let[t,n]=ae(!1),[r,a]=ae(!1),i=Re(null);Ds(cL,()=>n(!0));let o=e.info?.kabmo.latest??null,s=Boolean(e.info?.kabmo.updateAvailable&&o);Ee(()=>{if(!s||!o||i.current===o)return;if(i.current=o,!drn(o))return;prn(o),a(!0)},[s,o]);let l=t||r,u=Vrn(l);if(!l)return null;let d=u.data,p=d?.current??e.info?.kabmo.current??null,h=d?.latest??o,f=()=>{a(!1),n(!1)},g=()=>{f(),window.dispatchEvent(new CustomEvent(uL))};return Co(m(Va,{onClose:f,zClass:"z-[65]",maxWidthClass:"max-w-[560px]",header:m("div",{className:"flex items-center gap-3 min-w-0",children:[m(ji,{size:16,className:"shrink-0 text-ink/70"}),m("div",{className:"min-w-0",children:[m("h2",{className:"text-sm font-semibold text-ink",children:"Update available"}),m("p",{className:"font-mono text-[11px] text-ink/50 truncate",children:[p?`v${p} → `:"","v",h??"…"]})]})]}),footer:m(Urn,{data:d,updates:e,onClose:f,onRequestUpdate:g}),children:m("div",{className:"px-5 py-4",children:[u.loading&&m("p",{className:"flex items-center gap-2 text-[11px] text-ink/50",children:[m(Mn,{size:12,className:"animate-spin motion-reduce:animate-none"}),m("span",{children:"Loading release notes…"})]}),!u.loading&&u.error&&m("div",{className:"flex items-start gap-2",children:[m(xi,{size:14,className:"mt-0.5 shrink-0 text-ink/40"}),m("p",{className:"text-[11px] leading-4 text-ink/60",children:u.error})]}),!u.loading&&d&&d.versions.length>0&&m(Grn,{data:d})]})}),document.body)}var cLe=O(()=>{Je();Ma();pt();Qc();qrn();Hrn();Zrn();yb();dL();de()});function pL({status:e}){if(!e)return null;let t=e.connected,n=t?"Realtime channel connected":"Realtime channel disconnected";return m("span",{role:"status","aria-label":n,title:n,className:"flex items-center flex-shrink-0 select-none",children:m("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${t?"bg-success":"bg-error"}`})})}var hie=O(()=>{de()});var fie;var uLe=O(()=>{fie=[{command:"toggleSidebar",label:"Toggle sidebar",mac:{code:"KeyB",meta:!0},other:{code:"KeyB",ctrl:!0}},{command:"toggleEditorPanel",label:"Toggle editor panel",mac:{code:"KeyJ",meta:!0},other:{code:"KeyJ",ctrl:!0}},{command:"toggleRightPanel",label:"Toggle right panel",mac:{code:"KeyJ",meta:!0,alt:!0},other:{code:"KeyJ",ctrl:!0,alt:!0}},{command:"openSettings",label:"Open settings",mac:{code:"Comma",meta:!0},other:{code:"Comma",ctrl:!0}},{command:"saveFile",label:"Save file",mac:{code:"KeyS",meta:!0},other:{code:"KeyS",ctrl:!0}}]});function I2(){return typeof navigator<"u"&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)}function Krn(){return typeof navigator<"u"&&/^Win/i.test(navigator.platform)}function Hzr(e,t){return e.code===t.code&&Boolean(e.meta)===t.metaKey&&Boolean(e.ctrl)===t.ctrlKey&&Boolean(e.alt)===t.altKey&&Boolean(e.shift)===t.shiftKey}function Xrn(e,t){if(t)return e.mac;if(e.windows&&Krn())return e.windows;return e.other}function Vzr(e,t){let n=[];if(e.ctrl)n.push(t?"⌃":"Ctrl");if(e.alt)n.push(t?"⌥":"Alt");if(e.shift)n.push(t?"⇧":"Shift");if(e.meta)n.push(t?"⌘":"Win");return n.push(Zzr(e.code)),t?n.join(""):n.join("+")}function Zzr(e){if(Yrn[e])return Yrn[e];if(e.startsWith("Key"))return e.slice(3);if(e.startsWith("Digit"))return e.slice(5);return e}function mL(e,t=I2()){return Vzr(Xrn(e,t),t)}function hL(e,t,n=I2()){for(let r of e)if(Hzr(Xrn(r,n),t))return r.command;return null}var Yrn;var CT=O(()=>{Yrn={Slash:"/",Backslash:"\\",Comma:",",Period:".",Semicolon:";",Quote:"'",Backquote:"`",Minus:"-",Equal:"=",BracketLeft:"[",BracketRight:"]",Space:"Space",Enter:"Enter",Escape:"Esc",Backspace:"Backspace",Delete:"Del",Tab:"Tab"}});function fy(e,t){let n=fie.find((r)=>r.command===e);return n?`${t} (${mL(n)})`:t}var gie=O(()=>{uLe();CT()});var dLe,Qrn;var ean=O(()=>{dLe=["A-Z","Z-A","LATEST_SESSION","LATEST_ADDED"],Qrn={"A-Z":"A-Z","Z-A":"Z-A",LATEST_SESSION:"Latest Session",LATEST_ADDED:"Latest Added"}});function fL({variant:e,sortOption:t,onSortChange:n}){if(e==="mobile")return m(kt,{children:[m("div",{className:"px-2 py-1 text-[10px] uppercase font-bold text-ink/40 font-mono",children:"Sort Workspaces"}),dLe.map((r)=>m("button",{type:"button",onClick:()=>n(r),className:`w-full text-left px-2.5 py-1.5 rounded-lg flex items-center justify-between transition-colors ${t===r?"bg-ink/10 font-semibold text-ink":"hover:bg-ink/5 text-ink/80"}`,children:[m("span",{children:r.replace("_"," ")}),t===r&&m(Xt,{size:13,className:"text-ink"})]},r))]});return m(kt,{children:[m("div",{className:"px-3 py-1 text-[10px] uppercase font-bold text-ink/40 tracking-wider",children:"Sort Workspaces"}),dLe.map((r)=>m("div",{className:`px-3 py-1.5 text-xs cursor-pointer flex items-center justify-between ${t===r?"bg-ink/5 text-ink font-medium":"text-ink/70 hover:bg-ink/5 hover:text-ink"}`,onClick:()=>n(r),children:[m("span",{children:Qrn[r]}),t===r&&m("div",{className:"w-1.5 h-1.5 rounded-full bg-ink"})]},r))]})}var bie=O(()=>{pt();ean();de()});function yie({actions:e,sortHidden:t,sortOption:n,onSortChange:r,layout:a="desktop"}){let i=a==="mobile",[o,s]=ae(!1),l=Re(null);Yr(l,()=>s(!1)),Ee(()=>{if(!o)return;let d=(p)=>{if(p.key==="Escape")s(!1)};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[o]);let u=(d)=>{s(!1),d.onSelect()};return m("div",{className:"relative shrink-0",ref:l,children:[m("button",{type:"button",title:"More sidebar actions","aria-label":"More sidebar actions","aria-haspopup":"menu","aria-expanded":o,onClick:()=>s(!o),className:`inline-flex items-center justify-center transition-colors cursor-pointer ${i?"w-9.5 h-9.5 rounded-xl border active:scale-95 shadow-xs":"w-7 h-7 rounded border"} ${o?"border-ink/30 bg-ink/10 text-ink":"border-ink/15 bg-paper text-ink/70 hover:bg-ink/5 hover:text-ink"}`,children:m(oo,{size:i?16:14})}),o&&m("div",{role:"menu",className:`absolute right-0 top-full mt-2 w-52 bg-paper border border-ink/15 shadow-lg z-50 py-1 text-xs ${i?"rounded-xl p-2":"rounded-lg"}`,children:[e.map((d)=>m("button",{type:"button",role:"menuitem",onClick:()=>u(d),"aria-pressed":d.active,className:`w-full text-left flex items-center gap-2 transition-colors ${i?"px-2.5 py-1.5 rounded-lg":"px-3 py-1.5"} ${d.active?"bg-ink/5 text-ink font-medium":"text-ink/75 hover:bg-ink/5 hover:text-ink"}`,children:[m(d.icon,{size:13}),m("span",{children:d.label})]},d.id)),t&&m("div",{className:"mt-1 border-t border-ink/10 pt-1",children:m(fL,{variant:a,sortOption:n,onSortChange:r})})]})]})}var pLe=O(()=>{pt();Je();So();bie();de()});function vie(e){let t=Re(null),[n,r]=ae(0);return ma(()=>{let a=t.current;if(!a)return;let i=()=>r(Math.max(0,a.clientWidth-e));if(i(),typeof ResizeObserver>"u")return;let o=new ResizeObserver(i);return o.observe(a),()=>o.disconnect()},[e]),{ref:t,width:n}}var mLe=O(()=>{Je()});function nan(e){let t=xie.length;if(!(e>0))return t;let n=e-112-6-8;if(t*28+(t-1)*6<=n)return t;let a=Math.floor((n-28-8)/34);return Math.max(2,Math.min(t,a))}function ran(e){let t=kie.length;if(!(e>0))return t;let n=Kzr+Yzr,r=Math.floor((e-Xzr)/n);if(r>=t)return t;return Math.max(Jzr,Math.min(t,r-1))}var xie,tan=8,Kzr=38,Yzr=8,Xzr=126,Jzr=1,kie;var hLe=O(()=>{xie=["new-workspace","refresh","search","select","archive","scheduler","sort"];kie=["new-workspace","refresh","archive","sort","scheduler","select"]});function Qzr(e){return e.trim().replace(/^[vV]/,"")}function ian(e){return(Qzr(e).split("-")[0]??"").split(".").map((n)=>/^\d+$/.test(n)?Number.parseInt(n,10):0)}function ejr(e,t){let n=ian(e),r=ian(t),a=Math.max(n.length,r.length);for(let i=0;i<a;i+=1){let o=n[i]??0,s=r[i]??0;if(o>s)return 1;if(o<s)return-1}return 0}function oan(e,t){return ejr(e,t)>0}var san=()=>{};function tjr(e){if(typeof e!=="object"||e===null)return null;let t=e;if(typeof t.url!=="string"||!t.url)return null;if(typeof t.latest!=="string"||!t.latest)return null;return{url:t.url,latest:t.latest,releaseUrl:typeof t.releaseUrl==="string"?t.releaseUrl:null}}function njr(e,t,n){if(!n)return null;if(e)return oan(n.latest,e)?{...n,kind:"update"}:null;if(t)return{...n,kind:"install"};return null}function gL(e){return`${e.kind==="update"?"Update":"Install"} Kabmo ${e.latest} for Android`}function wie(e,t,n=fetch){let[r,a]=ae(null),i=Boolean(e)||Boolean(t);return Ee(()=>{if(!i)return;let o=!1;return(async()=>{try{let s=await n("/api/updates/android");if(!s.ok)return;let l=await s.json();if(!o)a(tjr(l))}catch{}})(),()=>{o=!0}},[i,n]),njr(e,t,r)}var Pz=O(()=>{Je();san()});function Cie(e=5,t=7){let[n,r]=ae(e),a=Le(()=>r((o)=>o+t),[t]),i=Le(()=>r(e),[e]);return{visibleCount:n,showMore:a,showLess:i,canShowLess:n>e}}var fLe=O(()=>{Je()});function bLe(e,t){if(ET.has(e)===t)return;if(t)ET.add(e);else ET.delete(e);for(let n of[...gLe])n()}function can(e){return ET.has(e)}function rjr(e){return gLe.add(e),()=>gLe.delete(e)}function O4(e){let t=e==null?"":String(e),[n,r]=ae(()=>t!==""&&ET.has(t));return Ee(()=>{if(!t){r(!1);return}return r(ET.has(t)),rjr(()=>r(ET.has(t)))},[t]),n}var ET,gLe;var bL=O(()=>{Je();ET=new Set,gLe=new Set});function Sie(e,t){let n=Uc();return{handleArchive:(o)=>{let s=o.is_archived!==1;n.submit({archived:String(s)},{method:"POST",action:`/api/sessions/${o.id}/archive`}),e()},handleRename:async(o,s)=>{try{let l=new FormData;if(l.set("name",s),!(await fetch(`/api/sessions/${encodeURIComponent(String(o.id))}/rename`,{method:"POST",body:l})).ok)return}catch{return}av("session-renamed",{sessionId:String(o.id),title:s}),e()},handleRenameWithAi:async(o)=>{let s=String(o.id);if(can(s))return;bLe(s,!0);try{let l=await fetch(`/api/sessions/${encodeURIComponent(s)}/rename-with-ai`,{method:"POST"}),u=await l.json().catch(()=>({}));if(!l.ok||!u.name){t?.(u.error||`Could not generate a name (HTTP ${l.status}).`,"error");return}av("session-renamed",{sessionId:s,title:u.name}),e(),t?.(`Renamed to "${u.name}".`,"success")}catch(l){t?.(l instanceof Error?l.message:String(l),"error")}finally{bLe(s,!1)}}}}var yLe=O(()=>{iv();ay();bL()});function Tie(e,t,n){let[r,a]=ae(!1),i=Uc(),o=Uc(),{handleArchive:s,handleRename:l,handleRenameWithAi:u}=Sie(t,n),d=()=>{if(typeof e.id!=="number")return;i.submit({isPinned:String(!e.isPinned)},{method:"POST",action:`/api/folders/${e.id}/pin`}),t()},p=()=>{if(typeof e.id!=="number")return;o.submit({},{method:"POST",action:`/api/folders/${e.id}/delete`}),a(!1),t()},h=e.project_path?()=>{(async()=>{try{let f=await fetch(`/api/folders/${encodeURIComponent(String(e.id))}/open`,{method:"POST"}),g=await f.json().catch(()=>({}));if(!f.ok)n?.(g.error||`Could not open the folder (HTTP ${f.status})`)}catch(f){n?.(f instanceof Error?f.message:String(f))}})()}:void 0;return{confirmDelete:r,requestDelete:()=>a(!0),cancelDelete:()=>a(!1),handlePin:d,handleOpenFolder:h,handleDelete:p,handleArchive:s,handleRename:l,handleRenameWithAi:u}}var vLe=O(()=>{Je();ay();yLe()});function yL(){let[e,t]=ae(null),[n,r]=ae(!1),[a,i]=ae(null),[o,s]=Ha(),l=Le((p)=>{i(null),t(p)},[]),u=Le(()=>{i(null),t(null)},[]),d=Le(async()=>{if(!e||n)return;let p=String(e.id);r(!0),i(null);try{let h=await fetch(`/api/sessions/${encodeURIComponent(p)}`,{method:"DELETE"}),f=await h.json().catch(()=>null);if(!h.ok){i(f?.error||`Could not delete the session (HTTP ${h.status}).`);return}if(Bre(p),o.get("sessionId")===p)s((g)=>{let b=new URLSearchParams(g);return b.delete("sessionId"),b.delete("subagent"),b},{replace:!0});t(null)}catch(h){i(h instanceof Error?h.message:"Could not reach the server.")}finally{r(!1)}},[e,n,o,s]);return{pending:e,isDeleting:n,error:a,requestDelete:l,cancelDelete:u,confirmDelete:d}}var Eie=O(()=>{Je();Kc();ep()});function vL({session:e,isDeleting:t,error:n,onClose:r,onConfirm:a}){if(Ee(()=>{let i=(o)=>{if(o.key!=="Escape"||t)return;o.preventDefault(),r()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[r,t]),!e)return null;return m(Va,{onClose:t?()=>{}:r,zClass:"z-[70]",maxWidthClass:"max-w-[460px]",header:m("div",{className:"flex items-center gap-3 min-w-0",children:[m(Tr,{size:16,className:"text-error shrink-0"}),m("div",{className:"min-w-0",children:[m("h2",{className:"text-sm font-semibold text-ink",children:"Delete session?"}),m("p",{className:"text-[11px] text-ink/50 truncate",children:e.title})]})]}),footer:m("div",{className:"flex items-center justify-end gap-2 px-5 py-3.5 border-t border-ink/10",children:[m("button",{type:"button",onClick:r,disabled:t,className:"px-3.5 py-1.5 rounded-md border border-ink/20 text-xs font-medium text-ink hover:bg-ink/5 transition-colors cursor-pointer disabled:opacity-50",children:"Cancel"}),m("button",{type:"button",onClick:a,disabled:t,className:"px-3.5 py-1.5 rounded-md bg-error text-canvas text-xs font-medium hover:opacity-90 transition-opacity cursor-pointer disabled:opacity-50 flex items-center gap-1.5",children:t?m(kt,{children:[m(nn,{size:13,className:"animate-spin"}),m("span",{children:"Deleting..."})]}):m(kt,{children:[m(Tr,{size:13}),m("span",{children:"Delete session"})]})})]}),children:m("div",{className:"px-5 py-4 space-y-3",children:[m("ul",{className:"text-[11.5px] leading-relaxed text-ink/70 space-y-1.5",children:[m("li",{children:["Its transcript is removed from"," ",m("span",{className:"font-mono text-ink",children:"~/.omp/agent/sessions"})," — the conversation is gone from the sidebar and from oh-my-pi."]}),m("li",{children:"The subagent transcripts and any side questions asked in it are removed with it."}),m("li",{children:"Its queued messages, archive state, and saved panel layout go too."})]}),n?m("div",{className:"flex items-start gap-2 px-3 py-2 rounded-md border border-error/30 bg-error/5 text-[11px] text-ink/75",children:[m(pr,{size:13,className:"mt-0.5 shrink-0 text-error"}),m("span",{children:n})]}):m("div",{className:"flex items-start gap-2 px-3 py-2 rounded-md border border-error/30 bg-error/5 text-[11px] text-ink/75",children:[m(pr,{size:13,className:"mt-0.5 shrink-0 text-error"}),m("span",{children:"This cannot be undone from the UI. Archive it instead to keep the transcript."})]})]})})}var Aie=O(()=>{Je();pt();Qc();de()});function xL(e,t){let[n,r]=ae(!1),[a,i]=ae(e),o=Re(null),s=Re(!1),l=Re(!1);Ee(()=>{if(n)o.current?.select()},[n]);let u=()=>{s.current=!1,l.current=!1,i(e),r(!0)},d=()=>{if(l.current)return;l.current=!0;let g=a.trim();if(r(!1),!g||g===e)return;t?.(g)},p=()=>{s.current=!0,r(!1)};return{isEditing:n,draft:a,setDraft:i,inputRef:o,startRename:u,commitRename:d,cancelRename:p,handleKeyDown:(g)=>{if(g.key==="Enter")g.preventDefault(),d();else if(g.key==="Escape")g.preventDefault(),p()},handleBlur:()=>{if(s.current){s.current=!1;return}d()}}}var Lie=O(()=>{Je()});function kL(){let[e,t]=ae(null),n=Le((i)=>{i.preventDefault(),i.stopPropagation();let o=i.currentTarget.getBoundingClientRect();t({top:o.top,right:o.right,bottom:o.bottom,left:o.left,align:"end"})},[]),r=Le((i)=>{i.preventDefault(),i.stopPropagation();let{clientX:o,clientY:s}=i;t({top:s,right:o,bottom:s,left:o,align:"start"})},[]),a=Le(()=>t(null),[]);return{anchor:e,openBelow:n,openAtCursor:r,close:a}}function _L({anchor:e,isArchived:t=!1,onRename:n,onRenameWithAi:r,onArchive:a,onDelete:i,onClose:o}){let s=Re(null),[l,u]=ae(null);ma(()=>{let p=s.current;if(!p)return;let{width:h,height:f}=p.getBoundingClientRect(),g=8,b=e.bottom+4,y=b+f+g<=window.innerHeight?b:Math.max(g,e.top-f-4),v=e.align==="end"?e.right-h:e.left;u({top:y,left:Math.max(g,Math.min(v,window.innerWidth-h-g))})},[e]),Ee(()=>{let p=(h)=>{if(h.key!=="Escape")return;h.preventDefault(),o()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[o]);let d=(p)=>()=>{o(),p?.()};return Co(m("div",{className:"fixed inset-0 z-[70]",onClick:o,onContextMenu:(p)=>{p.preventDefault(),o()},children:m("div",{ref:s,role:"menu","aria-label":"Session actions",style:{top:l?.top??e.bottom+4,left:l?.left??e.left,visibility:l?"visible":"hidden"},className:"fixed z-[70] w-44 bg-paper border border-ink/15 rounded-lg shadow-xl py-1 text-xs text-ink font-sans",onClick:(p)=>p.stopPropagation(),children:[n&&m("button",{type:"button",role:"menuitem",onClick:d(n),className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center gap-2 transition-colors cursor-pointer",children:[m(Hy,{size:12,className:"text-ink/60"}),m("span",{children:"Rename"})]}),r&&m("button",{type:"button",role:"menuitem",onClick:d(r),className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center gap-2 transition-colors cursor-pointer",children:[m(kg,{size:12,className:"text-ink/60"}),m("span",{children:"Rename with AI"})]}),a&&m("button",{type:"button",role:"menuitem",onClick:d(a),className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center gap-2 transition-colors cursor-pointer",children:[t?m(PR,{size:12,className:"text-ink/60"}):m(kd,{size:12,className:"text-ink/60"}),m("span",{children:t?"Unarchive":"Archive"})]}),(n||r||a)&&i&&m("div",{className:"my-1 border-t border-ink/10"}),i&&m("button",{type:"button",role:"menuitem",onClick:d(i),className:"w-full text-left px-3 py-1.5 hover:bg-error/10 text-error flex items-center gap-2 transition-colors cursor-pointer",children:[m(Tr,{size:12,className:"text-error"}),m("span",{children:"Delete"})]})]})}),document.body)}var Rie=O(()=>{Je();Ma();pt();de()});function F4({checked:e,indeterminate:t=!1,label:n,onChange:r,size:a="sm"}){let i=Re(null);return Ee(()=>{if(i.current)i.current.indeterminate=t},[t]),m("input",{ref:i,type:"checkbox",checked:e,"aria-label":n,onChange:r,onClick:(o)=>o.stopPropagation(),className:`shrink-0 accent-ink cursor-pointer rounded border-ink/30 ${a==="md"?"w-3.5 h-3.5":"w-3 h-3"}`})}var Dz=O(()=>{Je();de()});function Nie({variant:e,isPinned:t=!1,onOpenFolder:n,onSelectSessions:r,confirmDelete:a,onPin:i,onDelete:o,onRequestDelete:s,onCancelDelete:l}){if(e==="mobile")return a?m(kt,{children:[m("div",{className:"px-3 py-2 text-ink/80 font-medium",children:"Delete workspace?"}),m("button",{type:"button",onClick:o,className:"w-full text-left px-3 py-2 hover:bg-error/10 text-error flex items-center space-x-2",children:[m(Tr,{size:13}),m("span",{children:"Yes, delete"})]}),m("button",{type:"button",onClick:l,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/70",children:"Cancel"})]}):m(kt,{children:[n&&m("button",{type:"button",onClick:n,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/80 flex items-center space-x-2",children:[m(wd,{size:13}),m("span",{children:"Go to Explorer"})]}),m("button",{type:"button",onClick:i,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/80 flex items-center space-x-2",children:[t?m(i6,{size:13}):m(uk,{size:13}),m("span",{children:t?"Unpin Workspace":"Pin Workspace"})]}),r&&m("button",{type:"button",onClick:r,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/80 flex items-center space-x-2",children:[m(lf,{size:13}),m("span",{children:"Select sessions"})]}),m("button",{type:"button",onClick:s,className:"w-full text-left px-3 py-2 hover:bg-error/10 text-error flex items-center space-x-2",children:[m(Tr,{size:13}),m("span",{children:"Delete Workspace"})]})]});return a?m(kt,{children:[m("div",{className:"px-3 py-1.5 text-xs text-ink/80 font-medium",children:"Delete workspace?"}),m("button",{type:"button",onClick:o,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-error",children:[m(Tr,{size:12}),m("span",{children:"Yes, delete"})]}),m("button",{type:"button",onClick:l,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/70",children:m("span",{children:"Cancel"})})]}):m(kt,{children:[n&&m("button",{type:"button",onClick:n,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/80",children:[m(wd,{size:12}),m("span",{children:"Go to Explorer"})]}),m("button",{type:"button",onClick:i,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/80",children:[t?m(i6,{size:12}):m(uk,{size:12}),m("span",{children:t?"Unpin Workspace":"Pin Workspace"})]}),r&&m("button",{type:"button",onClick:r,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/80",children:[m(lf,{size:12}),m("span",{children:"Select sessions"})]}),m("button",{type:"button",onClick:s,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-error",children:[m(Tr,{size:12}),m("span",{children:"Delete Workspace"})]})]})}var xLe=O(()=>{pt();de()});function Iie(e){return ajr[e||"default"]||Pi}var ajr;var kLe=O(()=>{pt();ajr={default:Pi,code:Yc,terminal:Da,rocket:Ky,flask:Dy,gamepad:Oy,briefcase:Ey,home:Iu,globe:Pa,leaf:By,shield:Ig,palette:uh,server:fc,smartphone:lp,database:Tg,lightbulb:zy,music:Wy,camera:_d,book:ls,heart:Lg}});function Mie({status:e,live:t,size:n=12}){let r={size:n,strokeWidth:2,"aria-hidden":!0};if(e==="completed")return m(Ur,{...r,className:"text-success"});if(e==="failed")return m(Qn,{...r,className:"text-error"});if(e==="aborted")return m(op,{...r,className:"text-ink/40"});if(t===!1)return m(Ry,{...r,className:"text-ink/30"});let a=Math.max(5,Math.round(n/2));return m("span",{"aria-hidden":!0,className:"inline-block shrink-0 animate-pulse rounded-full bg-success",style:{width:a,height:a}})}var _Le=O(()=>{pt();de()});function ijr(e){return xn(e)&&typeof e.id==="string"&&e.id.length>0&&typeof e.agent==="string"&&e.agent.length>0&&typeof e.status==="string"&&typeof e.index==="number"}async function pan(e){try{let t=await fetch(`/api/sessions/${encodeURIComponent(e)}/subagents`);if(!t.ok)return null;let n=await t.json().catch(()=>null);if(!xn(n))return null;let r=xn(n.data)?n.data:n;if(!Array.isArray(r.subagents))return null;return r.subagents.filter(ijr)}catch{return null}}function Pie(e){let t={...e,source:"history",lastUpdate:0},n={};if(e.lastIntent!==void 0)n.lastIntent=e.lastIntent;if(e.toolCount!==void 0)n.toolCount=e.toolCount;if(e.requests!==void 0)n.requests=e.requests;if(e.tokens!==void 0)n.tokens=e.tokens;if(e.contextTokens!==void 0)n.contextTokens=e.contextTokens;if(e.contextWindow!==void 0)n.contextWindow=e.contextWindow;if(e.cost!==void 0)n.cost=e.cost;if(e.durationMs!==void 0)n.durationMs=e.durationMs;if(e.resolvedModel!==void 0)n.resolvedModel=e.resolvedModel;if(Object.keys(n).length>0)t.progress=n;return t}var wLe=()=>{};function han(e){for(let t of e){let n=t.trim();if(n)return n}return}function fan(e){if(!e)return;let t=e.split(`
|
|
5002
5002
|
`),n=t.findIndex((r)=>ojr.test(r.trim()));if(n!==-1){let r=t.slice(n+1),a=r.findIndex((o)=>man.test(o.trim())),i=han(a===-1?r:r.slice(0,a));if(i)return i}return han(t.filter((r)=>{let a=r.trim();return!man.test(a)&&!sjr.test(a)}))}function gan(e){let t=e.modelRole??e.progress?.modelRole;return t?`${e.id} (${e.agent}:${t})`:`${e.id} (${e.agent})`}function ban(e){let t=fan(e.task)??fan(e.assignment)??e.description,n=`${e.id} (${e.agent})`;return t?`${n}: ${t}`:n}var man,ojr,sjr;var CLe=O(()=>{man=/^#{1,6}\s+\S/,ojr=/^#{1,6}\s+target\s*:?\s*$/i,sjr=/^complete (the )?assignment\b/i});function wo(e){return typeof e==="string"&&e.length>0?e:void 0}function md(e){return typeof e==="number"&&Number.isFinite(e)?e:void 0}function TLe(e){return e==="bundled"||e==="user"||e==="project"?e:void 0}function ljr(e){return e==="pending"||e==="running"||e==="completed"||e==="failed"||e==="aborted"?e:void 0}function SLe(e){if(!xn(e))return;let t={},n=md(e.index);if(n!==void 0)t.index=n;let r=wo(e.id);if(r!==void 0)t.id=r;let a=wo(e.agent);if(a!==void 0)t.agent=a;let i=TLe(e.agentSource);if(i!==void 0)t.agentSource=i;let o=ljr(e.status);if(o!==void 0)t.status=o;let s=wo(e.task);if(s!==void 0)t.task=s;let l=wo(e.assignment);if(l!==void 0)t.assignment=l;let u=wo(e.description);if(u!==void 0)t.description=u;let d=wo(e.lastIntent);if(d!==void 0)t.lastIntent=d;let p=wo(e.currentTool);if(p!==void 0)t.currentTool=p;let h=wo(e.currentToolArgs);if(h!==void 0)t.currentToolArgs=h;let f=md(e.currentToolStartMs);if(f!==void 0)t.currentToolStartMs=f;if(Array.isArray(e.recentTools))t.recentTools=e.recentTools;if(Array.isArray(e.recentOutput))t.recentOutput=e.recentOutput.filter((E)=>typeof E==="string");let g=md(e.toolCount);if(g!==void 0)t.toolCount=g;let b=md(e.requests);if(b!==void 0)t.requests=b;let y=md(e.tokens);if(y!==void 0)t.tokens=y;let v=md(e.contextTokens);if(v!==void 0)t.contextTokens=v;let x=md(e.contextWindow);if(x!==void 0)t.contextWindow=x;let k=md(e.cost);if(k!==void 0)t.cost=k;let C=md(e.durationMs);if(C!==void 0)t.durationMs=C;if(typeof e.modelOverride==="string"||Array.isArray(e.modelOverride)&&e.modelOverride.every((E)=>typeof E==="string"))t.modelOverride=e.modelOverride;let _=wo(e.modelRole);if(_!==void 0)t.modelRole=_;let w=wo(e.resolvedModel);if(w!==void 0)t.resolvedModel=w;let T=wo(e.resolvedThinkingLevel);if(T!==void 0)t.resolvedThinkingLevel=T;if(typeof e.resolvedModelIsFallback==="boolean")t.resolvedModelIsFallback=e.resolvedModelIsFallback;if(xn(e.retryState)){let E=md(e.retryState.attempt),L=md(e.retryState.maxAttempts),P=md(e.retryState.delayMs),R=wo(e.retryState.errorMessage),M=md(e.retryState.startedAtMs);if(E!==void 0&&L!==void 0&&P!==void 0&&R!==void 0&&M!==void 0)t.retryState={attempt:E,maxAttempts:L,delayMs:P,errorMessage:R,startedAtMs:M}}if(xn(e.retryFailure)){let E=md(e.retryFailure.attempt),L=wo(e.retryFailure.errorMessage);if(E!==void 0&&L!==void 0)t.retryFailure={attempt:E,errorMessage:L}}if(e.inflightTaskDetails!==void 0)t.inflightTaskDetails=e.inflightTaskDetails;if(xn(e.extractedToolData))t.extractedToolData=e.extractedToolData;return Object.keys(t).length>0?t:void 0}function cjr(e){if(!xn(e))return;let t=wo(e.id),n=wo(e.agent);if(!t||!n)return;let r;if(e.status==="started"||e.status==="completed"||e.status==="failed"||e.status==="aborted")r=e.status;else if(e.status==="pending"||e.status==="running")r="started";else return;let a={id:t,agent:n,status:r,index:md(e.index)??-1,source:"live"},i=TLe(e.agentSource);if(i!==void 0)a.agentSource=i;let o=wo(e.description);if(o!==void 0)a.description=o;let s=wo(e.task);if(s!==void 0)a.task=s;let l=wo(e.assignment);if(l!==void 0)a.assignment=l;let u=wo(e.sessionFile);if(u!==void 0)a.sessionFile=u;let d=wo(e.parentToolCallId);if(d!==void 0)a.parentToolCallId=d;let p=md(e.lastUpdate)??Date.now();a.lastUpdate=p;let h=SLe(e.progress);if(h!==void 0)a.progress=h;return a}function Die(e){if(!xn(e))return;let t=wo(e.id),n=wo(e.status);if(!t||!n)return;if(n!=="started"&&n!=="completed"&&n!=="failed"&&n!=="aborted")return;let r={id:t,agent:wo(e.agent)??"subagent",status:n,index:md(e.index)??-1,lastUpdate:Date.now(),source:"live"},a=TLe(e.agentSource);if(a!==void 0)r.agentSource=a;let i=wo(e.description);if(i!==void 0)r.description=i;let o=wo(e.sessionFile);if(o!==void 0)r.sessionFile=o;let s=wo(e.parentToolCallId);if(s!==void 0)r.parentToolCallId=s;if(typeof e.detached==="boolean")r.detached=e.detached;return r}function $ie(e){let t=SLe(e);if(!xn(e)||!xn(e.progress))return t;let n=SLe(e.progress);if(!n)return t;return{...n,id:n.id??t?.id,index:n.index??t?.index}}function van(e){if(!xn(e))return[];let t=e.subagents;if(!Array.isArray(t))return[];let n=[];for(let r of t){let a=cjr(r);if(a)n.push(a)}return n}function ujr(e,t){return yan(e)-yan(t)||e.index-t.index||e.id.localeCompare(t.id)}function Oie(e,t,n){let r=new Map(e.map((a)=>[a.id,a]));for(let a of t){let i=r.get(a.id);if(!i){r.set(a.id,a);continue}let o=i.batchSeq??a.batchSeq;if(n!==void 0&&(i.lastUpdate??0)>=n){if(o!==i.batchSeq)r.set(a.id,{...i,batchSeq:o});continue}if(a.source==="history"&&i.source!=="history"){if(o!==i.batchSeq)r.set(a.id,{...i,batchSeq:o});continue}if(a.source!=="history"&&i.source==="history"){r.set(a.id,{...a,batchSeq:o});continue}r.set(a.id,{...i,...a,batchSeq:o})}return[...r.values()].sort(ujr)}var yan=(e)=>e.batchSeq??Number.MAX_SAFE_INTEGER;var ELe=()=>{};function AT(e,t){return ALe[e].add(t),()=>ALe[e].delete(t)}function xan(e,t){for(let n of[...ALe[e]])try{n(t)}catch{}}var ALe;var Fie=O(()=>{ALe={subagent_lifecycle:new Set,subagent_progress:new Set,subagent_event:new Set}});async function Bie(e,t){try{let n=await fetch(`/api/sessions/${encodeURIComponent(e)}/subagents/${encodeURIComponent(t)}/cancel`,{method:"POST"});if(!n.ok)return!1;return(await n.json().catch(()=>null))?.data?.cancelled===!0}catch{return!1}}async function kan(e,t,n){try{return(await fetch(`/api/sessions/${encodeURIComponent(e)}/subagents/${encodeURIComponent(t)}/steer`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:n})})).ok}catch{return!1}}function pjr(e,t){return e.map((n)=>{if(t.id!==void 0){if(n.id!==t.id)return n}else if(t.index===void 0||t.index<0||n.index!==t.index)return n;let r=t.status&&n.status==="started"?djr[t.status]??n.status:n.status;return{...n,status:r,progress:{...n.progress,...t},lastUpdate:Date.now()}})}function zie({sessionId:e,isActiveSession:t}){let[n]=Ha(),r=n.get("subagent"),[a,i]=ae([]),[o,s]=ae(!1);Ee(()=>{let u=!1,d=String(e);return i([]),s(!0),pan(d).then((p)=>{if(u||!p)return;let h=p.map(Pie);i((f)=>Oie(f,h))}).finally(()=>{if(!u)s(!1)}),()=>{u=!0}},[e]),Ee(()=>{if(!t)return;let u=!1,d=String(e),p=Date.now(),h=(b)=>b.sessionId===d?b.payload:null,f=AT("subagent_lifecycle",(b)=>{let y=Die(h(b));if(y)i((v)=>Oie(v,[y]))}),g=AT("subagent_progress",(b)=>{let y=$ie(h(b));if(y)i((v)=>pjr(v,y))});return fetch(`/api/agent/${encodeURIComponent(d)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"get_subagents"})}).then((b)=>b.ok?b.json():null).then((b)=>{if(u||!xn(b))return;let y="data"in b?b.data:b;i((v)=>Oie(v,van(y),p))}).catch(()=>{}),()=>{u=!0,f(),g()}},[t,e]);let l=o?"Loading subagents…":a.length===0?"No subagent activity":null;return m("div",{className:"pl-6 pr-0 space-y-0.5 py-0.5",children:l?m("div",{className:"px-2 py-1 text-xs italic text-ink/40 flex items-center",children:[m("span",{className:"w-4 h-4 shrink-0"}),m("span",{className:"w-2 shrink-0"}),m("span",{className:"flex-1 min-w-0 truncate",children:l})]}):a.map((u)=>{let d=ban(u),p=u.task??u.assignment??u.description??d,h=u.id===r,f=t&&u.status==="started";return m("div",{className:"flex items-center group/subagent-row",children:[m("button",{type:"button",title:p,onClick:()=>window.dispatchEvent(new CustomEvent("omp:view-subagent",{detail:{sessionId:String(e),subagent:u}})),className:`flex-1 min-w-0 flex items-center text-left text-xs rounded-md px-2 py-1 cursor-pointer transition-colors select-none group/subagent ${h?"bg-ink/10 font-medium text-ink":"text-ink/70 hover:text-ink hover:bg-ink/5"}`,children:[m("span",{className:"w-4 h-4 flex items-center justify-center shrink-0",children:m(Mie,{status:u.status,live:f,size:11})}),m("span",{className:"w-2 shrink-0"}),m("span",{className:"flex-1 min-w-0 truncate leading-snug",children:d})]}),f&&m("button",{type:"button",title:"Stop this subagent","aria-label":"Stop this subagent",onClick:()=>void Bie(String(e),u.id),className:"touch-visible shrink-0 mr-1 w-5 h-5 flex items-center justify-center rounded text-ink/40 hover:text-error hover:bg-error/5 opacity-0 group-hover/subagent-row:opacity-100 transition-opacity cursor-pointer",children:m(Mg,{size:10})})]},u.id)})})}var djr;var LLe=O(()=>{Je();pt();Kc();_Le();wLe();CLe();ELe();Fie();de();djr={pending:"started",running:"started",completed:"completed",failed:"failed",aborted:"aborted"}});function wan(){let e=cs(_an);if(!Array.isArray(e))return new Set;return new Set(e.filter((t)=>typeof t==="string"))}function Can(e){om(_an,[...e].slice(-mjr))}var _an="omp_sidebar_expanded_sessions",mjr=50;var San=O(()=>{Cd()});function jie(){let[e]=Ha(),t=e.get("subagent"),n=e.get("sessionId"),[r,a]=ae(()=>new Set);Ee(()=>{let o=wan();if(o&&o.size>0)a(o)},[]),Ee(()=>{if(!t||!n)return;a((o)=>{if(o.has(n))return o;let s=new Set(o);return s.add(n),s})},[t,n]);let i=Le((o)=>{a((s)=>{let l=new Set(s);if(l.has(o))l.delete(o);else l.add(o);return Can(l),l})},[]);return{expandedSessionIds:r,toggleSession:i}}var RLe=O(()=>{Je();Kc();San()});function Uie(e,t=Date.now()){if(e===null||e===void 0||e==="")return null;let n=typeof e==="number"?e:Date.parse(e);if(Number.isNaN(n))return null;let r=Math.round((t-n)/1000);if(r<45)return"now";let a=Math.round(r/60);if(a<60)return`${a}m`;let i=Math.round(a/60);if(i<24)return`${i}h`;let o=Math.round(i/24);if(o<7)return`${o}d`;let s=Math.round(o/7);if(s<5)return`${s}w`;let l=new Date(n),u=l.getFullYear()===new Date(t).getFullYear(),d=l.getDate(),p=l.toLocaleString("en-US",{month:"short"});return u?`${d} ${p}`:`${d} ${p} ${l.getFullYear()}`}function Tan(e,t){return e.includes(t)?e.filter((n)=>n!==t):[...e,t]}function Ean(e,t){let n=new Set(e),r=t.filter((a)=>n.has(a)).length;return{count:r,all:t.length>0&&r===t.length,some:r>0&&r<t.length}}function wL(e,t){return e.filter((n)=>t?n.is_archived===1:n.is_archived!==1).map((n)=>String(n.id))}function qie(e,t){let n=new Set(t);return e.filter((r)=>n.has(r))}function Aan(e,t,{activeSessionId:n,sessionStatus:r={}}){if(e.length<=t)return{rendered:e,hiddenCount:0};let a=[],i=0;for(let o=0;o<e.length;o+=1){let s=e[o],l=String(s.id),d=(n!==null?String(n)===l:s.is_active===1)||r[l]==="stream"||Boolean(s.awaitingInput);if(o<t||d)a.push(s);else i+=1}return{rendered:a,hiddenCount:i}}function Lan(e,t){return e.mode==="workspace"||e.mode==="session"&&e.scopeFolderId===t}function Ran(e,t){return e.mode==="session"&&e.scopeFolderId===t}function Wie({batch:e,folder:t,sessions:n,showArchived:r,visibleCount:a,activeSessionId:i,sessionStatus:o}){let s=e?Lan(e,t.id):!1,l=e?Ran(e,t.id):!1,u=l?wL(n,r):s?[String(t.id)]:[],d=e&&s?e.summaryOf(u):null,p=Aan(n,a,{activeSessionId:i,sessionStatus:o});return{folderCheckbox:s,sessionCheckboxes:l,folderSummary:d,selectableIds:u,toggleFolderSelection:()=>{if(!e)return;if(s&&!l){e.toggle(String(t.id));return}if(!l)return;if(d?.all)e.unselectAllOf(u);else e.selectAllOf(u)},rendered:l?n:p.rendered,hiddenCount:l?0:p.hiddenCount}}var NLe=()=>{};function $z(e,t){if(!e)return;fetch("/api/agent/prewarm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e,...t?{accessMode:t}:{}})}).catch(()=>{})}function Oz(e,t,n){let r=n!==void 0?e.find((a)=>String(a.id)===String(n)):e.find((a)=>a.sessions?.some((i)=>String(i.id)===String(t)))??e.find((a)=>Boolean(a.project_path));return r?.project_path||r?.name||null}function Pan(e,t){if(typeof e!=="object"||e===null)return t;if("error"in e&&typeof e.error==="string")return e.error;if("message"in e&&typeof e.message==="string")return e.message;return t}function fjr(e){if(typeof e!=="object"||e===null)return!1;return"success"in e&&typeof e.success==="boolean"&&"target"in e&&(e.target==="kabmo"||e.target==="omp")&&"manual"in e&&typeof e.manual==="boolean"&&"message"in e&&typeof e.message==="string"}function Gie(e={}){let{restart:t}=e,[n,r]=ae(null),[a,i]=ae(!1),[o,s]=ae(null),[l,u]=ae(null),[d,p]=ae(null),h=Re(null),f=Re(!1),g=Re(null),b=Le(()=>{if(h.current)return h.current;let v=(async()=>{i(!0),p(null);try{let x=await fetch("/api/updates/check"),k=await x.json();if(!x.ok)throw Error(Pan(k,`Update check failed (HTTP ${x.status})`));r(k)}catch(x){p(x instanceof Error?x.message:"Unable to check for updates.")}finally{i(!1),h.current=null}})();return h.current=v,v},[]),y=Le(async(v)=>{s(v),u({lines:[],pending:"",truncated:!1}),p(null);let x=new AbortController;g.current=x;let k={lines:[],pending:"",truncated:!1},C={result:null},_=null,w=!1;try{if(v==="kabmo")_=await KN(t);let T=await fetch("/api/updates/apply",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({target:v}),signal:x.signal});if(!T.ok&&!(T.headers.get("content-type")??"").includes("text/event-stream")){let L=await T.json().catch(()=>null),P=Pan(L,`Update failed (HTTP ${T.status})`);if(T.status===409)return{success:!1,target:v,manual:!1,message:P};throw Error(P)}await H9(T,(L,P)=>{if(L==="line"){k=oie(k,JSON.parse(P)),u(k);return}if(L==="stage"){k=oie(k,`${JSON.parse(P)}
|