@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
@@ -1,7 +1,8 @@
1
- import { S as SearchCriteria, n as SearchResponse, o as SearchResult, A as AIDiscoveredElement, P as PageContext, t as SemanticSnapshot, m as ParsedAction, N as NLActionRequest, l as NLActionResponse, b as AIErrorContext, d as AssertionRequest, e as AssertionResult, B as BatchAssertionRequest, g as BatchAssertionResult, p as SemanticDiff, R as RecoverySuggestion } from '../types-DfPqwU-i.js';
2
- export { a as AIElementRegistrationOptions, c as AIFindResponse, f as AssertionType, E as ElementChange, h as ElementModification, F as FormAnalysis, i as FormFieldAnalysis, j as FormFieldState, k as FormState, M as ModalState, q as SemanticSearchCriteria, r as SemanticSearchResponse, s as SemanticSearchResult } from '../types-DfPqwU-i.js';
3
- import { x as RegisteredElement, q as ElementState } from '../types-jKVgTI6_.js';
4
- import { D as DiscoveredElement, A as ActionExecutor, d as ControlSnapshot } from '../types-BkNRILUa.js';
1
+ import { a8 as SearchCriteria, a9 as SearchResponse, aa as SearchResult, A as AIDiscoveredElement, $ as PageContext, af as SemanticSnapshot, a3 as ParsedAction, X as NLActionRequest, Y as NLActionResponse, b as AIErrorContext, ab as SemanticDiff, a6 as RecoverySuggestion, D as DataType, a0 as PageDataMap, a7 as RegionType, a2 as PageRegionMap, S as ListSchema, al as TableSchema, ai as StructuredDataExtraction, x as FormatDescriptor, y as FormatMismatch, n as CrossAppDiff, T as MatchedElementPair, P as InteractionParity, Z as NavigationMap, i as ComponentInfo, h as ComponentComparison, Q as LayoutComparison, z as GridStructure, l as ContentComparison, m as CrossAppComparisonReport } from '../types-CebMQj76.js';
2
+ export { a as AIElementRegistrationOptions, c as AIFindResponse, d as AssertionRequest, e as AssertionResult, f as AssertionType, B as BatchAssertionRequest, g as BatchAssertionResult, C as ComparisonIssue, j as ComponentMatch, k as ContentChanges, o as CrossAppMetricChange, p as CrossAppStatusChange, q as DataValueComparison, r as DensityComparison, E as ElementChange, s as ElementModification, t as ExtractedDataValue, F as FormAnalysis, u as FormFieldAnalysis, v as FormFieldState, w as FormState, G as GridDiff, H as HeadingChange, I as HeadingLevelComparison, J as HeadingMatch, K as HierarchyDiff, L as Intent, M as IntentExecutionResult, N as IntentParam, O as IntentSearchResponse, R as ListItemField, U as MetricChange, V as MetricMatch, W as ModalState, _ as NavigationPair, a1 as PageRegion, a4 as RecoveryAttemptRequest, a5 as RecoveryAttemptResult, ac as SemanticSearchCriteria, ad as SemanticSearchResponse, ae as SemanticSearchResult, ag as StatusChange, ah as StatusMatch, aj as TableColumn, ak as TableComparison, am as TextChange } from '../types-CebMQj76.js';
3
+ import { X as RegisteredElement, z as ElementState } from '../types-suaYwWWg.js';
4
+ import { D as DiscoveredElement, A as ActionExecutor, d as ControlSnapshot } from '../types-C7gVYRnF.js';
5
+ export { A as AssertionConfig, a as AssertionExecutor, D as DEFAULT_ASSERTION_CONFIG, c as createAssertionExecutor } from '../assertions-BSR3afVr.js';
5
6
 
6
7
  /**
7
8
  * Fuzzy Matcher
@@ -496,156 +497,6 @@ declare class NLActionExecutor {
496
497
  */
497
498
  declare function createNLActionExecutor(config?: Partial<NLActionExecutorConfig>): NLActionExecutor;
498
499
 
