@rasputin-ai/node 0.4.1 → 0.5.0-alpha.2

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 (37) hide show
  1. package/README.md +188 -162
  2. package/dist/auto-instrumentation/collect-instrumentation-delta.d.ts +2 -37
  3. package/dist/auto-instrumentation/collect-instrumentation-delta.d.ts.map +1 -1
  4. package/dist/auto-instrumentation/instrument-compiled-esm.d.ts +17 -0
  5. package/dist/auto-instrumentation/instrument-compiled-esm.d.ts.map +1 -0
  6. package/dist/auto-instrumentation/instrumentation-manifest-delta.d.ts +40 -0
  7. package/dist/auto-instrumentation/instrumentation-manifest-delta.d.ts.map +1 -0
  8. package/dist/auto-instrumentation/instrumentation-manifest-registry.d.ts +4 -1
  9. package/dist/auto-instrumentation/instrumentation-manifest-registry.d.ts.map +1 -1
  10. package/dist/auto-instrumentation/transform-source.d.ts +1 -1
  11. package/dist/auto-instrumentation/transform-source.d.ts.map +1 -1
  12. package/dist/auto-instrumentation/warn-production-runtime-transform.d.ts +8 -0
  13. package/dist/auto-instrumentation/warn-production-runtime-transform.d.ts.map +1 -0
  14. package/dist/execution-recorder/automatic-runtime.d.ts +19 -10
  15. package/dist/execution-recorder/automatic-runtime.d.ts.map +1 -1
  16. package/dist/execution-recorder/call-aware-event-buffer.d.ts +17 -3
  17. package/dist/execution-recorder/call-aware-event-buffer.d.ts.map +1 -1
  18. package/dist/execution-recorder/execution-recorder-types.d.ts +19 -0
  19. package/dist/execution-recorder/execution-recorder-types.d.ts.map +1 -1
  20. package/dist/execution-recorder/execution-recorder.d.ts.map +1 -1
  21. package/dist/execution-recorder/function-plan.d.ts +26 -0
  22. package/dist/execution-recorder/function-plan.d.ts.map +1 -0
  23. package/dist/execution-recorder/recorder-memory-budget.d.ts +7 -1
  24. package/dist/execution-recorder/recorder-memory-budget.d.ts.map +1 -1
  25. package/dist/execution-recorder/safe-serialize.d.ts +7 -0
  26. package/dist/execution-recorder/safe-serialize.d.ts.map +1 -1
  27. package/dist/index.js +546 -294
  28. package/dist/instrument/build.d.ts +2 -0
  29. package/dist/instrument/build.d.ts.map +1 -0
  30. package/dist/instrument/build.js +707 -0
  31. package/dist/instrument/bun.js +55 -21
  32. package/dist/instrument/node.js +55 -21
  33. package/dist/rasputin-init.d.ts +5 -5
  34. package/dist/rasputin-init.d.ts.map +1 -1
  35. package/dist/sdk-meta.d.ts +1 -1
  36. package/dist/sdk-meta.d.ts.map +1 -1
  37. package/package.json +10 -2
