@lensmcp/nest-instrumentation 1.25.27 → 1.25.29

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/lib/instrument.js CHANGED
@@ -1 +1 @@
1
- "use strict";var Q=Object.defineProperty;var m=(e,r)=>Q(e,"name",{value:r,configurable:!0});var V=Object.defineProperty,l=m((e,r)=>V(e,"name",{value:r,configurable:!0}),"i");import{fingerprint as b,ulid as w}from"@lensmcp/core";import{redactText as O}from"@lensmcp/core/redact";import{captureFor as z,capturedValue as R}from"./capture.js";import{currentLensmcpContext as H,currentSpanId as J,LENSMCP_SPAN_STORAGE as X}from"./context.js";import{activeOptions as K}from"./state.js";import{performance as T}from"node:perf_hooks";export const LENSMCP_TRACED=Symbol.for("@lensmcp/nest-instrumentation/traced"),LENSMCP_IGNORE=Symbol.for("@lensmcp/nest-instrumentation/ignore");const h=300;function A(e){if(e instanceof Error){const d=e.code,p=O(e.message??"");return{name:e.name||e.constructor?.name||"Error",...p?{message:p.length>h?`${p.slice(0,h)}\u2026`:p}:{},...typeof d=="string"&&d.length<=64?{code:d}:{}}}const r=typeof e=="string"?O(e):void 0;return{name:e==null?"nothing":typeof e=="object"?"non-Error object":`non-Error ${typeof e}`,...r?{message:r.slice(0,h)}:{}}}m(A,"J"),l(A,"thrownOf");export function LensmcpIgnore(){return((e,r)=>{if(r===void 0)e[LENSMCP_IGNORE]=!0;else{const d=e[r];typeof d=="function"&&(d[LENSMCP_IGNORE]=!0)}})}m(LensmcpIgnore,"LensmcpIgnore"),l(LensmcpIgnore,"LensmcpIgnore");export function isTraced(e){return typeof e=="function"&&!!e[LENSMCP_TRACED]}m(isTraced,"isTraced"),l(isTraced,"isTraced");export function isIgnored(e){return!!e&&(typeof e=="function"||typeof e=="object")&&!!e[LENSMCP_IGNORE]}m(isIgnored,"isIgnored"),l(isIgnored,"isIgnored");export function traceWrap(e,r,d={}){if(isTraced(e))return e;const p=d.db??!1,x=l(function(...I){let a;try{a=K()}catch{return e.apply(this,I)}if(!a.trace.services)return e.apply(this,I);const c=Date.now();let D=c,E=0;const t=H(),g=w(),v=J(),P=t?.dbCallCount??0,N=t?.redisCallCount??0,_=t?.externalCallCount??0,B=t?.loopDbCalls??0,G=t?.loopRedisCalls??0,W=t?.loopExternalCalls??0,f=d.capture??z(r),q=f==="args"||f==="both"?R(I):void 0,M=l((n,o,C)=>{const s=Date.now()-c,i={id:w(),sessionId:a.sessionId,timestamp:Date.now(),source:"nestjs",category:"backend",severity:n==="error"?"error":"info",context:{sessionId:a.sessionId,flowId:t?.flowId,requestId:t?.requestId,...t?.runId?{runId:t.runId}:{}},fingerprint:b({kind:"method-call",identity:r}),title:`${r} (${s}ms)${n==="error"?" \u2717":""}`,message:o instanceof Error?o.message:void 0,raw:{kind:"span",span:{name:r,spanId:g,...v?{parentSpanId:v}:{},flowId:t?.flowId,requestId:t?.requestId,startTime:c,endTime:Date.now(),durationMs:s,syncStartedAt:D,syncDurationMs:E,status:n,outcome:n==="error"?"threw":"returned",...n==="error"?{error:A(o)}:{},...q!==void 0?{args:q}:{},...n==="ok"&&(f==="result"||f==="both")?{result:R(C)}:{}}}};a.emit(i)},"emitSpan"),S=l(()=>{t&&(t.dbCallCount=(t.dbCallCount??0)+1);const n=Date.now();a.emit({id:w(),sessionId:a.sessionId,timestamp:Date.now(),source:"db",category:"db",severity:"info",context:{sessionId:a.sessionId,flowId:t?.flowId,requestId:t?.requestId,...t?.runId?{runId:t.runId}:{}},fingerprint:b({kind:"db-query",identity:r}),title:`query ${r}`,raw:{kind:"db-query",query:{signature:r},startedAt:c,durationMs:n-c,span:{parentSpanId:g}}})},"emitDbQuery"),k=l(()=>{if(p||!t)return;const n=(t.dbCallCount??0)-P,o=(t.redisCallCount??0)-N,C=(t.externalCallCount??0)-_,s=Math.max(0,n-((t.loopDbCalls??0)-B)),i=Math.max(0,o-((t.loopRedisCalls??0)-G)),u=Math.max(0,C-((t.loopExternalCalls??0)-W));if(s<3&&i<3&&u<3)return;const F=Date.now()-c,y=[];s>=3&&y.push(`${s} DB calls`),i>=3&&y.push(`${i} redis calls`),u>=3&&y.push(`${u} external calls`),s>=3&&(t.loopDbCalls=(t.loopDbCalls??0)+s),i>=3&&(t.loopRedisCalls=(t.loopRedisCalls??0)+i),u>=3&&(t.loopExternalCalls=(t.loopExternalCalls??0)+u);const j=n-s+(o-i)+(C-u);a.emit({id:w(),sessionId:a.sessionId,timestamp:Date.now(),source:"nestjs",category:"backend",severity:"warning",context:{sessionId:a.sessionId,flowId:t.flowId,requestId:t.requestId,...t.runId?{runId:t.runId}:{}},fingerprint:b({kind:"loop",identity:r}),title:`loop in ${r} (${y.join(", ")})`,raw:{kind:"loop",loop:{iterations:Math.max(s,i,u),durationMs:F,startedAt:c,dbCallsInsideLoop:s,redisCallsInsideLoop:i,externalCallsInsideLoop:u,awaitedOperationsInsideLoop:s+i+u,...j>0?{reportedBeneath:j}:{}}}})},"emitLoopIfNeeded"),L=l(n=>{p&&S(),M("ok",void 0,n),k()},"onOk"),$=l(n=>{p&&S(),M("error",n),k()},"onErr");try{const n=X.run(g,()=>{D=Date.now();const o=T.now();try{return e.apply(this,I)}finally{E=Math.round((T.now()-o)*100)/100}});return n instanceof Promise?n.then(o=>(L(o),o),o=>{throw $(o),o}):(L(n),n)}catch(n){throw $(n),n}},"wrapped");return x[LENSMCP_TRACED]=!0,x}m(traceWrap,"traceWrap"),l(traceWrap,"traceWrap");
1
+ "use strict";var Q=Object.defineProperty;var m=(t,r)=>Q(t,"name",{value:r,configurable:!0});var V=Object.defineProperty,l=m((t,r)=>V(t,"name",{value:r,configurable:!0}),"l");import{fingerprint as b,ulid as w}from"@lensmcp/core";import{redactText as $}from"@lensmcp/core/redact";import{captureFor as z,capturedValue as O}from"./capture.js";import{currentLensmcpContext as H,currentSpanId as X,LENSMCP_SPAN_STORAGE as J}from"./context.js";import{activeOptions as K}from"./state.js";import{performance as R}from"node:perf_hooks";export const LENSMCP_TRACED=Symbol.for("@lensmcp/nest-instrumentation/traced"),LENSMCP_IGNORE=Symbol.for("@lensmcp/nest-instrumentation/ignore");const h=300;function T(t){if(t instanceof Error){const d=t.code,c=$(t.message??"");return{name:t.name||t.constructor?.name||"Error",...c?{message:c.length>h?`${c.slice(0,h)}\u2026`:c}:{},...typeof d=="string"&&d.length<=64?{code:d}:{}}}const r=typeof t=="string"?$(t):void 0;return{name:t==null?"nothing":typeof t=="object"?"non-Error object":`non-Error ${typeof t}`,...r?{message:r.slice(0,h)}:{}}}m(T,"z"),l(T,"thrownOf");export function LensmcpIgnore(){return((t,r)=>{if(r===void 0)t[LENSMCP_IGNORE]=!0;else{const d=t[r];typeof d=="function"&&(d[LENSMCP_IGNORE]=!0)}})}m(LensmcpIgnore,"LensmcpIgnore"),l(LensmcpIgnore,"LensmcpIgnore");export function isTraced(t){return typeof t=="function"&&!!t[LENSMCP_TRACED]}m(isTraced,"isTraced"),l(isTraced,"isTraced");export function isIgnored(t){return!!t&&(typeof t=="function"||typeof t=="object")&&!!t[LENSMCP_IGNORE]}m(isIgnored,"isIgnored"),l(isIgnored,"isIgnored");export function traceWrap(t,r,d={}){if(isTraced(t))return t;const c=d.db??!1,x=l(function(...I){let n;try{n=K()}catch{return t.apply(this,I)}if(!n.trace.services)return t.apply(this,I);const u=Date.now();let D=u,j=0;const e=H(),g=w(),E=X(),A=e?.dbCallCount??0,P=e?.redisCallCount??0,_=e?.externalCallCount??0,B=e?.loopDbCalls??0,G=e?.loopRedisCalls??0,W=e?.loopExternalCalls??0,f=d.capture??z(r),v=f==="args"||f==="both"?O(I):void 0,q=l((o,s,C)=>{const a=Date.now()-u,i={id:w(),sessionId:n.sessionId,timestamp:Date.now(),source:"nestjs",category:"backend",severity:o==="error"?"error":"info",context:{sessionId:n.sessionId,flowId:e?.flowId,requestId:e?.requestId,...e?.runId?{runId:e.runId}:{}},fingerprint:b({kind:"method-call",identity:r}),title:`${r} (${a}ms)${o==="error"?" \u2717":""}`,message:s instanceof Error?s.message:void 0,raw:{kind:"span",...n.projectName?{project:n.projectName}:{},span:{name:r,spanId:g,...E?{parentSpanId:E}:{},flowId:e?.flowId,requestId:e?.requestId,startTime:u,endTime:Date.now(),durationMs:a,syncStartedAt:D,syncDurationMs:j,status:o,outcome:o==="error"?"threw":"returned",...o==="error"?{error:T(s)}:{},...v!==void 0?{args:v}:{},...o==="ok"&&(f==="result"||f==="both")?{result:O(C)}:{}}}};n.emit(i)},"emitSpan"),M=l(()=>{e&&(e.dbCallCount=(e.dbCallCount??0)+1);const o=Date.now();n.emit({id:w(),sessionId:n.sessionId,timestamp:Date.now(),source:"db",category:"db",severity:"info",context:{sessionId:n.sessionId,flowId:e?.flowId,requestId:e?.requestId,...e?.runId?{runId:e.runId}:{}},fingerprint:b({kind:"db-query",identity:r}),title:`query ${r}`,raw:{kind:"db-query",...n.projectName?{project:n.projectName}:{},query:{signature:r},startedAt:u,durationMs:o-u,span:{parentSpanId:g}}})},"emitDbQuery"),N=l(()=>{if(c||!e)return;const o=(e.dbCallCount??0)-A,s=(e.redisCallCount??0)-P,C=(e.externalCallCount??0)-_,a=Math.max(0,o-((e.loopDbCalls??0)-B)),i=Math.max(0,s-((e.loopRedisCalls??0)-G)),p=Math.max(0,C-((e.loopExternalCalls??0)-W));if(a<3&&i<3&&p<3)return;const F=Date.now()-u,y=[];a>=3&&y.push(`${a} DB calls`),i>=3&&y.push(`${i} redis calls`),p>=3&&y.push(`${p} external calls`),a>=3&&(e.loopDbCalls=(e.loopDbCalls??0)+a),i>=3&&(e.loopRedisCalls=(e.loopRedisCalls??0)+i),p>=3&&(e.loopExternalCalls=(e.loopExternalCalls??0)+p);const L=o-a+(s-i)+(C-p);n.emit({id:w(),sessionId:n.sessionId,timestamp:Date.now(),source:"nestjs",category:"backend",severity:"warning",context:{sessionId:n.sessionId,flowId:e.flowId,requestId:e.requestId,...e.runId?{runId:e.runId}:{}},fingerprint:b({kind:"loop",identity:r}),title:`loop in ${r} (${y.join(", ")})`,raw:{kind:"loop",...n.projectName?{project:n.projectName}:{},loop:{iterations:Math.max(a,i,p),durationMs:F,startedAt:u,dbCallsInsideLoop:a,redisCallsInsideLoop:i,externalCallsInsideLoop:p,awaitedOperationsInsideLoop:a+i+p,...L>0?{reportedBeneath:L}:{}}}})},"emitLoopIfNeeded"),S=l(o=>{c&&M(),q("ok",void 0,o),N()},"onOk"),k=l(o=>{c&&M(),q("error",o),N()},"onErr");try{const o=J.run(g,()=>{D=Date.now();const s=R.now();try{return t.apply(this,I)}finally{j=Math.round((R.now()-s)*100)/100}});return o instanceof Promise?o.then(s=>(S(s),s),s=>{throw k(s),s}):(S(o),o)}catch(o){throw k(o),o}},"wrapped");return x[LENSMCP_TRACED]=!0,x}m(traceWrap,"traceWrap"),l(traceWrap,"traceWrap");
@@ -1 +1 @@
1
- "use strict";var N=Object.defineProperty;var f=(e,t)=>N(e,"name",{value:t,configurable:!0});var T=Object.defineProperty,u=f((e,t)=>T(e,"name",{value:t,configurable:!0}),"l");import{__decorate as k,__metadata as D}from"tslib";import{Injectable as L}from"@nestjs/common";import{ModuleRef as C}from"@nestjs/core";import{fingerprint as _,ulid as B}from"@lensmcp/core";import{trackContainer as Q}from"@lensmcp/memory-tracker";import{activeOptions as g,currentGeneration as O}from"./state.js";import{readTraceProvider as G}from"./trace-provider.js";import{traceWrap as S,isTraced as w,isIgnored as v}from"./instrument.js";const P=new Set(["constructor","onModuleInit","onApplicationBootstrap","onModuleDestroy","beforeApplicationShutdown","onApplicationShutdown"]),U={DataSource:new Set(["findMetadata","getMetadata","hasMetadata","getRepository","getTreeRepository","getMongoRepository","createQueryBuilder","createEntityManager","createQueryRunner","defaultReplicationModeForReads"]),EntityManager:new Set(["getRepository","getTreeRepository","getCustomRepository","createQueryBuilder"]),Reflector:new Set(["get","getAll","getAllAndOverride","getAllAndMerge"])};function h(e,t){let o=!0;try{o=g().trace.suppressNoiseMethods}catch{}return o?U[e]?.has(t)??!1:!1}f(h,"$"),u(h,"isNoiseMethod");const b=/^(_|Object|String|Number|Array|Promise|Function|RegExp|Map|Set)$/,j=Symbol.for("@lensmcp/nest-instrumentation/proto-wrapped");let I=class{static{f(this,"I")}static{u(this,"LensmcpProviderTracker")}constructor(e){this.moduleRef=e,this.active=new Map}onApplicationBootstrap(){const e=g(),t=O(),o=this.moduleRef.container;if(o?.getModules)for(const[,n]of o.getModules()){const c=n?.controllers;c&&typeof c.forEach=="function"&&c.forEach(r=>{const s=r?.instance;if(!s||typeof s!="object")return;const p=s.constructor,a=p?.name;if(!a||b.test(a))return;const l=`nest:controller:${a}`,d=`${a}#gen${t}#${M(`${a}:${t}`)}`;this.active.set(l,d),e.emit(y({logicalId:l,instanceId:d,generation:t,module:n?.metatype?.name,scope:m(r?.scope),lifecycle:"active"})),e.trace.autoInstrumentMethods&&p&&$(s,p,a)});const i=n?.providers;!i||typeof i.forEach!="function"||i.forEach(r=>{const s=r?.instance;if(m(r?.scope)!=="SINGLETON"){this.trackScopedProvider(r,n,t,e);return}if(!s||typeof s!="object")return;const p=s.constructor,a=p?.name;if(!a||b.test(a))return;const l=`nest:provider:${a}`,d=`${a}#gen${t}#${M(`${a}:${t}`)}`;if(this.active.set(l,d),e.emit(y({logicalId:l,instanceId:d,generation:t,module:n?.metatype?.name,scope:m(r?.scope),lifecycle:"active"})),e.memory.mode!=="off"){const A=G(p);(e.memory.scope==="all"||(A?.memory??!1))&&E(s,d)}e.trace.autoInstrumentMethods&&p&&$(s,p,a)})}}onModuleDestroy(){const e=g(),t=O();for(const[o,n]of this.active)e.emit(y({logicalId:o,instanceId:n,generation:t,lifecycle:"disposed"}))}trackScopedProvider(e,t,o,n){let c;if(typeof e?.metatype=="function"?c=e.metatype:e?.instance&&typeof e.instance=="object"&&(c=e.instance.constructor),typeof c!="function")return;const i=c;if(!i.prototype)return;const r=i.name;if(!r||b.test(r))return;const s=m(e?.scope),p=`nest:provider:${r}`,a=`${r}#gen${o}#${s.toLowerCase()}`;this.active.has(p)||this.active.set(p,a),n.emit(y({logicalId:p,instanceId:a,generation:o,module:t?.metatype?.name,scope:s,lifecycle:"active"})),n.trace.autoInstrumentMethods&&R(i,r)}};I=k([L(),D("design:paramtypes",[C])],I);export{I as LensmcpProviderTracker};function m(e){return e===1||e==="TRANSIENT"?"TRANSIENT":e===2||e==="REQUEST"?"REQUEST":"SINGLETON"}f(m,"g"),u(m,"scopeLabel");function y(e){const t=g();return{id:B(),sessionId:t.sessionId,timestamp:Date.now(),source:"nestjs",category:"backend",severity:"info",context:{sessionId:t.sessionId},fingerprint:_({kind:"nest-provider",identity:e.logicalId}),title:`Nest provider ${e.logicalId} ${e.lifecycle}`,raw:{kind:"singleton-instance",provider:{...e,createdAt:Date.now()}}}}f(y,"h"),u(y,"makeProviderEvent");function M(e){let t=5381;for(let o=0;o<e.length;o++)t=(t<<5)+t+e.charCodeAt(o)|0;return(t>>>0).toString(16).slice(0,6)}f(M,"P"),u(M,"shortHash");function E(e,t){for(const o of Object.keys(e)){const n=e[o];(n instanceof Map||n instanceof Set||Array.isArray(n))&&Q({ownerInstanceId:t,fieldName:o,container:n})}}f(E,"Q"),u(E,"trackProviderContainers");function $(e,t,o){if(v(t))return;const n=Object.getPrototypeOf(e);if(!(!n||n===Object.prototype))for(const c of Object.getOwnPropertyNames(n)){if(P.has(c)||h(o,c))continue;const i=Object.getOwnPropertyDescriptor(n,c);if(!i||typeof i.value!="function"||i.get||i.set)continue;const r=i.value;if(w(r)||v(r))continue;const s=S(r,`${o}.${c}`);try{Object.defineProperty(e,c,{value:s,writable:!0,enumerable:!1,configurable:!0})}catch{}}}f($,"N"),u($,"autoInstrumentProviderMethods");function R(e,t){if(v(e))return;const o=e.prototype;if(!o||o===Object.prototype)return;const n=o;if(n[j])return;const c=[];for(const i of Object.getOwnPropertyNames(o)){if(P.has(i)||h(t,i))continue;const r=Object.getOwnPropertyDescriptor(o,i);if(!r||typeof r.value!="function"||r.get||r.set)continue;const s=r.value;if(w(s)||v(s))continue;const p=S(s,`${t}.${i}`);try{Object.defineProperty(o,i,{value:p,writable:!0,enumerable:!1,configurable:!0}),c.push(i)}catch{}}n[j]=!0,process.env.LENSMCP_DEBUG&&console.error(`[lensmcp] proto-wrapped ${t}: [${c.join(", ")}]`)}f(R,"U"),u(R,"autoInstrumentPrototypeMethods");
1
+ "use strict";var A=Object.defineProperty;var f=(e,t)=>A(e,"name",{value:t,configurable:!0});var T=Object.defineProperty,u=f((e,t)=>T(e,"name",{value:t,configurable:!0}),"l");import{__decorate as k,__metadata as D}from"tslib";import{Injectable as L}from"@nestjs/common";import{ModuleRef as C}from"@nestjs/core";import{fingerprint as _,ulid as B}from"@lensmcp/core";import{trackContainer as Q}from"@lensmcp/memory-tracker";import{activeOptions as g,currentGeneration as j}from"./state.js";import{readTraceProvider as G}from"./trace-provider.js";import{traceWrap as O,isTraced as S,isIgnored as v}from"./instrument.js";const w=new Set(["constructor","onModuleInit","onApplicationBootstrap","onModuleDestroy","beforeApplicationShutdown","onApplicationShutdown"]),U={DataSource:new Set(["findMetadata","getMetadata","hasMetadata","getRepository","getTreeRepository","getMongoRepository","createQueryBuilder","createEntityManager","createQueryRunner","defaultReplicationModeForReads"]),EntityManager:new Set(["getRepository","getTreeRepository","getCustomRepository","createQueryBuilder"]),Reflector:new Set(["get","getAll","getAllAndOverride","getAllAndMerge"])};function h(e,t){let o=!0;try{o=g().trace.suppressNoiseMethods}catch{}return o?U[e]?.has(t)??!1:!1}f(h,"$"),u(h,"isNoiseMethod");const b=/^(_|Object|String|Number|Array|Promise|Function|RegExp|Map|Set)$/,P=Symbol.for("@lensmcp/nest-instrumentation/proto-wrapped");let I=class{static{f(this,"I")}static{u(this,"LensmcpProviderTracker")}constructor(e){this.moduleRef=e,this.active=new Map}onApplicationBootstrap(){const e=g(),t=j(),o=this.moduleRef.container;if(o?.getModules)for(const[,n]of o.getModules()){const i=n?.controllers;i&&typeof i.forEach=="function"&&i.forEach(r=>{const s=r?.instance;if(!s||typeof s!="object")return;const p=s.constructor,a=p?.name;if(!a||b.test(a))return;const l=`nest:controller:${a}`,d=`${a}#gen${t}#${M(`${a}:${t}`)}`;this.active.set(l,d),e.emit(y({logicalId:l,instanceId:d,generation:t,module:n?.metatype?.name,scope:m(r?.scope),lifecycle:"active"})),e.trace.autoInstrumentMethods&&p&&$(s,p,a)});const c=n?.providers;!c||typeof c.forEach!="function"||c.forEach(r=>{const s=r?.instance;if(m(r?.scope)!=="SINGLETON"){this.trackScopedProvider(r,n,t,e);return}if(!s||typeof s!="object")return;const p=s.constructor,a=p?.name;if(!a||b.test(a))return;const l=`nest:provider:${a}`,d=`${a}#gen${t}#${M(`${a}:${t}`)}`;if(this.active.set(l,d),e.emit(y({logicalId:l,instanceId:d,generation:t,module:n?.metatype?.name,scope:m(r?.scope),lifecycle:"active"})),e.memory.mode!=="off"){const R=G(p);(e.memory.scope==="all"||(R?.memory??!1))&&E(s,d)}e.trace.autoInstrumentMethods&&p&&$(s,p,a)})}}onModuleDestroy(){const e=g(),t=j();for(const[o,n]of this.active)e.emit(y({logicalId:o,instanceId:n,generation:t,lifecycle:"disposed"}))}trackScopedProvider(e,t,o,n){let i;if(typeof e?.metatype=="function"?i=e.metatype:e?.instance&&typeof e.instance=="object"&&(i=e.instance.constructor),typeof i!="function")return;const c=i;if(!c.prototype)return;const r=c.name;if(!r||b.test(r))return;const s=m(e?.scope),p=`nest:provider:${r}`,a=`${r}#gen${o}#${s.toLowerCase()}`;this.active.has(p)||this.active.set(p,a),n.emit(y({logicalId:p,instanceId:a,generation:o,module:t?.metatype?.name,scope:s,lifecycle:"active"})),n.trace.autoInstrumentMethods&&N(c,r)}};I=k([L(),D("design:paramtypes",[C])],I);export{I as LensmcpProviderTracker};function m(e){return e===1||e==="TRANSIENT"?"TRANSIENT":e===2||e==="REQUEST"?"REQUEST":"SINGLETON"}f(m,"g"),u(m,"scopeLabel");function y(e){const t=g();return{id:B(),sessionId:t.sessionId,timestamp:Date.now(),source:"nestjs",category:"backend",severity:"info",context:{sessionId:t.sessionId},fingerprint:_({kind:"nest-provider",identity:e.logicalId}),title:`Nest provider ${e.logicalId} ${e.lifecycle}`,raw:{kind:"singleton-instance",...t.projectName?{project:t.projectName}:{},provider:{...e,createdAt:Date.now()}}}}f(y,"h"),u(y,"makeProviderEvent");function M(e){let t=5381;for(let o=0;o<e.length;o++)t=(t<<5)+t+e.charCodeAt(o)|0;return(t>>>0).toString(16).slice(0,6)}f(M,"P"),u(M,"shortHash");function E(e,t){for(const o of Object.keys(e)){const n=e[o];(n instanceof Map||n instanceof Set||Array.isArray(n))&&Q({ownerInstanceId:t,fieldName:o,container:n})}}f(E,"Q"),u(E,"trackProviderContainers");function $(e,t,o){if(v(t))return;const n=Object.getPrototypeOf(e);if(!(!n||n===Object.prototype))for(const i of Object.getOwnPropertyNames(n)){if(w.has(i)||h(o,i))continue;const c=Object.getOwnPropertyDescriptor(n,i);if(!c||typeof c.value!="function"||c.get||c.set)continue;const r=c.value;if(S(r)||v(r))continue;const s=O(r,`${o}.${i}`);try{Object.defineProperty(e,i,{value:s,writable:!0,enumerable:!1,configurable:!0})}catch{}}}f($,"N"),u($,"autoInstrumentProviderMethods");function N(e,t){if(v(e))return;const o=e.prototype;if(!o||o===Object.prototype)return;const n=o;if(n[P])return;const i=[];for(const c of Object.getOwnPropertyNames(o)){if(w.has(c)||h(t,c))continue;const r=Object.getOwnPropertyDescriptor(o,c);if(!r||typeof r.value!="function"||r.get||r.set)continue;const s=r.value;if(S(s)||v(s))continue;const p=O(s,`${t}.${c}`);try{Object.defineProperty(o,c,{value:p,writable:!0,enumerable:!1,configurable:!0}),i.push(c)}catch{}}n[P]=!0,process.env.LENSMCP_DEBUG&&console.error(`[lensmcp] proto-wrapped ${t}: [${i.join(", ")}]`)}f(N,"U"),u(N,"autoInstrumentPrototypeMethods");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensmcp/nest-instrumentation",
3
- "version": "1.25.27",
3
+ "version": "1.25.29",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",
@@ -14,9 +14,9 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@lensmcp/core": "1.25.27",
18
- "@lensmcp/memory-tracker": "1.25.27",
19
- "@lensmcp/protocol-types": "1.25.27",
17
+ "@lensmcp/core": "1.25.29",
18
+ "@lensmcp/memory-tracker": "1.25.29",
19
+ "@lensmcp/protocol-types": "1.25.29",
20
20
  "tslib": "^2.3.0"
21
21
  },
22
22
  "peerDependencies": {