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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +219 -188
  2. package/dist/auto-instrumentation/bun-plugin.d.ts.map +1 -1
  3. package/dist/auto-instrumentation/format-configuration-report.d.ts +4 -0
  4. package/dist/auto-instrumentation/format-configuration-report.d.ts.map +1 -1
  5. package/dist/auto-instrumentation/instrument-compiled-esm.d.ts +1 -3
  6. package/dist/auto-instrumentation/instrument-compiled-esm.d.ts.map +1 -1
  7. package/dist/auto-instrumentation/instrumentation-manifest-delta.d.ts +10 -2
  8. package/dist/auto-instrumentation/instrumentation-manifest-delta.d.ts.map +1 -1
  9. package/dist/auto-instrumentation/instrumentation-manifest-registry.d.ts +6 -0
  10. package/dist/auto-instrumentation/instrumentation-manifest-registry.d.ts.map +1 -1
  11. package/dist/auto-instrumentation/node-hooks.d.ts.map +1 -1
  12. package/dist/auto-instrumentation/parameter-initializer-may-run-code.d.ts +3 -0
  13. package/dist/auto-instrumentation/parameter-initializer-may-run-code.d.ts.map +1 -0
  14. package/dist/auto-instrumentation/schedule-instrumentation-manifest-upload.d.ts +1 -1
  15. package/dist/auto-instrumentation/schedule-instrumentation-manifest-upload.d.ts.map +1 -1
  16. package/dist/auto-instrumentation/source-map-locations.d.ts +1 -0
  17. package/dist/auto-instrumentation/source-map-locations.d.ts.map +1 -1
  18. package/dist/auto-instrumentation/suspension-whitelist.d.ts +33 -0
  19. package/dist/auto-instrumentation/suspension-whitelist.d.ts.map +1 -0
  20. package/dist/auto-instrumentation/transform-disk-cache.d.ts +7 -0
  21. package/dist/auto-instrumentation/transform-disk-cache.d.ts.map +1 -0
  22. package/dist/auto-instrumentation/transform-source.d.ts +9 -6
  23. package/dist/auto-instrumentation/transform-source.d.ts.map +1 -1
  24. package/dist/auto-instrumentation/verify-instrumentation-isomorphism.d.ts +2 -0
  25. package/dist/auto-instrumentation/verify-instrumentation-isomorphism.d.ts.map +1 -0
  26. package/dist/auto-instrumentation/verify-transformed-source.d.ts +2 -0
  27. package/dist/auto-instrumentation/verify-transformed-source.d.ts.map +1 -0
  28. package/dist/execution-recorder/automatic-runtime.d.ts +17 -7
  29. package/dist/execution-recorder/automatic-runtime.d.ts.map +1 -1
  30. package/dist/execution-recorder/encode-frozen.d.ts +16 -0
  31. package/dist/execution-recorder/encode-frozen.d.ts.map +1 -0
  32. package/dist/execution-recorder/execution-journal.d.ts.map +1 -1
  33. package/dist/execution-recorder/execution-recorder-types.d.ts +124 -36
  34. package/dist/execution-recorder/execution-recorder-types.d.ts.map +1 -1
  35. package/dist/execution-recorder/execution-recorder.d.ts +2 -2
  36. package/dist/execution-recorder/execution-recorder.d.ts.map +1 -1
  37. package/dist/execution-recorder/function-plan.d.ts +8 -1
  38. package/dist/execution-recorder/function-plan.d.ts.map +1 -1
  39. package/dist/execution-recorder/index.d.ts +1 -1
  40. package/dist/execution-recorder/index.d.ts.map +1 -1
  41. package/dist/execution-recorder/recorder-memory-budget.d.ts +1 -0
  42. package/dist/execution-recorder/recorder-memory-budget.d.ts.map +1 -1
  43. package/dist/execution-recorder/redact-keys.d.ts +4 -0
  44. package/dist/execution-recorder/redact-keys.d.ts.map +1 -0
  45. package/dist/execution-recorder/run-exactly-once.d.ts +7 -0
  46. package/dist/execution-recorder/run-exactly-once.d.ts.map +1 -0
  47. package/dist/execution-recorder/runtime-state-size-budget.d.ts +14 -0
  48. package/dist/execution-recorder/runtime-state-size-budget.d.ts.map +1 -0
  49. package/dist/execution-recorder/safe-serialize.d.ts +9 -3
  50. package/dist/execution-recorder/safe-serialize.d.ts.map +1 -1
  51. package/dist/execution-recorder/value-freeze.d.ts +43 -0
  52. package/dist/execution-recorder/value-freeze.d.ts.map +1 -0
  53. package/dist/execution-recorder/warn-missing-async-context-frame.d.ts +10 -0
  54. package/dist/execution-recorder/warn-missing-async-context-frame.d.ts.map +1 -0
  55. package/dist/index.d.ts +1 -6
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +2612 -893
  58. package/dist/install-global-handlers.d.ts +29 -8
  59. package/dist/install-global-handlers.d.ts.map +1 -1
  60. package/dist/instrument/build.js +947 -805
  61. package/dist/instrument/bun.js +1098 -778
  62. package/dist/instrument/node.js +1078 -780
  63. package/dist/internal.d.ts +7 -0
  64. package/dist/internal.d.ts.map +1 -0
  65. package/dist/internal.js +4072 -0
  66. package/dist/rasputin-init.d.ts +25 -5
  67. package/dist/rasputin-init.d.ts.map +1 -1
  68. package/dist/sdk-meta.d.ts +1 -1
  69. package/dist/sdk-meta.d.ts.map +1 -1
  70. package/package.json +8 -3
  71. package/dist/derivation/analyze-function.d.ts +0 -42
  72. package/dist/derivation/analyze-function.d.ts.map +0 -1
  73. package/dist/derivation/build-dependency-graph.d.ts +0 -21
  74. package/dist/derivation/build-dependency-graph.d.ts.map +0 -1
  75. package/dist/derivation/derivation-ir.d.ts +0 -33
  76. package/dist/derivation/derivation-ir.d.ts.map +0 -1
  77. package/dist/derivation/derivation-proof.d.ts +0 -14
  78. package/dist/derivation/derivation-proof.d.ts.map +0 -1
  79. package/dist/derivation/emit-capture-plan.d.ts +0 -8
  80. package/dist/derivation/emit-capture-plan.d.ts.map +0 -1
