aboutsummaryrefslogtreecommitdiff
path: root/src/protocol.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol.ts')
-rw-r--r--src/protocol.ts77
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));
-}