@opencode/console 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -1
- package/THIRD_PARTY_LICENSES.md +16 -0
- package/chunk-0752rr1w.js +1 -0
- package/chunk-11wqcgnn.js +2 -0
- package/{chunk-c16zjbe1.js → chunk-1z17cm3w.js} +2 -2
- package/chunk-38zs2jre.js +1 -0
- package/chunk-3p7x3f0s.js +1 -0
- package/chunk-5a8bvcgq.js +15 -0
- package/chunk-6fqhbptf.js +1 -0
- package/chunk-6hmr86q5.js +3 -0
- package/chunk-6xs4y82y.js +2 -0
- package/chunk-7qa618ad.js +63 -0
- package/chunk-82p6vmpy.js +1 -0
- package/chunk-9dgq3xc0.js +32 -0
- package/chunk-9zpe1ry1.js +2 -0
- package/chunk-b4fde357.js +2 -0
- package/chunk-b6azftzw.js +254 -0
- package/chunk-bcmj4f7y.js +2 -0
- package/chunk-cd4h496v.js +2 -0
- package/chunk-g9f1r3v3.js +1 -0
- package/chunk-gcqbk8bn.js +149 -0
- package/chunk-ghvsrvdw.js +1 -0
- package/chunk-jpqmm6pm.js +2 -0
- package/chunk-jxh84gfh.js +1 -0
- package/chunk-kd1hjfpe.js +1 -0
- package/{chunk-zdf3mvav.js → chunk-m3m5harb.js} +2 -2
- package/chunk-mnjk01tj.js +1 -0
- package/chunk-nqk8n93s.js +1 -0
- package/chunk-qp7a49b3.js +1 -0
- package/chunk-r1adn0ka.js +11 -0
- package/chunk-tamzaefd.js +1 -0
- package/chunk-x65p26st.js +2 -0
- package/chunk-yb3fn5r1.js +2 -0
- package/{chunk-kdkxhbxc.js → chunk-z5mqjw9r.js} +2 -2
- package/dsh-plugin.js +1 -0
- package/index.js +59 -47
- package/package.json +3 -2
- package/pi-extension.js +2 -2
- package/chunk-03p95nje.js +0 -6
- package/chunk-2ktsq2gj.js +0 -3
- package/chunk-2y9vn023.js +0 -1
- package/chunk-5q7mrvv1.js +0 -2
- package/chunk-5w6hy202.js +0 -1
- package/chunk-6mydq7cv.js +0 -2
- package/chunk-6rpbc10h.js +0 -2
- package/chunk-81fv1abj.js +0 -2
- package/chunk-aym5xapq.js +0 -1
- package/chunk-bkr0zk6g.js +0 -32
- package/chunk-c9kvdzct.js +0 -1
- package/chunk-eyf3z07t.js +0 -1
- package/chunk-frqdgjbd.js +0 -17
- package/chunk-fzckrdm3.js +0 -2
- package/chunk-hpy9mszv.js +0 -1
- package/chunk-jh21wbwd.js +0 -2
- package/chunk-kvqewrn5.js +0 -1
- package/chunk-mpmqsnkz.js +0 -1
- package/chunk-mzpdnb17.js +0 -1
- package/chunk-nvh2a5rc.js +0 -254
- package/chunk-p59r4b0j.js +0 -2
- package/chunk-p7wsm5k0.js +0 -1
- package/chunk-sn451nak.js +0 -2
- package/chunk-vqmbpbbm.js +0 -1
- package/chunk-wjghq897.js +0 -63
- package/chunk-xeq3evq0.js +0 -1
package/chunk-2y9vn023.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k,E,e,c,Y,Pe,Nt,no,s,hi,Ce,f,_,Q,vs,Ie,re,ge,i,a,C,M,j,Ae,fr,N,P,ce,un,$t,A,g,Ue,S,O,z,pn,de,xe,ye,vt,dr,Ln,R,jn,fn,so,io,Is,dn,wt,le,xi,oe,hr,gr,hn,gn,xr,Ye,me,r,T,I,Ct,o,Qe,q,yr,yn,l,bn,je,h,Xe,We,br,Ts,Ke,Sr,uo,Os,po,It,_s,Ps,Ht,qn,Wn,Rs,Ns,Wt,dt,fo,mo,ho,At,Ds,Us,$s,Kt,ue,Cr,Ar,wi,_r,tt,bo,ki,Ci,So,vo,En,Ii,Gt,Ai,Ti,Tt,Eo,zs,wo,Oi,Jt,_i,Ge,Mr,Ri,Mi,Fi,Ni,Di,Vt,ko,Ot,Vn,Zt,F,m,Z,Ks,Qt,Ve,Wi,Lr,Oo,An,Ki,_o,Gi,Po,Ji,Vi,st}from"./chunk-bkr0zk6g.js";var ui={};k(ui,{Fetch:()=>yt,RequestInit:()=>Yr,StreamBodyFallback:()=>xn,layer:()=>Qr});var hs={};k(hs,{HttpClient:()=>we,SpanNameGenerator:()=>nn,TracerDisabledWhen:()=>en,TracerHeaderFilter:()=>rn,TracerPropagationEnabled:()=>on,catch:()=>Ws,catchTag:()=>js,catchTags:()=>Gs,circuitBreakerClassifier:()=>Zo,del:()=>qs,execute:()=>ws,filterOrElse:()=>Vs,filterOrFail:()=>Qs,filterStatus:()=>Ys,filterStatusOk:()=>ai,followRedirects:()=>Sa,get:()=>Bs,head:()=>Ms,isHttpClient:()=>Yo,isTransientError:()=>Tr,isTransientResponse:()=>Ir,layerMergedContext:()=>Pr,make:()=>Ur,makeWith:()=>ot,mapRequest:()=>ci,mapRequestEffect:()=>ta,mapRequestInput:()=>ea,mapRequestInputEffect:()=>ra,options:()=>Js,patch:()=>Fs,post:()=>ks,put:()=>Ls,query:()=>As,retry:()=>oa,retryTransient:()=>na,tap:()=>ga,tapError:()=>Ea,tapRequest:()=>ya,timeout:()=>sa,transform:()=>se,transformResponse:()=>Oe,withCircuitBreaker:()=>ia,withCookiesRef:()=>xa,withRateLimiter:()=>aa,withScope:()=>li});var Vr={};k(Vr,{accept:()=>ir,acceptJson:()=>pr,appendUrl:()=>Qn,appendUrlParam:()=>Kn,appendUrlParams:()=>Xn,basicAuth:()=>$n,bearerToken:()=>si,bodyFile:()=>fs,bodyFormData:()=>is,bodyFormDataRecord:()=>cs,bodyJson:()=>ns,bodyJsonUnsafe:()=>ii,bodyStream:()=>ps,bodyText:()=>os,bodyUint8Array:()=>rs,bodyUrlParams:()=>as,compressBody:()=>es,delete:()=>Fn,empty:()=>Io,fromWeb:()=>us,get:()=>ms,head:()=>Nn,isHttpClientRequest:()=>Ft,make:()=>X,makeWith:()=>B,modify:()=>ar,options:()=>vn,patch:()=>kn,post:()=>oi,prependUrl:()=>Gn,put:()=>_n,query:()=>Mn,removeHash:()=>ts,removeHeader:()=>ut,schemaBodyJson:()=>ss,setBody:()=>W,setHash:()=>Fo,setHeader:()=>Lt,setHeaders:()=>sn,setMethod:()=>Te,setUrl:()=>Ao,setUrlParam:()=>Zn,setUrlParams:()=>Mo,toUrl:()=>ee,toWeb:()=>gs,toWebResult:()=>No,trace:()=>Jn,updateHeaders:()=>Bo,updateUrl:()=>Yn,upgrade:()=>zn});var Zr={};k(Zr,{TypeId:()=>mt,filterStatus:()=>mr,filterStatusOk:()=>an,fromWeb:()=>ur,matchStatus:()=>bs,schemaBodyJson:()=>qe,schemaBodyUrlParams:()=>Lo,schemaHeaders:()=>qo,schemaJson:()=>ys,schemaNoBody:()=>xs,stream:()=>Ss,toWeb:()=>Es});var Hn="~effect/Ref",Pa={[Hn]:{_A:c},...ge,toJSON(){return{_id:"Ref",ref:this.ref}}};var Fr=(t)=>I(()=>t.ref.current);var Nr=e(2,(t,n)=>I(()=>{t.ref.current=n(t.ref.current)}));var Le="~effect/http/HttpBody";var vr="~effect/http/HttpBody/HttpBodyError";class Je extends R("HttpBodyError"){[vr]=vr}class Ut{[Le];constructor(){this[Le]=Le}[_](){return this.toJSON()}toString(){return f(this,{ignoreToString:!0})}}class jr extends Ut{_tag="Empty";toJSON(){return{_id:"effect/HttpBody",_tag:"Empty"}}}var Pt=new jr;class zr extends Ut{_tag="Raw";body;contentType;contentLength;constructor(t,n,p){super();this.body=t,this.contentType=n,this.contentLength=p}toJSON(){return{_id:"effect/HttpBody",_tag:"Raw",body:this.body,contentType:this.contentType,contentLength:this.contentLength}}}var Gr=(t,n)=>new zr(t,n?.contentType,n?.contentLength);class ie extends Ut{_tag="Uint8Array";contentType;contentLength;text;_body;constructor(t,n,p,u){super();this._body=t,this.text=u,this.contentType=n,this.contentLength=p}get body(){return this._body??=Rn(this.text)}toJSON(){return{_id:"effect/HttpBody",_tag:"Uint8Array",body:this.contentType.startsWith("text/")||this.contentType.endsWith("json")?new TextDecoder().decode(this.body):`Uint8Array(${this.body.length})`,contentType:this.contentType,contentLength:this.contentLength}}}var he=(t,n)=>new ie(t,n??"application/octet-stream",t.length),Kr=new TextEncoder,pe=globalThis.Buffer,Rn=pe!==void 0?(t)=>pe.from(t,"utf8"):(t)=>Kr.encode(t),zt=(t,n)=>{if(typeof t!=="string")t=t===void 0?"":String(t);if(pe!==void 0)return new ie(void 0,n??"text/plain",pe.byteLength(t,"utf8"),t);let p=Kr.encode(t);return new ie(p,n??"text/plain",p.length,t)},Xr=(t,n)=>zt(JSON.stringify(t),n??"application/json"),$e=(t,n)=>q({try:()=>zt(JSON.stringify(t),n??"application/json"),catch:(p)=>new Je({reason:{_tag:"JsonError"},cause:p})}),to=(t,n)=>{let p=Ot(Qt(t));return(u,d)=>p(u,n).pipe(Ke((y)=>new Je({reason:{_tag:"SchemaError",issue:y},cause:y})),l((y)=>$e(y,d)))},eo=(t,n)=>zt(Di(Ge(t)),n??"application/x-www-form-urlencoded");class ro extends Ut{_tag="FormData";contentType=void 0;contentLength=void 0;formData;constructor(t){super();this.formData=t}toJSON(){return{_id:"effect/HttpBody",_tag:"FormData",formData:this.formData}}}var ze=(t)=>new ro(t),qr=(t,n,p)=>{if(p==null)return;if(typeof p==="object"){t.append(n,p);return}t.append(n,String(p))},oo=(t)=>{let n=new globalThis.FormData;for(let[p,u]of Object.entries(t))if(Array.isArray(u))for(let d of u)qr(n,p,d);else qr(n,p,u);return ze(n)};class ao extends Ut{_tag="Stream";stream;contentType;contentLength;constructor(t,n,p){super();this.stream=t,this.contentType=n,this.contentLength=p}toJSON(){return{_id:"effect/HttpBody",_tag:"Stream",contentType:this.contentType,contentLength:this.contentLength}}}var Yt=(t,n,p)=>new ao(t,n??"application/octet-stream",p),Jr=(t,n,p)=>{let u=_r(t);return M(u)?r(u.value):o(Ve({module:"HttpBody",method:p,description:`Invalid ${n}: ${t}`}))},Tn=ue(function*(t,n,p){let u=p?.offset===void 0?wi:yield*Jr(p.offset,"offset",n),d=p?.bytesToRead===void 0?void 0:yield*Jr(p.bytesToRead,"bytesToRead",n),y=u>=t?BigInt("0"):t-u,x=d===void 0||d>y?y:d;if(x>BigInt(Number.MAX_SAFE_INTEGER))return yield*o(Ve({module:"HttpBody",method:n,description:`Content length exceeds Number.MAX_SAFE_INTEGER: ${x}`}));return Number(x)}),co=(t,n)=>l(st,(p)=>l(p.stat(t),(u)=>h(Tn(u.size,"file",n),(d)=>Yt(p.stream(t,n),n?.contentType,d))));var Ze="~effect/http/HttpClientError",Xt=(t)=>s(t,Ze);class D extends R("HttpClientError"){constructor(t){if("cause"in t.reason)super({...t,cause:t.reason.cause});else super(t)}[Ze]=Ze;get request(){return this.reason.request}get response(){return"response"in this.reason?this.reason.response:void 0}get message(){return this.reason.message}}var Bt=(t)=>t.endsWith("Error")?t.slice(0,-5):t,Dt=(t,n,p)=>n?`${t}: ${n} (${p})`:`${t} error (${p})`,Mt=(t)=>`${t.method} ${Vt(t.url)}`,kt=(t,n)=>({...n,request:{_id:"HttpClientRequest",method:t.request.method,url:Vt(t.request.url)},..."response"in t?{response:{_id:"HttpClientResponse",status:t.response.status}}:void 0});class _t extends R("TransportError"){get methodAndUrl(){return Mt(this.request)}get message(){return Dt(Bt(this._tag),this.description,this.methodAndUrl)}toJSON(){return kt(this,super.toJSON())}}class Se extends R("EncodeError"){get methodAndUrl(){return Mt(this.request)}get message(){return Dt(Bt(this._tag),this.description,this.methodAndUrl)}toJSON(){return kt(this,super.toJSON())}}class tr extends R("InvalidUrlError"){get methodAndUrl(){return Mt(this.request)}get message(){return Dt(Bt(this._tag),this.description,this.methodAndUrl)}toJSON(){return kt(this,super.toJSON())}}class ht extends R("StatusCodeError"){get methodAndUrl(){return Mt(this.request)}get message(){let t=`${this.response.status} ${this.methodAndUrl}`;return Dt(Bt(this._tag),this.description,t)}toJSON(){return kt(this,super.toJSON())}}class gt extends R("DecodeError"){get methodAndUrl(){return Mt(this.request)}get message(){let t=`${this.response.status} ${this.methodAndUrl}`;return Dt(Bt(this._tag),this.description,t)}toJSON(){return kt(this,super.toJSON())}}class er extends R("EmptyBodyError"){get methodAndUrl(){return Mt(this.request)}get message(){let t=`${this.response.status} ${this.methodAndUrl}`;return Dt(Bt(this._tag),this.description,t)}toJSON(){return kt(this,super.toJSON())}}function rr(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"}var lo=[["GET","get"],["POST","post"],["PUT","put"],["DELETE","del"],["PATCH","patch"],["HEAD","head"],["OPTIONS","options"],["TRACE","trace"],["QUERY","query"]];var yo=(t)=>(n)=>n.pipeThrough(new CompressionStream(t)),wn=(t)=>new ReadableStream({start(n){n.enqueue(t),n.close()}}),xo=(t,n,p)=>{if(t._tag!=="Uint8Array"&&t._tag!=="Stream")return r(t);if(t.contentLength!==void 0&&t.contentLength<(p?.minSize??1024))return r(t);if(t._tag==="Uint8Array")return h(Ye(()=>new globalThis.Response(yo(n)(wn(t.body))).arrayBuffer()),(u)=>he(new Uint8Array(u),t.contentType));return r(Yt(Oo({evaluate:()=>yo(n)(Ji(t.stream)),onError:c}),t.contentType))};var Ho=(t,n)=>{if(n._tag==="Empty"||n._tag==="FormData")return Tt(Tt(t,"content-type"),"content-length");return t=n.contentType===void 0?Tt(t,"content-type"):Gt(t,"content-type",n.contentType),or(t,n)},or=(t,n)=>{let p=n._tag==="Empty"||n._tag==="FormData"?void 0:n.contentLength;return p===void 0?Tt(t,"content-length"):Gt(t,"content-length",p.toString())},Co=(t)=>{if(t===null||t===void 0||!/^\d+$/.test(t))return;let n=Number(t);return Number.isSafeInteger(n)?n:void 0};class Re extends R("UrlError"){}var te=(t,n,p)=>Ue({try:()=>{let u=new URL(t,Bn());for(let d=0;d<n.params.length;d++){let[y,x]=n.params[d];if(x!==void 0)u.searchParams.append(y,Jt(x))}if(p!==void 0)u.hash=p;return u},catch:(u)=>new Re({cause:u})}),Bn=()=>{if("location"in globalThis&&globalThis.location!==void 0&&globalThis.location.origin!==void 0&&globalThis.location.pathname!==void 0){let t=location.origin+location.pathname;try{return new URL(t).href}catch{return}}return},To=(t,n)=>Ue({try:()=>new URL(t,n),catch:()=>new dn(`Invalid URL: "${t}"${n!==void 0?` with base "${n}"`:""}`)});var sr="~effect/http/HttpClientRequest",Ft=(t)=>s(t,sr),Dn={[sr]:sr,...Q,toJSON(){return{_id:"HttpClientRequest",method:this.method,url:Vt(this.url),urlParams:this.urlParams,hash:this.hash,headers:Ce(this.headers),body:this.body.toJSON()}},pipe(){return E(this,arguments)}};function B(t,n,p,u,d,y){let x=Object.create(Dn);return x.method=t,x.url=n,x.urlParams=p,x.hash=u,x.headers=d,x.body=y,x}var Io=B("GET","",Mr,i(),vo,Pt),X=(t)=>(n,p)=>ar(Io,{method:t,url:n,...p??void 0}),ms=X("GET"),Mn=X("QUERY"),oi=X("POST"),kn=X("PATCH"),_n=X("PUT"),Fn=X("DELETE");var Nn=X("HEAD"),vn=X("OPTIONS"),Jn=X("TRACE"),ar=e(2,(t,n)=>{let p=t;if(n.method)p=Te(p,n.method);if(n.url)p=Ao(p,n.url);if(n.headers)p=sn(p,n.headers);if(n.urlParams)p=Mo(p,n.urlParams);if(n.hash)p=Fo(p,n.hash);if(n.body)p=W(p,n.body);if(n.accept)p=ir(p,n.accept);if(n.acceptJson)p=pr(p);return p}),Te=e(2,(t,n)=>B(n,t.url,t.urlParams,t.hash,t.headers,t.body)),Lt=e(3,(t,n,p)=>B(t.method,t.url,t.urlParams,t.hash,Gt(t.headers,n,p),t.body)),sn=e(2,(t,n)=>B(t.method,t.url,t.urlParams,t.hash,Ai(t.headers,n),t.body)),Bo=e(2,(t,n)=>B(t.method,t.url,t.urlParams,t.hash,n(t.headers),t.body)),ut=e(2,(t,n)=>Bo(t,Tt(n))),$n=e(3,(t,n,p)=>Lt(t,"Authorization",`Basic ${tt(`${So(n)}:${So(p)}`)}`)),si=e(2,(t,n)=>Lt(t,"Authorization",`Bearer ${So(n)}`)),ir=e(2,(t,n)=>Lt(t,"Accept",n)),pr=ir("application/json"),zn=e(2,(t,n)=>B(t.method,t.url,t.urlParams,t.hash,Gt(Gt(t.headers,"connection","Upgrade"),"upgrade",n),t.body)),Ao=e(2,(t,n)=>{if(typeof n==="string")return B(t.method,n,t.urlParams,t.hash,t.headers,t.body);let p=new URL(n.toString()),u=Ge(p.searchParams),d=Ae(p.hash===""?void 0:p.hash.slice(1));return p.search="",p.hash="",B(t.method,p.toString(),u,d,t.headers,t.body)}),Gn=e(2,(t,n)=>{if(n==="")return t;return B(t.method,Do(n,t.url),t.urlParams,t.hash,t.headers,t.body)}),Qn=e(2,(t,n)=>{if(n==="")return t;return B(t.method,Do(t.url,n),t.urlParams,t.hash,t.headers,t.body)}),Do=(t,n)=>{let p=t.endsWith("/"),u=n.startsWith("/");return p&&u?t+n.slice(1):!p&&!u?t+"/"+n:t+n},Yn=e(2,(t,n)=>B(t.method,n(t.url),t.urlParams,t.hash,t.headers,t.body)),Zn=e(3,(t,n,p)=>B(t.method,t.url,Ri(t.urlParams,n,p),t.hash,t.headers,t.body)),Mo=e(2,(t,n)=>B(t.method,t.url,Mi(t.urlParams,n),t.hash,t.headers,t.body)),Kn=e(3,(t,n,p)=>B(t.method,t.url,Fi(t.urlParams,n,p),t.hash,t.headers,t.body)),Xn=e(2,(t,n)=>B(t.method,t.url,Ni(t.urlParams,n),t.hash,t.headers,t.body)),Fo=e(2,(t,n)=>B(t.method,t.url,t.urlParams,a(n),t.headers,t.body)),ts=(t)=>B(t.method,t.url,t.urlParams,i(),t.headers,t.body),W=e(2,(t,n)=>B(t.method,t.url,t.urlParams,t.hash,Ho(t.headers,n),n)),es=e((t)=>Ft(t[0]),(t,n,p)=>{if(t.headers["content-encoding"]!==void 0)return r(t);return h(xo(t.body,n,p),(u)=>u===t.body?t:B(t.method,t.url,t.urlParams,t.hash,Gt(or(t.headers,u),"content-encoding",n),u))}),rs=e((t)=>Ft(t[0]),(t,n,p)=>W(t,he(n,p))),os=e((t)=>Ft(t[0]),(t,n,p)=>W(t,zt(n,p))),ns=e(2,(t,n)=>h($e(n),(p)=>W(t,p))),ii=e(2,(t,n)=>W(t,Xr(n))),ss=(t,n)=>{let p=to(t,n);return e(2,(u,d)=>h(p(d),(y)=>W(u,y)))},as=e(2,(t,n)=>W(t,eo(Ge(n)))),is=e(2,(t,n)=>W(t,ze(n))),cs=e(2,(t,n)=>W(t,oo(n))),ps=e((t)=>Ft(t[0]),(t,n,p)=>W(t,Yt(n,p?.contentType,p?.contentLength))),fs=e((t)=>Ft(t[0]),(t,n,p)=>h(co(n,p),(u)=>W(t,u)));function ee(t){let n=te(t.url,t.urlParams,N(t.hash));if(O(n))return a(n.success);return i()}var us=(t)=>{let n=t.method.toUpperCase();return ar(B(n,"",Mr,i(),vo,Pt),{url:new URL(t.url),headers:t.headers,body:ds(t,n)})},ds=(t,n)=>{if(!rr(n)||t.body===null)return Pt;return Gr(t.body,{contentType:t.headers.get("content-type")??void 0,contentLength:Co(t.headers.get("content-length"))})},No=(t,n)=>{let p=te(t.url,t.urlParams,N(t.hash));if(S(p))return g(p.failure);let u={method:t.method,headers:t.headers};if(n?.signal)u.signal=n.signal;if(rr(t.method))switch(t.body._tag){case"Empty":break;case"Raw":{if(u.body=t.body.body,ls(t.body.body))u.duplex="half";break}case"Uint8Array":{u.body=t.body.body;break}case"FormData":{u.body=t.body.formData;break}case"Stream":{u.body=Po(t.body.stream,n?.context??ce()),u.duplex="half";break}}return Ue({try:()=>new Request(p.success,u),catch:(d)=>new Re({cause:d})})},ls=(t)=>typeof ReadableStream<"u"&&t instanceof ReadableStream,gs=(t,n)=>Wn((p)=>yn(No(t,{context:p,signal:n?.signal})));var xt="~effect/http/HttpIncomingMessage";var qe=(t,n)=>{let p=Zt(Qt(t)),u=n?.reviver===void 0?void 0:Zt(Z(Qt(t),n));return(d)=>u===void 0?l(d.json,(y)=>p(y,n)):l(d.text,(y)=>y===""?l(d.json,(x)=>p(x,n)):u(y,n))},Lo=(t,n)=>{let p=Ks.pipe(m(t),Zt);return(u)=>l(u.urlParamsBody,(d)=>p(d,n))},qo=(t,n)=>{let p=Vn(t);return(u)=>p(u.headers,n)};var Jo=(t,n)=>({...n,headers:Ce(t.headers),remoteAddress:t.remoteAddress});var Be="~effect/http/HttpClientResponse/WebSource",De=(t)=>t["~effect/http/HttpClientResponse/WebSource"]?.();var mt="~effect/http/HttpClientResponse",ur=(t,n)=>new $o(t,n),Es=(t)=>fr(De(t)),ys=(t,n)=>{let p=Zt(Qt(t),n),u=qe(F,n);return(d)=>l(u(d),(y)=>p({status:d.status,headers:d.headers,body:y}))},xs=(t,n)=>{let p=Zt(t,n);return(u)=>p({status:u.status,headers:u.headers})},Ss=(t)=>An(h(t,(n)=>n.stream)),bs=e(2,(t,n)=>{let p=t.status;if(n[p])return n[p](t);else if(p>=200&&p<300&&n["2xx"])return n["2xx"](t);else if(p>=300&&p<400&&n["3xx"])return n["3xx"](t);else if(p>=400&&p<500&&n["4xx"])return n["4xx"](t);else if(p>=500&&p<600&&n["5xx"])return n["5xx"](t);return n.orElse(t)}),mr=e(2,(t,n)=>T(()=>n(t.status)?r(t):o(new D({reason:new ht({response:t,request:t.request,description:"invalid status code"})})))),an=(t)=>t.status>=200&&t.status<300?r(t):o(new D({reason:new ht({response:t,request:t.request,description:"non 2xx status code"})}));class $o extends vs{[xt];[mt];request;source;constructor(t,n){super();this.request=t,this.source=n,this[xt]=xt,this[mt]=mt}toJSON(){return Jo(this,{_id:"HttpClientResponse",request:this.request.toJSON(),status:this.status})}get status(){return this.source.status}get url(){if(this.source.url)return this.source.url.split("#")[0];let t=ee(this.request);if(C(t))return"";return t.value.hash="",t.value.href}get headers(){return En(this.source.headers)}cachedCookies;get cookies(){if(this.cachedCookies)return this.cachedCookies;return this.cachedCookies=bo(this.source.headers.getSetCookie?.()??[])}get remoteAddress(){return i()}[Be](){return this.source}get stream(){return this.source.body?Oo({evaluate:()=>this.source.body,onError:(t)=>new D({reason:new gt({request:this.request,response:this,cause:t})})}):Lr(new D({reason:new er({request:this.request,response:this,description:"can not create stream from empty body"})}))}get json(){return l(this.text,(t)=>q({try:()=>t===""?null:JSON.parse(t),catch:(n)=>new D({reason:new gt({request:this.request,response:this,cause:n})})}))}textBody;get text(){return this.textBody??=h(this.arrayBuffer,(t)=>new TextDecoder().decode(t))}get urlParamsBody(){return l(this.arrayBuffer,(t)=>q({try:()=>Ge(_i(t)),catch:(n)=>new D({reason:new gt({request:this.request,response:this,cause:n})})}))}formDataBody;get formData(){return this.formDataBody??=me({try:()=>this.source.formData(),catch:(t)=>new D({reason:new gt({request:this.request,response:this,cause:t})})}).pipe(fo,Kt)}arrayBufferBody;get arrayBuffer(){if(this.arrayBufferBody)return this.arrayBufferBody;return this.arrayBufferBody=me({try:()=>this.source.arrayBuffer(),catch:(t)=>new D({reason:new gt({request:this.request,response:this,cause:t})})}).pipe(fo,Kt),this.arrayBufferBody}get upgrade(){return o(new D({reason:new ht({request:this.request,response:this,description:"fetch cannot hand over the connection of an HTTP upgrade"})}))}pipe(){return E(this,arguments)}}var jo=(t)=>Ii({b3:`${t.traceId}-${t.spanId}-${t.sampled?"1":"0"}${j(t.parent,{onNone:()=>"",onSome:(n)=>`-${n.spanId}`})}`,traceparent:`00-${t.traceId.padStart(32,"0")}-${t.spanId}-${t.sampled?"01":"00"}`});var Hs={"http:":80,"https:":443,"ws:":80,"wss:":443},Go=(t,n,p)=>{let u=Vt(n.search,p).slice(1);if(t.attribute("url.full",Vt(n.href,p)),t.attribute("url.path",n.pathname),u!=="")t.attribute("url.query",u);if(t.attribute("url.scheme",n.protocol.slice(0,-1)),n.hostname!==""){t.attribute("server.address",n.hostname.startsWith("[")?n.hostname.slice(1,-1):n.hostname);let d=n.port===""?Hs[n.protocol]:Number(n.port);if(d!==void 0)t.attribute("server.port",d)}},Vo=(t,n)=>{let p=t.params.filter(([,u])=>typeof u!=="string").map(([u])=>u);return p.length===0?n:[...n,...new URLSearchParams(p.map((u)=>[u,""])).keys()]},lr=(t,n,p,u,d)=>{for(let y in p){if(!u(y,n))continue;t.attribute(`http.${n}.header.${y}`,Eo(y,d)?"<redacted>":p[y])}};var Hr="~effect/http/HttpClient",Yo=(t)=>s(t,Hr),we=P("effect/HttpClient"),ct=(t)=>(...n)=>l(we,(p)=>p[t](...n)),ws=ct("execute"),Bs=ct("get"),As=ct("query"),Ms=ct("head"),ks=ct("post"),Fs=ct("patch"),Ls=ct("put"),qs=ct("del"),Js=ct("options"),se=e(2,(t,n)=>ot(l((p)=>n(t.postprocess(r(p)),p)),t.preprocess)),Oe=e(2,(t,n)=>ot((p)=>n(t.postprocess(p)),t.preprocess)),Ws=e(2,(t,n)=>Oe(t,We(n)));var js=e(3,(t,n,p)=>Oe(t,(u)=>br(u,n,p))),Gs=e(2,(t,n)=>Oe(t,Ts(n))),Vs=e(3,(t,n,p)=>Oe(t,_s(n,p))),Qs=e(3,(t,n,p)=>Oe(t,Ps(n,p))),Ys=e(2,(t,n)=>Oe(t,l(mr(n)))),ai=Oe(l(an)),ot=(t,n)=>{let p=Object.create(Zs);return p.preprocess=n,p.postprocess=t,p.execute=function(u){return t(n(u))},p},Zs={[Hr]:Hr,pipe(){return E(this,arguments)},...Q,toJSON(){return{_id:"effect/HttpClient"}},...Object.fromEntries(lo.map(([t,n])=>[n,function(p,u){return this.execute(X(t)(p,u))}]))},Ur=(t)=>ot((n)=>l(n,(p)=>yr((u)=>{let d=ke.get(p),y=d??new AbortController,x=te(p.url,p.urlParams,N(p.hash));if(S(x))return o(new D({reason:new tr({request:p,cause:x.failure})}));let H=x.success;if(u.getRef(jn)||u.getRef(en)(p)){let w=t(p,H,y.signal,u);if(d)return h(w,(U)=>Er(U,y,!0));return At((U)=>Ht(U(w),{onSuccess(b){return r(Er(b,y,!1))},onFailure(b){if(so(b))y.abort();return Qe(b)}}))}return Us(u.getRef(nn)(p),{kind:"client"},(w)=>{w.attribute("http.request.method",p.method);let U=u.getRef(zs);Go(w,H,Vo(p.urlParams,u.getRef(ko)));let b=u.getRef(rn);return lr(w,"request",p.headers,b,U),p=u.getRef(on)?sn(p,jo(w)):p,At((G)=>G(t(p,H,y.signal,u)).pipe($s(w,{captureStackTrace:!1}),Ht({onSuccess:(L)=>{if(w.attribute("http.response.status_code",L.status),lr(w,"response",L.headers,b,U),L.status>=400&&L.status<600)w.attribute("error.type",String(L.status)),Xs(u,w,p,L);return r(Er(L,y,d!==void 0))},onFailure(L){if(!d&&so(L))y.abort();return Qe(L)}})))})})),r),Xs=(t,n,p,u)=>{let d=Ie();re(0);let y;try{y=wt(new D({reason:new ht({request:p,response:u})}))}finally{re(d)}n.end(t.getRef(xi)?t.getRef(hr).currentTimeNanosUnsafe():BigInt(0),y)},ci=e(2,(t,n)=>ot(t.postprocess,(p)=>h(t.preprocess(p),n))),ta=e(2,(t,n)=>ot(t.postprocess,(p)=>l(t.preprocess(p),n))),ea=e(2,(t,n)=>ot(t.postprocess,(p)=>t.preprocess(n(p)))),ra=e(2,(t,n)=>ot(t.postprocess,(p)=>l(n(p),t.preprocess))),oa=e(2,(t,n)=>Oe(t,uo(n))),na=e(2,(t,n)=>{let p=gr(n),u=p?"errors-and-responses":n.retryOn??"errors-and-responses",d=Ha(p?n:n.schedule??xr),y=p?void 0:n.times;return Oe(t,no(u==="errors-only"?c:Ds({schedule:d,times:y,while:Ir}),u==="response-only"?c:uo({while:p||n.while===void 0?Tr:hi(Tr,n.while),schedule:d,times:y})))}),sa=e(2,(t,n)=>{let p=z(n),u=`timed out after ${Ln(p)}`;return se(t,(d,y)=>Os(d,{duration:p,orElse:()=>o(new D({reason:new _t({request:y,cause:new Is(`Operation ${u}`),description:u})}))}))}),aa=e(2,(t,n)=>{let p={initial:!0,limit:n.limit,window:vt(z(n.window),de(1))},u=new Map,d=n.key,y=typeof d==="function"?d:Y(d),x=n.tokens,H=typeof x==="function"?x:Y(x??1),K=!n.disableAdaptiveLearning,w=ua(n.responseHeaders),U=(V)=>{let v=u.get(V);if(v!==void 0)return v;return u.set(V,p),p},b=new Map,G=(V)=>{let v=b.get(V);if(v===void 0)v={sent:0,observed:0,remaining:0,resetAt:0},b.set(V,v);return v},L=n.disableResponseInspection?void 0:(V,v,at,St,Fe)=>{let pt=U(v),nt=da(pt,V,at,St,w);if(nt.limit!==pt.limit||!dr(nt.window,pt.window))u.set(v,nt);let it=Xo(at,w),et=G(v);if(it===void 0||Fe<=et.observed)return;let qt=Rr(V,at,w);if(et.observed=Fe,et.remaining=it,qt!==void 0)et.resetAt=V.currentTimeMillisUnsafe()+ye(qt)};return se(t,function V(v,at,St=0){let pt=Ar().getRef(hr),nt=y(at),it=Math.max(H(at),1),et=G(nt),qt=pt.currentTimeMillisUnsafe();if(et.resetAt>qt&&et.remaining-(et.sent-et.observed)<it)return l(It(et.resetAt-qt),()=>V(v,at,St));let Sn=et.sent+=it,ae=U(nt),Or=n.times===void 0||St<n.times;function Br(rt){return rt?l(It(rt),()=>V(v,at,St+1)):V(v,at,St+1)}let Dr=(rt,bt)=>{if(L?.(pt,nt,rt.headers,it,Sn),n.disableResponseInspection||rt.status!==429)return r(void 0);let jt=tn(pt.currentTimeMillisUnsafe(),ne(rt.headers,...w.retryAfter));if(jt===void 0)return r(void 0);let J=Rr(pt,rt.headers,w)??jt;if(bt===void 0)return r(J);return Xe(n.limiter.adaptiveFeedback({key:nt,epoch:bt.epoch,tokens:it,status:rt.status,retryAfter:J}),J)};return l(n.limiter.consume({algorithm:n.algorithm,onExceeded:"delay",key:nt,limit:ae.limit,window:ae.window,tokens:it}),({delay:rt})=>{let bt=()=>{let jt=(J)=>{let kr=qn(v,{onSuccess(ft){return l(Dr(ft,J),(Ne)=>{if(ft.status!==429||!Or)return r(ft);return Br(Ne)})},onFailure(ft){if(Ca(ft))return l(Dr(ft.reason.response,J),(Ne)=>Or?Br(Ne):o(ft));return o(ft)}});return J===void 0||pn(J.delay)?kr:po(kr,J.delay)};if(!K)return jt(void 0);return l(n.limiter.adaptiveConsume({key:nt,tokens:it,fallbackLimit:ae.limit,fallbackWindow:ae.window}),(J)=>{if(!pn(J.delay)&&J.phase==="cooldown")return l(It(J.delay),bt);return jt(J)})};return pn(rt)?bt():l(It(rt),bt)})})}),ia=e(2,(t,n)=>{let p=n.key,u=typeof p==="function"?p:p===void 0?ca:Y(p),d=n.classify??Zo;return se(t,(y,x)=>n.breaker.execute(y,{key:u(x),classify:d}))}),ca=(t)=>j(ee(t),{onNone:()=>t.url,onSome:(n)=>n.origin}),Zo=(t)=>Cr((n)=>r(pa(t,n.currentTimeMillisUnsafe()))),pa=(t,n)=>{if(le(t)){let y=Ko(t.value.status);return y==="Failure"?Qo(wr(t.value,n)):{_tag:y}}let p=!1,u=!1,d;for(let y of t.cause.reasons){if(!fn(y))continue;let x=fa(y.error);if(x==="Failure"){p=!0;let H=wr(y.error,n);if(H!==void 0)d=d===void 0?H:vt(d,H)}else if(x==="Success")u=!0}return p?Qo(d):{_tag:u?"Success":"Ignored"}},Qo=(t)=>({_tag:"Failure",retryAfter:t}),fa=(t)=>{if(io(t))return"Failure";if(!Xt(t))return"Ignored";switch(t.reason._tag){case"TransportError":return"Failure";case"StatusCodeError":return Ko(t.reason.response.status);default:return"Ignored"}},Ko=(t)=>t===429?"Ignored":t===408||t===500||t===502||t===503||t===504?"Failure":"Success",ua=(t)=>({limit:t?.limit===void 0?["ratelimit-limit","x-ratelimit-limit"]:[t.limit.toLowerCase()],remaining:t?.remaining===void 0?["ratelimit-remaining","x-ratelimit-remaining"]:[t.remaining.toLowerCase()],reset:t?.reset===void 0?["ratelimit-reset","x-ratelimit-reset"]:[t.reset.toLowerCase()],resetAfter:t?.resetAfter===void 0?["ratelimit-reset-after","x-ratelimit-reset-after"]:[t.resetAfter.toLowerCase()],retryAfter:t?.retryAfter===void 0?["retry-after"]:[t.retryAfter.toLowerCase()]}),da=(t,n,p,u,d)=>{let y=ma(t,p,u,d)??t.limit,x=Rr(n,p,d)??t.window;if(y===t.limit&&dr(x,t.window))return t;return{limit:y,window:x,initial:!1}},ma=(t,n,p,u)=>{let d=ne(n,...u.limit),y=_e(d);if(y!==void 0&&y>0)return y;let x=Xo(n,u);if(x===void 0)return;return t.initial?x+p:Math.max(x+p,t.limit)},Xo=(t,n)=>{let p=ne(t,...n.remaining),u=_e(p);return u!==void 0&&u>=0?u:void 0},Rr=(t,n,p)=>{let u=la(ne(n,...p.resetAfter));if(u!==void 0)return u;return ha(t,ne(n,...p.reset))},tn=(t,n)=>{if(n===void 0)return;let p=wo(n);return O(p)?vt(Oi(p.success,t),de(1)):void 0},la=(t)=>{let n=_e(t);if(n===void 0||n<=0)return;return vt(xe(n),de(1))},ha=(t,n)=>{let p=_e(n);if(p===void 0||p<=0)return;let u=t.currentTimeMillisUnsafe();if(p>1000000000000)return de(Math.max(p-u,1));if(p>1e9)return de(Math.max(p*1000-u,1));return vt(xe(p),de(1))},_e=(t)=>{if(t===void 0)return;let n=/-?\d+(?:\.\d+)?/.exec(t);if(n===null)return;let p=Number(n[0]);return Number.isFinite(p)?p:void 0},ne=(t,...n)=>{for(let p=0;p<n.length;p++){let u=t[n[p]];if(u!==void 0)return u}return},ga=e(2,(t,n)=>Oe(t,je(n))),Ea=e(2,(t,n)=>Oe(t,Sr(n))),ya=e(2,(t,n)=>ot(t.postprocess,(p)=>je(t.preprocess(p),n))),xa=e(2,(t,n)=>{let p=()=>Ar().getRef(hr).currentTimeMillisUnsafe(),u=(d)=>h(Fr(n),(y)=>{let x=Ci(y,d.url,p());if(x===void 0)return d;let H=Lt(d,"cookie",x),K=ke.get(d);if(K!==void 0)ke.set(H,K);return H});return ot((d)=>je(t.postprocess(l(d,u)),(y)=>Nr(n,ki(y.url,y.cookies,p()))),t.preprocess)}),li=(t)=>se(t,(n,p)=>{let u=new AbortController;return ke.set(p,u),bn(Ns(()=>I(()=>u.abort())),n)}),Sa=e((t)=>Yo(t[0]),(t,n)=>ot((p)=>{let u=(d,y)=>T(()=>{let x;return l(t.postprocess(h(d,(H)=>(x=H,H))),(H)=>{if(H.status<300||H.status>=400||!H.headers.location||y>=(n??10))return r(H);let K=To(H.headers.location,H.request.url);if(S(K))return r(H);let w=K.success,U=x??H.request,b=U;if((H.status===301||H.status===302)&&U.method==="POST"||H.status===303&&U.method!=="GET"&&U.method!=="HEAD")b=Te(b,"GET"),b=W(b,Pt),b=ut(b,"content-encoding"),b=ut(b,"content-language"),b=ut(b,"content-location");if(w.origin!==new URL(H.request.url).origin)b=ut(b,"authorization"),b=ut(b,"proxy-authorization"),b=ut(b,"cookie");let G=w.hash===""?i():a(w.hash.slice(1));return w.hash="",b=B(b.method,w.href,Mr,G,b.headers,b.body),bn(I(()=>cn.get(H)?.abort()),u(r(b),y+1))})});return u(p,0)},t.preprocess)),en=A("effect/http/HttpClient/TracerDisabledWhen",{defaultValue:()=>Nt}),rn=A("effect/http/HttpClient/TracerHeaderFilter",{defaultValue:()=>Nt}),on=A("effect/http/HttpClient/TracerPropagationEnabled",{defaultValue:Pe}),nn=A("effect/http/HttpClient/SpanNameGenerator",{defaultValue:()=>(t)=>t.method}),Pr=(t)=>oe(we)(Wn((n)=>h(t,(p)=>Oe(p,Rs((u)=>$t(n,u)))))),Me=(()=>{if("FinalizationRegistry"in globalThis&&globalThis.FinalizationRegistry){let n=new FinalizationRegistry((p)=>{try{p.abort()}catch{}});return{register(p,u){n.register(p,u,p)},unregister(p){n.unregister(p)}}}let t=new WeakMap;return{register(n,p){t.set(n,setTimeout(()=>p.abort(),5000))},unregister(n){let p=t.get(n);if(p===void 0)return;clearTimeout(p),t.delete(n)}}})(),ke=new WeakMap,cn=new WeakMap,Er=(t,n,p)=>{if(!p)Me.register(t,n),t=new mn(t,n);return cn.set(t,n),t};class mn{original;controller;constructor(t,n){this.original=t,this.controller=n}[mt]=mt;[xt]=xt;applyInterrupt(t){return T(()=>(Me.unregister(this.original),ho(t,()=>I(()=>{this.controller.abort()}))))}get request(){return this.original.request}get url(){return this.original.url}get status(){return this.original.status}get headers(){return this.original.headers}get cookies(){return this.original.cookies}get remoteAddress(){return this.original.remoteAddress}get formData(){return this.applyInterrupt(this.original.formData)}get text(){return this.applyInterrupt(this.original.text)}get json(){return this.applyInterrupt(this.original.json)}get urlParamsBody(){return this.applyInterrupt(this.original.urlParamsBody)}get arrayBuffer(){return this.applyInterrupt(this.original.arrayBuffer)}get upgrade(){return this.applyInterrupt(this.original.upgrade)}[Be](){let t=De(this.original);if(t!==void 0)Me.unregister(this.original);return t}get stream(){return Wi(()=>(Me.unregister(this.original),_o(this.original.stream,I(()=>{this.controller.abort()}))))}toJSON(){return this.original.toJSON()}[_](){return this.original[_]()}pipe(){return E(this,arguments)}}var Tr=(t)=>io(t)||ba(t),ba=(t)=>Xt(t)&&(t.reason._tag==="TransportError"||t.reason._tag==="StatusCodeError"&&Ir(t.reason.response)),wr=(t,n)=>{let p=Xt(t)?t.response:s(t,mt)?t:void 0;return tn(n,p?.headers["retry-after"])},Ha=(t)=>hn(h(gn(t),(n)=>(p,u)=>{let d=wr(u,p);if(d===void 0)return n(p,u);return h(n(p,u),([y,x])=>[y,vt(x,d)])})),Ca=(t)=>Xt(t)&&t.reason._tag==="StatusCodeError"&&t.reason.response.status===429,Ir=(t)=>t.status===408||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504;var yt=A("effect/http/FetchHttpClient/Fetch",{defaultValue:()=>globalThis.fetch}),xn=A("effect/http/FetchHttpClient/StreamBodyFallback",{defaultValue:()=>"error"});class Yr extends P()("effect/http/FetchHttpClient/RequestInit"){}var ln,Ra=()=>{try{let t=!1,n=new ReadableStream,p=new Request("https://example.com",{method:"POST",body:n,get duplex(){return t=!0,"half"}});return(t||p.body===n)&&!p.headers.has("Content-Type")}catch{return!1}},Ta=Ur((t,n,p,u)=>{if(t.headers.upgrade!==void 0)return o(new D({reason:new _t({request:t,description:"fetch cannot send an HTTP upgrade request"})}));let d=u.getRef(yt),y=un(u.context,Yr)??{},x=y.headers?Ti(En(y.headers),t.headers):t.headers;if(x["content-length"])x=Tt(x,"content-length");let H,K=I(()=>H?.abort()),w=(U)=>h(me({try:()=>d(n,{...y,method:t.method,headers:x,body:U,duplex:typeof ReadableStream<"u"&&U instanceof ReadableStream?"half":void 0,signal:H?AbortSignal.any([p,H.signal]):p}),catch:(b)=>new D({reason:new _t({request:t,cause:b})})}),(b)=>{let G=ur(t,b);if(!H)return G;if(b.body===null)H.abort();return Object.create(G,{...Object.fromEntries(["arrayBuffer","text","json","formData","urlParamsBody"].map((L)=>[L,{get:()=>Wt(G[L],K)}])),stream:{get:()=>_o(G.stream,K)}})}).pipe(dt(()=>K));switch(t.body._tag){case"Raw":case"Uint8Array":return w(t.body.body);case"FormData":return w(t.body.formData);case"Stream":{if(ln??=Ra(),ln){H=new AbortController;let U=AbortSignal.any([p,H.signal]),b=Ct((G)=>{let L=()=>G(mo);if(U.aborted){L();return}return U.addEventListener("abort",L,{once:!0}),I(()=>U.removeEventListener("abort",L))});return l(Vi(Ki(t.body.stream,b)),w)}if(u.getRef(xn)==="error")return o(new D({reason:new Se({request:t,description:"Streaming request bodies are not supported in this runtime"})}));return Gi(t.body.stream).pipe(Ke((U)=>new D({reason:new Se({request:t,cause:U})})),l(w))}}return w(void 0)}),Qr=Pr(r(Ta));export{ms,oi,sn,si,pr,ii,Vr,qe,an,Zr,we,Oe,ai,ci,li,hs,yt,Yr,Qr,ui};
|
package/chunk-5q7mrvv1.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{ss,cr,is,as,Gr,fs}from"./chunk-p59r4b0j.js";import{cn,Mt,_e,ne,ke,J}from"./chunk-6rpbc10h.js";import{k,N,xe,pt,I,W,h,zt,Er,Ei,D,Ir,H,Z}from"./chunk-bkr0zk6g.js";var rs={};k(rs,{ConsoleCredentials:()=>rs,fresh:()=>xt,login:()=>ea,logout:()=>ta,organization:()=>Mn,owner:()=>Fe,read:()=>He,stored:()=>Kr});import{createHash as c}from"node:crypto";var d=H(Z(cr)),f=300000;function He(e){let n=e.env.OPENCODE_API_KEY;if(!n)return Kr(e);let o=e.env.OPENCODE_CONSOLE_SERVER?.trim();if(!o)return{type:"key",server:ss,key:n};let r=fs(o);if(!r)throw Error(`OPENCODE_CONSOLE_SERVER isn't a Console URL: ${o}. Use an https:// URL, or http:// only for localhost.`);return{type:"key",server:r,key:n}}function Kr(e){let n=i(e);if(n.corrupt)throw Error(`The sign-in in ${cn(e)} can't be read. Run \`npx @opencode/console login\` to replace it or \`npx @opencode/console logout\` to remove it.`);return n.credential}function Fe(e){return JSON.stringify([e.server,e.type==="key"?c("sha256").update(e.key).digest("hex").slice(0,16):e.accountID,e.type==="oauth"?e.orgID:void 0])}function Mn(e){return e.type==="oauth"?e.orgName:void 0}var ea=D("ConsoleCredentials.login")(function*(e,n){let o=yield*is(n.server);yield*n.prompt(o);let r=yield*o.callback,t=yield*_e(e,I(()=>{let l=i(e).credential;if(ke(cn(e),JSON.stringify(r)),!l||Fe(l)!==Fe(r))J(Mt(e));return l}));if(t)yield*Gr(t).pipe(zt);return r}),xt=D("ConsoleCredentials.fresh")(function*(e){let n=He(e);if(!n||n.type==="key"||!(yield*s(n)))return n;let o=yield*_e(e,W(function*(){let r=Kr(e);if(!r||!(yield*s(r)))return r;let t=yield*as(r).pipe(Er(xe(30)));if(i(e).credential?.refresh!==r.refresh)return Kr(e);return ke(cn(e),JSON.stringify(t)),t})).pipe(Ei);return yield*Ir(o)}),ta=D("ConsoleCredentials.logout")(function*(e){let n=yield*_e(e,I(()=>{let o=i(e).credential;return J(cn(e)),J(Mt(e)),o}));if(!n)return!1;return yield*Gr(n).pipe(zt),!0});function s(e){return pt.pipe(h((n)=>e.expires-f<=n))}function i(e){let n=ne(cn(e));if(n===void 0)return{};let o=N(d(n));return o?{credential:o}:{corrupt:!0}}
|
|
2
|
-
export{He,Kr,Fe,Mn,ea,xt,ta,rs};
|
package/chunk-5w6hy202.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-zdf3mvav.js";import{bt}from"./chunk-6rpbc10h.js";import{k,N,H,t,n,Z}from"./chunk-bkr0zk6g.js";var u={};k(u,{CliInstall:()=>u,directory:()=>m,install:()=>I,packageName:()=>b,uninstall:()=>D});import{randomUUID as S}from"node:crypto";import{chmodSync as g,copyFileSync as j,cpSync as v,existsSync as c,readFileSync as C,realpathSync as f,renameSync as h,rmSync as l}from"node:fs";import o from"node:path";var b="@opencode/console",m=(e)=>o.join(e.data,"cli");function I(e,r){let s=m(e);if(r.entry===void 0){let a=o.join(s,o.basename(r.execPath));return x(s,(p)=>{bt(p);let y=o.join(p,o.basename(r.execPath));j(r.execPath,y),g(y,493)}),[a]}let i=f(r.entry),d=o.dirname(i);if(!O(d))return[r.execPath,i];return x(s,(a)=>v(d,a,{recursive:!0})),[U(r.execPath,r.path),o.join(s,o.basename(i))]}function U(e,r){if(!c(e))return e;let s=f(e);return(r??"").split(o.delimiter).filter((i)=>o.isAbsolute(i)).map((i)=>o.join(i,o.basename(e))).find((i)=>c(i)&&f(i)===s)??e}function D(e){l(m(e),{recursive:!0,force:!0})}function O(e){let r=o.join(e,"package.json");if(!c(r))return!1;let s=H(Z(n({name:t})))(C(r,"utf8"));return N(s)?.name===b}function x(e,r){bt(o.dirname(e));let s=`${e}.${S()}.tmp`,i=`${e}.${S()}.old`;try{if(r(s),c(e))h(e,i);h(s,e)}finally{l(s,{recursive:!0,force:!0}),l(i,{recursive:!0,force:!0})}}export{u as CliInstall,m as directory,I as install,b as packageName,D as uninstall};
|
package/chunk-6mydq7cv.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Rt}from"./chunk-81fv1abj.js";import{Mt,ne,ke,J}from"./chunk-6rpbc10h.js";import{Mn}from"./chunk-5q7mrvv1.js";import{k,De,N,H,w,F,t,ee,n,x,Z}from"./chunk-bkr0zk6g.js";var ns={};k(ns,{Info:()=>Xs,MAX_AGE_MS:()=>Qs,WorkspaceSnapshot:()=>ns,clear:()=>ts,models:()=>Xi,policies:()=>ei,read:()=>Xo,stale:()=>sr,workspace:()=>ir,write:()=>es});var Qs=60000,Xs=n({owner:t,organization:w(t),fetched:ee,config:w(x(t,F)),status:w(n({message:t,url:w(t)}))}),c=H(Z(Xs)),f=n({policies:w(F)}),s=x(t,n({models:w(x(t,F))}));function Xo(o){return N(c(ne(Mt(o))??""))}function es(o,e){ke(Mt(o),JSON.stringify(e))}function ts(o){J(Mt(o))}function sr(o,e){return e-o.fetched>=Qs}function ei(o){if(!o)return;let e=o.config;if(!e)return o.status?void 0:[];let r=e.policies??N(H(f)(e.experimental))?.policies;if(r===void 0)return[];return N(H(Rt.Policies)(r))}function ir(o,e){if(!o)return{policies:[]};return{organization:e?.organization??Mn(o),policies:ei(e),status:e?.status}}function Xi(o){let e=o?.config?.providers;if(e===void 0)return 0;return Object.values(De(H(s)(e),()=>({}))).reduce((r,i)=>r+Object.keys(i.models??{}).length,0)}
|
|
2
|
-
export{Qs,Xs,Xo,es,ts,sr,ei,ir,Xi,ns};
|
package/chunk-6rpbc10h.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{k,di,mi,me,zt,Fs}from"./chunk-bkr0zk6g.js";var bs={};k(bs,{ConsoleStore:()=>bs,credentialFile:()=>cn,ensureDir:()=>bt,locked:()=>_e,make:()=>gs,modified:()=>ys,read:()=>ne,remove:()=>J,snapshotFile:()=>Mt,syncClaimFile:()=>xs,unreachable:()=>eo,write:()=>ke});import{randomUUID as re}from"node:crypto";import{chmodSync as oe,mkdirSync as ae,readFileSync as ie,renameSync as se,rmSync as q,statSync as ce,writeFileSync as fe}from"node:fs";import E from"node:path";import _ from"path";import K from"os";import{randomBytes as W,randomUUID as Y}from"crypto";import{mkdir as S,readFile as V,rm as M,stat as B,utimes as z,writeFile as A}from"fs/promises";import{createHash as C}from"crypto";var x;(function(e){function i(w){return C("sha1").update(w).digest("hex")}e.fast=i;function s(w){return C("sha256").update(w).digest("hex")}e.sha256=s})(x||(x={}));var Dn;(function(e){let i;function s(r){i=r}e.setGlobal=s;let w=()=>{if(!i)throw Error("Flock global not set");return _.join(i.state,"locks")},b={staleMs:60000,timeoutMs:300000,baseDelayMs:100,maxDelayMs:2000};function g(r){if(typeof r!=="object"||r===null||!("code"in r))return;let t=r.code;if(typeof t!=="string")return;return t}function H(r,t){return new Promise((n,c)=>{if(t?.aborted){c(t.reason??Error("Aborted"));return}let a,f=()=>{t?.removeEventListener("abort",o),n()},o=()=>{if(a)clearTimeout(a);t?.removeEventListener("abort",o),c(t?.reason??Error("Aborted"))};t?.addEventListener("abort",o,{once:!0}),a=setTimeout(f,r)})}function F(r){let t=Math.floor(r*0.3),n=Math.floor(Math.random()*(2*t+1))-t;return Math.max(0,r+n)}function N(){return performance.now()}function j(){return performance.timeOrigin+N()}async function v(r){try{return await B(r)}catch(t){let n=g(t);if(n==="ENOENT"||n==="ENOTDIR")return;throw t}}async function I(r,t,n,c){let a=j(),f=await v(t);if(f)return a-f.mtimeMs>c;let o=await v(n);if(o)return a-o.mtimeMs>c;let l=await v(r);if(!l)return!1;return a-l.mtimeMs>c}async function G(r,t){let n=Y?.()??W(16).toString("hex"),c=_.join(r,"meta.json"),a=_.join(r,"heartbeat");try{await S(r,{mode:448})}catch(O){if(g(O)!=="EEXIST")throw O;if(!await I(r,a,c,t.staleMs))return{acquired:!1};let d=r+".breaker";try{await S(d,{mode:448})}catch(u){let p=g(u);if(p==="EEXIST"){let D=await v(d);if(D&&j()-D.mtimeMs>t.staleMs)await M(d,{recursive:!0,force:!0}).catch(()=>{return});return{acquired:!1}}if(p==="ENOENT"||p==="ENOTDIR")return{acquired:!1};throw u}try{if(!await I(r,a,c,t.staleMs))return{acquired:!1};await M(r,{recursive:!0,force:!0});try{await S(r,{mode:448})}catch(u){let p=g(u);if(p==="EEXIST"||p==="ENOTEMPTY")return{acquired:!1};throw u}}finally{await M(d,{recursive:!0,force:!0}).catch(()=>{return})}}let f={token:n,pid:process.pid,hostname:K.hostname(),createdAt:new Date().toISOString()};await A(a,"",{flag:"wx"}).catch(async()=>{throw await M(r,{recursive:!0,force:!0}),Error("Lock acquired but heartbeat already existed (possible compromise).")}),await A(c,JSON.stringify(f,null,2),{flag:"wx"}).catch(async()=>{throw await M(r,{recursive:!0,force:!0}),Error("Lock acquired but meta.json already existed (possible compromise).")});let o;return{acquired:!0,startHeartbeat:(O=Math.max(100,Math.floor(t.staleMs/3)))=>{if(o)return;o=setInterval(()=>{let d=new Date;z(a,d,d).catch(()=>{return})},O),o.unref?.()},release:async()=>{if(o)clearInterval(o),o=void 0;if((await V(c,"utf8").then((d)=>{let u=JSON.parse(d);if(!u||typeof u!=="object")return{};return{token:"token"in u&&typeof u.token==="string"?u.token:void 0}}).catch((d)=>{let u=g(d);if(u==="ENOENT"||u==="ENOTDIR")throw Error("Refusing to release: lock is compromised (metadata missing).");if(d instanceof SyntaxError)throw Error("Refusing to release: lock is compromised (metadata invalid).");throw d})).token!==n)throw Error("Refusing to release: lock token mismatch (not the owner).");await M(r,{recursive:!0,force:!0})}}}async function X(r,t,n){let c=N()+n.timeoutMs,a=0,f=0,o=n.baseDelayMs;while(!0){t.signal?.throwIfAborted();let l=await G(r,n);if(l.acquired)return l;if(N()>c)throw Error(`Timed out waiting for lock: ${t.key}`);a+=1;let y=F(o);await t.onWait?.({key:t.key,attempt:a,delay:y,waited:f}),await H(y,t.signal),f+=y,o=Math.min(n.maxDelayMs,Math.floor(o*1.7))}}async function T(r,t={}){t.signal?.throwIfAborted();let n={staleMs:t.staleMs??b.staleMs,timeoutMs:t.timeoutMs??b.timeoutMs,baseDelayMs:t.baseDelayMs??b.baseDelayMs,maxDelayMs:t.maxDelayMs??b.maxDelayMs},c=t.dir??w();await S(c,{recursive:!0});let a=_.join(c,x.fast(r)+".lock"),f=await X(a,{key:r,onWait:t.onWait,signal:t.signal},n);f.startHeartbeat();let o=()=>f.release();return{release:o,[Symbol.asyncDispose](){return o()}}}e.acquire=T;async function U(r,t,n={}){let a=[];try{const c=di(a,await T(r,n),1);n.signal?.throwIfAborted();return await t()}catch(f){var o=f,l=1}finally{var y=mi(a,o,l);y&&await y}}e.withLock=U})(Dn||(Dn={}));import P from"os";import m from"path";var h=P.homedir(),Q=process.env.XDG_DATA_HOME||(h?m.join(h,".local","share"):void 0),Z=process.env.XDG_CACHE_HOME||(h?m.join(h,".cache"):void 0),ee=process.env.XDG_CONFIG_HOME||(h?m.join(h,".config"):void 0),te=process.env.XDG_STATE_HOME||(h?m.join(h,".local","state"):void 0);function Xr(e){return{data:m.join(Q,e),cache:m.join(Z,e),config:m.join(ee,e),state:m.join(te,e),tmp:m.join(P.tmpdir(),e)}}function gs(e={}){let i=e.env??{OPENCODE_API_KEY:process.env.OPENCODE_API_KEY,OPENCODE_CONSOLE_SERVER:process.env.OPENCODE_CONSOLE_SERVER};if(e.root)return{data:E.join(e.root,"data"),cache:E.join(e.root,"cache"),env:i};let s=Xr("opencode-console");return{data:s.data,cache:s.cache,env:i}}var cn=(e)=>E.join(e.data,"credential.json"),Mt=(e)=>E.join(e.cache,"config.json"),xs=(e)=>E.join(e.cache,"sync.claim"),ue=30000,R=35000;function _e(e,i){return Fs(me({try:()=>(bt(e.data),bt(E.join(e.data,"locks")),Dn.acquire("credential",{dir:E.join(e.data,"locks"),staleMs:ue,timeoutMs:R})),catch:(s)=>s instanceof Error&&s.message.startsWith("Timed out waiting for lock")?Error(`Timed out after ${R/1000}s waiting for another opencode-console process to update the sign-in`,{cause:s}):s}),()=>i,(s)=>me(()=>s.release()).pipe(zt))}function ne(e){try{return ie(e,"utf8")}catch(i){if(L(i)==="ENOENT")return;throw i}}function ys(e){try{return ce(e,{throwIfNoEntry:!1})?.mtimeMs}catch(i){if(eo(i))return;throw i}}function ke(e,i){bt(E.dirname(e));let s=`${e}.${re()}.tmp`;fe(s,i,{mode:384,flag:"wx"});try{se(s,e)}catch(w){throw q(s,{force:!0}),w}}function J(e){q(e,{force:!0})}function eo(e){return["ENOENT","ENOTDIR","EACCES","EPERM"].includes(L(e)??"")}function bt(e){if(ae(e,{recursive:!0,mode:448}),process.platform!=="win32")oe(e,448)}function L(e){return e instanceof Error&&"code"in e&&typeof e.code==="string"?e.code:void 0}
|
|
2
|
-
export{Dn,Xr,gs,cn,Mt,xs,_e,ne,ys,ke,J,eo,bt,bs};
|
package/chunk-81fv1abj.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{C,M,Ut,$n,r,xn,vn,Gn,he,y,Je,Nr,_t,pe,Dr,H,Be,w,ve,d,Ui,Yt,F,t,ee,v,n,x,wn,p,Ur,b,B,nt,Zn,$i,te,Li,m,qs,mt,ze,Ee,Yn,rt,ji,$r,Pt,G,Ws,zi,kn,To,L,Cn}from"./chunk-bkr0zk6g.js";var Ro=Object.defineProperty,Lo=(o)=>o;function Ao(o,i){this[o]=Lo.bind(null,i)}var Te=(o,i)=>{for(var c in i)Ro(o,c,{get:i[c],enumerable:!0,configurable:!0,set:Ao.bind(i,c)})};var u=G.check(ji(0)),S=G.check($r(0)),Rn=t.pipe(te("RelativePath"),pe({identifier:"RelativePath"})),R=t.pipe(te("AbsolutePath"),pe({identifier:"AbsolutePath"})),e=(o)=>Be(o).pipe(m(w(ve(o)),{decode:he({strict:!1}),encode:Je(Ut((i)=>i!==void 0))})),Fo=(o,i)=>Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)),s=(o)=>(i)=>Fo(i,o(i)),Ln=rt.pipe(m(kn,{decode:y((o)=>vn(o)),encode:y((o)=>Gn(o))}));var Eo=26,_o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ve=0,ce=0;function h(){return Ke(!1)}function $e(){return Ke(!0)}function Ke(o,i=Date.now()){if(i!==Ve)Ve=i,ce=0;ce++;let c=BigInt(i)*0x1000n+BigInt(ce),g=o?~c:c,k=Array.from({length:6},(I,wo)=>Number(g>>BigInt(40-8*wo)&0xffn).toString(16).padStart(2,"0")).join(""),P=crypto.getRandomValues(new Uint8Array(Eo-12));return k+Array.from(P,(I)=>_o[I%62]).join("")}var Ge=t.pipe(te("Project.ID"),pe({identifier:"Project.ID"}),s((o)=>({global:o.make("global")})));var le=t.check(Yn("wrk")).pipe(te("Workspace.ID"),pe({identifier:"Workspace.ID"}),s((o)=>{let i=()=>o.make("wrk_"+h());return{ascending:(c)=>{if(!c)return i();return o.make(c)},create:i}}));var Ye=n({directory:R,workspaceID:e(le)}).annotate({identifier:"Location.Ref"}),Vn=n(_t(Ye.fields,["workspaceID"])).annotate({identifier:"Location.PublicRef"});class He extends L("Location.Info")({directory:R,workspaceID:e(le),project:n({id:Ge,directory:R,canonical:R})}){}var Kn=n(_t(He.fields,["workspaceID"])).annotate({identifier:"Location.PublicInfo"});var Oo=t.check(Yn("evt_")).pipe(te("Event.ID"),pe({identifier:"Event.ID"}),s((o)=>({create:()=>o.make("evt_"+h())}))),Wo=G.check($r(0)).pipe(te("Event.Seq"),pe({identifier:"Event.Seq"})),No=G.check($r(1)).pipe(te("Event.Version"),pe({identifier:"Event.Version"})),or=n({aggregateID:t,seq:Wo,version:No});function l(o){let i=n(o.schema);return n({id:Oo,created:rt,metadata:e(x(t,F)),type:d(o.type),location:e(Ye),data:i}).annotate({identifier:o.identifier??o.type}).pipe(s(()=>({type:o.type,durability:"ephemeral",durable:void 0,data:i})))}function f(...o){return Object.freeze(o)}var me=t.check(Yn("ses")).pipe(te("SessionID"),pe({identifier:"Session.ID"}),s((o)=>({create:()=>o.make("ses_"+$e())})));var et=t.check(Yn("per")).pipe(te("Permission.ID"),pe({identifier:"Permission.ID"}),s((o)=>({create:(i)=>o.make(i??"per_"+h())}))),zo=b([n({type:d("tool"),messageID:t,id:t})]).annotate({identifier:"Permission.Source"}),jo={sessionID:me,action:t,resources:p(t),save:p(t).pipe(e),metadata:x(t,F).pipe(e),source:zo.pipe(e),message:t.pipe(e)},Vo=n({id:et,...jo}).annotate({identifier:"Permission.Request"}),$o=B(["once","always","reject"]).annotate({identifier:"Permission.Reply"}),Xe=l({type:"permission.asked",schema:Vo.fields}),Ze=l({type:"permission.replied",schema:{sessionID:me,requestID:et,reply:$o}}),fr={Asked:Xe,Replied:Ze,Definitions:f(Xe,Ze)},Ko=B(["allow","deny","ask"]).annotate({identifier:"Permission.Effect"}),Go=n({action:t,resource:t,effect:Ko}).annotate({identifier:"Permission.Rule"}),tt=p(Go).annotate({identifier:"Permission.Ruleset"});var Ne=t.pipe(te("Integration.ID"),pe({identifier:"Integration.ID"})),O=t.pipe(te("Integration.MethodID"),pe({identifier:"Integration.MethodID"}));var z=t.pipe(te("Credential.ID"),pe({identifier:"Credential.ID"}),s((o)=>({create:()=>o.make("cred_"+h())}))),ot=l({type:"credential.updated",schema:{}}),it=l({type:"credential.switched",schema:{integrationID:Ne,credentialID:nt(z)}}),vr={Updated:ot,Switched:it,Definitions:f(ot,it)},Yo=n({type:d("oauth"),methodID:O,refresh:t,access:t,expires:S,metadata:e(x(t,F))}).annotate({identifier:"Credential.OAuth"}),Jo=n({type:d("key"),key:t,metadata:e(x(t,F))}).annotate({identifier:"Credential.Key"}),Ho=n({type:d("external"),methodID:O,metadata:e(x(t,F))}).annotate({identifier:"Credential.External"}),at=b([Yo,Jo,Ho]).pipe(ze("type")).annotate({identifier:"Credential.Value"}),Cr=n({id:z,integrationID:Ne,label:t,active:v,value:at}).annotate({identifier:"Credential.Entry"}),kr=n({id:e(z),integrationID:Ne,label:e(t),value:at,activate:e(v)}).annotate({identifier:"Credential.CreateInput"});var pt=n({status:B(["needs_auth"]),message:t,url:e(t)}).annotate({identifier:"Connection.Status"}),Qo=n({type:d("credential"),id:z,label:t,method:B(["key","oauth","external"]),status:e(pt)}).annotate({identifier:"Connection.CredentialInfo"}),Xo=n({type:d("env"),name:t,status:e(pt)}).annotate({identifier:"Connection.EnvInfo"}),ct=b([Qo,Xo]).pipe(ze("type")).annotate({identifier:"Connection.Info"});var Zo=t.check(Yn("frm_")).pipe(te("Form.ID"),pe({identifier:"Form.ID"})),ge=Zo.pipe(s((o)=>({create:(i)=>o.make(i??"frm_"+h())}))),ei=x(t,F).annotate({identifier:"Form.Metadata"}),ut=n({value:t,label:t,description:t.pipe(e)}).annotate({identifier:"Form.Option"}),ti=n({key:t,op:B(["eq","neq"]),value:b([t,ee,v])}).annotate({identifier:"Form.When"}),W={key:t,title:t.pipe(e),description:t.pipe(e),required:v.pipe(e),hidden:v.pipe(e).annotate({description:"Skip the interactive authentication prompt and use the default unless an answer is supplied"}),when:p(ti).pipe(e)},oi=n({...W,type:d("string"),format:B(["email","uri","date","date-time"]).pipe(e),minLength:S.pipe(e),maxLength:S.pipe(e),pattern:t.pipe(e),placeholder:t.pipe(e),default:t.pipe(e),options:p(ut).pipe(e),custom:v.pipe(e)}).annotate({identifier:"Form.StringField"}),ii=n({...W,type:d("number"),minimum:ee.pipe(e),maximum:ee.pipe(e),default:ee.pipe(e)}).annotate({identifier:"Form.NumberField"}),ni=n({...W,type:d("integer"),minimum:ee.pipe(e),maximum:ee.pipe(e),default:ee.pipe(e)}).annotate({identifier:"Form.IntegerField"}),ri=n({...W,type:d("boolean"),default:v.pipe(e)}).annotate({identifier:"Form.BooleanField"}),ai=n({...W,type:d("multiselect"),options:p(ut),minItems:S.pipe(e),maxItems:S.pipe(e),custom:v.pipe(e),default:p(t).pipe(e)}).annotate({identifier:"Form.MultiselectField"}),si=n({key:t,type:d("external"),url:t,title:t.pipe(e),description:t.pipe(e)}).annotate({identifier:"Form.ExternalField"}),pi=b([oi,ii,ni,ri,ai,si]).pipe(ze("type"),pe({identifier:"Form.Field"})),j=Ur(pi).annotate({identifier:"Form.Fields"}),ci={id:ge,sessionID:t,title:t,metadata:ei.pipe(e)},gt=n({...ci,fields:j}).annotate({identifier:"Form.Info"}),li=b([t,ee,v,p(t)]).annotate({identifier:"Form.Value"}),Se=x(t,li).annotate({identifier:"Form.Answer"}),di=b([n({status:d("pending")}),n({status:d("answered"),answer:Se}),n({status:d("cancelled"),message:t.pipe(e)})]).pipe(ze("status")).annotate({identifier:"Form.State"}),Fr=n({...gt.fields,state:di}).annotate({identifier:"Form.Detail"}),Er=n({answer:Se}).annotate({identifier:"Form.Reply"}),lt=l({type:"form.created",schema:{form:gt}}),dt=l({type:"form.replied",schema:{id:ge,sessionID:t,answer:Se}}),ft=l({type:"form.cancelled",schema:{id:ge,sessionID:t}}),_r={Created:lt,Replied:dt,Cancelled:ft,Definitions:f(lt,dt,ft)};var xe=Ne,ye=O,mi=n({id:ye,type:d("oauth"),label:t,form:e(j)}).annotate({identifier:"Integration.OAuthMethod"}),fi=n({id:ye,type:d("command"),label:t,command:p(t)}).annotate({identifier:"Integration.CommandMethod"}),ui=n({type:d("key"),label:e(t),form:e(j)}).annotate({identifier:"Integration.KeyMethod"}),gi=n({id:ye,type:d("external"),label:t,form:e(j)}).annotate({identifier:"Integration.ExternalMethod"}),Si=n({type:d("env"),names:p(t)}).annotate({identifier:"Integration.EnvMethod"}),hi=b([mi,fi,ui,gi,Si]).pipe(ze("type")).annotate({identifier:"Integration.Method"}),ht=l({type:"integration.updated",schema:{}}),Gr={Updated:ht,Definitions:f(ht)},Yr=n({id:xe,name:t,metadata:e(x(t,Yt))}).annotate({identifier:"Integration.Ref"}),Jr=n({id:xe,name:t,metadata:e(x(t,Yt)),methods:p(hi),connections:p(ct)}).annotate({identifier:"Integration.Info"}),xt=t.pipe(te("Integration.AttemptID"),pe({identifier:"Integration.AttemptID"}),s((o)=>({create:()=>o.make("con_"+h())}))),D=n({created:ee,expires:ee});class xi extends L("Integration.Attempt")({attemptID:xt,url:t,instructions:t,mode:B(["auto","code"]),paste:Be(d(!0)),time:D}){}var Hr=b([n({status:d("pending"),time:D}),n({status:d("complete"),time:D}),n({status:d("failed"),message:t,time:D}),n({status:d("expired"),time:D})]).pipe(ze("status")).annotate({identifier:"Integration.AttemptStatus"}),Qr=n({attemptID:xt,time:D}).annotate({identifier:"Integration.CommandAttempt"}),Xr=b([n({status:d("pending"),message:e(t),time:D}),n({status:d("complete"),time:D}),n({status:d("failed"),message:t,time:D}),n({status:d("expired"),time:D})]).pipe(ze("status")).annotate({identifier:"Integration.CommandAttemptStatus"});var It=b([B(["reasoning","reasoning_content","reasoning_text"]),t]).annotate({identifier:"Model.ReasoningField"}),bt=B(["max_completion_tokens","max_tokens"]).annotate({identifier:"Model.MaxTokensField"}),vt=B(["assets","state","root"]).annotate({identifier:"Model.MediaInput"}),yi=B(["anthropic","alibaba"]).annotate({identifier:"Model.CacheFormat"}),N=n({reasoningField:It.pipe(e),requireReasoning:v.pipe(e),maxTokensField:bt.pipe(e),requireFinishReason:v.pipe(e),requireAssistantAfterTool:v.pipe(e),supportsPromptCacheKey:v.pipe(e),streamUsage:v.pipe(e),cacheFormat:yi.pipe(e),supportsThinkingBlockBinding:v.pipe(e),supportsEffortUpdates:v.pipe(e),mediaInput:vt.pipe(e)}).annotate({identifier:"Model.Compatibility"}),V=n(_t(N.fields,["supportsThinkingBlockBinding","supportsEffortUpdates"])).annotate({identifier:"Provider.Compatibility"});var A=t.pipe(te("Provider.ID"),pe({identifier:"Provider.ID"}),s((o)=>({opencode:o.make("opencode"),anthropic:o.make("anthropic"),openai:o.make("openai"),google:o.make("google"),googleVertex:o.make("google-vertex"),githubCopilot:o.make("github-copilot"),claudeAgent:o.make("claude-agent"),amazonBedrock:o.make("amazon-bedrock"),azure:o.make("azure"),openrouter:o.make("openrouter"),mistral:o.make("mistral"),gitlab:o.make("gitlab")}))),Ct=l({type:"provider.updated",schema:{}}),sa={Updated:Ct,Definitions:f(Ct)},Dt=t,bi=B(["auto","enabled","disabled"]),vi=b([n({type:d("summary")}),n({type:d("native")})]).pipe(ze("type")).annotate({identifier:"Provider.Compaction"}),Ci=B(["http","websocket"]).annotate({identifier:"Provider.Transport"}),Di=Ui([ee,B(["ms","s","m","h","d"])]).check(Ee(/^\d+(ms|s|m|h|d)$/)).annotate({identifier:"Provider.CacheTTL"}),ki=b([v,n({interval:b([d("auto"),t]).pipe(e).annotate({description:`Duration such as "4 minutes", or "auto" for 90% of the model's cache.ttl`}),duration:t.pipe(e).annotate({description:'Duration such as "30 minutes"'})})]).annotate({identifier:"Provider.CacheWarming"}),Mi=n({ttl:Di.pipe(e),warming:ki.pipe(e)}).annotate({identifier:"Provider.Cache"}),Pi=B(["zstd","gzip","none"]).annotate({identifier:"Provider.Encoding"}),Ie=b([rt,d(!1)]).pipe(e),K=wn(n({timeout:Ie,headerTimeout:Ie,chunkTimeout:Ie,compaction:vi.pipe(e),cache:Mi.pipe(e),transport:Ci.pipe(e),encoding:Pi.pipe(e)}),[x(t,Yt)]).annotate({identifier:"Provider.Settings"}),wi={settings:K.pipe(e),headers:x(t,t).pipe(e),body:x(t,Yt).pipe(e)},pa=n({settings:K.pipe(qs(r({}))),headers:x(t,t),body:x(t,Yt)}).annotate({identifier:"Provider.Request"}),ca=n({id:A,canonical:A.pipe(e),integrationID:xe.pipe(e),name:t,activation:bi,package:Dt,compatibility:V.pipe(e),...wi}).annotate({identifier:"Provider.Info"}).pipe(s(()=>({empty:(o)=>({id:o,name:o,activation:"auto",package:""})})));var ma=rt.pipe(te("Money.USD"),pe({identifier:"Money.USD"}),s((o)=>({zero:o.make(0)}))),U=rt.pipe(te("Money.USDPerMillionTokens"),pe({identifier:"Money.USDPerMillionTokens"}),s((o)=>({zero:o.make(0)})));var T=t.pipe(te("Model.ID")),kt=l({type:"model.updated",schema:{}}),ya={Updated:kt,Definitions:f(kt)},E=t.pipe(te("Model.VariantID")),Ri=n({id:T,providerID:A,variant:E.pipe(e)}).annotate({identifier:"Model.Ref"}).pipe(s((o)=>({parse:(i)=>{let c=i.indexOf("/");if(c<=0)throw Error(`Invalid model reference: ${i}`);let g=i.slice(0,c),k=i.indexOf("#",c+1),P=i.slice(c+1,k===-1?void 0:k),I=k===-1?void 0:i.slice(k+1);if(!P||g.includes("#")||I!==void 0&&(!I||I.includes("#")))throw Error(`Invalid model reference: ${i}`);return o.make({providerID:A.make(g),id:T.make(P),...I?{variant:E.make(I)}:{}})}})));var Ce=t.pipe(te("Model.Family")),De=b([B(["chat","decision","image"]),t]).annotate({identifier:"Model.Type"}),J=wn(n(Nr(K.schema.fields,["compaction","cache","encoding"])),[x(t,Yt)]).annotate({identifier:"Model.Settings"}),Ai=wn(n(_t(J.schema.fields,["cache"])),J.records).annotate({identifier:"Model.VariantSettings"}),Mt={settings:J.pipe(e),headers:x(t,t).pipe(e),body:x(t,Yt).pipe(e)},Q=n({tools:v,input:p(t),output:p(t),temperature:v.pipe(e)}).annotate({identifier:"Model.Capabilities"}).pipe(s(()=>({default:()=>({tools:!0,input:["text","image"],output:["text"]})}))),Ti=n({tier:n({type:mt("context"),size:G}).pipe(e),input:U,output:U,cache:n({read:U,write:U})}).annotate({identifier:"Model.Cost"}),Fi=n({id:E,...Mt,settings:Ai.pipe(e)}).annotate({identifier:"Model.Variant"}),Ia=n({id:T,modelID:T,providerID:A,canonical:A.pipe(e),type:De.pipe(e),family:Ce.pipe(e),name:t,compatibility:N.pipe(e),package:Dt.pipe(e),...Mt,capabilities:Q,variants:p(Fi),time:n({released:rt}),cost:p(Ti),status:B(["alpha","beta","deprecated","active"]),enabled:v,limit:n({context:G,input:G.pipe(e),output:G})}).annotate({identifier:"Model.Info"}).pipe(s(()=>({default:(o,i)=>({id:i,modelID:i,providerID:o,name:i,capabilities:Q.default(),variants:[],time:{released:0},cost:[],status:"active",enabled:!0,limit:{context:200000,output:32000}})})));var Ei=A.check(Ee(/^[^/#]+$/u)),_i=T.check(Ee(/^[^#]+$/u)),Bi=E.check(Ee(/^[^#]+$/u)),wt=n({providerID:Ei,model:_i,variant:Bi.pipe(e)}),Oi=t.check(Ee(/^[^/#]+\/[^#]+(?:#[^#]+)?$/u)),X=b([Oi,wt]).pipe(m(wt,{decode:y((o)=>typeof o==="string"?Wi(o):o),encode:he({strict:!1})})).annotate({identifier:"Config.ModelSelection"});function Wi(o){let i=Ri.parse(o);return{providerID:i.providerID,model:i.id,...i.variant?{variant:i.variant}:{}}}var Ni=wn(n(K.schema.fields),[x(t,Zn(Cn))]).annotate({identifier:"Config.Provider.Settings"}),Me=wn(n(J.schema.fields),[x(t,Zn(Cn))]).annotate({identifier:"Config.Model.Settings"}),At=x(t,Cn),Pe={settings:Ni.pipe(e),headers:x(t,t).pipe(e),body:At.pipe(e)},Lt={settings:Me.pipe(e),headers:x(t,t).pipe(e),body:At.pipe(e)};class Tt extends L("Config.Provider.Request")({headers:Pe.headers,body:Pe.body}){}class Ft extends L("Config.Model.Cost.Cache")({read:U.pipe(e),write:U.pipe(e)}){}class we extends L("Config.Model.Cost")({tier:n({type:d("context"),size:G}).pipe(e),input:U,output:U,cache:Ft.pipe(e)}){}class Et extends L("Config.Model.Limit")({context:G.pipe(e),input:G.pipe(e),output:G.pipe(e)}){}var qi=b([n({supported:d(!1)}),n({supported:d(!0),toggle:v.pipe(e),effort:t.pipe(p,e),budget:n({min:G.pipe(e),max:G.pipe(e)}).pipe(e)})]).annotate({identifier:"Config.Model.Reasoning"});class Bt extends L("Config.Model")({modelID:T.pipe(e),type:De.pipe(e),family:Ce.pipe(e),name:t.pipe(e),releaseDate:t.check(Ee(/^\d{4}-\d{2}(-\d{2})?$/u)).annotate({description:"Release date as YYYY-MM-DD or YYYY-MM"}).pipe(e),compatibility:N.pipe(e),package:t.pipe(e),...Lt,capabilities:Q.mapFields((o)=>({tools:e(o.tools),input:e(o.input),output:e(o.output),temperature:o.temperature,reasoning:qi.pipe(e)})).annotate({identifier:"Config.Model.Capabilities"}).pipe(e),variants:n({id:E,...Lt,settings:wn(n(_t(Me.schema.fields,["cache"])),Me.records).annotate({identifier:"Config.Model.VariantSettings"}).pipe(e)}).pipe(p,e),cost:b([we,we.pipe(p)]).pipe(e),disabled:v.pipe(e),limit:Et.pipe(e)}){}class Re extends L("Config.Provider")({canonical:A.pipe(e),name:t.pipe(e),env:t.pipe(p,e),package:t.pipe(e),compatibility:V.pipe(e),...Pe,models:x(t,Bt).pipe(e)}){}var Vi=t.check(Ee(/^#[0-9a-fA-F]{6}$/u));class Ot extends L("Config.Agent")({model:X.pipe(e),request:Tt.pipe(e),system:t.pipe(e),description:t.pipe(e),mode:B(["subagent","primary","all"]).pipe(e),hidden:v.pipe(e),color:Vi.pipe(Li(()=>xn),e),steps:u.pipe(e),disabled:v.pipe(e),permissions:tt.pipe(e)}){}class Nt extends L("Config.Media.Image")({auto_resize:v.pipe(e),max_width:u.pipe(e),max_height:u.pipe(e),max_base64_bytes:u.pipe(e)}){}class qt extends L("Config.Media")({image:Nt.pipe(e)}){}class jt extends L("Config.Compaction.Keep")({tokens:S.pipe(e)}){}var Ki=t.check(Ee(/^([1-9]\d?(\.\d+)?)%$/u)).annotate({identifier:"Config.Compaction.Percent"});class Vt extends L("Config.Compaction")({auto:v.pipe(e),keep:jt.pipe(e),buffer:b([Ki,S]).pipe(e).annotate({description:`Room kept free below the model's context window before automatic compaction, as a share of the window from "1%" to "99%", such as "20%" to compact at 80% full. A token count is also accepted.`})}){}class Kt extends L("Config.Command")({template:t,description:t.pipe(e),agent:t.pipe(e),model:X.pipe(e),subagent:v.pipe(e),subtask:v.annotate({description:"Deprecated alias for subagent."}).pipe(e)}){}var Gi={todo:"Enable the experimental todowrite tool.",background_compaction:"Enable experimental background compaction: summarize the conversation in the background as it nears the compaction threshold, so automatic compaction does not wait for the summary. Background summaries that are never used still cost tokens.",media_blob:"Store new session media once in a deduplicated blob table instead of inline in every message row.",schedules:"Enable experimental scheduled tasks that wake a session with a prompt.",artifacts:"Enable experimental artifacts backed by pluggable providers."};var Qt=B(["allow","deny"]),os=B(["provider.use","tool.use","integration.connect","integration.use","mcp.use","skill.use","plugin.use","websearch.use"]),Ht=n({action:os,resource:t,effect:Qt}),Yi=new Map([["mcp","mcp.use"],["skill","skill.use"],["plugin","plugin.use"]]),Le=Ht.pipe(m(ve(Ht),{decode:y((o)=>{if(o.action!=="integration.use")return o;let i=o.resource.indexOf(":"),c=i===-1?void 0:Yi.get(o.resource.slice(0,i));if(!c)return o;return{...o,action:c,resource:o.resource.slice(i+1)}}),encode:he()}));class Xt extends L("ConfigExperimental.Info")({portable_shell_scanner:v.pipe(e).annotate({description:"Deprecated: the built-in shell permission scanner is now always enabled."}),all_flags:v.pipe(e).annotate({description:"Turn every feature flag on regardless of the build channel, like OPENCODE_FLAGS=all; explicit per-flag settings still win, and false is not a kill switch."}),...$n(Gi,(o)=>v.pipe(e).annotate({description:`${o} Defaults to on in local and dev builds and off in releases.`})),part_rows:v.pipe(e).annotate({description:"Write each assistant part as its own session_part row instead of rewriting the whole message on every event. Defaults to false."}),image_generate:b([v,n({model:X.pipe(e).annotate({description:"Default model for the experimental_image_generate tool when the agent doesn't choose one, as providerID/modelID. Falls back to automatic selection when it isn't available."})})]).pipe(e).annotate({description:"Settings for the experimental_image_generate tool, which is offered while a connected provider has an image model."}),subagent_depth:S.pipe(e).annotate({description:"Maximum subagent nesting depth. Defaults to 1."}),location_idle_timeout:b([To,d(!1)]).pipe(e).annotate({description:'How long a location can go without session activity before its services are unloaded. Running sessions and background jobs keep a location loaded. Set to false to never unload (default: "60 minutes")'}),policies:Le.pipe(p,e).annotate({description:"Deprecated: use top-level policies. Ordered policies controlling access to configured resources"})}){}class eo extends L("Config.Formatter.Entry")({disabled:v.pipe(e),command:t.pipe(p,e),environment:x(t,t).pipe(e),extensions:t.pipe(p,e)}){}var Ji=b([v,x(t,eo)]);var Hi=n({disabled:d(!0)});class oo extends L("Config.LSP.Server")({command:t.pipe(p),extensions:t.pipe(p,e),disabled:v.pipe(e),env:x(t,t).pipe(e),initialization:x(t,F).pipe(e)}){}var Qi=b([Hi,oo]),Xi=b([v,x(t,Qi)]);class ie extends L("Mcp.TimeoutConfig")({startup:u.pipe(e).annotate({description:"Maximum time in milliseconds to establish and initialize the MCP server."}),catalog:u.pipe(e).annotate({description:"Maximum time in milliseconds to wait for MCP discovery requests such as tools/list and prompts/list."}),execution:u.pipe(e).annotate({description:"Maximum time in milliseconds to wait for MCP tool and prompt execution."})}){}var Ae=B(["legacy","auto","2026-07-28"]).annotate({identifier:"Mcp.Protocol",description:'MCP protocol negotiation. "legacy" (default) opens with the initialize handshake and speaks protocol revisions up to 2025-11-25. "auto" probes for the 2026-07-28 revision and falls back to legacy when the server does not support it. "2026-07-28" requires that revision and fails otherwise.'});class Ue extends L("Mcp.LocalConfig")({type:d("local"),command:t.pipe(p),cwd:t.pipe(e).annotate({description:"Working directory for the MCP server process. Relative paths resolve from the workspace directory."}),environment:x(t,t).pipe(e),disabled:v.pipe(e),codemode:v.pipe(e).annotate({description:"Expose this server's tools through Code Mode. Defaults to true."}),timeout:ie.pipe(e),protocol:Ae.pipe(e),pool:v.pipe(e).annotate({description:'Share one connection to this server across every directory that configures it identically, instead of one per directory. Only connections that negotiate the 2026-07-28 revision are shared; an unset "protocol" becomes "auto", and "legacy" never shares. Defaults to false.'})}){}class Fe extends L("Mcp.OAuthConfig")({client_id:t.pipe(e),client_secret:t.pipe(e),scope:t.pipe(e),callback_port:G.check(Pt({minimum:1,maximum:65535})).pipe(e),redirect_uri:t.pipe(e),auth_server_metadata_url:t.pipe(e).annotate({description:"URL of the OAuth or OpenID Connect authorization server metadata document. Set when the MCP server does not publish protected resource metadata that names its authorization server."})}){}class _e extends L("Mcp.RemoteConfig")({type:d("remote"),url:t,headers:x(t,t).pipe(e),oauth:b([Fe,d(!1)]).pipe(e),disabled:v.pipe(e),codemode:v.pipe(e).annotate({description:"Expose this server's tools through Code Mode. Defaults to true."}),timeout:ie.pipe(e),protocol:Ae.pipe(e),pool:v.pipe(e).annotate({description:'Share one connection to this server across every directory that configures it identically, instead of one per directory. Only connections that negotiate the 2026-07-28 revision are shared; an unset "protocol" becomes "auto", and "legacy" never shares. Defaults to false.'})}){}var Zi=b([Ue,_e]).pipe(ze("type")),en=n({status:d("connected")}).annotate({identifier:"Mcp.Status.Connected"}),tn=n({status:d("pending")}).annotate({identifier:"Mcp.Status.Pending"}),on=n({status:d("disabled")}).annotate({identifier:"Mcp.Status.Disabled"}),nn=n({status:d("failed"),error:t}).annotate({identifier:"Mcp.Status.Failed"}),rn=n({status:d("needs_auth"),error:t}).annotate({identifier:"Mcp.Status.NeedsAuth"}),an=b([en,tn,on,nn,rn]).pipe(ze("status")),ns=n({name:t,status:an,title:e(t),integrationID:e(Ne)}).annotate({identifier:"Mcp.Server"}),sn=n({server:t,name:t,uri:t,description:e(t),mimeType:e(t)}).annotate({identifier:"Mcp.Resource"}),pn=n({server:t,name:t,uriTemplate:t,description:e(t),mimeType:e(t)}).annotate({identifier:"Mcp.ResourceTemplate"}),rs=n({resources:p(sn),templates:p(pn)}).annotate({identifier:"Mcp.ResourceCatalog"}),cn=b([n({type:d("text"),uri:t,text:t,mimeType:e(t)}),n({type:d("blob"),uri:t,blob:t,mimeType:e(t)})]).pipe(ze("type"),pe({identifier:"Mcp.ResourceContentPart"})),as=n({server:t,uri:t,contents:p(cn)}).annotate({identifier:"Mcp.ResourceContent"});var ln=ie,ls=Ue,ds=Fe,ms=_e,dn=Zi,fs=Ae;class Oe extends L("Config.MCP")({timeout:ln.pipe(e),servers:x(t,dn).pipe(e)}){}class ro extends L("Config.Plugin.Entry")({package:t,options:x(t,F).pipe(e)}){}var mn=b([t,ro]),fn=mn.pipe(p);class so extends L("Config.Reference.Git")({repository:t,branch:t.pipe(e),description:t.pipe(e),hidden:v.pipe(e)}){}class po extends L("Config.Reference.Local")({path:t,description:t.pipe(e),hidden:v.pipe(e)}){}var un=b([t,so,po]),gn=x(t,un);var ne=t.pipe(te("WebSearch.ID"),pe({identifier:"WebSearch.ID"})),bs=n({id:ne,name:t}).annotate({identifier:"WebSearch.Provider"}),vs=n({query:t,providerID:ne.pipe(e)}).annotate({identifier:"WebSearch.Input"}),Sn=n({url:t,title:t.pipe(e),content:t.pipe(e),time:n({published:rt.pipe(e).annotate({description:"Publication time in milliseconds since the Unix epoch"})})}).annotate({identifier:"WebSearch.Result"});class hn extends L("WebSearch.Response")({providerID:ne,results:p(Sn)}){}var lo=l({type:"websearch.updated",schema:{}}),Cs={Updated:lo,Definitions:f(lo)};class fo extends L("ConfigWebSearch.Info")({provider:b([d("random").annotate({description:"Reuse a randomly selected provider until it is rate limited, then switch to another available provider."}),ne])}){}var yn=b([d(!1),fo]);class go extends L("Config.ToolOutput")({max_lines:u.pipe(e),max_bytes:u.pipe(e)}){}class ho extends L("Config.Watcher")({ignore:t.pipe(p,e)}){}class yo extends L("Config.Warming")({prompt:t.pipe(e).annotate({description:"Prompt sent for keep-alive requests"}),interval:b([d("auto"),To]).pipe(e).annotate({description:`Idle time between keep-alive requests (default: "4 minutes"). "auto" uses 90% of the model's cache.ttl and skips models without one.`}),duration:To.pipe(e).annotate({description:'Time after the last active request to keep a session warm (default: "30 minutes")'})}){}var In=b([v,yo]);var bn=n({directory:zi.pipe($i(Ws())).annotate({description:"Parent directory for new worktrees, relative to the project's primary checkout when not absolute"})}).annotate({identifier:"Config.Worktree"});class _ extends L("Config.Info")({$schema:e(t).annotate({description:"JSON schema reference for configuration validation"}),shell:t.pipe(e).annotate({description:"Default shell to use for terminal and shell tool execution"}),model:X.pipe(e).annotate({description:"Default model to use when no session or agent model is selected"}),default_agent:t.pipe(e).annotate({description:"Default primary agent to use when no session agent is selected"}),update:B(["disable","notify","auto"]).pipe(e).annotate({description:"Disable updates, notify when one is available, or install updates automatically"}),share:B(["manual","auto","disabled"]).pipe(e).annotate({description:"Control whether sessions may be shared manually, automatically, or not at all"}),enterprise:n({url:t.pipe(e)}).pipe(e).annotate({description:"Enterprise sharing service configuration"}),username:t.pipe(e).annotate({description:"Username displayed in conversations and used for telemetry identity"}),timezone:t.pipe(e).annotate({description:"IANA time zone for schedules, e.g. America/Los_Angeles. Defaults to the server's local zone"}),permissions:tt.pipe(e).annotate({description:"Ordered tool permission rules applied to agent tool use"}),policies:Le.pipe(p,e).annotate({description:"Ordered policies controlling access to providers, tools, and integrations"}),agents:x(t,Ot).pipe(e).annotate({description:"Named built-in agent overrides and custom agent definitions"}),snapshots:v.pipe(e).annotate({description:"Enable snapshots used for undo and revert behavior"}),watcher:ho.pipe(e).annotate({description:"Filesystem watcher configuration"}),formatter:Ji.pipe(e).annotate({description:"Enable built-in formatters or configure formatter overrides"}),lsp:Xi.pipe(e).annotate({description:"Enable built-in language servers or configure server overrides"}),media:qt.pipe(e).annotate({description:"Media processing configuration"}),tool_output:go.pipe(e).annotate({description:"Tool output truncation thresholds"}),mcp:Oe.pipe(e).annotate({description:"MCP server configuration"}),compaction:Vt.pipe(e).annotate({description:"Conversation compaction behavior"}),skills:t.pipe(p,e).annotate({description:"Additional paths or URLs to discover skills from"}),commands:x(t,Kt).pipe(e).annotate({description:"Named slash command definitions"}),instructions:t.pipe(p,e).annotate({description:"Additional paths or URLs supplying ambient instructions"}),references:gn.pipe(e).annotate({description:"Named local directories or Git repositories available as external context"}),websearch:yn.pipe(e).annotate({description:"Web search provider selection"}),plugins:fn.pipe(e).annotate({description:"Ordered plugin enablement directives and external package declarations"}),worktree:bn.pipe(e).annotate({description:"Directory defaults for local worktree creation"}),warming:In.pipe(e).annotate({description:"Keep recently active sessions warm with transient model requests (default: false)"}),providers:x(t,Re).pipe(e),experimental:Xt.pipe(e)}){}var ip=n({shell:nt(t)}).annotate({identifier:"Config.Patch"});class re extends L("Config.Document")({type:d("document"),path:R.pipe(e),info:_}){}class Co extends L("Config.Directory")({type:d("directory"),path:R}){}var np=b([re,Co]).annotate({identifier:"Config.Entry"}),vo=l({type:"config.updated",schema:{}}),rp={Updated:vo,Definitions:f(vo)};var Rt={};Te(Rt,{ConfigIntegration:()=>Rt,Document:()=>Fn,Policies:()=>je,Remote:()=>ko,WellKnownDocument:()=>ae,make:()=>Po,suppliers:()=>Mo});var je=p(F).pipe(m(F,{decode:y((o)=>o.filter((i)=>{let c=H(n({action:t}))(i);if(M(c)&&!Dr(os)(c.value.action))return!1;let g=H(n({effect:t}))(i);return C(g)||Dr(Qt)(g.value.effect)})),encode:he({strict:!1})}),m(p(Le))),ko=n({providers:_.fields.providers,mcp:_.fields.mcp,policies:je.pipe(w),websearch:_.fields.websearch});class Fn extends re.extend("Config.IntegrationDocument")({integrationID:Ne,connection:ct,organization:w(t)}){}class ae extends re.extend("Config.WellKnownDocument")({integrationID:Ne}){}function Mo(o){return new Map(o.filter((i)=>i instanceof ae).flatMap((i)=>Object.keys(i.info.providers??{}).map((c)=>[c,i.integrationID])))}function Po(o){let i=o.info.mcp?.servers;return new Fn({type:"document",integrationID:o.integrationID,connection:o.connection,organization:o.organization,info:new _({providers:o.info.providers&&Object.fromEntries(Object.entries(o.info.providers).map(([c,g])=>[c,new Re({...g,env:void 0,settings:qe(g.settings),models:g.models&&Object.fromEntries(Object.entries(g.models).map(([k,P])=>[k,{...P,settings:qe(P.settings),variants:P.variants?.map((I)=>({...I,settings:qe(I.settings)}))}]))})])),mcp:i&&new Oe({servers:Object.fromEntries(Object.entries(i).filter(([,c])=>c.type==="remote"))}),policies:o.info.policies,websearch:o.info.websearch})})}function qe(o){return o&&Object.fromEntries(Object.entries(o).filter(([i])=>!["apiKey","authToken","accessToken"].includes(i)))}
|
|
2
|
-
export{Te,Ne,os,Rt,Fn};
|
package/chunk-aym5xapq.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Vr,Zr,hs,ui}from"./chunk-2y9vn023.js";export{ui as FetchHttpClient,hs as HttpClient,Vr as HttpClientRequest,Zr as HttpClientResponse};
|