brakit 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.
@@ -0,0 +1,739 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropNames = Object.getOwnPropertyNames;
3
+ var __esm = (fn, res) => function __init() {
4
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
5
+ };
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+
11
+ // src/constants/routes.ts
12
+ var DASHBOARD_API_INGEST;
13
+ var init_routes = __esm({
14
+ "src/constants/routes.ts"() {
15
+ "use strict";
16
+ DASHBOARD_API_INGEST = "/__brakit/api/ingest";
17
+ }
18
+ });
19
+
20
+ // src/constants/limits.ts
21
+ var init_limits = __esm({
22
+ "src/constants/limits.ts"() {
23
+ "use strict";
24
+ }
25
+ });
26
+
27
+ // src/constants/thresholds.ts
28
+ var init_thresholds = __esm({
29
+ "src/constants/thresholds.ts"() {
30
+ "use strict";
31
+ }
32
+ });
33
+
34
+ // src/constants/transport.ts
35
+ var TRANSPORT_FLUSH_INTERVAL_MS, TRANSPORT_FLUSH_BATCH_SIZE, NOISE_HOSTS;
36
+ var init_transport = __esm({
37
+ "src/constants/transport.ts"() {
38
+ "use strict";
39
+ TRANSPORT_FLUSH_INTERVAL_MS = 50;
40
+ TRANSPORT_FLUSH_BATCH_SIZE = 20;
41
+ NOISE_HOSTS = [
42
+ "registry.npmjs.org",
43
+ "telemetry.nextjs.org"
44
+ ];
45
+ }
46
+ });
47
+
48
+ // src/constants/metrics.ts
49
+ var init_metrics = __esm({
50
+ "src/constants/metrics.ts"() {
51
+ "use strict";
52
+ }
53
+ });
54
+
55
+ // src/constants/headers.ts
56
+ var BRAKIT_REQUEST_ID_HEADER;
57
+ var init_headers = __esm({
58
+ "src/constants/headers.ts"() {
59
+ "use strict";
60
+ BRAKIT_REQUEST_ID_HEADER = "x-brakit-request-id";
61
+ }
62
+ });
63
+
64
+ // src/constants/index.ts
65
+ var init_constants = __esm({
66
+ "src/constants/index.ts"() {
67
+ "use strict";
68
+ init_routes();
69
+ init_limits();
70
+ init_thresholds();
71
+ init_transport();
72
+ init_metrics();
73
+ init_headers();
74
+ }
75
+ });
76
+
77
+ // src/instrument/transport.ts
78
+ var transport_exports = {};
79
+ __export(transport_exports, {
80
+ send: () => send
81
+ });
82
+ import { request } from "http";
83
+ function flush() {
84
+ if (buffer.length === 0 || !brakitPort) return;
85
+ const batch = { _brakit: true, events: buffer };
86
+ buffer = [];
87
+ const body = JSON.stringify(batch);
88
+ try {
89
+ const req = request(
90
+ {
91
+ hostname: "127.0.0.1",
92
+ port: brakitPort,
93
+ path: DASHBOARD_API_INGEST,
94
+ method: "POST",
95
+ headers: {
96
+ "content-type": "application/json",
97
+ "content-length": Buffer.byteLength(body)
98
+ }
99
+ },
100
+ // Discard response — fire and forget
101
+ (res) => res.resume()
102
+ );
103
+ req.on("error", () => {
104
+ });
105
+ req.end(body);
106
+ } catch {
107
+ }
108
+ }
109
+ function scheduleFlush() {
110
+ if (timer !== null) return;
111
+ timer = setTimeout(() => {
112
+ timer = null;
113
+ flush();
114
+ }, TRANSPORT_FLUSH_INTERVAL_MS);
115
+ if (timer && typeof timer === "object" && "unref" in timer) {
116
+ timer.unref();
117
+ }
118
+ }
119
+ function send(event) {
120
+ buffer.push(event);
121
+ if (buffer.length >= TRANSPORT_FLUSH_BATCH_SIZE) {
122
+ if (timer !== null) {
123
+ clearTimeout(timer);
124
+ timer = null;
125
+ }
126
+ flush();
127
+ } else {
128
+ scheduleFlush();
129
+ }
130
+ }
131
+ var brakitPort, buffer, timer;
132
+ var init_transport2 = __esm({
133
+ "src/instrument/transport.ts"() {
134
+ "use strict";
135
+ init_constants();
136
+ brakitPort = parseInt(process.env.BRAKIT_PORT ?? "0", 10);
137
+ buffer = [];
138
+ timer = null;
139
+ }
140
+ });
141
+
142
+ // src/instrument/hooks/context.ts
143
+ import { AsyncLocalStorage } from "async_hooks";
144
+ import { randomUUID } from "crypto";
145
+ function getRequestContext() {
146
+ return storage.getStore();
147
+ }
148
+ var storage;
149
+ var init_context = __esm({
150
+ "src/instrument/hooks/context.ts"() {
151
+ "use strict";
152
+ storage = new AsyncLocalStorage();
153
+ }
154
+ });
155
+
156
+ // src/instrument/hooks/fetch.ts
157
+ var fetch_exports = {};
158
+ __export(fetch_exports, {
159
+ setupFetchHook: () => setupFetchHook
160
+ });
161
+ import { subscribe } from "diagnostics_channel";
162
+ function isNoise(origin) {
163
+ try {
164
+ const host = new URL(origin).hostname;
165
+ return NOISE_HOSTS.some((h) => host === h || host.endsWith("." + h));
166
+ } catch {
167
+ return false;
168
+ }
169
+ }
170
+ function setupFetchHook() {
171
+ subscribe("undici:request:create", (message) => {
172
+ const msg = message;
173
+ const req = msg.request;
174
+ const origin = req.origin ?? "";
175
+ if (isNoise(origin)) return;
176
+ const ctx = getRequestContext();
177
+ pending.set(msg.request, {
178
+ origin,
179
+ method: req.method ?? "GET",
180
+ path: req.path ?? "/",
181
+ startTime: performance.now(),
182
+ parentRequestId: ctx?.requestId ?? null
183
+ });
184
+ });
185
+ subscribe("undici:request:headers", (message) => {
186
+ const msg = message;
187
+ const info = pending.get(msg.request);
188
+ if (!info) return;
189
+ pending.delete(msg.request);
190
+ send({
191
+ type: "fetch",
192
+ data: {
193
+ url: info.origin + info.path,
194
+ method: info.method,
195
+ statusCode: msg.response.statusCode ?? 0,
196
+ durationMs: Math.round(performance.now() - info.startTime),
197
+ parentRequestId: info.parentRequestId,
198
+ timestamp: Date.now()
199
+ }
200
+ });
201
+ });
202
+ subscribe("undici:request:error", (message) => {
203
+ const msg = message;
204
+ pending.delete(msg.request);
205
+ });
206
+ }
207
+ var pending;
208
+ var init_fetch = __esm({
209
+ "src/instrument/hooks/fetch.ts"() {
210
+ "use strict";
211
+ init_transport2();
212
+ init_context();
213
+ init_constants();
214
+ pending = /* @__PURE__ */ new WeakMap();
215
+ }
216
+ });
217
+
218
+ // src/instrument/hooks/console.ts
219
+ var console_exports = {};
220
+ __export(console_exports, {
221
+ setupConsoleHook: () => setupConsoleHook
222
+ });
223
+ import { format } from "util";
224
+ function setupConsoleHook() {
225
+ for (const level of LEVELS) {
226
+ const original = originals[level];
227
+ console[level] = (...args) => {
228
+ original.apply(console, args);
229
+ const ctx = getRequestContext();
230
+ const message = format(...args);
231
+ const timestamp = Date.now();
232
+ const parentRequestId = ctx?.requestId ?? null;
233
+ if (level === "error") {
234
+ const errorArg = args.find((a) => a instanceof Error);
235
+ if (errorArg) {
236
+ send({
237
+ type: "error",
238
+ data: {
239
+ name: errorArg.name,
240
+ message: errorArg.message,
241
+ stack: errorArg.stack ?? "",
242
+ parentRequestId,
243
+ timestamp
244
+ }
245
+ });
246
+ return;
247
+ }
248
+ const match = message.match(/(\w*Error):\s+(.+)/s);
249
+ if (match) {
250
+ send({
251
+ type: "error",
252
+ data: {
253
+ name: match[1],
254
+ message: match[2].split("\n")[0],
255
+ stack: message,
256
+ parentRequestId,
257
+ timestamp
258
+ }
259
+ });
260
+ return;
261
+ }
262
+ }
263
+ send({
264
+ type: "log",
265
+ data: { level, message, parentRequestId, timestamp }
266
+ });
267
+ };
268
+ }
269
+ }
270
+ var LEVELS, originals;
271
+ var init_console = __esm({
272
+ "src/instrument/hooks/console.ts"() {
273
+ "use strict";
274
+ init_transport2();
275
+ init_context();
276
+ LEVELS = ["log", "warn", "error", "info", "debug"];
277
+ originals = {
278
+ log: console.log,
279
+ warn: console.warn,
280
+ error: console.error,
281
+ info: console.info,
282
+ debug: console.debug
283
+ };
284
+ }
285
+ });
286
+
287
+ // src/instrument/hooks/errors.ts
288
+ var errors_exports = {};
289
+ __export(errors_exports, {
290
+ setupErrorHook: () => setupErrorHook
291
+ });
292
+ function captureError(err) {
293
+ const error = err instanceof Error ? err : new Error(String(err));
294
+ const ctx = getRequestContext();
295
+ send({
296
+ type: "error",
297
+ data: {
298
+ name: error.name,
299
+ message: error.message,
300
+ stack: error.stack ?? "",
301
+ parentRequestId: ctx?.requestId ?? null,
302
+ timestamp: Date.now()
303
+ }
304
+ });
305
+ }
306
+ function setupErrorHook() {
307
+ process.on("uncaughtException", (err) => {
308
+ captureError(err);
309
+ process.removeAllListeners("uncaughtException");
310
+ throw err;
311
+ });
312
+ process.on("unhandledRejection", (reason) => {
313
+ captureError(reason);
314
+ });
315
+ }
316
+ var init_errors = __esm({
317
+ "src/instrument/hooks/errors.ts"() {
318
+ "use strict";
319
+ init_transport2();
320
+ init_context();
321
+ }
322
+ });
323
+
324
+ // src/instrument/hooks/http-context.ts
325
+ var http_context_exports = {};
326
+ __export(http_context_exports, {
327
+ setupHttpContextHook: () => setupHttpContextHook
328
+ });
329
+ import http from "http";
330
+ import { randomUUID as randomUUID2 } from "crypto";
331
+ function setupHttpContextHook() {
332
+ const originalEmit = http.Server.prototype.emit;
333
+ http.Server.prototype.emit = function(event, ...args) {
334
+ if (event === "request") {
335
+ const req = args[0];
336
+ const ctx = {
337
+ requestId: req.headers[BRAKIT_REQUEST_ID_HEADER] ?? randomUUID2(),
338
+ url: req.url ?? "/",
339
+ method: req.method ?? "GET"
340
+ };
341
+ return storage.run(
342
+ ctx,
343
+ () => originalEmit.apply(this, [event, ...args])
344
+ );
345
+ }
346
+ return originalEmit.apply(this, [event, ...args]);
347
+ };
348
+ }
349
+ var init_http_context = __esm({
350
+ "src/instrument/hooks/http-context.ts"() {
351
+ "use strict";
352
+ init_context();
353
+ init_constants();
354
+ }
355
+ });
356
+
357
+ // src/instrument/adapter-registry.ts
358
+ var AdapterRegistry;
359
+ var init_adapter_registry = __esm({
360
+ "src/instrument/adapter-registry.ts"() {
361
+ "use strict";
362
+ AdapterRegistry = class {
363
+ adapters = [];
364
+ active = [];
365
+ register(adapter) {
366
+ this.adapters.push(adapter);
367
+ }
368
+ patchAll(emit) {
369
+ for (const adapter of this.adapters) {
370
+ try {
371
+ if (adapter.detect()) {
372
+ adapter.patch(emit);
373
+ this.active.push(adapter);
374
+ }
375
+ } catch {
376
+ }
377
+ }
378
+ }
379
+ unpatchAll() {
380
+ for (const adapter of this.active) {
381
+ try {
382
+ adapter.unpatch?.();
383
+ } catch {
384
+ }
385
+ }
386
+ this.active = [];
387
+ }
388
+ getActive() {
389
+ return this.active;
390
+ }
391
+ };
392
+ }
393
+ });
394
+
395
+ // src/instrument/adapters/shared.ts
396
+ import { createRequire } from "module";
397
+ function tryRequire(id) {
398
+ try {
399
+ return appRequire(id);
400
+ } catch {
401
+ return null;
402
+ }
403
+ }
404
+ function captureRequestId() {
405
+ return getRequestContext()?.requestId ?? null;
406
+ }
407
+ var appRequire;
408
+ var init_shared = __esm({
409
+ "src/instrument/adapters/shared.ts"() {
410
+ "use strict";
411
+ init_context();
412
+ appRequire = createRequire(process.cwd() + "/index.js");
413
+ }
414
+ });
415
+
416
+ // src/instrument/adapters/normalize.ts
417
+ function normalizeSQL(sql) {
418
+ if (!sql) return { op: "OTHER", table: "" };
419
+ const trimmed = sql.trim();
420
+ const op = trimmed.split(/\s+/)[0].toUpperCase();
421
+ if (/SELECT\s+COUNT/i.test(trimmed)) {
422
+ const match = trimmed.match(/FROM\s+"?\w+"?\."?(\w+)"?/i);
423
+ return { op: "SELECT", table: match?.[1] ?? "" };
424
+ }
425
+ const tableMatch = trimmed.match(/(?:FROM|INTO|UPDATE)\s+"?\w+"?\."?(\w+)"?/i);
426
+ const table = tableMatch?.[1] ?? "";
427
+ switch (op) {
428
+ case "SELECT":
429
+ return { op: "SELECT", table };
430
+ case "INSERT":
431
+ return { op: "INSERT", table };
432
+ case "UPDATE":
433
+ return { op: "UPDATE", table };
434
+ case "DELETE":
435
+ return { op: "DELETE", table };
436
+ default:
437
+ return { op: "OTHER", table };
438
+ }
439
+ }
440
+ function normalizePrismaOp(operation) {
441
+ return PRISMA_OP_MAP[operation] ?? "OTHER";
442
+ }
443
+ var PRISMA_OP_MAP;
444
+ var init_normalize = __esm({
445
+ "src/instrument/adapters/normalize.ts"() {
446
+ "use strict";
447
+ PRISMA_OP_MAP = {
448
+ findUnique: "SELECT",
449
+ findUniqueOrThrow: "SELECT",
450
+ findFirst: "SELECT",
451
+ findFirstOrThrow: "SELECT",
452
+ findMany: "SELECT",
453
+ count: "SELECT",
454
+ aggregate: "SELECT",
455
+ groupBy: "SELECT",
456
+ create: "INSERT",
457
+ createMany: "INSERT",
458
+ createManyAndReturn: "INSERT",
459
+ update: "UPDATE",
460
+ updateMany: "UPDATE",
461
+ upsert: "UPDATE",
462
+ delete: "DELETE",
463
+ deleteMany: "DELETE"
464
+ };
465
+ }
466
+ });
467
+
468
+ // src/instrument/adapters/pg.ts
469
+ var origQuery, proto, pgAdapter;
470
+ var init_pg = __esm({
471
+ "src/instrument/adapters/pg.ts"() {
472
+ "use strict";
473
+ init_shared();
474
+ init_normalize();
475
+ origQuery = null;
476
+ proto = null;
477
+ pgAdapter = {
478
+ name: "pg",
479
+ detect() {
480
+ return tryRequire("pg") !== null;
481
+ },
482
+ patch(emit) {
483
+ const pg = tryRequire("pg");
484
+ if (!pg) return;
485
+ const Client = pg.default?.Client ?? pg.Client;
486
+ if (!Client || typeof Client !== "function") return;
487
+ proto = Client.prototype ?? null;
488
+ if (!proto?.query) return;
489
+ origQuery = proto.query;
490
+ const saved = origQuery;
491
+ proto.query = function(...args) {
492
+ const first = args[0];
493
+ const sql = typeof first === "string" ? first : typeof first === "object" && first !== null && "text" in first ? first.text : void 0;
494
+ const start = performance.now();
495
+ const requestId = captureRequestId();
496
+ const { op, table } = normalizeSQL(sql ?? "");
497
+ const emitQuery = (rowCount) => {
498
+ emit({
499
+ type: "query",
500
+ data: {
501
+ driver: "pg",
502
+ source: "pg",
503
+ sql,
504
+ normalizedOp: op,
505
+ table,
506
+ durationMs: Math.round(performance.now() - start),
507
+ rowCount: rowCount ?? void 0,
508
+ parentRequestId: requestId,
509
+ timestamp: Date.now()
510
+ }
511
+ });
512
+ };
513
+ const lastIdx = args.length - 1;
514
+ if (lastIdx >= 0 && typeof args[lastIdx] === "function") {
515
+ const origCb = args[lastIdx];
516
+ args[lastIdx] = function(err, res) {
517
+ emitQuery(res?.rowCount ?? void 0);
518
+ return origCb.call(this, err, res);
519
+ };
520
+ return saved.apply(this, args);
521
+ }
522
+ const result = saved.apply(this, args);
523
+ if (result && typeof result.then === "function") {
524
+ return result.then((res) => {
525
+ emitQuery(res?.rowCount ?? void 0);
526
+ return res;
527
+ });
528
+ }
529
+ if (result && typeof result.on === "function") {
530
+ result.on("end", (res) => emitQuery(res?.rowCount ?? void 0));
531
+ return result;
532
+ }
533
+ return result;
534
+ };
535
+ },
536
+ unpatch() {
537
+ if (proto && origQuery) {
538
+ proto.query = origQuery;
539
+ origQuery = null;
540
+ proto = null;
541
+ }
542
+ }
543
+ };
544
+ }
545
+ });
546
+
547
+ // src/instrument/adapters/mysql2.ts
548
+ var originals2, proto2, mysql2Adapter;
549
+ var init_mysql2 = __esm({
550
+ "src/instrument/adapters/mysql2.ts"() {
551
+ "use strict";
552
+ init_shared();
553
+ init_normalize();
554
+ originals2 = /* @__PURE__ */ new Map();
555
+ proto2 = null;
556
+ mysql2Adapter = {
557
+ name: "mysql2",
558
+ detect() {
559
+ return tryRequire("mysql2") !== null;
560
+ },
561
+ patch(emit) {
562
+ const mysql2 = tryRequire("mysql2");
563
+ if (!mysql2) return;
564
+ proto2 = mysql2.Connection?.prototype ?? null;
565
+ if (!proto2) return;
566
+ for (const method of ["query", "execute"]) {
567
+ const orig = proto2[method];
568
+ if (typeof orig !== "function") continue;
569
+ originals2.set(method, orig);
570
+ proto2[method] = function(...args) {
571
+ const first = args[0];
572
+ const sql = typeof first === "string" ? first : void 0;
573
+ const start = performance.now();
574
+ const requestId = captureRequestId();
575
+ const { op, table } = normalizeSQL(sql ?? "");
576
+ const emitQuery = () => {
577
+ emit({
578
+ type: "query",
579
+ data: {
580
+ driver: "mysql2",
581
+ source: "mysql2",
582
+ sql,
583
+ normalizedOp: op,
584
+ table,
585
+ durationMs: Math.round(performance.now() - start),
586
+ parentRequestId: requestId,
587
+ timestamp: Date.now()
588
+ }
589
+ });
590
+ };
591
+ const lastIdx = args.length - 1;
592
+ if (lastIdx >= 0 && typeof args[lastIdx] === "function") {
593
+ const origCb = args[lastIdx];
594
+ args[lastIdx] = function() {
595
+ emitQuery();
596
+ return origCb.apply(this, arguments);
597
+ };
598
+ return orig.apply(this, args);
599
+ }
600
+ const result = orig.apply(this, args);
601
+ if (result && typeof result.then === "function") {
602
+ return result.then((res) => {
603
+ emitQuery();
604
+ return res;
605
+ });
606
+ }
607
+ return result;
608
+ };
609
+ }
610
+ },
611
+ unpatch() {
612
+ if (proto2) {
613
+ for (const [method, orig] of originals2) {
614
+ proto2[method] = orig;
615
+ }
616
+ originals2.clear();
617
+ proto2 = null;
618
+ }
619
+ }
620
+ };
621
+ }
622
+ });
623
+
624
+ // src/instrument/adapters/prisma.ts
625
+ var origConnect, prismaProto, prismaAdapter;
626
+ var init_prisma = __esm({
627
+ "src/instrument/adapters/prisma.ts"() {
628
+ "use strict";
629
+ init_shared();
630
+ init_normalize();
631
+ origConnect = null;
632
+ prismaProto = null;
633
+ prismaAdapter = {
634
+ name: "prisma",
635
+ detect() {
636
+ return tryRequire("@prisma/client") !== null;
637
+ },
638
+ patch(emit) {
639
+ const prismaModule = tryRequire("@prisma/client");
640
+ if (!prismaModule) return;
641
+ const PrismaClient = prismaModule.default?.PrismaClient ?? prismaModule.PrismaClient;
642
+ if (!PrismaClient || typeof PrismaClient !== "function") return;
643
+ prismaProto = PrismaClient.prototype;
644
+ origConnect = prismaProto.$connect;
645
+ if (typeof origConnect !== "function") return;
646
+ const saved = origConnect;
647
+ prismaProto.$connect = async function(...args) {
648
+ if (!this._brakitPatched) {
649
+ this._brakitPatched = true;
650
+ const extended = this.$extends({
651
+ query: {
652
+ $allModels: {
653
+ async $allOperations({
654
+ model,
655
+ operation,
656
+ args: opArgs,
657
+ query
658
+ }) {
659
+ const requestId = captureRequestId();
660
+ const start = performance.now();
661
+ const result = await query(opArgs);
662
+ emit({
663
+ type: "query",
664
+ data: {
665
+ driver: "prisma",
666
+ source: "prisma",
667
+ model,
668
+ operation,
669
+ normalizedOp: normalizePrismaOp(operation),
670
+ table: model,
671
+ durationMs: Math.round(performance.now() - start),
672
+ parentRequestId: requestId,
673
+ timestamp: Date.now()
674
+ }
675
+ });
676
+ return result;
677
+ }
678
+ }
679
+ }
680
+ });
681
+ Object.setPrototypeOf(this, Object.getPrototypeOf(extended));
682
+ }
683
+ return saved.apply(this, args);
684
+ };
685
+ },
686
+ unpatch() {
687
+ if (prismaProto && origConnect) {
688
+ prismaProto.$connect = origConnect;
689
+ origConnect = null;
690
+ prismaProto = null;
691
+ }
692
+ }
693
+ };
694
+ }
695
+ });
696
+
697
+ // src/instrument/adapters/index.ts
698
+ var adapters_exports = {};
699
+ __export(adapters_exports, {
700
+ createDefaultRegistry: () => createDefaultRegistry,
701
+ mysql2Adapter: () => mysql2Adapter,
702
+ pgAdapter: () => pgAdapter,
703
+ prismaAdapter: () => prismaAdapter
704
+ });
705
+ function createDefaultRegistry() {
706
+ const registry = new AdapterRegistry();
707
+ registry.register(pgAdapter);
708
+ registry.register(mysql2Adapter);
709
+ registry.register(prismaAdapter);
710
+ return registry;
711
+ }
712
+ var init_adapters = __esm({
713
+ "src/instrument/adapters/index.ts"() {
714
+ "use strict";
715
+ init_adapter_registry();
716
+ init_pg();
717
+ init_mysql2();
718
+ init_prisma();
719
+ init_pg();
720
+ init_mysql2();
721
+ init_prisma();
722
+ }
723
+ });
724
+
725
+ // src/instrument/preload.ts
726
+ if (process.env.BRAKIT_PORT && process.env.BRAKIT_INSTRUMENT !== "0") {
727
+ const { setupFetchHook: setupFetchHook2 } = await Promise.resolve().then(() => (init_fetch(), fetch_exports));
728
+ const { setupConsoleHook: setupConsoleHook2 } = await Promise.resolve().then(() => (init_console(), console_exports));
729
+ const { setupErrorHook: setupErrorHook2 } = await Promise.resolve().then(() => (init_errors(), errors_exports));
730
+ const { setupHttpContextHook: setupHttpContextHook2 } = await Promise.resolve().then(() => (init_http_context(), http_context_exports));
731
+ const { createDefaultRegistry: createDefaultRegistry2 } = await Promise.resolve().then(() => (init_adapters(), adapters_exports));
732
+ const { send: send2 } = await Promise.resolve().then(() => (init_transport2(), transport_exports));
733
+ setupHttpContextHook2();
734
+ setupFetchHook2();
735
+ setupConsoleHook2();
736
+ setupErrorHook2();
737
+ const registry = createDefaultRegistry2();
738
+ registry.patchAll((event) => send2(event));
739
+ }