@qontinui/ui-bridge 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/dist/ai/index.d.mts +893 -0
  2. package/dist/ai/index.d.ts +893 -0
  3. package/dist/ai/index.js +3897 -0
  4. package/dist/ai/index.js.map +1 -0
  5. package/dist/ai/index.mjs +3839 -0
  6. package/dist/ai/index.mjs.map +1 -0
  7. package/dist/babel-plugin/index.js +515 -0
  8. package/dist/babel-plugin/index.js.map +1 -0
  9. package/dist/babel-plugin/index.mjs +499 -0
  10. package/dist/babel-plugin/index.mjs.map +1 -0
  11. package/dist/control/index.d.mts +5 -4
  12. package/dist/control/index.d.ts +5 -4
  13. package/dist/core/index.d.mts +115 -42
  14. package/dist/core/index.d.ts +115 -42
  15. package/dist/core/index.js +0 -983
  16. package/dist/core/index.js.map +1 -1
  17. package/dist/core/index.mjs +1 -972
  18. package/dist/core/index.mjs.map +1 -1
  19. package/dist/debug/index.d.mts +3 -3
  20. package/dist/debug/index.d.ts +3 -3
  21. package/dist/index.d.mts +8 -7
  22. package/dist/index.d.ts +8 -7
  23. package/dist/index.js +8249 -4163
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.mjs +8193 -4152
  26. package/dist/index.mjs.map +1 -1
  27. package/dist/{metrics-QCnK0EFw.d.ts → metrics-BfiT_rhZ.d.ts} +2 -2
  28. package/dist/{metrics-BCG7z7Aq.d.mts → metrics-DTA2bwG7.d.mts} +2 -2
  29. package/dist/native/control/index.js +453 -0
  30. package/dist/native/control/index.js.map +1 -0
  31. package/dist/native/control/index.mjs +450 -0
  32. package/dist/native/control/index.mjs.map +1 -0
  33. package/dist/native/core/index.js +486 -0
  34. package/dist/native/core/index.js.map +1 -0
  35. package/dist/native/core/index.mjs +475 -0
  36. package/dist/native/core/index.mjs.map +1 -0
  37. package/dist/native/debug/index.js +451 -0
  38. package/dist/native/debug/index.js.map +1 -0
  39. package/dist/native/debug/index.mjs +449 -0
  40. package/dist/native/debug/index.mjs.map +1 -0
  41. package/dist/native/index.js +2274 -0
  42. package/dist/native/index.js.map +1 -0
  43. package/dist/native/index.mjs +2246 -0
  44. package/dist/native/index.mjs.map +1 -0
  45. package/dist/native/react/index.js +1401 -0
  46. package/dist/native/react/index.js.map +1 -0
  47. package/dist/native/react/index.mjs +1389 -0
  48. package/dist/native/react/index.mjs.map +1 -0
  49. package/dist/native/server/index.js +415 -0
  50. package/dist/native/server/index.js.map +1 -0
  51. package/dist/native/server/index.mjs +410 -0
  52. package/dist/native/server/index.mjs.map +1 -0
  53. package/dist/react/index.d.mts +20 -6
  54. package/dist/react/index.d.ts +20 -6
  55. package/dist/react/index.js +629 -14
  56. package/dist/react/index.js.map +1 -1
  57. package/dist/react/index.mjs +629 -14
  58. package/dist/react/index.mjs.map +1 -1
  59. package/dist/{registry-CT6BVVKr.d.mts → registry-BKLEm-yk.d.ts} +29 -14
  60. package/dist/{registry-D4mQ01B3.d.ts → registry-BmZgyCz8.d.mts} +29 -14
  61. package/dist/render-log/index.d.mts +1 -1
  62. package/dist/render-log/index.d.ts +1 -1
  63. package/dist/server/express.d.mts +36 -0
  64. package/dist/server/express.d.ts +36 -0
  65. package/dist/server/express.js +196 -0
  66. package/dist/server/express.js.map +1 -0
  67. package/dist/server/express.mjs +192 -0
  68. package/dist/server/express.mjs.map +1 -0
  69. package/dist/server/handlers.d.mts +93 -0
  70. package/dist/server/handlers.d.ts +93 -0
  71. package/dist/server/handlers.js +4278 -0
  72. package/dist/server/handlers.js.map +1 -0
  73. package/dist/server/handlers.mjs +4275 -0
  74. package/dist/server/handlers.mjs.map +1 -0
  75. package/dist/server/index.d.mts +10 -0
  76. package/dist/server/index.d.ts +10 -0
  77. package/dist/server/index.js +5352 -0
  78. package/dist/server/index.js.map +1 -0
  79. package/dist/server/index.mjs +5337 -0
  80. package/dist/server/index.mjs.map +1 -0
  81. package/dist/server/nextjs.d.mts +126 -0
  82. package/dist/server/nextjs.d.ts +126 -0
  83. package/dist/server/nextjs.js +287 -0
  84. package/dist/server/nextjs.js.map +1 -0
  85. package/dist/server/nextjs.mjs +282 -0
  86. package/dist/server/nextjs.mjs.map +1 -0
  87. package/dist/server/standalone.d.mts +6 -0
  88. package/dist/server/standalone.d.ts +6 -0
  89. package/dist/server/standalone.js +719 -0
  90. package/dist/server/standalone.js.map +1 -0
  91. package/dist/server/standalone.mjs +715 -0
  92. package/dist/server/standalone.mjs.map +1 -0
  93. package/dist/standalone-BURj8J3G.d.ts +212 -0
  94. package/dist/standalone-Dwmel29d.d.mts +212 -0
  95. package/dist/swc-plugin/index.d.mts +79 -0
  96. package/dist/swc-plugin/index.d.ts +79 -0
  97. package/dist/swc-plugin/index.js +15 -0
  98. package/dist/swc-plugin/index.js.map +1 -0
  99. package/dist/swc-plugin/index.mjs +9 -0
  100. package/dist/swc-plugin/index.mjs.map +1 -0
  101. package/dist/types-B5Q0GVo0.d.mts +646 -0
  102. package/dist/{types-DdJD9yw5.d.mts → types-B7J7noLK.d.mts} +1 -1
  103. package/dist/{types-BDkXy5si.d.ts → types-BkNRILUa.d.ts} +1 -1
  104. package/dist/types-CEQLnFMv.d.mts +156 -0
  105. package/dist/types-CHnlwiTK.d.ts +156 -0
  106. package/dist/types-DfPqwU-i.d.ts +646 -0
  107. package/dist/{types-BpvpStn3.d.mts → types-jKVgTI6_.d.mts} +364 -160
  108. package/dist/{types-BpvpStn3.d.ts → types-jKVgTI6_.d.ts} +364 -160
  109. package/package.json +111 -3
  110. package/swc-plugin-wasm/ui_bridge_swc_plugin.wasm +0 -0
  111. package/dist/websocket-client-B2LC9CYc.d.mts +0 -124
  112. package/dist/websocket-client-DupH0X7B.d.ts +0 -124
