@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.
Files changed (52) hide show
  1. package/README.md +111 -0
  2. package/dist/browser-frames.d.ts +11 -0
  3. package/dist/browser-frames.d.ts.map +1 -0
  4. package/dist/browser-ingest-event.d.ts +10 -0
  5. package/dist/browser-ingest-event.d.ts.map +1 -0
  6. package/dist/browser-recorder.d.ts +36 -0
  7. package/dist/browser-recorder.d.ts.map +1 -0
  8. package/dist/browser-runtime-types.d.ts +207 -0
  9. package/dist/browser-runtime-types.d.ts.map +1 -0
  10. package/dist/browser-runtime.d.ts +14 -0
  11. package/dist/browser-runtime.d.ts.map +1 -0
  12. package/dist/browser-transport.d.ts +36 -0
  13. package/dist/browser-transport.d.ts.map +1 -0
  14. package/dist/captured-value.d.ts +48 -0
  15. package/dist/captured-value.d.ts.map +1 -0
  16. package/dist/index.d.ts +3 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +3706 -0
  19. package/dist/ingest-types.d.ts +75 -0
  20. package/dist/ingest-types.d.ts.map +1 -0
  21. package/dist/install-browser-handlers.d.ts +14 -0
  22. package/dist/install-browser-handlers.d.ts.map +1 -0
  23. package/dist/install-browser-runtime.d.ts +11 -0
  24. package/dist/install-browser-runtime.d.ts.map +1 -0
  25. package/dist/map-runtime-state.d.ts +4 -0
  26. package/dist/map-runtime-state.d.ts.map +1 -0
  27. package/dist/native-json-producer.d.ts +40 -0
  28. package/dist/native-json-producer.d.ts.map +1 -0
  29. package/dist/public-types.d.ts +116 -0
  30. package/dist/public-types.d.ts.map +1 -0
  31. package/dist/rasputin-init.d.ts +7 -0
  32. package/dist/rasputin-init.d.ts.map +1 -0
  33. package/dist/sdk-meta.d.ts +4 -0
  34. package/dist/sdk-meta.d.ts.map +1 -0
  35. package/dist/stack/fold-synthetic-frames.d.ts +9 -0
  36. package/dist/stack/fold-synthetic-frames.d.ts.map +1 -0
  37. package/dist/stack/parse-stack.d.ts +3 -0
  38. package/dist/stack/parse-stack.d.ts.map +1 -0
  39. package/dist/stack/raw-frame.d.ts +7 -0
  40. package/dist/stack/raw-frame.d.ts.map +1 -0
  41. package/dist/vite/artifacts.d.ts +102 -0
  42. package/dist/vite/artifacts.d.ts.map +1 -0
  43. package/dist/vite/index.d.ts +3 -0
  44. package/dist/vite/index.d.ts.map +1 -0
  45. package/dist/vite/index.js +4666 -0
  46. package/dist/vite/plugin.d.ts +48 -0
  47. package/dist/vite/plugin.d.ts.map +1 -0
  48. package/dist/vite/resolve-build-identity.d.ts +8 -0
  49. package/dist/vite/resolve-build-identity.d.ts.map +1 -0
  50. package/dist/vite/upload-browser-artifacts.d.ts +10 -0
  51. package/dist/vite/upload-browser-artifacts.d.ts.map +1 -0
  52. package/package.json +49 -0
