import { type AxiosResponse } from "axios"; import type { Session } from "../types.js"; import { RingBuffer, type RingBufferEntry, type RingBufferSlice } from "./ring-buffer.js"; export type BridgeEventCategory = "status" | "output" | "question" | "file_changed"; export interface BridgeEventPayload { readonly category: BridgeEventCategory; readonly agentId: string; readonly sessionId: string | null; readonly status?: string; readonly output?: string; readonly seq?: number; readonly questions?: unknown[]; readonly actionType?: string; readonly actionLabel?: string; readonly actionDetail?: string; readonly actionInput?: string; readonly actionResult?: string; readonly actionId?: string; readonly parentId?: string; readonly inputTokens?: number; readonly outputTokens?: number; readonly cacheHitTokens?: number; readonly cacheMissTokens?: number; readonly sourceEventType?: string; readonly logLevel?: string; readonly logCategory?: string; readonly workspacePath?: string; readonly filePath?: string; readonly eventType?: string; readonly size?: number; readonly toolCallId?: string; } export type { RingBufferEntry, RingBufferSlice }; export declare const bridgeEventBuffer: RingBuffer; interface RuntimeStatusActionInfo { actionType?: string; actionLabel?: string; actionDetail?: string; actionInput?: string; actionResult?: string; actionId?: string; parentId?: string; } export interface RuntimeCallbackAuthOptions { runtimeAccessToken?: string; schedulerBaseUrl?: string; } export interface RuntimeOutputMetadata { sourceEventType?: string; logLevel?: "info" | "warn" | "error"; logMessage?: string; logCategory?: string; stream?: string; sequence?: number; cwd?: string; commandFilePath?: string; commandLineCount?: number; } export declare const sessions: Map; export declare function sendStatus(agentId: string, sessionId: string | null, status: string, actionInfo?: RuntimeStatusActionInfo, usage?: { inputTokens: number; outputTokens: number; contextLimit?: number; maxOutput?: number; inputLimit?: number; compactionThreshold?: number; cacheHitTokens?: number; cacheMissTokens?: number; }, authOptions?: RuntimeCallbackAuthOptions, timestamp?: number, sourceEventType?: string): Promise | undefined>; export declare function sendOutput(agentId: string, output: string, sessionId: string, seq: number, metadata?: RuntimeOutputMetadata, authOptions?: RuntimeCallbackAuthOptions, signal?: AbortSignal): Promise; export declare function sendQuestionRequest(agentId: string, sessionId: string, questions: unknown[], authOptions?: RuntimeCallbackAuthOptions, toolCallId?: string): Promise; export interface RuntimeFileChangedPayload { bridgeBaseUrl?: string; workspacePath: string; filePath: string; eventType: string; size?: number; mtimeMs?: number; } export interface ToolAuthRequestPayload { requestId: string; capability: string; path?: string; command?: string; cwd?: string; operation?: string; } export declare function sendToolAuthRequest(agentId: string, sessionId: string, request: ToolAuthRequestPayload, authOptions?: RuntimeCallbackAuthOptions): Promise; export declare function sendFileChanged(payload: RuntimeFileChangedPayload): Promise; export declare function appendSessionOutput(sessionId: string, data: string): void; export declare function scheduleOutputFlush(sessionId: string): void; export declare function flushSessionOutput(sessionId: string): Promise;