@urun-sh/openai 0.6.21 → 0.6.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-BAKPG5S3.js → chunk-CUDFHFNX.js} +3 -3
- package/dist/chunk-ERRG6R4T.js +62 -0
- package/dist/chunk-FHGSREBO.js +7 -0
- package/dist/chunk-JOOR4RUT.js +2 -0
- package/dist/hosted/bin.cjs +40 -38
- package/dist/hosted/bin.js +1 -1
- package/dist/hosted/index.cjs +36 -34
- package/dist/hosted/index.d.cts +114 -3
- package/dist/hosted/index.d.ts +64 -2
- package/dist/hosted/index.js +1 -1
- package/dist/pi-extension/index.js +1 -1
- package/dist/pi-extension/standalone.cjs +29 -29
- package/dist/proxy/cli.cjs +51 -49
- package/dist/proxy/cli.js +15 -14
- package/dist/proxy/index.cjs +26 -26
- package/dist/proxy/index.d.cts +2 -2
- package/dist/proxy/index.d.ts +2 -2
- package/dist/proxy/index.js +1 -1
- package/dist/{responses-turn-DmzWIpmO.d.ts → responses-turn-2UJImii3.d.ts} +12 -1
- package/dist/{responses-turn-Cb1qQBA7.d.cts → responses-turn-C0PBaF29.d.cts} +41 -1
- package/package.json +1 -1
- package/dist/chunk-5SBYFTBD.js +0 -62
- package/dist/chunk-7ZH2UHK6.js +0 -1
- package/dist/chunk-CL3LVMNL.js +0 -6
package/dist/hosted/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{D as S,E as ve,U as ye,V as we,a as L,b as he,l as Z}from"../chunk-CL3LVMNL.js";import"../chunk-7ZH2UHK6.js";import"../chunk-K23AZPI4.js";import{x as de,y as le}from"../chunk-5SBYFTBD.js";import"../chunk-76BZLCGT.js";import"../chunk-BAKPG5S3.js";import"../chunk-3JWYIKHM.js";import"../chunk-6M5JK4YC.js";import"../chunk-7V2JKPIG.js";import{a as ze,b as Le,c as F}from"../chunk-YSFSRI3D.js";var _e=ze(()=>{"use strict";F();var pe;(function(_){(function(M){var w=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:m(),O=P(_);typeof w.Reflect<"u"&&(O=P(w.Reflect,O)),M(O,w),typeof w.Reflect>"u"&&(w.Reflect=_);function P(g,C){return function(I,D){Object.defineProperty(g,I,{configurable:!0,writable:!0,value:D}),C&&C(I,D)}}function x(){try{return Function("return this;")()}catch{}}function E(){try{return(0,eval)("(function() { return this; })()")}catch{}}function m(){return x()||E()}})(function(M,w){var O=Object.prototype.hasOwnProperty,P=typeof Symbol=="function",x=P&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",E=P&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",m=typeof Object.create=="function",g={__proto__:[]}instanceof Array,C=!m&&!g,I={create:m?function(){return z(Object.create(null))}:g?function(){return z({__proto__:null})}:function(){return z({})},has:C?function(e,t){return O.call(e,t)}:function(e,t){return t in e},get:C?function(e,t){return O.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},D=Object.getPrototypeOf(Function),A=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Ue(),U=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:We(),W=typeof WeakMap=="function"?WeakMap:Ne(),R=P?Symbol.for("@reflect-metadata:registry"):void 0,H=$e(),q=He(H);function Me(e,t,r,n){if(s(r)){if(!ne(e))throw new TypeError;if(!ae(t))throw new TypeError;return Se(e,t)}else{if(!ne(e))throw new TypeError;if(!h(t))throw new TypeError;if(!h(n)&&!s(n)&&!G(n))throw new TypeError;return G(n)&&(n=void 0),r=k(r),Re(e,t,r,n)}}M("decorate",Me);function ge(e,t){function r(n,f){if(!h(n))throw new TypeError;if(!s(f)&&!De(f))throw new TypeError;X(e,t,n,f)}return r}M("metadata",ge);function me(e,t,r,n){if(!h(r))throw new TypeError;return s(n)||(n=k(n)),X(e,t,r,n)}M("defineMetadata",me);function Oe(e,t,r){if(!h(t))throw new TypeError;return s(r)||(r=k(r)),Y(e,t,r)}M("hasMetadata",Oe);function be(e,t,r){if(!h(t))throw new TypeError;return s(r)||(r=k(r)),N(e,t,r)}M("hasOwnMetadata",be);function ke(e,t,r){if(!h(t))throw new TypeError;return s(r)||(r=k(r)),J(e,t,r)}M("getMetadata",ke);function Te(e,t,r){if(!h(t))throw new TypeError;return s(r)||(r=k(r)),Q(e,t,r)}M("getOwnMetadata",Te);function Ee(e,t){if(!h(e))throw new TypeError;return s(t)||(t=k(t)),K(e,t)}M("getMetadataKeys",Ee);function Pe(e,t){if(!h(e))throw new TypeError;return s(t)||(t=k(t)),ee(e,t)}M("getOwnMetadataKeys",Pe);function Ie(e,t,r){if(!h(t))throw new TypeError;if(s(r)||(r=k(r)),!h(t))throw new TypeError;s(r)||(r=k(r));var n=$(t,r,!1);return s(n)?!1:n.OrdinaryDeleteMetadata(e,t,r)}M("deleteMetadata",Ie);function Se(e,t){for(var r=e.length-1;r>=0;--r){var n=e[r],f=n(t);if(!s(f)&&!G(f)){if(!ae(f))throw new TypeError;t=f}}return t}function Re(e,t,r,n){for(var f=e.length-1;f>=0;--f){var v=e[f],p=v(t,r,n);if(!s(p)&&!G(p)){if(!h(p))throw new TypeError;n=p}}return n}function Y(e,t,r){var n=N(e,t,r);if(n)return!0;var f=B(t);return G(f)?!1:Y(e,f,r)}function N(e,t,r){var n=$(t,r,!1);return s(n)?!1:re(n.OrdinaryHasOwnMetadata(e,t,r))}function J(e,t,r){var n=N(e,t,r);if(n)return Q(e,t,r);var f=B(t);if(!G(f))return J(e,f,r)}function Q(e,t,r){var n=$(t,r,!1);if(!s(n))return n.OrdinaryGetOwnMetadata(e,t,r)}function X(e,t,r,n){var f=$(r,n,!0);f.OrdinaryDefineOwnMetadata(e,t,r,n)}function K(e,t){var r=ee(e,t),n=B(e);if(n===null)return r;var f=K(n,t);if(f.length<=0)return r;if(r.length<=0)return f;for(var v=new U,p=[],c=0,a=r;c<a.length;c++){var i=a[c],o=v.has(i);o||(v.add(i),p.push(i))}for(var u=0,d=f;u<d.length;u++){var i=d[u],o=v.has(i);o||(v.add(i),p.push(i))}return p}function ee(e,t){var r=$(e,t,!1);return r?r.OrdinaryOwnMetadataKeys(e,t):[]}function te(e){if(e===null)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return e===null?1:6;default:return 6}}function s(e){return e===void 0}function G(e){return e===null}function Ge(e){return typeof e=="symbol"}function h(e){return typeof e=="object"?e!==null:typeof e=="function"}function je(e,t){switch(te(e)){case 0:return e;case 1:return e;case 2:return e;case 3:return e;case 4:return e;case 5:return e}var r=t===3?"string":t===5?"number":"default",n=ie(e,x);if(n!==void 0){var f=n.call(e,r);if(h(f))throw new TypeError;return f}return xe(e,r==="default"?"number":r)}function xe(e,t){if(t==="string"){var r=e.toString;if(j(r)){var n=r.call(e);if(!h(n))return n}var f=e.valueOf;if(j(f)){var n=f.call(e);if(!h(n))return n}}else{var f=e.valueOf;if(j(f)){var n=f.call(e);if(!h(n))return n}var v=e.toString;if(j(v)){var n=v.call(e);if(!h(n))return n}}throw new TypeError}function re(e){return!!e}function Ce(e){return""+e}function k(e){var t=je(e,3);return Ge(t)?t:Ce(t)}function ne(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:Object.prototype.toString.call(e)==="[object Array]"}function j(e){return typeof e=="function"}function ae(e){return typeof e=="function"}function De(e){switch(te(e)){case 3:return!0;case 4:return!0;default:return!1}}function V(e,t){return e===t||e!==e&&t!==t}function ie(e,t){var r=e[t];if(r!=null){if(!j(r))throw new TypeError;return r}}function oe(e){var t=ie(e,E);if(!j(t))throw new TypeError;var r=t.call(e);if(!h(r))throw new TypeError;return r}function ue(e){return e.value}function fe(e){var t=e.next();return t.done?!1:t}function se(e){var t=e.return;t&&t.call(e)}function B(e){var t=Object.getPrototypeOf(e);if(typeof e!="function"||e===D||t!==D)return t;var r=e.prototype,n=r&&Object.getPrototypeOf(r);if(n==null||n===Object.prototype)return t;var f=n.constructor;return typeof f!="function"||f===e?t:f}function Ae(){var e;!s(R)&&typeof w.Reflect<"u"&&!(R in w.Reflect)&&typeof w.Reflect.defineMetadata=="function"&&(e=Fe(w.Reflect));var t,r,n,f=new W,v={registerProvider:p,getProvider:a,setProvider:o};return v;function p(u){if(!Object.isExtensible(v))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case e===u:break;case s(t):t=u;break;case t===u:break;case s(r):r=u;break;case r===u:break;default:n===void 0&&(n=new U),n.add(u);break}}function c(u,d){if(!s(t)){if(t.isProviderFor(u,d))return t;if(!s(r)){if(r.isProviderFor(u,d))return t;if(!s(n))for(var l=oe(n);;){var y=fe(l);if(!y)return;var b=ue(y);if(b.isProviderFor(u,d))return se(l),b}}}if(!s(e)&&e.isProviderFor(u,d))return e}function a(u,d){var l=f.get(u),y;return s(l)||(y=l.get(d)),s(y)&&(y=c(u,d),s(y)||(s(l)&&(l=new A,f.set(u,l)),l.set(d,y))),y}function i(u){if(s(u))throw new TypeError;return t===u||r===u||!s(n)&&n.has(u)}function o(u,d,l){if(!i(l))throw new Error("Metadata provider not registered.");var y=a(u,d);if(y!==l){if(!s(y))return!1;var b=f.get(u);s(b)&&(b=new A,f.set(u,b)),b.set(d,l)}return!0}}function $e(){var e;return!s(R)&&h(w.Reflect)&&Object.isExtensible(w.Reflect)&&(e=w.Reflect[R]),s(e)&&(e=Ae()),!s(R)&&h(w.Reflect)&&Object.isExtensible(w.Reflect)&&Object.defineProperty(w.Reflect,R,{enumerable:!1,configurable:!1,writable:!1,value:e}),e}function He(e){var t=new W,r={isProviderFor:function(i,o){var u=t.get(i);return s(u)?!1:u.has(o)},OrdinaryDefineOwnMetadata:p,OrdinaryHasOwnMetadata:f,OrdinaryGetOwnMetadata:v,OrdinaryOwnMetadataKeys:c,OrdinaryDeleteMetadata:a};return H.registerProvider(r),r;function n(i,o,u){var d=t.get(i),l=!1;if(s(d)){if(!u)return;d=new A,t.set(i,d),l=!0}var y=d.get(o);if(s(y)){if(!u)return;if(y=new A,d.set(o,y),!e.setProvider(i,o,r))throw d.delete(o),l&&t.delete(i),new Error("Wrong provider for target.")}return y}function f(i,o,u){var d=n(o,u,!1);return s(d)?!1:re(d.has(i))}function v(i,o,u){var d=n(o,u,!1);if(!s(d))return d.get(i)}function p(i,o,u,d){var l=n(u,d,!0);l.set(i,o)}function c(i,o){var u=[],d=n(i,o,!1);if(s(d))return u;for(var l=d.keys(),y=oe(l),b=0;;){var ce=fe(y);if(!ce)return u.length=b,u;var Ve=ue(ce);try{u[b]=Ve}catch(Be){try{se(y)}finally{throw Be}}b++}}function a(i,o,u){var d=n(o,u,!1);if(s(d)||!d.delete(i))return!1;if(d.size===0){var l=t.get(o);s(l)||(l.delete(u),l.size===0&&t.delete(l))}return!0}}function Fe(e){var t=e.defineMetadata,r=e.hasOwnMetadata,n=e.getOwnMetadata,f=e.getOwnMetadataKeys,v=e.deleteMetadata,p=new W,c={isProviderFor:function(a,i){var o=p.get(a);return!s(o)&&o.has(i)?!0:f(a,i).length?(s(o)&&(o=new U,p.set(a,o)),o.add(i),!0):!1},OrdinaryDefineOwnMetadata:t,OrdinaryHasOwnMetadata:r,OrdinaryGetOwnMetadata:n,OrdinaryOwnMetadataKeys:f,OrdinaryDeleteMetadata:v};return c}function $(e,t,r){var n=H.getProvider(e,t);if(!s(n))return n;if(r){if(H.setProvider(e,t,q))return q;throw new Error("Illegal state.")}}function Ue(){var e={},t=[],r=(function(){function c(a,i,o){this._index=0,this._keys=a,this._values=i,this._selector=o}return c.prototype["@@iterator"]=function(){return this},c.prototype[E]=function(){return this},c.prototype.next=function(){var a=this._index;if(a>=0&&a<this._keys.length){var i=this._selector(this._keys[a],this._values[a]);return a+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:i,done:!1}}return{value:void 0,done:!0}},c.prototype.throw=function(a){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),a},c.prototype.return=function(a){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:a,done:!0}},c})(),n=(function(){function c(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(c.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),c.prototype.has=function(a){return this._find(a,!1)>=0},c.prototype.get=function(a){var i=this._find(a,!1);return i>=0?this._values[i]:void 0},c.prototype.set=function(a,i){var o=this._find(a,!0);return this._values[o]=i,this},c.prototype.delete=function(a){var i=this._find(a,!1);if(i>=0){for(var o=this._keys.length,u=i+1;u<o;u++)this._keys[u-1]=this._keys[u],this._values[u-1]=this._values[u];return this._keys.length--,this._values.length--,V(a,this._cacheKey)&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},c.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},c.prototype.keys=function(){return new r(this._keys,this._values,f)},c.prototype.values=function(){return new r(this._keys,this._values,v)},c.prototype.entries=function(){return new r(this._keys,this._values,p)},c.prototype["@@iterator"]=function(){return this.entries()},c.prototype[E]=function(){return this.entries()},c.prototype._find=function(a,i){if(!V(this._cacheKey,a)){this._cacheIndex=-1;for(var o=0;o<this._keys.length;o++)if(V(this._keys[o],a)){this._cacheIndex=o;break}}return this._cacheIndex<0&&i&&(this._cacheIndex=this._keys.length,this._keys.push(a),this._values.push(void 0)),this._cacheIndex},c})();return n;function f(c,a){return c}function v(c,a){return a}function p(c,a){return[c,a]}}function We(){var e=(function(){function t(){this._map=new A}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(r){return this._map.has(r)},t.prototype.add=function(r){return this._map.set(r,r),this},t.prototype.delete=function(r){return this._map.delete(r)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.keys()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[E]=function(){return this.keys()},t})();return e}function Ne(){var e=16,t=I.create(),r=n();return(function(){function a(){this._key=n()}return a.prototype.has=function(i){var o=f(i,!1);return o!==void 0?I.has(o,this._key):!1},a.prototype.get=function(i){var o=f(i,!1);return o!==void 0?I.get(o,this._key):void 0},a.prototype.set=function(i,o){var u=f(i,!0);return u[this._key]=o,this},a.prototype.delete=function(i){var o=f(i,!1);return o!==void 0?delete o[this._key]:!1},a.prototype.clear=function(){this._key=n()},a})();function n(){var a;do a="@@WeakMap@@"+c();while(I.has(t,a));return t[a]=!0,a}function f(a,i){if(!O.call(a,r)){if(!i)return;Object.defineProperty(a,r,{value:I.create()})}return a[r]}function v(a,i){for(var o=0;o<i;++o)a[o]=Math.random()*255|0;return a}function p(a){if(typeof Uint8Array=="function"){var i=new Uint8Array(a);return typeof crypto<"u"?crypto.getRandomValues(i):typeof msCrypto<"u"?msCrypto.getRandomValues(i):v(i,a),i}return v(new Array(a),a)}function c(){var a=p(e);a[6]=a[6]&79|64,a[8]=a[8]&191|128;for(var i="",o=0;o<e;++o){var u=a[o];(o===4||o===6||o===8)&&(i+="-"),u<16&&(i+="0"),i+=u.toString(16).toLowerCase()}return i}}function z(e){return e.__=void 0,delete e.__,e}})})(pe||(pe={}))});F();var et=Le(_e(),1);import T from"process";function Ye(){let _=null;return _=le({streams:T,note:M=>{_?.isDead("stderr")!==!0&&de(T.stderr,M)}}),_}async function Je(){Ye();let _=ve(T.env),{server:M,metricsServer:w,edgeIdentityServer:O,closeAll:P,closeWebSockets:x}=ye(_);await new Promise((m,g)=>{M.once("error",g),M.listen(_.port,S,m)}),await new Promise((m,g)=>{w.once("error",g),w.listen(L,S,m)}),await new Promise((m,g)=>{O.once("error",g),O.listen(Z,S,m)}),T.stdout.write(`inference-proxy listening on http://${S}:${_.port}/v1 (metrics http://${S}:${L}${he}, edge identity http://${S}:${Z}, control plane ${_.baseUrl}, org API ${_.apiUrl}, catalog oracle ${_.catalog?"on":"off"})
|
|
2
|
+
import{D as S,E as ve,U as ye,V as we,a as L,b as he,l as Z}from"../chunk-FHGSREBO.js";import"../chunk-JOOR4RUT.js";import"../chunk-K23AZPI4.js";import{x as de,y as le}from"../chunk-ERRG6R4T.js";import"../chunk-76BZLCGT.js";import"../chunk-CUDFHFNX.js";import"../chunk-3JWYIKHM.js";import"../chunk-6M5JK4YC.js";import"../chunk-7V2JKPIG.js";import{a as ze,b as Le,c as F}from"../chunk-YSFSRI3D.js";var _e=ze(()=>{"use strict";F();var pe;(function(_){(function(M){var w=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:m(),O=P(_);typeof w.Reflect<"u"&&(O=P(w.Reflect,O)),M(O,w),typeof w.Reflect>"u"&&(w.Reflect=_);function P(g,C){return function(I,D){Object.defineProperty(g,I,{configurable:!0,writable:!0,value:D}),C&&C(I,D)}}function x(){try{return Function("return this;")()}catch{}}function E(){try{return(0,eval)("(function() { return this; })()")}catch{}}function m(){return x()||E()}})(function(M,w){var O=Object.prototype.hasOwnProperty,P=typeof Symbol=="function",x=P&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",E=P&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",m=typeof Object.create=="function",g={__proto__:[]}instanceof Array,C=!m&&!g,I={create:m?function(){return z(Object.create(null))}:g?function(){return z({__proto__:null})}:function(){return z({})},has:C?function(e,t){return O.call(e,t)}:function(e,t){return t in e},get:C?function(e,t){return O.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},D=Object.getPrototypeOf(Function),A=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Ue(),U=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:We(),W=typeof WeakMap=="function"?WeakMap:Ne(),R=P?Symbol.for("@reflect-metadata:registry"):void 0,H=$e(),q=He(H);function Me(e,t,r,n){if(s(r)){if(!ne(e))throw new TypeError;if(!ae(t))throw new TypeError;return Se(e,t)}else{if(!ne(e))throw new TypeError;if(!h(t))throw new TypeError;if(!h(n)&&!s(n)&&!G(n))throw new TypeError;return G(n)&&(n=void 0),r=k(r),Re(e,t,r,n)}}M("decorate",Me);function ge(e,t){function r(n,f){if(!h(n))throw new TypeError;if(!s(f)&&!De(f))throw new TypeError;X(e,t,n,f)}return r}M("metadata",ge);function me(e,t,r,n){if(!h(r))throw new TypeError;return s(n)||(n=k(n)),X(e,t,r,n)}M("defineMetadata",me);function Oe(e,t,r){if(!h(t))throw new TypeError;return s(r)||(r=k(r)),Y(e,t,r)}M("hasMetadata",Oe);function be(e,t,r){if(!h(t))throw new TypeError;return s(r)||(r=k(r)),N(e,t,r)}M("hasOwnMetadata",be);function ke(e,t,r){if(!h(t))throw new TypeError;return s(r)||(r=k(r)),J(e,t,r)}M("getMetadata",ke);function Te(e,t,r){if(!h(t))throw new TypeError;return s(r)||(r=k(r)),Q(e,t,r)}M("getOwnMetadata",Te);function Ee(e,t){if(!h(e))throw new TypeError;return s(t)||(t=k(t)),K(e,t)}M("getMetadataKeys",Ee);function Pe(e,t){if(!h(e))throw new TypeError;return s(t)||(t=k(t)),ee(e,t)}M("getOwnMetadataKeys",Pe);function Ie(e,t,r){if(!h(t))throw new TypeError;if(s(r)||(r=k(r)),!h(t))throw new TypeError;s(r)||(r=k(r));var n=$(t,r,!1);return s(n)?!1:n.OrdinaryDeleteMetadata(e,t,r)}M("deleteMetadata",Ie);function Se(e,t){for(var r=e.length-1;r>=0;--r){var n=e[r],f=n(t);if(!s(f)&&!G(f)){if(!ae(f))throw new TypeError;t=f}}return t}function Re(e,t,r,n){for(var f=e.length-1;f>=0;--f){var v=e[f],p=v(t,r,n);if(!s(p)&&!G(p)){if(!h(p))throw new TypeError;n=p}}return n}function Y(e,t,r){var n=N(e,t,r);if(n)return!0;var f=B(t);return G(f)?!1:Y(e,f,r)}function N(e,t,r){var n=$(t,r,!1);return s(n)?!1:re(n.OrdinaryHasOwnMetadata(e,t,r))}function J(e,t,r){var n=N(e,t,r);if(n)return Q(e,t,r);var f=B(t);if(!G(f))return J(e,f,r)}function Q(e,t,r){var n=$(t,r,!1);if(!s(n))return n.OrdinaryGetOwnMetadata(e,t,r)}function X(e,t,r,n){var f=$(r,n,!0);f.OrdinaryDefineOwnMetadata(e,t,r,n)}function K(e,t){var r=ee(e,t),n=B(e);if(n===null)return r;var f=K(n,t);if(f.length<=0)return r;if(r.length<=0)return f;for(var v=new U,p=[],c=0,a=r;c<a.length;c++){var i=a[c],o=v.has(i);o||(v.add(i),p.push(i))}for(var u=0,d=f;u<d.length;u++){var i=d[u],o=v.has(i);o||(v.add(i),p.push(i))}return p}function ee(e,t){var r=$(e,t,!1);return r?r.OrdinaryOwnMetadataKeys(e,t):[]}function te(e){if(e===null)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return e===null?1:6;default:return 6}}function s(e){return e===void 0}function G(e){return e===null}function Ge(e){return typeof e=="symbol"}function h(e){return typeof e=="object"?e!==null:typeof e=="function"}function je(e,t){switch(te(e)){case 0:return e;case 1:return e;case 2:return e;case 3:return e;case 4:return e;case 5:return e}var r=t===3?"string":t===5?"number":"default",n=ie(e,x);if(n!==void 0){var f=n.call(e,r);if(h(f))throw new TypeError;return f}return xe(e,r==="default"?"number":r)}function xe(e,t){if(t==="string"){var r=e.toString;if(j(r)){var n=r.call(e);if(!h(n))return n}var f=e.valueOf;if(j(f)){var n=f.call(e);if(!h(n))return n}}else{var f=e.valueOf;if(j(f)){var n=f.call(e);if(!h(n))return n}var v=e.toString;if(j(v)){var n=v.call(e);if(!h(n))return n}}throw new TypeError}function re(e){return!!e}function Ce(e){return""+e}function k(e){var t=je(e,3);return Ge(t)?t:Ce(t)}function ne(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:Object.prototype.toString.call(e)==="[object Array]"}function j(e){return typeof e=="function"}function ae(e){return typeof e=="function"}function De(e){switch(te(e)){case 3:return!0;case 4:return!0;default:return!1}}function V(e,t){return e===t||e!==e&&t!==t}function ie(e,t){var r=e[t];if(r!=null){if(!j(r))throw new TypeError;return r}}function oe(e){var t=ie(e,E);if(!j(t))throw new TypeError;var r=t.call(e);if(!h(r))throw new TypeError;return r}function ue(e){return e.value}function fe(e){var t=e.next();return t.done?!1:t}function se(e){var t=e.return;t&&t.call(e)}function B(e){var t=Object.getPrototypeOf(e);if(typeof e!="function"||e===D||t!==D)return t;var r=e.prototype,n=r&&Object.getPrototypeOf(r);if(n==null||n===Object.prototype)return t;var f=n.constructor;return typeof f!="function"||f===e?t:f}function Ae(){var e;!s(R)&&typeof w.Reflect<"u"&&!(R in w.Reflect)&&typeof w.Reflect.defineMetadata=="function"&&(e=Fe(w.Reflect));var t,r,n,f=new W,v={registerProvider:p,getProvider:a,setProvider:o};return v;function p(u){if(!Object.isExtensible(v))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case e===u:break;case s(t):t=u;break;case t===u:break;case s(r):r=u;break;case r===u:break;default:n===void 0&&(n=new U),n.add(u);break}}function c(u,d){if(!s(t)){if(t.isProviderFor(u,d))return t;if(!s(r)){if(r.isProviderFor(u,d))return t;if(!s(n))for(var l=oe(n);;){var y=fe(l);if(!y)return;var b=ue(y);if(b.isProviderFor(u,d))return se(l),b}}}if(!s(e)&&e.isProviderFor(u,d))return e}function a(u,d){var l=f.get(u),y;return s(l)||(y=l.get(d)),s(y)&&(y=c(u,d),s(y)||(s(l)&&(l=new A,f.set(u,l)),l.set(d,y))),y}function i(u){if(s(u))throw new TypeError;return t===u||r===u||!s(n)&&n.has(u)}function o(u,d,l){if(!i(l))throw new Error("Metadata provider not registered.");var y=a(u,d);if(y!==l){if(!s(y))return!1;var b=f.get(u);s(b)&&(b=new A,f.set(u,b)),b.set(d,l)}return!0}}function $e(){var e;return!s(R)&&h(w.Reflect)&&Object.isExtensible(w.Reflect)&&(e=w.Reflect[R]),s(e)&&(e=Ae()),!s(R)&&h(w.Reflect)&&Object.isExtensible(w.Reflect)&&Object.defineProperty(w.Reflect,R,{enumerable:!1,configurable:!1,writable:!1,value:e}),e}function He(e){var t=new W,r={isProviderFor:function(i,o){var u=t.get(i);return s(u)?!1:u.has(o)},OrdinaryDefineOwnMetadata:p,OrdinaryHasOwnMetadata:f,OrdinaryGetOwnMetadata:v,OrdinaryOwnMetadataKeys:c,OrdinaryDeleteMetadata:a};return H.registerProvider(r),r;function n(i,o,u){var d=t.get(i),l=!1;if(s(d)){if(!u)return;d=new A,t.set(i,d),l=!0}var y=d.get(o);if(s(y)){if(!u)return;if(y=new A,d.set(o,y),!e.setProvider(i,o,r))throw d.delete(o),l&&t.delete(i),new Error("Wrong provider for target.")}return y}function f(i,o,u){var d=n(o,u,!1);return s(d)?!1:re(d.has(i))}function v(i,o,u){var d=n(o,u,!1);if(!s(d))return d.get(i)}function p(i,o,u,d){var l=n(u,d,!0);l.set(i,o)}function c(i,o){var u=[],d=n(i,o,!1);if(s(d))return u;for(var l=d.keys(),y=oe(l),b=0;;){var ce=fe(y);if(!ce)return u.length=b,u;var Ve=ue(ce);try{u[b]=Ve}catch(Be){try{se(y)}finally{throw Be}}b++}}function a(i,o,u){var d=n(o,u,!1);if(s(d)||!d.delete(i))return!1;if(d.size===0){var l=t.get(o);s(l)||(l.delete(u),l.size===0&&t.delete(l))}return!0}}function Fe(e){var t=e.defineMetadata,r=e.hasOwnMetadata,n=e.getOwnMetadata,f=e.getOwnMetadataKeys,v=e.deleteMetadata,p=new W,c={isProviderFor:function(a,i){var o=p.get(a);return!s(o)&&o.has(i)?!0:f(a,i).length?(s(o)&&(o=new U,p.set(a,o)),o.add(i),!0):!1},OrdinaryDefineOwnMetadata:t,OrdinaryHasOwnMetadata:r,OrdinaryGetOwnMetadata:n,OrdinaryOwnMetadataKeys:f,OrdinaryDeleteMetadata:v};return c}function $(e,t,r){var n=H.getProvider(e,t);if(!s(n))return n;if(r){if(H.setProvider(e,t,q))return q;throw new Error("Illegal state.")}}function Ue(){var e={},t=[],r=(function(){function c(a,i,o){this._index=0,this._keys=a,this._values=i,this._selector=o}return c.prototype["@@iterator"]=function(){return this},c.prototype[E]=function(){return this},c.prototype.next=function(){var a=this._index;if(a>=0&&a<this._keys.length){var i=this._selector(this._keys[a],this._values[a]);return a+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:i,done:!1}}return{value:void 0,done:!0}},c.prototype.throw=function(a){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),a},c.prototype.return=function(a){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:a,done:!0}},c})(),n=(function(){function c(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(c.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),c.prototype.has=function(a){return this._find(a,!1)>=0},c.prototype.get=function(a){var i=this._find(a,!1);return i>=0?this._values[i]:void 0},c.prototype.set=function(a,i){var o=this._find(a,!0);return this._values[o]=i,this},c.prototype.delete=function(a){var i=this._find(a,!1);if(i>=0){for(var o=this._keys.length,u=i+1;u<o;u++)this._keys[u-1]=this._keys[u],this._values[u-1]=this._values[u];return this._keys.length--,this._values.length--,V(a,this._cacheKey)&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},c.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},c.prototype.keys=function(){return new r(this._keys,this._values,f)},c.prototype.values=function(){return new r(this._keys,this._values,v)},c.prototype.entries=function(){return new r(this._keys,this._values,p)},c.prototype["@@iterator"]=function(){return this.entries()},c.prototype[E]=function(){return this.entries()},c.prototype._find=function(a,i){if(!V(this._cacheKey,a)){this._cacheIndex=-1;for(var o=0;o<this._keys.length;o++)if(V(this._keys[o],a)){this._cacheIndex=o;break}}return this._cacheIndex<0&&i&&(this._cacheIndex=this._keys.length,this._keys.push(a),this._values.push(void 0)),this._cacheIndex},c})();return n;function f(c,a){return c}function v(c,a){return a}function p(c,a){return[c,a]}}function We(){var e=(function(){function t(){this._map=new A}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(r){return this._map.has(r)},t.prototype.add=function(r){return this._map.set(r,r),this},t.prototype.delete=function(r){return this._map.delete(r)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.keys()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[E]=function(){return this.keys()},t})();return e}function Ne(){var e=16,t=I.create(),r=n();return(function(){function a(){this._key=n()}return a.prototype.has=function(i){var o=f(i,!1);return o!==void 0?I.has(o,this._key):!1},a.prototype.get=function(i){var o=f(i,!1);return o!==void 0?I.get(o,this._key):void 0},a.prototype.set=function(i,o){var u=f(i,!0);return u[this._key]=o,this},a.prototype.delete=function(i){var o=f(i,!1);return o!==void 0?delete o[this._key]:!1},a.prototype.clear=function(){this._key=n()},a})();function n(){var a;do a="@@WeakMap@@"+c();while(I.has(t,a));return t[a]=!0,a}function f(a,i){if(!O.call(a,r)){if(!i)return;Object.defineProperty(a,r,{value:I.create()})}return a[r]}function v(a,i){for(var o=0;o<i;++o)a[o]=Math.random()*255|0;return a}function p(a){if(typeof Uint8Array=="function"){var i=new Uint8Array(a);return typeof crypto<"u"?crypto.getRandomValues(i):typeof msCrypto<"u"?msCrypto.getRandomValues(i):v(i,a),i}return v(new Array(a),a)}function c(){var a=p(e);a[6]=a[6]&79|64,a[8]=a[8]&191|128;for(var i="",o=0;o<e;++o){var u=a[o];(o===4||o===6||o===8)&&(i+="-"),u<16&&(i+="0"),i+=u.toString(16).toLowerCase()}return i}}function z(e){return e.__=void 0,delete e.__,e}})})(pe||(pe={}))});F();var et=Le(_e(),1);import T from"process";function Ye(){let _=null;return _=le({streams:T,note:M=>{_?.isDead("stderr")!==!0&&de(T.stderr,M)}}),_}async function Je(){Ye();let _=ve(T.env),{server:M,metricsServer:w,edgeIdentityServer:O,closeAll:P,closeWebSockets:x}=ye(_);await new Promise((m,g)=>{M.once("error",g),M.listen(_.port,S,m)}),await new Promise((m,g)=>{w.once("error",g),w.listen(L,S,m)}),await new Promise((m,g)=>{O.once("error",g),O.listen(Z,S,m)}),T.stdout.write(`inference-proxy listening on http://${S}:${_.port}/v1 (metrics http://${S}:${L}${he}, edge identity http://${S}:${Z}, control plane ${_.baseUrl}, org API ${_.apiUrl}, catalog oracle ${_.catalog?"on":"off"})
|
|
3
3
|
`);let E=async m=>{T.stdout.write(`inference-proxy: ${m} \u2014 draining
|
|
4
4
|
`),await we(M,P,x),await new Promise(g=>w.close(()=>g())),await new Promise(g=>O.close(()=>g()))};await new Promise(m=>{T.once("SIGINT",()=>{E("SIGINT").finally(m)}),T.once("SIGTERM",()=>{E("SIGTERM").finally(m)})})}Je().then(()=>T.exit(0),_=>{T.stderr.write(`inference-proxy: ${String(_ instanceof Error?_.stack??_.message:_)}
|
|
5
5
|
`),T.exit(1)});
|