package/README.md CHANGED
@@ -1,162 +1,188 @@
1
- # Official Rasputin AI SDK for Node and Bun
2
-
3
- Report application errors to Rasputin.
4
-
5
- ## Setup
6
-
7
- Initialize once when your application starts:
8
-
9
- ```ts
10
- import { RasputinInit } from '@rasputin-ai/node';
11
-
12
- export const rasputin = RasputinInit({
13
- projectApiKey: process.env.RASPUTIN_PROJECT_API_KEY!,
14
- release: process.env.RASPUTIN_RELEASE!,
15
- environment: process.env.NODE_ENV ?? 'development',
16
- enabled: ['staging', 'production'].includes(process.env.NODE_ENV ?? 'development'),
17
- });
18
- ```
19
-
20
- Uncaught exceptions and unhandled rejections are reported automatically.
21
-
22
- ## Capture handled errors
23
-
24
- ```ts
25
- try {
26
- await processPayment();
27
- } catch (error) {
28
- rasputin.captureException(error);
29
- }
30
- ```
31
-
32
- ## Configuration
33
-
34
- | Field | Required | Description |
35
- | --- | --- | --- |
36
- | `projectApiKey` | yes | Project API key from the Rasputin dashboard |
37
- | `environment` | yes | Environment such as `production`, `staging`, or `preview` |
38
- | `release` | yes | Git commit SHA for the deployed version |
39
- | `enabled` | no | Enables or disables the SDK; defaults to `true` |
40
- | `logSuccess` | no | Prints a configuration summary when setup succeeds; defaults to `true`. Failures always log. |
41
- | `moduleUrl` | no | `import.meta.url` from the initialization file; helps normalize local stack paths |
42
- | `sourceRoot` | no | Git repository folder for a single-package service, such as `apps/api` |
43
- | `sourceRoots` | no | Package-name to Git-folder mappings for ambiguous monorepos |
44
- | `repoRoot` | no | Local filesystem display root; it does not control instrumentation or Git identity |
45
-
46
- Rasputin normally identifies source from the nearest `package.json` and verifies it against the exact release on the server. Filesystem paths such as `/container` are never used as source identity.
47
-
48
- For deployment checks, call:
49
-
50
- ```ts
51
- const verification = await rasputin.verifyConfiguration();
52
- ```
53
-
54
- `verified` means every instrumented source file maps uniquely to the configured Git release. If a monorepo is ambiguous, set `sourceRoot` or `sourceRoots` using repository-relative folders, never Docker paths.
55
-
56
- Rasputin also prints a configuration summary after the instrumentation manifest is uploaded. Set `logSuccess: false` if you do not want that banner in production logs. Mapping failures still warn.
57
-
58
- ## Shutdown
59
-
60
- Events are sent in the background. Flush before a short-lived process exits:
61
-
62
- ```ts
63
- await rasputin.flush();
64
- ```
65
-
66
- Call `await rasputin.close()` during graceful shutdown when the process stays alive afterward.
67
-
68
- ---
69
-
70
- # Runtime recorder
71
-
72
- Optionally attach the runtime state that led to an error — arguments, return values, and call history from the failing execution.
73
-
74
- ## Automatic instrumentation
75
-
76
- Start your process with the adapter for your runtime so Rasputin can instrument application functions as they load:
77
-
78
- ```json
79
- {
80
- "scripts": {
81
- "start:node": "node --import @rasputin-ai/node/instrument/node dist/app.js",
82
- "start:bun": "bun --preload @rasputin-ai/node/instrument/bun src/app.ts"
83
- }
84
- }
85
- ```
86
-
87
- Runtime state is retained only inside an active execution and attached when that execution throws.
88
-
89
- ## Manual capture
90
-
91
- Wrap each meaningful unit of work — an HTTP request, background job, scheduled task, or worker iteration — in an execution:
92
-
93
- ```ts
94
- await rasputin.execution.run({ kind: 'job', name: 'sync-invoices' }, async () => {
95
- await syncInvoices();
96
- });
97
- ```
98
-
99
- When automatic instrumentation is unavailable, mark individual functions explicitly:
100
-
101
- ```ts
102
- const syncInvoices = rasputin.execution.trace(
103
- 'src/jobs/sync-invoices.ts:syncInvoices',
104
- async () => {
105
- // ...
106
- },
107
- );
108
- ```
109
-
110
- Framework packages such as `@rasputin-ai/elysia` create HTTP executions automatically.
111
-
112
- ## Runtime support
113
-
114
- | Environment | Support |
115
- | --- | --- |
116
- | Bun 1.3.x | Supported for directly loaded JavaScript and TypeScript using `instrument/bun` |
117
- | Node.js 22.15 or newer | Supported for unbundled ESM/CJS JavaScript using `instrument/node`; Node 22 and 24 are the supported LTS lines |
118
- | TypeScript compiled to multiple JavaScript files | Supported on Node; emit adjacent source maps to retain original TypeScript locations |
119
- | Single-file bundles (esbuild, tsup, webpack, Vite SSR, Next.js) | Automatic instrumentation not supported |
120
- | `tsx`, custom Node loader stacks, and Node's native TypeScript execution | Automatic instrumentation not supported |
121
- | Deno and edge runtimes | Not supported |
122
-
123
- Tested on Bun 1.3.13, Node.js 24.19.0. Node.js 22.15.0 is the minimum for automatic instrumentation (synchronous module hooks). Use `execution.run()` and `execution.trace()` when automatic instrumentation is not available.
124
-
125
- ## Recorder configuration
126
-
127
- Defaults work for most apps. Customize to exclude noisy sources, redact fields, or retain less state:
128
-
129
- | Field | Default | Description |
130
- | --- | ---: | --- |
131
- | `enabled` | `true` | Enables runtime-state capture |
132
- | `maxEventsPerExecution` | `500` | Maximum events retained for one execution |
133
- | `maxCapturedCallsPerFunction` | `3` | Detailed successful calls retained before similar calls are summarized |
134
- | `maxActiveMemoryBytes` | `64 MiB` | Maximum recorder memory shared across active executions |
135
- | `maxDepth` | `3` | Maximum captured value depth |
136
- | `maxObjectKeys` | `30` | Maximum properties retained from one object |
137
- | `maxArrayElements` | `20` | Maximum items retained from one array, map, or set |
138
- | `maxStringLength` | `500` | Maximum characters retained from one string |
139
- | `maxSerializedValueBytes` | `8 KiB` | Maximum retained size of one captured value |
140
- | `redactKeys` | `[]` | Additional case-insensitive property names to redact |
141
- | `excludeSources` | `[]` | Source globs or function-name patterns to exclude |
142
-
143
- ```ts
144
- const rasputin = RasputinInit({
145
- // ...required options
146
- executionRecorder: {
147
- excludeSources: ['src/logger/**', 'packages/shared-logger/**'],
148
- redactKeys: ['customerEmail'],
149
- maxEventsPerExecution: 200,
150
- },
151
- });
152
- ```
153
-
154
- Runtime state can include application data. Use `redactKeys` for sensitive fields.
155
-
156
- ## Diagnostics
157
-
158
- ```ts
159
- const { recorder, transport } = rasputin.getStats();
160
- ```
161
-
162
- Counters are local to the current process and reset on restart.
1
+ # Official Rasputin AI SDK for Node and Bun
2
+
3
+ Report application errors to Rasputin.
4
+
5
+ ## Setup
6
+
7
+ Initialize once when your application starts:
8
+
9
+ ```ts
10
+ import { RasputinInit } from '@rasputin-ai/node';
11
+
12
+ export const rasputin = RasputinInit({
13
+ projectApiKey: process.env.RASPUTIN_PROJECT_API_KEY!,
14
+ release: process.env.RASPUTIN_RELEASE!,
15
+ environment: process.env.NODE_ENV ?? 'development',
16
+ enabled: ['staging', 'production'].includes(process.env.NODE_ENV ?? 'development'),
17
+ });
18
+ ```
19
+
20
+ Uncaught exceptions and unhandled rejections are reported automatically.
21
+
22
+ ## Capture handled errors
23
+
24
+ ```ts
25
+ try {
26
+ await processPayment();
27
+ } catch (error) {
28
+ rasputin.captureException(error);
29
+ }
30
+ ```
31
+
32
+ ## Configuration
33
+
34
+ | Field | Required | Description |
35
+ | --- | --- | --- |
36
+ | `projectApiKey` | yes | Project API key from the Rasputin dashboard |
37
+ | `environment` | yes | Environment such as `production`, `staging`, or `preview` |
38
+ | `release` | yes | Git commit SHA for the deployed version |
39
+ | `enabled` | no | Enables or disables the SDK; defaults to `true` |
40
+ | `logSuccess` | no | Prints a configuration summary when setup succeeds; defaults to `true`. Failures always log. |
41
+ | `moduleUrl` | no | `import.meta.url` from the initialization file; helps normalize local stack paths |
42
+ | `sourceRoot` | no | Git repository folder for a single-package service, such as `apps/api` |
43
+ | `sourceRoots` | no | Package-name to Git-folder mappings for ambiguous monorepos |
44
+ | `repoRoot` | no | Local filesystem display root; it does not control instrumentation or Git identity |
45
+
46
+ Rasputin normally identifies source from the nearest `package.json` and verifies it against the exact release on the server. Filesystem paths such as `/container` are never used as source identity.
47
+
48
+ For deployment checks, call:
49
+
50
+ ```ts
51
+ const verification = await rasputin.verifyConfiguration();
52
+ ```
53
+
54
+ `verified` means every instrumented source file maps uniquely to the configured Git release. If a monorepo is ambiguous, set `sourceRoot` or `sourceRoots` using repository-relative folders, never Docker paths.
55
+
56
+ Rasputin also prints a configuration summary after the instrumentation manifest is uploaded. Set `logSuccess: false` if you do not want that banner in production logs. Mapping failures still warn.
57
+
58
+ ## Shutdown
59
+
60
+ Events are sent in the background. Flush before a short-lived process exits:
61
+
62
+ ```ts
63
+ await rasputin.flush();
64
+ ```
65
+
66
+ Call `await rasputin.close()` during graceful shutdown when the process stays alive afterward.
67
+
68
+ ---
69
+
70
+ # Runtime recorder
71
+
72
+ Optionally attach the runtime state that led to an error — arguments, return values, and call history from the failing execution.
73
+
74
+ ## Automatic instrumentation
75
+
76
+ Build-time instrumentation is the production default. Transform compiled unbundled JavaScript after `tsc` so the running process never loads the TypeScript compiler:
77
+
78
+ ```json
79
+ {
80
+ "scripts": {
81
+ "build": "tsc && rasputin-instrument dist",
82
+ "start:node": "node dist/app.js",
83
+ "start:bun": "bun dist/app.js"
84
+ }
85
+ }
86
+ ```
87
+
88
+ Emit adjacent source maps from TypeScript so function identities stay pointed at the original files. The instrumenter writes `.rasputin/instrumentation-manifest.json` next to the output. RasputinInit loads that file automatically, or from `RASPUTIN_INSTRUMENTATION_MANIFEST`.
89
+
90
+ Node `--import` and Bun `--preload` remain compatibility and development fallbacks. They transform application source as it loads, which pulls compiler infrastructure into the process and has materially higher RSS. Do not use those loader measurements in low-overhead comparisons. In `NODE_ENV=production` the loaders print a one-time warning recommending `rasputin-instrument`. Set `RASPUTIN_SUPPRESS_RUNTIME_TRANSFORM_WARNING=1` to hide it.
91
+
92
+ ```json
93
+ {
94
+ "scripts": {
95
+ "start:node": "node --import @rasputin-ai/node/instrument/node dist/app.js",
96
+ "start:bun": "bun --preload @rasputin-ai/node/instrument/bun src/app.ts"
97
+ }
98
+ }
99
+ ```
100
+
101
+ Runtime state is retained only inside an active execution and attached when that execution throws.
102
+
103
+ ## Manual capture
104
+
105
+ Wrap each meaningful unit of work — an HTTP request, background job, scheduled task, or worker iteration — in an execution:
106
+
107
+ ```ts
108
+ await rasputin.execution.run({ kind: 'job', name: 'sync-invoices' }, async () => {
109
+ await syncInvoices();
110
+ });
111
+ ```
112
+
113
+ When automatic instrumentation is unavailable, mark individual functions explicitly:
114
+
115
+ ```ts
116
+ const syncInvoices = rasputin.execution.trace(
117
+ 'src/jobs/sync-invoices.ts:syncInvoices',
118
+ async () => {
119
+ // ...
120
+ },
121
+ );
122
+ ```
123
+
124
+ Framework packages such as `@rasputin-ai/elysia` create HTTP executions automatically.
125
+
126
+ ## Runtime support
127
+
128
+ | Environment | Support |
129
+ | --- | --- |
130
+ | TypeScript compiled to multiple JavaScript files | Preferred: `rasputin-instrument dist` after `tsc`, with adjacent source maps |
131
+ | Bun 1.3.x loading application source directly | Supported using `instrument/bun` as a compatibility fallback |
132
+ | Node.js 22.15 or newer loading unbundled ESM/CJS | Supported using `instrument/node` as a compatibility fallback; Node 22 and 24 are the supported LTS lines |
133
+ | Single-file bundles (esbuild, tsup, webpack, Vite SSR, Next.js) | Automatic instrumentation not supported |
134
+ | `tsx`, custom Node loader stacks, and Node's native TypeScript execution | Automatic instrumentation not supported |
135
+ | Deno and edge runtimes | Not supported |
136
+
137
+ Tested on Bun 1.3.13, Node.js 24.19.0. Node.js 22.15.0 is the minimum for automatic instrumentation (synchronous module hooks). Use `execution.run()` and `execution.trace()` when automatic instrumentation is not available.
138
+
139
+ ## Recorder configuration
140
+
141
+ Defaults work for most apps. Customize to exclude noisy sources, redact fields, or retain less state:
142
+
143
+ | Field | Default | Description |
144
+ | --- | ---: | --- |
145
+ | `enabled` | `true` | Enables runtime-state capture |
146
+ | `maxEventsPerExecution` | `500` | Maximum events retained for one execution |
147
+ | `maxCapturedCallsPerFunction` | `3` | Detailed successful calls retained before similar calls are summarized |
148
+ | `maxActiveMemoryBytes` | `64 MiB` | Maximum recorder memory shared across active executions |
149
+ | `maxDepth` | `3` | Maximum captured value depth |
150
+ | `maxObjectKeys` | `30` | Maximum properties retained from one object |
151
+ | `maxArrayElements` | `20` | Maximum items retained from one array, map, or set |
152
+ | `maxStringLength` | `500` | Maximum characters retained from one string |
153
+ | `maxSerializedValueBytes` | `8 KiB` | Maximum retained size of one captured value |
154
+ | `redactKeys` | `[]` | Additional case-insensitive property names to redact |
155
+ | `excludeSources` | `[]` | Source globs or function-name patterns to exclude |
156
+
157
+ ```ts
158
+ const rasputin = RasputinInit({
159
+ // ...required options
160
+ executionRecorder: {
161
+ excludeSources: ['src/logger/**', 'packages/shared-logger/**'],
162
+ redactKeys: ['customerEmail'],
163
+ maxEventsPerExecution: 200,
164
+ },
165
+ });
166
+ ```
167
+
168
+ Runtime state can include application data. Use `redactKeys` for sensitive fields.
169
+
170
+ ## Diagnostics
171
+
172
+ ```ts
173
+ const { recorder, transport } = rasputin.getStats();
174
+ ```
175
+
176
+ Counters are local to the current process and reset on restart.
177
+
178
+ Recorder work counters support performance diagnosis without retaining successful execution state:
179
+
180
+ - `functionCallsObserved` counts hooks reached inside active execution scopes.
181
+ - `functionCallsCaptured` counts complete enter/terminal pairs recorded before any later eviction.
182
+ - `functionCallsExcluded` counts hooks omitted by source or excluded-subtree rules.
183
+ - `repeatedCallsSuppressed` counts successful repetitions represented by suppression summaries.
184
+ - `serializedValues`, `serializedValueNodes`, and `serializedValueBytes` describe bounded value
185
+ capture work. Redacted subtrees are not traversed or included in the node count.
186
+
187
+ All counters are cumulative. Compare before/after snapshots for a measurement window rather than
188
+ dividing the process-lifetime totals by a single request count.
@@ -4,55 +4,20 @@
4
4
  * bindings. transform-source calls these collectors and passes the delta to the manifest
