@qontinui/ui-bridge 0.18.0 → 0.19.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.
- package/dist/{change-observer-DMXmff2q.d.mts → change-observer-BPtZll6d.d.mts} +1 -1
- package/dist/{change-observer-DWhgnunJ.d.ts → change-observer-D0aEcwCl.d.ts} +1 -1
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/injected/bundle.global.js +1 -1
- package/dist/{nextjs-C1cIi_zY.d.ts → nextjs-BLvmgmnW.d.ts} +1 -1
- package/dist/{nextjs-BN5L-0yi.d.mts → nextjs-qQe7vyS4.d.mts} +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/index.mjs +1 -1
- package/dist/server/express.d.mts +1 -1
- package/dist/server/express.d.ts +1 -1
- package/dist/server/express.js +5 -0
- package/dist/server/express.js.map +1 -1
- package/dist/server/express.mjs +5 -0
- package/dist/server/express.mjs.map +1 -1
- package/dist/server/handlers.d.mts +1 -1
- package/dist/server/handlers.d.ts +1 -1
- package/dist/server/handlers.js +6 -0
- package/dist/server/handlers.js.map +1 -1
- package/dist/server/handlers.mjs +6 -0
- package/dist/server/handlers.mjs.map +1 -1
- package/dist/server/index.d.mts +92 -9
- package/dist/server/index.d.ts +92 -9
- package/dist/server/index.js +33 -0
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +33 -1
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/nextjs.d.mts +2 -2
- package/dist/server/nextjs.d.ts +2 -2
- package/dist/server/nextjs.js +11 -0
- package/dist/server/nextjs.js.map +1 -1
- package/dist/server/nextjs.mjs +11 -0
- package/dist/server/nextjs.mjs.map +1 -1
- package/dist/server/standalone.d.mts +3 -3
- package/dist/server/standalone.d.ts +3 -3
- package/dist/server/standalone.js +5 -0
- package/dist/server/standalone.js.map +1 -1
- package/dist/server/standalone.mjs +5 -0
- package/dist/server/standalone.mjs.map +1 -1
- package/dist/{standalone-7VEHUTla.d.ts → standalone-SkUUJ8sc.d.ts} +2 -2
- package/dist/{standalone-DCGkT2Ad.d.mts → standalone-u-N_N3Wl.d.mts} +2 -2
- package/dist/{types-DTGf8Noz.d.mts → types-DNc31VlO.d.mts} +45 -1
- package/dist/{types-DP4N3eYZ.d.ts → types-DmMT2yMs.d.ts} +45 -1
- package/package.json +1 -1
package/dist/server/index.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { a as UIBridgeServerHandlers } from '../types-
|
|
2
|
-
export { A as APIResponse, B as BrowserEventsResponse, C as CORSOptions, b as CapabilitiesResponse, c as ControlBatchRequest, d as ControlBatchResponse, e as ControlBatchStep, f as ControlBatchStepResult, D as DOMChangeEvent, E as ElementConditionSelector, g as ElementExpectRequest, h as ElementExpectResponse, i as EndpointCategory, j as EndpointInfo,
|
|
1
|
+
import { a as UIBridgeServerHandlers, H as HandlerContext } from '../types-DNc31VlO.mjs';
|
|
2
|
+
export { A as APIResponse, B as BrowserEventsResponse, C as CORSOptions, b as CapabilitiesResponse, c as ControlBatchRequest, d as ControlBatchResponse, e as ControlBatchStep, f as ControlBatchStepResult, D as DOMChangeEvent, E as ElementConditionSelector, g as ElementExpectRequest, h as ElementExpectResponse, i as EndpointCategory, j as EndpointInfo, I as INTERACTION_RELAY_COMMAND_ACTIONS, k as InteractionRelayCommandAction, P as PageEvaluateRequest, R as RateLimitOptions, l as RenderLogQuery, m as RouteDefinition, n as RunnerWindow, o as RunnerWindowsList, S as SpawnHeadlessRequest, p as SpawnHeadlessResponse, q as StateSummary, U as UIBridgeServerConfig, r as UI_BRIDGE_ROUTES, s as WaitForElementByConditionRequest, t as WaitForElementByConditionResponse, u as WaitForElementPredicate, v as WaitForElementRequest, w as WaitForElementSuccessResponse, x as WaitForRouteChangeRequest, y as WaitForRouteChangeResponse, W as WebSocketMessage, z as WebSocketMessageType } from '../types-DNc31VlO.mjs';
|
|
3
3
|
export { ActionExecutorLike, CreateHandlersConfig, RegistryLike, closeAllSpawnedHeadlessTabs, createAIHandlers, createHandlers } from './handlers.mjs';
|
|
4
4
|
export { ExpressAdapterConfig, createExpressApp, createExpressRouter, uiBridgeMiddleware } from './express.mjs';
|
|
5
|
-
import { C as CommandRelay } from '../nextjs-
|
|
6
|
-
export { a as CommandListener, b as CommandRelayOptions, N as NextJSAdapterConfig, c as NextRouteHandler, P as PendingCommand, Q as QueuedCommand, R as RedisRelayBus, d as RelayBus, e as RelayCommandEnvelope, f as RelayResponseEnvelope, T as TabInfo, g as TabListener, h as TabRoutingError, i as TransportDiagnostics, W as WebSocketClient, j as createControlHandlers, k as createDebugHandlers, l as createNextRouteHandlers, m as createRedisRelayBus, n as createRenderLogHandlers, o as createUIBridgeHandler } from '../nextjs-
|
|
7
|
-
import { U as UIBridgeWSHandler } from '../standalone-
|
|
8
|
-
export { S as StandaloneServer, a as StandaloneServerConfig, W as WebSocketLike, c as createStandaloneServer, s as startCLI } from '../standalone-
|
|
9
|
-
import { e as BridgeEvent, i as AnyCapturedEvent } from '../types-DnqZodFb.mjs';
|
|
5
|
+
import { C as CommandRelay } from '../nextjs-qQe7vyS4.mjs';
|
|
6
|
+
export { a as CommandListener, b as CommandRelayOptions, N as NextJSAdapterConfig, c as NextRouteHandler, P as PendingCommand, Q as QueuedCommand, R as RedisRelayBus, d as RelayBus, e as RelayCommandEnvelope, f as RelayResponseEnvelope, T as TabInfo, g as TabListener, h as TabRoutingError, i as TransportDiagnostics, W as WebSocketClient, j as createControlHandlers, k as createDebugHandlers, l as createNextRouteHandlers, m as createRedisRelayBus, n as createRenderLogHandlers, o as createUIBridgeHandler } from '../nextjs-qQe7vyS4.mjs';
|
|
7
|
+
import { U as UIBridgeWSHandler } from '../standalone-u-N_N3Wl.mjs';
|
|
8
|
+
export { S as StandaloneServer, a as StandaloneServerConfig, W as WebSocketLike, c as createStandaloneServer, s as startCLI } from '../standalone-u-N_N3Wl.mjs';
|
|
9
|
+
import { e as BridgeEvent, i as AnyCapturedEvent, Q as ControlActionRequest } from '../types-DnqZodFb.mjs';
|
|
10
10
|
import { B as BrowserEventStream, S as StreamSubscription } from '../ws-streaming-BzumSnWw.mjs';
|
|
11
11
|
export { S as SSEManager } from '../sse-handler-BE5cyXF7.mjs';
|
|
12
12
|
import '../codes.generated-CXeSH-M4.mjs';
|
|
@@ -24,7 +24,7 @@ import '../navigation-adapter-D0eod-Ve.mjs';
|
|
|
24
24
|
import '../drag-drop-detector-Baq_Ixcc.mjs';
|
|
25
25
|
import '../annotations/index.mjs';
|
|
26
26
|
import 'express';
|
|
27
|
-
import '../change-observer-
|
|
27
|
+
import '../change-observer-BPtZll6d.mjs';
|
|
28
28
|
|
|
29
29
|
interface WSStreamAdapterConfig {
|
|
30
30
|
/** Minimum severity to forward (default: 'warning') */
|
|
@@ -178,6 +178,89 @@ interface RelayHandlersOptions {
|
|
|
178
178
|
*/
|
|
179
179
|
declare function createRelayHandlers(relay: CommandRelay, options?: RelayHandlersOptions): UIBridgeServerHandlers;
|
|
180
180
|
|
|
181
|
+
/**
|
|
182
|
+
* Window-scoped client facade (plan 2026-06-07-multi-window-sdk-automation,
|
|
183
|
+
* Phase 3).
|
|
184
|
+
*
|
|
185
|
+
* `windowScope(bridge, 'term-2')` pre-binds the window-targetable SDK methods to
|
|
186
|
+
* a single runner pop-out window, so a caller driving one window doesn't repeat
|
|
187
|
+
* (and can't typo) `windowLabel` on every call:
|
|
188
|
+
*
|
|
189
|
+
* ```ts
|
|
190
|
+
* const term = windowScope(handlers, 'term-2');
|
|
191
|
+
* await term.evaluate({ expression: 'document.title' });
|
|
192
|
+
* await term.getElements({ text: 'Save' });
|
|
193
|
+
* await term.executeAction('btn-save', { action: 'click' });
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* It is pure sugar over the Phase-1 per-call `windowLabel` option — ONE code
|
|
197
|
+
* path. `windowScope(bridge, label).evaluate(req)` is exactly
|
|
198
|
+
* `bridge.pageEvaluate({ ...req, windowLabel: label })`, so there is no
|
|
199
|
+
* divergent behavior to reason about, and not using the scope (or passing a
|
|
200
|
+
* label of `'main'`) is byte-identical to a bare call. Only the window-
|
|
201
|
+
* targetable methods are exposed — you cannot call a non-targetable method on a
|
|
202
|
+
* window scope and get a silent no-op.
|
|
203
|
+
*
|
|
204
|
+
* The read/convenience family (`readValue`/`typeInto`/`clickByText`/
|
|
205
|
+
* `clickBySelector`/`findByText`) is included as of Phase 4 — the runner now
|
|
206
|
+
* honors `windowLabel` (read from the body) on those routes, so scoping them is
|
|
207
|
+
* honest end-to-end.
|
|
208
|
+
*/
|
|
209
|
+
|
|
210
|
+
/** Options accepted by `getElements`, minus the now-implicit `windowLabel`. */
|
|
211
|
+
type ScopedGetElementsOptions = Omit<NonNullable<Parameters<UIBridgeServerHandlers['getElements']>[0]>, 'windowLabel'>;
|
|
212
|
+
/**
|
|
213
|
+
* Args for a scoped `evaluate` — the JS expression plus any extra body fields,
|
|
214
|
+
* minus the now-implicit `windowLabel`. Spelled out rather than
|
|
215
|
+
* `Omit<PageEvaluateRequest, 'windowLabel'>` because `PageEvaluateRequest`'s
|
|
216
|
+
* index signature defeats `Omit` (it would drop the required `expression`).
|
|
217
|
+
*/
|
|
218
|
+
type ScopedEvaluateRequest = {
|
|
219
|
+
expression: string;
|
|
220
|
+
[key: string]: unknown;
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* The window-targetable subset of the SDK, pre-bound to one runner window.
|
|
224
|
+
* Returned by {@link windowScope}.
|
|
225
|
+
*/
|
|
226
|
+
interface WindowScopedBridge {
|
|
227
|
+
/** The window label every call on this scope targets. */
|
|
228
|
+
readonly windowLabel: string;
|
|
229
|
+
/**
|
|
230
|
+
* Evaluate a JS expression in the bound window. Delegates to `pageEvaluate`
|
|
231
|
+
* with `windowLabel` injected.
|
|
232
|
+
*/
|
|
233
|
+
evaluate(request: ScopedEvaluateRequest, context?: HandlerContext): ReturnType<UIBridgeServerHandlers['pageEvaluate']>;
|
|
234
|
+
/**
|
|
235
|
+
* Snapshot elements from the bound window. Delegates to `getElements` with
|
|
236
|
+
* `windowLabel` injected.
|
|
237
|
+
*/
|
|
238
|
+
getElements(options?: ScopedGetElementsOptions, context?: HandlerContext): ReturnType<UIBridgeServerHandlers['getElements']>;
|
|
239
|
+
/**
|
|
240
|
+
* Execute an action on an element in the bound window. Delegates to
|
|
241
|
+
* `executeElementAction` with `windowLabel` injected.
|
|
242
|
+
*/
|
|
243
|
+
executeAction(id: string, request: Omit<ControlActionRequest, 'windowLabel'>, context?: HandlerContext): ReturnType<UIBridgeServerHandlers['executeElementAction']>;
|
|
244
|
+
/** Read an element's value in the bound window. Delegates to `readValue`. */
|
|
245
|
+
readValue(request: Omit<Parameters<UIBridgeServerHandlers['readValue']>[0], 'windowLabel'>, context?: HandlerContext): ReturnType<UIBridgeServerHandlers['readValue']>;
|
|
246
|
+
/** Type text into an element in the bound window. Delegates to `typeInto`. */
|
|
247
|
+
typeInto(request: Omit<Parameters<UIBridgeServerHandlers['typeInto']>[0], 'windowLabel'>, context?: HandlerContext): ReturnType<UIBridgeServerHandlers['typeInto']>;
|
|
248
|
+
/** Click an element by visible text in the bound window. Delegates to `clickByText`. */
|
|
249
|
+
clickByText(request: Omit<Parameters<UIBridgeServerHandlers['clickByText']>[0], 'windowLabel'>, context?: HandlerContext): ReturnType<UIBridgeServerHandlers['clickByText']>;
|
|
250
|
+
/** Click an element by CSS selector in the bound window. Delegates to `clickBySelector`. */
|
|
251
|
+
clickBySelector(request: Omit<Parameters<UIBridgeServerHandlers['clickBySelector']>[0], 'windowLabel'>, context?: HandlerContext): ReturnType<UIBridgeServerHandlers['clickBySelector']>;
|
|
252
|
+
/** Find elements by visible text in the bound window. Delegates to `findByText`. */
|
|
253
|
+
findByText(request: Omit<Parameters<UIBridgeServerHandlers['findByText']>[0], 'windowLabel'>, context?: HandlerContext): ReturnType<UIBridgeServerHandlers['findByText']>;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Pre-bind the window-targetable methods of a `UIBridgeServerHandlers` to a
|
|
257
|
+
* single runner window. See the module docs for the contract.
|
|
258
|
+
*
|
|
259
|
+
* @param handlers - the bridge handlers (e.g. from `createRelayHandlers`).
|
|
260
|
+
* @param windowLabel - the target window's label (discover via `listWindows()`).
|
|
261
|
+
*/
|
|
262
|
+
declare function windowScope(handlers: UIBridgeServerHandlers, windowLabel: string): WindowScopedBridge;
|
|
263
|
+
|
|
181
264
|
/**
|
|
182
265
|
* Chrome DevTools Protocol Tab Discovery
|
|
183
266
|
*
|
|
@@ -309,4 +392,4 @@ interface ElementSelector {
|
|
|
309
392
|
*/
|
|
310
393
|
declare function matchesElementSelector(el: MatchableElement, selector: ElementSelector): boolean;
|
|
311
394
|
|
|
312
|
-
export { CDPTabDiscovery, type CDPTabsConfig, type CDPTarget, CommandRelay, type ElementSelector, type MatchableElement, type RelayHandlersOptions, UIBridgeServerHandlers, UIBridgeWSHandler, WSStreamAdapter, type WSStreamAdapterConfig, createRelayHandlers, createWSStreamBroadcast, matchesElementSelector };
|
|
395
|
+
export { CDPTabDiscovery, type CDPTabsConfig, type CDPTarget, CommandRelay, type ElementSelector, HandlerContext, type MatchableElement, type RelayHandlersOptions, UIBridgeServerHandlers, UIBridgeWSHandler, WSStreamAdapter, type WSStreamAdapterConfig, type WindowScopedBridge, createRelayHandlers, createWSStreamBroadcast, matchesElementSelector, windowScope };
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { a as UIBridgeServerHandlers } from '../types-
|
|
2
|
-
export { A as APIResponse, B as BrowserEventsResponse, C as CORSOptions, b as CapabilitiesResponse, c as ControlBatchRequest, d as ControlBatchResponse, e as ControlBatchStep, f as ControlBatchStepResult, D as DOMChangeEvent, E as ElementConditionSelector, g as ElementExpectRequest, h as ElementExpectResponse, i as EndpointCategory, j as EndpointInfo,
|
|
1
|
+
import { a as UIBridgeServerHandlers, H as HandlerContext } from '../types-DmMT2yMs.js';
|
|
2
|
+
export { A as APIResponse, B as BrowserEventsResponse, C as CORSOptions, b as CapabilitiesResponse, c as ControlBatchRequest, d as ControlBatchResponse, e as ControlBatchStep, f as ControlBatchStepResult, D as DOMChangeEvent, E as ElementConditionSelector, g as ElementExpectRequest, h as ElementExpectResponse, i as EndpointCategory, j as EndpointInfo, I as INTERACTION_RELAY_COMMAND_ACTIONS, k as InteractionRelayCommandAction, P as PageEvaluateRequest, R as RateLimitOptions, l as RenderLogQuery, m as RouteDefinition, n as RunnerWindow, o as RunnerWindowsList, S as SpawnHeadlessRequest, p as SpawnHeadlessResponse, q as StateSummary, U as UIBridgeServerConfig, r as UI_BRIDGE_ROUTES, s as WaitForElementByConditionRequest, t as WaitForElementByConditionResponse, u as WaitForElementPredicate, v as WaitForElementRequest, w as WaitForElementSuccessResponse, x as WaitForRouteChangeRequest, y as WaitForRouteChangeResponse, W as WebSocketMessage, z as WebSocketMessageType } from '../types-DmMT2yMs.js';
|
|
3
3
|
export { ActionExecutorLike, CreateHandlersConfig, RegistryLike, closeAllSpawnedHeadlessTabs, createAIHandlers, createHandlers } from './handlers.js';
|
|
4
4
|
export { ExpressAdapterConfig, createExpressApp, createExpressRouter, uiBridgeMiddleware } from './express.js';
|
|
5
|
-
import { C as CommandRelay } from '../nextjs-
|
|
6
|
-
export { a as CommandListener, b as CommandRelayOptions, N as NextJSAdapterConfig, c as NextRouteHandler, P as PendingCommand, Q as QueuedCommand, R as RedisRelayBus, d as RelayBus, e as RelayCommandEnvelope, f as RelayResponseEnvelope, T as TabInfo, g as TabListener, h as TabRoutingError, i as TransportDiagnostics, W as WebSocketClient, j as createControlHandlers, k as createDebugHandlers, l as createNextRouteHandlers, m as createRedisRelayBus, n as createRenderLogHandlers, o as createUIBridgeHandler } from '../nextjs-
|
|
7
|
-
import { U as UIBridgeWSHandler } from '../standalone-
|
|
8
|
-
export { S as StandaloneServer, a as StandaloneServerConfig, W as WebSocketLike, c as createStandaloneServer, s as startCLI } from '../standalone-
|
|
9
|
-
import { e as BridgeEvent, i as AnyCapturedEvent } from '../types-Chf3cfrT.js';
|
|
5
|
+
import { C as CommandRelay } from '../nextjs-BLvmgmnW.js';
|
|
6
|
+
export { a as CommandListener, b as CommandRelayOptions, N as NextJSAdapterConfig, c as NextRouteHandler, P as PendingCommand, Q as QueuedCommand, R as RedisRelayBus, d as RelayBus, e as RelayCommandEnvelope, f as RelayResponseEnvelope, T as TabInfo, g as TabListener, h as TabRoutingError, i as TransportDiagnostics, W as WebSocketClient, j as createControlHandlers, k as createDebugHandlers, l as createNextRouteHandlers, m as createRedisRelayBus, n as createRenderLogHandlers, o as createUIBridgeHandler } from '../nextjs-BLvmgmnW.js';
|
|
7
|
+
import { U as UIBridgeWSHandler } from '../standalone-SkUUJ8sc.js';
|
|
8
|
+
export { S as StandaloneServer, a as StandaloneServerConfig, W as WebSocketLike, c as createStandaloneServer, s as startCLI } from '../standalone-SkUUJ8sc.js';
|
|
9
|
+
import { e as BridgeEvent, i as AnyCapturedEvent, Q as ControlActionRequest } from '../types-Chf3cfrT.js';
|
|
10
10
|
import { B as BrowserEventStream, S as StreamSubscription } from '../ws-streaming-DweATXes.js';
|
|
11
11
|
export { S as SSEManager } from '../sse-handler-Bw_4h2AN.js';
|
|
12
12
|
import '../codes.generated-CXeSH-M4.js';
|
|
@@ -24,7 +24,7 @@ import '../navigation-adapter-D0eod-Ve.js';
|
|
|
24
24
|
import '../drag-drop-detector-gMHP_QIg.js';
|
|
25
25
|
import '../annotations/index.js';
|
|
26
26
|
import 'express';
|
|
27
|
-
import '../change-observer-
|
|
27
|
+
import '../change-observer-D0aEcwCl.js';
|
|
28
28
|
|
|
29
29
|
interface WSStreamAdapterConfig {
|
|
30
30
|
/** Minimum severity to forward (default: 'warning') */
|
|
@@ -178,6 +178,89 @@ interface RelayHandlersOptions {
|
|
|
178
178
|
*/
|
|
179
179
|
declare function createRelayHandlers(relay: CommandRelay, options?: RelayHandlersOptions): UIBridgeServerHandlers;
|
|
180
180
|
|
|
181
|
+
/**
|
|
182
|
+
* Window-scoped client facade (plan 2026-06-07-multi-window-sdk-automation,
|
|
183
|
+
* Phase 3).
|
|
184
|
+
*
|
|
185
|
+
* `windowScope(bridge, 'term-2')` pre-binds the window-targetable SDK methods to
|
|
186
|
+
* a single runner pop-out window, so a caller driving one window doesn't repeat
|
|
187
|
+
* (and can't typo) `windowLabel` on every call:
|
|
188
|
+
*
|
|
189
|
+
* ```ts
|
|
190
|
+
* const term = windowScope(handlers, 'term-2');
|
|
191
|
+
* await term.evaluate({ expression: 'document.title' });
|
|
192
|
+
* await term.getElements({ text: 'Save' });
|
|
193
|
+
* await term.executeAction('btn-save', { action: 'click' });
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* It is pure sugar over the Phase-1 per-call `windowLabel` option — ONE code
|
|
197
|
+
* path. `windowScope(bridge, label).evaluate(req)` is exactly
|
|
198
|
+
* `bridge.pageEvaluate({ ...req, windowLabel: label })`, so there is no
|
|
199
|
+
* divergent behavior to reason about, and not using the scope (or passing a
|
|
200
|
+
* label of `'main'`) is byte-identical to a bare call. Only the window-
|
|
201
|
+
* targetable methods are exposed — you cannot call a non-targetable method on a
|
|
202
|
+
* window scope and get a silent no-op.
|
|
203
|
+
*
|
|
204
|
+
* The read/convenience family (`readValue`/`typeInto`/`clickByText`/
|
|
205
|
+
* `clickBySelector`/`findByText`) is included as of Phase 4 — the runner now
|
|
206
|
+
* honors `windowLabel` (read from the body) on those routes, so scoping them is
|
|
207
|
+
* honest end-to-end.
|
|
208
|
+
*/
|
|
209
|
+
|
|
210
|
+
/** Options accepted by `getElements`, minus the now-implicit `windowLabel`. */
|
|
211
|
+
type ScopedGetElementsOptions = Omit<NonNullable<Parameters<UIBridgeServerHandlers['getElements']>[0]>, 'windowLabel'>;
|
|
212
|
+
/**
|
|
213
|
+
* Args for a scoped `evaluate` — the JS expression plus any extra body fields,
|
|
214
|
+
* minus the now-implicit `windowLabel`. Spelled out rather than
|
|
215
|
+
* `Omit<PageEvaluateRequest, 'windowLabel'>` because `PageEvaluateRequest`'s
|
|
216
|
+
* index signature defeats `Omit` (it would drop the required `expression`).
|
|
217
|
+
*/
|
|
218
|
+
type ScopedEvaluateRequest = {
|
|
219
|
+
expression: string;
|
|
220
|
+
[key: string]: unknown;
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* The window-targetable subset of the SDK, pre-bound to one runner window.
|
|
224
|
+
* Returned by {@link windowScope}.
|
|
225
|
+
*/
|
|
226
|
+
interface WindowScopedBridge {
|
|
227
|
+
/** The window label every call on this scope targets. */
|
|
228
|
+
readonly windowLabel: string;
|
|
229
|
+
/**
|
|
230
|
+
* Evaluate a JS expression in the bound window. Delegates to `pageEvaluate`
|
|
231
|
+
* with `windowLabel` injected.
|
|
232
|
+
*/
|
|
233
|
+
evaluate(request: ScopedEvaluateRequest, context?: HandlerContext): ReturnType<UIBridgeServerHandlers['pageEvaluate']>;
|
|
234
|
+
/**
|
|
235
|
+
* Snapshot elements from the bound window. Delegates to `getElements` with
|
|
236
|
+
* `windowLabel` injected.
|
|
237
|
+
*/
|
|
238
|
+
getElements(options?: ScopedGetElementsOptions, context?: HandlerContext): ReturnType<UIBridgeServerHandlers['getElements']>;
|
|
239
|
+
/**
|
|
240
|
+
* Execute an action on an element in the bound window. Delegates to
|
|
241
|
+
* `executeElementAction` with `windowLabel` injected.
|
|
242
|
+
*/
|
|
243
|
+
executeAction(id: string, request: Omit<ControlActionRequest, 'windowLabel'>, context?: HandlerContext): ReturnType<UIBridgeServerHandlers['executeElementAction']>;
|
|
244
|
+
/** Read an element's value in the bound window. Delegates to `readValue`. */
|
|
245
|
+
readValue(request: Omit<Parameters<UIBridgeServerHandlers['readValue']>[0], 'windowLabel'>, context?: HandlerContext): ReturnType<UIBridgeServerHandlers['readValue']>;
|
|
246
|
+
/** Type text into an element in the bound window. Delegates to `typeInto`. */
|
|
247
|
+
typeInto(request: Omit<Parameters<UIBridgeServerHandlers['typeInto']>[0], 'windowLabel'>, context?: HandlerContext): ReturnType<UIBridgeServerHandlers['typeInto']>;
|
|
248
|
+
/** Click an element by visible text in the bound window. Delegates to `clickByText`. */
|
|
249
|
+
clickByText(request: Omit<Parameters<UIBridgeServerHandlers['clickByText']>[0], 'windowLabel'>, context?: HandlerContext): ReturnType<UIBridgeServerHandlers['clickByText']>;
|
|
250
|
+
/** Click an element by CSS selector in the bound window. Delegates to `clickBySelector`. */
|
|
251
|
+
clickBySelector(request: Omit<Parameters<UIBridgeServerHandlers['clickBySelector']>[0], 'windowLabel'>, context?: HandlerContext): ReturnType<UIBridgeServerHandlers['clickBySelector']>;
|
|
252
|
+
/** Find elements by visible text in the bound window. Delegates to `findByText`. */
|
|
253
|
+
findByText(request: Omit<Parameters<UIBridgeServerHandlers['findByText']>[0], 'windowLabel'>, context?: HandlerContext): ReturnType<UIBridgeServerHandlers['findByText']>;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Pre-bind the window-targetable methods of a `UIBridgeServerHandlers` to a
|
|
257
|
+
* single runner window. See the module docs for the contract.
|
|
258
|
+
*
|
|
259
|
+
* @param handlers - the bridge handlers (e.g. from `createRelayHandlers`).
|
|
260
|
+
* @param windowLabel - the target window's label (discover via `listWindows()`).
|
|
261
|
+
*/
|
|
262
|
+
declare function windowScope(handlers: UIBridgeServerHandlers, windowLabel: string): WindowScopedBridge;
|
|
263
|
+
|
|
181
264
|
/**
|
|
182
265
|
* Chrome DevTools Protocol Tab Discovery
|
|
183
266
|
*
|
|
@@ -309,4 +392,4 @@ interface ElementSelector {
|
|
|
309
392
|
*/
|
|
310
393
|
declare function matchesElementSelector(el: MatchableElement, selector: ElementSelector): boolean;
|
|
311
394
|
|
|
312
|
-
export { CDPTabDiscovery, type CDPTabsConfig, type CDPTarget, CommandRelay, type ElementSelector, type MatchableElement, type RelayHandlersOptions, UIBridgeServerHandlers, UIBridgeWSHandler, WSStreamAdapter, type WSStreamAdapterConfig, createRelayHandlers, createWSStreamBroadcast, matchesElementSelector };
|
|
395
|
+
export { CDPTabDiscovery, type CDPTabsConfig, type CDPTarget, CommandRelay, type ElementSelector, HandlerContext, type MatchableElement, type RelayHandlersOptions, UIBridgeServerHandlers, UIBridgeWSHandler, WSStreamAdapter, type WSStreamAdapterConfig, type WindowScopedBridge, createRelayHandlers, createWSStreamBroadcast, matchesElementSelector, windowScope };
|
package/dist/server/index.js
CHANGED
|
@@ -237,6 +237,11 @@ var UI_BRIDGE_ROUTES = [
|
|
|
237
237
|
{ method: "GET", path: "/render-log/path", handler: "getRenderLogPath" },
|
|
238
238
|
// Control - Elements
|
|
239
239
|
{ method: "GET", path: "/control/elements", handler: "getElements" },
|
|
240
|
+
// Discover the runner process's own webview windows (main + pop-outs) so
|
|
241
|
+
// callers can resolve a `windowLabel` target. Runner-owned; promoted out of
|
|
242
|
+
// the runner_only_baseline allow-list once the SDK declared it here (plan
|
|
243
|
+
// 2026-06-07-multi-window-sdk-automation, Phase 2).
|
|
244
|
+
{ method: "GET", path: "/control/runner-windows", handler: "listWindows" },
|
|
240
245
|
{ method: "GET", path: "/control/element/:id", handler: "getElement", params: ["id"] },
|
|
241
246
|
{ method: "GET", path: "/control/element/:id/state", handler: "getElementState", params: ["id"] },
|
|
242
247
|
{
|
|
@@ -20697,6 +20702,12 @@ function createHandlers(registry, actionExecutor, config = {}) {
|
|
|
20697
20702
|
return error(err.message, "RANK_ELEMENTS_ERROR");
|
|
20698
20703
|
}
|
|
20699
20704
|
},
|
|
20705
|
+
listWindows: async () => {
|
|
20706
|
+
return error(
|
|
20707
|
+
"listWindows is runner-only \u2014 query the qontinui-runner directly (GET /control/runner-windows)",
|
|
20708
|
+
"NOT_IMPLEMENTED"
|
|
20709
|
+
);
|
|
20710
|
+
},
|
|
20700
20711
|
getElement: async (id) => {
|
|
20701
20712
|
try {
|
|
20702
20713
|
const element = registry.getElement(id);
|
|
@@ -29783,6 +29794,12 @@ function createRelayHandlers(relay, options) {
|
|
|
29783
29794
|
}))
|
|
29784
29795
|
);
|
|
29785
29796
|
},
|
|
29797
|
+
async listWindows() {
|
|
29798
|
+
return error2(
|
|
29799
|
+
"listWindows is runner-only \u2014 query the qontinui-runner directly (GET /control/runner-windows), not the browser-tab relay",
|
|
29800
|
+
"NOT_IMPLEMENTED"
|
|
29801
|
+
);
|
|
29802
|
+
},
|
|
29786
29803
|
async getElement(id, options2, context) {
|
|
29787
29804
|
try {
|
|
29788
29805
|
const { callerUserId } = extractTabRouting(options2 ?? {});
|
|
@@ -30873,6 +30890,21 @@ function createRelayHandlers(relay, options) {
|
|
|
30873
30890
|
return handlers;
|
|
30874
30891
|
}
|
|
30875
30892
|
|
|
30893
|
+
// src/server/window-scope.ts
|
|
30894
|
+
function windowScope(handlers, windowLabel) {
|
|
30895
|
+
return {
|
|
30896
|
+
windowLabel,
|
|
30897
|
+
evaluate: (request, context) => handlers.pageEvaluate({ ...request, windowLabel }, context),
|
|
30898
|
+
getElements: (options, context) => handlers.getElements({ ...options, windowLabel }, context),
|
|
30899
|
+
executeAction: (id, request, context) => handlers.executeElementAction(id, { ...request, windowLabel }, context),
|
|
30900
|
+
readValue: (request, context) => handlers.readValue({ ...request, windowLabel }, context),
|
|
30901
|
+
typeInto: (request, context) => handlers.typeInto({ ...request, windowLabel }, context),
|
|
30902
|
+
clickByText: (request, context) => handlers.clickByText({ ...request, windowLabel }, context),
|
|
30903
|
+
clickBySelector: (request, context) => handlers.clickBySelector({ ...request, windowLabel }, context),
|
|
30904
|
+
findByText: (request, context) => handlers.findByText({ ...request, windowLabel }, context)
|
|
30905
|
+
};
|
|
30906
|
+
}
|
|
30907
|
+
|
|
30876
30908
|
exports.CDPTabDiscovery = CDPTabDiscovery;
|
|
30877
30909
|
exports.CommandRelay = CommandRelay;
|
|
30878
30910
|
exports.INTERACTION_RELAY_COMMAND_ACTIONS = INTERACTION_RELAY_COMMAND_ACTIONS;
|
|
@@ -30900,5 +30932,6 @@ exports.createWSStreamBroadcast = createWSStreamBroadcast;
|
|
|
30900
30932
|
exports.matchesElementSelector = matchesElementSelector;
|
|
30901
30933
|
exports.startCLI = startCLI;
|
|
30902
30934
|
exports.uiBridgeMiddleware = uiBridgeMiddleware;
|
|
30935
|
+
exports.windowScope = windowScope;
|
|
30903
30936
|
//# sourceMappingURL=index.js.map
|
|
30904
30937
|
//# sourceMappingURL=index.js.map
|