@hasna/browser 0.3.7 → 0.4.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.
@@ -1 +1 @@
1
- {"version":3,"file":"selector.d.ts","sourceRoot":"","sources":["../../src/engines/selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AA+B5C;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,OAAO,EAChB,QAAQ,CAAC,EAAE,aAAa,GACvB,aAAa,CAqBf;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAOhE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CA0BnD"}
1
+ {"version":3,"file":"selector.d.ts","sourceRoot":"","sources":["../../src/engines/selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAkC5C;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,OAAO,EAChB,QAAQ,CAAC,EAAE,aAAa,GACvB,aAAa,CAqBf;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAQhE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CA4BnD"}
@@ -0,0 +1,49 @@
1
+ import { type ChildProcess } from "node:child_process";
2
+ import type { Browser, Page } from "playwright";
3
+ export interface TuiSession {
4
+ ttydProcess: ChildProcess;
5
+ port: number;
6
+ browser: Browser;
7
+ page: Page;
8
+ }
9
+ /**
10
+ * Check if ttyd is installed on this system.
11
+ */
12
+ export declare function isTuiAvailable(): boolean;
13
+ /**
14
+ * Launch a terminal app via ttyd and connect Playwright to it.
15
+ *
16
+ * @param command - The shell command to run (e.g. "htop", "npm start", "python app.py")
17
+ * @param options - Viewport and headless options
18
+ * @returns TuiSession with Playwright page connected to the ttyd web UI
19
+ */
20
+ export declare function launchTui(command: string, options?: {
21
+ headless?: boolean;
22
+ viewport?: {
23
+ width: number;
24
+ height: number;
25
+ };
26
+ }): Promise<TuiSession>;
27
+ /**
28
+ * Send keystrokes to the TUI app via the Playwright page.
29
+ * Types into the terminal's xterm.js input.
30
+ */
31
+ export declare function sendKeys(page: Page, keys: string): Promise<void>;
32
+ /**
33
+ * Send a special key (Enter, Escape, ArrowUp, etc.) to the TUI.
34
+ */
35
+ export declare function sendSpecialKey(page: Page, key: string): Promise<void>;
36
+ /**
37
+ * Get the visible text content from the terminal.
38
+ * Works with both canvas-based and DOM-based xterm.js renderers.
39
+ */
40
+ export declare function getTerminalText(page: Page): Promise<string>;
41
+ /**
42
+ * Wait for specific text to appear in the terminal output.
43
+ */
44
+ export declare function waitForTerminalText(page: Page, text: string, timeoutMs?: number): Promise<boolean>;
45
+ /**
46
+ * Close TUI session — kill ttyd and close Playwright.
47
+ */
48
+ export declare function closeTui(session: TuiSession): Promise<void>;
49
+ //# sourceMappingURL=tui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tui.d.ts","sourceRoot":"","sources":["../../src/engines/tui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAYhD,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,YAAY,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,IAAI,CAAC;CACZ;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAOxC;AAqCD;;;;;;GAMG;AACH,wBAAsB,SAAS,CAC7B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACzC,GACL,OAAO,CAAC,UAAU,CAAC,CAqDrB;AAED;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAStE;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAO3E;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAuBjE;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,MAAM,EACZ,SAAS,GAAE,MAAe,GACzB,OAAO,CAAC,OAAO,CAAC,CAQlB;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAUjE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tui.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tui.test.d.ts","sourceRoot":"","sources":["../../src/engines/tui.test.ts"],"names":[],"mappings":""}