@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.
- 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 +23 -34
- package/dist/babel-plugin/index.js.map +1 -1
- package/dist/babel-plugin/index.mjs +23 -34
- package/dist/babel-plugin/index.mjs.map +1 -1
- 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 +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js.map +1 -1
- 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 +12 -7
- package/dist/index.d.ts +12 -7
- package/dist/index.js +4720 -173
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4656 -174
- package/dist/index.mjs.map +1 -1
- package/dist/{metrics-DTA2bwG7.d.mts → metrics-DuA2qIIz.d.mts} +2 -2
- package/dist/{metrics-BfiT_rhZ.d.ts → metrics-KFAAKNEB.d.ts} +2 -2
- package/dist/native/control/index.js +2 -7
- package/dist/native/control/index.js.map +1 -1
- package/dist/native/control/index.mjs +2 -7
- package/dist/native/control/index.mjs.map +1 -1
- package/dist/native/core/index.js.map +1 -1
- package/dist/native/core/index.mjs.map +1 -1
- package/dist/native/debug/index.js +23 -66
- package/dist/native/debug/index.js.map +1 -1
- package/dist/native/debug/index.mjs +23 -66
- package/dist/native/debug/index.mjs.map +1 -1
- package/dist/native/index.js +89 -131
- package/dist/native/index.js.map +1 -1
- package/dist/native/index.mjs +89 -131
- package/dist/native/index.mjs.map +1 -1
- package/dist/native/react/index.js +28 -52
- package/dist/native/react/index.js.map +1 -1
- package/dist/native/react/index.mjs +28 -52
- package/dist/native/react/index.mjs.map +1 -1
- package/dist/native/server/index.js +38 -13
- package/dist/native/server/index.js.map +1 -1
- package/dist/native/server/index.mjs +38 -13
- package/dist/native/server/index.mjs.map +1 -1
- package/dist/react/index.d.mts +107 -8
- package/dist/react/index.d.ts +107 -8
- package/dist/react/index.js +2194 -84
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +2194 -85
- package/dist/react/index.mjs.map +1 -1
- package/dist/{registry-BKLEm-yk.d.ts → registry-C6dDtn1v.d.ts} +27 -2
- package/dist/{registry-BmZgyCz8.d.mts → registry-POtcxnal.d.mts} +27 -2
- package/dist/render-log/index.d.mts +1 -1
- package/dist/render-log/index.d.ts +1 -1
- package/dist/server/express.d.mts +5 -4
- package/dist/server/express.d.ts +5 -4
- package/dist/server/express.js +104 -2
- package/dist/server/express.js.map +1 -1
- package/dist/server/express.mjs +104 -2
- package/dist/server/express.mjs.map +1 -1
- package/dist/server/handlers.d.mts +36 -5
- package/dist/server/handlers.d.ts +36 -5
- package/dist/server/handlers.js +3129 -224
- package/dist/server/handlers.js.map +1 -1
- package/dist/server/handlers.mjs +3129 -224
- package/dist/server/handlers.mjs.map +1 -1
- package/dist/server/index.d.mts +7 -5
- package/dist/server/index.d.ts +7 -5
- package/dist/server/index.js +3215 -183
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +3215 -183
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/nextjs.d.mts +6 -4
- package/dist/server/nextjs.d.ts +6 -4
- package/dist/server/nextjs.js +106 -3
- package/dist/server/nextjs.js.map +1 -1
- package/dist/server/nextjs.mjs +106 -3
- package/dist/server/nextjs.mjs.map +1 -1
- package/dist/server/standalone.d.mts +6 -5
- package/dist/server/standalone.d.ts +6 -5
- package/dist/server/standalone.js +131 -5
- package/dist/server/standalone.js.map +1 -1
- package/dist/server/standalone.mjs +131 -5
- package/dist/server/standalone.mjs.map +1 -1
- 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-BURj8J3G.d.ts → standalone-B6GLIEmR.d.ts} +6 -2
- package/dist/{standalone-Dwmel29d.d.mts → standalone-CjdYqj3P.d.mts} +6 -2
- package/dist/{types-CHnlwiTK.d.ts → types-B2EfvEaq.d.ts} +83 -3
- package/dist/{types-B7J7noLK.d.mts → types-C7gVYRnF.d.ts} +72 -2
- package/dist/{types-BkNRILUa.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-CEQLnFMv.d.mts → types-gO696T_t.d.mts} +83 -3
- package/dist/{types-jKVgTI6_.d.mts → types-suaYwWWg.d.mts} +173 -2
- package/dist/{types-jKVgTI6_.d.ts → types-suaYwWWg.d.ts} +173 -2
- package/package.json +18 -2
- package/dist/types-B5Q0GVo0.d.mts +0 -646
- package/dist/types-DfPqwU-i.d.ts +0 -646
package/dist/react/index.d.mts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React$1, { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { U as UIBridgeRegistry } from '../registry-
|
|
3
|
+
import { a2 as UIBridgeFeatures, a1 as UIBridgeConfig, aa as WSConnectionState, X as RegisteredElement, W as RegisteredComponent, m as BridgeSnapshot, l as BridgeEventType, k as BridgeEventListener, as as WSSubscriptionOptions, j as BridgeEvent, Q as OnBrowserEventCallback, n as BrowserCaptureConfig, F as ElementType, Z as StandardAction, x as CustomAction, z as ElementState, y as ElementIdentifier, az as Workflow, a4 as UIStateGroup, a3 as UIState, $ as StateSnapshot, aA as WorkflowStep, a0 as TransitionResult, a5 as UITransition, O as NavigationResult, T as PathResult, v as ContentRole } from '../types-suaYwWWg.mjs';
|
|
4
|
+
import { U as UIBridgeRegistry } from '../registry-POtcxnal.mjs';
|
|
5
5
|
import { UIBridgeWSClient } from '../core/index.mjs';
|
|
6
6
|
import { RenderLogManager } from '../render-log/index.mjs';
|
|
7
|
-
import { M as MetricsCollector } from '../metrics-
|
|
8
|
-
import { A as ActionExecutor,
|
|
9
|
-
import '../types-
|
|
7
|
+
import { M as MetricsCollector } from '../metrics-DuA2qIIz.mjs';
|
|
8
|
+
import { A as ActionExecutor, k as WorkflowEngine, b as ControlActionRequest, c as ControlActionResponse, C as ComponentActionRequest, a as ComponentActionResponse, F as FindRequest, h as FindResponse, l as WorkflowRunRequest, m as WorkflowRunResponse } from '../types-CJGrBEhC.mjs';
|
|
9
|
+
import { E as ElementAnnotation } from '../types-UBtp7R0u.mjs';
|
|
10
|
+
import '../types-D_ypYl3T.mjs';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* UI Bridge context value
|
|
@@ -36,6 +37,8 @@ interface UIBridgeContextValue {
|
|
|
36
37
|
getComponents: () => RegisteredComponent[];
|
|
37
38
|
/** Create a snapshot */
|
|
38
39
|
createSnapshot: () => BridgeSnapshot;
|
|
40
|
+
/** Create a snapshot asynchronously (non-blocking) */
|
|
41
|
+
createSnapshotAsync: (batchSize?: number) => Promise<BridgeSnapshot>;
|
|
39
42
|
/** Subscribe to events */
|
|
40
43
|
on: <T = unknown>(type: BridgeEventType, listener: BridgeEventListener<T>) => () => void;
|
|
41
44
|
/** Unsubscribe from events */
|
|
@@ -63,13 +66,17 @@ interface UIBridgeProviderProps {
|
|
|
63
66
|
config?: UIBridgeConfig;
|
|
64
67
|
/** Event handler */
|
|
65
68
|
onEvent?: BridgeEventListener;
|
|
69
|
+
/** Callback fired for each captured browser event */
|
|
70
|
+
onBrowserEvent?: OnBrowserEventCallback;
|
|
71
|
+
/** Configuration for browser event capture sub-modules */
|
|
72
|
+
browserCaptureConfig?: BrowserCaptureConfig;
|
|
66
73
|
}
|
|
67
74
|
/**
|
|
68
75
|
* UI Bridge Provider
|
|
69
76
|
*
|
|
70
77
|
* Provides UI Bridge context to child components.
|
|
71
78
|
*/
|
|
72
|
-
declare function UIBridgeProvider({ children, features, config, onEvent, }: UIBridgeProviderProps): react_jsx_runtime.JSX.Element;
|
|
79
|
+
declare function UIBridgeProvider({ children, features, config, onEvent, onBrowserEvent, browserCaptureConfig, }: UIBridgeProviderProps): react_jsx_runtime.JSX.Element;
|
|
73
80
|
/**
|
|
74
81
|
* useUIBridgeContext hook
|
|
75
82
|
*
|
|
@@ -309,6 +316,8 @@ interface UseUIBridgeReturn {
|
|
|
309
316
|
workflows: Workflow[];
|
|
310
317
|
/** Create a snapshot of the current state */
|
|
311
318
|
createSnapshot: () => BridgeSnapshot;
|
|
319
|
+
/** Create a snapshot asynchronously (non-blocking, yields between batches) */
|
|
320
|
+
createSnapshotAsync: (batchSize?: number) => Promise<BridgeSnapshot>;
|
|
312
321
|
/** Execute an action on an element */
|
|
313
322
|
executeAction: (elementId: string, request: ControlActionRequest) => Promise<ControlActionResponse>;
|
|
314
323
|
/** Execute an action on a component */
|
|
@@ -715,6 +724,36 @@ declare function useCanNavigateTo(targetStates: string[]): boolean;
|
|
|
715
724
|
*/
|
|
716
725
|
declare function useNavigationPath(targetStates: string[]): PathResult;
|
|
717
726
|
|
|
727
|
+
/**
|
|
728
|
+
* Content Discovery
|
|
729
|
+
*
|
|
730
|
+
* Discovers static text content elements (headings, paragraphs, table cells, etc.)
|
|
731
|
+
* and generates stable IDs and semantic metadata for AI consumption.
|
|
732
|
+
*
|
|
733
|
+
* Separate from the interactive element discovery in useAutoRegister.ts —
|
|
734
|
+
* content elements have no interactive actions and use ContentType instead of ElementType.
|
|
735
|
+
*/
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* Options for content discovery
|
|
739
|
+
*/
|
|
740
|
+
interface ContentDiscoveryOptions {
|
|
741
|
+
/** Enable content discovery (default: true) */
|
|
742
|
+
enabled?: boolean;
|
|
743
|
+
/** Additional CSS selectors to include */
|
|
744
|
+
includeContentSelectors?: string[];
|
|
745
|
+
/** Additional CSS selectors to exclude */
|
|
746
|
+
excludeContentSelectors?: string[];
|
|
747
|
+
/** Minimum text length to register (default: 1) */
|
|
748
|
+
minTextLength?: number;
|
|
749
|
+
/** Maximum content elements to register (default: 500) */
|
|
750
|
+
maxContentElements?: number;
|
|
751
|
+
/** Debounce interval for content registration (default: 250ms) */
|
|
752
|
+
contentDebounceMs?: number;
|
|
753
|
+
/** Only register elements with these content roles */
|
|
754
|
+
contentRoles?: ContentRole[];
|
|
755
|
+
}
|
|
756
|
+
|
|
718
757
|
/**
|
|
719
758
|
* useAutoRegister Hook
|
|
720
759
|
*
|
|
@@ -728,6 +767,7 @@ declare function useNavigationPath(targetStates: string[]): PathResult;
|
|
|
728
767
|
* - Debounced updates for performance
|
|
729
768
|
* - Respects existing manually registered elements
|
|
730
769
|
*/
|
|
770
|
+
|
|
731
771
|
/**
|
|
732
772
|
* ID generation strategy
|
|
733
773
|
*/
|
|
@@ -756,6 +796,8 @@ interface AutoRegisterOptions {
|
|
|
756
796
|
onRegister?: (id: string, element: HTMLElement) => void;
|
|
757
797
|
/** Callback when element is unregistered */
|
|
758
798
|
onUnregister?: (id: string) => void;
|
|
799
|
+
/** Content discovery options (enabled by default) */
|
|
800
|
+
contentDiscovery?: ContentDiscoveryOptions;
|
|
759
801
|
}
|
|
760
802
|
/**
|
|
761
803
|
* Hook for automatic element registration
|
|
@@ -782,6 +824,8 @@ interface AutoRegisterProviderProps extends Omit<AutoRegisterOptions, 'root'> {
|
|
|
782
824
|
children: ReactNode;
|
|
783
825
|
/** Use this element as the observation root instead of document.body */
|
|
784
826
|
scopeToChildren?: boolean;
|
|
827
|
+
/** Content discovery options (enabled by default) */
|
|
828
|
+
contentDiscovery?: ContentDiscoveryOptions;
|
|
785
829
|
}
|
|
786
830
|
/**
|
|
787
831
|
* Provider component that enables automatic element registration.
|
|
@@ -795,6 +839,61 @@ interface AutoRegisterProviderProps extends Omit<AutoRegisterOptions, 'root'> {
|
|
|
795
839
|
* Place this component at the root of your app (inside UIBridgeProvider)
|
|
796
840
|
* for comprehensive automatic element registration.
|
|
797
841
|
*/
|
|
798
|
-
declare function AutoRegisterProvider({ children, scopeToChildren, enabled, idStrategy, debounceMs, includeHidden, includeSelectors, excludeSelectors, generateId, onRegister, onUnregister, }: AutoRegisterProviderProps): react_jsx_runtime.JSX.Element;
|
|
842
|
+
declare function AutoRegisterProvider({ children, scopeToChildren, enabled, idStrategy, debounceMs, includeHidden, includeSelectors, excludeSelectors, generateId, onRegister, onUnregister, contentDiscovery, }: AutoRegisterProviderProps): react_jsx_runtime.JSX.Element;
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* useUIAnnotation Hook
|
|
846
|
+
*
|
|
847
|
+
* Registers a semantic annotation for a UI element in the global annotation store.
|
|
848
|
+
*/
|
|
849
|
+
|
|
850
|
+
/**
|
|
851
|
+
* Register a semantic annotation for a UI element.
|
|
852
|
+
*
|
|
853
|
+
* The annotation is set in the global annotation store and persists
|
|
854
|
+
* across renders. It is NOT cleaned up on unmount because annotations
|
|
855
|
+
* represent persistent developer knowledge about elements.
|
|
856
|
+
*
|
|
857
|
+
* @param elementId - The UI Bridge element ID to annotate
|
|
858
|
+
* @param annotation - The annotation data
|
|
859
|
+
*
|
|
860
|
+
* @example Basic annotation for a button
|
|
861
|
+
* ```tsx
|
|
862
|
+
* function LoginButton() {
|
|
863
|
+
* useUIAnnotation('login-btn', {
|
|
864
|
+
* description: 'Primary login button',
|
|
865
|
+
* purpose: 'Submits the login form',
|
|
866
|
+
* tags: ['auth', 'primary-action'],
|
|
867
|
+
* });
|
|
868
|
+
*
|
|
869
|
+
* return <button data-ui-id="login-btn">Log In</button>;
|
|
870
|
+
* }
|
|
871
|
+
* ```
|
|
872
|
+
*
|
|
873
|
+
* @example Annotations enrich the semantic snapshot
|
|
874
|
+
* ```tsx
|
|
875
|
+
* // When an element has an annotation, the semantic snapshot includes it.
|
|
876
|
+
* // Without annotation, the snapshot only has DOM-derived information.
|
|
877
|
+
* // With annotation, the snapshot gains human-authored context.
|
|
878
|
+
*
|
|
879
|
+
* function SearchBar() {
|
|
880
|
+
* useUIAnnotation('search-input', {
|
|
881
|
+
* description: 'Global search input',
|
|
882
|
+
* purpose: 'Searches across all projects and workflows',
|
|
883
|
+
* notes: 'Debounces input by 300ms. Supports advanced query syntax.',
|
|
884
|
+
* tags: ['search', 'global'],
|
|
885
|
+
* relatedElements: ['search-results-panel', 'search-clear-btn'],
|
|
886
|
+
* });
|
|
887
|
+
*
|
|
888
|
+
* return <input data-ui-id="search-input" placeholder="Search..." />;
|
|
889
|
+
* }
|
|
890
|
+
*
|
|
891
|
+
* // The annotation data is then available via:
|
|
892
|
+
* // GET /annotations/search-input
|
|
893
|
+
* // GET /annotations/export (in the full config)
|
|
894
|
+
* // store.get('search-input')
|
|
895
|
+
* ```
|
|
896
|
+
*/
|
|
897
|
+
declare function useUIAnnotation(elementId: string, annotation: ElementAnnotation): void;
|
|
799
898
|
|
|
800
|
-
export { type AutoRegisterOptions, AutoRegisterProvider, type AutoRegisterProviderProps, type ComponentActionDef, type ComputedPropertyDef, type IdStrategy, type UIBridgeContextValue, UIBridgeProvider, type UIBridgeProviderProps, type UseUIBridgeReturn, type UseUIComponentOptions, type UseUIComponentReturn, type UseUIElementOptions, type UseUIElementReturn, type UseUINavigationReturn, type UseUIStateGroupOptions, type UseUIStateGroupReturn, type UseUIStateOptions, type UseUIStateReturn, type UseUITransitionOptions, type UseUITransitionReturn, useActiveStates, useAutoRegister, useAvailableTransitions, useCanNavigateTo, useNavigationPath, useStateSnapshot, useTransitions, useUIBridge, useUIBridgeContext, useUIBridgeOptional, useUIBridgeRequired, useUIComponent, useUIComponentAction, useUIElement, useUIElementRef, useUINavigation, useUIState, useUIStateGroup, useUITransition };
|
|
899
|
+
export { type AutoRegisterOptions, AutoRegisterProvider, type AutoRegisterProviderProps, type ComponentActionDef, type ComputedPropertyDef, type ContentDiscoveryOptions, type IdStrategy, type UIBridgeContextValue, UIBridgeProvider, type UIBridgeProviderProps, type UseUIBridgeReturn, type UseUIComponentOptions, type UseUIComponentReturn, type UseUIElementOptions, type UseUIElementReturn, type UseUINavigationReturn, type UseUIStateGroupOptions, type UseUIStateGroupReturn, type UseUIStateOptions, type UseUIStateReturn, type UseUITransitionOptions, type UseUITransitionReturn, useActiveStates, useAutoRegister, useAvailableTransitions, useCanNavigateTo, useNavigationPath, useStateSnapshot, useTransitions, useUIAnnotation, useUIBridge, useUIBridgeContext, useUIBridgeOptional, useUIBridgeRequired, useUIComponent, useUIComponentAction, useUIElement, useUIElementRef, useUINavigation, useUIState, useUIStateGroup, useUITransition };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React$1, { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { U as UIBridgeRegistry } from '../registry-
|
|
3
|
+
import { a2 as UIBridgeFeatures, a1 as UIBridgeConfig, aa as WSConnectionState, X as RegisteredElement, W as RegisteredComponent, m as BridgeSnapshot, l as BridgeEventType, k as BridgeEventListener, as as WSSubscriptionOptions, j as BridgeEvent, Q as OnBrowserEventCallback, n as BrowserCaptureConfig, F as ElementType, Z as StandardAction, x as CustomAction, z as ElementState, y as ElementIdentifier, az as Workflow, a4 as UIStateGroup, a3 as UIState, $ as StateSnapshot, aA as WorkflowStep, a0 as TransitionResult, a5 as UITransition, O as NavigationResult, T as PathResult, v as ContentRole } from '../types-suaYwWWg.js';
|
|
4
|
+
import { U as UIBridgeRegistry } from '../registry-C6dDtn1v.js';
|
|
5
5
|
import { UIBridgeWSClient } from '../core/index.js';
|
|
6
6
|
import { RenderLogManager } from '../render-log/index.js';
|
|
7
|
-
import { M as MetricsCollector } from '../metrics-
|
|
8
|
-
import { A as ActionExecutor,
|
|
9
|
-
import '../types-
|
|
7
|
+
import { M as MetricsCollector } from '../metrics-KFAAKNEB.js';
|
|
8
|
+
import { A as ActionExecutor, k as WorkflowEngine, b as ControlActionRequest, c as ControlActionResponse, C as ComponentActionRequest, a as ComponentActionResponse, F as FindRequest, h as FindResponse, l as WorkflowRunRequest, m as WorkflowRunResponse } from '../types-C7gVYRnF.js';
|
|
9
|
+
import { E as ElementAnnotation } from '../types-UBtp7R0u.js';
|
|
10
|
+
import '../types-CebMQj76.js';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* UI Bridge context value
|
|
@@ -36,6 +37,8 @@ interface UIBridgeContextValue {
|
|
|
36
37
|
getComponents: () => RegisteredComponent[];
|
|
37
38
|
/** Create a snapshot */
|
|
38
39
|
createSnapshot: () => BridgeSnapshot;
|
|
40
|
+
/** Create a snapshot asynchronously (non-blocking) */
|
|
41
|
+
createSnapshotAsync: (batchSize?: number) => Promise<BridgeSnapshot>;
|
|
39
42
|
/** Subscribe to events */
|
|
40
43
|
on: <T = unknown>(type: BridgeEventType, listener: BridgeEventListener<T>) => () => void;
|
|
41
44
|
/** Unsubscribe from events */
|
|
@@ -63,13 +66,17 @@ interface UIBridgeProviderProps {
|
|
|
63
66
|
config?: UIBridgeConfig;
|
|
64
67
|
/** Event handler */
|
|
65
68
|
onEvent?: BridgeEventListener;
|
|
69
|
+
/** Callback fired for each captured browser event */
|
|
70
|
+
onBrowserEvent?: OnBrowserEventCallback;
|
|
71
|
+
/** Configuration for browser event capture sub-modules */
|
|
72
|
+
browserCaptureConfig?: BrowserCaptureConfig;
|
|
66
73
|
}
|
|
67
74
|
/**
|
|
68
75
|
* UI Bridge Provider
|
|
69
76
|
*
|
|
70
77
|
* Provides UI Bridge context to child components.
|
|
71
78
|
*/
|
|
72
|
-
declare function UIBridgeProvider({ children, features, config, onEvent, }: UIBridgeProviderProps): react_jsx_runtime.JSX.Element;
|
|
79
|
+
declare function UIBridgeProvider({ children, features, config, onEvent, onBrowserEvent, browserCaptureConfig, }: UIBridgeProviderProps): react_jsx_runtime.JSX.Element;
|
|
73
80
|
/**
|
|
74
81
|
* useUIBridgeContext hook
|
|
75
82
|
*
|
|
@@ -309,6 +316,8 @@ interface UseUIBridgeReturn {
|
|
|
309
316
|
workflows: Workflow[];
|
|
310
317
|
/** Create a snapshot of the current state */
|
|
311
318
|
createSnapshot: () => BridgeSnapshot;
|
|
319
|
+
/** Create a snapshot asynchronously (non-blocking, yields between batches) */
|
|
320
|
+
createSnapshotAsync: (batchSize?: number) => Promise<BridgeSnapshot>;
|
|
312
321
|
/** Execute an action on an element */
|
|
313
322
|
executeAction: (elementId: string, request: ControlActionRequest) => Promise<ControlActionResponse>;
|
|
314
323
|
/** Execute an action on a component */
|
|
@@ -715,6 +724,36 @@ declare function useCanNavigateTo(targetStates: string[]): boolean;
|
|
|
715
724
|
*/
|
|
716
725
|
declare function useNavigationPath(targetStates: string[]): PathResult;
|
|
717
726
|
|
|
727
|
+
/**
|
|
728
|
+
* Content Discovery
|
|
729
|
+
*
|
|
730
|
+
* Discovers static text content elements (headings, paragraphs, table cells, etc.)
|
|
731
|
+
* and generates stable IDs and semantic metadata for AI consumption.
|
|
732
|
+
*
|
|
733
|
+
* Separate from the interactive element discovery in useAutoRegister.ts —
|
|
734
|
+
* content elements have no interactive actions and use ContentType instead of ElementType.
|
|
735
|
+
*/
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* Options for content discovery
|
|
739
|
+
*/
|
|
740
|
+
interface ContentDiscoveryOptions {
|
|
741
|
+
/** Enable content discovery (default: true) */
|
|
742
|
+
enabled?: boolean;
|
|
743
|
+
/** Additional CSS selectors to include */
|
|
744
|
+
includeContentSelectors?: string[];
|
|
745
|
+
/** Additional CSS selectors to exclude */
|
|
746
|
+
excludeContentSelectors?: string[];
|
|
747
|
+
/** Minimum text length to register (default: 1) */
|
|
748
|
+
minTextLength?: number;
|
|
749
|
+
/** Maximum content elements to register (default: 500) */
|
|
750
|
+
maxContentElements?: number;
|
|
751
|
+
/** Debounce interval for content registration (default: 250ms) */
|
|
752
|
+
contentDebounceMs?: number;
|
|
753
|
+
/** Only register elements with these content roles */
|
|
754
|
+
contentRoles?: ContentRole[];
|
|
755
|
+
}
|
|
756
|
+
|
|
718
757
|
/**
|
|
719
758
|
* useAutoRegister Hook
|
|
720
759
|
*
|
|
@@ -728,6 +767,7 @@ declare function useNavigationPath(targetStates: string[]): PathResult;
|
|
|
728
767
|
* - Debounced updates for performance
|
|
729
768
|
* - Respects existing manually registered elements
|
|
730
769
|
*/
|
|
770
|
+
|
|
731
771
|
/**
|
|
732
772
|
* ID generation strategy
|
|
733
773
|
*/
|
|
@@ -756,6 +796,8 @@ interface AutoRegisterOptions {
|
|
|
756
796
|
onRegister?: (id: string, element: HTMLElement) => void;
|
|
757
797
|
/** Callback when element is unregistered */
|
|
758
798
|
onUnregister?: (id: string) => void;
|
|
799
|
+
/** Content discovery options (enabled by default) */
|
|
800
|
+
contentDiscovery?: ContentDiscoveryOptions;
|
|
759
801
|
}
|
|
760
802
|
/**
|
|
761
803
|
* Hook for automatic element registration
|
|
@@ -782,6 +824,8 @@ interface AutoRegisterProviderProps extends Omit<AutoRegisterOptions, 'root'> {
|
|
|
782
824
|
children: ReactNode;
|
|
783
825
|
/** Use this element as the observation root instead of document.body */
|
|
784
826
|
scopeToChildren?: boolean;
|
|
827
|
+
/** Content discovery options (enabled by default) */
|
|
828
|
+
contentDiscovery?: ContentDiscoveryOptions;
|
|
785
829
|
}
|
|
786
830
|
/**
|
|
787
831
|
* Provider component that enables automatic element registration.
|
|
@@ -795,6 +839,61 @@ interface AutoRegisterProviderProps extends Omit<AutoRegisterOptions, 'root'> {
|
|
|
795
839
|
* Place this component at the root of your app (inside UIBridgeProvider)
|
|
796
840
|
* for comprehensive automatic element registration.
|
|
797
841
|
*/
|
|
798
|
-
declare function AutoRegisterProvider({ children, scopeToChildren, enabled, idStrategy, debounceMs, includeHidden, includeSelectors, excludeSelectors, generateId, onRegister, onUnregister, }: AutoRegisterProviderProps): react_jsx_runtime.JSX.Element;
|
|
842
|
+
declare function AutoRegisterProvider({ children, scopeToChildren, enabled, idStrategy, debounceMs, includeHidden, includeSelectors, excludeSelectors, generateId, onRegister, onUnregister, contentDiscovery, }: AutoRegisterProviderProps): react_jsx_runtime.JSX.Element;
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* useUIAnnotation Hook
|
|
846
|
+
*
|
|
847
|
+
* Registers a semantic annotation for a UI element in the global annotation store.
|
|
848
|
+
*/
|
|
849
|
+
|
|
850
|
+
/**
|
|
851
|
+
* Register a semantic annotation for a UI element.
|
|
852
|
+
*
|
|
853
|
+
* The annotation is set in the global annotation store and persists
|
|
854
|
+
* across renders. It is NOT cleaned up on unmount because annotations
|
|
855
|
+
* represent persistent developer knowledge about elements.
|
|
856
|
+
*
|
|
857
|
+
* @param elementId - The UI Bridge element ID to annotate
|
|
858
|
+
* @param annotation - The annotation data
|
|
859
|
+
*
|
|
860
|
+
* @example Basic annotation for a button
|
|
861
|
+
* ```tsx
|
|
862
|
+
* function LoginButton() {
|
|
863
|
+
* useUIAnnotation('login-btn', {
|
|
864
|
+
* description: 'Primary login button',
|
|
865
|
+
* purpose: 'Submits the login form',
|
|
866
|
+
* tags: ['auth', 'primary-action'],
|
|
867
|
+
* });
|
|
868
|
+
*
|
|
869
|
+
* return <button data-ui-id="login-btn">Log In</button>;
|
|
870
|
+
* }
|
|
871
|
+
* ```
|
|
872
|
+
*
|
|
873
|
+
* @example Annotations enrich the semantic snapshot
|
|
874
|
+
* ```tsx
|
|
875
|
+
* // When an element has an annotation, the semantic snapshot includes it.
|
|
876
|
+
* // Without annotation, the snapshot only has DOM-derived information.
|
|
877
|
+
* // With annotation, the snapshot gains human-authored context.
|
|
878
|
+
*
|
|
879
|
+
* function SearchBar() {
|
|
880
|
+
* useUIAnnotation('search-input', {
|
|
881
|
+
* description: 'Global search input',
|
|
882
|
+
* purpose: 'Searches across all projects and workflows',
|
|
883
|
+
* notes: 'Debounces input by 300ms. Supports advanced query syntax.',
|
|
884
|
+
* tags: ['search', 'global'],
|
|
885
|
+
* relatedElements: ['search-results-panel', 'search-clear-btn'],
|
|
886
|
+
* });
|
|
887
|
+
*
|
|
888
|
+
* return <input data-ui-id="search-input" placeholder="Search..." />;
|
|
889
|
+
* }
|
|
890
|
+
*
|
|
891
|
+
* // The annotation data is then available via:
|
|
892
|
+
* // GET /annotations/search-input
|
|
893
|
+
* // GET /annotations/export (in the full config)
|
|
894
|
+
* // store.get('search-input')
|
|
895
|
+
* ```
|
|
896
|
+
*/
|
|
897
|
+
declare function useUIAnnotation(elementId: string, annotation: ElementAnnotation): void;
|
|
799
898
|
|
|
800
|
-
export { type AutoRegisterOptions, AutoRegisterProvider, type AutoRegisterProviderProps, type ComponentActionDef, type ComputedPropertyDef, type IdStrategy, type UIBridgeContextValue, UIBridgeProvider, type UIBridgeProviderProps, type UseUIBridgeReturn, type UseUIComponentOptions, type UseUIComponentReturn, type UseUIElementOptions, type UseUIElementReturn, type UseUINavigationReturn, type UseUIStateGroupOptions, type UseUIStateGroupReturn, type UseUIStateOptions, type UseUIStateReturn, type UseUITransitionOptions, type UseUITransitionReturn, useActiveStates, useAutoRegister, useAvailableTransitions, useCanNavigateTo, useNavigationPath, useStateSnapshot, useTransitions, useUIBridge, useUIBridgeContext, useUIBridgeOptional, useUIBridgeRequired, useUIComponent, useUIComponentAction, useUIElement, useUIElementRef, useUINavigation, useUIState, useUIStateGroup, useUITransition };
|
|
899
|
+
export { type AutoRegisterOptions, AutoRegisterProvider, type AutoRegisterProviderProps, type ComponentActionDef, type ComputedPropertyDef, type ContentDiscoveryOptions, type IdStrategy, type UIBridgeContextValue, UIBridgeProvider, type UIBridgeProviderProps, type UseUIBridgeReturn, type UseUIComponentOptions, type UseUIComponentReturn, type UseUIElementOptions, type UseUIElementReturn, type UseUINavigationReturn, type UseUIStateGroupOptions, type UseUIStateGroupReturn, type UseUIStateOptions, type UseUIStateReturn, type UseUITransitionOptions, type UseUITransitionReturn, useActiveStates, useAutoRegister, useAvailableTransitions, useCanNavigateTo, useNavigationPath, useStateSnapshot, useTransitions, useUIAnnotation, useUIBridge, useUIBridgeContext, useUIBridgeOptional, useUIBridgeRequired, useUIComponent, useUIComponentAction, useUIElement, useUIElementRef, useUINavigation, useUIState, useUIStateGroup, useUITransition };
|