/** * 检测沙箱代理链路下的 WebSocket 僵尸连接:客户端每 5s 发 ping, * 连续 2 次拿不到 pong 即判死,向 parent 发 disconnected 通知。 * * 设计 spec: docs/superpowers/specs/2026-04-27-sandbox-ws-watchdog-design.md */ import type { Plugin } from 'vite'; export interface WsWatchdogPluginOptions { pingEvent?: string; pongEvent?: string; /** * 客户端 base 路径(如 `/app/app_xxx`)。aiforce 等网关把完整路径透传给 Vite, * middleware 匹配和注入的