@@ -0,0 +1,156 @@
1
+ import { U as UIBridgeConfig } from './types-jKVgTI6_.mjs';
2
+ import { d as ControlSnapshot, b as ControlActionRequest, c as ControlActionResponse, C as ComponentActionRequest, a as ComponentActionResponse, F as FindRequest, g as FindResponse, j as WorkflowRunRequest, k as WorkflowRunResponse } from './types-B7J7noLK.mjs';
3
+ import { S as SearchCriteria, n as SearchResponse, N as NLActionRequest, l as NLActionResponse, d as AssertionRequest, e as AssertionResult, B as BatchAssertionRequest, g as BatchAssertionResult, t as SemanticSnapshot, p as SemanticDiff, q as SemanticSearchCriteria, r as SemanticSearchResponse } from './types-B5Q0GVo0.mjs';
4
+ import { RenderLogEntryType, RenderLogEntry } from './render-log/index.mjs';
5
+
6
+ /**
7
+ * UI Bridge Server Types
8
+ *
9
+ * Shared types for server adapters.
10
+ */
11
+
12
+ /**
13
+ * Server configuration
14
+ */
15
+ interface UIBridgeServerConfig extends UIBridgeConfig {
16
+ /** Base path for API routes */
17
+ basePath?: string;
18
+ /** Enable CORS */
19
+ cors?: boolean | CORSOptions;
20
+ /** Authentication middleware */
21
+ authenticate?: (req: unknown) => boolean | Promise<boolean>;
22
+ /** Rate limiting */
23
+ rateLimit?: RateLimitOptions;
24
+ }
25
+ /**
26
+ * CORS options
27
+ */
28
+ interface CORSOptions {
29
+ /** Allowed origins */
30
+ origin?: string | string[] | boolean;
31
+ /** Allowed methods */
32
+ methods?: string[];
33
+ /** Allowed headers */
34
+ headers?: string[];
35
+ /** Expose headers */
36
+ exposeHeaders?: string[];
37
+ /** Allow credentials */
38
+ credentials?: boolean;
39
+ /** Max age for preflight cache */
40
+ maxAge?: number;
41
+ }
42
+ /**
43
+ * Rate limit options
44
+ */
45
+ interface RateLimitOptions {
46
+ /** Time window in milliseconds */
47
+ windowMs?: number;
48
+ /** Max requests per window */
49
+ max?: number;
50
+ /** Message when rate limited */
51
+ message?: string;
52
+ }
53
+ /**
54
+ * API response wrapper
55
+ */
56
+ interface APIResponse<T = unknown> {
57
+ /** Whether the request succeeded */
58
+ success: boolean;
59
+ /** Response data */
60
+ data?: T;
61
+ /** Error message if failed */
62
+ error?: string;
63
+ /** Error code */
64
+ code?: string;
65
+ /** Request timestamp */
66
+ timestamp: number;
67
+ }
68
+ /**
69
+ * Render log query parameters
70
+ */
71
+ interface RenderLogQuery {
72
+ /** Filter by entry type */
73
+ type?: RenderLogEntryType;
74
+ /** Filter entries since timestamp */
75
+ since?: number;
76
+ /** Filter entries until timestamp */
77
+ until?: number;
78
+ /** Limit number of results */
79
+ limit?: number;
80
+ }
81
+ /**
82
+ * Server handler interface
83
+ *
84
+ * Implementations provide these handlers for different frameworks.
85
+ */
86
+ interface UIBridgeServerHandlers {
87
+ getRenderLog: (query?: RenderLogQuery) => Promise<APIResponse<RenderLogEntry[]>>;
88
+ clearRenderLog: () => Promise<APIResponse<void>>;
89
+ captureSnapshot: () => Promise<APIResponse<unknown>>;
90
+ getRenderLogPath: () => Promise<APIResponse<{
91
+ path: string;
92
+ }>>;
93
+ getElements: () => Promise<APIResponse<ControlSnapshot['elements']>>;
94
+ getElement: (id: string) => Promise<APIResponse<ControlSnapshot['elements'][0]>>;
95
+ getElementState: (id: string) => Promise<APIResponse<unknown>>;
96
+ executeElementAction: (id: string, request: ControlActionRequest) => Promise<APIResponse<ControlActionResponse>>;
97
+ getComponents: () => Promise<APIResponse<ControlSnapshot['components']>>;
98
+ getComponent: (id: string) => Promise<APIResponse<ControlSnapshot['components'][0]>>;
99
+ getComponentState: (id: string) => Promise<APIResponse<{
100
+ state: Record<string, unknown>;
101
+ computed: Record<string, unknown>;
102
+ timestamp: number;
103
+ }>>;
104
+ executeComponentAction: (id: string, request: ComponentActionRequest) => Promise<APIResponse<ComponentActionResponse>>;
105
+ find: (request?: FindRequest) => Promise<APIResponse<FindResponse>>;
106
+ /**
107
+ * @deprecated Use find() instead
108
+ */
109
+ discover: (request?: FindRequest) => Promise<APIResponse<FindResponse>>;
110
+ getControlSnapshot: () => Promise<APIResponse<ControlSnapshot>>;
111
+ getWorkflows: () => Promise<APIResponse<ControlSnapshot['workflows']>>;
112
+ runWorkflow: (id: string, request?: WorkflowRunRequest) => Promise<APIResponse<WorkflowRunResponse>>;
113
+ getWorkflowStatus: (runId: string) => Promise<APIResponse<WorkflowRunResponse>>;
114
+ getActionHistory: (limit?: number) => Promise<APIResponse<unknown[]>>;
115
+ getMetrics: () => Promise<APIResponse<unknown>>;
116
+ highlightElement: (id: string) => Promise<APIResponse<void>>;
117
+ getElementTree: () => Promise<APIResponse<unknown>>;
118
+ aiSearch: (criteria: SearchCriteria) => Promise<APIResponse<SearchResponse>>;
119
+ aiExecute: (request: NLActionRequest) => Promise<APIResponse<NLActionResponse>>;
120
+ aiAssert: (request: AssertionRequest) => Promise<APIResponse<AssertionResult>>;
121
+ aiAssertBatch: (request: BatchAssertionRequest) => Promise<APIResponse<BatchAssertionResult>>;
122
+ getSemanticSnapshot: () => Promise<APIResponse<SemanticSnapshot>>;
123
+ getSemanticDiff: (since?: number) => Promise<APIResponse<SemanticDiff | null>>;
124
+ getPageSummary: () => Promise<APIResponse<string>>;
125
+ aiSemanticSearch: (criteria: SemanticSearchCriteria) => Promise<APIResponse<SemanticSearchResponse>>;
126
+ }
127
+ /**
128
+ * Route definition
129
+ */
130
+ interface RouteDefinition {
131
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
132
+ path: string;
133
+ handler: string;
134
+ params?: string[];
135
+ bodyRequired?: boolean;
136
+ }
137
+ /**
138
+ * All UI Bridge routes
139
+ */
140
+ declare const UI_BRIDGE_ROUTES: RouteDefinition[];
141
+ /**
142
+ * WebSocket message types
143
+ */
144
+ type WebSocketMessageType = 'subscribe' | 'unsubscribe' | 'event' | 'snapshot' | 'action' | 'error';
145
+ /**
146
+ * WebSocket message
147
+ */
148
+ interface WebSocketMessage<T = unknown> {
149
+ type: WebSocketMessageType;
150
+ channel?: string;
151
+ data?: T;
152
+ error?: string;
153
+ timestamp: number;
154
+ }
155
+
156
+ export { type APIResponse as A, type CORSOptions as C, type RateLimitOptions as R, type UIBridgeServerConfig as U, type WebSocketMessage as W, type RenderLogQuery as a, type RouteDefinition as b, type UIBridgeServerHandlers as c, UI_BRIDGE_ROUTES as d, type WebSocketMessageType as e };
@@ -0,0 +1,156 @@
1
+ import { U as UIBridgeConfig } from './types-jKVgTI6_.js';
2
+ import { d as ControlSnapshot, b as ControlActionRequest, c as ControlActionResponse, C as ComponentActionRequest, a as ComponentActionResponse, F as FindRequest, g as FindResponse, j as WorkflowRunRequest, k as WorkflowRunResponse } from './types-BkNRILUa.js';
3
+ import { S as SearchCriteria, n as SearchResponse, N as NLActionRequest, l as NLActionResponse, d as AssertionRequest, e as AssertionResult, B as BatchAssertionRequest, g as BatchAssertionResult, t as SemanticSnapshot, p as SemanticDiff, q as SemanticSearchCriteria, r as SemanticSearchResponse } from './types-DfPqwU-i.js';
4
+ import { RenderLogEntryType, RenderLogEntry } from './render-log/index.js';
5
+
6
+ /**
7
+ * UI Bridge Server Types
8
+ *
9
+ * Shared types for server adapters.
10
+ */
11
+
12
+ /**
13
+ * Server configuration
14
+ */
15
+ interface UIBridgeServerConfig extends UIBridgeConfig {
16
+ /** Base path for API routes */
17
+ basePath?: string;
18
+ /** Enable CORS */
19
+ cors?: boolean | CORSOptions;
20
+ /** Authentication middleware */
21
+ authenticate?: (req: unknown) => boolean | Promise<boolean>;
22
+ /** Rate limiting */
23
+ rateLimit?: RateLimitOptions;
24
+ }
25
+ /**
26
+ * CORS options
27
+ */
28
+ interface CORSOptions {
29
+ /** Allowed origins */
30
+ origin?: string | string[] | boolean;
31
+ /** Allowed methods */
32
+ methods?: string[];
33
+ /** Allowed headers */
34
+ headers?: string[];
35
+ /** Expose headers */
36
+ exposeHeaders?: string[];
37
+ /** Allow credentials */
38
+ credentials?: boolean;
39
+ /** Max age for preflight cache */
40
+ maxAge?: number;
41
+ }
42
+ /**
43
+ * Rate limit options
44
+ */
45
+ interface RateLimitOptions {
46
+ /** Time window in milliseconds */
47
+ windowMs?: number;
48
+ /** Max requests per window */
49
+ max?: number;
50
+ /** Message when rate limited */
51
+ message?: string;
52
+ }
53
+ /**
54
+ * API response wrapper
55
+ */
56
+ interface APIResponse<T = unknown> {
57
+ /** Whether the request succeeded */
58
+ success: boolean;
59
+ /** Response data */
60
+ data?: T;
61
+ /** Error message if failed */
62
+ error?: string;
63
+ /** Error code */
64
+ code?: string;
65
+ /** Request timestamp */
66
+ timestamp: number;
67
+ }
68
+ /**
69
+ * Render log query parameters
70
+ */
71
+ interface RenderLogQuery {
72
+ /** Filter by entry type */
73
+ type?: RenderLogEntryType;
74
+ /** Filter entries since timestamp */
75
+ since?: number;
76
+ /** Filter entries until timestamp */
77
+ until?: number;
78
+ /** Limit number of results */
79
+ limit?: number;
80
+ }
81
+ /**
82
+ * Server handler interface
83
+ *
84
+ * Implementations provide these handlers for different frameworks.
85
+ */
86
+ interface UIBridgeServerHandlers {
87
+ getRenderLog: (query?: RenderLogQuery) => Promise<APIResponse<RenderLogEntry[]>>;
88
+ clearRenderLog: () => Promise<APIResponse<void>>;
89
+ captureSnapshot: () => Promise<APIResponse<unknown>>;
90
+ getRenderLogPath: () => Promise<APIResponse<{
91
+ path: string;
92
+ }>>;
93
+ getElements: () => Promise<APIResponse<ControlSnapshot['elements']>>;
94
+ getElement: (id: string) => Promise<APIResponse<ControlSnapshot['elements'][0]>>;
95
+ getElementState: (id: string) => Promise<APIResponse<unknown>>;
96
+ executeElementAction: (id: string, request: ControlActionRequest) => Promise<APIResponse<ControlActionResponse>>;
97
+ getComponents: () => Promise<APIResponse<ControlSnapshot['components']>>;
98
+ getComponent: (id: string) => Promise<APIResponse<ControlSnapshot['components'][0]>>;
99
+ getComponentState: (id: string) => Promise<APIResponse<{
100
+ state: Record<string, unknown>;
101
+ computed: Record<string, unknown>;
102
+ timestamp: number;
103
+ }>>;
104
+ executeComponentAction: (id: string, request: ComponentActionRequest) => Promise<APIResponse<ComponentActionResponse>>;
105
+ find: (request?: FindRequest) => Promise<APIResponse<FindResponse>>;
106
+ /**
107
+ * @deprecated Use find() instead
108
+ */
109
+ discover: (request?: FindRequest) => Promise<APIResponse<FindResponse>>;
110
+ getControlSnapshot: () => Promise<APIResponse<ControlSnapshot>>;
111
+ getWorkflows: () => Promise<APIResponse<ControlSnapshot['workflows']>>;
112
+ runWorkflow: (id: string, request?: WorkflowRunRequest) => Promise<APIResponse<WorkflowRunResponse>>;
113
+ getWorkflowStatus: (runId: string) => Promise<APIResponse<WorkflowRunResponse>>;
114
+ getActionHistory: (limit?: number) => Promise<APIResponse<unknown[]>>;
115
+ getMetrics: () => Promise<APIResponse<unknown>>;
116
+ highlightElement: (id: string) => Promise<APIResponse<void>>;
117
+ getElementTree: () => Promise<APIResponse<unknown>>;
118
+ aiSearch: (criteria: SearchCriteria) => Promise<APIResponse<SearchResponse>>;
119
+ aiExecute: (request: NLActionRequest) => Promise<APIResponse<NLActionResponse>>;
120
+ aiAssert: (request: AssertionRequest) => Promise<APIResponse<AssertionResult>>;
121
+ aiAssertBatch: (request: BatchAssertionRequest) => Promise<APIResponse<BatchAssertionResult>>;
122
+ getSemanticSnapshot: () => Promise<APIResponse<SemanticSnapshot>>;
123
+ getSemanticDiff: (since?: number) => Promise<APIResponse<SemanticDiff | null>>;
124
+ getPageSummary: () => Promise<APIResponse<string>>;
125
+ aiSemanticSearch: (criteria: SemanticSearchCriteria) => Promise<APIResponse<SemanticSearchResponse>>;
126
+ }
127
+ /**
128
+ * Route definition
129
+ */
130
+ interface RouteDefinition {
131
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
132
+ path: string;
133
+ handler: string;
134
+ params?: string[];
135
+ bodyRequired?: boolean;
136
+ }
137
+ /**
138
+ * All UI Bridge routes
139
+ */
140
+ declare const UI_BRIDGE_ROUTES: RouteDefinition[];
141
+ /**
142
+ * WebSocket message types
143
+ */
144
+ type WebSocketMessageType = 'subscribe' | 'unsubscribe' | 'event' | 'snapshot' | 'action' | 'error';
145
+ /**
146
+ * WebSocket message
147
+ */
148
+ interface WebSocketMessage<T = unknown> {
149
+ type: WebSocketMessageType;
150
+ channel?: string;
151
+ data?: T;
152
+ error?: string;
153
+ timestamp: number;
154
+ }
155
+
156
+ export { type APIResponse as A, type CORSOptions as C, type RateLimitOptions as R, type UIBridgeServerConfig as U, type WebSocketMessage as W, type RenderLogQuery as a, type RouteDefinition as b, type UIBridgeServerHandlers as c, UI_BRIDGE_ROUTES as d, type WebSocketMessageType as e };