import { completeSimple, type Api, type Model, type ThinkingLevel as SimpleCompletionThinkingLevel } from "@earendil-works/pi-ai"; import type { ThinkLevel } from "../auto-reply/thinking.js"; import type { KlawConfig } from "../config/types.klaw.js"; import { type ResolvedProviderAuth } from "./model-auth.js"; import { resolveModelAsync } from "./pi-embedded-runner/model.js"; type AllowedMissingApiKeyMode = ResolvedProviderAuth["mode"]; export type SimpleCompletionModelOptions = { maxTokens?: number; temperature?: number; reasoning?: ThinkLevel | SimpleCompletionThinkingLevel; signal?: AbortSignal; }; export type PreparedSimpleCompletionModel = { model: Model; auth: ResolvedProviderAuth; } | { error: string; auth?: ResolvedProviderAuth; }; export type AgentSimpleCompletionSelection = { provider: string; modelId: string; /** Provider used for auth/transport when runtime policy redirects the logical model ref. */ runtimeProvider?: string; profileId?: string; agentDir: string; }; export type PreparedSimpleCompletionModelForAgent = { selection: AgentSimpleCompletionSelection; model: Model; auth: ResolvedProviderAuth; } | { error: string; selection?: AgentSimpleCompletionSelection; auth?: ResolvedProviderAuth; }; export declare function resolveSimpleCompletionSelectionForAgent(params: { cfg: KlawConfig; agentId: string; modelRef?: string; }): AgentSimpleCompletionSelection | null; export declare function prepareSimpleCompletionModel(params: { cfg: KlawConfig | undefined; provider: string; modelId: string; agentDir?: string; profileId?: string; preferredProfile?: string; allowMissingApiKeyModes?: ReadonlyArray; allowBundledStaticCatalogFallback?: boolean; skipPiDiscovery?: boolean; modelResolver?: typeof resolveModelAsync; }): Promise; export declare function prepareSimpleCompletionModelForAgent(params: { cfg: KlawConfig; agentId: string; modelRef?: string; preferredProfile?: string; allowMissingApiKeyModes?: ReadonlyArray; allowBundledStaticCatalogFallback?: boolean; skipPiDiscovery?: boolean; modelResolver?: typeof resolveModelAsync; }): Promise; export declare function completeWithPreparedSimpleCompletionModel(params: { model: Model; auth: ResolvedProviderAuth; context: Parameters[1]; cfg?: KlawConfig; options?: SimpleCompletionModelOptions; }): Promise; export {};