/** * Weavetab — tools/cookies.ts * browser_cookies: Read and inject browser cookies via the CDP Network domain. * * Use this tool to: * - GET: Read all cookies for the current page's URL (for inspection or debugging) * - SET: Inject a cookie to pre-authenticate a session without logging in manually * - DELETE: Remove a specific cookie by name and domain * * This is the correct tool for session pre-authentication. Do NOT use browser_eval * for cookie manipulation — this tool uses the proper CDP Network domain which * works correctly with HttpOnly and Secure cookies. * Weavetab by fy2ne */ import CDP from "chrome-remote-interface"; import type { Config } from "../config/loader.js"; export interface CookieEntry { name: string; value: string; domain: string; path: string; expires: number; httpOnly: boolean; secure: boolean; sameSite?: string; } export interface CookiesGetResult { success: true; action: "get"; cookies: CookieEntry[]; count: number; found?: boolean; message?: string; } export interface CookiesSetResult { success: true; action: "set"; name: string; } export interface CookiesDeleteResult { success: true; action: "delete"; name: string; } export type CookiesResult = CookiesGetResult | CookiesSetResult | CookiesDeleteResult; export interface CookieSetOptions { name: string; value: string; domain?: string; path?: string; expires?: number; httpOnly?: boolean; secure?: boolean; sameSite?: "Strict" | "Lax" | "None"; } export declare function browserCookies(session: CDP.Client, args: { action: "get" | "set" | "delete"; name?: string; value?: string; domain?: string; path?: string; expires?: number; httpOnly?: boolean; secure?: boolean; sameSite?: "Strict" | "Lax" | "None"; url?: string; }, _config: Config): Promise;