@rasputin-ai/node 0.5.3 → 0.6.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.
- package/README.md +3 -1
- package/dist/auto-instrumentation/instrumentation-manifest-registry.d.ts +1 -1
- package/dist/auto-instrumentation/instrumentation-manifest-registry.d.ts.map +1 -1
- package/dist/auto-instrumentation/source-map-locations.d.ts +1 -1
- package/dist/auto-instrumentation/source-map-locations.d.ts.map +1 -1
- package/dist/auto-instrumentation/transform-disk-cache.d.ts +1 -1
- package/dist/auto-instrumentation/transform-disk-cache.d.ts.map +1 -1
- package/dist/execution-recorder/automatic-runtime.d.ts +2 -33
- package/dist/execution-recorder/automatic-runtime.d.ts.map +1 -1
- package/dist/execution-recorder/execution-recorder-types.d.ts +2 -1
- package/dist/execution-recorder/execution-recorder-types.d.ts.map +1 -1
- package/dist/execution-recorder/execution-recorder.d.ts.map +1 -1
- package/dist/execution-recorder/function-plan.d.ts +7 -22
- package/dist/execution-recorder/function-plan.d.ts.map +1 -1
- package/dist/execution-recorder/runtime-state-size-budget.d.ts.map +1 -1
- package/dist/index.js +144 -123
- package/dist/instrument/build.js +852 -588
- package/dist/instrument/bun.js +639 -373
- package/dist/instrument/node.js +605 -339
- package/dist/internal.js +141 -120
- package/dist/rasputin-init.d.ts +1 -0
- package/dist/rasputin-init.d.ts.map +1 -1
- package/dist/sdk-meta.d.ts +1 -1
- package/package.json +4 -2
- package/dist/auto-instrumentation/collect-instrumentation-delta.d.ts +0 -29
- package/dist/auto-instrumentation/collect-instrumentation-delta.d.ts.map +0 -1
- package/dist/auto-instrumentation/instrumentation-manifest-delta.d.ts +0 -49
- package/dist/auto-instrumentation/instrumentation-manifest-delta.d.ts.map +0 -1
- package/dist/auto-instrumentation/parameter-initializer-may-run-code.d.ts +0 -3
- package/dist/auto-instrumentation/parameter-initializer-may-run-code.d.ts.map +0 -1
- package/dist/auto-instrumentation/suspension-whitelist.d.ts +0 -33
- package/dist/auto-instrumentation/suspension-whitelist.d.ts.map +0 -1
- package/dist/auto-instrumentation/transform-source.d.ts +0 -27
- package/dist/auto-instrumentation/transform-source.d.ts.map +0 -1
- package/dist/auto-instrumentation/verify-instrumentation-isomorphism.d.ts +0 -2
- package/dist/auto-instrumentation/verify-instrumentation-isomorphism.d.ts.map +0 -1
- package/dist/auto-instrumentation/verify-transformed-source.d.ts +0 -2
- package/dist/auto-instrumentation/verify-transformed-source.d.ts.map +0 -1
- package/dist/execution-recorder/run-exactly-once.d.ts +0 -7
- package/dist/execution-recorder/run-exactly-once.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ Initialize once when your application starts:
|
|
|
10
10
|
import { RasputinInit } from '@rasputin-ai/node';
|
|
11
11
|
|
|
12
12
|
export const rasputin = RasputinInit({
|
|
13
|
+
dsn: process.env.RASPUTIN_DSN!,
|
|
13
14
|
projectApiKey: process.env.RASPUTIN_PROJECT_API_KEY!,
|
|
14
15
|
release: process.env.RASPUTIN_RELEASE!,
|
|
15
16
|
environment: process.env.NODE_ENV ?? 'development',
|
|
@@ -33,7 +34,8 @@ try {
|
|
|
33
34
|
|
|
34
35
|
| Field | Required | Description |
|
|
35
36
|
| --- | --- | --- |
|
|
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 |
|
|
37
39
|
| `environment` | yes | Environment such as `production`, `staging`, or `preview` |
|
|
38
40
|
| `release` | yes | Git commit SHA for the deployed version |
|
|
39
41
|
| `enabled` | no | Enables or disables the SDK; defaults to `true` |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type InstrumentationManifestContent } from '@rasputin-ai/core';
|
|
2
|
-
import type { InstrumentationManifestDelta } from '
|
|
2
|
+
import type { InstrumentationManifestDelta } from '@rasputin-ai/instrumentation';
|
|
3
3
|
export declare const INSTRUMENTATION_MANIFEST_SYMBOL = "rasputin.instrumentation.manifest.v3";
|
|
4
4
|
type SnapshotOptions = {
|
|
5
5
|
sourceRoot?: string;
|
|
@@ -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;
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import type { SourceLocationMapper } from '
|
|
1
|
+
import type { SourceLocationMapper } from '@rasputin-ai/instrumentation';
|
|
2
2
|
export declare const sourceMapPayloadForCache: (generatedPath: string, source: string) => string;
|
|
3
3
|
export declare const createSourceMapLocationMapper: (generatedPath: string, source: string) => SourceLocationMapper | undefined;
|
|
4
4
|
//# sourceMappingURL=source-map-locations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-map-locations.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/source-map-locations.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAkB,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"source-map-locations.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/source-map-locations.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAkB,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAgCzF,eAAO,MAAM,wBAAwB,GAAI,eAAe,MAAM,EAAE,QAAQ,MAAM,KAAG,MAMhF,CAAC;AAEF,eAAO,MAAM,6BAA6B,GACzC,eAAe,MAAM,EACrB,QAAQ,MAAM,KACZ,oBAAoB,GAAG,SA8BzB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { TransformedSource, TransformSourceOptions } from '@rasputin-ai/instrumentation';
|
|
2
2
|
export declare const resolveTransformCacheDir: () => string;
|
|
3
3
|
export declare const transformSourceCached: (source: string, options: TransformSourceOptions, cache?: {
|
|
4
4
|
directory?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform-disk-cache.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/transform-disk-cache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transform-disk-cache.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/transform-disk-cache.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAGX,iBAAiB,EACjB,sBAAsB,EACtB,MAAM,8BAA8B,CAAC;AAkCtC,eAAO,MAAM,wBAAwB,QAAO,MAGoB,CAAC;AAwIjE,eAAO,MAAM,qBAAqB,GACjC,QAAQ,MAAM,EACd,SAAS,sBAAsB,EAC/B,QAAO;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,KAChD,iBAAiB,GAAG,SAgBtB,CAAC"}
|
|
@@ -3,40 +3,9 @@
|
|
|
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 { AUTOMATIC_RUNTIME_SYMBOL, getAutomaticRuntimeRegistry, resetAutomaticExecutionRuntime } from '@rasputin-ai/recorder';
|
|
6
7
|
import type { ExecutionRuntime } from './execution-recorder-types';
|
|
7
|
-
|
|
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
|
-
};
|
|
21
|
-
type DispatchCell = {
|
|
22
|
-
run: ModuleRun;
|
|
23
|
-
enter: ModuleRunner['enter'];
|
|
24
|
-
};
|
|
25
|
-
type RegisteredModule = {
|
|
26
|
-
plans: readonly EncodedFunctionPlan[];
|
|
27
|
-
cell: DispatchCell;
|
|
28
|
-
};
|
|
29
|
-
type AutomaticRuntime = {
|
|
30
|
-
bind: (module: RegisteredModule) => void;
|
|
31
|
-
};
|
|
32
|
-
type AutomaticRuntimeRegistry = {
|
|
33
|
-
runtimes: AutomaticRuntime[];
|
|
34
|
-
modules: RegisteredModule[];
|
|
35
|
-
register: (plans: readonly EncodedFunctionPlan[]) => ModuleRunner;
|
|
36
|
-
};
|
|
37
|
-
export declare const getAutomaticRuntimeRegistry: () => AutomaticRuntimeRegistry;
|
|
38
|
-
export declare const resetAutomaticExecutionRuntime: () => void;
|
|
8
|
+
export { AUTOMATIC_RUNTIME_SYMBOL, getAutomaticRuntimeRegistry, resetAutomaticExecutionRuntime };
|
|
39
9
|
/** Connect transformed application functions to this SDK instance. */
|
|
40
10
|
export declare const installAutomaticExecutionRuntime: (execution: ExecutionRuntime) => (() => void);
|
|
41
|
-
export {};
|
|
42
11
|
//# 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,
|
|
1
|
+
{"version":3,"file":"automatic-runtime.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/automatic-runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACN,wBAAwB,EAGxB,2BAA2B,EAI3B,8BAA8B,EAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,8BAA8B,EAAE,CAAC;AAoBjG,sEAAsE;AACtE,eAAO,MAAM,gCAAgC,GAAI,WAAW,gBAAgB,KAAG,CAAC,MAAM,IAAI,CAkBzF,CAAC"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* work, and future serverless invocations without coupling the recorder to one framework lifecycle.
|
|
5
5
|
*/
|
|
6
6
|
import type { RuntimeExecutionEvent, RuntimeExecutionKind, RuntimeExecutionMetadata, RuntimeExecutionState, RuntimeFunctionCallsSuppressedEvent, RuntimeFunctionDefinition, RuntimeFunctionEnterEvent, SourcePosition } from '@rasputin-ai/core';
|
|
7
|
-
import type { EncodedFunctionPlan
|
|
7
|
+
import type { EncodedFunctionPlan } from '@rasputin-ai/recorder';
|
|
8
|
+
import type { PreparedFunctionPlan } from './function-plan';
|
|
8
9
|
/** A file glob (`src/logger/**`) or a regular expression matched against a function id. */
|
|
9
10
|
export type ExecutionSourceExclusion = string | RegExp;
|
|
10
11
|
/** Limits and redaction for the runtime recorder. Defaults work for most apps. */
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"execution-recorder-types.d.ts","sour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AC,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-recorder.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/execution-recorder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"execution-recorder.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/execution-recorder.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAGX,wBAAwB,EACxB,gBAAgB,EAGhB,MAAM,4BAA4B,CAAC;AAwOpC,wEAAwE;AACxE,eAAO,MAAM,uBAAuB,GACnC,SAAS,wBAAwB,GAAG,SAAS,KAC3C,gBAq8CF,CAAC"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
column: number | null,
|
|
9
|
-
omitCallValues?: 1,
|
|
10
|
-
preBodyParameterEvaluation?: 1
|
|
11
|
-
];
|
|
1
|
+
/**
|
|
2
|
+
* Node-prepared function plan.
|
|
3
|
+
*
|
|
4
|
+
* Adds exclusion, byte estimates, and omit flags used by the ALS journal.
|
|
5
|
+
* Encoding of the compact tuple lives in `@rasputin-ai/recorder`.
|
|
6
|
+
*/
|
|
7
|
+
import type { RuntimeFunctionDefinition } from '@rasputin-ai/core';
|
|
12
8
|
export type PreparedFunctionPlan = {
|
|
13
9
|
runtimePlanId: number;
|
|
14
10
|
definition: RuntimeFunctionDefinition;
|
|
@@ -18,16 +14,5 @@ export type PreparedFunctionPlan = {
|
|
|
18
14
|
omitCallValues: boolean;
|
|
19
15
|
disabled?: boolean;
|
|
20
16
|
};
|
|
21
|
-
export declare const encodedPlanOmitsCallValues: (plan: EncodedFunctionPlan) => boolean;
|
|
22
|
-
export declare const withOmittedCallValues: (plan: EncodedFunctionPlan) => EncodedFunctionPlan;
|
|
23
|
-
export declare const withPreBodyParameterEvaluation: (plan: EncodedFunctionPlan) => EncodedFunctionPlan;
|
|
24
|
-
export type AutomaticFunctionSource = {
|
|
25
|
-
filePath: string;
|
|
26
|
-
name: string;
|
|
27
|
-
line: number;
|
|
28
|
-
column: number;
|
|
29
|
-
};
|
|
30
|
-
export declare const encodeFunctionPlan: (source: AutomaticFunctionSource) => EncodedFunctionPlan;
|
|
31
|
-
export declare const definitionFromEncodedPlan: (plan: EncodedFunctionPlan) => RuntimeFunctionDefinition;
|
|
32
17
|
export declare const estimatedCallBytesFor: (functionId: string) => number;
|
|
33
18
|
//# sourceMappingURL=function-plan.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function-plan.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/function-plan.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"function-plan.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/function-plan.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAEnE,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;AAIF,eAAO,MAAM,qBAAqB,GAAI,YAAY,MAAM,KAAG,MACiB,CAAC"}
|
|
@@ -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;
|
|
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"}
|
package/dist/index.js
CHANGED
|
@@ -13,14 +13,89 @@ import {
|
|
|
13
13
|
sourceLocatorFromFile as sourceLocatorFromFile2
|
|
14
14
|
} from "@rasputin-ai/core";
|
|
15
15
|
|
|
16
|
-
// src/
|
|
16
|
+
// ../recorder/src/run-exactly-once.ts
|
|
17
|
+
var runExactlyOnce = function __rasputinHandleRun__(invoke, callback) {
|
|
18
|
+
let outcome;
|
|
19
|
+
const wrapped = function __rasputinHandleRun__3() {
|
|
20
|
+
try {
|
|
21
|
+
const value = callback();
|
|
22
|
+
outcome = { kind: "value", value };
|
|
23
|
+
return value;
|
|
24
|
+
} catch (caught) {
|
|
25
|
+
outcome = { kind: "throw", error: caught };
|
|
26
|
+
throw caught;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
try {
|
|
30
|
+
invoke(wrapped);
|
|
31
|
+
} catch {
|
|
32
|
+
}
|
|
33
|
+
if (outcome?.kind === "throw") throw outcome.error;
|
|
34
|
+
if (outcome?.kind === "value") return outcome.value;
|
|
35
|
+
return callback();
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// ../recorder/src/call-handle.ts
|
|
39
|
+
var passthroughHandle = () => ({
|
|
40
|
+
leave: (value) => value,
|
|
41
|
+
fail: () => {
|
|
42
|
+
},
|
|
43
|
+
end: () => {
|
|
44
|
+
},
|
|
45
|
+
run: function __rasputinHandleRun__3(callback) {
|
|
46
|
+
return runExactlyOnce((invoke) => invoke(), callback);
|
|
47
|
+
},
|
|
48
|
+
suspend: (value) => value,
|
|
49
|
+
resume: (value) => value
|
|
50
|
+
});
|
|
51
|
+
var isolateHandle = (handle) => ({
|
|
52
|
+
leave: (value) => {
|
|
53
|
+
try {
|
|
54
|
+
return handle.leave(value);
|
|
55
|
+
} catch {
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
fail: (error, liveArgs) => {
|
|
60
|
+
try {
|
|
61
|
+
handle.fail(error, liveArgs);
|
|
62
|
+
} catch {
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
end: () => {
|
|
66
|
+
try {
|
|
67
|
+
handle.end();
|
|
68
|
+
} catch {
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
run: function __rasputinHandleRun__3(callback) {
|
|
72
|
+
return runExactlyOnce((invoke) => handle.run(invoke), callback);
|
|
73
|
+
},
|
|
74
|
+
suspend: (value) => {
|
|
75
|
+
try {
|
|
76
|
+
return handle.suspend(value);
|
|
77
|
+
} catch {
|
|
78
|
+
return value;
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
resume: (value) => {
|
|
82
|
+
try {
|
|
83
|
+
return handle.resume(value);
|
|
84
|
+
} catch {
|
|
85
|
+
return value;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// ../recorder/src/encoded-function-plan.ts
|
|
91
|
+
var encodedPlanOmitsCallValues = (plan) => plan[6] === 1;
|
|
92
|
+
var encodedPlanHasPreBodyParameterEvaluation = (plan) => plan[7] === 1;
|
|
93
|
+
|
|
94
|
+
// ../recorder/src/function-plan.ts
|
|
17
95
|
import {
|
|
18
96
|
runtimeFunctionId,
|
|
19
97
|
sourceLocatorFromFile
|
|
20
98
|
} from "@rasputin-ai/core";
|
|
21
|
-
var encodedPlanOmitsCallValues = (plan) => plan[6] === 1;
|
|
22
|
-
var encodedPlanHasPreBodyParameterEvaluation = (plan) => plan[7] === 1;
|
|
23
|
-
var EVENT_PAIR_BASE_ESTIMATED_BYTES = 512;
|
|
24
99
|
var definitionFromEncodedPlan = (plan) => {
|
|
25
100
|
const [functionId, name, packageName, packageRelativePath, line, column] = plan;
|
|
26
101
|
const source = packageRelativePath ? {
|
|
@@ -36,7 +111,57 @@ var definitionFromEncodedPlan = (plan) => {
|
|
|
36
111
|
...encodedPlanHasPreBodyParameterEvaluation(plan) ? { parentAttribution: "pre_body_parameter_evaluation" } : {}
|
|
37
112
|
};
|
|
38
113
|
};
|
|
39
|
-
|
|
114
|
+
|
|
115
|
+
// ../recorder/src/runtime-symbol.ts
|
|
116
|
+
var AUTOMATIC_RUNTIME_SYMBOL = "rasputin.execution.runtime.v3";
|
|
117
|
+
|
|
118
|
+
// ../recorder/src/registry.ts
|
|
119
|
+
var runtimeSymbol = Symbol.for(AUTOMATIC_RUNTIME_SYMBOL);
|
|
120
|
+
var passthroughRun = (_planIndex, _args, callback) => callback();
|
|
121
|
+
var passthroughEnter = () => passthroughHandle();
|
|
122
|
+
var bindPassthrough = (module) => {
|
|
123
|
+
module.cell.run = passthroughRun;
|
|
124
|
+
module.cell.enter = passthroughEnter;
|
|
125
|
+
};
|
|
126
|
+
var attachRunner = (cell) => {
|
|
127
|
+
const run = ((planIndex, args, callback, omitValues) => cell.run(planIndex, args, callback, omitValues));
|
|
128
|
+
run.enter = (planIndex, args, omitValues, callee) => cell.enter(planIndex, args, omitValues, callee);
|
|
129
|
+
return run;
|
|
130
|
+
};
|
|
131
|
+
var isCompatibleRegistry = (value) => typeof Reflect.get(value, "register") === "function" && Array.isArray(Reflect.get(value, "runtimes")) && Array.isArray(Reflect.get(value, "modules"));
|
|
132
|
+
var registerModule = (registry, plans, moduleIndex) => {
|
|
133
|
+
const cell = { run: passthroughRun, enter: passthroughEnter };
|
|
134
|
+
const module = {
|
|
135
|
+
plans,
|
|
136
|
+
cell,
|
|
137
|
+
...moduleIndex === void 0 ? {} : { moduleIndex }
|
|
138
|
+
};
|
|
139
|
+
registry.modules.push(module);
|
|
140
|
+
registry.runtimes.at(-1)?.bind(module);
|
|
141
|
+
return attachRunner(cell);
|
|
142
|
+
};
|
|
143
|
+
var createRegistry = () => {
|
|
144
|
+
const registry = {
|
|
145
|
+
runtimes: [],
|
|
146
|
+
modules: [],
|
|
147
|
+
register(plans, moduleIndex) {
|
|
148
|
+
return registerModule(registry, plans, moduleIndex);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
return registry;
|
|
152
|
+
};
|
|
153
|
+
var getAutomaticRuntimeRegistry = () => {
|
|
154
|
+
const existing = Reflect.get(globalThis, runtimeSymbol);
|
|
155
|
+
if (existing && typeof existing === "object" && isCompatibleRegistry(existing)) {
|
|
156
|
+
return existing;
|
|
157
|
+
}
|
|
158
|
+
if (existing != null) {
|
|
159
|
+
return createRegistry();
|
|
160
|
+
}
|
|
161
|
+
const registry = createRegistry();
|
|
162
|
+
Reflect.set(globalThis, runtimeSymbol, registry);
|
|
163
|
+
return registry;
|
|
164
|
+
};
|
|
40
165
|
|
|
41
166
|
// src/auto-instrumentation/instrumentation-manifest-registry.ts
|
|
42
167
|
var INSTRUMENTATION_MANIFEST_SYMBOL = "rasputin.instrumentation.manifest.v3";
|
|
@@ -919,6 +1044,10 @@ var ExecutionJournalPool = class {
|
|
|
919
1044
|
}
|
|
920
1045
|
};
|
|
921
1046
|
|
|
1047
|
+
// src/execution-recorder/function-plan.ts
|
|
1048
|
+
var EVENT_PAIR_BASE_ESTIMATED_BYTES = 512;
|
|
1049
|
+
var estimatedCallBytesFor = (functionId) => EVENT_PAIR_BASE_ESTIMATED_BYTES + Buffer.byteLength(functionId, "utf8") * 2;
|
|
1050
|
+
|
|
922
1051
|
// src/execution-recorder/recorder-memory-budget.ts
|
|
923
1052
|
var EXECUTION_BASE_ESTIMATED_BYTES = 1024;
|
|
924
1053
|
var SUMMARY_EVENT_BASE_ESTIMATED_BYTES = 256;
|
|
@@ -1054,28 +1183,6 @@ var RecorderMemoryBudget = class {
|
|
|
1054
1183
|
}
|
|
1055
1184
|
};
|
|
1056
1185
|
|
|
1057
|
-
// src/execution-recorder/run-exactly-once.ts
|
|
1058
|
-
var runExactlyOnce = function __rasputinHandleRun__(invoke, callback) {
|
|
1059
|
-
let outcome;
|
|
1060
|
-
const wrapped = function __rasputinHandleRun__3() {
|
|
1061
|
-
try {
|
|
1062
|
-
const value = callback();
|
|
1063
|
-
outcome = { kind: "value", value };
|
|
1064
|
-
return value;
|
|
1065
|
-
} catch (caught) {
|
|
1066
|
-
outcome = { kind: "throw", error: caught };
|
|
1067
|
-
throw caught;
|
|
1068
|
-
}
|
|
1069
|
-
};
|
|
1070
|
-
try {
|
|
1071
|
-
invoke(wrapped);
|
|
1072
|
-
} catch {
|
|
1073
|
-
}
|
|
1074
|
-
if (outcome?.kind === "throw") throw outcome.error;
|
|
1075
|
-
if (outcome?.kind === "value") return outcome.value;
|
|
1076
|
-
return callback();
|
|
1077
|
-
};
|
|
1078
|
-
|
|
1079
1186
|
// src/execution-recorder/runtime-state-size-budget.ts
|
|
1080
1187
|
import {
|
|
1081
1188
|
rasputinUnavailable
|
|
@@ -1118,6 +1225,7 @@ var dropEventValues = (events) => {
|
|
|
1118
1225
|
const marker = () => rasputinUnavailable(VALUE_OMITTED_REASON);
|
|
1119
1226
|
const bounded = events.map((event) => {
|
|
1120
1227
|
if (event.type === "function_enter") {
|
|
1228
|
+
if (event.args === void 0) return { ...event };
|
|
1121
1229
|
dropped += event.args.length;
|
|
1122
1230
|
return { ...event, args: event.args.map(marker) };
|
|
1123
1231
|
}
|
|
@@ -2721,7 +2829,10 @@ var createExecutionRecorder = (options) => {
|
|
|
2721
2829
|
};
|
|
2722
2830
|
const encodeEventValues = (events) => events.map((event) => {
|
|
2723
2831
|
if (event.type === "function_enter") {
|
|
2724
|
-
return {
|
|
2832
|
+
return {
|
|
2833
|
+
...event,
|
|
2834
|
+
...event.args === void 0 ? {} : { args: event.args.map((argument) => serializer.encode(argument)) }
|
|
2835
|
+
};
|
|
2725
2836
|
}
|
|
2726
2837
|
if (event.type === "function_exit") {
|
|
2727
2838
|
return { ...event, returnValue: serializer.encode(event.returnValue) };
|
|
@@ -2768,7 +2879,7 @@ var createExecutionRecorder = (options) => {
|
|
|
2768
2879
|
};
|
|
2769
2880
|
const eventsHaveOmittedValues = (events) => {
|
|
2770
2881
|
for (const event of events) {
|
|
2771
|
-
if (event.type === "function_enter" && event.args.some((arg) => rasputinTagKind(arg) === "omitted")) {
|
|
2882
|
+
if (event.type === "function_enter" && (event.args ?? []).some((arg) => rasputinTagKind(arg) === "omitted")) {
|
|
2772
2883
|
return true;
|
|
2773
2884
|
}
|
|
2774
2885
|
if (event.type === "function_exit" && rasputinTagKind(event.returnValue) === "omitted") {
|
|
@@ -3883,69 +3994,6 @@ var createExecutionRecorder = (options) => {
|
|
|
3883
3994
|
};
|
|
3884
3995
|
|
|
3885
3996
|
// src/execution-recorder/automatic-runtime.ts
|
|
3886
|
-
var AUTOMATIC_RUNTIME_SYMBOL = "rasputin.execution.runtime.v3";
|
|
3887
|
-
var runtimeSymbol = Symbol.for(AUTOMATIC_RUNTIME_SYMBOL);
|
|
3888
|
-
var passthroughHandle = () => ({
|
|
3889
|
-
leave: (value) => value,
|
|
3890
|
-
fail: () => {
|
|
3891
|
-
},
|
|
3892
|
-
end: () => {
|
|
3893
|
-
},
|
|
3894
|
-
run: function __rasputinHandleRun__3(callback) {
|
|
3895
|
-
return runExactlyOnce((invoke) => invoke(), callback);
|
|
3896
|
-
},
|
|
3897
|
-
suspend: (value) => value,
|
|
3898
|
-
resume: (value) => value
|
|
3899
|
-
});
|
|
3900
|
-
var isolateHandle = (handle) => ({
|
|
3901
|
-
leave: (value) => {
|
|
3902
|
-
try {
|
|
3903
|
-
return handle.leave(value);
|
|
3904
|
-
} catch {
|
|
3905
|
-
return value;
|
|
3906
|
-
}
|
|
3907
|
-
},
|
|
3908
|
-
fail: (error, liveArgs) => {
|
|
3909
|
-
try {
|
|
3910
|
-
handle.fail(error, liveArgs);
|
|
3911
|
-
} catch {
|
|
3912
|
-
}
|
|
3913
|
-
},
|
|
3914
|
-
end: () => {
|
|
3915
|
-
try {
|
|
3916
|
-
handle.end();
|
|
3917
|
-
} catch {
|
|
3918
|
-
}
|
|
3919
|
-
},
|
|
3920
|
-
run: function __rasputinHandleRun__3(callback) {
|
|
3921
|
-
return runExactlyOnce((invoke) => handle.run(invoke), callback);
|
|
3922
|
-
},
|
|
3923
|
-
suspend: (value) => {
|
|
3924
|
-
try {
|
|
3925
|
-
return handle.suspend(value);
|
|
3926
|
-
} catch {
|
|
3927
|
-
return value;
|
|
3928
|
-
}
|
|
3929
|
-
},
|
|
3930
|
-
resume: (value) => {
|
|
3931
|
-
try {
|
|
3932
|
-
return handle.resume(value);
|
|
3933
|
-
} catch {
|
|
3934
|
-
return value;
|
|
3935
|
-
}
|
|
3936
|
-
}
|
|
3937
|
-
});
|
|
3938
|
-
var passthroughRun = (_planIndex, _args, callback) => callback();
|
|
3939
|
-
var passthroughEnter = () => passthroughHandle();
|
|
3940
|
-
var bindPassthrough = (module) => {
|
|
3941
|
-
module.cell.run = passthroughRun;
|
|
3942
|
-
module.cell.enter = passthroughEnter;
|
|
3943
|
-
};
|
|
3944
|
-
var attachRunner = (cell) => {
|
|
3945
|
-
const run = ((planIndex, args, callback, omitValues) => cell.run(planIndex, args, callback, omitValues));
|
|
3946
|
-
run.enter = (planIndex, args, omitValues) => cell.enter(planIndex, args, omitValues);
|
|
3947
|
-
return run;
|
|
3948
|
-
};
|
|
3949
3997
|
var bindExecution = (execution, module) => {
|
|
3950
3998
|
const prepared = execution.prepareFunctionPlans(module.plans);
|
|
3951
3999
|
module.cell.run = (planIndex, args, callback, omitValues) => {
|
|
@@ -3956,40 +4004,13 @@ var bindExecution = (execution, module) => {
|
|
|
3956
4004
|
try {
|
|
3957
4005
|
const plan = prepared[planIndex];
|
|
3958
4006
|
return isolateHandle(
|
|
3959
|
-
plan ? execution.enterPreparedFunction(plan, args, omitValues) :
|
|
4007
|
+
plan ? execution.enterPreparedFunction(plan, args, omitValues) : passthroughHandle()
|
|
3960
4008
|
);
|
|
3961
4009
|
} catch {
|
|
3962
4010
|
return passthroughHandle();
|
|
3963
4011
|
}
|
|
3964
4012
|
};
|
|
3965
4013
|
};
|
|
3966
|
-
var isRegistry = (value) => Array.isArray(Reflect.get(value, "runtimes")) && Array.isArray(Reflect.get(value, "modules")) && typeof Reflect.get(value, "register") === "function";
|
|
3967
|
-
var registerModule = (registry, plans) => {
|
|
3968
|
-
const cell = { run: passthroughRun, enter: passthroughEnter };
|
|
3969
|
-
const module = { plans, cell };
|
|
3970
|
-
registry.modules.push(module);
|
|
3971
|
-
registry.runtimes.at(-1)?.bind(module);
|
|
3972
|
-
return attachRunner(cell);
|
|
3973
|
-
};
|
|
3974
|
-
var createRegistry = () => {
|
|
3975
|
-
const registry = {
|
|
3976
|
-
runtimes: [],
|
|
3977
|
-
modules: [],
|
|
3978
|
-
register(plans) {
|
|
3979
|
-
return registerModule(registry, plans);
|
|
3980
|
-
}
|
|
3981
|
-
};
|
|
3982
|
-
return registry;
|
|
3983
|
-
};
|
|
3984
|
-
var getAutomaticRuntimeRegistry = () => {
|
|
3985
|
-
const existing = Reflect.get(globalThis, runtimeSymbol);
|
|
3986
|
-
if (existing && typeof existing === "object" && isRegistry(existing)) {
|
|
3987
|
-
return existing;
|
|
3988
|
-
}
|
|
3989
|
-
const registry = createRegistry();
|
|
3990
|
-
Reflect.set(globalThis, runtimeSymbol, registry);
|
|
3991
|
-
return registry;
|
|
3992
|
-
};
|
|
3993
4014
|
var installAutomaticExecutionRuntime = (execution) => {
|
|
3994
4015
|
const registry = getAutomaticRuntimeRegistry();
|
|
3995
4016
|
const runtime = {
|
|
@@ -4148,7 +4169,7 @@ var installGlobalHandlers = (client, options = {}) => {
|
|
|
4148
4169
|
|
|
4149
4170
|
// src/sdk-meta.ts
|
|
4150
4171
|
var SDK_NAME = "@rasputin-ai/node";
|
|
4151
|
-
var SDK_VERSION = "0.
|
|
4172
|
+
var SDK_VERSION = "0.6.0";
|
|
4152
4173
|
|
|
4153
4174
|
// src/rasputin-init.ts
|
|
4154
4175
|
var publicExecution = (runtime) => ({
|
|
@@ -4227,7 +4248,7 @@ var RasputinInit = (options) => {
|
|
|
4227
4248
|
runtime,
|
|
4228
4249
|
recorderEnabled,
|
|
4229
4250
|
{
|
|
4230
|
-
projectApiKey: options.projectApiKey
|
|
4251
|
+
projectApiKey: options.projectApiKey,
|
|
4231
4252
|
release: options.release,
|
|
4232
4253
|
apiUrl: options.apiUrl,
|
|
4233
4254
|
enabled,
|
|
@@ -4247,7 +4268,7 @@ var RasputinInit = (options) => {
|
|
|
4247
4268
|
createExecutionRecorder({ enabled: false }),
|
|
4248
4269
|
false,
|
|
4249
4270
|
{
|
|
4250
|
-
projectApiKey: options.projectApiKey
|
|
4271
|
+
projectApiKey: options.projectApiKey,
|
|
4251
4272
|
release: options.release,
|
|
4252
4273
|
apiUrl: options.apiUrl,
|
|
4253
4274
|
enabled: false,
|