retrace-sdk 0.2.2 → 0.2.3

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.
Files changed (2) hide show
  1. package/dist/recorder.js +9 -2
  2. package/package.json +1 -1
package/dist/recorder.js CHANGED
@@ -95,9 +95,16 @@ export class TraceRecorder {
95
95
  export function record(opts) {
96
96
  const cfg = getConfig();
97
97
  if (!cfg.enabled || Math.random() > cfg.sampleRate) {
98
- // Return a no-op proxy that doesn't require API key or connect
98
+ // Return a no-op that silently swallows all method calls
99
+ const methods = new Set(["start", "end", "startSpan", "endSpan", "addSpan"]);
99
100
  const noop = {};
100
- return new Proxy(noop, { get: (_t, prop) => typeof prop === "string" ? (() => noop) : undefined });
101
+ return new Proxy(noop, {
102
+ get: (_t, prop) => {
103
+ if (typeof prop === "string" && methods.has(prop))
104
+ return () => noop;
105
+ return undefined;
106
+ },
107
+ });
101
108
  }
102
109
  return new TraceRecorder(opts);
103
110
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "retrace-sdk",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "The execution replay engine for AI agents. Record, replay, fork, and share agent executions.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",