trickle-observe 0.2.131 → 0.2.132
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/express.js +2 -1
- package/dist/fastify.js +1 -1
- package/dist/hono.js +1 -1
- package/dist/koa.js +1 -1
- package/observe-esm-hooks.mjs +2 -0
- package/package.json +1 -1
- package/src/express.ts +2 -1
- package/src/fastify.ts +1 -1
- package/src/hono.ts +1 -1
- package/src/koa.ts +1 -1
package/dist/express.js
CHANGED
|
@@ -100,7 +100,8 @@ function sanitizeSample(value, depth = 3) {
|
|
|
100
100
|
if (t === 'function')
|
|
101
101
|
return `[Function: ${value.name || 'anonymous'}]`;
|
|
102
102
|
if (Array.isArray(value)) {
|
|
103
|
-
|
|
103
|
+
// Preserve full depth for the first element (used for type assertions in test-gen)
|
|
104
|
+
return value.slice(0, 5).map((item, i) => sanitizeSample(item, i === 0 ? depth : depth - 1));
|
|
104
105
|
}
|
|
105
106
|
if (t === 'object') {
|
|
106
107
|
if (value instanceof Date)
|
package/dist/fastify.js
CHANGED
|
@@ -87,7 +87,7 @@ function sanitizeSample(value, depth = 3) {
|
|
|
87
87
|
if (t === 'function')
|
|
88
88
|
return `[Function: ${value.name || 'anonymous'}]`;
|
|
89
89
|
if (Array.isArray(value)) {
|
|
90
|
-
return value.slice(0, 5).map(item => sanitizeSample(item, depth - 1));
|
|
90
|
+
return value.slice(0, 5).map((item, i) => sanitizeSample(item, i === 0 ? depth : depth - 1));
|
|
91
91
|
}
|
|
92
92
|
if (t === 'object') {
|
|
93
93
|
if (value instanceof Date)
|
package/dist/hono.js
CHANGED
|
@@ -97,7 +97,7 @@ function sanitizeSample(value, depth = 3) {
|
|
|
97
97
|
if (t === 'function')
|
|
98
98
|
return `[Function: ${value.name || 'anonymous'}]`;
|
|
99
99
|
if (Array.isArray(value)) {
|
|
100
|
-
return value.slice(0, 5).map(item => sanitizeSample(item, depth - 1));
|
|
100
|
+
return value.slice(0, 5).map((item, i) => sanitizeSample(item, i === 0 ? depth : depth - 1));
|
|
101
101
|
}
|
|
102
102
|
if (t === 'object') {
|
|
103
103
|
if (value instanceof Date)
|
package/dist/koa.js
CHANGED
|
@@ -90,7 +90,7 @@ function sanitizeSample(value, depth = 3) {
|
|
|
90
90
|
if (t === 'function')
|
|
91
91
|
return `[Function: ${value.name || 'anonymous'}]`;
|
|
92
92
|
if (Array.isArray(value)) {
|
|
93
|
-
return value.slice(0, 5).map(item => sanitizeSample(item, depth - 1));
|
|
93
|
+
return value.slice(0, 5).map((item, i) => sanitizeSample(item, i === 0 ? depth : depth - 1));
|
|
94
94
|
}
|
|
95
95
|
if (t === 'object') {
|
|
96
96
|
if (value instanceof Date)
|
package/observe-esm-hooks.mjs
CHANGED
|
@@ -708,6 +708,8 @@ function transformSource(source, url, originalSource) {
|
|
|
708
708
|
`const __rq_express = __cr_express(import.meta.url);`,
|
|
709
709
|
`const __fwExpress = __rq_express('${fiPath}');`,
|
|
710
710
|
`const ${fi.factoryName} = function(...args) { const a = __OrigExpress(...args); try { __fwExpress.${instrumentFn}(a, { environment: process.env.TRICKLE_ENV || 'development' }); } catch(e) {} return a; };`,
|
|
711
|
+
`Object.keys(__OrigExpress).forEach(k => { ${fi.factoryName}[k] = __OrigExpress[k]; });`,
|
|
712
|
+
`Object.setPrototypeOf(${fi.factoryName}, Object.getPrototypeOf(__OrigExpress));`,
|
|
711
713
|
);
|
|
712
714
|
break;
|
|
713
715
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trickle-observe",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.132",
|
|
4
4
|
"description": "Zero-code runtime observability for JavaScript/TypeScript. Auto-instruments Express, Fastify, Koa, Hono, OpenAI, Anthropic, Gemini, MCP. Captures functions, variables, LLM calls, agent workflows.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
package/src/express.ts
CHANGED
|
@@ -72,7 +72,8 @@ function sanitizeSample(value: unknown, depth: number = 3): unknown {
|
|
|
72
72
|
if (t === 'function') return `[Function: ${(value as Function).name || 'anonymous'}]`;
|
|
73
73
|
|
|
74
74
|
if (Array.isArray(value)) {
|
|
75
|
-
|
|
75
|
+
// Preserve full depth for the first element (used for type assertions in test-gen)
|
|
76
|
+
return value.slice(0, 5).map((item, i) => sanitizeSample(item, i === 0 ? depth : depth - 1));
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
if (t === 'object') {
|
package/src/fastify.ts
CHANGED
|
@@ -61,7 +61,7 @@ function sanitizeSample(value: unknown, depth: number = 3): unknown {
|
|
|
61
61
|
if (t === 'function') return `[Function: ${(value as Function).name || 'anonymous'}]`;
|
|
62
62
|
|
|
63
63
|
if (Array.isArray(value)) {
|
|
64
|
-
return value.slice(0, 5).map(item => sanitizeSample(item, depth - 1));
|
|
64
|
+
return value.slice(0, 5).map((item, i) => sanitizeSample(item, i === 0 ? depth : depth - 1));
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
if (t === 'object') {
|
package/src/hono.ts
CHANGED
|
@@ -71,7 +71,7 @@ function sanitizeSample(value: unknown, depth: number = 3): unknown {
|
|
|
71
71
|
if (t === 'function') return `[Function: ${(value as Function).name || 'anonymous'}]`;
|
|
72
72
|
|
|
73
73
|
if (Array.isArray(value)) {
|
|
74
|
-
return value.slice(0, 5).map(item => sanitizeSample(item, depth - 1));
|
|
74
|
+
return value.slice(0, 5).map((item, i) => sanitizeSample(item, i === 0 ? depth : depth - 1));
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
if (t === 'object') {
|
package/src/koa.ts
CHANGED
|
@@ -64,7 +64,7 @@ function sanitizeSample(value: unknown, depth: number = 3): unknown {
|
|
|
64
64
|
if (t === 'function') return `[Function: ${(value as Function).name || 'anonymous'}]`;
|
|
65
65
|
|
|
66
66
|
if (Array.isArray(value)) {
|
|
67
|
-
return value.slice(0, 5).map(item => sanitizeSample(item, depth - 1));
|
|
67
|
+
return value.slice(0, 5).map((item, i) => sanitizeSample(item, i === 0 ? depth : depth - 1));
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
if (t === 'object') {
|