@qontinui/ui-bridge 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/ai/index.d.mts +4 -4
  2. package/dist/ai/index.d.ts +4 -4
  3. package/dist/babel-plugin/index.js +515 -0
  4. package/dist/babel-plugin/index.js.map +1 -0
  5. package/dist/babel-plugin/index.mjs +499 -0
  6. package/dist/babel-plugin/index.mjs.map +1 -0
  7. package/dist/control/index.d.mts +5 -5
  8. package/dist/control/index.d.ts +5 -5
  9. package/dist/core/index.d.mts +115 -44
  10. package/dist/core/index.d.ts +115 -44
  11. package/dist/core/index.js +0 -1560
  12. package/dist/core/index.js.map +1 -1
  13. package/dist/core/index.mjs +1 -1549
  14. package/dist/core/index.mjs.map +1 -1
  15. package/dist/debug/index.d.mts +3 -3
  16. package/dist/debug/index.d.ts +3 -3
  17. package/dist/index.d.mts +7 -8
  18. package/dist/index.d.ts +7 -8
  19. package/dist/index.js +859 -873
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +860 -862
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/{metrics-C9XRi_mL.d.ts → metrics-BfiT_rhZ.d.ts} +2 -2
  24. package/dist/{metrics-NC3csD0R.d.mts → metrics-DTA2bwG7.d.mts} +2 -2
  25. package/dist/native/control/index.js +453 -0
  26. package/dist/native/control/index.js.map +1 -0
  27. package/dist/native/control/index.mjs +450 -0
  28. package/dist/native/control/index.mjs.map +1 -0
  29. package/dist/native/core/index.js +486 -0
  30. package/dist/native/core/index.js.map +1 -0
  31. package/dist/native/core/index.mjs +475 -0
  32. package/dist/native/core/index.mjs.map +1 -0
  33. package/dist/native/debug/index.js +451 -0
  34. package/dist/native/debug/index.js.map +1 -0
  35. package/dist/native/debug/index.mjs +449 -0
  36. package/dist/native/debug/index.mjs.map +1 -0
  37. package/dist/native/index.js +2274 -0
  38. package/dist/native/index.js.map +1 -0
  39. package/dist/native/index.mjs +2246 -0
  40. package/dist/native/index.mjs.map +1 -0
  41. package/dist/native/react/index.js +1401 -0
  42. package/dist/native/react/index.js.map +1 -0
  43. package/dist/native/react/index.mjs +1389 -0
  44. package/dist/native/react/index.mjs.map +1 -0
  45. package/dist/native/server/index.js +415 -0
  46. package/dist/native/server/index.js.map +1 -0
  47. package/dist/native/server/index.mjs +410 -0
  48. package/dist/native/server/index.mjs.map +1 -0
  49. package/dist/react/index.d.mts +20 -7
  50. package/dist/react/index.d.ts +20 -7
  51. package/dist/react/index.js +42 -4
  52. package/dist/react/index.js.map +1 -1
  53. package/dist/react/index.mjs +42 -4
  54. package/dist/react/index.mjs.map +1 -1
  55. package/dist/{registry-CIEDjbQ9.d.ts → registry-BKLEm-yk.d.ts} +9 -15
  56. package/dist/{registry-SsSDq46X.d.mts → registry-BmZgyCz8.d.mts} +9 -15
  57. package/dist/render-log/index.d.mts +1 -1
  58. package/dist/render-log/index.d.ts +1 -1
  59. package/dist/server/express.d.mts +36 -0
  60. package/dist/server/express.d.ts +36 -0
  61. package/dist/server/express.js +196 -0
  62. package/dist/server/express.js.map +1 -0
  63. package/dist/server/express.mjs +192 -0
  64. package/dist/server/express.mjs.map +1 -0
  65. package/dist/server/handlers.d.mts +93 -0
  66. package/dist/server/handlers.d.ts +93 -0
  67. package/dist/server/handlers.js +4278 -0
  68. package/dist/server/handlers.js.map +1 -0
  69. package/dist/server/handlers.mjs +4275 -0
  70. package/dist/server/handlers.mjs.map +1 -0
  71. package/dist/server/index.d.mts +10 -0
  72. package/dist/server/index.d.ts +10 -0
  73. package/dist/server/index.js +5352 -0
  74. package/dist/server/index.js.map +1 -0
  75. package/dist/server/index.mjs +5337 -0
  76. package/dist/server/index.mjs.map +1 -0
  77. package/dist/server/nextjs.d.mts +126 -0
  78. package/dist/server/nextjs.d.ts +126 -0
  79. package/dist/server/nextjs.js +287 -0
  80. package/dist/server/nextjs.js.map +1 -0
  81. package/dist/server/nextjs.mjs +282 -0
  82. package/dist/server/nextjs.mjs.map +1 -0
  83. package/dist/server/standalone.d.mts +6 -0
  84. package/dist/server/standalone.d.ts +6 -0
  85. package/dist/server/standalone.js +719 -0
  86. package/dist/server/standalone.js.map +1 -0
  87. package/dist/server/standalone.mjs +715 -0
  88. package/dist/server/standalone.mjs.map +1 -0
  89. package/dist/standalone-BURj8J3G.d.ts +212 -0
  90. package/dist/standalone-Dwmel29d.d.mts +212 -0
  91. package/dist/swc-plugin/index.d.mts +79 -0
  92. package/dist/swc-plugin/index.d.ts +79 -0
  93. package/dist/swc-plugin/index.js +15 -0
  94. package/dist/swc-plugin/index.js.map +1 -0
  95. package/dist/swc-plugin/index.mjs +9 -0
  96. package/dist/swc-plugin/index.mjs.map +1 -0
  97. package/dist/{types-CFT3Dnx4.d.mts → types-B5Q0GVo0.d.mts} +115 -3
  98. package/dist/{types-Dr6tH-bm.d.mts → types-B7J7noLK.d.mts} +1 -1
  99. package/dist/{types-oCTrRxSw.d.ts → types-BkNRILUa.d.ts} +1 -1
  100. package/dist/types-CEQLnFMv.d.mts +156 -0
  101. package/dist/types-CHnlwiTK.d.ts +156 -0
  102. package/dist/{types-BvCfFuEV.d.ts → types-DfPqwU-i.d.ts} +115 -3
  103. package/dist/{types-CPMbN_Iw.d.mts → types-jKVgTI6_.d.mts} +356 -160
  104. package/dist/{types-CPMbN_Iw.d.ts → types-jKVgTI6_.d.ts} +356 -160
  105. package/package.json +106 -3
  106. package/swc-plugin-wasm/ui_bridge_swc_plugin.wasm +0 -0
  107. package/dist/websocket-client-CX4QJesI.d.ts +0 -124
  108. package/dist/websocket-client-C_Na0OSp.d.mts +0 -124