@@ -1,18 +1,39 @@
1
1
  import type { RasputinClient } from '@rasputin-ai/core';
2
2
  export type InstallGlobalHandlersOptions = {
3
3
  /**
4
- * When we are the only `uncaughtException` listener, flush then `process.exit(1)`
5
- * (Node's default is suppressed by any listener). When other listeners exist,
6
- * capture + flush only — they own graceful shutdown / exit.
4
+ * If Rasputin is the only `uncaughtException` listener, flush then exit the
5
+ * process (Node does this by default when nobody is listening). If you have
6
+ * other listeners, Rasputin only reports the error and leaves shutdown to you.
7
7
  */
8
8
  exitOnUncaughtException?: boolean;
9
- /** Flush budget before exit. Default 2000ms. */
9
+ /** How long to wait for queued events before exiting. Default: 2000 ms. */
10
10
  flushTimeoutMs?: number;
11
11
  };
12
+ type HandlerClient = Pick<RasputinClient, 'captureException' | 'flush'>;
12
13
  /**
13
- * Capture process-level failures outside any request handler.
14
- * `uncaughtException`: capture → flush → exit only if we are the sole listener.
15
- * `unhandledRejection`: capture only (do not exit).
14
+ * Observe process-level failures without becoming the host crash/recovery owner.
15
+ *
16
+ * On Node in the default `throw` / `strict` unhandled-rejection modes, Rasputin
17
+ * does not install `unhandledRejection`. Node then converts the rejection to
18
+ * `uncaughtException` the same way it would without Rasputin, so an existing
19
+ * recoverer still runs and a late `rejectionHandled` is unchanged. Capture
20
+ * happens on `uncaughtException`. Rasputin exits only when no host
21
+ * `uncaughtException` listener is present. Other Rasputin installations in the
22
+ * same process share this listener and are not treated as host recovery.
23
+ *
24
+ * In `warn`, `none`, and `warn-with-error-code`, installing a listener does
25
+ * not change exit policy. Rasputin observes only: it never calls
26
+ * `process.exit` for a rejection, prints when it is the sole host listener and
27
+ * Node would have printed, and sets `exitCode` only for `warn-with-error-code`.
28
+ *
29
+ * Bun is not forced onto Node's conversion model. Bun continues after
30
+ * unhandled rejections even in `throw` / `strict`; Rasputin observes a
31
+ * converted `uncaughtException` but does not exit.
32
+ *
33
+ * Disable this from `RasputinInit({ installGlobalHandlers: false })` when the
34
+ * host owns process diagnostics. SIGINT / SIGTERM / beforeExit flush hooks are
35
+ * separate: `RasputinInit({ installTransportSignalHandlers: false })`.
16
36
  */
17
- export declare const installGlobalHandlers: (client: Pick<RasputinClient, "captureException" | "flush">, options?: InstallGlobalHandlersOptions) => (() => void);
37
+ export declare const installGlobalHandlers: (client: HandlerClient, options?: InstallGlobalHandlersOptions) => (() => void);
38
+ export {};
18
39
  //# sourceMappingURL=install-global-handlers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"install-global-handlers.d.ts","sourceRoot":"","sources":["../src/install-global-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,MAAM,4BAA4B,GAAG;IAC1C;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,gDAAgD;IAChD,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAQF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GACjC,QAAQ,IAAI,CAAC,cAAc,EAAE,kBAAkB,GAAG,OAAO,CAAC,EAC1D,UAAS,4BAAiC,KACxC,CAAC,MAAM,IAAI,CAuDb,CAAC"}
1
+ {"version":3,"file":"install-global-handlers.d.ts","sourceRoot":"","sources":["../src/install-global-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,MAAM,4BAA4B,GAAG;IAC1C;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAsDF,KAAK,aAAa,GAAG,IAAI,CAAC,cAAc,EAAE,kBAAkB,GAAG,OAAO,CAAC,CAAC;AA+GxE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,qBAAqB,GACjC,QAAQ,aAAa,EACrB,UAAS,4BAAiC,KACxC,CAAC,MAAM,IAAI,CAcb,CAAC"}