499
- /**
500
- * Assertions Module
501
- *
502
- * Provides verification/assertion API for AI agents to validate
503
- * page state without writing Playwright tests.
504
- */
505
-
506
- /**
507
- * Configuration for assertions
508
- */
509
- interface AssertionConfig {
510
- /** Default timeout for wait-based assertions */
511
- defaultTimeout: number;
512
- /** Polling interval for wait-based assertions */
513
- pollInterval: number;
514
- /** Default fuzzy threshold for element search */
515
- fuzzyThreshold: number;
516
- /** Include suggestions in failure messages */
517
- includeSuggestions: boolean;
518
- }
519
- /**
520
- * Default assertion configuration
521
- */
522
- declare const DEFAULT_ASSERTION_CONFIG: AssertionConfig;
523
- /**
524
- * Assertion executor class
525
- */
526
- declare class AssertionExecutor {
527
- private config;
528
- private searchEngine;
529
- private elements;
530
- constructor(config?: Partial<AssertionConfig>);
531
- /**
532
- * Update available elements for assertions
533
- */
534
- updateElements(elements: Array<DiscoveredElement | AIDiscoveredElement>): void;
535
- /**
536
- * Execute a single assertion
537
- */
538
- assert(request: AssertionRequest): Promise<AssertionResult>;
539
- /**
540
- * Execute multiple assertions
541
- */
542
- assertBatch(request: BatchAssertionRequest): Promise<BatchAssertionResult>;
543
- /**
544
- * Convenience method: assert element is visible
545
- */
546
- assertVisible(target: string | SearchCriteria, timeout?: number): Promise<AssertionResult>;
547
- /**
548
- * Convenience method: assert element is hidden
549
- */
550
- assertHidden(target: string | SearchCriteria, timeout?: number): Promise<AssertionResult>;
551
- /**
552
- * Convenience method: assert element is enabled
553
- */
554
- assertEnabled(target: string | SearchCriteria, timeout?: number): Promise<AssertionResult>;
555
- /**
556
- * Convenience method: assert element is disabled
557
- */
558
- assertDisabled(target: string | SearchCriteria, timeout?: number): Promise<AssertionResult>;
559
- /**
560
- * Convenience method: assert element has text
561
- */
562
- assertHasText(target: string | SearchCriteria, text: string, timeout?: number): Promise<AssertionResult>;
563
- /**
564
- * Convenience method: assert element contains text
565
- */
566
- assertContainsText(target: string | SearchCriteria, text: string, timeout?: number): Promise<AssertionResult>;
567
- /**
568
- * Convenience method: assert element has value
569
- */
570
- assertHasValue(target: string | SearchCriteria, value: string, timeout?: number): Promise<AssertionResult>;
571
- /**
572
- * Convenience method: assert element exists
573
- */
574
- assertExists(target: string | SearchCriteria, timeout?: number): Promise<AssertionResult>;
575
- /**
576
- * Convenience method: assert element does not exist
577
- */
578
- assertNotExists(target: string | SearchCriteria, timeout?: number): Promise<AssertionResult>;
579
- /**
580
- * Convenience method: assert checkbox is checked
581
- */
582
- assertChecked(target: string | SearchCriteria, timeout?: number): Promise<AssertionResult>;
583
- /**
584
- * Convenience method: assert checkbox is unchecked
585
- */
586
- assertUnchecked(target: string | SearchCriteria, timeout?: number): Promise<AssertionResult>;
587
- /**
588
- * Convenience method: assert element count
589
- */
590
- assertCount(target: SearchCriteria, expectedCount: number, timeout?: number): Promise<AssertionResult>;
591
- /**
592
- * Find element by target (string or criteria)
593
- */
594
- private findElement;
595
- /**
596
- * Execute the actual assertion
597
- */
598
- private executeAssertion;
599
- /**
600
- * Assert visibility state
601
- */
602
- private assertVisibility;
603
- /**
604
- * Assert enabled state
605
- */
606
- private assertEnabledState;
607
- /**
608
- * Assert focused state
609
- */
610
- private assertFocused;
611
- /**
612
- * Assert checked state
613
- */
614
- private assertCheckedState;
615
- /**
616
- * Assert text content
617
- */
618
- private assertTextMatch;
619
- /**
620
- * Assert input value
621
- */
622
- private assertValue;
623
- /**
624
- * Assert element count
625
- */
626
- private assertElementCount;
627
- /**
628
- * Assert attribute value (placeholder for DOM attribute assertions)
629
- */
630
- private assertAttribute;
631
- /**
632
- * Assert element has CSS class
633
- */
634
- private assertHasClass;
635
- /**
636
- * Assert CSS property value
637
- */
638
- private assertCssProperty;
639
- /**
640
- * Create an assertion result
641
- */
642
- private createResult;
643
- }
644
- /**
645
- * Create a default assertion executor
646
- */
647
- declare function createAssertionExecutor(config?: Partial<AssertionConfig>): AssertionExecutor;
648
-
649
500
  /**
650
501
  * Semantic Snapshot
651
502
  *
@@ -667,6 +518,8 @@ interface SemanticSnapshotConfig {
667
518
  generateDescriptions: boolean;
668
519
  /** Maximum elements to include */