@@ -1,54 +1,125 @@
1
- import { E as ElementIdentifier } from '../types-CPMbN_Iw.mjs';
2
- export { A as ActionHandler, a as ActionRequest, b as ActionResponse, B as BranchCondition, c as BridgeEvent, d as BridgeEventListener, e as BridgeEventType, f as BridgeSnapshot, C as ComponentAction, g as CustomAction, h as ElementState, i as ElementType, j as ExtractConfig, L as LogConfig, k as LoopConfig, N as NavigationResult, P as PathResult, R as RegisteredComponent, l as RegisteredElement, S as StandardAction, m as StateSnapshot, T as TransitionResult, U as UIBridgeConfig, n as UIBridgeFeatures, o as UIState, p as UIStateGroup, q as UITransition, W as WSClientConfig, r as WSClientMessage, s as WSClientMessageType, t as WSConnectionState, u as WSDiscoverMessage, v as WSErrorMessage, w as WSEventMessage, x as WSExecuteActionMessage, y as WSExecuteComponentActionMessage, z as WSExecuteWorkflowMessage, D as WSFindMessage, F as WSGetElementMessage, G as WSGetSnapshotMessage, H as WSMessageBase, I as WSPingMessage, J as WSPongMessage, K as WSResponseMessage, M as WSServerMessage, O as WSServerMessageType, Q as WSSubscribeMessage, V as WSSubscribedMessage, X as WSSubscriptionOptions, Y as WSUnsubscribeMessage, Z as WSUnsubscribedMessage, _ as WSWelcomeMessage, $ as WSWorkflowProgressMessage, a0 as WaitOptions, a1 as Workflow, a2 as WorkflowStep, a3 as WorkflowStepType } from '../types-CPMbN_Iw.mjs';
3
- export { R as RegistryOptions, U as UIBridgeRegistry, g as getGlobalRegistry, r as resetGlobalRegistry, s as setGlobalRegistry } from '../registry-SsSDq46X.mjs';
4
- export { U as UIBridgeWSClient, c as createWSClient } from '../websocket-client-C_Na0OSp.mjs';
5
- import '../types-CFT3Dnx4.mjs';
6
- import '../types-Dr6tH-bm.mjs';
1
+ import { I as WSClientConfig, M as WSConnectionState, a9 as WSSubscriptionOptions, k as BridgeEventType, l as BridgeSnapshot, f as ActionRequest, g as ActionResponse, i as BridgeEvent } from '../types-jKVgTI6_.mjs';
2
+ export { A as AccessibilityIssue, a as AccessibilityReport, b as AccessibilitySeverity, c as ActionErrorCode, d as ActionFailureDetails, e as ActionHandler, h as AriaCheckedState, B as BranchCondition, j as BridgeEventListener, C as ComponentAction, m as ComponentStateResponse, n as ComputedProperty, o as CustomAction, E as ElementAccessibility, p as ElementIdentifier, q as ElementState, r as ElementType, s as ExtendedWorkflowStep, t as ExtractConfig, L as LogConfig, u as LoopConfig, N as NavigationResult, P as PartialMatch, v as PathResult, R as RecoveryAction, w as RegisteredComponent, x as RegisteredElement, S as StandardAction, y as StateGetter, z as StateSnapshot, T as TransitionResult, U as UIBridgeConfig, D as UIBridgeFeatures, F as UIState, G as UIStateGroup, H as UITransition, W as WCAGLevel, J as WSClientMessage, K as WSClientMessageType, O as WSDiscoverMessage, Q as WSErrorMessage, V as WSEventMessage, X as WSExecuteActionMessage, Y as WSExecuteComponentActionMessage, Z as WSExecuteWorkflowMessage, _ as WSFindMessage, $ as WSGetElementMessage, a0 as WSGetSnapshotMessage, a1 as WSMessageBase, a2 as WSPingMessage, a3 as WSPongMessage, a4 as WSResponseMessage, a5 as WSServerMessage, a6 as WSServerMessageType, a7 as WSSubscribeMessage, a8 as WSSubscribedMessage, aa as WSUnsubscribeMessage, ab as WSUnsubscribedMessage, ac as WSWelcomeMessage, ad as WSWorkflowProgressMessage, ae as WaitOptions, af as Workflow, ag as WorkflowStep, ah as WorkflowStepType } from '../types-jKVgTI6_.mjs';
7
3
 
