/** * Gateway API * Client functions for CLI Gateway operations. * Uses a non-clearing API client (same pattern as worker-api.ts) * so that transient 401 errors don't invalidate user auth. */ export interface GatewayRequest { requestId: string; conversationId: number; conversationHashKey?: string; message: string; references?: Array<{ type: string; hashKey: string; title: string; }>; clientType: string; createdAt: string; } export interface GatewayStreamEvent { type: string; data: Record; } export interface GatewayCompletionResult { content: string; toolCalls?: unknown[]; sparklet?: unknown; error?: string; } /** * Poll for pending gateway requests. */ export declare function pollGatewayRequests(sessionId: string, limit?: number): Promise<{ requests: GatewayRequest[]; count: number; }>; /** * Claim a gateway request for processing. */ export declare function claimGatewayRequest(requestId: string, sessionId: string, deviceName?: string): Promise<{ success: boolean; request?: GatewayRequest; error?: string; }>; export interface GatewayCommandFromServer { id: string; type: string; data: Record; } /** * Push streaming events for a gateway request. * Response may contain piggybacked commands from the frontend. */ export declare function pushGatewayEvents(requestId: string, sessionId: string, events: GatewayStreamEvent[]): Promise<{ success: boolean; error?: string; commands?: GatewayCommandFromServer[]; }>; /** * Register this CLI gateway instance with the cloud backend. */ export declare function registerGatewayInstance(sessionId: string, deviceName: string, meta?: { capabilities?: string[]; workingDirectory?: string; platform?: string; cliVersion?: string; sessionName?: string; protocolVersion?: number; }): Promise<{ success: boolean; error?: string; }>; /** * Unregister this CLI gateway instance from the cloud backend. */ export declare function unregisterGatewayInstance(sessionId: string): Promise<{ success: boolean; error?: string; }>; /** * Mark a gateway request as completed. */ export declare function completeGatewayRequest(requestId: string, sessionId: string, result: GatewayCompletionResult): Promise<{ success: boolean; error?: string; }>; //# sourceMappingURL=gateway-api.d.ts.map