5
5
  * registry so the server can map runtime locations back to Git.
6
6
  */
7
- import type { InstrumentationArgIdentifier, InstrumentationParamBinding } from '@rasputin-ai/core';
7
+ import type { InstrumentationParamBinding } from '@rasputin-ai/core';
8
8
  import ts from 'typescript';
9
+ import type { RawManifestCallSite, RawManifestDestructure, RawManifestFunction } from './instrumentation-manifest-delta';
9
10
  type SourceLocation = {
10
11
  filePath: string;
11
12
  line: number;
12
13
  column: number;
13
14
  };
14
15
  type SourceLocationMapper = (location: SourceLocation) => SourceLocation | undefined;
15
- type RawManifestCallSite = {
16
- callerSourceToken: string;
17
- calleeName: string;
18
- calleeText: string;
19
- filePath: string;
20
- line: number;
21
- column: number;
22
- endLine: number;
23
- endColumn: number;
24
- resultBinding: string | null;
25
- argIdentifiers: InstrumentationArgIdentifier[];
26
- };
27
- type RawManifestDestructure = {
28
- callerSourceToken: string;
29
- sourceParam: string;
30
- filePath: string;
31
- line: number;
32
- column: number;
33
- binding: InstrumentationParamBinding;
34
- };
35
16
  type CollectContext = {
36
17
  sourceFile: ts.SourceFile;
37
18
  mapLocation?: SourceLocationMapper;
38
19
  absolutePath: string;
39
20
  };
