UNPKG

agentframework

Version:
221 lines (217 loc) 21.3 kB
/*! Copyright 2016-2024 Ling Zhang Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ "use strict";class MemberKinds{}function t(t,n,e,r){return"function"!=typeof t.beforeDecorate||t.beforeDecorate(n,e,r)} MemberKinds.None=0,MemberKinds.Static=1,MemberKinds.Class=2,MemberKinds.Property=4,MemberKinds.Parameter=8, MemberKinds.StaticClass=3,MemberKinds.StaticProperty=5,MemberKinds.ClassParameter=10, MemberKinds.StaticClassParameter=11,MemberKinds.PropertyParameter=12,MemberKinds.StaticPropertyParameter=13, MemberKinds.Any=65535;class Annotation{constructor(){this.v=0}}class Property extends Annotation{constructor(t,n){ super(),this.target=t,n&&(this.descriptor=n)}}function n(t,n,e){const r=t.properties||(t.properties=new Map) ;let o=r.get(n);return o?e&&!o.descriptor&&(o.descriptor=e):(o=new Property(t.target,e),r.set(n,o),t.prototype[n]=o),o} class Parameter extends Annotation{}function e(t,n){const e=t.parameters||(t.parameters=new Map);let r=e.get(n) ;return r||e.set(n,r=new Parameter),r}function r(t,n){(t.a||(t.a=[])).push(n)}function o(t){t.v++}const s="constructor" ;function i(t,n,e){return Reflect.defineProperty(t,n,{value:e}),e}function c(t,n,e){(t.m||(t.m=new Map)).set(n,e)} class Type extends Property{constructor(t,n){super(t),this.target=t,this.prototype=n}} function u({target:t,prototype:n}){const e=s,r=Reflect.getOwnPropertyDescriptor(n,e);let o ;return r?o=r.value:n[e]=o=new Property(t),o}let a=class Knowledge extends WeakMap{get id(){return"agentframework"} get version(){return"2.0.4"}get timestamp(){return"2024-08-21T03:40:01.773Z"}get commit(){return"e32690e"} constructor(t,e){super();const r=t,o=r[e]&&r[e].bind(r),s=this;let a;a=o?function(t,e){return function(r,i,a){let f ;return f=i?n(s.add(r),i,a):u(s.add(r.prototype)),c(f,t,e),o(t,e)(r,i,a)}}:function(t,e){return function(r,o,i){let a ;a=o?n(s.add(r),o,i):u(s.add(r.prototype)),c(a,t,e)}},a.now=Date.now(),i(r,e,a),s.set(s,new Map)}add(t){ const n=super.get(t);if(n)return n;if(t===Function.prototype){const n=new Type(t,Object.create(null)) ;return this.set(t,n),n}const e=Reflect.getPrototypeOf(t),r=new Type(t,Object.create(e&&this.add(e).prototype)) ;return this.set(t,r),r}},f=class Knowledge{static has(t){}static get(t){}static set(t,n){}static add(t){}};var h,p ;function l(t,e,s,i){const c=f.add(e),u=n(c,s,i);r(u,t),o(u),o(c)}function d(t,s,i,c){const u=f.add(s),a=n(u,i),h=e(a,c) ;r(h,t),o(h),o(a),o(u)}function m(t,n){const e=u(f.add(n));r(e,t),o(e)}function g(t,n,s){const i=u(f.add(n)),c=e(i,s) ;r(c,t),o(c),o(i)}function y(t){return f.get(t)}function w(t){const n=f.get(t);if(!n)return ;const e=Reflect.getOwnPropertyDescriptor(n.prototype,s);return e?e.value:void 0}function I(t,n){ for(let e=t.length-1;e>=0;e--)n=t[e](n)||n;return n}f=I([(h=Reflect,p="metadata",function(){let t ;return t=Symbol.for(p),h[t]||i(h,t,h.construct(a,[h,p]))})],f);class AgentFrameworkError extends Error{}function v(n){ return(e,r,o)=>{t(n,e,r,o)&&("number"==typeof o?null!=r?d(n,e,r,o):g(n,e.prototype,o):l(n,e,r,o))}}function b(t,n,e){ return Reflect.defineProperty(t,n,e),t}function A(t,n,e){return void 0!==e&&b(t,n,{value:e}),e}function O(t,n,e,r){ const o=f.get(f),s=t+"."+String(e);if(o.has(s)){const t=o.get(s);return b(n,e,{value:t}),t}{const t=r() ;return o.set(s,t),t}}class CustomInterceptors{static get v1(){ return O("CustomInterceptors",this,"v1",(()=>new WeakMap))}}function M(t){ return!!Reflect.has(t,"interceptor")||CustomInterceptors.v1.has(t.constructor)} const D="constructor",T="invoke",F="version",R="design:returntype";function k(t,n,e){let r=Reflect.get(t,F),o=e() ;return b(t,n,{get(){const n=Reflect.get(t,F);return r!==n&&(o=e(),r=n),o}}),o}class OnDemandMemberInfo{constructor(t){ this.target=t}get name(){return A(this,"name",this.getName())}getDeclaringType(){ return"object"==typeof this.target?this.target.constructor:this.target}get declaringType(){ return A(this,"declaringType",this.getDeclaringType())}get kind(){return A(this,"kind",this.getKind())}get annotation(){ return A(this,"annotation",this.getAnnotation())}get version(){const t=this.annotation;return t?t.v:0}get type(){ return A(this,"type",this.getType())}get ownAttributes(){const t=this.annotation ;if(t)return k(this,"ownAttributes",(()=>t.a))}get ownInterceptors(){const t=this.annotation ;if(t)return k(this,"ownInterceptors",(()=>{const n=t.a;if(n){const t=n.filter(M);if(t.length)return t}}))} hasOwnAttribute(t){const n=this.ownAttributes;return!!n&&(t?n.some((n=>n instanceof t)):n.length>0)}getOwnAttribute(t){ const n=this.ownAttributes;if(n)for(const e of n)if(e instanceof t)return e}getOwnAttributes(t){ const n=this.ownAttributes;return n?t?n.filter((n=>n instanceof t)):n.slice(0):[]}findOwnAttributes(t,n){ const e=this.ownAttributes;return e?e.filter((e=>t(e,n))):[]}hasOwnInterceptor(){return void 0!==this.ownInterceptors}} class OnDemandParameterInfo extends OnDemandMemberInfo{constructor(t,n,e,r){super(t),this.key=n,this.index=e, this.parent=r}addAttribute(t){this.key===D?g(t,this.target,this.index):d(t,this.target,this.key,this.index)} getAnnotation(){const t=this.parent.annotation;return t&&t.parameters&&t.parameters.get(this.index)}getName(){ return this.index.toString()}getKind(){let t=MemberKinds.Parameter ;return this.target===this.declaringType&&(t|=MemberKinds.Static),"constructor"===this.key&&(t|=MemberKinds.Class),t} getType(){const t=this.parent.parameterTypes;if(Array.isArray(t))return t[this.index]}} class OnDemandPropertyInfo extends OnDemandMemberInfo{constructor(t,n,e){super(t),this.key=n,this.parent=e, this.parameters=new Map}getAnnotation(){if(this.key===D)return w(this.target);const t=y(this.target) ;return t&&t.properties&&t.properties.get(this.key)}getName(){return this.key.toString()}get descriptor(){ const t=this.annotation;return t&&t.descriptor}getKind(){ return this.target===this.declaringType?MemberKinds.StaticProperty:MemberKinds.Property}getType(){ return this.hasOwnMetadata(R)?this.getOwnMetadata(R):this.getOwnMetadata("design:type")}hasInterceptor(){ const t=this.annotation;if(!t)return!1;if(this.ownInterceptors)return!0;const n=t.parameters ;if(n)for(const t of n.keys())if(this.parameter(t).ownInterceptors)return!0;return!1}get intercepted(){ return k(this,"intercepted",(()=>this.hasInterceptor()))}parameter(t){let n=this.parameters.get(t) ;return n||(n=new OnDemandParameterInfo(this.target,this.key,t,this),this.parameters.set(t,n)),n}hasParameter(){ const t=this.annotation;return!(!t||!t.parameters)}getParameter(t){const n=this.annotation ;if(n&&n.parameters&&n.parameters.has(t))return this.parameter(t)}getParameterTypes(){ return this.getOwnMetadata("design:paramtypes")}get parameterTypes(){ return A(this,"parameterTypes",this.getParameterTypes())}getParameters(){ const t=new Array,n=this.annotation,e=n&&n.parameters;if(e)for(const n of e.keys())t.unshift(this.parameter(n));return t }addAttribute(t){this.key===D?m(t,this.target):l(t,this.target,this.key)}hasOwnMetadata(t){const n=this.annotation ;return!(!n||!n.m)&&n.m.has(t)}getOwnMetadata(t){const n=this.annotation ;return n&&n.m?n.m.get(t):Reflect.getOwnMetadata?Reflect.getOwnMetadata(t,this.declaringType.prototype,this.key):void 0} }class Agents{static get v1(){return O("Agents",this,"v1",(()=>new WeakMap))}}function x(t){return Agents.v1.has(t)} class TypeInfos{static get v1(){return O("TypeInfos",this,"v1",(()=>new WeakMap))}} class OnDemandTypeInfo extends OnDemandPropertyInfo{constructor(t){super(t,D),this.properties=new Map}static find(t){ const n=TypeInfos.v1.get(t);if(n)return n;const e=new OnDemandTypeInfo(t);return TypeInfos.v1.set(t,e),e}get static(){ return OnDemandTypeInfo.find(this.declaringType)}get prototype(){ return A(this,"prototype",OnDemandTypeInfo.find(this.declaringType.prototype))}getType(){return this.declaringType} getName(){return this.declaringType.name}getKind(){ return this.target===this.declaringType?MemberKinds.StaticClass:MemberKinds.Class}getBase(){ const t=Reflect.getPrototypeOf(this.target);let n ;return n=t?t===Function.prototype||t===Object.prototype||x(t)?null:OnDemandTypeInfo.find(t):null,n}getTypes(){ const t=[];let n=this;do{t.unshift(n),n=n.base}while(n);return t}getAnnotation(){return w(this.target)} getTypeAnnotation(){return y(this.target)}get annotation(){return A(this,"annotation",this.getAnnotation())} get typeAnnotation(){return A(this,"typeAnnotation",this.getTypeAnnotation())}get version(){const t=this.typeAnnotation ;return t?t.v:0}get descriptor(){return Reflect.getOwnPropertyDescriptor(this.declaringType.prototype,this.key)} get base(){return A(this,"base",this.getBase())}get types(){return A(this,"types",this.getTypes())}property(t){ let n=this.properties.get(t);return n||(n=new OnDemandPropertyInfo(this.target,t,this),this.properties.set(t,n)),n} hasOwnProperties(){const t=this.typeAnnotation;return void 0!==t&&void 0!==t.properties}getOwnProperty(t){ const n=this.typeAnnotation;if(n&&n.properties&&n.properties.has(t))return this.property(t)}getProperty(t){ const n=function(t,n){const e=f.add(t),r=Reflect.get(e.prototype,n);if(r)return r}(this.target,t) ;if(n)return n.target===this.target?this.getOwnProperty(t):OnDemandTypeInfo.find(n.target).getOwnProperty(t)} getOwnProperties(){const t=new Array,n=this.typeAnnotation ;if(n&&n.properties)for(const e of n.properties.keys())t.push(this.property(e));return t}findOwnProperties(t,n){ const e=new Array,r=this.typeAnnotation;if(r&&r.properties)for(const o of r.properties.keys()){const r=this.property(o) ;t(r,n)&&e.push(r)}return e}findProperties(t,n){const e=new Map;for(const r of this.types){ const o=r.findOwnProperties(t,n);o.length&&e.set(r,o)}return e}findTypes(t,n){if(!t)return this.types.slice(0) ;const e=new Array;for(const r of this.types)t(r,n)&&e.push(r);return e}addAttribute(t){m(t,this.target)}}class Types{ static get v1(){return O("Types",this,"v1",(()=>new WeakMap))}}function P(t,n){Types.v1.set(t,n), Types.v1.set(t.prototype,n.prototype)}function C(t){return Types.v1.get(t)}class ClassTypeInvocation{constructor(t,n){ this.target=t,this.design=n}invoke(t,n){return Reflect.construct(this.target,t,n)}}class OnDemandInterceptorInvocation{ constructor(t,n){this.next=t,this.attribute=n}get design(){return this.next.design}invoke(t,n){ const e=this.interceptor||(this.interceptor=function(t){const n=CustomInterceptors.v1.get(t.constructor) ;if(n)return Reflect.construct(n[0],[t,n[1]]);const e=Reflect.get(t,"interceptor") ;return e&&"object"==typeof e&&"function"==typeof e.intercept?e:void 0}(this.attribute)) ;if(e)return e.intercept(this.next,t,n) ;const r=this.next.invoke(t,n),o=Reflect.getOwnPropertyDescriptor(this.next,T),s=o?o.value:this.next.invoke.bind(this.next) ;return b(this,T,{value:s}),r}}class OnDemandInterceptorFactory{static addInterceptors(t,n){ if(n)for(const e of n)t=new OnDemandInterceptorInvocation(t,e);return t}static addInterceptor(t,n){ return new OnDemandInterceptorInvocation(t,n)}}class MethodParameterInvocation{constructor(t){this.design=t}invoke(t,n){ return t[this.design.index]}}class OnDemandParameterInterceptor{constructor(t){this.design=t}get interceptor(){ if(this.invocations)return this}get invocations(){const t=new Map;for(const n of this.design.getParameters()){ const e=n.index,r=n.ownInterceptors;if(r){const o=new MethodParameterInvocation(n) ;t.set(e,OnDemandInterceptorFactory.addInterceptors(o,r))}}return A(this,"invocations",t.size?t:void 0)} intercept(t,n,e){const r=Array.prototype.slice.call(n,0);for(const[t,o]of this.invocations.entries())r[t]=o.invoke(n,e) ;return t.invoke(r,e)}}class GetterSetterInvocation{constructor(t,n){this.design=t,this.cache=n}invoke(t,n){ if(null==n)throw new AgentFrameworkError("InvalidReceiver");return t.length?(this.cache.set(n,t[0]), t[0]):this.cache.get(n)}}class MethodInvocation{constructor(t,n){this.target=t,this.design=n}invoke(t,n){ return Reflect.apply(this.target,n,t)}}class AgentTypeInvocation{constructor(t,n){this.target=t,this.design=n} invoke([t],n){const e=b(class extends n{},"name",{value:`${t}$`});return P(e,this.target),e}} class OnDemandInvocationFactory{static createAgentInvocation(t,n,e){let r=new AgentTypeInvocation(t,n) ;r=OnDemandInterceptorFactory.addInterceptor(r,e);const o=n.property(D) ;return o.version&&(r=OnDemandInterceptorFactory.addInterceptors(r,o.ownInterceptors)),r} static createConstructorInvocation(t,n,e){let r=new ClassTypeInvocation(t,n) ;return e.hasParameter()&&(r=OnDemandInterceptorFactory.addInterceptor(r,new OnDemandParameterInterceptor(e))), r=OnDemandInterceptorFactory.addInterceptors(r,e.ownInterceptors),{invocation:r,version:e.version}} static createFieldInvocation(t,n){let e=new GetterSetterInvocation(t,n) ;return OnDemandInterceptorFactory.addInterceptors(e,t.ownInterceptors)}static createPropertyInvocation(t,n){ let e=new MethodInvocation(t,n) ;return n.hasParameter()&&(e=OnDemandInterceptorFactory.addInterceptor(e,new OnDemandParameterInterceptor(n))), OnDemandInterceptorFactory.addInterceptors(e,n.ownInterceptors)}}class OnDemandAgentCompiler{static makeField(t,n){ const e=new WeakMap,r={configurable:!0,get:function(){const o=OnDemandInvocationFactory.createFieldInvocation(t,e) ;return r.get=function(){return o.invoke([],this)},r.set=function(){return o.invoke(arguments,this)}, b(n,o.design.key,r),o.invoke([],this)},set:function(){const o=OnDemandInvocationFactory.createFieldInvocation(t,e) ;return r.get=function(){return o.invoke([],this)},r.set=function(){return o.invoke(arguments,this)}, b(n,o.design.key,r),o.invoke(arguments,this)}};return r}static makeProperty(t,n,e){const r=t.key;let o=Object.create(n) ;o.configurable=!0;const s=n.value,i=n.get,c=n.set;return"function"==typeof i?"function"==typeof c?(o.get=function(){ const n=OnDemandInvocationFactory.createPropertyInvocation(i,t);o.get=function(){return n.invoke([],this)} ;const s=OnDemandInvocationFactory.createPropertyInvocation(c,t);return o.set=function(){s.invoke(arguments,this)}, b(e,r,o),n.invoke([],this)},o.set=function(){const n=OnDemandInvocationFactory.createPropertyInvocation(i,t) ;o.get=function(){return n.invoke([],this)};const s=OnDemandInvocationFactory.createPropertyInvocation(c,t) ;return o.set=function(){s.invoke(arguments,this)},b(e,r,o),s.invoke(arguments,this)}):o.get=function(){ const n=OnDemandInvocationFactory.createPropertyInvocation(i,t);return o.get=function(){return n.invoke([],this)}, b(e,r,o),n.invoke([],this)}:"function"==typeof c?o.set=function(){ const n=OnDemandInvocationFactory.createPropertyInvocation(c,t);return o.set=function(){return n.invoke(arguments,this) },b(e,r,o),n.invoke(arguments,this)}:"function"==typeof s?o.value=function(){ let n=OnDemandInvocationFactory.createPropertyInvocation(s,t);return o.value=function(){return n.invoke(arguments,this) },b(e,r,o),n.invoke(arguments,this)}:o=this.makeField(t,e),o}}class ClassConstructors{static get v1(){ return O("ClassConstructors",this,"v1",(()=>new WeakMap))}}class ClassMembers{static get v1(){ return O("ClassMembers",this,"v1",(()=>new WeakMap))}}class AgentAttribute{get interceptor(){return this} intercept(t,n,e){const[,r,o]=n;if(o.version){const s=o.target=Reflect.construct(r,[e,o]);return P(s,e), o.receiver=t.invoke(n,s)}return o.receiver=t.invoke(n,e)}construct(t,n,e){const r=this.target,o=this.type,s=o.version ;if(s){const n=ClassMembers.v1.get(r);if(!n||n.version!==s){ const i=n&&n.members||new Map,c=i.size?o.findOwnProperties((t=>t.intercepted&&i.get(t.key)!==t.version)):o.findOwnProperties((t=>t.intercepted)) ;if(c.length){const n=function(t,n){const e=t.prototype;let r=n.prototype;const o=[] ;for(;r;)if(o.unshift(r.constructor),r=Reflect.getPrototypeOf(r),r===e)return o;return[]}(this.receiver,e) ;!function(t,n,e,r,o){for(const s of r){if(t.set(s.key,s.version),o&&Reflect.getOwnPropertyDescriptor(e,s.key)){ Reflect.deleteProperty(o,s.key);continue}const r=Reflect.getOwnPropertyDescriptor(n,s.key);let i ;i=r?OnDemandAgentCompiler.makeProperty(s,r,o||e):OnDemandAgentCompiler.makeField(s,o||e), Reflect.defineProperty(e,s.key,i)}}(i,t.prototype,this.receiver.prototype,c,n[0]&&n[0].prototype)} ClassMembers.v1.set(r,{version:s,members:i})}}const i=this.property,c=i.version;if(c){ let o,s=ClassConstructors.v1.get(r) ;s&&s.version===c||(s=OnDemandInvocationFactory.createConstructorInvocation(t,this.type,i), ClassConstructors.v1.set(r,s)),o=s.invocation;const u=o.invoke(n,e) ;if(null===u||"object"!=typeof u)throw new AgentFrameworkError("ConstructorReturnNonObject");return u} return Reflect.construct(t,n,e)}}function K(n,e,r){const o=Object.create(e||Reflect.construct(AgentAttribute,[n])) ;if(!t(o,n))throw new AgentFrameworkError("NoCreateAgentPermission") ;const s=C(n)||n,i=OnDemandTypeInfo.find(s),c=o.type=i.prototype,u=o.property=c.property(D) ;o.version=c.version+u.version+(r||0) ;const a=OnDemandInvocationFactory.createAgentInvocation(s,i,o).invoke([s.name,Proxy,o],s);return function(t,n){ Agents.v1.set(n,t),Agents.v1.set(n.prototype,t.prototype)}(s,a),a}class Singletons{static get v1(){ return O("Singletons",this,"v1",(()=>new WeakMap))}}class SingletonAttribute{constructor(t){this.type=t} get interceptor(){return this}intercept(t,n,e){ if(n.length)throw new AgentFrameworkError("NotAllowModifySingletonVariable");const r=t.invoke(n,e) ;if(void 0!==r)return r;const o=this.type,s=t.design&&t.design.type,i=o||s ;if(!i)throw new AgentFrameworkError("UnknownSingletonType") ;const c=o&&Singletons.v1.get(o.prototype)||s&&Singletons.v1.get(s.prototype);if(void 0===c){let r;r=x(i)?i:K(i) ;const o=Reflect.construct(r,n);return Singletons.v1.set(i.prototype,o),t.invoke([o],e)}return t.invoke([c],e)}} class TransitAttribute{constructor(t){this.type=t}get interceptor(){return this}intercept(t,n,e){ if(n.length)throw new AgentFrameworkError("NotAllowModifyTransitVariable");const r=t.invoke(n,e);if(void 0!==r)return r ;const o=this.type,s=t.design&&t.design.type,i=o||s;if(!i)throw new AgentFrameworkError("UnknownTransitType") ;const c=K(i),u=Reflect.construct(c,n);return t.invoke([u],e)}}const S=Symbol.for("AgentFramework.Initializer") ;class InitializerAttribute{constructor(t){this.key=t}get interceptor(){return this}intercept(t,n,e){ const r=t.invoke(n,e),o=Reflect.get(r,this.key);if(o){ if("function"!=typeof o)throw new AgentFrameworkError("InitializerIsNotFunction");Reflect.apply(o,r,n)}return r}} class StaticInitializerAttribute{constructor(t){this.key=t}get interceptor(){return this}intercept(t,n,e){ const r=t.design.declaringType,o=Reflect.get(r,this.key,e);if(o){ if("function"!=typeof o)throw new AgentFrameworkError("ClassInitializerIsNotFunction") ;return Reflect.apply(o,r,arguments)}return t.invoke(n,e)}}exports.AddAttributeToConstructor=m, exports.AddAttributeToConstructorParameter=g,exports.AddAttributeToProperty=l,exports.AddAttributeToPropertyParameter=d, exports.AgentFrameworkError=AgentFrameworkError,exports.CreateAgent=function(t){return K(t)}, exports.GetAgentType=function(t){return Agents.v1.get(t)},exports.GetCustomInterceptor=function(t){ return CustomInterceptors.v1.get(t)},exports.Initializer=S,exports.IsAgent=x,exports.MemberKinds=MemberKinds, exports.Reflector=function(t){if("function"==typeof t)return OnDemandTypeInfo.find(C(t.prototype)||t.prototype) ;if(null==t)throw new AgentFrameworkError("NotSupported: Reflector(null) is not supported");if("object"==typeof t){ if(Reflect.getOwnPropertyDescriptor(t,D))return OnDemandTypeInfo.find(C(t)||t) ;throw new AgentFrameworkError(`NotSupported: Reflector(${t.constructor.name} {}) is not supported`)} throw new AgentFrameworkError(`NotSupported: Reflector(${typeof t}) is not supported`)}, exports.RemoveCustomInterceptor=function(t){CustomInterceptors.v1.delete(t) },exports.SetCustomInterceptor=function(t,n,e){CustomInterceptors.v1.set(t,[n,e])},exports.__agent=I, exports.__decorate=function(t,n,e,r){null===r&&(r=Reflect.getOwnPropertyDescriptor(n,e));let o=r ;for(let s=t.length-1;s>=0;s--)o=t[s](n,e,o||r);o&&Reflect.defineProperty(n,e,o)},exports.__metadata=function(t,e){ return function(r,o,s){let i;i=o?n(f.add(r),o,s):u(f.add(r.prototype)),c(i,t,e)}},exports.__param=function(t,n){ return function(e,r){n(e,r,t)}},exports.agent=function(){return K},exports.decorateAgent=function(n){return e=>{ t(n,e)&&m(n,e)}},exports.decorateClass=function(n){return e=>{t(n,e.prototype)&&m(n,e.prototype)}}, exports.decorateMember=function(n){return(e,r,o)=>{t(n,e,r,o)&&l(n,e,r,o)}},exports.decorateParameter=function(n){ return(e,r,o)=>{t(n,e,r,o)&&(null!=r?d(n,e,r,o):g(n,e.prototype,o))}},exports.decorateVariable=v, exports.initializable=function(t){return n=>{m(new InitializerAttribute(t||S),n.prototype), m(new StaticInitializerAttribute(t||S),n.prototype)}},exports.singleton=function(t){return v(new SingletonAttribute(t)) },exports.transit=function(t){return v(new TransitAttribute(t))};