669
520
  maxElements: number;
521
+ /** Merge annotations from the annotation store (default: true) */
522
+ useAnnotations: boolean;
670
523
  }
671
524
  /**
672
525
  * Default snapshot configuration
@@ -710,6 +563,10 @@ declare class SemanticSnapshotManager {
710
563
  * Convert a single element to AI element
711
564
  */
712
565
  private convertElement;
566
+ /**
567
+ * Generate a content-specific description
568
+ */
569
+ private generateContentDescription;
713
570
  /**
714
571
  * Build full page context
715
572
  */
@@ -832,6 +689,21 @@ declare function hasSignificantChanges(diff: SemanticDiff): boolean;
832
689
  * Utility: Get a brief description of what changed
833
690
  */
834
691
  declare function describeDiff(diff: SemanticDiff): string;
692
+ /**
693
+ * Parse a numeric value from a string, handling common formats:
694
+ * - Plain numbers: "42", "1,234", "1234.56"
695
+ * - Percentages: "95%", "12.5%"
696
+ * - Currency: "$1,234", "$1,234.56", "-$50"
697
+ * - Duration: "2h 30m", "1.5s", "100ms"
698
+ * - Negative values: "-42", "($500)"
699
+ *
700
+ * Returns the numeric value or null if not parseable.
701
+ */
702
+ declare function parseNumericValue(text: string): number | null;
703
+ /**
704
+ * Classify whether a status change is an improvement, degradation, or neutral
705
+ */
706
+ declare function classifyStatusDirection(oldStatus: string, newStatus: string): 'improved' | 'degraded' | 'neutral';
835
707
 
836
708
  /**
837
709
  * Error Context
@@ -890,4 +762,289 @@ declare function isRecoverableError(code: ErrorCode): boolean;
890
762
  */
891
763
  declare function getBestRecoverySuggestion(context: AIErrorContext): RecoverySuggestion | null;
892
764
 
