@rasputin-ai/node 0.12.1 → 0.13.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.
Files changed (50) hide show
  1. package/dist/auto-instrumentation/bun-plugin.d.ts.map +1 -1
  2. package/dist/auto-instrumentation/instrument-compiled-esm.d.ts.map +1 -1
  3. package/dist/auto-instrumentation/instrumentation-manifest-registry.d.ts +2 -1
  4. package/dist/auto-instrumentation/instrumentation-manifest-registry.d.ts.map +1 -1
  5. package/dist/auto-instrumentation/node-hooks.d.ts.map +1 -1
  6. package/dist/auto-instrumentation/transform-disk-cache.d.ts.map +1 -1
  7. package/dist/execution-recorder/bind-adaptive-recorder.d.ts +4 -2
  8. package/dist/execution-recorder/bind-adaptive-recorder.d.ts.map +1 -1
  9. package/dist/execution-recorder/execution-recorder-hooks.d.ts +3 -0
  10. package/dist/execution-recorder/execution-recorder-hooks.d.ts.map +1 -1
  11. package/dist/execution-recorder/execution-recorder-types.d.ts +1 -2
  12. package/dist/execution-recorder/execution-recorder-types.d.ts.map +1 -1
  13. package/dist/execution-recorder/execution-recorder.d.ts.map +1 -1
  14. package/dist/execution-recorder/execution-recording-sync.d.ts +2 -2
  15. package/dist/execution-recorder/execution-recording-sync.d.ts.map +1 -1
  16. package/dist/execution-recorder/function-plan.d.ts +3 -1
  17. package/dist/execution-recorder/function-plan.d.ts.map +1 -1
  18. package/dist/function-metrics/bind-function-metrics.d.ts +19 -0
  19. package/dist/function-metrics/bind-function-metrics.d.ts.map +1 -0
  20. package/dist/function-metrics/create-metrics-only-runtime.d.ts +4 -0
  21. package/dist/function-metrics/create-metrics-only-runtime.d.ts.map +1 -0
  22. package/dist/function-metrics/encode-function-metrics-upload.d.ts +14 -0
  23. package/dist/function-metrics/encode-function-metrics-upload.d.ts.map +1 -0
  24. package/dist/function-metrics/function-metric-declaration-registry.d.ts +9 -0
  25. package/dist/function-metrics/function-metric-declaration-registry.d.ts.map +1 -0
  26. package/dist/function-metrics/function-metrics-batches.d.ts +35 -0
  27. package/dist/function-metrics/function-metrics-batches.d.ts.map +1 -0
  28. package/dist/function-metrics/function-metrics-collector.d.ts +45 -0
  29. package/dist/function-metrics/function-metrics-collector.d.ts.map +1 -0
  30. package/dist/function-metrics/function-metrics-exporter.d.ts +23 -0
  31. package/dist/function-metrics/function-metrics-exporter.d.ts.map +1 -0
  32. package/dist/function-metrics/install-function-metric-declaration-sink.d.ts +2 -0
  33. package/dist/function-metrics/install-function-metric-declaration-sink.d.ts.map +1 -0
  34. package/dist/function-metrics/intern-prepared-metrics.d.ts +4 -0
  35. package/dist/function-metrics/intern-prepared-metrics.d.ts.map +1 -0
  36. package/dist/function-metrics/send-function-metrics-batch.d.ts +25 -0
  37. package/dist/function-metrics/send-function-metrics-batch.d.ts.map +1 -0
  38. package/dist/function-metrics/settle-function-metrics.d.ts +5 -0
  39. package/dist/function-metrics/settle-function-metrics.d.ts.map +1 -0
  40. package/dist/index.js +1624 -147
  41. package/dist/instrument/build.js +458 -162
  42. package/dist/instrument/bun.js +454 -132
  43. package/dist/instrument/node.js +452 -132
  44. package/dist/internal.d.ts +2 -0
  45. package/dist/internal.d.ts.map +1 -1
  46. package/dist/internal.js +1600 -139
  47. package/dist/rasputin-init.d.ts +17 -4
  48. package/dist/rasputin-init.d.ts.map +1 -1
  49. package/dist/sdk-meta.d.ts +1 -1
  50. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { type RasputinClient, type RasputinClientStats, type RasputinOptions, type SourceVerification } from '@rasputin-ai/core';
