@qontinui/ui-bridge 0.2.0 → 0.3.1

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 (140) hide show
  1. package/dist/ai/index.d.mts +312 -155
  2. package/dist/ai/index.d.ts +312 -155
  3. package/dist/ai/index.js +2363 -67
  4. package/dist/ai/index.js.map +1 -1
  5. package/dist/ai/index.mjs +2328 -68
  6. package/dist/ai/index.mjs.map +1 -1
  7. package/dist/annotations/index.d.mts +218 -0
  8. package/dist/annotations/index.d.ts +218 -0
  9. package/dist/annotations/index.js +246 -0
  10. package/dist/annotations/index.js.map +1 -0
  11. package/dist/annotations/index.mjs +241 -0
  12. package/dist/annotations/index.mjs.map +1 -0
  13. package/dist/assertions-BSR3afVr.d.ts +161 -0
  14. package/dist/assertions-CTw1hfOx.d.mts +161 -0
  15. package/dist/babel-plugin/index.js +504 -0
  16. package/dist/babel-plugin/index.js.map +1 -0
  17. package/dist/babel-plugin/index.mjs +488 -0
  18. package/dist/babel-plugin/index.mjs.map +1 -0
  19. package/dist/browser-capture-Bms60T6f.d.mts +47 -0
  20. package/dist/browser-capture-CsTU29mb.d.ts +47 -0
  21. package/dist/control/index.d.mts +26 -7
  22. package/dist/control/index.d.ts +26 -7
  23. package/dist/control/index.js +276 -48
  24. package/dist/control/index.js.map +1 -1
  25. package/dist/control/index.mjs +276 -48
  26. package/dist/control/index.mjs.map +1 -1
  27. package/dist/core/index.d.mts +115 -44
  28. package/dist/core/index.d.ts +115 -44
  29. package/dist/core/index.js +0 -1560
  30. package/dist/core/index.js.map +1 -1
  31. package/dist/core/index.mjs +1 -1549
  32. package/dist/core/index.mjs.map +1 -1
  33. package/dist/debug/index.d.mts +5 -3
  34. package/dist/debug/index.d.ts +5 -3
  35. package/dist/debug/index.js +925 -1
  36. package/dist/debug/index.js.map +1 -1
  37. package/dist/debug/index.mjs +924 -2
  38. package/dist/debug/index.mjs.map +1 -1
  39. package/dist/index.d.mts +13 -9
  40. package/dist/index.d.ts +13 -9
  41. package/dist/index.js +8310 -3777
  42. package/dist/index.js.map +1 -1
  43. package/dist/index.mjs +8246 -3766
  44. package/dist/index.mjs.map +1 -1
  45. package/dist/{metrics-NC3csD0R.d.mts → metrics-DuA2qIIz.d.mts} +2 -2
  46. package/dist/{metrics-C9XRi_mL.d.ts → metrics-KFAAKNEB.d.ts} +2 -2
  47. package/dist/native/control/index.js +448 -0
  48. package/dist/native/control/index.js.map +1 -0
  49. package/dist/native/control/index.mjs +445 -0
  50. package/dist/native/control/index.mjs.map +1 -0
  51. package/dist/native/core/index.js +486 -0
  52. package/dist/native/core/index.js.map +1 -0
  53. package/dist/native/core/index.mjs +475 -0
  54. package/dist/native/core/index.mjs.map +1 -0
  55. package/dist/native/debug/index.js +408 -0
  56. package/dist/native/debug/index.js.map +1 -0
  57. package/dist/native/debug/index.mjs +406 -0
  58. package/dist/native/debug/index.mjs.map +1 -0
  59. package/dist/native/index.js +2232 -0
  60. package/dist/native/index.js.map +1 -0
  61. package/dist/native/index.mjs +2204 -0
  62. package/dist/native/index.mjs.map +1 -0
  63. package/dist/native/react/index.js +1377 -0
  64. package/dist/native/react/index.js.map +1 -0
  65. package/dist/native/react/index.mjs +1365 -0
  66. package/dist/native/react/index.mjs.map +1 -0
  67. package/dist/native/server/index.js +440 -0
  68. package/dist/native/server/index.js.map +1 -0
  69. package/dist/native/server/index.mjs +435 -0
  70. package/dist/native/server/index.mjs.map +1 -0
  71. package/dist/react/index.d.mts +121 -9
  72. package/dist/react/index.d.ts +121 -9
  73. package/dist/react/index.js +2239 -91
  74. package/dist/react/index.js.map +1 -1
  75. package/dist/react/index.mjs +2239 -92
  76. package/dist/react/index.mjs.map +1 -1
  77. package/dist/{registry-CIEDjbQ9.d.ts → registry-C6dDtn1v.d.ts} +34 -15
  78. package/dist/{registry-SsSDq46X.d.mts → registry-POtcxnal.d.mts} +34 -15
  79. package/dist/render-log/index.d.mts +1 -1
  80. package/dist/render-log/index.d.ts +1 -1
  81. package/dist/server/express.d.mts +37 -0
  82. package/dist/server/express.d.ts +37 -0
  83. package/dist/server/express.js +298 -0
  84. package/dist/server/express.js.map +1 -0
  85. package/dist/server/express.mjs +294 -0
  86. package/dist/server/express.mjs.map +1 -0
  87. package/dist/server/handlers.d.mts +124 -0
  88. package/dist/server/handlers.d.ts +124 -0
  89. package/dist/server/handlers.js +7183 -0
  90. package/dist/server/handlers.js.map +1 -0
  91. package/dist/server/handlers.mjs +7180 -0
  92. package/dist/server/handlers.mjs.map +1 -0
  93. package/dist/server/index.d.mts +12 -0
  94. package/dist/server/index.d.ts +12 -0
  95. package/dist/server/index.js +8384 -0
  96. package/dist/server/index.js.map +1 -0
  97. package/dist/server/index.mjs +8369 -0
  98. package/dist/server/index.mjs.map +1 -0
  99. package/dist/server/nextjs.d.mts +128 -0
  100. package/dist/server/nextjs.d.ts +128 -0
  101. package/dist/server/nextjs.js +390 -0
  102. package/dist/server/nextjs.js.map +1 -0
  103. package/dist/server/nextjs.mjs +385 -0
  104. package/dist/server/nextjs.mjs.map +1 -0
  105. package/dist/server/standalone.d.mts +7 -0
  106. package/dist/server/standalone.d.ts +7 -0
  107. package/dist/server/standalone.js +845 -0
  108. package/dist/server/standalone.js.map +1 -0
  109. package/dist/server/standalone.mjs +841 -0
  110. package/dist/server/standalone.mjs.map +1 -0
  111. package/dist/specs/index.d.mts +365 -0
  112. package/dist/specs/index.d.ts +365 -0
  113. package/dist/specs/index.js +2809 -0
  114. package/dist/specs/index.js.map +1 -0
  115. package/dist/specs/index.mjs +2786 -0
  116. package/dist/specs/index.mjs.map +1 -0
  117. package/dist/standalone-B6GLIEmR.d.ts +216 -0
  118. package/dist/standalone-CjdYqj3P.d.mts +216 -0
  119. package/dist/swc-plugin/index.d.mts +79 -0
  120. package/dist/swc-plugin/index.d.ts +79 -0
  121. package/dist/swc-plugin/index.js +15 -0
  122. package/dist/swc-plugin/index.js.map +1 -0
  123. package/dist/swc-plugin/index.mjs +9 -0
  124. package/dist/swc-plugin/index.mjs.map +1 -0
  125. package/dist/types-B2EfvEaq.d.ts +236 -0
  126. package/dist/{types-Dr6tH-bm.d.mts → types-C7gVYRnF.d.ts} +72 -2
  127. package/dist/{types-oCTrRxSw.d.ts → types-CJGrBEhC.d.mts} +72 -2
  128. package/dist/types-CebMQj76.d.ts +1275 -0
  129. package/dist/types-D_ypYl3T.d.mts +1275 -0
  130. package/dist/types-UBtp7R0u.d.mts +132 -0
  131. package/dist/types-UBtp7R0u.d.ts +132 -0
  132. package/dist/types-gO696T_t.d.mts +236 -0
  133. package/dist/{types-CPMbN_Iw.d.mts → types-suaYwWWg.d.mts} +519 -152
  134. package/dist/{types-CPMbN_Iw.d.ts → types-suaYwWWg.d.ts} +519 -152
  135. package/package.json +123 -4
  136. package/swc-plugin-wasm/ui_bridge_swc_plugin.wasm +0 -0
  137. package/dist/types-BvCfFuEV.d.ts +0 -534
  138. package/dist/types-CFT3Dnx4.d.mts +0 -534
  139. package/dist/websocket-client-CX4QJesI.d.ts +0 -124
  140. package/dist/websocket-client-C_Na0OSp.d.mts +0 -124