40
- export type RawManifestFunction = {
41
- sourceToken: string;
42
- filePath: string;
43
- name: string;
44
- startLine: number;
45
- startColumn: number;
46
- endLine: number;
47
- endColumn: number;
48
- params: InstrumentationParamBinding[];
49
- paramNames: Set<string>;
50
- };
51
- export type InstrumentationManifestDelta = {
52
- functions: RawManifestFunction[];
53
- callSites: RawManifestCallSite[];
54
- destructures: RawManifestDestructure[];
55
- };
56
21
  export declare const collectFunctionParams: (node: ts.FunctionLikeDeclaration, sourceFile: ts.SourceFile) => {
57
22
  params: InstrumentationParamBinding[];
58
23
  paramNames: Set<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"collect-instrumentation-delta.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/collect-instrumentation-delta.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AACnG,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,KAAK,cAAc,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,oBAAoB,GAAG,CAAC,QAAQ,EAAE,cAAc,KAAK,cAAc,GAAG,SAAS,CAAC;AAErF,KAAK,mBAAmB,GAAG;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,EAAE,4BAA4B,EAAE,CAAC;CAC/C,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,2BAA2B,CAAC;CACrC,CAAC;AAEF,KAAK,cAAc,GAAG;IACrB,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC;IAC1B,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,2BAA2B,EAAE,CAAC;IACtC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IAC1C,SAAS,EAAE,mBAAmB,EAAE,CAAC;IACjC,SAAS,EAAE,mBAAmB,EAAE,CAAC;IACjC,YAAY,EAAE,sBAAsB,EAAE,CAAC;CACvC,CAAC;AAqCF,eAAO,MAAM,qBAAqB,GACjC,MAAM,EAAE,CAAC,uBAAuB,EAChC,YAAY,EAAE,CAAC,UAAU,KACvB;IAAE,MAAM,EAAE,2BAA2B,EAAE,CAAC;IAAC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAQlE,CAAC;AA2BF,eAAO,MAAM,cAAc,GAC1B,YAAY,EAAE,CAAC,UAAU,EACzB,UAAU,MAAM,EAChB,cAAc,MAAM,EACpB,cAAc,oBAAoB,+BASlC,CAAC;AAuEF,eAAO,MAAM,eAAe,GAC3B,MAAM,EAAE,CAAC,cAAc,GAAG,EAAE,CAAC,aAAa,EAC1C,QAAQ,mBAAmB,EAC3B,SAAS,cAAc,KACrB,mBAAmB,GAAG,IA4BxB,CAAC;AAEF,eAAO,MAAM,uBAAuB,GACnC,aAAa,EAAE,CAAC,mBAAmB,EACnC,QAAQ,mBAAmB,EAC3B,SAAS,cAAc,KACrB,sBAAsB,GAAG,IAsB3B,CAAC"}
