import type { ChildProcess } from 'node:child_process'; import type { RuntimeProfileSpec } from './cli-adapters/base.js'; interface AdapterLaunch { bin: string; args: string[]; cwd?: string; env: NodeJS.ProcessEnv; baseUrl: string; healthUrl: string; } export declare function validateRuntimeProfile(profile: RuntimeProfileSpec): void; export declare const MODEL_ROUTING_ENV_KEYS: readonly ["ANTHROPIC_MODEL", "ANTHROPIC_DEFAULT_OPUS_MODEL", "ANTHROPIC_DEFAULT_SONNET_MODEL", "ANTHROPIC_DEFAULT_HAIKU_MODEL"]; export declare function applyClaudeRuntimeProfileEnvPolicy(env: NodeJS.ProcessEnv, profile: RuntimeProfileSpec | null | undefined): NodeJS.ProcessEnv; export declare function resolveClaudeExecutionEffort(slice: { effort?: string; } | null | undefined, profile: RuntimeProfileSpec | null | undefined, env?: NodeJS.ProcessEnv): { effort: string | null; env?: NodeJS.ProcessEnv; }; export declare const DEFAULT_REQUESTED_MAX_OUTPUT_TOKENS = 32000; export declare const DEFAULT_SAFETY_MARGIN_TOKENS = 40000; export declare const MIN_OUTPUT_TOKENS = 1024; export declare function estimateTokens(text: string | null | undefined): number; export interface PromptTokenEstimate { role_prompt: number; harness_append: number; first_turn: number; known_total: number; } export declare function estimatePromptTokens(rolePrompt: string | null | undefined, harnessAppend: string | null | undefined, firstTurnText: string | null | undefined): PromptTokenEstimate; export declare class ContextBudgetExhaustedError extends Error { readonly code = "context_budget_exhausted"; constructor(message: string); } export declare function resolveEffectiveMaxOutputTokens(params: { contextWindow: number; knownInputTokens: number; requestedMaxOutputTokens: number; safetyMarginTokens: number; }): number; export interface MaxOutputTokensResolution { env: Record; estimate: PromptTokenEstimate; effectiveMaxOutputTokens: number | null; safetyMarginTokens: number; } export declare function resolveMaxOutputTokensEnv(profile: RuntimeProfileSpec | null | undefined, params: { rolePrompt?: string | null; harnessAppend?: string | null; firstTurnText?: string | null; }): MaxOutputTokensResolution; export declare const MANAGER_CAPABILITY_CONTEXT_WINDOW_CLAMP = "context_window_clamp"; export declare const MANAGER_CAPABILITIES: readonly string[]; export declare const TOOL_PROFILE_COMPACT_THRESHOLD_TOKENS = 128000; export declare function resolveToolProfileHeader(profile: RuntimeProfileSpec | null | undefined): Record; export declare class RuntimeLease { #private; readonly profile: RuntimeProfileSpec; readonly launch: AdapterLaunch | null; readonly child: ChildProcess | null; readonly credentialEnv: Record; constructor(profile: RuntimeProfileSpec, launch: AdapterLaunch | null, child: ChildProcess | null, credentialEnv: Record, release?: (() => Promise) | null); claudeEnv(): Record; claudeExecutable(): string | null; close(): Promise; terminate(managerDrain?: boolean): Promise; } export declare function startRuntimeProfile(profile: RuntimeProfileSpec, credentialEnv?: Record): Promise; export declare function runtimeCredentialEnv(profile: RuntimeProfileSpec, credentialId: string | null | undefined, agentCredentialEnv: Record | undefined): Record; export declare function shutdownRuntimeProfiles(): Promise; export {};