@quiesco/web 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Quiesco contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,18 @@
1
- # Temporary Holding Version
1
+ # @quiesco/web
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The web device provider of Quiesco: runs the web build of your Expo app in Chromium through the
4
+ Playwright library. Install it only to test on the web.
5
+
6
+ ```sh
7
+ npm i -D @quiesco/web playwright
8
+ npx playwright install chromium
9
+ ```
10
+
11
+ Quiesco loads it for `npx quiesco test --platform web`. Configuration (`apps.web`):
12
+ [API reference](https://shift-14cc7601.mintlify.site/api#configuration); differences from iOS / Android: [platforms](https://shift-14cc7601.mintlify.site/platforms).
13
+
14
+ Part of [Quiesco](https://github.com/h2nology/quiesco): gray-box end-to-end testing for Expo apps on iOS, Android and the web. Setup: `npx quiesco init` ([quick start](https://github.com/h2nology/quiesco#quick-start-web-about-10-minutes)).
15
+
16
+ ## License
17
+
18
+ MIT
@@ -0,0 +1,17 @@
1
+ import type { ChildProcess } from 'node:child_process';
2
+ import type { StaticServer } from './static-server.js';
3
+ /** A web export made with `web.output: "server"`. */
4
+ export declare function isServerExport(distDir: string): boolean;
5
+ export interface ExpoServerDeps {
6
+ spawn: (command: string, args: string[], options: {
7
+ cwd: string;
8
+ }) => ChildProcess;
9
+ freePort: () => Promise<number>;
10
+ /** Resolves true once the server answers. */
11
+ ping: (url: string) => Promise<boolean>;
12
+ wait: (ms: number) => Promise<void>;
13
+ now: () => number;
14
+ }
15
+ export declare const defaultExpoServerDeps: ExpoServerDeps;
16
+ export declare function startExpoServer(distDir: string, deps?: ExpoServerDeps): Promise<StaticServer>;
17
+ //# sourceMappingURL=expo-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expo-server.d.ts","sourceRoot":"","sources":["../src/expo-server.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAOvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAMvD,qDAAqD;AACrD,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGvD;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,YAAY,CAAC;IACnF,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,6CAA6C;IAC7C,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,GAAG,EAAE,MAAM,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,qBAAqB,EAAE,cAqBnC,CAAC;AAEF,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,cAAsC,GAAG,OAAO,CAAC,YAAY,CAAC,CAoC1H"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Expo Router "server" output (`web.output: "server"`, the default of the SDK 58 app template):
3
+ * `expo export --platform web` writes `dist/client` and `dist/server` and no `index.html` — pages are
4
+ * rendered per request. A static file server cannot host that, so Quiesco runs Expo's own production
5
+ * server, `npx expo serve <distDir> --port <port>`, for the session. (`expo serve` takes the export
6
+ * directory: given the project directory it serves that as static files instead.)
7
+ */
8
+ import { spawn as nodeSpawn } from 'node:child_process';
9
+ import fs from 'node:fs';
10
+ import net from 'node:net';
11
+ import path from 'node:path';
12
+ import { trackChildProcess } from '@quiesco/core';
13
+ const READY_TIMEOUT_MS = 60_000;
14
+ const POLL_MS = 250;
15
+ const OUTPUT_LINES = 15;
16
+ /** A web export made with `web.output: "server"`. */
17
+ export function isServerExport(distDir) {
18
+ const isDir = (p) => fs.existsSync(p) && fs.statSync(p).isDirectory();
19
+ return isDir(path.join(distDir, 'server')) && isDir(path.join(distDir, 'client'));
20
+ }
21
+ export const defaultExpoServerDeps = {
22
+ // Tracked: a parallel worker ended without async teardown kills it synchronously (Phase 6.12).
23
+ spawn: (command, args, options) => trackChildProcess(nodeSpawn(command, args, { cwd: options.cwd, stdio: ['ignore', 'pipe', 'pipe'], shell: process.platform === 'win32' })),
24
+ freePort: () => new Promise((resolve, reject) => {
25
+ const srv = net.createServer();
26
+ srv.once('error', reject);
27
+ srv.listen(0, '127.0.0.1', () => {
28
+ const { port } = srv.address();
29
+ srv.close(() => resolve(port));
30
+ });
31
+ }),
32
+ ping: async (url) => {
33
+ try {
34
+ return (await fetch(url)).ok;
35
+ }
36
+ catch {
37
+ return false;
38
+ }
39
+ },
40
+ wait: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
41
+ now: () => Date.now(),
42
+ };
43
+ export async function startExpoServer(distDir, deps = defaultExpoServerDeps) {
44
+ const dist = path.resolve(distDir);
45
+ // Run from the project, so npx finds the project's own expo CLI.
46
+ const project = path.dirname(dist);
47
+ const port = await deps.freePort();
48
+ const child = deps.spawn('npx', ['expo', 'serve', dist, '--port', String(port)], { cwd: project });
49
+ const output = [];
50
+ const collect = (d) => {
51
+ output.push(...d.toString().split('\n').filter((l) => l.trim() !== ''));
52
+ output.splice(0, Math.max(0, output.length - OUTPUT_LINES));
53
+ };
54
+ child.stdout?.on('data', collect);
55
+ child.stderr?.on('data', collect);
56
+ let exited = null;
57
+ child.on('exit', (code) => (exited = code ?? 1));
58
+ const url = `http://localhost:${port}`;
59
+ const deadline = deps.now() + READY_TIMEOUT_MS;
60
+ for (;;) {
61
+ if (exited !== null)
62
+ throw new Error(`\`npx expo serve\` exited (code ${exited}) before serving ${url}:\n${output.join('\n')}`);
63
+ if (await deps.ping(url))
64
+ break;
65
+ if (deps.now() >= deadline) {
66
+ child.kill();
67
+ throw new Error(`\`npx expo serve\` did not answer on ${url} within ${READY_TIMEOUT_MS / 1000}s:\n${output.join('\n')}`);
68
+ }
69
+ await deps.wait(POLL_MS);
70
+ }
71
+ return {
72
+ url,
73
+ close: () => new Promise((resolve) => {
74
+ if (exited !== null)
75
+ return resolve();
76
+ child.once('exit', () => resolve());
77
+ child.kill();
78
+ }),
79
+ };
80
+ }
81
+ //# sourceMappingURL=expo-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expo-server.js","sourceRoot":"","sources":["../src/expo-server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,MAAM,SAAS,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AAO,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO;QACL,GAAG;QACH,KAAK,EAAE,GAAG,EAAE,CACV,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACtB,IAAI,MAAM,KAAK,IAAI;gBAAE,OAAO,OAAO,EAAE,CAAC;YACtC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;YACpC,KAAK,CAAC,IAAI,EAAE,CAAC;QACf,CAAC,CAAC;KACL,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { WebProvider, createWebProvider } from './provider.js';
2
+ export type { WebProviderOptions } from './provider.js';
3
+ export { startStaticServer, resolveRequest } from './static-server.js';
4
+ export type { StaticServer } from './static-server.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC/D,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACvE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { WebProvider, createWebProvider } from './provider.js';
2
+ export { startStaticServer, resolveRequest } from './static-server.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,138 @@
1
+ import type { HostInput, Orientation, Rect } from '@quiesco/protocol';
2
+ import type { ColorScheme, DeviceProvider, LaunchParams, LaunchUrlHandling, Logger, Permission, StateChange, StatusBarOptions, SystemNode, WebAppConfig, WebDeviceConfig, WorkerInfo } from '@quiesco/core';
3
+ /**
4
+ * Where a launch URL points on the web: paths and http(s) URLs as they are; an app scheme URL
5
+ * (`myapp://todos/1?x=1`) becomes its path (`/todos/1?x=1`), the route expo-router gives it natively.
6
+ */
7
+ export declare function webPathFor(url: string): string;
8
+ /** Ids of a JS dialog's parts in systemNodes(). */
9
+ export declare const DIALOG_MESSAGE = "dialog.message";
10
+ export declare const DIALOG_ACCEPT = "dialog.accept";
11
+ export declare const DIALOG_DISMISS = "dialog.dismiss";
12
+ /** A JS dialog as system UI: its message, OK and (confirm / prompt) Cancel. No geometry (the browser draws it). */
13
+ export declare function dialogNodes(type: string, message: string): SystemNode[];
14
+ export interface WebProviderOptions {
15
+ app: WebAppConfig;
16
+ device?: WebDeviceConfig;
17
+ logger?: Logger;
18
+ /**
19
+ * The parallel worker (Phase 6.12). Nothing to allocate: every worker process launches its own browser,
20
+ * and the file server / `expo serve` take a free port.
21
+ */
22
+ worker?: WorkerInfo;
23
+ }
24
+ export declare class WebProvider implements DeviceProvider {
25
+ private readonly options;
26
+ readonly platform: "web";
27
+ /**
28
+ * react-native-gesture-handler on the web: span slop 2 × 15 px before the scale detector starts, then
29
+ * 15 px more before the pinch activates (resetting its scale); measured about 46 px. Its rotation keeps
30
+ * the angle turned before activating (measured: 90° reported for 90° turned), so no rotation slop.
31
+ */
32
+ readonly gestureSlop: {
33
+ pinch: number;
34
+ rotation: number;
35
+ };
36
+ private browser;
37
+ private context;
38
+ private page;
39
+ private server;
40
+ private baseUrl;
41
+ private permissions;
42
+ /** Cookies / storage of the last context, kept by terminate({ keepData: true }) for the next launch. */
43
+ private kept;
44
+ /** Device state (Phase 6.6), applied to the open page and to every new context until reset. */
45
+ private orientation;
46
+ private geolocation;
47
+ private colorScheme;
48
+ private locale;
49
+ /** setNetwork('offline'): requests aborted, and (Chromium) `navigator.onLine` false; see applyNetwork. */
50
+ private offline;
51
+ private networkCdp;
52
+ private readonly abortRoute;
53
+ /** Permissions granted at runtime beyond / revoked from the configured ones. */
54
+ private permissionsAtStart;
55
+ private readonly pageErrors;
56
+ /** Phase 6.9 artifacts: the running screencast (segments) and the console log. */
57
+ private recording;
58
+ private logsOn;
59
+ private readonly logs;
60
+ /** The JS dialog the page is blocked on (Phase 6.7). */
61
+ private dialog;
62
+ private readonly dialogListeners;
63
+ private readonly logger;
64
+ constructor(options: WebProviderOptions);
65
+ private get device();
66
+ boot(): Promise<void>;
67
+ install(): Promise<void>;
68
+ launch(params: LaunchParams): Promise<LaunchUrlHandling | void>;
69
+ terminate(opts?: {
70
+ keepData?: boolean;
71
+ }): Promise<void>;
72
+ grantPermissions(perms: readonly Permission[]): Promise<void>;
73
+ screenshot(): Promise<Buffer>;
74
+ injectInput(input: HostInput): Promise<void>;
75
+ /** The configured viewport, turned to `this.orientation`; null without a configured viewport. */
76
+ private viewportSize;
77
+ /** Swaps the viewport's sides (a `resize` for the page; `screen.orientation` follows). */
78
+ setOrientation(orientation: Orientation): Promise<void>;
79
+ setLocation(location: {
80
+ latitude: number;
81
+ longitude: number;
82
+ }): Promise<void>;
83
+ setPermission(permission: Permission, grant: boolean): Promise<StateChange>;
84
+ /** Not granted is the browser's "prompt" state: a page's next request asks again. */
85
+ resetPermission(permission: Permission): Promise<StateChange>;
86
+ setAppearance(scheme: ColorScheme): Promise<void>;
87
+ /** A browser context's locale is fixed when it is created: the app is opened again in a new one (data kept). */
88
+ setLocale(locale: string | null): Promise<StateChange>;
89
+ /** A browser page has no status bar: nothing to override. */
90
+ setStatusBar(_opts: StatusBarOptions): Promise<void>;
91
+ resetStatusBar(): Promise<void>;
92
+ /**
93
+ * Offline: every request of the page is aborted (`net::ERR_INTERNET_DISCONNECTED`) and, on Chromium,
94
+ * `navigator.onLine` turns false with real `offline` and `navigator.connection` `change` events (CDP
95
+ * `Network.overrideNetworkState`).
96
+ * Not `context.setOffline()`: it also stops Quiesco's own WebSocket (messages no longer arrive; checked
97
+ * in Phase 6.6). Request routes do not see WebSockets, so the connection keeps working; the agent fails
98
+ * the app's new WebSockets.
99
+ */
100
+ setNetwork(offline: boolean): Promise<void>;
101
+ private applyNetwork;
102
+ /** `navigator.clipboard` with the clipboard permissions granted to the page's origin (Chromium; others may refuse). */
103
+ setClipboard(text: string): Promise<void>;
104
+ getClipboard(): Promise<string>;
105
+ private clipboardPage;
106
+ /** Playwright's per-page screencast (WebM); a relaunch continues in a new segment. */
107
+ startVideo(basePath: string): Promise<void>;
108
+ private recordSegment;
109
+ stopVideo(): Promise<string[]>;
110
+ /** The page's console messages and uncaught errors, from now on. */
111
+ startDeviceLogs(): Promise<void>;
112
+ deviceLogs(since: number): string[];
113
+ /**
114
+ * Evaluate `script` in the iframe the agent measured at `rect` (page coordinates): Playwright's frames
115
+ * reach cross-origin iframes too. The iframe is picked by position (the agent cannot name DOM nodes).
116
+ */
117
+ webviewEval(rect: Rect, script: string): Promise<string>;
118
+ private onDialog;
119
+ blockingDialog(): string | null;
120
+ onBlockingDialog(listener: (message: string) => void): () => void;
121
+ systemNodes(): Promise<SystemNode[]>;
122
+ /** OK accepts (a prompt with its default value), Cancel dismisses; the page goes on at once. */
123
+ tapSystemNode(node: SystemNode): Promise<void>;
124
+ resetDeviceState(): Promise<StateChange>;
125
+ shutdown(): Promise<void>;
126
+ diagnose(params: LaunchParams): Promise<string[]>;
127
+ /**
128
+ * Multi-finger touches through CDP `Input.dispatchTouchEvent` (Playwright has no multi-touch API):
129
+ * per frame the fingers that went down (touchStart), moved (touchMove) and lifted (touchEnd), each
130
+ * event listing the fingers touching after it, as CDP expects. Touch viewports only: a page on a
131
+ * viewport without touch does not expect touch events (HU 2026-11-09).
132
+ */
133
+ private playTouches;
134
+ private requirePage;
135
+ }
136
+ /** Entry used by @quiesco/core's createProvider('web') (loaded at runtime by name). */
137
+ export declare function createWebProvider(options: WebProviderOptions): DeviceProv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