8
4
  /**
9
- * Element Identification Module
5
+ * WebSocket Client for UI Bridge
10
6
  *
11
- * Provides utilities for identifying DOM elements using multiple strategies:
12
- * 1. data-ui-id (explicit UI Bridge identifier - preferred)
13
- * 2. data-testid (testing library convention)
14
- * 3. data-awas-element (legacy support)
15
- * 4. id (HTML id attribute)
16
- * 5. Generated XPath/CSS selector (fallback)
7
+ * Provides real-time communication with UI Bridge server.
17
8
  */
18
9
 
19
10
  /**
20
- * Data attributes used for element identification (in priority order)
11
+ * WebSocket client for UI Bridge
21
12
  */
22
- declare const ID_ATTRIBUTES: readonly ["data-ui-id", "data-testid", "data-awas-element", "id"];
13
+ declare class UIBridgeWSClient {
14
+ private ws;
15
+ private config;
16
+ private state;
17
+ private clientId;
18
+ private reconnectAttempts;
19
+ private reconnectTimer;
20
+ private pingTimer;
21
+ private pendingRequests;
22
+ private connectionListeners;
23
+ private eventListeners;
24
+ private errorListeners;
25
+ private subscriptions;
26
+ constructor(config: WSClientConfig);
27
+ /**
28
+ * Get current connection state
29
+ */
30
+ get connectionState(): WSConnectionState;
31
+ /**
32
+ * Get assigned client ID
33
+ */
34
+ get id(): string | null;
35
+ /**
36
+ * Connect to the WebSocket server
37
+ */
38
+ connect(): Promise<void>;
39
+ /**
40
+ * Disconnect from the server
41
+ */
42
+ disconnect(): void;
43
+ /**
44
+ * Subscribe to events
45
+ */
46
+ subscribe(options: WSSubscriptionOptions): Promise<BridgeEventType[]>;
47
+ /**
48
+ * Unsubscribe from events
49
+ */
50
+ unsubscribe(events?: BridgeEventType[]): Promise<BridgeEventType[]>;
51
+ /**
52
+ * Find elements
53
+ */
54
+ find(options?: {
55
+ interactiveOnly?: boolean;
56
+ includeState?: boolean;
57
+ selector?: string;
58
+ }): Promise<BridgeSnapshot['elements']>;
59
+ /**
60
+ * Discover elements
61
+ * @deprecated Use find() instead
62
+ */
63
+ discover(options?: {
64
+ interactiveOnly?: boolean;
65
+ includeState?: boolean;
66
+ selector?: string;
67
+ }): Promise<BridgeSnapshot['elements']>;
68
+ /**
69
+ * Get element details
70
+ */
71
+ getElement(elementId: string, includeState?: boolean): Promise<BridgeSnapshot['elements'][0] | null>;
72
+ /**
73
+ * Get full snapshot
74
+ */
75
+ getSnapshot(): Promise<BridgeSnapshot>;
76
+ /**
77
+ * Execute action on an element
78
+ */
79
+ executeAction(elementId: string, action: ActionRequest): Promise<ActionResponse>;
80
+ /**
81
+ * Execute component action
82
+ */
83
+ executeComponentAction(componentId: string, action: string, params?: Record<string, unknown>): Promise<ActionResponse>;
84
+ /**
85
+ * Execute workflow with optional progress streaming
86
+ */
87
+ executeWorkflow(workflowId: string, params?: Record<string, unknown>, onProgress?: (progress: {
88
+ currentStep: number;
89
+ totalSteps: number;
90
+ step: {
91
+ id: string;
92
+ status: string;
93
+ };
94
+ }) => void): Promise<{
95
+ success: boolean;
96
+ results: unknown[];
97
+ }>;
98
+ /**
99
+ * Add connection state listener
100
+ */
101
+ onConnectionChange(listener: (state: WSConnectionState) => void): () => void;
102
+ /**
103
+ * Add event listener
104
+ */
105
+ onEvent(eventType: BridgeEventType | '*', listener: (event: BridgeEvent) => void): () => void;
106
+ /**
107
+ * Add error listener
108
+ */
109
+ onError(listener: (error: Error) => void): () => void;
110
+ private setState;
111
+ private handleMessage;
112
+ private handleResponse;
113
+ private notifyEvent;
114
+ private notifyError;
115
+ private sendRequest;
116
+ private scheduleReconnect;
117
+ private startPingInterval;
118
+ private stopPingInterval;
119
+ }
23
120
  /**
24
- * Generate a unique XPath for an element
121
+ * Create a WebSocket client instance
25
122
  */
