From bb691459f358d32267c552de643fededf647855e Mon Sep 17 00:00:00 2001 From: amankumarsingh77 Date: Sat, 2 May 2026 16:46:12 +0530 Subject: refactor: delete legacy daemon, tools, protocol, renderers; collapse to single tsconfig --- src/protocol.ts | 77 --------------------------------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 src/protocol.ts (limited to 'src/protocol.ts') diff --git a/src/protocol.ts b/src/protocol.ts deleted file mode 100644 index 1b8bf40..0000000 --- a/src/protocol.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Protocol types for pi-browser-harness. - * - * Defines the shape of CDP communication and browser state. - * No socket transport — the daemon talks CDP directly over WebSocket. - */ - -// ── CDP Event ──────────────────────────────────────────────────────────────── - -export interface CDPEvent { - method: string; - params: unknown; - session_id?: string; -} - -// ── Dialog ─────────────────────────────────────────────────────────────────── - -export interface DialogInfo { - type: "alert" | "confirm" | "prompt" | "beforeunload"; - message: string; - defaultPrompt?: string; -} - -// ── Tab ────────────────────────────────────────────────────────────────────── - -export interface TabInfo { - targetId: string; - title: string; - url: string; -} - -// ── Page State ─────────────────────────────────────────────────────────────── - -export interface PageInfo { - url: string; - title: string; - width: number; - height: number; - scrollX: number; - scrollY: number; - pageWidth: number; - pageHeight: number; -} - -export type PageInfoResult = PageInfo | { dialog: DialogInfo }; - -// ── Daemon Status ──────────────────────────────────────────────────────────── - -export interface DaemonStatus { - alive: boolean; - sessionId: string | null; - pid: number | null; // deprecated — always null (no subprocess) - namespace: string; - socketPath: string; // deprecated — always "" (no socket) - remoteBrowserId?: string; -} - -// ── Remote Config ──────────────────────────────────────────────────────────── - -export interface RemoteConfig { - cdpUrl: string; - browserId: string; -} - -// ── Internal URL prefixes to filter ────────────────────────────────────────── - -const INTERNAL_PREFIXES = [ - "chrome://", - "chrome-untrusted://", - "devtools://", - "chrome-extension://", - "about:", -]; - -export function isInternalUrl(url: string): boolean { - return INTERNAL_PREFIXES.some((p) => url.startsWith(p)); -} -- cgit v1.2.3