@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,14 +1,17 @@
1
+ /**
2
+ * Shared source transformer for every runtime adapter. Keeping event injection independent from Bun,
3
+ * Node, and future build-tool integrations is what lets each environment produce the same execution
4
+ * tree and keeps recorder semantics from drifting between platforms.
5
+ */
1
6
  import type { InstrumentationManifestDelta } from './instrumentation-manifest-delta';
2
- export type DerivationCaptureMode = 'analysis' | 'selective';
3
7
  export type TransformSourceOptions = {
4
8
  filePath: string;
5
9
  mapLocation?: SourceLocationMapper;
6
- /**
7
- * analysis (default): full call capture plus derivation.
8
- * selective (experimental): omit argument/return serialization for exact helpers.
9
- */
10
- derivationMode?: DerivationCaptureMode;
10
+ verifyTransform?: boolean;
11
11
  };
12
+ export declare const RASPUTIN_INSTRUMENTATION_MARKER = "rasputin.instrumented.v3";
13
+ export declare const RASPUTIN_INSTRUMENTATION_PREAMBLE = "/*rasputin.instrumented.v3*/";
14
+ export declare const sourceIsRasputinInstrumented: (source: string) => boolean;
12
15
  export type TransformedSource = {
13
16
  code: string;
14
17
  delta: InstrumentationManifestDelta;
@@ -1 +1 @@
1
- {"version":3,"file":"transform-source.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/transform-source.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACX,4BAA4B,EAE5B,MAAM,kCAAkC,CAAC;AAI1C,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,WAAW,CAAC;AAE7D,MAAM,MAAM,sBAAsB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC;;;OAGG;IACH,cAAc,CAAC,EAAE,qBAAqB,CAAC;CACvC,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;AA6J5F,6FAA6F;AAC7F,eAAO,MAAM,eAAe,GAC3B,QAAQ,MAAM,EACd,SAAS,sBAAsB,KAC7B,iBAAiB,GAAG,SAqItB,CAAC"}
1
+ {"version":3,"file":"transform-source.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/transform-source.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAgBH,OAAO,KAAK,EACX,4BAA4B,EAE5B,MAAM,kCAAkC,CAAC;AAwC1C,MAAM,MAAM,sBAAsB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,+BAA+B,6BAA6B,CAAC;AAC1E,eAAO,MAAM,iCAAiC,iCAA2C,CAAC;AAE1F,eAAO,MAAM,4BAA4B,GAAI,QAAQ,MAAM,KAAG,OACX,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,4BAA4B,CAAC;CACpC,CAAC;AAOF,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;AA6d5F,6FAA6F;AAC7F,eAAO,MAAM,eAAe,GAC3B,QAAQ,MAAM,EACd,SAAS,sBAAsB,KAC7B,iBAAiB,GAAG,SAwOtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const instrumentationTreesAreIsomorphic: (filePath: string, original: string, transformed: string) => boolean;
2
+ //# sourceMappingURL=verify-instrumentation-isomorphism.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify-instrumentation-isomorphism.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/verify-instrumentation-isomorphism.ts"],"names":[],"mappings":"AA8KA,eAAO,MAAM,iCAAiC,GAC7C,UAAU,MAAM,EAChB,UAAU,MAAM,EAChB,aAAa,MAAM,KACjB,OAGF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const transformedSourceIsInvalid: (filePath: string, code: string) => boolean;
2
+ //# sourceMappingURL=verify-transformed-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify-transformed-source.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/verify-transformed-source.ts"],"names":[],"mappings":"AAuIA,eAAO,MAAM,0BAA0B,GAAI,UAAU,MAAM,EAAE,MAAM,MAAM,KAAG,OAgB3E,CAAC"}
@@ -3,12 +3,24 @@
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 { RasputinExecution } from './execution-recorder-types';
6
+ import type { ExecutionRuntime } from './execution-recorder-types';
7
7
  import type { EncodedFunctionPlan } from './function-plan';
8
- export declare const AUTOMATIC_RUNTIME_SYMBOL = "rasputin.execution.runtime.v2";
9
- type ModuleRunner = <T>(planIndex: number, args: ArrayLike<unknown>, callback: () => T, omitValues?: boolean) => T;
8
+ export declare const AUTOMATIC_RUNTIME_SYMBOL = "rasputin.execution.runtime.v3";
9
+ type CallHandle = {
10
+ leave: (value?: unknown) => unknown;
11
+ fail: (error: unknown, liveArgs?: ArrayLike<unknown>) => void;
12
+ end: () => void;
13
+ run: <T>(callback: () => T) => T;
14
+ suspend: (value?: unknown) => unknown;
15
+ resume: (value?: unknown) => unknown;
16
+ };
17
+ type ModuleRun = <T>(planIndex: number, args: ArrayLike<unknown>, callback: () => T, omitValues?: boolean) => T;
18
+ type ModuleRunner = ModuleRun & {
19
+ enter: (planIndex: number, args: ArrayLike<unknown>, omitValues?: boolean) => CallHandle;
20
+ };
10
21
  type DispatchCell = {
11
- run: ModuleRunner;
22
+ run: ModuleRun;
23
+ enter: ModuleRunner['enter'];
12
24
  };
13
25
  type RegisteredModule = {
14
26
  plans: readonly EncodedFunctionPlan[];
@@ -16,17 +28,15 @@ type RegisteredModule = {
16
28
  };
17
29
  type AutomaticRuntime = {
18
30
  bind: (module: RegisteredModule) => void;
19
- captureRoot: (rootId: number, value: unknown) => unknown;
20
31
  };
21
32
  type AutomaticRuntimeRegistry = {
22
33
  runtimes: AutomaticRuntime[];
23
34
  modules: RegisteredModule[];
24
35
  register: (plans: readonly EncodedFunctionPlan[]) => ModuleRunner;
25
- captureRoot: (rootId: number, value: unknown) => unknown;
26
36
  };
27
37
  export declare const getAutomaticRuntimeRegistry: () => AutomaticRuntimeRegistry;
28
38
  export declare const resetAutomaticExecutionRuntime: () => void;
29
39
  /** Connect transformed application functions to this SDK instance. */
30
- export declare const installAutomaticExecutionRuntime: (execution: RasputinExecution) => (() => void);
40
+ export declare const installAutomaticExecutionRuntime: (execution: ExecutionRuntime) => (() => void);
31
41
  export {};
32
42
  //# sourceMappingURL=automatic-runtime.d.ts.map
@@ -1 +1 @@
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,EACrB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,EACxB,QAAQ,EAAE,MAAM,CAAC,EACjB,UAAU,CAAC,EAAE,OAAO,KAChB,CAAC,CAAC;AAEP,KAAK,YAAY,GAAG;IACnB,GAAG,EAAE,YAAY,CAAC;CAClB,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACvB,KAAK,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACtC,IAAI,EAAE,YAAY,CAAC;CACnB,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACvB,IAAI,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACzC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CACzD,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC/B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,OAAO,EAAE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,EAAE,MAAM,CAAC,EACjB,UAAU,CAAC,EAAE,OAAO,KAChB,CAAC,CAAC;AAEP,KAAK,YAAY,GAAG,SAAS,GAAG;IAC/B,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,EAAE,OAAO,KAAK,UAAU,CAAC;CACzF,CAAC;AAEF,KAAK,YAAY,GAAG;IACnB,GAAG,EAAE,SAAS,CAAC;IACf,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;CAC7B,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACvB,KAAK,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACtC,IAAI,EAAE,YAAY,CAAC;CACnB,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACvB,IAAI,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC/B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,mBAAmB,EAAE,KAAK,YAAY,CAAC;CAClE,CAAC;AAgEF,eAAO,MAAM,2BAA2B,QAAO,wBAS9C,CAAC;AAEF,eAAO,MAAM,8BAA8B,QAAO,IAEjD,CAAC;AAEF,sEAAsE;AACtE,eAAO,MAAM,gCAAgC,GAAI,WAAW,gBAAgB,KAAG,CAAC,MAAM,IAAI,CAkBzF,CAAC"}
@@ -0,0 +1,16 @@
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
+ export declare const jsonLiteralUtf8Bytes: (value: unknown) => number;
10
+ export declare const encodeFrozen: (value: unknown) => unknown;
11
+ export declare const encodeFrozenWithBytes: (frozen: unknown, visitedNodes: number, maxSerializedValueBytes: number) => {
12
+ value: unknown;
13
+ bytes: number;
14
+ visitedNodes: number;
15
+ };
16
+ //# sourceMappingURL=encode-frozen.d.ts.map
@@ -0,0 +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;AAEF,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;CAiBvD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"execution-journal.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/execution-journal.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAG5D,eAAO,MAAM,SAAS,IAAI,CAAC;AAC3B,eAAO,MAAM,UAAU,IAAI,CAAC;AAiB5B,MAAM,MAAM,kBAAkB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;IACzB,eA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ACd,OAAO;IAoCV,WAAW,CACV,gBAAgB,EAAE,KAAK,CAAC,oBAAoB,GAAG,SAAS,CAAC,EACzD,oBAAoB,EAAE,MAAM,GAC1B,mBAAmB;IA0BtB,KAAK;IAgBL,OAAO,CAAC,OAAO;IAsDf,OAAO,CAAC,KAAK;IAwBb,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,UAAU;IA2BlB,OAAO,CAAC,2BAA2B;IA4CnC,OAAO,CAAC,QAAQ;CAqBhB;AAED,qBAAa,oBAAoB;IAM/B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAN3B,IAAI,SAAK;IACT,MAAM,SAAK;IACX,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA0B;gBAGlC,QAAQ,EAAE,MAAM,EAChB,SAAS,SAAsB;IAGjD,OAAO,IAAI,gBAAgB;IAU3B,OAAO,CAAC,OAAO,EAAE,gBAAgB;IAYjC,KAAK;;;;;;CAQL"}
@@ -5,110 +5,198 @@
5
5
  */
6
6
  import type { RuntimeExecutionEvent, RuntimeExecutionKind, RuntimeExecutionMetadata, RuntimeExecutionState, RuntimeFunctionCallsSuppressedEvent, RuntimeFunctionDefinition, RuntimeFunctionEnterEvent, SourcePosition } from '@rasputin-ai/core';
7
7
  import type { EncodedFunctionPlan, PreparedFunctionPlan } from './function-plan';
8
+ /** A file glob (`src/logger/**`) or a regular expression matched against a function id. */
8
9
  export type ExecutionSourceExclusion = string | RegExp;
10
+ /** Limits and redaction for the runtime recorder. Defaults work for most apps. */
9
11
  export type ExecutionRecorderOptions = {
10
- /** Disable runtime-state capture explicitly. It is enabled by SDK initializers by default. */
12
+ /** Turn runtime recording off. RasputinInit leaves this on unless you set `false`. */
11
13
  enabled?: boolean;
12
- /** Maximum recent runtime events retained per active execution. Default: 500. */
14
+ /** How many call events one request or job may keep. Older events are dropped first. Default: 500. */
13
15
  maxEventsPerExecution?: number;
14
- /** Successful calls retained per function and parent before repetitions are aggregated. Default: 3. */
16
+ /**
17
+ * How many successful calls of the same function (under the same parent) to keep in full.
18
+ * Further successes are counted in a summary instead of storing every argument list. Default: 3.
19
+ */
15
20
  maxCapturedCallsPerFunction?: number;
16
21
  /**
17
- * Process-wide estimated memory available to active execution recordings. Default: 64 MiB.
18
- * When exhausted, capture degrades from values to call structure and finally metadata-only;
19
- * the application is never blocked or crashed to preserve recorder completeness.
22
+ * Memory the recorder may use across all in-flight requests, in bytes. Default: 64 MiB.
23
+ * This bounds live recorder snapshots only — the transport queue, source-map cache, and
24
+ * process handlers are capped separately. Under pressure the recorder drops values first,
25
+ * then call details. It never blocks your app to keep recording.
20
26
  */
21
27
  maxActiveMemoryBytes?: number;
22
28
  /**
23
- * Repo-relative files/directories to omit from runtime state. Strings support `*` and `**` globs;
24
- * regular expressions match the complete function ID. Excluded calls suppress their nested subtree.
29
+ * Files or functions to skip. String globs match source paths (`src/logger/**`); regular
30
+ * expressions match the full function id. Skipping a function also skips everything it calls.
25
31
  */
26
32
  excludeSources?: ExecutionSourceExclusion[];
27
- /** Additional object keys whose values should be redacted before capture. */
33
+ /** Extra object keys to hide (case- and separator-insensitive), on top of built-in credential names. */
28
34
  redactKeys?: string[];
35
+ /** How deep nested objects and arrays are walked. Default: 3. */
29
36
  maxDepth?: number;
37
+ /** How many keys to keep from one object. Default: 30. */
30
38
  maxObjectKeys?: number;
39
+ /** How many items to keep from one array, map, or set. Default: 20. */
31
40
  maxArrayElements?: number;
41
+ /** How many characters to keep from one string. Default: 500. */
32
42
  maxStringLength?: number;
43
+ /** Maximum size of one captured value after serialization. Default: 8 KiB. */
33
44
  maxSerializedValueBytes?: number;
45
+ /**
46
+ * Soft size goal for the whole snapshot sent with an error. Extra reconstruction
47
+ * data is dropped first to stay near this. Default: 256 KiB.
48
+ */
49
+ runtimeStateTargetBytes?: number;
50
+ /**
51
+ * Hard size limit for that snapshot. Values are dropped before call history.
52
+ * Default: 512 KiB.
53
+ */
54
+ maxRuntimeStateBytes?: number;
55
+ /**
56
+ * How long a recording may hold process-wide memory budget, in milliseconds.
57
+ * Covers unfinished work and finished work that still has in-flight instrumented
58
+ * calls (SSE, WebSockets, abandoned promises). After this age the recording is
59
+ * marked partial and releases its reservation so later requests can record.
60
+ * Default: 60s.
61
+ */
62
+ maxExecutionHoldMs?: number;
63
+ /**
64
+ * How many finished error recordings to keep for later `getErrorState` lookups.
65
+ * Older finished recordings are evicted and report `unavailable` /
66
+ * `retained_state_evicted`. Default: 32.
67
+ */
68
+ maxRetainedErrorRecordings?: number;
34
69
  };
70
+ /** Labels you pass to `execution.createScope()`: kind of work, optional name, HTTP details. */
35
71
  export type ExecutionMetadata = RuntimeExecutionMetadata;
72
+ /** `http` for a request, `job` for a background task, and so on. */
36
73
  export type ExecutionKind = RuntimeExecutionKind;
37
74
  export type ExecutionFunctionEnterEvent = RuntimeFunctionEnterEvent;
38
75
  export type ExecutionFunctionCallsSuppressedEvent = RuntimeFunctionCallsSuppressedEvent;
39
76
  export type ExecutionEvent = RuntimeExecutionEvent;
77
+ /**
78
+ * Snapshot of the request or job that failed: which functions ran, with what
79
+ * arguments and return values. Attached to the error automatically.
80
+ */
40
81
  export type ExecutionState = RuntimeExecutionState;
82
+ /** Name and optional source location used when you wrap a function with `execution.trace()`. */
41
83
  export type ExecutionFunctionDescriptor = {
42
84
  name: string;
43
85
  source?: SourcePosition;
44
86
  };
87
+ /** Process-local counters from `getStats()`. Totals reset when the process restarts. */
45
88
  export type ExecutionRecorderStats = {
46
- /** Function hooks observed while an active execution scope exists. */
89
+ /** Function wrappers that ran while a request or job was being recorded. */
47
90
  functionCallsObserved: number;
48
- /** Observed calls for which a complete enter/terminal pair was captured. */
91
+ /** Of those, how many got a full enter and exit (or throw) stored. */
49
92
  functionCallsCaptured: number;
50
- /** Observed calls omitted because their source or parent subtree was excluded. */
93
+ /** Wrappers skipped because of `excludeSources` or a skipped parent. */
51
94
  functionCallsExcluded: number;
52
- /** Values actually traversed by the bounded serializer. */
95
+ /** Values the serializer actually walked. Redacted objects stop the walk. */
53
96
  serializedValues: number;
54
- /** Application value nodes visited while producing bounded snapshots. */
97
+ /** Nested fields visited while building those snapshots. */
55
98
  serializedValueNodes: number;
56
- /** Bounded serialized bytes produced before values are stored in recorder events. */
99
+ /** Bytes produced by that serialization, after size limits. */
57
100
  serializedValueBytes: number;
101
+ /** Errors that received a runtime snapshot. */
58
102
  errorSnapshots: number;
103
+ /** Requests or jobs that finished without an error, so their recordings were thrown away. */
59
104
  successfulExecutionsDiscarded: number;
105
+ /** Times an execution hit `maxEventsPerExecution` and dropped older events. */
60
106
  truncatedEvents: number;
107
+ /** Successful repeats that were counted in a summary instead of stored in full. */
61
108
  repeatedCallsSuppressed: number;
109
+ /** Recordings open right now (in-flight requests or jobs). */
62
110
  activeExecutions: number;
111
+ /** Highest `activeExecutions` seen in this process. */
63
112
  peakActiveExecutions: number;
113
+ /** Estimated recorder memory in use right now, in bytes. */
64
114
  activeEstimatedBytes: number;
115
+ /** Highest `activeEstimatedBytes` seen in this process. */
65
116
  peakActiveEstimatedBytes: number;
117
+ /** Executions that ran while the process-wide memory budget was exhausted. */
66
118
  memoryPressureExecutions: number;
119
+ /** Times capture was stepped down (values first, then events) to stay under that budget. */
67
120
  memoryPressureDegradations: number;
121
+ /** Argument or return values dropped because of the memory budget. */
68
122
  valuesDroppedByMemoryBudget: number;
123
+ /** Call events dropped because of the memory budget. */
69
124
  eventsDroppedByMemoryBudget: number;
125
+ /** Error snapshots that were incomplete after memory pressure. */
70
126
  partialErrorSnapshots: number;
127
+ /** Executions that contributed to `totalInlineWallTimeMs`. */
71
128
  measuredExecutions: number;
129
+ /** Time spent inside recorder code across those executions, in milliseconds. */
72
130
  totalInlineWallTimeMs: number;
131
+ /** Slowest single execution's recorder time, in milliseconds. */
73
132
  maxInlineWallTimeMs: number;
133
+ /** Times a finished recording reused a pooled journal instead of allocating. */
74
134
  journalPoolHits: number;
135
+ /** Times a new journal had to be allocated. */
75
136
  journalPoolMisses: number;
137
+ /** Journals currently sitting in the reuse pool. */
76
138
  journalPoolSize: number;
139
+ /** Combined capacity of pooled journals, in events. */
77
140
  journalAllocatedCapacity: number;
141
+ /** Time spent in async-local storage enter/exit, in nanoseconds. Omitted unless timing is on. */
78
142
  phaseAlsNs?: number;
143
+ /** Time spent turning a journal into the public snapshot, in nanoseconds. Omitted unless timing is on. */
79
144
  phaseMaterializeNs?: number;
80
- derivationCandidateFunctions: number;
81
- derivationElidedFunctionCalls: number;
82
- derivationRootsCaptured: number;
83
- derivationControlFactsCaptured: number;
84
- derivationValuesAvoided: number;
85
- derivationFallbackFunctions: number;
86
- derivationFallbackExpressions: number;
87
- derivationFallbackReasons: Record<string, number>;
88
- derivationRootBytes: number;
145
+ /**
146
+ * Times the ambient async store was not the one Rasputin expected.
147
+ * The affected execution's call tree is dropped so a wrong parent is never published.
148
+ */
149
+ attributionDegradations: number;
89
150
  };
151
+ /** One in-flight recording. Created by `execution.createScope()`. */
90
152
  export type ExecutionScope = {
153
+ /** Run `callback` under this recording's async context and return exactly what it returned. */
91
154
  run: <T>(callback: () => T) => T;
92
- getErrorState: (error: unknown, metadata?: Partial<ExecutionMetadata>) => ExecutionState | undefined;
155
+ /** Bind `error` to this recording without materializing the snapshot. */
156
+ associateError: (error: unknown) => void;
157
+ /** Mark the recording finished. The caller owns async completion. */
93
158
  finish: (metadata?: Partial<ExecutionMetadata>) => void;
94
159
  };
160
+ export type ExecutionRuntimeScope = ExecutionScope & {
161
+ getErrorState: (error: unknown, metadata?: Partial<ExecutionMetadata>) => ExecutionState | undefined;
162
+ };
163
+ export type PreparedCallHandle = {
164
+ leave: (value?: unknown) => unknown;
165
+ fail: (error: unknown, liveArgs?: ArrayLike<unknown>) => void;
166
+ end: () => void;
167
+ /**
168
+ * Run `callback` inside this call's async store. Used by instrumented async
169
+ * functions so awaits inherit parentage from the engine instead of source rewrites.
170
+ * Rasputin failures cannot skip, double-run, or replace the callback's result.
171
+ */
172
+ run: <T>(callback: () => T) => T;
173
+ /** Restore the caller async store before an `await` yields. */
174
+ suspend: (value?: unknown) => unknown;
175
+ /** Re-enter this call's async store after an `await` settles, including rejected awaits. */
176
+ resume: (value?: unknown) => unknown;
177
+ };
95
178
  export type RasputinExecution = {
179
+ /** Start a recording you will drive yourself with `run` / `associateError` / `finish`. */
96
180
  createScope: (metadata: ExecutionMetadata) => ExecutionScope;
97
- /** Define a logical non-HTTP execution such as a job, worker cycle, or scheduled task. */
98
- run: <T>(metadata: ExecutionMetadata, callback: () => T) => T;
181
+ /**
182
+ * Wrap a function yourself when automatic instrumentation is not available.
183
+ * Preserves the call receiver (`this`), `.call` / `.apply` / `.bind`, and
184
+ * the original return or thrown value. Not a constructor: `new tracedFn()`
185
+ * is rejected so `new.target` is not silently wrong.
186
+ */
187
+ trace: <TThis, TArgs extends unknown[], TResult>(definition: string | ExecutionFunctionDescriptor, fn: (this: TThis, ...args: TArgs) => TResult) => (this: TThis, ...args: TArgs) => TResult;
188
+ /** Process-local recorder counters. See `ExecutionRecorderStats`. */
189
+ getStats: () => ExecutionRecorderStats;
190
+ };
191
+ export type ExecutionRuntime = {
192
+ createScope: (metadata: ExecutionMetadata) => ExecutionRuntimeScope;
193
+ trace: RasputinExecution['trace'];
194
+ getStats: RasputinExecution['getStats'];
99
195
  getErrorState: (error: unknown, metadata?: Partial<ExecutionMetadata>) => ExecutionState | undefined;
100
- /** Internal primitive used by SDK-owned source instrumentation. */
101
196
  runFunction: <T>(definition: RuntimeFunctionDefinition | string, args: ArrayLike<unknown>, callback: () => T) => T;
102
- /** Internal prepared-plan path used by automatic instrumentation. */
103
197
  runFunctionPlans: <T>(plans: readonly EncodedFunctionPlan[], planIndex: number, args: ArrayLike<unknown>, callback: () => T, omitValues?: boolean) => T;
104
- /** Resolve a module plan table once so generated wrappers can bind to prepared plans. */
105
198
  prepareFunctionPlans: (plans: readonly EncodedFunctionPlan[]) => PreparedFunctionPlan[];
106
- /** Internal primitive used after a module's function plans have been resolved. */
107
199
  runPreparedFunction: <T>(plan: PreparedFunctionPlan, args: ArrayLike<unknown>, callback: () => T, omitValues?: boolean) => T;
108
- /** Manual fallback for runtimes/build systems without automatic instrumentation. */
109
- trace: <TThis, TArgs extends unknown[], TResult>(definition: string | ExecutionFunctionDescriptor, fn: (this: TThis, ...args: TArgs) => TResult) => (this: TThis, ...args: TArgs) => TResult;
110
- getStats: () => ExecutionRecorderStats;
111
- /** Snapshot a derivation capture-boundary value immediately. Pass-through the live value. */
112
- captureDerivationRoot: (rootId: number, value: unknown) => unknown;
200
+ enterPreparedFunction: (plan: PreparedFunctionPlan, args: ArrayLike<unknown>, omitValues?: boolean) => PreparedCallHandle;
113
201
  };
114
202
  //# sourceMappingURL=execution-recorder-types.d.ts.map
@@ -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,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEjF,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvD,MAAM,MAAM,wBAAwB,GAAG;IACtC,8FAA8F;IAC9F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iFAAiF;IACjF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,uGAAuG;IACvG,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAC5C,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,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AE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CACnE,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,mCAAmC,EACnC,yBAAyB,EACzB,yBAAyB,EACzB,cAAc,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEjF,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,EAAE,wBAAwB,EAAE,CAAC;IAC5C,wGAAwG;IACxG,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iEAAiE;IACjE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAA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C,UAAU,CAAC,CAAC;IACxC,aAAa,EAAE,CACd,KAAK,EAAE,OAAO,EACd,QAAQ,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,KACjC,cAAc,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,CAAC,CAAC,EACd,UAAU,EAAE,yBAAyB,GAAG,MAAM,EAC9C,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,EACxB,QAAQ,EAAE,MAAM,CAAC,KACb,CAAC,CAAC;IACP,gBAAgB,EAAE,CAAC,CAAC,EACnB,KAAK,EAAE,SAAS,mBAAmB,EAAE,EACrC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,SAAS,CAAC,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,4 +1,4 @@
1
- import type { ExecutionRecorderOptions, RasputinExecution } from './execution-recorder-types';
1
+ import type { ExecutionRecorderOptions, ExecutionRuntime } from './execution-recorder-types';
2
2
  /** Bounded, error-only execution recorder for application functions. */
3
- export declare const createExecutionRecorder: (options: ExecutionRecorderOptions | undefined) => RasputinExecution;
3
+ export declare const createExecutionRecorder: (options: ExecutionRecorderOptions | undefined) => ExecutionRuntime;
4
4
  //# sourceMappingURL=execution-recorder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"execution-recorder.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/execution-recorder.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAGX,wBAAwB,EAExB,iBAAiB,EACjB,MAAM,4BAA4B,CAAC;AAiRpC,wEAAwE;AACxE,eAAO,MAAM,uBAAuB,GACnC,SAAS,wBAAwB,GAAG,SAAS,KAC3C,iBA4yBF,CAAC"}
1
+ {"version":3,"file":"execution-recorder.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/execution-recorder.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAGX,wBAAwB,EACxB,gBAAgB,EAGhB,MAAM,4BAA4B,CAAC;AA+OpC,wEAAwE;AACxE,eAAO,MAAM,uBAAuB,GACnC,SAAS,wBAAwB,GAAG,SAAS,KAC3C,gBAg8CF,CAAC"}
@@ -5,7 +5,9 @@ export type EncodedFunctionPlan = readonly [
5
5
  packageName: string | null,
6
6
  packageRelativePath: string | null,
7
7
  line: number | null,
8
- column: number | null
8
+ column: number | null,
9
+ omitCallValues?: 1,
10
+ preBodyParameterEvaluation?: 1
9
11
  ];
10
12
  export type PreparedFunctionPlan = {
11
13
  runtimePlanId: number;
@@ -13,7 +15,12 @@ export type PreparedFunctionPlan = {
13
15
  functionId: string;
14
16
  excluded: boolean;
15
17
  estimatedCallBytes: number;
18
+ omitCallValues: boolean;
19
+ disabled?: boolean;
16
20
  };
21
+ export declare const encodedPlanOmitsCallValues: (plan: EncodedFunctionPlan) => boolean;
22
+ export declare const withOmittedCallValues: (plan: EncodedFunctionPlan) => EncodedFunctionPlan;
23
+ export declare const withPreBodyParameterEvaluation: (plan: EncodedFunctionPlan) => EncodedFunctionPlan;
17
24
  export type AutomaticFunctionSource = {
18
25
  filePath: string;
19
26
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"function-plan.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/function-plan.ts"],"names":[],"mappings":"AAAA,OAAO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,IAAI;IACrB,cAAc,CAAC,EAAE,CAAC;IAClB,0BAA0B,CAAC,EAAE,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,yBAAyB,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAI,MAAM,mBAAmB,KAAG,OAAwB,CAAC;AAKhG,eAAO,MAAM,qBAAqB,GAAI,MAAM,mBAAmB,KAAG,mBASjE,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAAI,MAAM,mBAAmB,KAAG,mBAS1E,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAIF,eAAO,MAAM,kBAAkB,GAAI,QAAQ,uBAAuB,KAAG,mBAcpE,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,MAAM,mBAAmB,KAAG,yBAkBrE,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,YAAY,MAAM,KAAG,MACiB,CAAC"}
@@ -1,3 +1,3 @@
1
1
  export { createExecutionRecorder } from './execution-recorder';
2
- export type { ExecutionFunctionDescriptor, ExecutionKind, ExecutionMetadata, ExecutionRecorderOptions, ExecutionRecorderStats, ExecutionScope, ExecutionSourceExclusion, ExecutionState, RasputinExecution, } from './execution-recorder-types';
2
+ export type { ExecutionFunctionDescriptor, ExecutionKind, ExecutionMetadata, ExecutionRecorderOptions, ExecutionRecorderStats, ExecutionRuntime, ExecutionRuntimeScope, ExecutionScope, ExecutionSourceExclusion, ExecutionState, PreparedCallHandle, RasputinExecution, } from './execution-recorder-types';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,YAAY,EACX,2BAA2B,EAC3B,aAAa,EACb,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,cAAc,EACd,wBAAwB,EACxB,cAAc,EACd,iBAAiB,GACjB,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,YAAY,EACX,2BAA2B,EAC3B,aAAa,EACb,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,wBAAwB,EACxB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,GACjB,MAAM,4BAA4B,CAAC"}
@@ -33,6 +33,7 @@ export declare class RecorderMemoryBudget {
33
33
  reserveCall(allocation: RecorderMemoryAllocation, estimatedBytes: number): boolean;
34
34
  reserveStandaloneEvent(allocation: RecorderMemoryAllocation): boolean;
35
35
  reserveStorage(allocation: RecorderMemoryAllocation, bytes: number): boolean;
36
+ releaseStorage(allocation: RecorderMemoryAllocation, bytes: number): void;
36
37
  release(allocation: RecorderMemoryAllocation): void;
37
38
  getStats(): RecorderMemoryStats;
38
39
  private reserve;
@@ -1 +1 @@
1
- {"version":3,"file":"recorder-memory-budget.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/recorder-memory-budget.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAU5D,KAAK,WAAW,GAAG,MAAM,G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,GAAG,OAAO;IAO5E,cAAc,CAAC,UAAU,EAAE,wBAAwB,EAAE,KAAK,EAAE,MAAM;IAQlE,OAAO,CAAC,UAAU,EAAE,wBAAwB;IAQ5C,QAAQ,IAAI,mBAAmB;IAI/B,OAAO,CAAC,OAAO;IAef,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,UAAU;CAIlB"}
@@ -0,0 +1,4 @@
1
+ export declare const compileRedactKeys: (extra: readonly string[] | undefined) => ReadonlySet<string>;
2
+ export declare const keyIsRedacted: (key: string, redactKeys: ReadonlySet<string>) => boolean;
3
+ export declare const propertyNameIsRedacted: (key: string) => boolean;
4
+ //# sourceMappingURL=redact-keys.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Run `callback` exactly once even when the store primitive throws. Used by
3
+ * generated `H.run` so a Rasputin ALS failure cannot skip or double-run the
4
+ * customer body, or replace its result.
5
+ */
6
+ export declare const runExactlyOnce: <T>(invoke: (callback: () => T) => T, callback: () => T) => T;
7
+ //# sourceMappingURL=run-exactly-once.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-exactly-once.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/run-exactly-once.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAkC,CAAC,EAC7D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,EAChC,UAAU,MAAM,CAAC,KACf,CAoBF,CAAC"}
@@ -0,0 +1,14 @@
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
+ /**
5
+ * Bound the complete compact-JSON runtime state after materialization. Captured function values
6
+ * are only omitted above the hard ceiling; call boundaries and timings remain until a final
7
+ * pathological-metadata fallback is required.
8
+ */
9
+ export declare const enforceRuntimeStateSizeBudget: (input: RuntimeExecutionState, options?: {
10
+ targetBytes?: number;
11
+ maximumBytes?: number;
12
+ }) => RuntimeExecutionState;
13
+ export declare const runtimeStateEncodedBytes: (value: unknown) => number;
14
+ //# sourceMappingURL=runtime-state-size-budget.d.ts.map
@@ -0,0 +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;AA8H1D;;;;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,UAjNR,OAAO,WAiNgB,CAAC"}
@@ -1,5 +1,11 @@
1
+ /**
2
+ * Values are frozen on the hot path as a redacted structural snapshot, then encoded
3
+ * to wire JSON only when an error snapshot is materialized.
4
+ */
1
5
  import type { ExecutionRecorderOptions } from './execution-recorder-types';
2
- export declare const jsonLiteralUtf8Bytes: (value: unknown) => number;
6
+ import { type FrozenSnapshot } from './value-freeze';
7
+ export { jsonLiteralUtf8Bytes } from './encode-frozen';
8
+ export type { FrozenSnapshot } from './value-freeze';
3
9
  export type SafeSerializedValue = {
4
10
  value: unknown;
5
11
  bytes: number;
@@ -7,12 +13,12 @@ export type SafeSerializedValue = {
7
13
  visitedNodes: number;
8
14
  };
9
15
  export type SafeSerializer = {
16
+ freeze: (value: unknown) => FrozenSnapshot;
17
+ encode: (frozen: unknown) => unknown;
10
18
  serialize: (value: unknown) => unknown;
11
19
  serializeWithBytes: (value: unknown) => SafeSerializedValue;
12
20
  };
13
21
  export declare const createSafeSerializer: (options?: ExecutionRecorderOptions) => SafeSerializer;
14
- /** Safely converts an arbitrary value and reports its bounded JSON byte size. */
15
22
  export declare const safeSerializeWithBytes: (value: unknown, options?: ExecutionRecorderOptions) => SafeSerializedValue;
16
- /** Safely converts an arbitrary value to bounded JSON-compatible data. */
17
23
  export declare const safeSerialize: (value: unknown, options?: ExecutionRecorderOptions) => unknown;
18
24
  //# 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":"AAQA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAoG3E,eAAO,MAAM,oBAAoB,GAAI,OAAO,OAAO,KAAG,MAkCrD,CAAC;AA4EF,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,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IACvC,kBAAkB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,mBAAmB,CAAC;CAC5D,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,UAAS,wBAA6B,KAAG,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
1
+ import type { ExecutionRecorderOptions } from './execution-recorder-types';
2
+ export declare const REDACTED = "[RASPUTIN_REDACTED]";
3
+ export type FreezeLimits = {
4
+ maxDepth: number;
5
+ maxObjectKeys: number;
6
+ maxArrayElements: number;
7
+ maxStringLength: number;
8
+ maxSerializedValueBytes: number;
9
+ };
10
+ export declare const compileFreezeLimits: (options: ExecutionRecorderOptions) => FreezeLimits;
11
+ export declare const FROZEN: unique symbol;
12
+ 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
+ export type FrozenAtom = {
14
+ [FROZEN]: FrozenKind;
15
+ value?: unknown;
16
+ name?: string;
17
+ message?: unknown;
18
+ stack?: unknown;
19
+ entries?: unknown;
20
+ values?: unknown;
21
+ type?: string;
22
+ reason?: string;
23
+ originalLength?: number;
24
+ serializedBytes?: number;
25
+ byteLength?: number;
26
+ base64?: string;
27
+ truncated?: true;
28
+ code?: unknown;
29
+ cause?: unknown;
30
+ statusCode?: unknown;
31
+ };
32
+ export type FrozenSnapshot = {
33
+ value: unknown;
34
+ estimatedBytes: number;
35
+ visitedNodes: number;
36
+ oversize: boolean;
37
+ };
38
+ export declare const isFrozenAtom: (value: unknown) => value is FrozenAtom;
39
+ export declare const createValueFreezer: (options?: ExecutionRecorderOptions) => {
40
+ freeze: (value: unknown) => FrozenSnapshot;
41
+ limits: FreezeLimits;
42
+ };
43
+ //# sourceMappingURL=value-freeze.d.ts.map