@rasputin-ai/node 0.7.1 → 0.8.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/dist/execution-recorder/encode-frozen.d.ts.map +1 -1
- package/dist/execution-recorder/execution-recorder-types.d.ts +5 -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/safe-serialize.d.ts +3 -4
- package/dist/execution-recorder/safe-serialize.d.ts.map +1 -1
- package/dist/execution-recorder/value-freeze.d.ts +4 -2
- package/dist/execution-recorder/value-freeze.d.ts.map +1 -1
- package/dist/index.js +32 -17
- package/dist/instrument/bun.js +1 -1
- package/dist/instrument/node.js +1 -1
- package/dist/internal.js +31 -16
- package/dist/sdk-meta.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encode-frozen.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/encode-frozen.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"encode-frozen.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/encode-frozen.ts"],"names":[],"mappings":"AAiFA,eAAO,MAAM,oBAAoB,GAAI,OAAO,OAAO,KAAG,MAmCrD,CAAC;AA2KF,eAAO,MAAM,YAAY,GAAI,OAAO,OAAO,KAAG,OAc7C,CAAC;AAWF,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;CAQvD,CAAC"}
|
|
@@ -8,7 +8,11 @@ import type { EncodedFunctionPlan } from '@rasputin-ai/recorder';
|
|
|
8
8
|
import type { PreparedFunctionPlan } from './function-plan';
|
|
9
9
|
/** A file glob (`src/logger/**`) or a regular expression matched against a function id. */
|
|
10
10
|
export type ExecutionSourceExclusion = string | RegExp;
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Limits and redaction for the runtime recorder. Defaults work for most apps.
|
|
13
|
+
* At startup the recorder also hides values copied from likely-secret
|
|
14
|
+
* environment variables, including URL-encoded forms and connection-URL passwords.
|
|
15
|
+
*/
|
|
12
16
|
export type ExecutionRecorderOptions = {
|
|
13
17
|
/** Turn runtime recording off. RasputinInit leaves this on unless you set `false`. */
|
|
14
18
|
enabled?: boolean;
|
|
@@ -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,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,cAAc,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,2FAA2F;AAC3F,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvD
|
|
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,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,cAAc,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,2FAA2F;AAC3F,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,MAAM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,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":"AAoCA,OAAO,KAAK,EAGX,wBAAwB,EACxB,gBAAgB,EAGhB,MAAM,4BAA4B,CAAC;AA2OpC,wEAAwE;AACxE,eAAO,MAAM,uBAAuB,GACnC,SAAS,wBAAwB,GAAG,SAAS,KAC3C,gBA+/CF,CAAC"}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* Values are frozen on the hot path as a redacted structural snapshot, then encoded
|
|
3
3
|
* to wire JSON only when an error snapshot is materialized.
|
|
4
4
|
*/
|
|
5
|
-
import type
|
|
6
|
-
import { type FrozenSnapshot } from './value-freeze';
|
|
5
|
+
import { type FrozenSnapshot, type ValueFreezeOptions } from './value-freeze';
|
|
7
6
|
export { jsonLiteralUtf8Bytes } from './encode-frozen';
|
|
8
7
|
export type SafeSerializedValue = {
|
|
9
8
|
value: unknown;
|
|
@@ -17,6 +16,6 @@ export type SafeSerializer = {
|
|
|
17
16
|
serialize: (value: unknown) => unknown;
|
|
18
17
|
serializeWithBytes: (value: unknown) => SafeSerializedValue;
|
|
19
18
|
};
|
|
20
|
-
export declare const createSafeSerializer: (options?:
|
|
21
|
-
export declare const safeSerialize: (value: unknown, options?:
|
|
19
|
+
export declare const createSafeSerializer: (options?: ValueFreezeOptions) => SafeSerializer;
|
|
20
|
+
export declare const safeSerialize: (value: unknown, options?: ValueFreezeOptions) => unknown;
|
|
22
21
|
//# 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":"AAAA;;;GAGG;AAGH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"safe-serialize.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/safe-serialize.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAsB,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAElG,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,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,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,cAAc,CAAC;IAC3C,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;IACrC,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IACvC,kBAAkB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,mBAAmB,CAAC;CAC5D,CAAC;AAWF,eAAO,MAAM,oBAAoB,GAAI,UAAS,kBAAuB,KAAG,cAgBvE,CAAC;AAaF,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,EAAE,UAAS,kBAAuB,KAAG,OACpC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ExecutionRecorderOptions } from './execution-recorder-types';
|
|
2
|
-
export declare const REDACTED = "[RASPUTIN_REDACTED]";
|
|
3
2
|
export type FreezeLimits = {
|
|
4
3
|
maxDepth: number;
|
|
5
4
|
maxObjectKeys: number;
|
|
@@ -35,7 +34,10 @@ export type FrozenSnapshot = {
|
|
|
35
34
|
oversize: boolean;
|
|
36
35
|
};
|
|
37
36
|
export declare const isFrozenAtom: (value: unknown) => value is FrozenAtom;
|
|
38
|
-
export
|
|
37
|
+
export type ValueFreezeOptions = ExecutionRecorderOptions & {
|
|
38
|
+
redactSecretValues?: (text: string) => string;
|
|
39
|
+
};
|
|
40
|
+
export declare const createValueFreezer: (options?: ValueFreezeOptions) => {
|
|
39
41
|
freeze: (value: unknown) => FrozenSnapshot;
|
|
40
42
|
limits: FreezeLimits;
|
|
41
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"value-freeze.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/value-freeze.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"value-freeze.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/value-freeze.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAW3E,MAAM,MAAM,YAAY,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,uBAAuB,EAAE,MAAM,CAAC;CAChC,CAAC;AAUF,eAAO,MAAM,MAAM,eAA4B,CAAC;AAEhD,MAAM,MAAM,UAAU,GACnB,WAAW,GACX,KAAK,GACL,UAAU,GACV,WAAW,GACX,IAAI,GACJ,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,OAAO,GACP,UAAU,GACV,MAAM,GACN,OAAO,GACP,QAAQ,GACR,SAAS,GACT,KAAK,GACL,KAAK,GACL,UAAU,GACV,gBAAgB,GAChB,WAAW,GACX,UAAU,GACV,MAAM,CAAC;AAEV,MAAM,MAAM,UAAU,GAAG;IACxB,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AAsXF,eAAO,MAAM,YAAY,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,UACQ,CAAC;AAoBhE,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,GAAG;IAC3D,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CAC9C,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,UAAS,kBAAuB;oBAqa3C,OAAO,KAAG,cAAc;;CA8B/C,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -689,6 +689,7 @@ var scheduleInstrumentationManifestUpload = (options) => {
|
|
|
689
689
|
// src/execution-recorder/execution-recorder.ts
|
|
690
690
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
691
691
|
import {
|
|
692
|
+
createEnvSecretMatcher,
|
|
692
693
|
rasputinOmitted,
|
|
693
694
|
rasputinTagKind,
|
|
694
695
|
runtimeFunctionId as runtimeFunctionId2
|
|
@@ -1414,11 +1415,16 @@ var enforceRuntimeStateSizeBudget = (input, options = {}) => {
|
|
|
1414
1415
|
|
|
1415
1416
|
// src/execution-recorder/encode-frozen.ts
|
|
1416
1417
|
import { Buffer as Buffer3 } from "node:buffer";
|
|
1418
|
+
import { RASPUTIN_REDACTED as RASPUTIN_REDACTED2 } from "@rasputin-ai/core";
|
|
1417
1419
|
|
|
1418
1420
|
// src/execution-recorder/value-freeze.ts
|
|
1419
1421
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
1420
1422
|
import { types } from "node:util";
|
|
1421
|
-
import {
|
|
1423
|
+
import {
|
|
1424
|
+
MAX_ENV_SECRET_NEEDLE_LENGTH,
|
|
1425
|
+
RASPUTIN_REDACTED,
|
|
1426
|
+
RASPUTIN_WIRE_TAG
|
|
1427
|
+
} from "@rasputin-ai/core";
|
|
1422
1428
|
|
|
1423
1429
|
// src/execution-recorder/redact-keys.ts
|
|
1424
1430
|
import { defaultSensitivePropertyNames, propertyNameIsSensitive } from "@rasputin-ai/core";
|
|
@@ -1454,7 +1460,6 @@ var keyIsRedacted = (key, redactKeys) => {
|
|
|
1454
1460
|
};
|
|
1455
1461
|
|
|
1456
1462
|
// src/execution-recorder/value-freeze.ts
|
|
1457
|
-
var REDACTED = "[RASPUTIN_REDACTED]";
|
|
1458
1463
|
var defaults = {
|
|
1459
1464
|
maxDepth: 3,
|
|
1460
1465
|
maxObjectKeys: 30,
|
|
@@ -1766,7 +1771,7 @@ var redactSensitiveQuery = (text, redactKeys) => {
|
|
|
1766
1771
|
}
|
|
1767
1772
|
if (!keyIsRedacted(decoded, redactKeys) && !keyIsRedacted(rawKey, redactKeys)) return part;
|
|
1768
1773
|
changed = true;
|
|
1769
|
-
return `${rawKey}=${
|
|
1774
|
+
return `${rawKey}=${RASPUTIN_REDACTED}`;
|
|
1770
1775
|
});
|
|
1771
1776
|
if (!changed) return text;
|
|
1772
1777
|
return `${prefix}${next.join("&")}${suffix}`;
|
|
@@ -1783,7 +1788,7 @@ var redactUrlUserinfo = (text) => {
|
|
|
1783
1788
|
const authority = rest.slice(0, authorityEnd);
|
|
1784
1789
|
const userinfoEnd = authority.lastIndexOf("@");
|
|
1785
1790
|
if (userinfoEnd < 0) return text;
|
|
1786
|
-
return `${text.slice(0, schemeEnd + 3)}${
|
|
1791
|
+
return `${text.slice(0, schemeEnd + 3)}${RASPUTIN_REDACTED}@${authority.slice(userinfoEnd + 1)}${rest.slice(authorityEnd)}`;
|
|
1787
1792
|
};
|
|
1788
1793
|
var redactUrlLikeString = (text, redactKeys) => redactSensitiveQuery(redactUrlUserinfo(text), redactKeys);
|
|
1789
1794
|
var isFrozenAtom = (value) => typeof value === "object" && value !== null && FROZEN in value;
|
|
@@ -1805,6 +1810,7 @@ var BYTE_LIMIT = "max_serialized_value_bytes";
|
|
|
1805
1810
|
var createValueFreezer = (options = {}) => {
|
|
1806
1811
|
const limits = compileFreezeLimits(options);
|
|
1807
1812
|
const redactKeys = compileRedactKeys(options.redactKeys);
|
|
1813
|
+
const redactSecretValues = options.redactSecretValues;
|
|
1808
1814
|
const sharedPath = /* @__PURE__ */ new Set();
|
|
1809
1815
|
let freezing = false;
|
|
1810
1816
|
const add = (metrics, count) => {
|
|
@@ -1832,11 +1838,16 @@ var createValueFreezer = (options = {}) => {
|
|
|
1832
1838
|
return value;
|
|
1833
1839
|
}
|
|
1834
1840
|
if (typeof value === "string") {
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1841
|
+
let text = value;
|
|
1842
|
+
if (redactSecretValues) {
|
|
1843
|
+
const cap = limits.maxStringLength + MAX_ENV_SECRET_NEEDLE_LENGTH;
|
|
1844
|
+
text = redactSecretValues(value.length > cap ? value.slice(0, cap) : value);
|
|
1838
1845
|
}
|
|
1839
|
-
|
|
1846
|
+
if (text.length <= limits.maxStringLength) {
|
|
1847
|
+
add(metrics, stringEstimate(text));
|
|
1848
|
+
return text;
|
|
1849
|
+
}
|
|
1850
|
+
const sliced = text.slice(0, limits.maxStringLength);
|
|
1840
1851
|
add(metrics, NODE + stringEstimate(sliced) + 48);
|
|
1841
1852
|
return atom("truncated", {
|
|
1842
1853
|
reason: "max_string_length",
|
|
@@ -1936,9 +1947,9 @@ var createValueFreezer = (options = {}) => {
|
|
|
1936
1947
|
const key = freezeInner(mapKey, depth + 1, path, metrics);
|
|
1937
1948
|
if (!keepOverflowChild(key, metrics.oversize)) break;
|
|
1938
1949
|
if (typeof mapKey === "string" && keyIsRedacted(mapKey, redactKeys)) {
|
|
1939
|
-
add(metrics, stringEstimate(
|
|
1950
|
+
add(metrics, stringEstimate(RASPUTIN_REDACTED));
|
|
1940
1951
|
if (metrics.oversize) break;
|
|
1941
|
-
entries.push([key,
|
|
1952
|
+
entries.push([key, RASPUTIN_REDACTED]);
|
|
1942
1953
|
} else {
|
|
1943
1954
|
const mapValue = freezeInner(
|
|
1944
1955
|
Map.prototype.get.call(value, mapKey),
|
|
@@ -2014,9 +2025,9 @@ var createValueFreezer = (options = {}) => {
|
|
|
2014
2025
|
continue;
|
|
2015
2026
|
}
|
|
2016
2027
|
if (redactNext) {
|
|
2017
|
-
add(metrics, stringEstimate(
|
|
2028
|
+
add(metrics, stringEstimate(RASPUTIN_REDACTED));
|
|
2018
2029
|
if (metrics.oversize) break;
|
|
2019
|
-
items.push(
|
|
2030
|
+
items.push(RASPUTIN_REDACTED);
|
|
2020
2031
|
redactNext = false;
|
|
2021
2032
|
} else {
|
|
2022
2033
|
const frozen = freezeInner(descriptor.value, depth + 1, path, metrics);
|
|
@@ -2149,9 +2160,9 @@ var createValueFreezer = (options = {}) => {
|
|
|
2149
2160
|
add(metrics, stringEstimate(key));
|
|
2150
2161
|
if (metrics.oversize) break;
|
|
2151
2162
|
if (keyIsRedacted(key, redactKeys) || key === "value" && pairIsSensitive) {
|
|
2152
|
-
add(metrics, stringEstimate(
|
|
2163
|
+
add(metrics, stringEstimate(RASPUTIN_REDACTED));
|
|
2153
2164
|
if (metrics.oversize) break;
|
|
2154
|
-
assignFrozenField(fields, key,
|
|
2165
|
+
assignFrozenField(fields, key, RASPUTIN_REDACTED);
|
|
2155
2166
|
kept++;
|
|
2156
2167
|
continue;
|
|
2157
2168
|
}
|
|
@@ -2479,7 +2490,7 @@ var encodeAtom = (frozen) => {
|
|
|
2479
2490
|
}
|
|
2480
2491
|
};
|
|
2481
2492
|
var encodeFrozen = (value) => {
|
|
2482
|
-
if (value ===
|
|
2493
|
+
if (value === RASPUTIN_REDACTED2) return RASPUTIN_REDACTED2;
|
|
2483
2494
|
if (isFrozenAtom(value)) return encodeAtom(value);
|
|
2484
2495
|
if (Array.isArray(value)) {
|
|
2485
2496
|
const items = new Array(value.length);
|
|
@@ -2816,7 +2827,11 @@ var createExecutionRecorder = (options) => {
|
|
|
2816
2827
|
maxActiveMemoryBytes,
|
|
2817
2828
|
options.maxSerializedValueBytes ?? 16 * 1024
|
|
2818
2829
|
);
|
|
2819
|
-
const
|
|
2830
|
+
const envSecretMatcher = createEnvSecretMatcher();
|
|
2831
|
+
const serializer = createSafeSerializer({
|
|
2832
|
+
...options,
|
|
2833
|
+
...envSecretMatcher.needleCount > 0 ? { redactSecretValues: envSecretMatcher.redact } : {}
|
|
2834
|
+
});
|
|
2820
2835
|
const excludesSource = createSourceExclusionMatcher(options.excludeSources);
|
|
2821
2836
|
const journalPool = new ExecutionJournalPool(maxEventsPerExecution);
|
|
2822
2837
|
const runtimeStateSizeBudget = {
|
|
@@ -4265,7 +4280,7 @@ var installGlobalHandlers = (client, options = {}) => {
|
|
|
4265
4280
|
|
|
4266
4281
|
// src/sdk-meta.ts
|
|
4267
4282
|
var SDK_NAME = "@rasputin-ai/node";
|
|
4268
|
-
var SDK_VERSION = "0.
|
|
4283
|
+
var SDK_VERSION = "0.8.0";
|
|
4269
4284
|
|
|
4270
4285
|
// src/rasputin-init.ts
|
|
4271
4286
|
var publicExecution = (runtime) => ({
|
package/dist/instrument/bun.js
CHANGED
|
@@ -1606,7 +1606,7 @@ import ts14 from "typescript";
|
|
|
1606
1606
|
import { originalPositionFor as originalPositionFor2, TraceMap as TraceMap3 } from "@jridgewell/trace-mapping";
|
|
1607
1607
|
|
|
1608
1608
|
// src/sdk-meta.ts
|
|
1609
|
-
var SDK_VERSION = "0.
|
|
1609
|
+
var SDK_VERSION = "0.8.0";
|
|
1610
1610
|
|
|
1611
1611
|
// src/auto-instrumentation/source-map-locations.ts
|
|
1612
1612
|
import { readFileSync } from "node:fs";
|
package/dist/instrument/node.js
CHANGED
|
@@ -1668,7 +1668,7 @@ import ts14 from "typescript";
|
|
|
1668
1668
|
import { originalPositionFor as originalPositionFor3, TraceMap as TraceMap4 } from "@jridgewell/trace-mapping";
|
|
1669
1669
|
|
|
1670
1670
|
// src/sdk-meta.ts
|
|
1671
|
-
var SDK_VERSION = "0.
|
|
1671
|
+
var SDK_VERSION = "0.8.0";
|
|
1672
1672
|
|
|
1673
1673
|
// src/auto-instrumentation/transform-disk-cache.ts
|
|
1674
1674
|
var projectCacheDir = () => {
|
package/dist/internal.js
CHANGED
|
@@ -660,6 +660,7 @@ var scheduleInstrumentationManifestUpload = (options) => {
|
|
|
660
660
|
// src/execution-recorder/execution-recorder.ts
|
|
661
661
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
662
662
|
import {
|
|
663
|
+
createEnvSecretMatcher,
|
|
663
664
|
rasputinOmitted,
|
|
664
665
|
rasputinTagKind,
|
|
665
666
|
runtimeFunctionId as runtimeFunctionId2
|
|
@@ -1385,11 +1386,16 @@ var enforceRuntimeStateSizeBudget = (input, options = {}) => {
|
|
|
1385
1386
|
|
|
1386
1387
|
// src/execution-recorder/encode-frozen.ts
|
|
1387
1388
|
import { Buffer as Buffer3 } from "node:buffer";
|
|
1389
|
+
import { RASPUTIN_REDACTED as RASPUTIN_REDACTED2 } from "@rasputin-ai/core";
|
|
1388
1390
|
|
|
1389
1391
|
// src/execution-recorder/value-freeze.ts
|
|
1390
1392
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
1391
1393
|
import { types } from "node:util";
|
|
1392
|
-
import {
|
|
1394
|
+
import {
|
|
1395
|
+
MAX_ENV_SECRET_NEEDLE_LENGTH,
|
|
1396
|
+
RASPUTIN_REDACTED,
|
|
1397
|
+
RASPUTIN_WIRE_TAG
|
|
1398
|
+
} from "@rasputin-ai/core";
|
|
1393
1399
|
|
|
1394
1400
|
// src/execution-recorder/redact-keys.ts
|
|
1395
1401
|
import { defaultSensitivePropertyNames, propertyNameIsSensitive } from "@rasputin-ai/core";
|
|
@@ -1425,7 +1431,6 @@ var keyIsRedacted = (key, redactKeys) => {
|
|
|
1425
1431
|
};
|
|
1426
1432
|
|
|
1427
1433
|
// src/execution-recorder/value-freeze.ts
|
|
1428
|
-
var REDACTED = "[RASPUTIN_REDACTED]";
|
|
1429
1434
|
var defaults = {
|
|
1430
1435
|
maxDepth: 3,
|
|
1431
1436
|
maxObjectKeys: 30,
|
|
@@ -1737,7 +1742,7 @@ var redactSensitiveQuery = (text, redactKeys) => {
|
|
|
1737
1742
|
}
|
|
1738
1743
|
if (!keyIsRedacted(decoded, redactKeys) && !keyIsRedacted(rawKey, redactKeys)) return part;
|
|
1739
1744
|
changed = true;
|
|
1740
|
-
return `${rawKey}=${
|
|
1745
|
+
return `${rawKey}=${RASPUTIN_REDACTED}`;
|
|
1741
1746
|
});
|
|
1742
1747
|
if (!changed) return text;
|
|
1743
1748
|
return `${prefix}${next.join("&")}${suffix}`;
|
|
@@ -1754,7 +1759,7 @@ var redactUrlUserinfo = (text) => {
|
|
|
1754
1759
|
const authority = rest.slice(0, authorityEnd);
|
|
1755
1760
|
const userinfoEnd = authority.lastIndexOf("@");
|
|
1756
1761
|
if (userinfoEnd < 0) return text;
|
|
1757
|
-
return `${text.slice(0, schemeEnd + 3)}${
|
|
1762
|
+
return `${text.slice(0, schemeEnd + 3)}${RASPUTIN_REDACTED}@${authority.slice(userinfoEnd + 1)}${rest.slice(authorityEnd)}`;
|
|
1758
1763
|
};
|
|
1759
1764
|
var redactUrlLikeString = (text, redactKeys) => redactSensitiveQuery(redactUrlUserinfo(text), redactKeys);
|
|
1760
1765
|
var isFrozenAtom = (value) => typeof value === "object" && value !== null && FROZEN in value;
|
|
@@ -1776,6 +1781,7 @@ var BYTE_LIMIT = "max_serialized_value_bytes";
|
|
|
1776
1781
|
var createValueFreezer = (options = {}) => {
|
|
1777
1782
|
const limits = compileFreezeLimits(options);
|
|
1778
1783
|
const redactKeys = compileRedactKeys(options.redactKeys);
|
|
1784
|
+
const redactSecretValues = options.redactSecretValues;
|
|
1779
1785
|
const sharedPath = /* @__PURE__ */ new Set();
|
|
1780
1786
|
let freezing = false;
|
|
1781
1787
|
const add = (metrics, count) => {
|
|
@@ -1803,11 +1809,16 @@ var createValueFreezer = (options = {}) => {
|
|
|
1803
1809
|
return value;
|
|
1804
1810
|
}
|
|
1805
1811
|
if (typeof value === "string") {
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1812
|
+
let text = value;
|
|
1813
|
+
if (redactSecretValues) {
|
|
1814
|
+
const cap = limits.maxStringLength + MAX_ENV_SECRET_NEEDLE_LENGTH;
|
|
1815
|
+
text = redactSecretValues(value.length > cap ? value.slice(0, cap) : value);
|
|
1809
1816
|
}
|
|
1810
|
-
|
|
1817
|
+
if (text.length <= limits.maxStringLength) {
|
|
1818
|
+
add(metrics, stringEstimate(text));
|
|
1819
|
+
return text;
|
|
1820
|
+
}
|
|
1821
|
+
const sliced = text.slice(0, limits.maxStringLength);
|
|
1811
1822
|
add(metrics, NODE + stringEstimate(sliced) + 48);
|
|
1812
1823
|
return atom("truncated", {
|
|
1813
1824
|
reason: "max_string_length",
|
|
@@ -1907,9 +1918,9 @@ var createValueFreezer = (options = {}) => {
|
|
|
1907
1918
|
const key = freezeInner(mapKey, depth + 1, path, metrics);
|
|
1908
1919
|
if (!keepOverflowChild(key, metrics.oversize)) break;
|
|
1909
1920
|
if (typeof mapKey === "string" && keyIsRedacted(mapKey, redactKeys)) {
|
|
1910
|
-
add(metrics, stringEstimate(
|
|
1921
|
+
add(metrics, stringEstimate(RASPUTIN_REDACTED));
|
|
1911
1922
|
if (metrics.oversize) break;
|
|
1912
|
-
entries.push([key,
|
|
1923
|
+
entries.push([key, RASPUTIN_REDACTED]);
|
|
1913
1924
|
} else {
|
|
1914
1925
|
const mapValue = freezeInner(
|
|
1915
1926
|
Map.prototype.get.call(value, mapKey),
|
|
@@ -1985,9 +1996,9 @@ var createValueFreezer = (options = {}) => {
|
|
|
1985
1996
|
continue;
|
|
1986
1997
|
}
|
|
1987
1998
|
if (redactNext) {
|
|
1988
|
-
add(metrics, stringEstimate(
|
|
1999
|
+
add(metrics, stringEstimate(RASPUTIN_REDACTED));
|
|
1989
2000
|
if (metrics.oversize) break;
|
|
1990
|
-
items.push(
|
|
2001
|
+
items.push(RASPUTIN_REDACTED);
|
|
1991
2002
|
redactNext = false;
|
|
1992
2003
|
} else {
|
|
1993
2004
|
const frozen = freezeInner(descriptor.value, depth + 1, path, metrics);
|
|
@@ -2120,9 +2131,9 @@ var createValueFreezer = (options = {}) => {
|
|
|
2120
2131
|
add(metrics, stringEstimate(key));
|
|
2121
2132
|
if (metrics.oversize) break;
|
|
2122
2133
|
if (keyIsRedacted(key, redactKeys) || key === "value" && pairIsSensitive) {
|
|
2123
|
-
add(metrics, stringEstimate(
|
|
2134
|
+
add(metrics, stringEstimate(RASPUTIN_REDACTED));
|
|
2124
2135
|
if (metrics.oversize) break;
|
|
2125
|
-
assignFrozenField(fields, key,
|
|
2136
|
+
assignFrozenField(fields, key, RASPUTIN_REDACTED);
|
|
2126
2137
|
kept++;
|
|
2127
2138
|
continue;
|
|
2128
2139
|
}
|
|
@@ -2450,7 +2461,7 @@ var encodeAtom = (frozen) => {
|
|
|
2450
2461
|
}
|
|
2451
2462
|
};
|
|
2452
2463
|
var encodeFrozen = (value) => {
|
|
2453
|
-
if (value ===
|
|
2464
|
+
if (value === RASPUTIN_REDACTED2) return RASPUTIN_REDACTED2;
|
|
2454
2465
|
if (isFrozenAtom(value)) return encodeAtom(value);
|
|
2455
2466
|
if (Array.isArray(value)) {
|
|
2456
2467
|
const items = new Array(value.length);
|
|
@@ -2787,7 +2798,11 @@ var createExecutionRecorder = (options) => {
|
|
|
2787
2798
|
maxActiveMemoryBytes,
|
|
2788
2799
|
options.maxSerializedValueBytes ?? 16 * 1024
|
|
2789
2800
|
);
|
|
2790
|
-
const
|
|
2801
|
+
const envSecretMatcher = createEnvSecretMatcher();
|
|
2802
|
+
const serializer = createSafeSerializer({
|
|
2803
|
+
...options,
|
|
2804
|
+
...envSecretMatcher.needleCount > 0 ? { redactSecretValues: envSecretMatcher.redact } : {}
|
|
2805
|
+
});
|
|
2791
2806
|
const excludesSource = createSourceExclusionMatcher(options.excludeSources);
|
|
2792
2807
|
const journalPool = new ExecutionJournalPool(maxEventsPerExecution);
|
|
2793
2808
|
const runtimeStateSizeBudget = {
|
package/dist/sdk-meta.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rasputin-ai/node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Official Rasputin AI SDK for Node and Bun.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@jridgewell/trace-mapping": "0.3.31",
|
|
52
|
-
"@rasputin-ai/core": "0.
|
|
52
|
+
"@rasputin-ai/core": "0.8.0",
|
|
53
53
|
"typescript": "5"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|