/** * GatewayTransport — CLI communication through the Supen gateway. * * Adds authentication headers and targets a specific daemon through the gateway relay. * Handles token refresh on expiry, including server-side rejection (401) of a * locally-valid token: one forced refresh + retry, then an actionable error. * * Uses Node.js built-in fetch for HTTP requests. */ import http from 'http'; import type { Transport, TransportConfig, TransportResponse } from './types.js'; export declare class GatewayTransport implements Transport { private gatewayUrl; private daemonId?; private refreshInFlight; constructor(config: TransportConfig); private refresh; private getAuthHeaders; /** * Fetch with auth headers. When the gateway answers 401, the token was * revoked or expired server-side while still valid locally: force one * refresh and retry once, then fail with an actionable login hint. */ private fetchWithAuth; get(path: string): Promise; post(path: string, body?: any): Promise; put(path: string, body?: any): Promise; patch(path: string, body?: any): Promise; delete(path: string, body?: any): Promise; private request; private openChatStream; chatStream(path: string, body: any): Promise; }