@rasputin-ai/node 0.6.0 → 0.6.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.
package/README.md CHANGED
@@ -1,221 +1,5 @@
1
1
  # Official Rasputin AI SDK for Node and Bun
2
2
 
3
- Report application errors to Rasputin.
3
+ Report application errors to Rasputin from Node or Bun services.
4
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
- dsn: process.env.RASPUTIN_DSN!,
14
- projectApiKey: process.env.RASPUTIN_PROJECT_API_KEY!,
15
- release: process.env.RASPUTIN_RELEASE!,
16
- environment: process.env.NODE_ENV ?? 'development',
17
- enabled: ['staging', 'production'].includes(process.env.NODE_ENV ?? 'development'),
18
- });
19
- ```
20
-
21
- Uncaught exceptions and unhandled rejections are reported automatically.
22
-
23
- ## Capture handled errors
24
-
25
- ```ts
26
- try {
27
- await processPayment();
28
- } catch (error) {
29
- rasputin.captureException(error);
30
- }
31
- ```
32
-
33
- ## Configuration
34
-
35
- | Field | Required | Description |
36
- | --- | --- | --- |
37
- | `dsn` | yes | Public project DSN from Rasputin project settings. Safe for application runtime. |
38
- | `projectApiKey` | yes | Secret project API key for deploy announcement and instrumentation manifest upload |
39
- | `environment` | yes | Environment such as `production`, `staging`, or `preview` |
40
- | `release` | yes | Git commit SHA for the deployed version |
41
- | `enabled` | no | Enables or disables the SDK; defaults to `true` |
42
- | `logSuccess` | no | Prints a configuration summary when setup succeeds; defaults to `true`. Failures always log. |
43
- | `moduleUrl` | no | `import.meta.url` from the initialization file; helps normalize local stack paths |
44
- | `sourceRoot` | no | Git repository folder for a single-package service, such as `apps/api` |
45
- | `sourceRoots` | no | Package-name to Git-folder mappings for ambiguous monorepos |
46
- | `repoRoot` | no | Local filesystem display root; it does not control instrumentation or Git identity |
47
-
48
- 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.
49
-
50
- For deployment checks, call:
51
-
52
- ```ts
53
- const verification = await rasputin.verifyConfiguration();
54
- ```
55
-
56
- `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.
57
-
58
- 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.
59
-
60
- ## Shutdown
61
-
62
- Events are sent in the background. Flush before a short-lived process exits:
63
-
64
- ```ts
65
- await rasputin.flush();
66
- ```
67
-
68
- Call `await rasputin.close()` during graceful shutdown when the process stays alive afterward.
69
-
70
- ---
71
-
72
- # Runtime recorder
73
-
74
- Optionally attach the runtime state that led to an error — arguments, return values, and call history from the failing execution.
75
-
76
- ## Automatic instrumentation
77
-
78
- Rasputin wraps your functions so it can show what ran when an error happened.
79
-
80
- **Compiled JavaScript (use this in production)**
81
-
82
- Build as you already do, then run `rasputin-instrument` on the output. Start the process normally — no extra flags:
83
-
84
- ```json
85
- {
86
- "scripts": {
87
- "build": "tsc && rasputin-instrument dist",
88
- "start:node": "node dist/app.js",
89
- "start:bun": "bun dist/app.js"
90
- }
91
- }
92
- ```
93
-
94
- 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.
95
-
96
- **Running TypeScript directly**
97
-
98
- `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:
99
-
100
- ```json
101
- {
102
- "scripts": {
103
- "start:bun": "bun --preload @rasputin-ai/node/instrument/bun src/app.ts"
104
- }
105
- }
106
- ```
107
-
108
- On Node you can wrap compiled files as they load instead of instrumenting at build time:
109
-
110
- ```json
111
- {
112
- "scripts": {
113
- "start:node": "node --import @rasputin-ai/node/instrument/node dist/app.js"
114
- }
115
- }
116
- ```
117
-
118
- 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.
119
-
120
- Runtime state is kept only while a request or job is running, and is attached when that work throws.
121
-
122
- ## Manual capture
123
-
124
- Wrap each meaningful unit of work — an HTTP request, background job, scheduled task, or worker iteration — in an execution:
125
-
126
- ```ts
127
- const scope = rasputin.execution.createScope({
128
- kind: 'job',
129
- name: 'sync-invoices',
130
- })
131
-
132
- try {
133
- return await scope.run(() => syncInvoices())
134
- } catch (error) {
135
- scope.associateError(error)
136
- throw error
137
- } finally {
138
- scope.finish()
139
- }
140
- ```
141
-
142
- `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()`.
143
-
144
- When automatic instrumentation is unavailable, mark individual functions explicitly:
145
-
146
- ```ts
147
- const syncInvoices = rasputin.execution.trace(
148
- 'src/jobs/sync-invoices.ts:syncInvoices',
149
- async () => {
150
- // ...
151
- },
152
- );
153
- ```
154
-
155
- `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.
156
-
157
- Framework packages such as `@rasputin-ai/elysia` create HTTP executions automatically.
158
-
159
- ## Runtime support
160
-
161
- | Environment | Support |
162
- | --- | --- |
163
- | TypeScript compiled to multiple JavaScript files | Use `rasputin-instrument dist` after `tsc`, with adjacent source maps |
164
- | Bun 1.3.x running `.ts` or `.js` files directly | Use `--preload @rasputin-ai/node/instrument/bun` |
165
- | 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 |
166
-
167
- 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.
168
- | Single-file bundles (esbuild, tsup, webpack, Vite SSR, Next.js) | Automatic instrumentation is not supported |
169
- | `tsx`, custom Node loader stacks, and Node's native TypeScript execution | Automatic instrumentation is not supported |
170
- | Deno and edge runtimes | Not supported |
171
-
172
- 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.
173
-
174
- ## Recorder configuration
175
-
176
- Defaults work for most apps. Customize to exclude noisy sources, redact fields, or retain less state:
177
-
178
- | Field | Default | Description |
179
- | --- | ---: | --- |
180
- | `enabled` | `true` | Enables runtime-state capture |
181
- | `maxEventsPerExecution` | `500` | Maximum events retained for one execution |
182
- | `maxCapturedCallsPerFunction` | `3` | Detailed successful calls retained before similar calls are summarized |
183
- | `maxActiveMemoryBytes` | `64 MiB` | Maximum recorder memory shared across active executions |
184
- | `maxDepth` | `3` | Maximum captured value depth |
185
- | `maxObjectKeys` | `30` | Maximum properties retained from one object |
186
- | `maxArrayElements` | `20` | Maximum items retained from one array, map, or set |
187
- | `maxStringLength` | `500` | Maximum characters retained from one string |
188
- | `maxSerializedValueBytes` | `16 KiB` | Maximum retained size of one captured value |
189
- | `runtimeStateTargetBytes` | `256 KiB` | Soft size goal for the snapshot sent with an error; extra reconstruction data is dropped first |
190
- | `maxRuntimeStateBytes` | `512 KiB` | Hard size limit for that snapshot; values are dropped before call history |
191
- | `redactKeys` | `[]` | Additional property names to redact (case- and separator-insensitive, trailing digits ignored) |
192
- | `excludeSources` | `[]` | Source globs or function-name patterns to exclude |
193
- | `maxExecutionHoldMs` | `60s` | How long one recording may hold process-wide memory, including finished work with in-flight calls |
194
- | `maxRetainedErrorRecordings` | `32` | Finished error snapshots kept for later `getErrorState`. Older ones report `unavailable` / `retained_state_evicted` |
195
-
196
- ```ts
197
- const rasputin = RasputinInit({
198
- // ...required options
199
- executionRecorder: {
200
- excludeSources: ['src/logger/**', 'packages/shared-logger/**'],
201
- redactKeys: ['customerEmail'],
202
- maxEventsPerExecution: 200,
203
- },
204
- });
205
- ```
206
-
207
- 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.
208
-
209
- `captureProfile.functionBoundaries: "full"` means every retained function boundary is complete. Repeated successful calls may still be summarized into `function_calls_suppressed` events.
210
-
211
- 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.
212
-
213
- 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.
214
-
215
- ## Diagnostics
216
-
217
- ```ts
218
- const { recorder, transport } = rasputin.getStats();
219
- ```
220
-
221
- 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.
5
+ See the [Node documentation](https://rasputinai.dev/docs/node/installation).
@@ -1,13 +1,11 @@
1
1
  import { type InstrumentationManifestContent } from '@rasputin-ai/core';
2
2
  import type { InstrumentationManifestDelta } from '@rasputin-ai/instrumentation';
3
- export declare const INSTRUMENTATION_MANIFEST_SYMBOL = "rasputin.instrumentation.manifest.v3";
4
3
  type SnapshotOptions = {
5
4
  sourceRoot?: string;
6
5
  sourceRoots?: Record<string, string>;
7
6
  };
8
7
  export declare const recordInstrumentationManifestDelta: (filePath: string, delta: InstrumentationManifestDelta) => void;
9
8
  export declare const recordPrebuiltInstrumentationManifest: (manifest: InstrumentationManifestContent) => void;
10
- export declare const loadInstrumentationManifestFile: (path: string) => boolean;
11
9
  export declare const loadInstrumentationManifestIfPresent: (path: string | undefined) => void;
12
10
  export declare const isInstrumentationManifestDirty: () => boolean;
13
11
  export declare const instrumentationManifestGeneration: () => number;
@@ -1 +1 @@
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;AAC3B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAGjF,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
+ {"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;AAC3B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAwBjF,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;AAcF,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"}
@@ -14,9 +14,11 @@ type ScheduleInstrumentationManifestUploadOptions = {
14
14
  logSuccess?: boolean;
15
15
  fetch?: (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
16
16
  enabled: boolean;
17
+ deferStart?: boolean;
17
18
  };
18
19
  type InstrumentationManifestUploadHandle = {
19
20
  flushSoon: () => void;
21
+ start: () => void;
20
22
  wait: (timeoutMs?: number) => Promise<void>;
21
23
  disconnect: () => void;
22
24
  verify: () => Promise<SourceVerification>;
@@ -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;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
+ {"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;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,KAAK,mCAAmC,GAAG;IAC1C,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,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;AAmBF,eAAO,MAAM,qCAAqC,GACjD,SAAS,4CAA4C,KACnD,mCAgOF,CAAC"}
@@ -1,11 +1,3 @@
1
- export declare const typeMarker: (type: string, value?: unknown) => {
2
- value?: {} | null | undefined;
3
- __rasputin_type: string;
4
- };
5
- export declare const truncation: (reason: string, extra?: Record<string, unknown>) => {
6
- __rasputin_truncated: boolean;
7
- __reason: string;
8
- };
9
1
  export declare const jsonLiteralUtf8Bytes: (value: unknown) => number;
10
2
  export declare const encodeFrozen: (value: unknown) => unknown;
11
3
  export declare const encodeFrozenWithBytes: (frozen: unknown, visitedNodes: number, maxSerializedValueBytes: number) => {
@@ -1 +1 @@
1
- {"version":3,"file":"encode-frozen.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/encode-frozen.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,EAAE,QAAQ,OAAO;;;CAGtD,CAAC;AAEH,eAAO,MAAM,UAAU,GAAI,QAAQ,MAAM,EAAE,QAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;;;CAI5E,CAAC;AA+DH,eAAO,MAAM,oBAAoB,GAAI,OAAO,OAAO,KAAG,MAmCrD,CAAC;AA2KF,eAAO,MAAM,YAAY,GAAI,OAAO,OAAO,KAAG,OAc7C,CAAC;AAWF,eAAO,MAAM,qBAAqB,GACjC,QAAQ,OAAO,EACf,cAAc,MAAM,EACpB,yBAAyB,MAAM,KAC7B;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAQvD,CAAC"}
1
+ {"version":3,"file":"encode-frozen.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/encode-frozen.ts"],"names":[],"mappings":"AAgFA,eAAO,MAAM,oBAAoB,GAAI,OAAO,OAAO,KAAG,MAmCrD,CAAC;AA2KF,eAAO,MAAM,YAAY,GAAI,OAAO,OAAO,KAAG,OAc7C,CAAC;AAWF,eAAO,MAAM,qBAAqB,GACjC,QAAQ,OAAO,EACf,cAAc,MAAM,EACpB,yBAAyB,MAAM,KAC7B;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAQvD,CAAC"}
@@ -3,7 +3,7 @@
3
3
  * event model explicit allows the same bounded state to represent HTTP requests, jobs, scheduled
4
4
  * work, and future serverless invocations without coupling the recorder to one framework lifecycle.
5
5
  */
6
- import type { RuntimeExecutionEvent, RuntimeExecutionKind, RuntimeExecutionMetadata, RuntimeExecutionState, RuntimeFunctionCallsSuppressedEvent, RuntimeFunctionDefinition, RuntimeFunctionEnterEvent, SourcePosition } from '@rasputin-ai/core';
6
+ import type { RuntimeExecutionEvent, RuntimeExecutionKind, RuntimeExecutionMetadata, RuntimeExecutionState, RuntimeFunctionDefinition, SourcePosition } from '@rasputin-ai/core';
7
7
  import type { EncodedFunctionPlan } from '@rasputin-ai/recorder';
8
8
  import type { PreparedFunctionPlan } from './function-plan';
9
9
  /** A file glob (`src/logger/**`) or a regular expression matched against a function id. */
@@ -72,8 +72,6 @@ export type ExecutionRecorderOptions = {
72
72
  export type ExecutionMetadata = RuntimeExecutionMetadata;
73
73
  /** `http` for a request, `job` for a background task, and so on. */
74
74
  export type ExecutionKind = RuntimeExecutionKind;
75
- export type ExecutionFunctionEnterEvent = RuntimeFunctionEnterEvent;
76
- export type ExecutionFunctionCallsSuppressedEvent = RuntimeFunctionCallsSuppressedEvent;
77
75
  export type ExecutionEvent = RuntimeExecutionEvent;
78
76
  /**
79
77
  * Snapshot of the request or job that failed: which functions ran, with what
@@ -1 +1 @@
1
- {"version":3,"file":"execution-recorder-types.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/execution-recorder-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACX,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,mCAAmC,EACnC,yBAAyB,EACzB,yBAAyB,EACzB,cAAc,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;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AAC,OAAO,CAAC,EACxB,QAAQ,EAAE,MAAM,CAAC,EACjB,UAAU,CAAC,EAAE,OAAO,KAChB,CAAC,CAAC;IACP,oBAAoB,EAAE,CAAC,KAAK,EAAE,SAAS,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,CAAC;IACxF,mBAAmB,EAAE,CAAC,CAAC,EACtB,IAAI,EAAE,oBAAoB,EAC1B,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,EACxB,QAAQ,EAAE,MAAM,CAAC,EACjB,UAAU,CAAC,EAAE,OAAO,KAChB,CAAC,CAAC;IACP,qBAAqB,EAAE,CACtB,IAAI,EAAE,oBAAoB,EAC1B,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,EACxB,UAAU,CAAC,EAAE,OAAO,KAChB,kBAAkB,CAAC;CACxB,CAAC"}
1
+ {"version":3,"file":"execution-recorder-types.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/execution-recorder-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACX,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,cAAc,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,2FAA2F;AAC3F,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvD,kFAAkF;AAClF,MAAM,MAAM,wBAAwB,GAAG;IACtC,sFAAsF;IACtF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sGAAsG;IACtG,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;;OAGG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,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AAU,CAAC,EAAE,OAAO,KAChB,kBAAkB,CAAC;CACxB,CAAC"}
@@ -1,4 +1,3 @@
1
1
  export declare const compileRedactKeys: (extra: readonly string[] | undefined) => ReadonlySet<string>;
2
2
  export declare const keyIsRedacted: (key: string, redactKeys: ReadonlySet<string>) => boolean;
3
- export declare const propertyNameIsRedacted: (key: string) => boolean;
4
3
  //# sourceMappingURL=redact-keys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"redact-keys.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/redact-keys.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,iBAAiB,GAAI,OAAO,SAAS,MAAM,EAAE,GAAG,SAAS,KAAG,WAAW,CAAC,MAAM,CAG1F,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,EAAE,YAAY,WAAW,CAAC,MAAM,CAAC,KAAG,OAM5E,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,KAAK,MAAM,KAAG,OAAuC,CAAC"}
1
+ {"version":3,"file":"redact-keys.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/redact-keys.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,iBAAiB,GAAI,OAAO,SAAS,MAAM,EAAE,GAAG,SAAS,KAAG,WAAW,CAAC,MAAM,CAG1F,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,EAAE,YAAY,WAAW,CAAC,MAAM,CAAC,KAAG,OAM5E,CAAC"}
@@ -1,6 +1,4 @@
1
1
  import { type RuntimeExecutionState } from '@rasputin-ai/core';
2
- export declare const DEFAULT_RUNTIME_STATE_TARGET_BYTES: number;
3
- export declare const DEFAULT_MAX_RUNTIME_STATE_BYTES: number;
4
2
  /**
5
3
  * Bound the complete compact-JSON runtime state after materialization. Captured function values
6
4
  * are only omitted above the hard ceiling; call boundaries and timings remain until a final
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-state-size-budget.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/runtime-state-size-budget.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,qBAAqB,EAG1B,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,kCAAkC,QAAa,CAAC;AAC7D,eAAO,MAAM,+BAA+B,QAAa,CAAC;AA+H1D;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,GACzC,OAAO,qBAAqB,EAC5B,UAAS;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAO,KAC3D,qBA6EF,CAAC;AAEF,eAAO,MAAM,wBAAwB,UAlNR,OAAO,WAkNgB,CAAC"}
1
+ {"version":3,"file":"runtime-state-size-budget.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/runtime-state-size-budget.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,qBAAqB,EAG1B,MAAM,mBAAmB,CAAC;AAkI3B;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,GACzC,OAAO,qBAAqB,EAC5B,UAAS;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAO,KAC3D,qBA6EF,CAAC;AAEF,eAAO,MAAM,wBAAwB,UAlNR,OAAO,WAkNgB,CAAC"}
@@ -5,7 +5,6 @@
5
5
  import type { ExecutionRecorderOptions } from './execution-recorder-types';
6
6
  import { type FrozenSnapshot } from './value-freeze';
7
7
  export { jsonLiteralUtf8Bytes } from './encode-frozen';
8
- export type { FrozenSnapshot } from './value-freeze';
9
8
  export type SafeSerializedValue = {
10
9
  value: unknown;
11
10
  bytes: number;
@@ -19,6 +18,5 @@ export type SafeSerializer = {
19
18
  serializeWithBytes: (value: unknown) => SafeSerializedValue;
20
19
  };
21
20
  export declare const createSafeSerializer: (options?: ExecutionRecorderOptions) => SafeSerializer;
22
- export declare const safeSerializeWithBytes: (value: unknown, options?: ExecutionRecorderOptions) => SafeSerializedValue;
23
21
  export declare const safeSerialize: (value: unknown, options?: ExecutionRecorderOptions) => unknown;
24
22
  //# sourceMappingURL=safe-serialize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"safe-serialize.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/safe-serialize.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAAG;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,4FAA4F;IAC5F,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,cAAc,CAAC;IAC3C,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;IACrC,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IACvC,kBAAkB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,mBAAmB,CAAC;CAC5D,CAAC;AAUF,eAAO,MAAM,oBAAoB,GAAI,UAAS,wBAA6B,KAAG,cAgB7E,CAAC;AAIF,eAAO,MAAM,sBAAsB,GAClC,OAAO,OAAO,EACd,UAAS,wBAA6B,KACpC,mBAIyB,CAAC;AAE7B,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,EAAE,UAAS,wBAA6B,KAAG,OAC1C,CAAC"}
1
+ {"version":3,"file":"safe-serialize.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/safe-serialize.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,mBAAmB,GAAG;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,4FAA4F;IAC5F,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,cAAc,CAAC;IAC3C,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;IACrC,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IACvC,kBAAkB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,mBAAmB,CAAC;CAC5D,CAAC;AAUF,eAAO,MAAM,oBAAoB,GAAI,UAAS,wBAA6B,KAAG,cAgB7E,CAAC;AAaF,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,EAAE,UAAS,wBAA6B,KAAG,OAC1C,CAAC"}
@@ -7,7 +7,6 @@ export type FreezeLimits = {
7
7
  maxStringLength: number;
8
8
  maxSerializedValueBytes: number;
9
9
  };
10
- export declare const compileFreezeLimits: (options: ExecutionRecorderOptions) => FreezeLimits;
11
10
  export declare const FROZEN: unique symbol;
12
11
  export type FrozenKind = 'undefined' | 'NaN' | 'Infinity' | '-Infinity' | '-0' | 'bigint' | 'symbol' | 'function' | 'Proxy' | 'circular' | 'Date' | 'Error' | 'Buffer' | 'Promise' | 'Map' | 'Set' | 'accessor' | 'unserializable' | 'truncated' | 'instance' | 'hole';
13
12
  export type FrozenAtom = {
@@ -1 +1 @@
1
- {"version":3,"file":"value-freeze.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/value-freeze.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA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C,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AAsXF,eAAO,MAAM,YAAY,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,UACQ,CAAC;AAoBhE,eAAO,MAAM,kBAAkB,GAAI,UAAS,wBAA6B;oBA+ZjD,OAAO,KAAG,cAAc;;CA8B/C,CAAC"}
package/dist/index.js CHANGED
@@ -358,7 +358,7 @@ var setInstrumentationManifestOnDirty = (onDirty) => {
358
358
 
359
359
  // src/auto-instrumentation/schedule-instrumentation-manifest-upload.ts
360
360
  import {
361
- detectRelease,
361
+ parseReleaseSha,
362
362
  resolveEndpointUrls,
363
363
  uploadInstrumentationManifest
364
364
  } from "@rasputin-ai/core";
@@ -476,6 +476,8 @@ var unavailable = () => ({
476
476
  var noopHandle = {
477
477
  flushSoon() {
478
478
  },
479
+ start() {
480
+ },
479
481
  async wait() {
480
482
  },
481
483
  disconnect() {
@@ -488,7 +490,7 @@ var scheduleInstrumentationManifestUpload = (options) => {
488
490
  if (!options.enabled || !(options.projectApiKey ?? "").trim()) {
489
491
  return noopHandle;
490
492
  }
491
- const release = detectRelease({ release: options.release });
493
+ const release = parseReleaseSha(options.release);
492
494
  if (!release) return noopHandle;
493
495
  const { instrumentationManifestUrl } = resolveEndpointUrls(options.apiUrl);
494
496
  let inflight = Promise.resolve();
@@ -498,8 +500,12 @@ var scheduleInstrumentationManifestUpload = (options) => {
498
500
  let stopped = false;
499
501
  let working = false;
500
502
  let debounceTimer;
503
+ let retryTimer;
504
+ let failedAttempts = 0;
501
505
  const sessionAbort = new AbortController();
502
506
  const debounceMs = 500;
507
+ const retryMs = 3e3;
508
+ const maxAttempts = 5;
503
509
  const packageNamesOf = (manifest) => [
504
510
  ...new Set(
505
511
  manifest.functions.map((fn) => fn.source.packageName).filter((name) => Boolean(name))
@@ -525,6 +531,20 @@ var scheduleInstrumentationManifestUpload = (options) => {
525
531
  clearTimeout(debounceTimer);
526
532
  debounceTimer = void 0;
527
533
  };
534
+ const clearRetry = () => {
535
+ if (retryTimer === void 0) return;
536
+ clearTimeout(retryTimer);
537
+ retryTimer = void 0;
538
+ };
539
+ const armRetry = () => {
540
+ if (stopped || failedAttempts >= maxAttempts) return;
541
+ clearRetry();
542
+ retryTimer = setTimeout(() => {
543
+ retryTimer = void 0;
544
+ flushSoon();
545
+ }, retryMs);
546
+ retryTimer.unref?.();
547
+ };
528
548
  const flushSoon = () => {
529
549
  clearDebounce();
530
550
  if (stopped || !isInstrumentationManifestDirty() || working) return;
@@ -543,7 +563,7 @@ var scheduleInstrumentationManifestUpload = (options) => {
543
563
  continue;
544
564
  }
545
565
  const controller = new AbortController();
546
- const timeout = setTimeout(() => controller.abort(), 2e3);
566
+ const timeout = setTimeout(() => controller.abort(), 5e3);
547
567
  timeout.unref?.();
548
568
  const abortUpload = () => controller.abort();
549
569
  sessionAbort.signal.addEventListener("abort", abortUpload, { once: true });
@@ -572,6 +592,8 @@ var scheduleInstrumentationManifestUpload = (options) => {
572
592
  if (result.ok) {
573
593
  verification = result.verification;
574
594
  markInstrumentationManifestUploaded(generation);
595
+ failedAttempts = 0;
596
+ clearRetry();
575
597
  if (verification.status === "verified") {
576
598
  if (!loggedSuccess && options.logSuccess !== false) {
577
599
  loggedSuccess = true;
@@ -585,13 +607,21 @@ var scheduleInstrumentationManifestUpload = (options) => {
585
607
  }
586
608
  continue;
587
609
  }
588
- if (!loggedFailure) {
610
+ failedAttempts += 1;
611
+ if (failedAttempts >= maxAttempts && !loggedFailure) {
589
612
  loggedFailure = true;
590
613
  console.warn(report(manifest, false, unavailable()));
591
614
  }
615
+ armRetry();
592
616
  break;
593
617
  } catch {
594
618
  if (stopped) return;
619
+ failedAttempts += 1;
620
+ if (failedAttempts >= maxAttempts && !loggedFailure) {
621
+ loggedFailure = true;
622
+ console.warn(report(manifest, false, unavailable()));
623
+ }
624
+ armRetry();
595
625
  break;
596
626
  } finally {
597
627
  clearTimeout(timeout);
@@ -612,10 +642,15 @@ var scheduleInstrumentationManifestUpload = (options) => {
612
642
  }, debounceMs);
613
643
  debounceTimer.unref?.();
614
644
  };
615
- setInstrumentationManifestOnDirty(armFlush);
616
- if (isInstrumentationManifestDirty()) armFlush();
645
+ const start = () => {
646
+ if (stopped) return;
647
+ setInstrumentationManifestOnDirty(armFlush);
648
+ if (isInstrumentationManifestDirty()) armFlush();
649
+ };
650
+ if (!options.deferStart) start();
617
651
  return {
618
652
  flushSoon,
653
+ start,
619
654
  wait: async (timeoutMs) => {
620
655
  flushSoon();
621
656
  if (timeoutMs === void 0) {
@@ -639,6 +674,7 @@ var scheduleInstrumentationManifestUpload = (options) => {
639
674
  disconnect: () => {
640
675
  stopped = true;
641
676
  clearDebounce();
677
+ clearRetry();
642
678
  setInstrumentationManifestOnDirty(void 0);
643
679
  sessionAbort.abort();
644
680
  },
@@ -4169,7 +4205,7 @@ var installGlobalHandlers = (client, options = {}) => {
4169
4205
 
4170
4206
  // src/sdk-meta.ts
4171
4207
  var SDK_NAME = "@rasputin-ai/node";
4172
- var SDK_VERSION = "0.6.0";
4208
+ var SDK_VERSION = "0.6.2";
4173
4209
 
4174
4210
  // src/rasputin-init.ts
4175
4211
  var publicExecution = (runtime) => ({
@@ -1594,7 +1594,7 @@ import ts15 from "typescript";
1594
1594
  import { originalPositionFor as originalPositionFor2, TraceMap as TraceMap3 } from "@jridgewell/trace-mapping";
1595
1595
 
1596
1596
  // src/sdk-meta.ts
1597
- var SDK_VERSION = "0.6.0";
1597
+ var SDK_VERSION = "0.6.2";
1598
1598
 
1599
1599
  // src/auto-instrumentation/source-map-locations.ts
1600
1600
  import { readFileSync } from "node:fs";
@@ -1656,7 +1656,7 @@ import ts15 from "typescript";
1656
1656
  import { originalPositionFor as originalPositionFor3, TraceMap as TraceMap4 } from "@jridgewell/trace-mapping";
1657
1657
 
1658
1658
  // src/sdk-meta.ts
1659
- var SDK_VERSION = "0.6.0";
1659
+ var SDK_VERSION = "0.6.2";
1660
1660
 
1661
1661
  // src/auto-instrumentation/transform-disk-cache.ts
1662
1662
  var projectCacheDir = () => {
package/dist/internal.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // src/auto-instrumentation/schedule-instrumentation-manifest-upload.ts
2
2
  import {
3
- detectRelease,
3
+ parseReleaseSha,
4
4
  resolveEndpointUrls,
5
5
  uploadInstrumentationManifest
6
6
  } from "@rasputin-ai/core";
@@ -447,6 +447,8 @@ var unavailable = () => ({
447
447
  var noopHandle = {
448
448
  flushSoon() {
449
449
  },
450
+ start() {
451
+ },
450
452
  async wait() {
451
453
  },
452
454
  disconnect() {
@@ -459,7 +461,7 @@ var scheduleInstrumentationManifestUpload = (options) => {
459
461
  if (!options.enabled || !(options.projectApiKey ?? "").trim()) {
460
462
  return noopHandle;
461
463
  }
462
- const release = detectRelease({ release: options.release });
464
+ const release = parseReleaseSha(options.release);
463
465
  if (!release) return noopHandle;
464
466
  const { instrumentationManifestUrl } = resolveEndpointUrls(options.apiUrl);
465
467
  let inflight = Promise.resolve();
@@ -469,8 +471,12 @@ var scheduleInstrumentationManifestUpload = (options) => {
469
471
  let stopped = false;
470
472
  let working = false;
471
473
  let debounceTimer;
474
+ let retryTimer;
475
+ let failedAttempts = 0;
472
476
  const sessionAbort = new AbortController();
473
477
  const debounceMs = 500;
478
+ const retryMs = 3e3;
479
+ const maxAttempts = 5;
474
480
  const packageNamesOf = (manifest) => [
475
481
  ...new Set(
476
482
  manifest.functions.map((fn) => fn.source.packageName).filter((name) => Boolean(name))
@@ -496,6 +502,20 @@ var scheduleInstrumentationManifestUpload = (options) => {
496
502
  clearTimeout(debounceTimer);
497
503
  debounceTimer = void 0;
498
504
  };
505
+ const clearRetry = () => {
506
+ if (retryTimer === void 0) return;
507
+ clearTimeout(retryTimer);
508
+ retryTimer = void 0;
509
+ };
510
+ const armRetry = () => {
511
+ if (stopped || failedAttempts >= maxAttempts) return;
512
+ clearRetry();
513
+ retryTimer = setTimeout(() => {
514
+ retryTimer = void 0;
515
+ flushSoon();
516
+ }, retryMs);
517
+ retryTimer.unref?.();
518
+ };
499
519
  const flushSoon = () => {
500
520
  clearDebounce();
501
521
  if (stopped || !isInstrumentationManifestDirty() || working) return;
@@ -514,7 +534,7 @@ var scheduleInstrumentationManifestUpload = (options) => {
514
534
  continue;
515
535
  }
516
536
  const controller = new AbortController();
517
- const timeout = setTimeout(() => controller.abort(), 2e3);
537
+ const timeout = setTimeout(() => controller.abort(), 5e3);
518
538
  timeout.unref?.();
519
539
  const abortUpload = () => controller.abort();
520
540
  sessionAbort.signal.addEventListener("abort", abortUpload, { once: true });
@@ -543,6 +563,8 @@ var scheduleInstrumentationManifestUpload = (options) => {
543
563
  if (result.ok) {
544
564
  verification = result.verification;
545
565
  markInstrumentationManifestUploaded(generation);
566
+ failedAttempts = 0;
567
+ clearRetry();
546
568
  if (verification.status === "verified") {
547
569
  if (!loggedSuccess && options.logSuccess !== false) {
548
570
  loggedSuccess = true;
@@ -556,13 +578,21 @@ var scheduleInstrumentationManifestUpload = (options) => {
556
578
  }
557
579
  continue;
558
580
  }
559
- if (!loggedFailure) {
581
+ failedAttempts += 1;
582
+ if (failedAttempts >= maxAttempts && !loggedFailure) {
560
583
  loggedFailure = true;
561
584
  console.warn(report(manifest, false, unavailable()));
562
585
  }
586
+ armRetry();
563
587
  break;
564
588
  } catch {
565
589
  if (stopped) return;
590
+ failedAttempts += 1;
591
+ if (failedAttempts >= maxAttempts && !loggedFailure) {
592
+ loggedFailure = true;
593
+ console.warn(report(manifest, false, unavailable()));
594
+ }
595
+ armRetry();
566
596
  break;
567
597
  } finally {
568
598
  clearTimeout(timeout);
@@ -583,10 +613,15 @@ var scheduleInstrumentationManifestUpload = (options) => {
583
613
  }, debounceMs);
584
614
  debounceTimer.unref?.();
585
615
  };
586
- setInstrumentationManifestOnDirty(armFlush);
587
- if (isInstrumentationManifestDirty()) armFlush();
616
+ const start = () => {
617
+ if (stopped) return;
618
+ setInstrumentationManifestOnDirty(armFlush);
619
+ if (isInstrumentationManifestDirty()) armFlush();
620
+ };
621
+ if (!options.deferStart) start();
588
622
  return {
589
623
  flushSoon,
624
+ start,
590
625
  wait: async (timeoutMs) => {
591
626
  flushSoon();
592
627
  if (timeoutMs === void 0) {
@@ -610,6 +645,7 @@ var scheduleInstrumentationManifestUpload = (options) => {
610
645
  disconnect: () => {
611
646
  stopped = true;
612
647
  clearDebounce();
648
+ clearRetry();
613
649
  setInstrumentationManifestOnDirty(void 0);
614
650
  sessionAbort.abort();
615
651
  },
@@ -1,4 +1,4 @@
1
1
  /** Generated by scripts/generate-sdk-meta.ts — do not edit. */
2
2
  export declare const SDK_NAME = "@rasputin-ai/node";
3
- export declare const SDK_VERSION = "0.6.0";
3
+ export declare const SDK_VERSION = "0.6.2";
4
4
  //# sourceMappingURL=sdk-meta.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rasputin-ai/node",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Official Rasputin AI SDK for Node and Bun.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@jridgewell/trace-mapping": "0.3.31",
52
- "@rasputin-ai/core": "0.6.0",
52
+ "@rasputin-ai/core": "0.6.2",
53
53
  "typescript": "5"
54
54
  },
55
55
  "devDependencies": {