@qontinui/ui-bridge 0.3.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 (127) 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 +23 -34
  16. package/dist/babel-plugin/index.js.map +1 -1
  17. package/dist/babel-plugin/index.mjs +23 -34
  18. package/dist/babel-plugin/index.mjs.map +1 -1
  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 +2 -2
  28. package/dist/core/index.d.ts +2 -2
  29. package/dist/core/index.js.map +1 -1
  30. package/dist/core/index.mjs.map +1 -1
  31. package/dist/debug/index.d.mts +5 -3
  32. package/dist/debug/index.d.ts +5 -3
  33. package/dist/debug/index.js +925 -1
  34. package/dist/debug/index.js.map +1 -1
  35. package/dist/debug/index.mjs +924 -2
  36. package/dist/debug/index.mjs.map +1 -1
  37. package/dist/index.d.mts +12 -7
  38. package/dist/index.d.ts +12 -7
  39. package/dist/index.js +4720 -173
  40. package/dist/index.js.map +1 -1
  41. package/dist/index.mjs +4656 -174
  42. package/dist/index.mjs.map +1 -1
  43. package/dist/{metrics-DTA2bwG7.d.mts → metrics-DuA2qIIz.d.mts} +2 -2
  44. package/dist/{metrics-BfiT_rhZ.d.ts → metrics-KFAAKNEB.d.ts} +2 -2
  45. package/dist/native/control/index.js +2 -7
  46. package/dist/native/control/index.js.map +1 -1
  47. package/dist/native/control/index.mjs +2 -7
  48. package/dist/native/control/index.mjs.map +1 -1
  49. package/dist/native/core/index.js.map +1 -1
  50. package/dist/native/core/index.mjs.map +1 -1
  51. package/dist/native/debug/index.js +23 -66
  52. package/dist/native/debug/index.js.map +1 -1
  53. package/dist/native/debug/index.mjs +23 -66
  54. package/dist/native/debug/index.mjs.map +1 -1
  55. package/dist/native/index.js +89 -131
  56. package/dist/native/index.js.map +1 -1
  57. package/dist/native/index.mjs +89 -131
  58. package/dist/native/index.mjs.map +1 -1
  59. package/dist/native/react/index.js +28 -52
  60. package/dist/native/react/index.js.map +1 -1
  61. package/dist/native/react/index.mjs +28 -52
  62. package/dist/native/react/index.mjs.map +1 -1
  63. package/dist/native/server/index.js +38 -13
  64. package/dist/native/server/index.js.map +1 -1
  65. package/dist/native/server/index.mjs +38 -13
  66. package/dist/native/server/index.mjs.map +1 -1
  67. package/dist/react/index.d.mts +107 -8
  68. package/dist/react/index.d.ts +107 -8
  69. package/dist/react/index.js +2194 -84
  70. package/dist/react/index.js.map +1 -1
  71. package/dist/react/index.mjs +2194 -85
  72. package/dist/react/index.mjs.map +1 -1
  73. package/dist/{registry-BKLEm-yk.d.ts → registry-C6dDtn1v.d.ts} +27 -2
  74. package/dist/{registry-BmZgyCz8.d.mts → registry-POtcxnal.d.mts} +27 -2
  75. package/dist/render-log/index.d.mts +1 -1
  76. package/dist/render-log/index.d.ts +1 -1
  77. package/dist/server/express.d.mts +5 -4
  78. package/dist/server/express.d.ts +5 -4
  79. package/dist/server/express.js +104 -2
  80. package/dist/server/express.js.map +1 -1
  81. package/dist/server/express.mjs +104 -2
  82. package/dist/server/express.mjs.map +1 -1
  83. package/dist/server/handlers.d.mts +36 -5
  84. package/dist/server/handlers.d.ts +36 -5
  85. package/dist/server/handlers.js +3129 -224
  86. package/dist/server/handlers.js.map +1 -1
  87. package/dist/server/handlers.mjs +3129 -224
  88. package/dist/server/handlers.mjs.map +1 -1
  89. package/dist/server/index.d.mts +7 -5
  90. package/dist/server/index.d.ts +7 -5
  91. package/dist/server/index.js +3215 -183
  92. package/dist/server/index.js.map +1 -1
  93. package/dist/server/index.mjs +3215 -183
  94. package/dist/server/index.mjs.map +1 -1
  95. package/dist/server/nextjs.d.mts +6 -4
  96. package/dist/server/nextjs.d.ts +6 -4
  97. package/dist/server/nextjs.js +106 -3
  98. package/dist/server/nextjs.js.map +1 -1
  99. package/dist/server/nextjs.mjs +106 -3
  100. package/dist/server/nextjs.mjs.map +1 -1
  101. package/dist/server/standalone.d.mts +6 -5
  102. package/dist/server/standalone.d.ts +6 -5
  103. package/dist/server/standalone.js +131 -5
  104. package/dist/server/standalone.js.map +1 -1
  105. package/dist/server/standalone.mjs +131 -5
  106. package/dist/server/standalone.mjs.map +1 -1
  107. package/dist/specs/index.d.mts +365 -0
  108. package/dist/specs/index.d.ts +365 -0
  109. package/dist/specs/index.js +2809 -0
  110. package/dist/specs/index.js.map +1 -0
  111. package/dist/specs/index.mjs +2786 -0
  112. package/dist/specs/index.mjs.map +1 -0
  113. package/dist/{standalone-BURj8J3G.d.ts → standalone-B6GLIEmR.d.ts} +6 -2
  114. package/dist/{standalone-Dwmel29d.d.mts → standalone-CjdYqj3P.d.mts} +6 -2
  115. package/dist/{types-CHnlwiTK.d.ts → types-B2EfvEaq.d.ts} +83 -3
  116. package/dist/{types-B7J7noLK.d.mts → types-C7gVYRnF.d.ts} +72 -2
  117. package/dist/{types-BkNRILUa.d.ts → types-CJGrBEhC.d.mts} +72 -2
  118. package/dist/types-CebMQj76.d.ts +1275 -0
  119. package/dist/types-D_ypYl3T.d.mts +1275 -0
  120. package/dist/types-UBtp7R0u.d.mts +132 -0
  121. package/dist/types-UBtp7R0u.d.ts +132 -0
  122. package/dist/{types-CEQLnFMv.d.mts → types-gO696T_t.d.mts} +83 -3
  123. package/dist/{types-jKVgTI6_.d.mts → types-suaYwWWg.d.mts} +173 -2
  124. package/dist/{types-jKVgTI6_.d.ts → types-suaYwWWg.d.ts} +173 -2
  125. package/package.json +18 -2
  126. package/dist/types-B5Q0GVo0.d.mts +0 -646
  127. package/dist/types-DfPqwU-i.d.ts +0 -646
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Annotation Types
3
+ *
4
+ * Types for the semantic annotation system that allows developers
5
+ * to attach rich human-authored context to UI elements.
6
+ */
7
+ /**
8
+ * Annotation for a single UI element.
9
+ *
10
+ * All fields are optional - annotate only what's useful.
11
+ * Annotations provide human-authored semantic context that enriches
12
+ * the UI Bridge's understanding of elements beyond what can be
13
+ * inferred from the DOM alone.
14
+ *
15
+ * @example Basic annotation for a button
16
+ * ```ts
17
+ * const annotation: ElementAnnotation = {
18
+ * description: 'Primary login button',
19
+ * purpose: 'Submits the login form and authenticates the user',
20
+ * tags: ['auth', 'primary-action'],
21
+ * };
22
+ * store.set('login-btn', annotation);
23
+ * ```
24
+ *
25
+ * @example Detailed annotation with relationships and metadata
26
+ * ```ts
27
+ * const annotation: ElementAnnotation = {
28
+ * description: 'Email input field',
29
+ * purpose: 'Collects the user email for authentication',
30
+ * notes: 'Validates email format on blur. Shows inline error below the field.',
31
+ * tags: ['auth', 'form-input', 'required'],
32
+ * relatedElements: ['email-label', 'email-error', 'login-btn'],
33
+ * metadata: { validationPattern: '^[^@]+@[^@]+\\.[^@]+$' },
34
+ * author: 'design-team',
35
+ * };
36
+ * ```
37
+ */
38
+ interface ElementAnnotation {
39
+ /** Human-readable description of what this element is */
40
+ description?: string;
41
+ /** Why this element exists / what it's for */
42
+ purpose?: string;
43
+ /** Behavioral notes, edge cases, or caveats */
44
+ notes?: string;
45
+ /** Searchable tags for categorization */
46
+ tags?: string[];
47
+ /** IDs of related elements (e.g., a label and its input) */
48
+ relatedElements?: string[];
49
+ /** Arbitrary key-value metadata */
50
+ metadata?: Record<string, unknown>;
51
+ /** Timestamp of last update (auto-set by store) */
52
+ updatedAt?: number;
53
+ /** Author of this annotation */
54
+ author?: string;
55
+ }
56
+ /**
57
+ * Annotation configuration file format.
58
+ *
59
+ * This is the import/export format - a JSON file with version and annotations map.
60
+ * Use `AnnotationStore.exportConfig()` to generate this object, and
61
+ * `AnnotationStore.importConfig()` to load it back.
62
+ *
63
+ * @example JSON file format (`annotations.json`)
64
+ * ```json
65
+ * {
66
+ * "version": "1.0.0",
67
+ * "annotations": {
68
+ * "login-btn": {
69
+ * "description": "Primary login button",
70
+ * "purpose": "Submits the login form",
71
+ * "tags": ["auth", "primary-action"]
72
+ * },
73
+ * "email-input": {
74
+ * "description": "Email address input",
75
+ * "purpose": "Collects user email for authentication",
76
+ * "relatedElements": ["email-label", "email-error"]
77
+ * }
78
+ * },
79
+ * "metadata": {
80
+ * "appName": "MyApp",
81
+ * "description": "Annotations for the login page"
82
+ * }
83
+ * }
84
+ * ```
85
+ */
86
+ interface AnnotationConfig {
87
+ /** Config format version */
88
+ version: string;
89
+ /** Map of element ID to annotation */
90
+ annotations: Record<string, ElementAnnotation>;
91
+ /** Optional file-level metadata */
92
+ metadata?: {
93
+ appName?: string;
94
+ exportedAt?: number;
95
+ description?: string;
96
+ };
97
+ }
98
+ /**
99
+ * Annotation coverage statistics.
100
+ */
101
+ interface AnnotationCoverage {
102
+ /** Total elements known to the system */
103
+ totalElements: number;
104
+ /** Elements that have annotations */
105
+ annotatedElements: number;
106
+ /** Coverage as a percentage (0-100) */
107
+ coveragePercent: number;
108
+ /** IDs of annotated elements */
109
+ annotatedIds: string[];
110
+ /** IDs of unannotated elements */
111
+ unannotatedIds: string[];
112
+ /** When this coverage was computed */
113
+ timestamp: number;
114
+ }
115
+ /**
116
+ * Event types emitted by the annotation store.
117
+ */
118
+ type AnnotationEventType = 'annotation:set' | 'annotation:deleted' | 'annotation:imported' | 'annotation:cleared';
119
+ /**
120
+ * Event payload for annotation store events.
121
+ */
122
+ interface AnnotationEvent {
123
+ type: AnnotationEventType;
124
+ elementId?: string;
125
+ annotation?: ElementAnnotation;
126
+ count?: number;
127
+ timestamp: number;
128
+ }
129
+ /** Current annotation config version */
130
+ declare const ANNOTATION_CONFIG_VERSION = "1.0.0";
131
+
132
+ export { ANNOTATION_CONFIG_VERSION as A, type ElementAnnotation as E, type AnnotationConfig as a, type AnnotationCoverage as b, type AnnotationEvent as c, type AnnotationEventType as d };
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Annotation Types
3
+ *
4
+ * Types for the semantic annotation system that allows developers
5
+ * to attach rich human-authored context to UI elements.
6
+ */
7
+ /**
8
+ * Annotation for a single UI element.
9
+ *
10
+ * All fields are optional - annotate only what's useful.
11
+ * Annotations provide human-authored semantic context that enriches
12
+ * the UI Bridge's understanding of elements beyond what can be
13
+ * inferred from the DOM alone.
14
+ *
15
+ * @example Basic annotation for a button
16
+ * ```ts
17
+ * const annotation: ElementAnnotation = {
18
+ * description: 'Primary login button',
19
+ * purpose: 'Submits the login form and authenticates the user',
20
+ * tags: ['auth', 'primary-action'],
21
+ * };
22
+ * store.set('login-btn', annotation);
23
+ * ```
24
+ *
25
+ * @example Detailed annotation with relationships and metadata
26
+ * ```ts
27
+ * const annotation: ElementAnnotation = {
28
+ * description: 'Email input field',
29
+ * purpose: 'Collects the user email for authentication',
30
+ * notes: 'Validates email format on blur. Shows inline error below the field.',
31
+ * tags: ['auth', 'form-input', 'required'],
32
+ * relatedElements: ['email-label', 'email-error', 'login-btn'],
33
+ * metadata: { validationPattern: '^[^@]+@[^@]+\\.[^@]+$' },
34
+ * author: 'design-team',
35
+ * };
36
+ * ```
37
+ */
38
+ interface ElementAnnotation {
39
+ /** Human-readable description of what this element is */
40
+ description?: string;
41
+ /** Why this element exists / what it's for */
42
+ purpose?: string;
43
+ /** Behavioral notes, edge cases, or caveats */
44
+ notes?: string;
45
+ /** Searchable tags for categorization */
46
+ tags?: string[];
47
+ /** IDs of related elements (e.g., a label and its input) */
48
+ relatedElements?: string[];
49
+ /** Arbitrary key-value metadata */
50
+ metadata?: Record<string, unknown>;
51
+ /** Timestamp of last update (auto-set by store) */
52
+ updatedAt?: number;
53
+ /** Author of this annotation */
54
+ author?: string;
55
+ }
56
+ /**
57
+ * Annotation configuration file format.
58
+ *
59
+ * This is the import/export format - a JSON file with version and annotations map.
60
+ * Use `AnnotationStore.exportConfig()` to generate this object, and
61
+ * `AnnotationStore.importConfig()` to load it back.
62
+ *
63
+ * @example JSON file format (`annotations.json`)
64
+ * ```json
65
+ * {
66
+ * "version": "1.0.0",
67
+ * "annotations": {
68
+ * "login-btn": {
69
+ * "description": "Primary login button",
70
+ * "purpose": "Submits the login form",
71
+ * "tags": ["auth", "primary-action"]
72
+ * },
73
+ * "email-input": {
74
+ * "description": "Email address input",
75
+ * "purpose": "Collects user email for authentication",
76
+ * "relatedElements": ["email-label", "email-error"]
77
+ * }
78
+ * },
79
+ * "metadata": {
80
+ * "appName": "MyApp",
81
+ * "description": "Annotations for the login page"
82
+ * }
83
+ * }
84
+ * ```
85
+ */
86
+ interface AnnotationConfig {
87
+ /** Config format version */
88
+ version: string;
89
+ /** Map of element ID to annotation */
90
+ annotations: Record<string, ElementAnnotation>;
91
+ /** Optional file-level metadata */
92
+ metadata?: {
93
+ appName?: string;
94
+ exportedAt?: number;
95
+ description?: string;
96
+ };
97
+ }
98
+ /**
99
+ * Annotation coverage statistics.
100
+ */
101
+ interface AnnotationCoverage {
102
+ /** Total elements known to the system */
103
+ totalElements: number;
104
+ /** Elements that have annotations */
105
+ annotatedElements: number;
106
+ /** Coverage as a percentage (0-100) */
107
+ coveragePercent: number;
108
+ /** IDs of annotated elements */
109
+ annotatedIds: string[];
110
+ /** IDs of unannotated elements */
111
+ unannotatedIds: string[];
112
+ /** When this coverage was computed */
113
+ timestamp: number;
114
+ }
115
+ /**
116
+ * Event types emitted by the annotation store.
117
+ */
118
+ type AnnotationEventType = 'annotation:set' | 'annotation:deleted' | 'annotation:imported' | 'annotation:cleared';
119
+ /**
120
+ * Event payload for annotation store events.
121
+ */
122
+ interface AnnotationEvent {
123
+ type: AnnotationEventType;
124
+ elementId?: string;
125
+ annotation?: ElementAnnotation;
126
+ count?: number;
127
+ timestamp: number;
128
+ }
129
+ /** Current annotation config version */
130
+ declare const ANNOTATION_CONFIG_VERSION = "1.0.0";
131
+
132
+ export { ANNOTATION_CONFIG_VERSION as A, type ElementAnnotation as E, type AnnotationConfig as a, type AnnotationCoverage as b, type AnnotationEvent as c, type AnnotationEventType as d };
@@ -1,7 +1,8 @@
1
- import { U as UIBridgeConfig } from './types-jKVgTI6_.mjs';
2
- import { d as ControlSnapshot, b as ControlActionRequest, c as ControlActionResponse, C as ComponentActionRequest, a as ComponentActionResponse, F as FindRequest, g as FindResponse, j as WorkflowRunRequest, k as WorkflowRunResponse } from './types-B7J7noLK.mjs';
3
- import { S as SearchCriteria, n as SearchResponse, N as NLActionRequest, l as NLActionResponse, d as AssertionRequest, e as AssertionResult, B as BatchAssertionRequest, g as BatchAssertionResult, t as SemanticSnapshot, p as SemanticDiff, q as SemanticSearchCriteria, r as SemanticSearchResponse } from './types-B5Q0GVo0.mjs';
1
+ import { a1 as UIBridgeConfig, C as CapturedError, a3 as UIState, a4 as UIStateGroup, a5 as UITransition, a0 as TransitionResult, T as PathResult, O as NavigationResult, $ as StateSnapshot } from './types-suaYwWWg.mjs';
2
+ import { d as ControlSnapshot, b as ControlActionRequest, c as ControlActionResponse, C as ComponentActionRequest, a as ComponentActionResponse, F as FindRequest, h as FindResponse, l as WorkflowRunRequest, m as WorkflowRunResponse, i as PageNavigationResponse, P as PageNavigateRequest } from './types-CJGrBEhC.mjs';
3
+ import { a8 as SearchCriteria, a9 as SearchResponse, X as NLActionRequest, Y as NLActionResponse, d as AssertionRequest, e as AssertionResult, B as BatchAssertionRequest, g as BatchAssertionResult, af as SemanticSnapshot, ab as SemanticDiff, ac as SemanticSearchCriteria, ad as SemanticSearchResponse, M as IntentExecutionResult, O as IntentSearchResponse, L as Intent, a4 as RecoveryAttemptRequest, a5 as RecoveryAttemptResult, a0 as PageDataMap, a2 as PageRegionMap, ai as StructuredDataExtraction, i as ComponentInfo, m as CrossAppComparisonReport } from './types-D_ypYl3T.mjs';
4
4
  import { RenderLogEntryType, RenderLogEntry } from './render-log/index.mjs';
