@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.
- package/dist/ai/index.d.mts +312 -155
- package/dist/ai/index.d.ts +312 -155
- package/dist/ai/index.js +2363 -67
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/index.mjs +2328 -68
- package/dist/ai/index.mjs.map +1 -1
- package/dist/annotations/index.d.mts +218 -0
- package/dist/annotations/index.d.ts +218 -0
- package/dist/annotations/index.js +246 -0
- package/dist/annotations/index.js.map +1 -0
- package/dist/annotations/index.mjs +241 -0
- package/dist/annotations/index.mjs.map +1 -0
- package/dist/assertions-BSR3afVr.d.ts +161 -0
- package/dist/assertions-CTw1hfOx.d.mts +161 -0
- package/dist/babel-plugin/index.js +504 -0
- package/dist/babel-plugin/index.js.map +1 -0
- package/dist/babel-plugin/index.mjs +488 -0
- package/dist/babel-plugin/index.mjs.map +1 -0
- package/dist/browser-capture-Bms60T6f.d.mts +47 -0
- package/dist/browser-capture-CsTU29mb.d.ts +47 -0
- package/dist/control/index.d.mts +26 -7
- package/dist/control/index.d.ts +26 -7
- package/dist/control/index.js +276 -48
- package/dist/control/index.js.map +1 -1
- package/dist/control/index.mjs +276 -48
- package/dist/control/index.mjs.map +1 -1
- package/dist/core/index.d.mts +115 -44
- package/dist/core/index.d.ts +115 -44
- package/dist/core/index.js +0 -1560
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +1 -1549
- package/dist/core/index.mjs.map +1 -1
- package/dist/debug/index.d.mts +5 -3
- package/dist/debug/index.d.ts +5 -3
- package/dist/debug/index.js +925 -1
- package/dist/debug/index.js.map +1 -1
- package/dist/debug/index.mjs +924 -2
- package/dist/debug/index.mjs.map +1 -1
- package/dist/index.d.mts +13 -9
- package/dist/index.d.ts +13 -9
- package/dist/index.js +8310 -3777
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8246 -3766
- package/dist/index.mjs.map +1 -1
- package/dist/{metrics-NC3csD0R.d.mts → metrics-DuA2qIIz.d.mts} +2 -2
- package/dist/{metrics-C9XRi_mL.d.ts → metrics-KFAAKNEB.d.ts} +2 -2
- package/dist/native/control/index.js +448 -0
- package/dist/native/control/index.js.map +1 -0
- package/dist/native/control/index.mjs +445 -0
- package/dist/native/control/index.mjs.map +1 -0
- package/dist/native/core/index.js +486 -0
- package/dist/native/core/index.js.map +1 -0
- package/dist/native/core/index.mjs +475 -0
- package/dist/native/core/index.mjs.map +1 -0
- package/dist/native/debug/index.js +408 -0
- package/dist/native/debug/index.js.map +1 -0
- package/dist/native/debug/index.mjs +406 -0
- package/dist/native/debug/index.mjs.map +1 -0
- package/dist/native/index.js +2232 -0
- package/dist/native/index.js.map +1 -0
- package/dist/native/index.mjs +2204 -0
- package/dist/native/index.mjs.map +1 -0
- package/dist/native/react/index.js +1377 -0
- package/dist/native/react/index.js.map +1 -0
- package/dist/native/react/index.mjs +1365 -0
- package/dist/native/react/index.mjs.map +1 -0
- package/dist/native/server/index.js +440 -0
- package/dist/native/server/index.js.map +1 -0
- package/dist/native/server/index.mjs +435 -0
- package/dist/native/server/index.mjs.map +1 -0
- package/dist/react/index.d.mts +121 -9
- package/dist/react/index.d.ts +121 -9
- package/dist/react/index.js +2239 -91
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +2239 -92
- package/dist/react/index.mjs.map +1 -1
- package/dist/{registry-CIEDjbQ9.d.ts → registry-C6dDtn1v.d.ts} +34 -15
- package/dist/{registry-SsSDq46X.d.mts → registry-POtcxnal.d.mts} +34 -15
- package/dist/render-log/index.d.mts +1 -1
- package/dist/render-log/index.d.ts +1 -1
- package/dist/server/express.d.mts +37 -0
- package/dist/server/express.d.ts +37 -0
- package/dist/server/express.js +298 -0
- package/dist/server/express.js.map +1 -0
- package/dist/server/express.mjs +294 -0
- package/dist/server/express.mjs.map +1 -0
- package/dist/server/handlers.d.mts +124 -0
- package/dist/server/handlers.d.ts +124 -0
- package/dist/server/handlers.js +7183 -0
- package/dist/server/handlers.js.map +1 -0
- package/dist/server/handlers.mjs +7180 -0
- package/dist/server/handlers.mjs.map +1 -0
- package/dist/server/index.d.mts +12 -0
- package/dist/server/index.d.ts +12 -0
- package/dist/server/index.js +8384 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/index.mjs +8369 -0
- package/dist/server/index.mjs.map +1 -0
- package/dist/server/nextjs.d.mts +128 -0
- package/dist/server/nextjs.d.ts +128 -0
- package/dist/server/nextjs.js +390 -0
- package/dist/server/nextjs.js.map +1 -0
- package/dist/server/nextjs.mjs +385 -0
- package/dist/server/nextjs.mjs.map +1 -0
- package/dist/server/standalone.d.mts +7 -0
- package/dist/server/standalone.d.ts +7 -0
- package/dist/server/standalone.js +845 -0
- package/dist/server/standalone.js.map +1 -0
- package/dist/server/standalone.mjs +841 -0
- package/dist/server/standalone.mjs.map +1 -0
- package/dist/specs/index.d.mts +365 -0
- package/dist/specs/index.d.ts +365 -0
- package/dist/specs/index.js +2809 -0
- package/dist/specs/index.js.map +1 -0
- package/dist/specs/index.mjs +2786 -0
- package/dist/specs/index.mjs.map +1 -0
- package/dist/standalone-B6GLIEmR.d.ts +216 -0
- package/dist/standalone-CjdYqj3P.d.mts +216 -0
- package/dist/swc-plugin/index.d.mts +79 -0
- package/dist/swc-plugin/index.d.ts +79 -0
- package/dist/swc-plugin/index.js +15 -0
- package/dist/swc-plugin/index.js.map +1 -0
- package/dist/swc-plugin/index.mjs +9 -0
- package/dist/swc-plugin/index.mjs.map +1 -0
- package/dist/types-B2EfvEaq.d.ts +236 -0
- package/dist/{types-Dr6tH-bm.d.mts → types-C7gVYRnF.d.ts} +72 -2
- package/dist/{types-oCTrRxSw.d.ts → types-CJGrBEhC.d.mts} +72 -2
- package/dist/types-CebMQj76.d.ts +1275 -0
- package/dist/types-D_ypYl3T.d.mts +1275 -0
- package/dist/types-UBtp7R0u.d.mts +132 -0
- package/dist/types-UBtp7R0u.d.ts +132 -0
- package/dist/types-gO696T_t.d.mts +236 -0
- package/dist/{types-CPMbN_Iw.d.mts → types-suaYwWWg.d.mts} +519 -152
- package/dist/{types-CPMbN_Iw.d.ts → types-suaYwWWg.d.ts} +519 -152
- package/package.json +123 -4
- package/swc-plugin-wasm/ui_bridge_swc_plugin.wasm +0 -0
- package/dist/types-BvCfFuEV.d.ts +0 -534
- package/dist/types-CFT3Dnx4.d.mts +0 -534
- package/dist/websocket-client-CX4QJesI.d.ts +0 -124
- package/dist/websocket-client-C_Na0OSp.d.mts +0 -124
package/dist/ai/index.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { a as AIElementRegistrationOptions, c as AIFindResponse, f as AssertionType, E as ElementChange,
|
|
3
|
-
import {
|
|
4
|
-
import { D as DiscoveredElement, A as ActionExecutor, d as ControlSnapshot } from '../types-
|
|
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-D_ypYl3T.mjs';
|
|
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-D_ypYl3T.mjs';
|
|
3
|
+
import { X as RegisteredElement, z as ElementState } from '../types-suaYwWWg.mjs';
|
|
4
|
+
import { D as DiscoveredElement, A as ActionExecutor, d as ControlSnapshot } from '../types-CJGrBEhC.mjs';
|
|
5
|
+
export { A as AssertionConfig, a as AssertionExecutor, D as DEFAULT_ASSERTION_CONFIG, c as createAssertionExecutor } from '../assertions-CTw1hfOx.mjs';
|
|
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
|
-
|
|
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 };
|