@@ -1,8 +1,142 @@
1
+ /**
2
+ * Browser Event Capture Types
3
+ *
4
+ * Discriminated union of all browser-side events captured for debugging.
5
+ */
6
+ type BrowserEventType = 'console' | 'network' | 'react-error' | 'navigation' | 'long-task' | 'long-animation-frame' | 'resource-error' | 'web-vital' | 'memory' | 'ws-disconnection' | 'hmr';
7
+ interface BrowserCapturedEvent {
8
+ type: BrowserEventType;
9
+ timestamp: number;
10
+ url: string;
11
+ }
12
+ interface ConsoleCapturedEvent extends BrowserCapturedEvent {
13
+ type: 'console';
14
+ level: 'error' | 'warn' | 'unhandledrejection';
15
+ message: string;
16
+ stack?: string;
17
+ }
18
+ interface NetworkCapturedEvent extends BrowserCapturedEvent {
19
+ type: 'network';
20
+ method: string;
21
+ requestUrl: string;
22
+ status?: number;
23
+ statusText?: string;
24
+ durationMs: number;
25
+ kind: 'http-error' | 'network-error' | 'timeout' | 'cors' | 'abort';
26
+ errorMessage?: string;
27
+ }
28
+ interface ReactErrorCapturedEvent extends BrowserCapturedEvent {
29
+ type: 'react-error';
30
+ message: string;
31
+ stack?: string;
32
+ componentStack?: string;
33
+ }
34
+ interface NavigationCapturedEvent extends BrowserCapturedEvent {
35
+ type: 'navigation';
36
+ from: string;
37
+ to: string;
38
+ trigger: 'pushState' | 'replaceState' | 'popstate';
39
+ }
40
+ interface LongTaskCapturedEvent extends BrowserCapturedEvent {
41
+ type: 'long-task';
42
+ durationMs: number;
43
+ }
44
+ interface ResourceErrorCapturedEvent extends BrowserCapturedEvent {
45
+ type: 'resource-error';
46
+ resourceUrl: string;
47
+ tagName: string;
48
+ }
49
+ interface WebVitalCapturedEvent extends BrowserCapturedEvent {
50
+ type: 'web-vital';
51
+ metric: 'LCP' | 'CLS';
52
+ value: number;
53
+ }
54
+ interface MemoryCapturedEvent extends BrowserCapturedEvent {
55
+ type: 'memory';
56
+ usedJSHeapSize: number;
57
+ totalJSHeapSize: number;
58
+ jsHeapSizeLimit: number;
59
+ }
60
+ interface WsDisconnectionCapturedEvent extends BrowserCapturedEvent {
61
+ type: 'ws-disconnection';
62
+ previousState: string;
63
+ newState: string;
64
+ reconnectAttempt?: number;
65
+ }
66
+ interface HmrCapturedEvent extends BrowserCapturedEvent {
67
+ type: 'hmr';
68
+ level: 'error' | 'warning';
69
+ message: string;
70
+ /** Source file that caused the error, if available */
71
+ moduleName?: string;
72
+ /** Source location (line:col), if available */
73
+ loc?: string;
74
+ }
75
+ interface LoafScriptAttribution {
76
+ invoker: string;
77
+ sourceURL: string;
78
+ sourceFunctionName: string;
79
+ sourceCharPosition: number;
80
+ duration: number;
81
+ }
82
+ interface LoafCapturedEvent extends BrowserCapturedEvent {
83
+ type: 'long-animation-frame';
84
+ durationMs: number;
85
+ blockingDurationMs: number;
86
+ scripts: LoafScriptAttribution[];
87
+ }
88
+ type AnyCapturedEvent = ConsoleCapturedEvent | NetworkCapturedEvent | ReactErrorCapturedEvent | NavigationCapturedEvent | LongTaskCapturedEvent | LoafCapturedEvent | ResourceErrorCapturedEvent | WebVitalCapturedEvent | MemoryCapturedEvent | WsDisconnectionCapturedEvent | HmrCapturedEvent;
89
+ type OnBrowserEventCallback = (event: AnyCapturedEvent) => void;
90
+ interface CapturedError {
91
+ timestamp: number;
92
+ level: 'error' | 'warn' | 'unhandledrejection';
93
+ message: string;
94
+ stack?: string;
95
+ }
96
+ /**
97
+ * @deprecated Use OnBrowserEventCallback instead
98
+ */
99
+ type OnCaptureCallback = (entry: CapturedError) => void;
100
+ interface BrowserCaptureConfig {
101
+ /** Capture console.error/warn + unhandled rejections. Default: true */
102
+ console?: boolean;
103
+ /** Capture failed fetch requests (4xx/5xx/network errors). Default: true */
104
+ network?: boolean;
105
+ /** Capture History API navigation. Default: true */
106
+ navigation?: boolean;
107
+ /** Capture PerformanceObserver long tasks. Default: true */
108
+ longTasks?: boolean;
109
+ /** Capture Long Animation Frames (LoAF) with script attribution. Default: true */
110
+ longAnimationFrames?: boolean;
111
+ /** Capture failed resource loads (img/script/link). Default: true */
112
+ resourceErrors?: boolean;
113
+ /** Capture WebSocket disconnection events. Default: true */
114
+ wsDisconnections?: boolean;
115
+ /** Capture Next.js HMR compilation errors/warnings via EventSource. Default: true */
116
+ hmr?: boolean;
117
+ /** Capture Web Vitals (LCP, CLS). Default: false (opt-in) */
118
+ webVitals?: boolean;
119
+ /** Capture Chrome memory snapshots. Default: false (opt-in) */
120
+ memory?: boolean;
121
+ /** Advanced: network capture options */
122
+ networkOptions?: {
123
+ /** URL patterns to ignore (substrings). Defaults to dev-debug/ui-bridge endpoints. */
124
+ ignorePatterns?: string[];
125
+ };
126
+ /** Advanced: memory polling interval in ms. Default: 30000 */
127
+ memoryIntervalMs?: number;
128
+ /** Maximum buffer size. Default: 200 */
129
+ maxEntries?: number;
130
+ }
131
+ declare const DEFAULT_CAPTURE_CONFIG: Required<Pick<BrowserCaptureConfig, 'console' | 'network' | 'navigation' | 'longTasks' | 'longAnimationFrames' | 'resourceErrors' | 'wsDisconnections' | 'hmr' | 'webVitals' | 'memory' | 'memoryIntervalMs' | 'maxEntries'>>;
132
+
1
133
  /**
2
134
  * UI Bridge Core Types
3
135
  *
4
- * Defines the fundamental types used throughout the UI Bridge framework.
136
+ * Defines the fundamental types used throughout the UI Bridge framework,
137
+ * plus ui-bridge-specific types (WebSocket protocol, accessibility, extended workflow types).
5
138
  */