1
+ import { type FunctionMetricsOptions, type RasputinClient, type RasputinClientStats, type RasputinOptions, type SourceVerification, type TransportFetch } from '@rasputin-ai/core';
2
2
  import { type ExecutionRecorderOptions, type ExecutionRecorderStats, type RasputinExecution } from './execution-recorder';
3
3
  export type RasputinNodeOptions = RasputinOptions & {
4
4
  /**
@@ -24,6 +24,17 @@ export type RasputinNodeOptions = RasputinOptions & {
24
24
  * Set false when the host owns process shutdown.
25
25
  */
26
26
  installTransportSignalHandlers?: boolean;
27
+ /**
28
+ * Function-level counts, failures, and duration histograms. On with a
29
+ * valid client. Set `enabled: false` to turn them off. Independent of
30
+ * `executionRecorder`. A build key is optional; omit it to use the
31
+ * server artifact id or a process fallback.
32
+ */
33
+ functionMetrics?: FunctionMetricsOptions;
34
+ };
35
+ /** @internal Test seams omitted from the published declaration surface. */
36
+ type RasputinNodeHooks = {
37
+ fetch?: TransportFetch;
27
38
  };
28
39
  export type RasputinNodeClientStats = RasputinClientStats & {
29
40
  /** What this process has recorded since it started. See `ExecutionRecorderStats`. */
@@ -48,9 +59,11 @@ export type RasputinNodeClient = Omit<RasputinClient, 'getStats'> & {
48
59
  * dsn: process.env.RASPUTIN_DSN!,
49
60
  * projectApiKey: process.env.RASPUTIN_PROJECT_API_KEY!,
50
61
  * release: process.env.RASPUTIN_RELEASE!,
51
- * environment: process.env.NODE_ENV ?? 'development',
52
- * enabled: ['staging', 'production'].includes(process.env.NODE_ENV ?? 'development'),
62
+ * environment: 'production',
53
63
  * });
54
64
  */
55
- export declare const RasputinInit: (options: RasputinNodeOptions) => RasputinNodeClient;
65
+ export declare function RasputinInit(options: RasputinNodeOptions): RasputinNodeClient;
66
+ /** @internal Test overload; omitted from the published declaration surface. */
67
+ export declare function RasputinInit(options: RasputinNodeOptions, hooks: RasputinNodeHooks): RasputinNodeClient;
68
+ export {};
56
69
  //# 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,EACpB,KAAK,kBAAkB,EACvB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAEN,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAE3B,KAAK,iBAAiB,EACtB,MAAM,sBAAsB,CAAC;AAO9B,MAAM,MAAM,mBAAmB,GAAG,e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IAChC;;;OAGG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;IACzC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,sBAAsB,CAAC;CACzC,CAAC;AAEF,2EAA2E;AAC3E,KAAK,iBAAiB,GAAG;IACxB,KAAK,CAAC,EAAE,cAAc,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,GAAG;IAC3D,qFAAqF;IACrF,QAAQ,EAAE,sBAAsB,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,GAAG;IACnE,+EAA+E;IAC/E,SAAS,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,EAAE,MAAM,uBAAuB,CAAC;IACxC;;;OAGG;IACH,mBAAmB,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACvD,CAAC;AAwEF;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,kBAAkB,CAAC;AAC/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.12.1";
3
+ export declare const SDK_VERSION = "0.13.1";
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.12.1",
3
+ "version": "0.13.1",
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.12.1",
52
+ "@rasputin-ai/core": "0.13.1",
53
53
  "typescript": "5"
54
54
  },
55
55
  "devDependencies": {