@rasputin-ai/node 0.16.0 → 1.0.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 (33) hide show
  1. package/dist/auto-instrumentation/instrumentation-manifest-registry.d.ts.map +1 -1
  2. package/dist/auto-instrumentation/schedule-instrumentation-manifest-upload.d.ts.map +1 -1
  3. package/dist/create-rasputin-runtime.d.ts +72 -0
  4. package/dist/create-rasputin-runtime.d.ts.map +1 -0
  5. package/dist/execution-metrics/encode-execution-metrics-upload.d.ts.map +1 -1
  6. package/dist/execution-metrics/execution-metrics-collector.d.ts +3 -3
  7. package/dist/execution-metrics/execution-metrics-collector.d.ts.map +1 -1
  8. package/dist/execution-recorder/adaptive-recording-options.d.ts +3 -0
  9. package/dist/execution-recorder/adaptive-recording-options.d.ts.map +1 -1
  10. package/dist/execution-recorder/bind-adaptive-recorder.d.ts.map +1 -1
  11. package/dist/execution-recorder/execution-journal.d.ts +16 -1
  12. package/dist/execution-recorder/execution-journal.d.ts.map +1 -1
  13. package/dist/execution-recorder/execution-recorder-types.d.ts +18 -13
  14. package/dist/execution-recorder/execution-recorder-types.d.ts.map +1 -1
  15. package/dist/execution-recorder/execution-recorder.d.ts.map +1 -1
  16. package/dist/execution-recorder/execution-recording-sync.d.ts +0 -1
  17. package/dist/execution-recorder/execution-recording-sync.d.ts.map +1 -1
  18. package/dist/execution-recorder/runtime-state-size-budget.d.ts +3 -3
  19. package/dist/execution-recorder/runtime-state-size-budget.d.ts.map +1 -1
  20. package/dist/function-metrics/create-metrics-only-runtime.d.ts.map +1 -1
  21. package/dist/function-metrics/function-metrics-collector.d.ts.map +1 -1
  22. package/dist/index.js +878 -412
  23. package/dist/instrument/build.js +211 -355
  24. package/dist/instrument/bun.js +135 -246
  25. package/dist/instrument/node.js +135 -246
  26. package/dist/internal.d.ts +2 -0
  27. package/dist/internal.d.ts.map +1 -1
  28. package/dist/internal.js +983 -341
  29. package/dist/rasputin-init.d.ts +7 -60
  30. package/dist/rasputin-init.d.ts.map +1 -1
  31. package/dist/sdk-meta.d.ts +1 -1
  32. package/dist/sdk-meta.d.ts.map +1 -1
  33. package/package.json +3 -3
@@ -1,62 +1,3 @@
1
- import { type RasputinClient, type RasputinClientStats, type RasputinOptions, type SourceVerification, type TransportFetch } from '@rasputin-ai/core';
2
- import { type ExecutionRecorderOptions, type ExecutionRecorderStats, type RasputinExecution } from './execution-recorder';
3
- export type RasputinNodeOptions = RasputinOptions & {
4
- /**
5
- * Limits and redaction for the runtime recorder. Recording is on unless you
6
- * set `enabled: false`. Successful requests and jobs are not kept.
7
- */
8
- executionRecorder?: ExecutionRecorderOptions;
9
- /**
10
- * Path to the JSON file `rasputin-instrument` writes at build time.
11
- * Defaults to `RASPUTIN_INSTRUMENTATION_MANIFEST`, or
12
- * `.rasputin/instrumentation-manifest.json` in the current working directory.
13
- */
14
- instrumentationManifestPath?: string;
15
- /**
16
- * Observe `uncaughtException` / nonfatal `unhandledRejection`. Default true.
17
- * Rasputin does not become the host crash/recovery owner: it exits only when
18
- * it is the sole `uncaughtException` listener. Set false when the host owns
19
- * process diagnostics.
20
- */
21
- installGlobalHandlers?: boolean;
22
- /**
23
- * Install SIGINT / SIGTERM / beforeExit flush hooks. Default true.
24
- * Set false when the host owns process shutdown.
25
- */
26
- installTransportSignalHandlers?: boolean;
27
- /**
28
- * Measure durations on a progressive schedule shared by function metrics,
29
- * execution metrics, and lightweight execution recording. Default false
30
- * times every eligible call and execution. True counts every call,
31
- * execution, and failure, and times a subset. Function durations are
32
- * keyed by function, direct caller, and execution type. Execution
33
- * durations use a separate counter per execution type so they cannot
34
- * move function sampling. Counters reset hourly. After 5,000 samples
35
- * the tail rate still samples. Selected sessions, activations, and full
36
- * capture still record every duration; metric duration statistics follow
37
- * this schedule so incident traffic does not bias aggregates. Invalid
38
- * values are treated as false.
39
- */
40
- dynamicDurationSampling?: boolean;
41
- };
42
- /** @internal Test seams omitted from the published declaration surface. */
43
- type RasputinNodeHooks = {
44
- fetch?: TransportFetch;
45
- };
46
- export type RasputinNodeClientStats = RasputinClientStats & {
47
- /** What this process has recorded since it started. See `ExecutionRecorderStats`. */
48
- recorder: ExecutionRecorderStats;
49
- };
50
- export type RasputinNodeClient = Omit<RasputinClient, 'getStats'> & {
51
- /** Wrap background jobs, inspect recorder stats, or mark functions by hand. */
52
- execution: RasputinExecution;
53
- getStats: () => RasputinNodeClientStats;
54
- /**
55
- * Check that every recorded source file maps to the Git commit in `release`.
56
- * Call this from a deploy check, not on every request.
57
- */
58
- verifyConfiguration: () => Promise<SourceVerification>;
59
- };
60
1
  /**
61
2
  * Boot the Node/Bun SDK: client + process global handlers.
62
3
  * Call once at process start. Never throws into the host app.
@@ -69,8 +10,14 @@ export type RasputinNodeClient = Omit<RasputinClient, 'getStats'> & {
69
10
  * environment: 'production',
70
11
  * });
71
12
  */
