@yukino.js/yukino 0.0.11 → 0.0.13-dev

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.
Files changed (53) hide show
  1. package/README.md +111 -68
  2. package/dist/a2a-DG2JNM3U.js +14 -0
  3. package/dist/acp-DCZDS6FQ.js +14 -0
  4. package/dist/anthropic-5BTWVZVT.js +4 -0
  5. package/dist/chunk-4CLD7LEU.js +5 -0
  6. package/dist/{chunk-QMHSZVNF.js → chunk-5DK2M7VI.js} +1 -1
  7. package/dist/chunk-5URXBVET.js +4 -0
  8. package/dist/{chunk-3VTVI62N.js → chunk-AZQD75PX.js} +1 -1
  9. package/dist/{chunk-WH5FUZXY.js → chunk-BDLFNDC4.js} +3 -3
  10. package/dist/{chunk-TPEUG7AU.js → chunk-COHBT6M7.js} +161 -155
  11. package/dist/chunk-CW5XFH7H.js +59 -0
  12. package/dist/{chunk-YWTRNPNR.js → chunk-IWMCIYOG.js} +21 -21
  13. package/dist/chunk-OI2W6R6H.js +28 -0
  14. package/dist/chunk-SZXXASVH.js +4 -0
  15. package/dist/chunk-UGX62ZSO.js +4 -0
  16. package/dist/chunk-W4GMCNWF.js +65 -0
  17. package/dist/lib/{anthropic-7HQY42TP.js → anthropic-AVZIC22O.js} +5 -5
  18. package/dist/lib/bwrap-JS5GRKWY.js +7 -0
  19. package/dist/lib/{chunk-QQ2V5EX3.js → chunk-EGJKLA2W.js} +3 -3
  20. package/dist/lib/{chunk-AUU4RKMV.js → chunk-GVI5R2DA.js} +47 -29
  21. package/dist/lib/{chunk-XDGZMZ2B.js → chunk-LSI3T24Q.js} +2 -2
  22. package/dist/lib/{chunk-EATSQNOB.js → chunk-O2H6VKKR.js} +3 -3
  23. package/dist/lib/{chunk-55LKYMVV.js → chunk-OFDOP6I2.js} +2 -2
  24. package/dist/lib/{chunk-JXZ5KIUV.js → chunk-PCZ63WQL.js} +1 -1
  25. package/dist/lib/{chunk-Q6B6TAR3.js → chunk-QJ32WYQY.js} +120 -152
  26. package/dist/lib/{chunk-VXHBKGZW.js → chunk-TUNZLQLO.js} +12 -13
  27. package/dist/lib/{chunk-OCGX3ISG.js → chunk-XH7D5FLE.js} +4 -4
  28. package/dist/lib/{chunk-KC54MV5H.js → chunk-XLRV26YW.js} +1 -1
  29. package/dist/lib/index.d.ts +380 -351
  30. package/dist/lib/index.js +925 -638
  31. package/dist/lib/{openai-Z7PCXN2X.js → openai-54IQOU6Y.js} +4 -4
  32. package/dist/lib/{providers-GOU5DD3X.js → providers-MOCB6Y5L.js} +3 -3
  33. package/dist/lib/seatbelt-LDM6UB6N.js +7 -0
  34. package/dist/lib/{tool-filter-GVVYY5QO.js → tool-filter-5Z6UTRRR.js} +4 -4
  35. package/dist/main-IA22XMQR.js +494 -0
  36. package/dist/main.js +2 -487
  37. package/dist/{openai-WNPMC64P.js → openai-I2TTMBWK.js} +1 -1
  38. package/dist/providers-DXQRJUIY.js +4 -0
  39. package/dist/server-QS7CX37F.js +4 -0
  40. package/dist/tool-filter-KDQMXIDC.js +4 -0
  41. package/package.json +2 -2
  42. package/dist/a2a-WKGEGTP6.js +0 -14
  43. package/dist/acp-W2I7T2NT.js +0 -14
  44. package/dist/anthropic-CQUMQFUK.js +0 -4
  45. package/dist/chunk-CH7VZVG4.js +0 -4
  46. package/dist/chunk-F6WFTAOT.js +0 -59
  47. package/dist/chunk-R567WVDL.js +0 -90
  48. package/dist/chunk-ZPL2YHQU.js +0 -5
  49. package/dist/lib/bwrap-V6MFP7PT.js +0 -7
  50. package/dist/lib/seatbelt-2OE46ZE7.js +0 -7
  51. package/dist/providers-CMCKMYGG.js +0 -4
  52. package/dist/server-OQ5XVSZY.js +0 -4
  53. package/dist/tool-filter-BTQ7WTHR.js +0 -4
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __yukinoCreateRequire } from "node:module";
3
3
  const require = __yukinoCreateRequire(import.meta.url);
