@rasputin-ai/node 0.5.2 → 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 +4 -2
- 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/encode-frozen.d.ts.map +1 -1
- package/dist/execution-recorder/execution-recorder-types.d.ts +3 -2
- 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/execution-recorder/value-freeze.d.ts.map +1 -1
- package/dist/index.js +228 -155
- 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 +225 -152
- 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
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One transformed file's contribution to the release manifest: functions, call sites, and
|
|
3
|
-
* destructures. The registry concatenates these deltas before upload.
|
|
4
|
-
*/
|
|
5
|
-
import type { InstrumentationArgIdentifier, InstrumentationParamBinding, InstrumentationSkipReason } from '@rasputin-ai/core';
|
|
6
|
-
import type { EncodedFunctionPlan } from '../execution-recorder/function-plan';
|
|
7
|
-
export type { InstrumentationSkipReason };
|
|
8
|
-
export type RawManifestCallSite = {
|
|
9
|
-
callerFunctionId: string;
|
|
10
|
-
calleeName: string;
|
|
11
|
-
calleeText: string;
|
|
12
|
-
filePath: string;
|
|
13
|
-
line: number;
|
|
14
|
-
column: number;
|
|
15
|
-
endLine: number;
|
|
16
|
-
endColumn: number;
|
|
17
|
-
resultBinding: string | null;
|
|
18
|
-
argIdentifiers: InstrumentationArgIdentifier[];
|
|
19
|
-
};
|
|
20
|
-
export type RawManifestDestructure = {
|
|
21
|
-
callerFunctionId: string;
|
|
22
|
-
sourceParam: string;
|
|
23
|
-
filePath: string;
|
|
24
|
-
line: number;
|
|
25
|
-
column: number;
|
|
26
|
-
binding: InstrumentationParamBinding;
|
|
27
|
-
};
|
|
28
|
-
export type RawManifestFunction = {
|
|
29
|
-
plan: EncodedFunctionPlan;
|
|
30
|
-
functionId: string;
|
|
31
|
-
filePath: string;
|
|
32
|
-
name: string;
|
|
33
|
-
startLine: number;
|
|
34
|
-
startColumn: number;
|
|
35
|
-
endLine: number;
|
|
36
|
-
endColumn: number;
|
|
37
|
-
params: InstrumentationParamBinding[];
|
|
38
|
-
paramNames: Set<string>;
|
|
39
|
-
instrumented: boolean;
|
|
40
|
-
skipReason?: InstrumentationSkipReason;
|
|
41
|
-
asyncFunction?: boolean;
|
|
42
|
-
};
|
|
43
|
-
export type InstrumentationManifestDelta = {
|
|
44
|
-
functions: RawManifestFunction[];
|
|
45
|
-
callSites: RawManifestCallSite[];
|
|
46
|
-
destructures: RawManifestDestructure[];
|
|
47
|
-
alreadyInstrumented?: boolean;
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=instrumentation-manifest-delta.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation-manifest-delta.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/instrumentation-manifest-delta.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACX,4BAA4B,EAC5B,2BAA2B,EAC3B,yBAAyB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE/E,YAAY,EAAE,yBAAyB,EAAE,CAAC;AAE1C,MAAM,MAAM,mBAAmB,GAAG;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,EAAE,4BAA4B,EAAE,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACpC,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,2BAA2B,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,2BAA2B,EAAE,CAAC;IACtC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,yBAAyB,CAAC;IACvC,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IAC1C,SAAS,EAAE,mBAAmB,EAAE,CAAC;IACjC,SAAS,EAAE,mBAAmB,EAAE,CAAC;IACjC,YAAY,EAAE,sBAAsB,EAAE,CAAC;IACvC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parameter-initializer-may-run-code.d.ts","sourceRoot":"","sources":["../../src/auto-instrumentation/parameter-initializer-may-run-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAqC5B,eAAO,MAAM,qCAAqC,GAAI,MAAM,EAAE,CAAC,oBAAoB,KAAG,OAOrF,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Phase-1 async instrumentation is a whitelist. Anything we have not proven
|
|
3
|
-
* exact — `for await`, `await using`, async generators, unknown future
|
|
4
|
-
* syntax — is skipped rather than approximated.
|
|
5
|
-
*/
|
|
6
|
-
import ts from 'typescript';
|
|
7
|
-
import type { InstrumentationSkipReason } from './instrumentation-manifest-delta';
|
|
8
|
-
export declare const knownSuspensionSyntaxKindNames: () => readonly string[];
|
|
9
|
-
export declare const unexpectedSuspensionSyntaxKindNames: () => string[];
|
|
10
|
-
export type AsyncInstrumentationAction = {
|
|
11
|
-
action: 'skip';
|
|
12
|
-
reason: InstrumentationSkipReason;
|
|
13
|
-
} | {
|
|
14
|
-
action: 'inline';
|
|
15
|
-
} | {
|
|
16
|
-
action: 'suspend_resume';
|
|
17
|
-
};
|
|
18
|
-
type FunctionLike = ts.FunctionLikeDeclaration;
|
|
19
|
-
export declare const isAsyncFunctionLike: (node: FunctionLike) => boolean;
|
|
20
|
-
export declare const isAsyncGeneratorLike: (node: ts.Node) => node is FunctionLike;
|
|
21
|
-
export declare const isSyncGeneratorLike: (node: ts.Node) => node is FunctionLike;
|
|
22
|
-
export declare const ownBodyHasAwaitKeyword: (node: FunctionLike, sourceFile: ts.SourceFile) => boolean;
|
|
23
|
-
export type OwnSuspensionFacts = {
|
|
24
|
-
awaitExpressions: boolean;
|
|
25
|
-
forAwait: boolean;
|
|
26
|
-
awaitUsing: boolean;
|
|
27
|
-
unknown: boolean;
|
|
28
|
-
awaitKeyword: boolean;
|
|
29
|
-
};
|
|
30
|
-
export declare const ownSuspensionFacts: (node: FunctionLike, sourceFile: ts.SourceFile) => OwnSuspensionFacts;
|
|
31
|
-
export declare const decideAsyncInstrumentation: (node: FunctionLike, sourceFile: ts.SourceFile) => AsyncInstrumentationAction;
|
|
32
|
-
export {};
|
|
33
|
-
//# sourceMappingURL=suspension-whitelist.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"suspension-whitelist.d.ts","sourceRoot":"","s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0BAcF,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
*/
|
|
6
|
-
import type { InstrumentationManifestDelta } from './instrumentation-manifest-delta';
|
|
7
|
-
export type TransformSourceOptions = {
|
|
8
|
-
filePath: string;
|
|
9
|
-
mapLocation?: SourceLocationMapper;
|
|
10
|
-
verifyTransform?: boolean;
|
|
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;
|
|
15
|
-
export type TransformedSource = {
|
|
16
|
-
code: string;
|
|
17
|
-
delta: InstrumentationManifestDelta;
|
|
18
|
-
};
|
|
19
|
-
export type SourceLocation = {
|
|
20
|
-
filePath: string;
|
|
21
|
-
line: number;
|
|
22
|
-
column: number;
|
|
23
|
-
};
|
|
24
|
-
export type SourceLocationMapper = (location: SourceLocation) => SourceLocation | undefined;
|
|
25
|
-
/** Add low-overhead function-boundary hooks while preserving the customer's source lines. */
|
|
26
|
-
export declare const transformSource: (source: string, options: TransformSourceOptions) => TransformedSource | undefined;
|
|
27
|
-
//# sourceMappingURL=transform-source.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAwgB5F,6FAA6F;AAC7F,eAAO,MAAM,eAAe,GAC3B,QAAQ,MAAM,EACd,SAAS,sBAAsB,KAC7B,iBAAiB,GAAG,SAwOtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|