@rasputin-ai/core 0.2.0 → 0.3.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/announce-deploy/announce-deploy.d.ts +2 -2
- package/dist/announce-deploy/announce-deploy.d.ts.map +1 -1
- package/dist/create-client/create-client-types.d.ts +16 -7
- package/dist/create-client/create-client-types.d.ts.map +1 -1
- package/dist/create-client/create-client.d.ts +1 -1
- package/dist/create-client/create-client.d.ts.map +1 -1
- package/dist/create-client/is-client-enabled.d.ts.map +1 -1
- package/dist/create-client/resolve-endpoint-urls.d.ts +1 -0
- package/dist/create-client/resolve-endpoint-urls.d.ts.map +1 -1
- package/dist/create-ingest-event/create-ingest-event-types.d.ts +6 -2
- 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 +87 -0
- package/dist/create-ingest-event/runtime-execution-state-types.d.ts.map +1 -0
- package/dist/create-ingest-event/truncate-ingest-message.d.ts +3 -0
- package/dist/create-ingest-event/truncate-ingest-message.d.ts.map +1 -0
- package/dist/detect-release/detect-release.d.ts +1 -1
- package/dist/detect-release/detect-release.d.ts.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +199 -19
- package/dist/instrumentation-manifest/instrumentation-manifest-types.d.ts +75 -0
- package/dist/instrumentation-manifest/instrumentation-manifest-types.d.ts.map +1 -0
- package/dist/instrumentation-manifest/upload-instrumentation-manifest.d.ts +16 -0
- package/dist/instrumentation-manifest/upload-instrumentation-manifest.d.ts.map +1 -0
- package/dist/sdk-meta.d.ts +1 -1
- package/dist/suppression/suppression-types.d.ts +2 -2
- package/dist/suppression/suppression-types.d.ts.map +1 -1
- package/dist/transport/create-transport.d.ts.map +1 -1
- package/dist/transport/transport-queue.d.ts +7 -0
- package/dist/transport/transport-queue.d.ts.map +1 -1
- package/dist/transport/transport-types.d.ts +11 -2
- package/dist/transport/transport-types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -4,8 +4,8 @@ type AnnounceDeployOptions = {
|
|
|
4
4
|
deployUrl: string;
|
|
5
5
|
projectApiKey: string;
|
|
6
6
|
environment: string;
|
|
7
|
-
/** Commit SHA / release.
|
|
8
|
-
release?: string
|
|
7
|
+
/** Commit SHA / release. Empty when it could not be detected. */
|
|
8
|
+
release?: string;
|
|
9
9
|
/** When false, no-op. Default true. */
|
|
10
10
|
enabled?: boolean;
|
|
11
11
|
fetch?: TransportFetch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"announce-deploy.d.ts","sourceRoot":"","sources":["../../src/announce-deploy/announce-deploy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,KAAK,qBAAqB,GAAG;IAC5B,kEAAkE;IAClE,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,
|
|
1
|
+
{"version":3,"file":"announce-deploy.d.ts","sourceRoot":"","sources":["../../src/announce-deploy/announce-deploy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,KAAK,qBAAqB,GAAG;IAC5B,kEAAkE;IAClE,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,cAAc,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAC1B,SAAS,qBAAqB,KAC5B,OAAO,CAAC,IAAI,GAAG,SAAS,GAAG,QAAQ,CAyBrC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RequestContext } from '../create-ingest-event/create-ingest-event-types';
|
|
2
|
-
import type {
|
|
2
|
+
import type { RuntimeExecutionState } from '../create-ingest-event/runtime-execution-state-types';
|
|
3
|
+
import type { TransportFetch, TransportStats } from '../transport/transport-types';
|
|
3
4
|
type RasputinBaseOptions = {
|
|
4
5
|
/** Project API key from the Rasputin dashboard. Required to send events. */
|
|
5
6
|
projectApiKey: string;
|
|
@@ -12,13 +13,13 @@ type RasputinBaseOptions = {
|
|
|
12
13
|
* Git commit SHA for this deploy. Links errors to a release so you can see
|
|
13
14
|
* what shipped when something broke.
|
|
14
15
|
*
|
|
15
|
-
*
|
|
16
|
-
* `release: process.env.RASPUTIN_RELEASE
|
|
16
|
+
* Set `RASPUTIN_RELEASE` in your deploy environment and pass:
|
|
17
|
+
* `release: process.env.RASPUTIN_RELEASE!`
|
|
17
18
|
*
|
|
18
|
-
* When
|
|
19
|
+
* When blank, Rasputin reads `RASPUTIN_RELEASE`, then platform vars
|
|
19
20
|
* (`VERCEL_GIT_COMMIT_SHA`, etc.), then `.git` HEAD. Must be 7–40 hex chars.
|
|
20
21
|
*/
|
|
21
|
-
release
|
|
22
|
+
release: string;
|
|
22
23
|
/**
|
|
23
24
|
* Master on/off switch. When `false`, nothing is captured or sent.
|
|
24
25
|
* Useful for local dev or tests without removing init code.
|
|
@@ -37,7 +38,7 @@ type RasputinBaseOptions = {
|
|
|
37
38
|
* RasputinInit({
|
|
38
39
|
* projectApiKey: 'rp_…', // from your Rasputin project settings
|
|
39
40
|
* environment: 'production', // e.g. production | staging | preview
|
|
40
|
-
* release: process.env.RASPUTIN_RELEASE
|
|
41
|
+
* release: process.env.RASPUTIN_RELEASE!,
|
|
41
42
|
* moduleUrl: import.meta.url, // from the file where you call this
|
|
42
43
|
* });
|
|
43
44
|
* ```
|
|
@@ -64,6 +65,12 @@ export type CaptureContext = {
|
|
|
64
65
|
* a request yourself; omit for background jobs and scripts.
|
|
65
66
|
*/
|
|
66
67
|
request?: RequestContext;
|
|
68
|
+
/** Runtime state supplied by a framework/runtime integration. */
|
|
69
|
+
runtimeState?: RuntimeExecutionState;
|
|
70
|
+
};
|
|
71
|
+
export type RasputinClientStats = {
|
|
72
|
+
/** Process-local transport counters. Cumulative counters reset when the process restarts. */
|
|
73
|
+
transport: TransportStats;
|
|
67
74
|
};
|
|
68
75
|
/**
|
|
69
76
|
* Client returned by `RasputinInit` / `createClient`.
|
|
@@ -104,8 +111,10 @@ export type RasputinClient = {
|
|
|
104
111
|
* After `close`, the client stops sending — create a new client if you restart.
|
|
105
112
|
*/
|
|
106
113
|
close: () => Promise<void>;
|
|
114
|
+
/** Return a cheap, read-only snapshot of process-local operational safety counters. */
|
|
115
|
+
getStats: () => RasputinClientStats;
|
|
107
116
|
};
|
|
108
|
-
/**
|
|
117
|
+
/** Integration configuration shared with official runtime and framework packages. */
|
|
109
118
|
export type CreateClientHooks = {
|
|
110
119
|
fetch?: TransportFetch;
|
|
111
120
|
announceDeploy?: boolean;
|
|
@@ -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,cAAc,EAAE,MAAM,8BAA8B,CAAC;
|
|
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;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AC,EAAE,OAAO,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CreateClientHooks, RasputinClient, RasputinOptions } from './create-client-types';
|
|
2
|
-
/** Reset per-process warning state
|
|
2
|
+
/** Reset per-process warning state. Not exported from the package entry point. */
|
|
3
3
|
export declare const resetSourceMapWarnings: () => void;
|
|
4
4
|
/**
|
|
5
5
|
* Wire parse → suppress (generated frames) → queue.
|
|
@@ -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,
|
|
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,cAwKF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-client-enabled.d.ts","sourceRoot":"","sources":["../../src/create-client/is-client-enabled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7E,uDAAuD;AACvD,eAAO,MAAM,eAAe,GAAI,SAAS,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,KAAG,OACpD,CAAC;AAEzB,eAAO,MAAM,UAAU,QAAO,
|
|
1
|
+
{"version":3,"file":"is-client-enabled.d.ts","sourceRoot":"","sources":["../../src/create-client/is-client-enabled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7E,uDAAuD;AACvD,eAAO,MAAM,eAAe,GAAI,SAAS,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,KAAG,OACpD,CAAC;AAEzB,eAAO,MAAM,UAAU,QAAO,cAa5B,CAAC"}
|
|
@@ -3,5 +3,6 @@ export declare const DEFAULT_API_URL = "https://rasputin-api.fly.dev";
|
|
|
3
3
|
export declare const resolveEndpointUrls: (apiUrl?: string) => {
|
|
4
4
|
ingestUrl: string;
|
|
5
5
|
deployUrl: string;
|
|
6
|
+
instrumentationManifestUrl: string;
|
|
6
7
|
};
|
|
7
8
|
//# sourceMappingURL=resolve-endpoint-urls.d.ts.map
|
|
@@ -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,iCAAiC,CAAC;AAE9D,eAAO,MAAM,mBAAmB,GAAI,eAAwB
|
|
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,iCAAiC,CAAC;AAE9D,eAAO,MAAM,mBAAmB,GAAI,eAAwB;;;;CAO3D,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Frame } from '../normalize-frames/normalize-frames';
|
|
2
|
+
import type { RuntimeExecutionState } from './runtime-execution-state-types';
|
|
2
3
|
export type IngestOrigin = 'server' | 'client';
|
|
3
4
|
export type FrameResolution = 'exact' | 'partial' | 'none';
|
|
4
5
|
/** Wire stack frame — matches apps/api ingest StackFrame. */
|
|
@@ -20,12 +21,14 @@ export type IngestEvent = {
|
|
|
20
21
|
origin: IngestOrigin;
|
|
21
22
|
/** Whether stack frames were source-map resolved before send. */
|
|
22
23
|
resolution?: FrameResolution;
|
|
23
|
-
release
|
|
24
|
+
release: string;
|
|
24
25
|
request?: {
|
|
25
26
|
method?: string | null;
|
|
26
27
|
route?: string | null;
|
|
27
28
|
status?: number | null;
|
|
28
29
|
};
|
|
30
|
+
/** Bounded runtime state atomically associated with this error occurrence. */
|
|
31
|
+
runtime_state?: RuntimeExecutionState;
|
|
29
32
|
};
|
|
30
33
|
export type RequestContext = {
|
|
31
34
|
method?: string | null;
|
|
@@ -38,10 +41,11 @@ export type CreateIngestEventInput = {
|
|
|
38
41
|
frames: Frame[];
|
|
39
42
|
environment: string;
|
|
40
43
|
resolution: FrameResolution;
|
|
41
|
-
release
|
|
44
|
+
release: string;
|
|
42
45
|
request?: RequestContext;
|
|
43
46
|
origin: IngestOrigin;
|
|
44
47
|
occurredAt?: Date | string;
|
|
45
48
|
code?: string | null;
|
|
49
|
+
runtimeState?: RuntimeExecutionState;
|
|
46
50
|
};
|
|
47
51
|
//# sourceMappingURL=create-ingest-event-types.d.ts.map
|
|
@@ -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;
|
|
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;AAE3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AAO,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;AAgDnC,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"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire-facing runtime-state types kept inside the standalone SDK package. They mirror the server
|
|
3
|
+
* contract without importing the application's private `~db` graph, allowing the published SDK to
|
|
4
|
+
* remain independently buildable and usable by external projects.
|
|
5
|
+
*/
|
|
6
|
+
export type RuntimeExecutionKind = 'http' | 'serverless' | 'job' | 'scheduled' | 'custom';
|
|
7
|
+
export type RuntimeExecutionRequest = {
|
|
8
|
+
method?: string | null;
|
|
9
|
+
route?: string | null;
|
|
10
|
+
status?: number | null;
|
|
11
|
+
};
|
|
12
|
+
export type RuntimeExecutionMetadata = {
|
|
13
|
+
kind: RuntimeExecutionKind;
|
|
14
|
+
name?: string;
|
|
15
|
+
request?: RuntimeExecutionRequest;
|
|
16
|
+
};
|
|
17
|
+
export type RuntimeFunctionEnterEvent = {
|
|
18
|
+
type: 'function_enter';
|
|
19
|
+
callId: number;
|
|
20
|
+
functionId: string;
|
|
21
|
+
parentCallId?: number;
|
|
22
|
+
timestampMs: number;
|
|
23
|
+
args: unknown[];
|
|
24
|
+
};
|
|
25
|
+
export type RuntimeFunctionExitEvent = {
|
|
26
|
+
type: 'function_exit';
|
|
27
|
+
callId: number;
|
|
28
|
+
timestampMs: number;
|
|
29
|
+
durationMs: number;
|
|
30
|
+
returnValue?: unknown;
|
|
31
|
+
};
|
|
32
|
+
/** Source-mapped origin of the exception represented by a runtime-state throw event. */
|
|
33
|
+
export type RuntimeThrowLocation = {
|
|
34
|
+
file: string;
|
|
35
|
+
function?: string;
|
|
36
|
+
line?: number;
|
|
37
|
+
column?: number;
|
|
38
|
+
inApp: boolean;
|
|
39
|
+
};
|
|
40
|
+
export type RuntimeFunctionThrowEvent = {
|
|
41
|
+
type: 'function_throw';
|
|
42
|
+
callId: number;
|
|
43
|
+
timestampMs: number;
|
|
44
|
+
durationMs: number;
|
|
45
|
+
error?: unknown;
|
|
46
|
+
/** Collector-derived from the occurrence's already-resolved stack before persistence. */
|
|
47
|
+
throwLocation?: RuntimeThrowLocation;
|
|
48
|
+
};
|
|
49
|
+
/** Aggregates successful repeated calls that were intentionally not captured individually. */
|
|
50
|
+
export type RuntimeFunctionCallsSuppressedEvent = {
|
|
51
|
+
type: 'function_calls_suppressed';
|
|
52
|
+
functionId: string;
|
|
53
|
+
parentCallId?: number;
|
|
54
|
+
/** Timestamp of the first suppressed call. */
|
|
55
|
+
timestampMs: number;
|
|
56
|
+
/** Completion timestamp of the most recent suppressed call. */
|
|
57
|
+
lastTimestampMs: number;
|
|
58
|
+
suppressedCallCount: number;
|
|
59
|
+
/** Aggregate wall time of the suppressed calls. */
|
|
60
|
+
totalDurationMs: number;
|
|
61
|
+
};
|
|
62
|
+
export type RuntimeExecutionEvent = RuntimeFunctionEnterEvent | RuntimeFunctionExitEvent | RuntimeFunctionThrowEvent | RuntimeFunctionCallsSuppressedEvent;
|
|
63
|
+
export type RuntimeExecutionRecorderMetrics = {
|
|
64
|
+
/** Cumulative synchronous wall time spent in recorder-owned work for this execution. */
|
|
65
|
+
inlineWallTimeMs: number;
|
|
66
|
+
};
|
|
67
|
+
/** Bounded, redacted execution state captured at the moment an error is reported. */
|
|
68
|
+
export type RuntimeExecutionState = {
|
|
69
|
+
version: 1;
|
|
70
|
+
executionId: string;
|
|
71
|
+
startedAt: string;
|
|
72
|
+
durationMs: number;
|
|
73
|
+
/** Optional for compatibility with runtime states produced by older SDK versions. */
|
|
74
|
+
recorder?: RuntimeExecutionRecorderMetrics;
|
|
75
|
+
execution: RuntimeExecutionMetadata;
|
|
76
|
+
events: RuntimeExecutionEvent[];
|
|
77
|
+
truncated?: {
|
|
78
|
+
eventsDropped: number;
|
|
79
|
+
};
|
|
80
|
+
capture?: {
|
|
81
|
+
completeness: 'partial';
|
|
82
|
+
reason: 'process_memory_budget';
|
|
83
|
+
valuesDropped: number;
|
|
84
|
+
eventsDropped: number;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=runtime-execution-state-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-execution-state-types.d.ts","sourceRoot":"","sources":["../../src/create-ingest-event/runtime-execution-state-types.ts"],"names":[],"mappings":"A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-message.d.ts","sourceRoot":"","sources":["../../src/create-ingest-event/truncate-ingest-message.ts"],"names":[],"mappings":"AAkIA,wFAAwF;AACxF,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,EAAE,iBAA4B,KAAG,MAenF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type DetectReleaseOptions = {
|
|
2
2
|
/** Explicit release (e.g. from RasputinInit). Wins over env when a valid SHA. */
|
|
3
|
-
release?: string
|
|
3
|
+
release?: string;
|
|
4
4
|
/** Defaults to `process.env` — override in tests. */
|
|
5
5
|
env?: Record<string, string | undefined>;
|
|
6
6
|
/** Directory to probe for `.git` — defaults to `process.cwd()`. Override in tests. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect-release.d.ts","sourceRoot":"","sources":["../../src/detect-release/detect-release.ts"],"names":[],"mappings":"AAGA,KAAK,oBAAoB,GAAG;IAC3B,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"detect-release.d.ts","sourceRoot":"","sources":["../../src/detect-release/detect-release.ts"],"names":[],"mappings":"AAGA,KAAK,oBAAoB,GAAG;IAC3B,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC,sFAAsF;IACtF,GAAG,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAkDF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,UAAS,oBAAyB,KAAG,MAAM,GAAG,SAyB3E,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
export { announceDeploy } from './announce-deploy/announce-deploy';
|
|
2
2
|
export { createClient } from './create-client/create-client';
|
|
3
|
-
export type { CaptureContext, RasputinClient, RasputinOptions, } from './create-client/create-client-types';
|
|
3
|
+
export type { CaptureContext, RasputinClient, RasputinClientStats, RasputinOptions, } from './create-client/create-client-types';
|
|
4
4
|
export { isClientEnabled } from './create-client/is-client-enabled';
|
|
5
|
+
export { resolveEndpointUrls } from './create-client/resolve-endpoint-urls';
|
|
5
6
|
export { createIngestEvent } from './create-ingest-event/create-ingest-event';
|
|
6
7
|
export type { RequestContext } from './create-ingest-event/create-ingest-event-types';
|
|
8
|
+
export type { RuntimeExecutionEvent, RuntimeExecutionKind, RuntimeExecutionMetadata, RuntimeExecutionRecorderMetrics, RuntimeExecutionRequest, RuntimeExecutionState, RuntimeFunctionCallsSuppressedEvent, RuntimeFunctionEnterEvent, RuntimeFunctionExitEvent, RuntimeFunctionThrowEvent, RuntimeThrowLocation, } from './create-ingest-event/runtime-execution-state-types';
|
|
7
9
|
export { detectRelease } from './detect-release/detect-release';
|
|
10
|
+
export type { InstrumentationArgIdentifier, InstrumentationManifestCallSite, InstrumentationManifestContent, InstrumentationManifestDestructure, InstrumentationManifestFunction, InstrumentationParamBinding, } from './instrumentation-manifest/instrumentation-manifest-types';
|
|
11
|
+
export { INSTRUMENTATION_MANIFEST_SCHEMA_VERSION } from './instrumentation-manifest/instrumentation-manifest-types';
|
|
12
|
+
export { uploadInstrumentationManifest } from './instrumentation-manifest/upload-instrumentation-manifest';
|
|
8
13
|
export type { Frame } from './normalize-frames/normalize-frames';
|
|
9
14
|
export { normalizeFrames } from './normalize-frames/normalize-frames';
|
|
10
15
|
export { parseStack } from './parse-stack/parse-stack';
|
|
11
16
|
export type { RawFrame } from './parse-stack/raw-frame';
|
|
12
17
|
export { repoRootFrom } from './repo-root/repo-root-from';
|
|
18
|
+
export { resolveRepoRoot } from './repo-root/resolve-repo-root';
|
|
13
19
|
export { resolveSourceMaps } from './resolve-source-maps/resolve-source-maps';
|
|
14
20
|
export type { ResolvedFrame, ResolveSourceMapsResult, } from './resolve-source-maps/resolved-frame';
|
|
15
21
|
export { createSuppression } from './suppression/create-suppression';
|
|
16
22
|
export type { CreateSuppressionOptions, IngestSummary, PrepareSummaryFrames, SummaryIdentity, SuppressionDecideInput, SuppressionDecideResult, } from './suppression/suppression-types';
|
|
17
23
|
export { createTransport } from './transport/create-transport';
|
|
18
|
-
export type { CreateTransportOptions, Transport, TransportPriority, } from './transport/transport-types';
|
|
24
|
+
export type { CreateTransportOptions, Transport, TransportPriority, TransportStats, } from './transport/transport-types';
|
|
19
25
|
//# sourceMappingURL=index.d.ts.map
|
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,eAAe,GACf,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,YAAY,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,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,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,YAAY,EACX,aAAa,EACb,uBAAuB,GACvB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,YAAY,EACX,wBAAwB,EACxB,aAAa,EACb,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C;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,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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// src/announce-deploy/announce-deploy.ts
|
|
2
2
|
var announceDeploy = async (options) => {
|
|
3
3
|
if (options.enabled === false) return "skipped";
|
|
4
|
-
const release = options.release?.trim();
|
|
4
|
+
const release = options.release?.trim() ?? "";
|
|
5
5
|
const environment = options.environment.trim();
|
|
6
|
-
if (!
|
|
6
|
+
if (!environment) return "skipped";
|
|
7
7
|
const fetchFn = options.fetch ?? globalThis.fetch;
|
|
8
8
|
try {
|
|
9
9
|
const response = await fetchFn(options.deployUrl, {
|
|
@@ -22,15 +22,116 @@ var announceDeploy = async (options) => {
|
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
// src/create-ingest-event/
|
|
25
|
+
// src/create-ingest-event/truncate-ingest-message.ts
|
|
26
26
|
var MAX_MESSAGE_BYTES = 8 * 1024;
|
|
27
|
-
var
|
|
27
|
+
var utf8Bytes = (value) => Buffer.byteLength(value, "utf8");
|
|
28
28
|
var truncateUtf8 = (value, maxBytes) => {
|
|
29
|
-
if (
|
|
29
|
+
if (utf8Bytes(value) <= maxBytes) return value;
|
|
30
30
|
let end = Math.min(value.length, maxBytes);
|
|
31
|
-
while (end > 0 &&
|
|
31
|
+
while (end > 0 && utf8Bytes(value.slice(0, end)) > maxBytes) end--;
|
|
32
32
|
return value.slice(0, end);
|
|
33
33
|
};
|
|
34
|
+
var truncation = (reason, extra = {}) => ({
|
|
35
|
+
__rasputin_truncated: true,
|
|
36
|
+
__reason: reason,
|
|
37
|
+
...extra
|
|
38
|
+
});
|
|
39
|
+
var mapJson = (value, maxStringChars, maxArrayItems, maxObjectKeys) => {
|
|
40
|
+
if (typeof value === "string") {
|
|
41
|
+
if (value.length <= maxStringChars) return value;
|
|
42
|
+
if (maxStringChars <= 1) return value.slice(0, maxStringChars);
|
|
43
|
+
return `${value.slice(0, maxStringChars - 1)}\u2026`;
|
|
44
|
+
}
|
|
45
|
+
if (Array.isArray(value)) {
|
|
46
|
+
const keep = maxArrayItems === null ? value.length : Math.min(value.length, maxArrayItems);
|
|
47
|
+
const items = value.slice(0, keep).map((item) => mapJson(item, maxStringChars, maxArrayItems, maxObjectKeys));
|
|
48
|
+
if (keep < value.length) {
|
|
49
|
+
items.push(truncation("max_array_elements", { __original_length: value.length }));
|
|
50
|
+
}
|
|
51
|
+
return items;
|
|
52
|
+
}
|
|
53
|
+
if (value && typeof value === "object") {
|
|
54
|
+
const entries = Object.entries(value);
|
|
55
|
+
const keep = maxObjectKeys === null ? entries.length : Math.min(entries.length, maxObjectKeys);
|
|
56
|
+
const out = {};
|
|
57
|
+
for (const [key, child] of entries.slice(0, keep)) {
|
|
58
|
+
out[key] = mapJson(child, maxStringChars, maxArrayItems, maxObjectKeys);
|
|
59
|
+
}
|
|
60
|
+
if (keep < entries.length) {
|
|
61
|
+
Object.assign(out, truncation("max_object_keys", { __original_length: entries.length }));
|
|
62
|
+
}
|
|
63
|
+
return out;
|
|
64
|
+
}
|
|
65
|
+
return value;
|
|
66
|
+
};
|
|
67
|
+
var jsonIfFits = (value, maxBytes) => {
|
|
68
|
+
const json = JSON.stringify(value);
|
|
69
|
+
return utf8Bytes(json) <= maxBytes ? json : null;
|
|
70
|
+
};
|
|
71
|
+
var boundJsonMessage = (value, maxBytes) => {
|
|
72
|
+
const fit = (maxStringChars, maxArrayItems, maxObjectKeys) => jsonIfFits(mapJson(value, maxStringChars, maxArrayItems, maxObjectKeys), maxBytes);
|
|
73
|
+
const longestStringsThatFit = (maxArrayItems, maxObjectKeys) => {
|
|
74
|
+
let lo = 0;
|
|
75
|
+
let hi = maxBytes;
|
|
76
|
+
let best = null;
|
|
77
|
+
while (lo <= hi) {
|
|
78
|
+
const mid = lo + hi >> 1;
|
|
79
|
+
const candidate = fit(mid, maxArrayItems, maxObjectKeys);
|
|
80
|
+
if (candidate) {
|
|
81
|
+
best = candidate;
|
|
82
|
+
lo = mid + 1;
|
|
83
|
+
} else {
|
|
84
|
+
hi = mid - 1;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return best;
|
|
88
|
+
};
|
|
89
|
+
const withAllKeys = longestStringsThatFit(null, null);
|
|
90
|
+
if (withAllKeys) return withAllKeys;
|
|
91
|
+
const searchCount = (emptyFits, fillStrings) => {
|
|
92
|
+
let lo = 0;
|
|
93
|
+
let hi = 1;
|
|
94
|
+
while (!emptyFits(hi) && hi < 1048576) hi *= 2;
|
|
95
|
+
let best = 0;
|
|
96
|
+
while (lo <= hi) {
|
|
97
|
+
const mid = lo + hi >> 1;
|
|
98
|
+
if (emptyFits(mid)) {
|
|
99
|
+
best = mid;
|
|
100
|
+
lo = mid + 1;
|
|
101
|
+
} else {
|
|
102
|
+
hi = mid - 1;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return fillStrings(best);
|
|
106
|
+
};
|
|
107
|
+
const withFewerArrayItems = searchCount(
|
|
108
|
+
(count) => fit(0, count, null) !== null,
|
|
109
|
+
(count) => longestStringsThatFit(count, null)
|
|
110
|
+
);
|
|
111
|
+
if (withFewerArrayItems) return withFewerArrayItems;
|
|
112
|
+
return searchCount(
|
|
113
|
+
(count) => fit(0, 0, count) !== null,
|
|
114
|
+
(count) => longestStringsThatFit(0, count)
|
|
115
|
+
) ?? JSON.stringify(
|
|
116
|
+
Array.isArray(value) ? [truncation("max_array_elements", { __original_length: value.length })] : truncation("max_object_keys", { __original_length: Object.keys(value).length })
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
var truncateIngestMessage = (value, maxBytes = MAX_MESSAGE_BYTES) => {
|
|
120
|
+
if (utf8Bytes(value) <= maxBytes) return value;
|
|
121
|
+
try {
|
|
122
|
+
const parsed = JSON.parse(value);
|
|
123
|
+
if (parsed !== null && typeof parsed === "object") {
|
|
124
|
+
const compact = JSON.stringify(parsed);
|
|
125
|
+
if (utf8Bytes(compact) <= maxBytes) return compact;
|
|
126
|
+
return boundJsonMessage(parsed, maxBytes);
|
|
127
|
+
}
|
|
128
|
+
} catch {
|
|
129
|
+
}
|
|
130
|
+
return truncateUtf8(value, maxBytes);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
// src/create-ingest-event/create-ingest-event.ts
|
|
134
|
+
var MAX_STACK_FRAMES = 50;
|
|
34
135
|
var errorFields = (error) => {
|
|
35
136
|
if (error instanceof Error) {
|
|
36
137
|
const code = "code" in error && (typeof error.code === "string" || typeof error.code === "number") ? String(error.code) : void 0;
|
|
@@ -79,18 +180,19 @@ var createIngestEvent = (input) => {
|
|
|
79
180
|
const occurred = input.occurredAt === void 0 ? (/* @__PURE__ */ new Date()).toISOString() : typeof input.occurredAt === "string" ? input.occurredAt : input.occurredAt.toISOString();
|
|
80
181
|
const event = {
|
|
81
182
|
type: extracted.type,
|
|
82
|
-
message:
|
|
183
|
+
message: truncateIngestMessage(extracted.message),
|
|
83
184
|
stack_frames: framesToStackFrames(input.frames),
|
|
84
185
|
occurred_at: occurred,
|
|
85
186
|
environment: input.environment,
|
|
86
187
|
origin: input.origin,
|
|
87
|
-
resolution: input.resolution
|
|
188
|
+
resolution: input.resolution,
|
|
189
|
+
release: input.release
|
|
88
190
|
};
|
|
89
191
|
const code = input.code !== void 0 ? input.code : extracted.code;
|
|
90
192
|
if (code !== void 0) event.code = code;
|
|
91
|
-
if (input.release !== void 0) event.release = input.release;
|
|
92
193
|
const request = sanitizeRequest(input.request);
|
|
93
194
|
if (request) event.request = request;
|
|
195
|
+
if (input.runtimeState) event.runtime_state = input.runtimeState;
|
|
94
196
|
return event;
|
|
95
197
|
};
|
|
96
198
|
|
|
@@ -166,7 +268,7 @@ var detectRelease = (options = {}) => {
|
|
|
166
268
|
const fromGit = readGitHead(options.cwd ?? process.cwd());
|
|
167
269
|
if (fromGit) return fromGit;
|
|
168
270
|
console.warn(
|
|
169
|
-
"[rasputin] No release detected. Set `RASPUTIN_RELEASE` to your git commit SHA, pass `release` in RasputinInit, or deploy on a platform that exposes a commit SHA env var (e.g. VERCEL_GIT_COMMIT_SHA).
|
|
271
|
+
"[rasputin] No release detected. Set `RASPUTIN_RELEASE` to your git commit SHA, pass `release` in RasputinInit, or deploy on a platform that exposes a commit SHA env var (e.g. VERCEL_GIT_COMMIT_SHA). Events are not sent without a release."
|
|
170
272
|
);
|
|
171
273
|
return void 0;
|
|
172
274
|
};
|
|
@@ -489,7 +591,7 @@ var resolveSourceMaps = async (frames) => {
|
|
|
489
591
|
|
|
490
592
|
// src/sdk-meta.ts
|
|
491
593
|
var SDK_NAME = "@rasputin-ai/core";
|
|
492
|
-
var SDK_VERSION = "0.
|
|
594
|
+
var SDK_VERSION = "0.3.0";
|
|
493
595
|
|
|
494
596
|
// src/suppression/identity-needs-message-template.ts
|
|
495
597
|
var identityNeedsMessageTemplate = (type, code) => {
|
|
@@ -687,7 +789,7 @@ var createSuppression = (options = {}) => {
|
|
|
687
789
|
const identity = captureIdentity(input);
|
|
688
790
|
const captureRawFrames = (input.rawFrames ?? []).slice(0, MAX_STACK_FRAMES);
|
|
689
791
|
const burstKey = computeBurstKey(input.errorType, input.message, input.code, input.frames);
|
|
690
|
-
const release = input.release
|
|
792
|
+
const release = input.release;
|
|
691
793
|
const route = input.route ?? null;
|
|
692
794
|
let bucket = burstBuckets.get(burstKey);
|
|
693
795
|
if (!bucket) {
|
|
@@ -859,6 +961,9 @@ var RANK = {
|
|
|
859
961
|
};
|
|
860
962
|
var createQueue = (maxSize) => {
|
|
861
963
|
const items = [];
|
|
964
|
+
let enqueued = 0;
|
|
965
|
+
let droppedIncoming = 0;
|
|
966
|
+
let droppedQueued = 0;
|
|
862
967
|
const oldestLowestIndex = () => {
|
|
863
968
|
let best = 0;
|
|
864
969
|
for (let i = 1; i < items.length; i++) {
|
|
@@ -874,16 +979,28 @@ var createQueue = (maxSize) => {
|
|
|
874
979
|
const victimIndex = oldestLowestIndex();
|
|
875
980
|
const victim = items[victimIndex];
|
|
876
981
|
if (!victim) break;
|
|
877
|
-
if (RANK[item.priority] < RANK[victim.priority])
|
|
982
|
+
if (RANK[item.priority] < RANK[victim.priority]) {
|
|
983
|
+
droppedIncoming++;
|
|
984
|
+
return;
|
|
985
|
+
}
|
|
878
986
|
items.splice(victimIndex, 1);
|
|
987
|
+
droppedQueued++;
|
|
879
988
|
}
|
|
880
989
|
items.push(item);
|
|
990
|
+
enqueued++;
|
|
881
991
|
};
|
|
882
992
|
const drain = (count) => items.splice(0, count);
|
|
883
993
|
return {
|
|
884
994
|
enqueue,
|
|
885
995
|
drain,
|
|
886
996
|
size: () => items.length,
|
|
997
|
+
getStats: () => ({
|
|
998
|
+
queued: items.length,
|
|
999
|
+
enqueued,
|
|
1000
|
+
droppedIncoming,
|
|
1001
|
+
droppedQueued,
|
|
1002
|
+
droppedTotal: droppedIncoming + droppedQueued
|
|
1003
|
+
}),
|
|
887
1004
|
clear: () => {
|
|
888
1005
|
items.length = 0;
|
|
889
1006
|
}
|
|
@@ -1058,7 +1175,14 @@ var createTransport = (options) => {
|
|
|
1058
1175
|
enqueueSummary,
|
|
1059
1176
|
flush,
|
|
1060
1177
|
close,
|
|
1061
|
-
size: () => queue.size() + (retryBatch?.items.length ?? 0)
|
|
1178
|
+
size: () => queue.size() + (retryBatch?.items.length ?? 0),
|
|
1179
|
+
getStats: () => {
|
|
1180
|
+
const queueStats = queue.getStats();
|
|
1181
|
+
return {
|
|
1182
|
+
...queueStats,
|
|
1183
|
+
queued: queueStats.queued + (retryBatch?.items.length ?? 0)
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1062
1186
|
};
|
|
1063
1187
|
};
|
|
1064
1188
|
|
|
@@ -1070,7 +1194,16 @@ var noopClient = () => ({
|
|
|
1070
1194
|
flush: async () => {
|
|
1071
1195
|
},
|
|
1072
1196
|
close: async () => {
|
|
1073
|
-
}
|
|
1197
|
+
},
|
|
1198
|
+
getStats: () => ({
|
|
1199
|
+
transport: {
|
|
1200
|
+
queued: 0,
|
|
1201
|
+
enqueued: 0,
|
|
1202
|
+
droppedIncoming: 0,
|
|
1203
|
+
droppedQueued: 0,
|
|
1204
|
+
droppedTotal: 0
|
|
1205
|
+
}
|
|
1206
|
+
})
|
|
1074
1207
|
});
|
|
1075
1208
|
|
|
1076
1209
|
// src/create-client/resolve-endpoint-urls.ts
|
|
@@ -1079,7 +1212,8 @@ var resolveEndpointUrls = (apiUrl = DEFAULT_API_URL) => {
|
|
|
1079
1212
|
const base = apiUrl.replace(/\/+$/, "");
|
|
1080
1213
|
return {
|
|
1081
1214
|
ingestUrl: `${base}/ingest`,
|
|
1082
|
-
deployUrl: `${base}/deploy
|
|
1215
|
+
deployUrl: `${base}/deploy`,
|
|
1216
|
+
instrumentationManifestUrl: `${base}/instrumentationManifest`
|
|
1083
1217
|
};
|
|
1084
1218
|
};
|
|
1085
1219
|
|
|
@@ -1115,6 +1249,17 @@ var createClient = (options, hooks = {}) => {
|
|
|
1115
1249
|
const release = detectRelease({ release: options.release });
|
|
1116
1250
|
const environment = options.environment;
|
|
1117
1251
|
const { ingestUrl, deployUrl } = resolveEndpointUrls(options.apiUrl);
|
|
1252
|
+
if (!release) {
|
|
1253
|
+
if (hooks.announceDeploy ?? true) {
|
|
1254
|
+
void announceDeploy({
|
|
1255
|
+
deployUrl,
|
|
1256
|
+
projectApiKey,
|
|
1257
|
+
environment,
|
|
1258
|
+
fetch: hooks.fetch
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1261
|
+
return noopClient();
|
|
1262
|
+
}
|
|
1118
1263
|
const repoRoot = resolveRepoRoot(options);
|
|
1119
1264
|
if (!repoRoot) {
|
|
1120
1265
|
warnIfMissingRepoRoot();
|
|
@@ -1183,7 +1328,8 @@ var createClient = (options, hooks = {}) => {
|
|
|
1183
1328
|
release,
|
|
1184
1329
|
origin: "server",
|
|
1185
1330
|
resolution: "none",
|
|
1186
|
-
request: context?.request
|
|
1331
|
+
request: context?.request,
|
|
1332
|
+
runtimeState: context?.runtimeState
|
|
1187
1333
|
});
|
|
1188
1334
|
const decision = suppression.decide({
|
|
1189
1335
|
errorType: event.type,
|
|
@@ -1221,12 +1367,43 @@ var createClient = (options, hooks = {}) => {
|
|
|
1221
1367
|
} catch {
|
|
1222
1368
|
}
|
|
1223
1369
|
};
|
|
1224
|
-
return {
|
|
1370
|
+
return {
|
|
1371
|
+
captureException,
|
|
1372
|
+
flush,
|
|
1373
|
+
close,
|
|
1374
|
+
getStats: () => ({ transport: transport.getStats() })
|
|
1375
|
+
};
|
|
1225
1376
|
} catch {
|
|
1226
1377
|
return noopClient();
|
|
1227
1378
|
}
|
|
1228
1379
|
};
|
|
1380
|
+
|
|
1381
|
+
// src/instrumentation-manifest/instrumentation-manifest-types.ts
|
|
1382
|
+
var INSTRUMENTATION_MANIFEST_SCHEMA_VERSION = 1;
|
|
1383
|
+
|
|
1384
|
+
// src/instrumentation-manifest/upload-instrumentation-manifest.ts
|
|
1385
|
+
var uploadInstrumentationManifest = async (options) => {
|
|
1386
|
+
const release = options.release.trim();
|
|
1387
|
+
if (!release) return "failed";
|
|
1388
|
+
const fetchFn = options.fetch ?? globalThis.fetch;
|
|
1389
|
+
try {
|
|
1390
|
+
const response = await fetchFn(options.url, {
|
|
1391
|
+
method: "POST",
|
|
1392
|
+
headers: {
|
|
1393
|
+
Authorization: `Bearer ${options.projectApiKey}`,
|
|
1394
|
+
"Content-Type": "application/json",
|
|
1395
|
+
Accept: "application/json"
|
|
1396
|
+
},
|
|
1397
|
+
body: JSON.stringify({ release, manifest: options.manifest })
|
|
1398
|
+
});
|
|
1399
|
+
if (response.ok) return "ok";
|
|
1400
|
+
return "failed";
|
|
1401
|
+
} catch {
|
|
1402
|
+
return "failed";
|
|
1403
|
+
}
|
|
1404
|
+
};
|
|
1229
1405
|
export {
|
|
1406
|
+
INSTRUMENTATION_MANIFEST_SCHEMA_VERSION,
|
|
1230
1407
|
announceDeploy,
|
|
1231
1408
|
createClient,
|
|
1232
1409
|
createIngestEvent,
|
|
@@ -1237,5 +1414,8 @@ export {
|
|
|
1237
1414
|
normalizeFrames,
|
|
1238
1415
|
parseStack,
|
|
1239
1416
|
repoRootFrom,
|
|
1240
|
-
|
|
1417
|
+
resolveEndpointUrls,
|
|
1418
|
+
resolveRepoRoot,
|
|
1419
|
+
resolveSourceMaps,
|
|
1420
|
+
uploadInstrumentationManifest
|
|
1241
1421
|
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static per-release facts about instrumented source. Runtime events stay v1;
|
|
3
|
+
* this payload is uploaded separately and joined in the debugger.
|
|
4
|
+
*/
|
|
5
|
+
export declare const INSTRUMENTATION_MANIFEST_SCHEMA_VERSION = 1;
|
|
6
|
+
export type InstrumentationParamBinding = {
|
|
7
|
+
kind: 'identifier';
|
|
8
|
+
name: string;
|
|
9
|
+
} | {
|
|
10
|
+
kind: 'object';
|
|
11
|
+
properties: Array<{
|
|
12
|
+
key: string;
|
|
13
|
+
binding: InstrumentationParamBinding;
|
|
14
|
+
}>;
|
|
15
|
+
} | {
|
|
16
|
+
kind: 'array';
|
|
17
|
+
elements: Array<InstrumentationParamBinding | {
|
|
18
|
+
kind: 'omitted';
|
|
19
|
+
}>;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'rest';
|
|
22
|
+
binding: InstrumentationParamBinding;
|
|
23
|
+
} | {
|
|
24
|
+
kind: 'omitted';
|
|
25
|
+
};
|
|
26
|
+
export type InstrumentationArgIdentifier = {
|
|
27
|
+
index: number;
|
|
28
|
+
kind: 'identifier';
|
|
29
|
+
name: string;
|
|
30
|
+
} | {
|
|
31
|
+
index: number;
|
|
32
|
+
kind: 'object';
|
|
33
|
+
properties: Array<{
|
|
34
|
+
key: string;
|
|
35
|
+
name: string;
|
|
36
|
+
}>;
|
|
37
|
+
};
|
|
38
|
+
export type InstrumentationManifestFunction = {
|
|
39
|
+
functionId: string;
|
|
40
|
+
path: string;
|
|
41
|
+
name: string;
|
|
42
|
+
startLine: number;
|
|
43
|
+
startColumn: number;
|
|
44
|
+
endLine: number;
|
|
45
|
+
endColumn: number;
|
|
46
|
+
params: InstrumentationParamBinding[];
|
|
47
|
+
};
|
|
48
|
+
export type InstrumentationManifestCallSite = {
|
|
49
|
+
id: string;
|
|
50
|
+
callerFunctionId: string;
|
|
51
|
+
calleeName: string;
|
|
52
|
+
calleeText: string;
|
|
53
|
+
path: string;
|
|
54
|
+
line: number;
|
|
55
|
+
column: number;
|
|
56
|
+
endLine: number;
|
|
57
|
+
endColumn: number;
|
|
58
|
+
resultBinding: string | null;
|
|
59
|
+
argIdentifiers: InstrumentationArgIdentifier[];
|
|
60
|
+
};
|
|
61
|
+
export type InstrumentationManifestDestructure = {
|
|
62
|
+
callerFunctionId: string;
|
|
63
|
+
sourceParam: string;
|
|
64
|
+
path: string;
|
|
65
|
+
line: number;
|
|
66
|
+
column: number;
|
|
67
|
+
binding: InstrumentationParamBinding;
|
|
68
|
+
};
|
|
69
|
+
export type InstrumentationManifestContent = {
|
|
70
|
+
schema_version: typeof INSTRUMENTATION_MANIFEST_SCHEMA_VERSION;
|
|
71
|
+
functions: InstrumentationManifestFunction[];
|
|
72
|
+
callSites: InstrumentationManifestCallSite[];
|
|
73
|
+
destructures: InstrumentationManifestDestructure[];
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=instrumentation-manifest-types.d.ts.map
|
|
@@ -0,0 +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,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,2BAA2B,EAAE,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,EAAE,4BAA4B,EAAE,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAChD,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,2BAA2B,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC5C,cAAc,EAAE,OAAO,uCAAuC,CAAC;IAC/D,SAAS,EAAE,+BAA+B,EAAE,CAAC;IAC7C,SAAS,EAAE,+BAA+B,EAAE,CAAC;IAC7C,YAAY,EAAE,kCAAkC,EAAE,CAAC;CACnD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TransportFetch } from '../transport/transport-types';
|
|
2
|
+
import type { InstrumentationManifestContent } from './instrumentation-manifest-types';
|
|
3
|
+
type UploadInstrumentationManifestOptions = {
|
|
4
|
+
url: string;
|
|
5
|
+
projectApiKey: string;
|
|
6
|
+
release: string;
|
|
7
|
+
manifest: InstrumentationManifestContent;
|
|
8
|
+
fetch?: TransportFetch;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Fire-and-forget merge of static source metadata for this release.
|
|
12
|
+
* Never throws — init and capture must not wait on this HTTP call.
|
|
13
|
+
*/
|
|
14
|
+
export declare const uploadInstrumentationManifest: (options: UploadInstrumentationManifestOptions) => Promise<"ok" | "failed">;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=upload-instrumentation-manifest.d.ts.map
|
|
@@ -0,0 +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,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAEvF,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,IAAI,GAAG,QAAQ,CAoBzB,CAAC"}
|
package/dist/sdk-meta.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type IngestSummary = {
|
|
|
13
13
|
environment: string;
|
|
14
14
|
origin: IngestOrigin;
|
|
15
15
|
resolution?: FrameResolution;
|
|
16
|
-
release
|
|
16
|
+
release: string;
|
|
17
17
|
};
|
|
18
18
|
export type SummaryIdentity = Pick<IngestSummary, 'type' | 'message' | 'stack_frames' | 'origin' | 'code' | 'resolution'>;
|
|
19
19
|
export type SuppressionDecideInput = {
|
|
@@ -25,7 +25,7 @@ export type SuppressionDecideInput = {
|
|
|
25
25
|
origin: IngestOrigin;
|
|
26
26
|
code?: string | null;
|
|
27
27
|
environment: string;
|
|
28
|
-
release
|
|
28
|
+
release: string;
|
|
29
29
|
route?: string | null;
|
|
30
30
|
/** Injectable clock for tests. */
|
|
31
31
|
now?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suppression-types.d.ts","sourceRoot":"","sources":["../../src/suppression/suppression-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,kFAAkF;AAClF,MAAM,MAAM,aAAa,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,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,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"suppression-types.d.ts","sourceRoot":"","sources":["../../src/suppression/suppression-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,k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AE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAClC,GAAG,EAAE,QAAQ,EAAE,KACX,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,cAAc,GAAG,YAAY,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-transport.d.ts","sourceRoot":"","sources":["../../src/transport/create-transport.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAe,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAoCxF,eAAO,MAAM,eAAe,GAAI,SAAS,sBAAsB,KAAG,
|
|
1
|
+
{"version":3,"file":"create-transport.d.ts","sourceRoot":"","sources":["../../src/transport/create-transport.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAe,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAoCxF,eAAO,MAAM,eAAe,GAAI,SAAS,sBAAsB,KAAG,SA6KjE,CAAC"}
|
|
@@ -4,6 +4,13 @@ export declare const createQueue: (maxSize: number) => {
|
|
|
4
4
|
enqueue: (item: QueuedEvent) => void;
|
|
5
5
|
drain: (count: number) => QueuedEvent[];
|
|
6
6
|
size: () => number;
|
|
7
|
+
getStats: () => {
|
|
8
|
+
queued: number;
|
|
9
|
+
enqueued: number;
|
|
10
|
+
droppedIncoming: number;
|
|
11
|
+
droppedQueued: number;
|
|
12
|
+
droppedTotal: number;
|
|
13
|
+
};
|
|
7
14
|
clear: () => void;
|
|
8
15
|
};
|
|
9
16
|
//# sourceMappingURL=transport-queue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport-queue.d.ts","sourceRoot":"","sources":["../../src/transport/transport-queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAqB,MAAM,mBAAmB,CAAC;AAQxE,kEAAkE;AAClE,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM;
|
|
1
|
+
{"version":3,"file":"transport-queue.d.ts","sourceRoot":"","sources":["../../src/transport/transport-queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAqB,MAAM,mBAAmB,CAAC;AAQxE,kEAAkE;AAClE,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM;oBAkBnB,WAAW;mBAgBZ,MAAM,KAAG,WAAW,EAAE;;;;;;;;;;CAiB5C,CAAC"}
|
|
@@ -21,10 +21,17 @@ export type QueuedEvent = {
|
|
|
21
21
|
rawFrames: RawFrame[];
|
|
22
22
|
};
|
|
23
23
|
export type TransportFetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
24
|
-
|
|
24
|
+
type PrepareQueuedEvent = (item: {
|
|
25
25
|
event: IngestEvent;
|
|
26
26
|
rawFrames: RawFrame[];
|
|
27
27
|
}) => Promise<IngestEvent>;
|
|
28
|
+
export type TransportStats = {
|
|
29
|
+
queued: number;
|
|
30
|
+
enqueued: number;
|
|
31
|
+
droppedIncoming: number;
|
|
32
|
+
droppedQueued: number;
|
|
33
|
+
droppedTotal: number;
|
|
34
|
+
};
|
|
28
35
|
export type CreateTransportOptions = {
|
|
29
36
|
/** Real API ingest URL — `POST /ingest` (apps/api post-ingest.handler). */
|
|
30
37
|
ingestUrl: string;
|
|
@@ -51,7 +58,9 @@ export type Transport = {
|
|
|
51
58
|
enqueueSummary: (summary: IngestSummary, rawFrames?: RawFrame[]) => void;
|
|
52
59
|
flush: (timeoutMs?: number) => Promise<void>;
|
|
53
60
|
close: () => Promise<void>;
|
|
54
|
-
/**
|
|
61
|
+
/** Number of events waiting in the bounded queue or a failed batch awaiting replay. */
|
|
55
62
|
size: () => number;
|
|
63
|
+
getStats: () => TransportStats;
|
|
56
64
|
};
|
|
65
|
+
export {};
|
|
57
66
|
//# sourceMappingURL=transport-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport-types.d.ts","sourceRoot":"","sources":["../../src/transport/transport-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAE5F;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE/D,MAAM,MAAM,WAAW,GACpB;IACA,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC7B,6DAA6D;IAC7D,SAAS,EAAE,QAAQ,EAAE,CAAC;CACrB,GACD;IACA,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,mEAAmE;IACnE,SAAS,EAAE,QAAQ,EAAE,CAAC;CACrB,CAAC;AAEL,MAAM,MAAM,cAAc,GAAG,CAC5B,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAC7B,IAAI,CAAC,EAAE,WAAW,KACd,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEvB,
|
|
1
|
+
{"version":3,"file":"transport-types.d.ts","sourceRoot":"","sources":["../../src/transport/transport-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAE5F;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE/D,MAAM,MAAM,WAAW,GAC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