26
- declare function generateXPath(element: HTMLElement): string;
27
- /**
28
- * Generate a unique CSS selector for an element
29
- */
30
- declare function generateCSSSelector(element: HTMLElement): string;
31
- /**
32
- * Get the best identifier for an element based on available attributes
33
- */
34
- declare function getBestIdentifier(element: HTMLElement): string;
35
- /**
36
- * Create a full ElementIdentifier object for an element
37
- */
38
- declare function createElementIdentifier(element: HTMLElement): ElementIdentifier;
39
- /**
40
- * Find an element by its identifier
41
- *
42
- * Tries each identification method in priority order
43
- */
44
- declare function findElementByIdentifier(identifier: string | ElementIdentifier, root?: ParentNode): HTMLElement | null;
45
- /**
46
- * Find all elements matching an identifier pattern
47
- */
48
- declare function findAllElementsByIdentifier(pattern: string, root?: ParentNode): HTMLElement[];
49
- /**
50
- * Check if an element matches an identifier
51
- */
52
- declare function elementMatchesIdentifier(element: HTMLElement, identifier: string | ElementIdentifier): boolean;
123
+ declare function createWSClient(config: WSClientConfig): UIBridgeWSClient;
53
124
 
54
- export { ElementIdentifier, ID_ATTRIBUTES, createElementIdentifier, elementMatchesIdentifier, findAllElementsByIdentifier, findElementByIdentifier, generateCSSSelector, generateXPath, getBestIdentifier };
125
+ export { ActionRequest, ActionResponse, BridgeEvent, BridgeEventType, BridgeSnapshot, UIBridgeWSClient, WSClientConfig, WSConnectionState, WSSubscriptionOptions, createWSClient };
@@ -1,54 +1,125 @@
1
- import { E as ElementIdentifier } from '../types-CPMbN_Iw.js';
2
- export { A as ActionHandler, a as ActionRequest, b as ActionResponse, B as BranchCondition, c as BridgeEvent, d as BridgeEventListener, e as BridgeEventType, f as BridgeSnapshot, C as ComponentAction, g as CustomAction, h as ElementState, i as ElementType, j as ExtractConfig, L as LogConfig, k as LoopConfig, N as NavigationResult, P as PathResult, R as RegisteredComponent, l as RegisteredElement, S as StandardAction, m as StateSnapshot, T as TransitionResult, U as UIBridgeConfig, n as UIBridgeFeatures, o as UIState, p as UIStateGroup, q as UITransition, W as WSClientConfig, r as WSClientMessage, s as WSClientMessageType, t as WSConnectionState, u as WSDiscoverMessage, v as WSErrorMessage, w as WSEventMessage, x as WSExecuteActionMessage, y as WSExecuteComponentActionMessage, z as WSExecuteWorkflowMessage, D as WSFindMessage, F as WSGetElementMessage, G as WSGetSnapshotMessage, H as WSMessageBase, I as WSPingMessage, J as WSPongMessage, K as WSResponseMessage, M as WSServerMessage, O as WSServerMessageType, Q as WSSubscribeMessage, V as WSSubscribedMessage, X as WSSubscriptionOptions, Y as WSUnsubscribeMessage, Z as WSUnsubscribedMessage, _ as WSWelcomeMessage, $ as WSWorkflowProgressMessage, a0 as WaitOptions, a1 as Workflow, a2 as WorkflowStep, a3 as WorkflowStepType } from '../types-CPMbN_Iw.js';
3
- export { R as RegistryOptions, U as UIBridgeRegistry, g as getGlobalRegistry, r as resetGlobalRegistry, s as setGlobalRegistry } from '../registry-CIEDjbQ9.js';
4
- export { U as UIBridgeWSClient, c as createWSClient } from '../websocket-client-CX4QJesI.js';
5
- import '../types-BvCfFuEV.js';
6
- import '../types-oCTrRxSw.js';
1
+ import { I as WSClientConfig, M as WSConnectionState, a9 as WSSubscriptionOptions, k as BridgeEventType, l as BridgeSnapshot, f as ActionRequest, g as ActionResponse, i as BridgeEvent } from '../types-jKVgTI6_.js';
2
+ export { A as AccessibilityIssue, a as AccessibilityReport, b as AccessibilitySeverity, c as ActionErrorCode, d as ActionFailureDetails, e as ActionHandler, h as AriaCheckedState, B as BranchCondition, j as BridgeEventListener, C as ComponentAction, m as ComponentStateResponse, n as ComputedProperty, o as CustomAction, E as ElementAccessibility, p as ElementIdentifier, q as ElementState, r as ElementType, s as ExtendedWorkflowStep, t as ExtractConfig, L as LogConfig, u as LoopConfig, N as NavigationResult, P as PartialMatch, v as PathResult, R as RecoveryAction, w as RegisteredComponent, x as RegisteredElement, S as StandardAction, y as StateGetter, z as StateSnapshot, T as TransitionResult, U as UIBridgeConfig, D as UIBridgeFeatures, F as UIState, G as UIStateGroup, H as UITransition, W as WCAGLevel, J as WSClientMessage, K as WSClientMessageType, O as WSDiscoverMessage, Q as WSErrorMessage, V as WSEventMessage, X as WSExecuteActionMessage, Y as WSExecuteComponentActionMessage, Z as WSExecuteWorkflowMessage, _ as WSFindMessage, $ as WSGetElementMessage, a0 as WSGetSnapshotMessage, a1 as WSMessageBase, a2 as WSPingMessage, a3 as WSPongMessage, a4 as WSResponseMessage, a5 as WSServerMessage, a6 as WSServerMessageType, a7 as WSSubscribeMessage, a8 as WSSubscribedMessage, aa as WSUnsubscribeMessage, ab as WSUnsubscribedMessage, ac as WSWelcomeMessage, ad as WSWorkflowProgressMessage, ae as WaitOptions, af as Workflow, ag as WorkflowStep, ah as WorkflowStepType } from '../types-jKVgTI6_.js';
7
3
 