5
+ import { E as ElementAnnotation, a as AnnotationConfig, b as AnnotationCoverage } from './types-UBtp7R0u.mjs';
5
6
 
6
7
  /**
7
8
  * UI Bridge Server Types
@@ -115,6 +116,16 @@ interface UIBridgeServerHandlers {
115
116
  getMetrics: () => Promise<APIResponse<unknown>>;
116
117
  highlightElement: (id: string) => Promise<APIResponse<void>>;
117
118
  getElementTree: () => Promise<APIResponse<unknown>>;
119
+ getConsoleErrors: (params?: {
120
+ since?: number;
121
+ limit?: number;
122
+ }) => Promise<APIResponse<{
123
+ errors: CapturedError[];
124
+ count: number;
125
+ }>>;
126
+ clearConsoleErrors: () => Promise<APIResponse<{
127
+ cleared: boolean;
128
+ }>>;
118
129
  aiSearch: (criteria: SearchCriteria) => Promise<APIResponse<SearchResponse>>;
119
130
  aiExecute: (request: NLActionRequest) => Promise<APIResponse<NLActionResponse>>;
120
131
  aiAssert: (request: AssertionRequest) => Promise<APIResponse<AssertionResult>>;
@@ -123,6 +134,75 @@ interface UIBridgeServerHandlers {
123
134
  getSemanticDiff: (since?: number) => Promise<APIResponse<SemanticDiff | null>>;
124
135
  getPageSummary: () => Promise<APIResponse<string>>;
125
136
  aiSemanticSearch: (criteria: SemanticSearchCriteria) => Promise<APIResponse<SemanticSearchResponse>>;
137
+ getStates: () => Promise<APIResponse<UIState[]>>;
138
+ getState: (id: string) => Promise<APIResponse<UIState>>;
139
+ getActiveStates: () => Promise<APIResponse<UIState[]>>;
140
+ activateState: (id: string) => Promise<APIResponse<void>>;
141
+ deactivateState: (id: string) => Promise<APIResponse<void>>;
142
+ getStateGroups: () => Promise<APIResponse<UIStateGroup[]>>;
143
+ activateStateGroup: (id: string) => Promise<APIResponse<void>>;
144
+ deactivateStateGroup: (id: string) => Promise<APIResponse<void>>;
145
+ getTransitions: () => Promise<APIResponse<UITransition[]>>;
146
+ canExecuteTransition: (id: string) => Promise<APIResponse<{
147
+ canExecute: boolean;
148
+ reason?: string;
149
+ }>>;
150
+ executeTransition: (id: string) => Promise<APIResponse<TransitionResult>>;
151
+ findPath: (request: {
152
+ targetStates: string[];
153
+ }) => Promise<APIResponse<PathResult>>;
154
+ navigateTo: (request: {
155
+ targetStates: string[];
156
+ }) => Promise<APIResponse<NavigationResult>>;
157
+ getStateSnapshot: () => Promise<APIResponse<StateSnapshot>>;
158
+ executeIntent: (request: {
159
+ intentId: string;
160
+ params?: Record<string, unknown>;
161
+ }) => Promise<APIResponse<IntentExecutionResult>>;
162
+ findIntent: (request: {
163
+ query: string;
164
+ }) => Promise<APIResponse<IntentSearchResponse>>;
165
+ listIntents: () => Promise<APIResponse<Intent[]>>;
166
+ registerIntent: (intent: Intent) => Promise<APIResponse<Intent>>;
167
+ executeIntentFromQuery: (request: {
168
+ query: string;
169
+ params?: Record<string, unknown>;
170
+ }) => Promise<APIResponse<IntentExecutionResult>>;
171
+ attemptRecovery: (request: RecoveryAttemptRequest) => Promise<APIResponse<RecoveryAttemptResult>>;
172
+ analyzePageData: () => Promise<APIResponse<PageDataMap>>;
173
+ analyzePageRegions: () => Promise<APIResponse<PageRegionMap>>;
174
+ analyzeStructuredData: () => Promise<APIResponse<StructuredDataExtraction>>;
175
+ crossAppCompare: (request: {
176
+ sourceSnapshot: SemanticSnapshot;
177
+ targetSnapshot: SemanticSnapshot;
178
+ sourceComponents?: ComponentInfo[];
179
+ targetComponents?: ComponentInfo[];
180
+ }) => Promise<APIResponse<CrossAppComparisonReport>>;
181
+ pageRefresh: () => Promise<APIResponse<PageNavigationResponse>>;
182
+ pageNavigate: (request: PageNavigateRequest) => Promise<APIResponse<PageNavigationResponse>>;
183
+ pageGoBack: () => Promise<APIResponse<PageNavigationResponse>>;
184
+ pageGoForward: () => Promise<APIResponse<PageNavigationResponse>>;
185
+ getAnnotations: () => Promise<APIResponse<Record<string, ElementAnnotation>>>;
186
+ getAnnotation: (id: string) => Promise<APIResponse<ElementAnnotation>>;
187
+ setAnnotation: (id: string, annotation: ElementAnnotation) => Promise<APIResponse<ElementAnnotation>>;
188
+ deleteAnnotation: (id: string) => Promise<APIResponse<void>>;
189
+ importAnnotations: (config: AnnotationConfig) => Promise<APIResponse<{
190
+ count: number;
191
+ }>>;
192
+ exportAnnotations: () => Promise<APIResponse<AnnotationConfig>>;
193
+ getAnnotationCoverage: () => Promise<APIResponse<AnnotationCoverage>>;
194
+ getPerformanceEntries: () => Promise<APIResponse<unknown>>;
195
+ clearPerformanceEntries: () => Promise<APIResponse<{
196
+ cleared: boolean;
197
+ }>>;
198
+ getBrowserEvents: (params?: {
199
+ type?: string;
200
+ since?: number;
201
+ limit?: number;
202
+ }) => Promise<APIResponse<{
203
+ events: unknown[];
204
+ count: number;
205
+ }>>;
126
206
  }
127
207
  /**
128
208
  * Route definition
@@ -1,9 +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
136
  * Defines the fundamental types used throughout the UI Bridge framework,
5
137
  * plus ui-bridge-specific types (WebSocket protocol, accessibility, extended workflow types).
6
138
  */
