@rasputin-ai/core 0.3.0 → 0.4.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/create-client/create-client-types.d.ts +34 -12
- package/dist/create-client/create-client-types.d.ts.map +1 -1
- package/dist/create-client/create-client.d.ts.map +1 -1
- package/dist/create-client/resolve-endpoint-urls.d.ts +1 -1
- package/dist/create-client/resolve-endpoint-urls.d.ts.map +1 -1
- package/dist/create-ingest-event/create-ingest-event-types.d.ts +2 -0
- package/dist/create-ingest-event/create-ingest-event-types.d.ts.map +1 -1
- package/dist/create-ingest-event/create-ingest-event.d.ts.map +1 -1
- package/dist/create-ingest-event/runtime-execution-state-types.d.ts +5 -1
- package/dist/create-ingest-event/runtime-execution-state-types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +139 -68
- package/dist/instrumentation-manifest/instrumentation-manifest-types.d.ts +29 -6
- package/dist/instrumentation-manifest/instrumentation-manifest-types.d.ts.map +1 -1
- package/dist/instrumentation-manifest/upload-instrumentation-manifest.d.ts +7 -2
- package/dist/instrumentation-manifest/upload-instrumentation-manifest.d.ts.map +1 -1
- package/dist/normalize-frames/normalize-frames.d.ts +4 -2
- package/dist/normalize-frames/normalize-frames.d.ts.map +1 -1
- package/dist/repo-root/warn-repo-root-setup.d.ts +0 -1
- package/dist/repo-root/warn-repo-root-setup.d.ts.map +1 -1
- package/dist/sdk-meta.d.ts +2 -2
- package/dist/sdk-meta.d.ts.map +1 -1
- package/dist/source-identity/source-identity.d.ts +25 -0
- package/dist/source-identity/source-identity.d.ts.map +1 -0
- package/package.json +1 -2
|
@@ -27,7 +27,37 @@ type RasputinBaseOptions = {
|
|
|
27
27
|
* @default true
|
|
28
28
|
*/
|
|
29
29
|
enabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Print a configuration summary when setup succeeds. Failures always log.
|
|
32
|
+
* Set to `false` to keep production logs quiet.
|
|
33
|
+
*
|
|
34
|
+
* @default true
|
|
35
|
+
*/
|
|
36
|
+
logSuccess?: boolean;
|
|
30
37
|
apiUrl?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Folder of this service inside the Git repo, such as `apps/api`.
|
|
40
|
+
* Only needed in a monorepo when the same relative path exists in more than
|
|
41
|
+
* one package. Use a repo-relative path, not a Docker or container path.
|
|
42
|
+
*/
|
|
43
|
+
sourceRoot?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Map each package's `package.json` `"name"` to its folder in the Git repo,
|
|
46
|
+
* such as `{ "@acme/api": "apps/api" }`. Use when several packages share the
|
|
47
|
+
* same relative file paths.
|
|
48
|
+
*/
|
|
49
|
+
sourceRoots?: Record<string, string>;
|
|
50
|
+
/**
|
|
51
|
+
* Absolute path to the project folder on this machine. Stack traces then
|
|
52
|
+
* show `src/app.ts` instead of `/var/app/src/app.ts`.
|
|
53
|
+
* Prefer `moduleUrl: import.meta.url` unless you need to set the folder yourself.
|
|
54
|
+
*/
|
|
55
|
+
repoRoot?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Pass `import.meta.url` from the file that calls `RasputinInit`.
|
|
58
|
+
* Stack traces then show project-relative paths.
|
|
59
|
+
*/
|
|
60
|
+
moduleUrl?: string;
|
|
31
61
|
};
|
|
32
62
|
/**
|
|
33
63
|
* Options passed to `RasputinInit` / `createClient`.
|
|
@@ -39,22 +69,14 @@ type RasputinBaseOptions = {
|
|
|
39
69
|
* projectApiKey: 'rp_…', // from your Rasputin project settings
|
|
40
70
|
* environment: 'production', // e.g. production | staging | preview
|
|
41
71
|
* release: process.env.RASPUTIN_RELEASE!,
|
|
42
|
-
* moduleUrl: import.meta.url, // from the file where you call this
|
|
43
72
|
* });
|
|
44
73
|
* ```
|
|
45
74
|
*
|
|
46
|
-
* Pass `moduleUrl: import.meta.url`
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* you open in your editor instead.
|
|
75
|
+
* Pass `moduleUrl: import.meta.url` if you want stack traces to use project-relative paths.
|
|
76
|
+
* In a monorepo, set `sourceRoot` or `sourceRoots` only if Rasputin cannot tell which
|
|
77
|
+
* package a recorded file belongs to.
|
|
50
78
|
*/
|
|
51
|
-
export type RasputinOptions = RasputinBaseOptions
|
|
52
|
-
repoRoot: string;
|
|
53
|
-
moduleUrl?: string;
|
|
54
|
-
} | {
|
|
55
|
-
moduleUrl: string;
|
|
56
|
-
repoRoot?: string;
|
|
57
|
-
});
|
|
79
|
+
export type RasputinOptions = RasputinBaseOptions;
|
|
58
80
|
/**
|
|
59
81
|
* Extra context for a captured error.
|
|
60
82
|
* Framework plugins (Elysia, etc.) fill `request` automatically for route failures.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-client-types.d.ts","sourceRoot":"","sources":["../../src/create-client/create-client-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AACvF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAClG,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnF,KAAK,mBAAmB,GAAG;IAC1B,4EAA4E;IAC5E,aAAa,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;;;;OASG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,
|
|
1
|
+
{"version":3,"file":"create-client-types.d.ts","sourceRoot":"","sources":["../../src/create-client/create-client-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AACvF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAClG,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnF,KAAK,m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Q,EAAE,MAAM,mBAAmB,CAAC;CACpC,CAAC;AAEF,qFAAqF;AACrF,MAAM,MAAM,iBAAiB,GAAG;IAC/B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,8BAA8B,CAAC,EAAE,OAAO,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-client.d.ts","sourceRoot":"","sources":["../../src/create-client/create-client.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAuBhG,kFAAkF;AAClF,eAAO,MAAM,sBAAsB,YAGlC,CAAC;AAaF;;;GAGG;AACH,eAAO,MAAM,YAAY,GACxB,SAAS,eAAe,EACxB,QAAO,iBAAsB,KAC3B,
|
|
1
|
+
{"version":3,"file":"create-client.d.ts","sourceRoot":"","sources":["../../src/create-client/create-client.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAuBhG,kFAAkF;AAClF,eAAO,MAAM,sBAAsB,YAGlC,CAAC;AAaF;;;GAGG;AACH,eAAO,MAAM,YAAY,GACxB,SAAS,eAAe,EACxB,QAAO,iBAAsB,KAC3B,cAoKF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Production ingest API origin. Override via `apiUrl` for local / self-hosted. */
|
|
2
|
-
export declare const DEFAULT_API_URL = "https://
|
|
2
|
+
export declare const DEFAULT_API_URL = "https://api.rasputinai.dev";
|
|
3
3
|
export declare const resolveEndpointUrls: (apiUrl?: string) => {
|
|
4
4
|
ingestUrl: string;
|
|
5
5
|
deployUrl: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-endpoint-urls.d.ts","sourceRoot":"","sources":["../../src/create-client/resolve-endpoint-urls.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"resolve-endpoint-urls.d.ts","sourceRoot":"","sources":["../../src/create-client/resolve-endpoint-urls.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,eAAO,MAAM,eAAe,+BAA+B,CAAC;AAE5D,eAAO,MAAM,mBAAmB,GAAI,eAAwB;;;;CAO3D,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { Frame } from '../normalize-frames/normalize-frames';
|
|
2
|
+
import type { SourcePosition } from '../source-identity/source-identity';
|
|
2
3
|
import type { RuntimeExecutionState } from './runtime-execution-state-types';
|
|
3
4
|
export type IngestOrigin = 'server' | 'client';
|
|
4
5
|
export type FrameResolution = 'exact' | 'partial' | 'none';
|
|
5
6
|
/** Wire stack frame — matches apps/api ingest StackFrame. */
|
|
6
7
|
export type IngestStackFrame = {
|
|
7
8
|
filename: string;
|
|
9
|
+
source?: SourcePosition;
|
|
8
10
|
function?: string;
|
|
9
11
|
lineno?: number;
|
|
10
12
|
colno?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-ingest-event-types.d.ts","sourceRoot":"","sources":["../../src/create-ingest-event/create-ingest-event-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAE7E,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAE3D,6DAA6D;AAC7D,MAAM,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,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AC3B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,qBAAqB,CAAC;CACrC,CAAC"}
|
|
1
|
+
{"version":3,"file":"create-ingest-event-types.d.ts","sourceRoot":"","sources":["../../src/create-ingest-event/create-ingest-event-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAE7E,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAE3D,6DAA6D;AAC7D,MAAM,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,wDAAwD;AACxD,MAAM,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,YAAY,CAAC;IACrB,iEAAiE;IACjE,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE;QACT,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACvB,CAAC;IACF,8EAA8E;IAC9E,aAAa,CAAC,EAAE,qBAAqB,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,eAAe,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,qBAAqB,CAAC;CACrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-ingest-event.d.ts","sourceRoot":"","sources":["../../src/create-ingest-event/create-ingest-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,KAAK,EACX,sBAAsB,EACtB,eAAe,EACf,WAAW,EACX,gBAAgB,EAEhB,MAAM,6BAA6B,CAAC;AAGrC,eAAO,MAAM,gBAAgB,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"create-ingest-event.d.ts","sourceRoot":"","sources":["../../src/create-ingest-event/create-ingest-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,KAAK,EACX,sBAAsB,EACtB,eAAe,EACf,WAAW,EACX,gBAAgB,EAEhB,MAAM,6BAA6B,CAAC;AAGrC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAiDnC,eAAO,MAAM,mBAAmB,GAAI,QAAQ,KAAK,EAAE,KAAG,gBAAgB,EAIP,CAAC;AAEhE,gFAAgF;AAChF,eAAO,MAAM,kBAAkB,GAC9B,OAAO,WAAW,EAClB,QAAQ,KAAK,EAAE,EACf,YAAY,eAAe,KACzB,WAID,CAAC;AAEH,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,KAAG,WA4BjE,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RuntimeFunctionDefinition, SourcePosition } from '../source-identity/source-identity';
|
|
1
2
|
/**
|
|
2
3
|
* Wire-facing runtime-state types kept inside the standalone SDK package. They mirror the server
|
|
3
4
|
* contract without importing the application's private `~db` graph, allowing the published SDK to
|
|
@@ -32,6 +33,7 @@ export type RuntimeFunctionExitEvent = {
|
|
|
32
33
|
/** Source-mapped origin of the exception represented by a runtime-state throw event. */
|
|
33
34
|
export type RuntimeThrowLocation = {
|
|
34
35
|
file: string;
|
|
36
|
+
source?: SourcePosition;
|
|
35
37
|
function?: string;
|
|
36
38
|
line?: number;
|
|
37
39
|
column?: number;
|
|
@@ -66,13 +68,15 @@ export type RuntimeExecutionRecorderMetrics = {
|
|
|
66
68
|
};
|
|
67
69
|
/** Bounded, redacted execution state captured at the moment an error is reported. */
|
|
68
70
|
export type RuntimeExecutionState = {
|
|
69
|
-
version:
|
|
71
|
+
version: 2;
|
|
70
72
|
executionId: string;
|
|
71
73
|
startedAt: string;
|
|
72
74
|
durationMs: number;
|
|
73
75
|
/** Optional for compatibility with runtime states produced by older SDK versions. */
|
|
74
76
|
recorder?: RuntimeExecutionRecorderMetrics;
|
|
75
77
|
execution: RuntimeExecutionMetadata;
|
|
78
|
+
/** Function metadata is stored once per execution; events keep only compact opaque IDs. */
|
|
79
|
+
functions: RuntimeFunctionDefinition[];
|
|
76
80
|
events: RuntimeExecutionEvent[];
|
|
77
81
|
truncated?: {
|
|
78
82
|
eventsDropped: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-execution-state-types.d.ts","sourceRoot":"","sources":["../../src/create-ingest-event/runtime-execution-state-types.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,YAAY,GAAG,KAAK,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE1F,MAAM,MAAM,uBAAuB,GAAG;IACrC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,uBAAuB,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,EAAE,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wFAAwF;AACxF,MAAM,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,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CAAC;KACtB,CAAC;IACF,OAAO,CAAC,EAAE;QACT,YAAY,EAAE,SAAS,CAAC;QACxB,MAAM,EAAE,uBAAuB,CAAC;QAChC,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;KACtB,CAAC;CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"runtime-execution-state-types.d.ts","sourceRoot":"","sources":["../../src/create-ingest-event/runtime-execution-state-types.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpG;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,YAAY,GAAG,KAAK,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE1F,MAAM,MAAM,uBAAuB,GAAG;IACrC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,uBAAuB,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,EAAE,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO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rF,QAAQ,CAAC,EAAE,+BAA+B,CAAC;IAC3C,SAAS,EAAE,wBAAwB,CAAC;IACpC,2FAA2F;IAC3F,SAAS,EAAE,yBAAyB,EAAE,CAAC;IACvC,MAAM,EAAE,qBAAqB,EAAE,CAAC;IAChC,SAAS,CAAC,EAAE;QACX,aAAa,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,OAAO,CAAC,EAAE;QACT,YAAY,EAAE,SAAS,CAAC;QACxB,MAAM,EAAE,uBAAuB,CAAC;QAChC,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;KACtB,CAAC;CACF,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { createIngestEvent } from './create-ingest-event/create-ingest-event';
|
|
|
7
7
|
export type { RequestContext } from './create-ingest-event/create-ingest-event-types';
|
|
8
8
|
export type { RuntimeExecutionEvent, RuntimeExecutionKind, RuntimeExecutionMetadata, RuntimeExecutionRecorderMetrics, RuntimeExecutionRequest, RuntimeExecutionState, RuntimeFunctionCallsSuppressedEvent, RuntimeFunctionEnterEvent, RuntimeFunctionExitEvent, RuntimeFunctionThrowEvent, RuntimeThrowLocation, } from './create-ingest-event/runtime-execution-state-types';
|
|
9
9
|
export { detectRelease } from './detect-release/detect-release';
|
|
10
|
-
export type { InstrumentationArgIdentifier, InstrumentationManifestCallSite, InstrumentationManifestContent, InstrumentationManifestDestructure, InstrumentationManifestFunction, InstrumentationParamBinding, } from './instrumentation-manifest/instrumentation-manifest-types';
|
|
10
|
+
export type { InstrumentationArgIdentifier, InstrumentationManifestCallSite, InstrumentationManifestContent, InstrumentationManifestDestructure, InstrumentationManifestFunction, InstrumentationParamBinding, SourceVerification, SourceVerificationIssue, } from './instrumentation-manifest/instrumentation-manifest-types';
|
|
11
11
|
export { INSTRUMENTATION_MANIFEST_SCHEMA_VERSION } from './instrumentation-manifest/instrumentation-manifest-types';
|
|
12
12
|
export { uploadInstrumentationManifest } from './instrumentation-manifest/upload-instrumentation-manifest';
|
|
13
13
|
export type { Frame } from './normalize-frames/normalize-frames';
|
|
@@ -18,6 +18,8 @@ export { repoRootFrom } from './repo-root/repo-root-from';
|
|
|
18
18
|
export { resolveRepoRoot } from './repo-root/resolve-repo-root';
|
|
19
19
|
export { resolveSourceMaps } from './resolve-source-maps/resolve-source-maps';
|
|
20
20
|
export type { ResolvedFrame, ResolveSourceMapsResult, } from './resolve-source-maps/resolved-frame';
|
|
21
|
+
export type { RuntimeFunctionDefinition, SourceLocator, SourcePosition, } from './source-identity/source-identity';
|
|
22
|
+
export { resetSourceIdentityCache, runtimeFunctionId, sourceDisplayPath, sourceLocatorFromFile, sourceLocatorKey, } from './source-identity/source-identity';
|
|
21
23
|
export { createSuppression } from './suppression/create-suppression';
|
|
22
24
|
export type { CreateSuppressionOptions, IngestSummary, PrepareSummaryFrames, SummaryIdentity, SuppressionDecideInput, SuppressionDecideResult, } from './suppression/suppression-types';
|
|
23
25
|
export { createTransport } from './transport/create-transport';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,YAAY,EACX,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,eAAe,GACf,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,YAAY,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACtF,YAAY,EACX,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,+BAA+B,EAC/B,uBAAuB,EACvB,qBAA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D,CAAC;AAC3G,YAAY,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,YAAY,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,YAAY,EACX,aAAa,EACb,uBAAuB,GACvB,MAAM,sCAAsC,CAAC;AAC9C,YAAY,EACX,yBAAyB,EACzB,aAAa,EACb,cAAc,GACd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACN,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,GAChB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,YAAY,EACX,wBAAwB,EACxB,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,uBAAuB,GACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,YAAY,EACX,sBAAsB,EACtB,SAAS,EACT,iBAAiB,EACjB,cAAc,GACd,MAAM,6BAA6B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -153,6 +153,7 @@ var toStackFrame = (frame) => {
|
|
|
153
153
|
const fn = frame.function ?? frame.original?.name;
|
|
154
154
|
return {
|
|
155
155
|
filename,
|
|
156
|
+
...frame.source ? { source: frame.source } : {},
|
|
156
157
|
...fn ? { function: fn } : {},
|
|
157
158
|
...preferred.line !== void 0 ? { lineno: preferred.line } : {},
|
|
158
159
|
...preferred.column !== void 0 ? { colno: preferred.column } : {},
|
|
@@ -274,14 +275,92 @@ var detectRelease = (options = {}) => {
|
|
|
274
275
|
};
|
|
275
276
|
|
|
276
277
|
// src/normalize-frames/normalize-frames.ts
|
|
277
|
-
import { isAbsolute, resolve } from "node:path";
|
|
278
|
+
import { isAbsolute as isAbsolute2, resolve as resolve2 } from "node:path";
|
|
279
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
280
|
+
|
|
281
|
+
// src/source-identity/source-identity.ts
|
|
282
|
+
import { createHash } from "node:crypto";
|
|
283
|
+
import { existsSync, readFileSync as readFileSync2 } from "node:fs";
|
|
284
|
+
import { basename, dirname, isAbsolute, relative, resolve, sep } from "node:path";
|
|
278
285
|
import { fileURLToPath } from "node:url";
|
|
279
|
-
var
|
|
286
|
+
var packageBoundaryByDirectory = /* @__PURE__ */ new Map();
|
|
280
287
|
var toPosix = (path) => path.replaceAll("\\", "/");
|
|
288
|
+
var physicalPath = (file) => {
|
|
289
|
+
if (!file.startsWith("file://")) return resolve(file);
|
|
290
|
+
try {
|
|
291
|
+
return fileURLToPath(file);
|
|
292
|
+
} catch {
|
|
293
|
+
return resolve(file.replace(/^file:\/\//, ""));
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
var readPackageBoundary = (directory) => {
|
|
297
|
+
const visited = [];
|
|
298
|
+
let current = resolve(directory);
|
|
299
|
+
while (true) {
|
|
300
|
+
const cached = packageBoundaryByDirectory.get(current);
|
|
301
|
+
if (cached !== void 0) {
|
|
302
|
+
for (const path of visited) packageBoundaryByDirectory.set(path, cached);
|
|
303
|
+
return cached;
|
|
304
|
+
}
|
|
305
|
+
visited.push(current);
|
|
306
|
+
const packageJson = resolve(current, "package.json");
|
|
307
|
+
if (existsSync(packageJson)) {
|
|
308
|
+
let name;
|
|
309
|
+
try {
|
|
310
|
+
const parsed = JSON.parse(readFileSync2(packageJson, "utf8"));
|
|
311
|
+
if (typeof parsed.name === "string" && parsed.name.trim()) name = parsed.name.trim();
|
|
312
|
+
} catch {
|
|
313
|
+
}
|
|
314
|
+
const boundary = { root: current, ...name ? { name } : {} };
|
|
315
|
+
for (const path of visited) packageBoundaryByDirectory.set(path, boundary);
|
|
316
|
+
return boundary;
|
|
317
|
+
}
|
|
318
|
+
const parent = dirname(current);
|
|
319
|
+
if (parent === current) {
|
|
320
|
+
for (const path of visited) packageBoundaryByDirectory.set(path, null);
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
current = parent;
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
var sourceLocatorFromFile = (file) => {
|
|
327
|
+
if (!file || /^(node:|bun:|https?:|webpack:|blob:|data:|native$)/i.test(file)) return void 0;
|
|
328
|
+
const absolute = physicalPath(file.split("?")[0] ?? file);
|
|
329
|
+
const boundary = readPackageBoundary(dirname(absolute));
|
|
330
|
+
if (!boundary) return void 0;
|
|
331
|
+
const fromPackage = relative(boundary.root, absolute);
|
|
332
|
+
if (!fromPackage || fromPackage === ".." || fromPackage.startsWith(`..${sep}`) || isAbsolute(fromPackage)) {
|
|
333
|
+
return { packageRelativePath: basename(absolute) };
|
|
334
|
+
}
|
|
335
|
+
return {
|
|
336
|
+
...boundary.name ? { packageName: boundary.name } : {},
|
|
337
|
+
packageRelativePath: toPosix(fromPackage)
|
|
338
|
+
};
|
|
339
|
+
};
|
|
340
|
+
var sourceLocatorKey = (source) => `${source.packageName ?? ""}\0${source.packageRelativePath}`;
|
|
341
|
+
var runtimeFunctionId = (definition) => {
|
|
342
|
+
const source = definition.source;
|
|
343
|
+
const identity = [
|
|
344
|
+
definition.name,
|
|
345
|
+
source?.packageName ?? "",
|
|
346
|
+
source?.packageRelativePath ?? "",
|
|
347
|
+
String(source?.line ?? ""),
|
|
348
|
+
String(source?.column ?? "")
|
|
349
|
+
].join("\0");
|
|
350
|
+
return `rf_${createHash("sha256").update(identity).digest("base64url").slice(0, 24)}`;
|
|
351
|
+
};
|
|
352
|
+
var sourceDisplayPath = (source) => source.repositoryPath ?? source.packageRelativePath;
|
|
353
|
+
var resetSourceIdentityCache = () => {
|
|
354
|
+
packageBoundaryByDirectory.clear();
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
// src/normalize-frames/normalize-frames.ts
|
|
358
|
+
var NON_SOURCE = /* @__PURE__ */ new Set(["", "native", "<anonymous>", "unknown location"]);
|
|
359
|
+
var toPosix2 = (path) => path.replaceAll("\\", "/");
|
|
281
360
|
var stripFileUrl = (file) => {
|
|
282
361
|
if (!file.startsWith("file://")) return file;
|
|
283
362
|
try {
|
|
284
|
-
return
|
|
363
|
+
return fileURLToPath2(file);
|
|
285
364
|
} catch {
|
|
286
365
|
return file.replace(/^file:\/\//, "");
|
|
287
366
|
}
|
|
@@ -289,44 +368,55 @@ var stripFileUrl = (file) => {
|
|
|
289
368
|
var isSchemePath = (file) => NON_SOURCE.has(file) || /^(node:|bun:|https?:|webpack:|blob:|data:|eval\b)/i.test(file);
|
|
290
369
|
var normalizeFile = (file, appRoot) => {
|
|
291
370
|
if (!file || isSchemePath(file)) return { file, underRoot: false };
|
|
292
|
-
const cleaned =
|
|
371
|
+
const cleaned = toPosix2(stripFileUrl(file)).split("?")[0]?.trim() ?? "";
|
|
293
372
|
if (!cleaned || isSchemePath(cleaned)) return { file: cleaned, underRoot: false };
|
|
294
|
-
const root =
|
|
295
|
-
const absolute =
|
|
296
|
-
|
|
373
|
+
const root = appRoot ? toPosix2(resolve2(appRoot)) : void 0;
|
|
374
|
+
const absolute = toPosix2(
|
|
375
|
+
isAbsolute2(cleaned) || /^[A-Za-z]:\//.test(cleaned) ? resolve2(cleaned) : resolve2(root ?? process.cwd(), cleaned)
|
|
297
376
|
);
|
|
298
|
-
if (
|
|
377
|
+
if (!root) return { file: cleaned, absolute, underRoot: false };
|
|
378
|
+
if (absolute === root) return { file: ".", absolute, underRoot: true };
|
|
299
379
|
const prefix = root.endsWith("/") ? root : `${root}/`;
|
|
300
380
|
if (absolute.startsWith(prefix)) {
|
|
301
|
-
return { file: absolute.slice(prefix.length), underRoot: true };
|
|
381
|
+
return { file: absolute.slice(prefix.length), absolute, underRoot: true };
|
|
302
382
|
}
|
|
303
|
-
return { file: absolute, underRoot: false };
|
|
383
|
+
return { file: absolute, absolute, underRoot: false };
|
|
304
384
|
};
|
|
305
|
-
var isInApp = (file, underRoot) => {
|
|
306
|
-
if (
|
|
307
|
-
if (/(^|\/)node_modules\//.test(file)) return false;
|
|
308
|
-
return
|
|
385
|
+
var isInApp = (file, absolute, underRoot, source) => {
|
|
386
|
+
if (isSchemePath(file)) return false;
|
|
387
|
+
if (/(^|\/)node_modules\//.test(absolute ?? file)) return false;
|
|
388
|
+
if (/^@rasputin-ai\/(?:core|node|elysia)$/.test(source?.packageName ?? "")) return false;
|
|
389
|
+
return underRoot || source !== void 0;
|
|
309
390
|
};
|
|
310
391
|
var normalizeFrames = (frames, options) => {
|
|
311
392
|
const appRoot = options.appRoot;
|
|
312
393
|
return frames.map((frame) => {
|
|
313
394
|
const generated = normalizeFile(frame.generated.file, appRoot);
|
|
314
395
|
const original = frame.original ? normalizeFile(frame.original.file, appRoot) : void 0;
|
|
396
|
+
const generatedSource = generated.absolute ? sourceLocatorFromFile(generated.absolute) : void 0;
|
|
397
|
+
const originalSource = original?.absolute ? sourceLocatorFromFile(original.absolute) : void 0;
|
|
315
398
|
const preferred = original ?? generated;
|
|
399
|
+
const locator = originalSource ?? generatedSource;
|
|
400
|
+
const source = locator ? {
|
|
401
|
+
...locator,
|
|
402
|
+
...(frame.original?.line ?? frame.generated.line) !== void 0 ? { line: frame.original?.line ?? frame.generated.line } : {},
|
|
403
|
+
...(frame.original?.column ?? frame.generated.column) !== void 0 ? { column: frame.original?.column ?? frame.generated.column } : {}
|
|
404
|
+
} : void 0;
|
|
316
405
|
return {
|
|
317
406
|
generated: {
|
|
318
|
-
file: generated.file,
|
|
407
|
+
file: generatedSource && !generated.underRoot ? sourceDisplayPath(generatedSource) : generated.file,
|
|
319
408
|
line: frame.generated.line,
|
|
320
409
|
column: frame.generated.column
|
|
321
410
|
},
|
|
322
411
|
original: frame.original ? {
|
|
323
|
-
file: original?.file ?? frame.original.file,
|
|
412
|
+
file: originalSource && !original?.underRoot ? sourceDisplayPath(originalSource) : original?.file ?? frame.original.file,
|
|
324
413
|
line: frame.original.line,
|
|
325
414
|
column: frame.original.column,
|
|
326
415
|
name: frame.original.name
|
|
327
416
|
} : void 0,
|
|
328
417
|
function: frame.function,
|
|
329
|
-
in_app: isInApp(preferred.file, preferred.underRoot)
|
|
418
|
+
in_app: isInApp(preferred.file, preferred.absolute, preferred.underRoot, source),
|
|
419
|
+
...source ? { source } : {}
|
|
330
420
|
};
|
|
331
421
|
});
|
|
332
422
|
};
|
|
@@ -390,22 +480,22 @@ var parseStack = (stack) => {
|
|
|
390
480
|
};
|
|
391
481
|
|
|
392
482
|
// src/repo-root/repo-root-from.ts
|
|
393
|
-
import { existsSync } from "node:fs";
|
|
394
|
-
import { dirname, join as join2, resolve as
|
|
395
|
-
import { fileURLToPath as
|
|
396
|
-
var isGitRoot = (dir) =>
|
|
397
|
-
var hasPackageJson = (dir) =>
|
|
483
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
484
|
+
import { dirname as dirname2, join as join2, resolve as resolve3 } from "node:path";
|
|
485
|
+
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
486
|
+
var isGitRoot = (dir) => existsSync2(join2(dir, ".git"));
|
|
487
|
+
var hasPackageJson = (dir) => existsSync2(join2(dir, "package.json"));
|
|
398
488
|
var repoRootFrom = (moduleUrl) => {
|
|
399
|
-
let current =
|
|
489
|
+
let current = resolve3(dirname2(fileURLToPath3(moduleUrl)));
|
|
400
490
|
let packageRoot;
|
|
401
491
|
while (true) {
|
|
402
492
|
if (isGitRoot(current)) return current;
|
|
403
493
|
if (hasPackageJson(current)) packageRoot = current;
|
|
404
|
-
const parent =
|
|
494
|
+
const parent = dirname2(current);
|
|
405
495
|
if (parent === current) break;
|
|
406
496
|
current = parent;
|
|
407
497
|
}
|
|
408
|
-
return packageRoot ??
|
|
498
|
+
return packageRoot ?? resolve3(dirname2(fileURLToPath3(moduleUrl)));
|
|
409
499
|
};
|
|
410
500
|
|
|
411
501
|
// src/repo-root/resolve-repo-root.ts
|
|
@@ -419,34 +509,12 @@ var resolveRepoRoot = (options) => {
|
|
|
419
509
|
|
|
420
510
|
// src/repo-root/warn-repo-root-setup.ts
|
|
421
511
|
var BUILD_OUTPUT_SEGMENTS = /* @__PURE__ */ new Set(["dist", "build", "out", ".next", "coverage"]);
|
|
422
|
-
var warnedMissing = false;
|
|
423
512
|
var warnedSuspicious = false;
|
|
424
513
|
var BANNER = "======== [rasputin] WARNING";
|
|
425
514
|
var looksLikeBuildOutputRoot = (root) => {
|
|
426
515
|
const posix = root.replaceAll("\\", "/").replace(/\/+$/, "");
|
|
427
516
|
return posix.split("/").some((segment) => BUILD_OUTPUT_SEGMENTS.has(segment));
|
|
428
517
|
};
|
|
429
|
-
var warnIfMissingRepoRoot = () => {
|
|
430
|
-
if (warnedMissing) return;
|
|
431
|
-
warnedMissing = true;
|
|
432
|
-
console.warn(
|
|
433
|
-
`
|
|
434
|
-
|
|
435
|
-
${BANNER}: we don't know where your project is ========
|
|
436
|
-
Rasputin needs to know which folder your app lives in so errors show
|
|
437
|
-
the right file paths in the dashboard.
|
|
438
|
-
|
|
439
|
-
Add this to RasputinInit (from the same file you call it in):
|
|
440
|
-
|
|
441
|
-
moduleUrl: import.meta.url
|
|
442
|
-
|
|
443
|
-
Or set repoRoot to the folder you open in your editor.
|
|
444
|
-
|
|
445
|
-
Nothing will be sent until this is set.
|
|
446
|
-
======================================================================
|
|
447
|
-
`
|
|
448
|
-
);
|
|
449
|
-
};
|
|
450
518
|
var warnIfSuspiciousRepoRoot = (root) => {
|
|
451
519
|
if (warnedSuspicious || !looksLikeBuildOutputRoot(root)) return;
|
|
452
520
|
warnedSuspicious = true;
|
|
@@ -474,8 +542,8 @@ Or set repoRoot yourself.
|
|
|
474
542
|
|
|
475
543
|
// src/resolve-source-maps/resolve-source-maps.ts
|
|
476
544
|
import { readFile } from "node:fs/promises";
|
|
477
|
-
import { dirname as
|
|
478
|
-
import { fileURLToPath as
|
|
545
|
+
import { dirname as dirname3, isAbsolute as isAbsolute3, join as join3 } from "node:path";
|
|
546
|
+
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
479
547
|
import { LEAST_UPPER_BOUND, originalPositionFor, TraceMap } from "@jridgewell/trace-mapping";
|
|
480
548
|
var SOURCE_EXT2 = /\.(ts|tsx|mts|cts)$/i;
|
|
481
549
|
var SOURCEMAP_COMMENT = /(?:\/\/[#@][ \t]*sourceMappingURL=([^\s'"]+)|\/\*[#@][ \t]*sourceMappingURL=([^\s*'"]+)[ \t]*\*\/)\s*$/;
|
|
@@ -483,7 +551,7 @@ var mapCache = /* @__PURE__ */ new Map();
|
|
|
483
551
|
var toPath = (file) => {
|
|
484
552
|
if (file.startsWith("file://")) {
|
|
485
553
|
try {
|
|
486
|
-
return
|
|
554
|
+
return fileURLToPath4(file);
|
|
487
555
|
} catch {
|
|
488
556
|
return file;
|
|
489
557
|
}
|
|
@@ -524,7 +592,7 @@ var readMapPayload = async (generatedPath) => {
|
|
|
524
592
|
if (comment?.startsWith("data:")) return decodeDataUrl(comment);
|
|
525
593
|
if (comment) {
|
|
526
594
|
try {
|
|
527
|
-
return await readFile(join3(
|
|
595
|
+
return await readFile(join3(dirname3(generatedPath), comment), "utf8");
|
|
528
596
|
} catch {
|
|
529
597
|
}
|
|
530
598
|
}
|
|
@@ -571,7 +639,7 @@ var resolveFrame = async (raw) => {
|
|
|
571
639
|
return {
|
|
572
640
|
...base,
|
|
573
641
|
original: {
|
|
574
|
-
file:
|
|
642
|
+
file: isAbsolute3(pos.source) ? pos.source : join3(dirname3(generatedPath), pos.source),
|
|
575
643
|
line: pos.line,
|
|
576
644
|
column: pos.column ?? void 0,
|
|
577
645
|
name: pos.name ?? void 0
|
|
@@ -591,7 +659,7 @@ var resolveSourceMaps = async (frames) => {
|
|
|
591
659
|
|
|
592
660
|
// src/sdk-meta.ts
|
|
593
661
|
var SDK_NAME = "@rasputin-ai/core";
|
|
594
|
-
var SDK_VERSION = "0.
|
|
662
|
+
var SDK_VERSION = "0.4.0";
|
|
595
663
|
|
|
596
664
|
// src/suppression/identity-needs-message-template.ts
|
|
597
665
|
var identityNeedsMessageTemplate = (type, code) => {
|
|
@@ -873,17 +941,17 @@ var createSuppression = (options = {}) => {
|
|
|
873
941
|
|
|
874
942
|
// src/transport/send-batch.ts
|
|
875
943
|
import { gzipSync } from "node:zlib";
|
|
876
|
-
var sleep = (ms, signal) => new Promise((
|
|
944
|
+
var sleep = (ms, signal) => new Promise((resolve4) => {
|
|
877
945
|
if (signal?.aborted) {
|
|
878
|
-
|
|
946
|
+
resolve4();
|
|
879
947
|
return;
|
|
880
948
|
}
|
|
881
|
-
const timer = setTimeout(
|
|
949
|
+
const timer = setTimeout(resolve4, ms);
|
|
882
950
|
signal?.addEventListener(
|
|
883
951
|
"abort",
|
|
884
952
|
() => {
|
|
885
953
|
clearTimeout(timer);
|
|
886
|
-
|
|
954
|
+
resolve4();
|
|
887
955
|
},
|
|
888
956
|
{ once: true }
|
|
889
957
|
);
|
|
@@ -1207,7 +1275,7 @@ var noopClient = () => ({
|
|
|
1207
1275
|
});
|
|
1208
1276
|
|
|
1209
1277
|
// src/create-client/resolve-endpoint-urls.ts
|
|
1210
|
-
var DEFAULT_API_URL = "https://
|
|
1278
|
+
var DEFAULT_API_URL = "https://api.rasputinai.dev";
|
|
1211
1279
|
var resolveEndpointUrls = (apiUrl = DEFAULT_API_URL) => {
|
|
1212
1280
|
const base = apiUrl.replace(/\/+$/, "");
|
|
1213
1281
|
return {
|
|
@@ -1261,11 +1329,7 @@ var createClient = (options, hooks = {}) => {
|
|
|
1261
1329
|
return noopClient();
|
|
1262
1330
|
}
|
|
1263
1331
|
const repoRoot = resolveRepoRoot(options);
|
|
1264
|
-
if (
|
|
1265
|
-
warnIfMissingRepoRoot();
|
|
1266
|
-
return noopClient();
|
|
1267
|
-
}
|
|
1268
|
-
warnIfSuspiciousRepoRoot(repoRoot);
|
|
1332
|
+
if (repoRoot) warnIfSuspiciousRepoRoot(repoRoot);
|
|
1269
1333
|
const MAX_STACK_RESOLVE_CACHE = 32;
|
|
1270
1334
|
const stackResolveCache = /* @__PURE__ */ new Map();
|
|
1271
1335
|
const stackCacheKey = (rawFrames) => rawFrames.map((frame) => `${frame.file}\0${frame.line}\0${frame.column}\0${frame.function ?? ""}`).join("\n");
|
|
@@ -1379,12 +1443,12 @@ var createClient = (options, hooks = {}) => {
|
|
|
1379
1443
|
};
|
|
1380
1444
|
|
|
1381
1445
|
// src/instrumentation-manifest/instrumentation-manifest-types.ts
|
|
1382
|
-
var INSTRUMENTATION_MANIFEST_SCHEMA_VERSION =
|
|
1446
|
+
var INSTRUMENTATION_MANIFEST_SCHEMA_VERSION = 2;
|
|
1383
1447
|
|
|
1384
1448
|
// src/instrumentation-manifest/upload-instrumentation-manifest.ts
|
|
1385
1449
|
var uploadInstrumentationManifest = async (options) => {
|
|
1386
1450
|
const release = options.release.trim();
|
|
1387
|
-
if (!release) return
|
|
1451
|
+
if (!release) return { ok: false };
|
|
1388
1452
|
const fetchFn = options.fetch ?? globalThis.fetch;
|
|
1389
1453
|
try {
|
|
1390
1454
|
const response = await fetchFn(options.url, {
|
|
@@ -1396,10 +1460,12 @@ var uploadInstrumentationManifest = async (options) => {
|
|
|
1396
1460
|
},
|
|
1397
1461
|
body: JSON.stringify({ release, manifest: options.manifest })
|
|
1398
1462
|
});
|
|
1399
|
-
if (response.ok) return
|
|
1400
|
-
|
|
1463
|
+
if (!response.ok) return { ok: false };
|
|
1464
|
+
const body = await response.json();
|
|
1465
|
+
const verification = body.payload?.verification;
|
|
1466
|
+
return verification ? { ok: true, verification } : { ok: false };
|
|
1401
1467
|
} catch {
|
|
1402
|
-
return
|
|
1468
|
+
return { ok: false };
|
|
1403
1469
|
}
|
|
1404
1470
|
};
|
|
1405
1471
|
export {
|
|
@@ -1414,8 +1480,13 @@ export {
|
|
|
1414
1480
|
normalizeFrames,
|
|
1415
1481
|
parseStack,
|
|
1416
1482
|
repoRootFrom,
|
|
1483
|
+
resetSourceIdentityCache,
|
|
1417
1484
|
resolveEndpointUrls,
|
|
1418
1485
|
resolveRepoRoot,
|
|
1419
1486
|
resolveSourceMaps,
|
|
1487
|
+
runtimeFunctionId,
|
|
1488
|
+
sourceDisplayPath,
|
|
1489
|
+
sourceLocatorFromFile,
|
|
1490
|
+
sourceLocatorKey,
|
|
1420
1491
|
uploadInstrumentationManifest
|
|
1421
1492
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Static per-release facts about instrumented source. Runtime events
|
|
3
|
-
* this payload
|
|
2
|
+
* Static per-release facts about instrumented source. Runtime events only carry opaque function
|
|
3
|
+
* IDs; this payload joins those IDs to source without coupling them to a container filesystem.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
import type { SourcePosition } from '../source-identity/source-identity';
|
|
6
|
+
export declare const INSTRUMENTATION_MANIFEST_SCHEMA_VERSION = 2;
|
|
6
7
|
export type InstrumentationParamBinding = {
|
|
7
8
|
kind: 'identifier';
|
|
8
9
|
name: string;
|
|
@@ -37,7 +38,7 @@ export type InstrumentationArgIdentifier = {
|
|
|
37
38
|
};
|
|
38
39
|
export type InstrumentationManifestFunction = {
|
|
39
40
|
functionId: string;
|
|
40
|
-
|
|
41
|
+
source: SourcePosition;
|
|
41
42
|
name: string;
|
|
42
43
|
startLine: number;
|
|
43
44
|
startColumn: number;
|
|
@@ -50,7 +51,7 @@ export type InstrumentationManifestCallSite = {
|
|
|
50
51
|
callerFunctionId: string;
|
|
51
52
|
calleeName: string;
|
|
52
53
|
calleeText: string;
|
|
53
|
-
|
|
54
|
+
source: SourcePosition;
|
|
54
55
|
line: number;
|
|
55
56
|
column: number;
|
|
56
57
|
endLine: number;
|
|
@@ -61,15 +62,37 @@ export type InstrumentationManifestCallSite = {
|
|
|
61
62
|
export type InstrumentationManifestDestructure = {
|
|
62
63
|
callerFunctionId: string;
|
|
63
64
|
sourceParam: string;
|
|
64
|
-
|
|
65
|
+
source: SourcePosition;
|
|
65
66
|
line: number;
|
|
66
67
|
column: number;
|
|
67
68
|
binding: InstrumentationParamBinding;
|
|
68
69
|
};
|
|
70
|
+
export type SourceVerificationIssue = {
|
|
71
|
+
packageName?: string;
|
|
72
|
+
packageRelativePath: string;
|
|
73
|
+
reason: 'not_found' | 'ambiguous' | 'invalid_mapping' | 'github_unavailable';
|
|
74
|
+
candidates?: string[];
|
|
75
|
+
};
|
|
76
|
+
type SourcePackageMapping = {
|
|
77
|
+
packageName?: string;
|
|
78
|
+
repositoryRoot: string;
|
|
79
|
+
};
|
|
80
|
+
export type SourceVerification = {
|
|
81
|
+
status: 'verified' | 'partial' | 'ambiguous' | 'unavailable';
|
|
82
|
+
verified: number;
|
|
83
|
+
unresolved: SourceVerificationIssue[];
|
|
84
|
+
packages?: SourcePackageMapping[];
|
|
85
|
+
};
|
|
69
86
|
export type InstrumentationManifestContent = {
|
|
70
87
|
schema_version: typeof INSTRUMENTATION_MANIFEST_SCHEMA_VERSION;
|
|
88
|
+
sourceRoots?: {
|
|
89
|
+
default?: string;
|
|
90
|
+
packages: Record<string, string>;
|
|
91
|
+
};
|
|
92
|
+
verification?: SourceVerification;
|
|
71
93
|
functions: InstrumentationManifestFunction[];
|
|
72
94
|
callSites: InstrumentationManifestCallSite[];
|
|
73
95
|
destructures: InstrumentationManifestDestructure[];
|
|
74
96
|
};
|
|
97
|
+
export {};
|
|
75
98
|
//# sourceMappingURL=instrumentation-manifest-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation-manifest-types.d.ts","sourceRoot":"","sources":["../../src/instrumentation-manifest/instrumentation-manifest-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,uCAAuC,IAAI,CAAC;AAEzD,MAAM,MAAM,2BAA2B,GACpC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACpC;IACA,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,2BAA2B,CAAA;KAAE,CAAC,CAAC;CACxE,GACD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,2BAA2B,GAAG;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC,CAAA;CAAE,GACrF;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,2BAA2B,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAEvB,MAAM,MAAM,4BAA4B,GACrC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,UAAU,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC;AAEvF,MAAM,MAAM,+BAA+B,GAAG;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":"instrumentation-manifest-types.d.ts","sourceRoot":"","sources":["../../src/instrumentation-manifest/instrumentation-manifest-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,eAAO,MAAM,uCAAuC,IAAI,CAAC;AAEzD,MAAM,MAAM,2BAA2B,GACpC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACpC;IACA,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,KAAK,CAA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AC;IAC7C,YAAY,EAAE,kCAAkC,EAAE,CAAC;CACnD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TransportFetch } from '../transport/transport-types';
|
|
2
|
-
import type { InstrumentationManifestContent } from './instrumentation-manifest-types';
|
|
2
|
+
import type { InstrumentationManifestContent, SourceVerification } from './instrumentation-manifest-types';
|
|
3
3
|
type UploadInstrumentationManifestOptions = {
|
|
4
4
|
url: string;
|
|
5
5
|
projectApiKey: string;
|
|
@@ -11,6 +11,11 @@ type UploadInstrumentationManifestOptions = {
|
|
|
11
11
|
* Fire-and-forget merge of static source metadata for this release.
|
|
12
12
|
* Never throws — init and capture must not wait on this HTTP call.
|
|
13
13
|
*/
|
|
14
|
-
export declare const uploadInstrumentationManifest: (options: UploadInstrumentationManifestOptions) => Promise<
|
|
14
|
+
export declare const uploadInstrumentationManifest: (options: UploadInstrumentationManifestOptions) => Promise<{
|
|
15
|
+
ok: true;
|
|
16
|
+
verification: SourceVerification;
|
|
17
|
+
} | {
|
|
18
|
+
ok: false;
|
|
19
|
+
}>;
|
|
15
20
|
export {};
|
|
16
21
|
//# sourceMappingURL=upload-instrumentation-manifest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-instrumentation-manifest.d.ts","sourceRoot":"","sources":["../../src/instrumentation-manifest/upload-instrumentation-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"upload-instrumentation-manifest.d.ts","sourceRoot":"","sources":["../../src/instrumentation-manifest/upload-instrumentation-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EACX,8BAA8B,EAC9B,kBAAkB,EAClB,MAAM,kCAAkC,CAAC;AAE1C,KAAK,oCAAoC,GAAG;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,8BAA8B,CAAC;IACzC,KAAK,CAAC,EAAE,cAAc,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,GACzC,SAAS,oCAAoC,KAC3C,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,YAAY,EAAE,kBAAkB,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAA;CAAE,CAwBxE,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ResolvedFrame } from '../resolve-source-maps/resolved-frame';
|
|
2
|
+
import { type SourcePosition } from '../source-identity/source-identity';
|
|
2
3
|
type NormalizeFramesOptions = {
|
|
3
|
-
/**
|
|
4
|
-
appRoot
|
|
4
|
+
/** Optional display root. Source identity does not depend on this directory being a Git root. */
|
|
5
|
+
appRoot?: string;
|
|
5
6
|
};
|
|
6
7
|
export type Frame = {
|
|
7
8
|
generated: {
|
|
@@ -17,6 +18,7 @@ export type Frame = {
|
|
|
17
18
|
};
|
|
18
19
|
function?: string;
|
|
19
20
|
in_app: boolean;
|
|
21
|
+
source?: SourcePosition;
|
|
20
22
|
};
|
|
21
23
|
/** Normalize resolved frames: repo-relative paths + in_app (runs after source-map resolution). */
|
|
22
24
|
export declare const normalizeFrames: (frames: ResolvedFrame[], options: NormalizeFramesOptions) => Frame[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-frames.d.ts","sourceRoot":"","sources":["../../src/normalize-frames/normalize-frames.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"normalize-frames.d.ts","sourceRoot":"","sources":["../../src/normalize-frames/normalize-frames.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EACN,KAAK,cAAc,EAGnB,MAAM,oCAAoC,CAAC;AAE5C,KAAK,sBAAsB,GAAG;IAC7B,iGAAiG;IACjG,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IACnB,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5D,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,cAAc,CAAC;CACxB,CAAC;AA4DF,kGAAkG;AAClG,eAAO,MAAM,eAAe,GAC3B,QAAQ,aAAa,EAAE,EACvB,SAAS,sBAAsB,KAC7B,KAAK,EAoDP,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/** Reset per-process warning state (for testing only). */
|
|
2
2
|
export declare const resetRepoRootSetupWarnings: () => void;
|
|
3
|
-
export declare const warnIfMissingRepoRoot: () => void;
|
|
4
3
|
export declare const warnIfSuspiciousRepoRoot: (root: string) => void;
|
|
5
4
|
//# sourceMappingURL=warn-repo-root-setup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warn-repo-root-setup.d.ts","sourceRoot":"","sources":["../../src/repo-root/warn-repo-root-setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"warn-repo-root-setup.d.ts","sourceRoot":"","sources":["../../src/repo-root/warn-repo-root-setup.ts"],"names":[],"mappings":"AAQA,0DAA0D;AAC1D,eAAO,MAAM,0BAA0B,YAEtC,CAAC;AAOF,eAAO,MAAM,wBAAwB,GAAI,MAAM,MAAM,SAcpD,CAAC"}
|
package/dist/sdk-meta.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Generated by
|
|
1
|
+
/** Generated by scripts/generate-sdk-meta.ts — do not edit. */
|
|
2
2
|
export declare const SDK_NAME = "@rasputin-ai/core";
|
|
3
|
-
export declare const SDK_VERSION = "0.
|
|
3
|
+
export declare const SDK_VERSION = "0.4.0";
|
|
4
4
|
//# sourceMappingURL=sdk-meta.d.ts.map
|
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
|
|
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,UAAU,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type SourceLocator = {
|
|
2
|
+
packageName?: string;
|
|
3
|
+
packageRelativePath: string;
|
|
4
|
+
/** Filled only after the backend verifies this path against the exact Git release. */
|
|
5
|
+
repositoryPath?: string;
|
|
6
|
+
};
|
|
7
|
+
export type SourcePosition = SourceLocator & {
|
|
8
|
+
line?: number;
|
|
9
|
+
column?: number;
|
|
10
|
+
};
|
|
11
|
+
export type RuntimeFunctionDefinition = {
|
|
12
|
+
functionId: string;
|
|
13
|
+
name: string;
|
|
14
|
+
source?: SourcePosition;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Describe a source file using deploy-stable package identity. Production images often omit the
|
|
18
|
+
* repository root, so absolute container paths are deliberately never part of the wire contract.
|
|
19
|
+
*/
|
|
20
|
+
export declare const sourceLocatorFromFile: (file: string) => SourceLocator | undefined;
|
|
21
|
+
export declare const sourceLocatorKey: (source: SourceLocator) => string;
|
|
22
|
+
export declare const runtimeFunctionId: (definition: Omit<RuntimeFunctionDefinition, "functionId">) => string;
|
|
23
|
+
export declare const sourceDisplayPath: (source: SourceLocator) => string;
|
|
24
|
+
export declare const resetSourceIdentityCache: () => void;
|
|
25
|
+
//# sourceMappingURL=source-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-identity.d.ts","sourceRoot":"","sources":["../../src/source-identity/source-identity.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,aAAa,GAAG;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sFAAsF;IACtF,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,cAAc,CAAC;CACxB,CAAC;AAuDF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,KAAG,aAAa,GAAG,SAoBpE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,QAAQ,aAAa,KAAG,MACI,CAAC;AAE9D,eAAO,MAAM,iBAAiB,GAC7B,YAAY,IAAI,CAAC,yBAAyB,EAAE,YAAY,CAAC,KACvD,MAUF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,QAAQ,aAAa,KAAG,MACN,CAAC;AAErD,eAAO,MAAM,wBAAwB,QAAO,IAE3C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rasputin-ai/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Core error capture, stack parsing, and ingest transport for Rasputin AI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"@types/bun": "latest",
|
|
32
32
|
"@types/node": "22.13.10",
|
|
33
33
|
"esbuild": "0.25.12",
|
|
34
|
-
"~core": "workspace:*",
|
|
35
34
|
"typescript": "5"
|
|
36
35
|
},
|
|
37
36
|
"dependencies": {
|