@@ -0,0 +1,75 @@
1
+ export type BrowserIngestEvent = {
2
+ type: string;
3
+ message: string;
4
+ stack_frames: Array<{
5
+ filename: string;
6
+ function?: string;
7
+ lineno?: number;
8
+ colno?: number;
9
+ in_app: boolean;
10
+ }>;
11
+ code?: string | null;
12
+ occurred_at: string;
13
+ environment: string;
14
+ origin: 'client';
15
+ resolution?: 'exact' | 'partial' | 'none';
16
+ /** Source/deployment revision, usually a Git SHA. Not the compilation identity. */
17
+ release: string;
18
+ runtime_state?: BrowserIngestRuntimeState;
19
+ };
20
+ export type BrowserIngestRuntimeState = {
21
+ version: 4;
22
+ captureProfile: {
23
+ source: 'automatic' | 'manual' | 'scope-only';
24
+ functionBoundaries: 'full' | 'partial' | 'none';
25
+ functionValues: 'full' | 'selective' | 'none';
26
+ timings: 'full' | 'partial' | 'none';
27
+ };
28
+ executionId: string;
29
+ startedAt?: string;
30
+ durationMs?: number;
31
+ execution: {
32
+ kind: 'interaction' | 'detached' | 'http' | 'serverless' | 'job' | 'scheduled' | 'custom';
33
+ name?: string;
34
+ eventType?: string;
35
+ };
36
+ functions: Array<{
37
+ functionId: string;
38
+ name: string;
39
+ source?: {
40
+ packageRelativePath: string;
41
+ packageName?: string;
42
+ line?: number;
43
+ column?: number;
44
+ };
45
+ moduleIndex?: number;
46
+ planIndex?: number;
47
+ siteIndex?: number;
48
+ }>;
49
+ events: Array<Record<string, unknown> & {
50
+ type: string;
51
+ }>;
52
+ truncated?: {
53
+ eventsDropped: number;
54
+ };
55
+ capture?: {
56
+ completeness: 'partial' | 'unavailable';
57
+ reason: string;
58
+ valuesDropped?: number;
59
+ eventsDropped?: number;
60
+ };
61
+ /** Exact browser compilation identity. Namespace for compact moduleIndex.planIndex. */
62
+ buildId?: string;
63
+ historyLinks?: Array<{
64
+ executionId: string;
65
+ relationship: 'observed-write' | 'last-observed-write' | 'inferred';
66
+ key?: string;
67
+ }>;
68
+ notes?: string[];
69
+ browser?: {
70
+ /** Same compilation identity as runtime_state.buildId. */
71
+ buildId?: string;
72
+ degradation?: 'normal' | 'values-off' | 'helpers-sparse';
73
+ };
74
+ };
75
+ //# sourceMappingURL=ingest-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ingest-types.d.ts","sourceRoot":"","sources":["../src/ingest-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,KAAK,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,OAAO,CAAC;KAChB,CAAC,CAAC;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,QAAQ,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IAC1C,mFAAmF;I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QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,OAAO,CAAC,EAAE;QACT,YAAY,EAAE,SAAS,GAAG,aAAa,CAAC;QACxC,MAAM,EAAE,MAAM,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,aAAa,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,uFAAuF;IACvF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,KAAK,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,gBAAgB,GAAG,qBAAqB,GAAG,UAAU,CAAC;QACpE,GAAG,CAAC,EAAE,MAAM,CAAC;KACb,CAAC,CAAC;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE;QACT,0DAA0D;QAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,QAAQ,GAAG,YAAY,GAAG,gBAAgB,CAAC;KACzD,CAAC;CACF,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Observe window error channels without becoming the host error owner.
3
+ *
4
+ * The same Error can arrive through onerror, unhandledrejection, and a
5
+ * framework catch. Capture once and leave default browser behavior alone.
6
+ */
7
+ type HandlerClient = {
8
+ captureException: (error: unknown) => void;
9
+ };
10
+ export declare const shouldCaptureBrowserError: (error: unknown) => boolean;
11
+ export declare const installBrowserHandlers: (client: HandlerClient) => (() => void);
12
+ export declare const resetBrowserHandlerDedup: () => void;
13
+ export {};
14
+ //# sourceMappingURL=install-browser-handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-browser-handlers.d.ts","sourceRoot":"","sources":["../src/install-browser-handlers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,KAAK,aAAa,GAAG;IACpB,gBAAgB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3C,CAAC;AA6BF,eAAO,MAAM,yBAAyB,GAAI,OAAO,OAAO,KAAG,OAiB1D,CAAC;AAoDF,eAAO,MAAM,sBAAsB,GAAI,QAAQ,aAAa,KAAG,CAAC,MAAM,IAAI,CASzE,CAAC;AAEF,eAAO,MAAM,wBAAwB,YAGpC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Binds the shared registry to the browser recorder enter function.
3
+ *
4
+ * Module evaluation stays passthrough until this runs. It does not own
5
+ * observe or reactive globals.
6
+ */
7
+ import { type CallHandle, type EncodedFunctionPlan } from '@rasputin-ai/recorder/runtime';
8
+ type BrowserEnter = (moduleIndex: number, planIndex: number, args?: ArrayLike<unknown>, omitValues?: boolean, plan?: EncodedFunctionPlan, callee?: object) => CallHandle;
9
+ export declare const installBrowserExecutionRuntime: (enter: BrowserEnter) => (() => void);
10
+ export {};
11
+ //# sourceMappingURL=install-browser-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-browser-runtime.d.ts","sourceRoot":"","sources":["../src/install-browser-runtime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACN,KAAK,UAAU,EACf,KAAK,mBAAmB,EAGxB,MAAM,+BAA+B,CAAC;AAEvC,KAAK,YAAY,GAAG,CACnB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,EACzB,UAAU,CAAC,EAAE,OAAO,EACpB,IAAI,CAAC,EAAE,mBAAmB,EAC1B,MAAM,CAAC,EAAE,MAAM,KACX,UAAU,CAAC;AAEhB,eAAO,MAAM,8BAA8B,GAAI,OAAO,YAAY,KAAG,CAAC,MAAM,IAAI,CA4D/E,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ExecutionSnapshot } from './browser-runtime-types';
2
+ import type { BrowserIngestRuntimeState } from './ingest-types';
3
+ export declare const mapBrowserRuntimeState: (snapshot: ExecutionSnapshot, buildId?: string) => BrowserIngestRuntimeState;
4
+ //# sourceMappingURL=map-runtime-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-runtime-state.d.ts","sourceRoot":"","sources":["../src/map-runtime-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,yBAAyB,CAAC;AAChF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAkHhE,eAAO,MAAM,sBAAsB,GAClC,UAAU,iBAAiB,EAC3B,UAAU,MAAM,KACd,yBAoEF,CAAC"}
@@ -0,0 +1,40 @@
1
+ type JsonAdoptFrame = {
2
+ fn: object | undefined;
3
+ yielded: boolean;
4
+ exited: boolean;
5
+ adopted: boolean;
6
+ bound: boolean;
7
+ left: object | undefined;
8
+ asyncPromise: object | undefined;
9
+ };
10
+ export declare const jsonProducerStats: {
11
+ method: number;
12
+ await: number;
13
+ adopt: number;
14
+ handle: number;
15
+ };
16
+ export declare const invokeNativeJsonMethod: (receiver: unknown, fn: unknown, ...args: unknown[]) => unknown;
17
+ export declare const tagJsonAwaitResult: (value: unknown, promise: unknown) => unknown;
18
+ export declare const createJsonAdoptFrame: (fn?: object) => JsonAdoptFrame;
19
+ export declare const notifyJsonProducerLeave: (frame: JsonAdoptFrame, value: unknown) => unknown;
20
+ export declare const notifyJsonProducerSuspend: (frame: JsonAdoptFrame) => void;
21
+ export declare const notifyJsonProducerEnd: (frame: JsonAdoptFrame) => void;
22
+ export declare const adoptAsyncJsonPromise: (value: unknown, callee?: unknown) => unknown;
23
+ export declare const resetJsonProducerAdopt: () => void;
24
+ export declare const passthroughAdopt: (value: unknown) => unknown;
25
+ export declare const createProvenanceHandle: (fn?: unknown) => {
26
+ leave: (value: unknown) => unknown;
27
+ end: () => void;
28
+ suspend: (value: unknown) => unknown;
29
+ resume: (value?: unknown) => unknown;
30
+ };
31
+ export declare const passthroughProvenanceHandle: (_fn?: unknown) => {
32
+ leave: (value: unknown) => unknown;
33
+ end: () => void;
34
+ suspend: (value: unknown) => unknown;
35
+ resume: (value?: unknown) => unknown;
36
+ };
37
+ export declare const passthroughNativeJsonMethod: (receiver: unknown, fn: unknown, ...args: unknown[]) => unknown;
38
+ export declare const passthroughJsonAwait: (value: unknown, _promise?: unknown) => unknown;
39
+ export {};
40
+ //# sourceMappingURL=native-json-producer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-json-producer.d.ts","sourceRoot":"","sources":["../src/native-json-producer.ts"],"names":[],"mappings":"AA6BA,KAAK,cAAc,GAAG;IACrB,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC,CAAC;AAIF,eAAO,MAAM,iBAAiB;;;;;CAK7B,CAAC;AAmEF,eAAO,MAAM,sBAAsB,GAClC,UAAU,OAAO,EACjB,IAAI,OAAO,EACX,GAAG,MAAM,OAAO,EAAE,KAChB,OAIF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,EAAE,SAAS,OAAO,KAAG,OAIrE,CAAC;AAoBF,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,KAAG,cAclD,CAAC;AAwBF,eAAO,MAAM,uBAAuB,GAAI,OAAO,cAAc,EAAE,OAAO,OAAO,KAAG,OAU/E,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,OAAO,cAAc,KAAG,IAEjE,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,OAAO,cAAc,KAAG,IAI7D,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,OAAO,OAAO,EAAE,SAAS,OAAO,KAAG,OAKxE,CAAC;AAEF,eAAO,MAAM,sBAAsB,QAAO,IAMzC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,OAAO,KAAG,OAAgB,CAAC;AAEnE,eAAO,MAAM,sBAAsB,GAAI,KAAK,OAAO;mBAIlC,OAAO;;qBAIL,OAAO;qBAIP,OAAO;CAEzB,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,MAAM,OAAO;mBACzC,OAAO;;qBAEL,OAAO;qBACP,OAAO;CACvB,CAAC;AAEH,eAAO,MAAM,2BAA2B,GACvC,UAAU,OAAO,EACjB,IAAI,OAAO,EACX,GAAG,MAAM,OAAO,EAAE,KAChB,OAAwC,CAAC;AAE5C,eAAO,MAAM,oBAAoB,GAAI,OAAO,OAAO,EAAE,WAAW,OAAO,KAAG,OAAgB,CAAC"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Public browser SDK types.
3
+ *
4
+ * Capture is name-based and bounded. Sensitive parameter and property names
5
+ * are omitted or redacted. DOM values, query-bearing URLs, accessors, and
6
+ * unknown or reactive objects are not expanded. Custom redaction lists are
7
+ * not supported. Only a public project DSN belongs in page JavaScript.
8
+ */
9
+ export type RasputinBrowserOptions = {
10
+ /**
11
+ * Public project DSN. Safe to include in frontend env.
12
+ * Blank, missing, or invalid values leave the SDK fully inert.
13
+ */
14
+ dsn?: string;
15
+ /**
16
+ * Where the error happened — e.g. `production`, `staging`, `preview`.
17
+ * The Vite plugin injects this. Blank or whitespace leaves the SDK inert.
18
+ */
19
+ environment: string;
20
+ /**
21
+ * Source/deployment revision, usually a Git SHA. The Vite plugin injects
22
+ * this when omitted. Not the browser compilation identity. Blank or
23
+ * whitespace leaves the SDK inert.
24
+ */
25
+ release: string;
26
+ /**
27
+ * Exact browser compilation identity. The Vite plugin generates this.
28
+ * Override only in tests; the caller then owns uniqueness.
29
+ */
30
+ buildId?: string;
31
+ /**
32
+ * Master on/off switch. `false` installs nothing and sends nothing.
33
+ * @default true
34
+ */
35
+ enabled?: boolean;
36
+ /**
37
+ * Rasputin API origin. Leave unset unless you self-host.
38
+ * Defaults to `https://api.rasputinai.dev`.
39
+ */
40
+ apiUrl?: string;
41
+ /**
42
+ * Print a configuration summary when setup succeeds. Failures always log.
43
+ * @default true
44
+ */
45
+ logSuccess?: boolean;
46
+ /**
47
+ * Observe `window` `error` and `unhandledrejection`. Default true.
48
+ */
49
+ installGlobalHandlers?: boolean;
50
+ };
51
+ export type RasputinBrowserTransportStats = {
52
+ queued: number;
53
+ enqueued: number;
54
+ droppedIncoming: number;
55
+ droppedQueued: number;
56
+ droppedKeepalive: number;
57
+ droppedTotal: number;
58
+ flushesStarted: number;
59
+ sendAttempts: number;
60
+ sendRetries: number;
61
+ batchesSucceeded: number;
62
+ batchesDropped: number;
63
+ batchesFailed: number;
64
+ networkErrors: number;
65
+ rateLimitedResponses: number;
66
+ serverErrorResponses: number;
67
+ lastFailureKind: 'aborted' | 'network_error' | 'rate_limited' | 'server_error' | 'non_retryable_http' | 'too_large' | null;
68
+ lastFailureStatusCode: number | null;
69
+ };
70
+ export type RasputinBrowserRecorderStats = {
71
+ active: boolean;
72
+ functionCallsObserved: number;
73
+ functionCallsCaptured: number;
74
+ successfulExecutionsDiscarded: number;
75
+ errorSnapshots: number;
76
+ capturedExecutions: number;
77
+ degradedExecutions: number;
78
+ };
79
+ export type RasputinBrowserInstrumentationStats = {
80
+ functions: number;
81
+ full: number;
82
+ structure: number;
83
+ skip: number;
84
+ reactiveSparse: number;
85
+ verificationFailed: number;
86
+ };
87
+ export type RasputinBrowserClientStats = {
88
+ enabled: boolean;
89
+ release: string | null;
90
+ buildId: string | null;
91
+ transport: RasputinBrowserTransportStats;
92
+ recorder: RasputinBrowserRecorderStats;
93
+ instrumentation: RasputinBrowserInstrumentationStats;
94
+ };
95
+ export type RasputinBrowserConfiguration = {
96
+ enabled: boolean;
97
+ reason: 'ok' | 'disabled' | 'missing_dsn' | 'invalid_dsn' | 'missing_release' | 'missing_environment' | 'unsupported_environment';
98
+ recorder: 'active' | 'inert';
99
+ handlersInstalled: boolean;
100
+ ingestEnabled: boolean;
101
+ release: string | null;
102
+ buildId: string | null;
103
+ /** Whether a compile id is present (`injected`) or was not supplied (`missing`). */
104
+ buildIdentity: 'injected' | 'missing';
105
+ environment: string | null;
106
+ };
107
+ export type RasputinBrowserClient = {
108
+ captureException: (error: unknown) => void;
109
+ flush: (timeoutMs?: number) => Promise<void>;
110
+ close: () => Promise<void>;
111
+ /** Recorder, transport, and compile counters for support and local debugging. */
112
+ getStats: () => RasputinBrowserClientStats;
113
+ /** Why the SDK is active or inert. Failures also print to the console. */
114
+ verifyConfiguration: () => RasputinBrowserConfiguration;
115
+ };
116
+ //# sourceMappingURL=public-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-types.d.ts","sourceRoot":"","sources":["../src/public-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACpC;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,gBA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BAAqB,GACrB,yBAAyB,CAAC;IAC7B,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC7B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,oFAAoF;IACpF,aAAa,EAAE,UAAU,GAAG,SAAS,CAAC;IACtC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IACnC,gBAAgB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,iFAAiF;IACjF,QAAQ,EAAE,MAAM,0BAA0B,CAAC;IAC3C,0EAA0E;IAC1E,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;CACxD,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { RasputinBrowserClient, RasputinBrowserOptions } from './public-types';
2
+ /**
3
+ * Boot the browser SDK. Call once from application startup or the Vite
4
+ * virtual init module. Never throws into the host app.
5
+ */
6
+ export declare const RasputinInit: (options: RasputinBrowserOptions) => RasputinBrowserClient;
7
+ //# sourceMappingURL=rasputin-init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rasputin-init.d.ts","sourceRoot":"","sources":["../src/rasputin-init.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACX,qBAAqB,EAGrB,sBAAsB,EAGtB,MAAM,gBAAgB,CAAC;AAmKxB;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,sBAAsB,KAAG,qBAqJ9D,CAAC"}
@@ -0,0 +1,4 @@
1
+ /** Generated by scripts/generate-sdk-meta.ts — do not edit. */
2
+ export declare const SDK_NAME = "@rasputin-ai/browser";
3
+ export declare const SDK_VERSION = "0.6.0";
4
+ //# sourceMappingURL=sdk-meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk-meta.d.ts","sourceRoot":"","sources":["../src/sdk-meta.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,eAAO,MAAM,QAAQ,yBAAyB,CAAC;AAC/C,eAAO,MAAM,WAAW,UAAU,CAAC"}
@@ -0,0 +1,9 @@
1
+ export type FoldableFrame = {
2
+ function?: string;
3
+ file?: string;
4
+ generated?: {
5
+ file: string;
6
+ };
7
+ };
8
+ export declare const foldSyntheticFrames: <T extends FoldableFrame>(frames: readonly T[]) => T[];
9
+ //# sourceMappingURL=fold-synthetic-frames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fold-synthetic-frames.d.ts","sourceRoot":"","sources":["../../src/stack/fold-synthetic-frames.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7B,CAAC;AAwCF,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,aAAa,EAAE,QAAQ,SAAS,CAAC,EAAE,KAAG,CAAC,EAKpF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { RawFrame } from './raw-frame';
2
+ export declare const parseStack: (stack: string) => RawFrame[];
3
+ //# sourceMappingURL=parse-stack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-stack.d.ts","sourceRoot":"","sources":["../../src/stack/parse-stack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAkF5C,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,KAAG,QAAQ,EAOlD,CAAC"}
@@ -0,0 +1,7 @@
1
+ export type RawFrame = {
2
+ file: string;
3
+ function?: string;
4
+ line?: number;
5
+ column?: number;
6
+ };
7
+ //# sourceMappingURL=raw-frame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raw-frame.d.ts","sourceRoot":"","sources":["../../src/stack/raw-frame.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -0,0 +1,102 @@
1
+ import type { InstrumentationArgIdentifier, InstrumentationParamBinding } from '@rasputin-ai/core';
2
+ import type { CaptureClass, ExpressionSite } from '@rasputin-ai/instrumentation';
3
+ export type ManifestFunction = {
4
+ functionId: string;
5
+ name: string;
6
+ packageName: string | null;
7
+ packageRelativePath: string | null;
8
+ repositoryPath?: string;
9
+ line: number | null;
10
+ column: number | null;
11
+ endLine: number | null;
12
+ endColumn: number | null;
13
+ params: InstrumentationParamBinding[];
14
+ filePath: string;
15
+ captureClass: CaptureClass;
16
+ captureReason: string;
17
+ /** Build-local Vite module ordinal. Meaningful only under this artifact's buildId. */
18
+ moduleIndex?: number;
19
+ /** Build-local plan ordinal within that module. */
20
+ planIndex?: number;
21
+ /** Build-local observe/reactive site id. */
22
+ siteId?: number;
23
+ };
24
+ export type ArtifactCallSite = {
25
+ callerFunctionId: string;
26
+ calleeName: string;
27
+ calleeText: string;
28
+ packageName: string | null;
29
+ packageRelativePath: string | null;
30
+ repositoryPath?: string;
31
+ line: number;
32
+ column: number;
33
+ endLine: number;
34
+ endColumn: number;
35
+ resultBinding: string | null;
36
+ argIdentifiers: InstrumentationArgIdentifier[];
37
+ };
38
+ export type ArtifactDestructure = {
39
+ callerFunctionId: string;
40
+ sourceParam: string;
41
+ packageName: string | null;
42
+ packageRelativePath: string | null;
43
+ repositoryPath?: string;
44
+ line: number;
45
+ column: number;
46
+ binding: InstrumentationParamBinding;
47
+ };
48
+ export type ArtifactIdentity = {
49
+ /** Build-local `moduleIndex.planIndex`. Source-stable id is `functionId` (`rf_*`). */
50
+ compactId: string;
51
+ functionId: string;
52
+ name: string;
53
+ captureClass: CaptureClass;
54
+ packageRelativePath: string | null;
55
+ line: number | null;
56
+ column: number | null;
57
+ siteId?: number;
58
+ moduleIndex: number;
59
+ planIndex: number;
60
+ };
61
+ export type DebugImage = {
62
+ debugId: string;
63
+ fileName: string;
64
+ map: unknown;
65
+ };
66
+ export type ClassificationReport = {
67
+ full: number;
68
+ structure: number;
69
+ skip: number;
70
+ reactiveSparse: number;
71
+ expressionSites: number;
72
+ };
73
+ export type ProvenanceBuildStats = {
74
+ modules: number;
75
+ functionWraps: number;
76
+ awaitWraps: number;
77
+ callWraps: number;
78
+ skippedComplexCall: number;
79
+ n: number;
80
+ p: number;
81
+ a: number;
82
+ m: number;
83
+ };
84
+ export type LocalArtifacts = {
85
+ schema_version: 1;
86
+ /** Exact browser compilation identity. Namespace for compact module indices. */
87
+ buildId: string;
88
+ functions: ManifestFunction[];
89
+ identities: ArtifactIdentity[];
90
+ callSites: ArtifactCallSite[];
91
+ destructures: ArtifactDestructure[];
92
+ expressionSites: ExpressionSite[];
93
+ classification: ClassificationReport;
94
+ debugImages: DebugImage[];
95
+ verificationFailed: string[];
96
+ provenance?: ProvenanceBuildStats;
97
+ };
98
+ export declare const contentDebugId: (source: string) => string;
99
+ export declare const contentHash: (value: unknown) => string;
100
+ export declare const summarizeClassification: (functions: ManifestFunction[], expressionSites: ExpressionSite[]) => ClassificationReport;
101
+ export declare const writeLocalArtifacts: (directory: string, artifacts: LocalArtifacts) => void;
102
+ //# sourceMappingURL=artifacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/vite/artifacts.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,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AC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACV,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,cAAc,EAAE,CAAC,CAAC;IAClB,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,YAAY,EAAE,mBAAmB,EAAE,CAAC;IACpC,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,cAAc,EAAE,oBAAoB,CAAC;IACrC,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,oBAAoB,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,KAAG,MAG/C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,KAAG,MACoB,CAAC;AAElE,eAAO,MAAM,uBAAuB,GACnC,WAAW,gBAAgB,EAAE,EAC7B,iBAAiB,cAAc,EAAE,KAC/B,oBAeF,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,WAAW,MAAM,EAAE,WAAW,cAAc,SAuB/E,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type { RasputinViteOptions } from './plugin';
2
+ export { rasputin } from './plugin';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC"}