139
+
7
140
  /**
8
141
  * Element identification using multiple strategies
9
142
  */
@@ -64,6 +197,29 @@ interface ElementState {
64
197
  * Types of UI elements that can be registered
65
198
  */
66
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
+ }
67
223
  /**
68
224
  * Standard actions available on elements
69
225
  */
@@ -109,6 +265,10 @@ interface RegisteredElement {
109
265
  registeredAt: number;
110
266
  /** Whether this element is currently mounted */
111
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;
112
272
  /** Alternative names for natural language matching */
113
273
  aliases?: string[];
114
274
  /** Human-readable description for AI agents */
@@ -360,6 +520,8 @@ interface ActionResponse {
360
520
  durationMs: number;
361
521
  /** Timestamp when the action completed */
362
522
  timestamp: number;
523
+ /** Console errors/warnings captured during action execution */
524
+ consoleErrors?: CapturedError[];
363
525
  }
364
526
  /**
365
527
  * Machine-readable error codes for action failures
@@ -431,12 +593,14 @@ interface BridgeSnapshot {
431
593
  /** All registered elements */
432
594
  elements: Array<{
433
595
  id: string;
434
- type: ElementType;
596
+ type: ElementType | string;
435
597
  label?: string;
436
598
  identifier: ElementIdentifier;
437
599
  state: ElementState;
438
600
  actions: StandardAction[];
439
601
  customActions?: string[];
602
+ category?: 'interactive' | 'content';
603
+ contentMetadata?: ContentMetadata;
440
604
  }>;
441
605
  /** All registered components */
442
606
  components: Array<{
@@ -499,6 +663,13 @@ interface UIBridgeConfig {
499
663
  maxLogEntries?: number;
500
664
  /** Enable verbose logging */
501
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
+ };
502
673
  }
503
674
  /**
504
675
  * Computed property definition
@@ -1003,4 +1174,4 @@ interface AccessibilityReport {
1003
1174
  durationMs: number;
1004
1175
  }
1005
1176
 
1006
- export type { WSGetElementMessage as $, AccessibilityIssue as A, BranchCondition as B, ComponentAction as C, UIBridgeFeatures as D, ElementAccessibility as E, UIState as F, UIStateGroup as G, UITransition as H, WSClientConfig as I, WSClientMessage as J, WSClientMessageType as K, LogConfig as L, WSConnectionState as M, NavigationResult as N, WSDiscoverMessage as O, PartialMatch as P, WSErrorMessage as Q, RecoveryAction as R, StandardAction as S, TransitionResult as T, UIBridgeConfig as U, WSEventMessage as V, WCAGLevel as W, WSExecuteActionMessage as X, WSExecuteComponentActionMessage as Y, WSExecuteWorkflowMessage as Z, WSFindMessage as _, AccessibilityReport as a, WSGetSnapshotMessage as a0, WSMessageBase as a1, WSPingMessage as a2, WSPongMessage as a3, WSResponseMessage as a4, WSServerMessage as a5, WSServerMessageType as a6, WSSubscribeMessage as a7, WSSubscribedMessage as a8, WSSubscriptionOptions as a9, WSUnsubscribeMessage as aa, WSUnsubscribedMessage as ab, WSWelcomeMessage as ac, WSWorkflowProgressMessage as ad, WaitOptions as ae, Workflow as af, WorkflowStep as ag, WorkflowStepType as ah, AccessibilitySeverity as b, ActionErrorCode as c, ActionFailureDetails as d, ActionHandler as e, ActionRequest as f, ActionResponse as g, AriaCheckedState as h, BridgeEvent as i, BridgeEventListener as j, BridgeEventType as k, BridgeSnapshot as l, ComponentStateResponse as m, ComputedProperty as n, CustomAction as o, ElementIdentifier as p, ElementState as q, ElementType as r, ExtendedWorkflowStep as s, ExtractConfig as t, LoopConfig as u, PathResult as v, RegisteredComponent as w, RegisteredElement as x, StateGetter as y, StateSnapshot 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 };