8
4
  /**
9
- * Element Identification Module
5
+ * WebSocket Client for UI Bridge
10
6
  *
11
- * Provides utilities for identifying DOM elements using multiple strategies:
12
- * 1. data-ui-id (explicit UI Bridge identifier - preferred)
13
- * 2. data-testid (testing library convention)
14
- * 3. data-awas-element (legacy support)
15
- * 4. id (HTML id attribute)
16
- * 5. Generated XPath/CSS selector (fallback)
7
+ * Provides real-time communication with UI Bridge server.
17
8
  */
18
9
 
19
10
  /**
20
- * Data attributes used for element identification (in priority order)
11
+ * WebSocket client for UI Bridge
21
12
  */
22
- declare const ID_ATTRIBUTES: readonly ["data-ui-id", "data-testid", "data-awas-element", "id"];
13
+ declare class UIBridgeWSClient {
14
+ private ws;
15
+ private config;
16
+ private state;
17
+ private clientId;
18
+ private reconnectAttempts;
19
+ private reconnectTimer;
20
+ private pingTimer;
21
+ private pendingRequests;
22
+ private connectionListeners;
23
+ private eventListeners;
24
+ private errorListeners;
25
+ private subscriptions;
26
+ constructor(config: WSClientConfig);
27
+ /**
28
+ * Get current connection state
29
+ */
30
+ get connectionState(): WSConnectionState;
31
+ /**
32
+ * Get assigned client ID
33
+ */
34
+ get id(): string | null;
35
+ /**
36
+ * Connect to the WebSocket server
37
+ */
38
+ connect(): Promise<void>;
39
+ /**
40
+ * Disconnect from the server
41
+ */
42
+ disconnect(): void;
43
+ /**
44
+ * Subscribe to events
45
+ */
46
+ subscribe(options: WSSubscriptionOptions): Promise<BridgeEventType[]>;
47
+ /**
48
+ * Unsubscribe from events
49
+ */
50
+ unsubscribe(events?: BridgeEventType[]): Promise<BridgeEventType[]>;
51
+ /**
52
+ * Find elements
53
+ */
54
+ find(options?: {
55
+ interactiveOnly?: boolean;
56
+ includeState?: boolean;
57
+ selector?: string;
58
+ }): Promise<BridgeSnapshot['elements']>;
59
+ /**
60
+ * Discover elements
61
+ * @deprecated Use find() instead
62
+ */
63
+ discover(options?: {
64
+ interactiveOnly?: boolean;
65
+ includeState?: boolean;
66
+ selector?: string;
67
+ }): Promise<BridgeSnapshot['elements']>;
68
+ /**
69
+ * Get element details
70
+ */
71
+ getElement(elementId: string, includeState?: boolean): Promise<BridgeSnapshot['elements'][0] | null>;
72
+ /**
73
+ * Get full snapshot
74
+ */
75
+ getSnapshot(): Promise<BridgeSnapshot>;
76
+ /**
77
+ * Execute action on an element
78
+ */
79
+ executeAction(elementId: string, action: ActionRequest): Promise<ActionResponse>;
80
+ /**
81
+ * Execute component action
82
+ */
83
+ executeComponentAction(componentId: string, action: string, params?: Record<string, unknown>): Promise<ActionResponse>;
84
+ /**
85
+ * Execute workflow with optional progress streaming
86
+ */
87
+ executeWorkflow(workflowId: string, params?: Record<string, unknown>, onProgress?: (progress: {
88
+ currentStep: number;
89
+ totalSteps: number;
90
+ step: {
91
+ id: string;
92
+ status: string;
93
+ };
94
+ }) => void): Promise<{
95
+ success: boolean;
96
+ results: unknown[];
97
+ }>;
98
+ /**
99
+ * Add connection state listener
100
+ */
101
+ onConnectionChange(listener: (state: WSConnectionState) => void): () => void;
102
+ /**
103
+ * Add event listener
104
+ */
105
+ onEvent(eventType: BridgeEventType | '*', listener: (event: BridgeEvent) => void): () => void;
106
+ /**
107
+ * Add error listener
108
+ */
109
+ onError(listener: (error: Error) => void): () => void;
110
+ private setState;
111
+ private handleMessage;
112
+ private handleResponse;
113
+ private notifyEvent;
114
+ private notifyError;
115
+ private sendRequest;
116
+ private scheduleReconnect;
117
+ private startPingInterval;
118
+ private stopPingInterval;
119
+ }
23
120
  /**
24
- * Generate a unique XPath for an element
121
+ * Create a WebSocket client instance
25
122
  */
