export declare function mapModel(model: string): string; export declare function resolveThinkingEffort(model: string, effort?: string | null): string; export declare function chatGptMessage(id: string, text: string, nowMs: number, role?: "user" | "assistant"): Record; export type PrepareBodyOpts = { model: string; prompt: string; messageId: string; nowMs: number; thinkingEffort: string; conversationId?: string; parentMessageId?: string; }; export declare function buildPrepareBody(opts: PrepareBodyOpts): Record; export type ConversationBodyOpts = { model: string; prompt: string; messageId: string; nowMs: number; thinkingEffort: string; conversationId?: string; parentMessageId?: string; /** OpenAI-style tools array; omitted when over budget. */ tools?: unknown[]; toolChoice?: unknown; useWrapperTool?: boolean; }; /** Prefer bare declared tool names first; keep wrapper last so models target real tools. */ export declare function localFunctionNames(tools: unknown[] | undefined, useWrapperTool?: boolean): string[] | undefined; /** * Wire tool_choice for ChatGPT conversation. * - "none" / missing tools → omit * - pass through auto/required/named choice from caller * - on tool-result turns default to "auto" so the model can finish after tools */ export declare function resolveToolChoice(opts: { tools?: unknown[]; toolChoice?: unknown; toolResultTurn?: boolean; }): unknown | undefined; /** Compact tool schemas into text the model can actually see. */ export declare function buildCompactToolRoster(tools: unknown[] | undefined, budget?: number): string; /** Luna throttle / sandbox-hallucination refusals that must never be final when tools exist. */ export declare function responseClaimsWorkspaceUnavailable(text: string): boolean; export declare function shouldRetryMissingToolCall(opts: { latestUserText: string; responseText: string; tools?: unknown[]; toolChoice?: unknown; emittedToolCall: boolean; }): boolean; export declare function buildMissingToolRetryPrompt(originalPrompt: string, invalidResponse: string): string; /** Imperative tool-availability trailer — no single-call ceiling, no soft/optional framing. */ export declare function buildToolAvailabilityGuard(declaredNames: string[], tools?: unknown[], toolChoice?: unknown): string; export declare function toolNames(tools: unknown[] | undefined): string[]; export declare function buildConversationBody(opts: ConversationBodyOpts): Record; export declare function buildToolResultConversationBody(opts: { model: string; messageId: string; nowMs: number; toolResultText: string; conversationId: string; parentMessageId: string; thinkingEffort?: string; tools?: unknown[]; toolChoice?: unknown; /** Upstream recipient that issued the call (e.g. container.exec); defaults to wrapper. */ toolAuthorName?: string; }): Record; /** Flatten Responses `input` + instructions into a single user prompt for ChatGPT. */ export declare function flattenResponsesInput(body: Record): string; export declare function extractLatestUserText(body: Record): string; export type FunctionCallOutput = { callId: string; output: string; isError?: boolean; }; export declare function extractFunctionCallOutputs(body: Record): FunctionCallOutput[]; /** * Fit an OpenAI-style tools array under a serialized byte budget without * dropping tools wholesale. Passes: (1) as-is; (2) truncate long descriptions; * (3) strip parameter-level descriptions; (4) name+required-params only. * Returns undefined only if even the skeleton exceeds the budget. */ export declare function fitToolsToBudget(tools: unknown[], budget: number): unknown[] | undefined; //# sourceMappingURL=bodies.d.ts.map