1
+ {"version":3,"file":"collect-instrumentation-delta.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/collect-instrumentation-delta.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAgC,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AACnG,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EACX,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,MAAM,kCAAkC,CAAC;AAE1C,KAAK,cAAc,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,oBAAoB,GAAG,CAAC,QAAQ,EAAE,cAAc,KAAK,cAAc,GAAG,SAAS,CAAC;AAErF,KAAK,cAAc,GAAG;IACrB,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC;IAC1B,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC;AAqCF,eAAO,MAAM,qBAAqB,GACjC,MAAM,EAAE,CAAC,uBAAuB,EAChC,YAAY,EAAE,CAAC,UAAU,KACvB;IAAE,MAAM,EAAE,2BAA2B,EAAE,CAAC;IAAC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAQlE,CAAC;AA2BF,eAAO,MAAM,cAAc,GAC1B,YAAY,EAAE,CAAC,UAAU,EACzB,UAAU,MAAM,EAChB,cAAc,MAAM,EACpB,cAAc,oBAAoB,+BASlC,CAAC;AAuEF,eAAO,MAAM,eAAe,GAC3B,MAAM,EAAE,CAAC,cAAc,GAAG,EAAE,CAAC,aAAa,EAC1C,QAAQ,mBAAmB,EAC3B,SAAS,cAAc,KACrB,mBAAmB,GAAG,IA4BxB,CAAC;AAEF,eAAO,MAAM,uBAAuB,GACnC,aAAa,EAAE,CAAC,mBAAmB,EACnC,QAAQ,mBAAmB,EAC3B,SAAS,cAAc,KACrB,sBAAsB,GAAG,IAsB3B,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { InstrumentationManifestContent } from '@rasputin-ai/core';
2
+ export type InstrumentCompiledDirectoryOptions = {
3
+ inputDir: string;
4
+ outputDir?: string;
5
+ manifestPath?: string;
6
+ excludedRoots?: readonly string[];
7
+ sourceRoot?: string;
8
+ sourceRoots?: Record<string, string>;
9
+ };
10
+ export type InstrumentCompiledDirectoryResult = {
11
+ transformedFiles: string[];
12
+ manifest: InstrumentationManifestContent | undefined;
13
+ manifestPath: string;
14
+ };
15
+ /** Instrument compiled unbundled ESM/CJS and emit the source manifest next to the output. */
16
+ export declare const instrumentCompiledDirectory: (options: InstrumentCompiledDirectoryOptions) => InstrumentCompiledDirectoryResult;
17
+ //# sourceMappingURL=instrument-compiled-esm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instrument-compiled-esm.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/instrument-compiled-esm.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AAYxE,MAAM,MAAM,kCAAkC,GAAG;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC/C,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,EAAE,8BAA8B,GAAG,SAAS,CAAC;IACrD,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC;AAuBF,6FAA6F;AAC7F,eAAO,MAAM,2BAA2B,GACvC,SAAS,kCAAkC,KACzC,iCA2CF,CAAC"}
@@ -0,0 +1,40 @@
1
+ import type { InstrumentationArgIdentifier, InstrumentationParamBinding } from '@rasputin-ai/core';
2
+ import type { EncodedFunctionPlan } from '../execution-recorder/function-plan';
3
+ export type RawManifestCallSite = {
4
+ callerFunctionId: string;
5
+ calleeName: string;
6
+ calleeText: string;
7
+ filePath: string;
8
+ line: number;
9
+ column: number;
10
+ endLine: number;
11
+ endColumn: number;
12
+ resultBinding: string | null;
13
+ argIdentifiers: InstrumentationArgIdentifier[];
14
+ };
15
+ export type RawManifestDestructure = {
16
+ callerFunctionId: string;
17
+ sourceParam: string;
18
+ filePath: string;
19
+ line: number;
20
+ column: number;
21
+ binding: InstrumentationParamBinding;
22
+ };
23
+ export type RawManifestFunction = {
24
+ plan: EncodedFunctionPlan;
25
+ functionId: string;
26
+ filePath: string;
27
+ name: string;
28
+ startLine: number;
29
+ startColumn: number;
30
+ endLine: number;
31
+ endColumn: number;
32
+ params: InstrumentationParamBinding[];
33
+ paramNames: Set<string>;
34
+ };
35
+ export type InstrumentationManifestDelta = {
36
+ functions: RawManifestFunction[];
37
+ callSites: RawManifestCallSite[];
38
+ destructures: RawManifestDestructure[];
39
+ };
40
+ //# sourceMappingURL=instrumentation-manifest-delta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instrumentation-manifest-delta.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/instrumentation-manifest-delta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AACnG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE/E,MAAM,MAAM,mBAAmB,GAAG;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,EAAE,4BAA4B,EAAE,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACpC,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,2BAA2B,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,2BAA2B,EAAE,CAAC;IACtC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IAC1C,SAAS,EAAE,mBAAmB,EAAE,CAAC;IACjC,SAAS,EAAE,mBAAmB,EAAE,CAAC;IACjC,YAAY,EAAE,sBAAsB,EAAE,CAAC;CACvC,CAAC"}
@@ -1,11 +1,14 @@
1
1
  import { type InstrumentationManifestContent } from '@rasputin-ai/core';
2
- import type { InstrumentationManifestDelta } from './collect-instrumentation-delta';
2
+ import type { InstrumentationManifestDelta } from './instrumentation-manifest-delta';
3
3
  export declare const INSTRUMENTATION_MANIFEST_SYMBOL = "rasputin.instrumentation.manifest.v2";
4
4
  type SnapshotOptions = {
5
5
  sourceRoot?: string;
6
6
  sourceRoots?: Record<string, string>;
7
7
  };
8
8
  export declare const recordInstrumentationManifestDelta: (filePath: string, delta: InstrumentationManifestDelta) => void;
9
+ export declare const recordPrebuiltInstrumentationManifest: (manifest: InstrumentationManifestContent) => void;
10
+ export declare const loadInstrumentationManifestFile: (path: string) => boolean;
11
+ export declare const loadInstrumentationManifestIfPresent: (path: string | undefined) => void;
9
12
  export declare const isInstrumentationManifestDirty: () => boolean;
10
13
  export declare const instrumentationManifestGeneration: () => number;
11
14
  export declare const instrumentationManifestModuleCount: () => number;
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation-manifest-registry.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/instrumentation-manifest-registry.ts"],"names":[],"mappings":"AAMA,OAAO,EAGN,KAAK,8BAA8B,EAKnC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAEpF,eAAO,MAAM,+BAA+B,yCAAyC,CAAC;AAYtF,KAAK,eAAe,GAAG;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC,CAAC;AAiCF,eAAO,MAAM,kCAAkC,GAC9C,UAAU,MAAM,EAChB,OAAO,4BAA4B,KACjC,IAKF,CAAC;AAEF,eAAO,MAAM,8BAA8B,QAAO,OAGjD,CAAC;AAEF,eAAO,MAAM,iCAAiC,QAAO,MAAkC,CAAC;AAExF,eAAO,MAAM,kCAAkC,QAAO,MAAkC,CAAC;AAEzF,eAAO,MAAM,+BAA+B,GAC3C,UAAS,eAAoB,KAC3B,8BAA8B,GAAG,SAiFnC,CAAC;AAEF,eAAO,MAAM,mCAAmC,GAAI,YAAY,MAAM,KAAG,IAGxE,CAAC;AAEF,eAAO,MAAM,iCAAiC,GAAI,UAAU,MAAM,IAAI,KAAG,IAExE,CAAC;AAEF,eAAO,MAAM,oCAAoC,QAAO,IAEvD,CAAC"}
1
+ {"version":3,"file":"instrumentation-manifest-registry.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/instrumentation-manifest-registry.ts"],"names":[],"mappings":"AAOA,OAAO,EAGN,KAAK,8BAA8B,EAKnC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAErF,eAAO,MAAM,+BAA+B,yCAAyC,CAAC;AAatF,KAAK,eAAe,GAAG;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC,CAAC;AAiCF,eAAO,MAAM,kCAAkC,GAC9C,UAAU,MAAM,EAChB,OAAO,4BAA4B,KACjC,IAKF,CAAC;AAEF,eAAO,MAAM,qCAAqC,GACjD,UAAU,8BAA8B,KACtC,IAKF,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAAI,MAAM,MAAM,KAAG,OAU9D,CAAC;AAEF,eAAO,MAAM,oCAAoC,GAAI,MAAM,MAAM,GAAG,SAAS,KAAG,IAG/E,CAAC;AAEF,eAAO,MAAM,8BAA8B,QAAO,OAMjD,CAAC;AAEF,eAAO,MAAM,iCAAiC,QAAO,MAAkC,CAAC;AAExF,eAAO,MAAM,kCAAkC,QAAO,MAKrD,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAC3C,UAAS,eAAoB,KAC3B,8BAA8B,GAAG,SA4FnC,CAAC;AAEF,eAAO,MAAM,mCAAmC,GAAI,YAAY,MAAM,KAAG,IAGxE,CAAC;AAEF,eAAO,MAAM,iCAAiC,GAAI,UAAU,MAAM,IAAI,KAAG,IAExE,CAAC;AAEF,eAAO,MAAM,oCAAoC,QAAO,IAEvD,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type InstrumentationManifestDelta } from './collect-instrumentation-delta';
1
+ import type { InstrumentationManifestDelta } from './instrumentation-manifest-delta';
2
2
  export type TransformSourceOptions = {
3
3
  filePath: string;
4
4
  mapLocation?: SourceLocationMapper;
@@ -1 +1 @@
1
- {"version":3,"file":"transform-source.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/transform-source.ts"],"names":[],"mappings":"AAWA,OAAO,EAIN,KAAK,4BAA4B,EAGjC,MAAM,iCAAiC,CAAC;AAIzC,MAAM,MAAM,sBAAsB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,oBAAoB,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,4BAA4B,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,cAAc,KAAK,cAAc,GAAG,SAAS,CAAC;AAuH5F,6FAA6F;AAC7F,eAAO,MAAM,eAAe,GAC3B,QAAQ,MAAM,EACd,SAAS,sBAAsB,KAC7B,iBAAiB,GAAG,SAiFtB,CAAC"}
1
+ {"version":3,"file":"transform-source.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/transform-source.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACX,4BAA4B,EAE5B,MAAM,kCAAkC,CAAC;AAI1C,MAAM,MAAM,sBAAsB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,oBAAoB,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,4BAA4B,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,cAAc,KAAK,cAAc,GAAG,SAAS,CAAC;AA+H5F,6FAA6F;AAC7F,eAAO,MAAM,eAAe,GAC3B,QAAQ,MAAM,EACd,SAAS,sBAAsB,KAC7B,iBAAiB,GAAG,SAsFtB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Load-time transformation pulls the TypeScript compiler into the application process. Production
3
+ * should prefer `rasputin-instrument` at build time; this warning exists so that fallback stays
4
+ * available without being mistaken for the low-overhead path.
5
+ */
6
+ export declare const RUNTIME_TRANSFORM_WARNING_SUPPRESS_ENV = "RASPUTIN_SUPPRESS_RUNTIME_TRANSFORM_WARNING";
7
+ export declare const warnIfProductionRuntimeTransform: () => void;
8
+ //# sourceMappingURL=warn-production-runtime-transform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"warn-production-runtime-transform.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/warn-production-runtime-transform.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,sCAAsC,gDAAgD,CAAC;AAIpG,eAAO,MAAM,gCAAgC,QAAO,IAQnD,CAAC"}
@@ -1,20 +1,29 @@
1
1
  /**
2
2
  * Compiler-instrumented functions and the initialized SDK can live in separate bundles. This
3
3
  * versioned global registry joins them without generated code importing a physical SDK file. Source
4
- * tokens contain only package-relative identity, so Docker paths never leak into runtime events.
4
+ * identity is encoded once per module as a compact plan table so call sites pass only a numeric index.
5
5
  */
6
- import { type RuntimeFunctionDefinition } from '@rasputin-ai/core';
7
6
  import type { RasputinExecution } from './execution-recorder-types';
7
+ import type { EncodedFunctionPlan } from './function-plan';
8
8
  export declare const AUTOMATIC_RUNTIME_SYMBOL = "rasputin.execution.runtime.v2";
9
- type AutomaticFunctionSource = {
10
- filePath: string;
11
- name: string;
12
- line: number;
13
- column: number;
9
+ type ModuleRunner = <T>(planIndex: number, args: ArrayLike<unknown>, callback: () => T) => T;
10
+ type DispatchCell = {
11
+ run: ModuleRunner;
14
12
  };
15
- /** Resolve package ownership at transform time, never on the user's request hot path. */
16
- export declare const encodeAutomaticFunctionSource: (source: AutomaticFunctionSource) => string;
17
- export declare const decodeAutomaticFunctionSource: (sourceToken: string) => RuntimeFunctionDefinition | undefined;
13
+ type RegisteredModule = {
14
+ plans: readonly EncodedFunctionPlan[];
15
+ cell: DispatchCell;
16
+ };
17
+ type AutomaticRuntime = {
18
+ bind: (module: RegisteredModule) => void;
19
+ };
20
+ type AutomaticRuntimeRegistry = {
21
+ runtimes: AutomaticRuntime[];
22
+ modules: RegisteredModule[];
23
+ register: (plans: readonly EncodedFunctionPlan[]) => ModuleRunner;
24
+ };
25
+ export declare const getAutomaticRuntimeRegistry: () => AutomaticRuntimeRegistry;
26
+ export declare const resetAutomaticExecutionRuntime: () => void;
18
27
  /** Connect transformed application functions to this SDK instance. */
19
28
  export declare const installAutomaticExecutionRuntime: (execution: RasputinExecution) => (() => void);
20
29
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"automatic-runtime.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/automatic-runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACN,KAAK,yBAAyB,EAG9B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,eAAO,MAAM,wBAAwB,kCAAkC,CAAC;AAKxE,KAAK,uBAAuB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAaF,yFAAyF;AACzF,eAAO,MAAM,6BAA6B,GAAI,QAAQ,uBAAuB,KAAG,MAO/E,CAAC;AAEF,eAAO,MAAM,6BAA6B,GACzC,aAAa,MAAM,KACjB,yBAAyB,GAAG,SAe9B,CAAC;AAuBF,sEAAsE;AACtE,eAAO,MAAM,gCAAgC,GAAI,WAAW,iBAAiB,KAAG,CAAC,MAAM,IAAI,CAkB1F,CAAC"}
1
+ {"version":3,"file":"automatic-runtime.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/automatic-runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,eAAO,MAAM,wBAAwB,kCAAkC,CAAC;AAIxE,KAAK,YAAY,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;AAE7F,KAAK,YAAY,GAAG;IACnB,GAAG,EAAE,YAAY,CAAC;CAClB,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACvB,KAAK,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACtC,IAAI,EAAE,YAAY,CAAC;CACnB,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACvB,IAAI,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC/B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,mBAAmB,EAAE,KAAK,YAAY,CAAC;CAClE,CAAC;AAmCF,eAAO,MAAM,2BAA2B,QAAO,wBAO9C,CAAC;AAEF,eAAO,MAAM,8BAA8B,QAAO,IAEjD,CAAC;AAEF,sEAAsE;AACtE,eAAO,MAAM,gCAAgC,GAAI,WAAW,iBAAiB,KAAG,CAAC,MAAM,IAAI,CAsB1F,CAAC"}
@@ -4,6 +4,21 @@
4
4
  * keeps truncated snapshots usable by investigations and source-addressable debugging UIs.
5
5
  */
6
6
  import type { ExecutionEvent, ExecutionFunctionEnterEvent } from './execution-recorder-types';
7
+ export type CompactSuppression = {
8
+ count: number;
9
+ firstTimestampNs: bigint;
10
+ lastTimestampNs: bigint;
11
+ totalDurationNs: bigint;
12
+ functionId: string;
13
+ parentCallId?: number;
14
+ retainedSlot?: SuppressionPlaceholder;
15
+ };
16
+ export type SuppressionPlaceholder = {
17
+ kind: 'suppressed';
18
+ group: CompactSuppression;
19
+ };
20
+ export type BufferItem = ExecutionEvent | SuppressionPlaceholder;
21
+ export declare const isSuppressionPlaceholder: (item: BufferItem) => item is SuppressionPlaceholder;
7
22
  export declare class CallAwareEventBuffer {
8
23
  private readonly capacity;
9
24
  private readonly items;
@@ -14,10 +29,9 @@ export declare class CallAwareEventBuffer {
14
29
  startCall(event: ExecutionFunctionEnterEvent): void;
15
30
  finishCall(event: ExecutionEvent): void;
16
31
  dropCall(): void;
17
- append(event: ExecutionEvent): boolean;
32
+ appendSuppressed(group: CompactSuppression): boolean;
18
33
  forceCompletedCall(enter: ExecutionFunctionEnterEvent, terminal: ExecutionEvent): boolean;
19
- values(): ExecutionEvent[];
20
- contains(target: ExecutionEvent): boolean;
34
+ values(): BufferItem[];
21
35
  private evictCompletedLeafOrSummary;
22
36
  }
23
37
  //# sourceMappingURL=call-aware-event-buffer.d.ts.map