@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
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { c as UIBridgeServerHandlers, U as UIBridgeServerConfig, W as WebSocketMessage } from './types-B2EfvEaq.js';
|
|
2
|
+
import { j as BridgeEvent } from './types-suaYwWWg.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* WebSocket Handler for UI Bridge Server
|
|
6
|
+
*
|
|
7
|
+
* Handles WebSocket connections and message routing.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* WebSocket-like interface for compatibility
|
|
12
|
+
*/
|
|
13
|
+
interface WebSocketLike {
|
|
14
|
+
send(data: string): void;
|
|
15
|
+
close(): void;
|
|
16
|
+
readyState: number;
|
|
17
|
+
onmessage?: ((event: {
|
|
18
|
+
data: string;
|
|
19
|
+
}) => void) | null;
|
|
20
|
+
onclose?: (() => void) | null;
|
|
21
|
+
onerror?: ((error: unknown) => void) | null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* WebSocket handler for UI Bridge server
|
|
25
|
+
*/
|
|
26
|
+
declare class UIBridgeWSHandler {
|
|
27
|
+
private handlers;
|
|
28
|
+
private clients;
|
|
29
|
+
private verbose;
|
|
30
|
+
private log;
|
|
31
|
+
constructor(handlers: UIBridgeServerHandlers, options?: {
|
|
32
|
+
verbose?: boolean;
|
|
33
|
+
log?: (message: string) => void;
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* Handle new WebSocket connection
|
|
37
|
+
*/
|
|
38
|
+
handleConnection(ws: WebSocketLike): string;
|
|
39
|
+
/**
|
|
40
|
+
* Handle client disconnect
|
|
41
|
+
*/
|
|
42
|
+
handleDisconnect(clientId: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Handle incoming message
|
|
45
|
+
*/
|
|
46
|
+
private handleMessage;
|
|
47
|
+
/**
|
|
48
|
+
* Handle ping message
|
|
49
|
+
*/
|
|
50
|
+
private handlePing;
|
|
51
|
+
/**
|
|
52
|
+
* Handle subscribe message
|
|
53
|
+
*/
|
|
54
|
+
private handleSubscribe;
|
|
55
|
+
/**
|
|
56
|
+
* Handle unsubscribe message
|
|
57
|
+
*/
|
|
58
|
+
private handleUnsubscribe;
|
|
59
|
+
/**
|
|
60
|
+
* Handle find message
|
|
61
|
+
*/
|
|
62
|
+
private handleFind;
|
|
63
|
+
/**
|
|
64
|
+
* Handle getElement message
|
|
65
|
+
*/
|
|
66
|
+
private handleGetElement;
|
|
67
|
+
/**
|
|
68
|
+
* Handle getSnapshot message
|
|
69
|
+
*/
|
|
70
|
+
private handleGetSnapshot;
|
|
71
|
+
/**
|
|
72
|
+
* Handle executeAction message
|
|
73
|
+
*/
|
|
74
|
+
private handleExecuteAction;
|
|
75
|
+
/**
|
|
76
|
+
* Handle executeComponentAction message
|
|
77
|
+
*/
|
|
78
|
+
private handleExecuteComponentAction;
|
|
79
|
+
/**
|
|
80
|
+
* Handle executeWorkflow message
|
|
81
|
+
*/
|
|
82
|
+
private handleExecuteWorkflow;
|
|
83
|
+
/**
|
|
84
|
+
* Broadcast event to all subscribed clients
|
|
85
|
+
*/
|
|
86
|
+
broadcastEvent(event: BridgeEvent): void;
|
|
87
|
+
/**
|
|
88
|
+
* Send message to specific client
|
|
89
|
+
*/
|
|
90
|
+
private sendToClient;
|
|
91
|
+
/**
|
|
92
|
+
* Send response message
|
|
93
|
+
*/
|
|
94
|
+
private sendResponse;
|
|
95
|
+
/**
|
|
96
|
+
* Send error message
|
|
97
|
+
*/
|
|
98
|
+
private sendError;
|
|
99
|
+
/**
|
|
100
|
+
* Get connected client count
|
|
101
|
+
*/
|
|
102
|
+
get clientCount(): number;
|
|
103
|
+
/**
|
|
104
|
+
* Get all connected client IDs
|
|
105
|
+
*/
|
|
106
|
+
get clientIds(): string[];
|
|
107
|
+
/**
|
|
108
|
+
* Disconnect all clients
|
|
109
|
+
*/
|
|
110
|
+
disconnectAll(): void;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Standalone Server
|
|
115
|
+
*
|
|
116
|
+
* Standalone HTTP server for UI Bridge that can run independently.
|
|
117
|
+
* Supports both HTTP and WebSocket connections.
|
|
118
|
+
*/
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Standalone server configuration
|
|
122
|
+
*/
|
|
123
|
+
interface StandaloneServerConfig extends UIBridgeServerConfig {
|
|
124
|
+
/** Host to bind to */
|
|
125
|
+
host?: string;
|
|
126
|
+
/** Port to listen on */
|
|
127
|
+
port?: number;
|
|
128
|
+
/** Enable WebSocket support */
|
|
129
|
+
websocket?: boolean;
|
|
130
|
+
/** WebSocket port (defaults to port) */
|
|
131
|
+
websocketPort?: number;
|
|
132
|
+
/** Logging function */
|
|
133
|
+
log?: (message: string) => void;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Simple HTTP server implementation using Node.js built-in http module
|
|
137
|
+
* with optional WebSocket support.
|
|
138
|
+
*/
|
|
139
|
+
declare class StandaloneServer {
|
|
140
|
+
private server;
|
|
141
|
+
private wsServer;
|
|
142
|
+
private config;
|
|
143
|
+
private handlers;
|
|
144
|
+
private wsHandler;
|
|
145
|
+
private wsConnections;
|
|
146
|
+
constructor(handlers: UIBridgeServerHandlers, config?: StandaloneServerConfig);
|
|
147
|
+
/**
|
|
148
|
+
* Get enabled capabilities based on handlers
|
|
149
|
+
*/
|
|
150
|
+
private getCapabilities;
|
|
151
|
+
/**
|
|
152
|
+
* Start the server
|
|
153
|
+
*/
|
|
154
|
+
start(): Promise<void>;
|
|
155
|
+
/**
|
|
156
|
+
* Start WebSocket server
|
|
157
|
+
*/
|
|
158
|
+
private startWebSocketServer;
|
|
159
|
+
/**
|
|
160
|
+
* Stop the server
|
|
161
|
+
*/
|
|
162
|
+
stop(): Promise<void>;
|
|
163
|
+
/**
|
|
164
|
+
* Handle an HTTP request
|
|
165
|
+
*/
|
|
166
|
+
private handleRequest;
|
|
167
|
+
/**
|
|
168
|
+
* Find a matching route
|
|
169
|
+
*/
|
|
170
|
+
private findRoute;
|
|
171
|
+
/**
|
|
172
|
+
* Extract params from path
|
|
173
|
+
*/
|
|
174
|
+
private extractParams;
|
|
175
|
+
/**
|
|
176
|
+
* Parse request body
|
|
177
|
+
*/
|
|
178
|
+
private parseBody;
|
|
179
|
+
/**
|
|
180
|
+
* Send JSON response
|
|
181
|
+
*/
|
|
182
|
+
private sendJSON;
|
|
183
|
+
/**
|
|
184
|
+
* Broadcast a message to all WebSocket connections (legacy)
|
|
185
|
+
*/
|
|
186
|
+
broadcast(message: WebSocketMessage): void;
|
|
187
|
+
/**
|
|
188
|
+
* Broadcast an event to all subscribed WebSocket clients
|
|
189
|
+
*/
|
|
190
|
+
broadcastEvent(event: BridgeEvent): void;
|
|
191
|
+
/**
|
|
192
|
+
* Get WebSocket handler for direct access
|
|
193
|
+
*/
|
|
194
|
+
getWSHandler(): UIBridgeWSHandler | null;
|
|
195
|
+
/**
|
|
196
|
+
* Get number of connected WebSocket clients
|
|
197
|
+
*/
|
|
198
|
+
get wsClientCount(): number;
|
|
199
|
+
/**
|
|
200
|
+
* Get the server address
|
|
201
|
+
*/
|
|
202
|
+
getAddress(): {
|
|
203
|
+
host: string;
|
|
204
|
+
port: number;
|
|
205
|
+
} | null;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Create and start a standalone server
|
|
209
|
+
*/
|
|
210
|
+
declare function createStandaloneServer(handlers: UIBridgeServerHandlers, config?: StandaloneServerConfig): Promise<StandaloneServer>;
|
|
211
|
+
/**
|
|
212
|
+
* CLI entry point
|
|
213
|
+
*/
|
|
214
|
+
declare function startCLI(handlers: UIBridgeServerHandlers, args?: string[]): Promise<void>;
|
|
215
|
+
|
|
216
|
+
export { StandaloneServer as S, UIBridgeWSHandler as U, type WebSocketLike as W, type StandaloneServerConfig as a, createStandaloneServer as c, startCLI as s };
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { c as UIBridgeServerHandlers, U as UIBridgeServerConfig, W as WebSocketMessage } from './types-gO696T_t.mjs';
|
|
2
|
+
import { j as BridgeEvent } from './types-suaYwWWg.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* WebSocket Handler for UI Bridge Server
|
|
6
|
+
*
|
|
7
|
+
* Handles WebSocket connections and message routing.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* WebSocket-like interface for compatibility
|
|
12
|
+
*/
|
|
13
|
+
interface WebSocketLike {
|
|
14
|
+
send(data: string): void;
|
|
15
|
+
close(): void;
|
|
16
|
+
readyState: number;
|
|
17
|
+
onmessage?: ((event: {
|
|
18
|
+
data: string;
|
|
19
|
+
}) => void) | null;
|
|
20
|
+
onclose?: (() => void) | null;
|
|
21
|
+
onerror?: ((error: unknown) => void) | null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* WebSocket handler for UI Bridge server
|
|
25
|
+
*/
|
|
26
|
+
declare class UIBridgeWSHandler {
|
|
27
|
+
private handlers;
|
|
28
|
+
private clients;
|
|
29
|
+
private verbose;
|
|
30
|
+
private log;
|
|
31
|
+
constructor(handlers: UIBridgeServerHandlers, options?: {
|
|
32
|
+
verbose?: boolean;
|
|
33
|
+
log?: (message: string) => void;
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* Handle new WebSocket connection
|
|
37
|
+
*/
|
|
38
|
+
handleConnection(ws: WebSocketLike): string;
|
|
39
|
+
/**
|
|
40
|
+
* Handle client disconnect
|
|
41
|
+
*/
|
|
42
|
+
handleDisconnect(clientId: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Handle incoming message
|
|
45
|
+
*/
|
|
46
|
+
private handleMessage;
|
|
47
|
+
/**
|
|
48
|
+
* Handle ping message
|
|
49
|
+
*/
|
|
50
|
+
private handlePing;
|
|
51
|
+
/**
|
|
52
|
+
* Handle subscribe message
|
|
53
|
+
*/
|
|
54
|
+
private handleSubscribe;
|
|
55
|
+
/**
|
|
56
|
+
* Handle unsubscribe message
|
|
57
|
+
*/
|
|
58
|
+
private handleUnsubscribe;
|
|
59
|
+
/**
|
|
60
|
+
* Handle find message
|
|
61
|
+
*/
|
|
62
|
+
private handleFind;
|
|
63
|
+
/**
|
|
64
|
+
* Handle getElement message
|
|
65
|
+
*/
|
|
66
|
+
private handleGetElement;
|
|
67
|
+
/**
|
|
68
|
+
* Handle getSnapshot message
|
|
69
|
+
*/
|
|
70
|
+
private handleGetSnapshot;
|
|
71
|
+
/**
|
|
72
|
+
* Handle executeAction message
|
|
73
|
+
*/
|
|
74
|
+
private handleExecuteAction;
|
|
75
|
+
/**
|
|
76
|
+
* Handle executeComponentAction message
|
|
77
|
+
*/
|
|
78
|
+
private handleExecuteComponentAction;
|
|
79
|
+
/**
|
|
80
|
+
* Handle executeWorkflow message
|
|
81
|
+
*/
|
|
82
|
+
private handleExecuteWorkflow;
|
|
83
|
+
/**
|
|
84
|
+
* Broadcast event to all subscribed clients
|
|
85
|
+
*/
|
|
86
|
+
broadcastEvent(event: BridgeEvent): void;
|
|
87
|
+
/**
|
|
88
|
+
* Send message to specific client
|
|
89
|
+
*/
|
|
90
|
+
private sendToClient;
|
|
91
|
+
/**
|
|
92
|
+
* Send response message
|
|
93
|
+
*/
|
|
94
|
+
private sendResponse;
|
|
95
|
+
/**
|
|
96
|
+
* Send error message
|
|
97
|
+
*/
|
|
98
|
+
private sendError;
|
|
99
|
+
/**
|
|
100
|
+
* Get connected client count
|
|
101
|
+
*/
|
|
102
|
+
get clientCount(): number;
|
|
103
|
+
/**
|
|
104
|
+
* Get all connected client IDs
|
|
105
|
+
*/
|
|
106
|
+
get clientIds(): string[];
|
|
107
|
+
/**
|
|
108
|
+
* Disconnect all clients
|
|
109
|
+
*/
|
|
110
|
+
disconnectAll(): void;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Standalone Server
|
|
115
|
+
*
|
|
116
|
+
* Standalone HTTP server for UI Bridge that can run independently.
|
|
117
|
+
* Supports both HTTP and WebSocket connections.
|
|
118
|
+
*/
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Standalone server configuration
|
|
122
|
+
*/
|
|
123
|
+
interface StandaloneServerConfig extends UIBridgeServerConfig {
|
|
124
|
+
/** Host to bind to */
|
|
125
|
+
host?: string;
|
|
126
|
+
/** Port to listen on */
|
|
127
|
+
port?: number;
|
|
128
|
+
/** Enable WebSocket support */
|
|
129
|
+
websocket?: boolean;
|
|
130
|
+
/** WebSocket port (defaults to port) */
|
|
131
|
+
websocketPort?: number;
|
|
132
|
+
/** Logging function */
|
|
133
|
+
log?: (message: string) => void;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Simple HTTP server implementation using Node.js built-in http module
|
|
137
|
+
* with optional WebSocket support.
|
|
138
|
+
*/
|
|
139
|
+
declare class StandaloneServer {
|
|
140
|
+
private server;
|
|
141
|
+
private wsServer;
|
|
142
|
+
private config;
|
|
143
|
+
private handlers;
|
|
144
|
+
private wsHandler;
|
|
145
|
+
private wsConnections;
|
|
146
|
+
constructor(handlers: UIBridgeServerHandlers, config?: StandaloneServerConfig);
|
|
147
|
+
/**
|
|
148
|
+
* Get enabled capabilities based on handlers
|
|
149
|
+
*/
|
|
150
|
+
private getCapabilities;
|
|
151
|
+
/**
|
|
152
|
+
* Start the server
|
|
153
|
+
*/
|
|
154
|
+
start(): Promise<void>;
|
|
155
|
+
/**
|
|
156
|
+
* Start WebSocket server
|
|
157
|
+
*/
|
|
158
|
+
private startWebSocketServer;
|
|
159
|
+
/**
|
|
160
|
+
* Stop the server
|
|
161
|
+
*/
|
|
162
|
+
stop(): Promise<void>;
|
|
163
|
+
/**
|
|
164
|
+
* Handle an HTTP request
|
|
165
|
+
*/
|
|
166
|
+
private handleRequest;
|
|
167
|
+
/**
|
|
168
|
+
* Find a matching route
|
|
169
|
+
*/
|
|
170
|
+
private findRoute;
|
|
171
|
+
/**
|
|
172
|
+
* Extract params from path
|
|
173
|
+
*/
|
|
174
|
+
private extractParams;
|
|
175
|
+
/**
|
|
176
|
+
* Parse request body
|
|
177
|
+
*/
|
|
178
|
+
private parseBody;
|
|
179
|
+
/**
|
|
180
|
+
* Send JSON response
|
|
181
|
+
*/
|
|
182
|
+
private sendJSON;
|
|
183
|
+
/**
|
|
184
|
+
* Broadcast a message to all WebSocket connections (legacy)
|
|
185
|
+
*/
|
|
186
|
+
broadcast(message: WebSocketMessage): void;
|
|
187
|
+
/**
|
|
188
|
+
* Broadcast an event to all subscribed WebSocket clients
|
|
189
|
+
*/
|
|
190
|
+
broadcastEvent(event: BridgeEvent): void;
|
|
191
|
+
/**
|
|
192
|
+
* Get WebSocket handler for direct access
|
|
193
|
+
*/
|
|
194
|
+
getWSHandler(): UIBridgeWSHandler | null;
|
|
195
|
+
/**
|
|
196
|
+
* Get number of connected WebSocket clients
|
|
197
|
+
*/
|
|
198
|
+
get wsClientCount(): number;
|
|
199
|
+
/**
|
|
200
|
+
* Get the server address
|
|
201
|
+
*/
|
|
202
|
+
getAddress(): {
|
|
203
|
+
host: string;
|
|
204
|
+
port: number;
|
|
205
|
+
} | null;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Create and start a standalone server
|
|
209
|
+
*/
|
|
210
|
+
declare function createStandaloneServer(handlers: UIBridgeServerHandlers, config?: StandaloneServerConfig): Promise<StandaloneServer>;
|
|
211
|
+
/**
|
|
212
|
+
* CLI entry point
|
|
213
|
+
*/
|
|
214
|
+
declare function startCLI(handlers: UIBridgeServerHandlers, args?: string[]): Promise<void>;
|
|
215
|
+
|
|
216
|
+
export { StandaloneServer as S, UIBridgeWSHandler as U, type WebSocketLike as W, type StandaloneServerConfig as a, createStandaloneServer as c, startCLI as s };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI Bridge SWC Plugin Configuration
|
|
3
|
+
*/
|
|
4
|
+
interface UIBridgeSwcPluginConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Elements to automatically instrument
|
|
7
|
+
* @default ['button', 'input', 'select', 'textarea', 'a', 'form']
|
|
8
|
+
*/
|
|
9
|
+
elements?: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Prefix for generated IDs
|
|
12
|
+
* @default 'ui'
|
|
13
|
+
*/
|
|
14
|
+
idPrefix?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Attribute name for the generated ID
|
|
17
|
+
* @default 'data-ui-id'
|
|
18
|
+
*/
|
|
19
|
+
idAttribute?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Attribute name for aliases
|
|
22
|
+
* @default 'data-ui-aliases'
|
|
23
|
+
*/
|
|
24
|
+
aliasesAttribute?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Attribute name for element type
|
|
27
|
+
* @default 'data-ui-type'
|
|
28
|
+
*/
|
|
29
|
+
typeAttribute?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Generate aliases from text content
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
generateAliases?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Include component name in generated ID
|
|
37
|
+
* @default true
|
|
38
|
+
*/
|
|
39
|
+
includeComponentName?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Include file path in generated ID
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
includeFilePath?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Hash the generated ID for shorter strings
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
hashIds?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Maximum alias count per element
|
|
52
|
+
* @default 5
|
|
53
|
+
*/
|
|
54
|
+
maxAliases?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Skip elements that already have data-ui-id
|
|
57
|
+
* @default true
|
|
58
|
+
*/
|
|
59
|
+
skipExisting?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Only instrument elements inside components with specific names
|
|
62
|
+
* @default []
|
|
63
|
+
*/
|
|
64
|
+
onlyInComponents?: string[];
|
|
65
|
+
/**
|
|
66
|
+
* Skip instrumentation for elements inside these components
|
|
67
|
+
* @default []
|
|
68
|
+
*/
|
|
69
|
+
skipInComponents?: string[];
|
|
70
|
+
/**
|
|
71
|
+
* Enable verbose logging during build
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
verbose?: boolean;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
declare const pluginPath: string;
|
|
78
|
+
|
|
79
|
+
export { type UIBridgeSwcPluginConfig, pluginPath as default };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI Bridge SWC Plugin Configuration
|
|
3
|
+
*/
|
|
4
|
+
interface UIBridgeSwcPluginConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Elements to automatically instrument
|
|
7
|
+
* @default ['button', 'input', 'select', 'textarea', 'a', 'form']
|
|
8
|
+
*/
|
|
9
|
+
elements?: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Prefix for generated IDs
|
|
12
|
+
* @default 'ui'
|
|
13
|
+
*/
|
|
14
|
+
idPrefix?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Attribute name for the generated ID
|
|
17
|
+
* @default 'data-ui-id'
|
|
18
|
+
*/
|
|
19
|
+
idAttribute?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Attribute name for aliases
|
|
22
|
+
* @default 'data-ui-aliases'
|
|
23
|
+
*/
|
|
24
|
+
aliasesAttribute?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Attribute name for element type
|
|
27
|
+
* @default 'data-ui-type'
|
|
28
|
+
*/
|
|
29
|
+
typeAttribute?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Generate aliases from text content
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
generateAliases?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Include component name in generated ID
|
|
37
|
+
* @default true
|
|
38
|
+
*/
|
|
39
|
+
includeComponentName?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Include file path in generated ID
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
includeFilePath?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Hash the generated ID for shorter strings
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
hashIds?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Maximum alias count per element
|
|
52
|
+
* @default 5
|
|
53
|
+
*/
|
|
54
|
+
maxAliases?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Skip elements that already have data-ui-id
|
|
57
|
+
* @default true
|
|
58
|
+
*/
|
|
59
|
+
skipExisting?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Only instrument elements inside components with specific names
|
|
62
|
+
* @default []
|
|
63
|
+
*/
|
|
64
|
+
onlyInComponents?: string[];
|
|
65
|
+
/**
|
|
66
|
+
* Skip instrumentation for elements inside these components
|
|
67
|
+
* @default []
|
|
68
|
+
*/
|
|
69
|
+
skipInComponents?: string[];
|
|
70
|
+
/**
|
|
71
|
+
* Enable verbose logging during build
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
verbose?: boolean;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
declare const pluginPath: string;
|
|
78
|
+
|
|
79
|
+
export { type UIBridgeSwcPluginConfig, pluginPath as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var path = require('path');
|
|
4
|
+
|
|
5
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
|
+
|
|
7
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
8
|
+
|
|
9
|
+
// src/swc-plugin/index.ts
|
|
10
|
+
var pluginPath = path__default.default.join(__dirname, "..", "..", "swc-plugin-wasm", "ui_bridge_swc_plugin.wasm");
|
|
11
|
+
var swc_plugin_default = pluginPath;
|
|
12
|
+
|
|
13
|
+
module.exports = swc_plugin_default;
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/swc-plugin/index.ts"],"names":["path"],"mappings":";;;;;;;;;AAqBA,IAAM,aAAaA,qBAAA,CAAK,IAAA,CAAK,WAAW,IAAA,EAAM,IAAA,EAAM,mBAAmB,2BAA2B,CAAA;AAElG,IAAO,kBAAA,GAAQ","file":"index.js","sourcesContent":["/**\n * SWC Plugin for UI Bridge\n *\n * Provides the path to the pre-built WASM plugin binary.\n *\n * @example\n * ```js\n * // next.config.js\n * const swcPluginPath = require('@qontinui/ui-bridge/swc-plugin').default;\n *\n * module.exports = {\n * experimental: {\n * swcPlugins: [[swcPluginPath, { elements: ['button', 'input'] }]]\n * }\n * };\n * ```\n */\nimport path from 'path';\n\nexport type { UIBridgeSwcPluginConfig } from './types';\n\nconst pluginPath = path.join(__dirname, '..', '..', 'swc-plugin-wasm', 'ui_bridge_swc_plugin.wasm');\n\nexport default pluginPath;\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
|
|
3
|
+
// src/swc-plugin/index.ts
|
|
4
|
+
var pluginPath = path.join(__dirname, "..", "..", "swc-plugin-wasm", "ui_bridge_swc_plugin.wasm");
|
|
5
|
+
var swc_plugin_default = pluginPath;
|
|
6
|
+
|
|
7
|
+
export { swc_plugin_default as default };
|
|
8
|
+
//# sourceMappingURL=index.mjs.map
|
|
9
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/swc-plugin/index.ts"],"names":[],"mappings":";;;AAqBA,IAAM,aAAa,IAAA,CAAK,IAAA,CAAK,WAAW,IAAA,EAAM,IAAA,EAAM,mBAAmB,2BAA2B,CAAA;AAElG,IAAO,kBAAA,GAAQ","file":"index.mjs","sourcesContent":["/**\n * SWC Plugin for UI Bridge\n *\n * Provides the path to the pre-built WASM plugin binary.\n *\n * @example\n * ```js\n * // next.config.js\n * const swcPluginPath = require('@qontinui/ui-bridge/swc-plugin').default;\n *\n * module.exports = {\n * experimental: {\n * swcPlugins: [[swcPluginPath, { elements: ['button', 'input'] }]]\n * }\n * };\n * ```\n */\nimport path from 'path';\n\nexport type { UIBridgeSwcPluginConfig } from './types';\n\nconst pluginPath = path.join(__dirname, '..', '..', 'swc-plugin-wasm', 'ui_bridge_swc_plugin.wasm');\n\nexport default pluginPath;\n"]}
|