@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
@@ -0,0 +1,1275 @@
1
+ import { u as ContentMetadata, F as ElementType, z as ElementState } from './types-suaYwWWg.mjs';
2
+ import { D as DiscoveredElement } from './types-CJGrBEhC.mjs';
3
+
4
+ /**
5
+ * AI Module Types
6
+ *
7
+ * Defines types for AI-native UI Bridge functionality including
8
+ * search criteria, natural language actions, assertions, and semantic snapshots.
9
+ */
10
+
11
+ /**
12
+ * Criteria for searching elements using multiple strategies
13
+ */
14
+ interface SearchCriteria {
15
+ /** Exact visible text match: "Start Extraction" */
16
+ text?: string;
17
+ /** Alias for text (used by spec assertions) */
18
+ textContent?: string;
19
+ /** Partial text match: "Start" */
20
+ textContains?: string;
21
+ /** Accessible name (aria-label, associated labels) */
22
+ accessibleName?: string;
23
+ /** ARIA role: "button", "input" */
24
+ role?: string;
25
+ /** Element type (more specific than role) */
26
+ type?: ElementType;
27
+ /** Spatial proximity: "near the URL input" */
28
+ near?: string;
29
+ /** Container context: "within the login form" */
30
+ within?: string;
31
+ /** Enable fuzzy matching (default: true) */
32
+ fuzzy?: boolean;
33
+ /** Fuzzy match confidence threshold 0-1 (default: 0.7) */
34
+ fuzzyThreshold?: number;
35
+ /** Element ID pattern (supports wildcards) */
36
+ idPattern?: string;
37
+ /** CSS selector */
38
+ selector?: string;
39
+ /** Placeholder text (for inputs) */
40
+ placeholder?: string;
41
+ /** Title attribute */
42
+ title?: string;
43
+ /** Data attributes to match */
44
+ dataAttributes?: Record<string, string>;
45
+ /** Filter by content role */
46
+ contentRole?: string;
47
+ /** Include content (non-interactive) elements in search */
48
+ includeContent?: boolean;
49
+ /** Only search content elements */
50
+ contentOnly?: boolean;
51
+ }
52
+ /**
53
+ * Result from a search operation
54
+ */
55
+ interface SearchResult {
56
+ /** The matched element */
57
+ element: AIDiscoveredElement;
58
+ /** Match confidence 0-1 */
59
+ confidence: number;
60
+ /** Reasons why this element matched */
61
+ matchReasons: string[];
62
+ /** Match scores by strategy */
63
+ scores: {
64
+ text?: number;
65
+ accessibility?: number;
66
+ role?: number;
67
+ spatial?: number;
68
+ fuzzy?: number;
69
+ };
70
+ }
71
+ /**
72
+ * Response from search operations
73
+ */
74
+ interface SearchResponse {
75
+ /** All matching results sorted by confidence */
76
+ results: SearchResult[];
77
+ /** Best match (highest confidence above threshold) */
78
+ bestMatch: SearchResult | null;
79
+ /** Total elements scanned */
80
+ scannedCount: number;
81
+ /** Search duration in milliseconds */
82
+ durationMs: number;
83
+ /** Search criteria used */
84
+ criteria: SearchCriteria;
85
+ /** Timestamp */
86
+ timestamp: number;
87
+ }
88
+ /**
89
+ * Element with AI-generated metadata and descriptions
90
+ */
91
+ interface AIDiscoveredElement extends DiscoveredElement {
92
+ /** Human-readable description: "Blue submit button in the form" */
93
+ description: string;
94
+ /** Auto-generated aliases for natural language matching */
95
+ aliases: string[];
96
+ /** Inferred purpose: "Submits the form" */
97
+ purpose?: string;
98
+ /** Parent context identifier */
99
+ parentContext?: string;
100
+ /** Suggested actions in natural language */
101
+ suggestedActions: string[];
102
+ /** Semantic type (more descriptive than ElementType) */
103
+ semanticType?: string;
104
+ /** Associated label text */
105
+ labelText?: string;
106
+ /** Placeholder text (for inputs) */
107
+ placeholder?: string;
108
+ /** Title attribute */
109
+ title?: string;
110
+ /** ARIA description */
111
+ ariaDescription?: string;
112
+ /** Whether this is an interactive element or static content */
113
+ category?: 'interactive' | 'content';
114
+ /** Metadata for content elements */
115
+ contentMetadata?: ContentMetadata;
116
+ }
117
+ /**
118
+ * Response from AI find operations
119
+ */
120
+ interface AIFindResponse {
121
+ /** All discovered elements with AI metadata */
122
+ elements: AIDiscoveredElement[];
123
+ /** LLM-friendly text summary of the page */
124
+ summary: string;
125
+ /** Detected forms with their fields */
126
+ forms?: FormAnalysis[];
127
+ /** Page context information */
128
+ pageContext: PageContext;
129
+ /** Find duration */
130
+ durationMs: number;
131
+ /** Timestamp */
132
+ timestamp: number;
133
+ }
134
+ /**
135
+ * Page context information
136
+ */
137
+ interface PageContext {
138
+ /** Current URL */
139
+ url: string;
140
+ /** Page title */
141
+ title: string;
142
+ /** Inferred page type */
143
+ pageType?: 'login' | 'dashboard' | 'form' | 'list' | 'detail' | 'search' | 'checkout' | 'settings' | 'unknown';
144
+ /** Active modals/dialogs */
145
+ activeModals: string[];
146
+ /** Currently focused element */
147
+ focusedElement?: string;
148
+ /** Detected navigation elements */
149
+ navigation?: string[];
150
+ }
151
+ /**
152
+ * Form analysis result
153
+ */
154
+ interface FormAnalysis {
155
+ /** Form element ID */
156
+ id: string;
157
+ /** Form name attribute */
158
+ name?: string;
159
+ /** Detected form purpose */
160
+ purpose?: string;
161
+ /** Form fields */
162
+ fields: FormFieldAnalysis[];
163
+ /** Whether form is valid */
164
+ isValid: boolean;
165
+ /** Submit button ID */
166
+ submitButton?: string;
167
+ /** Cancel/reset button ID */
168
+ cancelButton?: string;
169
+ }
170
+ /**
171
+ * Form field analysis
172
+ */
173
+ interface FormFieldAnalysis {
174
+ /** Field element ID */
175
+ id: string;
176
+ /** Field label */
177
+ label: string;
178
+ /** Input type */
179
+ type: string;
180
+ /** Current value */
181
+ value: string;
182
+ /** Whether field is valid */
183
+ valid: boolean;
184
+ /** Validation error message */
185
+ error?: string;
186
+ /** Whether field is required */
187
+ required: boolean;
188
+ /** Placeholder text */
189
+ placeholder?: string;
190
+ }
191
+ /**
192
+ * Natural language action request
193
+ */
194
+ interface NLActionRequest {
195
+ /** Natural language instruction: "click the Start Extraction button" */
196
+ instruction: string;
197
+ /** Optional context to help disambiguate */
198
+ context?: string;
199
+ /** Timeout for the operation */
200
+ timeout?: number;
201
+ /** Confidence threshold for element matching */
202
+ confidenceThreshold?: number;
203
+ }
204
+ /**
205
+ * Parsed action from natural language
206
+ */
207
+ interface ParsedAction {
208
+ /** Action type */
209
+ action: 'click' | 'type' | 'select' | 'check' | 'uncheck' | 'scroll' | 'wait' | 'assert' | 'hover' | 'focus' | 'clear' | 'doubleClick' | 'rightClick';
210
+ /** Description of the target element */
211
+ targetDescription: string;
212
+ /** Value for type/select actions */
213
+ value?: string;
214
+ /** Key modifiers */
215
+ modifiers?: ('shift' | 'ctrl' | 'alt' | 'meta')[];
216
+ /** Scroll direction for scroll actions */
217
+ scrollDirection?: 'up' | 'down' | 'left' | 'right';
218
+ /** Wait condition for wait actions */
219
+ waitCondition?: string;
220
+ /** Assertion type for assert actions */
221
+ assertionType?: AssertionType;
222
+ /** Raw instruction that was parsed */
223
+ rawInstruction: string;
224
+ /** Parse confidence */
225
+ parseConfidence: number;
226
+ }
227
+ /**
228
+ * Partial match information for structured failures
229
+ */
230
+ interface PartialMatchInfo {
231
+ /** Element ID */
232
+ elementId: string;
233
+ /** Match confidence 0-1 */
234
+ confidence: number;
235
+ /** Why this element was considered but not selected */
236
+ reason: string;
237
+ /** Element type */
238
+ type: string;
239
+ /** Element description/label */
240
+ description?: string;
241
+ }
242
+ /**
243
+ * Recovery suggestion for structured failures
244
+ */
245
+ interface RecoverySuggestionInfo {
246
+ /** Human-readable suggestion */
247
+ suggestion: string;
248
+ /** Machine-executable command (if applicable) */
249
+ command?: string;
250
+ /** Confidence that this action will help (0-1) */
251
+ confidence: number;
252
+ /** Whether retry with same parameters might help */
253
+ retryable: boolean;
254
+ }
255
+ /**
256
+ * Structured failure information for NL action responses
257
+ */
258
+ interface StructuredFailureInfo {
259
+ /** Machine-readable error code */
260
+ errorCode: string;
261
+ /** Human-readable error message */
262
+ message: string;
263
+ /** Target element ID (if known) */
264
+ elementId?: string;
265
+ /** Selectors/strategies that were attempted */
266
+ selectorsTried?: string[];
267
+ /** Similar elements that were found but not used */
268
+ partialMatches?: PartialMatchInfo[];
269
+ /** Current state of the target element (if found) */
270
+ elementState?: ElementState;
271
+ /** Reference to visual context (screenshot path/id) */
272
+ screenshotContext?: string;
273
+ /** Suggested recovery actions */
274
+ suggestedActions?: RecoverySuggestionInfo[];
275
+ /** Whether retry with same parameters might help */
276
+ retryRecommended: boolean;
277
+ /** Additional context data */
278
+ context?: Record<string, unknown>;
279
+ /** Duration before failure in milliseconds */
280
+ durationMs?: number;
281
+ /** Timeout value that was exceeded (for timeout errors) */
282
+ timeoutMs?: number;
283
+ }
284
+ /**
285
+ * Response from executing a natural language action
286
+ */
287
+ interface NLActionResponse {
288
+ /** Whether the action succeeded */
289
+ success: boolean;
290
+ /** Human-readable description of what was done */
291
+ executedAction: string;
292
+ /** The element that was used */
293
+ elementUsed: AIDiscoveredElement;
294
+ /** Match confidence for the element */
295
+ confidence: number;
296
+ /** Element state after the action */
297
+ elementState: ElementState;
298
+ /** Action duration */
299
+ durationMs: number;
300
+ /** Timestamp */
301
+ timestamp: number;
302
+ /** Error message if failed */
303
+ error?: string;
304
+ /** Error code */
305
+ errorCode?: string;
306
+ /** Suggestions for recovery */
307
+ suggestions?: string[];
308
+ /** Alternative elements that could have been used */
309
+ alternatives?: SearchResult[];
310
+ /** Detailed failure information when success is false */
311
+ failureInfo?: StructuredFailureInfo;
312
+ }
313
+ /**
314
+ * Types of assertions that can be made about elements
315
+ */
316
+ type AssertionType = 'visible' | 'hidden' | 'enabled' | 'disabled' | 'focused' | 'checked' | 'unchecked' | 'hasText' | 'containsText' | 'hasValue' | 'hasClass' | 'exists' | 'notExists' | 'count' | 'attribute' | 'cssProperty';
317
+ /**
318
+ * Assertion request
319
+ */
320
+ interface AssertionRequest {
321
+ /** Element target (ID or natural language description) */
322
+ target: string | SearchCriteria;
323
+ /** Type of assertion */
324
+ type: AssertionType;
325
+ /** Expected value (for hasText, hasValue, count, attribute, cssProperty) */
326
+ expected?: unknown;
327
+ /** Attribute name (for attribute assertions) */
328
+ attributeName?: string;
329
+ /** CSS property name (for cssProperty assertions) */
330
+ propertyName?: string;
331
+ /** Timeout for waiting (ms) */
332
+ timeout?: number;
333
+ /** Custom failure message */
334
+ message?: string;
335
+ /** Whether to use fuzzy matching for element search */
336
+ fuzzy?: boolean;
337
+ }
338
+ /**
339
+ * Assertion result
340
+ */
341
+ interface AssertionResult {
342
+ /** Whether the assertion passed */
343
+ passed: boolean;
344
+ /** Element target that was checked */
345
+ target: string;
346
+ /** Human-readable description of the target */
347
+ targetDescription: string;
348
+ /** Expected value */
349
+ expected: unknown;
350
+ /** Actual value */
351
+ actual: unknown;
352
+ /** Failure reason if assertion failed */
353
+ failureReason?: string;
354
+ /** Suggestion for fixing the failure */
355
+ suggestion?: string;
356
+ /** Element state at time of assertion */
357
+ elementState?: ElementState;
358
+ /** Search metadata from element lookup (confidence, match reasons, candidate count) */
359
+ searchDetails?: {
360
+ confidence: number;
361
+ matchReasons: string[];
362
+ candidateCount: number;
363
+ };
364
+ /** Duration of the assertion */
365
+ durationMs: number;
366
+ /** Timestamp */
367
+ timestamp: number;
368
+ }
369
+ /**
370
+ * Batch assertion request
371
+ */
372
+ interface BatchAssertionRequest {
373
+ /** Assertions to execute */
374
+ assertions: AssertionRequest[];
375
+ /** Mode: 'all' requires all to pass, 'any' requires at least one */
376
+ mode: 'all' | 'any';
377
+ /** Stop on first failure */
378
+ stopOnFailure?: boolean;
379
+ }
380
+ /**
381
+ * Batch assertion result
382
+ */
383
+ interface BatchAssertionResult {
384
+ /** Overall pass/fail */
385
+ passed: boolean;
386
+ /** Individual assertion results */
387
+ results: AssertionResult[];
388
+ /** Number of passed assertions */
389
+ passedCount: number;
390
+ /** Number of failed assertions */
391
+ failedCount: number;
392
+ /** Total duration */
393
+ durationMs: number;
394
+ /** Timestamp */
395
+ timestamp: number;
396
+ }
397
+ /**
398
+ * Semantic snapshot of the current page state
399
+ */
400
+ interface SemanticSnapshot {
401
+ /** Snapshot timestamp */
402
+ timestamp: number;
403
+ /** Snapshot ID for diffing */
404
+ snapshotId: string;
405
+ /** Page information */
406
+ page: PageContext;
407
+ /** All elements with AI metadata */
408
+ elements: AIDiscoveredElement[];
409
+ /** Form states */
410
+ forms: FormState[];
411
+ /** Active modals */
412
+ activeModals: ModalState[];
413
+ /** Currently focused element */
414
+ focusedElement?: string;
415
+ /** LLM-readable summary */
416
+ summary: string;
417
+ /** Element count by type */
418
+ elementCounts: Record<string, number>;
419
+ }
420
+ /**
421
+ * Form state in semantic snapshot
422
+ */
423
+ interface FormState {
424
+ /** Form ID */
425
+ id: string;
426
+ /** Form name */
427
+ name?: string;
428
+ /** Form purpose */
429
+ purpose?: string;
430
+ /** Field states */
431
+ fields: FormFieldState[];
432
+ /** Overall validity */
433
+ isValid: boolean;
434
+ /** Submit button */
435
+ submitButton?: string;
436
+ /** Whether form is dirty (has changes) */
437
+ isDirty: boolean;
438
+ }
439
+ /**
440
+ * Form field state
441
+ */
442
+ interface FormFieldState {
443
+ /** Field ID */
444
+ id: string;
445
+ /** Field label */
446
+ label: string;
447
+ /** Input type */
448
+ type: string;
449
+ /** Current value */
450
+ value: string;
451
+ /** Validity */
452
+ valid: boolean;
453
+ /** Error message */
454
+ error?: string;
455
+ /** Required flag */
456
+ required: boolean;
457
+ /** Touched flag */
458
+ touched: boolean;
459
+ }
460
+ /**
461
+ * Modal/dialog state
462
+ */
463
+ interface ModalState {
464
+ /** Modal ID */
465
+ id: string;
466
+ /** Modal title */
467
+ title?: string;
468
+ /** Modal type */
469
+ type: 'dialog' | 'alert' | 'confirm' | 'prompt' | 'drawer' | 'popup';
470
+ /** Whether modal is blocking */
471
+ blocking: boolean;
472
+ /** Close button ID */
473
+ closeButton?: string;
474
+ /** Primary action button */
475
+ primaryAction?: string;
476
+ /** Secondary action button */
477
+ secondaryAction?: string;
478
+ }
479
+ /**
480
+ * Semantic diff between two snapshots
481
+ */
482
+ interface SemanticDiff {
483
+ /** LLM-readable summary of changes */
484
+ summary: string;
485
+ /** From snapshot ID */
486
+ fromSnapshotId: string;
487
+ /** To snapshot ID */
488
+ toSnapshotId: string;
489
+ /** Detailed changes */
490
+ changes: {
491
+ /** Elements that appeared */
492
+ appeared: ElementChange[];
493
+ /** Elements that disappeared */
494
+ disappeared: ElementChange[];
495
+ /** Elements that were modified */
496
+ modified: ElementModification[];
497
+ };
498
+ /** Content-specific changes (text, metrics, statuses) */
499
+ contentChanges?: ContentChanges;
500
+ /** Probable trigger for the changes */
501
+ probableTrigger?: string;
502
+ /** Suggested next actions based on changes */
503
+ suggestedActions?: string[];
504
+ /** Page context changes */
505
+ pageChanges?: {
506
+ urlChanged: boolean;
507
+ titleChanged: boolean;
508
+ newUrl?: string;
509
+ newTitle?: string;
510
+ };
511
+ /** Duration of diff computation */
512
+ durationMs: number;
513
+ /** Timestamp */
514
+ timestamp: number;
515
+ }
516
+ /**
517
+ * Content-specific changes detected between snapshots
518
+ */
519
+ interface ContentChanges {
520
+ /** General text content changes */
521
+ textChanges: TextChange[];
522
+ /** Metric/numeric value changes with delta analysis */
523
+ metricChanges: MetricChange[];
524
+ /** Status/badge changes with direction analysis */
525
+ statusChanges: StatusChange[];
526
+ /** Human-readable summary of content changes */
527
+ summary: string;
528
+ }
529
+ /**
530
+ * A text content change between snapshots
531
+ */
532
+ interface TextChange {
533
+ /** Element ID */
534
+ elementId: string;
535
+ /** Content type (e.g., 'heading', 'paragraph', 'badge') */
536
+ contentType: string;
537
+ /** Previous text value */
538
+ oldText: string;
539
+ /** New text value */
540
+ newText: string;
541
+ /** Whether content was modified, added, or removed */
542
+ changeType: 'modified' | 'added' | 'removed';
543
+ }
544
+ /**
545
+ * A metric value change with numeric analysis
546
+ */
547
+ interface MetricChange {
548
+ /** Element ID */
549
+ elementId: string;
550
+ /** Associated label or description */
551
+ label: string;
552
+ /** Previous value as string */
553
+ oldValue: string;
554
+ /** New value as string */
555
+ newValue: string;
556
+ /** Numeric delta if both values are parseable */
557
+ numericDelta?: number;
558
+ /** Percent change if both values are parseable */
559
+ percentChange?: number;
560
+ /** Whether the change is significant (>10% or sign flip) */
561
+ significant: boolean;
562
+ }
563
+ /**
564
+ * A status change with direction analysis
565
+ */
566
+ interface StatusChange {
567
+ /** Element ID */
568
+ elementId: string;
569
+ /** Associated label or description */
570
+ label: string;
571
+ /** Previous status text */
572
+ oldStatus: string;
573
+ /** New status text */
574
+ newStatus: string;
575
+ /** Whether the change is positive, negative, or neutral */
576
+ direction: 'improved' | 'degraded' | 'neutral';
577
+ }
578
+ /**
579
+ * Element change (appeared/disappeared)
580
+ */
581
+ interface ElementChange {
582
+ /** Element ID */
583
+ elementId: string;
584
+ /** Element description */
585
+ description: string;
586
+ /** Element type */
587
+ type: string;
588
+ /** Semantic type */
589
+ semanticType?: string;
590
+ }
591
+ /**
592
+ * Element modification
593
+ */
594
+ interface ElementModification {
595
+ /** Element ID */
596
+ elementId: string;
597
+ /** Element description */
598
+ description: string;
599
+ /** Property that changed */
600
+ property: string;
601
+ /** Previous value */
602
+ from: string;
603
+ /** New value */
604
+ to: string;
605
+ /** Whether this is a significant change */
606
+ significant: boolean;
607
+ }
608
+ /**
609
+ * Semantic search criteria using embeddings
610
+ */
611
+ interface SemanticSearchCriteria {
612
+ /** Natural language query for semantic matching */
613
+ query: string;
614
+ /** Minimum similarity score (0-1, default: 0.5) */
615
+ threshold?: number;
616
+ /** Maximum results to return */
617
+ limit?: number;
618
+ /** Filter by element type */
619
+ type?: string;
620
+ /** Filter by ARIA role */
621
+ role?: string;
622
+ /** Combine with text-based search */
623
+ combineWithText?: boolean;
624
+ }
625
+ /**
626
+ * Semantic search result
627
+ */
628
+ interface SemanticSearchResult {
629
+ /** The matched element */
630
+ element: AIDiscoveredElement;
631
+ /** Semantic similarity score (0-1) */
632
+ similarity: number;
633
+ /** Rank in results (1-indexed) */
634
+ rank: number;
635
+ /** Text that was used for embedding */
636
+ embeddedText: string;
637
+ }
638
+ /**
639
+ * Response from semantic search operations
640
+ */
641
+ interface SemanticSearchResponse {
642
+ /** All matching results sorted by similarity */
643
+ results: SemanticSearchResult[];
644
+ /** Best match (highest similarity above threshold) */
645
+ bestMatch: SemanticSearchResult | null;
646
+ /** Total elements scanned */
647
+ scannedCount: number;
648
+ /** Search duration in milliseconds */
649
+ durationMs: number;
650
+ /** Query used */
651
+ query: string;
652
+ /** Embedding provider info */
653
+ providerInfo?: {
654
+ provider: string;
655
+ model: string;
656
+ dimension: number;
657
+ };
658
+ /** Timestamp */
659
+ timestamp: number;
660
+ }
661
+ /**
662
+ * Rich error context for AI agents
663
+ */
664
+ interface AIErrorContext {
665
+ /** Error code */
666
+ code: string;
667
+ /** Human-readable error message */
668
+ message: string;
669
+ /** What action was attempted */
670
+ attemptedAction: string;
671
+ /** Search criteria used (if applicable) */
672
+ searchCriteria?: SearchCriteria;
673
+ /** Information about what was found */
674
+ searchResults: {
675
+ /** Number of candidates found */
676
+ candidatesFound: number;
677
+ /** Nearest match if any */
678
+ nearestMatch?: {
679
+ element: AIDiscoveredElement;
680
+ confidence: number;
681
+ whyNotSelected: string;
682
+ };
683
+ };
684
+ /** Page state at time of error */
685
+ pageContext: {
686
+ url: string;
687
+ title: string;
688
+ visibleElements: number;
689
+ /** Possible blockers like modals */
690
+ possibleBlockers: string[];
691
+ };
692
+ /** Recovery suggestions */
693
+ suggestions: RecoverySuggestion[];
694
+ /** Stack trace if available */
695
+ stack?: string;
696
+ /** Timestamp */
697
+ timestamp: number;
698
+ }
699
+ /**
700
+ * Recovery suggestion for errors
701
+ */
702
+ interface RecoverySuggestion {
703
+ /** Human-readable action description */
704
+ action: string;
705
+ /** Command to execute (if applicable) */
706
+ command?: string;
707
+ /** Confidence that this will help */
708
+ confidence: number;
709
+ /** Priority (lower = try first) */
710
+ priority: number;
711
+ }
712
+ /**
713
+ * Extended element registration options with AI metadata
714
+ */
715
+ interface AIElementRegistrationOptions {
716
+ /** Alternative names for the element */
717
+ aliases?: string[];
718
+ /** Human-readable description */
719
+ description?: string;
720
+ /** Semantic type (more descriptive than ElementType) */
721
+ semanticType?: string;
722
+ /** Purpose of the element */
723
+ purpose?: string;
724
+ /** Whether to auto-generate aliases */
725
+ autoGenerateAliases?: boolean;
726
+ }
727
+ /**
728
+ * Parameter definition for an intent
729
+ */
730
+ interface IntentParam {
731
+ /** Parameter type (e.g., 'string', 'number', 'boolean') */
732
+ type: string;
733
+ /** Whether the parameter is required */
734
+ required?: boolean;
735
+ /** Description of the parameter */
736
+ description?: string;
737
+ /** Default value */
738
+ default?: unknown;
739
+ }
740
+ /**
741
+ * An intent represents a high-level user goal that can be executed
742
+ */
743
+ interface Intent {
744
+ /** Unique intent identifier */
745
+ id: string;
746
+ /** Human-readable name */
747
+ name: string;
748
+ /** Description of what the intent does */
749
+ description: string;
750
+ /** Tags for categorization and search */
751
+ tags?: string[];
752
+ /** Parameters the intent accepts */
753
+ params?: Record<string, IntentParam>;
754
+ /** Handler identifier */
755
+ handler?: string;
756
+ }
757
+ /**
758
+ * Response from intent search/find operations
759
+ */
760
+ interface IntentSearchResponse {
761
+ /** Matched intents with confidence scores */
762
+ intents: Array<{
763
+ intent: Intent;
764
+ confidence: number;
765
+ }>;
766
+ }
767
+ /**
768
+ * Result from executing an intent
769
+ */
770
+ interface IntentExecutionResult {
771
+ /** Whether the intent executed successfully */
772
+ success: boolean;
773
+ /** ID of the intent that was executed */
774
+ intentId: string;
775
+ /** Result data from the intent execution */
776
+ result?: unknown;
777
+ /** Error message if failed */
778
+ error?: string;
779
+ /** Duration of intent execution in milliseconds */
780
+ durationMs: number;
781
+ }
782
+ /**
783
+ * Request to attempt recovery from a failure
784
+ */
785
+ interface RecoveryAttemptRequest {
786
+ /** The failure to recover from */
787
+ failure: StructuredFailureInfo;
788
+ /** Natural language instruction for recovery */
789
+ instruction: string;
790
+ /** Optional element ID related to the failure */
791
+ elementId?: string;
792
+ /** Maximum number of retries */
793
+ maxRetries: number;
794
+ }
795
+ /**
796
+ * Result from a recovery attempt
797
+ */
798
+ interface RecoveryAttemptResult {
799
+ /** Whether recovery was successful */
800
+ recovered: boolean;
801
+ /** Names of strategies that were attempted */
802
+ strategiesAttempted: string[];
803
+ /** Final action result if recovery succeeded */
804
+ finalResult?: NLActionResponse;
805
+ /** Error message if recovery failed */
806
+ error?: string;
807
+ /** Duration of recovery attempts in milliseconds */
808
+ durationMs: number;
809
+ }
810
+ /** Classified data type for extracted values */
811
+ type DataType = 'text' | 'number' | 'currency' | 'date' | 'email' | 'url' | 'phone' | 'percentage' | 'boolean' | 'enum' | 'unknown';
812
+ /** A single extracted data value from a page element */
813
+ interface ExtractedDataValue {
814
+ /** Source element ID */
815
+ elementId: string;
816
+ /** Accessible name or label */
817
+ label: string;
818
+ /** Raw text value */
819
+ rawValue: string;
820
+ /** Normalized value for comparison */
821
+ normalizedValue: string;
822
+ /** Classified data type */
823
+ dataType: DataType;
824
+ /** Confidence in the classification (0-1) */
825
+ confidence: number;
826
+ }
827
+ /** Map of labeled data values extracted from a page */
828
+ interface PageDataMap {
829
+ /** All extracted values keyed by label */
830
+ values: Record<string, ExtractedDataValue>;
831
+ /** Total elements scanned */
832
+ scannedCount: number;
833
+ /** Elements with extractable data */
834
+ extractedCount: number;
835
+ }
836
+ /** Semantic region type */
837
+ type RegionType = 'header' | 'navigation' | 'sidebar' | 'main-content' | 'footer' | 'form' | 'table' | 'card' | 'modal' | 'toolbar' | 'unknown';
838
+ /** A segmented region of a page */
839
+ interface PageRegion {
840
+ /** Region type */
841
+ type: RegionType;
842
+ /** Bounding box */
843
+ bounds: {
844
+ x: number;
845
+ y: number;
846
+ width: number;
847
+ height: number;
848
+ };
849
+ /** Element IDs contained in this region */
850
+ elementIds: string[];
851
+ /** Computed label for the region */
852
+ label: string;
853
+ /** Confidence in the classification (0-1) */
854
+ confidence: number;
855
+ }
856
+ /** All regions on a page */
857
+ interface PageRegionMap {
858
+ /** Detected regions */
859
+ regions: PageRegion[];
860
+ /** Total elements assigned to regions */
861
+ assignedCount: number;
862
+ /** Elements not assigned to any region */
863
+ unassignedIds: string[];
864
+ }
865
+ /** Column definition for an extracted table */
866
+ interface TableColumn {
867
+ /** Column header text */
868
+ header: string;
869
+ /** Index in the table */
870
+ index: number;
871
+ /** Detected data type for the column */
872
+ dataType: DataType;
873
+ }
874
+ /** Schema of an extracted table */
875
+ interface TableSchema {
876
+ /** Table label or caption */
877
+ label: string;
878
+ /** Columns */
879
+ columns: TableColumn[];
880
+ /** Row data (array of row arrays) */
881
+ rows: string[][];
882
+ /** Source element ID */
883
+ sourceElementId?: string;
884
+ }
885
+ /** Field definition for a list item */
886
+ interface ListItemField {
887
+ /** Field label */
888
+ label: string;
889
+ /** Detected data type */
890
+ dataType: DataType;
891
+ }
892
+ /** Schema of an extracted list */
893
+ interface ListSchema {
894
+ /** List label */
895
+ label: string;
896
+ /** Item fields */
897
+ fields: ListItemField[];
898
+ /** Items (array of field-value maps) */
899
+ items: Record<string, string>[];
900
+ /** Source element ID */
901
+ sourceElementId?: string;
902
+ }
903
+ /** All structured data extracted from a page */
904
+ interface StructuredDataExtraction {
905
+ /** Extracted tables */
906
+ tables: TableSchema[];
907
+ /** Extracted lists */
908
+ lists: ListSchema[];
909
+ }
910
+ /** Describes the format of a data value */
911
+ interface FormatDescriptor {
912
+ /** Element ID */
913
+ elementId: string;
914
+ /** Label */
915
+ label: string;
916
+ /** Data type */
917
+ dataType: DataType;
918
+ /** Detected format pattern (e.g., "MM/DD/YYYY", "$#,###.##") */
919
+ pattern: string;
920
+ /** Example value */
921
+ example: string;
922
+ }
923
+ /** A format mismatch between source and target */
924
+ interface FormatMismatch {
925
+ /** Label of the data field */
926
+ label: string;
927
+ /** Source format */
928
+ sourceFormat: FormatDescriptor;
929
+ /** Target format */
930
+ targetFormat: FormatDescriptor;
931
+ /** Severity: 'info' | 'warning' | 'error' */
932
+ severity: 'info' | 'warning' | 'error';
933
+ /** Human-readable description of the mismatch */
934
+ description: string;
935
+ }
936
+ /** A pair of matched elements across apps */
937
+ interface MatchedElementPair {
938
+ /** Source element ID */
939
+ sourceId: string;
940
+ /** Target element ID */
941
+ targetId: string;
942
+ /** Source element label */
943
+ sourceLabel: string;
944
+ /** Target element label */
945
+ targetLabel: string;
946
+ /** Match confidence (0-1) */
947
+ confidence: number;
948
+ /** Strategy that matched them */
949
+ matchStrategy: string;
950
+ }
951
+ /** Comparison of a data value between source and target */
952
+ interface DataValueComparison {
953
+ /** Field label */
954
+ label: string;
955
+ /** Source value */
956
+ sourceValue: string;
957
+ /** Target value */
958
+ targetValue: string;
959
+ /** Whether values match after normalization */
960
+ valuesMatch: boolean;
961
+ /** Whether formats match */
962
+ formatsMatch: boolean;
963
+ }
964
+ /** Full cross-app diff result */
965
+ interface CrossAppDiff {
966
+ /** Matched element pairs */
967
+ matchedPairs: MatchedElementPair[];
968
+ /** Source elements with no match */
969
+ unmatchedSourceIds: string[];
970
+ /** Target elements with no match */
971
+ unmatchedTargetIds: string[];
972
+ /** Data value comparisons for matched pairs */
973
+ dataComparisons: DataValueComparison[];
974
+ /** Format mismatches */
975
+ formatMismatches: FormatMismatch[];
976
+ }
977
+ /** Comparison of interactive capabilities between matched elements */
978
+ interface InteractionParity {
979
+ /** Matched element pair */
980
+ pair: MatchedElementPair;
981
+ /** Actions available in source */
982
+ sourceActions: string[];
983
+ /** Actions available in target */
984
+ targetActions: string[];
985
+ /** Actions present in source but missing in target */
986
+ missingInTarget: string[];
987
+ /** Actions present in target but missing in source */
988
+ missingInSource: string[];
989
+ }
990
+ /** A pair of navigation elements across apps */
991
+ interface NavigationPair {
992
+ /** Source navigation element */
993
+ sourceId: string;
994
+ /** Target navigation element */
995
+ targetId: string;
996
+ /** Link text or label */
997
+ label: string;
998
+ /** Source href/destination */
999
+ sourceHref?: string;
1000
+ /** Target href/destination */
1001
+ targetHref?: string;
1002
+ /** Whether the destination is equivalent */
1003
+ destinationMatch: boolean;
1004
+ }
1005
+ /** Full navigation map comparison */
1006
+ interface NavigationMap {
1007
+ /** Matched navigation pairs */
1008
+ pairs: NavigationPair[];
1009
+ /** Navigation items only in source */
1010
+ sourceOnly: string[];
1011
+ /** Navigation items only in target */
1012
+ targetOnly: string[];
1013
+ }
1014
+ /** Information about a component (from /control/components) */
1015
+ interface ComponentInfo {
1016
+ /** Component ID */
1017
+ id: string;
1018
+ /** Component name */
1019
+ name: string;
1020
+ /** Component type */
1021
+ type: string;
1022
+ /** State keys */
1023
+ stateKeys: string[];
1024
+ /** Action names */
1025
+ actions: string[];
1026
+ }
1027
+ /** A matched pair of components */
1028
+ interface ComponentMatch {
1029
+ /** Source component */
1030
+ source: ComponentInfo;
1031
+ /** Target component */
1032
+ target: ComponentInfo;
1033
+ /** Match confidence (0-1) */
1034
+ confidence: number;
1035
+ /** State key differences */
1036
+ stateKeyDiff: {
1037
+ missing: string[];
1038
+ extra: string[];
1039
+ };
1040
+ /** Action differences */
1041
+ actionDiff: {
1042
+ missing: string[];
1043
+ extra: string[];
1044
+ };
1045
+ }
1046
+ /** Full component comparison result */
1047
+ interface ComponentComparison {
1048
+ /** Matched component pairs */
1049
+ matches: ComponentMatch[];
1050
+ /** Source-only components */
1051
+ sourceOnly: ComponentInfo[];
1052
+ /** Target-only components */
1053
+ targetOnly: ComponentInfo[];
1054
+ }
1055
+ /** Detected grid structure from element positions */
1056
+ interface GridStructure {
1057
+ /** Detected column positions (x-coordinates) */
1058
+ columns: number[];
1059
+ /** Detected row positions (y-coordinates) */
1060
+ rows: number[];
1061
+ /** Column count */
1062
+ columnCount: number;
1063
+ /** Row count */
1064
+ rowCount: number;
1065
+ }
1066
+ /** Differences in grid structure */
1067
+ interface GridDiff {
1068
+ /** Source grid */
1069
+ sourceGrid: GridStructure;
1070
+ /** Target grid */
1071
+ targetGrid: GridStructure;
1072
+ /** Column count difference */
1073
+ columnDiff: number;
1074
+ /** Row count difference */
1075
+ rowDiff: number;
1076
+ }
1077
+ /** Differences in element hierarchy depth */
1078
+ interface HierarchyDiff {
1079
+ /** Source max nesting depth */
1080
+ sourceDepth: number;
1081
+ /** Target max nesting depth */
1082
+ targetDepth: number;
1083
+ /** Difference */
1084
+ depthDiff: number;
1085
+ }
1086
+ /** Information density comparison */
1087
+ interface DensityComparison {
1088
+ /** Source elements per region */
1089
+ sourceDensity: number;
1090
+ /** Target elements per region */
1091
+ targetDensity: number;
1092
+ /** Ratio (source/target) */
1093
+ ratio: number;
1094
+ }
1095
+ /** Full layout comparison result */
1096
+ interface LayoutComparison {
1097
+ /** Grid structure differences */
1098
+ gridDiff: GridDiff;
1099
+ /** Hierarchy differences */
1100
+ hierarchyDiff: HierarchyDiff;
1101
+ /** Density comparison */
1102
+ density: DensityComparison;
1103
+ /** Overall layout similarity (0-1) */
1104
+ similarity: number;
1105
+ }
1106
+ /** A matched heading pair */
1107
+ interface HeadingMatch {
1108
+ /** Source heading text */
1109
+ source: string;
1110
+ /** Target heading text */
1111
+ target: string;
1112
+ /** Heading level (1-6) */
1113
+ level?: number;
1114
+ }
1115
+ /** A changed heading pair */
1116
+ interface HeadingChange {
1117
+ /** Source heading text */
1118
+ source: string;
1119
+ /** Target heading text */
1120
+ target: string;
1121
+ /** Heading level (1-6) */
1122
+ level?: number;
1123
+ }
1124
+ /** A matched metric pair */
1125
+ interface MetricMatch {
1126
+ /** Metric label */
1127
+ label: string;
1128
+ /** Source value */
1129
+ sourceValue: string;
1130
+ /** Target value */
1131
+ targetValue: string;
1132
+ }
1133
+ /** A changed metric pair (cross-app comparison) */
1134
+ interface CrossAppMetricChange {
1135
+ /** Metric label */
1136
+ label: string;
1137
+ /** Source value */
1138
+ sourceValue: string;
1139
+ /** Target value */
1140
+ targetValue: string;
1141
+ }
1142
+ /** A matched status pair */
1143
+ interface StatusMatch {
1144
+ /** Status label */
1145
+ label: string;
1146
+ /** Source status text */
1147
+ sourceStatus: string;
1148
+ /** Target status text */
1149
+ targetStatus: string;
1150
+ }
1151
+ /** A changed status pair (cross-app comparison) */
1152
+ interface CrossAppStatusChange {
1153
+ /** Status label */
1154
+ label: string;
1155
+ /** Source status text */
1156
+ sourceStatus: string;
1157
+ /** Target status text */
1158
+ targetStatus: string;
1159
+ }
1160
+ /** Heading comparison for a specific level */
1161
+ interface HeadingLevelComparison {
1162
+ /** Heading level (1-6) */
1163
+ level: number;
1164
+ /** Source heading count */
1165
+ sourceCount: number;
1166
+ /** Target heading count */
1167
+ targetCount: number;
1168
+ }
1169
+ /** Table structure comparison */
1170
+ interface TableComparison {
1171
+ /** Table label (source) */
1172
+ sourceLabel: string;
1173
+ /** Table label (target) */
1174
+ targetLabel: string;
1175
+ /** Whether column headers match */
1176
+ columnsMatch: boolean;
1177
+ /** Column headers only in source */
1178
+ sourceOnlyColumns: string[];
1179
+ /** Column headers only in target */
1180
+ targetOnlyColumns: string[];
1181
+ /** Number of rows in source */
1182
+ sourceRowCount: number;
1183
+ /** Number of rows in target */
1184
+ targetRowCount: number;
1185
+ /** Cell value differences (row, column, source value, target value) */
1186
+ cellDifferences: Array<{
1187
+ row: number;
1188
+ column: string;
1189
+ sourceValue: string;
1190
+ targetValue: string;
1191
+ }>;
1192
+ }
1193
+ /** Full content comparison result */
1194
+ interface ContentComparison {
1195
+ /** Heading comparison */
1196
+ headings: {
1197
+ matched: HeadingMatch[];
1198
+ sourceOnly: string[];
1199
+ targetOnly: string[];
1200
+ changed: HeadingChange[];
1201
+ };
1202
+ /** Metric comparison */
1203
+ metrics: {
1204
+ matched: MetricMatch[];
1205
+ changed: CrossAppMetricChange[];
1206
+ sourceOnly: string[];
1207
+ targetOnly: string[];
1208
+ };
1209
+ /** Status comparison */
1210
+ statuses: {
1211
+ matched: StatusMatch[];
1212
+ changed: CrossAppStatusChange[];
1213
+ };
1214
+ /** Labels / text comparison */
1215
+ labels: {
1216
+ matched: string[];
1217
+ sourceOnly: string[];
1218
+ targetOnly: string[];
1219
+ };
1220
+ /** Table structure comparison */
1221
+ tables: TableComparison[];
1222
+ /** Heading hierarchy comparison */
1223
+ headingHierarchy: HeadingLevelComparison[];
1224
+ /** Content parity score (0-1) */
1225
+ contentParity: number;
1226
+ }
1227
+ /** A single issue found during comparison */
1228
+ interface ComparisonIssue {
1229
+ /** Issue severity */
1230
+ severity: 'info' | 'warning' | 'error';
1231
+ /** Issue category */
1232
+ category: 'missing-data' | 'format-mismatch' | 'value-mismatch' | 'missing-action' | 'navigation-gap' | 'layout-difference' | 'component-mismatch' | 'content-difference';
1233
+ /** Human-readable description */
1234
+ description: string;
1235
+ /** Source element ID (if applicable) */
1236
+ sourceElementId?: string;
1237
+ /** Target element ID (if applicable) */
1238
+ targetElementId?: string;
1239
+ }
1240
+ /** Full cross-app comparison report */
1241
+ interface CrossAppComparisonReport {
1242
+ /** Source page URL */
1243
+ sourceUrl: string;
1244
+ /** Target page URL */
1245
+ targetUrl: string;
1246
+ /** Timestamp */
1247
+ timestamp: number;
1248
+ /** Duration of comparison in ms */
1249
+ durationMs: number;
1250
+ /** Scores (0-1) */
1251
+ scores: {
1252
+ dataCompleteness: number;
1253
+ formatAlignment: number;
1254
+ presentationAlignment: number;
1255
+ navigationParity: number;
1256
+ actionParity: number;
1257
+ overallScore: number;
1258
+ };
1259
+ /** Cross-app diff */
1260
+ diff: CrossAppDiff;
1261
+ /** Navigation map */
1262
+ navigation: NavigationMap;
1263
+ /** Layout comparison */
1264
+ layout: LayoutComparison;
1265
+ /** Component comparison (included when components are provided) */
1266
+ components?: ComponentComparison;
1267
+ /** Content comparison (headings, metrics, statuses, labels, tables) */
1268
+ contentComparison?: ContentComparison;
1269
+ /** All issues sorted by severity */
1270
+ issues: ComparisonIssue[];
1271
+ /** LLM-readable summary */
1272
+ summary: string;
1273
+ }
1274
+
1275
+ export type { PageContext as $, AIDiscoveredElement as A, BatchAssertionRequest as B, ComparisonIssue as C, DataType as D, ElementChange as E, FormAnalysis as F, GridDiff as G, HeadingChange as H, HeadingLevelComparison as I, HeadingMatch as J, HierarchyDiff as K, Intent as L, IntentExecutionResult as M, IntentParam as N, IntentSearchResponse as O, InteractionParity as P, LayoutComparison as Q, ListItemField as R, ListSchema as S, MatchedElementPair as T, MetricChange as U, MetricMatch as V, ModalState as W, NLActionRequest as X, NLActionResponse as Y, NavigationMap as Z, NavigationPair as _, AIElementRegistrationOptions as a, PageDataMap as a0, PageRegion as a1, PageRegionMap as a2, ParsedAction as a3, RecoveryAttemptRequest as a4, RecoveryAttemptResult as a5, RecoverySuggestion as a6, RegionType as a7, SearchCriteria as a8, SearchResponse as a9, SearchResult as aa, SemanticDiff as ab, SemanticSearchCriteria as ac, SemanticSearchResponse as ad, SemanticSearchResult as ae, SemanticSnapshot as af, StatusChange as ag, StatusMatch as ah, StructuredDataExtraction as ai, TableColumn as aj, TableComparison as ak, TableSchema as al, TextChange as am, AIErrorContext as b, AIFindResponse as c, AssertionRequest as d, AssertionResult as e, AssertionType as f, BatchAssertionResult as g, ComponentComparison as h, ComponentInfo as i, ComponentMatch as j, ContentChanges as k, ContentComparison as l, CrossAppComparisonReport as m, CrossAppDiff as n, CrossAppMetricChange as o, CrossAppStatusChange as p, DataValueComparison as q, DensityComparison as r, ElementModification as s, ExtractedDataValue as t, FormFieldAnalysis as u, FormFieldState as v, FormState as w, FormatDescriptor as x, FormatMismatch as y, GridStructure as z };