139
+
6
140
  /**
7
141
  * Element identification using multiple strategies
8
142
  */
@@ -63,6 +197,29 @@ interface ElementState {
63
197
  * Types of UI elements that can be registered
64
198
  */
65
199
  type ElementType = 'button' | 'input' | 'select' | 'checkbox' | 'radio' | 'link' | 'form' | 'textarea' | 'menu' | 'menuitem' | 'tab' | 'dialog' | 'custom' | 'switch' | 'slider' | 'combobox' | 'listbox' | 'option' | 'textbox' | 'generic';
200
+ /**
201
+ * Types of static content elements (non-interactive)
202
+ */
203
+ type ContentType = 'heading' | 'paragraph' | 'list-item' | 'table-cell' | 'table-header' | 'label' | 'caption' | 'blockquote' | 'code-block' | 'badge' | 'status-message' | 'metric-value' | 'description-text' | 'nav-text' | 'content-generic';
204
+ /**
205
+ * Semantic role of content elements
206
+ */
207
+ type ContentRole = 'heading' | 'body-text' | 'list-item' | 'table-cell' | 'table-header' | 'label' | 'caption' | 'quote' | 'code' | 'badge' | 'status' | 'metric' | 'description' | 'navigation' | 'generic';
208
+ /**
209
+ * Metadata for content elements
210
+ */
211
+ interface ContentMetadata {
212
+ /** Semantic role of the content */
213
+ contentRole: ContentRole;
214
+ /** Heading level (1-6) for heading content */
215
+ headingLevel?: number;
216
+ /** Whether the content is dynamically updated */
217
+ dynamic?: boolean;
218
+ /** Stable text prefix for identification when full text changes */
219
+ stableTextPrefix?: string;
220
+ /** Structural context (e.g., "table > tbody > tr:nth-child(2)") */
221
+ structuralContext?: string;
222
+ }
66
223
  /**
67
224
  * Standard actions available on elements
68
225
  */
@@ -108,6 +265,10 @@ interface RegisteredElement {
108
265
  registeredAt: number;
109
266
  /** Whether this element is currently mounted */
110
267
  mounted: boolean;
268
+ /** Whether this is an interactive element or static content */
269
+ category?: 'interactive' | 'content';
270
+ /** Metadata for content elements */
271
+ contentMetadata?: ContentMetadata;
111
272
  /** Alternative names for natural language matching */
112
273
  aliases?: string[];
113
274
  /** Human-readable description for AI agents */
@@ -117,6 +278,10 @@ interface RegisteredElement {
117
278
  /** Purpose of the element */
118
279
  purpose?: string;
119
280
  }
281
+ /**
282
+ * Generic state getter function
283
+ */
284
+ type StateGetter<T = unknown> = () => T;
120
285
  /**
121
286
  * Component action definition
122
287
  */
@@ -150,6 +315,10 @@ interface RegisteredComponent {
150
315
  registeredAt: number;
151
316
  /** Whether this component is currently mounted */
152
317
  mounted: boolean;
318
+ /** State getter function */
319
+ getState?: StateGetter<Record<string, unknown>>;
320
+ /** Computed properties getter function */
321
+ getComputed?: () => Record<string, unknown>;
153
322
  }
154
323
  /**
155
324
  * Workflow step types
@@ -252,6 +421,25 @@ interface WorkflowStep {
252
421
  /** Log configuration (type: 'log') */
253
422
  logConfig?: LogConfig;
254
423
  }
424
+ /**
425
+ * Extended workflow step with additional branch/loop/extract support
426
+ */
427
+ interface ExtendedWorkflowStep extends WorkflowStep {
428
+ /** Branch condition (type: 'branch') */
429
+ branchCondition?: BranchCondition;
430
+ /** Steps to execute if branch condition is true */
431
+ thenSteps?: ExtendedWorkflowStep[];
432
+ /** Steps to execute if branch condition is false */
433
+ elseSteps?: ExtendedWorkflowStep[];
434
+ /** Loop configuration (type: 'loop') */
435
+ loopConfig?: LoopConfig;
436
+ /** Steps to execute in loop */
437
+ loopSteps?: ExtendedWorkflowStep[];
438
+ /** Extract configuration (type: 'extract') */
439
+ extractConfig?: ExtractConfig;
440
+ /** Log configuration (type: 'log') */
441
+ logConfig?: LogConfig;
442
+ }
255
443
  /**
256
444
  * Workflow definition
257
445
  */
@@ -332,6 +520,69 @@ interface ActionResponse {
332
520
  durationMs: number;
333
521
  /** Timestamp when the action completed */
334
522
  timestamp: number;
523
+ /** Console errors/warnings captured during action execution */
524
+ consoleErrors?: CapturedError[];
525
+ }
526
+ /**
527
+ * Machine-readable error codes for action failures
528
+ */
529
+ type ActionErrorCode = 'ELEMENT_NOT_FOUND' | 'ELEMENT_NOT_VISIBLE' | 'ELEMENT_NOT_ENABLED' | 'ELEMENT_NOT_INTERACTABLE' | 'ACTION_TIMEOUT' | 'ACTION_REJECTED' | 'STATE_NOT_REACHED' | 'NETWORK_ERROR' | 'PARSE_ERROR' | 'VALIDATION_ERROR' | 'AMBIGUOUS_MATCH' | 'LOW_CONFIDENCE' | 'UNSUPPORTED_ACTION' | 'UNKNOWN_ERROR';
530
+ /**
531
+ * Partial element match found during search
532
+ */
533
+ interface PartialMatch {
534
+ /** Element ID of the partial match */
535
+ elementId: string;
536
+ /** Match confidence score (0-1) */
537
+ confidence: number;
538
+ /** Reason for partial match */
539
+ reason: string;
540
+ /** Type of match */
541
+ type: string;
542
+ /** Description of the match */
543
+ description?: string;
544
+ }
545
+ /**
546
+ * Suggested recovery action
547
+ */
548
+ interface RecoveryAction {
549
+ /** Human-readable suggestion */
550
+ suggestion: string;
551
+ /** Optional command to execute */
552
+ command?: string;
553
+ /** Confidence score (0-1) */
554
+ confidence: number;
555
+ /** Whether the original action can be retried */
556
+ retryable: boolean;
557
+ }
558
+ /**
559
+ * Structured error details for action failures
560
+ */
561
+ interface ActionFailureDetails {
562
+ /** Machine-readable error code */
563
+ errorCode: ActionErrorCode;
564
+ /** Human-readable error message */
565
+ message: string;
566
+ /** Element ID that was targeted */
567
+ elementId?: string;
568
+ /** CSS selectors that were tried */
569
+ selectorsTried?: string[];
570
+ /** Partial matches found during element search */
571
+ partialMatches?: PartialMatch[];
572
+ /** Element state at time of failure */
573
+ elementState?: ElementState;
574
+ /** Screenshot context (base64 or URL) */
575
+ screenshotContext?: string;
576
+ /** Suggested recovery actions */
577
+ suggestedActions: RecoveryAction[];
578
+ /** Whether retrying is recommended */
579
+ retryRecommended: boolean;
580
+ /** Additional context */
581
+ context?: Record<string, unknown>;
582
+ /** Duration of the action in milliseconds */
583
+ durationMs?: number;
584
+ /** Timeout that was configured in milliseconds */
585
+ timeoutMs?: number;
335
586
  }
336
587
  /**
337
588
  * Snapshot of the entire UI bridge state
@@ -342,12 +593,14 @@ interface BridgeSnapshot {
342
593
  /** All registered elements */
343
594
  elements: Array<{
344
595
  id: string;
345
- type: ElementType;
596
+ type: ElementType | string;
346
597
  label?: string;
347
598
  identifier: ElementIdentifier;
348
599
  state: ElementState;
349
600
  actions: StandardAction[];
350
601
  customActions?: string[];
602
+ category?: 'interactive' | 'content';
603
+ contentMetadata?: ContentMetadata;
351
604
  }>;
352
605
  /** All registered components */
353
606
  components: Array<{
@@ -365,6 +618,22 @@ interface BridgeSnapshot {
365
618
  stepCount: number;
366
619
  }>;
367
620
  }
621
+ /**
622
+ * Event types emitted by the bridge
623
+ */
624
+ type BridgeEventType = 'element:registered' | 'element:unregistered' | 'element:stateChanged' | 'component:registered' | 'component:unregistered' | 'action:started' | 'action:completed' | 'action:failed' | 'workflow:started' | 'workflow:stepCompleted' | 'workflow:completed' | 'workflow:failed' | 'render:snapshot' | 'error';
625
+ /**
626
+ * Event payload structure
627
+ */
628
+ interface BridgeEvent<T = unknown> {
629
+ type: BridgeEventType;
630
+ timestamp: number;
631
+ data: T;
632
+ }
633
+ /**
634
+ * Event listener function
635
+ */
636
+ type BridgeEventListener<T = unknown> = (event: BridgeEvent<T>) => void;
368
637
  /**
369
638
  * UI Bridge feature flags
370
639
  */
@@ -394,23 +663,170 @@ interface UIBridgeConfig {
394
663
  maxLogEntries?: number;
395
664
  /** Enable verbose logging */
396
665
  verbose?: boolean;
666
+ /** Application info for discovery */
667
+ appInfo?: {
668
+ appId: string;
669
+ appName: string;
670
+ appType: 'web' | 'desktop' | 'mobile' | 'other';
671
+ framework?: string;
672
+ };
397
673
  }
398
674
  /**
399
- * Event types emitted by the bridge
675
+ * Computed property definition
400
676
  */
401
- type BridgeEventType = 'element:registered' | 'element:unregistered' | 'element:stateChanged' | 'component:registered' | 'component:unregistered' | 'action:started' | 'action:completed' | 'action:failed' | 'workflow:started' | 'workflow:stepCompleted' | 'workflow:completed' | 'workflow:failed' | 'render:snapshot' | 'error';
677
+ interface ComputedProperty<T = unknown> {
678
+ /** Getter function for the computed value */
679
+ getter: () => T;
680
+ /** Description of what the computed property represents */
681
+ description?: string;
682
+ }
402
683
  /**
403
- * Event payload structure
684
+ * Response from getting component state
404
685
  */
405
- interface BridgeEvent<T = unknown> {
406
- type: BridgeEventType;
686
+ interface ComponentStateResponse {
687
+ /** Current state values */
688
+ state: Record<string, unknown>;
689
+ /** Current computed property values */
690
+ computed: Record<string, unknown>;
691
+ /** Timestamp when the state was captured */
407
692
  timestamp: number;
408
- data: T;
409
693
  }
410
694
  /**
411
- * Event listener function
695
+ * UI State definition
696
+ *
697
+ * Represents a distinct state in the UI (e.g., "LoginForm", "Dashboard", "Modal").
698
+ * States can be active or inactive, and can block other states from activating.
412
699
  */
413
- type BridgeEventListener<T = unknown> = (event: BridgeEvent<T>) => void;
700
+ interface UIState {
701
+ /** Unique state identifier */
702
+ id: string;
703
+ /** Human-readable name */
704
+ name: string;
705
+ /** Element IDs belonging to this state */
706
+ elements: string[];
707
+ /** Optional function to detect if state is active */
708
+ activeWhen?: () => boolean;
709
+ /** If true, blocks other state activations (modal behavior) */
710
+ blocking?: boolean;
711
+ /** Specific state IDs this state blocks */
712
+ blocks?: string[];
713
+ /** State group membership */
714
+ group?: string;
715
+ /** Cost for pathfinding (default: 1.0) */
716
+ pathCost?: number;
717
+ /** Custom metadata */
718
+ metadata?: Record<string, unknown>;
719
+ }
720
+ /**
721
+ * State group - states that activate/deactivate atomically
722
+ *
723
+ * When a group is activated, all its states are activated together.
724
+ * When deactivated, all states are deactivated together.
725
+ */
726
+ interface UIStateGroup {
727
+ /** Unique group identifier */
728
+ id: string;
729
+ /** Human-readable name */
730
+ name: string;
731
+ /** State IDs belonging to this group */
732
+ states: string[];
733
+ }
734
+ /**
735
+ * State transition definition
736
+ *
737
+ * Defines how to move from one set of states to another,
738
+ * including any actions to execute during the transition.
739
+ */
740
+ interface UITransition {
741
+ /** Unique transition identifier */
742
+ id: string;
743
+ /** Human-readable name */
744
+ name: string;
745
+ /** Precondition: at least one must be active */
746
+ fromStates: string[];
747
+ /** States to activate */
748
+ activateStates: string[];
749
+ /** States to deactivate */
750
+ exitStates: string[];
751
+ /** Groups to activate */
752
+ activateGroups?: string[];
753
+ /** Groups to deactivate */
754
+ exitGroups?: string[];
755
+ /** Actions to execute during transition */
756
+ actions?: WorkflowStep[];
757
+ /** Cost for pathfinding */
758
+ pathCost?: number;
759
+ /** Whether source states remain visible during transition */
760
+ staysVisible?: boolean;
761
+ }
762
+ /**
763
+ * Path result from pathfinding
764
+ *
765
+ * Returned when searching for a path to target states.
766
+ */
767
+ interface PathResult {
768
+ /** Whether a path was found */
769
+ found: boolean;
770
+ /** Transition IDs in order to reach target */
771
+ transitions: string[];
772
+ /** Total cost of the path */
773
+ totalCost: number;
774
+ /** Target state IDs */
775
+ targetStates: string[];
776
+ /** Estimated number of steps */
777
+ estimatedSteps: number;
778
+ }
779
+ /**
780
+ * Transition execution result
781
+ */
782
+ interface TransitionResult {
783
+ /** Whether the transition succeeded */
784
+ success: boolean;
785
+ /** States that were activated */
786
+ activatedStates: string[];
787
+ /** States that were deactivated */
788
+ deactivatedStates: string[];
789
+ /** Error message if failed */
790
+ error?: string;
791
+ /** Phase where failure occurred (if any) */
792
+ failedPhase?: string;
793
+ /** Duration of the transition in milliseconds */
794
+ durationMs: number;
795
+ }
796
+ /**
797
+ * Navigation result
798
+ *
799
+ * Returned after navigating to target states via pathfinding.
800
+ */
801
+ interface NavigationResult {
802
+ /** Whether navigation succeeded */
803
+ success: boolean;
804
+ /** The path that was followed */
805
+ path: PathResult;
806
+ /** Transitions that were executed */
807
+ executedTransitions: string[];
808
+ /** Final active states after navigation */
809
+ finalActiveStates: string[];
810
+ /** Error message if failed */
811
+ error?: string;
812
+ /** Duration of the navigation in milliseconds */
813
+ durationMs: number;
814
+ }
815
+ /**
816
+ * State manager snapshot
817
+ */
818
+ interface StateSnapshot {
819
+ /** Timestamp of the snapshot */
820
+ timestamp: number;
821
+ /** Currently active state IDs */
822
+ activeStates: string[];
823
+ /** All registered states */
824
+ states: UIState[];
825
+ /** All registered state groups */
826
+ groups: UIStateGroup[];
827
+ /** All registered transitions */
828
+ transitions: UITransition[];
829
+ }
414
830
  /**
415
831
  * WebSocket message types from client to server
416
832
  */
@@ -436,11 +852,8 @@ interface WSMessageBase {
436
852
  interface WSSubscribeMessage extends WSMessageBase {
437
853
  type: 'subscribe';
438
854
  payload: {
439
- /** Event types to subscribe to (empty = all events) */
440
855
  events?: BridgeEventType[];
441
- /** Filter events by element ID */
442
856
  elementIds?: string[];
443
- /** Filter events by component ID */
444
857
  componentIds?: string[];
445
858
  };
446
859
  }
@@ -450,7 +863,6 @@ interface WSSubscribeMessage extends WSMessageBase {
450
863
  interface WSUnsubscribeMessage extends WSMessageBase {
451
864
  type: 'unsubscribe';
452
865
  payload: {
453
- /** Event types to unsubscribe from (empty = all) */
454
866
  events?: BridgeEventType[];
455
867
  };
456
868
  }
@@ -472,7 +884,7 @@ interface WSFindMessage extends WSMessageBase {
472
884
  };
473
885
  }
474
886
  /**
475
- * Client message: Discover elements
887
+ * Client message: Discover elements (deprecated)
476
888
  * @deprecated Use WSFindMessage instead
477
889
  */
478
890
  interface WSDiscoverMessage extends WSMessageBase {
@@ -506,7 +918,11 @@ interface WSExecuteActionMessage extends WSMessageBase {
506
918
  type: 'executeAction';
507
919
  payload: {
508
920
  elementId: string;
509
- action: ActionRequest;
921
+ action: {
922
+ action: string;
923
+ params?: Record<string, unknown>;
924
+ waitOptions?: WaitOptions;
925
+ };
510
926
  };
511
927
  }
512
928
  /**
@@ -528,7 +944,6 @@ interface WSExecuteWorkflowMessage extends WSMessageBase {
528
944
  payload: {
529
945
  workflowId: string;
530
946
  params?: Record<string, unknown>;
531
- /** Stream progress updates */
532
947
  streamProgress?: boolean;
533
948
  };
534
949
  }
@@ -542,11 +957,8 @@ type WSClientMessage = WSSubscribeMessage | WSUnsubscribeMessage | WSPingMessage
542
957
  interface WSWelcomeMessage extends WSMessageBase {
543
958
  type: 'welcome';
544
959
  payload: {
545
- /** Server version */
546
960
  version: string;
547
- /** Available features */
548
961
  features: UIBridgeFeatures;
549
- /** Client ID assigned by server */
550
962
  clientId: string;
551
963
  };
552
964
  }
@@ -562,7 +974,6 @@ interface WSPongMessage extends WSMessageBase {
562
974
  interface WSSubscribedMessage extends WSMessageBase {
563
975
  type: 'subscribed';
564
976
  payload: {
565
- /** Events now subscribed to */
566
977
  events: BridgeEventType[];
567
978
  };
568
979
  }
@@ -572,7 +983,6 @@ interface WSSubscribedMessage extends WSMessageBase {
572
983
  interface WSUnsubscribedMessage extends WSMessageBase {
573
984
  type: 'unsubscribed';
574
985
  payload: {
575
- /** Events unsubscribed from */
576
986
  events: BridgeEventType[];
577
987
  };
578
988
  }
@@ -588,7 +998,6 @@ interface WSEventMessage extends WSMessageBase {
588
998
  */
589
999
  interface WSResponseMessage<T = unknown> extends WSMessageBase {
590
1000
  type: 'response';
591
- /** ID of the request this responds to */
592
1001
  requestId: string;
593
1002
  payload: {
594
1003
  success: boolean;
@@ -601,7 +1010,6 @@ interface WSResponseMessage<T = unknown> extends WSMessageBase {
601
1010
  */
602
1011
  interface WSErrorMessage extends WSMessageBase {
603
1012
  type: 'error';
604
- /** ID of the request that caused the error (if applicable) */
605
1013
  requestId?: string;
606
1014
  payload: {
607
1015
  code: string;
@@ -614,23 +1022,17 @@ interface WSErrorMessage extends WSMessageBase {
614
1022
  */
615
1023
  interface WSWorkflowProgressMessage extends WSMessageBase {
616
1024
  type: 'workflowProgress';
617
- /** ID of the workflow execution request */
618
1025
  requestId: string;
619
1026
  payload: {
620
1027
  workflowId: string;
621
- /** Current step index (0-based) */
622
1028
  currentStep: number;
623
- /** Total number of steps */
624
1029
  totalSteps: number;
625
- /** Current step info */
626
1030
  step: {
627
1031
  id: string;
628
- type: WorkflowStep['type'];
1032
+ type: string;
629
1033
  status: 'pending' | 'running' | 'completed' | 'failed';
630
1034
  };
631
- /** Result of the current step (if completed) */
632
1035
  stepResult?: unknown;
633
- /** Error (if failed) */
634
1036
  error?: string;
635
1037
  };
636
1038
  }
@@ -671,140 +1073,105 @@ interface WSSubscriptionOptions {
671
1073
  componentIds?: string[];
672
1074
  }
673
1075
  /**
674
- * UI State definition
675
- *
676
- * Represents a distinct state in the UI (e.g., "LoginForm", "Dashboard", "Modal").
677
- * States can be active or inactive, and can block other states from activating.
1076
+ * ARIA checked state (can be boolean or 'mixed' for indeterminate)
678
1077
  */
679
- interface UIState {
680
- /** Unique state identifier */
681
- id: string;
682
- /** Human-readable name */
683
- name: string;
684
- /** Element IDs belonging to this state */
685
- elements: string[];
686
- /** Optional function to detect if state is active */
687
- activeWhen?: () => boolean;
688
- /** If true, blocks other state activations (modal behavior) */
689
- blocking?: boolean;
690
- /** Specific state IDs this state blocks */
691
- blocks?: string[];
692
- /** State group membership */
693
- group?: string;
694
- /** Cost for pathfinding (default: 1.0) */
695
- pathCost?: number;
696
- /** Custom metadata */
697
- metadata?: Record<string, unknown>;
698
- }
1078
+ type AriaCheckedState = boolean | 'mixed';
699
1079
  /**
700
- * State group - states that activate/deactivate atomically
701
- *
702
- * When a group is activated, all its states are activated together.
703
- * When deactivated, all states are deactivated together.
1080
+ * Accessibility information for a UI element
704
1081
  */
705
- interface UIStateGroup {
706
- /** Unique group identifier */
707
- id: string;
708
- /** Human-readable name */
709
- name: string;
710
- /** State IDs belonging to this group */
711
- states: string[];
1082
+ interface ElementAccessibility {
1083
+ /** The element's computed role (explicit or implicit) */
1084
+ role: string;
1085
+ /** Computed accessible name following ARIA name computation */
1086
+ accessibleName?: string;
1087
+ /** Computed accessible description */
1088
+ accessibleDescription?: string;
1089
+ /** Value of aria-label attribute */
1090
+ ariaLabel?: string;
1091
+ /** Value of aria-labelledby attribute */
1092
+ ariaLabelledBy?: string;
1093
+ /** Value of aria-describedby attribute */
1094
+ ariaDescribedBy?: string;
1095
+ /** Whether element is expanded (for expandable elements) */
1096
+ ariaExpanded?: boolean;
1097
+ /** Whether element is selected (for selectable elements) */
1098
+ ariaSelected?: boolean;
1099
+ /** Checked state (for checkboxes, can be true/false/'mixed') */
1100
+ ariaChecked?: AriaCheckedState;
1101
+ /** Whether element is hidden from accessibility tree */
1102
+ ariaHidden?: boolean;
1103
+ /** Whether element is disabled via aria-disabled */
1104
+ ariaDisabled?: boolean;
1105
+ /** Whether element is required (for form inputs) */
1106
+ ariaRequired?: boolean;
1107
+ /** Current aria-live value for live regions */
1108
+ ariaLive?: 'off' | 'polite' | 'assertive';
1109
+ /** Tab index value */
1110
+ tabIndex: number;
1111
+ /** Whether element is in the tab order (tabindex >= 0 or naturally focusable) */
1112
+ isInTabOrder: boolean;
1113
+ /** Whether element can receive keyboard focus */
1114
+ isKeyboardAccessible: boolean;
1115
+ /** The implicit role based on element type (before explicit role override) */
1116
+ implicitRole?: string;
1117
+ /** Whether element has an explicit role attribute */
1118
+ hasExplicitRole: boolean;
712
1119
  }
713
1120
  /**
714
- * State transition definition
715
- *
716
- * Defines how to move from one set of states to another,
717
- * including any actions to execute during the transition.
1121
+ * WCAG conformance level
718
1122
  */
719
- interface UITransition {
720
- /** Unique transition identifier */
721
- id: string;
722
- /** Human-readable name */
723
- name: string;
724
- /** Precondition: at least one must be active */
725
- fromStates: string[];
726
- /** States to activate */
727
- activateStates: string[];
728
- /** States to deactivate */
729
- exitStates: string[];
730
- /** Groups to activate */
731
- activateGroups?: string[];
732
- /** Groups to deactivate */
733
- exitGroups?: string[];
734
- /** Actions to execute during transition */
735
- actions?: WorkflowStep[];
736
- /** Cost for pathfinding */
737
- pathCost?: number;
738
- /** Whether source states remain visible during transition */
739
- staysVisible?: boolean;
740
- }
741
- /**
742
- * Path result from pathfinding
743
- *
744
- * Returned when searching for a path to target states.
745
- */
746
- interface PathResult {
747
- /** Whether a path was found */
748
- found: boolean;
749
- /** Transition IDs in order to reach target */
750
- transitions: string[];
751
- /** Total cost of the path */
752
- totalCost: number;
753
- /** Target state IDs */
754
- targetStates: string[];
755
- /** Estimated number of steps */
756
- estimatedSteps: number;
757
- }
1123
+ type WCAGLevel = 'A' | 'AA' | 'AAA';
758
1124
  /**
759
- * Transition execution result
1125
+ * Accessibility issue severity
760
1126
  */
761
- interface TransitionResult {
762
- /** Whether the transition succeeded */
763
- success: boolean;
764
- /** States that were activated */
765
- activatedStates: string[];
766
- /** States that were deactivated */
767
- deactivatedStates: string[];
768
- /** Error message if failed */
769
- error?: string;
770
- /** Phase where failure occurred (if any) */
771
- failedPhase?: string;
772
- /** Duration of the transition in milliseconds */
773
- durationMs: number;
774
- }
1127
+ type AccessibilitySeverity = 'critical' | 'serious' | 'moderate' | 'minor';
775
1128
  /**
776
- * Navigation result
777
- *
778
- * Returned after navigating to target states via pathfinding.
1129
+ * An accessibility issue found during validation
779
1130
  */
780
- interface NavigationResult {
781
- /** Whether navigation succeeded */
782
- success: boolean;
783
- /** The path that was followed */
784
- path: PathResult;
785
- /** Transitions that were executed */
786
- executedTransitions: string[];
787
- /** Final active states after navigation */
788
- finalActiveStates: string[];
789
- /** Error message if failed */
790
- error?: string;
791
- /** Duration of the navigation in milliseconds */
792
- durationMs: number;
1131
+ interface AccessibilityIssue {
1132
+ /** Unique identifier for this issue instance */
1133
+ id: string;
1134
+ /** The WCAG success criterion this issue relates to (e.g., "4.1.2") */
1135
+ wcagCriterion: string;
1136
+ /** How severe this issue is */
1137
+ severity: AccessibilitySeverity;
1138
+ /** WCAG conformance level this criterion belongs to */
1139
+ level: WCAGLevel;
1140
+ /** Human-readable description of the issue */
1141
+ message: string;
1142
+ /** ID of the element with the issue */
1143
+ elementId: string;
1144
+ /** Selector to find the element */
1145
+ elementSelector?: string;
1146
+ /** Suggested fix for the issue */
1147
+ suggestion: string;
1148
+ /** The rule ID that detected this issue */
1149
+ ruleId: string;
793
1150
  }
794
1151
  /**
795
- * State manager snapshot
1152
+ * Accessibility validation report
796
1153
  */
797
- interface StateSnapshot {
798
- /** Timestamp of the snapshot */
1154
+ interface AccessibilityReport {
1155
+ /** When the validation was performed */
799
1156
  timestamp: number;
800
- /** Currently active state IDs */
801
- activeStates: string[];
802
- /** All registered states */
803
- states: UIState[];
804
- /** All registered state groups */
805
- groups: UIStateGroup[];
806
- /** All registered transitions */
807
- transitions: UITransition[];
1157
+ /** URL of the page that was validated */
1158
+ url: string;
1159
+ /** Number of elements that were scanned */
1160
+ elementsScanned: number;
1161
+ /** All issues found during validation */
1162
+ issues: AccessibilityIssue[];
1163
+ /** Number of checks that passed */
1164
+ passedCount: number;
1165
+ /** Number of checks that failed */
1166
+ failedCount: number;
1167
+ /** Whether the page meets WCAG 2.1 Level A */
1168
+ meetsWCAG_A: boolean;
1169
+ /** Whether the page meets WCAG 2.1 Level AA */
1170
+ meetsWCAG_AA: boolean;
1171
+ /** Human-readable summary of the validation */
1172
+ summary: string;
1173
+ /** Duration of the validation in milliseconds */
1174
+ durationMs: number;
808
1175
  }
809
1176
 
810
- export type { WSWorkflowProgressMessage as $, ActionHandler as A, BranchCondition as B, ComponentAction as C, WSFindMessage as D, ElementIdentifier as E, WSGetElementMessage as F, WSGetSnapshotMessage as G, WSMessageBase as H, WSPingMessage as I, WSPongMessage as J, WSResponseMessage as K, LogConfig as L, WSServerMessage as M, NavigationResult as N, WSServerMessageType as O, PathResult as P, WSSubscribeMessage as Q, RegisteredComponent as R, StandardAction as S, TransitionResult as T, UIBridgeConfig as U, WSSubscribedMessage as V, WSClientConfig as W, WSSubscriptionOptions as X, WSUnsubscribeMessage as Y, WSUnsubscribedMessage as Z, WSWelcomeMessage as _, ActionRequest as a, WaitOptions as a0, Workflow as a1, WorkflowStep as a2, WorkflowStepType as a3, ActionResponse as b, BridgeEvent as c, BridgeEventListener as d, BridgeEventType as e, BridgeSnapshot as f, CustomAction as g, ElementState as h, ElementType as i, ExtractConfig as j, LoopConfig as k, RegisteredElement as l, StateSnapshot as m, UIBridgeFeatures as n, UIState as o, UIStateGroup as p, UITransition as q, WSClientMessage as r, WSClientMessageType as s, WSConnectionState as t, WSDiscoverMessage as u, WSErrorMessage as v, WSEventMessage as w, WSExecuteActionMessage as x, WSExecuteComponentActionMessage as y, WSExecuteWorkflowMessage as z };
1177
+ export { type StateSnapshot as $, type AccessibilityIssue as A, type BranchCondition as B, type CapturedError as C, DEFAULT_CAPTURE_CONFIG as D, type ElementAccessibility as E, type ElementType as F, type ExtendedWorkflowStep as G, type ExtractConfig as H, type HmrCapturedEvent as I, type LongTaskCapturedEvent as J, type LoopConfig as K, type LogConfig as L, type MemoryCapturedEvent as M, type NavigationCapturedEvent as N, type NavigationResult as O, type NetworkCapturedEvent as P, type OnBrowserEventCallback as Q, type OnCaptureCallback as R, type PartialMatch as S, type PathResult as T, type ReactErrorCapturedEvent as U, type RecoveryAction as V, type RegisteredComponent as W, type RegisteredElement as X, type ResourceErrorCapturedEvent as Y, type StandardAction as Z, type StateGetter as _, type AccessibilityReport as a, type TransitionResult as a0, type UIBridgeConfig as a1, type UIBridgeFeatures as a2, type UIState as a3, type UIStateGroup as a4, type UITransition as a5, type WCAGLevel as a6, type WSClientConfig as a7, type WSClientMessage as a8, type WSClientMessageType as a9, type WorkflowStep as aA, type WorkflowStepType as aB, type WsDisconnectionCapturedEvent as aC, type WSConnectionState as aa, type WSDiscoverMessage as ab, type WSErrorMessage as ac, type WSEventMessage as ad, type WSExecuteActionMessage as ae, type WSExecuteComponentActionMessage as af, type WSExecuteWorkflowMessage as ag, type WSFindMessage as ah, type WSGetElementMessage as ai, type WSGetSnapshotMessage as aj, type WSMessageBase as ak, type WSPingMessage as al, type WSPongMessage as am, type WSResponseMessage as an, type WSServerMessage as ao, type WSServerMessageType as ap, type WSSubscribeMessage as aq, type WSSubscribedMessage as ar, type WSSubscriptionOptions as as, type WSUnsubscribeMessage as at, type WSUnsubscribedMessage as au, type WSWelcomeMessage as av, type WSWorkflowProgressMessage as aw, type WaitOptions as ax, type WebVitalCapturedEvent as ay, type Workflow as az, type AccessibilitySeverity as b, type ActionErrorCode as c, type ActionFailureDetails as d, type ActionHandler as e, type ActionRequest as f, type ActionResponse as g, type AnyCapturedEvent as h, type AriaCheckedState as i, type BridgeEvent as j, type BridgeEventListener as k, type BridgeEventType as l, type BridgeSnapshot as m, type BrowserCaptureConfig as n, type BrowserCapturedEvent as o, type BrowserEventType as p, type ComponentAction as q, type ComponentStateResponse as r, type ComputedProperty as s, type ConsoleCapturedEvent as t, type ContentMetadata as u, type ContentRole as v, type ContentType as w, type CustomAction as x, type ElementIdentifier as y, type ElementState as z };