13
+ import type { TransportFetch } from '@rasputin-ai/core';
14
+ import { type RasputinNodeClient, type RasputinNodeOptions } from './create-rasputin-runtime';
15
+ export type { RasputinNodeClient, RasputinNodeClientStats, RasputinNodeOptions, } from './create-rasputin-runtime';
16
+ /** @internal Test seams omitted from the published declaration surface. */
17
+ type RasputinNodeHooks = {
18
+ fetch?: TransportFetch;
19
+ };
72
20
  export declare function RasputinInit(options: RasputinNodeOptions): RasputinNodeClient;
73
21
  /** @internal Test overload; omitted from the published declaration surface. */
74
22
  export declare function RasputinInit(options: RasputinNodeOptions, hooks: RasputinNodeHooks): RasputinNodeClient;
75
- export {};
76
23
  //# sourceMappingURL=rasputin-init.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rasputin-init.d.ts","sourceRoot":"","sources":["../src/rasputin-init.ts"],"names":[],"mappings":"AAMA,OAAO,EAKN,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EAEpB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAEN,KAAK,wBAAwB,EAC7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,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,MAAM,2BAA2B,CAAC;AAGnC,YAAY,EACX,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,GACnB,MAAM,2BAA2B,CAAC;AAEnC,2EAA2E;AAC3E,KAAK,iBAAiB,GAAG;IACxB,KAAK,CAAC,EAAE,cAAc,CAAC;CACvB,CAAC;AAEF,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,kBAAkB,CAAC;AAE/E,+EAA+E;AAC/E,wBAAgB,YAAY,CAC3B,OAAO,EAAE,mBAAmB,EAC5B,KAAK,EAAE,iBAAiB,GACtB,kBAAkB,CAAC"}
@@ -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.16.0";
3
+ export declare const SDK_VERSION = "1.0.0";
4
4
  //# sourceMappingURL=sdk-meta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk-meta.d.ts","sourceRoot":"","sources":["../src/sdk-meta.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,eAAO,MAAM,QAAQ,sBAAsB,CAAC;AAC5C,eAAO,MAAM,WAAW,WAAW,CAAC"}
1
+ {"version":3,"file":"sdk-meta.d.ts","sourceRoot":"","sources":["../src/sdk-meta.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,eAAO,MAAM,QAAQ,sBAAsB,CAAC;AAC5C,eAAO,MAAM,WAAW,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rasputin-ai/node",
3
- "version": "0.16.0",
3
+ "version": "1.0.0",
4
4
  "description": "Official Rasputin AI SDK for Node and Bun.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -49,14 +49,14 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@jridgewell/trace-mapping": "0.3.31",
52
- "@rasputin-ai/core": "0.16.0",
52
+ "@rasputin-ai/core": "1.0.0",
53
53
  "typescript": "5"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@rasputin-ai/core": "workspace:*",
57
57
  "@rasputin-ai/instrumentation": "workspace:*",
58
58
  "@rasputin-ai/recorder": "workspace:*",
59
- "@types/bun": "1.3.14",
59
+ "@types/bun": "1.4.5",
60
60
  "@types/node": "22.13.10",
61
61
  "esbuild": "0.25.12"
62
62
  }