blink 0.1.82 → 0.1.84
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/browser/agent/client/index.cjs +8 -8
- package/dist/browser/agent/client/index.d.cts +3 -3
- package/dist/browser/agent/client/index.d.ts +3 -3
- package/dist/browser/agent/client/index.js +8 -8
- package/dist/browser/agent/index.browser.d.cts +3 -3
- package/dist/browser/agent/index.browser.d.ts +3 -3
- package/dist/browser/{chat-B3FNVJ5h.d.cts → chat-DjsYj6b0.d.cts} +11 -1
- package/dist/browser/{chat-BpCaFSfj.d.ts → chat-k3skFyU5.d.ts} +11 -1
- package/dist/browser/control/index.cjs +1 -1
- package/dist/browser/control/index.d.cts +27 -18
- package/dist/browser/control/index.d.ts +27 -18
- package/dist/browser/control/index.js +1 -1
- package/dist/browser/{index-CiKnRuyK.d.cts → index-Cm9mLCpT.d.cts} +3 -3
- package/dist/browser/{index-BG1gi0aW.d.ts → index-Ct7PnO7V.d.ts} +3 -3
- package/dist/browser/{index.browser-Bivj_NTA.d.cts → index.browser-9_0VjM7D.d.cts} +1 -1
- package/dist/browser/{index.browser-CddR1S-T.d.ts → index.browser-DkykGx0f.d.ts} +1 -1
- package/dist/browser/react/index.cjs +1 -1
- package/dist/browser/react/index.d.cts +3 -3
- package/dist/browser/react/index.d.ts +3 -3
- package/dist/browser/react/index.js +1 -1
- package/dist/cli/{dev-CB_oM-uX.js → dev-FGXkSqqr.js} +11 -10
- package/dist/cli/index.js +2 -2
- package/dist/cli/{init-BV36CyKQ.js → init-iSl35rQ-.js} +1 -1
- package/dist/node/agent/index.node.cjs +39 -39
- package/dist/node/agent/index.node.d.cts +2 -2
- package/dist/node/agent/index.node.d.ts +2 -2
- package/dist/node/agent/index.node.js +39 -39
- package/dist/node/build/index.cjs +2 -2
- package/dist/node/build/index.js +2 -2
- package/dist/node/esm-BK4bGWKt.cjs +1 -1
- package/dist/node/esm-Bu_mj8Z9.js +1 -1
- package/dist/node/{index.browser-DePGDuoD.d.cts → index.browser-CQKM-pMt.d.ts} +11 -1
- package/dist/node/{index.browser-K_A3oWLI.d.ts → index.browser-Chqtpkvq.d.cts} +11 -1
- package/dist/node/test.d.cts +2 -2
- package/dist/node/test.d.ts +2 -2
- package/package.json +4 -1
|
@@ -2,6 +2,6 @@ const e=require(`../chunk-D2ScRZv4.cjs`);let t=require(`path`);t=e.__toESM(t);le
|
|
|
2
2
|
`);t=e+`
|
|
3
3
|
|
|
4
4
|
`+t}e.contents=Buffer.from(t,`utf-8`)}})})}},{name:`blink-dev-server`,setup(e){let n;e.onStart(()=>{r.onStart(),n=performance.now()}),e.onEnd(async e=>{await(0,i.rm)(r.outdir,{recursive:!0,force:!0}),await(0,i.mkdir)(r.outdir,{recursive:!0});let a=e.outputFiles?.map(e=>({path:e.path,contents:e.contents}))??[];a.push({path:t.default.resolve(r.outdir,`package.json`),contents:Buffer.from(JSON.stringify({type:`module`},null,2),`utf-8`)});for(let e of a)await(0,i.writeFile)(e.path,e.contents);e.errors.length>0?r.onResult({error:{message:e.errors.map(e=>`${e.text} (${e.location?.file})`).join(`
|
|
5
|
-
`)}}):r.onResult({entry:t.default.resolve(r.outdir,t.default.basename(r.entry).replace(`.ts`,`.js`)),duration:performance.now()-n,outdir:r.outdir,warnings:e.warnings.map(e=>({message:e.text,file:e.location?.file}))}),r.watch||(o.dispose(),o.cancel())})}}],...e});await o.watch()}}function o(e){return e??{}}function s(e){let n=[`blink.config.ts`],i;for(let a of n){let n=t.default.resolve(e,a);if((0,r.existsSync)(n)){let e=require(n);if(e.default){i={...e.default};break}}}if(i
|
|
5
|
+
`)}}):r.onResult({entry:t.default.resolve(r.outdir,t.default.basename(r.entry).replace(`.ts`,`.js`)),duration:performance.now()-n,outdir:r.outdir,warnings:e.warnings.map(e=>({message:e.text,file:e.location?.file}))}),r.watch||(o.dispose(),o.cancel())})}}],...e});await o.watch()}}function o(e){return e??{}}function s(e){let n=[`blink.config.ts`],i;for(let a of n){let n=t.default.resolve(e,a);if((0,r.existsSync)(n)){let e=require(n);if(e.default){i={...e.default};break}}}if(i||(i={}),!i.entry){let n=[`src/agent.ts`,`src/agent.js`,`agent.ts`,`agent.js`];for(let a of n){let n=t.default.resolve(e,a);if((0,r.existsSync)(n)){i.entry=n;break}}if(!i.entry)throw Error(`Agent entrypoint not found.
|
|
6
6
|
|
|
7
|
-
Try creating "agent.ts" or specify "entry" in a blink.config.ts file.`)}return i.outdir
|
|
7
|
+
Try creating "agent.ts" or specify "entry" in a blink.config.ts file.`)}return i.outdir||(i.outdir=t.default.resolve(e,`.blink/build`)),i.build||(i.build=a()),i}exports.buildWithEsbuild=a,exports.defineConfig=o,exports.resolveConfig=s;
|
package/dist/node/build/index.js
CHANGED
|
@@ -2,6 +2,6 @@ import{__require as e}from"../chunk-BJ0G7Fuz.js";import t from"path";import{buil
|
|
|
2
2
|
`);t=e+`
|
|
3
3
|
|
|
4
4
|
`+t}e.contents=Buffer.from(t,`utf-8`)}})})}},{name:`blink-dev-server`,setup(e){let n;e.onStart(()=>{r.onStart(),n=performance.now()}),e.onEnd(async e=>{await a(r.outdir,{recursive:!0,force:!0}),await i(r.outdir,{recursive:!0});let s=e.outputFiles?.map(e=>({path:e.path,contents:e.contents}))??[];s.push({path:t.resolve(r.outdir,`package.json`),contents:Buffer.from(JSON.stringify({type:`module`},null,2),`utf-8`)});for(let e of s)await o(e.path,e.contents);e.errors.length>0?r.onResult({error:{message:e.errors.map(e=>`${e.text} (${e.location?.file})`).join(`
|
|
5
|
-
`)}}):r.onResult({entry:t.resolve(r.outdir,t.basename(r.entry).replace(`.ts`,`.js`)),duration:performance.now()-n,outdir:r.outdir,warnings:e.warnings.map(e=>({message:e.text,file:e.location?.file}))}),r.watch||(c.dispose(),c.cancel())})}}],...e});await c.watch()}}function c(e){return e??{}}function l(n){let i=[`blink.config.ts`],a;for(let o of i){let i=t.resolve(n,o);if(r(i)){let t=e(i);if(t.default){a={...t.default};break}}}if(a
|
|
5
|
+
`)}}):r.onResult({entry:t.resolve(r.outdir,t.basename(r.entry).replace(`.ts`,`.js`)),duration:performance.now()-n,outdir:r.outdir,warnings:e.warnings.map(e=>({message:e.text,file:e.location?.file}))}),r.watch||(c.dispose(),c.cancel())})}}],...e});await c.watch()}}function c(e){return e??{}}function l(n){let i=[`blink.config.ts`],a;for(let o of i){let i=t.resolve(n,o);if(r(i)){let t=e(i);if(t.default){a={...t.default};break}}}if(a||(a={}),!a.entry){let e=[`src/agent.ts`,`src/agent.js`,`agent.ts`,`agent.js`];for(let i of e){let e=t.resolve(n,i);if(r(e)){a.entry=e;break}}if(!a.entry)throw Error(`Agent entrypoint not found.
|
|
6
6
|
|
|
7
|
-
Try creating "agent.ts" or specify "entry" in a blink.config.ts file.`)}return a.outdir
|
|
7
|
+
Try creating "agent.ts" or specify "entry" in a blink.config.ts file.`)}return a.outdir||(a.outdir=t.resolve(n,`.blink/build`)),a.build||(a.build=s()),a}export{s as buildWithEsbuild,c as defineConfig,l as resolveConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk-D2ScRZv4.cjs`);var t,n=e.__esmMin((()=>{t=typeof globalThis==`object`?globalThis:global})),r=e.__esmMin((()=>{n()})),i=e.__esmMin((()=>{r()})),a,o=e.__esmMin((()=>{a=`1.9.0`}));function s(e){var t=new Set([e]),n=new Set,r=e.match(c);if(!r)return function(){return!1};var i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;var r=e.match(c);if(!r)return a(e);var s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}var c,l,ee=e.__esmMin((()=>{o(),c=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,l=s(a)}));function u(e,t,n,r){var i;r===void 0&&(r=!1);var o=m[p]=(i=m[p])??{version:a};if(!r&&o[e]){var s=Error(`@opentelemetry/api: Attempted duplicate registration of API: `+e);return n.error(s.stack||s.message),!1}if(o.version!==a){var s=Error(`@opentelemetry/api: Registration of version v`+o.version+` for `+e+` does not match previously registered API v`+a);return n.error(s.stack||s.message),!1}return o[e]=t,n.debug(`@opentelemetry/api: Registered a global for `+e+` v`+a+`.`),!0}function d(e){var t,n,r=(t=m[p])?.version;if(!(!r||!l(r)))return(n=m[p])?.[e]}function f(e,t){t.debug(`@opentelemetry/api: Unregistering a global for `+e+` v`+a+`.`);var n=m[p];n&&delete n[e]}var te,p,m,h=e.__esmMin((()=>{i(),o(),ee(),te=a.split(`.`)[0],p=Symbol.for(`opentelemetry.js.api.`+te),m=t}));function g(e,t,n){var r=d(`diag`);if(r)return n.unshift(t),r[e].apply(r,re([],ne(n),!1))}var ne,re,ie,ae=e.__esmMin((()=>{h(),ne=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},re=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},ie=function(){function e(e){this._namespace=e.namespace||`DiagComponentLogger`}return e.prototype.debug=function(){var e=[...arguments];return g(`debug`,this._namespace,e)},e.prototype.error=function(){var e=[...arguments];return g(`error`,this._namespace,e)},e.prototype.info=function(){var e=[...arguments];return g(`info`,this._namespace,e)},e.prototype.warn=function(){var e=[...arguments];return g(`warn`,this._namespace,e)},e.prototype.verbose=function(){var e=[...arguments];return g(`verbose`,this._namespace,e)},e}()})),_,oe=e.__esmMin((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(_||={})}));function se(e,t){e<_.NONE?e=_.NONE:e>_.ALL&&(e=_.ALL),t||={};function n(n,r){var i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,_.ERROR),warn:n(`warn`,_.WARN),info:n(`info`,_.INFO),debug:n(`debug`,_.DEBUG),verbose:n(`verbose`,_.VERBOSE)}}var ce=e.__esmMin((()=>{oe()})),le,ue,de,v,y=e.__esmMin((()=>{ae(),ce(),oe(),h(),le=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},ue=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},de=`diag`,v=function(){function e(){function e(e){return function(){var t=[...arguments],n=d(`diag`);if(n)return n[e].apply(n,ue([],le(t),!1))}}var t=this,n=function(e,n){var r,i,a;if(n===void 0&&(n={logLevel:_.INFO}),e===t){var o=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error((r=o.stack)??o.message),!1}typeof n==`number`&&(n={logLevel:n});var s=d(`diag`),c=se((i=n.logLevel)??_.INFO,e);if(s&&!n.suppressOverrideMessage){var l=(a=Error().stack)??`<failed to generate stacktrace>`;s.warn(`Current logger will be overwritten from `+l),c.warn(`Current logger will overwrite one already registered from `+l)}return u(`diag`,c,t,!0)};t.setLogger=n,t.disable=function(){f(de,t)},t.createComponentLogger=function(e){return new ie(e)},t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}return e.instance=function(){return this._instance||=new e,this._instance},e}()})),fe,pe,me,he=e.__esmMin((()=>{fe=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},pe=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},me=function(){function e(e){this._entries=e?new Map(e):new Map}return e.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=fe(e,2),n=t[0],r=t[1];return[n,r]})},e.prototype.setEntry=function(t,n){var r=new e(this._entries);return r._entries.set(t,n),r},e.prototype.removeEntry=function(t){var n=new e(this._entries);return n._entries.delete(t),n},e.prototype.removeEntries=function(){for(var t,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=new e(this._entries);try{for(var o=pe(r),s=o.next();!s.done;s=o.next()){var c=s.value;a._entries.delete(c)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return a},e.prototype.clear=function(){return new e},e}()})),ge,_e=e.__esmMin((()=>{ge=Symbol(`BaggageEntryMetadata`)}));function ve(e){return e===void 0&&(e={}),new me(new Map(Object.entries(e)))}function ye(e){return typeof e!=`string`&&(be.error(`Cannot create baggage metadata from unknown type: `+typeof e),e=``),{__TYPE__:ge,toString:function(){return e}}}var be,xe=e.__esmMin((()=>{y(),he(),_e(),be=v.instance()}));function Se(e){return Symbol.for(e)}var Ce,we,b=e.__esmMin((()=>{Ce=function(){function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(e){return n._currentContext.get(e)},n.setValue=function(t,r){var i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=function(t){var r=new e(n._currentContext);return r._currentContext.delete(t),r}}return e}(),we=new Ce})),x,Te,Ee=e.__esmMin((()=>{x=[{n:`error`,c:`error`},{n:`warn`,c:`warn`},{n:`info`,c:`info`},{n:`debug`,c:`debug`},{n:`verbose`,c:`trace`}],Te=function(){function e(){function e(e){return function(){var t=[...arguments];if(console){var n=console[e];if(typeof n!=`function`&&(n=console.log),typeof n==`function`)return n.apply(console,t)}}}for(var t=0;t<x.length;t++)this[x[t].n]=e(x[t].c)}return e}()}));function De(){return T}var S,Oe,C,ke,Ae,je,Me,w,Ne,Pe,Fe,T,Ie,Le,Re,ze,Be,Ve,He,Ue=e.__esmMin((()=>{S=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Oe=function(){function e(){}return e.prototype.createGauge=function(e,t){return Le},e.prototype.createHistogram=function(e,t){return Re},e.prototype.createCounter=function(e,t){return Ie},e.prototype.createUpDownCounter=function(e,t){return ze},e.prototype.createObservableGauge=function(e,t){return Ve},e.prototype.createObservableCounter=function(e,t){return Be},e.prototype.createObservableUpDownCounter=function(e,t){return He},e.prototype.addBatchObservableCallback=function(e,t){},e.prototype.removeBatchObservableCallback=function(e){},e}(),C=function(){function e(){}return e}(),ke=function(e){S(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.add=function(e,t){},t}(C),Ae=function(e){S(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.add=function(e,t){},t}(C),je=function(e){S(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.record=function(e,t){},t}(C),Me=function(e){S(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.record=function(e,t){},t}(C),w=function(){function e(){}return e.prototype.addCallback=function(e){},e.prototype.removeCallback=function(e){},e}(),Ne=function(e){S(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(w),Pe=function(e){S(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(w),Fe=function(e){S(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(w),T=new Oe,Ie=new ke,Le=new je,Re=new Me,ze=new Ae,Be=new Ne,Ve=new Pe,He=new Fe})),We,Ge=e.__esmMin((()=>{(function(e){e[e.INT=0]=`INT`,e[e.DOUBLE=1]=`DOUBLE`})(We||={})})),E,D,Ke=e.__esmMin((()=>{E={get:function(e,t){if(e!=null)return e[t]},keys:function(e){return e==null?[]:Object.keys(e)}},D={set:function(e,t,n){e!=null&&(e[t]=n)}}})),qe,Je,Ye,Xe=e.__esmMin((()=>{b(),qe=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Je=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},Ye=function(){function e(){}return e.prototype.active=function(){return we},e.prototype.with=function(e,t,n){var r=[...arguments].slice(3);return t.call.apply(t,Je([n],qe(r),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}()})),Ze,Qe,O,$e,k,A=e.__esmMin((()=>{Xe(),h(),y(),Ze=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Qe=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},O=`context`,$e=new Ye,k=function(){function e(){}return e.getInstance=function(){return this._instance||=new e,this._instance},e.prototype.setGlobalContextManager=function(e){return u(O,e,v.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,n){for(var r,i=[],a=3;a<arguments.length;a++)i[a-3]=arguments[a];return(r=this._getContextManager()).with.apply(r,Qe([e,t,n],Ze(i),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return d(O)||$e},e.prototype.disable=function(){this._getContextManager().disable(),f(O,v.instance())},e}()})),j,et=e.__esmMin((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(j||={})})),M,N,P,tt=e.__esmMin((()=>{et(),M=`0000000000000000`,N=`00000000000000000000000000000000`,P={traceId:N,spanId:M,traceFlags:j.NONE}})),F,nt=e.__esmMin((()=>{tt(),F=function(){function e(e){e===void 0&&(e=P),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}()}));function rt(e){return e.getValue(L)||void 0}function it(){return rt(k.getInstance().active())}function I(e,t){return e.setValue(L,t)}function at(e){return e.deleteValue(L)}function ot(e,t){return I(e,new F(t))}function st(e){var t;return(t=rt(e))?.spanContext()}var L,ct=e.__esmMin((()=>{b(),nt(),A(),L=Se(`OpenTelemetry Context Key SPAN`)}));function lt(e){return ft.test(e)&&e!==N}function ut(e){return pt.test(e)&&e!==M}function R(e){return lt(e.traceId)&&ut(e.spanId)}function dt(e){return new F(e)}var ft,pt,z=e.__esmMin((()=>{tt(),nt(),ft=/^([0-9a-f]{32})$/i,pt=/^[0-9a-f]{16}$/i}));function mt(e){return typeof e==`object`&&typeof e.spanId==`string`&&typeof e.traceId==`string`&&typeof e.traceFlags==`number`}var B,V,ht=e.__esmMin((()=>{A(),ct(),nt(),z(),B=k.getInstance(),V=function(){function e(){}return e.prototype.startSpan=function(e,t,n){n===void 0&&(n=B.active());var r=!!t?.root;if(r)return new F;var i=n&&st(n);return mt(i)&&R(i)?new F(i):new F},e.prototype.startActiveSpan=function(e,t,n,r){var i,a,o;if(!(arguments.length<2)){arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);var s=a??B.active(),c=this.startSpan(e,i,s),l=I(s,c);return B.with(l,o,void 0,c)}},e}()})),gt,H,_t=e.__esmMin((()=>{ht(),gt=new V,H=function(){function e(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}return e.prototype.startSpan=function(e,t,n){return this._getTracer().startSpan(e,t,n)},e.prototype.startActiveSpan=function(e,t,n,r){var i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):gt},e}()})),vt,yt=e.__esmMin((()=>{ht(),vt=function(){function e(){}return e.prototype.getTracer=function(e,t,n){return new V},e}()})),bt,U,xt=e.__esmMin((()=>{_t(),yt(),bt=new vt,U=function(){function e(){}return e.prototype.getTracer=function(e,t,n){var r;return(r=this.getDelegateTracer(e,t,n))??new H(this,e,t,n)},e.prototype.getDelegate=function(){var e;return(e=this._delegate)??bt},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,n){var r;return(r=this._delegate)?.getTracer(e,t,n)},e}()})),St,Ct=e.__esmMin((()=>{(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(St||={})})),wt,Tt=e.__esmMin((()=>{(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(wt||={})})),W,Et=e.__esmMin((()=>{(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(W||={})}));function Dt(e){return jt.test(e)}function Ot(e){return Mt.test(e)&&!Nt.test(e)}var G,kt,At,jt,Mt,Nt,Pt=e.__esmMin((()=>{G=`[_0-9a-z-*/]`,kt=`[a-z]`+G+`{0,255}`,At=`[a-z0-9]`+G+`{0,240}@[a-z]`+G+`{0,13}`,jt=RegExp(`^(?:`+kt+`|`+At+`)$`),Mt=/^[ -~]{0,255}[!-~]$/,Nt=/,|=/})),K,Ft,q,It,Lt,Rt=e.__esmMin((()=>{Pt(),K=32,Ft=512,q=`,`,It=`=`,Lt=function(){function e(e){this._internalState=new Map,e&&this._parse(e)}return e.prototype.set=function(e,t){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n},e.prototype.unset=function(e){var t=this._clone();return t._internalState.delete(e),t},e.prototype.get=function(e){return this._internalState.get(e)},e.prototype.serialize=function(){var e=this;return this._keys().reduce(function(t,n){return t.push(n+It+e.get(n)),t},[]).join(q)},e.prototype._parse=function(e){e.length>Ft||(this._internalState=e.split(q).reverse().reduce(function(e,t){var n=t.trim(),r=n.indexOf(It);if(r!==-1){var i=n.slice(0,r),a=n.slice(r+1,t.length);Dt(i)&&Ot(a)&&e.set(i,a)}return e},new Map),this._internalState.size>K&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,K))))},e.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},e.prototype._clone=function(){var t=new e;return t._internalState=new Map(this._internalState),t},e}()}));function zt(e){return new Lt(e)}var Bt=e.__esmMin((()=>{Rt()})),Vt,Ht=e.__esmMin((()=>{A(),Vt=k.getInstance()})),J,Ut=e.__esmMin((()=>{y(),J=v.instance()})),Wt,Gt,Kt=e.__esmMin((()=>{Ue(),Wt=function(){function e(){}return e.prototype.getMeter=function(e,t,n){return T},e}(),Gt=new Wt})),Y,qt,Jt=e.__esmMin((()=>{Kt(),h(),y(),Y=`metrics`,qt=function(){function e(){}return e.getInstance=function(){return this._instance||=new e,this._instance},e.prototype.setGlobalMeterProvider=function(e){return u(Y,e,v.instance())},e.prototype.getMeterProvider=function(){return d(Y)||Gt},e.prototype.getMeter=function(e,t,n){return this.getMeterProvider().getMeter(e,t,n)},e.prototype.disable=function(){f(Y,v.instance())},e}()})),Yt,Xt=e.__esmMin((()=>{Jt(),Yt=qt.getInstance()})),Zt,Qt=e.__esmMin((()=>{Zt=function(){function e(){}return e.prototype.inject=function(e,t){},e.prototype.extract=function(e,t){return e},e.prototype.fields=function(){return[]},e}()}));function $t(e){return e.getValue(X)||void 0}function en(){return $t(k.getInstance().active())}function tn(e,t){return e.setValue(X,t)}function nn(e){return e.deleteValue(X)}var X,rn=e.__esmMin((()=>{A(),b(),X=Se(`OpenTelemetry Baggage Key`)})),Z,an,on,sn=e.__esmMin((()=>{h(),Qt(),Ke(),rn(),xe(),y(),Z=`propagation`,an=new Zt,on=function(){function e(){this.createBaggage=ve,this.getBaggage=$t,this.getActiveBaggage=en,this.setBaggage=tn,this.deleteBaggage=nn}return e.getInstance=function(){return this._instance||=new e,this._instance},e.prototype.setGlobalPropagator=function(e){return u(Z,e,v.instance())},e.prototype.inject=function(e,t,n){return n===void 0&&(n=D),this._getGlobalPropagator().inject(e,t,n)},e.prototype.extract=function(e,t,n){return n===void 0&&(n=E),this._getGlobalPropagator().extract(e,t,n)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){f(Z,v.instance())},e.prototype._getGlobalPropagator=function(){return d(Z)||an},e}()})),cn,ln=e.__esmMin((()=>{sn(),cn=on.getInstance()})),Q,un,dn=e.__esmMin((()=>{h(),xt(),z(),ct(),y(),Q=`trace`,un=function(){function e(){this._proxyTracerProvider=new U,this.wrapSpanContext=dt,this.isSpanContextValid=R,this.deleteSpan=at,this.getSpan=rt,this.getActiveSpan=it,this.getSpanContext=st,this.setSpan=I,this.setSpanContext=ot}return e.getInstance=function(){return this._instance||=new e,this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=u(Q,this._proxyTracerProvider,v.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return d(Q)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){f(Q,v.instance()),this._proxyTracerProvider=new U},e}()})),$,fn=e.__esmMin((()=>{dn(),$=un.getInstance()})),pn={};e.__export(pn,{DiagConsoleLogger:()=>Te,DiagLogLevel:()=>_,INVALID_SPANID:()=>M,INVALID_SPAN_CONTEXT:()=>P,INVALID_TRACEID:()=>N,ProxyTracer:()=>H,ProxyTracerProvider:()=>U,ROOT_CONTEXT:()=>we,SamplingDecision:()=>St,SpanKind:()=>wt,SpanStatusCode:()=>W,TraceFlags:()=>j,ValueType:()=>We,baggageEntryMetadataFromString:()=>ye,context:()=>Vt,createContextKey:()=>Se,createNoopMeter:()=>De,createTraceState:()=>zt,default:()=>mn,defaultTextMapGetter:()=>E,defaultTextMapSetter:()=>D,diag:()=>J,isSpanContextValid:()=>R,isValidSpanId:()=>ut,isValidTraceId:()=>lt,metrics:()=>Yt,propagation:()=>cn,trace:()=>$});var mn,hn=e.__esmMin((()=>{xe(),b(),Ee(),oe(),Ue(),Ge(),Ke(),_t(),xt(),Ct(),Tt(),Et(),et(),Bt(),z(),tt(),Ht(),Ut(),Xt(),ln(),fn(),mn={context:Vt,diag:J,metrics:Yt,propagation:cn,trace:$}}));Object.defineProperty(exports,`SpanStatusCode`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`diag`,{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,`esm_exports`,{enumerable:!0,get:function(){return pn}}),Object.defineProperty(exports,`init_esm`,{enumerable:!0,get:function(){return hn}}),Object.defineProperty(exports,`trace`,{enumerable:!0,get:function(){return $}});
|
|
1
|
+
const e=require(`./chunk-D2ScRZv4.cjs`);var t,n=e.__esmMin((()=>{t=typeof globalThis==`object`?globalThis:global})),r=e.__esmMin((()=>{n()})),i=e.__esmMin((()=>{r()})),a,o=e.__esmMin((()=>{a=`1.9.0`}));function s(e){var t=new Set([e]),n=new Set,r=e.match(c);if(!r)return function(){return!1};var i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;var r=e.match(c);if(!r)return a(e);var s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}var c,l,ee=e.__esmMin((()=>{o(),c=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,l=s(a)}));function u(e,t,n,r){var i;r===void 0&&(r=!1);var o=m[p]=(i=m[p])==null?{version:a}:i;if(!r&&o[e]){var s=Error(`@opentelemetry/api: Attempted duplicate registration of API: `+e);return n.error(s.stack||s.message),!1}if(o.version!==a){var s=Error(`@opentelemetry/api: Registration of version v`+o.version+` for `+e+` does not match previously registered API v`+a);return n.error(s.stack||s.message),!1}return o[e]=t,n.debug(`@opentelemetry/api: Registered a global for `+e+` v`+a+`.`),!0}function d(e){var t,n,r=(t=m[p])==null?void 0:t.version;if(!(!r||!l(r)))return(n=m[p])==null?void 0:n[e]}function f(e,t){t.debug(`@opentelemetry/api: Unregistering a global for `+e+` v`+a+`.`);var n=m[p];n&&delete n[e]}var te,p,m,h=e.__esmMin((()=>{i(),o(),ee(),te=a.split(`.`)[0],p=Symbol.for(`opentelemetry.js.api.`+te),m=t}));function g(e,t,n){var r=d(`diag`);if(r)return n.unshift(t),r[e].apply(r,re([],ne(n),!1))}var ne,re,ie,ae=e.__esmMin((()=>{h(),ne=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},re=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},ie=function(){function e(e){this._namespace=e.namespace||`DiagComponentLogger`}return e.prototype.debug=function(){var e=[...arguments];return g(`debug`,this._namespace,e)},e.prototype.error=function(){var e=[...arguments];return g(`error`,this._namespace,e)},e.prototype.info=function(){var e=[...arguments];return g(`info`,this._namespace,e)},e.prototype.warn=function(){var e=[...arguments];return g(`warn`,this._namespace,e)},e.prototype.verbose=function(){var e=[...arguments];return g(`verbose`,this._namespace,e)},e}()})),_,oe=e.__esmMin((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(_||(_={}))}));function se(e,t){e<_.NONE?e=_.NONE:e>_.ALL&&(e=_.ALL),t=t||{};function n(n,r){var i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,_.ERROR),warn:n(`warn`,_.WARN),info:n(`info`,_.INFO),debug:n(`debug`,_.DEBUG),verbose:n(`verbose`,_.VERBOSE)}}var ce=e.__esmMin((()=>{oe()})),le,ue,de,v,y=e.__esmMin((()=>{ae(),ce(),oe(),h(),le=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},ue=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},de=`diag`,v=function(){function e(){function e(e){return function(){var t=[...arguments],n=d(`diag`);if(n)return n[e].apply(n,ue([],le(t),!1))}}var t=this,n=function(e,n){var r,i,a;if(n===void 0&&(n={logLevel:_.INFO}),e===t){var o=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error((r=o.stack)==null?o.message:r),!1}typeof n==`number`&&(n={logLevel:n});var s=d(`diag`),c=se((i=n.logLevel)==null?_.INFO:i,e);if(s&&!n.suppressOverrideMessage){var l=(a=Error().stack)==null?`<failed to generate stacktrace>`:a;s.warn(`Current logger will be overwritten from `+l),c.warn(`Current logger will overwrite one already registered from `+l)}return u(`diag`,c,t,!0)};t.setLogger=n,t.disable=function(){f(de,t)},t.createComponentLogger=function(e){return new ie(e)},t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}()})),fe,pe,me,he=e.__esmMin((()=>{fe=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},pe=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},me=function(){function e(e){this._entries=e?new Map(e):new Map}return e.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=fe(e,2),n=t[0],r=t[1];return[n,r]})},e.prototype.setEntry=function(t,n){var r=new e(this._entries);return r._entries.set(t,n),r},e.prototype.removeEntry=function(t){var n=new e(this._entries);return n._entries.delete(t),n},e.prototype.removeEntries=function(){for(var t,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=new e(this._entries);try{for(var o=pe(r),s=o.next();!s.done;s=o.next()){var c=s.value;a._entries.delete(c)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return a},e.prototype.clear=function(){return new e},e}()})),ge,_e=e.__esmMin((()=>{ge=Symbol(`BaggageEntryMetadata`)}));function ve(e){return e===void 0&&(e={}),new me(new Map(Object.entries(e)))}function ye(e){return typeof e!=`string`&&(be.error(`Cannot create baggage metadata from unknown type: `+typeof e),e=``),{__TYPE__:ge,toString:function(){return e}}}var be,xe=e.__esmMin((()=>{y(),he(),_e(),be=v.instance()}));function b(e){return Symbol.for(e)}var Se,Ce,x=e.__esmMin((()=>{Se=function(){function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(e){return n._currentContext.get(e)},n.setValue=function(t,r){var i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=function(t){var r=new e(n._currentContext);return r._currentContext.delete(t),r}}return e}(),Ce=new Se})),S,we,Te=e.__esmMin((()=>{S=[{n:`error`,c:`error`},{n:`warn`,c:`warn`},{n:`info`,c:`info`},{n:`debug`,c:`debug`},{n:`verbose`,c:`trace`}],we=function(){function e(){function e(e){return function(){var t=[...arguments];if(console){var n=console[e];if(typeof n!=`function`&&(n=console.log),typeof n==`function`)return n.apply(console,t)}}}for(var t=0;t<S.length;t++)this[S[t].n]=e(S[t].c)}return e}()}));function Ee(){return E}var C,De,w,Oe,ke,Ae,je,T,Me,Ne,Pe,E,Fe,Ie,Le,Re,ze,Be,Ve,He=e.__esmMin((()=>{C=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),De=function(){function e(){}return e.prototype.createGauge=function(e,t){return Ie},e.prototype.createHistogram=function(e,t){return Le},e.prototype.createCounter=function(e,t){return Fe},e.prototype.createUpDownCounter=function(e,t){return Re},e.prototype.createObservableGauge=function(e,t){return Be},e.prototype.createObservableCounter=function(e,t){return ze},e.prototype.createObservableUpDownCounter=function(e,t){return Ve},e.prototype.addBatchObservableCallback=function(e,t){},e.prototype.removeBatchObservableCallback=function(e){},e}(),w=function(){function e(){}return e}(),Oe=function(e){C(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.add=function(e,t){},t}(w),ke=function(e){C(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.add=function(e,t){},t}(w),Ae=function(e){C(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.record=function(e,t){},t}(w),je=function(e){C(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.record=function(e,t){},t}(w),T=function(){function e(){}return e.prototype.addCallback=function(e){},e.prototype.removeCallback=function(e){},e}(),Me=function(e){C(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(T),Ne=function(e){C(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(T),Pe=function(e){C(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(T),E=new De,Fe=new Oe,Ie=new Ae,Le=new je,Re=new ke,ze=new Me,Be=new Ne,Ve=new Pe})),D,Ue=e.__esmMin((()=>{(function(e){e[e.INT=0]=`INT`,e[e.DOUBLE=1]=`DOUBLE`})(D||(D={}))})),O,k,We=e.__esmMin((()=>{O={get:function(e,t){if(e!=null)return e[t]},keys:function(e){return e==null?[]:Object.keys(e)}},k={set:function(e,t,n){e!=null&&(e[t]=n)}}})),Ge,Ke,qe,Je=e.__esmMin((()=>{x(),Ge=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Ke=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},qe=function(){function e(){}return e.prototype.active=function(){return Ce},e.prototype.with=function(e,t,n){var r=[...arguments].slice(3);return t.call.apply(t,Ke([n],Ge(r),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}()})),Ye,Xe,A,Ze,j,M=e.__esmMin((()=>{Je(),h(),y(),Ye=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Xe=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},A=`context`,Ze=new qe,j=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return u(A,e,v.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,n){for(var r,i=[],a=3;a<arguments.length;a++)i[a-3]=arguments[a];return(r=this._getContextManager()).with.apply(r,Xe([e,t,n],Ye(i),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return d(A)||Ze},e.prototype.disable=function(){this._getContextManager().disable(),f(A,v.instance())},e}()})),N,Qe=e.__esmMin((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(N||(N={}))})),P,F,$e,et=e.__esmMin((()=>{Qe(),P=`0000000000000000`,F=`00000000000000000000000000000000`,$e={traceId:F,spanId:P,traceFlags:N.NONE}})),I,tt=e.__esmMin((()=>{et(),I=function(){function e(e){e===void 0&&(e=$e),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}()}));function nt(e){return e.getValue(L)||void 0}function rt(){return nt(j.getInstance().active())}function it(e,t){return e.setValue(L,t)}function at(e){return e.deleteValue(L)}function ot(e,t){return it(e,new I(t))}function st(e){var t;return(t=nt(e))==null?void 0:t.spanContext()}var L,ct=e.__esmMin((()=>{x(),tt(),M(),L=b(`OpenTelemetry Context Key SPAN`)}));function lt(e){return ft.test(e)&&e!==F}function ut(e){return pt.test(e)&&e!==P}function R(e){return lt(e.traceId)&&ut(e.spanId)}function dt(e){return new I(e)}var ft,pt,z=e.__esmMin((()=>{et(),tt(),ft=/^([0-9a-f]{32})$/i,pt=/^[0-9a-f]{16}$/i}));function mt(e){return typeof e==`object`&&typeof e.spanId==`string`&&typeof e.traceId==`string`&&typeof e.traceFlags==`number`}var B,V,ht=e.__esmMin((()=>{M(),ct(),tt(),z(),B=j.getInstance(),V=function(){function e(){}return e.prototype.startSpan=function(e,t,n){n===void 0&&(n=B.active());var r=!!(t!=null&&t.root);if(r)return new I;var i=n&&st(n);return mt(i)&&R(i)?new I(i):new I},e.prototype.startActiveSpan=function(e,t,n,r){var i,a,o;if(!(arguments.length<2)){arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);var s=a==null?B.active():a,c=this.startSpan(e,i,s),l=it(s,c);return B.with(l,o,void 0,c)}},e}()})),gt,H,_t=e.__esmMin((()=>{ht(),gt=new V,H=function(){function e(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}return e.prototype.startSpan=function(e,t,n){return this._getTracer().startSpan(e,t,n)},e.prototype.startActiveSpan=function(e,t,n,r){var i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):gt},e}()})),vt,yt=e.__esmMin((()=>{ht(),vt=function(){function e(){}return e.prototype.getTracer=function(e,t,n){return new V},e}()})),bt,U,xt=e.__esmMin((()=>{_t(),yt(),bt=new vt,U=function(){function e(){}return e.prototype.getTracer=function(e,t,n){var r;return(r=this.getDelegateTracer(e,t,n))==null?new H(this,e,t,n):r},e.prototype.getDelegate=function(){var e;return(e=this._delegate)==null?bt:e},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getTracer(e,t,n)},e}()})),W,St=e.__esmMin((()=>{(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(W||(W={}))})),G,Ct=e.__esmMin((()=>{(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(G||(G={}))})),K,wt=e.__esmMin((()=>{(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(K||(K={}))}));function Tt(e){return kt.test(e)}function Et(e){return At.test(e)&&!jt.test(e)}var q,Dt,Ot,kt,At,jt,Mt=e.__esmMin((()=>{q=`[_0-9a-z-*/]`,Dt=`[a-z]`+q+`{0,255}`,Ot=`[a-z0-9]`+q+`{0,240}@[a-z]`+q+`{0,13}`,kt=RegExp(`^(?:`+Dt+`|`+Ot+`)$`),At=/^[ -~]{0,255}[!-~]$/,jt=/,|=/})),Nt,Pt,Ft,It,Lt,Rt=e.__esmMin((()=>{Mt(),Nt=32,Pt=512,Ft=`,`,It=`=`,Lt=function(){function e(e){this._internalState=new Map,e&&this._parse(e)}return e.prototype.set=function(e,t){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n},e.prototype.unset=function(e){var t=this._clone();return t._internalState.delete(e),t},e.prototype.get=function(e){return this._internalState.get(e)},e.prototype.serialize=function(){var e=this;return this._keys().reduce(function(t,n){return t.push(n+It+e.get(n)),t},[]).join(Ft)},e.prototype._parse=function(e){e.length>Pt||(this._internalState=e.split(Ft).reverse().reduce(function(e,t){var n=t.trim(),r=n.indexOf(It);if(r!==-1){var i=n.slice(0,r),a=n.slice(r+1,t.length);Tt(i)&&Et(a)&&e.set(i,a)}return e},new Map),this._internalState.size>Nt&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Nt))))},e.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},e.prototype._clone=function(){var t=new e;return t._internalState=new Map(this._internalState),t},e}()}));function zt(e){return new Lt(e)}var Bt=e.__esmMin((()=>{Rt()})),Vt,Ht=e.__esmMin((()=>{M(),Vt=j.getInstance()})),J,Ut=e.__esmMin((()=>{y(),J=v.instance()})),Wt,Gt,Kt=e.__esmMin((()=>{He(),Wt=function(){function e(){}return e.prototype.getMeter=function(e,t,n){return E},e}(),Gt=new Wt})),Y,qt,Jt=e.__esmMin((()=>{Kt(),h(),y(),Y=`metrics`,qt=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalMeterProvider=function(e){return u(Y,e,v.instance())},e.prototype.getMeterProvider=function(){return d(Y)||Gt},e.prototype.getMeter=function(e,t,n){return this.getMeterProvider().getMeter(e,t,n)},e.prototype.disable=function(){f(Y,v.instance())},e}()})),Yt,Xt=e.__esmMin((()=>{Jt(),Yt=qt.getInstance()})),Zt,Qt=e.__esmMin((()=>{Zt=function(){function e(){}return e.prototype.inject=function(e,t){},e.prototype.extract=function(e,t){return e},e.prototype.fields=function(){return[]},e}()}));function $t(e){return e.getValue(X)||void 0}function en(){return $t(j.getInstance().active())}function tn(e,t){return e.setValue(X,t)}function nn(e){return e.deleteValue(X)}var X,rn=e.__esmMin((()=>{M(),x(),X=b(`OpenTelemetry Baggage Key`)})),Z,an,on,sn=e.__esmMin((()=>{h(),Qt(),We(),rn(),xe(),y(),Z=`propagation`,an=new Zt,on=function(){function e(){this.createBaggage=ve,this.getBaggage=$t,this.getActiveBaggage=en,this.setBaggage=tn,this.deleteBaggage=nn}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalPropagator=function(e){return u(Z,e,v.instance())},e.prototype.inject=function(e,t,n){return n===void 0&&(n=k),this._getGlobalPropagator().inject(e,t,n)},e.prototype.extract=function(e,t,n){return n===void 0&&(n=O),this._getGlobalPropagator().extract(e,t,n)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){f(Z,v.instance())},e.prototype._getGlobalPropagator=function(){return d(Z)||an},e}()})),cn,ln=e.__esmMin((()=>{sn(),cn=on.getInstance()})),Q,un,dn=e.__esmMin((()=>{h(),xt(),z(),ct(),y(),Q=`trace`,un=function(){function e(){this._proxyTracerProvider=new U,this.wrapSpanContext=dt,this.isSpanContextValid=R,this.deleteSpan=at,this.getSpan=nt,this.getActiveSpan=rt,this.getSpanContext=st,this.setSpan=it,this.setSpanContext=ot}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=u(Q,this._proxyTracerProvider,v.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return d(Q)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){f(Q,v.instance()),this._proxyTracerProvider=new U},e}()})),$,fn=e.__esmMin((()=>{dn(),$=un.getInstance()})),pn={};e.__export(pn,{DiagConsoleLogger:()=>we,DiagLogLevel:()=>_,INVALID_SPANID:()=>P,INVALID_SPAN_CONTEXT:()=>$e,INVALID_TRACEID:()=>F,ProxyTracer:()=>H,ProxyTracerProvider:()=>U,ROOT_CONTEXT:()=>Ce,SamplingDecision:()=>W,SpanKind:()=>G,SpanStatusCode:()=>K,TraceFlags:()=>N,ValueType:()=>D,baggageEntryMetadataFromString:()=>ye,context:()=>Vt,createContextKey:()=>b,createNoopMeter:()=>Ee,createTraceState:()=>zt,default:()=>mn,defaultTextMapGetter:()=>O,defaultTextMapSetter:()=>k,diag:()=>J,isSpanContextValid:()=>R,isValidSpanId:()=>ut,isValidTraceId:()=>lt,metrics:()=>Yt,propagation:()=>cn,trace:()=>$});var mn,hn=e.__esmMin((()=>{xe(),x(),Te(),oe(),He(),Ue(),We(),_t(),xt(),St(),Ct(),wt(),Qe(),Bt(),z(),et(),Ht(),Ut(),Xt(),ln(),fn(),mn={context:Vt,diag:J,metrics:Yt,propagation:cn,trace:$}}));Object.defineProperty(exports,`SpanStatusCode`,{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,`diag`,{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,`esm_exports`,{enumerable:!0,get:function(){return pn}}),Object.defineProperty(exports,`init_esm`,{enumerable:!0,get:function(){return hn}}),Object.defineProperty(exports,`trace`,{enumerable:!0,get:function(){return $}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__esmMin as e,__export as t}from"./chunk-BJ0G7Fuz.js";var n,r=e((()=>{n=typeof globalThis==`object`?globalThis:global})),i=e((()=>{r()})),a=e((()=>{i()})),o,s=e((()=>{o=`1.9.0`}));function c(e){var t=new Set([e]),n=new Set,r=e.match(l);if(!r)return function(){return!1};var i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;var r=e.match(l);if(!r)return a(e);var s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}var l,ee,te=e((()=>{s(),l=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,ee=c(o)}));function u(e,t,n,r){var i;r===void 0&&(r=!1);var a=m[p]=(i=m[p])??{version:o};if(!r&&a[e]){var s=Error(`@opentelemetry/api: Attempted duplicate registration of API: `+e);return n.error(s.stack||s.message),!1}if(a.version!==o){var s=Error(`@opentelemetry/api: Registration of version v`+a.version+` for `+e+` does not match previously registered API v`+o);return n.error(s.stack||s.message),!1}return a[e]=t,n.debug(`@opentelemetry/api: Registered a global for `+e+` v`+o+`.`),!0}function d(e){var t,n,r=(t=m[p])?.version;if(!(!r||!ee(r)))return(n=m[p])?.[e]}function f(e,t){t.debug(`@opentelemetry/api: Unregistering a global for `+e+` v`+o+`.`);var n=m[p];n&&delete n[e]}var ne,p,m,h=e((()=>{a(),s(),te(),ne=o.split(`.`)[0],p=Symbol.for(`opentelemetry.js.api.`+ne),m=n}));function g(e,t,n){var r=d(`diag`);if(r)return n.unshift(t),r[e].apply(r,ie([],re(n),!1))}var re,ie,ae,oe=e((()=>{h(),re=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},ie=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},ae=function(){function e(e){this._namespace=e.namespace||`DiagComponentLogger`}return e.prototype.debug=function(){var e=[...arguments];return g(`debug`,this._namespace,e)},e.prototype.error=function(){var e=[...arguments];return g(`error`,this._namespace,e)},e.prototype.info=function(){var e=[...arguments];return g(`info`,this._namespace,e)},e.prototype.warn=function(){var e=[...arguments];return g(`warn`,this._namespace,e)},e.prototype.verbose=function(){var e=[...arguments];return g(`verbose`,this._namespace,e)},e}()})),_,v=e((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(_||={})}));function se(e,t){e<_.NONE?e=_.NONE:e>_.ALL&&(e=_.ALL),t||={};function n(n,r){var i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,_.ERROR),warn:n(`warn`,_.WARN),info:n(`info`,_.INFO),debug:n(`debug`,_.DEBUG),verbose:n(`verbose`,_.VERBOSE)}}var ce=e((()=>{v()})),le,ue,de,y,b=e((()=>{oe(),ce(),v(),h(),le=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},ue=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},de=`diag`,y=function(){function e(){function e(e){return function(){var t=[...arguments],n=d(`diag`);if(n)return n[e].apply(n,ue([],le(t),!1))}}var t=this,n=function(e,n){var r,i,a;if(n===void 0&&(n={logLevel:_.INFO}),e===t){var o=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error((r=o.stack)??o.message),!1}typeof n==`number`&&(n={logLevel:n});var s=d(`diag`),c=se((i=n.logLevel)??_.INFO,e);if(s&&!n.suppressOverrideMessage){var l=(a=Error().stack)??`<failed to generate stacktrace>`;s.warn(`Current logger will be overwritten from `+l),c.warn(`Current logger will overwrite one already registered from `+l)}return u(`diag`,c,t,!0)};t.setLogger=n,t.disable=function(){f(de,t)},t.createComponentLogger=function(e){return new ae(e)},t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}return e.instance=function(){return this._instance||=new e,this._instance},e}()})),fe,pe,me,he=e((()=>{fe=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},pe=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},me=function(){function e(e){this._entries=e?new Map(e):new Map}return e.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=fe(e,2),n=t[0],r=t[1];return[n,r]})},e.prototype.setEntry=function(t,n){var r=new e(this._entries);return r._entries.set(t,n),r},e.prototype.removeEntry=function(t){var n=new e(this._entries);return n._entries.delete(t),n},e.prototype.removeEntries=function(){for(var t,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=new e(this._entries);try{for(var o=pe(r),s=o.next();!s.done;s=o.next()){var c=s.value;a._entries.delete(c)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return a},e.prototype.clear=function(){return new e},e}()})),ge,_e=e((()=>{ge=Symbol(`BaggageEntryMetadata`)}));function ve(e){return e===void 0&&(e={}),new me(new Map(Object.entries(e)))}function ye(e){return typeof e!=`string`&&(be.error(`Cannot create baggage metadata from unknown type: `+typeof e),e=``),{__TYPE__:ge,toString:function(){return e}}}var be,xe=e((()=>{b(),he(),_e(),be=y.instance()}));function Se(e){return Symbol.for(e)}var Ce,x,S=e((()=>{Ce=function(){function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(e){return n._currentContext.get(e)},n.setValue=function(t,r){var i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=function(t){var r=new e(n._currentContext);return r._currentContext.delete(t),r}}return e}(),x=new Ce})),C,we,Te=e((()=>{C=[{n:`error`,c:`error`},{n:`warn`,c:`warn`},{n:`info`,c:`info`},{n:`debug`,c:`debug`},{n:`verbose`,c:`trace`}],we=function(){function e(){function e(e){return function(){var t=[...arguments];if(console){var n=console[e];if(typeof n!=`function`&&(n=console.log),typeof n==`function`)return n.apply(console,t)}}}for(var t=0;t<C.length;t++)this[C[t].n]=e(C[t].c)}return e}()}));function Ee(){return D}var w,De,T,Oe,ke,Ae,je,E,Me,Ne,Pe,D,Fe,Ie,Le,Re,ze,Be,Ve,He=e((()=>{w=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),De=function(){function e(){}return e.prototype.createGauge=function(e,t){return Ie},e.prototype.createHistogram=function(e,t){return Le},e.prototype.createCounter=function(e,t){return Fe},e.prototype.createUpDownCounter=function(e,t){return Re},e.prototype.createObservableGauge=function(e,t){return Be},e.prototype.createObservableCounter=function(e,t){return ze},e.prototype.createObservableUpDownCounter=function(e,t){return Ve},e.prototype.addBatchObservableCallback=function(e,t){},e.prototype.removeBatchObservableCallback=function(e){},e}(),T=function(){function e(){}return e}(),Oe=function(e){w(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.add=function(e,t){},t}(T),ke=function(e){w(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.add=function(e,t){},t}(T),Ae=function(e){w(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.record=function(e,t){},t}(T),je=function(e){w(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.record=function(e,t){},t}(T),E=function(){function e(){}return e.prototype.addCallback=function(e){},e.prototype.removeCallback=function(e){},e}(),Me=function(e){w(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(E),Ne=function(e){w(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(E),Pe=function(e){w(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(E),D=new De,Fe=new Oe,Ie=new Ae,Le=new je,Re=new ke,ze=new Me,Be=new Ne,Ve=new Pe})),Ue,We=e((()=>{(function(e){e[e.INT=0]=`INT`,e[e.DOUBLE=1]=`DOUBLE`})(Ue||={})})),O,k,Ge=e((()=>{O={get:function(e,t){if(e!=null)return e[t]},keys:function(e){return e==null?[]:Object.keys(e)}},k={set:function(e,t,n){e!=null&&(e[t]=n)}}})),Ke,qe,Je,Ye=e((()=>{S(),Ke=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},qe=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},Je=function(){function e(){}return e.prototype.active=function(){return x},e.prototype.with=function(e,t,n){var r=[...arguments].slice(3);return t.call.apply(t,qe([n],Ke(r),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}()})),Xe,Ze,A,Qe,j,M=e((()=>{Ye(),h(),b(),Xe=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Ze=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},A=`context`,Qe=new Je,j=function(){function e(){}return e.getInstance=function(){return this._instance||=new e,this._instance},e.prototype.setGlobalContextManager=function(e){return u(A,e,y.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,n){for(var r,i=[],a=3;a<arguments.length;a++)i[a-3]=arguments[a];return(r=this._getContextManager()).with.apply(r,Ze([e,t,n],Xe(i),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return d(A)||Qe},e.prototype.disable=function(){this._getContextManager().disable(),f(A,y.instance())},e}()})),N,$e=e((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(N||={})})),P,F,I,L=e((()=>{$e(),P=`0000000000000000`,F=`00000000000000000000000000000000`,I={traceId:F,spanId:P,traceFlags:N.NONE}})),R,z=e((()=>{L(),R=function(){function e(e){e===void 0&&(e=I),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}()}));function B(e){return e.getValue(H)||void 0}function et(){return B(j.getInstance().active())}function V(e,t){return e.setValue(H,t)}function tt(e){return e.deleteValue(H)}function nt(e,t){return V(e,new R(t))}function rt(e){var t;return(t=B(e))?.spanContext()}var H,it=e((()=>{S(),z(),M(),H=Se(`OpenTelemetry Context Key SPAN`)}));function at(e){return lt.test(e)&&e!==F}function ot(e){return ut.test(e)&&e!==P}function st(e){return at(e.traceId)&&ot(e.spanId)}function ct(e){return new R(e)}var lt,ut,dt=e((()=>{L(),z(),lt=/^([0-9a-f]{32})$/i,ut=/^[0-9a-f]{16}$/i}));function ft(e){return typeof e==`object`&&typeof e.spanId==`string`&&typeof e.traceId==`string`&&typeof e.traceFlags==`number`}var U,pt,mt=e((()=>{M(),it(),z(),dt(),U=j.getInstance(),pt=function(){function e(){}return e.prototype.startSpan=function(e,t,n){n===void 0&&(n=U.active());var r=!!t?.root;if(r)return new R;var i=n&&rt(n);return ft(i)&&st(i)?new R(i):new R},e.prototype.startActiveSpan=function(e,t,n,r){var i,a,o;if(!(arguments.length<2)){arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);var s=a??U.active(),c=this.startSpan(e,i,s),l=V(s,c);return U.with(l,o,void 0,c)}},e}()})),ht,gt,_t=e((()=>{mt(),ht=new pt,gt=function(){function e(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}return e.prototype.startSpan=function(e,t,n){return this._getTracer().startSpan(e,t,n)},e.prototype.startActiveSpan=function(e,t,n,r){var i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):ht},e}()})),vt,yt=e((()=>{mt(),vt=function(){function e(){}return e.prototype.getTracer=function(e,t,n){return new pt},e}()})),bt,W,xt=e((()=>{_t(),yt(),bt=new vt,W=function(){function e(){}return e.prototype.getTracer=function(e,t,n){var r;return(r=this.getDelegateTracer(e,t,n))??new gt(this,e,t,n)},e.prototype.getDelegate=function(){var e;return(e=this._delegate)??bt},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,n){var r;return(r=this._delegate)?.getTracer(e,t,n)},e}()})),St,Ct=e((()=>{(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(St||={})})),wt,Tt=e((()=>{(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(wt||={})})),Et,Dt=e((()=>{(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(Et||={})}));function Ot(e){return Mt.test(e)}function kt(e){return Nt.test(e)&&!Pt.test(e)}var G,At,jt,Mt,Nt,Pt,Ft=e((()=>{G=`[_0-9a-z-*/]`,At=`[a-z]`+G+`{0,255}`,jt=`[a-z0-9]`+G+`{0,240}@[a-z]`+G+`{0,13}`,Mt=RegExp(`^(?:`+At+`|`+jt+`)$`),Nt=/^[ -~]{0,255}[!-~]$/,Pt=/,|=/})),It,Lt,Rt,zt,Bt,Vt=e((()=>{Ft(),It=32,Lt=512,Rt=`,`,zt=`=`,Bt=function(){function e(e){this._internalState=new Map,e&&this._parse(e)}return e.prototype.set=function(e,t){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n},e.prototype.unset=function(e){var t=this._clone();return t._internalState.delete(e),t},e.prototype.get=function(e){return this._internalState.get(e)},e.prototype.serialize=function(){var e=this;return this._keys().reduce(function(t,n){return t.push(n+zt+e.get(n)),t},[]).join(Rt)},e.prototype._parse=function(e){e.length>Lt||(this._internalState=e.split(Rt).reverse().reduce(function(e,t){var n=t.trim(),r=n.indexOf(zt);if(r!==-1){var i=n.slice(0,r),a=n.slice(r+1,t.length);Ot(i)&&kt(a)&&e.set(i,a)}return e},new Map),this._internalState.size>It&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,It))))},e.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},e.prototype._clone=function(){var t=new e;return t._internalState=new Map(this._internalState),t},e}()}));function Ht(e){return new Bt(e)}var Ut=e((()=>{Vt()})),Wt,Gt=e((()=>{M(),Wt=j.getInstance()})),K,Kt=e((()=>{b(),K=y.instance()})),qt,Jt,Yt=e((()=>{He(),qt=function(){function e(){}return e.prototype.getMeter=function(e,t,n){return D},e}(),Jt=new qt})),q,Xt,Zt=e((()=>{Yt(),h(),b(),q=`metrics`,Xt=function(){function e(){}return e.getInstance=function(){return this._instance||=new e,this._instance},e.prototype.setGlobalMeterProvider=function(e){return u(q,e,y.instance())},e.prototype.getMeterProvider=function(){return d(q)||Jt},e.prototype.getMeter=function(e,t,n){return this.getMeterProvider().getMeter(e,t,n)},e.prototype.disable=function(){f(q,y.instance())},e}()})),J,Qt=e((()=>{Zt(),J=Xt.getInstance()})),$t,en=e((()=>{$t=function(){function e(){}return e.prototype.inject=function(e,t){},e.prototype.extract=function(e,t){return e},e.prototype.fields=function(){return[]},e}()}));function tn(e){return e.getValue(Y)||void 0}function nn(){return tn(j.getInstance().active())}function rn(e,t){return e.setValue(Y,t)}function an(e){return e.deleteValue(Y)}var Y,on=e((()=>{M(),S(),Y=Se(`OpenTelemetry Baggage Key`)})),X,sn,cn,ln=e((()=>{h(),en(),Ge(),on(),xe(),b(),X=`propagation`,sn=new $t,cn=function(){function e(){this.createBaggage=ve,this.getBaggage=tn,this.getActiveBaggage=nn,this.setBaggage=rn,this.deleteBaggage=an}return e.getInstance=function(){return this._instance||=new e,this._instance},e.prototype.setGlobalPropagator=function(e){return u(X,e,y.instance())},e.prototype.inject=function(e,t,n){return n===void 0&&(n=k),this._getGlobalPropagator().inject(e,t,n)},e.prototype.extract=function(e,t,n){return n===void 0&&(n=O),this._getGlobalPropagator().extract(e,t,n)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){f(X,y.instance())},e.prototype._getGlobalPropagator=function(){return d(X)||sn},e}()})),Z,un=e((()=>{ln(),Z=cn.getInstance()})),Q,dn,fn=e((()=>{h(),xt(),dt(),it(),b(),Q=`trace`,dn=function(){function e(){this._proxyTracerProvider=new W,this.wrapSpanContext=ct,this.isSpanContextValid=st,this.deleteSpan=tt,this.getSpan=B,this.getActiveSpan=et,this.getSpanContext=rt,this.setSpan=V,this.setSpanContext=nt}return e.getInstance=function(){return this._instance||=new e,this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=u(Q,this._proxyTracerProvider,y.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return d(Q)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){f(Q,y.instance()),this._proxyTracerProvider=new W},e}()})),$,pn=e((()=>{fn(),$=dn.getInstance()})),mn={};t(mn,{DiagConsoleLogger:()=>we,DiagLogLevel:()=>_,INVALID_SPANID:()=>P,INVALID_SPAN_CONTEXT:()=>I,INVALID_TRACEID:()=>F,ProxyTracer:()=>gt,ProxyTracerProvider:()=>W,ROOT_CONTEXT:()=>x,SamplingDecision:()=>St,SpanKind:()=>wt,SpanStatusCode:()=>Et,TraceFlags:()=>N,ValueType:()=>Ue,baggageEntryMetadataFromString:()=>ye,context:()=>Wt,createContextKey:()=>Se,createNoopMeter:()=>Ee,createTraceState:()=>Ht,default:()=>hn,defaultTextMapGetter:()=>O,defaultTextMapSetter:()=>k,diag:()=>K,isSpanContextValid:()=>st,isValidSpanId:()=>ot,isValidTraceId:()=>at,metrics:()=>J,propagation:()=>Z,trace:()=>$});var hn,gn=e((()=>{xe(),S(),Te(),v(),He(),We(),Ge(),_t(),xt(),Ct(),Tt(),Dt(),$e(),Ut(),dt(),L(),Gt(),Kt(),Qt(),un(),pn(),hn={context:Wt,diag:K,metrics:J,propagation:Z,trace:$}}));export{Et as SpanStatusCode,K as diag,mn as esm_exports,gn as init_esm,$ as trace};
|
|
1
|
+
import{__esmMin as e,__export as t}from"./chunk-BJ0G7Fuz.js";var n,r=e((()=>{n=typeof globalThis==`object`?globalThis:global})),i=e((()=>{r()})),a=e((()=>{i()})),o,s=e((()=>{o=`1.9.0`}));function c(e){var t=new Set([e]),n=new Set,r=e.match(l);if(!r)return function(){return!1};var i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;var r=e.match(l);if(!r)return a(e);var s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}var l,ee,te=e((()=>{s(),l=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,ee=c(o)}));function u(e,t,n,r){var i;r===void 0&&(r=!1);var a=m[p]=(i=m[p])==null?{version:o}:i;if(!r&&a[e]){var s=Error(`@opentelemetry/api: Attempted duplicate registration of API: `+e);return n.error(s.stack||s.message),!1}if(a.version!==o){var s=Error(`@opentelemetry/api: Registration of version v`+a.version+` for `+e+` does not match previously registered API v`+o);return n.error(s.stack||s.message),!1}return a[e]=t,n.debug(`@opentelemetry/api: Registered a global for `+e+` v`+o+`.`),!0}function d(e){var t,n,r=(t=m[p])==null?void 0:t.version;if(!(!r||!ee(r)))return(n=m[p])==null?void 0:n[e]}function f(e,t){t.debug(`@opentelemetry/api: Unregistering a global for `+e+` v`+o+`.`);var n=m[p];n&&delete n[e]}var ne,p,m,h=e((()=>{a(),s(),te(),ne=o.split(`.`)[0],p=Symbol.for(`opentelemetry.js.api.`+ne),m=n}));function g(e,t,n){var r=d(`diag`);if(r)return n.unshift(t),r[e].apply(r,ie([],re(n),!1))}var re,ie,ae,oe=e((()=>{h(),re=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},ie=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},ae=function(){function e(e){this._namespace=e.namespace||`DiagComponentLogger`}return e.prototype.debug=function(){var e=[...arguments];return g(`debug`,this._namespace,e)},e.prototype.error=function(){var e=[...arguments];return g(`error`,this._namespace,e)},e.prototype.info=function(){var e=[...arguments];return g(`info`,this._namespace,e)},e.prototype.warn=function(){var e=[...arguments];return g(`warn`,this._namespace,e)},e.prototype.verbose=function(){var e=[...arguments];return g(`verbose`,this._namespace,e)},e}()})),_,v=e((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(_||(_={}))}));function se(e,t){e<_.NONE?e=_.NONE:e>_.ALL&&(e=_.ALL),t=t||{};function n(n,r){var i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,_.ERROR),warn:n(`warn`,_.WARN),info:n(`info`,_.INFO),debug:n(`debug`,_.DEBUG),verbose:n(`verbose`,_.VERBOSE)}}var ce=e((()=>{v()})),le,ue,de,y,b=e((()=>{oe(),ce(),v(),h(),le=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},ue=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},de=`diag`,y=function(){function e(){function e(e){return function(){var t=[...arguments],n=d(`diag`);if(n)return n[e].apply(n,ue([],le(t),!1))}}var t=this,n=function(e,n){var r,i,a;if(n===void 0&&(n={logLevel:_.INFO}),e===t){var o=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error((r=o.stack)==null?o.message:r),!1}typeof n==`number`&&(n={logLevel:n});var s=d(`diag`),c=se((i=n.logLevel)==null?_.INFO:i,e);if(s&&!n.suppressOverrideMessage){var l=(a=Error().stack)==null?`<failed to generate stacktrace>`:a;s.warn(`Current logger will be overwritten from `+l),c.warn(`Current logger will overwrite one already registered from `+l)}return u(`diag`,c,t,!0)};t.setLogger=n,t.disable=function(){f(de,t)},t.createComponentLogger=function(e){return new ae(e)},t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}()})),fe,pe,me,he=e((()=>{fe=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},pe=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},me=function(){function e(e){this._entries=e?new Map(e):new Map}return e.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=fe(e,2),n=t[0],r=t[1];return[n,r]})},e.prototype.setEntry=function(t,n){var r=new e(this._entries);return r._entries.set(t,n),r},e.prototype.removeEntry=function(t){var n=new e(this._entries);return n._entries.delete(t),n},e.prototype.removeEntries=function(){for(var t,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=new e(this._entries);try{for(var o=pe(r),s=o.next();!s.done;s=o.next()){var c=s.value;a._entries.delete(c)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return a},e.prototype.clear=function(){return new e},e}()})),ge,_e=e((()=>{ge=Symbol(`BaggageEntryMetadata`)}));function ve(e){return e===void 0&&(e={}),new me(new Map(Object.entries(e)))}function ye(e){return typeof e!=`string`&&(be.error(`Cannot create baggage metadata from unknown type: `+typeof e),e=``),{__TYPE__:ge,toString:function(){return e}}}var be,xe=e((()=>{b(),he(),_e(),be=y.instance()}));function Se(e){return Symbol.for(e)}var Ce,x,S=e((()=>{Ce=function(){function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(e){return n._currentContext.get(e)},n.setValue=function(t,r){var i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=function(t){var r=new e(n._currentContext);return r._currentContext.delete(t),r}}return e}(),x=new Ce})),C,we,Te=e((()=>{C=[{n:`error`,c:`error`},{n:`warn`,c:`warn`},{n:`info`,c:`info`},{n:`debug`,c:`debug`},{n:`verbose`,c:`trace`}],we=function(){function e(){function e(e){return function(){var t=[...arguments];if(console){var n=console[e];if(typeof n!=`function`&&(n=console.log),typeof n==`function`)return n.apply(console,t)}}}for(var t=0;t<C.length;t++)this[C[t].n]=e(C[t].c)}return e}()}));function Ee(){return D}var w,De,T,Oe,ke,Ae,je,E,Me,Ne,Pe,D,Fe,Ie,Le,Re,ze,Be,Ve,He=e((()=>{w=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),De=function(){function e(){}return e.prototype.createGauge=function(e,t){return Ie},e.prototype.createHistogram=function(e,t){return Le},e.prototype.createCounter=function(e,t){return Fe},e.prototype.createUpDownCounter=function(e,t){return Re},e.prototype.createObservableGauge=function(e,t){return Be},e.prototype.createObservableCounter=function(e,t){return ze},e.prototype.createObservableUpDownCounter=function(e,t){return Ve},e.prototype.addBatchObservableCallback=function(e,t){},e.prototype.removeBatchObservableCallback=function(e){},e}(),T=function(){function e(){}return e}(),Oe=function(e){w(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.add=function(e,t){},t}(T),ke=function(e){w(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.add=function(e,t){},t}(T),Ae=function(e){w(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.record=function(e,t){},t}(T),je=function(e){w(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.record=function(e,t){},t}(T),E=function(){function e(){}return e.prototype.addCallback=function(e){},e.prototype.removeCallback=function(e){},e}(),Me=function(e){w(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(E),Ne=function(e){w(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(E),Pe=function(e){w(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(E),D=new De,Fe=new Oe,Ie=new Ae,Le=new je,Re=new ke,ze=new Me,Be=new Ne,Ve=new Pe})),O,Ue=e((()=>{(function(e){e[e.INT=0]=`INT`,e[e.DOUBLE=1]=`DOUBLE`})(O||(O={}))})),k,A,We=e((()=>{k={get:function(e,t){if(e!=null)return e[t]},keys:function(e){return e==null?[]:Object.keys(e)}},A={set:function(e,t,n){e!=null&&(e[t]=n)}}})),Ge,Ke,qe,Je=e((()=>{S(),Ge=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Ke=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},qe=function(){function e(){}return e.prototype.active=function(){return x},e.prototype.with=function(e,t,n){var r=[...arguments].slice(3);return t.call.apply(t,Ke([n],Ge(r),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}()})),Ye,Xe,j,Ze,M,N=e((()=>{Je(),h(),b(),Ye=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Xe=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},j=`context`,Ze=new qe,M=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return u(j,e,y.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,n){for(var r,i=[],a=3;a<arguments.length;a++)i[a-3]=arguments[a];return(r=this._getContextManager()).with.apply(r,Xe([e,t,n],Ye(i),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return d(j)||Ze},e.prototype.disable=function(){this._getContextManager().disable(),f(j,y.instance())},e}()})),P,Qe=e((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(P||(P={}))})),F,I,L,R=e((()=>{Qe(),F=`0000000000000000`,I=`00000000000000000000000000000000`,L={traceId:I,spanId:F,traceFlags:P.NONE}})),z,B=e((()=>{R(),z=function(){function e(e){e===void 0&&(e=L),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}()}));function V(e){return e.getValue(H)||void 0}function $e(){return V(M.getInstance().active())}function et(e,t){return e.setValue(H,t)}function tt(e){return e.deleteValue(H)}function nt(e,t){return et(e,new z(t))}function rt(e){var t;return(t=V(e))==null?void 0:t.spanContext()}var H,it=e((()=>{S(),B(),N(),H=Se(`OpenTelemetry Context Key SPAN`)}));function at(e){return lt.test(e)&&e!==I}function ot(e){return ut.test(e)&&e!==F}function st(e){return at(e.traceId)&&ot(e.spanId)}function ct(e){return new z(e)}var lt,ut,dt=e((()=>{R(),B(),lt=/^([0-9a-f]{32})$/i,ut=/^[0-9a-f]{16}$/i}));function ft(e){return typeof e==`object`&&typeof e.spanId==`string`&&typeof e.traceId==`string`&&typeof e.traceFlags==`number`}var U,pt,mt=e((()=>{N(),it(),B(),dt(),U=M.getInstance(),pt=function(){function e(){}return e.prototype.startSpan=function(e,t,n){n===void 0&&(n=U.active());var r=!!(t!=null&&t.root);if(r)return new z;var i=n&&rt(n);return ft(i)&&st(i)?new z(i):new z},e.prototype.startActiveSpan=function(e,t,n,r){var i,a,o;if(!(arguments.length<2)){arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);var s=a==null?U.active():a,c=this.startSpan(e,i,s),l=et(s,c);return U.with(l,o,void 0,c)}},e}()})),ht,gt,_t=e((()=>{mt(),ht=new pt,gt=function(){function e(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}return e.prototype.startSpan=function(e,t,n){return this._getTracer().startSpan(e,t,n)},e.prototype.startActiveSpan=function(e,t,n,r){var i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):ht},e}()})),vt,yt=e((()=>{mt(),vt=function(){function e(){}return e.prototype.getTracer=function(e,t,n){return new pt},e}()})),bt,W,xt=e((()=>{_t(),yt(),bt=new vt,W=function(){function e(){}return e.prototype.getTracer=function(e,t,n){var r;return(r=this.getDelegateTracer(e,t,n))==null?new gt(this,e,t,n):r},e.prototype.getDelegate=function(){var e;return(e=this._delegate)==null?bt:e},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getTracer(e,t,n)},e}()})),St,Ct=e((()=>{(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(St||(St={}))})),wt,Tt=e((()=>{(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(wt||(wt={}))})),G,Et=e((()=>{(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(G||(G={}))}));function Dt(e){return jt.test(e)}function Ot(e){return Mt.test(e)&&!Nt.test(e)}var K,kt,At,jt,Mt,Nt,Pt=e((()=>{K=`[_0-9a-z-*/]`,kt=`[a-z]`+K+`{0,255}`,At=`[a-z0-9]`+K+`{0,240}@[a-z]`+K+`{0,13}`,jt=RegExp(`^(?:`+kt+`|`+At+`)$`),Mt=/^[ -~]{0,255}[!-~]$/,Nt=/,|=/})),Ft,It,Lt,Rt,zt,Bt=e((()=>{Pt(),Ft=32,It=512,Lt=`,`,Rt=`=`,zt=function(){function e(e){this._internalState=new Map,e&&this._parse(e)}return e.prototype.set=function(e,t){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n},e.prototype.unset=function(e){var t=this._clone();return t._internalState.delete(e),t},e.prototype.get=function(e){return this._internalState.get(e)},e.prototype.serialize=function(){var e=this;return this._keys().reduce(function(t,n){return t.push(n+Rt+e.get(n)),t},[]).join(Lt)},e.prototype._parse=function(e){e.length>It||(this._internalState=e.split(Lt).reverse().reduce(function(e,t){var n=t.trim(),r=n.indexOf(Rt);if(r!==-1){var i=n.slice(0,r),a=n.slice(r+1,t.length);Dt(i)&&Ot(a)&&e.set(i,a)}return e},new Map),this._internalState.size>Ft&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Ft))))},e.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},e.prototype._clone=function(){var t=new e;return t._internalState=new Map(this._internalState),t},e}()}));function Vt(e){return new zt(e)}var Ht=e((()=>{Bt()})),Ut,Wt=e((()=>{N(),Ut=M.getInstance()})),q,Gt=e((()=>{b(),q=y.instance()})),Kt,qt,Jt=e((()=>{He(),Kt=function(){function e(){}return e.prototype.getMeter=function(e,t,n){return D},e}(),qt=new Kt})),J,Yt,Xt=e((()=>{Jt(),h(),b(),J=`metrics`,Yt=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalMeterProvider=function(e){return u(J,e,y.instance())},e.prototype.getMeterProvider=function(){return d(J)||qt},e.prototype.getMeter=function(e,t,n){return this.getMeterProvider().getMeter(e,t,n)},e.prototype.disable=function(){f(J,y.instance())},e}()})),Zt,Qt=e((()=>{Xt(),Zt=Yt.getInstance()})),$t,en=e((()=>{$t=function(){function e(){}return e.prototype.inject=function(e,t){},e.prototype.extract=function(e,t){return e},e.prototype.fields=function(){return[]},e}()}));function tn(e){return e.getValue(Y)||void 0}function nn(){return tn(M.getInstance().active())}function rn(e,t){return e.setValue(Y,t)}function an(e){return e.deleteValue(Y)}var Y,on=e((()=>{N(),S(),Y=Se(`OpenTelemetry Baggage Key`)})),X,sn,cn,ln=e((()=>{h(),en(),We(),on(),xe(),b(),X=`propagation`,sn=new $t,cn=function(){function e(){this.createBaggage=ve,this.getBaggage=tn,this.getActiveBaggage=nn,this.setBaggage=rn,this.deleteBaggage=an}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalPropagator=function(e){return u(X,e,y.instance())},e.prototype.inject=function(e,t,n){return n===void 0&&(n=A),this._getGlobalPropagator().inject(e,t,n)},e.prototype.extract=function(e,t,n){return n===void 0&&(n=k),this._getGlobalPropagator().extract(e,t,n)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){f(X,y.instance())},e.prototype._getGlobalPropagator=function(){return d(X)||sn},e}()})),Z,un=e((()=>{ln(),Z=cn.getInstance()})),Q,dn,fn=e((()=>{h(),xt(),dt(),it(),b(),Q=`trace`,dn=function(){function e(){this._proxyTracerProvider=new W,this.wrapSpanContext=ct,this.isSpanContextValid=st,this.deleteSpan=tt,this.getSpan=V,this.getActiveSpan=$e,this.getSpanContext=rt,this.setSpan=et,this.setSpanContext=nt}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=u(Q,this._proxyTracerProvider,y.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return d(Q)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){f(Q,y.instance()),this._proxyTracerProvider=new W},e}()})),$,pn=e((()=>{fn(),$=dn.getInstance()})),mn={};t(mn,{DiagConsoleLogger:()=>we,DiagLogLevel:()=>_,INVALID_SPANID:()=>F,INVALID_SPAN_CONTEXT:()=>L,INVALID_TRACEID:()=>I,ProxyTracer:()=>gt,ProxyTracerProvider:()=>W,ROOT_CONTEXT:()=>x,SamplingDecision:()=>St,SpanKind:()=>wt,SpanStatusCode:()=>G,TraceFlags:()=>P,ValueType:()=>O,baggageEntryMetadataFromString:()=>ye,context:()=>Ut,createContextKey:()=>Se,createNoopMeter:()=>Ee,createTraceState:()=>Vt,default:()=>hn,defaultTextMapGetter:()=>k,defaultTextMapSetter:()=>A,diag:()=>q,isSpanContextValid:()=>st,isValidSpanId:()=>ot,isValidTraceId:()=>at,metrics:()=>Zt,propagation:()=>Z,trace:()=>$});var hn,gn=e((()=>{xe(),S(),Te(),v(),He(),Ue(),We(),_t(),xt(),Ct(),Tt(),Et(),Qe(),Ht(),dt(),R(),Wt(),Gt(),Qt(),un(),pn(),hn={context:Ut,diag:q,metrics:Zt,propagation:Z,trace:$}}));export{G as SpanStatusCode,q as diag,mn as esm_exports,gn as init_esm,$ as trace};
|
|
@@ -9,6 +9,10 @@ interface Context {
|
|
|
9
9
|
* Commonly used for: authentication state, caching external resources, or other state.
|
|
10
10
|
*/
|
|
11
11
|
readonly store: StoreContext;
|
|
12
|
+
/**
|
|
13
|
+
* Otlp is for forwarding OpenTelemetry traces.
|
|
14
|
+
*/
|
|
15
|
+
readonly otlp: OtlpContext;
|
|
12
16
|
}
|
|
13
17
|
interface ChatContext {
|
|
14
18
|
/**
|
|
@@ -84,6 +88,12 @@ interface StoreContext {
|
|
|
84
88
|
cursor?: string;
|
|
85
89
|
}>;
|
|
86
90
|
}
|
|
91
|
+
interface OtlpContext {
|
|
92
|
+
/**
|
|
93
|
+
* traces forwards OpenTelemetry traces.
|
|
94
|
+
*/
|
|
95
|
+
traces: (request: Request) => Promise<Response>;
|
|
96
|
+
}
|
|
87
97
|
//#endregion
|
|
88
98
|
//#region src/agent/internal/types.d.ts
|
|
89
99
|
type Promisable<T> = T | Promise<T>;
|
|
@@ -302,4 +312,4 @@ type StreamResponseFormat = "ui-message" | "openai-chat" | "openai-response" | "
|
|
|
302
312
|
declare const StreamResponseFormatHeader = "x-blink-stream-response-format";
|
|
303
313
|
declare function withResponseFormat(response: Response, format: StreamResponseFormat): Response;
|
|
304
314
|
//#endregion
|
|
305
|
-
export { Chat, ChatBehavior, ChatContext, ChatEvent, ChatHandler, ChatResponse, Context, ContextFromTools, EnsuredChat, ExtractUIOptions, MessageOptions, Promisable, StoreContext, StreamResponseFormat, StreamResponseFormatHeader, ToolApprovalOutput, ToolSetWithApproval, ToolWithApproval, ToolWithContext, UIEvent, UIHandler, UIOptionSelect, UIOptionSelectValue, UIOptions, UIOptionsSchema, WithUIOptions, isToolApprovalOutput, lastUIOptions, toolWithApproval, tools, withResponseFormat };
|
|
315
|
+
export { Chat, ChatBehavior, ChatContext, ChatEvent, ChatHandler, ChatResponse, Context, ContextFromTools, EnsuredChat, ExtractUIOptions, MessageOptions, OtlpContext, Promisable, StoreContext, StreamResponseFormat, StreamResponseFormatHeader, ToolApprovalOutput, ToolSetWithApproval, ToolWithApproval, ToolWithContext, UIEvent, UIHandler, UIOptionSelect, UIOptionSelectValue, UIOptions, UIOptionsSchema, WithUIOptions, isToolApprovalOutput, lastUIOptions, toolWithApproval, tools, withResponseFormat };
|
|
@@ -9,6 +9,10 @@ interface Context {
|
|
|
9
9
|
* Commonly used for: authentication state, caching external resources, or other state.
|
|
10
10
|
*/
|
|
11
11
|
readonly store: StoreContext;
|
|
12
|
+
/**
|
|
13
|
+
* Otlp is for forwarding OpenTelemetry traces.
|
|
14
|
+
*/
|
|
15
|
+
readonly otlp: OtlpContext;
|
|
12
16
|
}
|
|
13
17
|
interface ChatContext {
|
|
14
18
|
/**
|
|
@@ -84,6 +88,12 @@ interface StoreContext {
|
|
|
84
88
|
cursor?: string;
|
|
85
89
|
}>;
|
|
86
90
|
}
|
|
91
|
+
interface OtlpContext {
|
|
92
|
+
/**
|
|
93
|
+
* traces forwards OpenTelemetry traces.
|
|
94
|
+
*/
|
|
95
|
+
traces: (request: Request) => Promise<Response>;
|
|
96
|
+
}
|
|
87
97
|
//#endregion
|
|
88
98
|
//#region src/agent/internal/types.d.ts
|
|
89
99
|
type Promisable<T> = T | Promise<T>;
|
|
@@ -302,4 +312,4 @@ type StreamResponseFormat = "ui-message" | "openai-chat" | "openai-response" | "
|
|
|
302
312
|
declare const StreamResponseFormatHeader = "x-blink-stream-response-format";
|
|
303
313
|
declare function withResponseFormat(response: Response, format: StreamResponseFormat): Response;
|
|
304
314
|
//#endregion
|
|
305
|
-
export { Chat, ChatBehavior, ChatContext, ChatEvent, ChatHandler, ChatResponse, Context, ContextFromTools, EnsuredChat, ExtractUIOptions, MessageOptions, Promisable, StoreContext, StreamResponseFormat, StreamResponseFormatHeader, ToolApprovalOutput, ToolSetWithApproval, ToolWithApproval, ToolWithContext, UIEvent, UIHandler, UIOptionSelect, UIOptionSelectValue, UIOptions, UIOptionsSchema, WithUIOptions, isToolApprovalOutput, lastUIOptions, toolWithApproval, tools, withResponseFormat };
|
|
315
|
+
export { Chat, ChatBehavior, ChatContext, ChatEvent, ChatHandler, ChatResponse, Context, ContextFromTools, EnsuredChat, ExtractUIOptions, MessageOptions, OtlpContext, Promisable, StoreContext, StreamResponseFormat, StreamResponseFormatHeader, ToolApprovalOutput, ToolSetWithApproval, ToolWithApproval, ToolWithContext, UIEvent, UIHandler, UIOptionSelect, UIOptionSelectValue, UIOptions, UIOptionsSchema, WithUIOptions, isToolApprovalOutput, lastUIOptions, toolWithApproval, tools, withResponseFormat };
|
package/dist/node/test.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Chat, UIOptions, UIOptionsSchema } from "./index.browser-
|
|
1
|
+
import { Chat, UIOptions, UIOptionsSchema } from "./index.browser-Chqtpkvq.cjs";
|
|
2
2
|
import { UIMessage, UIMessageChunk } from "ai";
|
|
3
3
|
|
|
4
4
|
//#region src/agent/client/index.d.ts
|
|
@@ -38,7 +38,7 @@ declare class Client {
|
|
|
38
38
|
selectedOptions?: UIOptions;
|
|
39
39
|
}, options?: {
|
|
40
40
|
signal?: AbortSignal;
|
|
41
|
-
}): Promise<UIOptionsSchema>;
|
|
41
|
+
}): Promise<UIOptionsSchema | undefined>;
|
|
42
42
|
/**
|
|
43
43
|
* health simply returns a 200 response.
|
|
44
44
|
* This is used to check if the agent is running.
|
package/dist/node/test.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Chat, UIOptions, UIOptionsSchema } from "./index.browser-
|
|
1
|
+
import { Chat, UIOptions, UIOptionsSchema } from "./index.browser-CQKM-pMt.js";
|
|
2
2
|
import { UIMessage, UIMessageChunk } from "ai";
|
|
3
3
|
|
|
4
4
|
//#region src/agent/client/index.d.ts
|
|
@@ -38,7 +38,7 @@ declare class Client {
|
|
|
38
38
|
selectedOptions?: UIOptions;
|
|
39
39
|
}, options?: {
|
|
40
40
|
signal?: AbortSignal;
|
|
41
|
-
}): Promise<UIOptionsSchema>;
|
|
41
|
+
}): Promise<UIOptionsSchema | undefined>;
|
|
42
42
|
/**
|
|
43
43
|
* health simply returns a 200 response.
|
|
44
44
|
* This is used to check if the agent is running.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blink",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.84",
|
|
4
4
|
"description": "Blink is a JavaScript runtime for building and deploying AI agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -98,5 +98,8 @@
|
|
|
98
98
|
"zod": ">= 4",
|
|
99
99
|
"ai": ">= 5",
|
|
100
100
|
"react": ">= 18"
|
|
101
|
+
},
|
|
102
|
+
"engines": {
|
|
103
|
+
"node": ">=20.0.0"
|
|
101
104
|
}
|
|
102
105
|
}
|