@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/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-
|
|
5
|
-
import {
|
|
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
|
+
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
|
*
|
|
@@ -181,6 +188,15 @@ interface ComponentActionDef<TParams = unknown, TResult = unknown> {
|
|
|
181
188
|
/** Handler function */
|
|
182
189
|
handler: (params?: TParams) => TResult | Promise<TResult>;
|
|
183
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* Computed property definition for useUIComponent
|
|
193
|
+
*/
|
|
194
|
+
interface ComputedPropertyDef<T = unknown> {
|
|
195
|
+
/** Getter function for the computed value */
|
|
196
|
+
getter: () => T;
|
|
197
|
+
/** Description of what the computed property represents */
|
|
198
|
+
description?: string;
|
|
199
|
+
}
|
|
184
200
|
/**
|
|
185
201
|
* useUIComponent options
|
|
186
202
|
*/
|
|
@@ -197,6 +213,10 @@ interface UseUIComponentOptions {
|
|
|
197
213
|
elementIds?: string[];
|
|
198
214
|
/** Whether to automatically register on mount */
|
|
199
215
|
autoRegister?: boolean;
|
|
216
|
+
/** Function to get the current component state */
|
|
217
|
+
state?: () => Record<string, unknown>;
|
|
218
|
+
/** Computed properties exposed by the component */
|
|
219
|
+
computed?: Record<string, ComputedPropertyDef | (() => unknown)>;
|
|
200
220
|
}
|
|
201
221
|
/**
|
|
202
222
|
* useUIComponent return value
|
|
@@ -296,6 +316,8 @@ interface UseUIBridgeReturn {
|
|
|
296
316
|
workflows: Workflow[];
|
|
297
317
|
/** Create a snapshot of the current state */
|
|
298
318
|
createSnapshot: () => BridgeSnapshot;
|
|
319
|
+
/** Create a snapshot asynchronously (non-blocking, yields between batches) */
|
|
320
|
+
createSnapshotAsync: (batchSize?: number) => Promise<BridgeSnapshot>;
|
|
299
321
|
/** Execute an action on an element */
|
|
300
322
|
executeAction: (elementId: string, request: ControlActionRequest) => Promise<ControlActionResponse>;
|
|
301
323
|
/** Execute an action on a component */
|
|
@@ -702,6 +724,36 @@ declare function useCanNavigateTo(targetStates: string[]): boolean;
|
|
|
702
724
|
*/
|
|
703
725
|
declare function useNavigationPath(targetStates: string[]): PathResult;
|
|
704
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
|
+
|
|
705
757
|
/**
|
|
706
758
|
* useAutoRegister Hook
|
|
707
759
|
*
|
|
@@ -715,6 +767,7 @@ declare function useNavigationPath(targetStates: string[]): PathResult;
|
|
|
715
767
|
* - Debounced updates for performance
|
|
716
768
|
* - Respects existing manually registered elements
|
|
717
769
|
*/
|
|
770
|
+
|
|
718
771
|
/**
|
|
719
772
|
* ID generation strategy
|
|
720
773
|
*/
|
|
@@ -743,6 +796,8 @@ interface AutoRegisterOptions {
|
|
|
743
796
|
onRegister?: (id: string, element: HTMLElement) => void;
|
|
744
797
|
/** Callback when element is unregistered */
|
|
745
798
|
onUnregister?: (id: string) => void;
|
|
799
|
+
/** Content discovery options (enabled by default) */
|
|
800
|
+
contentDiscovery?: ContentDiscoveryOptions;
|
|
746
801
|
}
|
|
747
802
|
/**
|
|
748
803
|
* Hook for automatic element registration
|
|
@@ -769,6 +824,8 @@ interface AutoRegisterProviderProps extends Omit<AutoRegisterOptions, 'root'> {
|
|
|
769
824
|
children: ReactNode;
|
|
770
825
|
/** Use this element as the observation root instead of document.body */
|
|
771
826
|
scopeToChildren?: boolean;
|
|
827
|
+
/** Content discovery options (enabled by default) */
|
|
828
|
+
contentDiscovery?: ContentDiscoveryOptions;
|
|
772
829
|
}
|
|
773
830
|
/**
|
|
774
831
|
* Provider component that enables automatic element registration.
|
|
@@ -782,6 +839,61 @@ interface AutoRegisterProviderProps extends Omit<AutoRegisterOptions, 'root'> {
|
|
|
782
839
|
* Place this component at the root of your app (inside UIBridgeProvider)
|
|
783
840
|
* for comprehensive automatic element registration.
|
|
784
841
|
*/
|
|
785
|
-
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;
|
|
786
898
|
|
|
787
|
-
export { type AutoRegisterOptions, AutoRegisterProvider, type AutoRegisterProviderProps, type ComponentActionDef, 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-
|
|
5
|
-
import {
|
|
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
|
+
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
|
*
|
|
@@ -181,6 +188,15 @@ interface ComponentActionDef<TParams = unknown, TResult = unknown> {
|
|
|
181
188
|
/** Handler function */
|
|
182
189
|
handler: (params?: TParams) => TResult | Promise<TResult>;
|
|
183
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* Computed property definition for useUIComponent
|
|
193
|
+
*/
|
|
194
|
+
interface ComputedPropertyDef<T = unknown> {
|
|
195
|
+
/** Getter function for the computed value */
|
|
196
|
+
getter: () => T;
|
|
197
|
+
/** Description of what the computed property represents */
|
|
198
|
+
description?: string;
|
|
199
|
+
}
|
|
184
200
|
/**
|
|
185
201
|
* useUIComponent options
|
|
186
202
|
*/
|
|
@@ -197,6 +213,10 @@ interface UseUIComponentOptions {
|
|
|
197
213
|
elementIds?: string[];
|
|
198
214
|
/** Whether to automatically register on mount */
|
|
199
215
|
autoRegister?: boolean;
|
|
216
|
+
/** Function to get the current component state */
|
|
217
|
+
state?: () => Record<string, unknown>;
|
|
218
|
+
/** Computed properties exposed by the component */
|
|
219
|
+
computed?: Record<string, ComputedPropertyDef | (() => unknown)>;
|
|
200
220
|
}
|
|
201
221
|
/**
|
|
202
222
|
* useUIComponent return value
|
|
@@ -296,6 +316,8 @@ interface UseUIBridgeReturn {
|
|
|
296
316
|
workflows: Workflow[];
|
|
297
317
|
/** Create a snapshot of the current state */
|
|
298
318
|
createSnapshot: () => BridgeSnapshot;
|
|
319
|
+
/** Create a snapshot asynchronously (non-blocking, yields between batches) */
|
|
320
|
+
createSnapshotAsync: (batchSize?: number) => Promise<BridgeSnapshot>;
|
|
299
321
|
/** Execute an action on an element */
|
|
300
322
|
executeAction: (elementId: string, request: ControlActionRequest) => Promise<ControlActionResponse>;
|
|
301
323
|
/** Execute an action on a component */
|
|
@@ -702,6 +724,36 @@ declare function useCanNavigateTo(targetStates: string[]): boolean;
|
|
|
702
724
|
*/
|
|
703
725
|
declare function useNavigationPath(targetStates: string[]): PathResult;
|
|
704
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
|
+
|
|
705
757
|
/**
|
|
706
758
|
* useAutoRegister Hook
|
|
707
759
|
*
|
|
@@ -715,6 +767,7 @@ declare function useNavigationPath(targetStates: string[]): PathResult;
|
|
|
715
767
|
* - Debounced updates for performance
|
|
716
768
|
* - Respects existing manually registered elements
|
|
717
769
|
*/
|
|
770
|
+
|
|
718
771
|
/**
|
|
719
772
|
* ID generation strategy
|
|
720
773
|
*/
|
|
@@ -743,6 +796,8 @@ interface AutoRegisterOptions {
|
|
|
743
796
|
onRegister?: (id: string, element: HTMLElement) => void;
|
|
744
797
|
/** Callback when element is unregistered */
|
|
745
798
|
onUnregister?: (id: string) => void;
|
|
799
|
+
/** Content discovery options (enabled by default) */
|
|
800
|
+
contentDiscovery?: ContentDiscoveryOptions;
|
|
746
801
|
}
|
|
747
802
|
/**
|
|
748
803
|
* Hook for automatic element registration
|
|
@@ -769,6 +824,8 @@ interface AutoRegisterProviderProps extends Omit<AutoRegisterOptions, 'root'> {
|
|
|
769
824
|
children: ReactNode;
|
|
770
825
|
/** Use this element as the observation root instead of document.body */
|
|
771
826
|
scopeToChildren?: boolean;
|
|
827
|
+
/** Content discovery options (enabled by default) */
|
|
828
|
+
contentDiscovery?: ContentDiscoveryOptions;
|
|
772
829
|
}
|
|
773
830
|
/**
|
|
774
831
|
* Provider component that enables automatic element registration.
|
|
@@ -782,6 +839,61 @@ interface AutoRegisterProviderProps extends Omit<AutoRegisterOptions, 'root'> {
|
|
|
782
839
|
* Place this component at the root of your app (inside UIBridgeProvider)
|
|
783
840
|
* for comprehensive automatic element registration.
|
|
784
841
|
*/
|
|
785
|
-
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;
|
|
786
898
|
|
|
787
|
-
export { type AutoRegisterOptions, AutoRegisterProvider, type AutoRegisterProviderProps, type ComponentActionDef, 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 };
|