@runtimescope/collector 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,1356 @@
1
+ import { SecureContextOptions } from 'node:tls';
2
+
3
+ type EventType = 'network' | 'console' | 'session' | 'state' | 'render' | 'dom_snapshot' | 'performance' | 'database' | 'recon_metadata' | 'recon_design_tokens' | 'recon_fonts' | 'recon_layout_tree' | 'recon_accessibility' | 'recon_computed_styles' | 'recon_element_snapshot' | 'recon_asset_inventory';
4
+ interface BaseEvent {
5
+ eventId: string;
6
+ sessionId: string;
7
+ timestamp: number;
8
+ eventType: EventType;
9
+ }
10
+ interface GraphQLOperation {
11
+ type: 'query' | 'mutation' | 'subscription';
12
+ name: string;
13
+ }
14
+ interface NetworkEvent extends BaseEvent {
15
+ eventType: 'network';
16
+ url: string;
17
+ method: string;
18
+ status: number;
19
+ requestHeaders: Record<string, string>;
20
+ responseHeaders: Record<string, string>;
21
+ requestBodySize: number;
22
+ responseBodySize: number;
23
+ duration: number;
24
+ ttfb: number;
25
+ graphqlOperation?: GraphQLOperation;
26
+ requestBody?: string;
27
+ responseBody?: string;
28
+ errorPhase?: 'error' | 'abort' | 'timeout';
29
+ errorMessage?: string;
30
+ source?: 'fetch' | 'xhr' | 'node-http' | 'node-https';
31
+ }
32
+ type ConsoleLevel = 'log' | 'warn' | 'error' | 'info' | 'debug' | 'trace';
33
+ interface ConsoleEvent extends BaseEvent {
34
+ eventType: 'console';
35
+ level: ConsoleLevel;
36
+ message: string;
37
+ args: unknown[];
38
+ stackTrace?: string;
39
+ sourceFile?: string;
40
+ }
41
+ interface BuildMeta {
42
+ gitCommit?: string;
43
+ gitBranch?: string;
44
+ buildTime?: string;
45
+ deployId?: string;
46
+ }
47
+ interface SessionEvent extends BaseEvent {
48
+ eventType: 'session';
49
+ appName: string;
50
+ connectedAt: number;
51
+ sdkVersion: string;
52
+ buildMeta?: BuildMeta;
53
+ }
54
+ interface StateEvent extends BaseEvent {
55
+ eventType: 'state';
56
+ storeId: string;
57
+ library: 'zustand' | 'redux' | 'unknown';
58
+ phase: 'init' | 'update';
59
+ state: unknown;
60
+ previousState?: unknown;
61
+ diff?: Record<string, {
62
+ from: unknown;
63
+ to: unknown;
64
+ }>;
65
+ action?: {
66
+ type: string;
67
+ payload?: unknown;
68
+ };
69
+ stackTrace?: string;
70
+ }
71
+ interface RenderComponentProfile {
72
+ componentName: string;
73
+ renderCount: number;
74
+ totalDuration: number;
75
+ avgDuration: number;
76
+ lastRenderPhase: 'mount' | 'update' | 'unmount';
77
+ lastRenderCause?: 'props' | 'state' | 'context' | 'parent' | 'unknown';
78
+ renderVelocity: number;
79
+ suspicious: boolean;
80
+ }
81
+ interface RenderEvent extends BaseEvent {
82
+ eventType: 'render';
83
+ profiles: RenderComponentProfile[];
84
+ snapshotWindowMs: number;
85
+ totalRenders: number;
86
+ suspiciousComponents: string[];
87
+ }
88
+ interface DomSnapshotEvent extends BaseEvent {
89
+ eventType: 'dom_snapshot';
90
+ html: string;
91
+ url: string;
92
+ viewport: {
93
+ width: number;
94
+ height: number;
95
+ };
96
+ scrollPosition: {
97
+ x: number;
98
+ y: number;
99
+ };
100
+ elementCount: number;
101
+ truncated: boolean;
102
+ }
103
+ type WebVitalRating = 'good' | 'needs-improvement' | 'poor';
104
+ type ServerMetricName = 'memory.rss' | 'memory.heapUsed' | 'memory.heapTotal' | 'memory.external' | 'eventloop.lag.mean' | 'eventloop.lag.p99' | 'eventloop.lag.max' | 'gc.pause.major' | 'gc.pause.minor' | 'cpu.user' | 'cpu.system' | 'handles.active' | 'requests.active';
105
+ type PerformanceMetricName = 'LCP' | 'FCP' | 'CLS' | 'TTFB' | 'FID' | 'INP' | ServerMetricName;
106
+ interface PerformanceEvent extends BaseEvent {
107
+ eventType: 'performance';
108
+ metricName: PerformanceMetricName;
109
+ value: number;
110
+ rating?: WebVitalRating;
111
+ unit?: 'bytes' | 'ms' | 'percent' | 'count' | 'score';
112
+ element?: string;
113
+ entries?: unknown[];
114
+ }
115
+ type DatabaseOperation = 'SELECT' | 'INSERT' | 'UPDATE' | 'DELETE' | 'OTHER';
116
+ type DatabaseSource = 'prisma' | 'drizzle' | 'knex' | 'pg' | 'mysql2' | 'better-sqlite3' | 'generic';
117
+ interface DatabaseEvent extends BaseEvent {
118
+ eventType: 'database';
119
+ query: string;
120
+ normalizedQuery: string;
121
+ duration: number;
122
+ rowsReturned?: number;
123
+ rowsAffected?: number;
124
+ tablesAccessed: string[];
125
+ operation: DatabaseOperation;
126
+ source: DatabaseSource;
127
+ stackTrace?: string;
128
+ label?: string;
129
+ error?: string;
130
+ params?: string;
131
+ }
132
+ type DetectedFramework = 'react' | 'vue' | 'angular' | 'svelte' | 'solid' | 'preact' | 'htmx' | 'unknown';
133
+ type DetectedMetaFramework = 'nextjs' | 'nuxt' | 'sveltekit' | 'remix' | 'astro' | 'gatsby' | 'unknown';
134
+ type DetectedUILibrary = 'tailwind' | 'mui' | 'chakra' | 'shadcn' | 'bootstrap' | 'antd' | 'radix' | 'unknown';
135
+ type DetectedBuildTool = 'webpack' | 'vite' | 'turbopack' | 'esbuild' | 'parcel' | 'rollup' | 'unknown';
136
+ type DetectedHosting = 'vercel' | 'netlify' | 'cloudflare' | 'aws' | 'firebase' | 'railway' | 'unknown';
137
+ interface TechStackDetection {
138
+ name: string;
139
+ confidence: 'high' | 'medium' | 'low';
140
+ version?: string;
141
+ evidence: string[];
142
+ }
143
+ interface ReconMetadataEvent extends BaseEvent {
144
+ eventType: 'recon_metadata';
145
+ url: string;
146
+ title: string;
147
+ viewport: {
148
+ width: number;
149
+ height: number;
150
+ };
151
+ documentLang?: string;
152
+ metaTags: Record<string, string>;
153
+ techStack: {
154
+ framework: TechStackDetection;
155
+ metaFramework?: TechStackDetection;
156
+ uiLibrary?: TechStackDetection;
157
+ buildTool?: TechStackDetection;
158
+ hosting?: TechStackDetection;
159
+ stateManagement?: TechStackDetection;
160
+ additional: TechStackDetection[];
161
+ };
162
+ externalStylesheets: {
163
+ href: string;
164
+ crossOrigin: boolean;
165
+ }[];
166
+ externalScripts: {
167
+ src: string;
168
+ async: boolean;
169
+ defer: boolean;
170
+ type?: string;
171
+ }[];
172
+ preloads: {
173
+ href: string;
174
+ as: string;
175
+ }[];
176
+ }
177
+ interface CSSCustomProperty {
178
+ name: string;
179
+ value: string;
180
+ source: string;
181
+ }
182
+ interface ColorToken {
183
+ value: string;
184
+ hex: string;
185
+ usageCount: number;
186
+ properties: string[];
187
+ sampleSelectors: string[];
188
+ }
189
+ interface TypographyToken {
190
+ fontFamily: string;
191
+ fontSize: string;
192
+ fontWeight: string;
193
+ lineHeight: string;
194
+ letterSpacing: string;
195
+ usageCount: number;
196
+ sampleSelectors: string[];
197
+ }
198
+ interface SpacingValue {
199
+ value: string;
200
+ pixels: number;
201
+ usageCount: number;
202
+ properties: string[];
203
+ }
204
+ type CSSArchitecture = 'tailwind' | 'css-modules' | 'styled-components' | 'css-in-js' | 'bem' | 'atomic' | 'vanilla' | 'unknown';
205
+ interface ReconDesignTokensEvent extends BaseEvent {
206
+ eventType: 'recon_design_tokens';
207
+ url: string;
208
+ customProperties: CSSCustomProperty[];
209
+ colors: ColorToken[];
210
+ typography: TypographyToken[];
211
+ spacing: SpacingValue[];
212
+ borderRadii: {
213
+ value: string;
214
+ usageCount: number;
215
+ }[];
216
+ boxShadows: {
217
+ value: string;
218
+ usageCount: number;
219
+ }[];
220
+ cssArchitecture: CSSArchitecture;
221
+ classNamingPatterns: string[];
222
+ sampleClassNames: string[];
223
+ }
224
+ interface FontFaceInfo {
225
+ family: string;
226
+ weight: string;
227
+ style: string;
228
+ src: string;
229
+ display?: string;
230
+ unicodeRange?: string;
231
+ }
232
+ interface FontUsage {
233
+ family: string;
234
+ weight: string;
235
+ style: string;
236
+ usageCount: number;
237
+ sampleSelectors: string[];
238
+ }
239
+ interface ReconFontsEvent extends BaseEvent {
240
+ eventType: 'recon_fonts';
241
+ url: string;
242
+ fontFaces: FontFaceInfo[];
243
+ fontsUsed: FontUsage[];
244
+ iconFonts: {
245
+ family: string;
246
+ glyphsUsed: {
247
+ codepoint: string;
248
+ selector: string;
249
+ }[];
250
+ }[];
251
+ loadingStrategy: string;
252
+ }
253
+ interface LayoutNode {
254
+ tag: string;
255
+ id?: string;
256
+ classList: string[];
257
+ role?: string;
258
+ ariaLabel?: string;
259
+ dataAttributes: Record<string, string>;
260
+ boundingRect: {
261
+ x: number;
262
+ y: number;
263
+ width: number;
264
+ height: number;
265
+ };
266
+ display: string;
267
+ position: string;
268
+ flexDirection?: string;
269
+ justifyContent?: string;
270
+ alignItems?: string;
271
+ flexWrap?: string;
272
+ gap?: string;
273
+ gridTemplateColumns?: string;
274
+ gridTemplateRows?: string;
275
+ overflow?: string;
276
+ zIndex?: string;
277
+ opacity?: string;
278
+ children: LayoutNode[];
279
+ childCount: number;
280
+ textContent?: string;
281
+ }
282
+ interface ReconLayoutTreeEvent extends BaseEvent {
283
+ eventType: 'recon_layout_tree';
284
+ url: string;
285
+ viewport: {
286
+ width: number;
287
+ height: number;
288
+ };
289
+ scrollHeight: number;
290
+ rootSelector?: string;
291
+ tree: LayoutNode;
292
+ totalElements: number;
293
+ maxDepth: number;
294
+ }
295
+ interface HeadingInfo {
296
+ level: number;
297
+ text: string;
298
+ selector: string;
299
+ }
300
+ interface LandmarkInfo {
301
+ role: string;
302
+ label?: string;
303
+ selector: string;
304
+ }
305
+ interface FormFieldInfo {
306
+ tag: string;
307
+ type?: string;
308
+ name?: string;
309
+ label?: string;
310
+ required: boolean;
311
+ ariaDescribedBy?: string;
312
+ selector: string;
313
+ }
314
+ interface InteractiveElementInfo {
315
+ tag: string;
316
+ role?: string;
317
+ text: string;
318
+ ariaLabel?: string;
319
+ href?: string;
320
+ tabIndex?: number;
321
+ selector: string;
322
+ }
323
+ interface ReconAccessibilityEvent extends BaseEvent {
324
+ eventType: 'recon_accessibility';
325
+ url: string;
326
+ headings: HeadingInfo[];
327
+ landmarks: LandmarkInfo[];
328
+ formFields: FormFieldInfo[];
329
+ links: InteractiveElementInfo[];
330
+ buttons: InteractiveElementInfo[];
331
+ images: {
332
+ src: string;
333
+ alt: string;
334
+ hasAlt: boolean;
335
+ selector: string;
336
+ }[];
337
+ issues: string[];
338
+ }
339
+ interface ComputedStyleEntry {
340
+ selector: string;
341
+ matchCount: number;
342
+ styles: Record<string, string>;
343
+ variations?: {
344
+ property: string;
345
+ values: {
346
+ value: string;
347
+ count: number;
348
+ }[];
349
+ }[];
350
+ }
351
+ interface ReconComputedStylesEvent extends BaseEvent {
352
+ eventType: 'recon_computed_styles';
353
+ url: string;
354
+ selector: string;
355
+ propertyFilter?: string[];
356
+ entries: ComputedStyleEntry[];
357
+ }
358
+ interface ElementSnapshotNode {
359
+ tag: string;
360
+ id?: string;
361
+ classList: string[];
362
+ attributes: Record<string, string>;
363
+ textContent?: string;
364
+ boundingRect: {
365
+ x: number;
366
+ y: number;
367
+ width: number;
368
+ height: number;
369
+ };
370
+ computedStyles: Record<string, string>;
371
+ children: ElementSnapshotNode[];
372
+ }
373
+ interface ReconElementSnapshotEvent extends BaseEvent {
374
+ eventType: 'recon_element_snapshot';
375
+ url: string;
376
+ selector: string;
377
+ depth: number;
378
+ root: ElementSnapshotNode;
379
+ totalNodes: number;
380
+ }
381
+ interface ImageAsset {
382
+ src: string;
383
+ alt?: string;
384
+ width: number;
385
+ height: number;
386
+ naturalWidth?: number;
387
+ naturalHeight?: number;
388
+ format?: string;
389
+ loading?: string;
390
+ selector: string;
391
+ }
392
+ interface SpriteFrame {
393
+ selector: string;
394
+ cropX: number;
395
+ cropY: number;
396
+ cropWidth: number;
397
+ cropHeight: number;
398
+ extractedDataUrl?: string;
399
+ }
400
+ interface BackgroundSpriteSheet {
401
+ sheetUrl: string;
402
+ sheetWidth?: number;
403
+ sheetHeight?: number;
404
+ frames: SpriteFrame[];
405
+ }
406
+ interface SVGSpriteSymbol {
407
+ id: string;
408
+ viewBox?: string;
409
+ paths: string;
410
+ referencedBy: string[];
411
+ }
412
+ interface IconFontInfo {
413
+ fontFamily: string;
414
+ fontFaceUrl?: string;
415
+ glyphs: {
416
+ codepoint: string;
417
+ pseudoElement: string;
418
+ selector: string;
419
+ renderedSize: number;
420
+ }[];
421
+ }
422
+ interface InlineSVGAsset {
423
+ selector: string;
424
+ viewBox?: string;
425
+ width?: number;
426
+ height?: number;
427
+ source: string;
428
+ }
429
+ interface MaskSpriteSheet {
430
+ sheetUrl: string;
431
+ sheetWidth?: number;
432
+ sheetHeight?: number;
433
+ frames: SpriteFrame[];
434
+ }
435
+ interface ReconAssetInventoryEvent extends BaseEvent {
436
+ eventType: 'recon_asset_inventory';
437
+ url: string;
438
+ images: ImageAsset[];
439
+ inlineSVGs: InlineSVGAsset[];
440
+ svgSprites: SVGSpriteSymbol[];
441
+ backgroundSprites: BackgroundSpriteSheet[];
442
+ maskSprites: MaskSpriteSheet[];
443
+ iconFonts: IconFontInfo[];
444
+ totalAssets: number;
445
+ }
446
+ interface ReconFilter {
447
+ reconType?: ReconEventType;
448
+ sinceSeconds?: number;
449
+ sessionId?: string;
450
+ url?: string;
451
+ }
452
+ type ReconEventType = 'recon_metadata' | 'recon_design_tokens' | 'recon_fonts' | 'recon_layout_tree' | 'recon_accessibility' | 'recon_computed_styles' | 'recon_element_snapshot' | 'recon_asset_inventory';
453
+ type RuntimeEvent = NetworkEvent | ConsoleEvent | SessionEvent | StateEvent | RenderEvent | DomSnapshotEvent | PerformanceEvent | DatabaseEvent | ReconMetadataEvent | ReconDesignTokensEvent | ReconFontsEvent | ReconLayoutTreeEvent | ReconAccessibilityEvent | ReconComputedStylesEvent | ReconElementSnapshotEvent | ReconAssetInventoryEvent;
454
+ interface NetworkFilter {
455
+ sinceSeconds?: number;
456
+ urlPattern?: string;
457
+ status?: number;
458
+ method?: string;
459
+ sessionId?: string;
460
+ }
461
+ interface ConsoleFilter {
462
+ level?: string;
463
+ sinceSeconds?: number;
464
+ search?: string;
465
+ sessionId?: string;
466
+ }
467
+ interface StateFilter {
468
+ storeId?: string;
469
+ sinceSeconds?: number;
470
+ sessionId?: string;
471
+ }
472
+ interface RenderFilter {
473
+ componentName?: string;
474
+ sinceSeconds?: number;
475
+ sessionId?: string;
476
+ }
477
+ interface PerformanceFilter {
478
+ metricName?: string;
479
+ sinceSeconds?: number;
480
+ sessionId?: string;
481
+ }
482
+ interface DatabaseFilter {
483
+ sinceSeconds?: number;
484
+ table?: string;
485
+ minDurationMs?: number;
486
+ search?: string;
487
+ operation?: DatabaseOperation;
488
+ source?: DatabaseSource;
489
+ sessionId?: string;
490
+ }
491
+ interface HistoricalFilter {
492
+ project?: string;
493
+ sessionId?: string;
494
+ eventTypes?: EventType[];
495
+ since?: number;
496
+ until?: number;
497
+ limit?: number;
498
+ offset?: number;
499
+ endpoint?: string;
500
+ component?: string;
501
+ storeId?: string;
502
+ }
503
+ interface ToolResponse<T = unknown> {
504
+ summary: string;
505
+ data: T;
506
+ issues: string[];
507
+ metadata: {
508
+ timeRange: {
509
+ from: number;
510
+ to: number;
511
+ };
512
+ eventCount: number;
513
+ sessionId: string | null;
514
+ };
515
+ }
516
+ interface SessionInfo {
517
+ sessionId: string;
518
+ appName: string;
519
+ connectedAt: number;
520
+ sdkVersion: string;
521
+ eventCount: number;
522
+ isConnected: boolean;
523
+ }
524
+ interface SessionInfoExtended extends SessionInfo {
525
+ project: string;
526
+ disconnectedAt?: number;
527
+ buildMeta?: BuildMeta;
528
+ }
529
+ interface SessionMetrics {
530
+ sessionId: string;
531
+ project: string;
532
+ connectedAt: number;
533
+ disconnectedAt: number;
534
+ totalEvents: number;
535
+ errorCount: number;
536
+ endpoints: Record<string, {
537
+ avgLatency: number;
538
+ errorRate: number;
539
+ callCount: number;
540
+ }>;
541
+ components: Record<string, {
542
+ renderCount: number;
543
+ avgDuration: number;
544
+ }>;
545
+ stores: Record<string, {
546
+ updateCount: number;
547
+ }>;
548
+ webVitals: Record<string, {
549
+ value: number;
550
+ rating: WebVitalRating;
551
+ }>;
552
+ queries: Record<string, {
553
+ avgDuration: number;
554
+ callCount: number;
555
+ }>;
556
+ }
557
+ interface MetricDelta {
558
+ key: string;
559
+ before: number;
560
+ after: number;
561
+ delta: number;
562
+ percentChange: number;
563
+ classification: 'regression' | 'improvement' | 'unchanged';
564
+ }
565
+ interface SessionDiffResult {
566
+ sessionA: string;
567
+ sessionB: string;
568
+ endpointDeltas: MetricDelta[];
569
+ componentDeltas: MetricDelta[];
570
+ storeDeltas: MetricDelta[];
571
+ webVitalDeltas: MetricDelta[];
572
+ queryDeltas: MetricDelta[];
573
+ overallDelta: {
574
+ errorCountDelta: number;
575
+ totalEventsDelta: number;
576
+ };
577
+ }
578
+ interface SessionSnapshot {
579
+ sessionId: string;
580
+ project: string;
581
+ snapshotPath?: string;
582
+ metrics: SessionMetrics;
583
+ buildMeta?: BuildMeta;
584
+ createdAt: number;
585
+ }
586
+ interface WSMessage {
587
+ type: 'event' | 'handshake' | 'heartbeat' | 'command' | 'command_response';
588
+ payload: unknown;
589
+ timestamp: number;
590
+ sessionId: string;
591
+ }
592
+ interface HandshakePayload {
593
+ appName: string;
594
+ sdkVersion: string;
595
+ sessionId: string;
596
+ authToken?: string;
597
+ }
598
+ interface EventBatchPayload {
599
+ events: RuntimeEvent[];
600
+ }
601
+ type ServerCommand = {
602
+ command: 'capture_dom_snapshot';
603
+ requestId: string;
604
+ params?: {
605
+ maxSize?: number;
606
+ };
607
+ } | {
608
+ command: 'capture_performance_metrics';
609
+ requestId: string;
610
+ } | {
611
+ command: 'clear_renders';
612
+ requestId: string;
613
+ } | {
614
+ command: 'recon_scan';
615
+ requestId: string;
616
+ params?: {
617
+ categories?: ReconEventType[];
618
+ };
619
+ } | {
620
+ command: 'recon_computed_styles';
621
+ requestId: string;
622
+ params: {
623
+ selector: string;
624
+ properties?: string[];
625
+ };
626
+ } | {
627
+ command: 'recon_element_snapshot';
628
+ requestId: string;
629
+ params: {
630
+ selector: string;
631
+ depth?: number;
632
+ };
633
+ } | {
634
+ command: 'recon_layout_tree';
635
+ requestId: string;
636
+ params?: {
637
+ selector?: string;
638
+ maxDepth?: number;
639
+ };
640
+ };
641
+ interface CommandResponse {
642
+ type: 'command_response';
643
+ requestId: string;
644
+ command: string;
645
+ payload: unknown;
646
+ timestamp: number;
647
+ sessionId: string;
648
+ }
649
+ interface TimelineFilter {
650
+ sinceSeconds?: number;
651
+ eventTypes?: EventType[];
652
+ sessionId?: string;
653
+ }
654
+ type IssueSeverity = 'high' | 'medium' | 'low';
655
+ interface DetectedIssue {
656
+ id: string;
657
+ pattern: string;
658
+ severity: IssueSeverity;
659
+ title: string;
660
+ description: string;
661
+ evidence: string[];
662
+ suggestion?: string;
663
+ }
664
+ interface AuthInfo {
665
+ type: 'bearer' | 'basic' | 'api_key' | 'cookie' | 'none';
666
+ headerName?: string;
667
+ }
668
+ interface ApiContractField {
669
+ path: string;
670
+ type: string;
671
+ nullable: boolean;
672
+ example?: unknown;
673
+ }
674
+ interface ApiContract {
675
+ requestFields?: ApiContractField[];
676
+ responseFields: ApiContractField[];
677
+ sampleCount: number;
678
+ }
679
+ interface ApiEndpoint {
680
+ normalizedPath: string;
681
+ method: string;
682
+ baseUrl: string;
683
+ service: string;
684
+ callCount: number;
685
+ firstSeen: number;
686
+ lastSeen: number;
687
+ auth: AuthInfo;
688
+ contract?: ApiContract;
689
+ graphqlOperation?: GraphQLOperation;
690
+ }
691
+ interface ApiEndpointHealth {
692
+ normalizedPath: string;
693
+ method: string;
694
+ service: string;
695
+ callCount: number;
696
+ successRate: number;
697
+ avgLatency: number;
698
+ p50Latency: number;
699
+ p95Latency: number;
700
+ errorRate: number;
701
+ errorCodes: Record<number, number>;
702
+ }
703
+ interface ServiceInfo {
704
+ name: string;
705
+ baseUrl: string;
706
+ endpointCount: number;
707
+ totalCalls: number;
708
+ avgLatency: number;
709
+ errorRate: number;
710
+ auth: AuthInfo;
711
+ detectedPlatform?: string;
712
+ }
713
+ interface ApiChangeRecord {
714
+ normalizedPath: string;
715
+ method: string;
716
+ changeType: 'added' | 'removed' | 'modified';
717
+ fieldChanges?: {
718
+ path: string;
719
+ change: 'added' | 'removed' | 'type_changed';
720
+ oldType?: string;
721
+ newType?: string;
722
+ }[];
723
+ }
724
+ interface NormalizedQueryStats {
725
+ normalizedQuery: string;
726
+ tables: string[];
727
+ operation: DatabaseOperation;
728
+ callCount: number;
729
+ avgDuration: number;
730
+ maxDuration: number;
731
+ p95Duration: number;
732
+ totalDuration: number;
733
+ avgRowsReturned: number;
734
+ }
735
+ interface IndexSuggestion {
736
+ table: string;
737
+ columns: string[];
738
+ reason: string;
739
+ estimatedImpact: 'high' | 'medium' | 'low';
740
+ queryPattern: string;
741
+ }
742
+ interface DatabaseConnectionConfig {
743
+ id: string;
744
+ type: 'postgres' | 'mysql' | 'sqlite';
745
+ connectionString?: string;
746
+ label?: string;
747
+ projectRef?: string;
748
+ serviceKey?: string;
749
+ }
750
+ interface SchemaColumn {
751
+ name: string;
752
+ type: string;
753
+ nullable: boolean;
754
+ defaultValue?: string;
755
+ isPrimaryKey: boolean;
756
+ }
757
+ interface SchemaForeignKey {
758
+ column: string;
759
+ referencedTable: string;
760
+ referencedColumn: string;
761
+ }
762
+ interface SchemaIndex {
763
+ name: string;
764
+ columns: string[];
765
+ unique: boolean;
766
+ }
767
+ interface SchemaTable {
768
+ name: string;
769
+ columns: SchemaColumn[];
770
+ foreignKeys: SchemaForeignKey[];
771
+ indexes: SchemaIndex[];
772
+ rowCount?: number;
773
+ }
774
+ interface DatabaseSchema {
775
+ connectionId: string;
776
+ tables: SchemaTable[];
777
+ fetchedAt: number;
778
+ }
779
+ type DevProcessType = 'next' | 'vite' | 'webpack' | 'wrangler' | 'prisma' | 'docker' | 'postgres' | 'mysql' | 'redis' | 'node' | 'bun' | 'deno' | 'python' | 'unknown';
780
+ interface DevProcess {
781
+ pid: number;
782
+ command: string;
783
+ type: DevProcessType;
784
+ cpuPercent: number;
785
+ memoryMB: number;
786
+ ports: number[];
787
+ cwd?: string;
788
+ project?: string;
789
+ uptime?: number;
790
+ isOrphaned: boolean;
791
+ }
792
+ interface PortUsage {
793
+ port: number;
794
+ pid: number;
795
+ process: string;
796
+ type: DevProcessType;
797
+ project?: string;
798
+ }
799
+ interface DeployLog {
800
+ id: string;
801
+ platform: string;
802
+ project: string;
803
+ status: 'building' | 'ready' | 'error' | 'canceled';
804
+ url?: string;
805
+ branch?: string;
806
+ commit?: string;
807
+ createdAt: number;
808
+ readyAt?: number;
809
+ errorMessage?: string;
810
+ }
811
+ interface RuntimeLog {
812
+ timestamp: number;
813
+ level: 'info' | 'warn' | 'error' | 'debug';
814
+ message: string;
815
+ source?: string;
816
+ platform: string;
817
+ }
818
+ interface BuildStatus {
819
+ platform: string;
820
+ project: string;
821
+ latestDeployId: string;
822
+ status: 'building' | 'ready' | 'error' | 'canceled';
823
+ url?: string;
824
+ lastDeployed: number;
825
+ }
826
+ interface InfraOverview {
827
+ project: string;
828
+ platforms: {
829
+ name: string;
830
+ configured: boolean;
831
+ deployCount: number;
832
+ lastDeploy?: number;
833
+ status?: string;
834
+ }[];
835
+ detectedFromTraffic: string[];
836
+ }
837
+
838
+ interface SqliteStoreOptions {
839
+ dbPath: string;
840
+ walMode?: boolean;
841
+ flushIntervalMs?: number;
842
+ batchSize?: number;
843
+ }
844
+ declare class SqliteStore {
845
+ private db;
846
+ private writeBuffer;
847
+ private flushTimer;
848
+ private readonly batchSize;
849
+ private insertEventStmt;
850
+ private insertSessionStmt;
851
+ private updateSessionDisconnectedStmt;
852
+ constructor(options: SqliteStoreOptions);
853
+ private createSchema;
854
+ addEvent(event: RuntimeEvent, project: string): void;
855
+ flush(): void;
856
+ saveSession(info: SessionInfoExtended): void;
857
+ updateSessionDisconnected(sessionId: string, disconnectedAt: number): void;
858
+ saveSessionMetrics(sessionId: string, project: string, metrics: unknown): void;
859
+ getEvents(filter: HistoricalFilter): RuntimeEvent[];
860
+ getEventCount(filter: HistoricalFilter): number;
861
+ getSessions(project: string, limit?: number): SessionInfoExtended[];
862
+ getSessionMetrics(sessionId: string): unknown | null;
863
+ getEventsByType(project: string, eventType: EventType, sinceMs?: number): RuntimeEvent[];
864
+ deleteOldEvents(beforeTimestamp: number): number;
865
+ vacuum(): void;
866
+ close(): void;
867
+ }
868
+
869
+ interface RedactionRule {
870
+ name: string;
871
+ pattern: RegExp;
872
+ replacement: string;
873
+ }
874
+ interface RedactorConfig {
875
+ enabled?: boolean;
876
+ useBuiltIn?: boolean;
877
+ rules?: RedactionRule[];
878
+ /** Redact JSON object keys matching these patterns (case-insensitive). */
879
+ sensitiveKeys?: string[];
880
+ }
881
+ /** Built-in patterns for common secret/PII formats. */
882
+ declare const BUILT_IN_RULES: RedactionRule[];
883
+ declare class Redactor {
884
+ private rules;
885
+ private sensitiveKeyPattern;
886
+ private enabled;
887
+ constructor(config?: RedactorConfig);
888
+ isEnabled(): boolean;
889
+ /** Apply all redaction rules to a string value. */
890
+ redactString(value: string): string;
891
+ /**
892
+ * Deep-walk an event and redact all string fields.
893
+ * Returns a new event object (does not mutate the original).
894
+ */
895
+ redactEvent(event: RuntimeEvent): RuntimeEvent;
896
+ private deepRedact;
897
+ }
898
+
899
+ declare class EventStore {
900
+ private buffer;
901
+ private sessions;
902
+ private sqliteStore;
903
+ private currentProject;
904
+ private onEventCallbacks;
905
+ private redactor;
906
+ constructor(capacity?: number);
907
+ setRedactor(redactor: Redactor): void;
908
+ get eventCount(): number;
909
+ setSqliteStore(store: SqliteStore, project: string): void;
910
+ onEvent(callback: (event: RuntimeEvent) => void): void;
911
+ removeEventListener(callback: (event: RuntimeEvent) => void): void;
912
+ addEvent(event: RuntimeEvent): void;
913
+ getNetworkRequests(filter?: NetworkFilter): NetworkEvent[];
914
+ getConsoleMessages(filter?: ConsoleFilter): ConsoleEvent[];
915
+ getSessionInfo(): SessionInfo[];
916
+ markDisconnected(sessionId: string): void;
917
+ getEventTimeline(filter?: TimelineFilter): RuntimeEvent[];
918
+ getAllEvents(sinceSeconds?: number, sessionId?: string): RuntimeEvent[];
919
+ getSessionIdsForProject(appName: string): string[];
920
+ getStateEvents(filter?: StateFilter): StateEvent[];
921
+ getRenderEvents(filter?: RenderFilter): RenderEvent[];
922
+ getPerformanceMetrics(filter?: PerformanceFilter): PerformanceEvent[];
923
+ getDatabaseEvents(filter?: DatabaseFilter): DatabaseEvent[];
924
+ private getLatestReconEvent;
925
+ private getReconEvents;
926
+ getReconMetadata(filter?: ReconFilter): ReconMetadataEvent | null;
927
+ getReconDesignTokens(filter?: ReconFilter): ReconDesignTokensEvent | null;
928
+ getReconFonts(filter?: ReconFilter): ReconFontsEvent | null;
929
+ getReconLayoutTree(filter?: ReconFilter): ReconLayoutTreeEvent | null;
930
+ getReconAccessibility(filter?: ReconFilter): ReconAccessibilityEvent | null;
931
+ getReconComputedStyles(filter?: ReconFilter): ReconComputedStylesEvent[];
932
+ getReconElementSnapshots(filter?: ReconFilter): ReconElementSnapshotEvent[];
933
+ getReconAssetInventory(filter?: ReconFilter): ReconAssetInventoryEvent | null;
934
+ clear(): {
935
+ clearedCount: number;
936
+ };
937
+ }
938
+
939
+ interface ApiKeyEntry {
940
+ key: string;
941
+ label: string;
942
+ project?: string;
943
+ createdAt: number;
944
+ }
945
+ interface AuthConfig {
946
+ enabled: boolean;
947
+ apiKeys: ApiKeyEntry[];
948
+ }
949
+ declare class AuthManager {
950
+ private keys;
951
+ private enabled;
952
+ constructor(config?: Partial<AuthConfig>);
953
+ isEnabled(): boolean;
954
+ /** Validate an API key. Returns the entry if valid, null if invalid. */
955
+ validate(key: string | undefined): ApiKeyEntry | null;
956
+ /** Check if request is authorized. Returns true if auth is disabled or key is valid. */
957
+ isAuthorized(key: string | undefined): boolean;
958
+ /** Extract bearer token from Authorization header value. */
959
+ static extractBearer(header: string | undefined): string | undefined;
960
+ /** Constant-time string comparison to prevent timing attacks. */
961
+ private safeCompare;
962
+ }
963
+ /** Generate a cryptographically secure API key (64 hex chars = 32 bytes). */
964
+ declare function generateApiKey(label: string, project?: string): ApiKeyEntry;
965
+
966
+ interface GlobalConfig {
967
+ defaultPort: number;
968
+ bufferSize: number;
969
+ httpPort: number;
970
+ /** Authentication configuration */
971
+ auth?: {
972
+ enabled: boolean;
973
+ apiKeys: ApiKeyEntry[];
974
+ };
975
+ /** TLS certificate paths */
976
+ tls?: {
977
+ certPath: string;
978
+ keyPath: string;
979
+ caPath?: string;
980
+ };
981
+ /** CORS allowed origins (defaults to '*' when not set) */
982
+ corsOrigins?: string[];
983
+ /** Rate limiting configuration */
984
+ rateLimits?: {
985
+ maxEventsPerSecond?: number;
986
+ maxEventsPerMinute?: number;
987
+ };
988
+ /** Payload redaction configuration */
989
+ redaction?: {
990
+ enabled: boolean;
991
+ rules?: {
992
+ name: string;
993
+ pattern: string;
994
+ replacement: string;
995
+ }[];
996
+ };
997
+ }
998
+ interface ProjectConfig {
999
+ name: string;
1000
+ createdAt: string;
1001
+ sdkVersion?: string;
1002
+ settings: {
1003
+ bufferSize?: number;
1004
+ retentionDays?: number;
1005
+ };
1006
+ }
1007
+ interface InfrastructureConfig {
1008
+ project?: string;
1009
+ databases?: Record<string, {
1010
+ type: string;
1011
+ connection_string?: string;
1012
+ project_ref?: string;
1013
+ service_key?: string;
1014
+ label?: string;
1015
+ }>;
1016
+ deployments?: Record<string, {
1017
+ platform: string;
1018
+ project_id?: string;
1019
+ team_id?: string;
1020
+ worker_name?: string;
1021
+ account_id?: string;
1022
+ }>;
1023
+ services?: Record<string, string>;
1024
+ }
1025
+ declare class ProjectManager {
1026
+ private readonly baseDir;
1027
+ constructor(baseDir?: string);
1028
+ get rootDir(): string;
1029
+ getProjectDir(projectName: string): string;
1030
+ getProjectDbPath(projectName: string): string;
1031
+ getSessionsDir(projectName: string): string;
1032
+ getSessionSnapshotPath(projectName: string, sessionId: string, timestamp: number): string;
1033
+ ensureGlobalDir(): void;
1034
+ ensureProjectDir(projectName: string): void;
1035
+ getGlobalConfig(): GlobalConfig;
1036
+ saveGlobalConfig(config: GlobalConfig): void;
1037
+ getProjectConfig(projectName: string): ProjectConfig | null;
1038
+ saveProjectConfig(projectName: string, config: ProjectConfig): void;
1039
+ getInfrastructureConfig(projectName: string): InfrastructureConfig | null;
1040
+ getClaudeInstructions(projectName: string): string | null;
1041
+ listProjects(): string[];
1042
+ projectExists(projectName: string): boolean;
1043
+ resolveEnvVars(value: string): string;
1044
+ private mkdirp;
1045
+ private readJson;
1046
+ private writeJson;
1047
+ private resolveConfigEnvVars;
1048
+ /**
1049
+ * Minimal YAML parser for simple infrastructure config files.
1050
+ * Handles flat key-value pairs and one level of nesting.
1051
+ * For full YAML support, install js-yaml.
1052
+ */
1053
+ private parseSimpleYaml;
1054
+ }
1055
+
1056
+ interface RateLimitConfig {
1057
+ maxEventsPerSecond?: number;
1058
+ maxEventsPerMinute?: number;
1059
+ }
1060
+ declare class SessionRateLimiter {
1061
+ private windows;
1062
+ private maxPerSecond;
1063
+ private maxPerMinute;
1064
+ private _droppedTotal;
1065
+ constructor(config?: RateLimitConfig);
1066
+ get droppedTotal(): number;
1067
+ isEnabled(): boolean;
1068
+ /** Returns true if the event should be accepted, false if rate-limited. */
1069
+ allow(sessionId: string): boolean;
1070
+ /** Allow a batch of N events. Returns the number accepted. */
1071
+ allowBatch(sessionId: string, count: number): number;
1072
+ /** Remove tracking for sessions that haven't been seen in maxAgeMs. */
1073
+ prune(maxAgeMs?: number): void;
1074
+ private maybeWarn;
1075
+ }
1076
+
1077
+ interface TlsConfig {
1078
+ certPath: string;
1079
+ keyPath: string;
1080
+ caPath?: string;
1081
+ }
1082
+ /**
1083
+ * Load TLS certificate files and return options suitable for
1084
+ * https.createServer() or tls.createSecureContext().
1085
+ */
1086
+ declare function loadTlsOptions(config: TlsConfig): SecureContextOptions;
1087
+ /**
1088
+ * Resolve TLS config from environment variables.
1089
+ * Returns null if TLS is not configured.
1090
+ */
1091
+ declare function resolveTlsConfig(): TlsConfig | null;
1092
+
1093
+ interface CollectorServerOptions {
1094
+ port?: number;
1095
+ host?: string;
1096
+ bufferSize?: number;
1097
+ maxRetries?: number;
1098
+ retryDelayMs?: number;
1099
+ projectManager?: ProjectManager;
1100
+ authManager?: AuthManager;
1101
+ rateLimits?: RateLimitConfig;
1102
+ tls?: TlsConfig;
1103
+ }
1104
+ declare class CollectorServer {
1105
+ private wss;
1106
+ private store;
1107
+ private projectManager;
1108
+ private authManager;
1109
+ private rateLimiter;
1110
+ private clients;
1111
+ private pendingHandshakes;
1112
+ private pendingCommands;
1113
+ private sqliteStores;
1114
+ private disconnectCallbacks;
1115
+ private pruneTimer;
1116
+ private tlsConfig;
1117
+ constructor(options?: CollectorServerOptions);
1118
+ getStore(): EventStore;
1119
+ getPort(): number | null;
1120
+ getClientCount(): number;
1121
+ getProjectManager(): ProjectManager | null;
1122
+ getSqliteStore(projectName: string): SqliteStore | undefined;
1123
+ getSqliteStores(): Map<string, SqliteStore>;
1124
+ getRateLimiter(): SessionRateLimiter;
1125
+ onDisconnect(cb: (sessionId: string, projectName: string) => void): void;
1126
+ start(options?: CollectorServerOptions): Promise<void>;
1127
+ private tryStart;
1128
+ private handleStartError;
1129
+ private ensureSqliteStore;
1130
+ private setupConnectionHandler;
1131
+ private handleMessage;
1132
+ /** Find the WebSocket for a given sessionId */
1133
+ private findWsBySessionId;
1134
+ /** Get the first connected session ID (for single-app use) */
1135
+ getFirstSessionId(): string | undefined;
1136
+ /** Get the project name for a session */
1137
+ getProjectForSession(sessionId: string): string | undefined;
1138
+ /** Send a command to the SDK and await the response */
1139
+ sendCommand(sessionId: string, command: {
1140
+ command: string;
1141
+ requestId: string;
1142
+ params?: Record<string, unknown>;
1143
+ }, timeoutMs?: number): Promise<unknown>;
1144
+ stop(): void;
1145
+ }
1146
+
1147
+ /**
1148
+ * Fixed-size circular buffer. When full, new items overwrite the oldest.
1149
+ * Optimized for append-heavy workloads with periodic filtered scans.
1150
+ */
1151
+ declare class RingBuffer<T> {
1152
+ private capacity;
1153
+ private buffer;
1154
+ private head;
1155
+ private _count;
1156
+ constructor(capacity: number);
1157
+ get count(): number;
1158
+ push(item: T): void;
1159
+ /** Returns all items from oldest to newest. */
1160
+ toArray(): T[];
1161
+ /** Returns matching items from newest to oldest (most recent first). */
1162
+ query(predicate: (item: T) => boolean): T[];
1163
+ clear(): void;
1164
+ }
1165
+
1166
+ /**
1167
+ * Runs all pattern detectors against a set of events and returns
1168
+ * prioritized issues sorted by severity (high → medium → low).
1169
+ */
1170
+ declare function detectIssues(events: RuntimeEvent[]): DetectedIssue[];
1171
+
1172
+ declare class ApiDiscoveryEngine {
1173
+ private endpoints;
1174
+ private store;
1175
+ constructor(store: EventStore);
1176
+ rebuild(): void;
1177
+ private ingestEvent;
1178
+ private refineEndpoints;
1179
+ getCatalog(filter?: {
1180
+ service?: string;
1181
+ minCalls?: number;
1182
+ }): ApiEndpoint[];
1183
+ getHealth(filter?: {
1184
+ endpoint?: string;
1185
+ sinceSeconds?: number;
1186
+ }): ApiEndpointHealth[];
1187
+ getDocumentation(filter?: {
1188
+ service?: string;
1189
+ format?: string;
1190
+ }): string;
1191
+ getServiceMap(): ServiceInfo[];
1192
+ getApiChanges(sessionA: string, sessionB: string): ApiChangeRecord[];
1193
+ private buildCatalogFromEvents;
1194
+ detectIssues(): DetectedIssue[];
1195
+ }
1196
+
1197
+ declare function aggregateQueryStats(events: DatabaseEvent[]): NormalizedQueryStats[];
1198
+ declare function detectN1Queries(events: DatabaseEvent[]): DetectedIssue[];
1199
+ declare function detectSlowQueries(events: DatabaseEvent[], thresholdMs?: number): DetectedIssue[];
1200
+ declare function suggestIndexes(events: DatabaseEvent[]): IndexSuggestion[];
1201
+ declare function detectOverfetching(events: DatabaseEvent[]): DetectedIssue[];
1202
+
1203
+ interface ManagedConnection {
1204
+ config: DatabaseConnectionConfig;
1205
+ client: unknown;
1206
+ isHealthy: boolean;
1207
+ lastChecked: number;
1208
+ }
1209
+ declare class ConnectionManager {
1210
+ private connections;
1211
+ addConnection(config: DatabaseConnectionConfig): Promise<void>;
1212
+ getConnection(id: string): ManagedConnection | undefined;
1213
+ listConnections(): {
1214
+ id: string;
1215
+ type: string;
1216
+ label?: string;
1217
+ isHealthy: boolean;
1218
+ }[];
1219
+ healthCheck(id: string): Promise<boolean>;
1220
+ closeConnection(id: string): Promise<void>;
1221
+ closeAll(): Promise<void>;
1222
+ private dynamicRequire;
1223
+ private createClient;
1224
+ }
1225
+
1226
+ declare class SchemaIntrospector {
1227
+ introspect(connection: ManagedConnection, tableName?: string): Promise<DatabaseSchema>;
1228
+ private introspectPostgres;
1229
+ private introspectMysql;
1230
+ private introspectSqlite;
1231
+ }
1232
+
1233
+ interface ReadOptions {
1234
+ table: string;
1235
+ limit?: number;
1236
+ offset?: number;
1237
+ where?: string;
1238
+ orderBy?: string;
1239
+ }
1240
+ interface ReadResult {
1241
+ rows: Record<string, unknown>[];
1242
+ total: number;
1243
+ limit: number;
1244
+ offset: number;
1245
+ }
1246
+ interface WriteOptions {
1247
+ table: string;
1248
+ operation: 'insert' | 'update' | 'delete';
1249
+ data?: Record<string, unknown>;
1250
+ where?: string;
1251
+ }
1252
+ interface WriteResult {
1253
+ success: boolean;
1254
+ affectedRows: number;
1255
+ error?: string;
1256
+ }
1257
+ declare class DataBrowser {
1258
+ read(connection: ManagedConnection, options: ReadOptions): Promise<ReadResult>;
1259
+ write(connection: ManagedConnection, options: WriteOptions): Promise<WriteResult>;
1260
+ private assertLocalhost;
1261
+ private readPostgres;
1262
+ private writePostgres;
1263
+ private readMysql;
1264
+ private writeMysql;
1265
+ private readSqlite;
1266
+ private writeSqlite;
1267
+ }
1268
+
1269
+ declare class ProcessMonitor {
1270
+ private store;
1271
+ private scanInterval;
1272
+ private processes;
1273
+ private lastActivity;
1274
+ constructor(store: EventStore);
1275
+ start(intervalMs?: number): void;
1276
+ stop(): void;
1277
+ scan(): void;
1278
+ getProcesses(filter?: {
1279
+ project?: string;
1280
+ type?: DevProcessType;
1281
+ }): DevProcess[];
1282
+ killProcess(pid: number, signal?: 'SIGTERM' | 'SIGKILL'): {
1283
+ success: boolean;
1284
+ error?: string;
1285
+ };
1286
+ getPortUsage(port?: number): PortUsage[];
1287
+ detectIssues(): DetectedIssue[];
1288
+ }
1289
+
1290
+ declare class InfraConnector {
1291
+ private store;
1292
+ private clients;
1293
+ constructor(store: EventStore);
1294
+ loadFromConfig(projectManager: ProjectManager, projectName: string): void;
1295
+ getDeployLogs(project: string, platform?: string, deployId?: string): Promise<DeployLog[]>;
1296
+ getRuntimeLogs(project: string, opts?: {
1297
+ platform?: string;
1298
+ since?: number;
1299
+ level?: string;
1300
+ }): Promise<RuntimeLog[]>;
1301
+ getBuildStatus(project: string): Promise<BuildStatus[]>;
1302
+ getInfraOverview(project?: string): InfraOverview[];
1303
+ }
1304
+
1305
+ declare class SessionManager {
1306
+ private projectManager;
1307
+ private sqliteStores;
1308
+ private store;
1309
+ constructor(projectManager: ProjectManager, sqliteStores: Map<string, SqliteStore>, store: EventStore);
1310
+ computeMetrics(sessionId: string, project: string, events: RuntimeEvent[]): SessionMetrics;
1311
+ createSnapshot(sessionId: string, project: string): SessionSnapshot;
1312
+ getSessionHistory(project: string, limit?: number): SessionSnapshot[];
1313
+ }
1314
+
1315
+ declare function compareSessions(metricsA: SessionMetrics, metricsB: SessionMetrics): SessionDiffResult;
1316
+
1317
+ interface HttpServerOptions {
1318
+ port?: number;
1319
+ host?: string;
1320
+ authManager?: AuthManager;
1321
+ allowedOrigins?: string[];
1322
+ tls?: TlsConfig;
1323
+ }
1324
+ declare class HttpServer {
1325
+ private server;
1326
+ private wss;
1327
+ private store;
1328
+ private processMonitor;
1329
+ private authManager;
1330
+ private allowedOrigins;
1331
+ private dashboardClients;
1332
+ private eventListener;
1333
+ private routes;
1334
+ private sdkBundlePath;
1335
+ private activePort;
1336
+ private startedAt;
1337
+ constructor(store: EventStore, processMonitor?: ProcessMonitor, options?: {
1338
+ authManager?: AuthManager;
1339
+ allowedOrigins?: string[];
1340
+ });
1341
+ private registerRoutes;
1342
+ /**
1343
+ * Resolve the SDK IIFE bundle path.
1344
+ * Tries multiple locations for monorepo and installed-package scenarios.
1345
+ */
1346
+ private resolveSdkPath;
1347
+ start(options?: HttpServerOptions): Promise<void>;
1348
+ private tryStart;
1349
+ stop(): Promise<void>;
1350
+ broadcastEvent(event: RuntimeEvent): void;
1351
+ private handleRequest;
1352
+ private setCorsHeaders;
1353
+ private json;
1354
+ }
1355
+
1356
+ export { type ApiChangeRecord, type ApiContract, type ApiContractField, ApiDiscoveryEngine, type ApiEndpoint, type ApiEndpointHealth, type ApiKeyEntry, type AuthConfig, type AuthInfo, AuthManager, BUILT_IN_RULES, type BackgroundSpriteSheet, type BaseEvent, type BuildMeta, type BuildStatus, type CSSArchitecture, type CSSCustomProperty, CollectorServer, type CollectorServerOptions, type ColorToken, type CommandResponse, type ComputedStyleEntry, ConnectionManager, type ConsoleEvent, type ConsoleFilter, type ConsoleLevel, DataBrowser, type DatabaseConnectionConfig, type DatabaseEvent, type DatabaseFilter, type DatabaseOperation, type DatabaseSchema, type DatabaseSource, type DeployLog, type DetectedBuildTool, type DetectedFramework, type DetectedHosting, type DetectedIssue, type DetectedMetaFramework, type DetectedUILibrary, type DevProcess, type DevProcessType, type DomSnapshotEvent, type ElementSnapshotNode, type EventBatchPayload, EventStore, type EventType, type FontFaceInfo, type FontUsage, type FormFieldInfo, type GlobalConfig, type GraphQLOperation, type HandshakePayload, type HeadingInfo, type HistoricalFilter, HttpServer, type HttpServerOptions, type IconFontInfo, type ImageAsset, type IndexSuggestion, InfraConnector, type InfraOverview, type InfrastructureConfig, type InlineSVGAsset, type InteractiveElementInfo, type IssueSeverity, type LandmarkInfo, type LayoutNode, type ManagedConnection, type MaskSpriteSheet, type MetricDelta, type NetworkEvent, type NetworkFilter, type NormalizedQueryStats, type PerformanceEvent, type PerformanceFilter, type PerformanceMetricName, type PortUsage, ProcessMonitor, type ProjectConfig, ProjectManager, type RateLimitConfig, type ReadOptions, type ReadResult, type ReconAccessibilityEvent, type ReconAssetInventoryEvent, type ReconComputedStylesEvent, type ReconDesignTokensEvent, type ReconElementSnapshotEvent, type ReconEventType, type ReconFilter, type ReconFontsEvent, type ReconLayoutTreeEvent, type ReconMetadataEvent, type RedactionRule, Redactor, type RedactorConfig, type RenderComponentProfile, type RenderEvent, type RenderFilter, RingBuffer, type RuntimeEvent, type RuntimeLog, type SVGSpriteSymbol, type SchemaColumn, type SchemaForeignKey, type SchemaIndex, SchemaIntrospector, type SchemaTable, type ServerCommand, type ServerMetricName, type ServiceInfo, type SessionDiffResult, type SessionEvent, type SessionInfo, type SessionInfoExtended, SessionManager, type SessionMetrics, SessionRateLimiter, type SessionSnapshot, type SpacingValue, type SpriteFrame, SqliteStore, type SqliteStoreOptions, type StateEvent, type StateFilter, type TechStackDetection, type TimelineFilter, type TlsConfig, type ToolResponse, type TypographyToken, type WSMessage, type WebVitalRating, type WriteOptions, type WriteResult, aggregateQueryStats, compareSessions, detectIssues, detectN1Queries, detectOverfetching, detectSlowQueries, generateApiKey, loadTlsOptions, resolveTlsConfig, suggestIndexes };