export {}; type BridgeErrorCode = "invalid_request" | "session_invalid" | "plugin_unavailable" | "legacy_bridge_disabled" | "permission_not_declared" | "permission_not_granted" | "permission_scope_denied" | "payload_too_large" | "concurrency_limit" | "timeout" | "network_denied" | "unsupported" | "host_failure"; interface BridgeError extends Error { code: BridgeErrorCode; } interface HttpRequest { url: string; method?: string; headers?: Record; body?: string; } interface HttpResponse { status: number; ok: boolean; content: string; headers: Record; } interface YmhutBridge { input: { get(): Promise; set(value: unknown): Promise; onInputChanged(handler: (value: unknown) => void): void }; output: { set(value: unknown): Promise; append(value: unknown): Promise; clear(): Promise }; log: { info(message: string, detail?: string): Promise; warn(message: string, detail?: string): Promise; error(message: string, detail?: string): Promise }; storage: { get(key: string): Promise; set(key: string, value: string): Promise; remove(key: string): Promise; list(): Promise> }; http: { fetch(request: HttpRequest): Promise }; network: { diagnostics(): Promise; ping(request: unknown): Promise; dnsLookup(request: unknown): Promise; traceRoute(request: unknown): Promise }; clipboard: { readText(): Promise; writeText(text: string): Promise }; file: { openPicker(): Promise<{ name: string; content: string } | null>; savePicker(name: string, value: string): Promise<{ name: string } | null> }; tool: { run(toolId: string, input: string): Promise }; openExternal(url: string, options?: { target?: "safe" | "system" }): Promise; } declare global { interface Window { ymhut: YmhutBridge; } }