import { type AgentMessageStream, type AgentRequestBase, type AgentResponder, type AgentResponse } from "@mono-agent/agent-contracts"; export interface OpenAIApiRequestMetadata { readonly requestId: string; readonly model: string; readonly stream: boolean; readonly method: string; readonly path: string; readonly receivedAt: string; readonly remoteAddress?: string; readonly headers: Record; readonly parameters: Record; readonly attachments?: OpenAIApiAttachmentMetadata; } export type OpenAIApiAttachmentUrlKind = "data" | "remote" | "file" | "other"; export type OpenAIApiImageDetail = "auto" | "low" | "high"; export interface OpenAIApiImageAttachment { readonly type: "image"; readonly source: "image_url"; readonly url: string; readonly urlKind: OpenAIApiAttachmentUrlKind; readonly mediaType?: string; readonly detail?: OpenAIApiImageDetail; readonly messageRole: string; readonly messageIndex: number; readonly contentPartIndex: number; } export type OpenAIApiAttachment = OpenAIApiImageAttachment; export interface OpenAIApiImageAttachmentMetadata { readonly type: "image"; readonly source: "image_url"; readonly urlKind: OpenAIApiAttachmentUrlKind; readonly mediaType?: string; readonly detail?: OpenAIApiImageDetail; readonly messageRole: string; readonly messageIndex: number; readonly contentPartIndex: number; } export interface OpenAIApiAttachmentMetadata { readonly count: number; readonly images: readonly OpenAIApiImageAttachmentMetadata[]; } export interface OpenAIApiChatRequest extends AgentRequestBase { readonly conversationId: string; readonly text: string; readonly imageAttachments: readonly OpenAIApiAttachment[]; readonly abortSignal: AbortSignal; readonly metadata: { readonly openaiApi: OpenAIApiRequestMetadata; readonly [key: string]: unknown; }; } export interface OpenAIApiAdapterLogger { debug?(message: string, metadata?: Record): void; info?(message: string, metadata?: Record): void; warn?(message: string, metadata?: Record): void; error?(message: string, metadata?: Record): void; } export interface OpenAIApiAdapterOptions { readonly host?: string; readonly port?: number; readonly basePath?: string; readonly allowNonLoopback?: boolean; readonly apiKey?: string; readonly modelId?: string; /** * Per-field UTF-8 preview upper bound for tool arguments/results rendered * into SSE. The adapter may lower it to satisfy the complete frame cap; * callers may lower, but never raise, the hard default boundary. */ readonly maxToolPayloadBytes?: number; readonly responder: AgentResponder; readonly logger?: OpenAIApiAdapterLogger; } export interface OpenAIApiAdapterStartResult { /** Primary usable origin (loopback for wildcard binds), never an unspecified address. */ readonly url: string; readonly baseUrl: string; /** Every concrete loopback/private-LAN/Tailscale base URL discovered for this bind. */ readonly baseUrls: readonly string[]; readonly modelsUrl: string; readonly chatCompletionsUrl: string; readonly host: string; readonly port: number; stop(): Promise; } export declare function startOpenAIApiAdapter(options: OpenAIApiAdapterOptions): Promise; //# sourceMappingURL=server.d.ts.map