@easbot/sdk 0.2.16 → 0.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +30 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
'use strict';var child_process=require('child_process');var Ve=Object.defineProperty;var Je=(s,t,e)=>t in s?Ve(s,t,{enumerable:true,configurable:true,writable:true,value:e}):s[t]=e;var l=(s,t,e)=>Je(s,typeof t!="symbol"?t+"":t,e);function Ae({onRequest:s,onSseError:t,onSseEvent:e,responseTransformer:r,responseValidator:n,sseDefaultRetryDelay:d,sseMaxRetryAttempts:p,sseMaxRetryDelay:i,sseSleepFn:a,url:m,...c}){let y,E=a??(g=>new Promise(b=>setTimeout(b,g)));return {stream:async function*(){let g=d??3e3,b=0,S=c.signal??new AbortController().signal;for(;!S.aborted;){b++;let q=c.headers instanceof Headers?c.headers:new Headers(c.headers);y!==void 0&&q.set("Last-Event-ID",y);try{let w={redirect:"follow",...c,body:c.serializedBody,headers:q,signal:S},O=new Request(m,w);s&&(O=await s(m,w));let
|
|
1
|
+
'use strict';var child_process=require('child_process');var Ve=Object.defineProperty;var Je=(s,t,e)=>t in s?Ve(s,t,{enumerable:true,configurable:true,writable:true,value:e}):s[t]=e;var l=(s,t,e)=>Je(s,typeof t!="symbol"?t+"":t,e);function Ae({onRequest:s,onSseError:t,onSseEvent:e,responseTransformer:r,responseValidator:n,sseDefaultRetryDelay:d,sseMaxRetryAttempts:p,sseMaxRetryDelay:i,sseSleepFn:a,url:m,...c}){let y,E=a??(g=>new Promise(b=>setTimeout(b,g)));return {stream:async function*(){let g=d??3e3,b=0,S=c.signal??new AbortController().signal;for(;!S.aborted;){b++;let q=c.headers instanceof Headers?c.headers:new Headers(c.headers);y!==void 0&&q.set("Last-Event-ID",y);try{let w={redirect:"follow",...c,body:c.serializedBody,headers:q,signal:S},O=new Request(m,w);s&&(O=await s(m,w));let x=await(c.fetch??globalThis.fetch)(O);if(!x.ok)throw new Error(`SSE failed: ${x.status} ${x.statusText}`);if(!x.body)throw new Error("No body in SSE response");let v=x.body.pipeThrough(new TextDecoderStream).getReader(),f="",Oe=()=>{try{v.cancel();}catch{}};S.addEventListener("abort",Oe);try{for(;;){let{done:We,value:Qe}=await v.read();if(We)break;f+=Qe,f=f.replace(/\r\n?/g,`
|
|
2
2
|
`);let De=f.split(`
|
|
3
3
|
|
|
4
4
|
`);f=De.pop()??"";for(let $e of De){let He=$e.split(`
|
|
5
5
|
`),M=[],Pe;for(let T of He)if(T.startsWith("data:"))M.push(T.replace(/^data:\s*/,""));else if(T.startsWith("event:"))Pe=T.replace(/^event:\s*/,"");else if(T.startsWith("id:"))y=T.replace(/^id:\s*/,"");else if(T.startsWith("retry:")){let Ce=Number.parseInt(T.replace(/^retry:\s*/,""),10);Number.isNaN(Ce)||(g=Ce);}let D,Ie=!1;if(M.length){let T=M.join(`
|
|
6
|
-
`);try{D=JSON.parse(T),Ie=!0;}catch{D=T;}}Ie&&(n&&await n(D),r&&(D=await r(D))),e?.({data:D,event:Pe,id:y,retry:g}),M.length&&(yield D);}}}finally{S.removeEventListener("abort",Oe),v.releaseLock();}break}catch(w){if(t?.(w),p!==void 0&&b>=p)break;let O=Math.min(g*2**(b-1),i??3e4);await E(O);}}}()}}var Ke=s=>{switch(s){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},Xe=s=>{switch(s){case "form":return ",";case "pipeDelimited":return "|";case "spaceDelimited":return "%20";default:return ","}},Ye=s=>{switch(s){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},j=({allowReserved:s,explode:t,name:e,style:r,value:n})=>{if(!t){let i=(s?n:n.map(a=>encodeURIComponent(a))).join(Xe(r));switch(r){case "label":return `.${i}`;case "matrix":return `;${e}=${i}`;case "simple":return i;default:return `${e}=${i}`}}let d=Ke(r),p=n.map(i=>r==="label"||r==="simple"?s?i:encodeURIComponent(i):P({allowReserved:s,name:e,value:i})).join(d);return r==="label"||r==="matrix"?d+p:p},P=({allowReserved:s,name:t,value:e})=>{if(e==null)return "";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return `${t}=${s?e:encodeURIComponent(e)}`},F=({allowReserved:s,explode:t,name:e,style:r,value:n,valueOnly:d})=>{if(n instanceof Date)return d?n.toISOString():`${e}=${n.toISOString()}`;if(r!=="deepObject"&&!t){let a=[];Object.entries(n).forEach(([c,y])=>{a=[...a,c,s?y:encodeURIComponent(y)];});let m=a.join(",");switch(r){case "form":return `${e}=${m}`;case "label":return `.${m}`;case "matrix":return `;${e}=${m}`;default:return m}}let p=Ye(r),i=Object.entries(n).map(([a,m])=>P({allowReserved:s,name:r==="deepObject"?`${e}[${a}]`:a,value:m})).join(p);return r==="label"||r==="matrix"?p+i:i};var Ze=/\{[^{}]+\}/g,er=({path:s,url:t})=>{let e=t,r=t.match(Ze);if(r)for(let n of r){let d=false,p=n.substring(1,n.length-1),i="simple";p.endsWith("*")&&(d=true,p=p.substring(0,p.length-1)),p.startsWith(".")?(p=p.substring(1),i="label"):p.startsWith(";")&&(p=p.substring(1),i="matrix");let a=s[p];if(a==null)continue;if(Array.isArray(a)){e=e.replace(n,j({explode:d,name:p,style:i,value:a}));continue}if(typeof a=="object"){e=e.replace(n,F({explode:d,name:p,style:i,value:a,valueOnly:true}));continue}if(i==="matrix"){e=e.replace(n,`;${P({name:p,value:a})}`);continue}let m=encodeURIComponent(i==="label"?`.${a}`:a);e=e.replace(n,m);}return e},qe=({baseUrl:s,path:t,query:e,querySerializer:r,url:n})=>{let d=n.startsWith("/")?n:`/${n}`,p=(s??"")+d;t&&(p=er({path:t,url:p}));let i=e?r(e):"";return i.startsWith("?")&&(i=i.substring(1)),i&&(p+=`?${i}`),p};function B(s){let t=s.body!==void 0;if(t&&s.bodySerializer)return "serializedBody"in s?s.serializedBody!==void 0&&s.serializedBody!==""?s.serializedBody:null:s.body!==""?s.body:null;if(t)return s.body}var Me=async(s,t)=>{let e=typeof t=="function"?await t(s):t;if(e)return s.scheme==="bearer"?`Bearer ${e}`:s.scheme==="basic"?`Basic ${btoa(e)}`:e};var N={bodySerializer:s=>JSON.stringify(s,(t,e)=>typeof e=="bigint"?e.toString():e)};var je=({parameters:s={},...t}={})=>r=>{let n=[];if(r&&typeof r=="object")for(let d in r){let p=r[d];if(p==null)continue;let i=s[d]||t;if(Array.isArray(p)){let a=j({allowReserved:i.allowReserved,explode:true,name:d,style:"form",value:p,...i.array});a&&n.push(a);}else if(typeof p=="object"){let a=F({allowReserved:i.allowReserved,explode:true,name:d,style:"deepObject",value:p,...i.object});a&&n.push(a);}else {let a=P({allowReserved:i.allowReserved,name:d,value:p});a&&n.push(a);}}return n.join("&")},Fe=s=>{if(!s)return "stream";let t=s.split(";")[0]?.trim();if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return "json";if(t==="multipart/form-data")return "formData";if(["application/","audio/","image/","video/"].some(e=>t.startsWith(e)))return "blob";if(t.startsWith("text/"))return "text"}},rr=(s,t)=>t?!!(s.headers.has(t)||s.query?.[t]||s.headers.get("Cookie")?.includes(`${t}=`)):false,Ue=async({security:s,...t})=>{for(let e of s){if(rr(t,e.name))continue;let r=await Me(e,t.auth);if(!r)continue;let n=e.name??"Authorization";switch(e.in){case "query":t.query||(t.query={}),t.query[n]=r;break;case "cookie":t.headers.append("Cookie",`${n}=${r}`);break;default:t.headers.set(n,r);break}}},W=s=>qe({baseUrl:s.baseUrl,path:s.path,query:s.query,querySerializer:typeof s.querySerializer=="function"?s.querySerializer:je(s.querySerializer),url:s.url}),Q=(s,t)=>{let e={...s,...t};return e.baseUrl?.endsWith("/")&&(e.baseUrl=e.baseUrl.substring(0,e.baseUrl.length-1)),e.headers=U(s.headers,t.headers),e},tr=s=>{let t=[];return s.forEach((e,r)=>{t.push([r,e]);}),t},U=(...s)=>{let t=new Headers;for(let e of s){if(!e)continue;let r=e instanceof Headers?tr(e):Object.entries(e);for(let[n,d]of r)if(d===null)t.delete(n);else if(Array.isArray(d))for(let p of d)t.append(n,p);else d!==void 0&&t.set(n,typeof d=="object"?JSON.stringify(d):d);}return t},I=class{constructor(){l(this,"fns",[]);}clear(){this.fns=[];}eject(t){let e=this.getInterceptorIndex(t);this.fns[e]&&(this.fns[e]=null);}exists(t){let e=this.getInterceptorIndex(t);return !!this.fns[e]}getInterceptorIndex(t){return typeof t=="number"?this.fns[t]?t:-1:this.fns.indexOf(t)}update(t,e){let r=this.getInterceptorIndex(t);return this.fns[r]?(this.fns[r]=e,t):false}use(t){return this.fns.push(t),this.fns.length-1}},Le=()=>({error:new I,request:new I,response:new I}),sr=je({allowReserved:false,array:{explode:true,style:"form"},object:{explode:true,style:"deepObject"}}),nr={"Content-Type":"application/json"},C=(s={})=>({...N,headers:nr,parseAs:"auto",querySerializer:sr,...s});var A=(s={})=>{let t=Q(C(),s),e=()=>({...t}),r=c=>(t=Q(t,c),e()),n=Le(),d=async c=>{let y={...t,...c,fetch:c.fetch??t.fetch??globalThis.fetch,headers:U(t.headers,c.headers),serializedBody:void 0};y.security&&await Ue({...y,security:y.security}),y.requestValidator&&await y.requestValidator(y),y.body!==void 0&&y.bodySerializer&&(y.serializedBody=y.bodySerializer(y.body)),(y.body===void 0||y.serializedBody==="")&&y.headers.delete("Content-Type");let E=y,k=W(E);return {opts:E,url:k}},p=async c=>{let y=c.throwOnError??t.throwOnError,E=c.responseStyle??t.responseStyle,k,h;try{let{opts:g,url:b}=await d(c),S={redirect:"follow",...g,body:B(g)};k=new Request(b,S);for(let R of n.request.fns)R&&(k=await R(k,g));let q=g.fetch;h=await q(k);for(let R of n.response.fns)R&&(h=await R(h,k,g));let w={request:k,response:h};if(h.ok){let R=(g.parseAs==="auto"?Fe(h.headers.get("Content-Type")):g.parseAs)??"json";if(h.status===204||h.headers.get("Content-Length")==="0"){let f;switch(R){case "arrayBuffer":case "blob":case "text":f=await h[R]();break;case "formData":f=new FormData;break;case "stream":f=h.body;break;default:f={};break}return g.responseStyle==="data"?f:{data:f,...w}}let v;switch(R){case "arrayBuffer":case "blob":case "formData":case "text":v=await h[R]();break;case "json":{let f=await h.text();v=f?JSON.parse(f):{};break}case "stream":return g.responseStyle==="data"?h.body:{data:h.body,...w}}return R==="json"&&(g.responseValidator&&await g.responseValidator(v),g.responseTransformer&&(v=await g.responseTransformer(v))),g.responseStyle==="data"?v:{data:v,...w}}let O=await h.text(),z;try{z=JSON.parse(O);}catch{}throw z??O}catch(g){let b=g;for(let S of n.error.fns)S&&(b=await S(b,h,k,c));if(b=b||{},y)throw b;return E==="data"?void 0:{error:b,request:k,response:h}}},i=c=>y=>p({...y,method:c}),a=c=>async y=>{let{opts:E,url:k}=await d(y);return Ae({...E,body:E.body,method:c,onRequest:async(h,g)=>{let b=new Request(h,g);for(let S of n.request.fns)S&&(b=await S(b,E));return b},serializedBody:B(E),url:k})};return {buildUrl:c=>W({...t,...c}),connect:i("CONNECT"),delete:i("DELETE"),get:i("GET"),getConfig:e,head:i("HEAD"),interceptors:n,options:i("OPTIONS"),patch:i("PATCH"),post:i("POST"),put:i("PUT"),request:p,setConfig:r,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:i("TRACE")}};var or={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},ir=Object.entries(or),Ge=(s,t)=>{t||(t=new Map);for(let e of s)"in"in e?e.key&&t.set(e.key,{in:e.in,map:e.map}):"key"in e?t.set(e.key,{map:e.map}):e.args&&Ge(e.args,t);return t},ar=s=>{for(let[t,e]of Object.entries(s))e&&typeof e=="object"&&!Array.isArray(e)&&!Object.keys(e).length&&delete s[t];},o=(s,t)=>{let e={body:{},headers:{},path:{},query:{}},r=Ge(t),n;for(let[d,p]of s.entries())if(t[d]&&(n=t[d]),!!n)if("in"in n)if(n.key){let i=r.get(n.key),a=i.map||n.key;i.in&&(e[i.in][a]=p);}else e.body=p;else for(let[i,a]of Object.entries(p??{})){let m=r.get(i);if(m)if(m.in){let c=m.map||i;e[m.in][c]=a;}else e[m.map]=a;else {let c=ir.find(([y])=>i.startsWith(y));if(c){let[y,E]=c;e[E][i.slice(y.length)]=a;}else if("allowExtra"in n&&n.allowExtra){for(let[y,E]of Object.entries(n.allowExtra))if(E){e[y][i]=a;break}}}}return ar(e),e};var _e=A(C({baseUrl:"http://localhost:4096"}));var u=class{constructor(t){l(this,"client");this.client=t?.client??_e;}},$=class{constructor(){l(this,"defaultKey","default");l(this,"instances",new Map);}get(t){let e=this.instances.get(t??this.defaultKey);if(!e)throw new Error('No SDK client found. Create one with "new EasbotClient()" to fix this error.');return e}set(t,e){this.instances.set(e??this.defaultKey,t);}},H=class extends u{get(t){return (t?.client??this.client).get({url:"/global/config",...t})}update(t,e){let r=o([t],[{args:[{key:"config",map:"body"}]}]);return (e?.client??this.client).patch({url:"/global/config",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},V=class extends u{constructor(){super(...arguments);l(this,"_config");}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})}get config(){return this._config??(this._config=new H({client:this.client}))}},J=class extends u{get(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/session/{sessionID}/contextMode",...e,...r})}set(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"mode"}]}]);return (e?.client??this.client).put({url:"/session/{sessionID}/contextMode",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},K=class extends u{constructor(){super(...arguments);l(this,"_contextMode");}event(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).sse.get({url:"/session/{sessionID}/event",...r,...n})}list(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"roots"},{in:"query",key:"start"},{in:"query",key:"search"},{in:"query",key:"limit"}]}]);return (r?.client??this.client).get({url:"/session",...r,...n})}create(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"parentID"},{in:"body",key:"title"},{in:"body",key:"permission"},{in:"body",key:"contextMode"}]}]);return (r?.client??this.client).post({url:"/session",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}status(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/status",...r,...n})}delete(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).delete({url:"/session/{sessionID}",...r,...n})}get(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}",...r,...n})}update(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"title"},{in:"body",key:"time"}]}]);return (r?.client??this.client).patch({url:"/session/{sessionID}",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}children(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/children",...r,...n})}todo(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/todo",...r,...n})}init(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"modelID"},{in:"body",key:"providerID"},{in:"body",key:"messageID"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/init",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}fork(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"contextMode"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/fork",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}abort(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/abort",...r,...n})}unshare(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).delete({url:"/session/{sessionID}/share",...r,...n})}share(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/share",...r,...n})}diff(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"messageID"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/diff",...r,...n})}summarize(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"providerID"},{in:"body",key:"modelID"},{in:"body",key:"auto"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/summarize",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}messages(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"limit"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/message",...r,...n})}prompt(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{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:"contextMode"},{in:"body",key:"parts"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/message",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}deleteMessage(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}",...r,...n})}message(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/message/{messageID}",...r,...n})}promptAsync(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"agent"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"parts"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/prompt_async",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}command(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{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:"contextMode"},{in:"body",key:"parts"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/command",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}shell(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"command"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/shell",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}revert(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"partID"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/revert",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}unrevert(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/unrevert",...r,...n})}get contextMode(){return this._contextMode??(this._contextMode=new J({client:this.client}))}},X=class extends u{event(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).sse.get({url:"/session/{sessionID}/message/{messageID}/event",...e,...r})}},Y=class extends u{remove(t,e){let r=o([t],[{args:[{in:"path",key:"providerID"}]}]);return (e?.client??this.client).delete({url:"/auth/{providerID}",...e,...r})}set(t,e){let r=o([t],[{args:[{in:"path",key:"providerID"},{key:"auth",map:"body"}]}]);return (e?.client??this.client).put({url:"/auth/{providerID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},Z=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/project",...e,...r})}current(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/project/current",...e,...r})}initGit(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return (e?.client??this.client).post({url:"/project/git/init",...e,...r})}update(t,e){let r=o([t],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"body",key:"name"},{in:"body",key:"icon"},{in:"body",key:"commands"}]}]);return (e?.client??this.client).patch({url:"/project/{projectID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},ee=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/pty",...e,...r})}create(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"body",key:"command"},{in:"body",key:"args"},{in:"body",key:"cwd"},{in:"body",key:"title"},{in:"body",key:"env"}]}]);return (e?.client??this.client).post({url:"/pty",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}remove(t,e){let r=o([t],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).delete({url:"/pty/{ptyID}",...e,...r})}get(t,e){let r=o([t],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/pty/{ptyID}",...e,...r})}update(t,e){let r=o([t],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"body",key:"title"},{in:"body",key:"size"}]}]);return (e?.client??this.client).put({url:"/pty/{ptyID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}connect(t,e){let r=o([t],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/pty/{ptyID}/connect",...e,...r})}},re=class extends u{get(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/config",...e,...r})}update(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"config",map:"body"}]}]);return (e?.client??this.client).patch({url:"/config",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}providers(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/config/providers",...e,...r})}},te=class extends u{default(t){return (t?.client??this.client).get({url:"/model/default",...t})}parse(t,e){let r=o([t],[{args:[{in:"query",key:"model"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/model/parse",...e,...r})}},se=class extends u{ids(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/experimental/tool/ids",...e,...r})}list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"provider"},{in:"query",key:"model"}]}]);return (e?.client??this.client).get({url:"/experimental/tool",...e,...r})}},ne=class extends u{remove(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"worktreeRemoveInput",map:"body"}]}]);return (e?.client??this.client).delete({url:"/experimental/worktree",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/experimental/worktree",...e,...r})}create(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"worktreeCreateInput",map:"body"}]}]);return (e?.client??this.client).post({url:"/experimental/worktree",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}reset(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"worktreeResetInput",map:"body"}]}]);return (e?.client??this.client).post({url:"/experimental/worktree/reset",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},oe=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{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 (e?.client??this.client).get({url:"/experimental/session",...e,...r})}},ie=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/experimental/resource",...e,...r})}},ae=class extends u{constructor(){super(...arguments);l(this,"_session");l(this,"_resource");}get session(){return this._session??(this._session=new oe({client:this.client}))}get resource(){return this._resource??(this._resource=new ie({client:this.client}))}},pe=class extends u{delete(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...e,...r})}update(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"},{key:"part",map:"body"}]}]);return (e?.client??this.client).patch({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},L=class extends u{respond(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"permissionID"},{in:"query",key:"directory"},{in:"body",key:"response"}]}]);return (e?.client??this.client).post({url:"/session/{sessionID}/permissions/{permissionID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}reply(t,e){let r=o([t],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"body",key:"reply"},{in:"body",key:"message"}]}]);return (e?.client??this.client).post({url:"/permission/{requestID}/reply",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/permission",...e,...r})}},le=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/question",...e,...r})}reply(t,e){let r=o([t],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"body",key:"answers"}]}]);return (e?.client??this.client).post({url:"/question/{requestID}/reply",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}reject(t,e){let r=o([t],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).post({url:"/question/{requestID}/reject",...e,...r})}},ye=class extends u{authorize(t,e){let r=o([t],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"body",key:"method"}]}]);return (e?.client??this.client).post({url:"/provider/{providerID}/oauth/authorize",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}callback(t,e){let r=o([t],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"body",key:"method"},{in:"body",key:"code"}]}]);return (e?.client??this.client).post({url:"/provider/{providerID}/oauth/callback",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},ue=class extends u{constructor(){super(...arguments);l(this,"_oauth");}list(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/provider",...r,...n})}auth(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/provider/auth",...r,...n})}get oauth(){return this._oauth??(this._oauth=new ye({client:this.client}))}},de=class extends u{text(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"pattern"}]}]);return (e?.client??this.client).get({url:"/find",...e,...r})}files(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"query"},{in:"query",key:"dirs"},{in:"query",key:"type"},{in:"query",key:"limit"}]}]);return (e?.client??this.client).get({url:"/find/file",...e,...r})}symbols(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"query"}]}]);return (e?.client??this.client).get({url:"/find/symbol",...e,...r})}},ce=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"path"}]}]);return (e?.client??this.client).get({url:"/file",...e,...r})}read(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"path"}]}]);return (e?.client??this.client).get({url:"/file/content",...e,...r})}status(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/file/status",...e,...r})}},ge=class extends u{remove(t,e){let r=o([t],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).delete({url:"/mcp/{name}/auth",...e,...r})}start(t,e){let r=o([t],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).post({url:"/mcp/{name}/auth",...e,...r})}callback(t,e){let r=o([t],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"body",key:"code"}]}]);return (e?.client??this.client).post({url:"/mcp/{name}/auth/callback",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}authenticate(t,e){let r=o([t],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).post({url:"/mcp/{name}/auth/authenticate",...e,...r})}},me=class extends u{constructor(){super(...arguments);l(this,"_auth");}status(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/mcp",...r,...n})}add(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"name"},{in:"body",key:"config"}]}]);return (r?.client??this.client).post({url:"/mcp",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}connect(e,r){let n=o([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/mcp/{name}/connect",...r,...n})}disconnect(e,r){let n=o([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/mcp/{name}/disconnect",...r,...n})}get auth(){return this._auth??(this._auth=new ge({client:this.client}))}},he=class extends u{next(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/tui/control/next",...e,...r})}response(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"body",map:"body"}]}]);return (e?.client??this.client).post({url:"/tui/control/response",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},be=class extends u{constructor(){super(...arguments);l(this,"_control");}appendPrompt(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"text"}]}]);return (r?.client??this.client).post({url:"/tui/append-prompt",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}openHelp(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/open-help",...r,...n})}openSessions(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/open-sessions",...r,...n})}openThemes(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/open-themes",...r,...n})}openModels(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/open-models",...r,...n})}submitPrompt(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/submit-prompt",...r,...n})}clearPrompt(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/clear-prompt",...r,...n})}executeCommand(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"command"}]}]);return (r?.client??this.client).post({url:"/tui/execute-command",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}showToast(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"title"},{in:"body",key:"message"},{in:"body",key:"variant"},{in:"body",key:"duration"}]}]);return (r?.client??this.client).post({url:"/tui/show-toast",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}publish(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{key:"body",map:"body"}]}]);return (r?.client??this.client).post({url:"/tui/publish",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}selectSession(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"sessionID"}]}]);return (r?.client??this.client).post({url:"/tui/select-session",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}get control(){return this._control??(this._control=new he({client:this.client}))}},Re=class extends u{dispose(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).post({url:"/instance/dispose",...e,...r})}},xe=class extends u{get(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/path",...e,...r})}},Ee=class extends u{get(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/vcs",...e,...r})}},fe=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"contextMode"}]}]);return (e?.client??this.client).get({url:"/command",...e,...r})}},ke=class extends u{log(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"body",key:"service"},{in:"body",key:"level"},{in:"body",key:"message"},{in:"body",key:"extra"}]}]);return (e?.client??this.client).post({url:"/log",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}agents(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/agent",...e,...r})}skills(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/skill",...e,...r})}},Se=class extends u{create(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"body",key:"name"},{in:"body",key:"mode"},{in:"body",key:"permission"},{in:"body",key:"description"},{in:"body",key:"prompt"},{in:"body",key:"model"},{in:"body",key:"temperature"},{in:"body",key:"topP"},{in:"body",key:"color"},{in:"body",key:"hidden"},{in:"body",key:"variant"},{in:"body",key:"steps"},{in:"body",key:"options"}]}]);return (e?.client??this.client).post({url:"/agent",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}get(t,e){let r=o([t],[{args:[{in:"path",key:"agentID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/agent/{agentID}",...e,...r})}event(t,e){let r=o([t],[{args:[{in:"path",key:"agentID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).sse.get({url:"/agent/{agentID}/event",...e,...r})}default(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/agent/default",...e,...r})}},ve=class extends u{status(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/lsp",...e,...r})}},Te=class extends u{status(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/formatter",...e,...r})}},we=class extends u{subscribe(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).sse.get({url:"/event",...e,...r})}publish(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"event",map:"body"}]}]);return (e?.client??this.client).post({url:"/event",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},_=class _ extends u{constructor(e){super(e);l(this,"_global");l(this,"_session");l(this,"_message");l(this,"_auth");l(this,"_project");l(this,"_pty");l(this,"_config");l(this,"_model");l(this,"_tool");l(this,"_worktree");l(this,"_experimental");l(this,"_part");l(this,"_permission");l(this,"_question");l(this,"_provider");l(this,"_find");l(this,"_file");l(this,"_mcp");l(this,"_tui");l(this,"_instance");l(this,"_path");l(this,"_vcs");l(this,"_command");l(this,"_app");l(this,"_agent");l(this,"_lsp");l(this,"_formatter");l(this,"_event");_.__registry.set(this,e?.key);}get global(){return this._global??(this._global=new V({client:this.client}))}get session(){return this._session??(this._session=new K({client:this.client}))}get message(){return this._message??(this._message=new X({client:this.client}))}get auth(){return this._auth??(this._auth=new Y({client:this.client}))}get project(){return this._project??(this._project=new Z({client:this.client}))}get pty(){return this._pty??(this._pty=new ee({client:this.client}))}get config(){return this._config??(this._config=new re({client:this.client}))}get model(){return this._model??(this._model=new te({client:this.client}))}get tool(){return this._tool??(this._tool=new se({client:this.client}))}get worktree(){return this._worktree??(this._worktree=new ne({client:this.client}))}get experimental(){return this._experimental??(this._experimental=new ae({client:this.client}))}get part(){return this._part??(this._part=new pe({client:this.client}))}get permission(){return this._permission??(this._permission=new L({client:this.client}))}get question(){return this._question??(this._question=new le({client:this.client}))}get provider(){return this._provider??(this._provider=new ue({client:this.client}))}get find(){return this._find??(this._find=new de({client:this.client}))}get file(){return this._file??(this._file=new ce({client:this.client}))}get mcp(){return this._mcp??(this._mcp=new me({client:this.client}))}get tui(){return this._tui??(this._tui=new be({client:this.client}))}get instance(){return this._instance??(this._instance=new Re({client:this.client}))}get path(){return this._path??(this._path=new xe({client:this.client}))}get vcs(){return this._vcs??(this._vcs=new Ee({client:this.client}))}get command(){return this._command??(this._command=new fe({client:this.client}))}get app(){return this._app??(this._app=new ke({client:this.client}))}get agent(){return this._agent??(this._agent=new Se({client:this.client}))}get lsp(){return this._lsp??(this._lsp=new ve({client:this.client}))}get formatter(){return this._formatter??(this._formatter=new Te({client:this.client}))}get event(){return this._event??(this._event=new we({client:this.client}))}};l(_,"__registry",new $);var G=_;function ze(s){if(s?.fetch||(s={...s,fetch:r=>(r.timeout=false,fetch(r))}),s?.directory){let r=/[^\x00-\x7F]/.test(s.directory)?encodeURIComponent(s.directory):s.directory;s.headers={...s.headers,"x-easbot-directory|":r};}let t=A(s);return new G({client:t})}async function Ne(s){s=Object.assign({hostname:"127.0.0.1",port:4096,timeout:5e3},s??{});let t=["serve",`--hostname=${s.hostname}`,`--port=${s.port}`];s.config?.logLevel&&t.push(`--log-level=${s.config.logLevel}`);let e=child_process.spawn("easbot",t,{signal:s.signal,env:{...process.env,EASBOT_CONFIG_CONTENT:JSON.stringify(s.config??{})}});return {url:await new Promise((n,d)=>{let p=setTimeout(()=>{d(new Error(`Timeout waiting for server to start after ${s.timeout}ms`));},s.timeout),i="";e.stdout?.on("data",a=>{i+=a.toString();let m=i.split(`
|
|
6
|
+
`);try{D=JSON.parse(T),Ie=!0;}catch{D=T;}}Ie&&(n&&await n(D),r&&(D=await r(D))),e?.({data:D,event:Pe,id:y,retry:g}),M.length&&(yield D);}}}finally{S.removeEventListener("abort",Oe),v.releaseLock();}break}catch(w){if(t?.(w),p!==void 0&&b>=p)break;let O=Math.min(g*2**(b-1),i??3e4);await E(O);}}}()}}var Ke=s=>{switch(s){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},Xe=s=>{switch(s){case "form":return ",";case "pipeDelimited":return "|";case "spaceDelimited":return "%20";default:return ","}},Ye=s=>{switch(s){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},j=({allowReserved:s,explode:t,name:e,style:r,value:n})=>{if(!t){let i=(s?n:n.map(a=>encodeURIComponent(a))).join(Xe(r));switch(r){case "label":return `.${i}`;case "matrix":return `;${e}=${i}`;case "simple":return i;default:return `${e}=${i}`}}let d=Ke(r),p=n.map(i=>r==="label"||r==="simple"?s?i:encodeURIComponent(i):P({allowReserved:s,name:e,value:i})).join(d);return r==="label"||r==="matrix"?d+p:p},P=({allowReserved:s,name:t,value:e})=>{if(e==null)return "";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return `${t}=${s?e:encodeURIComponent(e)}`},F=({allowReserved:s,explode:t,name:e,style:r,value:n,valueOnly:d})=>{if(n instanceof Date)return d?n.toISOString():`${e}=${n.toISOString()}`;if(r!=="deepObject"&&!t){let a=[];Object.entries(n).forEach(([c,y])=>{a=[...a,c,s?y:encodeURIComponent(y)];});let m=a.join(",");switch(r){case "form":return `${e}=${m}`;case "label":return `.${m}`;case "matrix":return `;${e}=${m}`;default:return m}}let p=Ye(r),i=Object.entries(n).map(([a,m])=>P({allowReserved:s,name:r==="deepObject"?`${e}[${a}]`:a,value:m})).join(p);return r==="label"||r==="matrix"?p+i:i};var Ze=/\{[^{}]+\}/g,er=({path:s,url:t})=>{let e=t,r=t.match(Ze);if(r)for(let n of r){let d=false,p=n.substring(1,n.length-1),i="simple";p.endsWith("*")&&(d=true,p=p.substring(0,p.length-1)),p.startsWith(".")?(p=p.substring(1),i="label"):p.startsWith(";")&&(p=p.substring(1),i="matrix");let a=s[p];if(a==null)continue;if(Array.isArray(a)){e=e.replace(n,j({explode:d,name:p,style:i,value:a}));continue}if(typeof a=="object"){e=e.replace(n,F({explode:d,name:p,style:i,value:a,valueOnly:true}));continue}if(i==="matrix"){e=e.replace(n,`;${P({name:p,value:a})}`);continue}let m=encodeURIComponent(i==="label"?`.${a}`:a);e=e.replace(n,m);}return e},qe=({baseUrl:s,path:t,query:e,querySerializer:r,url:n})=>{let d=n.startsWith("/")?n:`/${n}`,p=(s??"")+d;t&&(p=er({path:t,url:p}));let i=e?r(e):"";return i.startsWith("?")&&(i=i.substring(1)),i&&(p+=`?${i}`),p};function B(s){let t=s.body!==void 0;if(t&&s.bodySerializer)return "serializedBody"in s?s.serializedBody!==void 0&&s.serializedBody!==""?s.serializedBody:null:s.body!==""?s.body:null;if(t)return s.body}var Me=async(s,t)=>{let e=typeof t=="function"?await t(s):t;if(e)return s.scheme==="bearer"?`Bearer ${e}`:s.scheme==="basic"?`Basic ${btoa(e)}`:e};var N={bodySerializer:s=>JSON.stringify(s,(t,e)=>typeof e=="bigint"?e.toString():e)};var je=({parameters:s={},...t}={})=>r=>{let n=[];if(r&&typeof r=="object")for(let d in r){let p=r[d];if(p==null)continue;let i=s[d]||t;if(Array.isArray(p)){let a=j({allowReserved:i.allowReserved,explode:true,name:d,style:"form",value:p,...i.array});a&&n.push(a);}else if(typeof p=="object"){let a=F({allowReserved:i.allowReserved,explode:true,name:d,style:"deepObject",value:p,...i.object});a&&n.push(a);}else {let a=P({allowReserved:i.allowReserved,name:d,value:p});a&&n.push(a);}}return n.join("&")},Fe=s=>{if(!s)return "stream";let t=s.split(";")[0]?.trim();if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return "json";if(t==="multipart/form-data")return "formData";if(["application/","audio/","image/","video/"].some(e=>t.startsWith(e)))return "blob";if(t.startsWith("text/"))return "text"}},rr=(s,t)=>t?!!(s.headers.has(t)||s.query?.[t]||s.headers.get("Cookie")?.includes(`${t}=`)):false,Ue=async({security:s,...t})=>{for(let e of s){if(rr(t,e.name))continue;let r=await Me(e,t.auth);if(!r)continue;let n=e.name??"Authorization";switch(e.in){case "query":t.query||(t.query={}),t.query[n]=r;break;case "cookie":t.headers.append("Cookie",`${n}=${r}`);break;default:t.headers.set(n,r);break}}},W=s=>qe({baseUrl:s.baseUrl,path:s.path,query:s.query,querySerializer:typeof s.querySerializer=="function"?s.querySerializer:je(s.querySerializer),url:s.url}),Q=(s,t)=>{let e={...s,...t};return e.baseUrl?.endsWith("/")&&(e.baseUrl=e.baseUrl.substring(0,e.baseUrl.length-1)),e.headers=U(s.headers,t.headers),e},tr=s=>{let t=[];return s.forEach((e,r)=>{t.push([r,e]);}),t},U=(...s)=>{let t=new Headers;for(let e of s){if(!e)continue;let r=e instanceof Headers?tr(e):Object.entries(e);for(let[n,d]of r)if(d===null)t.delete(n);else if(Array.isArray(d))for(let p of d)t.append(n,p);else d!==void 0&&t.set(n,typeof d=="object"?JSON.stringify(d):d);}return t},I=class{constructor(){l(this,"fns",[]);}clear(){this.fns=[];}eject(t){let e=this.getInterceptorIndex(t);this.fns[e]&&(this.fns[e]=null);}exists(t){let e=this.getInterceptorIndex(t);return !!this.fns[e]}getInterceptorIndex(t){return typeof t=="number"?this.fns[t]?t:-1:this.fns.indexOf(t)}update(t,e){let r=this.getInterceptorIndex(t);return this.fns[r]?(this.fns[r]=e,t):false}use(t){return this.fns.push(t),this.fns.length-1}},Le=()=>({error:new I,request:new I,response:new I}),sr=je({allowReserved:false,array:{explode:true,style:"form"},object:{explode:true,style:"deepObject"}}),nr={"Content-Type":"application/json"},C=(s={})=>({...N,headers:nr,parseAs:"auto",querySerializer:sr,...s});var A=(s={})=>{let t=Q(C(),s),e=()=>({...t}),r=c=>(t=Q(t,c),e()),n=Le(),d=async c=>{let y={...t,...c,fetch:c.fetch??t.fetch??globalThis.fetch,headers:U(t.headers,c.headers),serializedBody:void 0};y.security&&await Ue({...y,security:y.security}),y.requestValidator&&await y.requestValidator(y),y.body!==void 0&&y.bodySerializer&&(y.serializedBody=y.bodySerializer(y.body)),(y.body===void 0||y.serializedBody==="")&&y.headers.delete("Content-Type");let E=y,k=W(E);return {opts:E,url:k}},p=async c=>{let y=c.throwOnError??t.throwOnError,E=c.responseStyle??t.responseStyle,k,h;try{let{opts:g,url:b}=await d(c),S={redirect:"follow",...g,body:B(g)};k=new Request(b,S);for(let x of n.request.fns)x&&(k=await x(k,g));let q=g.fetch;h=await q(k);for(let x of n.response.fns)x&&(h=await x(h,k,g));let w={request:k,response:h};if(h.ok){let x=(g.parseAs==="auto"?Fe(h.headers.get("Content-Type")):g.parseAs)??"json";if(h.status===204||h.headers.get("Content-Length")==="0"){let f;switch(x){case "arrayBuffer":case "blob":case "text":f=await h[x]();break;case "formData":f=new FormData;break;case "stream":f=h.body;break;default:f={};break}return g.responseStyle==="data"?f:{data:f,...w}}let v;switch(x){case "arrayBuffer":case "blob":case "formData":case "text":v=await h[x]();break;case "json":{let f=await h.text();v=f?JSON.parse(f):{};break}case "stream":return g.responseStyle==="data"?h.body:{data:h.body,...w}}return x==="json"&&(g.responseValidator&&await g.responseValidator(v),g.responseTransformer&&(v=await g.responseTransformer(v))),g.responseStyle==="data"?v:{data:v,...w}}let O=await h.text(),z;try{z=JSON.parse(O);}catch{}throw z??O}catch(g){let b=g;for(let S of n.error.fns)S&&(b=await S(b,h,k,c));if(b=b||{},y)throw b;return E==="data"?void 0:{error:b,request:k,response:h}}},i=c=>y=>p({...y,method:c}),a=c=>async y=>{let{opts:E,url:k}=await d(y);return Ae({...E,body:E.body,method:c,onRequest:async(h,g)=>{let b=new Request(h,g);for(let S of n.request.fns)S&&(b=await S(b,E));return b},serializedBody:B(E),url:k})};return {buildUrl:c=>W({...t,...c}),connect:i("CONNECT"),delete:i("DELETE"),get:i("GET"),getConfig:e,head:i("HEAD"),interceptors:n,options:i("OPTIONS"),patch:i("PATCH"),post:i("POST"),put:i("PUT"),request:p,setConfig:r,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:i("TRACE")}};var or={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},ir=Object.entries(or),Ge=(s,t)=>{t||(t=new Map);for(let e of s)"in"in e?e.key&&t.set(e.key,{in:e.in,map:e.map}):"key"in e?t.set(e.key,{map:e.map}):e.args&&Ge(e.args,t);return t},ar=s=>{for(let[t,e]of Object.entries(s))e&&typeof e=="object"&&!Array.isArray(e)&&!Object.keys(e).length&&delete s[t];},o=(s,t)=>{let e={body:{},headers:{},path:{},query:{}},r=Ge(t),n;for(let[d,p]of s.entries())if(t[d]&&(n=t[d]),!!n)if("in"in n)if(n.key){let i=r.get(n.key),a=i.map||n.key;i.in&&(e[i.in][a]=p);}else e.body=p;else for(let[i,a]of Object.entries(p??{})){let m=r.get(i);if(m)if(m.in){let c=m.map||i;e[m.in][c]=a;}else e[m.map]=a;else {let c=ir.find(([y])=>i.startsWith(y));if(c){let[y,E]=c;e[E][i.slice(y.length)]=a;}else if("allowExtra"in n&&n.allowExtra){for(let[y,E]of Object.entries(n.allowExtra))if(E){e[y][i]=a;break}}}}return ar(e),e};var _e=A(C({baseUrl:"http://localhost:4096"}));var u=class{constructor(t){l(this,"client");this.client=t?.client??_e;}},$=class{constructor(){l(this,"defaultKey","default");l(this,"instances",new Map);}get(t){let e=this.instances.get(t??this.defaultKey);if(!e)throw new Error('No SDK client found. Create one with "new EasbotClient()" to fix this error.');return e}set(t,e){this.instances.set(e??this.defaultKey,t);}},H=class extends u{get(t){return (t?.client??this.client).get({url:"/global/config",...t})}update(t,e){let r=o([t],[{args:[{key:"config",map:"body"}]}]);return (e?.client??this.client).patch({url:"/global/config",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},V=class extends u{constructor(){super(...arguments);l(this,"_config");}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})}get config(){return this._config??(this._config=new H({client:this.client}))}},J=class extends u{get(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/session/{sessionID}/contextMode",...e,...r})}set(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"mode"}]}]);return (e?.client??this.client).put({url:"/session/{sessionID}/contextMode",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},K=class extends u{constructor(){super(...arguments);l(this,"_contextMode");}event(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).sse.get({url:"/session/{sessionID}/event",...r,...n})}list(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"roots"},{in:"query",key:"start"},{in:"query",key:"search"},{in:"query",key:"limit"}]}]);return (r?.client??this.client).get({url:"/session",...r,...n})}create(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"parentID"},{in:"body",key:"title"},{in:"body",key:"permission"},{in:"body",key:"contextMode"}]}]);return (r?.client??this.client).post({url:"/session",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}status(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/status",...r,...n})}delete(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).delete({url:"/session/{sessionID}",...r,...n})}get(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}",...r,...n})}update(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"title"},{in:"body",key:"time"}]}]);return (r?.client??this.client).patch({url:"/session/{sessionID}",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}children(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/children",...r,...n})}todo(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/todo",...r,...n})}init(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"modelID"},{in:"body",key:"providerID"},{in:"body",key:"messageID"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/init",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}fork(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"contextMode"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/fork",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}abort(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/abort",...r,...n})}unshare(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).delete({url:"/session/{sessionID}/share",...r,...n})}share(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/share",...r,...n})}diff(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"messageID"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/diff",...r,...n})}summarize(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"providerID"},{in:"body",key:"modelID"},{in:"body",key:"auto"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/summarize",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}messages(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"limit"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/message",...r,...n})}prompt(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{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:"contextMode"},{in:"body",key:"parts"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/message",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}deleteMessage(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}",...r,...n})}message(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/message/{messageID}",...r,...n})}promptAsync(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"agent"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"parts"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/prompt_async",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}command(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{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:"contextMode"},{in:"body",key:"parts"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/command",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}shell(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"command"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/shell",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}revert(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"partID"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/revert",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}unrevert(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/unrevert",...r,...n})}get contextMode(){return this._contextMode??(this._contextMode=new J({client:this.client}))}},X=class extends u{event(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).sse.get({url:"/session/{sessionID}/message/{messageID}/event",...e,...r})}},Y=class extends u{remove(t,e){let r=o([t],[{args:[{in:"path",key:"providerID"}]}]);return (e?.client??this.client).delete({url:"/auth/{providerID}",...e,...r})}set(t,e){let r=o([t],[{args:[{in:"path",key:"providerID"},{key:"auth",map:"body"}]}]);return (e?.client??this.client).put({url:"/auth/{providerID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},Z=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/project",...e,...r})}current(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/project/current",...e,...r})}initGit(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return (e?.client??this.client).post({url:"/project/git/init",...e,...r})}update(t,e){let r=o([t],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"body",key:"name"},{in:"body",key:"icon"},{in:"body",key:"commands"}]}]);return (e?.client??this.client).patch({url:"/project/{projectID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},ee=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/pty",...e,...r})}create(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"body",key:"command"},{in:"body",key:"args"},{in:"body",key:"cwd"},{in:"body",key:"title"},{in:"body",key:"env"}]}]);return (e?.client??this.client).post({url:"/pty",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}remove(t,e){let r=o([t],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).delete({url:"/pty/{ptyID}",...e,...r})}get(t,e){let r=o([t],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/pty/{ptyID}",...e,...r})}update(t,e){let r=o([t],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"body",key:"title"},{in:"body",key:"size"}]}]);return (e?.client??this.client).put({url:"/pty/{ptyID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}connect(t,e){let r=o([t],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/pty/{ptyID}/connect",...e,...r})}},re=class extends u{get(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/config",...e,...r})}update(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"config",map:"body"}]}]);return (e?.client??this.client).patch({url:"/config",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}providers(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/config/providers",...e,...r})}},te=class extends u{default(t){return (t?.client??this.client).get({url:"/model/default",...t})}parse(t,e){let r=o([t],[{args:[{in:"query",key:"model"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/model/parse",...e,...r})}},se=class extends u{ids(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/experimental/tool/ids",...e,...r})}list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"provider"},{in:"query",key:"model"}]}]);return (e?.client??this.client).get({url:"/experimental/tool",...e,...r})}},ne=class extends u{remove(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"worktreeRemoveInput",map:"body"}]}]);return (e?.client??this.client).delete({url:"/experimental/worktree",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/experimental/worktree",...e,...r})}create(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"worktreeCreateInput",map:"body"}]}]);return (e?.client??this.client).post({url:"/experimental/worktree",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}reset(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"worktreeResetInput",map:"body"}]}]);return (e?.client??this.client).post({url:"/experimental/worktree/reset",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},oe=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{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 (e?.client??this.client).get({url:"/experimental/session",...e,...r})}},ie=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/experimental/resource",...e,...r})}},ae=class extends u{constructor(){super(...arguments);l(this,"_session");l(this,"_resource");}get session(){return this._session??(this._session=new oe({client:this.client}))}get resource(){return this._resource??(this._resource=new ie({client:this.client}))}},pe=class extends u{delete(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...e,...r})}update(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"},{key:"part",map:"body"}]}]);return (e?.client??this.client).patch({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},L=class extends u{respond(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"permissionID"},{in:"query",key:"directory"},{in:"body",key:"response"}]}]);return (e?.client??this.client).post({url:"/session/{sessionID}/permissions/{permissionID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}reply(t,e){let r=o([t],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"body",key:"reply"},{in:"body",key:"message"}]}]);return (e?.client??this.client).post({url:"/permission/{requestID}/reply",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/permission",...e,...r})}},le=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/question",...e,...r})}reply(t,e){let r=o([t],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"body",key:"answers"}]}]);return (e?.client??this.client).post({url:"/question/{requestID}/reply",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}reject(t,e){let r=o([t],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).post({url:"/question/{requestID}/reject",...e,...r})}},ye=class extends u{authorize(t,e){let r=o([t],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"body",key:"method"}]}]);return (e?.client??this.client).post({url:"/provider/{providerID}/oauth/authorize",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}callback(t,e){let r=o([t],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"body",key:"method"},{in:"body",key:"code"}]}]);return (e?.client??this.client).post({url:"/provider/{providerID}/oauth/callback",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},ue=class extends u{constructor(){super(...arguments);l(this,"_oauth");}list(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/provider",...r,...n})}auth(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/provider/auth",...r,...n})}get oauth(){return this._oauth??(this._oauth=new ye({client:this.client}))}},de=class extends u{text(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"pattern"}]}]);return (e?.client??this.client).get({url:"/find",...e,...r})}files(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"query"},{in:"query",key:"dirs"},{in:"query",key:"type"},{in:"query",key:"limit"}]}]);return (e?.client??this.client).get({url:"/find/file",...e,...r})}symbols(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"query"}]}]);return (e?.client??this.client).get({url:"/find/symbol",...e,...r})}},ce=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"path"}]}]);return (e?.client??this.client).get({url:"/file",...e,...r})}read(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"path"}]}]);return (e?.client??this.client).get({url:"/file/content",...e,...r})}status(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/file/status",...e,...r})}},ge=class extends u{remove(t,e){let r=o([t],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).delete({url:"/mcp/{name}/auth",...e,...r})}start(t,e){let r=o([t],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).post({url:"/mcp/{name}/auth",...e,...r})}callback(t,e){let r=o([t],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"body",key:"code"}]}]);return (e?.client??this.client).post({url:"/mcp/{name}/auth/callback",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}authenticate(t,e){let r=o([t],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).post({url:"/mcp/{name}/auth/authenticate",...e,...r})}},me=class extends u{constructor(){super(...arguments);l(this,"_auth");}status(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/mcp",...r,...n})}add(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"name"},{in:"body",key:"config"}]}]);return (r?.client??this.client).post({url:"/mcp",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}connect(e,r){let n=o([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/mcp/{name}/connect",...r,...n})}disconnect(e,r){let n=o([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/mcp/{name}/disconnect",...r,...n})}get auth(){return this._auth??(this._auth=new ge({client:this.client}))}},he=class extends u{next(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/tui/control/next",...e,...r})}response(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"body",map:"body"}]}]);return (e?.client??this.client).post({url:"/tui/control/response",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},be=class extends u{constructor(){super(...arguments);l(this,"_control");}appendPrompt(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"text"}]}]);return (r?.client??this.client).post({url:"/tui/append-prompt",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}openHelp(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/open-help",...r,...n})}openSessions(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/open-sessions",...r,...n})}openThemes(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/open-themes",...r,...n})}openModels(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/open-models",...r,...n})}submitPrompt(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/submit-prompt",...r,...n})}clearPrompt(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/clear-prompt",...r,...n})}executeCommand(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"command"}]}]);return (r?.client??this.client).post({url:"/tui/execute-command",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}showToast(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"title"},{in:"body",key:"message"},{in:"body",key:"variant"},{in:"body",key:"duration"}]}]);return (r?.client??this.client).post({url:"/tui/show-toast",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}publish(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{key:"body",map:"body"}]}]);return (r?.client??this.client).post({url:"/tui/publish",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}selectSession(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"sessionID"}]}]);return (r?.client??this.client).post({url:"/tui/select-session",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}get control(){return this._control??(this._control=new he({client:this.client}))}},xe=class extends u{dispose(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).post({url:"/instance/dispose",...e,...r})}},Re=class extends u{get(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/path",...e,...r})}},Ee=class extends u{get(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/vcs",...e,...r})}},fe=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"contextMode"}]}]);return (e?.client??this.client).get({url:"/command",...e,...r})}},ke=class extends u{log(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"body",key:"service"},{in:"body",key:"level"},{in:"body",key:"message"},{in:"body",key:"extra"}]}]);return (e?.client??this.client).post({url:"/log",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}agents(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/agent",...e,...r})}skills(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/skill",...e,...r})}context(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/context",...e,...r})}},Se=class extends u{create(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"body",key:"name"},{in:"body",key:"mode"},{in:"body",key:"permission"},{in:"body",key:"description"},{in:"body",key:"prompt"},{in:"body",key:"model"},{in:"body",key:"temperature"},{in:"body",key:"topP"},{in:"body",key:"color"},{in:"body",key:"hidden"},{in:"body",key:"variant"},{in:"body",key:"steps"},{in:"body",key:"options"}]}]);return (e?.client??this.client).post({url:"/agent",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}get(t,e){let r=o([t],[{args:[{in:"path",key:"agentID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/agent/{agentID}",...e,...r})}event(t,e){let r=o([t],[{args:[{in:"path",key:"agentID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).sse.get({url:"/agent/{agentID}/event",...e,...r})}default(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/agent/default",...e,...r})}},ve=class extends u{status(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/lsp",...e,...r})}},Te=class extends u{status(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/formatter",...e,...r})}},we=class extends u{subscribe(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).sse.get({url:"/event",...e,...r})}publish(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"event",map:"body"}]}]);return (e?.client??this.client).post({url:"/event",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},_=class _ extends u{constructor(e){super(e);l(this,"_global");l(this,"_session");l(this,"_message");l(this,"_auth");l(this,"_project");l(this,"_pty");l(this,"_config");l(this,"_model");l(this,"_tool");l(this,"_worktree");l(this,"_experimental");l(this,"_part");l(this,"_permission");l(this,"_question");l(this,"_provider");l(this,"_find");l(this,"_file");l(this,"_mcp");l(this,"_tui");l(this,"_instance");l(this,"_path");l(this,"_vcs");l(this,"_command");l(this,"_app");l(this,"_agent");l(this,"_lsp");l(this,"_formatter");l(this,"_event");_.__registry.set(this,e?.key);}get global(){return this._global??(this._global=new V({client:this.client}))}get session(){return this._session??(this._session=new K({client:this.client}))}get message(){return this._message??(this._message=new X({client:this.client}))}get auth(){return this._auth??(this._auth=new Y({client:this.client}))}get project(){return this._project??(this._project=new Z({client:this.client}))}get pty(){return this._pty??(this._pty=new ee({client:this.client}))}get config(){return this._config??(this._config=new re({client:this.client}))}get model(){return this._model??(this._model=new te({client:this.client}))}get tool(){return this._tool??(this._tool=new se({client:this.client}))}get worktree(){return this._worktree??(this._worktree=new ne({client:this.client}))}get experimental(){return this._experimental??(this._experimental=new ae({client:this.client}))}get part(){return this._part??(this._part=new pe({client:this.client}))}get permission(){return this._permission??(this._permission=new L({client:this.client}))}get question(){return this._question??(this._question=new le({client:this.client}))}get provider(){return this._provider??(this._provider=new ue({client:this.client}))}get find(){return this._find??(this._find=new de({client:this.client}))}get file(){return this._file??(this._file=new ce({client:this.client}))}get mcp(){return this._mcp??(this._mcp=new me({client:this.client}))}get tui(){return this._tui??(this._tui=new be({client:this.client}))}get instance(){return this._instance??(this._instance=new xe({client:this.client}))}get path(){return this._path??(this._path=new Re({client:this.client}))}get vcs(){return this._vcs??(this._vcs=new Ee({client:this.client}))}get command(){return this._command??(this._command=new fe({client:this.client}))}get app(){return this._app??(this._app=new ke({client:this.client}))}get agent(){return this._agent??(this._agent=new Se({client:this.client}))}get lsp(){return this._lsp??(this._lsp=new ve({client:this.client}))}get formatter(){return this._formatter??(this._formatter=new Te({client:this.client}))}get event(){return this._event??(this._event=new we({client:this.client}))}};l(_,"__registry",new $);var G=_;function ze(s){if(s?.fetch||(s={...s,fetch:r=>(r.timeout=false,fetch(r))}),s?.directory){let r=/[^\x00-\x7F]/.test(s.directory)?encodeURIComponent(s.directory):s.directory;s.headers={...s.headers,"x-easbot-directory|":r};}let t=A(s);return new G({client:t})}async function Ne(s){s=Object.assign({hostname:"127.0.0.1",port:4096,timeout:5e3},s??{});let t=["serve",`--hostname=${s.hostname}`,`--port=${s.port}`];s.config?.logLevel&&t.push(`--log-level=${s.config.logLevel}`);let e=child_process.spawn("easbot",t,{signal:s.signal,env:{...process.env,EASBOT_CONFIG_CONTENT:JSON.stringify(s.config??{})}});return {url:await new Promise((n,d)=>{let p=setTimeout(()=>{d(new Error(`Timeout waiting for server to start after ${s.timeout}ms`));},s.timeout),i="";e.stdout?.on("data",a=>{i+=a.toString();let m=i.split(`
|
|
7
7
|
`);for(let c of m)if(c.startsWith("easbot server listening")){let y=c.match(/on\s+(https?:\/\/[^\s]+)/);if(!y)throw new Error(`Failed to parse server url from output: ${c}`);clearTimeout(p),n(y[1]);return}}),e.stderr?.on("data",a=>{i+=a.toString();}),e.on("exit",a=>{clearTimeout(p);let m=`Server exited with code ${a}`;i.trim()&&(m+=`
|
|
8
8
|
Server output: ${i}`),d(new Error(m));}),e.on("error",a=>{clearTimeout(p),d(a);}),s.signal&&s.signal.addEventListener("abort",()=>{clearTimeout(p),d(new Error("Aborted"));});}),close(){e.kill();}}}function yt(s){let t=[];s?.project&&t.push(`--project=${s.project}`),s?.model&&t.push(`--model=${s.model}`),s?.session&&t.push(`--session=${s.session}`),s?.agent&&t.push(`--agent=${s.agent}`);let e=child_process.spawn("easbot",t,{signal:s?.signal,stdio:"inherit",env:{...process.env,EASBOT_CONFIG_CONTENT:JSON.stringify(s?.config??{})}});return {close(){e.kill();}}}async function mt(s){let t=await Ne({...s});return {client:ze({baseUrl:t.url}),server:t}}exports.EasbotClient=G;exports.Permission=L;exports.createEasbotClient=ze;exports.createEasbotServer=Ne;exports.createEascode=mt;exports.createEascodeTui=yt;
|
package/dist/index.d.cts
CHANGED
|
@@ -3512,6 +3512,32 @@ type AppSkillsResponses = {
|
|
|
3512
3512
|
}>;
|
|
3513
3513
|
};
|
|
3514
3514
|
type AppSkillsResponse = AppSkillsResponses[keyof AppSkillsResponses];
|
|
3515
|
+
type AppContextData = {
|
|
3516
|
+
body?: never;
|
|
3517
|
+
path?: never;
|
|
3518
|
+
query?: {
|
|
3519
|
+
directory?: string;
|
|
3520
|
+
};
|
|
3521
|
+
url: '/context';
|
|
3522
|
+
};
|
|
3523
|
+
type AppContextResponses = {
|
|
3524
|
+
200: {
|
|
3525
|
+
protocolMetadata: {
|
|
3526
|
+
agentId?: string;
|
|
3527
|
+
workspace: string;
|
|
3528
|
+
name: string;
|
|
3529
|
+
userName: string;
|
|
3530
|
+
mission: string;
|
|
3531
|
+
preferredName?: string;
|
|
3532
|
+
coreRelationship?: string;
|
|
3533
|
+
coreValues?: Array<string>;
|
|
3534
|
+
behaviorStyle?: string;
|
|
3535
|
+
decisionPrinciples?: Array<string>;
|
|
3536
|
+
};
|
|
3537
|
+
protocolInitialized: boolean;
|
|
3538
|
+
};
|
|
3539
|
+
};
|
|
3540
|
+
type AppContextResponse = AppContextResponses[keyof AppContextResponses];
|
|
3515
3541
|
type LspStatusData = {
|
|
3516
3542
|
body?: never;
|
|
3517
3543
|
path?: never;
|
|
@@ -4300,6 +4326,9 @@ declare class App extends HeyApiClient {
|
|
|
4300
4326
|
skills<ThrowOnError extends boolean = false>(parameters?: {
|
|
4301
4327
|
directory?: string;
|
|
4302
4328
|
}, options?: Options<never, ThrowOnError>): RequestResult<AppSkillsResponses, unknown, ThrowOnError, "fields">;
|
|
4329
|
+
context<ThrowOnError extends boolean = false>(parameters?: {
|
|
4330
|
+
directory?: string;
|
|
4331
|
+
}, options?: Options<never, ThrowOnError>): RequestResult<AppContextResponses, unknown, ThrowOnError, "fields">;
|
|
4303
4332
|
}
|
|
4304
4333
|
declare class Agent extends HeyApiClient {
|
|
4305
4334
|
create<ThrowOnError extends boolean = false>(parameters: {
|
|
@@ -4455,4 +4484,4 @@ declare function createEascode(options?: ServerOptions): Promise<{
|
|
|
4455
4484
|
};
|
|
4456
4485
|
}>;
|
|
4457
4486
|
|
|
4458
|
-
export { type Agent$1 as Agent, type AgentConfig, type AgentCreateData, type AgentCreateError, type AgentCreateErrors, type AgentCreateResponse, type AgentCreateResponses, type AgentDefaultData, type AgentDefaultError, type AgentDefaultErrors, type AgentDefaultResponse, type AgentDefaultResponses, type AgentEvent, type AgentEventData, type AgentEventResponse, type AgentEventResponses, type AgentGetData, type AgentGetError, type AgentGetErrors, type AgentGetResponse, type AgentGetResponses, type AgentPart, type AgentPartInput, type ApiAuth, type ApiError, type AppAgentsData, type AppAgentsResponse, type AppAgentsResponses, type AppLogData, type AppLogError, type AppLogErrors, type AppLogResponse, type AppLogResponses, type AppSkillsData, type AppSkillsResponse, type AppSkillsResponses, type AssistantMessage, type Auth$2 as Auth, type AuthRemoveData, type AuthRemoveError, type AuthRemoveErrors, type AuthRemoveResponse, type AuthRemoveResponses, type AuthSetData, type AuthSetError, type AuthSetErrors, type AuthSetResponse, type AuthSetResponses, type BadRequestError, type ClientOptions$1 as ClientOptions, type Command$1 as Command, type CommandListData, type CommandListResponse, type CommandListResponses, type CompactionPart, type Config$3 as Config, type ConfigGetData, type ConfigGetResponse, type ConfigGetResponses, type ConfigProvidersData, type ConfigProvidersResponse, type ConfigProvidersResponses, type ConfigUpdateData, type ConfigUpdateError, type ConfigUpdateErrors, type ConfigUpdateResponse, type ConfigUpdateResponses, type ContextMode$1 as ContextMode, type ContextOverflowError, EasbotClient, type Config$1 as EasbotClientConfig, type Event, type EventCommandExecuted, type EventFileEdited, type EventFileWatcherUpdated, type EventGlobalDisposed, type EventInstallationUpdateAvailable, type EventInstallationUpdated, type EventLspClientDiagnostics, type EventLspUpdated, type EventMcpBrowserOpenFailed, type EventMcpToolsChanged, type EventMessagePartRemoved, type EventMessagePartUpdated, type EventMessageRemoved, type EventMessageUpdated, type EventPermissionAsked, type EventPermissionReplied, type EventProjectUpdated, type EventPtyCreated, type EventPtyDeleted, type EventPtyExited, type EventPtyUpdated, type EventPublishData, type EventPublishResponse, type EventPublishResponses, type EventQuestionAsked, type EventQuestionRejected, type EventQuestionReplied, type EventServerConnected, type EventServerInstanceDisposed, type EventSessionCompacted, type EventSessionCreated, type EventSessionDeleted, type EventSessionDiff, type EventSessionError, type EventSessionIdle, type EventSessionStatus, type EventSessionUpdated, type EventSubscribeData, type EventSubscribeResponse, type EventSubscribeResponses, type EventTodoUpdated, type EventTuiCommandExecute, type EventTuiPromptAppend, type EventTuiSessionSelect, type EventTuiToastShow, type EventVcsBranchUpdated, type EventWorkspaceFailed, type EventWorkspaceReady, type EventWorktreeFailed, type EventWorktreeReady, type ExperimentalResourceListData, type ExperimentalResourceListResponse, type ExperimentalResourceListResponses, type ExperimentalSessionListData, type ExperimentalSessionListResponse, type ExperimentalSessionListResponses, type File, type FileContent, type FileDiff, type FileListData, type FileListResponse, type FileListResponses, type FileNode, type FilePart, type FilePartInput, type FilePartSource, type FilePartSourceText, type FileReadData, type FileReadResponse, type FileReadResponses, type FileSource, type FileStatusData, type FileStatusResponse, type FileStatusResponses, type FindFilesData, type FindFilesResponse, type FindFilesResponses, type FindSymbolsData, type FindSymbolsResponse, type FindSymbolsResponses, type FindTextData, type FindTextResponse, type FindTextResponses, type FormatterStatus, type FormatterStatusData, type FormatterStatusResponse, type FormatterStatusResponses, type GlobalConfigGetData, type GlobalConfigGetResponse, type GlobalConfigGetResponses, type GlobalConfigUpdateData, type GlobalConfigUpdateError, type GlobalConfigUpdateErrors, type GlobalConfigUpdateResponse, type GlobalConfigUpdateResponses, type GlobalDisposeData, type GlobalDisposeResponse, type GlobalDisposeResponses, type GlobalEvent, type GlobalEventData, type GlobalEventResponse, type GlobalEventResponses, type GlobalHealthData, type GlobalHealthResponse, type GlobalHealthResponses, type GlobalSession, type ImagePartInput, type InstanceDisposeData, type InstanceDisposeResponse, type InstanceDisposeResponses, type JsonSchema, type LayoutConfig, type LogLevel, type LspStatus, type LspStatusData, type LspStatusResponse, type LspStatusResponses, type McpAddData, type McpAddError, type McpAddErrors, type McpAddResponse, type McpAddResponses, type McpAuthAuthenticateData, type McpAuthAuthenticateError, type McpAuthAuthenticateErrors, type McpAuthAuthenticateResponse, type McpAuthAuthenticateResponses, type McpAuthCallbackData, type McpAuthCallbackError, type McpAuthCallbackErrors, type McpAuthCallbackResponse, type McpAuthCallbackResponses, type McpAuthRemoveData, type McpAuthRemoveError, type McpAuthRemoveErrors, type McpAuthRemoveResponse, type McpAuthRemoveResponses, type McpAuthStartData, type McpAuthStartError, type McpAuthStartErrors, type McpAuthStartResponse, type McpAuthStartResponses, type McpConnectData, type McpConnectResponse, type McpConnectResponses, type McpDisconnectData, type McpDisconnectResponse, type McpDisconnectResponses, type McpLocalConfig, type McpOAuthConfig, type McpRemoteConfig, type McpResource, type McpStatus, type McpStatusConnected, type McpStatusData, type McpStatusDisabled, type McpStatusFailed, type McpStatusNeedsAuth, type McpStatusNeedsClientRegistration, type McpStatusResponse, type McpStatusResponses, type MemoryPart, type MemoryPartInput, type Message$1 as Message, type MessageAbortedError, type MessageEvent, type MessageEventData, type MessageEventResponse, type MessageEventResponses, type MessageOutputLengthError, type Model$1 as Model, type ModelDefaultData, type ModelDefaultError, type ModelDefaultErrors, type ModelDefaultResponse, type ModelDefaultResponses, type ModelParseData, type ModelParseError, type ModelParseErrors, type ModelParseResponse, type ModelParseResponses, type NotFoundError, type OAuth, type OutputFormat, type OutputFormatJsonSchema, type OutputFormatText, type Part$1 as Part, type PartDeleteData, type PartDeleteError, type PartDeleteErrors, type PartDeleteResponse, type PartDeleteResponses, type PartUpdateData, type PartUpdateError, type PartUpdateErrors, type PartUpdateResponse, type PartUpdateResponses, type PatchPart, type Path$1 as Path, type PathGetData, type PathGetResponse, type PathGetResponses, Permission, type PermissionAction, type PermissionActionConfig, type PermissionConfig, type PermissionListData, type PermissionListResponse, type PermissionListResponses, type PermissionObjectConfig, type PermissionReplyData, type PermissionReplyError, type PermissionReplyErrors, type PermissionReplyResponse, type PermissionReplyResponses, type PermissionRequest, type PermissionRespondData, type PermissionRespondError, type PermissionRespondErrors, type PermissionRespondResponse, type PermissionRespondResponses, type PermissionRule, type PermissionRuleConfig, type PermissionRuleset, type Project$1 as Project, type ProjectCurrentData, type ProjectCurrentResponse, type ProjectCurrentResponses, type ProjectInitGitData, type ProjectInitGitResponse, type ProjectInitGitResponses, type ProjectListData, type ProjectListResponse, type ProjectListResponses, type ProjectSummary, type ProjectUpdateData, type ProjectUpdateError, type ProjectUpdateErrors, type ProjectUpdateResponse, type ProjectUpdateResponses, type Provider$1 as Provider, type ProviderAuthAuthorization, type ProviderAuthData, type ProviderAuthError, type ProviderAuthMethod, type ProviderAuthResponse, type ProviderAuthResponses, type ProviderConfig, type ProviderListData, type ProviderListResponse, type ProviderListResponses, type ProviderOauthAuthorizeData, type ProviderOauthAuthorizeError, type ProviderOauthAuthorizeErrors, type ProviderOauthAuthorizeResponse, type ProviderOauthAuthorizeResponses, type ProviderOauthCallbackData, type ProviderOauthCallbackError, type ProviderOauthCallbackErrors, type ProviderOauthCallbackResponse, type ProviderOauthCallbackResponses, type Pty$1 as Pty, type PtyConnectData, type PtyConnectError, type PtyConnectErrors, type PtyConnectResponse, type PtyConnectResponses, type PtyCreateData, type PtyCreateError, type PtyCreateErrors, type PtyCreateResponse, type PtyCreateResponses, type PtyGetData, type PtyGetError, type PtyGetErrors, type PtyGetResponse, type PtyGetResponses, type PtyListData, type PtyListResponse, type PtyListResponses, type PtyRemoveData, type PtyRemoveError, type PtyRemoveErrors, type PtyRemoveResponse, type PtyRemoveResponses, type PtyUpdateData, type PtyUpdateError, type PtyUpdateErrors, type PtyUpdateResponse, type PtyUpdateResponses, type QuestionAnswer, type QuestionInfo, type QuestionListData, type QuestionListResponse, type QuestionListResponses, type QuestionOption, type QuestionRejectData, type QuestionRejectError, type QuestionRejectErrors, type QuestionRejectResponse, type QuestionRejectResponses, type QuestionReplyData, type QuestionReplyError, type QuestionReplyErrors, type QuestionReplyResponse, type QuestionReplyResponses, type QuestionRequest, type Range, type ReasoningPart, type ResourcePartInput, type ResourceSource, type RetryPart, type ServerConfig, type ServerOptions, type Session$1 as Session, type SessionAbortData, type SessionAbortError, type SessionAbortErrors, type SessionAbortResponse, type SessionAbortResponses, type SessionChildrenData, type SessionChildrenError, type SessionChildrenErrors, type SessionChildrenResponse, type SessionChildrenResponses, type SessionCommandData, type SessionCommandError, type SessionCommandErrors, type SessionCommandResponse, type SessionCommandResponses, type SessionContextModeGetData, type SessionContextModeGetError, type SessionContextModeGetErrors, type SessionContextModeGetResponse, type SessionContextModeGetResponses, type SessionContextModeSetData, type SessionContextModeSetError, type SessionContextModeSetErrors, type SessionContextModeSetResponse, type SessionContextModeSetResponses, type SessionCreateData, type SessionCreateError, type SessionCreateErrors, type SessionCreateResponse, type SessionCreateResponses, type SessionDeleteData, type SessionDeleteError, type SessionDeleteErrors, type SessionDeleteMessageData, type SessionDeleteMessageError, type SessionDeleteMessageErrors, type SessionDeleteMessageResponse, type SessionDeleteMessageResponses, type SessionDeleteResponse, type SessionDeleteResponses, type SessionDiffData, type SessionDiffResponse, type SessionDiffResponses, type SessionEvent, type SessionEventData, type SessionEventResponse, type SessionEventResponses, type SessionForkData, type SessionForkResponse, type SessionForkResponses, type SessionGetData, type SessionGetError, type SessionGetErrors, type SessionGetResponse, type SessionGetResponses, type SessionInitData, type SessionInitError, type SessionInitErrors, type SessionInitResponse, type SessionInitResponses, type SessionListData, type SessionListResponse, type SessionListResponses, type SessionMessageData, type SessionMessageError, type SessionMessageErrors, type SessionMessageResponse, type SessionMessageResponses, type SessionMessagesData, type SessionMessagesError, type SessionMessagesErrors, type SessionMessagesResponse, type SessionMessagesResponses, type SessionPromptAsyncData, type SessionPromptAsyncError, type SessionPromptAsyncErrors, type SessionPromptAsyncResponse, type SessionPromptAsyncResponses, type SessionPromptData, type SessionPromptError, type SessionPromptErrors, type SessionPromptResponse, type SessionPromptResponses, type SessionRevertData, type SessionRevertError, type SessionRevertErrors, type SessionRevertResponse, type SessionRevertResponses, type SessionShareData, type SessionShareError, type SessionShareErrors, type SessionShareResponse, type SessionShareResponses, type SessionShellData, type SessionShellError, type SessionShellErrors, type SessionShellResponse, type SessionShellResponses, type SessionStatus, type SessionStatusData, type SessionStatusError, type SessionStatusErrors, type SessionStatusResponse, type SessionStatusResponses, type SessionSummarizeData, type SessionSummarizeError, type SessionSummarizeErrors, type SessionSummarizeResponse, type SessionSummarizeResponses, type SessionTodoData, type SessionTodoError, type SessionTodoErrors, type SessionTodoResponse, type SessionTodoResponses, type SessionUnrevertData, type SessionUnrevertError, type SessionUnrevertErrors, type SessionUnrevertResponse, type SessionUnrevertResponses, type SessionUnshareData, type SessionUnshareError, type SessionUnshareErrors, type SessionUnshareResponse, type SessionUnshareResponses, type SessionUpdateData, type SessionUpdateError, type SessionUpdateErrors, type SessionUpdateResponse, type SessionUpdateResponses, type SnapshotPart, type StepFinishPart, type StepStartPart, type StructuredOutputError, type SubtaskPart, type SubtaskPartInput, type SubtaskResultPart, type SubtaskResultPartInput, type Symbol, type SymbolSource, type TextPart, type TextPartInput, type Todo, type ToolIds, type ToolIdsData, type ToolIdsError, type ToolIdsErrors, type ToolIdsResponse, type ToolIdsResponses, type ToolList, type ToolListData, type ToolListError, type ToolListErrors, type ToolListItem, type ToolListResponse, type ToolListResponses, type ToolPart, type ToolState, type ToolStateCompleted, type ToolStateError, type ToolStatePending, type ToolStateRunning, type TuiAppendPromptData, type TuiAppendPromptError, type TuiAppendPromptErrors, type TuiAppendPromptResponse, type TuiAppendPromptResponses, type TuiClearPromptData, type TuiClearPromptResponse, type TuiClearPromptResponses, type TuiControlNextData, type TuiControlNextResponse, type TuiControlNextResponses, type TuiControlResponseData, type TuiControlResponseResponse, type TuiControlResponseResponses, type TuiExecuteCommandData, type TuiExecuteCommandError, type TuiExecuteCommandErrors, type TuiExecuteCommandResponse, type TuiExecuteCommandResponses, type TuiOpenHelpData, type TuiOpenHelpResponse, type TuiOpenHelpResponses, type TuiOpenModelsData, type TuiOpenModelsResponse, type TuiOpenModelsResponses, type TuiOpenSessionsData, type TuiOpenSessionsResponse, type TuiOpenSessionsResponses, type TuiOpenThemesData, type TuiOpenThemesResponse, type TuiOpenThemesResponses, type TuiOptions, type TuiPublishData, type TuiPublishError, type TuiPublishErrors, type TuiPublishResponse, type TuiPublishResponses, type TuiSelectSessionData, type TuiSelectSessionError, type TuiSelectSessionErrors, type TuiSelectSessionResponse, type TuiSelectSessionResponses, type TuiShowToastData, type TuiShowToastResponse, type TuiShowToastResponses, type TuiSubmitPromptData, type TuiSubmitPromptResponse, type TuiSubmitPromptResponses, type UnknownError, type UserMessage, type VcsGetData, type VcsGetResponse, type VcsGetResponses, type VcsInfo, type WellKnownAuth, type Workspace, type Worktree$1 as Worktree, type WorktreeCreateData, type WorktreeCreateError, type WorktreeCreateErrors, type WorktreeCreateInput, type WorktreeCreateResponse, type WorktreeCreateResponses, type WorktreeListData, type WorktreeListResponse, type WorktreeListResponses, type WorktreeRemoveData, type WorktreeRemoveError, type WorktreeRemoveErrors, type WorktreeRemoveInput, type WorktreeRemoveResponse, type WorktreeRemoveResponses, type WorktreeResetData, type WorktreeResetError, type WorktreeResetErrors, type WorktreeResetInput, type WorktreeResetResponse, type WorktreeResetResponses, createEasbotClient, createEasbotServer, createEascode, createEascodeTui };
|
|
4487
|
+
export { type Agent$1 as Agent, type AgentConfig, type AgentCreateData, type AgentCreateError, type AgentCreateErrors, type AgentCreateResponse, type AgentCreateResponses, type AgentDefaultData, type AgentDefaultError, type AgentDefaultErrors, type AgentDefaultResponse, type AgentDefaultResponses, type AgentEvent, type AgentEventData, type AgentEventResponse, type AgentEventResponses, type AgentGetData, type AgentGetError, type AgentGetErrors, type AgentGetResponse, type AgentGetResponses, type AgentPart, type AgentPartInput, type ApiAuth, type ApiError, type AppAgentsData, type AppAgentsResponse, type AppAgentsResponses, type AppContextData, type AppContextResponse, type AppContextResponses, type AppLogData, type AppLogError, type AppLogErrors, type AppLogResponse, type AppLogResponses, type AppSkillsData, type AppSkillsResponse, type AppSkillsResponses, type AssistantMessage, type Auth$2 as Auth, type AuthRemoveData, type AuthRemoveError, type AuthRemoveErrors, type AuthRemoveResponse, type AuthRemoveResponses, type AuthSetData, type AuthSetError, type AuthSetErrors, type AuthSetResponse, type AuthSetResponses, type BadRequestError, type ClientOptions$1 as ClientOptions, type Command$1 as Command, type CommandListData, type CommandListResponse, type CommandListResponses, type CompactionPart, type Config$3 as Config, type ConfigGetData, type ConfigGetResponse, type ConfigGetResponses, type ConfigProvidersData, type ConfigProvidersResponse, type ConfigProvidersResponses, type ConfigUpdateData, type ConfigUpdateError, type ConfigUpdateErrors, type ConfigUpdateResponse, type ConfigUpdateResponses, type ContextMode$1 as ContextMode, type ContextOverflowError, EasbotClient, type Config$1 as EasbotClientConfig, type Event, type EventCommandExecuted, type EventFileEdited, type EventFileWatcherUpdated, type EventGlobalDisposed, type EventInstallationUpdateAvailable, type EventInstallationUpdated, type EventLspClientDiagnostics, type EventLspUpdated, type EventMcpBrowserOpenFailed, type EventMcpToolsChanged, type EventMessagePartRemoved, type EventMessagePartUpdated, type EventMessageRemoved, type EventMessageUpdated, type EventPermissionAsked, type EventPermissionReplied, type EventProjectUpdated, type EventPtyCreated, type EventPtyDeleted, type EventPtyExited, type EventPtyUpdated, type EventPublishData, type EventPublishResponse, type EventPublishResponses, type EventQuestionAsked, type EventQuestionRejected, type EventQuestionReplied, type EventServerConnected, type EventServerInstanceDisposed, type EventSessionCompacted, type EventSessionCreated, type EventSessionDeleted, type EventSessionDiff, type EventSessionError, type EventSessionIdle, type EventSessionStatus, type EventSessionUpdated, type EventSubscribeData, type EventSubscribeResponse, type EventSubscribeResponses, type EventTodoUpdated, type EventTuiCommandExecute, type EventTuiPromptAppend, type EventTuiSessionSelect, type EventTuiToastShow, type EventVcsBranchUpdated, type EventWorkspaceFailed, type EventWorkspaceReady, type EventWorktreeFailed, type EventWorktreeReady, type ExperimentalResourceListData, type ExperimentalResourceListResponse, type ExperimentalResourceListResponses, type ExperimentalSessionListData, type ExperimentalSessionListResponse, type ExperimentalSessionListResponses, type File, type FileContent, type FileDiff, type FileListData, type FileListResponse, type FileListResponses, type FileNode, type FilePart, type FilePartInput, type FilePartSource, type FilePartSourceText, type FileReadData, type FileReadResponse, type FileReadResponses, type FileSource, type FileStatusData, type FileStatusResponse, type FileStatusResponses, type FindFilesData, type FindFilesResponse, type FindFilesResponses, type FindSymbolsData, type FindSymbolsResponse, type FindSymbolsResponses, type FindTextData, type FindTextResponse, type FindTextResponses, type FormatterStatus, type FormatterStatusData, type FormatterStatusResponse, type FormatterStatusResponses, type GlobalConfigGetData, type GlobalConfigGetResponse, type GlobalConfigGetResponses, type GlobalConfigUpdateData, type GlobalConfigUpdateError, type GlobalConfigUpdateErrors, type GlobalConfigUpdateResponse, type GlobalConfigUpdateResponses, type GlobalDisposeData, type GlobalDisposeResponse, type GlobalDisposeResponses, type GlobalEvent, type GlobalEventData, type GlobalEventResponse, type GlobalEventResponses, type GlobalHealthData, type GlobalHealthResponse, type GlobalHealthResponses, type GlobalSession, type ImagePartInput, type InstanceDisposeData, type InstanceDisposeResponse, type InstanceDisposeResponses, type JsonSchema, type LayoutConfig, type LogLevel, type LspStatus, type LspStatusData, type LspStatusResponse, type LspStatusResponses, type McpAddData, type McpAddError, type McpAddErrors, type McpAddResponse, type McpAddResponses, type McpAuthAuthenticateData, type McpAuthAuthenticateError, type McpAuthAuthenticateErrors, type McpAuthAuthenticateResponse, type McpAuthAuthenticateResponses, type McpAuthCallbackData, type McpAuthCallbackError, type McpAuthCallbackErrors, type McpAuthCallbackResponse, type McpAuthCallbackResponses, type McpAuthRemoveData, type McpAuthRemoveError, type McpAuthRemoveErrors, type McpAuthRemoveResponse, type McpAuthRemoveResponses, type McpAuthStartData, type McpAuthStartError, type McpAuthStartErrors, type McpAuthStartResponse, type McpAuthStartResponses, type McpConnectData, type McpConnectResponse, type McpConnectResponses, type McpDisconnectData, type McpDisconnectResponse, type McpDisconnectResponses, type McpLocalConfig, type McpOAuthConfig, type McpRemoteConfig, type McpResource, type McpStatus, type McpStatusConnected, type McpStatusData, type McpStatusDisabled, type McpStatusFailed, type McpStatusNeedsAuth, type McpStatusNeedsClientRegistration, type McpStatusResponse, type McpStatusResponses, type MemoryPart, type MemoryPartInput, type Message$1 as Message, type MessageAbortedError, type MessageEvent, type MessageEventData, type MessageEventResponse, type MessageEventResponses, type MessageOutputLengthError, type Model$1 as Model, type ModelDefaultData, type ModelDefaultError, type ModelDefaultErrors, type ModelDefaultResponse, type ModelDefaultResponses, type ModelParseData, type ModelParseError, type ModelParseErrors, type ModelParseResponse, type ModelParseResponses, type NotFoundError, type OAuth, type OutputFormat, type OutputFormatJsonSchema, type OutputFormatText, type Part$1 as Part, type PartDeleteData, type PartDeleteError, type PartDeleteErrors, type PartDeleteResponse, type PartDeleteResponses, type PartUpdateData, type PartUpdateError, type PartUpdateErrors, type PartUpdateResponse, type PartUpdateResponses, type PatchPart, type Path$1 as Path, type PathGetData, type PathGetResponse, type PathGetResponses, Permission, type PermissionAction, type PermissionActionConfig, type PermissionConfig, type PermissionListData, type PermissionListResponse, type PermissionListResponses, type PermissionObjectConfig, type PermissionReplyData, type PermissionReplyError, type PermissionReplyErrors, type PermissionReplyResponse, type PermissionReplyResponses, type PermissionRequest, type PermissionRespondData, type PermissionRespondError, type PermissionRespondErrors, type PermissionRespondResponse, type PermissionRespondResponses, type PermissionRule, type PermissionRuleConfig, type PermissionRuleset, type Project$1 as Project, type ProjectCurrentData, type ProjectCurrentResponse, type ProjectCurrentResponses, type ProjectInitGitData, type ProjectInitGitResponse, type ProjectInitGitResponses, type ProjectListData, type ProjectListResponse, type ProjectListResponses, type ProjectSummary, type ProjectUpdateData, type ProjectUpdateError, type ProjectUpdateErrors, type ProjectUpdateResponse, type ProjectUpdateResponses, type Provider$1 as Provider, type ProviderAuthAuthorization, type ProviderAuthData, type ProviderAuthError, type ProviderAuthMethod, type ProviderAuthResponse, type ProviderAuthResponses, type ProviderConfig, type ProviderListData, type ProviderListResponse, type ProviderListResponses, type ProviderOauthAuthorizeData, type ProviderOauthAuthorizeError, type ProviderOauthAuthorizeErrors, type ProviderOauthAuthorizeResponse, type ProviderOauthAuthorizeResponses, type ProviderOauthCallbackData, type ProviderOauthCallbackError, type ProviderOauthCallbackErrors, type ProviderOauthCallbackResponse, type ProviderOauthCallbackResponses, type Pty$1 as Pty, type PtyConnectData, type PtyConnectError, type PtyConnectErrors, type PtyConnectResponse, type PtyConnectResponses, type PtyCreateData, type PtyCreateError, type PtyCreateErrors, type PtyCreateResponse, type PtyCreateResponses, type PtyGetData, type PtyGetError, type PtyGetErrors, type PtyGetResponse, type PtyGetResponses, type PtyListData, type PtyListResponse, type PtyListResponses, type PtyRemoveData, type PtyRemoveError, type PtyRemoveErrors, type PtyRemoveResponse, type PtyRemoveResponses, type PtyUpdateData, type PtyUpdateError, type PtyUpdateErrors, type PtyUpdateResponse, type PtyUpdateResponses, type QuestionAnswer, type QuestionInfo, type QuestionListData, type QuestionListResponse, type QuestionListResponses, type QuestionOption, type QuestionRejectData, type QuestionRejectError, type QuestionRejectErrors, type QuestionRejectResponse, type QuestionRejectResponses, type QuestionReplyData, type QuestionReplyError, type QuestionReplyErrors, type QuestionReplyResponse, type QuestionReplyResponses, type QuestionRequest, type Range, type ReasoningPart, type ResourcePartInput, type ResourceSource, type RetryPart, type ServerConfig, type ServerOptions, type Session$1 as Session, type SessionAbortData, type SessionAbortError, type SessionAbortErrors, type SessionAbortResponse, type SessionAbortResponses, type SessionChildrenData, type SessionChildrenError, type SessionChildrenErrors, type SessionChildrenResponse, type SessionChildrenResponses, type SessionCommandData, type SessionCommandError, type SessionCommandErrors, type SessionCommandResponse, type SessionCommandResponses, type SessionContextModeGetData, type SessionContextModeGetError, type SessionContextModeGetErrors, type SessionContextModeGetResponse, type SessionContextModeGetResponses, type SessionContextModeSetData, type SessionContextModeSetError, type SessionContextModeSetErrors, type SessionContextModeSetResponse, type SessionContextModeSetResponses, type SessionCreateData, type SessionCreateError, type SessionCreateErrors, type SessionCreateResponse, type SessionCreateResponses, type SessionDeleteData, type SessionDeleteError, type SessionDeleteErrors, type SessionDeleteMessageData, type SessionDeleteMessageError, type SessionDeleteMessageErrors, type SessionDeleteMessageResponse, type SessionDeleteMessageResponses, type SessionDeleteResponse, type SessionDeleteResponses, type SessionDiffData, type SessionDiffResponse, type SessionDiffResponses, type SessionEvent, type SessionEventData, type SessionEventResponse, type SessionEventResponses, type SessionForkData, type SessionForkResponse, type SessionForkResponses, type SessionGetData, type SessionGetError, type SessionGetErrors, type SessionGetResponse, type SessionGetResponses, type SessionInitData, type SessionInitError, type SessionInitErrors, type SessionInitResponse, type SessionInitResponses, type SessionListData, type SessionListResponse, type SessionListResponses, type SessionMessageData, type SessionMessageError, type SessionMessageErrors, type SessionMessageResponse, type SessionMessageResponses, type SessionMessagesData, type SessionMessagesError, type SessionMessagesErrors, type SessionMessagesResponse, type SessionMessagesResponses, type SessionPromptAsyncData, type SessionPromptAsyncError, type SessionPromptAsyncErrors, type SessionPromptAsyncResponse, type SessionPromptAsyncResponses, type SessionPromptData, type SessionPromptError, type SessionPromptErrors, type SessionPromptResponse, type SessionPromptResponses, type SessionRevertData, type SessionRevertError, type SessionRevertErrors, type SessionRevertResponse, type SessionRevertResponses, type SessionShareData, type SessionShareError, type SessionShareErrors, type SessionShareResponse, type SessionShareResponses, type SessionShellData, type SessionShellError, type SessionShellErrors, type SessionShellResponse, type SessionShellResponses, type SessionStatus, type SessionStatusData, type SessionStatusError, type SessionStatusErrors, type SessionStatusResponse, type SessionStatusResponses, type SessionSummarizeData, type SessionSummarizeError, type SessionSummarizeErrors, type SessionSummarizeResponse, type SessionSummarizeResponses, type SessionTodoData, type SessionTodoError, type SessionTodoErrors, type SessionTodoResponse, type SessionTodoResponses, type SessionUnrevertData, type SessionUnrevertError, type SessionUnrevertErrors, type SessionUnrevertResponse, type SessionUnrevertResponses, type SessionUnshareData, type SessionUnshareError, type SessionUnshareErrors, type SessionUnshareResponse, type SessionUnshareResponses, type SessionUpdateData, type SessionUpdateError, type SessionUpdateErrors, type SessionUpdateResponse, type SessionUpdateResponses, type SnapshotPart, type StepFinishPart, type StepStartPart, type StructuredOutputError, type SubtaskPart, type SubtaskPartInput, type SubtaskResultPart, type SubtaskResultPartInput, type Symbol, type SymbolSource, type TextPart, type TextPartInput, type Todo, type ToolIds, type ToolIdsData, type ToolIdsError, type ToolIdsErrors, type ToolIdsResponse, type ToolIdsResponses, type ToolList, type ToolListData, type ToolListError, type ToolListErrors, type ToolListItem, type ToolListResponse, type ToolListResponses, type ToolPart, type ToolState, type ToolStateCompleted, type ToolStateError, type ToolStatePending, type ToolStateRunning, type TuiAppendPromptData, type TuiAppendPromptError, type TuiAppendPromptErrors, type TuiAppendPromptResponse, type TuiAppendPromptResponses, type TuiClearPromptData, type TuiClearPromptResponse, type TuiClearPromptResponses, type TuiControlNextData, type TuiControlNextResponse, type TuiControlNextResponses, type TuiControlResponseData, type TuiControlResponseResponse, type TuiControlResponseResponses, type TuiExecuteCommandData, type TuiExecuteCommandError, type TuiExecuteCommandErrors, type TuiExecuteCommandResponse, type TuiExecuteCommandResponses, type TuiOpenHelpData, type TuiOpenHelpResponse, type TuiOpenHelpResponses, type TuiOpenModelsData, type TuiOpenModelsResponse, type TuiOpenModelsResponses, type TuiOpenSessionsData, type TuiOpenSessionsResponse, type TuiOpenSessionsResponses, type TuiOpenThemesData, type TuiOpenThemesResponse, type TuiOpenThemesResponses, type TuiOptions, type TuiPublishData, type TuiPublishError, type TuiPublishErrors, type TuiPublishResponse, type TuiPublishResponses, type TuiSelectSessionData, type TuiSelectSessionError, type TuiSelectSessionErrors, type TuiSelectSessionResponse, type TuiSelectSessionResponses, type TuiShowToastData, type TuiShowToastResponse, type TuiShowToastResponses, type TuiSubmitPromptData, type TuiSubmitPromptResponse, type TuiSubmitPromptResponses, type UnknownError, type UserMessage, type VcsGetData, type VcsGetResponse, type VcsGetResponses, type VcsInfo, type WellKnownAuth, type Workspace, type Worktree$1 as Worktree, type WorktreeCreateData, type WorktreeCreateError, type WorktreeCreateErrors, type WorktreeCreateInput, type WorktreeCreateResponse, type WorktreeCreateResponses, type WorktreeListData, type WorktreeListResponse, type WorktreeListResponses, type WorktreeRemoveData, type WorktreeRemoveError, type WorktreeRemoveErrors, type WorktreeRemoveInput, type WorktreeRemoveResponse, type WorktreeRemoveResponses, type WorktreeResetData, type WorktreeResetError, type WorktreeResetErrors, type WorktreeResetInput, type WorktreeResetResponse, type WorktreeResetResponses, createEasbotClient, createEasbotServer, createEascode, createEascodeTui };
|
package/dist/index.d.ts
CHANGED
|
@@ -3512,6 +3512,32 @@ type AppSkillsResponses = {
|
|
|
3512
3512
|
}>;
|
|
3513
3513
|
};
|
|
3514
3514
|
type AppSkillsResponse = AppSkillsResponses[keyof AppSkillsResponses];
|
|
3515
|
+
type AppContextData = {
|
|
3516
|
+
body?: never;
|
|
3517
|
+
path?: never;
|
|
3518
|
+
query?: {
|
|
3519
|
+
directory?: string;
|
|
3520
|
+
};
|
|
3521
|
+
url: '/context';
|
|
3522
|
+
};
|
|
3523
|
+
type AppContextResponses = {
|
|
3524
|
+
200: {
|
|
3525
|
+
protocolMetadata: {
|
|
3526
|
+
agentId?: string;
|
|
3527
|
+
workspace: string;
|
|
3528
|
+
name: string;
|
|
3529
|
+
userName: string;
|
|
3530
|
+
mission: string;
|
|
3531
|
+
preferredName?: string;
|
|
3532
|
+
coreRelationship?: string;
|
|
3533
|
+
coreValues?: Array<string>;
|
|
3534
|
+
behaviorStyle?: string;
|
|
3535
|
+
decisionPrinciples?: Array<string>;
|
|
3536
|
+
};
|
|
3537
|
+
protocolInitialized: boolean;
|
|
3538
|
+
};
|
|
3539
|
+
};
|
|
3540
|
+
type AppContextResponse = AppContextResponses[keyof AppContextResponses];
|
|
3515
3541
|
type LspStatusData = {
|
|
3516
3542
|
body?: never;
|
|
3517
3543
|
path?: never;
|
|
@@ -4300,6 +4326,9 @@ declare class App extends HeyApiClient {
|
|
|
4300
4326
|
skills<ThrowOnError extends boolean = false>(parameters?: {
|
|
4301
4327
|
directory?: string;
|
|
4302
4328
|
}, options?: Options<never, ThrowOnError>): RequestResult<AppSkillsResponses, unknown, ThrowOnError, "fields">;
|
|
4329
|
+
context<ThrowOnError extends boolean = false>(parameters?: {
|
|
4330
|
+
directory?: string;
|
|
4331
|
+
}, options?: Options<never, ThrowOnError>): RequestResult<AppContextResponses, unknown, ThrowOnError, "fields">;
|
|
4303
4332
|
}
|
|
4304
4333
|
declare class Agent extends HeyApiClient {
|
|
4305
4334
|
create<ThrowOnError extends boolean = false>(parameters: {
|
|
@@ -4455,4 +4484,4 @@ declare function createEascode(options?: ServerOptions): Promise<{
|
|
|
4455
4484
|
};
|
|
4456
4485
|
}>;
|
|
4457
4486
|
|
|
4458
|
-
export { type Agent$1 as Agent, type AgentConfig, type AgentCreateData, type AgentCreateError, type AgentCreateErrors, type AgentCreateResponse, type AgentCreateResponses, type AgentDefaultData, type AgentDefaultError, type AgentDefaultErrors, type AgentDefaultResponse, type AgentDefaultResponses, type AgentEvent, type AgentEventData, type AgentEventResponse, type AgentEventResponses, type AgentGetData, type AgentGetError, type AgentGetErrors, type AgentGetResponse, type AgentGetResponses, type AgentPart, type AgentPartInput, type ApiAuth, type ApiError, type AppAgentsData, type AppAgentsResponse, type AppAgentsResponses, type AppLogData, type AppLogError, type AppLogErrors, type AppLogResponse, type AppLogResponses, type AppSkillsData, type AppSkillsResponse, type AppSkillsResponses, type AssistantMessage, type Auth$2 as Auth, type AuthRemoveData, type AuthRemoveError, type AuthRemoveErrors, type AuthRemoveResponse, type AuthRemoveResponses, type AuthSetData, type AuthSetError, type AuthSetErrors, type AuthSetResponse, type AuthSetResponses, type BadRequestError, type ClientOptions$1 as ClientOptions, type Command$1 as Command, type CommandListData, type CommandListResponse, type CommandListResponses, type CompactionPart, type Config$3 as Config, type ConfigGetData, type ConfigGetResponse, type ConfigGetResponses, type ConfigProvidersData, type ConfigProvidersResponse, type ConfigProvidersResponses, type ConfigUpdateData, type ConfigUpdateError, type ConfigUpdateErrors, type ConfigUpdateResponse, type ConfigUpdateResponses, type ContextMode$1 as ContextMode, type ContextOverflowError, EasbotClient, type Config$1 as EasbotClientConfig, type Event, type EventCommandExecuted, type EventFileEdited, type EventFileWatcherUpdated, type EventGlobalDisposed, type EventInstallationUpdateAvailable, type EventInstallationUpdated, type EventLspClientDiagnostics, type EventLspUpdated, type EventMcpBrowserOpenFailed, type EventMcpToolsChanged, type EventMessagePartRemoved, type EventMessagePartUpdated, type EventMessageRemoved, type EventMessageUpdated, type EventPermissionAsked, type EventPermissionReplied, type EventProjectUpdated, type EventPtyCreated, type EventPtyDeleted, type EventPtyExited, type EventPtyUpdated, type EventPublishData, type EventPublishResponse, type EventPublishResponses, type EventQuestionAsked, type EventQuestionRejected, type EventQuestionReplied, type EventServerConnected, type EventServerInstanceDisposed, type EventSessionCompacted, type EventSessionCreated, type EventSessionDeleted, type EventSessionDiff, type EventSessionError, type EventSessionIdle, type EventSessionStatus, type EventSessionUpdated, type EventSubscribeData, type EventSubscribeResponse, type EventSubscribeResponses, type EventTodoUpdated, type EventTuiCommandExecute, type EventTuiPromptAppend, type EventTuiSessionSelect, type EventTuiToastShow, type EventVcsBranchUpdated, type EventWorkspaceFailed, type EventWorkspaceReady, type EventWorktreeFailed, type EventWorktreeReady, type ExperimentalResourceListData, type ExperimentalResourceListResponse, type ExperimentalResourceListResponses, type ExperimentalSessionListData, type ExperimentalSessionListResponse, type ExperimentalSessionListResponses, type File, type FileContent, type FileDiff, type FileListData, type FileListResponse, type FileListResponses, type FileNode, type FilePart, type FilePartInput, type FilePartSource, type FilePartSourceText, type FileReadData, type FileReadResponse, type FileReadResponses, type FileSource, type FileStatusData, type FileStatusResponse, type FileStatusResponses, type FindFilesData, type FindFilesResponse, type FindFilesResponses, type FindSymbolsData, type FindSymbolsResponse, type FindSymbolsResponses, type FindTextData, type FindTextResponse, type FindTextResponses, type FormatterStatus, type FormatterStatusData, type FormatterStatusResponse, type FormatterStatusResponses, type GlobalConfigGetData, type GlobalConfigGetResponse, type GlobalConfigGetResponses, type GlobalConfigUpdateData, type GlobalConfigUpdateError, type GlobalConfigUpdateErrors, type GlobalConfigUpdateResponse, type GlobalConfigUpdateResponses, type GlobalDisposeData, type GlobalDisposeResponse, type GlobalDisposeResponses, type GlobalEvent, type GlobalEventData, type GlobalEventResponse, type GlobalEventResponses, type GlobalHealthData, type GlobalHealthResponse, type GlobalHealthResponses, type GlobalSession, type ImagePartInput, type InstanceDisposeData, type InstanceDisposeResponse, type InstanceDisposeResponses, type JsonSchema, type LayoutConfig, type LogLevel, type LspStatus, type LspStatusData, type LspStatusResponse, type LspStatusResponses, type McpAddData, type McpAddError, type McpAddErrors, type McpAddResponse, type McpAddResponses, type McpAuthAuthenticateData, type McpAuthAuthenticateError, type McpAuthAuthenticateErrors, type McpAuthAuthenticateResponse, type McpAuthAuthenticateResponses, type McpAuthCallbackData, type McpAuthCallbackError, type McpAuthCallbackErrors, type McpAuthCallbackResponse, type McpAuthCallbackResponses, type McpAuthRemoveData, type McpAuthRemoveError, type McpAuthRemoveErrors, type McpAuthRemoveResponse, type McpAuthRemoveResponses, type McpAuthStartData, type McpAuthStartError, type McpAuthStartErrors, type McpAuthStartResponse, type McpAuthStartResponses, type McpConnectData, type McpConnectResponse, type McpConnectResponses, type McpDisconnectData, type McpDisconnectResponse, type McpDisconnectResponses, type McpLocalConfig, type McpOAuthConfig, type McpRemoteConfig, type McpResource, type McpStatus, type McpStatusConnected, type McpStatusData, type McpStatusDisabled, type McpStatusFailed, type McpStatusNeedsAuth, type McpStatusNeedsClientRegistration, type McpStatusResponse, type McpStatusResponses, type MemoryPart, type MemoryPartInput, type Message$1 as Message, type MessageAbortedError, type MessageEvent, type MessageEventData, type MessageEventResponse, type MessageEventResponses, type MessageOutputLengthError, type Model$1 as Model, type ModelDefaultData, type ModelDefaultError, type ModelDefaultErrors, type ModelDefaultResponse, type ModelDefaultResponses, type ModelParseData, type ModelParseError, type ModelParseErrors, type ModelParseResponse, type ModelParseResponses, type NotFoundError, type OAuth, type OutputFormat, type OutputFormatJsonSchema, type OutputFormatText, type Part$1 as Part, type PartDeleteData, type PartDeleteError, type PartDeleteErrors, type PartDeleteResponse, type PartDeleteResponses, type PartUpdateData, type PartUpdateError, type PartUpdateErrors, type PartUpdateResponse, type PartUpdateResponses, type PatchPart, type Path$1 as Path, type PathGetData, type PathGetResponse, type PathGetResponses, Permission, type PermissionAction, type PermissionActionConfig, type PermissionConfig, type PermissionListData, type PermissionListResponse, type PermissionListResponses, type PermissionObjectConfig, type PermissionReplyData, type PermissionReplyError, type PermissionReplyErrors, type PermissionReplyResponse, type PermissionReplyResponses, type PermissionRequest, type PermissionRespondData, type PermissionRespondError, type PermissionRespondErrors, type PermissionRespondResponse, type PermissionRespondResponses, type PermissionRule, type PermissionRuleConfig, type PermissionRuleset, type Project$1 as Project, type ProjectCurrentData, type ProjectCurrentResponse, type ProjectCurrentResponses, type ProjectInitGitData, type ProjectInitGitResponse, type ProjectInitGitResponses, type ProjectListData, type ProjectListResponse, type ProjectListResponses, type ProjectSummary, type ProjectUpdateData, type ProjectUpdateError, type ProjectUpdateErrors, type ProjectUpdateResponse, type ProjectUpdateResponses, type Provider$1 as Provider, type ProviderAuthAuthorization, type ProviderAuthData, type ProviderAuthError, type ProviderAuthMethod, type ProviderAuthResponse, type ProviderAuthResponses, type ProviderConfig, type ProviderListData, type ProviderListResponse, type ProviderListResponses, type ProviderOauthAuthorizeData, type ProviderOauthAuthorizeError, type ProviderOauthAuthorizeErrors, type ProviderOauthAuthorizeResponse, type ProviderOauthAuthorizeResponses, type ProviderOauthCallbackData, type ProviderOauthCallbackError, type ProviderOauthCallbackErrors, type ProviderOauthCallbackResponse, type ProviderOauthCallbackResponses, type Pty$1 as Pty, type PtyConnectData, type PtyConnectError, type PtyConnectErrors, type PtyConnectResponse, type PtyConnectResponses, type PtyCreateData, type PtyCreateError, type PtyCreateErrors, type PtyCreateResponse, type PtyCreateResponses, type PtyGetData, type PtyGetError, type PtyGetErrors, type PtyGetResponse, type PtyGetResponses, type PtyListData, type PtyListResponse, type PtyListResponses, type PtyRemoveData, type PtyRemoveError, type PtyRemoveErrors, type PtyRemoveResponse, type PtyRemoveResponses, type PtyUpdateData, type PtyUpdateError, type PtyUpdateErrors, type PtyUpdateResponse, type PtyUpdateResponses, type QuestionAnswer, type QuestionInfo, type QuestionListData, type QuestionListResponse, type QuestionListResponses, type QuestionOption, type QuestionRejectData, type QuestionRejectError, type QuestionRejectErrors, type QuestionRejectResponse, type QuestionRejectResponses, type QuestionReplyData, type QuestionReplyError, type QuestionReplyErrors, type QuestionReplyResponse, type QuestionReplyResponses, type QuestionRequest, type Range, type ReasoningPart, type ResourcePartInput, type ResourceSource, type RetryPart, type ServerConfig, type ServerOptions, type Session$1 as Session, type SessionAbortData, type SessionAbortError, type SessionAbortErrors, type SessionAbortResponse, type SessionAbortResponses, type SessionChildrenData, type SessionChildrenError, type SessionChildrenErrors, type SessionChildrenResponse, type SessionChildrenResponses, type SessionCommandData, type SessionCommandError, type SessionCommandErrors, type SessionCommandResponse, type SessionCommandResponses, type SessionContextModeGetData, type SessionContextModeGetError, type SessionContextModeGetErrors, type SessionContextModeGetResponse, type SessionContextModeGetResponses, type SessionContextModeSetData, type SessionContextModeSetError, type SessionContextModeSetErrors, type SessionContextModeSetResponse, type SessionContextModeSetResponses, type SessionCreateData, type SessionCreateError, type SessionCreateErrors, type SessionCreateResponse, type SessionCreateResponses, type SessionDeleteData, type SessionDeleteError, type SessionDeleteErrors, type SessionDeleteMessageData, type SessionDeleteMessageError, type SessionDeleteMessageErrors, type SessionDeleteMessageResponse, type SessionDeleteMessageResponses, type SessionDeleteResponse, type SessionDeleteResponses, type SessionDiffData, type SessionDiffResponse, type SessionDiffResponses, type SessionEvent, type SessionEventData, type SessionEventResponse, type SessionEventResponses, type SessionForkData, type SessionForkResponse, type SessionForkResponses, type SessionGetData, type SessionGetError, type SessionGetErrors, type SessionGetResponse, type SessionGetResponses, type SessionInitData, type SessionInitError, type SessionInitErrors, type SessionInitResponse, type SessionInitResponses, type SessionListData, type SessionListResponse, type SessionListResponses, type SessionMessageData, type SessionMessageError, type SessionMessageErrors, type SessionMessageResponse, type SessionMessageResponses, type SessionMessagesData, type SessionMessagesError, type SessionMessagesErrors, type SessionMessagesResponse, type SessionMessagesResponses, type SessionPromptAsyncData, type SessionPromptAsyncError, type SessionPromptAsyncErrors, type SessionPromptAsyncResponse, type SessionPromptAsyncResponses, type SessionPromptData, type SessionPromptError, type SessionPromptErrors, type SessionPromptResponse, type SessionPromptResponses, type SessionRevertData, type SessionRevertError, type SessionRevertErrors, type SessionRevertResponse, type SessionRevertResponses, type SessionShareData, type SessionShareError, type SessionShareErrors, type SessionShareResponse, type SessionShareResponses, type SessionShellData, type SessionShellError, type SessionShellErrors, type SessionShellResponse, type SessionShellResponses, type SessionStatus, type SessionStatusData, type SessionStatusError, type SessionStatusErrors, type SessionStatusResponse, type SessionStatusResponses, type SessionSummarizeData, type SessionSummarizeError, type SessionSummarizeErrors, type SessionSummarizeResponse, type SessionSummarizeResponses, type SessionTodoData, type SessionTodoError, type SessionTodoErrors, type SessionTodoResponse, type SessionTodoResponses, type SessionUnrevertData, type SessionUnrevertError, type SessionUnrevertErrors, type SessionUnrevertResponse, type SessionUnrevertResponses, type SessionUnshareData, type SessionUnshareError, type SessionUnshareErrors, type SessionUnshareResponse, type SessionUnshareResponses, type SessionUpdateData, type SessionUpdateError, type SessionUpdateErrors, type SessionUpdateResponse, type SessionUpdateResponses, type SnapshotPart, type StepFinishPart, type StepStartPart, type StructuredOutputError, type SubtaskPart, type SubtaskPartInput, type SubtaskResultPart, type SubtaskResultPartInput, type Symbol, type SymbolSource, type TextPart, type TextPartInput, type Todo, type ToolIds, type ToolIdsData, type ToolIdsError, type ToolIdsErrors, type ToolIdsResponse, type ToolIdsResponses, type ToolList, type ToolListData, type ToolListError, type ToolListErrors, type ToolListItem, type ToolListResponse, type ToolListResponses, type ToolPart, type ToolState, type ToolStateCompleted, type ToolStateError, type ToolStatePending, type ToolStateRunning, type TuiAppendPromptData, type TuiAppendPromptError, type TuiAppendPromptErrors, type TuiAppendPromptResponse, type TuiAppendPromptResponses, type TuiClearPromptData, type TuiClearPromptResponse, type TuiClearPromptResponses, type TuiControlNextData, type TuiControlNextResponse, type TuiControlNextResponses, type TuiControlResponseData, type TuiControlResponseResponse, type TuiControlResponseResponses, type TuiExecuteCommandData, type TuiExecuteCommandError, type TuiExecuteCommandErrors, type TuiExecuteCommandResponse, type TuiExecuteCommandResponses, type TuiOpenHelpData, type TuiOpenHelpResponse, type TuiOpenHelpResponses, type TuiOpenModelsData, type TuiOpenModelsResponse, type TuiOpenModelsResponses, type TuiOpenSessionsData, type TuiOpenSessionsResponse, type TuiOpenSessionsResponses, type TuiOpenThemesData, type TuiOpenThemesResponse, type TuiOpenThemesResponses, type TuiOptions, type TuiPublishData, type TuiPublishError, type TuiPublishErrors, type TuiPublishResponse, type TuiPublishResponses, type TuiSelectSessionData, type TuiSelectSessionError, type TuiSelectSessionErrors, type TuiSelectSessionResponse, type TuiSelectSessionResponses, type TuiShowToastData, type TuiShowToastResponse, type TuiShowToastResponses, type TuiSubmitPromptData, type TuiSubmitPromptResponse, type TuiSubmitPromptResponses, type UnknownError, type UserMessage, type VcsGetData, type VcsGetResponse, type VcsGetResponses, type VcsInfo, type WellKnownAuth, type Workspace, type Worktree$1 as Worktree, type WorktreeCreateData, type WorktreeCreateError, type WorktreeCreateErrors, type WorktreeCreateInput, type WorktreeCreateResponse, type WorktreeCreateResponses, type WorktreeListData, type WorktreeListResponse, type WorktreeListResponses, type WorktreeRemoveData, type WorktreeRemoveError, type WorktreeRemoveErrors, type WorktreeRemoveInput, type WorktreeRemoveResponse, type WorktreeRemoveResponses, type WorktreeResetData, type WorktreeResetError, type WorktreeResetErrors, type WorktreeResetInput, type WorktreeResetResponse, type WorktreeResetResponses, createEasbotClient, createEasbotServer, createEascode, createEascodeTui };
|
|
4487
|
+
export { type Agent$1 as Agent, type AgentConfig, type AgentCreateData, type AgentCreateError, type AgentCreateErrors, type AgentCreateResponse, type AgentCreateResponses, type AgentDefaultData, type AgentDefaultError, type AgentDefaultErrors, type AgentDefaultResponse, type AgentDefaultResponses, type AgentEvent, type AgentEventData, type AgentEventResponse, type AgentEventResponses, type AgentGetData, type AgentGetError, type AgentGetErrors, type AgentGetResponse, type AgentGetResponses, type AgentPart, type AgentPartInput, type ApiAuth, type ApiError, type AppAgentsData, type AppAgentsResponse, type AppAgentsResponses, type AppContextData, type AppContextResponse, type AppContextResponses, type AppLogData, type AppLogError, type AppLogErrors, type AppLogResponse, type AppLogResponses, type AppSkillsData, type AppSkillsResponse, type AppSkillsResponses, type AssistantMessage, type Auth$2 as Auth, type AuthRemoveData, type AuthRemoveError, type AuthRemoveErrors, type AuthRemoveResponse, type AuthRemoveResponses, type AuthSetData, type AuthSetError, type AuthSetErrors, type AuthSetResponse, type AuthSetResponses, type BadRequestError, type ClientOptions$1 as ClientOptions, type Command$1 as Command, type CommandListData, type CommandListResponse, type CommandListResponses, type CompactionPart, type Config$3 as Config, type ConfigGetData, type ConfigGetResponse, type ConfigGetResponses, type ConfigProvidersData, type ConfigProvidersResponse, type ConfigProvidersResponses, type ConfigUpdateData, type ConfigUpdateError, type ConfigUpdateErrors, type ConfigUpdateResponse, type ConfigUpdateResponses, type ContextMode$1 as ContextMode, type ContextOverflowError, EasbotClient, type Config$1 as EasbotClientConfig, type Event, type EventCommandExecuted, type EventFileEdited, type EventFileWatcherUpdated, type EventGlobalDisposed, type EventInstallationUpdateAvailable, type EventInstallationUpdated, type EventLspClientDiagnostics, type EventLspUpdated, type EventMcpBrowserOpenFailed, type EventMcpToolsChanged, type EventMessagePartRemoved, type EventMessagePartUpdated, type EventMessageRemoved, type EventMessageUpdated, type EventPermissionAsked, type EventPermissionReplied, type EventProjectUpdated, type EventPtyCreated, type EventPtyDeleted, type EventPtyExited, type EventPtyUpdated, type EventPublishData, type EventPublishResponse, type EventPublishResponses, type EventQuestionAsked, type EventQuestionRejected, type EventQuestionReplied, type EventServerConnected, type EventServerInstanceDisposed, type EventSessionCompacted, type EventSessionCreated, type EventSessionDeleted, type EventSessionDiff, type EventSessionError, type EventSessionIdle, type EventSessionStatus, type EventSessionUpdated, type EventSubscribeData, type EventSubscribeResponse, type EventSubscribeResponses, type EventTodoUpdated, type EventTuiCommandExecute, type EventTuiPromptAppend, type EventTuiSessionSelect, type EventTuiToastShow, type EventVcsBranchUpdated, type EventWorkspaceFailed, type EventWorkspaceReady, type EventWorktreeFailed, type EventWorktreeReady, type ExperimentalResourceListData, type ExperimentalResourceListResponse, type ExperimentalResourceListResponses, type ExperimentalSessionListData, type ExperimentalSessionListResponse, type ExperimentalSessionListResponses, type File, type FileContent, type FileDiff, type FileListData, type FileListResponse, type FileListResponses, type FileNode, type FilePart, type FilePartInput, type FilePartSource, type FilePartSourceText, type FileReadData, type FileReadResponse, type FileReadResponses, type FileSource, type FileStatusData, type FileStatusResponse, type FileStatusResponses, type FindFilesData, type FindFilesResponse, type FindFilesResponses, type FindSymbolsData, type FindSymbolsResponse, type FindSymbolsResponses, type FindTextData, type FindTextResponse, type FindTextResponses, type FormatterStatus, type FormatterStatusData, type FormatterStatusResponse, type FormatterStatusResponses, type GlobalConfigGetData, type GlobalConfigGetResponse, type GlobalConfigGetResponses, type GlobalConfigUpdateData, type GlobalConfigUpdateError, type GlobalConfigUpdateErrors, type GlobalConfigUpdateResponse, type GlobalConfigUpdateResponses, type GlobalDisposeData, type GlobalDisposeResponse, type GlobalDisposeResponses, type GlobalEvent, type GlobalEventData, type GlobalEventResponse, type GlobalEventResponses, type GlobalHealthData, type GlobalHealthResponse, type GlobalHealthResponses, type GlobalSession, type ImagePartInput, type InstanceDisposeData, type InstanceDisposeResponse, type InstanceDisposeResponses, type JsonSchema, type LayoutConfig, type LogLevel, type LspStatus, type LspStatusData, type LspStatusResponse, type LspStatusResponses, type McpAddData, type McpAddError, type McpAddErrors, type McpAddResponse, type McpAddResponses, type McpAuthAuthenticateData, type McpAuthAuthenticateError, type McpAuthAuthenticateErrors, type McpAuthAuthenticateResponse, type McpAuthAuthenticateResponses, type McpAuthCallbackData, type McpAuthCallbackError, type McpAuthCallbackErrors, type McpAuthCallbackResponse, type McpAuthCallbackResponses, type McpAuthRemoveData, type McpAuthRemoveError, type McpAuthRemoveErrors, type McpAuthRemoveResponse, type McpAuthRemoveResponses, type McpAuthStartData, type McpAuthStartError, type McpAuthStartErrors, type McpAuthStartResponse, type McpAuthStartResponses, type McpConnectData, type McpConnectResponse, type McpConnectResponses, type McpDisconnectData, type McpDisconnectResponse, type McpDisconnectResponses, type McpLocalConfig, type McpOAuthConfig, type McpRemoteConfig, type McpResource, type McpStatus, type McpStatusConnected, type McpStatusData, type McpStatusDisabled, type McpStatusFailed, type McpStatusNeedsAuth, type McpStatusNeedsClientRegistration, type McpStatusResponse, type McpStatusResponses, type MemoryPart, type MemoryPartInput, type Message$1 as Message, type MessageAbortedError, type MessageEvent, type MessageEventData, type MessageEventResponse, type MessageEventResponses, type MessageOutputLengthError, type Model$1 as Model, type ModelDefaultData, type ModelDefaultError, type ModelDefaultErrors, type ModelDefaultResponse, type ModelDefaultResponses, type ModelParseData, type ModelParseError, type ModelParseErrors, type ModelParseResponse, type ModelParseResponses, type NotFoundError, type OAuth, type OutputFormat, type OutputFormatJsonSchema, type OutputFormatText, type Part$1 as Part, type PartDeleteData, type PartDeleteError, type PartDeleteErrors, type PartDeleteResponse, type PartDeleteResponses, type PartUpdateData, type PartUpdateError, type PartUpdateErrors, type PartUpdateResponse, type PartUpdateResponses, type PatchPart, type Path$1 as Path, type PathGetData, type PathGetResponse, type PathGetResponses, Permission, type PermissionAction, type PermissionActionConfig, type PermissionConfig, type PermissionListData, type PermissionListResponse, type PermissionListResponses, type PermissionObjectConfig, type PermissionReplyData, type PermissionReplyError, type PermissionReplyErrors, type PermissionReplyResponse, type PermissionReplyResponses, type PermissionRequest, type PermissionRespondData, type PermissionRespondError, type PermissionRespondErrors, type PermissionRespondResponse, type PermissionRespondResponses, type PermissionRule, type PermissionRuleConfig, type PermissionRuleset, type Project$1 as Project, type ProjectCurrentData, type ProjectCurrentResponse, type ProjectCurrentResponses, type ProjectInitGitData, type ProjectInitGitResponse, type ProjectInitGitResponses, type ProjectListData, type ProjectListResponse, type ProjectListResponses, type ProjectSummary, type ProjectUpdateData, type ProjectUpdateError, type ProjectUpdateErrors, type ProjectUpdateResponse, type ProjectUpdateResponses, type Provider$1 as Provider, type ProviderAuthAuthorization, type ProviderAuthData, type ProviderAuthError, type ProviderAuthMethod, type ProviderAuthResponse, type ProviderAuthResponses, type ProviderConfig, type ProviderListData, type ProviderListResponse, type ProviderListResponses, type ProviderOauthAuthorizeData, type ProviderOauthAuthorizeError, type ProviderOauthAuthorizeErrors, type ProviderOauthAuthorizeResponse, type ProviderOauthAuthorizeResponses, type ProviderOauthCallbackData, type ProviderOauthCallbackError, type ProviderOauthCallbackErrors, type ProviderOauthCallbackResponse, type ProviderOauthCallbackResponses, type Pty$1 as Pty, type PtyConnectData, type PtyConnectError, type PtyConnectErrors, type PtyConnectResponse, type PtyConnectResponses, type PtyCreateData, type PtyCreateError, type PtyCreateErrors, type PtyCreateResponse, type PtyCreateResponses, type PtyGetData, type PtyGetError, type PtyGetErrors, type PtyGetResponse, type PtyGetResponses, type PtyListData, type PtyListResponse, type PtyListResponses, type PtyRemoveData, type PtyRemoveError, type PtyRemoveErrors, type PtyRemoveResponse, type PtyRemoveResponses, type PtyUpdateData, type PtyUpdateError, type PtyUpdateErrors, type PtyUpdateResponse, type PtyUpdateResponses, type QuestionAnswer, type QuestionInfo, type QuestionListData, type QuestionListResponse, type QuestionListResponses, type QuestionOption, type QuestionRejectData, type QuestionRejectError, type QuestionRejectErrors, type QuestionRejectResponse, type QuestionRejectResponses, type QuestionReplyData, type QuestionReplyError, type QuestionReplyErrors, type QuestionReplyResponse, type QuestionReplyResponses, type QuestionRequest, type Range, type ReasoningPart, type ResourcePartInput, type ResourceSource, type RetryPart, type ServerConfig, type ServerOptions, type Session$1 as Session, type SessionAbortData, type SessionAbortError, type SessionAbortErrors, type SessionAbortResponse, type SessionAbortResponses, type SessionChildrenData, type SessionChildrenError, type SessionChildrenErrors, type SessionChildrenResponse, type SessionChildrenResponses, type SessionCommandData, type SessionCommandError, type SessionCommandErrors, type SessionCommandResponse, type SessionCommandResponses, type SessionContextModeGetData, type SessionContextModeGetError, type SessionContextModeGetErrors, type SessionContextModeGetResponse, type SessionContextModeGetResponses, type SessionContextModeSetData, type SessionContextModeSetError, type SessionContextModeSetErrors, type SessionContextModeSetResponse, type SessionContextModeSetResponses, type SessionCreateData, type SessionCreateError, type SessionCreateErrors, type SessionCreateResponse, type SessionCreateResponses, type SessionDeleteData, type SessionDeleteError, type SessionDeleteErrors, type SessionDeleteMessageData, type SessionDeleteMessageError, type SessionDeleteMessageErrors, type SessionDeleteMessageResponse, type SessionDeleteMessageResponses, type SessionDeleteResponse, type SessionDeleteResponses, type SessionDiffData, type SessionDiffResponse, type SessionDiffResponses, type SessionEvent, type SessionEventData, type SessionEventResponse, type SessionEventResponses, type SessionForkData, type SessionForkResponse, type SessionForkResponses, type SessionGetData, type SessionGetError, type SessionGetErrors, type SessionGetResponse, type SessionGetResponses, type SessionInitData, type SessionInitError, type SessionInitErrors, type SessionInitResponse, type SessionInitResponses, type SessionListData, type SessionListResponse, type SessionListResponses, type SessionMessageData, type SessionMessageError, type SessionMessageErrors, type SessionMessageResponse, type SessionMessageResponses, type SessionMessagesData, type SessionMessagesError, type SessionMessagesErrors, type SessionMessagesResponse, type SessionMessagesResponses, type SessionPromptAsyncData, type SessionPromptAsyncError, type SessionPromptAsyncErrors, type SessionPromptAsyncResponse, type SessionPromptAsyncResponses, type SessionPromptData, type SessionPromptError, type SessionPromptErrors, type SessionPromptResponse, type SessionPromptResponses, type SessionRevertData, type SessionRevertError, type SessionRevertErrors, type SessionRevertResponse, type SessionRevertResponses, type SessionShareData, type SessionShareError, type SessionShareErrors, type SessionShareResponse, type SessionShareResponses, type SessionShellData, type SessionShellError, type SessionShellErrors, type SessionShellResponse, type SessionShellResponses, type SessionStatus, type SessionStatusData, type SessionStatusError, type SessionStatusErrors, type SessionStatusResponse, type SessionStatusResponses, type SessionSummarizeData, type SessionSummarizeError, type SessionSummarizeErrors, type SessionSummarizeResponse, type SessionSummarizeResponses, type SessionTodoData, type SessionTodoError, type SessionTodoErrors, type SessionTodoResponse, type SessionTodoResponses, type SessionUnrevertData, type SessionUnrevertError, type SessionUnrevertErrors, type SessionUnrevertResponse, type SessionUnrevertResponses, type SessionUnshareData, type SessionUnshareError, type SessionUnshareErrors, type SessionUnshareResponse, type SessionUnshareResponses, type SessionUpdateData, type SessionUpdateError, type SessionUpdateErrors, type SessionUpdateResponse, type SessionUpdateResponses, type SnapshotPart, type StepFinishPart, type StepStartPart, type StructuredOutputError, type SubtaskPart, type SubtaskPartInput, type SubtaskResultPart, type SubtaskResultPartInput, type Symbol, type SymbolSource, type TextPart, type TextPartInput, type Todo, type ToolIds, type ToolIdsData, type ToolIdsError, type ToolIdsErrors, type ToolIdsResponse, type ToolIdsResponses, type ToolList, type ToolListData, type ToolListError, type ToolListErrors, type ToolListItem, type ToolListResponse, type ToolListResponses, type ToolPart, type ToolState, type ToolStateCompleted, type ToolStateError, type ToolStatePending, type ToolStateRunning, type TuiAppendPromptData, type TuiAppendPromptError, type TuiAppendPromptErrors, type TuiAppendPromptResponse, type TuiAppendPromptResponses, type TuiClearPromptData, type TuiClearPromptResponse, type TuiClearPromptResponses, type TuiControlNextData, type TuiControlNextResponse, type TuiControlNextResponses, type TuiControlResponseData, type TuiControlResponseResponse, type TuiControlResponseResponses, type TuiExecuteCommandData, type TuiExecuteCommandError, type TuiExecuteCommandErrors, type TuiExecuteCommandResponse, type TuiExecuteCommandResponses, type TuiOpenHelpData, type TuiOpenHelpResponse, type TuiOpenHelpResponses, type TuiOpenModelsData, type TuiOpenModelsResponse, type TuiOpenModelsResponses, type TuiOpenSessionsData, type TuiOpenSessionsResponse, type TuiOpenSessionsResponses, type TuiOpenThemesData, type TuiOpenThemesResponse, type TuiOpenThemesResponses, type TuiOptions, type TuiPublishData, type TuiPublishError, type TuiPublishErrors, type TuiPublishResponse, type TuiPublishResponses, type TuiSelectSessionData, type TuiSelectSessionError, type TuiSelectSessionErrors, type TuiSelectSessionResponse, type TuiSelectSessionResponses, type TuiShowToastData, type TuiShowToastResponse, type TuiShowToastResponses, type TuiSubmitPromptData, type TuiSubmitPromptResponse, type TuiSubmitPromptResponses, type UnknownError, type UserMessage, type VcsGetData, type VcsGetResponse, type VcsGetResponses, type VcsInfo, type WellKnownAuth, type Workspace, type Worktree$1 as Worktree, type WorktreeCreateData, type WorktreeCreateError, type WorktreeCreateErrors, type WorktreeCreateInput, type WorktreeCreateResponse, type WorktreeCreateResponses, type WorktreeListData, type WorktreeListResponse, type WorktreeListResponses, type WorktreeRemoveData, type WorktreeRemoveError, type WorktreeRemoveErrors, type WorktreeRemoveInput, type WorktreeRemoveResponse, type WorktreeRemoveResponses, type WorktreeResetData, type WorktreeResetError, type WorktreeResetErrors, type WorktreeResetInput, type WorktreeResetResponse, type WorktreeResetResponses, createEasbotClient, createEasbotServer, createEascode, createEascodeTui };
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {spawn}from'child_process';var Je=Object.defineProperty;var Ke=(s,t,e)=>t in s?Je(s,t,{enumerable:true,configurable:true,writable:true,value:e}):s[t]=e;var l=(s,t,e)=>Ke(s,typeof t!="symbol"?t+"":t,e);function qe({onRequest:s,onSseError:t,onSseEvent:e,responseTransformer:r,responseValidator:n,sseDefaultRetryDelay:d,sseMaxRetryAttempts:p,sseMaxRetryDelay:i,sseSleepFn:a,url:m,...c}){let y,f=a??(g=>new Promise(b=>setTimeout(b,g)));return {stream:async function*(){let g=d??3e3,b=0,v=c.signal??new AbortController().signal;for(;!v.aborted;){b++;let M=c.headers instanceof Headers?c.headers:new Headers(c.headers);y!==void 0&&M.set("Last-Event-ID",y);try{let O={redirect:"follow",...c,body:c.serializedBody,headers:M,signal:v},D=new Request(m,O);s&&(D=await s(m,O));let
|
|
1
|
+
import {spawn}from'child_process';var Je=Object.defineProperty;var Ke=(s,t,e)=>t in s?Je(s,t,{enumerable:true,configurable:true,writable:true,value:e}):s[t]=e;var l=(s,t,e)=>Ke(s,typeof t!="symbol"?t+"":t,e);function qe({onRequest:s,onSseError:t,onSseEvent:e,responseTransformer:r,responseValidator:n,sseDefaultRetryDelay:d,sseMaxRetryAttempts:p,sseMaxRetryDelay:i,sseSleepFn:a,url:m,...c}){let y,f=a??(g=>new Promise(b=>setTimeout(b,g)));return {stream:async function*(){let g=d??3e3,b=0,v=c.signal??new AbortController().signal;for(;!v.aborted;){b++;let M=c.headers instanceof Headers?c.headers:new Headers(c.headers);y!==void 0&&M.set("Last-Event-ID",y);try{let O={redirect:"follow",...c,body:c.serializedBody,headers:M,signal:v},D=new Request(m,O);s&&(D=await s(m,O));let x=await(c.fetch??globalThis.fetch)(D);if(!x.ok)throw new Error(`SSE failed: ${x.status} ${x.statusText}`);if(!x.body)throw new Error("No body in SSE response");let T=x.body.pipeThrough(new TextDecoderStream).getReader(),k="",De=()=>{try{T.cancel();}catch{}};v.addEventListener("abort",De);try{for(;;){let{done:Qe,value:$e}=await T.read();if(Qe)break;k+=$e,k=k.replace(/\r\n?/g,`
|
|
2
2
|
`);let Pe=k.split(`
|
|
3
3
|
|
|
4
4
|
`);k=Pe.pop()??"";for(let He of Pe){let Ve=He.split(`
|
|
5
5
|
`),j=[],Ie;for(let w of Ve)if(w.startsWith("data:"))j.push(w.replace(/^data:\s*/,""));else if(w.startsWith("event:"))Ie=w.replace(/^event:\s*/,"");else if(w.startsWith("id:"))y=w.replace(/^id:\s*/,"");else if(w.startsWith("retry:")){let Ae=Number.parseInt(w.replace(/^retry:\s*/,""),10);Number.isNaN(Ae)||(g=Ae);}let P,Ce=!1;if(j.length){let w=j.join(`
|
|
6
|
-
`);try{P=JSON.parse(w),Ce=!0;}catch{P=w;}}Ce&&(n&&await n(P),r&&(P=await r(P))),e?.({data:P,event:Ie,id:y,retry:g}),j.length&&(yield P);}}}finally{v.removeEventListener("abort",De),T.releaseLock();}break}catch(O){if(t?.(O),p!==void 0&&b>=p)break;let D=Math.min(g*2**(b-1),i??3e4);await f(D);}}}()}}var Xe=s=>{switch(s){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},Ye=s=>{switch(s){case "form":return ",";case "pipeDelimited":return "|";case "spaceDelimited":return "%20";default:return ","}},Ze=s=>{switch(s){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},F=({allowReserved:s,explode:t,name:e,style:r,value:n})=>{if(!t){let i=(s?n:n.map(a=>encodeURIComponent(a))).join(Ye(r));switch(r){case "label":return `.${i}`;case "matrix":return `;${e}=${i}`;case "simple":return i;default:return `${e}=${i}`}}let d=Xe(r),p=n.map(i=>r==="label"||r==="simple"?s?i:encodeURIComponent(i):I({allowReserved:s,name:e,value:i})).join(d);return r==="label"||r==="matrix"?d+p:p},I=({allowReserved:s,name:t,value:e})=>{if(e==null)return "";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return `${t}=${s?e:encodeURIComponent(e)}`},U=({allowReserved:s,explode:t,name:e,style:r,value:n,valueOnly:d})=>{if(n instanceof Date)return d?n.toISOString():`${e}=${n.toISOString()}`;if(r!=="deepObject"&&!t){let a=[];Object.entries(n).forEach(([c,y])=>{a=[...a,c,s?y:encodeURIComponent(y)];});let m=a.join(",");switch(r){case "form":return `${e}=${m}`;case "label":return `.${m}`;case "matrix":return `;${e}=${m}`;default:return m}}let p=Ze(r),i=Object.entries(n).map(([a,m])=>I({allowReserved:s,name:r==="deepObject"?`${e}[${a}]`:a,value:m})).join(p);return r==="label"||r==="matrix"?p+i:i};var er=/\{[^{}]+\}/g,rr=({path:s,url:t})=>{let e=t,r=t.match(er);if(r)for(let n of r){let d=false,p=n.substring(1,n.length-1),i="simple";p.endsWith("*")&&(d=true,p=p.substring(0,p.length-1)),p.startsWith(".")?(p=p.substring(1),i="label"):p.startsWith(";")&&(p=p.substring(1),i="matrix");let a=s[p];if(a==null)continue;if(Array.isArray(a)){e=e.replace(n,F({explode:d,name:p,style:i,value:a}));continue}if(typeof a=="object"){e=e.replace(n,U({explode:d,name:p,style:i,value:a,valueOnly:true}));continue}if(i==="matrix"){e=e.replace(n,`;${I({name:p,value:a})}`);continue}let m=encodeURIComponent(i==="label"?`.${a}`:a);e=e.replace(n,m);}return e},Me=({baseUrl:s,path:t,query:e,querySerializer:r,url:n})=>{let d=n.startsWith("/")?n:`/${n}`,p=(s??"")+d;t&&(p=rr({path:t,url:p}));let i=e?r(e):"";return i.startsWith("?")&&(i=i.substring(1)),i&&(p+=`?${i}`),p};function N(s){let t=s.body!==void 0;if(t&&s.bodySerializer)return "serializedBody"in s?s.serializedBody!==void 0&&s.serializedBody!==""?s.serializedBody:null:s.body!==""?s.body:null;if(t)return s.body}var je=async(s,t)=>{let e=typeof t=="function"?await t(s):t;if(e)return s.scheme==="bearer"?`Bearer ${e}`:s.scheme==="basic"?`Basic ${btoa(e)}`:e};var W={bodySerializer:s=>JSON.stringify(s,(t,e)=>typeof e=="bigint"?e.toString():e)};var Fe=({parameters:s={},...t}={})=>r=>{let n=[];if(r&&typeof r=="object")for(let d in r){let p=r[d];if(p==null)continue;let i=s[d]||t;if(Array.isArray(p)){let a=F({allowReserved:i.allowReserved,explode:true,name:d,style:"form",value:p,...i.array});a&&n.push(a);}else if(typeof p=="object"){let a=U({allowReserved:i.allowReserved,explode:true,name:d,style:"deepObject",value:p,...i.object});a&&n.push(a);}else {let a=I({allowReserved:i.allowReserved,name:d,value:p});a&&n.push(a);}}return n.join("&")},Ue=s=>{if(!s)return "stream";let t=s.split(";")[0]?.trim();if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return "json";if(t==="multipart/form-data")return "formData";if(["application/","audio/","image/","video/"].some(e=>t.startsWith(e)))return "blob";if(t.startsWith("text/"))return "text"}},tr=(s,t)=>t?!!(s.headers.has(t)||s.query?.[t]||s.headers.get("Cookie")?.includes(`${t}=`)):false,Le=async({security:s,...t})=>{for(let e of s){if(tr(t,e.name))continue;let r=await je(e,t.auth);if(!r)continue;let n=e.name??"Authorization";switch(e.in){case "query":t.query||(t.query={}),t.query[n]=r;break;case "cookie":t.headers.append("Cookie",`${n}=${r}`);break;default:t.headers.set(n,r);break}}},Q=s=>Me({baseUrl:s.baseUrl,path:s.path,query:s.query,querySerializer:typeof s.querySerializer=="function"?s.querySerializer:Fe(s.querySerializer),url:s.url}),$=(s,t)=>{let e={...s,...t};return e.baseUrl?.endsWith("/")&&(e.baseUrl=e.baseUrl.substring(0,e.baseUrl.length-1)),e.headers=L(s.headers,t.headers),e},sr=s=>{let t=[];return s.forEach((e,r)=>{t.push([r,e]);}),t},L=(...s)=>{let t=new Headers;for(let e of s){if(!e)continue;let r=e instanceof Headers?sr(e):Object.entries(e);for(let[n,d]of r)if(d===null)t.delete(n);else if(Array.isArray(d))for(let p of d)t.append(n,p);else d!==void 0&&t.set(n,typeof d=="object"?JSON.stringify(d):d);}return t},C=class{constructor(){l(this,"fns",[]);}clear(){this.fns=[];}eject(t){let e=this.getInterceptorIndex(t);this.fns[e]&&(this.fns[e]=null);}exists(t){let e=this.getInterceptorIndex(t);return !!this.fns[e]}getInterceptorIndex(t){return typeof t=="number"?this.fns[t]?t:-1:this.fns.indexOf(t)}update(t,e){let r=this.getInterceptorIndex(t);return this.fns[r]?(this.fns[r]=e,t):false}use(t){return this.fns.push(t),this.fns.length-1}},Ge=()=>({error:new C,request:new C,response:new C}),nr=Fe({allowReserved:false,array:{explode:true,style:"form"},object:{explode:true,style:"deepObject"}}),or={"Content-Type":"application/json"},A=(s={})=>({...W,headers:or,parseAs:"auto",querySerializer:nr,...s});var q=(s={})=>{let t=$(A(),s),e=()=>({...t}),r=c=>(t=$(t,c),e()),n=Ge(),d=async c=>{let y={...t,...c,fetch:c.fetch??t.fetch??globalThis.fetch,headers:L(t.headers,c.headers),serializedBody:void 0};y.security&&await Le({...y,security:y.security}),y.requestValidator&&await y.requestValidator(y),y.body!==void 0&&y.bodySerializer&&(y.serializedBody=y.bodySerializer(y.body)),(y.body===void 0||y.serializedBody==="")&&y.headers.delete("Content-Type");let f=y,S=Q(f);return {opts:f,url:S}},p=async c=>{let y=c.throwOnError??t.throwOnError,f=c.responseStyle??t.responseStyle,S,h;try{let{opts:g,url:b}=await d(c),v={redirect:"follow",...g,body:N(g)};S=new Request(b,v);for(let R of n.request.fns)R&&(S=await R(S,g));let M=g.fetch;h=await M(S);for(let R of n.response.fns)R&&(h=await R(h,S,g));let O={request:S,response:h};if(h.ok){let R=(g.parseAs==="auto"?Ue(h.headers.get("Content-Type")):g.parseAs)??"json";if(h.status===204||h.headers.get("Content-Length")==="0"){let k;switch(R){case "arrayBuffer":case "blob":case "text":k=await h[R]();break;case "formData":k=new FormData;break;case "stream":k=h.body;break;default:k={};break}return g.responseStyle==="data"?k:{data:k,...O}}let T;switch(R){case "arrayBuffer":case "blob":case "formData":case "text":T=await h[R]();break;case "json":{let k=await h.text();T=k?JSON.parse(k):{};break}case "stream":return g.responseStyle==="data"?h.body:{data:h.body,...O}}return R==="json"&&(g.responseValidator&&await g.responseValidator(T),g.responseTransformer&&(T=await g.responseTransformer(T))),g.responseStyle==="data"?T:{data:T,...O}}let D=await h.text(),B;try{B=JSON.parse(D);}catch{}throw B??D}catch(g){let b=g;for(let v of n.error.fns)v&&(b=await v(b,h,S,c));if(b=b||{},y)throw b;return f==="data"?void 0:{error:b,request:S,response:h}}},i=c=>y=>p({...y,method:c}),a=c=>async y=>{let{opts:f,url:S}=await d(y);return qe({...f,body:f.body,method:c,onRequest:async(h,g)=>{let b=new Request(h,g);for(let v of n.request.fns)v&&(b=await v(b,f));return b},serializedBody:N(f),url:S})};return {buildUrl:c=>Q({...t,...c}),connect:i("CONNECT"),delete:i("DELETE"),get:i("GET"),getConfig:e,head:i("HEAD"),interceptors:n,options:i("OPTIONS"),patch:i("PATCH"),post:i("POST"),put:i("PUT"),request:p,setConfig:r,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:i("TRACE")}};var ir={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},ar=Object.entries(ir),_e=(s,t)=>{t||(t=new Map);for(let e of s)"in"in e?e.key&&t.set(e.key,{in:e.in,map:e.map}):"key"in e?t.set(e.key,{map:e.map}):e.args&&_e(e.args,t);return t},pr=s=>{for(let[t,e]of Object.entries(s))e&&typeof e=="object"&&!Array.isArray(e)&&!Object.keys(e).length&&delete s[t];},o=(s,t)=>{let e={body:{},headers:{},path:{},query:{}},r=_e(t),n;for(let[d,p]of s.entries())if(t[d]&&(n=t[d]),!!n)if("in"in n)if(n.key){let i=r.get(n.key),a=i.map||n.key;i.in&&(e[i.in][a]=p);}else e.body=p;else for(let[i,a]of Object.entries(p??{})){let m=r.get(i);if(m)if(m.in){let c=m.map||i;e[m.in][c]=a;}else e[m.map]=a;else {let c=ar.find(([y])=>i.startsWith(y));if(c){let[y,f]=c;e[f][i.slice(y.length)]=a;}else if("allowExtra"in n&&n.allowExtra){for(let[y,f]of Object.entries(n.allowExtra))if(f){e[y][i]=a;break}}}}return pr(e),e};var ze=q(A({baseUrl:"http://localhost:4096"}));var u=class{constructor(t){l(this,"client");this.client=t?.client??ze;}},H=class{constructor(){l(this,"defaultKey","default");l(this,"instances",new Map);}get(t){let e=this.instances.get(t??this.defaultKey);if(!e)throw new Error('No SDK client found. Create one with "new EasbotClient()" to fix this error.');return e}set(t,e){this.instances.set(e??this.defaultKey,t);}},V=class extends u{get(t){return (t?.client??this.client).get({url:"/global/config",...t})}update(t,e){let r=o([t],[{args:[{key:"config",map:"body"}]}]);return (e?.client??this.client).patch({url:"/global/config",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},J=class extends u{constructor(){super(...arguments);l(this,"_config");}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})}get config(){return this._config??(this._config=new V({client:this.client}))}},K=class extends u{get(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/session/{sessionID}/contextMode",...e,...r})}set(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"mode"}]}]);return (e?.client??this.client).put({url:"/session/{sessionID}/contextMode",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},X=class extends u{constructor(){super(...arguments);l(this,"_contextMode");}event(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).sse.get({url:"/session/{sessionID}/event",...r,...n})}list(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"roots"},{in:"query",key:"start"},{in:"query",key:"search"},{in:"query",key:"limit"}]}]);return (r?.client??this.client).get({url:"/session",...r,...n})}create(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"parentID"},{in:"body",key:"title"},{in:"body",key:"permission"},{in:"body",key:"contextMode"}]}]);return (r?.client??this.client).post({url:"/session",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}status(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/status",...r,...n})}delete(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).delete({url:"/session/{sessionID}",...r,...n})}get(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}",...r,...n})}update(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"title"},{in:"body",key:"time"}]}]);return (r?.client??this.client).patch({url:"/session/{sessionID}",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}children(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/children",...r,...n})}todo(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/todo",...r,...n})}init(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"modelID"},{in:"body",key:"providerID"},{in:"body",key:"messageID"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/init",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}fork(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"contextMode"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/fork",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}abort(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/abort",...r,...n})}unshare(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).delete({url:"/session/{sessionID}/share",...r,...n})}share(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/share",...r,...n})}diff(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"messageID"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/diff",...r,...n})}summarize(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"providerID"},{in:"body",key:"modelID"},{in:"body",key:"auto"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/summarize",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}messages(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"limit"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/message",...r,...n})}prompt(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{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:"contextMode"},{in:"body",key:"parts"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/message",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}deleteMessage(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}",...r,...n})}message(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/message/{messageID}",...r,...n})}promptAsync(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"agent"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"parts"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/prompt_async",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}command(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{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:"contextMode"},{in:"body",key:"parts"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/command",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}shell(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"command"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/shell",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}revert(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"partID"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/revert",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}unrevert(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/unrevert",...r,...n})}get contextMode(){return this._contextMode??(this._contextMode=new K({client:this.client}))}},Y=class extends u{event(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).sse.get({url:"/session/{sessionID}/message/{messageID}/event",...e,...r})}},Z=class extends u{remove(t,e){let r=o([t],[{args:[{in:"path",key:"providerID"}]}]);return (e?.client??this.client).delete({url:"/auth/{providerID}",...e,...r})}set(t,e){let r=o([t],[{args:[{in:"path",key:"providerID"},{key:"auth",map:"body"}]}]);return (e?.client??this.client).put({url:"/auth/{providerID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},ee=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/project",...e,...r})}current(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/project/current",...e,...r})}initGit(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return (e?.client??this.client).post({url:"/project/git/init",...e,...r})}update(t,e){let r=o([t],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"body",key:"name"},{in:"body",key:"icon"},{in:"body",key:"commands"}]}]);return (e?.client??this.client).patch({url:"/project/{projectID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},re=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/pty",...e,...r})}create(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"body",key:"command"},{in:"body",key:"args"},{in:"body",key:"cwd"},{in:"body",key:"title"},{in:"body",key:"env"}]}]);return (e?.client??this.client).post({url:"/pty",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}remove(t,e){let r=o([t],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).delete({url:"/pty/{ptyID}",...e,...r})}get(t,e){let r=o([t],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/pty/{ptyID}",...e,...r})}update(t,e){let r=o([t],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"body",key:"title"},{in:"body",key:"size"}]}]);return (e?.client??this.client).put({url:"/pty/{ptyID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}connect(t,e){let r=o([t],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/pty/{ptyID}/connect",...e,...r})}},te=class extends u{get(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/config",...e,...r})}update(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"config",map:"body"}]}]);return (e?.client??this.client).patch({url:"/config",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}providers(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/config/providers",...e,...r})}},se=class extends u{default(t){return (t?.client??this.client).get({url:"/model/default",...t})}parse(t,e){let r=o([t],[{args:[{in:"query",key:"model"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/model/parse",...e,...r})}},ne=class extends u{ids(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/experimental/tool/ids",...e,...r})}list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"provider"},{in:"query",key:"model"}]}]);return (e?.client??this.client).get({url:"/experimental/tool",...e,...r})}},oe=class extends u{remove(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"worktreeRemoveInput",map:"body"}]}]);return (e?.client??this.client).delete({url:"/experimental/worktree",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/experimental/worktree",...e,...r})}create(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"worktreeCreateInput",map:"body"}]}]);return (e?.client??this.client).post({url:"/experimental/worktree",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}reset(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"worktreeResetInput",map:"body"}]}]);return (e?.client??this.client).post({url:"/experimental/worktree/reset",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},ie=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{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 (e?.client??this.client).get({url:"/experimental/session",...e,...r})}},ae=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/experimental/resource",...e,...r})}},pe=class extends u{constructor(){super(...arguments);l(this,"_session");l(this,"_resource");}get session(){return this._session??(this._session=new ie({client:this.client}))}get resource(){return this._resource??(this._resource=new ae({client:this.client}))}},le=class extends u{delete(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...e,...r})}update(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"},{key:"part",map:"body"}]}]);return (e?.client??this.client).patch({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},G=class extends u{respond(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"permissionID"},{in:"query",key:"directory"},{in:"body",key:"response"}]}]);return (e?.client??this.client).post({url:"/session/{sessionID}/permissions/{permissionID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}reply(t,e){let r=o([t],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"body",key:"reply"},{in:"body",key:"message"}]}]);return (e?.client??this.client).post({url:"/permission/{requestID}/reply",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/permission",...e,...r})}},ye=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/question",...e,...r})}reply(t,e){let r=o([t],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"body",key:"answers"}]}]);return (e?.client??this.client).post({url:"/question/{requestID}/reply",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}reject(t,e){let r=o([t],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).post({url:"/question/{requestID}/reject",...e,...r})}},ue=class extends u{authorize(t,e){let r=o([t],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"body",key:"method"}]}]);return (e?.client??this.client).post({url:"/provider/{providerID}/oauth/authorize",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}callback(t,e){let r=o([t],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"body",key:"method"},{in:"body",key:"code"}]}]);return (e?.client??this.client).post({url:"/provider/{providerID}/oauth/callback",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},de=class extends u{constructor(){super(...arguments);l(this,"_oauth");}list(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/provider",...r,...n})}auth(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/provider/auth",...r,...n})}get oauth(){return this._oauth??(this._oauth=new ue({client:this.client}))}},ce=class extends u{text(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"pattern"}]}]);return (e?.client??this.client).get({url:"/find",...e,...r})}files(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"query"},{in:"query",key:"dirs"},{in:"query",key:"type"},{in:"query",key:"limit"}]}]);return (e?.client??this.client).get({url:"/find/file",...e,...r})}symbols(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"query"}]}]);return (e?.client??this.client).get({url:"/find/symbol",...e,...r})}},ge=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"path"}]}]);return (e?.client??this.client).get({url:"/file",...e,...r})}read(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"path"}]}]);return (e?.client??this.client).get({url:"/file/content",...e,...r})}status(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/file/status",...e,...r})}},me=class extends u{remove(t,e){let r=o([t],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).delete({url:"/mcp/{name}/auth",...e,...r})}start(t,e){let r=o([t],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).post({url:"/mcp/{name}/auth",...e,...r})}callback(t,e){let r=o([t],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"body",key:"code"}]}]);return (e?.client??this.client).post({url:"/mcp/{name}/auth/callback",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}authenticate(t,e){let r=o([t],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).post({url:"/mcp/{name}/auth/authenticate",...e,...r})}},he=class extends u{constructor(){super(...arguments);l(this,"_auth");}status(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/mcp",...r,...n})}add(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"name"},{in:"body",key:"config"}]}]);return (r?.client??this.client).post({url:"/mcp",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}connect(e,r){let n=o([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/mcp/{name}/connect",...r,...n})}disconnect(e,r){let n=o([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/mcp/{name}/disconnect",...r,...n})}get auth(){return this._auth??(this._auth=new me({client:this.client}))}},be=class extends u{next(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/tui/control/next",...e,...r})}response(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"body",map:"body"}]}]);return (e?.client??this.client).post({url:"/tui/control/response",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},Re=class extends u{constructor(){super(...arguments);l(this,"_control");}appendPrompt(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"text"}]}]);return (r?.client??this.client).post({url:"/tui/append-prompt",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}openHelp(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/open-help",...r,...n})}openSessions(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/open-sessions",...r,...n})}openThemes(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/open-themes",...r,...n})}openModels(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/open-models",...r,...n})}submitPrompt(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/submit-prompt",...r,...n})}clearPrompt(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/clear-prompt",...r,...n})}executeCommand(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"command"}]}]);return (r?.client??this.client).post({url:"/tui/execute-command",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}showToast(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"title"},{in:"body",key:"message"},{in:"body",key:"variant"},{in:"body",key:"duration"}]}]);return (r?.client??this.client).post({url:"/tui/show-toast",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}publish(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{key:"body",map:"body"}]}]);return (r?.client??this.client).post({url:"/tui/publish",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}selectSession(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"sessionID"}]}]);return (r?.client??this.client).post({url:"/tui/select-session",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}get control(){return this._control??(this._control=new be({client:this.client}))}},xe=class extends u{dispose(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).post({url:"/instance/dispose",...e,...r})}},Ee=class extends u{get(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/path",...e,...r})}},fe=class extends u{get(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/vcs",...e,...r})}},ke=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"contextMode"}]}]);return (e?.client??this.client).get({url:"/command",...e,...r})}},Se=class extends u{log(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"body",key:"service"},{in:"body",key:"level"},{in:"body",key:"message"},{in:"body",key:"extra"}]}]);return (e?.client??this.client).post({url:"/log",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}agents(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/agent",...e,...r})}skills(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/skill",...e,...r})}},ve=class extends u{create(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"body",key:"name"},{in:"body",key:"mode"},{in:"body",key:"permission"},{in:"body",key:"description"},{in:"body",key:"prompt"},{in:"body",key:"model"},{in:"body",key:"temperature"},{in:"body",key:"topP"},{in:"body",key:"color"},{in:"body",key:"hidden"},{in:"body",key:"variant"},{in:"body",key:"steps"},{in:"body",key:"options"}]}]);return (e?.client??this.client).post({url:"/agent",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}get(t,e){let r=o([t],[{args:[{in:"path",key:"agentID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/agent/{agentID}",...e,...r})}event(t,e){let r=o([t],[{args:[{in:"path",key:"agentID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).sse.get({url:"/agent/{agentID}/event",...e,...r})}default(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/agent/default",...e,...r})}},Te=class extends u{status(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/lsp",...e,...r})}},we=class extends u{status(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/formatter",...e,...r})}},Oe=class extends u{subscribe(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).sse.get({url:"/event",...e,...r})}publish(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"event",map:"body"}]}]);return (e?.client??this.client).post({url:"/event",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},z=class z extends u{constructor(e){super(e);l(this,"_global");l(this,"_session");l(this,"_message");l(this,"_auth");l(this,"_project");l(this,"_pty");l(this,"_config");l(this,"_model");l(this,"_tool");l(this,"_worktree");l(this,"_experimental");l(this,"_part");l(this,"_permission");l(this,"_question");l(this,"_provider");l(this,"_find");l(this,"_file");l(this,"_mcp");l(this,"_tui");l(this,"_instance");l(this,"_path");l(this,"_vcs");l(this,"_command");l(this,"_app");l(this,"_agent");l(this,"_lsp");l(this,"_formatter");l(this,"_event");z.__registry.set(this,e?.key);}get global(){return this._global??(this._global=new J({client:this.client}))}get session(){return this._session??(this._session=new X({client:this.client}))}get message(){return this._message??(this._message=new Y({client:this.client}))}get auth(){return this._auth??(this._auth=new Z({client:this.client}))}get project(){return this._project??(this._project=new ee({client:this.client}))}get pty(){return this._pty??(this._pty=new re({client:this.client}))}get config(){return this._config??(this._config=new te({client:this.client}))}get model(){return this._model??(this._model=new se({client:this.client}))}get tool(){return this._tool??(this._tool=new ne({client:this.client}))}get worktree(){return this._worktree??(this._worktree=new oe({client:this.client}))}get experimental(){return this._experimental??(this._experimental=new pe({client:this.client}))}get part(){return this._part??(this._part=new le({client:this.client}))}get permission(){return this._permission??(this._permission=new G({client:this.client}))}get question(){return this._question??(this._question=new ye({client:this.client}))}get provider(){return this._provider??(this._provider=new de({client:this.client}))}get find(){return this._find??(this._find=new ce({client:this.client}))}get file(){return this._file??(this._file=new ge({client:this.client}))}get mcp(){return this._mcp??(this._mcp=new he({client:this.client}))}get tui(){return this._tui??(this._tui=new Re({client:this.client}))}get instance(){return this._instance??(this._instance=new xe({client:this.client}))}get path(){return this._path??(this._path=new Ee({client:this.client}))}get vcs(){return this._vcs??(this._vcs=new fe({client:this.client}))}get command(){return this._command??(this._command=new ke({client:this.client}))}get app(){return this._app??(this._app=new Se({client:this.client}))}get agent(){return this._agent??(this._agent=new ve({client:this.client}))}get lsp(){return this._lsp??(this._lsp=new Te({client:this.client}))}get formatter(){return this._formatter??(this._formatter=new we({client:this.client}))}get event(){return this._event??(this._event=new Oe({client:this.client}))}};l(z,"__registry",new H);var _=z;function Be(s){if(s?.fetch||(s={...s,fetch:r=>(r.timeout=false,fetch(r))}),s?.directory){let r=/[^\x00-\x7F]/.test(s.directory)?encodeURIComponent(s.directory):s.directory;s.headers={...s.headers,"x-easbot-directory|":r};}let t=q(s);return new _({client:t})}async function We(s){s=Object.assign({hostname:"127.0.0.1",port:4096,timeout:5e3},s??{});let t=["serve",`--hostname=${s.hostname}`,`--port=${s.port}`];s.config?.logLevel&&t.push(`--log-level=${s.config.logLevel}`);let e=spawn("easbot",t,{signal:s.signal,env:{...process.env,EASBOT_CONFIG_CONTENT:JSON.stringify(s.config??{})}});return {url:await new Promise((n,d)=>{let p=setTimeout(()=>{d(new Error(`Timeout waiting for server to start after ${s.timeout}ms`));},s.timeout),i="";e.stdout?.on("data",a=>{i+=a.toString();let m=i.split(`
|
|
6
|
+
`);try{P=JSON.parse(w),Ce=!0;}catch{P=w;}}Ce&&(n&&await n(P),r&&(P=await r(P))),e?.({data:P,event:Ie,id:y,retry:g}),j.length&&(yield P);}}}finally{v.removeEventListener("abort",De),T.releaseLock();}break}catch(O){if(t?.(O),p!==void 0&&b>=p)break;let D=Math.min(g*2**(b-1),i??3e4);await f(D);}}}()}}var Xe=s=>{switch(s){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},Ye=s=>{switch(s){case "form":return ",";case "pipeDelimited":return "|";case "spaceDelimited":return "%20";default:return ","}},Ze=s=>{switch(s){case "label":return ".";case "matrix":return ";";case "simple":return ",";default:return "&"}},F=({allowReserved:s,explode:t,name:e,style:r,value:n})=>{if(!t){let i=(s?n:n.map(a=>encodeURIComponent(a))).join(Ye(r));switch(r){case "label":return `.${i}`;case "matrix":return `;${e}=${i}`;case "simple":return i;default:return `${e}=${i}`}}let d=Xe(r),p=n.map(i=>r==="label"||r==="simple"?s?i:encodeURIComponent(i):I({allowReserved:s,name:e,value:i})).join(d);return r==="label"||r==="matrix"?d+p:p},I=({allowReserved:s,name:t,value:e})=>{if(e==null)return "";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return `${t}=${s?e:encodeURIComponent(e)}`},U=({allowReserved:s,explode:t,name:e,style:r,value:n,valueOnly:d})=>{if(n instanceof Date)return d?n.toISOString():`${e}=${n.toISOString()}`;if(r!=="deepObject"&&!t){let a=[];Object.entries(n).forEach(([c,y])=>{a=[...a,c,s?y:encodeURIComponent(y)];});let m=a.join(",");switch(r){case "form":return `${e}=${m}`;case "label":return `.${m}`;case "matrix":return `;${e}=${m}`;default:return m}}let p=Ze(r),i=Object.entries(n).map(([a,m])=>I({allowReserved:s,name:r==="deepObject"?`${e}[${a}]`:a,value:m})).join(p);return r==="label"||r==="matrix"?p+i:i};var er=/\{[^{}]+\}/g,rr=({path:s,url:t})=>{let e=t,r=t.match(er);if(r)for(let n of r){let d=false,p=n.substring(1,n.length-1),i="simple";p.endsWith("*")&&(d=true,p=p.substring(0,p.length-1)),p.startsWith(".")?(p=p.substring(1),i="label"):p.startsWith(";")&&(p=p.substring(1),i="matrix");let a=s[p];if(a==null)continue;if(Array.isArray(a)){e=e.replace(n,F({explode:d,name:p,style:i,value:a}));continue}if(typeof a=="object"){e=e.replace(n,U({explode:d,name:p,style:i,value:a,valueOnly:true}));continue}if(i==="matrix"){e=e.replace(n,`;${I({name:p,value:a})}`);continue}let m=encodeURIComponent(i==="label"?`.${a}`:a);e=e.replace(n,m);}return e},Me=({baseUrl:s,path:t,query:e,querySerializer:r,url:n})=>{let d=n.startsWith("/")?n:`/${n}`,p=(s??"")+d;t&&(p=rr({path:t,url:p}));let i=e?r(e):"";return i.startsWith("?")&&(i=i.substring(1)),i&&(p+=`?${i}`),p};function N(s){let t=s.body!==void 0;if(t&&s.bodySerializer)return "serializedBody"in s?s.serializedBody!==void 0&&s.serializedBody!==""?s.serializedBody:null:s.body!==""?s.body:null;if(t)return s.body}var je=async(s,t)=>{let e=typeof t=="function"?await t(s):t;if(e)return s.scheme==="bearer"?`Bearer ${e}`:s.scheme==="basic"?`Basic ${btoa(e)}`:e};var W={bodySerializer:s=>JSON.stringify(s,(t,e)=>typeof e=="bigint"?e.toString():e)};var Fe=({parameters:s={},...t}={})=>r=>{let n=[];if(r&&typeof r=="object")for(let d in r){let p=r[d];if(p==null)continue;let i=s[d]||t;if(Array.isArray(p)){let a=F({allowReserved:i.allowReserved,explode:true,name:d,style:"form",value:p,...i.array});a&&n.push(a);}else if(typeof p=="object"){let a=U({allowReserved:i.allowReserved,explode:true,name:d,style:"deepObject",value:p,...i.object});a&&n.push(a);}else {let a=I({allowReserved:i.allowReserved,name:d,value:p});a&&n.push(a);}}return n.join("&")},Ue=s=>{if(!s)return "stream";let t=s.split(";")[0]?.trim();if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return "json";if(t==="multipart/form-data")return "formData";if(["application/","audio/","image/","video/"].some(e=>t.startsWith(e)))return "blob";if(t.startsWith("text/"))return "text"}},tr=(s,t)=>t?!!(s.headers.has(t)||s.query?.[t]||s.headers.get("Cookie")?.includes(`${t}=`)):false,Le=async({security:s,...t})=>{for(let e of s){if(tr(t,e.name))continue;let r=await je(e,t.auth);if(!r)continue;let n=e.name??"Authorization";switch(e.in){case "query":t.query||(t.query={}),t.query[n]=r;break;case "cookie":t.headers.append("Cookie",`${n}=${r}`);break;default:t.headers.set(n,r);break}}},Q=s=>Me({baseUrl:s.baseUrl,path:s.path,query:s.query,querySerializer:typeof s.querySerializer=="function"?s.querySerializer:Fe(s.querySerializer),url:s.url}),$=(s,t)=>{let e={...s,...t};return e.baseUrl?.endsWith("/")&&(e.baseUrl=e.baseUrl.substring(0,e.baseUrl.length-1)),e.headers=L(s.headers,t.headers),e},sr=s=>{let t=[];return s.forEach((e,r)=>{t.push([r,e]);}),t},L=(...s)=>{let t=new Headers;for(let e of s){if(!e)continue;let r=e instanceof Headers?sr(e):Object.entries(e);for(let[n,d]of r)if(d===null)t.delete(n);else if(Array.isArray(d))for(let p of d)t.append(n,p);else d!==void 0&&t.set(n,typeof d=="object"?JSON.stringify(d):d);}return t},C=class{constructor(){l(this,"fns",[]);}clear(){this.fns=[];}eject(t){let e=this.getInterceptorIndex(t);this.fns[e]&&(this.fns[e]=null);}exists(t){let e=this.getInterceptorIndex(t);return !!this.fns[e]}getInterceptorIndex(t){return typeof t=="number"?this.fns[t]?t:-1:this.fns.indexOf(t)}update(t,e){let r=this.getInterceptorIndex(t);return this.fns[r]?(this.fns[r]=e,t):false}use(t){return this.fns.push(t),this.fns.length-1}},Ge=()=>({error:new C,request:new C,response:new C}),nr=Fe({allowReserved:false,array:{explode:true,style:"form"},object:{explode:true,style:"deepObject"}}),or={"Content-Type":"application/json"},A=(s={})=>({...W,headers:or,parseAs:"auto",querySerializer:nr,...s});var q=(s={})=>{let t=$(A(),s),e=()=>({...t}),r=c=>(t=$(t,c),e()),n=Ge(),d=async c=>{let y={...t,...c,fetch:c.fetch??t.fetch??globalThis.fetch,headers:L(t.headers,c.headers),serializedBody:void 0};y.security&&await Le({...y,security:y.security}),y.requestValidator&&await y.requestValidator(y),y.body!==void 0&&y.bodySerializer&&(y.serializedBody=y.bodySerializer(y.body)),(y.body===void 0||y.serializedBody==="")&&y.headers.delete("Content-Type");let f=y,S=Q(f);return {opts:f,url:S}},p=async c=>{let y=c.throwOnError??t.throwOnError,f=c.responseStyle??t.responseStyle,S,h;try{let{opts:g,url:b}=await d(c),v={redirect:"follow",...g,body:N(g)};S=new Request(b,v);for(let x of n.request.fns)x&&(S=await x(S,g));let M=g.fetch;h=await M(S);for(let x of n.response.fns)x&&(h=await x(h,S,g));let O={request:S,response:h};if(h.ok){let x=(g.parseAs==="auto"?Ue(h.headers.get("Content-Type")):g.parseAs)??"json";if(h.status===204||h.headers.get("Content-Length")==="0"){let k;switch(x){case "arrayBuffer":case "blob":case "text":k=await h[x]();break;case "formData":k=new FormData;break;case "stream":k=h.body;break;default:k={};break}return g.responseStyle==="data"?k:{data:k,...O}}let T;switch(x){case "arrayBuffer":case "blob":case "formData":case "text":T=await h[x]();break;case "json":{let k=await h.text();T=k?JSON.parse(k):{};break}case "stream":return g.responseStyle==="data"?h.body:{data:h.body,...O}}return x==="json"&&(g.responseValidator&&await g.responseValidator(T),g.responseTransformer&&(T=await g.responseTransformer(T))),g.responseStyle==="data"?T:{data:T,...O}}let D=await h.text(),B;try{B=JSON.parse(D);}catch{}throw B??D}catch(g){let b=g;for(let v of n.error.fns)v&&(b=await v(b,h,S,c));if(b=b||{},y)throw b;return f==="data"?void 0:{error:b,request:S,response:h}}},i=c=>y=>p({...y,method:c}),a=c=>async y=>{let{opts:f,url:S}=await d(y);return qe({...f,body:f.body,method:c,onRequest:async(h,g)=>{let b=new Request(h,g);for(let v of n.request.fns)v&&(b=await v(b,f));return b},serializedBody:N(f),url:S})};return {buildUrl:c=>Q({...t,...c}),connect:i("CONNECT"),delete:i("DELETE"),get:i("GET"),getConfig:e,head:i("HEAD"),interceptors:n,options:i("OPTIONS"),patch:i("PATCH"),post:i("POST"),put:i("PUT"),request:p,setConfig:r,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:i("TRACE")}};var ir={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},ar=Object.entries(ir),_e=(s,t)=>{t||(t=new Map);for(let e of s)"in"in e?e.key&&t.set(e.key,{in:e.in,map:e.map}):"key"in e?t.set(e.key,{map:e.map}):e.args&&_e(e.args,t);return t},pr=s=>{for(let[t,e]of Object.entries(s))e&&typeof e=="object"&&!Array.isArray(e)&&!Object.keys(e).length&&delete s[t];},o=(s,t)=>{let e={body:{},headers:{},path:{},query:{}},r=_e(t),n;for(let[d,p]of s.entries())if(t[d]&&(n=t[d]),!!n)if("in"in n)if(n.key){let i=r.get(n.key),a=i.map||n.key;i.in&&(e[i.in][a]=p);}else e.body=p;else for(let[i,a]of Object.entries(p??{})){let m=r.get(i);if(m)if(m.in){let c=m.map||i;e[m.in][c]=a;}else e[m.map]=a;else {let c=ar.find(([y])=>i.startsWith(y));if(c){let[y,f]=c;e[f][i.slice(y.length)]=a;}else if("allowExtra"in n&&n.allowExtra){for(let[y,f]of Object.entries(n.allowExtra))if(f){e[y][i]=a;break}}}}return pr(e),e};var ze=q(A({baseUrl:"http://localhost:4096"}));var u=class{constructor(t){l(this,"client");this.client=t?.client??ze;}},H=class{constructor(){l(this,"defaultKey","default");l(this,"instances",new Map);}get(t){let e=this.instances.get(t??this.defaultKey);if(!e)throw new Error('No SDK client found. Create one with "new EasbotClient()" to fix this error.');return e}set(t,e){this.instances.set(e??this.defaultKey,t);}},V=class extends u{get(t){return (t?.client??this.client).get({url:"/global/config",...t})}update(t,e){let r=o([t],[{args:[{key:"config",map:"body"}]}]);return (e?.client??this.client).patch({url:"/global/config",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},J=class extends u{constructor(){super(...arguments);l(this,"_config");}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})}get config(){return this._config??(this._config=new V({client:this.client}))}},K=class extends u{get(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/session/{sessionID}/contextMode",...e,...r})}set(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"mode"}]}]);return (e?.client??this.client).put({url:"/session/{sessionID}/contextMode",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},X=class extends u{constructor(){super(...arguments);l(this,"_contextMode");}event(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).sse.get({url:"/session/{sessionID}/event",...r,...n})}list(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"query",key:"roots"},{in:"query",key:"start"},{in:"query",key:"search"},{in:"query",key:"limit"}]}]);return (r?.client??this.client).get({url:"/session",...r,...n})}create(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"parentID"},{in:"body",key:"title"},{in:"body",key:"permission"},{in:"body",key:"contextMode"}]}]);return (r?.client??this.client).post({url:"/session",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}status(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/status",...r,...n})}delete(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).delete({url:"/session/{sessionID}",...r,...n})}get(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}",...r,...n})}update(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"title"},{in:"body",key:"time"}]}]);return (r?.client??this.client).patch({url:"/session/{sessionID}",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}children(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/children",...r,...n})}todo(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/todo",...r,...n})}init(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"modelID"},{in:"body",key:"providerID"},{in:"body",key:"messageID"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/init",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}fork(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"contextMode"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/fork",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}abort(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/abort",...r,...n})}unshare(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).delete({url:"/session/{sessionID}/share",...r,...n})}share(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/share",...r,...n})}diff(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"messageID"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/diff",...r,...n})}summarize(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"providerID"},{in:"body",key:"modelID"},{in:"body",key:"auto"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/summarize",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}messages(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"limit"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/message",...r,...n})}prompt(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{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:"contextMode"},{in:"body",key:"parts"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/message",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}deleteMessage(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}",...r,...n})}message(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/session/{sessionID}/message/{messageID}",...r,...n})}promptAsync(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"agent"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"parts"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/prompt_async",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}command(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{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:"contextMode"},{in:"body",key:"parts"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/command",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}shell(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"command"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/shell",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}revert(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"body",key:"messageID"},{in:"body",key:"partID"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/revert",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}unrevert(e,r){let n=o([e],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/session/{sessionID}/unrevert",...r,...n})}get contextMode(){return this._contextMode??(this._contextMode=new K({client:this.client}))}},Y=class extends u{event(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).sse.get({url:"/session/{sessionID}/message/{messageID}/event",...e,...r})}},Z=class extends u{remove(t,e){let r=o([t],[{args:[{in:"path",key:"providerID"}]}]);return (e?.client??this.client).delete({url:"/auth/{providerID}",...e,...r})}set(t,e){let r=o([t],[{args:[{in:"path",key:"providerID"},{key:"auth",map:"body"}]}]);return (e?.client??this.client).put({url:"/auth/{providerID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},ee=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/project",...e,...r})}current(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/project/current",...e,...r})}initGit(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return (e?.client??this.client).post({url:"/project/git/init",...e,...r})}update(t,e){let r=o([t],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"body",key:"name"},{in:"body",key:"icon"},{in:"body",key:"commands"}]}]);return (e?.client??this.client).patch({url:"/project/{projectID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},re=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/pty",...e,...r})}create(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"body",key:"command"},{in:"body",key:"args"},{in:"body",key:"cwd"},{in:"body",key:"title"},{in:"body",key:"env"}]}]);return (e?.client??this.client).post({url:"/pty",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}remove(t,e){let r=o([t],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).delete({url:"/pty/{ptyID}",...e,...r})}get(t,e){let r=o([t],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/pty/{ptyID}",...e,...r})}update(t,e){let r=o([t],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"body",key:"title"},{in:"body",key:"size"}]}]);return (e?.client??this.client).put({url:"/pty/{ptyID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}connect(t,e){let r=o([t],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/pty/{ptyID}/connect",...e,...r})}},te=class extends u{get(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/config",...e,...r})}update(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"config",map:"body"}]}]);return (e?.client??this.client).patch({url:"/config",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}providers(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/config/providers",...e,...r})}},se=class extends u{default(t){return (t?.client??this.client).get({url:"/model/default",...t})}parse(t,e){let r=o([t],[{args:[{in:"query",key:"model"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/model/parse",...e,...r})}},ne=class extends u{ids(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/experimental/tool/ids",...e,...r})}list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"provider"},{in:"query",key:"model"}]}]);return (e?.client??this.client).get({url:"/experimental/tool",...e,...r})}},oe=class extends u{remove(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"worktreeRemoveInput",map:"body"}]}]);return (e?.client??this.client).delete({url:"/experimental/worktree",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/experimental/worktree",...e,...r})}create(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"worktreeCreateInput",map:"body"}]}]);return (e?.client??this.client).post({url:"/experimental/worktree",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}reset(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"worktreeResetInput",map:"body"}]}]);return (e?.client??this.client).post({url:"/experimental/worktree/reset",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},ie=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{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 (e?.client??this.client).get({url:"/experimental/session",...e,...r})}},ae=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/experimental/resource",...e,...r})}},pe=class extends u{constructor(){super(...arguments);l(this,"_session");l(this,"_resource");}get session(){return this._session??(this._session=new ie({client:this.client}))}get resource(){return this._resource??(this._resource=new ae({client:this.client}))}},le=class extends u{delete(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...e,...r})}update(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"},{key:"part",map:"body"}]}]);return (e?.client??this.client).patch({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},G=class extends u{respond(t,e){let r=o([t],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"permissionID"},{in:"query",key:"directory"},{in:"body",key:"response"}]}]);return (e?.client??this.client).post({url:"/session/{sessionID}/permissions/{permissionID}",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}reply(t,e){let r=o([t],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"body",key:"reply"},{in:"body",key:"message"}]}]);return (e?.client??this.client).post({url:"/permission/{requestID}/reply",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/permission",...e,...r})}},ye=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/question",...e,...r})}reply(t,e){let r=o([t],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"body",key:"answers"}]}]);return (e?.client??this.client).post({url:"/question/{requestID}/reply",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}reject(t,e){let r=o([t],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).post({url:"/question/{requestID}/reject",...e,...r})}},ue=class extends u{authorize(t,e){let r=o([t],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"body",key:"method"}]}]);return (e?.client??this.client).post({url:"/provider/{providerID}/oauth/authorize",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}callback(t,e){let r=o([t],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"body",key:"method"},{in:"body",key:"code"}]}]);return (e?.client??this.client).post({url:"/provider/{providerID}/oauth/callback",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},de=class extends u{constructor(){super(...arguments);l(this,"_oauth");}list(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/provider",...r,...n})}auth(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/provider/auth",...r,...n})}get oauth(){return this._oauth??(this._oauth=new ue({client:this.client}))}},ce=class extends u{text(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"pattern"}]}]);return (e?.client??this.client).get({url:"/find",...e,...r})}files(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"query"},{in:"query",key:"dirs"},{in:"query",key:"type"},{in:"query",key:"limit"}]}]);return (e?.client??this.client).get({url:"/find/file",...e,...r})}symbols(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"query"}]}]);return (e?.client??this.client).get({url:"/find/symbol",...e,...r})}},ge=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"path"}]}]);return (e?.client??this.client).get({url:"/file",...e,...r})}read(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"path"}]}]);return (e?.client??this.client).get({url:"/file/content",...e,...r})}status(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/file/status",...e,...r})}},me=class extends u{remove(t,e){let r=o([t],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).delete({url:"/mcp/{name}/auth",...e,...r})}start(t,e){let r=o([t],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).post({url:"/mcp/{name}/auth",...e,...r})}callback(t,e){let r=o([t],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"body",key:"code"}]}]);return (e?.client??this.client).post({url:"/mcp/{name}/auth/callback",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}authenticate(t,e){let r=o([t],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).post({url:"/mcp/{name}/auth/authenticate",...e,...r})}},he=class extends u{constructor(){super(...arguments);l(this,"_auth");}status(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).get({url:"/mcp",...r,...n})}add(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"name"},{in:"body",key:"config"}]}]);return (r?.client??this.client).post({url:"/mcp",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}connect(e,r){let n=o([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/mcp/{name}/connect",...r,...n})}disconnect(e,r){let n=o([e],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/mcp/{name}/disconnect",...r,...n})}get auth(){return this._auth??(this._auth=new me({client:this.client}))}},be=class extends u{next(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/tui/control/next",...e,...r})}response(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"body",map:"body"}]}]);return (e?.client??this.client).post({url:"/tui/control/response",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},xe=class extends u{constructor(){super(...arguments);l(this,"_control");}appendPrompt(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"text"}]}]);return (r?.client??this.client).post({url:"/tui/append-prompt",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}openHelp(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/open-help",...r,...n})}openSessions(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/open-sessions",...r,...n})}openThemes(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/open-themes",...r,...n})}openModels(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/open-models",...r,...n})}submitPrompt(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/submit-prompt",...r,...n})}clearPrompt(e,r){let n=o([e],[{args:[{in:"query",key:"directory"}]}]);return (r?.client??this.client).post({url:"/tui/clear-prompt",...r,...n})}executeCommand(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"command"}]}]);return (r?.client??this.client).post({url:"/tui/execute-command",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}showToast(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"title"},{in:"body",key:"message"},{in:"body",key:"variant"},{in:"body",key:"duration"}]}]);return (r?.client??this.client).post({url:"/tui/show-toast",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}publish(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{key:"body",map:"body"}]}]);return (r?.client??this.client).post({url:"/tui/publish",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}selectSession(e,r){let n=o([e],[{args:[{in:"query",key:"directory"},{in:"body",key:"sessionID"}]}]);return (r?.client??this.client).post({url:"/tui/select-session",...r,...n,headers:{"Content-Type":"application/json",...r?.headers,...n.headers}})}get control(){return this._control??(this._control=new be({client:this.client}))}},Re=class extends u{dispose(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).post({url:"/instance/dispose",...e,...r})}},Ee=class extends u{get(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/path",...e,...r})}},fe=class extends u{get(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/vcs",...e,...r})}},ke=class extends u{list(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"query",key:"contextMode"}]}]);return (e?.client??this.client).get({url:"/command",...e,...r})}},Se=class extends u{log(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"body",key:"service"},{in:"body",key:"level"},{in:"body",key:"message"},{in:"body",key:"extra"}]}]);return (e?.client??this.client).post({url:"/log",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}agents(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/agent",...e,...r})}skills(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/skill",...e,...r})}context(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/context",...e,...r})}},ve=class extends u{create(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{in:"body",key:"name"},{in:"body",key:"mode"},{in:"body",key:"permission"},{in:"body",key:"description"},{in:"body",key:"prompt"},{in:"body",key:"model"},{in:"body",key:"temperature"},{in:"body",key:"topP"},{in:"body",key:"color"},{in:"body",key:"hidden"},{in:"body",key:"variant"},{in:"body",key:"steps"},{in:"body",key:"options"}]}]);return (e?.client??this.client).post({url:"/agent",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}get(t,e){let r=o([t],[{args:[{in:"path",key:"agentID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/agent/{agentID}",...e,...r})}event(t,e){let r=o([t],[{args:[{in:"path",key:"agentID"},{in:"query",key:"directory"}]}]);return (e?.client??this.client).sse.get({url:"/agent/{agentID}/event",...e,...r})}default(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/agent/default",...e,...r})}},Te=class extends u{status(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/lsp",...e,...r})}},we=class extends u{status(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).get({url:"/formatter",...e,...r})}},Oe=class extends u{subscribe(t,e){let r=o([t],[{args:[{in:"query",key:"directory"}]}]);return (e?.client??this.client).sse.get({url:"/event",...e,...r})}publish(t,e){let r=o([t],[{args:[{in:"query",key:"directory"},{key:"event",map:"body"}]}]);return (e?.client??this.client).post({url:"/event",...e,...r,headers:{"Content-Type":"application/json",...e?.headers,...r.headers}})}},z=class z extends u{constructor(e){super(e);l(this,"_global");l(this,"_session");l(this,"_message");l(this,"_auth");l(this,"_project");l(this,"_pty");l(this,"_config");l(this,"_model");l(this,"_tool");l(this,"_worktree");l(this,"_experimental");l(this,"_part");l(this,"_permission");l(this,"_question");l(this,"_provider");l(this,"_find");l(this,"_file");l(this,"_mcp");l(this,"_tui");l(this,"_instance");l(this,"_path");l(this,"_vcs");l(this,"_command");l(this,"_app");l(this,"_agent");l(this,"_lsp");l(this,"_formatter");l(this,"_event");z.__registry.set(this,e?.key);}get global(){return this._global??(this._global=new J({client:this.client}))}get session(){return this._session??(this._session=new X({client:this.client}))}get message(){return this._message??(this._message=new Y({client:this.client}))}get auth(){return this._auth??(this._auth=new Z({client:this.client}))}get project(){return this._project??(this._project=new ee({client:this.client}))}get pty(){return this._pty??(this._pty=new re({client:this.client}))}get config(){return this._config??(this._config=new te({client:this.client}))}get model(){return this._model??(this._model=new se({client:this.client}))}get tool(){return this._tool??(this._tool=new ne({client:this.client}))}get worktree(){return this._worktree??(this._worktree=new oe({client:this.client}))}get experimental(){return this._experimental??(this._experimental=new pe({client:this.client}))}get part(){return this._part??(this._part=new le({client:this.client}))}get permission(){return this._permission??(this._permission=new G({client:this.client}))}get question(){return this._question??(this._question=new ye({client:this.client}))}get provider(){return this._provider??(this._provider=new de({client:this.client}))}get find(){return this._find??(this._find=new ce({client:this.client}))}get file(){return this._file??(this._file=new ge({client:this.client}))}get mcp(){return this._mcp??(this._mcp=new he({client:this.client}))}get tui(){return this._tui??(this._tui=new xe({client:this.client}))}get instance(){return this._instance??(this._instance=new Re({client:this.client}))}get path(){return this._path??(this._path=new Ee({client:this.client}))}get vcs(){return this._vcs??(this._vcs=new fe({client:this.client}))}get command(){return this._command??(this._command=new ke({client:this.client}))}get app(){return this._app??(this._app=new Se({client:this.client}))}get agent(){return this._agent??(this._agent=new ve({client:this.client}))}get lsp(){return this._lsp??(this._lsp=new Te({client:this.client}))}get formatter(){return this._formatter??(this._formatter=new we({client:this.client}))}get event(){return this._event??(this._event=new Oe({client:this.client}))}};l(z,"__registry",new H);var _=z;function Be(s){if(s?.fetch||(s={...s,fetch:r=>(r.timeout=false,fetch(r))}),s?.directory){let r=/[^\x00-\x7F]/.test(s.directory)?encodeURIComponent(s.directory):s.directory;s.headers={...s.headers,"x-easbot-directory|":r};}let t=q(s);return new _({client:t})}async function We(s){s=Object.assign({hostname:"127.0.0.1",port:4096,timeout:5e3},s??{});let t=["serve",`--hostname=${s.hostname}`,`--port=${s.port}`];s.config?.logLevel&&t.push(`--log-level=${s.config.logLevel}`);let e=spawn("easbot",t,{signal:s.signal,env:{...process.env,EASBOT_CONFIG_CONTENT:JSON.stringify(s.config??{})}});return {url:await new Promise((n,d)=>{let p=setTimeout(()=>{d(new Error(`Timeout waiting for server to start after ${s.timeout}ms`));},s.timeout),i="";e.stdout?.on("data",a=>{i+=a.toString();let m=i.split(`
|
|
7
7
|
`);for(let c of m)if(c.startsWith("easbot server listening")){let y=c.match(/on\s+(https?:\/\/[^\s]+)/);if(!y)throw new Error(`Failed to parse server url from output: ${c}`);clearTimeout(p),n(y[1]);return}}),e.stderr?.on("data",a=>{i+=a.toString();}),e.on("exit",a=>{clearTimeout(p);let m=`Server exited with code ${a}`;i.trim()&&(m+=`
|
|
8
8
|
Server output: ${i}`),d(new Error(m));}),e.on("error",a=>{clearTimeout(p),d(a);}),s.signal&&s.signal.addEventListener("abort",()=>{clearTimeout(p),d(new Error("Aborted"));});}),close(){e.kill();}}}function ut(s){let t=[];s?.project&&t.push(`--project=${s.project}`),s?.model&&t.push(`--model=${s.model}`),s?.session&&t.push(`--session=${s.session}`),s?.agent&&t.push(`--agent=${s.agent}`);let e=spawn("easbot",t,{signal:s?.signal,stdio:"inherit",env:{...process.env,EASBOT_CONFIG_CONTENT:JSON.stringify(s?.config??{})}});return {close(){e.kill();}}}async function ht(s){let t=await We({...s});return {client:Be({baseUrl:t.url}),server:t}}export{_ as EasbotClient,G as Permission,Be as createEasbotClient,We as createEasbotServer,ht as createEascode,ut as createEascodeTui};
|