@rasputin-ai/node 0.4.1 → 0.5.0-alpha.1
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/README.md +185 -159
- package/dist/auto-instrumentation/collect-instrumentation-delta.d.ts +2 -37
- package/dist/auto-instrumentation/collect-instrumentation-delta.d.ts.map +1 -1
- package/dist/auto-instrumentation/instrument-compiled-esm.d.ts +17 -0
- package/dist/auto-instrumentation/instrument-compiled-esm.d.ts.map +1 -0
- package/dist/auto-instrumentation/instrumentation-manifest-delta.d.ts +40 -0
- package/dist/auto-instrumentation/instrumentation-manifest-delta.d.ts.map +1 -0
- package/dist/auto-instrumentation/instrumentation-manifest-registry.d.ts +4 -1
- package/dist/auto-instrumentation/instrumentation-manifest-registry.d.ts.map +1 -1
- package/dist/auto-instrumentation/transform-source.d.ts +1 -1
- package/dist/auto-instrumentation/transform-source.d.ts.map +1 -1
- package/dist/execution-recorder/automatic-runtime.d.ts +12 -10
- package/dist/execution-recorder/automatic-runtime.d.ts.map +1 -1
- package/dist/execution-recorder/call-aware-event-buffer.d.ts +2 -1
- package/dist/execution-recorder/call-aware-event-buffer.d.ts.map +1 -1
- package/dist/execution-recorder/execution-recorder-types.d.ts +17 -0
- package/dist/execution-recorder/execution-recorder-types.d.ts.map +1 -1
- package/dist/execution-recorder/execution-recorder.d.ts.map +1 -1
- package/dist/execution-recorder/function-plan.d.ts +26 -0
- package/dist/execution-recorder/function-plan.d.ts.map +1 -0
- package/dist/execution-recorder/recorder-memory-budget.d.ts +7 -1
- package/dist/execution-recorder/recorder-memory-budget.d.ts.map +1 -1
- package/dist/execution-recorder/safe-serialize.d.ts +7 -0
- package/dist/execution-recorder/safe-serialize.d.ts.map +1 -1
- package/dist/index.js +439 -259
- package/dist/instrument/build.d.ts +2 -0
- package/dist/instrument/build.d.ts.map +1 -0
- package/dist/instrument/build.js +707 -0
- package/dist/instrument/bun.js +41 -21
- package/dist/instrument/node.js +41 -21
- package/dist/rasputin-init.d.ts +5 -5
- package/dist/rasputin-init.d.ts.map +1 -1
- package/dist/sdk-meta.d.ts +1 -1
- package/dist/sdk-meta.d.ts.map +1 -1
- 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
|
-
|
|
77
|
-
|
|
78
|
-
```json
|
|
79
|
-
{
|
|
80
|
-
"scripts": {
|
|
81
|
-
"
|
|
82
|
-
"start:
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
| `
|
|
135
|
-
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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 preferred high-performance mode. Transform compiled unbundled JavaScript after `tsc` so the production process never loads TypeScript:
|
|
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
|
+
Load-time transformation remains available as a compatibility fallback. It imports the TypeScript compiler into the application process and increases RSS:
|
|
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.
|
|
155
177
|
|
|
156
|
-
|
|
178
|
+
Recorder work counters support performance diagnosis without retaining successful execution state:
|
|
157
179
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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.
|
|
161
186
|
|
|
162
|
-
|
|
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 {
|
|
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,
|
|
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 './
|
|
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":"
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform-source.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/transform-source.ts"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -1,20 +1,22 @@
|
|
|
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
|
-
*
|
|
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
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
line: number;
|
|
13
|
-
column: number;
|
|
9
|
+
type ModuleRunner = <T>(planIndex: number, args: ArrayLike<unknown>, callback: () => T) => T;
|
|
10
|
+
type AutomaticRuntime = {
|
|
11
|
+
run: <T>(plans: readonly EncodedFunctionPlan[], planIndex: number, args: ArrayLike<unknown>, callback: () => T) => T;
|
|
14
12
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
type AutomaticRuntimeRegistry = {
|
|
14
|
+
__rasputinRuntimeRegistry: true;
|
|
15
|
+
runtimes: AutomaticRuntime[];
|
|
16
|
+
register: (plans: readonly EncodedFunctionPlan[]) => ModuleRunner;
|
|
17
|
+
};
|
|
18
|
+
export declare const getAutomaticRuntimeRegistry: () => AutomaticRuntimeRegistry;
|
|
19
|
+
export declare const resetAutomaticExecutionRuntime: () => void;
|
|
18
20
|
/** Connect transformed application functions to this SDK instance. */
|
|
19
21
|
export declare const installAutomaticExecutionRuntime: (execution: RasputinExecution) => (() => void);
|
|
20
22
|
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,
|
|
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,gBAAgB,GAAG;IACvB,GAAG,EAAE,CAAC,CAAC,EACN,KAAK,EAAE,SAAS,mBAAmB,EAAE,EACrC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,EACxB,QAAQ,EAAE,MAAM,CAAC,KACb,CAAC,CAAC;CACP,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC/B,yBAAyB,EAAE,IAAI,CAAC;IAChC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,mBAAmB,EAAE,KAAK,YAAY,CAAC;CAClE,CAAC;AAgBF,eAAO,MAAM,2BAA2B,QAAO,wBAY9C,CAAC;AAEF,eAAO,MAAM,8BAA8B,QAAO,IAEjD,CAAC;AAEF,sEAAsE;AACtE,eAAO,MAAM,gCAAgC,GAAI,WAAW,iBAAiB,KAAG,CAAC,MAAM,IAAI,CAW1F,CAAC"}
|
|
@@ -8,6 +8,7 @@ export declare class CallAwareEventBuffer {
|
|
|
8
8
|
private readonly capacity;
|
|
9
9
|
private readonly items;
|
|
10
10
|
private readonly openCallIds;
|
|
11
|
+
private readonly retainedSummaries;
|
|
11
12
|
dropped: number;
|
|
12
13
|
constructor(capacity: number);
|
|
13
14
|
canStartCall(): boolean;
|
|
@@ -15,9 +16,9 @@ export declare class CallAwareEventBuffer {
|
|
|
15
16
|
finishCall(event: ExecutionEvent): void;
|
|
16
17
|
dropCall(): void;
|
|
17
18
|
append(event: ExecutionEvent): boolean;
|
|
19
|
+
hasSummary(event: object): boolean;
|
|
18
20
|
forceCompletedCall(enter: ExecutionFunctionEnterEvent, terminal: ExecutionEvent): boolean;
|
|
19
21
|
values(): ExecutionEvent[];
|
|
20
|
-
contains(target: ExecutionEvent): boolean;
|
|
21
22
|
private evictCompletedLeafOrSummary;
|
|
22
23
|
}
|
|
23
24
|
//# sourceMappingURL=call-aware-event-buffer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call-aware-event-buffer.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/call-aware-event-buffer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAE9F,qBAAa,oBAAoB;
|
|
1
|
+
{"version":3,"file":"call-aware-event-buffer.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/call-aware-event-buffer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAE9F,qBAAa,oBAAoB;IAOpB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IANrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAwB;IAC9C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IACjD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAyB;IAE3D,OAAO,SAAK;gBAEiB,QAAQ,EAAE,MAAM;IAE7C,YAAY,IAAI,OAAO;IAIvB,SAAS,CAAC,KAAK,EAAE,2BAA2B;IAK5C,UAAU,CAAC,KAAK,EAAE,cAAc;IAMhC,QAAQ;IAIR,MAAM,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO;IAWtC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAIlC,kBAAkB,CAAC,KAAK,EAAE,2BAA2B,EAAE,QAAQ,EAAE,cAAc,GAAG,OAAO;IAYzF,MAAM,IAAI,cAAc,EAAE;IAI1B,OAAO,CAAC,2BAA2B;CAiDnC"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* work, and future serverless invocations without coupling the recorder to one framework lifecycle.
|
|
5
5
|
*/
|
|
6
6
|
import type { RuntimeExecutionEvent, RuntimeExecutionKind, RuntimeExecutionMetadata, RuntimeExecutionState, RuntimeFunctionCallsSuppressedEvent, RuntimeFunctionDefinition, RuntimeFunctionEnterEvent, SourcePosition } from '@rasputin-ai/core';
|
|
7
|
+
import type { EncodedFunctionPlan, PreparedFunctionPlan } from './function-plan';
|
|
7
8
|
export type ExecutionSourceExclusion = string | RegExp;
|
|
8
9
|
export type ExecutionRecorderOptions = {
|
|
9
10
|
/** Disable runtime-state capture explicitly. It is enabled by SDK initializers by default. */
|
|
@@ -42,6 +43,18 @@ export type ExecutionFunctionDescriptor = {
|
|
|
42
43
|
source?: SourcePosition;
|
|
43
44
|
};
|
|
44
45
|
export type ExecutionRecorderStats = {
|
|
46
|
+
/** Function hooks observed while an active execution scope exists. */
|
|
47
|
+
functionCallsObserved: number;
|
|
48
|
+
/** Observed calls for which a complete enter/terminal pair was captured. */
|
|
49
|
+
functionCallsCaptured: number;
|
|
50
|
+
/** Observed calls omitted because their source or parent subtree was excluded. */
|
|
51
|
+
functionCallsExcluded: number;
|
|
52
|
+
/** Values actually traversed by the bounded serializer. */
|
|
53
|
+
serializedValues: number;
|
|
54
|
+
/** Application value nodes visited while producing bounded snapshots. */
|
|
55
|
+
serializedValueNodes: number;
|
|
56
|
+
/** Bounded serialized bytes produced before values are stored in recorder events. */
|
|
57
|
+
serializedValueBytes: number;
|
|
45
58
|
errorSnapshots: number;
|
|
46
59
|
successfulExecutionsDiscarded: number;
|
|
47
60
|
truncatedEvents: number;
|
|
@@ -71,6 +84,10 @@ export type RasputinExecution = {
|
|
|
71
84
|
getErrorState: (error: unknown, metadata?: Partial<ExecutionMetadata>) => ExecutionState | undefined;
|
|
72
85
|
/** Internal primitive used by SDK-owned source instrumentation. */
|
|
73
86
|
runFunction: <T>(definition: RuntimeFunctionDefinition | string, args: ArrayLike<unknown>, callback: () => T) => T;
|
|
87
|
+
/** Internal prepared-plan path used by automatic instrumentation. */
|
|
88
|
+
runFunctionPlans: <T>(plans: readonly EncodedFunctionPlan[], planIndex: number, args: ArrayLike<unknown>, callback: () => T) => T;
|
|
89
|
+
/** Internal primitive used after a module's function plans have been resolved. */
|
|
90
|
+
runPreparedFunction: <T>(plan: PreparedFunctionPlan, args: ArrayLike<unknown>, callback: () => T) => T;
|
|
74
91
|
/** Manual fallback for runtimes/build systems without automatic instrumentation. */
|
|
75
92
|
trace: <TThis, TArgs extends unknown[], TResult>(definition: string | ExecutionFunctionDescriptor, fn: (this: TThis, ...args: TArgs) => TResult) => (this: TThis, ...args: TArgs) => TResult;
|
|
76
93
|
getStats: () => ExecutionRecorderStats;
|