@rasputin-ai/node 0.5.0-alpha.8 → 0.5.0

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 (80) hide show
  1. package/README.md +219 -188
  2. package/dist/auto-instrumentation/bun-plugin.d.ts.map +1 -1
  3. package/dist/auto-instrumentation/format-configuration-report.d.ts +4 -0
  4. package/dist/auto-instrumentation/format-configuration-report.d.ts.map +1 -1
  5. package/dist/auto-instrumentation/instrument-compiled-esm.d.ts +1 -3
  6. package/dist/auto-instrumentation/instrument-compiled-esm.d.ts.map +1 -1
  7. package/dist/auto-instrumentation/instrumentation-manifest-delta.d.ts +10 -2
  8. package/dist/auto-instrumentation/instrumentation-manifest-delta.d.ts.map +1 -1
  9. package/dist/auto-instrumentation/instrumentation-manifest-registry.d.ts +6 -0
  10. package/dist/auto-instrumentation/instrumentation-manifest-registry.d.ts.map +1 -1
  11. package/dist/auto-instrumentation/node-hooks.d.ts.map +1 -1
  12. package/dist/auto-instrumentation/parameter-initializer-may-run-code.d.ts +3 -0
  13. package/dist/auto-instrumentation/parameter-initializer-may-run-code.d.ts.map +1 -0
  14. package/dist/auto-instrumentation/schedule-instrumentation-manifest-upload.d.ts +1 -1
  15. package/dist/auto-instrumentation/schedule-instrumentation-manifest-upload.d.ts.map +1 -1
  16. package/dist/auto-instrumentation/source-map-locations.d.ts +1 -0
  17. package/dist/auto-instrumentation/source-map-locations.d.ts.map +1 -1
  18. package/dist/auto-instrumentation/suspension-whitelist.d.ts +33 -0
  19. package/dist/auto-instrumentation/suspension-whitelist.d.ts.map +1 -0
  20. package/dist/auto-instrumentation/transform-disk-cache.d.ts +7 -0
  21. package/dist/auto-instrumentation/transform-disk-cache.d.ts.map +1 -0
  22. package/dist/auto-instrumentation/transform-source.d.ts +9 -6
  23. package/dist/auto-instrumentation/transform-source.d.ts.map +1 -1
  24. package/dist/auto-instrumentation/verify-instrumentation-isomorphism.d.ts +2 -0
  25. package/dist/auto-instrumentation/verify-instrumentation-isomorphism.d.ts.map +1 -0
  26. package/dist/auto-instrumentation/verify-transformed-source.d.ts +2 -0
  27. package/dist/auto-instrumentation/verify-transformed-source.d.ts.map +1 -0
  28. package/dist/execution-recorder/automatic-runtime.d.ts +17 -7
  29. package/dist/execution-recorder/automatic-runtime.d.ts.map +1 -1
  30. package/dist/execution-recorder/encode-frozen.d.ts +16 -0
  31. package/dist/execution-recorder/encode-frozen.d.ts.map +1 -0
  32. package/dist/execution-recorder/execution-journal.d.ts.map +1 -1
  33. package/dist/execution-recorder/execution-recorder-types.d.ts +124 -36
  34. package/dist/execution-recorder/execution-recorder-types.d.ts.map +1 -1
  35. package/dist/execution-recorder/execution-recorder.d.ts +2 -2
  36. package/dist/execution-recorder/execution-recorder.d.ts.map +1 -1
  37. package/dist/execution-recorder/function-plan.d.ts +8 -1
  38. package/dist/execution-recorder/function-plan.d.ts.map +1 -1
  39. package/dist/execution-recorder/index.d.ts +1 -1
  40. package/dist/execution-recorder/index.d.ts.map +1 -1
  41. package/dist/execution-recorder/recorder-memory-budget.d.ts +1 -0
  42. package/dist/execution-recorder/recorder-memory-budget.d.ts.map +1 -1
  43. package/dist/execution-recorder/redact-keys.d.ts +4 -0
  44. package/dist/execution-recorder/redact-keys.d.ts.map +1 -0
  45. package/dist/execution-recorder/run-exactly-once.d.ts +7 -0
  46. package/dist/execution-recorder/run-exactly-once.d.ts.map +1 -0
  47. package/dist/execution-recorder/runtime-state-size-budget.d.ts +14 -0
  48. package/dist/execution-recorder/runtime-state-size-budget.d.ts.map +1 -0
  49. package/dist/execution-recorder/safe-serialize.d.ts +9 -3
  50. package/dist/execution-recorder/safe-serialize.d.ts.map +1 -1
  51. package/dist/execution-recorder/value-freeze.d.ts +43 -0
  52. package/dist/execution-recorder/value-freeze.d.ts.map +1 -0
  53. package/dist/execution-recorder/warn-missing-async-context-frame.d.ts +10 -0
  54. package/dist/execution-recorder/warn-missing-async-context-frame.d.ts.map +1 -0
  55. package/dist/index.d.ts +1 -6
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +2637 -894
  58. package/dist/install-global-handlers.d.ts +29 -8
  59. package/dist/install-global-handlers.d.ts.map +1 -1
  60. package/dist/instrument/build.js +947 -797
  61. package/dist/instrument/bun.js +1098 -770
  62. package/dist/instrument/node.js +1078 -772
  63. package/dist/internal.d.ts +7 -0
  64. package/dist/internal.d.ts.map +1 -0
  65. package/dist/internal.js +4072 -0
  66. package/dist/rasputin-init.d.ts +25 -5
  67. package/dist/rasputin-init.d.ts.map +1 -1
  68. package/dist/sdk-meta.d.ts +1 -1
  69. package/dist/sdk-meta.d.ts.map +1 -1
  70. package/package.json +8 -3
  71. package/dist/derivation/analyze-function.d.ts +0 -42
  72. package/dist/derivation/analyze-function.d.ts.map +0 -1
  73. package/dist/derivation/build-dependency-graph.d.ts +0 -21
  74. package/dist/derivation/build-dependency-graph.d.ts.map +0 -1
  75. package/dist/derivation/derivation-ir.d.ts +0 -33
  76. package/dist/derivation/derivation-ir.d.ts.map +0 -1
  77. package/dist/derivation/derivation-proof.d.ts +0 -14
  78. package/dist/derivation/derivation-proof.d.ts.map +0 -1
  79. package/dist/derivation/emit-capture-plan.d.ts +0 -8
  80. package/dist/derivation/emit-capture-plan.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,188 +1,219 @@
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.
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
+ Rasputin wraps your functions so it can show what ran when an error happened.
77
+
78
+ **Compiled JavaScript (use this in production)**
79
+
80
+ Build as you already do, then run `rasputin-instrument` on the output. Start the process normally — no extra flags:
81
+
82
+ ```json
83
+ {
84
+ "scripts": {
85
+ "build": "tsc && rasputin-instrument dist",
86
+ "start:node": "node dist/app.js",
87
+ "start:bun": "bun dist/app.js"
88
+ }
89
+ }
90
+ ```
91
+
92
+ Have TypeScript write `.js.map` files next to the output so recorded functions still point at your `.ts` sources. The instrumenter writes `.rasputin/instrumentation-manifest.json` beside `dist`, and `RasputinInit` loads it automatically.
93
+
94
+ **Running TypeScript directly**
95
+
96
+ `rasputin-instrument` rewrites compiled `.js` files on disk. It does not run when you start TypeScript with Bun (`bun src/app.ts`, `bun run src/app.ts`, and similar). Use `--preload` so Bun wraps files as they load:
97
+
98
+ ```json
99
+ {
100
+ "scripts": {
101
+ "start:bun": "bun --preload @rasputin-ai/node/instrument/bun src/app.ts"
102
+ }
103
+ }
104
+ ```
105
+
106
+ On Node you can wrap compiled files as they load instead of instrumenting at build time:
107
+
108
+ ```json
109
+ {
110
+ "scripts": {
111
+ "start:node": "node --import @rasputin-ai/node/instrument/node dist/app.js"
112
+ }
113
+ }
114
+ ```
115
+
116
+ Use `--preload` / `--import` while you run TypeScript locally. In production, instrument at build time instead — wrapping files at startup is slower and uses more memory.
117
+
118
+ Runtime state is kept only while a request or job is running, and is attached when that work throws.
119
+
120
+ ## Manual capture
121
+
122
+ Wrap each meaningful unit of work — an HTTP request, background job, scheduled task, or worker iteration — in an execution:
123
+
124
+ ```ts
125
+ const scope = rasputin.execution.createScope({
126
+ kind: 'job',
127
+ name: 'sync-invoices',
128
+ })
129
+
130
+ try {
131
+ return await scope.run(() => syncInvoices())
132
+ } catch (error) {
133
+ scope.associateError(error)
134
+ throw error
135
+ } finally {
136
+ scope.finish()
137
+ }
138
+ ```
139
+
140
+ `scope.run()` executes the callback under this recording's async context and returns exactly what the callback returned. It does not wrap, replace, or observe Promises. The caller owns `await`, error association, and `finish()`.
141
+
142
+ When automatic instrumentation is unavailable, mark individual functions explicitly:
143
+
144
+ ```ts
145
+ const syncInvoices = rasputin.execution.trace(
146
+ 'src/jobs/sync-invoices.ts:syncInvoices',
147
+ async () => {
148
+ // ...
149
+ },
150
+ );
151
+ ```
152
+
153
+ `trace()` preserves the call receiver (`this`) for methods and `.call` / `.apply` / `.bind`. It is not a constructor — do not use `new` on the wrapped function.
154
+
155
+ Framework packages such as `@rasputin-ai/elysia` create HTTP executions automatically.
156
+
157
+ ## Runtime support
158
+
159
+ | Environment | Support |
160
+ | --- | --- |
161
+ | TypeScript compiled to multiple JavaScript files | Use `rasputin-instrument dist` after `tsc`, with adjacent source maps |
162
+ | Bun 1.3.x running `.ts` or `.js` files directly | Use `--preload @rasputin-ai/node/instrument/bun` |
163
+ | Node.js 22.15 or newer, unbundled ESM/CJS | Use `rasputin-instrument`, or `--import @rasputin-ai/node/instrument/node`; Node 22 and 24 are the supported LTS lines |
164
+
165
+ On Node.js 22, start the process with `--experimental-async-context-frame` (or set `NODE_OPTIONS`) so `AsyncLocalStorage` uses the faster implementation that Node.js 24 enables by default. Rasputin logs this once when the flag is missing; set `RASPUTIN_SUPPRESS_ASYNC_CONTEXT_FRAME_WARNING=1` to hide it.
166
+ | Single-file bundles (esbuild, tsup, webpack, Vite SSR, Next.js) | Automatic instrumentation is not supported |
167
+ | `tsx`, custom Node loader stacks, and Node's native TypeScript execution | Automatic instrumentation is not supported |
168
+ | Deno and edge runtimes | Not supported |
169
+
170
+ Tested on Bun 1.3.13 and Node.js 24.19.0. Node.js 22.15.0 is the minimum for automatic instrumentation. Use `execution.createScope()` and `execution.trace()` when automatic instrumentation is not available.
171
+
172
+ ## Recorder configuration
173
+
174
+ Defaults work for most apps. Customize to exclude noisy sources, redact fields, or retain less state:
175
+
176
+ | Field | Default | Description |
177
+ | --- | ---: | --- |
178
+ | `enabled` | `true` | Enables runtime-state capture |
179
+ | `maxEventsPerExecution` | `500` | Maximum events retained for one execution |
180
+ | `maxCapturedCallsPerFunction` | `3` | Detailed successful calls retained before similar calls are summarized |
181
+ | `maxActiveMemoryBytes` | `64 MiB` | Maximum recorder memory shared across active executions |
182
+ | `maxDepth` | `3` | Maximum captured value depth |
183
+ | `maxObjectKeys` | `30` | Maximum properties retained from one object |
184
+ | `maxArrayElements` | `20` | Maximum items retained from one array, map, or set |
185
+ | `maxStringLength` | `500` | Maximum characters retained from one string |
186
+ | `maxSerializedValueBytes` | `8 KiB` | Maximum retained size of one captured value |
187
+ | `runtimeStateTargetBytes` | `256 KiB` | Soft size goal for the snapshot sent with an error; extra reconstruction data is dropped first |
188
+ | `maxRuntimeStateBytes` | `512 KiB` | Hard size limit for that snapshot; values are dropped before call history |
189
+ | `redactKeys` | `[]` | Additional property names to redact (case- and separator-insensitive, trailing digits ignored) |
190
+ | `excludeSources` | `[]` | Source globs or function-name patterns to exclude |
191
+ | `maxExecutionHoldMs` | `60s` | How long one recording may hold process-wide memory, including finished work with in-flight calls |
192
+ | `maxRetainedErrorRecordings` | `32` | Finished error snapshots kept for later `getErrorState`. Older ones report `unavailable` / `retained_state_evicted` |
193
+
194
+ ```ts
195
+ const rasputin = RasputinInit({
196
+ // ...required options
197
+ executionRecorder: {
198
+ excludeSources: ['src/logger/**', 'packages/shared-logger/**'],
199
+ redactKeys: ['customerEmail'],
200
+ maxEventsPerExecution: 200,
201
+ },
202
+ });
203
+ ```
204
+
205
+ Runtime state can include application data. Rasputin redacts **property names** that look like secrets (`password`, `token`, `DATABASE_URL`, `jwt`, `sessionId`, and similar, including digit suffixes like `password2`). It does **not** scan ordinary string values for embedded secrets. Use `redactKeys` for additional field names.
206
+
207
+ `captureProfile.functionBoundaries: "full"` means every retained function boundary is complete. Repeated successful calls may still be summarized into `function_calls_suppressed` events.
208
+
209
+ Short-lived processes flush telemetry for at most about two seconds on exit. If ingest is unreachable, Rasputin drops the leftover events and prints one stderr line rather than holding a CLI or cron job open.
210
+
211
+ The on-disk transform cache includes the verification mode in its key, so an unverified rewrite cannot be reused by a verifying process. On POSIX the cache directory must be owned by the process user and not world-writable. Windows cannot enforce those ownership bits, so a project-local cache is trusted when the directory can be created.
212
+
213
+ ## Diagnostics
214
+
215
+ ```ts
216
+ const { recorder, transport } = rasputin.getStats();
217
+ ```
218
+
219
+ These counters describe what this process has recorded and sent since it started. They reset on restart. Compare two snapshots if you want activity over a window, rather than dividing lifetime totals by one request.
@@ -1 +1 @@
1
- {"version":3,"file":"bun-plugin.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/bun-plugin.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAK7C,MAAM,MAAM,iCAAiC,GAAG;IAC/C,4FAA4F;IAC5F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,OAAO,CAAC;CACrB,CAAC;AAcF,eAAO,MAAM,yBAAyB,GACrC,UAAU,MAAM,EAChB,UAAS,iCAAsC,KAC7C,OAAmF,CAAC;AAEvF,kGAAkG;AAClG,eAAO,MAAM,4BAA4B,GACxC,UAAU,MAAM,EAChB,UAAS,iCAAsC,KAC7C,OAAO,CAAC,yBAAyB,CAqBnC,CAAC;AAEF,eAAO,MAAM,uBAAuB,GACnC,UAAS,iCAAsC,KAC7C,SAsBF,CAAC"}
1
+ {"version":3,"file":"bun-plugin.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/bun-plugin.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAK7C,MAAM,MAAM,iCAAiC,GAAG;IAC/C,4FAA4F;IAC5F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,OAAO,CAAC;CACrB,CAAC;AAcF,eAAO,MAAM,yBAAyB,GACrC,UAAU,MAAM,EAChB,UAAS,iCAAsC,KAC7C,OAAmF,CAAC;AAEvF,kGAAkG;AAClG,eAAO,MAAM,4BAA4B,GACxC,UAAU,MAAM,EAChB,UAAS,iCAAsC,KAC7C,OAAO,CAAC,yBAAyB,CAwBnC,CAAC;AAEF,eAAO,MAAM,uBAAuB,GACnC,UAAS,iCAAsC,KAC7C,SAsBF,CAAC"}
@@ -4,6 +4,10 @@ type ConfigurationReportInput = {
4
4
  runtime: string;
5
5
  modules: number;
6
6
  functions: number;
7
+ skippedFunctions?: number;
8
+ instrumentedAsync?: number;
9
+ skippedByReason?: Partial<Record<string, number>>;
10
+ attributionDegradations?: number;
7
11
  packageNames: string[];
8
12
  verification: SourceVerification;
9
13
  uploaded: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"format-configuration-report.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/format-configuration-report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,KAAK,wBAAwB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,kBAAkB,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AA2CF,eAAO,MAAM,yBAAyB,GAAI,OAAO,wBAAwB,KAAG,MAkE3E,CAAC;AAEF,eAAO,MAAM,YAAY,QAAO,MAI/B,CAAC"}
