@kilocode/cli-darwin-x64-baseline 7.4.19 → 7.4.20

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.
@@ -17,7 +17,7 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-DA
17
17
 
18
18
  `);v=L.pop()??"";for(const S of L){const G=S.split(`
19
19
  `),K=[];let J;for(const z of G)if(z.startsWith("data:"))K.push(z.replace(/^data:\s*/,""));else if(z.startsWith("event:"))J=z.replace(/^event:\s*/,"");else if(z.startsWith("id:"))g=z.replace(/^id:\s*/,"");else if(z.startsWith("retry:")){const aA=Number.parseInt(z.replace(/^retry:\s*/,""),10);Number.isNaN(aA)||(E=aA)}let Y,P=!1;if(K.length){const z=K.join(`
20
- `);try{Y=JSON.parse(z),P=!0}catch{Y=z}}P&&(i&&await i(Y),n&&(Y=await n(Y))),t?.({data:Y,event:J,id:g,retry:E}),K.length&&(yield Y)}}}finally{h.removeEventListener("abort",b),k.releaseLock()}break}catch(p){if(e?.(p),o!==void 0&&I>=o)break;const w=Math.min(E*2**(I-1),s??3e4);await d(w)}}}()}},Q3=A=>{switch(A){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},B3=A=>{switch(A){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},u3=A=>{switch(A){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Oh=({allowReserved:A,explode:e,name:t,style:n,value:i})=>{if(!e){const s=(A?i:i.map(a=>encodeURIComponent(a))).join(B3(n));switch(n){case"label":return`.${s}`;case"matrix":return`;${t}=${s}`;case"simple":return s;default:return`${t}=${s}`}}const r=Q3(n),o=i.map(s=>n==="label"||n==="simple"?A?s:encodeURIComponent(s):ll({allowReserved:A,name:t,value:s})).join(r);return n==="label"||n==="matrix"?r+o:o},ll=({allowReserved:A,name:e,value:t})=>{if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${A?t:encodeURIComponent(t)}`},Kh=({allowReserved:A,explode:e,name:t,style:n,value:i,valueOnly:r})=>{if(i instanceof Date)return r?i.toISOString():`${t}=${i.toISOString()}`;if(n!=="deepObject"&&!e){let a=[];Object.entries(i).forEach(([c,g])=>{a=[...a,c,A?g:encodeURIComponent(g)]});const l=a.join(",");switch(n){case"form":return`${t}=${l}`;case"label":return`.${l}`;case"matrix":return`;${t}=${l}`;default:return l}}const o=u3(n),s=Object.entries(i).map(([a,l])=>ll({allowReserved:A,name:n==="deepObject"?`${t}[${a}]`:a,value:l})).join(o);return n==="label"||n==="matrix"?o+s:s},E3=/\{[^{}]+\}/g,C3=({path:A,url:e})=>{let t=e;const n=e.match(E3);if(n)for(const i of n){let r=!1,o=i.substring(1,i.length-1),s="simple";o.endsWith("*")&&(r=!0,o=o.substring(0,o.length-1)),o.startsWith(".")?(o=o.substring(1),s="label"):o.startsWith(";")&&(o=o.substring(1),s="matrix");const a=A[o];if(a==null)continue;if(Array.isArray(a)){t=t.replace(i,Oh({explode:r,name:o,style:s,value:a}));continue}if(typeof a=="object"){t=t.replace(i,Kh({explode:r,name:o,style:s,value:a,valueOnly:!0}));continue}if(s==="matrix"){t=t.replace(i,`;${ll({name:o,value:a})}`);continue}const l=encodeURIComponent(s==="label"?`.${a}`:a);t=t.replace(i,l)}return t},h3=({baseUrl:A,path:e,query:t,querySerializer:n,url:i})=>{const r=i.startsWith("/")?i:`/${i}`;let o=(A??"")+r;e&&(o=C3({path:e,url:o}));let s=t?n(t):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(o+=`?${s}`),o};function uB(A){const e=A.body!==void 0;if(e&&A.bodySerializer)return"serializedBody"in A?A.serializedBody!==void 0&&A.serializedBody!==""?A.serializedBody:null:A.body!==""?A.body:null;if(e)return A.body}const I3=async(A,e)=>{const t=typeof e=="function"?await e(A):e;if(t)return A.scheme==="bearer"?`Bearer ${t}`:A.scheme==="basic"?`Basic ${btoa(t)}`:t},f3={bodySerializer:A=>JSON.stringify(A,(e,t)=>typeof t=="bigint"?t.toString():t)},qh=({parameters:A={},...e}={})=>n=>{const i=[];if(n&&typeof n=="object")for(const r in n){const o=n[r];if(o==null)continue;const s=A[r]||e;if(Array.isArray(o)){const a=Oh({allowReserved:s.allowReserved,explode:!0,name:r,style:"form",value:o,...s.array});a&&i.push(a)}else if(typeof o=="object"){const a=Kh({allowReserved:s.allowReserved,explode:!0,name:r,style:"deepObject",value:o,...s.object});a&&i.push(a)}else{const a=ll({allowReserved:s.allowReserved,name:r,value:o});a&&i.push(a)}}return i.join("&")},p3=A=>{if(!A)return"stream";const e=A.split(";")[0]?.trim();if(e){if(e.startsWith("application/json")||e.endsWith("+json"))return"json";if(e==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(t=>e.startsWith(t)))return"blob";if(e.startsWith("text/"))return"text"}},m3=(A,e)=>e?!!(A.headers.has(e)||A.query?.[e]||A.headers.get("Cookie")?.includes(`${e}=`)):!1,w3=async({security:A,...e})=>{for(const t of A){if(m3(e,t.name))continue;const n=await I3(t,e.auth);if(!n)continue;const i=t.name??"Authorization";switch(t.in){case"query":e.query||(e.query={}),e.query[i]=n;break;case"cookie":e.headers.append("Cookie",`${i}=${n}`);break;default:e.headers.set(i,n);break}}},EB=A=>h3({baseUrl:A.baseUrl,path:A.path,query:A.query,querySerializer:typeof A.querySerializer=="function"?A.querySerializer:qh(A.querySerializer),url:A.url}),CB=(A,e)=>{const t={...A,...e};return t.baseUrl?.endsWith("/")&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=Jh(A.headers,e.headers),t},y3=A=>{const e=[];return A.forEach((t,n)=>{e.push([n,t])}),e},Jh=(...A)=>{const e=new Headers;for(const t of A){if(!t)continue;const n=t instanceof Headers?y3(t):Object.entries(t);for(const[i,r]of n)if(r===null)e.delete(i);else if(Array.isArray(r))for(const o of r)e.append(i,o);else r!==void 0&&e.set(i,typeof r=="object"?JSON.stringify(r):r)}return e};class cg{fns=[];clear(){this.fns=[]}eject(e){const t=this.getInterceptorIndex(e);this.fns[t]&&(this.fns[t]=null)}exists(e){const t=this.getInterceptorIndex(e);return!!this.fns[t]}getInterceptorIndex(e){return typeof e=="number"?this.fns[e]?e:-1:this.fns.indexOf(e)}update(e,t){const n=this.getInterceptorIndex(e);return this.fns[n]?(this.fns[n]=t,e):!1}use(e){return this.fns.push(e),this.fns.length-1}}const D3=()=>({error:new cg,request:new cg,response:new cg}),k3=qh({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),b3={"Content-Type":"application/json"},Hh=(A={})=>({...f3,headers:b3,parseAs:"auto",querySerializer:k3,...A}),Yh=(A={})=>{let e=CB(Hh(),A);const t=()=>({...e}),n=l=>(e=CB(e,l),t()),i=D3(),r=async l=>{const c={...e,...l,fetch:l.fetch??e.fetch??globalThis.fetch,headers:Jh(e.headers,l.headers),serializedBody:void 0};c.security&&await w3({...c,security:c.security}),c.requestValidator&&await c.requestValidator(c),c.body!==void 0&&c.bodySerializer&&(c.serializedBody=c.bodySerializer(c.body)),(c.body===void 0||c.serializedBody==="")&&c.headers.delete("Content-Type");const g=EB(c);return{opts:c,url:g}},o=async l=>{const{opts:c,url:g}=await r(l),d={redirect:"follow",...c,body:uB(c)};let Q=new Request(g,d);for(const m of i.request.fns)m&&(Q=await m(Q,c));const B=c.fetch;let E;try{E=await B(Q)}catch(m){let y=m;for(const k of i.error.fns)k&&(y=await k(m,void 0,Q,c));if(y=y||{},c.throwOnError)throw y;return c.responseStyle==="data"?void 0:{error:y,request:Q,response:void 0}}for(const m of i.response.fns)m&&(E=await m(E,Q,c));const I={request:Q,response:E};if(E.ok){const m=(c.parseAs==="auto"?p3(E.headers.get("Content-Type")):c.parseAs)??"json";if(E.status===204||E.headers.get("Content-Length")==="0"){let k;switch(m){case"arrayBuffer":case"blob":case"text":k=await E[m]();break;case"formData":k=new FormData;break;case"stream":k=E.body;break;default:k={};break}return c.responseStyle==="data"?k:{data:k,...I}}let y;switch(m){case"arrayBuffer":case"blob":case"formData":case"text":y=await E[m]();break;case"json":{const k=await E.text();y=k?JSON.parse(k):{};break}case"stream":return c.responseStyle==="data"?E.body:{data:E.body,...I}}return m==="json"&&(c.responseValidator&&await c.responseValidator(y),c.responseTransformer&&(y=await c.responseTransformer(y))),c.responseStyle==="data"?y:{data:y,...I}}const h=await E.text();let C;try{C=JSON.parse(h)}catch{}const p=C??h;let w=p;for(const m of i.error.fns)m&&(w=await m(p,E,Q,c));if(w=w||{},c.throwOnError)throw w;return c.responseStyle==="data"?void 0:{error:w,...I}},s=l=>c=>o({...c,method:l}),a=l=>async c=>{const{opts:g,url:d}=await r(c);return d3({...g,body:g.body,headers:g.headers,method:l,onRequest:async(Q,B)=>{let E=new Request(Q,B);for(const I of i.request.fns)I&&(E=await I(E,g));return E},serializedBody:uB(g),url:d})};return{buildUrl:EB,connect:s("CONNECT"),delete:s("DELETE"),get:s("GET"),getConfig:t,head:s("HEAD"),interceptors:i,options:s("OPTIONS"),patch:s("PATCH"),post:s("POST"),put:s("PUT"),request:o,setConfig:n,sse:{connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),head:a("HEAD"),options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),trace:a("TRACE")},trace:s("TRACE")}},v3={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},M3=Object.entries(v3),Ph=(A,e)=>{e||(e=new Map);for(const t of A)"in"in t?t.key&&e.set(t.key,{in:t.in,map:t.map}):"key"in t?e.set(t.key,{map:t.map}):t.args&&Ph(t.args,e);return e},N3=A=>{for(const[e,t]of Object.entries(A))t&&typeof t=="object"&&!Object.keys(t).length&&delete A[e]},F=(A,e)=>{const t={body:{},headers:{},path:{},query:{}},n=Ph(e);let i;for(const[r,o]of A.entries())if(e[r]&&(i=e[r]),!!i)if("in"in i)if(i.key){const s=n.get(i.key),a=s.map||i.key;s.in&&(t[s.in][a]=o)}else t.body=o;else for(const[s,a]of Object.entries(o??{})){const l=n.get(s);if(l)if(l.in){const c=l.map||s;t[l.in][c]=a}else t[l.map]=a;else{const c=M3.find(([g])=>s.startsWith(g));if(c){const[g,d]=c;t[d][s.slice(g.length)]=a}else if("allowExtra"in i&&i.allowExtra){for(const[g,d]of Object.entries(i.allowExtra))if(d){t[g][s]=a;break}}}}return N3(t),t},S3=Yh(Hh({baseUrl:"http://localhost:4096"}));class dA{client;constructor(e){this.client=e?.client??S3}}class x3{defaultKey="default";instances=new Map;get(e){const t=this.instances.get(e??this.defaultKey);if(!t)throw new Error('No SDK client found. Create one with "new KiloClient()" to fix this error.');return t}set(e,t){this.instances.set(t??this.defaultKey,e)}}class L3 extends dA{remove(e,t){const n=F([e],[{args:[{in:"path",key:"providerID"}]}]);return(t?.client??this.client).delete({url:"/auth/{providerID}",...t,...n})}set(e,t){const n=F([e],[{args:[{in:"path",key:"providerID"},{key:"auth",map:"body"}]}]);return(t?.client??this.client).put({url:"/auth/{providerID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}let _3=class extends dA{log(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"service"},{in:"body",key:"level"},{in:"body",key:"message"},{in:"body",key:"extra"}]}]);return(t?.client??this.client).post({url:"/log",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}agents(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/agent",...t,...n})}skills(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/skill",...t,...n})}};class F3 extends dA{moveSession(e,t){const n=F([e],[{args:[{in:"body",key:"sessionID"},{in:"body",key:"destination"},{in:"body",key:"moveChanges"}]}]);return(t?.client??this.client).post({url:"/experimental/control-plane/move-session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class G3 extends dA{get(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/capabilities",...t,...n})}}class R3 extends dA{get(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/console",...t,...n})}listOrgs(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/console/orgs",...t,...n})}switchOrg(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"accountID"},{in:"body",key:"orgID"}]}]);return(t?.client??this.client).post({url:"/experimental/console/switch",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class T3 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"projectID"},{in:"query",key:"worktrees"},{in:"query",key:"current"},{in:"query",key:"roots"},{in:"query",key:"start"},{in:"query",key:"cursor"},{in:"query",key:"search"},{in:"query",key:"limit"},{in:"query",key:"archived"}]}]);return(t?.client??this.client).get({url:"/experimental/session",...t,...n})}background(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/experimental/session/{sessionID}/background",...t,...n})}}class U3 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/resource",...t,...n})}}class O3 extends dA{generateName(e,t){const n=F([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"context"}]}]);return(t?.client??this.client).post({url:"/experimental/project/{projectID}/copy/generate-name",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class K3 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/workspace/adapter",...t,...n})}}class q3 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/workspace",...t,...n})}create(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"type"},{in:"body",key:"branch"},{in:"body",key:"extra"}]}]);return(t?.client??this.client).post({url:"/experimental/workspace",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}syncList(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/experimental/workspace/sync-list",...t,...n})}status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/workspace/status",...t,...n})}remove(e,t){const n=F([e],[{args:[{in:"path",key:"id"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/experimental/workspace/{id}",...t,...n})}warp(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"sessionID"},{in:"body",key:"copyChanges"}]}]);return(t?.client??this.client).post({url:"/experimental/workspace/warp",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_adapter;get adapter(){return this._adapter??=new K3({client:this.client})}}class J3 extends dA{_controlPlane;get controlPlane(){return this._controlPlane??=new F3({client:this.client})}_capabilities;get capabilities(){return this._capabilities??=new G3({client:this.client})}_console;get console(){return this._console??=new R3({client:this.client})}_session;get session(){return this._session??=new T3({client:this.client})}_resource;get resource(){return this._resource??=new U3({client:this.client})}_projectCopy;get projectCopy(){return this._projectCopy??=new O3({client:this.client})}_workspace;get workspace(){return this._workspace??=new q3({client:this.client})}}class H3 extends dA{get(e){return(e?.client??this.client).get({url:"/global/config",...e})}update(e,t){const n=F([e],[{args:[{key:"config",map:"body"}]}]);return(t?.client??this.client).patch({url:"/global/config",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Y3 extends dA{health(e){return(e?.client??this.client).get({url:"/global/health",...e})}event(e){return(e?.client??this.client).sse.get({url:"/global/event",...e})}dispose(e){return(e?.client??this.client).post({url:"/global/dispose",...e})}upgrade(e,t){const n=F([e],[{args:[{in:"body",key:"target"}]}]);return(t?.client??this.client).post({url:"/global/upgrade",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_config;get config(){return this._config??=new H3({client:this.client})}}let P3=class extends dA{subscribe(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).sse.get({url:"/event",...t,...n})}};class V3 extends dA{get(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config",...t,...n})}update(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"config",map:"body"}]}]);return(t?.client??this.client).patch({url:"/config",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}warnings(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/warnings",...t,...n})}providers(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/providers",...t,...n})}overlay(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"scope"}]}]);return(t?.client??this.client).get({url:"/config/overlay",...t,...n})}overlayUpdate(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"scope"},{in:"body",key:"set"},{in:"body",key:"unset"},{in:"body",key:"expected"}]}]);return(t?.client??this.client).patch({url:"/config/overlay",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}sources(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/sources",...t,...n})}effective(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/effective",...t,...n})}rules(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"scope"}]}]);return(t?.client??this.client).get({url:"/config/rules",...t,...n})}rulesUpdate(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"scope"},{in:"body",key:"content"}]}]);return(t?.client??this.client).put({url:"/config/rules",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}modelState(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/model-state",...t,...n})}modelStateUpdate(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"favorite"}]}]);return(t?.client??this.client).patch({url:"/config/model-state",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class j3 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"provider"},{in:"query",key:"model"}]}]);return(t?.client??this.client).get({url:"/experimental/tool",...t,...n})}ids(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/tool/ids",...t,...n})}}class z3 extends dA{remove(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeRemoveInput",map:"body"}]}]);return(t?.client??this.client).delete({url:"/experimental/worktree",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/worktree",...t,...n})}create(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeCreateInput",map:"body"}]}]);return(t?.client??this.client).post({url:"/experimental/worktree",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reset(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeResetInput",map:"body"}]}]);return(t?.client??this.client).post({url:"/experimental/worktree/reset",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}diff(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"base"}]}]);return(t?.client??this.client).get({url:"/experimental/worktree/diff",...t,...n})}diffSummary(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"base"}]}]);return(t?.client??this.client).get({url:"/experimental/worktree/diff/summary",...t,...n})}diffFile(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"base"},{in:"query",key:"file"}]}]);return(t?.client??this.client).get({url:"/experimental/worktree/diff/file",...t,...n})}}class $3 extends dA{text(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"pattern"}]}]);return(t?.client??this.client).get({url:"/find",...t,...n})}files(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"query"},{in:"query",key:"dirs"},{in:"query",key:"type"},{in:"query",key:"limit"}]}]);return(t?.client??this.client).get({url:"/find/file",...t,...n})}symbols(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"query"}]}]);return(t?.client??this.client).get({url:"/find/symbol",...t,...n})}}let W3=class extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"path"}]}]);return(t?.client??this.client).get({url:"/file",...t,...n})}read(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"path"}]}]);return(t?.client??this.client).get({url:"/file/content",...t,...n})}status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/file/status",...t,...n})}};class Z3 extends dA{dispose(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/instance/dispose",...t,...n})}reload(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/instance/reload",...t,...n})}}class X3 extends dA{get(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/path",...t,...n})}}let Ab=class extends dA{raw(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/vcs/diff/raw",...t,...n})}};class eb extends dA{get(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/vcs",...t,...n})}status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/vcs/status",...t,...n})}diff(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"mode"},{in:"query",key:"context"}]}]);return(t?.client??this.client).get({url:"/vcs/diff",...t,...n})}apply(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"patch"}]}]);return(t?.client??this.client).post({url:"/vcs/apply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_diff;get diff2(){return this._diff??=new Ab({client:this.client})}}class tb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/command",...t,...n})}}class nb extends dA{status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/lsp",...t,...n})}}class ib extends dA{status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/formatter",...t,...n})}}class rb extends dA{remove(e,t){const n=F([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/mcp/{name}/auth",...t,...n})}start(e,t){const n=F([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/auth",...t,...n})}callback(e,t){const n=F([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"code"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/auth/callback",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}authenticate(e,t){const n=F([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/auth/authenticate",...t,...n})}}class ob extends dA{status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/mcp",...t,...n})}add(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"name"},{in:"body",key:"config"}]}]);return(t?.client??this.client).post({url:"/mcp",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}connect(e,t){const n=F([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/connect",...t,...n})}disconnect(e,t){const n=F([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/disconnect",...t,...n})}_auth;get auth(){return this._auth??=new rb({client:this.client})}}class sb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/project",...t,...n})}current(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/project/current",...t,...n})}initGit(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/project/git/init",...t,...n})}update(e,t){const n=F([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"name"},{in:"body",key:"icon"},{in:"body",key:"commands"}]}]);return(t?.client??this.client).patch({url:"/project/{projectID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}directories(e,t){const n=F([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/project/{projectID}/directories",...t,...n})}}class ab extends dA{shells(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/pty/shells",...t,...n})}list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/pty",...t,...n})}create(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"command"},{in:"body",key:"args"},{in:"body",key:"cwd"},{in:"body",key:"title"},{in:"body",key:"env"}]}]);return(t?.client??this.client).post({url:"/pty",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}remove(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/pty/{ptyID}",...t,...n})}get(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/pty/{ptyID}",...t,...n})}update(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"title"},{in:"body",key:"sessionID"},{in:"body",key:"size"}]}]);return(t?.client??this.client).put({url:"/pty/{ptyID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}connectToken(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/pty/{ptyID}/connect-token",...t,...n})}connect(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"cursor"},{in:"query",key:"ticket"}]}]);return(t?.client??this.client).get({url:"/pty/{ptyID}/connect",...t,...n})}}class lb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/question",...t,...n})}reply(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"answers"}]}]);return(t?.client??this.client).post({url:"/question/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reject(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/question/{requestID}/reject",...t,...n})}}class gb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/permission",...t,...n})}reply(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"reply"},{in:"body",key:"message"},{in:"body",key:"interactive"}]}]);return(t?.client??this.client).post({url:"/permission/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}saveAlwaysRules(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"approvedAlways"},{in:"body",key:"deniedAlways"}]}]);return(t?.client??this.client).post({url:"/permission/{requestID}/always-rules",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}allowEverything(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"enable"},{in:"body",key:"requestID"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/permission/allow-everything",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}respond(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"permissionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"response"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/permissions/{permissionID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class cb extends dA{authorize(e,t){const n=F([e],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"method"},{in:"body",key:"inputs"}]}]);return(t?.client??this.client).post({url:"/provider/{providerID}/oauth/authorize",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}callback(e,t){const n=F([e],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"method"},{in:"body",key:"code"}]}]);return(t?.client??this.client).post({url:"/provider/{providerID}/oauth/callback",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class db extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/provider",...t,...n})}auth(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/provider/auth",...t,...n})}_oauth;get oauth(){return this._oauth??=new cb({client:this.client})}}class Qb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"scope"},{in:"query",key:"path"},{in:"query",key:"roots"},{in:"query",key:"start"},{in:"query",key:"search"},{in:"query",key:"limit"}]}]);return(t?.client??this.client).get({url:"/session",...t,...n})}create(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"parentID"},{in:"body",key:"title"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"metadata"},{in:"body",key:"permission"},{in:"body",key:"platform"},{in:"body",key:"workspaceID"},{in:"body",key:"sandboxInheritanceToken"}]}]);return(t?.client??this.client).post({url:"/session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/status",...t,...n})}delete(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/session/{sessionID}",...t,...n})}get(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}",...t,...n})}update(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"title"},{in:"body",key:"metadata"},{in:"body",key:"permission"},{in:"body",key:"time"}]}]);return(t?.client??this.client).patch({url:"/session/{sessionID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}children(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/children",...t,...n})}todo(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/todo",...t,...n})}diff(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"messageID"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/diff",...t,...n})}messages(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"limit"},{in:"query",key:"before"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/message",...t,...n})}prompt(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"agent"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"format"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"snapshotInitialization"},{in:"body",key:"editorContext"},{in:"body",key:"parts"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/message",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}deleteMessage(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}",...t,...n})}message(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/message/{messageID}",...t,...n})}fork(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/fork",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}abort(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/abort",...t,...n})}init(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"modelID"},{in:"body",key:"providerID"},{in:"body",key:"messageID"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/init",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}unshare(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/session/{sessionID}/share",...t,...n})}share(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/share",...t,...n})}summarize(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"providerID"},{in:"body",key:"modelID"},{in:"body",key:"auto"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/summarize",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}promptAsync(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"agent"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"format"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"snapshotInitialization"},{in:"body",key:"editorContext"},{in:"body",key:"parts"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/prompt_async",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}command(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"arguments"},{in:"body",key:"command"},{in:"body",key:"variant"},{in:"body",key:"snapshotInitialization"},{in:"body",key:"parts"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/command",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}shell(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"command"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/shell",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}revert(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"partID"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/revert",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}unrevert(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/unrevert",...t,...n})}viewed(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"viewer"},{in:"body",key:"attached"},{in:"body",key:"visible"}]}]);return(t?.client??this.client).post({url:"/session/viewed",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Bb extends dA{delete(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...t,...n})}update(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"part",map:"body"}]}]);return(t?.client??this.client).patch({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class ub extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return(t?.client??this.client).post({url:"/sync/history",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Eb extends dA{start(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/sync/start",...t,...n})}replay(e,t){const n=F([e],[{args:[{in:"query",key:"query_directory",map:"directory"},{in:"query",key:"workspace"},{in:"body",key:"body_directory",map:"directory"},{in:"body",key:"events"}]}]);return(t?.client??this.client).post({url:"/sync/replay",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}steal(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/sync/steal",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_history;get history(){return this._history??=new ub({client:this.client})}}class Cb extends dA{next(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/tui/control/next",...t,...n})}response(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return(t?.client??this.client).post({url:"/tui/control/response",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class hb extends dA{get(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/tui/config",...t,...n})}update(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"scope"},{in:"body",key:"$schema"},{in:"body",key:"theme"},{in:"body",key:"keybinds"},{in:"body",key:"plugin"},{in:"body",key:"plugin_enabled"},{in:"body",key:"title_icon"},{in:"body",key:"scroll_speed"},{in:"body",key:"scroll_acceleration"},{in:"body",key:"diff_style"},{in:"body",key:"mouse"},{in:"body",key:"attention"}]}]);return(t?.client??this.client).patch({url:"/tui/config",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Ib extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/tui/keybinds",...t,...n})}}class fb extends dA{appendPrompt(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"}]}]);return(t?.client??this.client).post({url:"/tui/append-prompt",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}openHelp(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/open-help",...t,...n})}openSessions(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/open-sessions",...t,...n})}openThemes(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/open-themes",...t,...n})}openModels(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/open-models",...t,...n})}submitPrompt(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/submit-prompt",...t,...n})}clearPrompt(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/clear-prompt",...t,...n})}executeCommand(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"command"}]}]);return(t?.client??this.client).post({url:"/tui/execute-command",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}showToast(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"title"},{in:"body",key:"message"},{in:"body",key:"variant"},{in:"body",key:"duration"}]}]);return(t?.client??this.client).post({url:"/tui/show-toast",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}publish(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return(t?.client??this.client).post({url:"/tui/publish",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}selectSession(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/tui/select-session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_control;get control(){return this._control??=new Cb({client:this.client})}_config;get config(){return this._config??=new hb({client:this.client})}_keybind;get keybind(){return this._keybind??=new Ib({client:this.client})}}class pb extends dA{preview(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"scope"},{in:"body",key:"description"},{in:"body",key:"mode"},{in:"body",key:"model"},{in:"body",key:"color"},{in:"body",key:"steps"},{in:"body",key:"tools"},{in:"body",key:"permission"},{in:"body",key:"prompt"}]}]);return(t?.client??this.client).post({url:"/agent-builder/preview",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}save(e,t){const n=F([e],[{args:[{in:"path",key:"path_id",map:"id"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"body_id",map:"id"},{in:"body",key:"scope"},{in:"body",key:"description"},{in:"body",key:"mode"},{in:"body",key:"model"},{in:"body",key:"color"},{in:"body",key:"steps"},{in:"body",key:"tools"},{in:"body",key:"permission"},{in:"body",key:"prompt"}]}]);return(t?.client??this.client).put({url:"/agent-builder/{id}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class mb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/background-process",...t,...n})}get(e,t){const n=F([e],[{args:[{in:"path",key:"processID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/background-process/{processID}",...t,...n})}logs(e,t){const n=F([e],[{args:[{in:"path",key:"processID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/background-process/{processID}/logs",...t,...n})}stop(e,t){const n=F([e],[{args:[{in:"path",key:"processID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/background-process/{processID}/stop",...t,...n})}restart(e,t){const n=F([e],[{args:[{in:"path",key:"processID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/background-process/{processID}/restart",...t,...n})}stopSession(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/background-process/session/{sessionID}/stop",...t,...n})}}class wb extends dA{generate(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"prompt"},{in:"body",key:"providerID"},{in:"body",key:"modelID"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/branch-name",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class yb extends dA{generate(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"path"},{in:"body",key:"selectedFiles"},{in:"body",key:"previousMessage"},{in:"body",key:"language"}]}]);return(t?.client??this.client).post({url:"/commit-message",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Db extends dA{enhance(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"}]}]);return(t?.client??this.client).post({url:"/enhance-prompt",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class kb extends dA{status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/indexing/status",...t,...n})}warnings(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/indexing/warnings",...t,...n})}models(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/indexing/models",...t,...n})}consent(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"enabled"}]}]);return(t?.client??this.client).put({url:"/indexing/consent",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class bb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/interactive-terminal",...t,...n})}get(e,t){const n=F([e],[{args:[{in:"path",key:"terminalID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/interactive-terminal/{terminalID}",...t,...n})}write(e,t){const n=F([e],[{args:[{in:"path",key:"terminalID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"interactiveTerminalWriteInput",map:"body"}]}]);return(t?.client??this.client).post({url:"/interactive-terminal/{terminalID}/input",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}resize(e,t){const n=F([e],[{args:[{in:"path",key:"terminalID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"interactiveTerminalResizeInput",map:"body"}]}]);return(t?.client??this.client).post({url:"/interactive-terminal/{terminalID}/resize",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}close(e,t){const n=F([e],[{args:[{in:"path",key:"terminalID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/interactive-terminal/{terminalID}/close",...t,...n})}}class vb extends dA{transcriptions(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"model"},{in:"body",key:"input_audio"},{in:"body",key:"language"},{in:"body",key:"prompt"},{in:"body",key:"temperature"}]}]);return(t?.client??this.client).post({url:"/kilo/audio/transcriptions",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Mb extends dA{images(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/models/images",...t,...n})}}class Nb extends dA{set(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"organizationId"}]}]);return(t?.client??this.client).post({url:"/kilo/organization",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Sb extends dA{status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/claw/status",...t,...n})}chatCredentials(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/claw/chat-credentials",...t,...n})}}class xb extends dA{get(e,t){const n=F([e],[{args:[{in:"path",key:"id"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/cloud/session/{id}",...t,...n})}import(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"sessionId"}]}]);return(t?.client??this.client).post({url:"/kilo/cloud/session/import",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Lb extends dA{_session;get session(){return this._session??=new xb({client:this.client})}}class _b extends dA{profile(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/profile",...t,...n})}authStatus(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/auth-status",...t,...n})}modes(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/modes",...t,...n})}fim(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"prefix"},{in:"body",key:"suffix"},{in:"body",key:"provider"},{in:"body",key:"model"},{in:"body",key:"maxTokens"},{in:"body",key:"temperature"}]}]);return(t?.client??this.client).sse.post({url:"/kilo/fim",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}edit(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"provider"},{in:"body",key:"model"},{in:"body",key:"maxTokens"},{in:"body",key:"currentFilePath"},{in:"body",key:"currentFileContent"},{in:"body",key:"cursorLine"},{in:"body",key:"cursorCharacter"},{in:"body",key:"editableRegionStartLine"},{in:"body",key:"editableRegionEndLine"},{in:"body",key:"recentlyViewedSnippets"},{in:"body",key:"editDiffHistory"}]}]);return(t?.client??this.client).post({url:"/kilo/edit",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}notifications(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/notifications",...t,...n})}cloudSessions(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"cursor"},{in:"query",key:"limit"},{in:"query",key:"gitUrl"}]}]);return(t?.client??this.client).get({url:"/kilo/cloud-sessions",...t,...n})}_audio;get audio(){return this._audio??=new vb({client:this.client})}_models;get models(){return this._models??=new Mb({client:this.client})}_organization;get organization(){return this._organization??=new Nb({client:this.client})}_claw;get claw(){return this._claw??=new Sb({client:this.client})}_cloud;get cloud(){return this._cloud??=new Lb({client:this.client})}}class Fb extends dA{snapshot(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/kilocode/heap/snapshot",...t,...n})}}class Gb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilocode/notebook",...t,...n})}reply(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"result"}]}]);return(t?.client??this.client).post({url:"/kilocode/notebook/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reject(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"error"}]}]);return(t?.client??this.client).post({url:"/kilocode/notebook/{requestID}/reject",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Rb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilocode/agent-manager",...t,...n})}reply(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"result"}]}]);return(t?.client??this.client).post({url:"/kilocode/agent-manager/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reject(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"error"}]}]);return(t?.client??this.client).post({url:"/kilocode/agent-manager/{requestID}/reject",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Tb extends dA{project(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"worktree"},{in:"body",key:"vcs"},{in:"body",key:"name"},{in:"body",key:"iconUrl"},{in:"body",key:"iconColor"},{in:"body",key:"timeCreated"},{in:"body",key:"timeUpdated"},{in:"body",key:"timeInitialized"},{in:"body",key:"sandboxes"},{in:"body",key:"commands"}]}]);return(t?.client??this.client).post({url:"/kilocode/session-import/project",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}session(e,t){const n=F([e],[{args:[{in:"query",key:"query_directory",map:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"projectID"},{in:"body",key:"force"},{in:"body",key:"workspaceID"},{in:"body",key:"parentID"},{in:"body",key:"slug"},{in:"body",key:"body_directory",map:"directory"},{in:"body",key:"title"},{in:"body",key:"version"},{in:"body",key:"shareURL"},{in:"body",key:"summary"},{in:"body",key:"revert"},{in:"body",key:"permission"},{in:"body",key:"timeCreated"},{in:"body",key:"timeUpdated"},{in:"body",key:"timeCompacting"},{in:"body",key:"timeArchived"}]}]);return(t?.client??this.client).post({url:"/kilocode/session-import/session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}message(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"sessionID"},{in:"body",key:"timeCreated"},{in:"body",key:"data"}]}]);return(t?.client??this.client).post({url:"/kilocode/session-import/message",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}part(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"messageID"},{in:"body",key:"sessionID"},{in:"body",key:"timeCreated"},{in:"body",key:"data"}]}]);return(t?.client??this.client).post({url:"/kilocode/session-import/part",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Ub extends dA{agentRequirements(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"agent"}]}]);return(t?.client??this.client).get({url:"/kilocode/agent/requirements",...t,...n})}removeSkill(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"location"}]}]);return(t?.client??this.client).post({url:"/kilocode/skill/remove",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}removeAgent(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"name"}]}]);return(t?.client??this.client).post({url:"/kilocode/agent/remove",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}sessionModelUsage(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/model-usage",...t,...n})}_heap;get heap(){return this._heap??=new Fb({client:this.client})}_notebook;get notebook(){return this._notebook??=new Gb({client:this.client})}_agentManager;get agentManager(){return this._agentManager??=new Rb({client:this.client})}_sessionImport;get sessionImport(){return this._sessionImport??=new Tb({client:this.client})}}class Ob extends dA{status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilocode/anaconda-desktop/status",...t,...n})}open(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/kilocode/anaconda-desktop/open",...t,...n})}sync(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"acknowledgeToolLimitations"}]}]);return(t?.client??this.client).post({url:"/kilocode/anaconda-desktop/sync",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Kb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/network",...t,...n})}reply(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/network/{requestID}/reply",...t,...n})}reject(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/network/{requestID}/reject",...t,...n})}}class qb extends dA{enable(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/remote/enable",...t,...n})}disable(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/remote/disable",...t,...n})}status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/remote/status",...t,...n})}}class Jb extends dA{support(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/sandbox/support",...t,...n})}status(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/sandbox",...t,...n})}toggle(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/sandbox/toggle",...t,...n})}}class Hb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/suggestion",...t,...n})}accept(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"index"}]}]);return(t?.client??this.client).post({url:"/suggestion/{requestID}/accept",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}dismiss(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/suggestion/{requestID}/dismiss",...t,...n})}}class Yb extends dA{capture(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"event"},{in:"body",key:"properties"}]}]);return(t?.client??this.client).post({url:"/telemetry/capture",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}setEnabled(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"enabled"}]}]);return(t?.client??this.client).post({url:"/telemetry/setEnabled",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Pb extends dA{status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/memory/status",...t,...n})}show(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/memory/show",...t,...n})}enable(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/memory/enable",...t,...n})}disable(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/memory/disable",...t,...n})}configure(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"autoConsolidate"},{in:"body",key:"verbose"}]}]);return(t?.client??this.client).post({url:"/memory/configure",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}rebuild(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/memory/rebuild",...t,...n})}remember(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"},{in:"body",key:"key"},{in:"body",key:"file"},{in:"body",key:"section"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/memory/remember",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}correct(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"},{in:"body",key:"key"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/memory/correct",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}forget(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"query"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/memory/forget",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}purge(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"confirm"}]}]);return(t?.client??this.client).post({url:"/memory/purge",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Vb extends dA{get(e){return(e?.client??this.client).get({url:"/api/health",...e})}}class jb extends dA{get(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/location",...t,...n})}}class zb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/agent",...t,...n})}}class $b extends dA{list(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/permission",...t,...n})}reply(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"requestID"},{in:"body",key:"reply"},{in:"body",key:"message"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/permission/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Wb extends dA{list(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/question",...t,...n})}reply(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"requestID"},{key:"questionV2Reply",map:"body"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/question/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reject(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"requestID"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/question/{requestID}/reject",...t,...n})}}class Zb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"workspace"},{in:"query",key:"limit"},{in:"query",key:"order"},{in:"query",key:"search"},{in:"query",key:"directory"},{in:"query",key:"project"},{in:"query",key:"subpath"},{in:"query",key:"cursor"}]}]);return(t?.client??this.client).get({url:"/api/session",...t,...n})}create(e,t){const n=F([e],[{args:[{in:"body",key:"id"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"location"}]}]);return(t?.client??this.client).post({url:"/api/session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}get(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}",...t,...n})}prompt(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"body",key:"id"},{in:"body",key:"prompt"},{in:"body",key:"delivery"},{in:"body",key:"resume"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/prompt",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}compact(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/compact",...t,...n})}wait(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/wait",...t,...n})}context(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/context",...t,...n})}messages(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"limit"},{in:"query",key:"order"},{in:"query",key:"cursor"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/message",...t,...n})}_permission;get permission(){return this._permission??=new $b({client:this.client})}_question;get question(){return this._question??=new Wb({client:this.client})}}class Xb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/model",...t,...n})}}class A8 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/provider",...t,...n})}get(e,t){const n=F([e],[{args:[{in:"path",key:"providerID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/provider/{providerID}",...t,...n})}}class e8 extends dA{key(e,t){const n=F([e],[{args:[{in:"path",key:"integrationID"},{in:"query",key:"location"},{in:"body",key:"key"},{in:"body",key:"label"}]}]);return(t?.client??this.client).post({url:"/api/integration/{integrationID}/connect/key",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}oauth(e,t){const n=F([e],[{args:[{in:"path",key:"integrationID"},{in:"query",key:"location"},{in:"body",key:"methodID"},{in:"body",key:"inputs"},{in:"body",key:"label"}]}]);return(t?.client??this.client).post({url:"/api/integration/{integrationID}/connect/oauth",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class t8 extends dA{cancel(e,t){const n=F([e],[{args:[{in:"path",key:"attemptID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).delete({url:"/api/integration/attempt/{attemptID}",...t,...n})}status(e,t){const n=F([e],[{args:[{in:"path",key:"attemptID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/integration/attempt/{attemptID}",...t,...n})}complete(e,t){const n=F([e],[{args:[{in:"path",key:"attemptID"},{in:"query",key:"location"},{in:"body",key:"code"}]}]);return(t?.client??this.client).post({url:"/api/integration/attempt/{attemptID}/complete",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class n8 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/integration",...t,...n})}get(e,t){const n=F([e],[{args:[{in:"path",key:"integrationID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/integration/{integrationID}",...t,...n})}_connect;get connect(){return this._connect??=new e8({client:this.client})}_attempt;get attempt(){return this._attempt??=new t8({client:this.client})}}class i8 extends dA{remove(e,t){const n=F([e],[{args:[{in:"path",key:"credentialID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).delete({url:"/api/credential/{credentialID}",...t,...n})}update(e,t){const n=F([e],[{args:[{in:"path",key:"credentialID"},{in:"query",key:"location"},{in:"body",key:"label"}]}]);return(t?.client??this.client).patch({url:"/api/credential/{credentialID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}let r8=class extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/permission/request",...t,...n})}};class o8 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"projectID"}]}]);return(t?.client??this.client).get({url:"/api/permission/saved",...t,...n})}remove(e,t){const n=F([e],[{args:[{in:"path",key:"id"}]}]);return(t?.client??this.client).delete({url:"/api/permission/saved/{id}",...t,...n})}}class s8 extends dA{_request;get request(){return this._request??=new r8({client:this.client})}_saved;get saved(){return this._saved??=new o8({client:this.client})}}class a8 extends dA{read(e,t){const n=F([e],[{args:[{in:"query",key:"location"},{in:"query",key:"path"}]}]);return(t?.client??this.client).get({url:"/api/fs/read/*",...t,...n})}list(e,t){const n=F([e],[{args:[{in:"query",key:"location"},{in:"query",key:"path"}]}]);return(t?.client??this.client).get({url:"/api/fs/list",...t,...n})}find(e,t){const n=F([e],[{args:[{in:"query",key:"location"},{in:"query",key:"query"},{in:"query",key:"type"},{in:"query",key:"limit"}]}]);return(t?.client??this.client).get({url:"/api/fs/find",...t,...n})}}class l8 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/command",...t,...n})}}class g8 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/skill",...t,...n})}}class c8 extends dA{subscribe(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).sse.get({url:"/api/event",...t,...n})}}class d8 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/pty",...t,...n})}create(e,t){const n=F([e],[{args:[{in:"query",key:"location"},{in:"body",key:"command"},{in:"body",key:"args"},{in:"body",key:"cwd"},{in:"body",key:"title"},{in:"body",key:"env"}]}]);return(t?.client??this.client).post({url:"/api/pty",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}remove(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).delete({url:"/api/pty/{ptyID}",...t,...n})}get(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/pty/{ptyID}",...t,...n})}update(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location"},{in:"body",key:"title"},{in:"body",key:"sessionID"},{in:"body",key:"size"}]}]);return(t?.client??this.client).put({url:"/api/pty/{ptyID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}connectToken(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).post({url:"/api/pty/{ptyID}/connect-token",...t,...n})}connect(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location[directory]"},{in:"query",key:"location[workspace]"},{in:"query",key:"cursor"},{in:"query",key:"ticket"},{in:"query",key:"replayExited"}]}]);return(t?.client??this.client).get({url:"/api/pty/{ptyID}/connect",...t,...n})}}class Q8 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/question/request",...t,...n})}}class B8 extends dA{_request;get request(){return this._request??=new Q8({client:this.client})}}class u8 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/reference",...t,...n})}}class E8 extends dA{remove(e,t){const n=F([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"location"},{in:"body",key:"directory"},{in:"body",key:"force"}]}]);return(t?.client??this.client).delete({url:"/experimental/project/{projectID}/copy",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}create(e,t){const n=F([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"location"},{in:"body",key:"strategy"},{in:"body",key:"directory"},{in:"body",key:"name"}]}]);return(t?.client??this.client).post({url:"/experimental/project/{projectID}/copy",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}refresh(e,t){const n=F([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).post({url:"/experimental/project/{projectID}/copy/refresh",...t,...n})}}class C8 extends dA{_health;get health(){return this._health??=new Vb({client:this.client})}_location;get location(){return this._location??=new jb({client:this.client})}_agent;get agent(){return this._agent??=new zb({client:this.client})}_session;get session(){return this._session??=new Zb({client:this.client})}_model;get model(){return this._model??=new Xb({client:this.client})}_provider;get provider(){return this._provider??=new A8({client:this.client})}_integration;get integration(){return this._integration??=new n8({client:this.client})}_credential;get credential(){return this._credential??=new i8({client:this.client})}_permission;get permission(){return this._permission??=new s8({client:this.client})}_fs;get fs(){return this._fs??=new a8({client:this.client})}_command;get command(){return this._command??=new l8({client:this.client})}_skill;get skill(){return this._skill??=new g8({client:this.client})}_event;get event(){return this._event??=new c8({client:this.client})}_pty;get pty(){return this._pty??=new d8({client:this.client})}_question;get question(){return this._question??=new B8({client:this.client})}_reference;get reference(){return this._reference??=new u8({client:this.client})}_projectCopy;get projectCopy(){return this._projectCopy??=new E8({client:this.client})}}class id extends dA{static __registry=new x3;constructor(e){super(e),id.__registry.set(this,e?.key)}_auth;get auth(){return this._auth??=new L3({client:this.client})}_app;get app(){return this._app??=new _3({client:this.client})}_experimental;get experimental(){return this._experimental??=new J3({client:this.client})}_global;get global(){return this._global??=new Y3({client:this.client})}_event;get event(){return this._event??=new P3({client:this.client})}_config;get config(){return this._config??=new V3({client:this.client})}_tool;get tool(){return this._tool??=new j3({client:this.client})}_worktree;get worktree(){return this._worktree??=new z3({client:this.client})}_find;get find(){return this._find??=new $3({client:this.client})}_file;get file(){return this._file??=new W3({client:this.client})}_instance;get instance(){return this._instance??=new Z3({client:this.client})}_path;get path(){return this._path??=new X3({client:this.client})}_vcs;get vcs(){return this._vcs??=new eb({client:this.client})}_command;get command(){return this._command??=new tb({client:this.client})}_lsp;get lsp(){return this._lsp??=new nb({client:this.client})}_formatter;get formatter(){return this._formatter??=new ib({client:this.client})}_mcp;get mcp(){return this._mcp??=new ob({client:this.client})}_project;get project(){return this._project??=new sb({client:this.client})}_pty;get pty(){return this._pty??=new ab({client:this.client})}_question;get question(){return this._question??=new lb({client:this.client})}_permission;get permission(){return this._permission??=new gb({client:this.client})}_provider;get provider(){return this._provider??=new db({client:this.client})}_session;get session(){return this._session??=new Qb({client:this.client})}_part;get part(){return this._part??=new Bb({client:this.client})}_sync;get sync(){return this._sync??=new Eb({client:this.client})}_tui;get tui(){return this._tui??=new fb({client:this.client})}_agentBuilder;get agentBuilder(){return this._agentBuilder??=new pb({client:this.client})}_backgroundProcess;get backgroundProcess(){return this._backgroundProcess??=new mb({client:this.client})}_branchName;get branchName(){return this._branchName??=new wb({client:this.client})}_commitMessage;get commitMessage(){return this._commitMessage??=new yb({client:this.client})}_enhancePrompt;get enhancePrompt(){return this._enhancePrompt??=new Db({client:this.client})}_indexing;get indexing(){return this._indexing??=new kb({client:this.client})}_interactiveTerminal;get interactiveTerminal(){return this._interactiveTerminal??=new bb({client:this.client})}_kilo;get kilo(){return this._kilo??=new _b({client:this.client})}_kilocode;get kilocode(){return this._kilocode??=new Ub({client:this.client})}_anacondaDesktop;get anacondaDesktop(){return this._anacondaDesktop??=new Ob({client:this.client})}_network;get network(){return this._network??=new Kb({client:this.client})}_remote;get remote(){return this._remote??=new qb({client:this.client})}_sandbox;get sandbox(){return this._sandbox??=new Jb({client:this.client})}_suggestion;get suggestion(){return this._suggestion??=new Hb({client:this.client})}_telemetry;get telemetry(){return this._telemetry??=new Yb({client:this.client})}_memory;get memory(){return this._memory??=new Pb({client:this.client})}_v2;get v2(){return this._v2??=new C8({client:this.client})}}function h8(A,e,t,n){if(!n?.throwOnError||A instanceof Error)return A;if(typeof A=="object"&&A!==null&&Object.keys(A).length>0){const r=A,o=typeof r.data?.message=="string"&&r.data.message||typeof r.message=="string"&&r.message||typeof r.name=="string"&&r.name||hB(t,e);return new Error(o,{cause:{body:A,status:e?.status}})}if(typeof A=="string"&&A.length>0)return new Error(A,{cause:{body:A,status:e?.status}});const i=e?"(empty response body)":"network error (no response)";return new Error(`kilo server ${hB(t,e)}: ${i}`,{cause:{body:A,status:e?.status}})}function hB(A,e){const t=A?.method??"?",n=A?.url??"?",i=e?.status,r=e?.statusText;return`${t} ${n}${i?" → "+i:""}${r?" "+r:""}`}function I8(A,e,t){if(A)return e&&(A===e||t&&A===t(e))?e:A}function f8(A,e){if(A.method!=="GET"&&A.method!=="HEAD")return A;const t=new URL(A.url);let n=!1;for(const[r,o]of[["x-kilo-directory","directory"],["x-kilo-workspace","workspace"]]){const s=I8(A.headers.get(r),o==="directory"?e.directory:e.workspace,o==="directory"?encodeURIComponent:void 0);if(s){for(const a of t.pathname.startsWith("/api/")?[o,`location[${o}]`]:[o])t.searchParams.has(a)||t.searchParams.set(a,s);n=!0}}if(!n)return A;const i=new Request(t,A);return i.headers.delete("x-kilo-directory"),i.headers.delete("x-kilo-workspace"),i}function p8(A){A?.fetch||(A={...A,fetch:n=>fetch(n,{duplex:"half",timeout:!1})}),A?.directory&&(A.headers={...A.headers,"x-kilo-directory":encodeURIComponent(A.directory)}),A?.experimental_workspaceID&&(A.headers={...A.headers,"x-kilo-workspace":A.experimental_workspaceID}),A.duplex="half";const e=Yh(A);return e.interceptors.request.use(t=>f8(t,{directory:A?.directory,workspace:A?.experimental_workspaceID})),e.interceptors.response.use(t=>{if(t.headers.get("content-type")==="text/html")throw new Error("Request is not supported by this version of OpenCode Server (Server responded with text/html)");return t}),e.interceptors.error.use(h8),new id({client:e})}const m8=Array.from({length:20},(A,e)=>4097+e),w8=1440*60*1e3,rd="kilo.config.server",yr={},od=window.fetch.bind(window);function y8(A){const e=new TextEncoder().encode(A);return btoa(String.fromCharCode(...e))}function IB(A){return A?decodeURIComponent(A):""}function gl(A){const e=new URL(A),t=IB(e.username)||"kilo",n=IB(e.password)||"kilo";return e.username="",e.password="",e.search="",e.hash="",{url:e.toString().replace(/\/$/,""),token:y8(`${t}:${n}`)}}function ee(A){const e=gl(A.url);return p8({baseUrl:e.url,directory:cl(A.dir),headers:{Authorization:`Basic ${e.token}`},fetch:od})}function cl(A){const e=A.trim();if(e)return e}function ua(A){return A instanceof Error?A.message:typeof A=="string"?A:A==null?"Unknown error":JSON.stringify(A)}function TA(A,e){if(e.error)throw new Error(`${A}: ${ua(e.error)}`);if(e.data===void 0)throw new Error(`${A}: empty response`);return e.data}async function D8(A){const t=(await Ql(A)).find(n=>n.id===A.project);if(!t)throw new Error(`Project not found: ${A.project}`);return t}async function B1(A,e){return await e.then(t=>{if(t.error){console.warn(`${A}: ${ua(t.error)}`);return}return t.data}).catch(t=>{console.warn(`${A}: ${ua(t)}`)})}function k8(A){if(typeof A!="string")return;const e=A.indexOf("/");if(!(e<=0||e>=A.length-1))return{provider:A.slice(0,e),model:A.slice(e+1)}}function dl(A){const e=cl(A.dir);return e?{directory:e}:void 0}function b8(A){return A.split("_").filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function v8(A){return{keybinds:Object.entries(A.keybinds??{}).map(([e,t])=>({id:e,label:b8(e),group:"Configured",default:t??"none",description:"Configured TUI keybind"}))}}function Ea(A){return A.replace(/\\/g,"/").replace(/\/+$/,"")||"/"}function M8(A,e){const t=Ea(A),n=Ea(e);return n===t?!0:n.startsWith(`${t}/`)}function Vh(A){return A.id!=="global"?!0:Ea(A.worktree)!=="/"}function N8(A,e){return[A.worktree,...A.sandboxes].reduce((t,n)=>M8(n,e)?Math.max(t,Ea(n).length):t,-1)}function S8(A,e){const t=A.find(n=>n.id===e.projectID);return t||A.reduce((n,i)=>{const r=N8(i,e.directory);return r<=n.score?n:{item:i,score:r}},{score:-1}).item}async function jh(A){const e=new AbortController,t=window.setTimeout(()=>e.abort(),400),n=gl(A);return await od(`${n.url}/global/health`,{headers:{Authorization:`Basic ${n.token}`},signal:e.signal}).then(i=>i.ok?A:void 0).catch(()=>{}).finally(()=>window.clearTimeout(t))}function x8(A){return Array.isArray(A)?A.filter(e=>{if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&typeof t.worktree=="string"&&typeof t.time?.updated=="number"}):[]}function L8(A){return A.reduce((e,t)=>Math.max(e,t.time.updated),0)}async function _8(A){if(!await jh(A))return;const t=new AbortController,n=window.setTimeout(()=>t.abort(),400),i=gl(A);return await od(`${i.url}/project`,{headers:{Authorization:`Basic ${i.token}`},signal:t.signal}).then(async r=>{if(!r.ok)return{url:A,count:0,time:0};const o=x8(await r.json()).filter(Vh);return{url:A,count:o.length,time:L8(o)}}).catch(()=>({url:A,count:0,time:0})).finally(()=>window.clearTimeout(n))}function fB(A){return Number(new URL(A).port)||0}function pB(A){return new URL(A).hostname==="127.0.0.1"?1:0}function Ut(){return window.localStorage.getItem(rd)??""}function At(A){window.localStorage.setItem(rd,A)}function Bi(){window.localStorage.removeItem(rd)}async function F8(A){return await jh(A)!==void 0}async function G8(){const A=m8.flatMap(t=>[`http://127.0.0.1:${t}`,`http://localhost:${t}`]);return(await Promise.all(A.map(_8))).filter(t=>t!==void 0).toSorted((t,n)=>n.count-t.count||n.time-t.time||fB(n.url)-fB(t.url)||pB(n.url)-pB(t.url))[0]?.url}async function ui(){if(yr.run)return await yr.run;const A=G8().finally(()=>{yr.run===A&&(yr.run=void 0)});return yr.run=A,await A}async function rr(){const A=await ui();if(A)return A;const e=Ut();if(e){if(await F8(e))return e;Bi()}}async function R8(A){const e=ee(A),[t,n,i,r,o,s,a,l,c,g,d,Q]=await Promise.all([e.global.health(),e.config.overlay({scope:A.scope}),e.config.modelState(),e.provider.list(),e.provider.auth(),e.tui.config.get(),B1("TUI keybinds",e.tui.keybind.list()),e.tool.ids(),e.mcp.status(),e.lsp.status(),e.formatter.status(),e.app.agents()]),B=TA("Config overlay",n),E=k8(B.effective.model),I=E?await B1("Tool metadata",e.tool.list(E)):void 0,h=TA("TUI config",s);return{health:TA("Health",t),effective:B.effective,overlay:B,sources:{sources:B.sources},modelState:TA("Model state",i),providers:TA("Providers",r),authMethods:TA("Provider auth methods",o),tui:h,keybinds:a??v8(h),tools:TA("Tools",l),toolDetails:I??[],mcp:TA("MCP status",c),lsp:TA("LSP status",g),formatter:TA("Formatter status",d),agents:TA("Agents",Q)}}async function T8(A){return TA("Kilo embedding models",await ee(A).indexing.models())}async function zh(A){const t=await ee(A).kilo.profile(dl(A));return TA("Kilo profile",t)}async function U8(A,e){const t=ee(A),n=await t.kilo.organization.set({...dl(A),organizationId:e});TA("Switch Kilo account",n),await t.global.dispose()}async function O8(A){const e=ee(A),t=await e.auth.remove({providerID:"kilo"});TA("Log out of Kilo",t),await e.global.dispose()}async function K8(A){const t=await ee(A).provider.oauth.authorize({...dl(A),providerID:"kilo",method:0});return TA("Start Kilo login",t)}async function q8(A,e){const t=ee(A),n=await t.provider.oauth.callback({...dl(A),providerID:"kilo",method:0},e?{signal:e}:void 0);TA("Complete Kilo login",n),await t.global.dispose()}async function $h(A){const e=ee(A),t=cl(A.dir),n=await e.project.list(t?{directory:t}:void 0);return TA("Projects",n)}async function Ql(A){return(await $h(A)).filter(Vh)}async function J8(A){const e=ee(A),[t,n]=await Promise.all([Ql(A),e.experimental.session.list({archived:!1,start:Date.now()-w8,limit:500})]),i=TA("Recent sessions",n),r=new Map;for(const o of i){const s=S8(t,o);s&&r.set(s.id,(r.get(s.id)??0)+1)}return t.map(o=>({...o,sessions:r.get(o.id)??0})).filter(o=>o.sessions>0)}async function H8(A){const e=await D8(A),t={url:A.url,dir:e.worktree},n=ee(t),[i,r,o]=await Promise.all([n.config.overlay({scope:"global"}),n.vcs.get({directory:t.dir}),n.worktree.list({directory:t.dir})]),s=TA("Config",i),a=TA("Worktrees",o),l=await Promise.all([t.dir,...a.map(c=>c.directory)].map(c=>j8({url:A.url},c)));return{project:e,config:s.global,vcs:TA("VCS",r),worktrees:a,terminals:l.flat()}}async function Y8(A,e){const t=ee(A),n=e?.trim(),i=await t.worktree.create({directory:A.dir,...n?{worktreeCreateInput:{name:n}}:{}});return TA("Create worktree",i)}async function P8(A,e){const n=await ee(A).worktree.remove({directory:A.dir,worktreeRemoveInput:{directory:e}});return TA("Remove worktree",n)}async function V8(A,e){const n=await ee(A).worktree.reset({directory:A.dir,worktreeResetInput:{directory:e}});return TA("Reset worktree",n)}async function j8(A,e){const t=ee({url:A.url,dir:e}),[n,i,r,o]=await Promise.all([t.pty.list({directory:e}),B1("Session status",t.session.status({directory:e})),B1("Pending permissions",t.permission.list({directory:e})),B1("Pending questions",t.question.list({directory:e}))]),s=TA("Terminals",n),a=i??{},l=mB(r??[]),c=mB(o??[]),g=new Map;return await Promise.all(s.map(async d=>{if(!d.sessionID||g.has(d.sessionID))return;const Q=await B1("Session",t.session.get({directory:e,sessionID:d.sessionID}));Q&&g.set(d.sessionID,Q)})),s.map(d=>{const Q=d.sessionID?g.get(d.sessionID):void 0;return{...d,directory:e,session:Q,sessionStatus:d.sessionID?a[d.sessionID]:void 0,attention:d.sessionID?W8(d.sessionID,l,c):void 0}})}function Wh(A){return new Set(A.flatMap(e=>e.sessionID?[e.sessionID]:[]))}function mB(A){return new Set(A.map(e=>e.sessionID))}function wB(A,e){return A.some(t=>e.has(t.sessionID))}async function z8(A,e){const t=ee({url:A.url,dir:e}),[n,i,r,o]=await Promise.all([B1("Session status",t.session.status({directory:e})),B1("Terminals",t.pty.list({directory:e})),B1("Pending permissions",t.permission.list({directory:e})),B1("Pending questions",t.question.list({directory:e}))]),s=Wh(i??[]),a=Object.entries(n??{}).some(([c,g])=>s.has(c)&&g.type!=="idle"),l=wB(r??[],s)||wB(o??[],s);return{busy:a,attention:l}}async function $8(A,e){const t=ee({url:A.url,dir:e}),n=await B1("Terminals",t.pty.list({directory:e}));return Wh(n??[])}function W8(A,e,t){if(e.has(A))return"permission";if(t.has(A))return"question"}async function Z8(A,e){const n=await ee({url:A.url,dir:e}).worktree.diffSummary({directory:e});return TA("Worktree diff",n)}async function X8(A,e,t){const i=await ee({url:A.url,dir:e}).worktree.diffFile({directory:e,file:t});return TA("Worktree diff file",i)}async function Av(A,e,t="Kilo session"){const i=await ee({url:A.url,dir:e}).pty.create({directory:e,command:"kilo",cwd:e,title:t});return TA("Create terminal",i)}async function ev(A,e){const n=await ee({url:A.url,dir:A.dir}).pty.remove({directory:A.dir,ptyID:e});return TA("Remove terminal",n)}async function yB(A,e,t,n){const r=await ee(A).session.viewed({directory:A.dir,viewer:e,attached:t,visible:n});return TA("Viewed sessions",r)}function Zh(A,e){const t=ee(A),n=new AbortController;return(async()=>{const i=await t.global.event({signal:n.signal,sseMaxRetryAttempts:0});for await(const r of i.stream){if(n.signal.aborted)return;e(r)}})().catch(i=>{n.signal.aborted||console.warn(`Project events: ${ua(i)}`)}),()=>n.abort()}async function tv(A,e,t,n){const r=await ee({url:A.url,dir:A.dir}).pty.update({directory:A.dir,ptyID:e,size:{cols:t,rows:n}});return TA("Resize terminal",r)}function nv(A,e,t=0){const n=gl(A.url),i=new URL(`/pty/${encodeURIComponent(e)}/connect`,n.url);return i.protocol=i.protocol==="https:"?"wss:":"ws:",i.searchParams.set("directory",A.dir),i.searchParams.set("cursor",String(t)),i.searchParams.set("auth_token",n.token),i.toString()}async function Bo(A,e,t){const n=ee(A),i=Object.keys(e).length?e:void 0,r=await n.config.overlayUpdate({directory:cl(A.dir),scope:A.scope,set:i,unset:t});return TA("Update config",r)}async function iv(A,e){return Bo(A,e)}async function rv(A,e){return Bo(A,{},e)}async function ov(A,e){const n=await ee(A).config.modelStateUpdate({favorite:e});return TA("Update model state",n)}async function sv(A,e,t,n){const i=ee(A),r=n?{type:"api",key:t,metadata:n}:{type:"api",key:t},o=await i.auth.set({providerID:e,auth:r});TA("Connect provider",o),await i.global.dispose()}async function av(A,e,t,n){const r=await ee(A).provider.oauth.authorize({providerID:e,method:t,inputs:n});return TA("Authorize provider",r)}async function lv(A,e,t,n){const i=ee(A),r=await i.provider.oauth.callback({providerID:e,method:t,code:n});TA("Complete provider authorization",r),await i.global.dispose()}async function gv(A,e){const n=await ee(A).mcp.connect({name:e});return TA("Connect MCP server",n)}async function cv(A,e){const n=await ee(A).mcp.disconnect({name:e});return TA("Disconnect MCP server",n)}async function dv(A,e){const n=await ee(A).mcp.auth.authenticate({name:e});return TA("Authenticate MCP server",n)}async function Qv(A,e){const n=await ee(A).tui.config.update({scope:A.scope,...e});return TA("Update TUI config",n)}async function Bv(A,e){const n=await ee(A).agentBuilder.preview(e);return TA("Preview agent",n)}async function uv(A,e){const n=await ee(A).agentBuilder.save({path_id:e.id,scope:e.scope,description:e.description,mode:e.mode,model:e.model,color:e.color,steps:e.steps,tools:e.tools,permission:e.permission,prompt:e.prompt});return TA("Save agent",n)}function Ev(A){return!A||A==="normal"?"default":A==="small"?"sm":A==="large"?"lg":A}function Cv(A){return!A||A==="default"?"primary":A}function QA(A){const[e,t]=CA(A,["variant","size","icon","class","classList","children"]);return u(al,cA(t,{"data-component":"button",get"data-size"(){return Ev(e.size)},get"data-variant"(){return Cv(e.variant)},get"data-icon"(){return e.icon?"inline-start":void 0},get classList(){return{...e.classList,[e.class??""]:!!e.class}},get children(){return[u(H,{get when(){return e.icon},children:n=>u(Ft,{get name(){return n()},size:"small"})}),MA(()=>e.children)]}}))}function hv(A,e){const t=Object.fromEntries(Object.entries(e).filter(n=>n[1]!==void 0));if(typeof A=="string"){const n=Object.entries(t).map(i=>`${i[0]}:${i[1]}`).join(";");return n?`${A};${n}`:A}return{...A??{},...t}}var Iv=M("<div>");function zA(A){const[e,t]=CA(A,["variant","size","padding","style","class","classList","children"]),n=()=>typeof e.padding=="number"?`${e.padding}px`:e.padding;return(()=>{var i=Iv();return pt(i,cA(t,{"data-component":"card",get"data-variant"(){return e.variant??"normal"},get"data-size"(){return e.size??"default"},get style(){return hv(e.style,{"--kw-card-padding":n()})},get classList(){return{...e.classList,[e.class??""]:!!e.class}}}),!1,!0),f(i,()=>e.children),i})()}var fv=M("<span>");function Xh(A){const[e,t]=CA(A,["size","tone","class","classList","children"]);return(()=>{var n=fv();return pt(n,cA(t,{"data-component":"tag",get"data-size"(){return e.size??"normal"},get"data-tone"(){return e.tone??"neutral"},get classList(){return{...e.classList,[e.class??""]:!!e.class}}}),!1,!0),f(n,()=>e.children),n})()}var pv=M("<span data-slot=status-dot aria-hidden=true>"),mv=M("<p>"),wv=M("<section data-component=section-title><div><h2>"),yv=M("<div data-component=banner role=alert><div><span>"),Dv=M("<strong>"),kv=M("<span data-slot=config-row-accent>"),bv=M("<div data-slot=config-row-body><div data-slot=config-row-title>"),vv=M("<div data-slot=config-row-trailing>"),Mv=M("<div data-slot=config-row-leading>"),Nv=M("<div data-slot=config-row-subtitle>"),Sv=M("<div data-slot=config-row-actions>"),xv=M("<a data-component=config-row>"),Lv=M("<button type=button data-component=config-row>"),_v=M("<div data-component=config-row>");function Ae(A){return u(Xh,cA(A,{"data-slot":"config-tag"}))}function Se(A){return u(Ae,cA(A,{tone:"neutral"}))}function AI(A){return A.source==="project"||A.source==="local override"?"project":A.source==="global"||A.source==="inherited"?"global":A.overridden?"project":A.inherited?"global":"default"}function eI(A){return(()=>{var e=pv();return j(()=>$(e,"data-tone",A.tone)),e})()}function uo(A){const e=()=>["connected","healthy","running"].includes(A.status)?{tone:"success",label:A.status==="healthy"?"Healthy":A.status==="running"?"Running":"Connected"}:["failed","error","unhealthy"].includes(A.status)?{tone:"critical",label:A.status==="unhealthy"?"Unhealthy":A.status==="failed"?"Failed":"Error"}:A.status==="stopped"?{tone:"neutral",label:"Stopped"}:{tone:"neutral",label:A.status||"Unknown"};return u(Ae,{get tone(){return e().tone},class:"kw-status-tag",get children(){return[u(eI,{get tone(){return MA(()=>e().tone==="critical")()?"critical":e().tone==="success"?"success":"neutral"}}),MA(()=>e().label)]}})}function tI(A){const e=()=>AI(A),t=()=>e().toUpperCase();return u(Ae,{class:"mono",get tone(){return e()==="project"?"info":"neutral"},get children(){return t()}})}function I1(A){return(()=>{var e=wv(),t=e.firstChild,n=t.firstChild;return f(n,()=>A.children),f(t,()=>A.trailing,null),f(e,u(H,{get when(){return A.description},children:i=>(()=>{var r=mv();return f(r,i),r})()}),null),e})()}function Fv(A){const e=()=>A.tone==="critical"||A.tone==="warning"?"warning":A.tone==="success"?"circle-check":"help";return(()=>{var t=yv(),n=t.firstChild,i=n.firstChild;return f(t,u(Ft,{get name(){return e()},size:"small"}),n),f(n,u(H,{get when(){return A.title},children:r=>(()=>{var o=Dv();return f(o,r),o})()}),i),f(i,()=>A.children),f(t,()=>A.action,null),j(()=>$(t,"data-tone",A.tone??"info")),t})()}function _t(A){const e=()=>AI({source:A.source})==="project"||A.highlightOverride,t=()=>[u(H,{get when(){return e()},get children(){return kv()}}),u(H,{get when(){return A.leading},children:n=>(()=>{var i=Mv();return f(i,n),i})()}),(()=>{var n=bv(),i=n.firstChild;return f(i,()=>A.title),f(n,u(H,{get when(){return A.subtitle},children:r=>(()=>{var o=Nv();return f(o,r),o})()}),null),n})(),(()=>{var n=vv();return f(n,u(H,{get when(){return A.source!==void 0},get children(){return u(tI,{get source(){return A.source}})}}),null),f(n,()=>A.status,null),f(n,u(H,{get when(){return A.actions},children:i=>(()=>{var r=Sv();return f(r,i),r})()}),null),n})()];return A.href?(()=>{var n=xv();return f(n,t),j(i=>{var r=e()||void 0,o=A.href;return r!==i.e&&$(n,"data-override",i.e=r),o!==i.t&&$(n,"href",i.t=o),i},{e:void 0,t:void 0}),n})():A.onClick?(()=>{var n=Lv();return re(n,"click",A.onClick,!0),f(n,t),j(()=>$(n,"data-override",e()||void 0)),n})():(()=>{var n=_v();return f(n,t),j(()=>$(n,"data-override",e()||void 0)),n})()}ce(["click"]);var Gv=M("<details><summary></summary><div class=models-select-menu role=listbox>"),Rv=M("<button class=models-select-option type=button role=option>");function Xt(A){const e=()=>A.options.find(i=>i.value===A.value)?.label??A.value;function t(i,r){A.disabled||i.disabled||(A.onSelect(i.value),r.currentTarget.closest("details")?.removeAttribute("open"))}function n(i){if(A.disabled){i.currentTarget.removeAttribute("open");return}i.currentTarget.open&&i.currentTarget.parentElement?.querySelectorAll(".models-select[open]").forEach(r=>{r!==i.currentTarget&&r.removeAttribute("open")})}return(()=>{var i=Gv(),r=i.firstChild,o=r.nextSibling;return i.addEventListener("toggle",n),f(r,e),f(o,u(vA,{get each(){return A.options},children:s=>(()=>{var a=Rv();return a.$$click=l=>t(s,l),f(a,()=>s.label),j(l=>{var c=s.value===A.value,g=!!s.disabled,d=s.value===A.value,Q=A.disabled||s.disabled;return c!==l.e&&a.classList.toggle("selected",l.e=c),g!==l.t&&a.classList.toggle("disabled",l.t=g),d!==l.a&&$(a,"aria-selected",l.a=d),Q!==l.o&&(a.disabled=l.o=Q),l},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()})),j(s=>{var a=`models-select ${A.class??""}`,l=!!A.disabled,c=!!A.invalid,g=A.label,d=A.disabled,Q=A.label;return a!==s.e&&ti(i,s.e=a),l!==s.t&&i.classList.toggle("disabled",s.t=l),c!==s.a&&i.classList.toggle("invalid",s.a=c),g!==s.o&&$(r,"aria-label",s.o=g),d!==s.i&&$(r,"aria-disabled",s.i=d),Q!==s.n&&$(o,"aria-label",s.n=Q),s},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),i})()}ce(["click"]);var Tv=M("<label data-component=search-field><span data-slot=search-label></span><input>");function n1(A){const[e,t]=CA(A,["label","value","variant","hideLabel","inputClass","class","classList","onValue"]);return(()=>{var n=Tv(),i=n.firstChild,r=i.nextSibling;return f(i,()=>e.label),pt(r,cA(t,{get class(){return e.inputClass},type:"search",get value(){return e.value},get"aria-label"(){return MA(()=>e.hideLabel===!1)()?void 0:e.label},onInput:o=>e.onValue(o.currentTarget.value)}),!1,!1),j(o=>{var s=e.variant??"list",a=e.hideLabel===!1?"visible":"hidden",l={...e.classList,[e.class??""]:!!e.class};return s!==o.e&&$(n,"data-variant",o.e=s),a!==o.t&&$(n,"data-label",o.t=a),o.a=nr(n,l,o.a),o},{e:void 0,t:void 0,a:void 0}),n})()}const nI=ye();function We(){const A=pe(nI);if(!A)throw new Error("useConfig must be used within ConfigLayout");return A}function sd(){return"/console/".replace(/\/$/,"")}function Yo(A,e=sd()){return!e||e==="/"?A:A===e?"/":A.startsWith(`${e}/`)?A.slice(e.length):A}function iI(A,e=sd()){const t=Yo(A,e),n=t.indexOf("/settings");return n>0?`${t.slice(0,n)}/settings`:t.startsWith("/config")?"/config":"/settings"}function Uv(A,e=sd()){const t=Yo(A,e);return t==="/profile"||t.startsWith("/kilo/login")?"/profile":t.startsWith("/settings")||t.startsWith("/config")?"/settings":t.startsWith("/projects/")?"/project":"/projects"}const Ov={apply_patch:"Apply Patch",bash:"Bash",edit:"Edit File",glob:"Find Files",grep:"Search Content",lsp:"Language Server",question:"Ask User",read:"Read File",recall:"Local Recall",skill:"Load Skill",task:"Subagent Task",todowrite:"Todo List",webfetch:"Fetch URL",websearch:"Web Search",write:"Write File"},Kv={apply_patch:["Apply structured patches to add, update, move, or delete files.","Keeps edits explicit and easy to review."],bash:["Run shell commands in the current workspace.","Supports timeouts, working directories, and command descriptions."],edit:["Replace exact text inside an existing file.","Can update one match or all matches when needed."],glob:["Find files by path patterns.","Useful for locating files before reading or editing them."],grep:["Search file contents with regular expressions.","Can limit results to a file pattern such as TypeScript or CSS files."],lsp:["Use language-server features for code navigation.","Supports operations such as definitions, references, and diagnostics."],question:["Ask the user for a decision during execution.","Supports single-choice and multi-choice prompts."],read:["Read files, directories, images, and PDFs from the workspace.","Supports line offsets and limits for large files."],recall:["Search and read previous project conversations.","Useful for recovering prior decisions or implementation context."],skill:["Load task-specific instructions and workflows.","Applies specialized repo guidance when a matching skill exists."],task:["Delegate focused exploration or implementation work to a subagent.","Useful for parallel codebase research and complex subtasks."],todowrite:["Track multi-step implementation work.","Shows progress with pending, in-progress, and completed states."],webfetch:["Fetch and convert web pages for analysis.","Supports markdown, text, and HTML output formats."],websearch:["Search the web for external information.","Supports fast, automatic, and deep search modes."],write:["Create or overwrite files with complete contents.","Best for new files or full-file replacements."]},qv=new Set(["api","html","id","json","lsp","mcp","pdf","url"]);function UA(A){return A.trim()}function Vn(A){return A==null||A===""?"Not set":typeof A=="string"?A:typeof A=="number"||typeof A=="boolean"?String(A):JSON.stringify(A)??"Unserializable value"}function rI(A){return[...A].sort((e,t)=>e.localeCompare(t))}function Tc(A){return A.split(/\s+/).map(e=>e.trim()).filter(Boolean)}function Rt(A){return A.trim().split(/[\s._/-]+/).filter(Boolean).map(e=>/^[A-Z0-9]+$/.test(e)&&e.length<=4?e:`${e[0]?.toUpperCase()??""}${e.slice(1).toLowerCase()}`).join(" ")}function Jv(A){const e=A.toLowerCase();return qv.has(e)?e.toUpperCase():A.charAt(0).toUpperCase()+A.slice(1)}function DB(A){return A.length<=180?A:`${A.slice(0,177)}...`}function Hv(A){const e=A.replace(/```[\s\S]*?```/g," ").replace(/[*`#>_-]+/g," ").replace(/\s+/g," ").trim(),t=e.split(/(?:\.|\?|!)\s+/).map(n=>n.trim()).filter(Boolean).slice(0,2);return t.length?t.map(DB):e?[DB(e)]:[]}function x1(A){const e=Ov[A];if(e)return e;const t=A.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[._:/-]+/g," ").replace(/\s+/g," ").trim();return t?t.split(" ").map(Jv).join(" "):A}function ad(A){const e=Kv[A.id];if(e)return e;const t=A.detail?.description.trim();return t?Hv(t):["No capability description is available for this tool."]}function Yi(A){return A.split(",").map(e=>e.trim()).filter(Boolean)}function kB(A){return!A||typeof A!="object"||Array.isArray(A)?0:Object.keys(A).length}function Me(A){return A instanceof Error?A.message:typeof A=="string"?A:Vn(A)}function Yv(A){return A==="subagent"?"subagent":A==="all"?"all":"primary"}var Pv=M("<main class=config-page><section class=config-page-header><div><h1>"),Vv=M("<p>"),jv=M("<div class=config-page-actions>"),zv=M("<section class=config-toolbar>"),$v=M("<div class=config-toolbar-controls>"),Wv=M("<div class=config-toolbar-meta>");function Ze(A){return(()=>{var e=Pv(),t=e.firstChild,n=t.firstChild,i=n.firstChild;return f(i,()=>A.title),f(n,u(H,{get when(){return A.description},children:r=>(()=>{var o=Vv();return f(o,r),o})()}),null),f(t,u(H,{get when(){return A.actions},children:r=>(()=>{var o=jv();return f(o,r),o})()}),null),f(e,()=>A.children,null),e})()}function oI(A){return u(H,{get when(){return A.children||A.meta},get children(){var e=zv();return f(e,u(H,{get when(){return A.children},children:t=>(()=>{var n=$v();return f(n,t),n})()}),null),f(e,u(H,{get when(){return A.meta},children:t=>(()=>{var n=Wv();return f(n,t),n})()}),null),e}})}function ve(A){return u(tI,A)}const sI=[{value:"ask",label:"Ask"},{value:"allow",label:"Allow"},{value:"deny",label:"Deny"}],nn=[{id:"external_directory",title:"External Directory",description:"Access files outside the project directory.",noun:"path",placeholder:"e.g. ~/Downloads/**"},{id:"bash",title:"Bash",description:"Run shell commands.",noun:"command",placeholder:"e.g. git status or npm *"},{id:"read",title:"Read",description:"Read files by matching file paths.",noun:"path",placeholder:"e.g. **/*.env"},{id:"edit",title:"Edit",description:"Modify files, including writes, patches, and multi-edits.",noun:"path",placeholder:"e.g. src/**/*.ts"}],ld=[{id:"glob",title:"Glob",description:"Match files using glob patterns."},{id:"grep",title:"Grep",description:"Search file contents using regular expressions."},{id:"list",title:"List",description:"List files within a directory."},{id:"task",title:"Task",description:"Launch sub-agents."},{id:"skill",title:"Skill",description:"Load a skill by name."},{id:"lsp",title:"LSP",description:"Run language server queries."},{id:"todowrite",title:"Todo Write",description:"Update the todo list."},{id:"question",title:"Question",description:"Ask the user a question."},{id:"webfetch",title:"Web Fetch",description:"Fetch content from a URL."},{id:"websearch",title:"Web Search",description:"Search the web."},{id:"doom_loop",title:"Doom Loop",description:"Detect repeated tool calls with identical input."},{id:"agent_manager",title:"Agent Manager",description:"Manage Agent Manager operations."}],aI=[...nn,...ld],Zv=new Set(nn.map(A=>A.id)),Xv=new Set(aI.map(A=>A.id));function gd(A,e="ask"){return A==="ask"||A==="allow"||A==="deny"?A:e}function Bl(A){return A&&typeof A=="object"&&!Array.isArray(A)?A:{}}function lI(A){return Bl(A.effective.permission)}function cd(A,e){return A.overlay.collections.permission?.find(t=>t.key===e)}function gI(A,e){return typeof A.effective.permission=="string"?A.effective.permission:lI(A)[e]}function cI(A){return gd(A.effective.permission)}function A7(A,e){return A?e==="*"&&typeof A.value=="string"?A.path:[...A.path,e]:["permission",e]}function Eo(A,e,t,n){if(!(t!=="ask"&&t!=="allow"&&t!=="deny"))return{tool:A,pattern:e,action:t,source:n?.source??"default",inherited:n?.inherited??!1,overridden:n?.overridden??!1,path:n?A7(n,e):["permission",A,e]}}function e7(A){const e=A.value;if(e&&typeof e=="object"&&!Array.isArray(e))return Object.entries(e).flatMap(([n,i])=>Eo(A.key,n,i,A)??[]);const t=Eo(A.key,"*",e,A);return t?[t]:[]}function t7(A,e,t){const n=Bl(e);if(Object.keys(n).length)return Object.entries(n).flatMap(([r,o])=>Eo(A,r,o,t)??[]);const i=Eo(A,"*",e,t);return i?[i]:[]}function n7(A,e){const t=cd(A,e.id),n=gI(A,e.id),i=Bl(n),r=cI(A);return{...e,action:gd(typeof n=="string"?n:i["*"],r),source:t?.source??"default",inherited:t?.inherited??!1,overridden:t?.overridden??!1}}function i7(A,e){const t=cd(A,e.id),n=gI(A,e.id),i=Bl(n),r=cI(A);return{...e,action:gd(typeof n=="string"?n:i["*"],r),source:t?.source??"default",inherited:t?.inherited??!1,overridden:t?.overridden??!1,rules:Object.entries(i).filter(([o])=>o!=="*").flatMap(([o,s])=>Eo(e.id,o,s,t)??[])}}function r7(){const A=We(),e=()=>A.data(),[t,n]=T("closed"),[i,r]=T("external_directory"),[o,s]=T(""),[a,l]=T("ask"),c=R(()=>(e()?.overlay.collections.permission??[]).flatMap(e7)),g=R(()=>{const w=e();return w?nn.map(m=>i7(w,m)):[]}),d=R(()=>{const w=e();return w?ld.map(m=>n7(w,m)):[]}),Q=R(()=>{const w=e();return w?Object.entries(lI(w)).filter(([m])=>!Xv.has(m)).flatMap(([m,y])=>t7(m,y,cd(w,m))).sort((m,y)=>m.tool.localeCompare(y.tool)||m.pattern.localeCompare(y.pattern)):[]}),B=R(()=>nn.find(w=>w.id===i())??nn[0]);function E(w){r(w),s(""),l("ask"),n("rule")}function I(){n("closed")}function h(){const w=e(),m=UA(o());if(!w||!m){A.fail(`Enter a ${B().noun} pattern before saving.`);return}const y={[i()]:{[m]:a()}};A.save({permission:y}),I()}function C(w,m){const y=Zv.has(w)?{[w]:{"*":m}}:{[w]:m};A.save({permission:y})}function p(w){A.unset([w.path])}return{ctx:A,mode:t,kind:i,pattern:o,setPattern:s,action:a,setAction:l,rules:c,groups:g,settings:d,other:Q,selected:B,open:E,close:I,add:h,setDefault:C,remove:p}}var Uc=M("<div class=permission-row-meta>"),o7=M('<details class="models-select permission-select"><summary></summary><div class=models-select-menu role=listbox>'),s7=M("<button class=models-select-option type=button role=option>"),a7=M("<section class=permission-group><div class=permission-rules>"),l7=M("<div class=permissions><section class=permission-group><div class=permission-rules>"),g7=M("<div class=drawer-scrim>"),c7=M('<aside class="provider-drawer permission-drawer"aria-label="Permission rule configuration"><header class=drawer-header><div><h2></h2><span></span></div></header><div class="provider-form permission-form"><label class="required-field wide"><input></label><label class="required-field wide">Method</label></div><footer class=drawer-footer>'),d7=M("<span class=config-title-count>Permissions"),Q7=M("<section class=permission-group><header class=permission-group-header><div class=permission-group-copy><h2></h2><span></span><p></p></div><div class=permission-section-actions></div></header><div class=permission-rules>"),B7=M("<p class=permission-empty>No specific <!> rules."),u7=M("<span class=permission-pattern>"),E7=M("<span class=permission-subtitle><span></span><span class=permission-pattern>");function dI(A){return A==="allow"?"success":A==="deny"?"critical":"warning"}function dd(A){return sI.find(e=>e.value===A)?.label??A}function bB(A){return(()=>{var e=Uc();return f(e,u(Ae,{get tone(){return dI(A.rule.action)},get children(){return dd(A.rule.action)}}),null),f(e,u(ve,{get source(){return A.rule.source},get inherited(){return A.rule.inherited},get overridden(){return A.rule.overridden}}),null),e})()}function Pi(A){const e=()=>dd(A.value);function t(i,r){A.disabled||(A.onSelect(i),r.currentTarget.closest("details")?.removeAttribute("open"))}function n(i){if(A.disabled){i.currentTarget.removeAttribute("open");return}i.currentTarget.open&&i.currentTarget.parentElement?.querySelectorAll(".models-select[open]").forEach(r=>{r!==i.currentTarget&&r.removeAttribute("open")})}return(()=>{var i=o7(),r=i.firstChild,o=r.nextSibling;return i.addEventListener("toggle",n),f(r,e),f(o,u(vA,{each:sI,children:s=>(()=>{var a=s7();return a.$$click=l=>t(s.value,l),f(a,()=>s.label),j(l=>{var c=s.value===A.value,g=s.value===A.value;return c!==l.e&&a.classList.toggle("selected",l.e=c),g!==l.t&&$(a,"aria-selected",l.t=g),l},{e:void 0,t:void 0}),a})()})),j(s=>{var a=!!A.disabled,l=A.label,c=A.disabled,g=A.label;return a!==s.e&&i.classList.toggle("disabled",s.e=a),l!==s.t&&$(r,"aria-label",s.t=l),c!==s.a&&$(r,"aria-disabled",s.a=c),g!==s.o&&$(o,"aria-label",s.o=g),s},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()}function C7(){const A=r7();return u(Ze,{get title(){return(()=>{var e=d7();return e.firstChild,f(e,u(Se,{get children(){return A.groups().length+A.settings().length}}),null),e})()},description:"Control what tools agents can use by default and add pattern-specific allow, ask, or deny rules.",get children(){return[(()=>{var e=l7(),t=e.firstChild,n=t.firstChild;return f(e,u(vA,{get each(){return A.groups()},children:i=>(()=>{var r=Q7(),o=r.firstChild,s=o.firstChild,a=s.firstChild,l=a.nextSibling,c=l.nextSibling,g=s.nextSibling,d=o.nextSibling;return f(a,()=>i.title),f(l,()=>i.id),f(c,()=>i.description),f(g,u(Se,{get children(){return i.rules.length}}),null),f(g,u(QA,{icon:"plus",variant:"primary",get disabled(){return!!A.ctx.saving()},onClick:()=>A.open(i.id),children:"Add rule"}),null),f(r,u(_t,{title:"Default method",get subtitle(){return`Used for ${i.noun}s that do not match a specific rule.`},get status(){return(()=>{var Q=Uc();return f(Q,u(ve,{get source(){return i.source},get inherited(){return i.inherited},get overridden(){return i.overridden}})),Q})()},get actions(){return u(Pi,{get label(){return`Default method for ${i.title}`},get value(){return i.action},get disabled(){return!!A.ctx.saving()},onSelect:Q=>A.setDefault(i.id,Q)})}}),d),f(d,u(H,{get when(){return i.rules.length},get fallback(){return(()=>{var Q=B7(),B=Q.firstChild,E=B.nextSibling;return E.nextSibling,f(Q,()=>i.noun,E),Q})()},get children(){return u(vA,{get each(){return i.rules},children:Q=>u(_t,{get title(){return(()=>{var B=u7();return f(B,()=>Q.pattern),B})()},get subtitle(){return`${i.title} ${i.noun} rule`},get status(){return u(bB,{rule:Q})},get actions(){return u(Je,{icon:"trash",variant:"ghost",get"aria-label"(){return`Delete ${i.title} rule ${Q.pattern}`},get disabled(){return!!A.ctx.saving()},onClick:()=>A.remove(Q)})}})})}})),r})()}),t),f(t,u(I1,{get trailing(){return u(Se,{get children(){return A.settings().length}})},description:"Default methods for additional built-in tool permissions.",children:"Tool Defaults"}),n),f(n,u(vA,{get each(){return A.settings()},children:i=>u(_t,{get title(){return i.title},get subtitle(){return`${i.id} · ${i.description}`},get status(){return(()=>{var r=Uc();return f(r,u(ve,{get source(){return i.source},get inherited(){return i.inherited},get overridden(){return i.overridden}})),r})()},get actions(){return u(Pi,{get label(){return`Default method for ${i.title}`},get value(){return i.action},get disabled(){return!!A.ctx.saving()},onSelect:r=>A.setDefault(i.id,r)})}})})),f(e,u(H,{get when(){return A.other().length},get children(){var i=a7(),r=i.firstChild;return f(i,u(I1,{get trailing(){return u(Se,{get children(){return A.other().length}})},description:"Additional tool permission rules from config.",children:"Other Permissions"}),r),f(r,u(vA,{get each(){return A.other()},children:o=>u(_t,{get title(){return x1(o.tool)},get subtitle(){return(()=>{var s=E7(),a=s.firstChild,l=a.nextSibling;return f(a,()=>o.tool),f(l,()=>o.pattern),s})()},get status(){return u(bB,{rule:o})},get actions(){return u(Je,{icon:"trash",variant:"ghost",get"aria-label"(){return`Delete ${o.tool} rule ${o.pattern}`},get disabled(){return!!A.ctx.saving()},onClick:()=>A.remove(o)})}})})),i}}),null),e})(),u(H,{get when(){return A.mode()==="rule"},get children(){return[(()=>{var e=g7();return re(e,"click",A.close,!0),e})(),(()=>{var e=c7(),t=e.firstChild,n=t.firstChild,i=n.firstChild,r=i.nextSibling,o=t.nextSibling,s=o.firstChild,a=s.firstChild,l=s.nextSibling;l.firstChild;var c=o.nextSibling;return f(i,()=>`Add ${A.selected().title} Rule`),f(r,()=>`${A.selected().id} · ${A.selected().description}`),f(t,u(QA,{variant:"ghost","aria-label":"Close permission rule overlay",get onClick(){return A.close},children:"X"}),null),f(s,()=>A.selected().noun==="command"?"Command pattern":"Path pattern",a),a.$$input=g=>A.setPattern(g.currentTarget.value),$(a,"spellcheck",!1),f(l,u(Pi,{label:"Rule method",get value(){return A.action()},get disabled(){return!!A.ctx.saving()},get onSelect(){return A.setAction}}),null),f(c,u(QA,{variant:"ghost",get onClick(){return A.close},children:"Cancel"}),null),f(c,u(QA,{variant:"primary",get disabled(){return!!A.ctx.saving()},get onClick(){return A.add},children:"Save Rule"}),null),j(()=>$(a,"placeholder",A.selected().placeholder)),j(()=>a.value=A.pattern()),e})()]}})]}})}ce(["click","input"]);const h7=["Review the current diff and report risks, regressions, and missing tests.","Plan the work in small steps, then implement the smallest correct change.","Inspect relevant files first, then summarize the root cause before editing.","Run the smallest relevant validation checks and report any remaining failures."];function I7(A,e){return A.id==="kilo"?-1:e.id==="kilo"?1:A.name.localeCompare(e.name)}function f7(A,e){return A.provider.id===e.providerID&&A.model.id===e.modelID?!0:A.model.providerID===e.providerID&&A.model.id===e.modelID}function dg(A){const e=UA(A);if(e)return e}function p7(A){const e=Number(A);if(Number.isInteger(e)&&e>0)return e}function $1(A){return A&&typeof A=="object"&&!Array.isArray(A)?A:{}}function hn(A){return typeof A=="string"?A:""}function m7(A){if(typeof A=="number"&&Number.isFinite(A))return A}function vB(A,e="ask"){return A==="allow"||A==="deny"||A==="ask"?A:e}function Oc(A,e,t){if(!(t!=="allow"&&t!=="deny"&&t!=="ask"))return{tool:A,pattern:e,action:t}}function MB(A,e){const t=$1(e);if(Object.keys(t).length)return Object.entries(t).flatMap(([i,r])=>Oc(A,i,r)??[]);const n=Oc(A,"*",e);return n?[n]:[]}const w7=new Set(nn.map(A=>A.id)),y7=new Set(aI.map(A=>A.id));function D7(A){const e=A.options.source;if(typeof e=="string")return e}function k7(A){const e=Object.entries(b7(A));return{tools:rI(e.filter(([,t])=>t==="allow").map(([t])=>t)),permission:Object.fromEntries(e.filter(([,t])=>t!=="allow"))}}function b7(A){return Array.isArray(A)?A.reduce((e,t)=>{const n=$1(t),i=hn(n.permission),r=hn(n.action);if(!i||!r)return e;const o=hn(n.pattern)||"*";if(o==="*")return{...e,[i]:r};const s=e[i],a=s&&typeof s=="object"&&!Array.isArray(s)?s:{};return{...e,[i]:{...a,[o]:r}}},{}):$1(A)}function v7(A,e){return(A.overlay.collections.agent??[]).find(t=>t.key===e)}function Dr(A){return A.displayName??Rt(A.name)}function M7(A){return A.model?`${A.model.providerID}/${A.model.modelID}`:""}function Kc(A,e){return!(A.native||e?.inherited||e?.editable===!1||D7(A)==="organization")}function N7(A){const e=We(),t=()=>e.data(),n=R(()=>e.query()?.scope??"project"),[i,r]=T(),[o,s]=T(!0),[a,l]=T(!1),[c,g]=T("reviewer"),[d,Q]=T(""),[B,E]=T("subagent"),[I,h]=T(""),[C,p]=T(""),[w,m]=T(""),[y,k]=T([]),[v,b]=T(""),[x,_]=T("external_directory"),[L,S]=T(""),[G,K]=T("ask"),[J,Y]=T({}),[P,z]=T(),[aA,EA]=T("closed"),[Z,hA]=T(""),[V,q]=T(""),[X,iA]=T(""),[tA,oA]=T([]),nA=R(()=>{const AA=t();if(!AA)return[];const BA=new Set([...Object.keys(AA.effective.provider??{}),...AA.providers.connected]);return AA.providers.all.filter(DA=>BA.has(DA.id)).filter(DA=>Object.keys(DA.models).length>0).sort(I7)}),IA=R(()=>nA().flatMap(AA=>Object.values(AA.models).map(BA=>({id:`${AA.id}/${BA.id}`,provider:AA,model:BA})))),fA=R(()=>t()?.modelState.favorite??[]),W=AA=>fA().some(BA=>f7(AA,BA)),D=R(()=>{const AA=Z().trim().toLowerCase();return IA().filter(BA=>AA?`${BA.id} ${BA.model.name} ${BA.provider.name}`.toLowerCase().includes(AA):!0).sort((BA,DA)=>{const HA=Number(W(DA))-Number(W(BA));if(HA!==0)return HA;const de=BA.model.name.localeCompare(DA.model.name);if(de!==0)return de;const te=BA.provider.name.localeCompare(DA.provider.name);return te!==0?te:BA.id.localeCompare(DA.id)})}),mA=AA=>{if(typeof AA=="string")return IA().find(BA=>BA.id===AA||`${BA.model.providerID}/${BA.model.id}`===AA)},yA=R(()=>mA(I())),bA=R(()=>{const AA=t();if(!AA)return[];const BA=X().trim().toLowerCase(),DA=new Map(AA.toolDetails.map(HA=>[HA.id,HA]));return AA.tools.map(HA=>({id:HA,detail:DA.get(HA)})).filter(HA=>BA?`${HA.id} ${x1(HA.id)} ${ad(HA).join(" ")}`.toLowerCase().includes(BA):!0).sort((HA,de)=>x1(HA.id).localeCompare(x1(de.id)))}),$A=R(()=>new Set(tA())),KA=R(()=>Object.entries(J()).flatMap(([AA,BA])=>MB(AA,BA))),YA=R(()=>nn.map(AA=>{const BA=J()[AA.id],DA=$1(BA);return{...AA,action:vB(typeof BA=="string"?BA:DA["*"]),rules:Object.entries(DA).filter(([HA])=>HA!=="*").flatMap(([HA,de])=>Oc(AA.id,HA,de)??[])}})),Ye=R(()=>ld.map(AA=>{const BA=J()[AA.id],DA=$1(BA);return{...AA,action:vB(typeof BA=="string"?BA:DA["*"])}})),De=R(()=>Object.entries(J()).filter(([AA])=>!y7.has(AA)).flatMap(([AA,BA])=>MB(AA,BA)).sort((AA,BA)=>AA.tool.localeCompare(BA.tool)||AA.pattern.localeCompare(BA.pattern))),ie=R(()=>nn.find(AA=>AA.id===x())??nn[0]);function GA(AA="reviewer"){g(AA),Q(""),E("subagent"),h(""),p(""),m(""),k([]),b(""),Y({}),z(void 0),l(!1),EA("closed"),_("external_directory"),S(""),K("ask"),hA(""),q(""),iA(""),oA([])}rA(()=>{A?.()||i()!==""&&(GA(),s(!0),r(""))}),rA(()=>{const AA=t(),BA=A?.();if(!AA||!BA||i()===BA)return;GA(BA),s(!1),r(BA);const DA=AA.agents.find(yt=>yt.name===BA);if(!DA){e.fail(`Agent not found: ${BA}`);return}const HA=v7(AA,BA),de=Kc(DA,HA);e.fail(""),s(!0),l(!de);const te=$1(HA?.value),Ot=k7(te.permission??(de?void 0:DA.permission)),Kt=m7(te.steps)??DA.steps;g(DA.name),Q(hn(te.description)||DA.description||""),E(Yv(hn(te.mode)||DA.mode)),h(hn(te.model)||M7(DA)),p(hn(te.color)||DA.color||""),m(Kt?String(Kt):""),k(Ot.tools),Y(Ot.permission),b(hn(te.prompt)||DA.prompt||"")});function VA(){EA("closed")}function NA(){return a()?(e.fail("Inspected agents are read-only."),!1):!0}function Ie(){const AA=wt();AA&&(z(void 0),EA("markdown"),e.run("Previewing agent",()=>Bv(e.target(),AA).then(z),{refetch:!1}))}function ae(){NA()&&(hA(""),q(I()),EA("model"))}function Ge(AA){q(AA.id)}function Pe(){if(!NA())return;const AA=V();if(!AA){e.fail("Select a model before saving the agent model field.");return}h(AA),VA()}function tt(){NA()&&h("")}function jA(){NA()&&(iA(""),oA(y()),EA("tools"))}function lA(AA){if(!NA())return;const BA=new Set(tA());BA.has(AA)?BA.delete(AA):BA.add(AA),oA(rI(BA))}function SA(){NA()&&(k(tA()),VA())}function JA(){NA()&&k([])}function Re(AA){NA()&&(_(AA),S(""),K("ask"),EA("permission"))}function Ve(AA,BA){if(!NA())return;const DA={...J()};if(!w7.has(AA)){DA[AA]=BA,Y(DA);return}const HA=$1(DA[AA]);DA[AA]={...HA,"*":BA},Y(DA)}function Ee(){if(!NA())return;const AA=UA(L());if(!AA){e.fail(`Enter a ${ie().noun} pattern before saving.`);return}const BA=x(),DA={...J()},HA=DA[BA],de=HA&&typeof HA=="object"&&!Array.isArray(HA)?{...HA}:{};de[AA]=G(),DA[BA]=de,Y(DA),VA()}function Oe(AA){if(!NA())return;const BA={...J()};if(AA.pattern==="*"){const HA={...$1(BA[AA.tool])};if(Object.keys(HA).length){delete HA["*"],Object.keys(HA).length?BA[AA.tool]=HA:delete BA[AA.tool],Y(BA);return}delete BA[AA.tool],Y(BA);return}const DA={...$1(BA[AA.tool])};delete DA[AA.pattern],Object.keys(DA).length?BA[AA.tool]=DA:delete BA[AA.tool],Y(BA)}function Et(AA){if(!NA())return;const BA=UA(v());b(BA?`${BA}
20
+ `);try{Y=JSON.parse(z),P=!0}catch{Y=z}}P&&(i&&await i(Y),n&&(Y=await n(Y))),t?.({data:Y,event:J,id:g,retry:E}),K.length&&(yield Y)}}}finally{h.removeEventListener("abort",b),k.releaseLock()}break}catch(p){if(e?.(p),o!==void 0&&I>=o)break;const w=Math.min(E*2**(I-1),s??3e4);await d(w)}}}()}},Q3=A=>{switch(A){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},B3=A=>{switch(A){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},u3=A=>{switch(A){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Oh=({allowReserved:A,explode:e,name:t,style:n,value:i})=>{if(!e){const s=(A?i:i.map(a=>encodeURIComponent(a))).join(B3(n));switch(n){case"label":return`.${s}`;case"matrix":return`;${t}=${s}`;case"simple":return s;default:return`${t}=${s}`}}const r=Q3(n),o=i.map(s=>n==="label"||n==="simple"?A?s:encodeURIComponent(s):ll({allowReserved:A,name:t,value:s})).join(r);return n==="label"||n==="matrix"?r+o:o},ll=({allowReserved:A,name:e,value:t})=>{if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${A?t:encodeURIComponent(t)}`},Kh=({allowReserved:A,explode:e,name:t,style:n,value:i,valueOnly:r})=>{if(i instanceof Date)return r?i.toISOString():`${t}=${i.toISOString()}`;if(n!=="deepObject"&&!e){let a=[];Object.entries(i).forEach(([c,g])=>{a=[...a,c,A?g:encodeURIComponent(g)]});const l=a.join(",");switch(n){case"form":return`${t}=${l}`;case"label":return`.${l}`;case"matrix":return`;${t}=${l}`;default:return l}}const o=u3(n),s=Object.entries(i).map(([a,l])=>ll({allowReserved:A,name:n==="deepObject"?`${t}[${a}]`:a,value:l})).join(o);return n==="label"||n==="matrix"?o+s:s},E3=/\{[^{}]+\}/g,C3=({path:A,url:e})=>{let t=e;const n=e.match(E3);if(n)for(const i of n){let r=!1,o=i.substring(1,i.length-1),s="simple";o.endsWith("*")&&(r=!0,o=o.substring(0,o.length-1)),o.startsWith(".")?(o=o.substring(1),s="label"):o.startsWith(";")&&(o=o.substring(1),s="matrix");const a=A[o];if(a==null)continue;if(Array.isArray(a)){t=t.replace(i,Oh({explode:r,name:o,style:s,value:a}));continue}if(typeof a=="object"){t=t.replace(i,Kh({explode:r,name:o,style:s,value:a,valueOnly:!0}));continue}if(s==="matrix"){t=t.replace(i,`;${ll({name:o,value:a})}`);continue}const l=encodeURIComponent(s==="label"?`.${a}`:a);t=t.replace(i,l)}return t},h3=({baseUrl:A,path:e,query:t,querySerializer:n,url:i})=>{const r=i.startsWith("/")?i:`/${i}`;let o=(A??"")+r;e&&(o=C3({path:e,url:o}));let s=t?n(t):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(o+=`?${s}`),o};function uB(A){const e=A.body!==void 0;if(e&&A.bodySerializer)return"serializedBody"in A?A.serializedBody!==void 0&&A.serializedBody!==""?A.serializedBody:null:A.body!==""?A.body:null;if(e)return A.body}const I3=async(A,e)=>{const t=typeof e=="function"?await e(A):e;if(t)return A.scheme==="bearer"?`Bearer ${t}`:A.scheme==="basic"?`Basic ${btoa(t)}`:t},f3={bodySerializer:A=>JSON.stringify(A,(e,t)=>typeof t=="bigint"?t.toString():t)},qh=({parameters:A={},...e}={})=>n=>{const i=[];if(n&&typeof n=="object")for(const r in n){const o=n[r];if(o==null)continue;const s=A[r]||e;if(Array.isArray(o)){const a=Oh({allowReserved:s.allowReserved,explode:!0,name:r,style:"form",value:o,...s.array});a&&i.push(a)}else if(typeof o=="object"){const a=Kh({allowReserved:s.allowReserved,explode:!0,name:r,style:"deepObject",value:o,...s.object});a&&i.push(a)}else{const a=ll({allowReserved:s.allowReserved,name:r,value:o});a&&i.push(a)}}return i.join("&")},p3=A=>{if(!A)return"stream";const e=A.split(";")[0]?.trim();if(e){if(e.startsWith("application/json")||e.endsWith("+json"))return"json";if(e==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(t=>e.startsWith(t)))return"blob";if(e.startsWith("text/"))return"text"}},m3=(A,e)=>e?!!(A.headers.has(e)||A.query?.[e]||A.headers.get("Cookie")?.includes(`${e}=`)):!1,w3=async({security:A,...e})=>{for(const t of A){if(m3(e,t.name))continue;const n=await I3(t,e.auth);if(!n)continue;const i=t.name??"Authorization";switch(t.in){case"query":e.query||(e.query={}),e.query[i]=n;break;case"cookie":e.headers.append("Cookie",`${i}=${n}`);break;default:e.headers.set(i,n);break}}},EB=A=>h3({baseUrl:A.baseUrl,path:A.path,query:A.query,querySerializer:typeof A.querySerializer=="function"?A.querySerializer:qh(A.querySerializer),url:A.url}),CB=(A,e)=>{const t={...A,...e};return t.baseUrl?.endsWith("/")&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=Jh(A.headers,e.headers),t},y3=A=>{const e=[];return A.forEach((t,n)=>{e.push([n,t])}),e},Jh=(...A)=>{const e=new Headers;for(const t of A){if(!t)continue;const n=t instanceof Headers?y3(t):Object.entries(t);for(const[i,r]of n)if(r===null)e.delete(i);else if(Array.isArray(r))for(const o of r)e.append(i,o);else r!==void 0&&e.set(i,typeof r=="object"?JSON.stringify(r):r)}return e};class cg{fns=[];clear(){this.fns=[]}eject(e){const t=this.getInterceptorIndex(e);this.fns[t]&&(this.fns[t]=null)}exists(e){const t=this.getInterceptorIndex(e);return!!this.fns[t]}getInterceptorIndex(e){return typeof e=="number"?this.fns[e]?e:-1:this.fns.indexOf(e)}update(e,t){const n=this.getInterceptorIndex(e);return this.fns[n]?(this.fns[n]=t,e):!1}use(e){return this.fns.push(e),this.fns.length-1}}const D3=()=>({error:new cg,request:new cg,response:new cg}),k3=qh({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),b3={"Content-Type":"application/json"},Hh=(A={})=>({...f3,headers:b3,parseAs:"auto",querySerializer:k3,...A}),Yh=(A={})=>{let e=CB(Hh(),A);const t=()=>({...e}),n=l=>(e=CB(e,l),t()),i=D3(),r=async l=>{const c={...e,...l,fetch:l.fetch??e.fetch??globalThis.fetch,headers:Jh(e.headers,l.headers),serializedBody:void 0};c.security&&await w3({...c,security:c.security}),c.requestValidator&&await c.requestValidator(c),c.body!==void 0&&c.bodySerializer&&(c.serializedBody=c.bodySerializer(c.body)),(c.body===void 0||c.serializedBody==="")&&c.headers.delete("Content-Type");const g=EB(c);return{opts:c,url:g}},o=async l=>{const{opts:c,url:g}=await r(l),d={redirect:"follow",...c,body:uB(c)};let Q=new Request(g,d);for(const m of i.request.fns)m&&(Q=await m(Q,c));const B=c.fetch;let E;try{E=await B(Q)}catch(m){let y=m;for(const k of i.error.fns)k&&(y=await k(m,void 0,Q,c));if(y=y||{},c.throwOnError)throw y;return c.responseStyle==="data"?void 0:{error:y,request:Q,response:void 0}}for(const m of i.response.fns)m&&(E=await m(E,Q,c));const I={request:Q,response:E};if(E.ok){const m=(c.parseAs==="auto"?p3(E.headers.get("Content-Type")):c.parseAs)??"json";if(E.status===204||E.headers.get("Content-Length")==="0"){let k;switch(m){case"arrayBuffer":case"blob":case"text":k=await E[m]();break;case"formData":k=new FormData;break;case"stream":k=E.body;break;default:k={};break}return c.responseStyle==="data"?k:{data:k,...I}}let y;switch(m){case"arrayBuffer":case"blob":case"formData":case"text":y=await E[m]();break;case"json":{const k=await E.text();y=k?JSON.parse(k):{};break}case"stream":return c.responseStyle==="data"?E.body:{data:E.body,...I}}return m==="json"&&(c.responseValidator&&await c.responseValidator(y),c.responseTransformer&&(y=await c.responseTransformer(y))),c.responseStyle==="data"?y:{data:y,...I}}const h=await E.text();let C;try{C=JSON.parse(h)}catch{}const p=C??h;let w=p;for(const m of i.error.fns)m&&(w=await m(p,E,Q,c));if(w=w||{},c.throwOnError)throw w;return c.responseStyle==="data"?void 0:{error:w,...I}},s=l=>c=>o({...c,method:l}),a=l=>async c=>{const{opts:g,url:d}=await r(c);return d3({...g,body:g.body,headers:g.headers,method:l,onRequest:async(Q,B)=>{let E=new Request(Q,B);for(const I of i.request.fns)I&&(E=await I(E,g));return E},serializedBody:uB(g),url:d})};return{buildUrl:EB,connect:s("CONNECT"),delete:s("DELETE"),get:s("GET"),getConfig:t,head:s("HEAD"),interceptors:i,options:s("OPTIONS"),patch:s("PATCH"),post:s("POST"),put:s("PUT"),request:o,setConfig:n,sse:{connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),head:a("HEAD"),options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),trace:a("TRACE")},trace:s("TRACE")}},v3={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},M3=Object.entries(v3),Ph=(A,e)=>{e||(e=new Map);for(const t of A)"in"in t?t.key&&e.set(t.key,{in:t.in,map:t.map}):"key"in t?e.set(t.key,{map:t.map}):t.args&&Ph(t.args,e);return e},N3=A=>{for(const[e,t]of Object.entries(A))t&&typeof t=="object"&&!Object.keys(t).length&&delete A[e]},F=(A,e)=>{const t={body:{},headers:{},path:{},query:{}},n=Ph(e);let i;for(const[r,o]of A.entries())if(e[r]&&(i=e[r]),!!i)if("in"in i)if(i.key){const s=n.get(i.key),a=s.map||i.key;s.in&&(t[s.in][a]=o)}else t.body=o;else for(const[s,a]of Object.entries(o??{})){const l=n.get(s);if(l)if(l.in){const c=l.map||s;t[l.in][c]=a}else t[l.map]=a;else{const c=M3.find(([g])=>s.startsWith(g));if(c){const[g,d]=c;t[d][s.slice(g.length)]=a}else if("allowExtra"in i&&i.allowExtra){for(const[g,d]of Object.entries(i.allowExtra))if(d){t[g][s]=a;break}}}}return N3(t),t},S3=Yh(Hh({baseUrl:"http://localhost:4096"}));class dA{client;constructor(e){this.client=e?.client??S3}}class x3{defaultKey="default";instances=new Map;get(e){const t=this.instances.get(e??this.defaultKey);if(!t)throw new Error('No SDK client found. Create one with "new KiloClient()" to fix this error.');return t}set(e,t){this.instances.set(t??this.defaultKey,e)}}class L3 extends dA{remove(e,t){const n=F([e],[{args:[{in:"path",key:"providerID"}]}]);return(t?.client??this.client).delete({url:"/auth/{providerID}",...t,...n})}set(e,t){const n=F([e],[{args:[{in:"path",key:"providerID"},{key:"auth",map:"body"}]}]);return(t?.client??this.client).put({url:"/auth/{providerID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}let _3=class extends dA{log(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"service"},{in:"body",key:"level"},{in:"body",key:"message"},{in:"body",key:"extra"}]}]);return(t?.client??this.client).post({url:"/log",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}agents(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/agent",...t,...n})}skills(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/skill",...t,...n})}};class F3 extends dA{moveSession(e,t){const n=F([e],[{args:[{in:"body",key:"sessionID"},{in:"body",key:"destination"},{in:"body",key:"moveChanges"}]}]);return(t?.client??this.client).post({url:"/experimental/control-plane/move-session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class G3 extends dA{get(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/capabilities",...t,...n})}}class R3 extends dA{get(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/console",...t,...n})}listOrgs(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/console/orgs",...t,...n})}switchOrg(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"accountID"},{in:"body",key:"orgID"}]}]);return(t?.client??this.client).post({url:"/experimental/console/switch",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class T3 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"projectID"},{in:"query",key:"worktrees"},{in:"query",key:"current"},{in:"query",key:"roots"},{in:"query",key:"start"},{in:"query",key:"cursor"},{in:"query",key:"search"},{in:"query",key:"limit"},{in:"query",key:"archived"}]}]);return(t?.client??this.client).get({url:"/experimental/session",...t,...n})}background(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/experimental/session/{sessionID}/background",...t,...n})}}class U3 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/resource",...t,...n})}}class O3 extends dA{generateName(e,t){const n=F([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"context"}]}]);return(t?.client??this.client).post({url:"/experimental/project/{projectID}/copy/generate-name",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class K3 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/workspace/adapter",...t,...n})}}class q3 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/workspace",...t,...n})}create(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"type"},{in:"body",key:"branch"},{in:"body",key:"extra"}]}]);return(t?.client??this.client).post({url:"/experimental/workspace",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}syncList(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/experimental/workspace/sync-list",...t,...n})}status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/workspace/status",...t,...n})}remove(e,t){const n=F([e],[{args:[{in:"path",key:"id"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/experimental/workspace/{id}",...t,...n})}warp(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"sessionID"},{in:"body",key:"copyChanges"}]}]);return(t?.client??this.client).post({url:"/experimental/workspace/warp",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_adapter;get adapter(){return this._adapter??=new K3({client:this.client})}}class J3 extends dA{_controlPlane;get controlPlane(){return this._controlPlane??=new F3({client:this.client})}_capabilities;get capabilities(){return this._capabilities??=new G3({client:this.client})}_console;get console(){return this._console??=new R3({client:this.client})}_session;get session(){return this._session??=new T3({client:this.client})}_resource;get resource(){return this._resource??=new U3({client:this.client})}_projectCopy;get projectCopy(){return this._projectCopy??=new O3({client:this.client})}_workspace;get workspace(){return this._workspace??=new q3({client:this.client})}}class H3 extends dA{get(e){return(e?.client??this.client).get({url:"/global/config",...e})}update(e,t){const n=F([e],[{args:[{key:"config",map:"body"}]}]);return(t?.client??this.client).patch({url:"/global/config",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Y3 extends dA{health(e){return(e?.client??this.client).get({url:"/global/health",...e})}event(e){return(e?.client??this.client).sse.get({url:"/global/event",...e})}dispose(e){return(e?.client??this.client).post({url:"/global/dispose",...e})}upgrade(e,t){const n=F([e],[{args:[{in:"body",key:"target"}]}]);return(t?.client??this.client).post({url:"/global/upgrade",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_config;get config(){return this._config??=new H3({client:this.client})}}let P3=class extends dA{subscribe(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).sse.get({url:"/event",...t,...n})}};class V3 extends dA{get(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config",...t,...n})}update(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"config",map:"body"}]}]);return(t?.client??this.client).patch({url:"/config",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}warnings(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/warnings",...t,...n})}providers(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/providers",...t,...n})}overlay(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"scope"}]}]);return(t?.client??this.client).get({url:"/config/overlay",...t,...n})}overlayUpdate(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"scope"},{in:"body",key:"set"},{in:"body",key:"unset"},{in:"body",key:"expected"}]}]);return(t?.client??this.client).patch({url:"/config/overlay",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}sources(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/sources",...t,...n})}effective(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/effective",...t,...n})}rules(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"scope"}]}]);return(t?.client??this.client).get({url:"/config/rules",...t,...n})}rulesUpdate(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"scope"},{in:"body",key:"content"}]}]);return(t?.client??this.client).put({url:"/config/rules",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}modelState(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/config/model-state",...t,...n})}modelStateUpdate(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"favorite"}]}]);return(t?.client??this.client).patch({url:"/config/model-state",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class j3 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"provider"},{in:"query",key:"model"}]}]);return(t?.client??this.client).get({url:"/experimental/tool",...t,...n})}ids(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/tool/ids",...t,...n})}}class z3 extends dA{remove(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeRemoveInput",map:"body"}]}]);return(t?.client??this.client).delete({url:"/experimental/worktree",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/experimental/worktree",...t,...n})}create(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeCreateInput",map:"body"}]}]);return(t?.client??this.client).post({url:"/experimental/worktree",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reset(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeResetInput",map:"body"}]}]);return(t?.client??this.client).post({url:"/experimental/worktree/reset",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}diff(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"base"}]}]);return(t?.client??this.client).get({url:"/experimental/worktree/diff",...t,...n})}diffSummary(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"base"}]}]);return(t?.client??this.client).get({url:"/experimental/worktree/diff/summary",...t,...n})}diffFile(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"base"},{in:"query",key:"file"}]}]);return(t?.client??this.client).get({url:"/experimental/worktree/diff/file",...t,...n})}}class $3 extends dA{text(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"pattern"}]}]);return(t?.client??this.client).get({url:"/find",...t,...n})}files(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"query"},{in:"query",key:"dirs"},{in:"query",key:"type"},{in:"query",key:"limit"}]}]);return(t?.client??this.client).get({url:"/find/file",...t,...n})}symbols(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"query"}]}]);return(t?.client??this.client).get({url:"/find/symbol",...t,...n})}}let W3=class extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"path"}]}]);return(t?.client??this.client).get({url:"/file",...t,...n})}read(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"path"}]}]);return(t?.client??this.client).get({url:"/file/content",...t,...n})}status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/file/status",...t,...n})}};class Z3 extends dA{dispose(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/instance/dispose",...t,...n})}reload(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/instance/reload",...t,...n})}}class X3 extends dA{get(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/path",...t,...n})}}let Ab=class extends dA{raw(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/vcs/diff/raw",...t,...n})}};class eb extends dA{get(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/vcs",...t,...n})}status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/vcs/status",...t,...n})}diff(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"mode"},{in:"query",key:"context"}]}]);return(t?.client??this.client).get({url:"/vcs/diff",...t,...n})}apply(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"patch"}]}]);return(t?.client??this.client).post({url:"/vcs/apply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_diff;get diff2(){return this._diff??=new Ab({client:this.client})}}class tb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/command",...t,...n})}}class nb extends dA{status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/lsp",...t,...n})}}class ib extends dA{status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/formatter",...t,...n})}}class rb extends dA{remove(e,t){const n=F([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/mcp/{name}/auth",...t,...n})}start(e,t){const n=F([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/auth",...t,...n})}callback(e,t){const n=F([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"code"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/auth/callback",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}authenticate(e,t){const n=F([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/auth/authenticate",...t,...n})}}class ob extends dA{status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/mcp",...t,...n})}add(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"name"},{in:"body",key:"config"}]}]);return(t?.client??this.client).post({url:"/mcp",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}connect(e,t){const n=F([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/connect",...t,...n})}disconnect(e,t){const n=F([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/mcp/{name}/disconnect",...t,...n})}_auth;get auth(){return this._auth??=new rb({client:this.client})}}class sb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/project",...t,...n})}current(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/project/current",...t,...n})}initGit(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/project/git/init",...t,...n})}update(e,t){const n=F([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"name"},{in:"body",key:"icon"},{in:"body",key:"commands"}]}]);return(t?.client??this.client).patch({url:"/project/{projectID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}directories(e,t){const n=F([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/project/{projectID}/directories",...t,...n})}}class ab extends dA{shells(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/pty/shells",...t,...n})}list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/pty",...t,...n})}create(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"command"},{in:"body",key:"args"},{in:"body",key:"cwd"},{in:"body",key:"title"},{in:"body",key:"env"}]}]);return(t?.client??this.client).post({url:"/pty",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}remove(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/pty/{ptyID}",...t,...n})}get(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/pty/{ptyID}",...t,...n})}update(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"title"},{in:"body",key:"sessionID"},{in:"body",key:"size"}]}]);return(t?.client??this.client).put({url:"/pty/{ptyID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}connectToken(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/pty/{ptyID}/connect-token",...t,...n})}connect(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"cursor"},{in:"query",key:"ticket"}]}]);return(t?.client??this.client).get({url:"/pty/{ptyID}/connect",...t,...n})}}class lb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/question",...t,...n})}reply(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"answers"}]}]);return(t?.client??this.client).post({url:"/question/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reject(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/question/{requestID}/reject",...t,...n})}}class gb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/permission",...t,...n})}reply(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"reply"},{in:"body",key:"message"},{in:"body",key:"interactive"}]}]);return(t?.client??this.client).post({url:"/permission/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}saveAlwaysRules(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"approvedAlways"},{in:"body",key:"deniedAlways"}]}]);return(t?.client??this.client).post({url:"/permission/{requestID}/always-rules",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}allowEverything(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"enable"},{in:"body",key:"requestID"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/permission/allow-everything",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}respond(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"permissionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"response"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/permissions/{permissionID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class cb extends dA{authorize(e,t){const n=F([e],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"method"},{in:"body",key:"inputs"}]}]);return(t?.client??this.client).post({url:"/provider/{providerID}/oauth/authorize",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}callback(e,t){const n=F([e],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"method"},{in:"body",key:"code"}]}]);return(t?.client??this.client).post({url:"/provider/{providerID}/oauth/callback",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class db extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/provider",...t,...n})}auth(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/provider/auth",...t,...n})}_oauth;get oauth(){return this._oauth??=new cb({client:this.client})}}class Qb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"scope"},{in:"query",key:"path"},{in:"query",key:"roots"},{in:"query",key:"start"},{in:"query",key:"search"},{in:"query",key:"limit"}]}]);return(t?.client??this.client).get({url:"/session",...t,...n})}create(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"parentID"},{in:"body",key:"title"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"metadata"},{in:"body",key:"permission"},{in:"body",key:"platform"},{in:"body",key:"workspaceID"},{in:"body",key:"sandboxInheritanceToken"}]}]);return(t?.client??this.client).post({url:"/session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/status",...t,...n})}delete(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/session/{sessionID}",...t,...n})}get(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}",...t,...n})}update(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"title"},{in:"body",key:"metadata"},{in:"body",key:"permission"},{in:"body",key:"time"}]}]);return(t?.client??this.client).patch({url:"/session/{sessionID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}children(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/children",...t,...n})}todo(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/todo",...t,...n})}diff(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"messageID"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/diff",...t,...n})}messages(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"limit"},{in:"query",key:"before"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/message",...t,...n})}prompt(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"agent"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"format"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"snapshotInitialization"},{in:"body",key:"editorContext"},{in:"body",key:"parts"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/message",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}deleteMessage(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}",...t,...n})}message(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/message/{messageID}",...t,...n})}fork(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/fork",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}abort(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/abort",...t,...n})}init(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"modelID"},{in:"body",key:"providerID"},{in:"body",key:"messageID"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/init",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}unshare(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/session/{sessionID}/share",...t,...n})}share(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/share",...t,...n})}summarize(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"providerID"},{in:"body",key:"modelID"},{in:"body",key:"auto"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/summarize",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}promptAsync(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"agent"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"format"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"snapshotInitialization"},{in:"body",key:"editorContext"},{in:"body",key:"parts"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/prompt_async",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}command(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"arguments"},{in:"body",key:"command"},{in:"body",key:"variant"},{in:"body",key:"snapshotInitialization"},{in:"body",key:"parts"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/command",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}shell(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"command"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/shell",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}revert(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"partID"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/revert",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}unrevert(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/unrevert",...t,...n})}viewed(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"viewer"},{in:"body",key:"attached"},{in:"body",key:"visible"}]}]);return(t?.client??this.client).post({url:"/session/viewed",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Bb extends dA{delete(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...t,...n})}update(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"part",map:"body"}]}]);return(t?.client??this.client).patch({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class ub extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return(t?.client??this.client).post({url:"/sync/history",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Eb extends dA{start(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/sync/start",...t,...n})}replay(e,t){const n=F([e],[{args:[{in:"query",key:"query_directory",map:"directory"},{in:"query",key:"workspace"},{in:"body",key:"body_directory",map:"directory"},{in:"body",key:"events"}]}]);return(t?.client??this.client).post({url:"/sync/replay",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}steal(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/sync/steal",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_history;get history(){return this._history??=new ub({client:this.client})}}class Cb extends dA{next(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/tui/control/next",...t,...n})}response(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return(t?.client??this.client).post({url:"/tui/control/response",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class hb extends dA{get(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/tui/config",...t,...n})}update(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"scope"},{in:"body",key:"$schema"},{in:"body",key:"theme"},{in:"body",key:"keybinds"},{in:"body",key:"plugin"},{in:"body",key:"plugin_enabled"},{in:"body",key:"title_icon"},{in:"body",key:"scroll_speed"},{in:"body",key:"scroll_acceleration"},{in:"body",key:"diff_style"},{in:"body",key:"mouse"},{in:"body",key:"attention"}]}]);return(t?.client??this.client).patch({url:"/tui/config",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Ib extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/tui/keybinds",...t,...n})}}class fb extends dA{appendPrompt(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"}]}]);return(t?.client??this.client).post({url:"/tui/append-prompt",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}openHelp(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/open-help",...t,...n})}openSessions(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/open-sessions",...t,...n})}openThemes(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/open-themes",...t,...n})}openModels(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/open-models",...t,...n})}submitPrompt(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/submit-prompt",...t,...n})}clearPrompt(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/tui/clear-prompt",...t,...n})}executeCommand(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"command"}]}]);return(t?.client??this.client).post({url:"/tui/execute-command",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}showToast(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"title"},{in:"body",key:"message"},{in:"body",key:"variant"},{in:"body",key:"duration"}]}]);return(t?.client??this.client).post({url:"/tui/show-toast",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}publish(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return(t?.client??this.client).post({url:"/tui/publish",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}selectSession(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/tui/select-session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}_control;get control(){return this._control??=new Cb({client:this.client})}_config;get config(){return this._config??=new hb({client:this.client})}_keybind;get keybind(){return this._keybind??=new Ib({client:this.client})}}class pb extends dA{preview(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"scope"},{in:"body",key:"description"},{in:"body",key:"mode"},{in:"body",key:"model"},{in:"body",key:"color"},{in:"body",key:"steps"},{in:"body",key:"tools"},{in:"body",key:"permission"},{in:"body",key:"prompt"}]}]);return(t?.client??this.client).post({url:"/agent-builder/preview",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}save(e,t){const n=F([e],[{args:[{in:"path",key:"path_id",map:"id"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"body_id",map:"id"},{in:"body",key:"scope"},{in:"body",key:"description"},{in:"body",key:"mode"},{in:"body",key:"model"},{in:"body",key:"color"},{in:"body",key:"steps"},{in:"body",key:"tools"},{in:"body",key:"permission"},{in:"body",key:"prompt"}]}]);return(t?.client??this.client).put({url:"/agent-builder/{id}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class mb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/background-process",...t,...n})}get(e,t){const n=F([e],[{args:[{in:"path",key:"processID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/background-process/{processID}",...t,...n})}logs(e,t){const n=F([e],[{args:[{in:"path",key:"processID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/background-process/{processID}/logs",...t,...n})}stop(e,t){const n=F([e],[{args:[{in:"path",key:"processID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/background-process/{processID}/stop",...t,...n})}restart(e,t){const n=F([e],[{args:[{in:"path",key:"processID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/background-process/{processID}/restart",...t,...n})}stopSession(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/background-process/session/{sessionID}/stop",...t,...n})}}class wb extends dA{generate(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"prompt"},{in:"body",key:"providerID"},{in:"body",key:"modelID"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/branch-name",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class yb extends dA{generate(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"path"},{in:"body",key:"selectedFiles"},{in:"body",key:"previousMessage"},{in:"body",key:"language"}]}]);return(t?.client??this.client).post({url:"/commit-message",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Db extends dA{enhance(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"}]}]);return(t?.client??this.client).post({url:"/enhance-prompt",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class kb extends dA{status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/indexing/status",...t,...n})}warnings(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/indexing/warnings",...t,...n})}models(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/indexing/models",...t,...n})}consent(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"enabled"}]}]);return(t?.client??this.client).put({url:"/indexing/consent",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class bb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/interactive-terminal",...t,...n})}get(e,t){const n=F([e],[{args:[{in:"path",key:"terminalID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/interactive-terminal/{terminalID}",...t,...n})}write(e,t){const n=F([e],[{args:[{in:"path",key:"terminalID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"interactiveTerminalWriteInput",map:"body"}]}]);return(t?.client??this.client).post({url:"/interactive-terminal/{terminalID}/input",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}resize(e,t){const n=F([e],[{args:[{in:"path",key:"terminalID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"interactiveTerminalResizeInput",map:"body"}]}]);return(t?.client??this.client).post({url:"/interactive-terminal/{terminalID}/resize",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}close(e,t){const n=F([e],[{args:[{in:"path",key:"terminalID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/interactive-terminal/{terminalID}/close",...t,...n})}}class vb extends dA{transcriptions(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"model"},{in:"body",key:"input_audio"},{in:"body",key:"language"},{in:"body",key:"prompt"},{in:"body",key:"temperature"}]}]);return(t?.client??this.client).post({url:"/kilo/audio/transcriptions",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Mb extends dA{images(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/models/images",...t,...n})}transcriptions(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/models/transcriptions",...t,...n})}}class Nb extends dA{set(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"organizationId"}]}]);return(t?.client??this.client).post({url:"/kilo/organization",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Sb extends dA{status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/claw/status",...t,...n})}chatCredentials(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/claw/chat-credentials",...t,...n})}}class xb extends dA{get(e,t){const n=F([e],[{args:[{in:"path",key:"id"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/cloud/session/{id}",...t,...n})}import(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"sessionId"}]}]);return(t?.client??this.client).post({url:"/kilo/cloud/session/import",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Lb extends dA{_session;get session(){return this._session??=new xb({client:this.client})}}class _b extends dA{profile(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/profile",...t,...n})}authStatus(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/auth-status",...t,...n})}modes(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/modes",...t,...n})}fim(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"prefix"},{in:"body",key:"suffix"},{in:"body",key:"provider"},{in:"body",key:"model"},{in:"body",key:"maxTokens"},{in:"body",key:"temperature"}]}]);return(t?.client??this.client).sse.post({url:"/kilo/fim",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}edit(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"provider"},{in:"body",key:"model"},{in:"body",key:"maxTokens"},{in:"body",key:"currentFilePath"},{in:"body",key:"currentFileContent"},{in:"body",key:"cursorLine"},{in:"body",key:"cursorCharacter"},{in:"body",key:"editableRegionStartLine"},{in:"body",key:"editableRegionEndLine"},{in:"body",key:"recentlyViewedSnippets"},{in:"body",key:"editDiffHistory"}]}]);return(t?.client??this.client).post({url:"/kilo/edit",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}notifications(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilo/notifications",...t,...n})}cloudSessions(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"cursor"},{in:"query",key:"limit"},{in:"query",key:"gitUrl"}]}]);return(t?.client??this.client).get({url:"/kilo/cloud-sessions",...t,...n})}_audio;get audio(){return this._audio??=new vb({client:this.client})}_models;get models(){return this._models??=new Mb({client:this.client})}_organization;get organization(){return this._organization??=new Nb({client:this.client})}_claw;get claw(){return this._claw??=new Sb({client:this.client})}_cloud;get cloud(){return this._cloud??=new Lb({client:this.client})}}class Fb extends dA{snapshot(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/kilocode/heap/snapshot",...t,...n})}}class Gb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilocode/notebook",...t,...n})}reply(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"result"}]}]);return(t?.client??this.client).post({url:"/kilocode/notebook/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reject(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"error"}]}]);return(t?.client??this.client).post({url:"/kilocode/notebook/{requestID}/reject",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Rb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilocode/agent-manager",...t,...n})}reply(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"result"}]}]);return(t?.client??this.client).post({url:"/kilocode/agent-manager/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reject(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"error"}]}]);return(t?.client??this.client).post({url:"/kilocode/agent-manager/{requestID}/reject",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Tb extends dA{project(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"worktree"},{in:"body",key:"vcs"},{in:"body",key:"name"},{in:"body",key:"iconUrl"},{in:"body",key:"iconColor"},{in:"body",key:"timeCreated"},{in:"body",key:"timeUpdated"},{in:"body",key:"timeInitialized"},{in:"body",key:"sandboxes"},{in:"body",key:"commands"}]}]);return(t?.client??this.client).post({url:"/kilocode/session-import/project",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}session(e,t){const n=F([e],[{args:[{in:"query",key:"query_directory",map:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"projectID"},{in:"body",key:"force"},{in:"body",key:"workspaceID"},{in:"body",key:"parentID"},{in:"body",key:"slug"},{in:"body",key:"body_directory",map:"directory"},{in:"body",key:"title"},{in:"body",key:"version"},{in:"body",key:"shareURL"},{in:"body",key:"summary"},{in:"body",key:"revert"},{in:"body",key:"permission"},{in:"body",key:"timeCreated"},{in:"body",key:"timeUpdated"},{in:"body",key:"timeCompacting"},{in:"body",key:"timeArchived"}]}]);return(t?.client??this.client).post({url:"/kilocode/session-import/session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}message(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"sessionID"},{in:"body",key:"timeCreated"},{in:"body",key:"data"}]}]);return(t?.client??this.client).post({url:"/kilocode/session-import/message",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}part(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"messageID"},{in:"body",key:"sessionID"},{in:"body",key:"timeCreated"},{in:"body",key:"data"}]}]);return(t?.client??this.client).post({url:"/kilocode/session-import/part",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Ub extends dA{agentRequirements(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"agent"}]}]);return(t?.client??this.client).get({url:"/kilocode/agent/requirements",...t,...n})}removeSkill(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"location"}]}]);return(t?.client??this.client).post({url:"/kilocode/skill/remove",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}removeAgent(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"name"}]}]);return(t?.client??this.client).post({url:"/kilocode/agent/remove",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}sessionModelUsage(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/model-usage",...t,...n})}_heap;get heap(){return this._heap??=new Fb({client:this.client})}_notebook;get notebook(){return this._notebook??=new Gb({client:this.client})}_agentManager;get agentManager(){return this._agentManager??=new Rb({client:this.client})}_sessionImport;get sessionImport(){return this._sessionImport??=new Tb({client:this.client})}}class Ob extends dA{status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/kilocode/anaconda-desktop/status",...t,...n})}open(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/kilocode/anaconda-desktop/open",...t,...n})}sync(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"acknowledgeToolLimitations"}]}]);return(t?.client??this.client).post({url:"/kilocode/anaconda-desktop/sync",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Kb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/network",...t,...n})}reply(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/network/{requestID}/reply",...t,...n})}reject(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/network/{requestID}/reject",...t,...n})}}class qb extends dA{enable(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/remote/enable",...t,...n})}disable(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/remote/disable",...t,...n})}status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/remote/status",...t,...n})}}class Jb extends dA{support(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/sandbox/support",...t,...n})}status(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/session/{sessionID}/sandbox",...t,...n})}toggle(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/session/{sessionID}/sandbox/toggle",...t,...n})}}class Hb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/suggestion",...t,...n})}accept(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"index"}]}]);return(t?.client??this.client).post({url:"/suggestion/{requestID}/accept",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}dismiss(e,t){const n=F([e],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/suggestion/{requestID}/dismiss",...t,...n})}}class Yb extends dA{capture(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"event"},{in:"body",key:"properties"}]}]);return(t?.client??this.client).post({url:"/telemetry/capture",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}setEnabled(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"enabled"}]}]);return(t?.client??this.client).post({url:"/telemetry/setEnabled",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Pb extends dA{status(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/memory/status",...t,...n})}show(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).get({url:"/memory/show",...t,...n})}enable(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/memory/enable",...t,...n})}disable(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/memory/disable",...t,...n})}configure(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"autoConsolidate"},{in:"body",key:"verbose"}]}]);return(t?.client??this.client).post({url:"/memory/configure",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}rebuild(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(t?.client??this.client).post({url:"/memory/rebuild",...t,...n})}remember(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"},{in:"body",key:"key"},{in:"body",key:"file"},{in:"body",key:"section"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/memory/remember",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}correct(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"},{in:"body",key:"key"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/memory/correct",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}forget(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"query"},{in:"body",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/memory/forget",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}purge(e,t){const n=F([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"confirm"}]}]);return(t?.client??this.client).post({url:"/memory/purge",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Vb extends dA{get(e){return(e?.client??this.client).get({url:"/api/health",...e})}}class jb extends dA{get(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/location",...t,...n})}}class zb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/agent",...t,...n})}}class $b extends dA{list(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/permission",...t,...n})}reply(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"requestID"},{in:"body",key:"reply"},{in:"body",key:"message"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/permission/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class Wb extends dA{list(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/question",...t,...n})}reply(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"requestID"},{key:"questionV2Reply",map:"body"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/question/{requestID}/reply",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}reject(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"requestID"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/question/{requestID}/reject",...t,...n})}}class Zb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"workspace"},{in:"query",key:"limit"},{in:"query",key:"order"},{in:"query",key:"search"},{in:"query",key:"directory"},{in:"query",key:"project"},{in:"query",key:"subpath"},{in:"query",key:"cursor"}]}]);return(t?.client??this.client).get({url:"/api/session",...t,...n})}create(e,t){const n=F([e],[{args:[{in:"body",key:"id"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"location"}]}]);return(t?.client??this.client).post({url:"/api/session",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}get(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}",...t,...n})}prompt(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"body",key:"id"},{in:"body",key:"prompt"},{in:"body",key:"delivery"},{in:"body",key:"resume"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/prompt",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}compact(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/compact",...t,...n})}wait(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).post({url:"/api/session/{sessionID}/wait",...t,...n})}context(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/context",...t,...n})}messages(e,t){const n=F([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"limit"},{in:"query",key:"order"},{in:"query",key:"cursor"}]}]);return(t?.client??this.client).get({url:"/api/session/{sessionID}/message",...t,...n})}_permission;get permission(){return this._permission??=new $b({client:this.client})}_question;get question(){return this._question??=new Wb({client:this.client})}}class Xb extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/model",...t,...n})}}class A8 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/provider",...t,...n})}get(e,t){const n=F([e],[{args:[{in:"path",key:"providerID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/provider/{providerID}",...t,...n})}}class e8 extends dA{key(e,t){const n=F([e],[{args:[{in:"path",key:"integrationID"},{in:"query",key:"location"},{in:"body",key:"key"},{in:"body",key:"label"}]}]);return(t?.client??this.client).post({url:"/api/integration/{integrationID}/connect/key",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}oauth(e,t){const n=F([e],[{args:[{in:"path",key:"integrationID"},{in:"query",key:"location"},{in:"body",key:"methodID"},{in:"body",key:"inputs"},{in:"body",key:"label"}]}]);return(t?.client??this.client).post({url:"/api/integration/{integrationID}/connect/oauth",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class t8 extends dA{cancel(e,t){const n=F([e],[{args:[{in:"path",key:"attemptID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).delete({url:"/api/integration/attempt/{attemptID}",...t,...n})}status(e,t){const n=F([e],[{args:[{in:"path",key:"attemptID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/integration/attempt/{attemptID}",...t,...n})}complete(e,t){const n=F([e],[{args:[{in:"path",key:"attemptID"},{in:"query",key:"location"},{in:"body",key:"code"}]}]);return(t?.client??this.client).post({url:"/api/integration/attempt/{attemptID}/complete",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}class n8 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/integration",...t,...n})}get(e,t){const n=F([e],[{args:[{in:"path",key:"integrationID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/integration/{integrationID}",...t,...n})}_connect;get connect(){return this._connect??=new e8({client:this.client})}_attempt;get attempt(){return this._attempt??=new t8({client:this.client})}}class i8 extends dA{remove(e,t){const n=F([e],[{args:[{in:"path",key:"credentialID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).delete({url:"/api/credential/{credentialID}",...t,...n})}update(e,t){const n=F([e],[{args:[{in:"path",key:"credentialID"},{in:"query",key:"location"},{in:"body",key:"label"}]}]);return(t?.client??this.client).patch({url:"/api/credential/{credentialID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}}let r8=class extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/permission/request",...t,...n})}};class o8 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"projectID"}]}]);return(t?.client??this.client).get({url:"/api/permission/saved",...t,...n})}remove(e,t){const n=F([e],[{args:[{in:"path",key:"id"}]}]);return(t?.client??this.client).delete({url:"/api/permission/saved/{id}",...t,...n})}}class s8 extends dA{_request;get request(){return this._request??=new r8({client:this.client})}_saved;get saved(){return this._saved??=new o8({client:this.client})}}class a8 extends dA{read(e,t){const n=F([e],[{args:[{in:"query",key:"location"},{in:"query",key:"path"}]}]);return(t?.client??this.client).get({url:"/api/fs/read/*",...t,...n})}list(e,t){const n=F([e],[{args:[{in:"query",key:"location"},{in:"query",key:"path"}]}]);return(t?.client??this.client).get({url:"/api/fs/list",...t,...n})}find(e,t){const n=F([e],[{args:[{in:"query",key:"location"},{in:"query",key:"query"},{in:"query",key:"type"},{in:"query",key:"limit"}]}]);return(t?.client??this.client).get({url:"/api/fs/find",...t,...n})}}class l8 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/command",...t,...n})}}class g8 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/skill",...t,...n})}}class c8 extends dA{subscribe(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).sse.get({url:"/api/event",...t,...n})}}class d8 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/pty",...t,...n})}create(e,t){const n=F([e],[{args:[{in:"query",key:"location"},{in:"body",key:"command"},{in:"body",key:"args"},{in:"body",key:"cwd"},{in:"body",key:"title"},{in:"body",key:"env"}]}]);return(t?.client??this.client).post({url:"/api/pty",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}remove(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).delete({url:"/api/pty/{ptyID}",...t,...n})}get(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/pty/{ptyID}",...t,...n})}update(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location"},{in:"body",key:"title"},{in:"body",key:"sessionID"},{in:"body",key:"size"}]}]);return(t?.client??this.client).put({url:"/api/pty/{ptyID}",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}connectToken(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).post({url:"/api/pty/{ptyID}/connect-token",...t,...n})}connect(e,t){const n=F([e],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"location[directory]"},{in:"query",key:"location[workspace]"},{in:"query",key:"cursor"},{in:"query",key:"ticket"},{in:"query",key:"replayExited"}]}]);return(t?.client??this.client).get({url:"/api/pty/{ptyID}/connect",...t,...n})}}class Q8 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/question/request",...t,...n})}}class B8 extends dA{_request;get request(){return this._request??=new Q8({client:this.client})}}class u8 extends dA{list(e,t){const n=F([e],[{args:[{in:"query",key:"location"}]}]);return(t?.client??this.client).get({url:"/api/reference",...t,...n})}}class E8 extends dA{remove(e,t){const n=F([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"location"},{in:"body",key:"directory"},{in:"body",key:"force"}]}]);return(t?.client??this.client).delete({url:"/experimental/project/{projectID}/copy",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}create(e,t){const n=F([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"location"},{in:"body",key:"strategy"},{in:"body",key:"directory"},{in:"body",key:"name"}]}]);return(t?.client??this.client).post({url:"/experimental/project/{projectID}/copy",...t,...n,headers:{"Content-Type":"application/json",...t?.headers,...n.headers}})}refresh(e,t){const n=F([e],[{args:[{in:"path",key:"projectID"},{in:"query",key:"location"}]}]);return(t?.client??this.client).post({url:"/experimental/project/{projectID}/copy/refresh",...t,...n})}}class C8 extends dA{_health;get health(){return this._health??=new Vb({client:this.client})}_location;get location(){return this._location??=new jb({client:this.client})}_agent;get agent(){return this._agent??=new zb({client:this.client})}_session;get session(){return this._session??=new Zb({client:this.client})}_model;get model(){return this._model??=new Xb({client:this.client})}_provider;get provider(){return this._provider??=new A8({client:this.client})}_integration;get integration(){return this._integration??=new n8({client:this.client})}_credential;get credential(){return this._credential??=new i8({client:this.client})}_permission;get permission(){return this._permission??=new s8({client:this.client})}_fs;get fs(){return this._fs??=new a8({client:this.client})}_command;get command(){return this._command??=new l8({client:this.client})}_skill;get skill(){return this._skill??=new g8({client:this.client})}_event;get event(){return this._event??=new c8({client:this.client})}_pty;get pty(){return this._pty??=new d8({client:this.client})}_question;get question(){return this._question??=new B8({client:this.client})}_reference;get reference(){return this._reference??=new u8({client:this.client})}_projectCopy;get projectCopy(){return this._projectCopy??=new E8({client:this.client})}}class id extends dA{static __registry=new x3;constructor(e){super(e),id.__registry.set(this,e?.key)}_auth;get auth(){return this._auth??=new L3({client:this.client})}_app;get app(){return this._app??=new _3({client:this.client})}_experimental;get experimental(){return this._experimental??=new J3({client:this.client})}_global;get global(){return this._global??=new Y3({client:this.client})}_event;get event(){return this._event??=new P3({client:this.client})}_config;get config(){return this._config??=new V3({client:this.client})}_tool;get tool(){return this._tool??=new j3({client:this.client})}_worktree;get worktree(){return this._worktree??=new z3({client:this.client})}_find;get find(){return this._find??=new $3({client:this.client})}_file;get file(){return this._file??=new W3({client:this.client})}_instance;get instance(){return this._instance??=new Z3({client:this.client})}_path;get path(){return this._path??=new X3({client:this.client})}_vcs;get vcs(){return this._vcs??=new eb({client:this.client})}_command;get command(){return this._command??=new tb({client:this.client})}_lsp;get lsp(){return this._lsp??=new nb({client:this.client})}_formatter;get formatter(){return this._formatter??=new ib({client:this.client})}_mcp;get mcp(){return this._mcp??=new ob({client:this.client})}_project;get project(){return this._project??=new sb({client:this.client})}_pty;get pty(){return this._pty??=new ab({client:this.client})}_question;get question(){return this._question??=new lb({client:this.client})}_permission;get permission(){return this._permission??=new gb({client:this.client})}_provider;get provider(){return this._provider??=new db({client:this.client})}_session;get session(){return this._session??=new Qb({client:this.client})}_part;get part(){return this._part??=new Bb({client:this.client})}_sync;get sync(){return this._sync??=new Eb({client:this.client})}_tui;get tui(){return this._tui??=new fb({client:this.client})}_agentBuilder;get agentBuilder(){return this._agentBuilder??=new pb({client:this.client})}_backgroundProcess;get backgroundProcess(){return this._backgroundProcess??=new mb({client:this.client})}_branchName;get branchName(){return this._branchName??=new wb({client:this.client})}_commitMessage;get commitMessage(){return this._commitMessage??=new yb({client:this.client})}_enhancePrompt;get enhancePrompt(){return this._enhancePrompt??=new Db({client:this.client})}_indexing;get indexing(){return this._indexing??=new kb({client:this.client})}_interactiveTerminal;get interactiveTerminal(){return this._interactiveTerminal??=new bb({client:this.client})}_kilo;get kilo(){return this._kilo??=new _b({client:this.client})}_kilocode;get kilocode(){return this._kilocode??=new Ub({client:this.client})}_anacondaDesktop;get anacondaDesktop(){return this._anacondaDesktop??=new Ob({client:this.client})}_network;get network(){return this._network??=new Kb({client:this.client})}_remote;get remote(){return this._remote??=new qb({client:this.client})}_sandbox;get sandbox(){return this._sandbox??=new Jb({client:this.client})}_suggestion;get suggestion(){return this._suggestion??=new Hb({client:this.client})}_telemetry;get telemetry(){return this._telemetry??=new Yb({client:this.client})}_memory;get memory(){return this._memory??=new Pb({client:this.client})}_v2;get v2(){return this._v2??=new C8({client:this.client})}}function h8(A,e,t,n){if(!n?.throwOnError||A instanceof Error)return A;if(typeof A=="object"&&A!==null&&Object.keys(A).length>0){const r=A,o=typeof r.data?.message=="string"&&r.data.message||typeof r.message=="string"&&r.message||typeof r.name=="string"&&r.name||hB(t,e);return new Error(o,{cause:{body:A,status:e?.status}})}if(typeof A=="string"&&A.length>0)return new Error(A,{cause:{body:A,status:e?.status}});const i=e?"(empty response body)":"network error (no response)";return new Error(`kilo server ${hB(t,e)}: ${i}`,{cause:{body:A,status:e?.status}})}function hB(A,e){const t=A?.method??"?",n=A?.url??"?",i=e?.status,r=e?.statusText;return`${t} ${n}${i?" → "+i:""}${r?" "+r:""}`}function I8(A,e,t){if(A)return e&&(A===e||t&&A===t(e))?e:A}function f8(A,e){if(A.method!=="GET"&&A.method!=="HEAD")return A;const t=new URL(A.url);let n=!1;for(const[r,o]of[["x-kilo-directory","directory"],["x-kilo-workspace","workspace"]]){const s=I8(A.headers.get(r),o==="directory"?e.directory:e.workspace,o==="directory"?encodeURIComponent:void 0);if(s){for(const a of t.pathname.startsWith("/api/")?[o,`location[${o}]`]:[o])t.searchParams.has(a)||t.searchParams.set(a,s);n=!0}}if(!n)return A;const i=new Request(t,A);return i.headers.delete("x-kilo-directory"),i.headers.delete("x-kilo-workspace"),i}function p8(A){A?.fetch||(A={...A,fetch:n=>fetch(n,{duplex:"half",timeout:!1})}),A?.directory&&(A.headers={...A.headers,"x-kilo-directory":encodeURIComponent(A.directory)}),A?.experimental_workspaceID&&(A.headers={...A.headers,"x-kilo-workspace":A.experimental_workspaceID}),A.duplex="half";const e=Yh(A);return e.interceptors.request.use(t=>f8(t,{directory:A?.directory,workspace:A?.experimental_workspaceID})),e.interceptors.response.use(t=>{if(t.headers.get("content-type")==="text/html")throw new Error("Request is not supported by this version of OpenCode Server (Server responded with text/html)");return t}),e.interceptors.error.use(h8),new id({client:e})}const m8=Array.from({length:20},(A,e)=>4097+e),w8=1440*60*1e3,rd="kilo.config.server",yr={},od=window.fetch.bind(window);function y8(A){const e=new TextEncoder().encode(A);return btoa(String.fromCharCode(...e))}function IB(A){return A?decodeURIComponent(A):""}function gl(A){const e=new URL(A),t=IB(e.username)||"kilo",n=IB(e.password)||"kilo";return e.username="",e.password="",e.search="",e.hash="",{url:e.toString().replace(/\/$/,""),token:y8(`${t}:${n}`)}}function ee(A){const e=gl(A.url);return p8({baseUrl:e.url,directory:cl(A.dir),headers:{Authorization:`Basic ${e.token}`},fetch:od})}function cl(A){const e=A.trim();if(e)return e}function ua(A){return A instanceof Error?A.message:typeof A=="string"?A:A==null?"Unknown error":JSON.stringify(A)}function TA(A,e){if(e.error)throw new Error(`${A}: ${ua(e.error)}`);if(e.data===void 0)throw new Error(`${A}: empty response`);return e.data}async function D8(A){const t=(await Ql(A)).find(n=>n.id===A.project);if(!t)throw new Error(`Project not found: ${A.project}`);return t}async function B1(A,e){return await e.then(t=>{if(t.error){console.warn(`${A}: ${ua(t.error)}`);return}return t.data}).catch(t=>{console.warn(`${A}: ${ua(t)}`)})}function k8(A){if(typeof A!="string")return;const e=A.indexOf("/");if(!(e<=0||e>=A.length-1))return{provider:A.slice(0,e),model:A.slice(e+1)}}function dl(A){const e=cl(A.dir);return e?{directory:e}:void 0}function b8(A){return A.split("_").filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function v8(A){return{keybinds:Object.entries(A.keybinds??{}).map(([e,t])=>({id:e,label:b8(e),group:"Configured",default:t??"none",description:"Configured TUI keybind"}))}}function Ea(A){return A.replace(/\\/g,"/").replace(/\/+$/,"")||"/"}function M8(A,e){const t=Ea(A),n=Ea(e);return n===t?!0:n.startsWith(`${t}/`)}function Vh(A){return A.id!=="global"?!0:Ea(A.worktree)!=="/"}function N8(A,e){return[A.worktree,...A.sandboxes].reduce((t,n)=>M8(n,e)?Math.max(t,Ea(n).length):t,-1)}function S8(A,e){const t=A.find(n=>n.id===e.projectID);return t||A.reduce((n,i)=>{const r=N8(i,e.directory);return r<=n.score?n:{item:i,score:r}},{score:-1}).item}async function jh(A){const e=new AbortController,t=window.setTimeout(()=>e.abort(),400),n=gl(A);return await od(`${n.url}/global/health`,{headers:{Authorization:`Basic ${n.token}`},signal:e.signal}).then(i=>i.ok?A:void 0).catch(()=>{}).finally(()=>window.clearTimeout(t))}function x8(A){return Array.isArray(A)?A.filter(e=>{if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&typeof t.worktree=="string"&&typeof t.time?.updated=="number"}):[]}function L8(A){return A.reduce((e,t)=>Math.max(e,t.time.updated),0)}async function _8(A){if(!await jh(A))return;const t=new AbortController,n=window.setTimeout(()=>t.abort(),400),i=gl(A);return await od(`${i.url}/project`,{headers:{Authorization:`Basic ${i.token}`},signal:t.signal}).then(async r=>{if(!r.ok)return{url:A,count:0,time:0};const o=x8(await r.json()).filter(Vh);return{url:A,count:o.length,time:L8(o)}}).catch(()=>({url:A,count:0,time:0})).finally(()=>window.clearTimeout(n))}function fB(A){return Number(new URL(A).port)||0}function pB(A){return new URL(A).hostname==="127.0.0.1"?1:0}function Ut(){return window.localStorage.getItem(rd)??""}function At(A){window.localStorage.setItem(rd,A)}function Bi(){window.localStorage.removeItem(rd)}async function F8(A){return await jh(A)!==void 0}async function G8(){const A=m8.flatMap(t=>[`http://127.0.0.1:${t}`,`http://localhost:${t}`]);return(await Promise.all(A.map(_8))).filter(t=>t!==void 0).toSorted((t,n)=>n.count-t.count||n.time-t.time||fB(n.url)-fB(t.url)||pB(n.url)-pB(t.url))[0]?.url}async function ui(){if(yr.run)return await yr.run;const A=G8().finally(()=>{yr.run===A&&(yr.run=void 0)});return yr.run=A,await A}async function rr(){const A=await ui();if(A)return A;const e=Ut();if(e){if(await F8(e))return e;Bi()}}async function R8(A){const e=ee(A),[t,n,i,r,o,s,a,l,c,g,d,Q]=await Promise.all([e.global.health(),e.config.overlay({scope:A.scope}),e.config.modelState(),e.provider.list(),e.provider.auth(),e.tui.config.get(),B1("TUI keybinds",e.tui.keybind.list()),e.tool.ids(),e.mcp.status(),e.lsp.status(),e.formatter.status(),e.app.agents()]),B=TA("Config overlay",n),E=k8(B.effective.model),I=E?await B1("Tool metadata",e.tool.list(E)):void 0,h=TA("TUI config",s);return{health:TA("Health",t),effective:B.effective,overlay:B,sources:{sources:B.sources},modelState:TA("Model state",i),providers:TA("Providers",r),authMethods:TA("Provider auth methods",o),tui:h,keybinds:a??v8(h),tools:TA("Tools",l),toolDetails:I??[],mcp:TA("MCP status",c),lsp:TA("LSP status",g),formatter:TA("Formatter status",d),agents:TA("Agents",Q)}}async function T8(A){return TA("Kilo embedding models",await ee(A).indexing.models())}async function zh(A){const t=await ee(A).kilo.profile(dl(A));return TA("Kilo profile",t)}async function U8(A,e){const t=ee(A),n=await t.kilo.organization.set({...dl(A),organizationId:e});TA("Switch Kilo account",n),await t.global.dispose()}async function O8(A){const e=ee(A),t=await e.auth.remove({providerID:"kilo"});TA("Log out of Kilo",t),await e.global.dispose()}async function K8(A){const t=await ee(A).provider.oauth.authorize({...dl(A),providerID:"kilo",method:0});return TA("Start Kilo login",t)}async function q8(A,e){const t=ee(A),n=await t.provider.oauth.callback({...dl(A),providerID:"kilo",method:0},e?{signal:e}:void 0);TA("Complete Kilo login",n),await t.global.dispose()}async function $h(A){const e=ee(A),t=cl(A.dir),n=await e.project.list(t?{directory:t}:void 0);return TA("Projects",n)}async function Ql(A){return(await $h(A)).filter(Vh)}async function J8(A){const e=ee(A),[t,n]=await Promise.all([Ql(A),e.experimental.session.list({archived:!1,start:Date.now()-w8,limit:500})]),i=TA("Recent sessions",n),r=new Map;for(const o of i){const s=S8(t,o);s&&r.set(s.id,(r.get(s.id)??0)+1)}return t.map(o=>({...o,sessions:r.get(o.id)??0})).filter(o=>o.sessions>0)}async function H8(A){const e=await D8(A),t={url:A.url,dir:e.worktree},n=ee(t),[i,r,o]=await Promise.all([n.config.overlay({scope:"global"}),n.vcs.get({directory:t.dir}),n.worktree.list({directory:t.dir})]),s=TA("Config",i),a=TA("Worktrees",o),l=await Promise.all([t.dir,...a.map(c=>c.directory)].map(c=>j8({url:A.url},c)));return{project:e,config:s.global,vcs:TA("VCS",r),worktrees:a,terminals:l.flat()}}async function Y8(A,e){const t=ee(A),n=e?.trim(),i=await t.worktree.create({directory:A.dir,...n?{worktreeCreateInput:{name:n}}:{}});return TA("Create worktree",i)}async function P8(A,e){const n=await ee(A).worktree.remove({directory:A.dir,worktreeRemoveInput:{directory:e}});return TA("Remove worktree",n)}async function V8(A,e){const n=await ee(A).worktree.reset({directory:A.dir,worktreeResetInput:{directory:e}});return TA("Reset worktree",n)}async function j8(A,e){const t=ee({url:A.url,dir:e}),[n,i,r,o]=await Promise.all([t.pty.list({directory:e}),B1("Session status",t.session.status({directory:e})),B1("Pending permissions",t.permission.list({directory:e})),B1("Pending questions",t.question.list({directory:e}))]),s=TA("Terminals",n),a=i??{},l=mB(r??[]),c=mB(o??[]),g=new Map;return await Promise.all(s.map(async d=>{if(!d.sessionID||g.has(d.sessionID))return;const Q=await B1("Session",t.session.get({directory:e,sessionID:d.sessionID}));Q&&g.set(d.sessionID,Q)})),s.map(d=>{const Q=d.sessionID?g.get(d.sessionID):void 0;return{...d,directory:e,session:Q,sessionStatus:d.sessionID?a[d.sessionID]:void 0,attention:d.sessionID?W8(d.sessionID,l,c):void 0}})}function Wh(A){return new Set(A.flatMap(e=>e.sessionID?[e.sessionID]:[]))}function mB(A){return new Set(A.map(e=>e.sessionID))}function wB(A,e){return A.some(t=>e.has(t.sessionID))}async function z8(A,e){const t=ee({url:A.url,dir:e}),[n,i,r,o]=await Promise.all([B1("Session status",t.session.status({directory:e})),B1("Terminals",t.pty.list({directory:e})),B1("Pending permissions",t.permission.list({directory:e})),B1("Pending questions",t.question.list({directory:e}))]),s=Wh(i??[]),a=Object.entries(n??{}).some(([c,g])=>s.has(c)&&g.type!=="idle"),l=wB(r??[],s)||wB(o??[],s);return{busy:a,attention:l}}async function $8(A,e){const t=ee({url:A.url,dir:e}),n=await B1("Terminals",t.pty.list({directory:e}));return Wh(n??[])}function W8(A,e,t){if(e.has(A))return"permission";if(t.has(A))return"question"}async function Z8(A,e){const n=await ee({url:A.url,dir:e}).worktree.diffSummary({directory:e});return TA("Worktree diff",n)}async function X8(A,e,t){const i=await ee({url:A.url,dir:e}).worktree.diffFile({directory:e,file:t});return TA("Worktree diff file",i)}async function Av(A,e,t="Kilo session"){const i=await ee({url:A.url,dir:e}).pty.create({directory:e,command:"kilo",cwd:e,title:t});return TA("Create terminal",i)}async function ev(A,e){const n=await ee({url:A.url,dir:A.dir}).pty.remove({directory:A.dir,ptyID:e});return TA("Remove terminal",n)}async function yB(A,e,t,n){const r=await ee(A).session.viewed({directory:A.dir,viewer:e,attached:t,visible:n});return TA("Viewed sessions",r)}function Zh(A,e){const t=ee(A),n=new AbortController;return(async()=>{const i=await t.global.event({signal:n.signal,sseMaxRetryAttempts:0});for await(const r of i.stream){if(n.signal.aborted)return;e(r)}})().catch(i=>{n.signal.aborted||console.warn(`Project events: ${ua(i)}`)}),()=>n.abort()}async function tv(A,e,t,n){const r=await ee({url:A.url,dir:A.dir}).pty.update({directory:A.dir,ptyID:e,size:{cols:t,rows:n}});return TA("Resize terminal",r)}function nv(A,e,t=0){const n=gl(A.url),i=new URL(`/pty/${encodeURIComponent(e)}/connect`,n.url);return i.protocol=i.protocol==="https:"?"wss:":"ws:",i.searchParams.set("directory",A.dir),i.searchParams.set("cursor",String(t)),i.searchParams.set("auth_token",n.token),i.toString()}async function Bo(A,e,t){const n=ee(A),i=Object.keys(e).length?e:void 0,r=await n.config.overlayUpdate({directory:cl(A.dir),scope:A.scope,set:i,unset:t});return TA("Update config",r)}async function iv(A,e){return Bo(A,e)}async function rv(A,e){return Bo(A,{},e)}async function ov(A,e){const n=await ee(A).config.modelStateUpdate({favorite:e});return TA("Update model state",n)}async function sv(A,e,t,n){const i=ee(A),r=n?{type:"api",key:t,metadata:n}:{type:"api",key:t},o=await i.auth.set({providerID:e,auth:r});TA("Connect provider",o),await i.global.dispose()}async function av(A,e,t,n){const r=await ee(A).provider.oauth.authorize({providerID:e,method:t,inputs:n});return TA("Authorize provider",r)}async function lv(A,e,t,n){const i=ee(A),r=await i.provider.oauth.callback({providerID:e,method:t,code:n});TA("Complete provider authorization",r),await i.global.dispose()}async function gv(A,e){const n=await ee(A).mcp.connect({name:e});return TA("Connect MCP server",n)}async function cv(A,e){const n=await ee(A).mcp.disconnect({name:e});return TA("Disconnect MCP server",n)}async function dv(A,e){const n=await ee(A).mcp.auth.authenticate({name:e});return TA("Authenticate MCP server",n)}async function Qv(A,e){const n=await ee(A).tui.config.update({scope:A.scope,...e});return TA("Update TUI config",n)}async function Bv(A,e){const n=await ee(A).agentBuilder.preview(e);return TA("Preview agent",n)}async function uv(A,e){const n=await ee(A).agentBuilder.save({path_id:e.id,scope:e.scope,description:e.description,mode:e.mode,model:e.model,color:e.color,steps:e.steps,tools:e.tools,permission:e.permission,prompt:e.prompt});return TA("Save agent",n)}function Ev(A){return!A||A==="normal"?"default":A==="small"?"sm":A==="large"?"lg":A}function Cv(A){return!A||A==="default"?"primary":A}function QA(A){const[e,t]=CA(A,["variant","size","icon","class","classList","children"]);return u(al,cA(t,{"data-component":"button",get"data-size"(){return Ev(e.size)},get"data-variant"(){return Cv(e.variant)},get"data-icon"(){return e.icon?"inline-start":void 0},get classList(){return{...e.classList,[e.class??""]:!!e.class}},get children(){return[u(H,{get when(){return e.icon},children:n=>u(Ft,{get name(){return n()},size:"small"})}),MA(()=>e.children)]}}))}function hv(A,e){const t=Object.fromEntries(Object.entries(e).filter(n=>n[1]!==void 0));if(typeof A=="string"){const n=Object.entries(t).map(i=>`${i[0]}:${i[1]}`).join(";");return n?`${A};${n}`:A}return{...A??{},...t}}var Iv=M("<div>");function zA(A){const[e,t]=CA(A,["variant","size","padding","style","class","classList","children"]),n=()=>typeof e.padding=="number"?`${e.padding}px`:e.padding;return(()=>{var i=Iv();return pt(i,cA(t,{"data-component":"card",get"data-variant"(){return e.variant??"normal"},get"data-size"(){return e.size??"default"},get style(){return hv(e.style,{"--kw-card-padding":n()})},get classList(){return{...e.classList,[e.class??""]:!!e.class}}}),!1,!0),f(i,()=>e.children),i})()}var fv=M("<span>");function Xh(A){const[e,t]=CA(A,["size","tone","class","classList","children"]);return(()=>{var n=fv();return pt(n,cA(t,{"data-component":"tag",get"data-size"(){return e.size??"normal"},get"data-tone"(){return e.tone??"neutral"},get classList(){return{...e.classList,[e.class??""]:!!e.class}}}),!1,!0),f(n,()=>e.children),n})()}var pv=M("<span data-slot=status-dot aria-hidden=true>"),mv=M("<p>"),wv=M("<section data-component=section-title><div><h2>"),yv=M("<div data-component=banner role=alert><div><span>"),Dv=M("<strong>"),kv=M("<span data-slot=config-row-accent>"),bv=M("<div data-slot=config-row-body><div data-slot=config-row-title>"),vv=M("<div data-slot=config-row-trailing>"),Mv=M("<div data-slot=config-row-leading>"),Nv=M("<div data-slot=config-row-subtitle>"),Sv=M("<div data-slot=config-row-actions>"),xv=M("<a data-component=config-row>"),Lv=M("<button type=button data-component=config-row>"),_v=M("<div data-component=config-row>");function Ae(A){return u(Xh,cA(A,{"data-slot":"config-tag"}))}function Se(A){return u(Ae,cA(A,{tone:"neutral"}))}function AI(A){return A.source==="project"||A.source==="local override"?"project":A.source==="global"||A.source==="inherited"?"global":A.overridden?"project":A.inherited?"global":"default"}function eI(A){return(()=>{var e=pv();return j(()=>$(e,"data-tone",A.tone)),e})()}function uo(A){const e=()=>["connected","healthy","running"].includes(A.status)?{tone:"success",label:A.status==="healthy"?"Healthy":A.status==="running"?"Running":"Connected"}:["failed","error","unhealthy"].includes(A.status)?{tone:"critical",label:A.status==="unhealthy"?"Unhealthy":A.status==="failed"?"Failed":"Error"}:A.status==="stopped"?{tone:"neutral",label:"Stopped"}:{tone:"neutral",label:A.status||"Unknown"};return u(Ae,{get tone(){return e().tone},class:"kw-status-tag",get children(){return[u(eI,{get tone(){return MA(()=>e().tone==="critical")()?"critical":e().tone==="success"?"success":"neutral"}}),MA(()=>e().label)]}})}function tI(A){const e=()=>AI(A),t=()=>e().toUpperCase();return u(Ae,{class:"mono",get tone(){return e()==="project"?"info":"neutral"},get children(){return t()}})}function I1(A){return(()=>{var e=wv(),t=e.firstChild,n=t.firstChild;return f(n,()=>A.children),f(t,()=>A.trailing,null),f(e,u(H,{get when(){return A.description},children:i=>(()=>{var r=mv();return f(r,i),r})()}),null),e})()}function Fv(A){const e=()=>A.tone==="critical"||A.tone==="warning"?"warning":A.tone==="success"?"circle-check":"help";return(()=>{var t=yv(),n=t.firstChild,i=n.firstChild;return f(t,u(Ft,{get name(){return e()},size:"small"}),n),f(n,u(H,{get when(){return A.title},children:r=>(()=>{var o=Dv();return f(o,r),o})()}),i),f(i,()=>A.children),f(t,()=>A.action,null),j(()=>$(t,"data-tone",A.tone??"info")),t})()}function _t(A){const e=()=>AI({source:A.source})==="project"||A.highlightOverride,t=()=>[u(H,{get when(){return e()},get children(){return kv()}}),u(H,{get when(){return A.leading},children:n=>(()=>{var i=Mv();return f(i,n),i})()}),(()=>{var n=bv(),i=n.firstChild;return f(i,()=>A.title),f(n,u(H,{get when(){return A.subtitle},children:r=>(()=>{var o=Nv();return f(o,r),o})()}),null),n})(),(()=>{var n=vv();return f(n,u(H,{get when(){return A.source!==void 0},get children(){return u(tI,{get source(){return A.source}})}}),null),f(n,()=>A.status,null),f(n,u(H,{get when(){return A.actions},children:i=>(()=>{var r=Sv();return f(r,i),r})()}),null),n})()];return A.href?(()=>{var n=xv();return f(n,t),j(i=>{var r=e()||void 0,o=A.href;return r!==i.e&&$(n,"data-override",i.e=r),o!==i.t&&$(n,"href",i.t=o),i},{e:void 0,t:void 0}),n})():A.onClick?(()=>{var n=Lv();return re(n,"click",A.onClick,!0),f(n,t),j(()=>$(n,"data-override",e()||void 0)),n})():(()=>{var n=_v();return f(n,t),j(()=>$(n,"data-override",e()||void 0)),n})()}ce(["click"]);var Gv=M("<details><summary></summary><div class=models-select-menu role=listbox>"),Rv=M("<button class=models-select-option type=button role=option>");function Xt(A){const e=()=>A.options.find(i=>i.value===A.value)?.label??A.value;function t(i,r){A.disabled||i.disabled||(A.onSelect(i.value),r.currentTarget.closest("details")?.removeAttribute("open"))}function n(i){if(A.disabled){i.currentTarget.removeAttribute("open");return}i.currentTarget.open&&i.currentTarget.parentElement?.querySelectorAll(".models-select[open]").forEach(r=>{r!==i.currentTarget&&r.removeAttribute("open")})}return(()=>{var i=Gv(),r=i.firstChild,o=r.nextSibling;return i.addEventListener("toggle",n),f(r,e),f(o,u(vA,{get each(){return A.options},children:s=>(()=>{var a=Rv();return a.$$click=l=>t(s,l),f(a,()=>s.label),j(l=>{var c=s.value===A.value,g=!!s.disabled,d=s.value===A.value,Q=A.disabled||s.disabled;return c!==l.e&&a.classList.toggle("selected",l.e=c),g!==l.t&&a.classList.toggle("disabled",l.t=g),d!==l.a&&$(a,"aria-selected",l.a=d),Q!==l.o&&(a.disabled=l.o=Q),l},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()})),j(s=>{var a=`models-select ${A.class??""}`,l=!!A.disabled,c=!!A.invalid,g=A.label,d=A.disabled,Q=A.label;return a!==s.e&&ti(i,s.e=a),l!==s.t&&i.classList.toggle("disabled",s.t=l),c!==s.a&&i.classList.toggle("invalid",s.a=c),g!==s.o&&$(r,"aria-label",s.o=g),d!==s.i&&$(r,"aria-disabled",s.i=d),Q!==s.n&&$(o,"aria-label",s.n=Q),s},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),i})()}ce(["click"]);var Tv=M("<label data-component=search-field><span data-slot=search-label></span><input>");function n1(A){const[e,t]=CA(A,["label","value","variant","hideLabel","inputClass","class","classList","onValue"]);return(()=>{var n=Tv(),i=n.firstChild,r=i.nextSibling;return f(i,()=>e.label),pt(r,cA(t,{get class(){return e.inputClass},type:"search",get value(){return e.value},get"aria-label"(){return MA(()=>e.hideLabel===!1)()?void 0:e.label},onInput:o=>e.onValue(o.currentTarget.value)}),!1,!1),j(o=>{var s=e.variant??"list",a=e.hideLabel===!1?"visible":"hidden",l={...e.classList,[e.class??""]:!!e.class};return s!==o.e&&$(n,"data-variant",o.e=s),a!==o.t&&$(n,"data-label",o.t=a),o.a=nr(n,l,o.a),o},{e:void 0,t:void 0,a:void 0}),n})()}const nI=ye();function We(){const A=pe(nI);if(!A)throw new Error("useConfig must be used within ConfigLayout");return A}function sd(){return"/console/".replace(/\/$/,"")}function Yo(A,e=sd()){return!e||e==="/"?A:A===e?"/":A.startsWith(`${e}/`)?A.slice(e.length):A}function iI(A,e=sd()){const t=Yo(A,e),n=t.indexOf("/settings");return n>0?`${t.slice(0,n)}/settings`:t.startsWith("/config")?"/config":"/settings"}function Uv(A,e=sd()){const t=Yo(A,e);return t==="/profile"||t.startsWith("/kilo/login")?"/profile":t.startsWith("/settings")||t.startsWith("/config")?"/settings":t.startsWith("/projects/")?"/project":"/projects"}const Ov={apply_patch:"Apply Patch",bash:"Bash",edit:"Edit File",glob:"Find Files",grep:"Search Content",lsp:"Language Server",question:"Ask User",read:"Read File",recall:"Local Recall",skill:"Load Skill",task:"Subagent Task",todowrite:"Todo List",webfetch:"Fetch URL",websearch:"Web Search",write:"Write File"},Kv={apply_patch:["Apply structured patches to add, update, move, or delete files.","Keeps edits explicit and easy to review."],bash:["Run shell commands in the current workspace.","Supports timeouts, working directories, and command descriptions."],edit:["Replace exact text inside an existing file.","Can update one match or all matches when needed."],glob:["Find files by path patterns.","Useful for locating files before reading or editing them."],grep:["Search file contents with regular expressions.","Can limit results to a file pattern such as TypeScript or CSS files."],lsp:["Use language-server features for code navigation.","Supports operations such as definitions, references, and diagnostics."],question:["Ask the user for a decision during execution.","Supports single-choice and multi-choice prompts."],read:["Read files, directories, images, and PDFs from the workspace.","Supports line offsets and limits for large files."],recall:["Search and read previous project conversations.","Useful for recovering prior decisions or implementation context."],skill:["Load task-specific instructions and workflows.","Applies specialized repo guidance when a matching skill exists."],task:["Delegate focused exploration or implementation work to a subagent.","Useful for parallel codebase research and complex subtasks."],todowrite:["Track multi-step implementation work.","Shows progress with pending, in-progress, and completed states."],webfetch:["Fetch and convert web pages for analysis.","Supports markdown, text, and HTML output formats."],websearch:["Search the web for external information.","Supports fast, automatic, and deep search modes."],write:["Create or overwrite files with complete contents.","Best for new files or full-file replacements."]},qv=new Set(["api","html","id","json","lsp","mcp","pdf","url"]);function UA(A){return A.trim()}function Vn(A){return A==null||A===""?"Not set":typeof A=="string"?A:typeof A=="number"||typeof A=="boolean"?String(A):JSON.stringify(A)??"Unserializable value"}function rI(A){return[...A].sort((e,t)=>e.localeCompare(t))}function Tc(A){return A.split(/\s+/).map(e=>e.trim()).filter(Boolean)}function Rt(A){return A.trim().split(/[\s._/-]+/).filter(Boolean).map(e=>/^[A-Z0-9]+$/.test(e)&&e.length<=4?e:`${e[0]?.toUpperCase()??""}${e.slice(1).toLowerCase()}`).join(" ")}function Jv(A){const e=A.toLowerCase();return qv.has(e)?e.toUpperCase():A.charAt(0).toUpperCase()+A.slice(1)}function DB(A){return A.length<=180?A:`${A.slice(0,177)}...`}function Hv(A){const e=A.replace(/```[\s\S]*?```/g," ").replace(/[*`#>_-]+/g," ").replace(/\s+/g," ").trim(),t=e.split(/(?:\.|\?|!)\s+/).map(n=>n.trim()).filter(Boolean).slice(0,2);return t.length?t.map(DB):e?[DB(e)]:[]}function x1(A){const e=Ov[A];if(e)return e;const t=A.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[._:/-]+/g," ").replace(/\s+/g," ").trim();return t?t.split(" ").map(Jv).join(" "):A}function ad(A){const e=Kv[A.id];if(e)return e;const t=A.detail?.description.trim();return t?Hv(t):["No capability description is available for this tool."]}function Yi(A){return A.split(",").map(e=>e.trim()).filter(Boolean)}function kB(A){return!A||typeof A!="object"||Array.isArray(A)?0:Object.keys(A).length}function Me(A){return A instanceof Error?A.message:typeof A=="string"?A:Vn(A)}function Yv(A){return A==="subagent"?"subagent":A==="all"?"all":"primary"}var Pv=M("<main class=config-page><section class=config-page-header><div><h1>"),Vv=M("<p>"),jv=M("<div class=config-page-actions>"),zv=M("<section class=config-toolbar>"),$v=M("<div class=config-toolbar-controls>"),Wv=M("<div class=config-toolbar-meta>");function Ze(A){return(()=>{var e=Pv(),t=e.firstChild,n=t.firstChild,i=n.firstChild;return f(i,()=>A.title),f(n,u(H,{get when(){return A.description},children:r=>(()=>{var o=Vv();return f(o,r),o})()}),null),f(t,u(H,{get when(){return A.actions},children:r=>(()=>{var o=jv();return f(o,r),o})()}),null),f(e,()=>A.children,null),e})()}function oI(A){return u(H,{get when(){return A.children||A.meta},get children(){var e=zv();return f(e,u(H,{get when(){return A.children},children:t=>(()=>{var n=$v();return f(n,t),n})()}),null),f(e,u(H,{get when(){return A.meta},children:t=>(()=>{var n=Wv();return f(n,t),n})()}),null),e}})}function ve(A){return u(tI,A)}const sI=[{value:"ask",label:"Ask"},{value:"allow",label:"Allow"},{value:"deny",label:"Deny"}],nn=[{id:"external_directory",title:"External Directory",description:"Access files outside the project directory.",noun:"path",placeholder:"e.g. ~/Downloads/**"},{id:"bash",title:"Bash",description:"Run shell commands.",noun:"command",placeholder:"e.g. git status or npm *"},{id:"read",title:"Read",description:"Read files by matching file paths.",noun:"path",placeholder:"e.g. **/*.env"},{id:"edit",title:"Edit",description:"Modify files, including writes, patches, and multi-edits.",noun:"path",placeholder:"e.g. src/**/*.ts"}],ld=[{id:"glob",title:"Glob",description:"Match files using glob patterns."},{id:"grep",title:"Grep",description:"Search file contents using regular expressions."},{id:"list",title:"List",description:"List files within a directory."},{id:"task",title:"Task",description:"Launch sub-agents."},{id:"skill",title:"Skill",description:"Load a skill by name."},{id:"lsp",title:"LSP",description:"Run language server queries."},{id:"todowrite",title:"Todo Write",description:"Update the todo list."},{id:"question",title:"Question",description:"Ask the user a question."},{id:"webfetch",title:"Web Fetch",description:"Fetch content from a URL."},{id:"websearch",title:"Web Search",description:"Search the web."},{id:"doom_loop",title:"Doom Loop",description:"Detect repeated tool calls with identical input."},{id:"agent_manager",title:"Agent Manager",description:"Manage Agent Manager operations."}],aI=[...nn,...ld],Zv=new Set(nn.map(A=>A.id)),Xv=new Set(aI.map(A=>A.id));function gd(A,e="ask"){return A==="ask"||A==="allow"||A==="deny"?A:e}function Bl(A){return A&&typeof A=="object"&&!Array.isArray(A)?A:{}}function lI(A){return Bl(A.effective.permission)}function cd(A,e){return A.overlay.collections.permission?.find(t=>t.key===e)}function gI(A,e){return typeof A.effective.permission=="string"?A.effective.permission:lI(A)[e]}function cI(A){return gd(A.effective.permission)}function A7(A,e){return A?e==="*"&&typeof A.value=="string"?A.path:[...A.path,e]:["permission",e]}function Eo(A,e,t,n){if(!(t!=="ask"&&t!=="allow"&&t!=="deny"))return{tool:A,pattern:e,action:t,source:n?.source??"default",inherited:n?.inherited??!1,overridden:n?.overridden??!1,path:n?A7(n,e):["permission",A,e]}}function e7(A){const e=A.value;if(e&&typeof e=="object"&&!Array.isArray(e))return Object.entries(e).flatMap(([n,i])=>Eo(A.key,n,i,A)??[]);const t=Eo(A.key,"*",e,A);return t?[t]:[]}function t7(A,e,t){const n=Bl(e);if(Object.keys(n).length)return Object.entries(n).flatMap(([r,o])=>Eo(A,r,o,t)??[]);const i=Eo(A,"*",e,t);return i?[i]:[]}function n7(A,e){const t=cd(A,e.id),n=gI(A,e.id),i=Bl(n),r=cI(A);return{...e,action:gd(typeof n=="string"?n:i["*"],r),source:t?.source??"default",inherited:t?.inherited??!1,overridden:t?.overridden??!1}}function i7(A,e){const t=cd(A,e.id),n=gI(A,e.id),i=Bl(n),r=cI(A);return{...e,action:gd(typeof n=="string"?n:i["*"],r),source:t?.source??"default",inherited:t?.inherited??!1,overridden:t?.overridden??!1,rules:Object.entries(i).filter(([o])=>o!=="*").flatMap(([o,s])=>Eo(e.id,o,s,t)??[])}}function r7(){const A=We(),e=()=>A.data(),[t,n]=T("closed"),[i,r]=T("external_directory"),[o,s]=T(""),[a,l]=T("ask"),c=R(()=>(e()?.overlay.collections.permission??[]).flatMap(e7)),g=R(()=>{const w=e();return w?nn.map(m=>i7(w,m)):[]}),d=R(()=>{const w=e();return w?ld.map(m=>n7(w,m)):[]}),Q=R(()=>{const w=e();return w?Object.entries(lI(w)).filter(([m])=>!Xv.has(m)).flatMap(([m,y])=>t7(m,y,cd(w,m))).sort((m,y)=>m.tool.localeCompare(y.tool)||m.pattern.localeCompare(y.pattern)):[]}),B=R(()=>nn.find(w=>w.id===i())??nn[0]);function E(w){r(w),s(""),l("ask"),n("rule")}function I(){n("closed")}function h(){const w=e(),m=UA(o());if(!w||!m){A.fail(`Enter a ${B().noun} pattern before saving.`);return}const y={[i()]:{[m]:a()}};A.save({permission:y}),I()}function C(w,m){const y=Zv.has(w)?{[w]:{"*":m}}:{[w]:m};A.save({permission:y})}function p(w){A.unset([w.path])}return{ctx:A,mode:t,kind:i,pattern:o,setPattern:s,action:a,setAction:l,rules:c,groups:g,settings:d,other:Q,selected:B,open:E,close:I,add:h,setDefault:C,remove:p}}var Uc=M("<div class=permission-row-meta>"),o7=M('<details class="models-select permission-select"><summary></summary><div class=models-select-menu role=listbox>'),s7=M("<button class=models-select-option type=button role=option>"),a7=M("<section class=permission-group><div class=permission-rules>"),l7=M("<div class=permissions><section class=permission-group><div class=permission-rules>"),g7=M("<div class=drawer-scrim>"),c7=M('<aside class="provider-drawer permission-drawer"aria-label="Permission rule configuration"><header class=drawer-header><div><h2></h2><span></span></div></header><div class="provider-form permission-form"><label class="required-field wide"><input></label><label class="required-field wide">Method</label></div><footer class=drawer-footer>'),d7=M("<span class=config-title-count>Permissions"),Q7=M("<section class=permission-group><header class=permission-group-header><div class=permission-group-copy><h2></h2><span></span><p></p></div><div class=permission-section-actions></div></header><div class=permission-rules>"),B7=M("<p class=permission-empty>No specific <!> rules."),u7=M("<span class=permission-pattern>"),E7=M("<span class=permission-subtitle><span></span><span class=permission-pattern>");function dI(A){return A==="allow"?"success":A==="deny"?"critical":"warning"}function dd(A){return sI.find(e=>e.value===A)?.label??A}function bB(A){return(()=>{var e=Uc();return f(e,u(Ae,{get tone(){return dI(A.rule.action)},get children(){return dd(A.rule.action)}}),null),f(e,u(ve,{get source(){return A.rule.source},get inherited(){return A.rule.inherited},get overridden(){return A.rule.overridden}}),null),e})()}function Pi(A){const e=()=>dd(A.value);function t(i,r){A.disabled||(A.onSelect(i),r.currentTarget.closest("details")?.removeAttribute("open"))}function n(i){if(A.disabled){i.currentTarget.removeAttribute("open");return}i.currentTarget.open&&i.currentTarget.parentElement?.querySelectorAll(".models-select[open]").forEach(r=>{r!==i.currentTarget&&r.removeAttribute("open")})}return(()=>{var i=o7(),r=i.firstChild,o=r.nextSibling;return i.addEventListener("toggle",n),f(r,e),f(o,u(vA,{each:sI,children:s=>(()=>{var a=s7();return a.$$click=l=>t(s.value,l),f(a,()=>s.label),j(l=>{var c=s.value===A.value,g=s.value===A.value;return c!==l.e&&a.classList.toggle("selected",l.e=c),g!==l.t&&$(a,"aria-selected",l.t=g),l},{e:void 0,t:void 0}),a})()})),j(s=>{var a=!!A.disabled,l=A.label,c=A.disabled,g=A.label;return a!==s.e&&i.classList.toggle("disabled",s.e=a),l!==s.t&&$(r,"aria-label",s.t=l),c!==s.a&&$(r,"aria-disabled",s.a=c),g!==s.o&&$(o,"aria-label",s.o=g),s},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()}function C7(){const A=r7();return u(Ze,{get title(){return(()=>{var e=d7();return e.firstChild,f(e,u(Se,{get children(){return A.groups().length+A.settings().length}}),null),e})()},description:"Control what tools agents can use by default and add pattern-specific allow, ask, or deny rules.",get children(){return[(()=>{var e=l7(),t=e.firstChild,n=t.firstChild;return f(e,u(vA,{get each(){return A.groups()},children:i=>(()=>{var r=Q7(),o=r.firstChild,s=o.firstChild,a=s.firstChild,l=a.nextSibling,c=l.nextSibling,g=s.nextSibling,d=o.nextSibling;return f(a,()=>i.title),f(l,()=>i.id),f(c,()=>i.description),f(g,u(Se,{get children(){return i.rules.length}}),null),f(g,u(QA,{icon:"plus",variant:"primary",get disabled(){return!!A.ctx.saving()},onClick:()=>A.open(i.id),children:"Add rule"}),null),f(r,u(_t,{title:"Default method",get subtitle(){return`Used for ${i.noun}s that do not match a specific rule.`},get status(){return(()=>{var Q=Uc();return f(Q,u(ve,{get source(){return i.source},get inherited(){return i.inherited},get overridden(){return i.overridden}})),Q})()},get actions(){return u(Pi,{get label(){return`Default method for ${i.title}`},get value(){return i.action},get disabled(){return!!A.ctx.saving()},onSelect:Q=>A.setDefault(i.id,Q)})}}),d),f(d,u(H,{get when(){return i.rules.length},get fallback(){return(()=>{var Q=B7(),B=Q.firstChild,E=B.nextSibling;return E.nextSibling,f(Q,()=>i.noun,E),Q})()},get children(){return u(vA,{get each(){return i.rules},children:Q=>u(_t,{get title(){return(()=>{var B=u7();return f(B,()=>Q.pattern),B})()},get subtitle(){return`${i.title} ${i.noun} rule`},get status(){return u(bB,{rule:Q})},get actions(){return u(Je,{icon:"trash",variant:"ghost",get"aria-label"(){return`Delete ${i.title} rule ${Q.pattern}`},get disabled(){return!!A.ctx.saving()},onClick:()=>A.remove(Q)})}})})}})),r})()}),t),f(t,u(I1,{get trailing(){return u(Se,{get children(){return A.settings().length}})},description:"Default methods for additional built-in tool permissions.",children:"Tool Defaults"}),n),f(n,u(vA,{get each(){return A.settings()},children:i=>u(_t,{get title(){return i.title},get subtitle(){return`${i.id} · ${i.description}`},get status(){return(()=>{var r=Uc();return f(r,u(ve,{get source(){return i.source},get inherited(){return i.inherited},get overridden(){return i.overridden}})),r})()},get actions(){return u(Pi,{get label(){return`Default method for ${i.title}`},get value(){return i.action},get disabled(){return!!A.ctx.saving()},onSelect:r=>A.setDefault(i.id,r)})}})})),f(e,u(H,{get when(){return A.other().length},get children(){var i=a7(),r=i.firstChild;return f(i,u(I1,{get trailing(){return u(Se,{get children(){return A.other().length}})},description:"Additional tool permission rules from config.",children:"Other Permissions"}),r),f(r,u(vA,{get each(){return A.other()},children:o=>u(_t,{get title(){return x1(o.tool)},get subtitle(){return(()=>{var s=E7(),a=s.firstChild,l=a.nextSibling;return f(a,()=>o.tool),f(l,()=>o.pattern),s})()},get status(){return u(bB,{rule:o})},get actions(){return u(Je,{icon:"trash",variant:"ghost",get"aria-label"(){return`Delete ${o.tool} rule ${o.pattern}`},get disabled(){return!!A.ctx.saving()},onClick:()=>A.remove(o)})}})})),i}}),null),e})(),u(H,{get when(){return A.mode()==="rule"},get children(){return[(()=>{var e=g7();return re(e,"click",A.close,!0),e})(),(()=>{var e=c7(),t=e.firstChild,n=t.firstChild,i=n.firstChild,r=i.nextSibling,o=t.nextSibling,s=o.firstChild,a=s.firstChild,l=s.nextSibling;l.firstChild;var c=o.nextSibling;return f(i,()=>`Add ${A.selected().title} Rule`),f(r,()=>`${A.selected().id} · ${A.selected().description}`),f(t,u(QA,{variant:"ghost","aria-label":"Close permission rule overlay",get onClick(){return A.close},children:"X"}),null),f(s,()=>A.selected().noun==="command"?"Command pattern":"Path pattern",a),a.$$input=g=>A.setPattern(g.currentTarget.value),$(a,"spellcheck",!1),f(l,u(Pi,{label:"Rule method",get value(){return A.action()},get disabled(){return!!A.ctx.saving()},get onSelect(){return A.setAction}}),null),f(c,u(QA,{variant:"ghost",get onClick(){return A.close},children:"Cancel"}),null),f(c,u(QA,{variant:"primary",get disabled(){return!!A.ctx.saving()},get onClick(){return A.add},children:"Save Rule"}),null),j(()=>$(a,"placeholder",A.selected().placeholder)),j(()=>a.value=A.pattern()),e})()]}})]}})}ce(["click","input"]);const h7=["Review the current diff and report risks, regressions, and missing tests.","Plan the work in small steps, then implement the smallest correct change.","Inspect relevant files first, then summarize the root cause before editing.","Run the smallest relevant validation checks and report any remaining failures."];function I7(A,e){return A.id==="kilo"?-1:e.id==="kilo"?1:A.name.localeCompare(e.name)}function f7(A,e){return A.provider.id===e.providerID&&A.model.id===e.modelID?!0:A.model.providerID===e.providerID&&A.model.id===e.modelID}function dg(A){const e=UA(A);if(e)return e}function p7(A){const e=Number(A);if(Number.isInteger(e)&&e>0)return e}function $1(A){return A&&typeof A=="object"&&!Array.isArray(A)?A:{}}function hn(A){return typeof A=="string"?A:""}function m7(A){if(typeof A=="number"&&Number.isFinite(A))return A}function vB(A,e="ask"){return A==="allow"||A==="deny"||A==="ask"?A:e}function Oc(A,e,t){if(!(t!=="allow"&&t!=="deny"&&t!=="ask"))return{tool:A,pattern:e,action:t}}function MB(A,e){const t=$1(e);if(Object.keys(t).length)return Object.entries(t).flatMap(([i,r])=>Oc(A,i,r)??[]);const n=Oc(A,"*",e);return n?[n]:[]}const w7=new Set(nn.map(A=>A.id)),y7=new Set(aI.map(A=>A.id));function D7(A){const e=A.options.source;if(typeof e=="string")return e}function k7(A){const e=Object.entries(b7(A));return{tools:rI(e.filter(([,t])=>t==="allow").map(([t])=>t)),permission:Object.fromEntries(e.filter(([,t])=>t!=="allow"))}}function b7(A){return Array.isArray(A)?A.reduce((e,t)=>{const n=$1(t),i=hn(n.permission),r=hn(n.action);if(!i||!r)return e;const o=hn(n.pattern)||"*";if(o==="*")return{...e,[i]:r};const s=e[i],a=s&&typeof s=="object"&&!Array.isArray(s)?s:{};return{...e,[i]:{...a,[o]:r}}},{}):$1(A)}function v7(A,e){return(A.overlay.collections.agent??[]).find(t=>t.key===e)}function Dr(A){return A.displayName??Rt(A.name)}function M7(A){return A.model?`${A.model.providerID}/${A.model.modelID}`:""}function Kc(A,e){return!(A.native||e?.inherited||e?.editable===!1||D7(A)==="organization")}function N7(A){const e=We(),t=()=>e.data(),n=R(()=>e.query()?.scope??"project"),[i,r]=T(),[o,s]=T(!0),[a,l]=T(!1),[c,g]=T("reviewer"),[d,Q]=T(""),[B,E]=T("subagent"),[I,h]=T(""),[C,p]=T(""),[w,m]=T(""),[y,k]=T([]),[v,b]=T(""),[x,_]=T("external_directory"),[L,S]=T(""),[G,K]=T("ask"),[J,Y]=T({}),[P,z]=T(),[aA,EA]=T("closed"),[Z,hA]=T(""),[V,q]=T(""),[X,iA]=T(""),[tA,oA]=T([]),nA=R(()=>{const AA=t();if(!AA)return[];const BA=new Set([...Object.keys(AA.effective.provider??{}),...AA.providers.connected]);return AA.providers.all.filter(DA=>BA.has(DA.id)).filter(DA=>Object.keys(DA.models).length>0).sort(I7)}),IA=R(()=>nA().flatMap(AA=>Object.values(AA.models).map(BA=>({id:`${AA.id}/${BA.id}`,provider:AA,model:BA})))),fA=R(()=>t()?.modelState.favorite??[]),W=AA=>fA().some(BA=>f7(AA,BA)),D=R(()=>{const AA=Z().trim().toLowerCase();return IA().filter(BA=>AA?`${BA.id} ${BA.model.name} ${BA.provider.name}`.toLowerCase().includes(AA):!0).sort((BA,DA)=>{const HA=Number(W(DA))-Number(W(BA));if(HA!==0)return HA;const de=BA.model.name.localeCompare(DA.model.name);if(de!==0)return de;const te=BA.provider.name.localeCompare(DA.provider.name);return te!==0?te:BA.id.localeCompare(DA.id)})}),mA=AA=>{if(typeof AA=="string")return IA().find(BA=>BA.id===AA||`${BA.model.providerID}/${BA.model.id}`===AA)},yA=R(()=>mA(I())),bA=R(()=>{const AA=t();if(!AA)return[];const BA=X().trim().toLowerCase(),DA=new Map(AA.toolDetails.map(HA=>[HA.id,HA]));return AA.tools.map(HA=>({id:HA,detail:DA.get(HA)})).filter(HA=>BA?`${HA.id} ${x1(HA.id)} ${ad(HA).join(" ")}`.toLowerCase().includes(BA):!0).sort((HA,de)=>x1(HA.id).localeCompare(x1(de.id)))}),$A=R(()=>new Set(tA())),KA=R(()=>Object.entries(J()).flatMap(([AA,BA])=>MB(AA,BA))),YA=R(()=>nn.map(AA=>{const BA=J()[AA.id],DA=$1(BA);return{...AA,action:vB(typeof BA=="string"?BA:DA["*"]),rules:Object.entries(DA).filter(([HA])=>HA!=="*").flatMap(([HA,de])=>Oc(AA.id,HA,de)??[])}})),Ye=R(()=>ld.map(AA=>{const BA=J()[AA.id],DA=$1(BA);return{...AA,action:vB(typeof BA=="string"?BA:DA["*"])}})),De=R(()=>Object.entries(J()).filter(([AA])=>!y7.has(AA)).flatMap(([AA,BA])=>MB(AA,BA)).sort((AA,BA)=>AA.tool.localeCompare(BA.tool)||AA.pattern.localeCompare(BA.pattern))),ie=R(()=>nn.find(AA=>AA.id===x())??nn[0]);function GA(AA="reviewer"){g(AA),Q(""),E("subagent"),h(""),p(""),m(""),k([]),b(""),Y({}),z(void 0),l(!1),EA("closed"),_("external_directory"),S(""),K("ask"),hA(""),q(""),iA(""),oA([])}rA(()=>{A?.()||i()!==""&&(GA(),s(!0),r(""))}),rA(()=>{const AA=t(),BA=A?.();if(!AA||!BA||i()===BA)return;GA(BA),s(!1),r(BA);const DA=AA.agents.find(yt=>yt.name===BA);if(!DA){e.fail(`Agent not found: ${BA}`);return}const HA=v7(AA,BA),de=Kc(DA,HA);e.fail(""),s(!0),l(!de);const te=$1(HA?.value),Ot=k7(te.permission??(de?void 0:DA.permission)),Kt=m7(te.steps)??DA.steps;g(DA.name),Q(hn(te.description)||DA.description||""),E(Yv(hn(te.mode)||DA.mode)),h(hn(te.model)||M7(DA)),p(hn(te.color)||DA.color||""),m(Kt?String(Kt):""),k(Ot.tools),Y(Ot.permission),b(hn(te.prompt)||DA.prompt||"")});function VA(){EA("closed")}function NA(){return a()?(e.fail("Inspected agents are read-only."),!1):!0}function Ie(){const AA=wt();AA&&(z(void 0),EA("markdown"),e.run("Previewing agent",()=>Bv(e.target(),AA).then(z),{refetch:!1}))}function ae(){NA()&&(hA(""),q(I()),EA("model"))}function Ge(AA){q(AA.id)}function Pe(){if(!NA())return;const AA=V();if(!AA){e.fail("Select a model before saving the agent model field.");return}h(AA),VA()}function tt(){NA()&&h("")}function jA(){NA()&&(iA(""),oA(y()),EA("tools"))}function lA(AA){if(!NA())return;const BA=new Set(tA());BA.has(AA)?BA.delete(AA):BA.add(AA),oA(rI(BA))}function SA(){NA()&&(k(tA()),VA())}function JA(){NA()&&k([])}function Re(AA){NA()&&(_(AA),S(""),K("ask"),EA("permission"))}function Ve(AA,BA){if(!NA())return;const DA={...J()};if(!w7.has(AA)){DA[AA]=BA,Y(DA);return}const HA=$1(DA[AA]);DA[AA]={...HA,"*":BA},Y(DA)}function Ee(){if(!NA())return;const AA=UA(L());if(!AA){e.fail(`Enter a ${ie().noun} pattern before saving.`);return}const BA=x(),DA={...J()},HA=DA[BA],de=HA&&typeof HA=="object"&&!Array.isArray(HA)?{...HA}:{};de[AA]=G(),DA[BA]=de,Y(DA),VA()}function Oe(AA){if(!NA())return;const BA={...J()};if(AA.pattern==="*"){const HA={...$1(BA[AA.tool])};if(Object.keys(HA).length){delete HA["*"],Object.keys(HA).length?BA[AA.tool]=HA:delete BA[AA.tool],Y(BA);return}delete BA[AA.tool],Y(BA);return}const DA={...$1(BA[AA.tool])};delete DA[AA.pattern],Object.keys(DA).length?BA[AA.tool]=DA:delete BA[AA.tool],Y(BA)}function Et(AA){if(!NA())return;const BA=UA(v());b(BA?`${BA}
21
21
 
22
22
  ${AA}`:AA)}function wt(){if(!o()){e.fail("Select an agent before previewing or saving.");return}const AA=UA(c()),BA=UA(v());if(!AA||!BA){e.fail("Enter an agent id and prompt before previewing or saving.");return}const DA=J();return{scope:n(),id:AA,description:dg(d()),mode:B(),model:dg(I()),color:dg(C()),steps:p7(w()),tools:y().length?y():void 0,permission:Object.keys(DA).length?DA:void 0,prompt:BA}}function pA(){if(!NA())return;const AA=wt();AA&&e.run("Saving agent",()=>uv(e.target(),AA).then(z))}return{ctx:e,snap:t,scope:n,id:c,setId:g,desc:d,setDesc:Q,mode:B,setMode:E,model:I,setModel:h,color:C,setColor:p,steps:w,setSteps:m,tools:y,prompt:v,setPrompt:b,permTool:x,setPermTool:_,permPattern:L,setPermPattern:S,permAction:G,setPermAction:K,permissionGroups:YA,permissionDefaults:Ye,permissionOther:De,selectedPermission:ie,draft:P,ready:o,locked:a,panel:aA,close:VA,openMarkdown:Ie,picker:Z,setPicker:hA,choice:V,models:D,selected:yA,fav:W,openModel:ae,selectModel:Ge,saveModel:Pe,clearModel:tt,search:X,setSearch:iA,options:bA,pickedDraft:$A,openTools:jA,rules:KA,openPermission:Re,setPermissionDefault:Ve,removePermission:Oe,toggleTool:lA,saveTools:SA,clearTools:JA,addPermission:Ee,insert:Et,save:pA}}var S7=M("<div class=agent-builder-field-actions>"),x7=M('<div class="ui-field agent-builder-field"><div class=agent-builder-field-head><div><span></span></div></div><div class=agent-builder-control>'),L7=M("<small>"),_7=M("<div class=permission-row-meta>"),F7=M("<div class=agents>"),G7=M("<span class=config-title-count>Agents"),R7=M("<p class=empty>"),T7=M("<section class=agent-section>"),U7=M("<div>"),O7=M("<span class=agent-mode-dot aria-hidden=true>"),K7=M("<span class=agent-subtitle><span class=agent-id></span><span class=agent-description>"),q7=M('<div class="tags agent-tags">'),J7=M("<header class=ui-card-header><div><h2>Identity</h2><p>Name, mode, and display metadata for this agent."),H7=M("<input class=mono placeholder=reviewer>"),Y7=M('<input placeholder="Review code and report risks">'),P7=M('<div class=agent-color-control><input class=mono placeholder=#0e639c><div class=agent-color-swatches aria-label="Preset colors">'),V7=M("<input class=mono placeholder=optional inputmode=numeric>"),NB=M('<div class="ui-form agent-builder-form">'),j7=M("<header class=ui-card-header><div><h2>Model And Tools</h2><p>Choose the model and default tool access written into the agent frontmatter."),Qg=M("<strong>"),z7=M('<div class="tag-cloud agent-tool-summary">'),$7=M("<header class=ui-card-header><div><h2>System Prompt</h2><p>Markdown instructions that define how this agent behaves."),W7=M('<textarea class="mono agent-prompt-input"placeholder="Describe how this agent should behave.">'),Z7=M('<div class="ui-form agent-builder-form"><div class=agent-snippets><div class=block-title><strong>Prompt snippets</strong><span>Insert a starter instruction into the prompt, then customize it.</span></div><div class=snippet-list>'),X7=M("<header class=ui-card-header><div><h2>Agent Permissions</h2><p>Add scalar or pattern-specific overrides before previewing markdown."),AM=M("<section class=permission-group><div class=permission-rules>"),eM=M('<div class="ui-card-body agent-permissions-body"><div class="permissions agent-permissions"><section class=permission-group><div class=permission-rules>'),tM=M('<div class="builder agent-builder"><section class="builder-form agent-builder-stack">'),ls=M("<div class=drawer-scrim>"),nM=M('<aside class=provider-drawer aria-label="Agent model selector"><header class=drawer-header><div><h2>Choose Model</h2><span>Favorites are listed first, then models are sorted alphabetically.</span></div></header><div class="provider-picker model-picker"></div><footer class=drawer-footer>'),iM=M('<aside class=provider-drawer aria-label="Agent tool access selector"><header class=drawer-header><div><h2>Choose Tool Access</h2><span>Selected tools are written as allow permissions in the agent frontmatter.</span></div></header><div class="provider-picker tool-picker"></div><footer class=drawer-footer>'),rM=M('<aside class="provider-drawer permission-drawer"aria-label="Agent permission rule configuration"><header class=drawer-header><div><h2></h2><span></span></div></header><div class="provider-form permission-form"><label class="required-field wide"><input></label><label class="required-field wide">Method</label></div><footer class=drawer-footer>'),oM=M('<aside class=provider-drawer aria-label="Generated agent markdown"><header class=drawer-header><div><h2>Markdown</h2><span></span></div></header><div class="provider-picker markdown-picker">'),sM=M("<button class=agent-color-swatch type=button>"),SB=M("<span class=mono>"),aM=M("<strong>No tools selected"),lM=M("<span>No allow permissions will be written."),gM=M("<section class=permission-group><header class=permission-group-header><div class=permission-group-copy><h2></h2><span></span><p></p></div><div class=permission-section-actions></div></header><div class=permission-rules>"),cM=M("<p class=permission-empty>No specific <!> rules."),dM=M("<span class=permission-pattern>"),QM=M("<span class=permission-subtitle><span></span><span class=permission-pattern>"),BM=M("<p class=empty>No models match this filter."),uM=M('<button class="provider-option model-option"type=button><span class=model-star aria-hidden=true></span><div><strong></strong><span></span></div><div class=tags>'),EM=M("<p class=empty>No tools match this filter."),CM=M('<button class="provider-option tool-option"type=button><div class="model-main tool-main"><div class=model-title><div><strong></strong><span></span></div></div><div class=tags></div></div><ul class=tool-capabilities>'),hM=M("<li>"),IM=M("<p class=empty>Generating markdown preview..."),fM=M("<pre class=markdown-preview>");const pM=["#0e639c","#89d185","#cca700","#f14c4c","#3794ff","#c586c0","#9cdcfe"],mM=[{value:"primary",label:"Primary"},{value:"subagent",label:"Subagent"},{value:"all",label:"Both"}];function xB(A){return A.description??"No description available."}function wM(A){return A===0?"Project Agents":"Global Agents"}function QI(){const A=O1(),e=il();return{href:n=>{const i=n?`/${encodeURIComponent(n)}`:"";return`${iI(A.pathname)}/agents${i}${A.search}`},nav:e}}function yM(A){return A.length===1?"1 tool":`${A.length} tools`}function dn(A){return(()=>{var e=x7(),t=e.firstChild,n=t.firstChild,i=n.firstChild,r=t.nextSibling;return f(i,()=>A.label),f(n,u(H,{get when(){return A.description},children:o=>(()=>{var s=L7();return f(s,o),s})()}),null),f(t,u(H,{get when(){return A.actions},get children(){var o=S7();return f(o,()=>A.actions),o}}),null),f(r,()=>A.children),e})()}function LB(A){return(()=>{var e=_7();return f(e,u(Ae,{get tone(){return dI(A.action)},get children(){return dd(A.action)}})),e})()}function DM(){const A=QI(),e=We(),[t,n]=T(""),i=()=>e.data(),r=R(()=>{const l=i();if(!l)return[];const c=e.query()?.scope??"global",g=new Map((l.overlay.collections.agent??[]).map(Q=>[Q.key,Q])),d=new Set((l.overlay.collections.agent??[]).filter(Q=>Q.source==="project").map(Q=>Q.key));return l.agents.filter(Q=>{const B=g.get(Q.name);return c==="global"?!B?.local:d.has(Q.name)||!B?.local}).map(Q=>({item:Q,entry:g.get(Q.name),rank:d.has(Q.name)?0:1})).sort((Q,B)=>Q.rank-B.rank||Dr(Q.item).localeCompare(Dr(B.item)))}),o=R(()=>{const l=t().trim().toLowerCase();return l?r().filter(c=>`${Dr(c.item)} ${c.item.name} ${xB(c.item)}`.toLowerCase().includes(l)):r()}),s=R(()=>[0,1].map(l=>o().filter(c=>c.rank===l)).filter(l=>l.length)),a=R(()=>r().length?"No agents match this filter.":"No agents loaded.");return u(H,{get when(){return i()},children:l=>u(Ze,{get title(){return(()=>{var c=G7();return c.firstChild,f(c,u(Se,{get children(){return r().length}}),null),c})()},description:"Agents are reusable model, prompt, and tool configurations. Primary agents drive sessions; subagents are delegated to.",get actions(){return u(QA,{icon:"plus",variant:"primary",onClick:()=>A.nav(A.href("new")),children:"New agent"})},get children(){return[u(n1,{label:"Filter agents",get value(){return t()},placeholder:"Filter by name or ID...",onValue:n}),(()=>{var c=F7();return f(c,u(H,{get when(){return s().length},get fallback(){return(()=>{var g=R7();return f(g,a),g})()},get children(){return u(vA,{get each(){return s()},children:g=>(()=>{var d=T7();return f(d,u(H,{get when(){return e.query()?.scope==="project"},get children(){return u(I1,{get children(){return wM(g[0]?.rank??1)}})}}),null),f(d,u(vA,{each:g,children:Q=>(()=>{var B=U7();return f(B,u(_t,{get leading(){return(()=>{var E=O7();return j(()=>$(E,"data-mode",Q.item.mode)),E})()},get title(){return Dr(Q.item)},get subtitle(){return(()=>{var E=K7(),I=E.firstChild,h=I.nextSibling;return f(I,()=>Q.item.name),f(h,()=>xB(Q.item)),E})()},get status(){return(()=>{var E=q7();return f(E,u(Ae,{get tone(){return Q.item.mode==="primary"?"brand":"neutral"},get children(){return Q.item.mode}}),null),f(E,u(Ae,{get children(){return Q.item.native?"Native":"Custom"}}),null),f(E,u(H,{get when(){return Q.item.hidden},get children(){return u(Ae,{children:"Hidden"})}}),null),f(E,u(H,{get when(){return Q.item.deprecated},get children(){return u(Ae,{children:"Deprecated"})}}),null),f(E,u(H,{get when(){return Q.entry},children:I=>u(ve,{get source(){return I().source},get inherited(){return I().inherited},get overridden(){return I().overridden}})}),null),E})()},get actions(){return u(Je,{get icon(){return Kc(Q.item,Q.entry)?"edit":"eye"},variant:"ghost",get"aria-label"(){return`${Kc(Q.item,Q.entry)?"Edit":"Inspect"} ${Dr(Q.item)}`},onClick:()=>A.nav(A.href(Q.item.name))})}})),j(()=>B.classList.toggle("inherited",!!Q.entry?.inherited)),B})()}),null),d})()})}})),c})()]}})})}function _B(){const A=QI(),e=Ho(),t=()=>e.agentID==="new"?void 0:e.agentID,n=N7(t),i=R(()=>t()?n.locked()?"Inspect Agent":"Edit Agent":"Agent Builder");return u(H,{get when(){return n.snap()},children:r=>u(Ze,{get title(){return i()},description:"Build a reusable agent by combining a prompt, model, mode, and tool permissions.",get actions(){return[u(QA,{variant:"secondary",get disabled(){return!!n.ctx.saving()||!n.ready()},get onClick(){return n.openMarkdown},children:"Markdown"}),u(H,{get when(){return!n.locked()},get children(){return u(QA,{variant:"primary",get disabled(){return!!n.ctx.saving()||!n.ready()},get onClick(){return n.save},children:"Save"})}}),u(Je,{icon:"close",variant:"secondary","aria-label":"Close agent builder",onClick:()=>A.nav(A.href())})]},get children(){return[(()=>{var o=tM(),s=o.firstChild;return f(s,u(zA,{class:"ui-card agent-builder-card",padding:0,get children(){return[J7(),(()=>{var a=NB();return f(a,u(dn,{label:"Agent id",description:"Used in @ mentions, commands, and agent files.",get children(){var l=H7();return l.$$input=c=>n.setId(c.currentTarget.value),$(l,"spellcheck",!1),j(()=>l.readOnly=n.locked()),j(()=>l.value=n.id()),l}}),null),f(a,u(dn,{label:"Description",description:"Shown when choosing or delegating to the agent.",get children(){var l=Y7();return l.$$input=c=>n.setDesc(c.currentTarget.value),j(()=>l.readOnly=n.locked()),j(()=>l.value=n.desc()),l}}),null),f(a,u(dn,{label:"Mode",description:"Primary agents can run sessions directly; subagents are delegated to by other agents.",get children(){return u(Xt,{label:"Agent mode",get value(){return n.mode()},options:mM,get disabled(){return n.locked()},get onSelect(){return n.setMode}})}}),null),f(a,u(dn,{label:"Color",get children(){var l=P7(),c=l.firstChild,g=c.nextSibling;return c.$$input=d=>n.setColor(d.currentTarget.value),f(g,u(vA,{each:pM,children:d=>(()=>{var Q=sM();return Q.$$click=()=>n.setColor(d),$(Q,"aria-label",`Use color ${d}`),N1(Q,"background-color",d),j(B=>{var E=n.color()===d,I=n.locked();return E!==B.e&&Q.classList.toggle("selected",B.e=E),I!==B.t&&(Q.disabled=B.t=I),B},{e:void 0,t:void 0}),Q})()})),j(()=>c.readOnly=n.locked()),j(()=>c.value=n.color()),l}}),null),f(a,u(dn,{label:"Max steps",description:"Optional hard cap on tool-call iterations.",get children(){var l=V7();return l.$$input=c=>n.setSteps(c.currentTarget.value),j(()=>l.readOnly=n.locked()),j(()=>l.value=n.steps()),l}}),null),a})()]}}),null),f(s,u(zA,{class:"ui-card agent-builder-card",padding:0,get children(){return[j7(),(()=>{var a=NB();return f(a,u(dn,{label:"Model",description:"Leave unset to inherit the default model, or choose one to pin this agent to a specific model.",get actions(){return[u(H,{get when(){return MA(()=>!n.locked())()&&n.model()},get children(){return u(QA,{variant:"secondary",get disabled(){return!!n.ctx.saving()},get onClick(){return n.clearModel},children:"Use Default"})}}),u(Je,{icon:"edit",variant:"secondary","aria-label":"Edit agent model",get disabled(){return!!n.ctx.saving()||n.locked()},get onClick(){return n.openModel}})]},get children(){return u(H,{get when(){return n.selected()},get fallback(){return[(()=>{var l=Qg();return f(l,()=>n.model()||"Inherit default model"),l})(),u(H,{get when(){return n.model()},children:l=>(()=>{var c=SB();return f(c,l),c})()})]},children:l=>[(()=>{var c=Qg();return f(c,()=>`${l().provider.name} / ${l().model.name}`),c})(),(()=>{var c=SB();return f(c,()=>l().id),c})()]})}}),null),f(a,u(dn,{label:"Tool access",description:"Selected tools are written as allow permissions.",get actions(){return[u(H,{get when(){return MA(()=>!n.locked())()&&n.tools().length},get children(){return u(QA,{variant:"secondary",get disabled(){return!!n.ctx.saving()},get onClick(){return n.clearTools},children:"Clear"})}}),u(Je,{icon:"edit",variant:"secondary","aria-label":"Edit tool access",get disabled(){return!!n.ctx.saving()||n.locked()},get onClick(){return n.openTools}})]},get children(){return u(H,{get when(){return n.tools().length},get fallback(){return[aM(),lM()]},get children(){return[(()=>{var l=Qg();return f(l,()=>yM(n.tools())),l})(),(()=>{var l=z7();return f(l,u(vA,{get each(){return n.tools()},children:c=>u(Ae,{children:c})})),l})()]}})}}),null),a})()]}}),null),f(s,u(zA,{class:"ui-card agent-builder-card",padding:0,get children(){return[$7(),(()=>{var a=Z7(),l=a.firstChild,c=l.firstChild,g=c.nextSibling;return f(a,u(dn,{label:"Prompt",get children(){var d=W7();return d.$$input=Q=>n.setPrompt(Q.currentTarget.value),j(()=>d.readOnly=n.locked()),j(()=>d.value=n.prompt()),d}}),l),f(g,u(vA,{each:h7,children:d=>u(QA,{variant:"secondary",get disabled(){return!!n.ctx.saving()||n.locked()},onClick:()=>n.insert(d),children:d})})),a})()]}}),null),f(s,u(zA,{class:"ui-card agent-builder-card",padding:0,get children(){return[(()=>{var a=X7();return a.firstChild,f(a,u(Se,{get children(){return n.rules().length}}),null),a})(),(()=>{var a=eM(),l=a.firstChild,c=l.firstChild,g=c.firstChild;return f(l,u(vA,{get each(){return n.permissionGroups()},children:d=>(()=>{var Q=gM(),B=Q.firstChild,E=B.firstChild,I=E.firstChild,h=I.nextSibling,C=h.nextSibling,p=E.nextSibling,w=B.nextSibling;return f(I,()=>d.title),f(h,()=>d.id),f(C,()=>d.description),f(p,u(Se,{get children(){return d.rules.length}}),null),f(p,u(QA,{icon:"plus",variant:"primary",get disabled(){return!!n.ctx.saving()||n.locked()},onClick:()=>n.openPermission(d.id),children:"Add rule"}),null),f(Q,u(_t,{title:"Default method",get subtitle(){return`Used for ${d.noun}s that do not match a specific rule.`},get actions(){return u(Pi,{get label(){return`Default method for ${d.title}`},get value(){return d.action},get disabled(){return!!n.ctx.saving()||n.locked()},onSelect:m=>n.setPermissionDefault(d.id,m)})}}),w),f(w,u(H,{get when(){return d.rules.length},get fallback(){return(()=>{var m=cM(),y=m.firstChild,k=y.nextSibling;return k.nextSibling,f(m,()=>d.noun,k),m})()},get children(){return u(vA,{get each(){return d.rules},children:m=>u(_t,{get title(){return(()=>{var y=dM();return f(y,()=>m.pattern),y})()},get subtitle(){return`${d.title} ${d.noun} rule`},get status(){return u(LB,{get action(){return m.action}})},get actions(){return u(Je,{icon:"trash",variant:"ghost",get"aria-label"(){return`Delete ${d.title} rule ${m.pattern}`},get disabled(){return!!n.ctx.saving()||n.locked()},onClick:()=>n.removePermission(m)})}})})}})),Q})()}),c),f(c,u(I1,{get trailing(){return u(Se,{get children(){return n.permissionDefaults().length}})},description:"Default methods for additional built-in tool permissions.",children:"Tool Defaults"}),g),f(g,u(vA,{get each(){return n.permissionDefaults()},children:d=>u(_t,{get title(){return d.title},get subtitle(){return`${d.id} · ${d.description}`},get actions(){return u(Pi,{get label(){return`Default method for ${d.title}`},get value(){return d.action},get disabled(){return!!n.ctx.saving()||n.locked()},onSelect:Q=>n.setPermissionDefault(d.id,Q)})}})})),f(l,u(H,{get when(){return n.permissionOther().length},get children(){var d=AM(),Q=d.firstChild;return f(d,u(I1,{get trailing(){return u(Se,{get children(){return n.permissionOther().length}})},description:"Additional tool permission rules from this agent.",children:"Other Permissions"}),Q),f(Q,u(vA,{get each(){return n.permissionOther()},children:B=>u(_t,{get title(){return x1(B.tool)},get subtitle(){return(()=>{var E=QM(),I=E.firstChild,h=I.nextSibling;return f(I,()=>B.tool),f(h,()=>B.pattern),E})()},get status(){return u(LB,{get action(){return B.action}})},get actions(){return u(Je,{icon:"trash",variant:"ghost",get"aria-label"(){return`Delete ${B.tool} rule ${B.pattern}`},get disabled(){return!!n.ctx.saving()||n.locked()},onClick:()=>n.removePermission(B)})}})})),d}}),null),a})()]}}),null),o})(),u(H,{get when(){return n.panel()==="model"},get children(){return[(()=>{var o=ls();return re(o,"click",n.close,!0),o})(),(()=>{var o=nM(),s=o.firstChild;s.firstChild;var a=s.nextSibling,l=a.nextSibling;return f(s,u(QA,{variant:"ghost","aria-label":"Close model selector",get onClick(){return n.close},children:"X"}),null),f(o,u(n1,{class:"drawer-search",hideLabel:!1,label:"Filter models",get value(){return n.picker()},variant:"drawer",placeholder:"Search by name, provider, or ID",get onValue(){return n.setPicker}}),a),f(a,u(H,{get when(){return n.models().length},get fallback(){return BM()},get children(){return u(vA,{get each(){return n.models()},children:c=>(()=>{var g=uM(),d=g.firstChild,Q=d.nextSibling,B=Q.firstChild,E=B.nextSibling,I=Q.nextSibling;return g.$$click=()=>n.selectModel(c),f(B,()=>c.model.name),f(E,()=>c.id),f(I,u(Ae,{get children(){return c.provider.name}}),null),f(I,u(Ae,{get children(){return c.model.isFree?"free":"paid"}}),null),j(h=>{var C=n.choice()===c.id,p=!!n.fav(c);return C!==h.e&&g.classList.toggle("selected",h.e=C),p!==h.t&&d.classList.toggle("active",h.t=p),h},{e:void 0,t:void 0}),g})()})}})),f(l,u(QA,{variant:"ghost",get onClick(){return n.close},children:"Cancel"}),null),f(l,u(QA,{variant:"primary",get disabled(){return!!n.ctx.saving()||n.locked()||!n.choice()},get onClick(){return n.saveModel},children:"Save"}),null),o})()]}}),u(H,{get when(){return n.panel()==="tools"},get children(){return[(()=>{var o=ls();return re(o,"click",n.close,!0),o})(),(()=>{var o=iM(),s=o.firstChild;s.firstChild;var a=s.nextSibling,l=a.nextSibling;return f(s,u(QA,{variant:"ghost","aria-label":"Close tool selector",get onClick(){return n.close},children:"X"}),null),f(o,u(n1,{class:"drawer-search",hideLabel:!1,label:"Filter tools",get value(){return n.search()},variant:"drawer",placeholder:"Search by tool name, ID, or capability",get onValue(){return n.setSearch}}),a),f(a,u(H,{get when(){return n.options().length},get fallback(){return EM()},get children(){return u(vA,{get each(){return n.options()},children:c=>(()=>{var g=CM(),d=g.firstChild,Q=d.firstChild,B=Q.firstChild,E=B.firstChild,I=E.nextSibling,h=Q.nextSibling,C=d.nextSibling;return g.$$click=()=>n.toggleTool(c.id),f(E,()=>x1(c.id)),f(I,()=>c.id),f(h,u(Ae,{get children(){return n.pickedDraft().has(c.id)?"Allowed":"Off"}})),f(C,u(vA,{get each(){return ad(c)},children:p=>(()=>{var w=hM();return f(w,p),w})()})),j(p=>{var w=!!n.pickedDraft().has(c.id),m=n.pickedDraft().has(c.id);return w!==p.e&&g.classList.toggle("selected",p.e=w),m!==p.t&&$(g,"aria-pressed",p.t=m),p},{e:void 0,t:void 0}),g})()})}})),f(l,u(QA,{variant:"ghost",get onClick(){return n.close},children:"Cancel"}),null),f(l,u(QA,{variant:"primary",get disabled(){return!!n.ctx.saving()||n.locked()},get onClick(){return n.saveTools},children:"Save"}),null),o})()]}}),u(H,{get when(){return n.panel()==="permission"},get children(){return[(()=>{var o=ls();return re(o,"click",n.close,!0),o})(),(()=>{var o=rM(),s=o.firstChild,a=s.firstChild,l=a.firstChild,c=l.nextSibling,g=s.nextSibling,d=g.firstChild,Q=d.firstChild,B=d.nextSibling;B.firstChild;var E=g.nextSibling;return f(l,()=>`Add ${n.selectedPermission().title} Rule`),f(c,()=>`${n.selectedPermission().id} · ${n.selectedPermission().description}`),f(s,u(QA,{variant:"ghost","aria-label":"Close permission rule overlay",get onClick(){return n.close},children:"X"}),null),f(d,()=>n.selectedPermission().noun==="command"?"Command pattern":"Path pattern",Q),Q.$$input=I=>n.setPermPattern(I.currentTarget.value),$(Q,"spellcheck",!1),f(B,u(Pi,{label:"Rule method",get value(){return n.permAction()},get disabled(){return!!n.ctx.saving()||n.locked()},get onSelect(){return n.setPermAction}}),null),f(E,u(QA,{variant:"ghost",get onClick(){return n.close},children:"Cancel"}),null),f(E,u(QA,{variant:"primary",get disabled(){return!!n.ctx.saving()||n.locked()},get onClick(){return n.addPermission},children:"Save Rule"}),null),j(I=>{var h=n.selectedPermission().placeholder,C=n.locked();return h!==I.e&&$(Q,"placeholder",I.e=h),C!==I.t&&(Q.readOnly=I.t=C),I},{e:void 0,t:void 0}),j(()=>Q.value=n.permPattern()),o})()]}}),u(H,{get when(){return n.panel()==="markdown"},get children(){return[(()=>{var o=ls();return re(o,"click",n.close,!0),o})(),(()=>{var o=oM(),s=o.firstChild,a=s.firstChild,l=a.firstChild,c=l.nextSibling,g=s.nextSibling;return f(c,()=>n.draft()?.path??"Previewing the current agent configuration."),f(s,u(QA,{variant:"ghost","aria-label":"Close markdown preview",get onClick(){return n.close},children:"X"}),null),f(g,u(H,{get when(){return n.draft()},get fallback(){return IM()},children:d=>(()=>{var Q=fM();return f(Q,()=>d().markdown),Q})()})),o})()]}})]}})})}ce(["input","click"]);const kM=["#0c0a09","#fafaf9","#f9f76f","#a6a09b","#3794ff","#44403b"],Bg=[{id:"aura",swatches:["#0f0f0f","#edecee","#a277ff","#f694ff","#a277ff","#2d2d2d"]},{id:"ayu",swatches:["#0B0E14","#BFBDB6","#59C2FF","#D2A6FF","#E6B450","#6C7380"]},{id:"carbonfox",swatches:["#161616","#f2f4f8","#33b1ff","#78a9ff","#ff7eb6","#303030"]},{id:"catppuccin",swatches:["#1e1e2e","#cdd6f4","#89b4fa","#cba6f7","#f5c2e7","#313244"]},{id:"catppuccin-frappe",swatches:["#303446","#c6d0f5","#8da4e2","#ca9ee6","#f4b8e4","#414559"]},{id:"catppuccin-macchiato",swatches:["#24273a","#cad3f5","#8aadf4","#c6a0f6","#f5bde6","#363a4f"]},{id:"cobalt2",swatches:["#193549","#ffffff","#0088ff","#9a5feb","#2affdf","#1f4662"]},{id:"colorblind",swatches:["#1A1A2E","#E8E8E8","#0077BB","#EE7733","#33BBEE","#1F4068"]},{id:"cursor",swatches:["#181818","#e4e4e4","#88c0d0","#81a1c1","#88c0d0","#e4e4e413"]},{id:"dracula",swatches:["#282a36","#f8f8f2","#bd93f9","#ff79c6","#8be9fd","#44475a"]},{id:"everforest",swatches:["#2d353b","#d3c6aa","#a7c080","#7fbbb3","#d699b6","#859289"]},{id:"flexoki",swatches:["#100F0F","#CECDC3","#DA702C","#4385BE","#8B7EC8","#575653"]},{id:"github",swatches:["#0d1117","#c9d1d9","#58a6ff","#bc8cff","#39c5cf","#30363d"]},{id:"gruvbox",swatches:["#282828","#ebdbb2","#83a598","#d3869b","#8ec07c","#665c54"]},{id:"kanagawa",swatches:["#1F1F28","#DCD7BA","#7E9CD8","#957FB8","#D27E99","#54546D"]},{id:"kilo",swatches:["#0c0a09","#fafaf9","#f9f76f","#a6a09b","#f9f76f","#44403b"]},{id:"kilo-v1",swatches:["#1e1e1e","#cccccc","#faf74f","#007acc","#007fd4","#3c3c3c"]},{id:"lucent-orng",swatches:["#000000","#eeeeee","#EC5B2B","#EE7948","#FFF7F1","#EC5B2B"]},{id:"material",swatches:["#263238","#eeffff","#82aaff","#c792ea","#89ddff","#37474f"]},{id:"matrix",swatches:["#0a0e0a","#62ff94","#2eff6a","#00efff","#c770ff","#1e2a1b"]},{id:"mercury",swatches:["#171721","#dddde5","#8da4f5","#a7b6f8","#8da4f5","#b4b7c81f"]},{id:"monokai",swatches:["#272822","#f8f8f2","#66d9ef","#ae81ff","#a6e22e","#3e3d32"]},{id:"nightowl",swatches:["#011627","#d6deeb","#82AAFF","#7fdbca","#c792ea","#5f7e97"]},{id:"nord",swatches:["#2E3440","#ECEFF4","#88C0D0","#81A1C1","#8FBCBB","#434C5E"]},{id:"one-dark",swatches:["#282c34","#abb2bf","#61afef","#c678dd","#56b6c2","#393f4a"]},{id:"opencode",swatches:["#0a0a0a","#eeeeee","#fab283","#5c9cf5","#9d7cd8","#484848"]},{id:"orng",swatches:["#0a0a0a","#eeeeee","#EC5B2B","#EE7948","#FFF7F1","#EC5B2B"]},{id:"osaka-jade",swatches:["#111c18","#C1C497","#2DD5B7","#D2689C","#549e6a","#3d4a44"]},{id:"palenight",swatches:["#292d3e","#a6accd","#82aaff","#c792ea","#89ddff","#32364a"]},{id:"rosepine",swatches:["#191724","#e0def4","#9ccfd8","#c4a7e7","#ebbcba","#403d52"]},{id:"solarized",swatches:["#002b36","#839496","#268bd2","#6c71c4","#2aa198","#073642"]},{id:"synthwave84",swatches:["#262335","#ffffff","#36f9f6","#ff7edb","#b084eb","#495495"]},{id:"tokyonight",swatches:["#1a1b26","#c8d3f5","#82aaff","#c099ff","#ff966c","#737aa2"]},{id:"vercel",swatches:["#000000","#EDEDED","#0070F3","#52A8FF","#8E4EC6","#1F1F1F"]},{id:"vesper",swatches:["#101010","#FFF","#FFC799","#99FFE4","#FFC799","#282828"]},{id:"zenburn",swatches:["#3f3f3f","#dcdccc","#8cd0d3","#dc8cc3","#93e0e3","#5f5f5f"]}];function Qd(A){return A.split("-").filter(Boolean).map(e=>`${e[0]?.toUpperCase()??""}${e.slice(1)}`).join(" ")}function FB(A){return{id:A,swatches:kM,custom:!0}}function bM(A){return A==="stacked"?"stacked":"auto"}function $r(A,e){return typeof A=="boolean"?A:e}function vM(){const A=We(),e=R(()=>A.data()?.tui.theme??"kilo"),[t,n]=T(""),[i,r]=T("closed"),[o,s]=T(""),[a,l]=T(""),[c,g]=T("3"),[d,Q]=T(!1),[B,E]=T("auto"),[I,h]=T(!0),[C,p]=T(!1),w=R(()=>{const G=UA(o()).toLowerCase(),K=Bg.filter(Y=>G?`${Y.id} ${Qd(Y.id)}`.toLowerCase().includes(G):!0),J=UA(o());return!J||Bg.some(Y=>Y.id===J)||K.length?K:[FB(J)]});function m(G){return Bg.find(K=>K.id===G)??FB(G||"kilo")}const y=R(()=>m(t())),k=R(()=>m(a()||t()));rA(()=>{const G=A.data()?.tui;n(e()),!C()&&(g(String(G?.scroll_speed??3)),Q($r(G?.scroll_acceleration?.enabled,!1)),E(bM(G?.diff_style)),h($r(G?.mouse,!0)))});function v(){l(t()),s(""),r("theme")}function b(){r("closed")}function x(G){l(G.id)}function _(G){p(!0),G()}function L(){const G=UA(a());if(!G){A.fail("Select a TUI theme before saving.");return}A.tui({theme:G}),n(G),b()}function S(){const G=Number(c());if(!Number.isFinite(G)||G<.001){A.fail("Enter a scroll speed of at least 0.001.");return}const K={scroll_speed:G,scroll_acceleration:{enabled:d()},diff_style:B(),mouse:I()};A.tui(K),p(!1)}return{ctx:A,current:e,theme:t,active:y,selected:k,mode:i,picker:o,setPicker:s,choice:a,options:w,edit:v,close:b,select:x,saveTheme:L,speed:c,setSpeed:G=>_(()=>g(G)),accel:d,setAccel:G=>_(()=>Q(G)),diff:B,setDiff:G=>_(()=>E(G)),mouse:I,setMouse:G=>_(()=>h(G)),dirty:C,save:S}}function MM(){const A=We(),[e,t]=T(!1),[n,i]=T(!0),[r,o]=T(!0),[s,a]=T("0.4"),[l,c]=T("none"),[g,d]=T(!1);rA(()=>{if(g())return;const E=A.data()?.tui,I=E?.attention;t($r(I?.enabled,!1)),i($r(I?.notifications,!0)),o($r(I?.sound,!0)),a(String(I?.volume??.4)),c(E?.title_icon??"none")});function Q(E){d(!0),E()}function B(){const E=Number(s());if(!Number.isFinite(E)||E<0||E>1){A.fail("Enter an attention volume between 0 and 1.");return}A.tui({title_icon:l(),attention:{enabled:e(),notifications:n(),sound:r(),volume:E}}),d(!1)}return{ctx:A,alert:e,setAlert:E=>Q(()=>t(E)),notify:n,setNotify:E=>Q(()=>i(E)),sound:r,setSound:E=>Q(()=>o(E)),volume:s,setVolume:E=>Q(()=>a(E)),icon:l,setIcon:E=>Q(()=>c(E)),dirty:g,save:B}}var NM=M("<button class=ui-toggle type=button><span><strong></strong><small>"),SM=M("<header class=ui-card-header><div><h2>Terminal title</h2><p>Choose how session status appears in the terminal tab title."),xM=M("<div class=ui-form><div class=ui-field><span>Title Icon</span><small>None hides status icons. Unicode and Emojis show working, attention, and finished states."),LM=M("<header class=ui-card-header><div><h2>Attention</h2><p>Control when the TUI asks for attention and how it notifies you."),_M=M('<div class="ui-form attention-form"><label class=ui-field><span>Volume</span><input type=number min=0 max=1 step=0.05><small>Use a value from 0 to 1. The docs example uses 0.4.'),FM=M("<div class=ui-settings>");const GM=[{value:"none",label:"None"},{value:"unicode",label:"Unicode"},{value:"emojis",label:"Emojis"}];function ug(A){return(()=>{var e=NM(),t=e.firstChild,n=t.firstChild,i=n.nextSibling;return re(e,"click",A.onChange,!0),f(n,()=>A.label),f(i,()=>A.description),f(e,u(Ae,{get tone(){return A.checked?"success":"neutral"},get children(){return A.checked?"On":"Off"}}),null),j(r=>{var o=!!A.checked,s=A.checked,a=A.disabled;return o!==r.e&&e.classList.toggle("selected",r.e=o),s!==r.t&&$(e,"aria-pressed",r.t=s),a!==r.a&&(e.disabled=r.a=a),r},{e:void 0,t:void 0,a:void 0}),e})()}function RM(){const A=MM();return u(Ze,{title:"CLI Notifications",description:"Configure terminal title indicators, TUI attention alerts, desktop notifications, and sound defaults.",get actions(){return u(QA,{variant:"primary",get disabled(){return!!A.ctx.saving()||!A.dirty()},get onClick(){return A.save},children:"Save"})},get children(){var e=FM();return f(e,u(zA,{class:"ui-card",padding:0,get children(){return[SM(),(()=>{var t=xM(),n=t.firstChild,i=n.firstChild,r=i.nextSibling;return f(n,u(Xt,{class:"title-icon-select",label:"Title Icon",get value(){return A.icon()},options:GM,get disabled(){return!!A.ctx.saving()},get onSelect(){return A.setIcon}}),r),t})()]}}),null),f(e,u(zA,{class:"ui-card",padding:0,get children(){return[LM(),(()=>{var t=_M(),n=t.firstChild,i=n.firstChild,r=i.nextSibling;return f(t,u(ug,{label:"Attention alerts",description:"Turn on TUI attention events.",get checked(){return A.alert()},get disabled(){return!!A.ctx.saving()},onChange:()=>A.setAlert(!A.alert())}),n),f(t,u(ug,{label:"Desktop notifications",description:"Show desktop notifications when attention alerts fire.",get checked(){return A.notify()},get disabled(){return!!A.ctx.saving()||!A.alert()},onChange:()=>A.setNotify(!A.notify())}),n),f(t,u(ug,{label:"Sound",description:"Play an attention sound when alerts fire.",get checked(){return A.sound()},get disabled(){return!!A.ctx.saving()||!A.alert()},onChange:()=>A.setSound(!A.sound())}),n),r.$$input=o=>A.setVolume(o.currentTarget.value),j(()=>r.disabled=!A.alert()),j(()=>r.value=A.volume()),t})()]}}),null),e}})}ce(["click","input"]);var TM=M("<div class=theme-swatches aria-hidden=true>"),UM=M("<span class=theme-swatch>"),OM=M("<div class=theme-preview><div><strong></strong><span class=mono>"),KM=M("<button class=ui-toggle type=button><span><strong></strong><small>"),qM=M("<header class=ui-card-header><div><h2>Theme</h2><p>Choose the TUI palette. Custom theme IDs can still be typed in the selector search."),JM=M("<div class=ui-card-body>"),HM=M("<header class=ui-card-header><div><h2>Interaction</h2><p>Control mouse capture, scrolling, and diff rendering behavior in the terminal."),YM=M("<div class=ui-form><label class=ui-field><span>Diff style</span><small>Auto adapts to terminal width; stacked always uses a single-column diff.</small></label><label class=ui-field><span>Scroll speed</span><input type=number min=0.001 step=0.25><small>Default is 3. Use lower values for slower scrolling."),PM=M("<div class=ui-settings>"),VM=M("<div class=drawer-scrim>"),jM=M('<aside class="provider-drawer theme-drawer"aria-label="Theme selector"><header class=drawer-header><div><h2>Choose Theme</h2><span>Select a built-in theme or type a custom theme ID in search.</span></div></header><div class="provider-picker theme-picker"></div><footer class="drawer-footer theme-footer"><div>'),zM=M("<p class=empty>No themes match this filter."),$M=M('<button class="provider-option theme-option"type=button><div><strong></strong><span>');const WM=[{value:"auto",label:"Auto"},{value:"stacked",label:"Stacked"}];function BI(A){return(()=>{var e=TM();return f(e,u(vA,{get each(){return A.swatches},children:t=>(()=>{var n=UM();return N1(n,"background-color",t),n})()})),e})()}function GB(A){return(()=>{var e=OM(),t=e.firstChild,n=t.firstChild,i=n.nextSibling;return f(n,()=>Qd(A.item.id)),f(i,(()=>{var r=MA(()=>!!A.item.custom);return()=>r()?`${A.item.id} / custom`:A.item.id})()),f(e,u(BI,{get swatches(){return A.item.swatches}}),null),e})()}function RB(A){return(()=>{var e=KM(),t=e.firstChild,n=t.firstChild,i=n.nextSibling;return re(e,"click",A.onChange,!0),f(n,()=>A.label),f(i,()=>A.description),f(e,u(Ae,{get tone(){return A.checked?"success":"neutral"},get children(){return A.checked?"On":"Off"}}),null),j(r=>{var o=!!A.checked,s=A.checked,a=A.disabled;return o!==r.e&&e.classList.toggle("selected",r.e=o),s!==r.t&&$(e,"aria-pressed",r.t=s),a!==r.a&&(e.disabled=r.a=a),r},{e:void 0,t:void 0,a:void 0}),e})()}function ZM(){const A=vM();return u(Ze,{title:"CLI UI",description:"Configure terminal UI preferences saved in tui.json.",get actions(){return u(QA,{variant:"primary",get disabled(){return!!A.ctx.saving()||!A.dirty()},get onClick(){return A.save},children:"Save"})},get children(){return[(()=>{var e=PM();return f(e,u(zA,{class:"ui-card ui-theme-card",padding:0,get children(){return[(()=>{var t=qM();return t.firstChild,f(t,u(QA,{variant:"secondary",get disabled(){return!!A.ctx.saving()},get onClick(){return A.edit},children:"Change Theme"}),null),t})(),(()=>{var t=JM();return f(t,u(GB,{get item(){return A.active()}})),t})()]}}),null),f(e,u(zA,{class:"ui-card",padding:0,get children(){return[HM(),(()=>{var t=YM(),n=t.firstChild,i=n.firstChild,r=i.nextSibling,o=n.nextSibling,s=o.firstChild,a=s.nextSibling;return f(n,u(Xt,{label:"Diff style",get value(){return A.diff()},options:WM,get onSelect(){return A.setDiff}}),r),a.$$input=l=>A.setSpeed(l.currentTarget.value),f(t,u(RB,{label:"Mouse capture",description:"Allow the TUI to receive mouse input. Defaults to on.",get checked(){return A.mouse()},get disabled(){return!!A.ctx.saving()},onChange:()=>A.setMouse(!A.mouse())}),null),f(t,u(RB,{label:"Scroll acceleration",description:"Enable macOS-style scroll acceleration.",get checked(){return A.accel()},get disabled(){return!!A.ctx.saving()},onChange:()=>A.setAccel(!A.accel())}),null),j(()=>a.value=A.speed()),t})()]}}),null),e})(),u(H,{get when(){return A.mode()==="theme"},get children(){return[(()=>{var e=VM();return re(e,"click",A.close,!0),e})(),(()=>{var e=jM(),t=e.firstChild;t.firstChild;var n=t.nextSibling,i=n.nextSibling,r=i.firstChild;return f(t,u(QA,{variant:"ghost","aria-label":"Close theme selector",get onClick(){return A.close},children:"X"}),null),f(e,u(n1,{class:"drawer-search",hideLabel:!1,label:"Filter themes",get value(){return A.picker()},variant:"drawer",placeholder:"Search theme or type a custom ID",get onValue(){return A.setPicker}}),n),f(n,u(H,{get when(){return A.options().length},get fallback(){return zM()},get children(){return u(vA,{get each(){return A.options()},children:o=>(()=>{var s=$M(),a=s.firstChild,l=a.firstChild,c=l.nextSibling;return s.$$click=()=>A.select(o),f(l,()=>Qd(o.id)),f(c,(()=>{var g=MA(()=>!!o.custom);return()=>g()?`${o.id} / custom theme`:o.id})()),f(s,u(BI,{get swatches(){return o.swatches}}),null),j(()=>s.classList.toggle("selected",A.choice()===o.id)),s})()})}})),f(i,u(GB,{get item(){return A.selected()}}),r),f(r,u(QA,{variant:"ghost",get onClick(){return A.close},children:"Cancel"}),null),f(r,u(QA,{variant:"primary",get disabled(){return!!A.ctx.saving()||!A.choice()},get onClick(){return A.saveTheme},children:"Save Theme"}),null),e})()]}})]}})}ce(["click","input"]);var XM=M("<svg>"),AN=M("<svg><rect width=3 height=3 rx=1></svg>",!1,!0,!1);const eN=new Set([1,2,4,7,8,11,13,14]),tN=new Set([0,3,12,15]),nN=Array.from({length:16},(A,e)=>({id:e,x:e%4*4,y:Math.floor(e/4)*4,delay:Math.random()*1.5,duration:1+Math.random()*1,outer:eN.has(e),corner:tN.has(e)}));function Bd(A){return(()=>{var e=XM();return pt(e,cA(A,{viewBox:"0 0 15 15","data-component":"spinner",get classList(){return{...A.classList,[A.class??""]:!!A.class}},fill:"currentColor"}),!0,!0),f(e,u(vA,{each:nN,children:t=>(()=>{var n=AN();return j(i=>{var r=t.x,o=t.y,s=t.corner?0:void 0,a=t.corner?void 0:`${t.outer?"pulse-opacity-dim":"pulse-opacity"} ${t.duration}s ease-in-out infinite`,l=t.corner?void 0:"both",c=t.corner?void 0:`${t.delay}s`;return r!==i.e&&$(n,"x",i.e=r),o!==i.t&&$(n,"y",i.t=o),s!==i.a&&N1(n,"opacity",i.a=s),a!==i.o&&N1(n,"animation",i.o=a),l!==i.i&&N1(n,"animation-fill-mode",i.i=l),c!==i.n&&N1(n,"animation-delay",i.n=c),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),n})()})),e})()}const Ca=300,ri=250,Wi=800,ha="unified";function qc(A){return A==="split"?"split":ha}function Jc(A){return typeof A!="number"||!Number.isFinite(A)?Ca:Math.min(Wi,Math.max(ri,Math.round(A)))}function iN(A){const e=Number(A);if(Number.isInteger(e)&&!(e<ri||e>Wi))return e}function rN(){const A=We(),[e,t]=T(String(Ca)),[n,i]=T(ha),[r,o]=T(!1);rA(()=>{if(r())return;const l=A.data()?.effective.console;t(String(Jc(l?.context_sidebar_width))),i(qc(l?.diff_style))});function s(){const l=iN(e());if(l===void 0){A.fail(`Enter a sidebar width between ${ri} and ${Wi} pixels.`);return}A.patch({console:{context_sidebar_width:l,diff_style:n()}}),t(String(l)),o(!1)}function a(){A.unset([["console","context_sidebar_width"],["console","diff_style"]]),t(String(Ca)),i(ha),o(!1)}return{ctx:A,width:e,setWidth:l=>{t(l),o(!0)},style:n,setStyle:l=>{i(qc(l)),o(!0)},dirty:r,configured:()=>{const l=A.data()?.effective.console;return l?.context_sidebar_width!==void 0||l?.diff_style!==void 0},save:s,reset:a}}var oN=M("<header class=ui-card-header><div><h2>Project context sidebar</h2><p>Set the default width used by the Context and Changes panel in project consoles."),sN=M("<div class=ui-form><label class=ui-field><span>Sidebar width</span><input type=number step=1><small>Width in pixels, between <!> and <!>. You can also resize the sidebar by dragging its left edge."),aN=M("<header class=ui-card-header><div><h2>Diff review</h2><p>Choose the default layout used when reviewing changed files in project consoles."),lN=M("<div class=ui-form><div class=ui-field><span>Diff layout</span><small>Unified shows changes in one column. Split shows the original and modified file side by side."),gN=M("<div class=ui-settings>");const cN=[{value:"unified",label:"Unified"},{value:"split",label:"Split"}];function dN(){const A=rN();return u(Ze,{title:"Console UI",description:"Configure the local Kilo Console interface. These preferences are saved in your user config.",get actions(){return[u(H,{get when(){return A.configured()},get children(){return u(QA,{variant:"secondary",get disabled(){return!!A.ctx.saving()},get onClick(){return A.reset},children:"Use default"})}}),u(QA,{variant:"primary",get disabled(){return!!A.ctx.saving()||!A.dirty()},get"aria-busy"(){return!!A.ctx.saving()},get onClick(){return A.save},get children(){return[u(H,{get when(){return A.ctx.saving()},get children(){return u(Bd,{})}}),"Save"]}})]},get children(){var e=gN();return f(e,u(zA,{class:"ui-card",padding:0,get children(){return[oN(),(()=>{var t=sN(),n=t.firstChild,i=n.firstChild,r=i.nextSibling,o=r.nextSibling,s=o.firstChild,a=s.nextSibling,l=a.nextSibling,c=l.nextSibling;return c.nextSibling,r.$$input=g=>A.setWidth(g.currentTarget.value),$(r,"min",ri),$(r,"max",Wi),f(o,ri,a),f(o,Wi,c),j(()=>r.value=A.width()),t})()]}}),null),f(e,u(zA,{class:"ui-card",padding:0,get children(){return[aN(),(()=>{var t=lN(),n=t.firstChild,i=n.firstChild,r=i.nextSibling;return f(n,u(Xt,{class:"console-diff-select",label:"Diff layout",get value(){return A.style()},options:cN,get disabled(){return!!A.ctx.saving()},get onSelect(){return A.setStyle}}),r),t})()]}}),null),e}})}ce(["input"]);const uI=[{id:"air",ext:[".R"],req:"air command available"},{id:"biome",ext:[".js",".jsx",".ts",".tsx",".html",".css",".md",".json",".yaml"],req:"biome.json(c) config file"},{id:"cargofmt",ext:[".rs"],req:"cargo fmt command available"},{id:"clang-format",ext:[".c",".cpp",".h",".hpp",".ino"],req:".clang-format config file"},{id:"cljfmt",ext:[".clj",".cljs",".cljc",".edn"],req:"cljfmt command available"},{id:"dart",ext:[".dart"],req:"dart command available"},{id:"dfmt",ext:[".d"],req:"dfmt command available"},{id:"gleam",ext:[".gleam"],req:"gleam command available"},{id:"gofmt",ext:[".go"],req:"gofmt command available"},{id:"htmlbeautifier",ext:[".erb",".html.erb"],req:"htmlbeautifier command available"},{id:"ktlint",ext:[".kt",".kts"],req:"ktlint command available"},{id:"latexindent",ext:[".tex"],req:"latexindent command available"},{id:"mix",ext:[".ex",".exs",".eex",".heex",".leex",".neex",".sface"],req:"mix command available"},{id:"nixfmt",ext:[".nix"],req:"nixfmt command available"},{id:"ocamlformat",ext:[".ml",".mli"],req:"ocamlformat command and .ocamlformat config file"},{id:"ormolu",ext:[".hs"],req:"ormolu command available"},{id:"oxfmt",ext:[".js",".jsx",".ts",".tsx"],req:"oxfmt dependency and experimental flag",note:"Experimental"},{id:"pint",ext:[".php"],req:"laravel/pint dependency in composer.json"},{id:"prettier",ext:[".js",".jsx",".ts",".tsx",".html",".css",".md",".json",".yaml"],req:"prettier dependency in package.json"},{id:"rubocop",ext:[".rb",".rake",".gemspec",".ru"],req:"rubocop command available"},{id:"ruff",ext:[".py",".pyi"],req:"ruff command available with config"},{id:"rustfmt",ext:[".rs"],req:"rustfmt command available"},{id:"shfmt",ext:[".sh",".bash"],req:"shfmt command available"},{id:"standardrb",ext:[".rb",".rake",".gemspec",".ru"],req:"standardrb command available"},{id:"terraform",ext:[".tf",".tfvars"],req:"terraform command available"},{id:"uv",ext:[".py",".pyi"],req:"uv command available"},{id:"zig",ext:[".zig",".zon"],req:"zig command available"}],EI=[{id:"astro",ext:[".astro"],req:"Auto-installs for Astro projects"},{id:"bash",ext:[".sh",".bash",".zsh",".ksh"],req:"Auto-installs bash-language-server"},{id:"biome",ext:[".js",".jsx",".ts",".tsx",".json",".jsonc",".css"],req:"biome dependency or config available"},{id:"clangd",ext:[".c",".cpp",".cc",".cxx",".c++",".h",".hpp",".hh",".hxx",".h++"],req:"Auto-installs for C/C++ projects"},{id:"clojure-lsp",ext:[".clj",".cljs",".cljc",".edn"],req:"clojure-lsp command available"},{id:"csharp",title:"C#",ext:[".cs",".csx"],req:".NET SDK installed"},{id:"dart",ext:[".dart"],req:"dart command available"},{id:"deno",ext:[".ts",".tsx",".js",".jsx",".mjs"],req:"deno command available with deno.json/c"},{id:"dockerfile",title:"Dockerfile",ext:["Dockerfile",".dockerfile"],req:"Docker language server available"},{id:"elixir-ls",ext:[".ex",".exs"],req:"elixir command available"},{id:"eslint",title:"ESLint",ext:[".ts",".tsx",".js",".jsx",".mjs",".cjs",".mts",".cts",".vue"],req:"eslint dependency in project"},{id:"fsharp",title:"F#",ext:[".fs",".fsi",".fsx",".fsscript"],req:".NET SDK installed"},{id:"gleam",ext:[".gleam"],req:"gleam command available"},{id:"gopls",ext:[".go"],req:"go command available"},{id:"haskell-language-server",title:"HLS",ext:[".hs",".lhs"],req:"haskell-language-server-wrapper command available"},{id:"jdtls",title:"JDTLS",ext:[".java"],req:"Java SDK 21+ installed"},{id:"julials",title:"JuliaLS",ext:[".jl"],req:"julia and LanguageServer.jl installed"},{id:"kotlin-ls",ext:[".kt",".kts"],req:"Auto-installs for Kotlin projects"},{id:"lua-ls",ext:[".lua"],req:"Auto-installs for Lua projects"},{id:"nixd",ext:[".nix"],req:"nixd command available"},{id:"ocaml-lsp",ext:[".ml",".mli"],req:"ocamllsp command available"},{id:"oxlint",ext:[".ts",".tsx",".js",".jsx",".mjs",".cjs",".mts",".cts",".vue",".astro",".svelte"],req:"oxlint dependency in project"},{id:"php intelephense",title:"PHP Intelephense",ext:[".php"],req:"Auto-installs for PHP projects"},{id:"prisma",ext:[".prisma"],req:"prisma command available"},{id:"pyright",ext:[".py",".pyi"],req:"pyright dependency installed"},{id:"razor",ext:[".razor",".cshtml"],req:".NET SDK and VS Code C# extension installed"},{id:"ruby-lsp",ext:[".rb",".rake",".gemspec",".ru"],req:"ruby and gem commands available"},{id:"rust",ext:[".rs"],req:"rust-analyzer command available"},{id:"sourcekit-lsp",ext:[".swift",".objc",".objcpp"],req:"swift installed, Xcode on macOS"},{id:"svelte",ext:[".svelte"],req:"Auto-installs for Svelte projects"},{id:"terraform",ext:[".tf",".tfvars"],req:"Auto-installs from GitHub releases"},{id:"texlab",ext:[".tex"],req:"Auto-installs texlab"},{id:"tinymist",ext:[".typ",".typc"],req:"Auto-installs from GitHub releases"},{id:"ty",title:"Ty",ext:[".py",".pyi"],req:"Experimental Python LSP",note:"Experimental"},{id:"typescript",title:"TypeScript",ext:[".ts",".tsx",".js",".jsx",".mjs",".cjs",".mts",".cts"],req:"typescript dependency in project"},{id:"vue",ext:[".vue"],req:"Auto-installs for Vue projects"},{id:"yaml-ls",title:"YAML LS",ext:[".yaml",".yml"],req:"Auto-installs Red Hat yaml-language-server"},{id:"zls",title:"ZLS",ext:[".zig",".zon"],req:"zig command available"}],QN=new Set(uI.map(A=>A.id)),BN=new Set(EI.map(A=>A.id));function on(A){return!A||typeof A!="object"||Array.isArray(A)?{}:A}function CI(A){return Array.isArray(A)?A.filter(e=>typeof e=="string"):[]}function TB(A){return new Map(A.map(e=>[e.key,e]))}function UB(A){return A===!0||!!(A&&typeof A=="object")}function gs(A){return on(A?.value).disabled===!0}function cs(A){return CI(on(A?.value).command)}function ds(A,e){return Object.fromEntries(Object.entries(on(on(A?.value)[e])).filter(t=>typeof t[1]=="string"))}function OB(A){return on(on(A?.value).initialization)}function Eg(A,e,t){const n=CI(on(e?.value).extensions);return n.length?n:t.length?t:A.ext}function uN(A){return Object.entries(A).map(e=>`${e[0]}=${e[1]}`).join(`
23
23
  `)}function EN(A){return Object.keys(A).length?JSON.stringify(A,null,2):""}function KB(A){const e=A.split(`
@@ -6,7 +6,7 @@
6
6
  <link rel="icon" type="image/svg+xml" href="/console/favicon.svg" />
7
7
  <link rel="icon" type="image/x-icon" href="/console/favicon.ico" />
8
8
  <title>Kilo Console</title>
9
- <script type="module" crossorigin src="/console/assets/index-gbhhVAes.js"></script>
9
+ <script type="module" crossorigin src="/console/assets/index-D4NRlfXJ.js"></script>
10
10
  <link rel="stylesheet" crossorigin href="/console/assets/index-DaUKIxYQ.css">
11
11
  </head>
12
12
  <body>
package/bin/kilo CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kilocode/cli-darwin-x64-baseline",
3
- "version": "7.4.19",
3
+ "version": "7.4.20",
4
4
  "license": "MIT",
5
5
  "preferUnplugged": true,
6
6
  "os": [