@rasputin-ai/node 0.7.0 → 0.7.2-beta.1
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 +5 -5
- 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 +28 -17
- package/dist/instrument/bun.js +1 -1
- package/dist/instrument/node.js +1 -1
- package/dist/internal.js +27 -16
- package/dist/sdk-meta.d.ts +1 -1
- package/dist/sdk-meta.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# Official Rasputin AI SDK for Node and Bun
|
|
2
|
-
|
|
3
|
-
Report application errors to Rasputin from Node or Bun services.
|
|
4
|
-
|
|
5
|
-
See the [Node documentation](https://rasputinai.dev/docs/node/installation).
|
|
1
|
+
# Official Rasputin AI SDK for Node and Bun
|
|
2
|
+
|
|
3
|
+
Report application errors to Rasputin from Node or Bun services.
|
|
4
|
+
|
|
5
|
+
See the [Node documentation](https://rasputinai.dev/docs/node/installation).
|
|
@@ -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":["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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":"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":"AAQA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"value-freeze.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/value-freeze.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAW3E,MAAM,MAAM,YAAY,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAA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AAO,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,12 @@ 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 { RASPUTIN_WIRE_TAG } from "@rasputin-ai/core";
|
|
1423
|
+
import { MAX_ENV_SECRET_NEEDLE_LENGTH, RASPUTIN_REDACTED, RASPUTIN_WIRE_TAG } from "@rasputin-ai/core";
|
|
1422
1424
|
|
|
1423
1425
|
// src/execution-recorder/redact-keys.ts
|
|
1424
1426
|
import { defaultSensitivePropertyNames, propertyNameIsSensitive } from "@rasputin-ai/core";
|
|
@@ -1454,7 +1456,6 @@ var keyIsRedacted = (key, redactKeys) => {
|
|
|
1454
1456
|
};
|
|
1455
1457
|
|
|
1456
1458
|
// src/execution-recorder/value-freeze.ts
|
|
1457
|
-
var REDACTED = "[RASPUTIN_REDACTED]";
|
|
1458
1459
|
var defaults = {
|
|
1459
1460
|
maxDepth: 3,
|
|
1460
1461
|
maxObjectKeys: 30,
|
|
@@ -1766,7 +1767,7 @@ var redactSensitiveQuery = (text, redactKeys) => {
|
|
|
1766
1767
|
}
|
|
1767
1768
|
if (!keyIsRedacted(decoded, redactKeys) && !keyIsRedacted(rawKey, redactKeys)) return part;
|
|
1768
1769
|
changed = true;
|
|
1769
|
-
return `${rawKey}=${
|
|
1770
|
+
return `${rawKey}=${RASPUTIN_REDACTED}`;
|
|
1770
1771
|
});
|
|
1771
1772
|
if (!changed) return text;
|
|
1772
1773
|
return `${prefix}${next.join("&")}${suffix}`;
|
|
@@ -1783,7 +1784,7 @@ var redactUrlUserinfo = (text) => {
|
|
|
1783
1784
|
const authority = rest.slice(0, authorityEnd);
|
|
1784
1785
|
const userinfoEnd = authority.lastIndexOf("@");
|
|
1785
1786
|
if (userinfoEnd < 0) return text;
|
|
1786
|
-
return `${text.slice(0, schemeEnd + 3)}${
|
|
1787
|
+
return `${text.slice(0, schemeEnd + 3)}${RASPUTIN_REDACTED}@${authority.slice(userinfoEnd + 1)}${rest.slice(authorityEnd)}`;
|
|
1787
1788
|
};
|
|
1788
1789
|
var redactUrlLikeString = (text, redactKeys) => redactSensitiveQuery(redactUrlUserinfo(text), redactKeys);
|
|
1789
1790
|
var isFrozenAtom = (value) => typeof value === "object" && value !== null && FROZEN in value;
|
|
@@ -1805,6 +1806,7 @@ var BYTE_LIMIT = "max_serialized_value_bytes";
|
|
|
1805
1806
|
var createValueFreezer = (options = {}) => {
|
|
1806
1807
|
const limits = compileFreezeLimits(options);
|
|
1807
1808
|
const redactKeys = compileRedactKeys(options.redactKeys);
|
|
1809
|
+
const redactSecretValues = options.redactSecretValues;
|
|
1808
1810
|
const sharedPath = /* @__PURE__ */ new Set();
|
|
1809
1811
|
let freezing = false;
|
|
1810
1812
|
const add = (metrics, count) => {
|
|
@@ -1832,11 +1834,16 @@ var createValueFreezer = (options = {}) => {
|
|
|
1832
1834
|
return value;
|
|
1833
1835
|
}
|
|
1834
1836
|
if (typeof value === "string") {
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1837
|
+
let text = value;
|
|
1838
|
+
if (redactSecretValues) {
|
|
1839
|
+
const cap = limits.maxStringLength + MAX_ENV_SECRET_NEEDLE_LENGTH;
|
|
1840
|
+
text = redactSecretValues(value.length > cap ? value.slice(0, cap) : value);
|
|
1841
|
+
}
|
|
1842
|
+
if (text.length <= limits.maxStringLength) {
|
|
1843
|
+
add(metrics, stringEstimate(text));
|
|
1844
|
+
return text;
|
|
1838
1845
|
}
|
|
1839
|
-
const sliced =
|
|
1846
|
+
const sliced = text.slice(0, limits.maxStringLength);
|
|
1840
1847
|
add(metrics, NODE + stringEstimate(sliced) + 48);
|
|
1841
1848
|
return atom("truncated", {
|
|
1842
1849
|
reason: "max_string_length",
|
|
@@ -1936,9 +1943,9 @@ var createValueFreezer = (options = {}) => {
|
|
|
1936
1943
|
const key = freezeInner(mapKey, depth + 1, path, metrics);
|
|
1937
1944
|
if (!keepOverflowChild(key, metrics.oversize)) break;
|
|
1938
1945
|
if (typeof mapKey === "string" && keyIsRedacted(mapKey, redactKeys)) {
|
|
1939
|
-
add(metrics, stringEstimate(
|
|
1946
|
+
add(metrics, stringEstimate(RASPUTIN_REDACTED));
|
|
1940
1947
|
if (metrics.oversize) break;
|
|
1941
|
-
entries.push([key,
|
|
1948
|
+
entries.push([key, RASPUTIN_REDACTED]);
|
|
1942
1949
|
} else {
|
|
1943
1950
|
const mapValue = freezeInner(
|
|
1944
1951
|
Map.prototype.get.call(value, mapKey),
|
|
@@ -2014,9 +2021,9 @@ var createValueFreezer = (options = {}) => {
|
|
|
2014
2021
|
continue;
|
|
2015
2022
|
}
|
|
2016
2023
|
if (redactNext) {
|
|
2017
|
-
add(metrics, stringEstimate(
|
|
2024
|
+
add(metrics, stringEstimate(RASPUTIN_REDACTED));
|
|
2018
2025
|
if (metrics.oversize) break;
|
|
2019
|
-
items.push(
|
|
2026
|
+
items.push(RASPUTIN_REDACTED);
|
|
2020
2027
|
redactNext = false;
|
|
2021
2028
|
} else {
|
|
2022
2029
|
const frozen = freezeInner(descriptor.value, depth + 1, path, metrics);
|
|
@@ -2149,9 +2156,9 @@ var createValueFreezer = (options = {}) => {
|
|
|
2149
2156
|
add(metrics, stringEstimate(key));
|
|
2150
2157
|
if (metrics.oversize) break;
|
|
2151
2158
|
if (keyIsRedacted(key, redactKeys) || key === "value" && pairIsSensitive) {
|
|
2152
|
-
add(metrics, stringEstimate(
|
|
2159
|
+
add(metrics, stringEstimate(RASPUTIN_REDACTED));
|
|
2153
2160
|
if (metrics.oversize) break;
|
|
2154
|
-
assignFrozenField(fields, key,
|
|
2161
|
+
assignFrozenField(fields, key, RASPUTIN_REDACTED);
|
|
2155
2162
|
kept++;
|
|
2156
2163
|
continue;
|
|
2157
2164
|
}
|
|
@@ -2479,7 +2486,7 @@ var encodeAtom = (frozen) => {
|
|
|
2479
2486
|
}
|
|
2480
2487
|
};
|
|
2481
2488
|
var encodeFrozen = (value) => {
|
|
2482
|
-
if (value ===
|
|
2489
|
+
if (value === RASPUTIN_REDACTED2) return RASPUTIN_REDACTED2;
|
|
2483
2490
|
if (isFrozenAtom(value)) return encodeAtom(value);
|
|
2484
2491
|
if (Array.isArray(value)) {
|
|
2485
2492
|
const items = new Array(value.length);
|
|
@@ -2816,7 +2823,11 @@ var createExecutionRecorder = (options) => {
|
|
|
2816
2823
|
maxActiveMemoryBytes,
|
|
2817
2824
|
options.maxSerializedValueBytes ?? 16 * 1024
|
|
2818
2825
|
);
|
|
2819
|
-
const
|
|
2826
|
+
const envSecretMatcher = createEnvSecretMatcher();
|
|
2827
|
+
const serializer = createSafeSerializer({
|
|
2828
|
+
...options,
|
|
2829
|
+
...envSecretMatcher.needleCount > 0 ? { redactSecretValues: envSecretMatcher.redact } : {}
|
|
2830
|
+
});
|
|
2820
2831
|
const excludesSource = createSourceExclusionMatcher(options.excludeSources);
|
|
2821
2832
|
const journalPool = new ExecutionJournalPool(maxEventsPerExecution);
|
|
2822
2833
|
const runtimeStateSizeBudget = {
|
|
@@ -4265,7 +4276,7 @@ var installGlobalHandlers = (client, options = {}) => {
|
|
|
4265
4276
|
|
|
4266
4277
|
// src/sdk-meta.ts
|
|
4267
4278
|
var SDK_NAME = "@rasputin-ai/node";
|
|
4268
|
-
var SDK_VERSION = "0.7.
|
|
4279
|
+
var SDK_VERSION = "0.7.2-beta.1";
|
|
4269
4280
|
|
|
4270
4281
|
// src/rasputin-init.ts
|
|
4271
4282
|
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.7.
|
|
1609
|
+
var SDK_VERSION = "0.7.2-beta.1";
|
|
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.7.
|
|
1671
|
+
var SDK_VERSION = "0.7.2-beta.1";
|
|
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,12 @@ 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 { RASPUTIN_WIRE_TAG } from "@rasputin-ai/core";
|
|
1394
|
+
import { MAX_ENV_SECRET_NEEDLE_LENGTH, RASPUTIN_REDACTED, RASPUTIN_WIRE_TAG } from "@rasputin-ai/core";
|
|
1393
1395
|
|
|
1394
1396
|
// src/execution-recorder/redact-keys.ts
|
|
1395
1397
|
import { defaultSensitivePropertyNames, propertyNameIsSensitive } from "@rasputin-ai/core";
|
|
@@ -1425,7 +1427,6 @@ var keyIsRedacted = (key, redactKeys) => {
|
|
|
1425
1427
|
};
|
|
1426
1428
|
|
|
1427
1429
|
// src/execution-recorder/value-freeze.ts
|
|
1428
|
-
var REDACTED = "[RASPUTIN_REDACTED]";
|
|
1429
1430
|
var defaults = {
|
|
1430
1431
|
maxDepth: 3,
|
|
1431
1432
|
maxObjectKeys: 30,
|
|
@@ -1737,7 +1738,7 @@ var redactSensitiveQuery = (text, redactKeys) => {
|
|
|
1737
1738
|
}
|
|
1738
1739
|
if (!keyIsRedacted(decoded, redactKeys) && !keyIsRedacted(rawKey, redactKeys)) return part;
|
|
1739
1740
|
changed = true;
|
|
1740
|
-
return `${rawKey}=${
|
|
1741
|
+
return `${rawKey}=${RASPUTIN_REDACTED}`;
|
|
1741
1742
|
});
|
|
1742
1743
|
if (!changed) return text;
|
|
1743
1744
|
return `${prefix}${next.join("&")}${suffix}`;
|
|
@@ -1754,7 +1755,7 @@ var redactUrlUserinfo = (text) => {
|
|
|
1754
1755
|
const authority = rest.slice(0, authorityEnd);
|
|
1755
1756
|
const userinfoEnd = authority.lastIndexOf("@");
|
|
1756
1757
|
if (userinfoEnd < 0) return text;
|
|
1757
|
-
return `${text.slice(0, schemeEnd + 3)}${
|
|
1758
|
+
return `${text.slice(0, schemeEnd + 3)}${RASPUTIN_REDACTED}@${authority.slice(userinfoEnd + 1)}${rest.slice(authorityEnd)}`;
|
|
1758
1759
|
};
|
|
1759
1760
|
var redactUrlLikeString = (text, redactKeys) => redactSensitiveQuery(redactUrlUserinfo(text), redactKeys);
|
|
1760
1761
|
var isFrozenAtom = (value) => typeof value === "object" && value !== null && FROZEN in value;
|
|
@@ -1776,6 +1777,7 @@ var BYTE_LIMIT = "max_serialized_value_bytes";
|
|
|
1776
1777
|
var createValueFreezer = (options = {}) => {
|
|
1777
1778
|
const limits = compileFreezeLimits(options);
|
|
1778
1779
|
const redactKeys = compileRedactKeys(options.redactKeys);
|
|
1780
|
+
const redactSecretValues = options.redactSecretValues;
|
|
1779
1781
|
const sharedPath = /* @__PURE__ */ new Set();
|
|
1780
1782
|
let freezing = false;
|
|
1781
1783
|
const add = (metrics, count) => {
|
|
@@ -1803,11 +1805,16 @@ var createValueFreezer = (options = {}) => {
|
|
|
1803
1805
|
return value;
|
|
1804
1806
|
}
|
|
1805
1807
|
if (typeof value === "string") {
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1808
|
+
let text = value;
|
|
1809
|
+
if (redactSecretValues) {
|
|
1810
|
+
const cap = limits.maxStringLength + MAX_ENV_SECRET_NEEDLE_LENGTH;
|
|
1811
|
+
text = redactSecretValues(value.length > cap ? value.slice(0, cap) : value);
|
|
1812
|
+
}
|
|
1813
|
+
if (text.length <= limits.maxStringLength) {
|
|
1814
|
+
add(metrics, stringEstimate(text));
|
|
1815
|
+
return text;
|
|
1809
1816
|
}
|
|
1810
|
-
const sliced =
|
|
1817
|
+
const sliced = text.slice(0, limits.maxStringLength);
|
|
1811
1818
|
add(metrics, NODE + stringEstimate(sliced) + 48);
|
|
1812
1819
|
return atom("truncated", {
|
|
1813
1820
|
reason: "max_string_length",
|
|
@@ -1907,9 +1914,9 @@ var createValueFreezer = (options = {}) => {
|
|
|
1907
1914
|
const key = freezeInner(mapKey, depth + 1, path, metrics);
|
|
1908
1915
|
if (!keepOverflowChild(key, metrics.oversize)) break;
|
|
1909
1916
|
if (typeof mapKey === "string" && keyIsRedacted(mapKey, redactKeys)) {
|
|
1910
|
-
add(metrics, stringEstimate(
|
|
1917
|
+
add(metrics, stringEstimate(RASPUTIN_REDACTED));
|
|
1911
1918
|
if (metrics.oversize) break;
|
|
1912
|
-
entries.push([key,
|
|
1919
|
+
entries.push([key, RASPUTIN_REDACTED]);
|
|
1913
1920
|
} else {
|
|
1914
1921
|
const mapValue = freezeInner(
|
|
1915
1922
|
Map.prototype.get.call(value, mapKey),
|
|
@@ -1985,9 +1992,9 @@ var createValueFreezer = (options = {}) => {
|
|
|
1985
1992
|
continue;
|
|
1986
1993
|
}
|
|
1987
1994
|
if (redactNext) {
|
|
1988
|
-
add(metrics, stringEstimate(
|
|
1995
|
+
add(metrics, stringEstimate(RASPUTIN_REDACTED));
|
|
1989
1996
|
if (metrics.oversize) break;
|
|
1990
|
-
items.push(
|
|
1997
|
+
items.push(RASPUTIN_REDACTED);
|
|
1991
1998
|
redactNext = false;
|
|
1992
1999
|
} else {
|
|
1993
2000
|
const frozen = freezeInner(descriptor.value, depth + 1, path, metrics);
|
|
@@ -2120,9 +2127,9 @@ var createValueFreezer = (options = {}) => {
|
|
|
2120
2127
|
add(metrics, stringEstimate(key));
|
|
2121
2128
|
if (metrics.oversize) break;
|
|
2122
2129
|
if (keyIsRedacted(key, redactKeys) || key === "value" && pairIsSensitive) {
|
|
2123
|
-
add(metrics, stringEstimate(
|
|
2130
|
+
add(metrics, stringEstimate(RASPUTIN_REDACTED));
|
|
2124
2131
|
if (metrics.oversize) break;
|
|
2125
|
-
assignFrozenField(fields, key,
|
|
2132
|
+
assignFrozenField(fields, key, RASPUTIN_REDACTED);
|
|
2126
2133
|
kept++;
|
|
2127
2134
|
continue;
|
|
2128
2135
|
}
|
|
@@ -2450,7 +2457,7 @@ var encodeAtom = (frozen) => {
|
|
|
2450
2457
|
}
|
|
2451
2458
|
};
|
|
2452
2459
|
var encodeFrozen = (value) => {
|
|
2453
|
-
if (value ===
|
|
2460
|
+
if (value === RASPUTIN_REDACTED2) return RASPUTIN_REDACTED2;
|
|
2454
2461
|
if (isFrozenAtom(value)) return encodeAtom(value);
|
|
2455
2462
|
if (Array.isArray(value)) {
|
|
2456
2463
|
const items = new Array(value.length);
|
|
@@ -2787,7 +2794,11 @@ var createExecutionRecorder = (options) => {
|
|
|
2787
2794
|
maxActiveMemoryBytes,
|
|
2788
2795
|
options.maxSerializedValueBytes ?? 16 * 1024
|
|
2789
2796
|
);
|
|
2790
|
-
const
|
|
2797
|
+
const envSecretMatcher = createEnvSecretMatcher();
|
|
2798
|
+
const serializer = createSafeSerializer({
|
|
2799
|
+
...options,
|
|
2800
|
+
...envSecretMatcher.needleCount > 0 ? { redactSecretValues: envSecretMatcher.redact } : {}
|
|
2801
|
+
});
|
|
2791
2802
|
const excludesSource = createSourceExclusionMatcher(options.excludeSources);
|
|
2792
2803
|
const journalPool = new ExecutionJournalPool(maxEventsPerExecution);
|
|
2793
2804
|
const runtimeStateSizeBudget = {
|
package/dist/sdk-meta.d.ts
CHANGED
package/dist/sdk-meta.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk-meta.d.ts","sourceRoot":"","sources":["../src/sdk-meta.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,eAAO,MAAM,QAAQ,sBAAsB,CAAC;AAC5C,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"sdk-meta.d.ts","sourceRoot":"","sources":["../src/sdk-meta.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,eAAO,MAAM,QAAQ,sBAAsB,CAAC;AAC5C,eAAO,MAAM,WAAW,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rasputin-ai/node",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2-beta.1",
|
|
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.7.
|
|
52
|
+
"@rasputin-ai/core": "0.7.2-beta.1",
|
|
53
53
|
"typescript": "5"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|