1
+ {"version":3,"file":"format-configuration-report.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/format-configuration-report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,KAAK,wBAAwB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,kBAAkB,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AA2CF,eAAO,MAAM,yBAAyB,GAAI,OAAO,wBAAwB,KAAG,MAiF3E,CAAC;AAEF,eAAO,MAAM,YAAY,QAAO,MAI/B,CAAC"}
@@ -1,5 +1,4 @@
1
- import type { InstrumentationManifestContent } from '@rasputin-ai/core';
2
- import { type DerivationCaptureMode } from './transform-source';
1
+ import { type InstrumentationManifestContent } from '@rasputin-ai/core';
3
2
  export type InstrumentCompiledDirectoryOptions = {
4
3
  inputDir: string;
5
4
  outputDir?: string;
@@ -7,7 +6,6 @@ export type InstrumentCompiledDirectoryOptions = {
7
6
  excludedRoots?: readonly string[];
8
7
  sourceRoot?: string;
9
8
  sourceRoots?: Record<string, string>;
10
- derivationMode?: DerivationCaptureMode;
11
9
  };
12
10
  export type InstrumentCompiledDirectoryResult = {
13
11
  transformedFiles: string[];
@@ -1 +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;AAQxE,OAAO,EAAE,KAAK,qBAAqB,EAAmB,MAAM,oBAAoB,CAAC;AAIjF,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;IACrC,cAAc,CAAC,EAAE,qBAAqB,CAAC;CACvC,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,iCA4CF,CAAC"}
1
+ {"version":3,"file":"instrument-compiled-esm.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/instrument-compiled-esm.ts"],"names":[],"mappings":"AAMA,OAAO,EAEN,KAAK,8BAA8B,EACnC,MAAM,mBAAmB,CAAC;AAY3B,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,iCAmDF,CAAC"}
@@ -1,5 +1,10 @@
1
- import type { DerivationPlan, InstrumentationArgIdentifier, InstrumentationParamBinding } from '@rasputin-ai/core';
1
+ /**
2
+ * One transformed file's contribution to the release manifest: functions, call sites, and
3
+ * destructures. The registry concatenates these deltas before upload.
4
+ */
5
+ import type { InstrumentationArgIdentifier, InstrumentationParamBinding, InstrumentationSkipReason } from '@rasputin-ai/core';
2
6
  import type { EncodedFunctionPlan } from '../execution-recorder/function-plan';
7
+ export type { InstrumentationSkipReason };
3
8
  export type RawManifestCallSite = {
4
9
  callerFunctionId: string;
5
10
  calleeName: string;
@@ -31,11 +36,14 @@ export type RawManifestFunction = {
31
36
  endColumn: number;
32
37
  params: InstrumentationParamBinding[];
33
38
  paramNames: Set<string>;
39
+ instrumented: boolean;
40
+ skipReason?: InstrumentationSkipReason;
41
+ asyncFunction?: boolean;
34
42
  };
35
43
  export type InstrumentationManifestDelta = {
36
44
  functions: RawManifestFunction[];
37
45
  callSites: RawManifestCallSite[];
38
46
  destructures: RawManifestDestructure[];
39
- derivationPlans: DerivationPlan[];
47
+ alreadyInstrumented?: boolean;
40
48
  };
41
49
  //# sourceMappingURL=instrumentation-manifest-delta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation-manifest-delta.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/instrumentation-manifest-delta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,cAAc,EACd,4BAA4B,EAC5B,2BAA2B,EAC3B,MAAM,mBAAmB,CAAC;AAC3B,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;IACvC,eAAe,EAAE,cAAc,EAAE,CAAC;CAClC,CAAC"}
1
+ {"version":3,"file":"instrumentation-manifest-delta.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/instrumentation-manifest-delta.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACX,4BAA4B,EAC5B,2BAA2B,EAC3B,yBAAyB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE/E,YAAY,EAAE,yBAAyB,EAAE,CAAC;AAE1C,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;IACxB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,yBAAyB,CAAC;IACvC,aAAa,CAAC,EAAE,OAAO,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;IACvC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC"}
@@ -11,6 +11,12 @@ export declare const loadInstrumentationManifestFile: (path: string) => boolean;
11
11
  export declare const loadInstrumentationManifestIfPresent: (path: string | undefined) => void;
12
12
  export declare const isInstrumentationManifestDirty: () => boolean;
13
13
  export declare const instrumentationManifestGeneration: () => number;
14
+ export declare const instrumentationCoverageStats: () => {
15
+ instrumented: number;
16
+ instrumentedAsync: number;
17
+ alreadyInstrumented: number;
18
+ skippedByReason: Record<string, number>;
19
+ };
14
20
  export declare const instrumentationManifestModuleCount: () => number;
15
21
  export declare const snapshotInstrumentationManifest: (options?: SnapshotOptions) => InstrumentationManifestContent | undefined;
16
22
  export declare const markInstrumentationManifestUploaded: (generation: number) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation-manifest-registry.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/instrumentation-manifest-registry.ts"],"names":[],"mappings":"AAOA,OAAO,EAIN,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,SAgGnC,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;AAqBtF,KAAK,eAAe,GAAG;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC,CAAC;AAoCF,eAAO,MAAM,kCAAkC,GAC9C,UAAU,MAAM,EAChB,OAAO,4BAA4B,KACjC,IASF,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,4BAA4B,QAAO;IAC/C,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CA0BxC,CAAC;AAEF,eAAO,MAAM,kCAAkC,QAAO,MAKrD,CAAC;AAQF,eAAO,MAAM,+BAA+B,GAC3C,UAAS,eAAoB,KAC3B,8BAA8B,GAAG,SA+GnC,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 +1 @@
1
- {"version":3,"file":"node-hooks.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/node-hooks.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,kCAAkC,GAAG;IAChD,8FAA8F;IAC9F,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC,CAAC;AA6BF,eAAO,MAAM,yBAAyB,GACrC,UAAS,kCAAuC,KAC9C,IA8CF,CAAC"}
1
+ {"version":3,"file":"node-hooks.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/node-hooks.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,kCAAkC,GAAG;IAChD,8FAA8F;IAC9F,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC,CAAC;AA6BF,eAAO,MAAM,yBAAyB,GACrC,UAAS,kCAAuC,KAC9C,IAuDF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import ts from 'typescript';
2
+ export declare const functionHasPreBodyParameterEvaluation: (node: ts.SignatureDeclaration) => boolean;
3
+ //# sourceMappingURL=parameter-initializer-may-run-code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameter-initializer-may-run-code.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/parameter-initializer-may-run-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAqC5B,eAAO,MAAM,qCAAqC,GAAI,MAAM,EAAE,CAAC,oBAAoB,KAAG,OAOrF,CAAC"}
@@ -17,7 +17,7 @@ type ScheduleInstrumentationManifestUploadOptions = {
17
17
  };
18
18
  type InstrumentationManifestUploadHandle = {
19
19
  flushSoon: () => void;
20
- wait: () => Promise<void>;
20
+ wait: (timeoutMs?: number) => Promise<void>;
21
21
  disconnect: () => void;
22
22
  verify: () => Promise<SourceVerification>;
23
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"schedule-instrumentation-manifest-upload.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/schedule-instrumentation-manifest-upload.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAGN,KAAK,kBAAkB,EAEvB,MAAM,mBAAmB,CAAC;AAW3B,KAAK,4CAA4C,GAAG;IACnD,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjF,OAAO,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,KAAK,mCAAmC,GAAG;IAC1C,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC1C,CAAC;AAkBF,eAAO,MAAM,qCAAqC,GACjD,SAAS,4CAA4C,KACnD,mCAwGF,CAAC"}
1
+ {"version":3,"file":"schedule-instrumentation-manifest-upload.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/schedule-instrumentation-manifest-upload.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAGN,KAAK,kBAAkB,EAEvB,MAAM,mBAAmB,CAAC;AAY3B,KAAK,4CAA4C,GAAG;IACnD,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjF,OAAO,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,KAAK,mCAAmC,GAAG;IAC1C,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC1C,CAAC;AAkBF,eAAO,MAAM,qCAAqC,GACjD,SAAS,4CAA4C,KACnD,mCA6LF,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import type { SourceLocationMapper } from './transform-source';
2
+ export declare const sourceMapPayloadForCache: (generatedPath: string, source: string) => string;
2
3
  export declare const createSourceMapLocationMapper: (generatedPath: string, source: string) => SourceLocationMapper | undefined;
3
4
  //# sourceMappingURL=source-map-locations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"source-map-locations.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/source-map-locations.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAkB,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAgC/E,eAAO,MAAM,6BAA6B,GACzC,eAAe,MAAM,EACrB,QAAQ,MAAM,KACZ,oBAAoB,GAAG,SA8BzB,CAAC"}
1
+ {"version":3,"file":"source-map-locations.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/source-map-locations.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAkB,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAgC/E,eAAO,MAAM,wBAAwB,GAAI,eAAe,MAAM,EAAE,QAAQ,MAAM,KAAG,MAMhF,CAAC;AAEF,eAAO,MAAM,6BAA6B,GACzC,eAAe,MAAM,EACrB,QAAQ,MAAM,KACZ,oBAAoB,GAAG,SA8BzB,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Phase-1 async instrumentation is a whitelist. Anything we have not proven
3
+ * exact — `for await`, `await using`, async generators, unknown future
4
+ * syntax — is skipped rather than approximated.
5
+ */
6
+ import ts from 'typescript';
7
+ import type { InstrumentationSkipReason } from './instrumentation-manifest-delta';
8
+ export declare const knownSuspensionSyntaxKindNames: () => readonly string[];
9
+ export declare const unexpectedSuspensionSyntaxKindNames: () => string[];
10
+ export type AsyncInstrumentationAction = {
11
+ action: 'skip';
12
+ reason: InstrumentationSkipReason;
13
+ } | {
14
+ action: 'inline';
15
+ } | {
16
+ action: 'suspend_resume';
17
+ };
18
+ type FunctionLike = ts.FunctionLikeDeclaration;
19
+ export declare const isAsyncFunctionLike: (node: FunctionLike) => boolean;
20
+ export declare const isAsyncGeneratorLike: (node: ts.Node) => node is FunctionLike;
21
+ export declare const isSyncGeneratorLike: (node: ts.Node) => node is FunctionLike;
22
+ export declare const ownBodyHasAwaitKeyword: (node: FunctionLike, sourceFile: ts.SourceFile) => boolean;
23
+ export type OwnSuspensionFacts = {
24
+ awaitExpressions: boolean;
25
+ forAwait: boolean;
26
+ awaitUsing: boolean;
27
+ unknown: boolean;
28
+ awaitKeyword: boolean;
29
+ };
30
+ export declare const ownSuspensionFacts: (node: FunctionLike, sourceFile: ts.SourceFile) => OwnSuspensionFacts;
31
+ export declare const decideAsyncInstrumentation: (node: FunctionLike, sourceFile: ts.SourceFile) => AsyncInstrumentationAction;
32
+ export {};
33
+ //# sourceMappingURL=suspension-whitelist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suspension-whitelist.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/suspension-whitelist.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAclF,eAAO,MAAM,8BAA8B,QAAO,SAAS,MAAM,EAAiC,CAAC;AAEnG,eAAO,MAAM,mCAAmC,QAAO,MAAM,EAU5D,CAAC;AAEF,MAAM,MAAM,0BAA0B,GACnC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,yBAAyB,CAAA;CAAE,GACrD;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,GACpB;IAAE,MAAM,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAEhC,KAAK,YAAY,GAAG,EAAE,CAAC,uBAAuB,CAAC;AAI/C,eAAO,MAAM,mBAAmB,GAAI,MAAM,YAAY,KAAG,OACU,CAAC;AAEpE,eAAO,MAAM,oBAAoB,GAAI,MAAM,EAAE,CAAC,IAAI,KAAG,IAAI,IAAI,YAIjC,CAAC;AAE7B,eAAO,MAAM,mBAAmB,GAAI,MAAM,EAAE,CAAC,IAAI,KAAG,IAAI,IAAI,YAIjC,CAAC;AAgE5B,eAAO,MAAM,sBAAsB,GAAI,MAAM,YAAY,EAAE,YAAY,EAAE,CAAC,UAAU,KAAG,OAOtF,CAAC;AAgBF,MAAM,MAAM,kBAAkB,GAAG;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC9B,MAAM,YAAY,EAClB,YAAY,EAAE,CAAC,UAAU,KACvB,kBAkBF,CAAC;AAiBF,eAAO,MAAM,0BAA0B,GACtC,MAAM,YAAY,EAClB,YAAY,EAAE,CAAC,UAAU,KACvB,0BAcF,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type TransformedSource, type TransformSourceOptions } from './transform-source';
2
+ export declare const resolveTransformCacheDir: () => string;
3
+ export declare const transformSourceCached: (source: string, options: TransformSourceOptions, cache?: {
4
+ directory?: string;
5
+ limit?: number;
6
+ }) => TransformedSource | undefined;
7
+ //# sourceMappingURL=transform-disk-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform-disk-cache.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/transform-disk-cache.ts"],"names":[],"mappings":"AAuBA,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAE3B,MAAM,oBAAoB,CAAC;AA+B5B,eAAO,MAAM,wBAAwB,QAAO,MAGoB,CAAC;AAwIjE,eAAO,MAAM,qBAAqB,GACjC,QAAQ,MAAM,EACd,SAAS,sBAAsB,EAC/B,QAAO;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,KAChD,iBAAiB,GAAG,SAgBtB,CAAC"}