/** * batch-14 intercept full state machine — fulfills the contract frozen in * cross-review v2.0.1 R3 + spec §"intercept 完整状态机 (batch-14 契约)": * * - requestId 生命周期:`Network.requestIntercepted` → buffered in PageSession * → consumed by `intercept_continue` / `intercept_respond` → drained. * - 并发上限:16 pending. Overflow auto-continues the oldest. * - 超时:30s without consumption → auto-continue (page does NOT hang). * - 显式 abort 语义:`intercept_continue(reqId, abort=true)` blocks the * request via `Network.interceptContinue` with `errorReason=BlockedByClient`. * * Apple WIP methods (probe-confirmed 2026-05-17): * - Network.setInterceptionEnabled ✅ returns {} * - Network.addInterception ✅ returns {} for any url pattern * - Network.interceptContinue ✅ (probe shows method exists) * - Network.interceptWithResponse ✅ (probe shows method exists) * * ⚠ **iOS WKWebView limitation (2026-05-17 实测)**: Even though the methods * above all return `{}` success, `Network.requestIntercepted` event is NEVER * fired for matching requests on iOS 26.5.0 + Apple system WKWebView. The * underlying WebKit interception machinery is a no-op on iOS. iwdp-mcp's * fulfill/continue flow validated against macOS Safari, where it works. * * Tools below are coded correctly per the WIP spec — they will Just Work the * day Apple ships interception runtime in iOS WKWebView (or when this MCP is * pointed at macOS Safari via a different transport). For now, calling * `set_request_interception` does nothing observable; `list_intercepted_requests` * always returns 0. */ import { z } from 'zod'; export declare const listInterceptedRequestsTool: { name: string; description: string; inputSchema: {}; handler: () => Promise<{ content: { type: "text"; text: string; }[]; }>; }; export declare const interceptContinueTool: { name: string; description: string; inputSchema: { requestId: z.ZodString; abort: z.ZodOptional; }; handler: ({ requestId, abort }: { requestId: string; abort?: boolean; }) => Promise<{ content: { type: "text"; text: string; }[]; }>; }; export declare const interceptRespondTool: { name: string; description: string; inputSchema: { requestId: z.ZodString; statusCode: z.ZodOptional; headers: z.ZodOptional>; body: z.ZodString; base64: z.ZodOptional; }; handler: ({ requestId, statusCode, headers, body, base64 }: { requestId: string; statusCode?: number; headers?: Record; body: string; base64?: boolean; }) => Promise<{ content: { type: "text"; text: string; }[]; }>; };