diff options
| author | amankumarsingh77 <amankumarsingh7702@gmal.com> | 2026-05-02 16:46:12 +0530 |
|---|---|---|
| committer | amankumarsingh77 <amankumarsingh7702@gmal.com> | 2026-05-02 16:46:12 +0530 |
| commit | bb691459f358d32267c552de643fededf647855e (patch) | |
| tree | 7dbbbc4f2cfa1f40077b48050cdbf2b96e348102 /src/protocol.ts | |
| parent | c86b220d46c577441bb0bff7eac49aa80340fc70 (diff) | |
refactor: delete legacy daemon, tools, protocol, renderers; collapse to single tsconfig
Diffstat (limited to 'src/protocol.ts')
| -rw-r--r-- | src/protocol.ts | 77 |
1 files changed, 0 insertions, 77 deletions
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)); -} |