26
- declare function generateXPath(element: HTMLElement): string;
27
- /**
28
- * Generate a unique CSS selector for an element
29
- */
30
- declare function generateCSSSelector(element: HTMLElement): string;
31
- /**
32
- * Get the best identifier for an element based on available attributes
33
- */
34
- declare function getBestIdentifier(element: HTMLElement): string;
35
- /**
36
- * Create a full ElementIdentifier object for an element
37
- */
38
- declare function createElementIdentifier(element: HTMLElement): ElementIdentifier;
39
- /**
40
- * Find an element by its identifier
41
- *
42
- * Tries each identification method in priority order
43
- */
44
- declare function findElementByIdentifier(identifier: string | ElementIdentifier, root?: ParentNode): HTMLElement | null;
45
- /**
46
- * Find all elements matching an identifier pattern
47
- */
48
- declare function findAllElementsByIdentifier(pattern: string, root?: ParentNode): HTMLElement[];
49
- /**
50
- * Check if an element matches an identifier
51
- */
52
- declare function elementMatchesIdentifier(element: HTMLElement, identifier: string | ElementIdentifier): boolean;
123
+ declare function createWSClient(config: WSClientConfig): UIBridgeWSClient;
53
124
 
54
- export { ElementIdentifier, ID_ATTRIBUTES, createElementIdentifier, elementMatchesIdentifier, findAllElementsByIdentifier, findElementByIdentifier, generateCSSSelector, generateXPath, getBestIdentifier };
125
+ export { ActionRequest, ActionResponse, BridgeEvent, BridgeEventType, BridgeSnapshot, UIBridgeWSClient, WSClientConfig, WSConnectionState, WSSubscriptionOptions, createWSClient };