893
- export { AIDiscoveredElement, AIErrorContext, type AliasGeneratorConfig, type AliasGeneratorInput, type AssertionConfig, AssertionExecutor, AssertionRequest, AssertionResult, BatchAssertionRequest, BatchAssertionResult, DEFAULT_ALIAS_CONFIG, DEFAULT_ASSERTION_CONFIG, DEFAULT_DIFF_CONFIG, DEFAULT_EXECUTOR_CONFIG, DEFAULT_FUZZY_CONFIG, DEFAULT_SEARCH_CONFIG, DEFAULT_SNAPSHOT_CONFIG, type ErrorCode, ErrorCodes, type FuzzyMatchConfig, type FuzzyMatchResult, NLActionExecutor, type NLActionExecutorConfig, NLActionRequest, NLActionResponse, PageContext, ParsedAction, RecoverySuggestion, SearchCriteria, SearchEngine, type SearchEngineConfig, SearchResponse, SearchResult, SemanticDiff, type SemanticDiffConfig, SemanticDiffManager, SemanticSnapshot, type SemanticSnapshotConfig, SemanticSnapshotManager, type SummaryConfig, areSynonyms, computeDiff, createAssertionExecutor, createDiffManager, createErrorContext, createNLActionExecutor, createSearchEngine, createSimpleError, createSnapshotManager, describeAction, describeDiff, extractModifiers, findAllMatches, findBestMatch, formatErrorContext, fuzzyContains, fuzzyMatch, generateAliases, generateDescription, generateDiffSummary, generateElementDescription, generateNgrams, generatePageSummary, generatePurpose, generateSnapshotSummary, generateSuggestedActions, getBestRecoverySuggestion, getSynonyms, hasSignificantChanges, inferPageType, isRecoverableError, jaroSimilarity, jaroWinklerSimilarity, levenshteinDistance, levenshteinSimilarity, ngramSimilarity, normalizeString, parseNLInstruction, parseNLInstructions, splitCompoundInstruction, tokenSimilarity, tokenize, validateParsedAction, wordSimilarity };
765
+ /**
766
+ * Data Extraction
767
+ *
768
+ * Extracts labeled data values from page elements, classifies their types,
769
+ * and normalizes values for cross-app comparison.
770
+ */
771
+
772
+ interface DataExtractionConfig {
773
+ /** Minimum confidence to include a value */
774
+ minConfidence: number;
775
+ /** Whether to normalize whitespace */
776
+ normalizeWhitespace: boolean;
777
+ }
778
+ declare const DEFAULT_DATA_EXTRACTION_CONFIG: DataExtractionConfig;
779
+ /**
780
+ * Classify the data type of a raw string value.
781
+ */
782
+ declare function classifyDataType(value: string): {
783
+ type: DataType;
784
+ confidence: number;
785
+ };
786
+ /**
787
+ * Normalize a value for comparison by stripping formatting differences.
788
+ */
789
+ declare function normalizeValue(value: string, dataType: DataType): string;
790
+ /**
791
+ * Extract labeled data values from all page elements.
792
+ */
793
+ declare function extractPageData(elements: AIDiscoveredElement[], config?: DataExtractionConfig): PageDataMap;
794
+
795
+ /**
796
+ * Region Segmentation
797
+ *
798
+ * Segments a page into semantic regions (header, nav, sidebar, main, footer, etc.)
799
+ * based on element positions, roles, and spatial clustering.
800
+ */
801
+
802
+ interface RegionSegmentationConfig {
803
+ /** Minimum elements for a region to be valid */
804
+ minRegionElements: number;
805
+ /** Top portion of viewport considered "header" (fraction 0-1) */
806
+ headerFraction: number;
807
+ /** Bottom portion considered "footer" (fraction 0-1) */
808
+ footerFraction: number;
809
+ /** Left portion considered "sidebar" (fraction 0-1) */
810
+ sidebarFraction: number;
811
+ }
812
+ declare const DEFAULT_REGION_SEGMENTATION_CONFIG: RegionSegmentationConfig;
813
+ /**
814
+ * Classify the region type of an element based on its role, position, and context.
815
+ */
816
+ declare function classifyRegionType(el: AIDiscoveredElement, relativeY: number, relativeX: number, config?: RegionSegmentationConfig): {
817
+ type: RegionType;
818
+ confidence: number;
819
+ };
820
+ /**
821
+ * Segment all page elements into semantic regions.
822
+ */
823
+ declare function segmentPageRegions(elements: AIDiscoveredElement[], config?: RegionSegmentationConfig): PageRegionMap;
824
+
825
+ /**
826
+ * Table & List Extraction
827
+ *
828
+ * Detects and extracts structured data (tables and lists) from page elements
829
+ * based on spatial layout and semantic roles.
830
+ */
831
+
832
+ interface TableExtractionConfig {
833
+ /** Minimum columns to consider a group a table */
834
+ minTableColumns: number;
835
+ /** Minimum rows to consider a group a table */
836
+ minTableRows: number;
837
+ /** Minimum items to consider a group a list */
838
+ minListItems: number;
839
+ /** Position tolerance for column alignment (px) */
840
+ columnTolerance: number;
841
+ /** Position tolerance for row alignment (px) */
842
+ rowTolerance: number;
843
+ }
844
+ declare const DEFAULT_TABLE_EXTRACTION_CONFIG: TableExtractionConfig;
845
+ /**
846
+ * Detect a table structure from elements with grid-like spatial arrangement.
847
+ */
848
+ declare function detectTable(elements: AIDiscoveredElement[], config?: TableExtractionConfig): TableSchema | null;
849
+ /**
850
+ * Detect a list structure from repeating element patterns.
851
+ */
852
+ declare function detectList(elements: AIDiscoveredElement[], config?: TableExtractionConfig): ListSchema | null;
853
+ /**
854
+ * Extract all structured data (tables and lists) from page elements.
855
+ */
856
+ declare function extractStructuredData(elements: AIDiscoveredElement[], config?: TableExtractionConfig): StructuredDataExtraction;
857
+
858
+ /**
859
+ * Format Analysis
860
+ *
861
+ * Analyzes the display format of data values and detects
862
+ * format mismatches between source and target pages.
863
+ */
864
+
865
+ interface FormatAnalysisConfig {
866
+ /** Treat minor format differences (e.g., comma vs period for thousands) as warnings rather than errors */
867
+ lenientFormatting: boolean;
868
+ }
869
+ declare const DEFAULT_FORMAT_ANALYSIS_CONFIG: FormatAnalysisConfig;
870
+ /**
871
+ * Detect the format pattern of a value.
872
+ */
873
+ declare function detectFormatPattern(value: string, dataType: DataType): string;
874
+ /**
875
+ * Analyze format of a single element's value.
876
+ */
877
+ declare function analyzeFormat(elementId: string, label: string, rawValue: string): FormatDescriptor;
878
+ /**
879
+ * Analyze formats for all data-bearing elements on a page.
880
+ */
881
+ declare function analyzePageFormats(elements: AIDiscoveredElement[]): FormatDescriptor[];
882
+ /**
883
+ * Compare formats between source and target descriptors with matching labels.
884
+ */
885
+ declare function compareFormats(sourceFormats: FormatDescriptor[], targetFormats: FormatDescriptor[], config?: FormatAnalysisConfig): FormatMismatch[];
886
+
887
+ /**
888
+ * Cross-App Diff
889
+ *
890
+ * Matches elements between source and target pages and computes
891
+ * a structured diff of data values, formats, and unmatched elements.
892
+ */
893
+
894
+ interface CrossAppDiffConfig {
895
+ /** Minimum confidence to consider a match */
896
+ matchThreshold: number;
897
+ /** Weight for accessible name matching */
898
+ accessibleNameWeight: number;
899
+ /** Weight for text matching */
900
+ textWeight: number;
901
+ /** Weight for role + position matching */
902
+ rolePositionWeight: number;
903
+ }
904
+ declare const DEFAULT_CROSS_APP_DIFF_CONFIG: CrossAppDiffConfig;
905
+ /**
906
+ * Match elements between source and target using greedy assignment.
907
+ * Elements are matched by descending confidence.
908
+ */
909
+ declare function matchElements(sourceElements: AIDiscoveredElement[], targetElements: AIDiscoveredElement[], config?: CrossAppDiffConfig): MatchedElementPair[];
910
+ /**
911
+ * Compute a full cross-app diff between source and target element sets.
912
+ */
913
+ declare function computeCrossAppDiff(sourceElements: AIDiscoveredElement[], targetElements: AIDiscoveredElement[], config?: CrossAppDiffConfig): CrossAppDiff;
914
+
915
+ /**
916
+ * Action Parity
917
+ *
918
+ * Compares the interactive capabilities (available actions) of matched
919
+ * element pairs to detect missing functionality between source and target.
920
+ */
921
+
922
+ interface ActionParityConfig {
923
+ /** Actions to ignore in comparison (e.g., framework-internal actions) */
924
+ ignoreActions: string[];
925
+ }
926
+ declare const DEFAULT_ACTION_PARITY_CONFIG: ActionParityConfig;
927
+ /**
928
+ * Analyze action parity for all matched element pairs.
929
+ */
930
+ declare function analyzeActionParity(matchedPairs: MatchedElementPair[], sourceElements: AIDiscoveredElement[], targetElements: AIDiscoveredElement[], config?: ActionParityConfig): InteractionParity[];
931
+
932
+ /**
933
+ * Navigation Map
934
+ *
935
+ * Identifies navigation elements in both source and target pages
936
+ * and maps them to each other for parity analysis.
937
+ */
938
+
939
+ interface NavigationMapConfig {
940
+ /** Minimum similarity for label matching */
941
+ labelMatchThreshold: number;
942
+ }
943
+ declare const DEFAULT_NAVIGATION_MAP_CONFIG: NavigationMapConfig;
944
+ /**
945
+ * Determine whether an element is a navigation link/item.
946
+ */
947
+ declare function isNavigationElement(el: AIDiscoveredElement): boolean;
948
+ /**
949
+ * Build a navigation map comparing source and target pages.
950
+ */
951
+ declare function buildNavigationMap(sourceElements: AIDiscoveredElement[], targetElements: AIDiscoveredElement[], config?: NavigationMapConfig): NavigationMap;
952
+
953
+ /**
954
+ * Component Comparison
955
+ *
956
+ * Compares registered components between source and target apps,
957
+ * matching by name/type and diffing state keys and actions.
958
+ */
959
+
960
+ interface ComponentComparisonConfig {
961
+ /** Minimum similarity for name matching */
962
+ nameMatchThreshold: number;
963
+ }
964
+ declare const DEFAULT_COMPONENT_COMPARISON_CONFIG: ComponentComparisonConfig;
965
+ /**
966
+ * Compare components between source and target apps.
967
+ *
968
+ * Note: ComponentInfo is not part of SemanticSnapshot. The caller must
969
+ * fetch component lists separately from /control/components endpoint.
970
+ */
971
+ declare function compareComponents(sourceComponents: ComponentInfo[], targetComponents: ComponentInfo[], config?: ComponentComparisonConfig): ComponentComparison;
972
+
973
+ /**
974
+ * Layout Comparison
975
+ *
976
+ * Compares the spatial layout between two pages: grid structure,
977
+ * hierarchy depth, and information density.
978
+ */
979
+
980
+ interface LayoutComparisonConfig {
981
+ /** Tolerance for column/row alignment detection (px) */
982
+ gridTolerance: number;
983
+ }
984
+ declare const DEFAULT_LAYOUT_COMPARISON_CONFIG: LayoutComparisonConfig;
985
+ /**
986
+ * Detect the implicit grid structure from element positions.
987
+ */
988
+ declare function detectGridStructure(elements: AIDiscoveredElement[], config?: LayoutComparisonConfig): GridStructure;
989
+ /**
990
+ * Compute a prominence score for an element (0-1) based on size and position.
991
+ * Larger elements nearer the top are more prominent.
992
+ */
993
+ declare function computeProminence(element: AIDiscoveredElement, pageWidth: number, pageHeight: number): number;
994
+ /**
995
+ * Compare layouts between source and target element sets.
996
+ */
997
+ declare function compareLayouts(sourceElements: AIDiscoveredElement[], targetElements: AIDiscoveredElement[], sourceRegions?: PageRegionMap, targetRegions?: PageRegionMap, config?: LayoutComparisonConfig): LayoutComparison;
998
+
999
+ /**
1000
+ * Content Comparison
1001
+ *
1002
+ * Compares content elements (headings, metrics, labels, statuses, table data)
1003
+ * between source and target semantic snapshots. Produces a structured
1004
+ * ContentComparison result alongside the existing interactive element comparison.
1005
+ */
1006
+
1007
+ interface ContentComparisonConfig {
1008
+ /** Minimum fuzzy similarity to consider two labels as matching */
1009
+ labelMatchThreshold: number;
1010
+ /** Minimum fuzzy similarity to consider two headings as matching */
1011
+ headingMatchThreshold: number;
1012
+ /** Maximum cell differences to report per table */
1013
+ maxCellDifferences: number;
1014
+ }
1015
+ declare const DEFAULT_CONTENT_COMPARISON_CONFIG: ContentComparisonConfig;
1016
+ /**
1017
+ * Compare content elements between source and target.
1018
+ *
1019
+ * Analyzes headings, metrics, statuses, labels, and table data,
1020
+ * producing a structured ContentComparison result.
1021
+ */
1022
+ declare function compareContent(sourceElements: AIDiscoveredElement[], targetElements: AIDiscoveredElement[], config?: ContentComparisonConfig): ContentComparison;
1023
+
1024
+ /**
1025
+ * Comparison Report
1026
+ *
1027
+ * Orchestrates all cross-app analysis modules to produce a unified
1028
+ * comparison report with scores, issues, and a summary.
1029
+ */
1030
+
1031
+ interface ComparisonReportConfig {
1032
+ /** Include component comparison (requires separate ComponentInfo arrays) */
1033
+ includeComponents: boolean;
1034
+ }
1035
+ declare const DEFAULT_COMPARISON_REPORT_CONFIG: ComparisonReportConfig;
1036
+ /**
1037
+ * Generate a comprehensive cross-app comparison report.
1038
+ *
1039
+ * @param source - Source page semantic snapshot
1040
+ * @param target - Target page semantic snapshot
1041
+ * @param options - Optional configuration and component data
1042
+ * @returns Full comparison report with scores, issues, and summary
1043
+ */
1044
+ declare function generateComparisonReport(source: SemanticSnapshot, target: SemanticSnapshot, options?: {
1045
+ config?: ComparisonReportConfig;
1046
+ sourceComponents?: ComponentInfo[];
1047
+ targetComponents?: ComponentInfo[];
1048
+ }): CrossAppComparisonReport;
1049
+
1050
+ export { AIDiscoveredElement, AIErrorContext, type ActionParityConfig, type AliasGeneratorConfig, type AliasGeneratorInput, type ComparisonReportConfig, ComponentComparison, type ComponentComparisonConfig, ComponentInfo, ContentComparison, type ContentComparisonConfig, CrossAppComparisonReport, CrossAppDiff, type CrossAppDiffConfig, DEFAULT_ACTION_PARITY_CONFIG, DEFAULT_ALIAS_CONFIG, DEFAULT_COMPARISON_REPORT_CONFIG, DEFAULT_COMPONENT_COMPARISON_CONFIG, DEFAULT_CONTENT_COMPARISON_CONFIG, DEFAULT_CROSS_APP_DIFF_CONFIG, DEFAULT_DATA_EXTRACTION_CONFIG, DEFAULT_DIFF_CONFIG, DEFAULT_EXECUTOR_CONFIG, DEFAULT_FORMAT_ANALYSIS_CONFIG, DEFAULT_FUZZY_CONFIG, DEFAULT_LAYOUT_COMPARISON_CONFIG, DEFAULT_NAVIGATION_MAP_CONFIG, DEFAULT_REGION_SEGMENTATION_CONFIG, DEFAULT_SEARCH_CONFIG, DEFAULT_SNAPSHOT_CONFIG, DEFAULT_TABLE_EXTRACTION_CONFIG, type DataExtractionConfig, DataType, type ErrorCode, ErrorCodes, type FormatAnalysisConfig, FormatDescriptor, FormatMismatch, type FuzzyMatchConfig, type FuzzyMatchResult, GridStructure, InteractionParity, LayoutComparison, type LayoutComparisonConfig, ListSchema, MatchedElementPair, NLActionExecutor, type NLActionExecutorConfig, NLActionRequest, NLActionResponse, NavigationMap, type NavigationMapConfig, PageContext, PageDataMap, PageRegionMap, ParsedAction, RecoverySuggestion, type RegionSegmentationConfig, RegionType, SearchCriteria, SearchEngine, type SearchEngineConfig, SearchResponse, SearchResult, SemanticDiff, type SemanticDiffConfig, SemanticDiffManager, SemanticSnapshot, type SemanticSnapshotConfig, SemanticSnapshotManager, StructuredDataExtraction, type SummaryConfig, type TableExtractionConfig, TableSchema, analyzeActionParity, analyzeFormat, analyzePageFormats, areSynonyms, buildNavigationMap, classifyDataType, classifyRegionType, classifyStatusDirection, compareComponents, compareContent, compareFormats, compareLayouts, computeCrossAppDiff, computeDiff, computeProminence, createDiffManager, createErrorContext, createNLActionExecutor, createSearchEngine, createSimpleError, createSnapshotManager, describeAction, describeDiff, detectFormatPattern, detectGridStructure, detectList, detectTable, extractModifiers, extractPageData, extractStructuredData, findAllMatches, findBestMatch, formatErrorContext, fuzzyContains, fuzzyMatch, generateAliases, generateComparisonReport, generateDescription, generateDiffSummary, generateElementDescription, generateNgrams, generatePageSummary, generatePurpose, generateSnapshotSummary, generateSuggestedActions, getBestRecoverySuggestion, getSynonyms, hasSignificantChanges, inferPageType, isNavigationElement, isRecoverableError, jaroSimilarity, jaroWinklerSimilarity, levenshteinDistance, levenshteinSimilarity, matchElements, ngramSimilarity, normalizeString, normalizeValue, parseNLInstruction, parseNLInstructions, parseNumericValue, segmentPageRegions, splitCompoundInstruction, tokenSimilarity, tokenize, validateParsedAction, wordSimilarity };