@rasputin-ai/browser 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +111 -0
- package/dist/browser-frames.d.ts +11 -0
- package/dist/browser-frames.d.ts.map +1 -0
- package/dist/browser-ingest-event.d.ts +10 -0
- package/dist/browser-ingest-event.d.ts.map +1 -0
- package/dist/browser-recorder.d.ts +36 -0
- package/dist/browser-recorder.d.ts.map +1 -0
- package/dist/browser-runtime-types.d.ts +207 -0
- package/dist/browser-runtime-types.d.ts.map +1 -0
- package/dist/browser-runtime.d.ts +14 -0
- package/dist/browser-runtime.d.ts.map +1 -0
- package/dist/browser-transport.d.ts +36 -0
- package/dist/browser-transport.d.ts.map +1 -0
- package/dist/captured-value.d.ts +48 -0
- package/dist/captured-value.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3706 -0
- package/dist/ingest-types.d.ts +75 -0
- package/dist/ingest-types.d.ts.map +1 -0
- package/dist/install-browser-handlers.d.ts +14 -0
- package/dist/install-browser-handlers.d.ts.map +1 -0
- package/dist/install-browser-runtime.d.ts +11 -0
- package/dist/install-browser-runtime.d.ts.map +1 -0
- package/dist/map-runtime-state.d.ts +4 -0
- package/dist/map-runtime-state.d.ts.map +1 -0
- package/dist/native-json-producer.d.ts +40 -0
- package/dist/native-json-producer.d.ts.map +1 -0
- package/dist/public-types.d.ts +116 -0
- package/dist/public-types.d.ts.map +1 -0
- package/dist/rasputin-init.d.ts +7 -0
- package/dist/rasputin-init.d.ts.map +1 -0
- package/dist/sdk-meta.d.ts +4 -0
- package/dist/sdk-meta.d.ts.map +1 -0
- package/dist/stack/fold-synthetic-frames.d.ts +9 -0
- package/dist/stack/fold-synthetic-frames.d.ts.map +1 -0
- package/dist/stack/parse-stack.d.ts +3 -0
- package/dist/stack/parse-stack.d.ts.map +1 -0
- package/dist/stack/raw-frame.d.ts +7 -0
- package/dist/stack/raw-frame.d.ts.map +1 -0
- package/dist/vite/artifacts.d.ts +102 -0
- package/dist/vite/artifacts.d.ts.map +1 -0
- package/dist/vite/index.d.ts +3 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +4666 -0
- package/dist/vite/plugin.d.ts +48 -0
- package/dist/vite/plugin.d.ts.map +1 -0
- package/dist/vite/resolve-build-identity.d.ts +8 -0
- package/dist/vite/resolve-build-identity.d.ts.map +1 -0
- package/dist/vite/upload-browser-artifacts.d.ts +10 -0
- package/dist/vite/upload-browser-artifacts.d.ts.map +1 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Official Rasputin AI SDK for browsers
|
|
2
|
+
|
|
3
|
+
Report application errors to Rasputin from frontend apps.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
Initialize once when the application starts:
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { RasputinInit } from '@rasputin-ai/browser';
|
|
11
|
+
|
|
12
|
+
export const rasputin = RasputinInit({
|
|
13
|
+
dsn: import.meta.env.VITE_RASPUTIN_DSN,
|
|
14
|
+
environment: 'production',
|
|
15
|
+
release: import.meta.env.VITE_RASPUTIN_RELEASE,
|
|
16
|
+
});
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The DSN is public and ingest-only. Do not put a project API key in frontend code.
|
|
20
|
+
|
|
21
|
+
`release` and `environment` are required on `RasputinInit` and on the Vite plugin. Blank or whitespace values leave the SDK fully inert. The plugin injects the values you pass into `RasputinInit`. It does not invent a release.
|
|
22
|
+
|
|
23
|
+
## Vite plugin
|
|
24
|
+
|
|
25
|
+
Use the plugin to instrument the app and inject the DSN at build time:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { rasputin } from '@rasputin-ai/browser/vite';
|
|
29
|
+
import { defineConfig } from 'vite';
|
|
30
|
+
|
|
31
|
+
export default defineConfig({
|
|
32
|
+
plugins: [
|
|
33
|
+
rasputin({
|
|
34
|
+
dsn: process.env.VITE_RASPUTIN_DSN,
|
|
35
|
+
environment: 'production',
|
|
36
|
+
release: process.env.RASPUTIN_RELEASE!,
|
|
37
|
+
projectApiKey: process.env.RASPUTIN_PROJECT_API_KEY,
|
|
38
|
+
}),
|
|
39
|
+
],
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`projectApiKey` is used by the plugin to upload the BrowserArtifact after `vite build`. It is never written into the browser bundle and is not used during `vite dev`.
|
|
44
|
+
|
|
45
|
+
## Release and build identity
|
|
46
|
+
|
|
47
|
+
These are different values. You normally do not configure `buildId`.
|
|
48
|
+
|
|
49
|
+
**Release** is required. It is the source/deployment revision, usually a Git SHA. Pass it to the Vite plugin (and to `RasputinInit` if you boot the SDK yourself). It is used for deployment grouping and repository source lookup.
|
|
50
|
+
|
|
51
|
+
**Build ID** is generated automatically for each browser compilation (`b_<uuid>`). It namespaces compact runtime ids (`moduleIndex.planIndex`) and the uploaded BrowserArtifact. Two production builds of the same commit get two build IDs. Open tabs from an older build keep resolving against their own artifact.
|
|
52
|
+
|
|
53
|
+
`vite dev` instruments modules in memory for local debugging and HMR. It does not write `.rasputin/`, register a production build, or POST `/browserArtifacts`. A new `buildId` is minted for that dev-server process and stays stable across route navigation and HMR. Production artifact upload happens only on `vite build`.
|
|
54
|
+
|
|
55
|
+
`verifyConfiguration()` and the success log report both:
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
Release:
|
|
59
|
+
a39498e31207580763ebac2c752a82fdb30b133b
|
|
60
|
+
|
|
61
|
+
Browser build:
|
|
62
|
+
b_f37c9a1e-...
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Leave `buildId` unset. An explicit `buildId` is only for tests or advanced tooling; the caller then owns uniqueness. Do not pass a Git SHA as `buildId`.
|
|
66
|
+
|
|
67
|
+
## Diagnostics
|
|
68
|
+
|
|
69
|
+
`verifyConfiguration()` reports whether the SDK is active and why. `getStats()` returns recorder, transport, and compile counters for support and local debugging. Neither is required to send errors.
|
|
70
|
+
|
|
71
|
+
## Configuration
|
|
72
|
+
|
|
73
|
+
| Field | Required | Description |
|
|
74
|
+
| --- | --- | --- |
|
|
75
|
+
| `dsn` | yes | Public project DSN from Rasputin project settings |
|
|
76
|
+
| `environment` | yes | Environment such as `production` or `staging`. Required on the Vite plugin; injected into `RasputinInit`. |
|
|
77
|
+
| `release` | yes | Source/deployment revision. Required on the Vite plugin; injected into `RasputinInit`. |
|
|
78
|
+
| `enabled` | no | Enables or disables the SDK; defaults to `true` |
|
|
79
|
+
| `logSuccess` | no | Prints a configuration summary when setup succeeds; defaults to `true` |
|
|
80
|
+
| `apiUrl` | no | Override the API origin from the DSN. Leave unset unless you self-host. |
|
|
81
|
+
| `installGlobalHandlers` | no | Observe `window` `error` and `unhandledrejection`. Defaults to `true`. |
|
|
82
|
+
|
|
83
|
+
A missing, blank, or invalid DSN, release, or environment leaves the SDK fully inert.
|
|
84
|
+
|
|
85
|
+
## Privacy
|
|
86
|
+
|
|
87
|
+
Browser capture is name-based and bounded. It is not a generic secret scanner.
|
|
88
|
+
|
|
89
|
+
Automatically omitted or redacted:
|
|
90
|
+
|
|
91
|
+
- Function parameters whose names match known sensitive keys, including `password`, `token`, `authorization`, `cookie`, `apiKey`, `secret`, and `databaseUrl`. Redaction happens at compile time. The recorder never reads that binding.
|
|
92
|
+
- Static property paths with those same names, such as `user.password` or `headers.authorization`.
|
|
93
|
+
- DOM and form surfaces: `input.value`, `textarea.value`, `textContent`, `innerText`, `innerHTML`. Any terminal `.value` read is left unobserved, including non-DOM objects such as `error.value`. Nested reads like `error.value.message` are still observed.
|
|
94
|
+
- Query-bearing URL surfaces: `location.href`, `location.search`, `document.URL`.
|
|
95
|
+
|
|
96
|
+
Still captured under normal rules:
|
|
97
|
+
|
|
98
|
+
- Ordinary primitives and safe parameter names, including a parameter named `value`.
|
|
99
|
+
- Safe property reads such as `user.email`.
|
|
100
|
+
- Ordinary strings. `const note = "my password is hunter2"` is stored as that string.
|
|
101
|
+
- Current own data properties of verified JSON and compiler-known ordinary objects. Accessors are not invoked. Names, emails, addresses, wallet addresses, and similar strings may appear unless the property name matches the sensitive-name policy.
|
|
102
|
+
|
|
103
|
+
Not scanned or intercepted:
|
|
104
|
+
|
|
105
|
+
- Unknown, Proxy, and reactive objects. Those stay opaque.
|
|
106
|
+
- String contents for embedded secrets.
|
|
107
|
+
- Network request or response bodies.
|
|
108
|
+
- The DOM tree or keystrokes.
|
|
109
|
+
- Extra getter, Proxy, or coercion reads beyond the application's own expression.
|
|
110
|
+
|
|
111
|
+
Custom browser `redactKeys` are not supported. Use a non-sensitive parameter name if a value must stay out of recordings, or keep it off a captured primitive argument. A full URL passed as a string argument named `url` is still captured.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type BrowserFrame = {
|
|
2
|
+
generated: {
|
|
3
|
+
file: string;
|
|
4
|
+
line?: number;
|
|
5
|
+
column?: number;
|
|
6
|
+
};
|
|
7
|
+
function?: string;
|
|
8
|
+
in_app: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const framesFromError: (error: unknown) => BrowserFrame[];
|
|
11
|
+
//# sourceMappingURL=browser-frames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-frames.d.ts","sourceRoot":"","sources":["../src/browser-frames.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,YAAY,GAAG;IAC1B,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,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CAChB,CAAC;AAeF,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,KAAG,YAAY,EAO5D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BrowserFrame } from './browser-frames';
|
|
2
|
+
import type { BrowserIngestEvent, BrowserIngestRuntimeState } from './ingest-types';
|
|
3
|
+
export declare const createBrowserIngestEvent: (input: {
|
|
4
|
+
error: unknown;
|
|
5
|
+
frames: BrowserFrame[];
|
|
6
|
+
environment: string;
|
|
7
|
+
release: string;
|
|
8
|
+
runtimeState?: BrowserIngestRuntimeState;
|
|
9
|
+
}) => BrowserIngestEvent;
|
|
10
|
+
//# sourceMappingURL=browser-ingest-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-ingest-event.d.ts","sourceRoot":"","sources":["../src/browser-ingest-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AA6BpF,eAAO,MAAM,wBAAwB,GAAI,OAAO;IAC/C,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,yBAAyB,CAAC;CACzC,KAAG,kBA2BH,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser execution recorder.
|
|
3
|
+
*
|
|
4
|
+
* Owns the frame carrier, settling, observe, reactive-sparse, history, and
|
|
5
|
+
* opaque capture. It does not use AsyncLocalStorage or the Node freezer.
|
|
6
|
+
*/
|
|
7
|
+
import type { EncodedFunctionPlan } from '@rasputin-ai/recorder/runtime';
|
|
8
|
+
import type { BrowserInitOptions, BrowserRuntimeState, CallHandle, CaptureClass, ExecutionSnapshot, HistoryRecord } from './browser-runtime-types';
|
|
9
|
+
export declare const createBrowserRecorder: (options?: BrowserInitOptions) => {
|
|
10
|
+
enter: (moduleIndex: number, planIndex: number, args?: ArrayLike<unknown>, omitValues?: boolean, plan?: EncodedFunctionPlan, callee?: object) => CallHandle;
|
|
11
|
+
registerIdentities: (items: Array<{
|
|
12
|
+
compactId: string;
|
|
13
|
+
functionId: string;
|
|
14
|
+
name: string;
|
|
15
|
+
captureClass: CaptureClass;
|
|
16
|
+
packageRelativePath?: string | null;
|
|
17
|
+
line: number | null;
|
|
18
|
+
column: number | null;
|
|
19
|
+
siteId?: number;
|
|
20
|
+
moduleIndex?: number;
|
|
21
|
+
planIndex?: number;
|
|
22
|
+
}>) => void;
|
|
23
|
+
observe: (siteId: string | number, value: unknown) => unknown;
|
|
24
|
+
reactiveRegister: (entries: unknown) => void;
|
|
25
|
+
reactiveHit: (id: number) => boolean;
|
|
26
|
+
reactiveLeave: (id: number, value?: unknown) => unknown;
|
|
27
|
+
reactiveThrow: (id: number, error: unknown) => void;
|
|
28
|
+
reactiveDone: () => void;
|
|
29
|
+
noteStateWrite: (key: string, value: unknown) => void;
|
|
30
|
+
noteStateRead: (key: string, value: unknown) => void;
|
|
31
|
+
getHistory: () => HistoryRecord[];
|
|
32
|
+
getErrorState(error: unknown): ExecutionSnapshot | undefined;
|
|
33
|
+
getState(): BrowserRuntimeState;
|
|
34
|
+
reset(): void;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=browser-recorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-recorder.d.ts","sourceRoot":"","sources":["../src/browser-recorder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,KAAK,EACX,kBAAkB,EAElB,mBAAmB,EACnB,UAAU,EACV,YAAY,EAIZ,iBAAiB,EAIjB,aAAa,EAKb,MAAM,yBAAyB,CAAC;AAsNjC,eAAO,MAAM,qBAAqB,GAAI,UAAS,kBAAuB;yBA+jCvD,MAAM,aACR,MAAM,SACV,SAAS,CAAC,OAAO,CAAC,eACZ,OAAO,SACb,mBAAmB,WACjB,MAAM,KACb,UAAU;gCA/9BL,KAAK,CAAC;QACZ,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,YAAY,CAAC;QAC3B,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACpC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;sBA49BsB,MAAM,GAAG,MAAM,SAAS,OAAO;gCA4DrB,OAAO;sBAkCjB,MAAM,KAAG,OAAO;wBAgDd,MAAM,UAAU,OAAO;wBAcvB,MAAM,SAAS,OAAO;;0BAnrBpB,MAAM,SAAS,OAAO;yBAgBvB,MAAM,SAAS,OAAO;;yBA+uB5B,OAAO,GAAG,iBAAiB,GAAG,SAAS;gBAQhD,mBAAmB;;CAgChC,CAAC"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser recorder wire and snapshot vocabulary.
|
|
3
|
+
*
|
|
4
|
+
* Interaction, detached, provenance, expression_observed, and reactive
|
|
5
|
+
* stats stay here. Node does not import this file.
|
|
6
|
+
*/
|
|
7
|
+
import type { CapturedValue } from './captured-value';
|
|
8
|
+
export type CaptureMode = 'structure' | 'values';
|
|
9
|
+
export type CaptureProfile = 'normal' | 'values-off' | 'helpers-sparse';
|
|
10
|
+
export type RecorderCostProfile = {
|
|
11
|
+
enterMs: number;
|
|
12
|
+
leaveEndMs: number;
|
|
13
|
+
journalMs: number;
|
|
14
|
+
resolveMs: number;
|
|
15
|
+
handleAllocMs: number;
|
|
16
|
+
structureMs: number;
|
|
17
|
+
suppressMs: number;
|
|
18
|
+
observeMs: number;
|
|
19
|
+
captureMs: number;
|
|
20
|
+
historyMs: number;
|
|
21
|
+
statsMs: number;
|
|
22
|
+
entersFull: number;
|
|
23
|
+
entersStructure: number;
|
|
24
|
+
entersSkip: number;
|
|
25
|
+
entersSparse: number;
|
|
26
|
+
observeCalls: number;
|
|
27
|
+
reactiveHitMs: number;
|
|
28
|
+
reactiveRepeats: number;
|
|
29
|
+
};
|
|
30
|
+
export type CaptureClass = 'full' | 'structure' | 'skip' | 'reactive-sparse';
|
|
31
|
+
export type Provenance = 'observed' | 'inferred' | 'inferred-ambiguous' | 'unlinked';
|
|
32
|
+
export type ExecutionKind = 'interaction' | 'detached';
|
|
33
|
+
export type FunctionIdentity = {
|
|
34
|
+
functionId: string;
|
|
35
|
+
name: string;
|
|
36
|
+
packageName: string | null;
|
|
37
|
+
packageRelativePath: string | null;
|
|
38
|
+
line: number | null;
|
|
39
|
+
column: number | null;
|
|
40
|
+
captureClass: CaptureClass;
|
|
41
|
+
moduleIndex?: number;
|
|
42
|
+
planIndex?: number;
|
|
43
|
+
};
|
|
44
|
+
export type BrowserIdentityRecord = {
|
|
45
|
+
compactId: string;
|
|
46
|
+
functionId: string;
|
|
47
|
+
name: string;
|
|
48
|
+
captureClass: CaptureClass;
|
|
49
|
+
packageRelativePath?: string | null;
|
|
50
|
+
line: number | null;
|
|
51
|
+
column: number | null;
|
|
52
|
+
siteId?: number;
|
|
53
|
+
moduleIndex?: number;
|
|
54
|
+
planIndex?: number;
|
|
55
|
+
};
|
|
56
|
+
export type BrowserInitOptions = {
|
|
57
|
+
settlingMs?: number;
|
|
58
|
+
holdMs?: number;
|
|
59
|
+
captureMode?: CaptureMode;
|
|
60
|
+
identities?: BrowserIdentityRecord[];
|
|
61
|
+
maxStructuralEvents?: number;
|
|
62
|
+
maxValueEvents?: number;
|
|
63
|
+
maxCapturedCallsPerFunction?: number;
|
|
64
|
+
maxRecentExecutions?: number;
|
|
65
|
+
maxRetainedSnapshots?: number;
|
|
66
|
+
maxHistory?: number;
|
|
67
|
+
maxOpenExecutions?: number;
|
|
68
|
+
profileCosts?: boolean;
|
|
69
|
+
};
|
|
70
|
+
export type FunctionEnterEvent = {
|
|
71
|
+
type: 'function_enter';
|
|
72
|
+
callId: number;
|
|
73
|
+
functionId: string;
|
|
74
|
+
parentCallId?: number;
|
|
75
|
+
timestampMs: number;
|
|
76
|
+
provenance: Provenance;
|
|
77
|
+
args?: CapturedValue[];
|
|
78
|
+
argsOmitted?: true;
|
|
79
|
+
materialized?: 'throw-time';
|
|
80
|
+
};
|
|
81
|
+
export type FunctionExitEvent = {
|
|
82
|
+
type: 'function_exit';
|
|
83
|
+
callId: number;
|
|
84
|
+
timestampMs: number;
|
|
85
|
+
returnValue?: CapturedValue;
|
|
86
|
+
};
|
|
87
|
+
export type FunctionThrowEvent = {
|
|
88
|
+
type: 'function_throw';
|
|
89
|
+
callId: number;
|
|
90
|
+
timestampMs: number;
|
|
91
|
+
errorName?: string;
|
|
92
|
+
errorMessage?: string;
|
|
93
|
+
priorSuccessfulRuns?: number;
|
|
94
|
+
error?: {
|
|
95
|
+
__rasputin_type: 'ErrorReference';
|
|
96
|
+
callId: number;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
export type AwaitedEvent = {
|
|
100
|
+
type: 'awaited';
|
|
101
|
+
callId: number;
|
|
102
|
+
timestampMs: number;
|
|
103
|
+
value?: CapturedValue;
|
|
104
|
+
omitted?: true;
|
|
105
|
+
};
|
|
106
|
+
export type CallsSuppressedEvent = {
|
|
107
|
+
type: 'function_calls_suppressed';
|
|
108
|
+
functionId: string;
|
|
109
|
+
parentCallId?: number;
|
|
110
|
+
timestampMs: number;
|
|
111
|
+
suppressedCallCount: number;
|
|
112
|
+
};
|
|
113
|
+
export type ExpressionObservedEvent = {
|
|
114
|
+
type: 'expression_observed';
|
|
115
|
+
siteId: string | number;
|
|
116
|
+
callId?: number;
|
|
117
|
+
timestampMs: number;
|
|
118
|
+
value: CapturedValue;
|
|
119
|
+
};
|
|
120
|
+
export type StateFact = {
|
|
121
|
+
key: string;
|
|
122
|
+
value: CapturedValue;
|
|
123
|
+
timestampMs: number;
|
|
124
|
+
functionName?: string;
|
|
125
|
+
};
|
|
126
|
+
export type HistoryRelationship = 'observed-write' | 'last-observed-write' | 'inferred';
|
|
127
|
+
export type HistoryLink = {
|
|
128
|
+
executionId: string;
|
|
129
|
+
relationship: HistoryRelationship;
|
|
130
|
+
key?: string;
|
|
131
|
+
};
|
|
132
|
+
export type HistoryRecord = {
|
|
133
|
+
executionId: string;
|
|
134
|
+
kind: ExecutionKind;
|
|
135
|
+
eventType?: string;
|
|
136
|
+
startedAt: number;
|
|
137
|
+
durationMs: number;
|
|
138
|
+
functionNames: string[];
|
|
139
|
+
writes: StateFact[];
|
|
140
|
+
};
|
|
141
|
+
export type RecorderEvent = FunctionEnterEvent | FunctionExitEvent | FunctionThrowEvent | AwaitedEvent | CallsSuppressedEvent | ExpressionObservedEvent;
|
|
142
|
+
export type ExecutionSnapshot = {
|
|
143
|
+
executionId: string;
|
|
144
|
+
kind: ExecutionKind;
|
|
145
|
+
eventType?: string;
|
|
146
|
+
startedAt: number;
|
|
147
|
+
/** Wall-clock start, only when the recorder stored Date.now() at create. */
|
|
148
|
+
startedAtIso?: string;
|
|
149
|
+
durationMs: number;
|
|
150
|
+
provenanceNotes: string[];
|
|
151
|
+
functions: FunctionIdentity[];
|
|
152
|
+
events: RecorderEvent[];
|
|
153
|
+
captureMode: CaptureMode;
|
|
154
|
+
writes: StateFact[];
|
|
155
|
+
reads: StateFact[];
|
|
156
|
+
historyLinks: HistoryLink[];
|
|
157
|
+
partial?: boolean;
|
|
158
|
+
captureProfile?: CaptureProfile;
|
|
159
|
+
};
|
|
160
|
+
export type ExecutionSummary = {
|
|
161
|
+
executionId: string;
|
|
162
|
+
kind: ExecutionKind;
|
|
163
|
+
eventType?: string;
|
|
164
|
+
functionNames: string[];
|
|
165
|
+
durationMs: number;
|
|
166
|
+
hadError: boolean;
|
|
167
|
+
};
|
|
168
|
+
export type BrowserRecorderStats = {
|
|
169
|
+
functionCallsObserved: number;
|
|
170
|
+
functionCallsCaptured: number;
|
|
171
|
+
successfulExecutionsDiscarded: number;
|
|
172
|
+
errorSnapshots: number;
|
|
173
|
+
activeExecutions: number;
|
|
174
|
+
peakActiveExecutions: number;
|
|
175
|
+
activeEstimatedBytes: number;
|
|
176
|
+
peakActiveEstimatedBytes: number;
|
|
177
|
+
attributionInferred: number;
|
|
178
|
+
attributionInferredAmbiguous: number;
|
|
179
|
+
attributionUnlinked: number;
|
|
180
|
+
truncatedEvents: number;
|
|
181
|
+
truncatedStructural: number;
|
|
182
|
+
omittedValueObservations: number;
|
|
183
|
+
expressionObservations: number;
|
|
184
|
+
repeatedCallsSuppressed: number;
|
|
185
|
+
executionsDroppedUnderPressure: number;
|
|
186
|
+
reactiveCallbackInvocations: number;
|
|
187
|
+
reactiveRecordedEntries: number;
|
|
188
|
+
reactiveSparseCounted: number;
|
|
189
|
+
reactiveThrows: number;
|
|
190
|
+
costs?: RecorderCostProfile;
|
|
191
|
+
};
|
|
192
|
+
export type BrowserRuntimeState = {
|
|
193
|
+
open: ExecutionSummary[];
|
|
194
|
+
recent: ExecutionSummary[];
|
|
195
|
+
snapshots: ExecutionSnapshot[];
|
|
196
|
+
history: HistoryRecord[];
|
|
197
|
+
stats: BrowserRecorderStats;
|
|
198
|
+
};
|
|
199
|
+
export type CallHandle = {
|
|
200
|
+
leave: (value?: unknown) => unknown;
|
|
201
|
+
fail: (error: unknown, liveArgs?: ArrayLike<unknown>) => void;
|
|
202
|
+
end: () => void;
|
|
203
|
+
run: <T>(callback: () => T) => T;
|
|
204
|
+
suspend: (value?: unknown) => unknown;
|
|
205
|
+
resume: (...restored: unknown[]) => unknown;
|
|
206
|
+
};
|
|
207
|
+
//# sourceMappingURL=browser-runtime-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-runtime-types.d.ts","sourceRoot":"","sources":["../src/browser-runtime-types.ts"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;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,KAAK,EAAE,oBAAoB,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACxB,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;IACpC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC9D,GAAG,EAAE,MAAM,IAAI,CAAC;IAChB,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IACjC,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;IACtC,MAAM,EAAE,CAAC,GAAG,QAAQ,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;CAC5C,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BrowserInitOptions, BrowserRuntimeState, ExecutionSnapshot, HistoryRecord } from './browser-runtime-types';
|
|
2
|
+
export declare const RasputinBrowserInit: (options?: BrowserInitOptions) => {
|
|
3
|
+
getState: () => BrowserRuntimeState;
|
|
4
|
+
getErrorState: (error: unknown) => ExecutionSnapshot | undefined;
|
|
5
|
+
getHistory: () => HistoryRecord[];
|
|
6
|
+
};
|
|
7
|
+
export declare const getBrowserRuntimeState: () => BrowserRuntimeState;
|
|
8
|
+
export declare const getBrowserErrorState: (error: unknown) => ExecutionSnapshot | undefined;
|
|
9
|
+
export declare const resetBrowserRuntime: () => void;
|
|
10
|
+
export declare const registerBrowserIdentities: (items: NonNullable<BrowserInitOptions["identities"]>) => void;
|
|
11
|
+
export declare const getBrowserHistory: () => HistoryRecord[];
|
|
12
|
+
export declare const uninstallBrowserRuntime: () => void;
|
|
13
|
+
export declare const browserRuntimeIsInstalled: () => boolean;
|
|
14
|
+
//# sourceMappingURL=browser-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-runtime.d.ts","sourceRoot":"","sources":["../src/browser-runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,MAAM,yBAAyB,CAAC;AAkIjC,eAAO,MAAM,mBAAmB,GAAI,UAAS,kBAAuB;;;;CAwDnE,CAAC;AAEF,eAAO,MAAM,sBAAsB,QAAO,mBA6BxC,CAAC;AAEH,eAAO,MAAM,oBAAoB,GAAI,OAAO,OAAO,KAAG,iBAAiB,GAAG,SAC1C,CAAC;AAEjC,eAAO,MAAM,mBAAmB,YAE/B,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,OAAO,WAAW,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC,SAG7F,CAAC;AAIF,eAAO,MAAM,iBAAiB,QAAO,aAAa,EAAmC,CAAC;AAEtF,eAAO,MAAM,uBAAuB,YAQnC,CAAC;AAEF,eAAO,MAAM,yBAAyB,QAAO,OAAkC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser ingest transport.
|
|
3
|
+
*
|
|
4
|
+
* Bounded queue and page-lifecycle flush. Large snapshots must not block
|
|
5
|
+
* navigation; losing telemetry is preferred over delaying unload.
|
|
6
|
+
*/
|
|
7
|
+
import type { IngestSummary } from '@rasputin-ai/core';
|
|
8
|
+
import type { BrowserIngestEvent } from './ingest-types';
|
|
9
|
+
import type { RasputinBrowserTransportStats } from './public-types';
|
|
10
|
+
type BrowserTransportFetch = (input: string, init?: RequestInit) => Promise<{
|
|
11
|
+
status: number;
|
|
12
|
+
ok: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
type CreateBrowserTransportOptions = {
|
|
15
|
+
ingestUrl: string;
|
|
16
|
+
publicKey: string;
|
|
17
|
+
sdkName: string;
|
|
18
|
+
sdkVersion: string;
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
fetch?: BrowserTransportFetch;
|
|
21
|
+
beforeFlush?: () => void;
|
|
22
|
+
maxQueueSize?: number;
|
|
23
|
+
maxQueueBytes?: number;
|
|
24
|
+
batchSize?: number;
|
|
25
|
+
flushIntervalMs?: number;
|
|
26
|
+
maxRetries?: number;
|
|
27
|
+
};
|
|
28
|
+
export declare const createBrowserTransport: (options: CreateBrowserTransportOptions) => {
|
|
29
|
+
enqueue: (event: BrowserIngestEvent) => void;
|
|
30
|
+
enqueueSummary: (summary: IngestSummary) => void;
|
|
31
|
+
flush: (_timeoutMs?: number) => Promise<void>;
|
|
32
|
+
close: () => Promise<void>;
|
|
33
|
+
getStats: () => RasputinBrowserTransportStats;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=browser-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-transport.d.ts","sourceRoot":"","sources":["../src/browser-transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAEpE,KAAK,qBAAqB,GAAG,CAC5B,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,WAAW,KACd,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAQ9C,KAAK,6BAA6B,GAAG;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,qBAAqB,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAkDF,eAAO,MAAM,sBAAsB,GAAI,SAAS,6BAA6B;qBAwDpD,kBAAkB;8BAIT,aAAa;yBA+OlB,MAAM;;oBAoBnB,6BAA6B;CAoB5C,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export type CapturedValue = {
|
|
2
|
+
kind: 'primitive';
|
|
3
|
+
value: string | number | boolean;
|
|
4
|
+
originalLength?: number;
|
|
5
|
+
truncated?: true;
|
|
6
|
+
reason?: 'max_string_length';
|
|
7
|
+
} | {
|
|
8
|
+
kind: 'null';
|
|
9
|
+
} | {
|
|
10
|
+
kind: 'undefined';
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'hole';
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'bigint';
|
|
15
|
+
value: string;
|
|
16
|
+
} | {
|
|
17
|
+
kind: 'opaque';
|
|
18
|
+
jsType: string;
|
|
19
|
+
array?: boolean;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'accessor';
|
|
22
|
+
} | {
|
|
23
|
+
kind: 'circular';
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'shared';
|
|
26
|
+
} | {
|
|
27
|
+
kind: 'struct';
|
|
28
|
+
array?: boolean;
|
|
29
|
+
entries: {
|
|
30
|
+
key: string;
|
|
31
|
+
value: CapturedValue;
|
|
32
|
+
}[];
|
|
33
|
+
truncated?: true;
|
|
34
|
+
reason?: 'max_keys' | 'max_depth' | 'max_nodes' | 'max_bytes' | 'wide_object' | 'omitted_symbols' | 'omitted_extra_keys';
|
|
35
|
+
} | {
|
|
36
|
+
kind: 'redacted';
|
|
37
|
+
};
|
|
38
|
+
export declare const MAX_BROWSER_STRING_LENGTH = 500;
|
|
39
|
+
export declare const MAX_ORDINARY_ARRAY_ELEMENTS = 20;
|
|
40
|
+
export declare const MAX_OWN_KEYS_ENUMERATION = 256;
|
|
41
|
+
export declare const tagVerifiedOrdinary: (object: unknown) => unknown;
|
|
42
|
+
export declare const isVerifiedOrdinary: (object: unknown) => boolean;
|
|
43
|
+
export declare const rememberKnownLiteral: (object: unknown, _keys?: unknown, _values?: unknown) => unknown;
|
|
44
|
+
export declare const passthroughKnownLiteral: (object: unknown) => unknown;
|
|
45
|
+
export declare const tagJsonParseResult: (value: unknown) => unknown;
|
|
46
|
+
export declare const captureValue: (value: unknown) => CapturedValue;
|
|
47
|
+
export declare const estimateCapturedBytes: (value: CapturedValue) => number;
|
|
48
|
+
//# sourceMappingURL=captured-value.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captured-value.d.ts","sourceRoot":"","sources":["../src/captured-value.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,aAAa,GACtB;IACA,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC5B,GACD;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAA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ientStats, RasputinBrowserConfiguration, RasputinBrowserInstrumentationStats, RasputinBrowserOptions, RasputinBrowserRecorderStats, RasputinBrowserTransportStats, } from './public-types';
|
|
2
|
+
export { RasputinInit } from './rasputin-init';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACX,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,mCAAmC,EACnC,sBAAsB,EACtB,4BAA4B,EAC5B,6BAA6B,GAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|