4
- import{a as dn}from"./chunk-P6DHMU7R.js";import{a as ln}from"./chunk-CH7VZVG4.js";import{C as pn,D as St,E as Cs,F as io,G as ce,H as ao,I as Ss,J as ks,n as on,p as an,r as un,s as cn,v as Jr}from"./chunk-ZPL2YHQU.js";import"./chunk-MQAQBW7F.js";import{C as j,H as no,K as Xr,L as $e,M as oo,N as Rs,S as ie}from"./chunk-R567WVDL.js";import"./chunk-LCWNSYZU.js";import"./chunk-7MKA3SHV.js";function x(r,e,t,s,n){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t}function c(r,e,t,s){if(t==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?s:t==="a"?s.call(r):s?s.value:e.get(r)}var Ve=function(){let{crypto:r}=globalThis;if(r?.randomUUID)return Ve=r.randomUUID.bind(r),r.randomUUID();let e=new Uint8Array(1),t=r?()=>r.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,s=>(+s^t()&15>>+s/4).toString(16))};function Vr(r){return typeof r=="object"&&r!==null&&("name"in r&&r.name==="AbortError"||"message"in r&&String(r.message).includes("FetchRequestCanceledException"))}var Gr=r=>{if(r instanceof Error)return r;if(typeof r=="object"&&r!==null){try{if(Object.prototype.toString.call(r)==="[object Error]"){let e=new Error(r.message,r.cause?{cause:r.cause}:{});return r.stack&&(e.stack=r.stack),r.cause&&!e.cause&&(e.cause=r.cause),r.name&&(e.name=r.name),e}}catch{}try{return new Error(JSON.stringify(r))}catch{}}return new Error(r)};var y=class extends Error{},M=class r extends y{constructor(e,t,s,n){super(`${r.makeMessage(e,t,s)}`),this.status=e,this.headers=n,this.requestID=n?.get("x-request-id"),this.error=t;let o=t;this.code=o?.code,this.param=o?.param,this.type=o?.type}static makeMessage(e,t,s){let n=t?.message?typeof t.message=="string"?t.message:JSON.stringify(t.message):t?JSON.stringify(t):s;return e&&n?`${e} ${n}`:e?`${e} status code (no body)`:n||"(no status code or body)"}static generate(e,t,s,n){if(!e||!n)return new Ee({message:s,cause:Gr(t)});let o=t?.error;return e===400?new kt(e,o,s,n):e===401?new $t(e,o,s,n):e===403?new Et(e,o,s,n):e===404?new Ot(e,o,s,n):e===409?new vt(e,o,s,n):e===422?new Tt(e,o,s,n):e===429?new Lt(e,o,s,n):e>=500?new jt(e,o,s,n):new r(e,o,s,n)}},K=class extends M{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},Ee=class extends M{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),t&&(this.cause=t)}},Oe=class extends Ee{constructor({message:e}={}){super({message:e??"Request timed out."})}},kt=class extends M{},$t=class extends M{},Et=class extends M{},Ot=class extends M{},vt=class extends M{},Tt=class extends M{},Lt=class extends M{},jt=class extends M{},Ft=class extends y{constructor(){super("Could not parse response content as the length limit was reached")}},Nt=class extends y{constructor(){super("Could not parse response content as the request was rejected by the content filter")}},me=class extends Error{constructor(e){super(e)}},Ge=class extends M{constructor(e,t,s){let n="OAuth2 authentication error",o;if(t&&typeof t=="object"){let a=t;o=a.error;let l=a.error_description;l&&typeof l=="string"?n=l:o&&(n=o)}super(e,t,n,s),this.error_code=o}},Qr=class extends y{constructor(e,t,s){super(e),this.provider=t,this.cause=s}};var $i=/^[a-z][a-z0-9+.-]*:/i,uo=r=>$i.test(r),G=r=>(G=Array.isArray,G(r)),fn=G;function $s(r){return typeof r!="object"?{}:r??{}}function mn(r){if(!r)return!0;for(let e in r)return!1;return!0}function co(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function Yr(r){return r!=null&&typeof r=="object"&&!Array.isArray(r)}var lo=(r,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new y(`${r} must be an integer`);if(e<0)throw new y(`${r} must be a positive integer`);return e};var po=r=>{try{return JSON.parse(r)}catch{return}};var he=r=>new Promise(e=>setTimeout(e,r));var ve="6.49.0";var _o=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function Ei(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}var Oi=()=>{let r=Ei();if(r==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ve,"X-Stainless-OS":mo(Deno.build.os),"X-Stainless-Arch":fo(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ve,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(r==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ve,"X-Stainless-OS":mo(globalThis.process.platform??"unknown"),"X-Stainless-Arch":fo(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=vi();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ve,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ve,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function vi(){if(typeof navigator>"u"||!navigator)return null;let r=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:t}of r){let s=t.exec(navigator.userAgent);if(s){let n=s[1]||0,o=s[2]||0,a=s[3]||0;return{browser:e,version:`${n}.${o}.${a}`}}}return null}var fo=r=>r==="x32"?"x32":r==="x86_64"||r==="x64"?"x64":r==="arm"?"arm":r==="aarch64"||r==="arm64"?"arm64":r?`other:${r}`:"unknown",mo=r=>(r=r.toLowerCase(),r.includes("ios")?"iOS":r==="android"?"Android":r==="darwin"?"MacOS":r==="win32"?"Windows":r==="freebsd"?"FreeBSD":r==="openbsd"?"OpenBSD":r==="linux"?"Linux":r?`Other:${r}`:"Unknown"),ho,yo=()=>ho??(ho=Oi());function Es(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function hn(...r){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...r)}function Zr(r){let e=Symbol.asyncIterator in r?r[Symbol.asyncIterator]():r[Symbol.iterator]();return hn({start(){},async pull(t){let{done:s,value:n}=await e.next();s?t.close():t.enqueue(n)},async cancel(){await e.return?.()}})}function Os(r){if(r[Symbol.asyncIterator])return r;let e=r.getReader();return{async next(){try{let t=await e.read();return t?.done&&e.releaseLock(),t}catch(t){throw e.releaseLock(),t}},async return(){let t=e.cancel();return e.releaseLock(),await t,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function _n(r){if(r===null||typeof r!="object")return;if(r[Symbol.asyncIterator]){await r[Symbol.asyncIterator]().return?.();return}let e=r.getReader(),t=e.cancel();e.releaseLock(),await t}var Ao=({headers:r,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)});var yn="RFC3986",gn=r=>String(r),An={RFC1738:r=>String(r).replace(/%20/g,"+"),RFC3986:gn},bo="RFC1738";var vs=(r,e)=>(vs=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),vs(r,e)),_e=(()=>{let r=[];for(let e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r})();var bn=1024,wo=(r,e,t,s,n)=>{if(r.length===0)return r;let o=r;if(typeof r=="symbol"?o=Symbol.prototype.toString.call(r):typeof r!="string"&&(o=String(r)),t==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});let a="";for(let l=0;l<o.length;l+=bn){let d=o.length>=bn?o.slice(l,l+bn):o,p=[];for(let m=0;m<d.length;++m){let _=d.charCodeAt(m);if(_===45||_===46||_===95||_===126||_>=48&&_<=57||_>=65&&_<=90||_>=97&&_<=122||n===bo&&(_===40||_===41)){p[p.length]=d.charAt(m);continue}if(_<128){p[p.length]=_e[_];continue}if(_<2048){p[p.length]=_e[192|_>>6]+_e[128|_&63];continue}if(_<55296||_>=57344){p[p.length]=_e[224|_>>12]+_e[128|_>>6&63]+_e[128|_&63];continue}m+=1,_=65536+((_&1023)<<10|d.charCodeAt(m)&1023),p[p.length]=_e[240|_>>18]+_e[128|_>>12&63]+_e[128|_>>6&63]+_e[128|_&63]}a+=p.join("")}return a};function Io(r){return!r||typeof r!="object"?!1:!!(r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer(r))}function wn(r,e){if(G(r)){let t=[];for(let s=0;s<r.length;s+=1)t.push(e(r[s]));return t}return e(r)}var xo={brackets(r){return String(r)+"[]"},comma:"comma",indices(r,e){return String(r)+"["+e+"]"},repeat(r){return String(r)}},Ro=function(r,e){Array.prototype.push.apply(r,G(e)?e:[e])},Po,q={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:wo,encodeValuesOnly:!1,format:yn,formatter:gn,indices:!1,serializeDate(r){return(Po??(Po=Function.prototype.call.bind(Date.prototype.toISOString)))(r)},skipNulls:!1,strictNullHandling:!1};function Li(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r=="symbol"||typeof r=="bigint"}var In={};function Co(r,e,t,s,n,o,a,l,d,p,m,_,h,w,P,A,I,O){let g=r,$=O,k=0,E=!1;for(;($=$.get(In))!==void 0&&!E;){let F=$.get(r);if(k+=1,typeof F<"u"){if(F===k)throw new RangeError("Cyclic object value");E=!0}typeof $.get(In)>"u"&&(k=0)}if(typeof p=="function"?g=p(e,g):g instanceof Date?g=h?.(g):t==="comma"&&G(g)&&(g=wn(g,function(F){return F instanceof Date?h?.(F):F})),g===null){if(o)return d&&!A?d(e,q.encoder,I,"key",w):e;g=""}if(Li(g)||Io(g)){if(d){let F=A?e:d(e,q.encoder,I,"key",w);return[P?.(F)+"="+P?.(d(g,q.encoder,I,"value",w))]}return[P?.(e)+"="+P?.(String(g))]}let R=[];if(typeof g>"u")return R;let b;if(t==="comma"&&G(g))A&&d&&(g=wn(g,d)),b=[{value:g.length>0?g.join(",")||null:void 0}];else if(G(p))b=p;else{let F=Object.keys(g);b=m?F.sort(m):F}let v=l?String(e).replace(/\./g,"%2E"):String(e),N=s&&G(g)&&g.length===1?v+"[]":v;if(n&&G(g)&&g.length===0)return N+"[]";for(let F=0;F<b.length;++F){let B=b[F],Ct=typeof B=="object"&&typeof B.value<"u"?B.value:g[B];if(a&&Ct===null)continue;let X=_&&l?B.replace(/\./g,"%2E"):B,Ps=G(g)?typeof t=="function"?t(N,X):N:N+(_?"."+X:"["+X+"]");O.set(r,k);let xs=new WeakMap;xs.set(In,O),Ro(R,Co(Ct,Ps,t,s,n,o,a,l,t==="comma"&&A&&G(g)?null:d,p,m,_,h,w,P,A,I,xs))}return R}function ji(r=q){if(typeof r.allowEmptyArrays<"u"&&typeof r.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof r.encodeDotInKeys<"u"&&typeof r.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(r.encoder!==null&&typeof r.encoder<"u"&&typeof r.encoder!="function")throw new TypeError("Encoder has to be a function.");let e=r.charset||q.charset;if(typeof r.charset<"u"&&r.charset!=="utf-8"&&r.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let t=yn;if(typeof r.format<"u"){if(!vs(An,r.format))throw new TypeError("Unknown format option provided.");t=r.format}let s=An[t],n=q.filter;(typeof r.filter=="function"||G(r.filter))&&(n=r.filter);let o;if(r.arrayFormat&&r.arrayFormat in xo?o=r.arrayFormat:"indices"in r?o=r.indices?"indices":"repeat":o=q.arrayFormat,"commaRoundTrip"in r&&typeof r.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");let a=typeof r.allowDots>"u"?r.encodeDotInKeys?!0:q.allowDots:!!r.allowDots;return{addQueryPrefix:typeof r.addQueryPrefix=="boolean"?r.addQueryPrefix:q.addQueryPrefix,allowDots:a,allowEmptyArrays:typeof r.allowEmptyArrays=="boolean"?!!r.allowEmptyArrays:q.allowEmptyArrays,arrayFormat:o,charset:e,charsetSentinel:typeof r.charsetSentinel=="boolean"?r.charsetSentinel:q.charsetSentinel,commaRoundTrip:!!r.commaRoundTrip,delimiter:typeof r.delimiter>"u"?q.delimiter:r.delimiter,encode:typeof r.encode=="boolean"?r.encode:q.encode,encodeDotInKeys:typeof r.encodeDotInKeys=="boolean"?r.encodeDotInKeys:q.encodeDotInKeys,encoder:typeof r.encoder=="function"?r.encoder:q.encoder,encodeValuesOnly:typeof r.encodeValuesOnly=="boolean"?r.encodeValuesOnly:q.encodeValuesOnly,filter:n,format:t,formatter:s,serializeDate:typeof r.serializeDate=="function"?r.serializeDate:q.serializeDate,skipNulls:typeof r.skipNulls=="boolean"?r.skipNulls:q.skipNulls,sort:typeof r.sort=="function"?r.sort:null,strictNullHandling:typeof r.strictNullHandling=="boolean"?r.strictNullHandling:q.strictNullHandling}}function So(r,e={}){let t=r,s=ji(e),n,o;typeof s.filter=="function"?(o=s.filter,t=o("",t)):G(s.filter)&&(o=s.filter,n=o);let a=[];if(typeof t!="object"||t===null)return"";let l=xo[s.arrayFormat],d=l==="comma"&&s.commaRoundTrip;n||(n=Object.keys(t)),s.sort&&n.sort(s.sort);let p=new WeakMap;for(let h=0;h<n.length;++h){let w=n[h];s.skipNulls&&t[w]===null||Ro(a,Co(t[w],w,l,d,s.allowEmptyArrays,s.strictNullHandling,s.skipNulls,s.encodeDotInKeys,s.encode?s.encoder:null,s.filter,s.sort,s.allowDots,s.serializeDate,s.format,s.formatter,s.encodeValuesOnly,s.charset,p))}let m=a.join(s.delimiter),_=s.addQueryPrefix===!0?"?":"";return s.charsetSentinel&&(s.charset==="iso-8859-1"?_+="utf8=%26%2310003%3B&":_+="utf8=%E2%9C%93&"),m.length>0?_+m:""}function ko(r){return So(r,{arrayFormat:"brackets"})}function Oo(r){let e=0;for(let n of r)e+=n.length;let t=new Uint8Array(e),s=0;for(let n of r)t.set(n,s),s+=n.length;return t}var $o;function te(r){let e;return($o??(e=new globalThis.TextEncoder,$o=e.encode.bind(e)))(r)}var Eo;function Pn(r){let e;return(Eo??(e=new globalThis.TextDecoder,Eo=e.decode.bind(e)))(r)}var re,se,Qe=class{constructor(){re.set(this,void 0),se.set(this,void 0),x(this,re,new Uint8Array,"f"),x(this,se,null,"f")}decode(e){if(e==null)return[];let t=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?te(e):e;x(this,re,Oo([c(this,re,"f"),t]),"f");let s=[],n;for(;(n=Ni(c(this,re,"f"),c(this,se,"f")))!=null;){if(n.carriage&&c(this,se,"f")==null){x(this,se,n.index,"f");continue}if(c(this,se,"f")!=null&&(n.index!==c(this,se,"f")+1||n.carriage)){s.push(Pn(c(this,re,"f").subarray(0,c(this,se,"f")-1))),x(this,re,c(this,re,"f").subarray(c(this,se,"f")),"f"),x(this,se,null,"f");continue}let o=c(this,se,"f")!==null?n.preceding-1:n.preceding,a=Pn(c(this,re,"f").subarray(0,o));s.push(a),x(this,re,c(this,re,"f").subarray(n.index),"f"),x(this,se,null,"f")}return s}flush(){return c(this,re,"f").length?this.decode(`
4
+ import{a as dn}from"./chunk-P6DHMU7R.js";import{a as ln}from"./chunk-5URXBVET.js";import{C as pn,D as St,E as Cs,F as io,G as ce,H as ao,I as Ss,J as ks,n as on,p as an,r as un,s as cn,v as Jr}from"./chunk-4CLD7LEU.js";import"./chunk-MQAQBW7F.js";import{k as no,n as Xr,o as $e,p as oo,q as Rs,v as ie}from"./chunk-OI2W6R6H.js";import"./chunk-LCWNSYZU.js";import{C as j}from"./chunk-W4GMCNWF.js";import"./chunk-7MKA3SHV.js";function x(r,e,t,s,n){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t}function c(r,e,t,s){if(t==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?s:t==="a"?s.call(r):s?s.value:e.get(r)}var Ve=function(){let{crypto:r}=globalThis;if(r?.randomUUID)return Ve=r.randomUUID.bind(r),r.randomUUID();let e=new Uint8Array(1),t=r?()=>r.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,s=>(+s^t()&15>>+s/4).toString(16))};function Vr(r){return typeof r=="object"&&r!==null&&("name"in r&&r.name==="AbortError"||"message"in r&&String(r.message).includes("FetchRequestCanceledException"))}var Gr=r=>{if(r instanceof Error)return r;if(typeof r=="object"&&r!==null){try{if(Object.prototype.toString.call(r)==="[object Error]"){let e=new Error(r.message,r.cause?{cause:r.cause}:{});return r.stack&&(e.stack=r.stack),r.cause&&!e.cause&&(e.cause=r.cause),r.name&&(e.name=r.name),e}}catch{}try{return new Error(JSON.stringify(r))}catch{}}return new Error(r)};var y=class extends Error{},M=class r extends y{constructor(e,t,s,n){super(`${r.makeMessage(e,t,s)}`),this.status=e,this.headers=n,this.requestID=n?.get("x-request-id"),this.error=t;let o=t;this.code=o?.code,this.param=o?.param,this.type=o?.type}static makeMessage(e,t,s){let n=t?.message?typeof t.message=="string"?t.message:JSON.stringify(t.message):t?JSON.stringify(t):s;return e&&n?`${e} ${n}`:e?`${e} status code (no body)`:n||"(no status code or body)"}static generate(e,t,s,n){if(!e||!n)return new Ee({message:s,cause:Gr(t)});let o=t?.error;return e===400?new kt(e,o,s,n):e===401?new $t(e,o,s,n):e===403?new Et(e,o,s,n):e===404?new Ot(e,o,s,n):e===409?new vt(e,o,s,n):e===422?new Tt(e,o,s,n):e===429?new Lt(e,o,s,n):e>=500?new jt(e,o,s,n):new r(e,o,s,n)}},K=class extends M{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},Ee=class extends M{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),t&&(this.cause=t)}},Oe=class extends Ee{constructor({message:e}={}){super({message:e??"Request timed out."})}},kt=class extends M{},$t=class extends M{},Et=class extends M{},Ot=class extends M{},vt=class extends M{},Tt=class extends M{},Lt=class extends M{},jt=class extends M{},Ft=class extends y{constructor(){super("Could not parse response content as the length limit was reached")}},Nt=class extends y{constructor(){super("Could not parse response content as the request was rejected by the content filter")}},me=class extends Error{constructor(e){super(e)}},Ge=class extends M{constructor(e,t,s){let n="OAuth2 authentication error",o;if(t&&typeof t=="object"){let a=t;o=a.error;let l=a.error_description;l&&typeof l=="string"?n=l:o&&(n=o)}super(e,t,n,s),this.error_code=o}},Qr=class extends y{constructor(e,t,s){super(e),this.provider=t,this.cause=s}};var $i=/^[a-z][a-z0-9+.-]*:/i,uo=r=>$i.test(r),G=r=>(G=Array.isArray,G(r)),fn=G;function $s(r){return typeof r!="object"?{}:r??{}}function mn(r){if(!r)return!0;for(let e in r)return!1;return!0}function co(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function Yr(r){return r!=null&&typeof r=="object"&&!Array.isArray(r)}var lo=(r,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new y(`${r} must be an integer`);if(e<0)throw new y(`${r} must be a positive integer`);return e};var po=r=>{try{return JSON.parse(r)}catch{return}};var he=r=>new Promise(e=>setTimeout(e,r));var ve="6.49.0";var _o=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function Ei(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}var Oi=()=>{let r=Ei();if(r==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ve,"X-Stainless-OS":mo(Deno.build.os),"X-Stainless-Arch":fo(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ve,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(r==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ve,"X-Stainless-OS":mo(globalThis.process.platform??"unknown"),"X-Stainless-Arch":fo(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=vi();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ve,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ve,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function vi(){if(typeof navigator>"u"||!navigator)return null;let r=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:t}of r){let s=t.exec(navigator.userAgent);if(s){let n=s[1]||0,o=s[2]||0,a=s[3]||0;return{browser:e,version:`${n}.${o}.${a}`}}}return null}var fo=r=>r==="x32"?"x32":r==="x86_64"||r==="x64"?"x64":r==="arm"?"arm":r==="aarch64"||r==="arm64"?"arm64":r?`other:${r}`:"unknown",mo=r=>(r=r.toLowerCase(),r.includes("ios")?"iOS":r==="android"?"Android":r==="darwin"?"MacOS":r==="win32"?"Windows":r==="freebsd"?"FreeBSD":r==="openbsd"?"OpenBSD":r==="linux"?"Linux":r?`Other:${r}`:"Unknown"),ho,yo=()=>ho??(ho=Oi());function Es(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function hn(...r){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...r)}function Zr(r){let e=Symbol.asyncIterator in r?r[Symbol.asyncIterator]():r[Symbol.iterator]();return hn({start(){},async pull(t){let{done:s,value:n}=await e.next();s?t.close():t.enqueue(n)},async cancel(){await e.return?.()}})}function Os(r){if(r[Symbol.asyncIterator])return r;let e=r.getReader();return{async next(){try{let t=await e.read();return t?.done&&e.releaseLock(),t}catch(t){throw e.releaseLock(),t}},async return(){let t=e.cancel();return e.releaseLock(),await t,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function _n(r){if(r===null||typeof r!="object")return;if(r[Symbol.asyncIterator]){await r[Symbol.asyncIterator]().return?.();return}let e=r.getReader(),t=e.cancel();e.releaseLock(),await t}var Ao=({headers:r,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)});var yn="RFC3986",gn=r=>String(r),An={RFC1738:r=>String(r).replace(/%20/g,"+"),RFC3986:gn},bo="RFC1738";var vs=(r,e)=>(vs=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),vs(r,e)),_e=(()=>{let r=[];for(let e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r})();var bn=1024,wo=(r,e,t,s,n)=>{if(r.length===0)return r;let o=r;if(typeof r=="symbol"?o=Symbol.prototype.toString.call(r):typeof r!="string"&&(o=String(r)),t==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});let a="";for(let l=0;l<o.length;l+=bn){let d=o.length>=bn?o.slice(l,l+bn):o,p=[];for(let m=0;m<d.length;++m){let _=d.charCodeAt(m);if(_===45||_===46||_===95||_===126||_>=48&&_<=57||_>=65&&_<=90||_>=97&&_<=122||n===bo&&(_===40||_===41)){p[p.length]=d.charAt(m);continue}if(_<128){p[p.length]=_e[_];continue}if(_<2048){p[p.length]=_e[192|_>>6]+_e[128|_&63];continue}if(_<55296||_>=57344){p[p.length]=_e[224|_>>12]+_e[128|_>>6&63]+_e[128|_&63];continue}m+=1,_=65536+((_&1023)<<10|d.charCodeAt(m)&1023),p[p.length]=_e[240|_>>18]+_e[128|_>>12&63]+_e[128|_>>6&63]+_e[128|_&63]}a+=p.join("")}return a};function Io(r){return!r||typeof r!="object"?!1:!!(r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer(r))}function wn(r,e){if(G(r)){let t=[];for(let s=0;s<r.length;s+=1)t.push(e(r[s]));return t}return e(r)}var xo={brackets(r){return String(r)+"[]"},comma:"comma",indices(r,e){return String(r)+"["+e+"]"},repeat(r){return String(r)}},Ro=function(r,e){Array.prototype.push.apply(r,G(e)?e:[e])},Po,q={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:wo,encodeValuesOnly:!1,format:yn,formatter:gn,indices:!1,serializeDate(r){return(Po??(Po=Function.prototype.call.bind(Date.prototype.toISOString)))(r)},skipNulls:!1,strictNullHandling:!1};function Li(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r=="symbol"||typeof r=="bigint"}var In={};function Co(r,e,t,s,n,o,a,l,d,p,m,_,h,w,P,A,I,O){let g=r,$=O,k=0,E=!1;for(;($=$.get(In))!==void 0&&!E;){let F=$.get(r);if(k+=1,typeof F<"u"){if(F===k)throw new RangeError("Cyclic object value");E=!0}typeof $.get(In)>"u"&&(k=0)}if(typeof p=="function"?g=p(e,g):g instanceof Date?g=h?.(g):t==="comma"&&G(g)&&(g=wn(g,function(F){return F instanceof Date?h?.(F):F})),g===null){if(o)return d&&!A?d(e,q.encoder,I,"key",w):e;g=""}if(Li(g)||Io(g)){if(d){let F=A?e:d(e,q.encoder,I,"key",w);return[P?.(F)+"="+P?.(d(g,q.encoder,I,"value",w))]}return[P?.(e)+"="+P?.(String(g))]}let R=[];if(typeof g>"u")return R;let b;if(t==="comma"&&G(g))A&&d&&(g=wn(g,d)),b=[{value:g.length>0?g.join(",")||null:void 0}];else if(G(p))b=p;else{let F=Object.keys(g);b=m?F.sort(m):F}let v=l?String(e).replace(/\./g,"%2E"):String(e),N=s&&G(g)&&g.length===1?v+"[]":v;if(n&&G(g)&&g.length===0)return N+"[]";for(let F=0;F<b.length;++F){let B=b[F],Ct=typeof B=="object"&&typeof B.value<"u"?B.value:g[B];if(a&&Ct===null)continue;let X=_&&l?B.replace(/\./g,"%2E"):B,Ps=G(g)?typeof t=="function"?t(N,X):N:N+(_?"."+X:"["+X+"]");O.set(r,k);let xs=new WeakMap;xs.set(In,O),Ro(R,Co(Ct,Ps,t,s,n,o,a,l,t==="comma"&&A&&G(g)?null:d,p,m,_,h,w,P,A,I,xs))}return R}function ji(r=q){if(typeof r.allowEmptyArrays<"u"&&typeof r.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof r.encodeDotInKeys<"u"&&typeof r.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(r.encoder!==null&&typeof r.encoder<"u"&&typeof r.encoder!="function")throw new TypeError("Encoder has to be a function.");let e=r.charset||q.charset;if(typeof r.charset<"u"&&r.charset!=="utf-8"&&r.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let t=yn;if(typeof r.format<"u"){if(!vs(An,r.format))throw new TypeError("Unknown format option provided.");t=r.format}let s=An[t],n=q.filter;(typeof r.filter=="function"||G(r.filter))&&(n=r.filter);let o;if(r.arrayFormat&&r.arrayFormat in xo?o=r.arrayFormat:"indices"in r?o=r.indices?"indices":"repeat":o=q.arrayFormat,"commaRoundTrip"in r&&typeof r.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");let a=typeof r.allowDots>"u"?r.encodeDotInKeys?!0:q.allowDots:!!r.allowDots;return{addQueryPrefix:typeof r.addQueryPrefix=="boolean"?r.addQueryPrefix:q.addQueryPrefix,allowDots:a,allowEmptyArrays:typeof r.allowEmptyArrays=="boolean"?!!r.allowEmptyArrays:q.allowEmptyArrays,arrayFormat:o,charset:e,charsetSentinel:typeof r.charsetSentinel=="boolean"?r.charsetSentinel:q.charsetSentinel,commaRoundTrip:!!r.commaRoundTrip,delimiter:typeof r.delimiter>"u"?q.delimiter:r.delimiter,encode:typeof r.encode=="boolean"?r.encode:q.encode,encodeDotInKeys:typeof r.encodeDotInKeys=="boolean"?r.encodeDotInKeys:q.encodeDotInKeys,encoder:typeof r.encoder=="function"?r.encoder:q.encoder,encodeValuesOnly:typeof r.encodeValuesOnly=="boolean"?r.encodeValuesOnly:q.encodeValuesOnly,filter:n,format:t,formatter:s,serializeDate:typeof r.serializeDate=="function"?r.serializeDate:q.serializeDate,skipNulls:typeof r.skipNulls=="boolean"?r.skipNulls:q.skipNulls,sort:typeof r.sort=="function"?r.sort:null,strictNullHandling:typeof r.strictNullHandling=="boolean"?r.strictNullHandling:q.strictNullHandling}}function So(r,e={}){let t=r,s=ji(e),n,o;typeof s.filter=="function"?(o=s.filter,t=o("",t)):G(s.filter)&&(o=s.filter,n=o);let a=[];if(typeof t!="object"||t===null)return"";let l=xo[s.arrayFormat],d=l==="comma"&&s.commaRoundTrip;n||(n=Object.keys(t)),s.sort&&n.sort(s.sort);let p=new WeakMap;for(let h=0;h<n.length;++h){let w=n[h];s.skipNulls&&t[w]===null||Ro(a,Co(t[w],w,l,d,s.allowEmptyArrays,s.strictNullHandling,s.skipNulls,s.encodeDotInKeys,s.encode?s.encoder:null,s.filter,s.sort,s.allowDots,s.serializeDate,s.format,s.formatter,s.encodeValuesOnly,s.charset,p))}let m=a.join(s.delimiter),_=s.addQueryPrefix===!0?"?":"";return s.charsetSentinel&&(s.charset==="iso-8859-1"?_+="utf8=%26%2310003%3B&":_+="utf8=%E2%9C%93&"),m.length>0?_+m:""}function ko(r){return So(r,{arrayFormat:"brackets"})}function Oo(r){let e=0;for(let n of r)e+=n.length;let t=new Uint8Array(e),s=0;for(let n of r)t.set(n,s),s+=n.length;return t}var $o;function te(r){let e;return($o??(e=new globalThis.TextEncoder,$o=e.encode.bind(e)))(r)}var Eo;function Pn(r){let e;return(Eo??(e=new globalThis.TextDecoder,Eo=e.decode.bind(e)))(r)}var re,se,Qe=class{constructor(){re.set(this,void 0),se.set(this,void 0),x(this,re,new Uint8Array,"f"),x(this,se,null,"f")}decode(e){if(e==null)return[];let t=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?te(e):e;x(this,re,Oo([c(this,re,"f"),t]),"f");let s=[],n;for(;(n=Ni(c(this,re,"f"),c(this,se,"f")))!=null;){if(n.carriage&&c(this,se,"f")==null){x(this,se,n.index,"f");continue}if(c(this,se,"f")!=null&&(n.index!==c(this,se,"f")+1||n.carriage)){s.push(Pn(c(this,re,"f").subarray(0,c(this,se,"f")-1))),x(this,re,c(this,re,"f").subarray(c(this,se,"f")),"f"),x(this,se,null,"f");continue}let o=c(this,se,"f")!==null?n.preceding-1:n.preceding,a=Pn(c(this,re,"f").subarray(0,o));s.push(a),x(this,re,c(this,re,"f").subarray(n.index),"f"),x(this,se,null,"f")}return s}flush(){return c(this,re,"f").length?this.decode(`
5
5
  `):[]}};re=new WeakMap,se=new WeakMap;Qe.NEWLINE_CHARS=new Set([`
6
6
  `,"\r"]);Qe.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function Ni(r,e){for(let n=e??0;n<r.length;n++){if(r[n]===10)return{preceding:n,index:n+1,carriage:!1};if(r[n]===13)return{preceding:n,index:n+1,carriage:!0}}return null}function vo(r){for(let s=0;s<r.length-1;s++){if(r[s]===10&&r[s+1]===10||r[s]===13&&r[s+1]===13)return s+2;if(r[s]===13&&r[s+1]===10&&s+3<r.length&&r[s+2]===13&&r[s+3]===10)return s+4}return-1}var Ls={off:0,error:200,warn:300,info:400,debug:500},xn=(r,e,t)=>{if(r){if(co(Ls,r))return r;U(t).warn(`${e} was set to ${JSON.stringify(r)}, expected one of ${JSON.stringify(Object.keys(Ls))}`)}};function es(){}function Ts(r,e,t){return!e||Ls[r]>Ls[t]?es:e[r].bind(e)}var Mi={error:es,warn:es,info:es,debug:es},To=new WeakMap;function U(r){let e=r.logger,t=r.logLevel??"off";if(!e)return Mi;let s=To.get(e);if(s&&s[0]===t)return s[1];let n={error:Ts("error",e,t),warn:Ts("warn",e,t),info:Ts("info",e,t),debug:Ts("debug",e,t)};return To.set(e,[t,n]),n}var be=r=>(r.options&&(r.options={...r.options},delete r.options.headers),r.headers&&(r.headers=Object.fromEntries((r.headers instanceof Headers?[...r.headers]:Object.entries(r.headers)).map(([e,t])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="api-key"||e.toLowerCase()==="x-api-key"||e.toLowerCase()==="x-amz-security-token"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":t]))),"retryOfRequestLogID"in r&&(r.retryOfRequestLogID&&(r.retryOf=r.retryOfRequestLogID),delete r.retryOfRequestLogID),r);var ts,ee=class r{constructor(e,t,s){this.iterator=e,ts.set(this,void 0),this.controller=t,x(this,ts,s,"f")}static fromSSEResponse(e,t,s,n){let o=!1,a=s?U(s):console;async function*l(){if(o)throw new y("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let d=!1;try{for await(let p of Ki(e,t))if(!d){if(p.data.startsWith("[DONE]")){d=!0;continue}if(p.event===null||!p.event.startsWith("thread.")){let m;try{m=JSON.parse(p.data)}catch(_){throw a.error("Could not parse message into JSON:",p.data),a.error("From chunk:",p.raw),_}if(m&&m.error)throw new M(void 0,m.error,void 0,e.headers);yield n?{event:p.event,data:m}:m}else{let m;try{m=JSON.parse(p.data)}catch(_){throw console.error("Could not parse message into JSON:",p.data),console.error("From chunk:",p.raw),_}if(p.event=="error")throw new M(void 0,m.error,m.message,void 0);yield{event:p.event,data:m}}}d=!0}catch(p){if(Vr(p))return;throw p}finally{d||t.abort()}}return new r(l,t,s)}static fromReadableStream(e,t,s){let n=!1;async function*o(){let l=new Qe,d=e.getReader(),p=!1,m,_=()=>{m??(m=d.cancel()),m.catch(()=>{})};t.signal.addEventListener("abort",_,{once:!0});try{if(t.signal.aborted){_();return}for(;;){let{value:h,done:w}=await d.read();if(w){p=!0;break}if(t.signal.aborted)return;for(let P of l.decode(h)){if(t.signal.aborted)return;yield P}}if(t.signal.aborted)return;for(let h of l.flush()){if(t.signal.aborted)return;yield h}}finally{t.signal.removeEventListener("abort",_),p||_(),d.releaseLock()}}async function*a(){if(n)throw new y("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let l=!1;try{for await(let d of o())l||d&&(yield JSON.parse(d));l=!0}catch(d){if(t.signal.aborted||Vr(d))return;throw d}finally{l||t.abort()}}return new r(a,t,s)}[(ts=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],t=[],s=this.iterator(),n=o=>({next:()=>{if(o.length===0){let a=s.next();e.push(a),t.push(a)}return o.shift()}});return[new r(()=>n(e),this.controller,c(this,ts,"f")),new r(()=>n(t),this.controller,c(this,ts,"f"))]}toReadableStream(){let e=this,t;return hn({async start(){t=e[Symbol.asyncIterator]()},async pull(s){try{let{value:n,done:o}=await t.next();if(o)return s.close();let a=te(JSON.stringify(n)+`
7
7
  `);s.enqueue(a)}catch(n){s.error(n)}},async cancel(){await t.return?.()}})}};async function*Ki(r,e){if(!r.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new y("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new y("Attempted to iterate over a response with no body");let t=new Rn,s=new Qe,n=Os(r.body);for await(let o of Ui(n))for(let a of s.decode(o)){let l=t.decode(a);l&&(yield l)}for(let o of s.flush()){let a=t.decode(o);a&&(yield a)}}async function*Ui(r){let e=new Uint8Array;for await(let t of r){if(t==null)continue;let s=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?te(t):t,n=new Uint8Array(e.length+s.length);n.set(e),n.set(s,e.length),e=n;let o;for(;(o=vo(e))!==-1;)yield e.slice(0,o),e=e.slice(o)}e.length>0&&(yield e)}var Rn=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let o={event:this.event,data:this.data.join(`
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __yukinoCreateRequire } from "node:module";
3
+ const require = __yukinoCreateRequire(import.meta.url);
4
+ import{a,b}from"./chunk-BDLFNDC4.js";import"./chunk-OI2W6R6H.js";import"./chunk-JFKC4VCA.js";import"./chunk-LCWNSYZU.js";import"./chunk-SZXXASVH.js";import"./chunk-W4GMCNWF.js";import"./chunk-HMZQYFYG.js";import"./chunk-3QL446GD.js";import"./chunk-AGSYLE4E.js";import"./chunk-CU3IISCC.js";import"./chunk-VCIRD267.js";import"./chunk-7MKA3SHV.js";export{b as createTelemetryRuntime,a as parseExporterTypes};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __yukinoCreateRequire } from "node:module";
3
+ const require = __yukinoCreateRequire(import.meta.url);
4
+ import{g as a,h as b}from"./chunk-IWMCIYOG.js";import"./chunk-COHBT6M7.js";import"./chunk-5DK2M7VI.js";import"./chunk-4CLD7LEU.js";import"./chunk-CW5XFH7H.js";import"./chunk-AZQD75PX.js";import"./chunk-MQAQBW7F.js";import"./chunk-WGFROGUC.js";import"./chunk-VU3JWAJR.js";import"./chunk-BDLFNDC4.js";import"./chunk-OI2W6R6H.js";import"./chunk-JFKC4VCA.js";import"./chunk-KJJYW5IY.js";import"./chunk-I74AL3PF.js";import"./chunk-LCWNSYZU.js";import"./chunk-SZXXASVH.js";import"./chunk-W4GMCNWF.js";import"./chunk-VM4YKTHC.js";import"./chunk-HMZQYFYG.js";import"./chunk-3QL446GD.js";import"./chunk-AGSYLE4E.js";import"./chunk-CU3IISCC.js";import"./chunk-VCIRD267.js";import"./chunk-7MKA3SHV.js";export{b as RemoteServer,a as createRemoteAgent};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __yukinoCreateRequire } from "node:module";
3
+ const require = __yukinoCreateRequire(import.meta.url);
4
+ import{$ as e,X as a,Y as b,Z as c,_ as d,aa as f,ba as g}from"./chunk-CW5XFH7H.js";import"./chunk-AZQD75PX.js";import"./chunk-MQAQBW7F.js";import"./chunk-OI2W6R6H.js";import"./chunk-LCWNSYZU.js";import"./chunk-W4GMCNWF.js";import"./chunk-7MKA3SHV.js";export{c as ASYNC_AGENT_ALLOWED_TOOLS,e as FORK_QUERY_SOURCE,a as MAIN_AGENT_ONLY_TOOLS,b as SUBAGENT_DISALLOWED_TOOLS,g as cloneRegistryForFork,f as cloneRegistryForTeammate,d as filterToolsForAgent};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yukino.js/yukino",
3
- "version": "0.0.11",
3
+ "version": "0.0.13-dev",
4
4
  "description": "Yukino is a terminal-based AI coding agent. It provides an interactive UI (terminal user interface) for conversing with large language models, executing code, manipulating files, and orchestrating multi-agent workflows, all from the command line.",
5
5
  "keywords": [
6
6
  "a2a",
@@ -166,7 +166,7 @@
166
166
  "dev:fe": "cd src/remote/fe && tsup --watch",
167
167
  "build:fe": "cd src/remote/fe && rm -rf ./dist && tsup",
168
168
  "preview:fe": "pnpm dlx serve src/remote/fe/dist",
169
- "dev": "pnpm build:fe && tsx ./src/main.tsx",
169
+ "dev": "pnpm build:fe && tsx ./src/cli.ts",
170
170
  "build": "pnpm build:fe && rm -rf ./dist && tsup",
171
171
  "lint": "eslint --cache --quiet ./src ./tests",
172
172
  "lint:fix": "eslint --cache --fix --quiet ./src ./tests",