/** * Canonical runtime/model contract for SDK query and init surfaces. * * Phase 5 keeps SDK as the source of truth for runtime-model semantics. * The contract preserves explicit model binding, inherit binding, and * runtime-default binding as distinct outcomes instead of flattening * everything into ad hoc strings. */ import type { GSDConfig, ResolveModelIdsSetting } from '../config.js'; import { type Runtime } from './helpers.js'; export declare const PROFILE_MODEL_KEYS: readonly ["quality", "balanced", "budget", "adaptive"]; export type ProfileModelKey = (typeof PROFILE_MODEL_KEYS)[number]; export declare const MODEL_PROFILES: Record>; export declare const VALID_PROFILES: readonly ["quality", "balanced", "budget", "adaptive", "inherit"]; export declare const ACCEPTED_MODEL_PROFILES: readonly ["quality", "balanced", "budget", "adaptive", "inherit"]; export type AcceptedModelProfile = (typeof ACCEPTED_MODEL_PROFILES)[number]; export type BindingKind = 'explicit' | 'profile' | 'inherit' | 'runtime-default'; export type BindingSource = 'override' | 'profile' | 'inherit-profile' | 'resolve-model-omit'; export type RejectionReason = 'unknown-agent' | 'missing-contract-coverage' | 'runtime-model-unsupported' | 'missing-runtime-binding-channel'; export type ModelFamily = 'anthropic' | 'openai' | 'google' | 'unknown'; export interface RuntimeCapability { runtime: Runtime; supportsExplicitModel: boolean; supportsInheritBinding: boolean; supportsRuntimeDefaultBinding: boolean; supportsCrossAiExecution: boolean; explicitModelFamilies: readonly ModelFamily[]; } export declare const RUNTIME_CAPABILITIES: Record; export interface RuntimeModelDiagnostic { agent: string; runtime: Runtime; profile: AcceptedModelProfile; bindingKind: BindingKind; source: BindingSource; configuredModel: string | null; resolvedModel: string | null; suggestedFix: string; } export interface ResolvedAgentBinding extends RuntimeModelDiagnostic { kind: 'resolved'; knownAgent: true; modelToken: string | null; resolveModelIds: ResolveModelIdsSetting | undefined; runtimeCapability: RuntimeCapability; crossAiExecutionConfigured: boolean; } export interface UnsupportedAgentBinding extends RuntimeModelDiagnostic { kind: 'unsupported'; knownAgent: false; rejectionReason: RejectionReason; message: string; modelToken: null; resolveModelIds: ResolveModelIdsSetting | undefined; runtimeCapability: RuntimeCapability; crossAiExecutionConfigured: boolean; } export type RuntimeModelResolution = ResolvedAgentBinding | UnsupportedAgentBinding; export interface SerializedRuntimeModelResolution { agent: string; status: RuntimeModelResolution['kind']; known_agent: boolean; runtime: Runtime; profile: AcceptedModelProfile; binding_kind: BindingKind; source: BindingSource; configured_model: string | null; resolved_model: string | null; model_token: string | null; resolve_model_ids: ResolveModelIdsSetting | undefined; suggested_fix: string; cross_ai: { execution_supported: boolean; execution_configured: boolean; }; runtime_capability: { supports_explicit_model: boolean; supports_inherit_binding: boolean; supports_runtime_default_binding: boolean; }; rejection_reason?: RejectionReason; message?: string; } export type RuntimeEnforcementStatus = 'unknown' | boolean; export type RuntimeBindingChannelKind = 'hermes-delegate-task-model' | 'runtime-native-model-parameter' | 'none'; export type RuntimeBindingChannelProofLevel = 'child-construction' | 'runtime-dispatch' | 'none'; export interface RuntimeBindingChannel { kind: RuntimeBindingChannelKind; available: boolean; proof_level: RuntimeBindingChannelProofLevel; reason: string | null; suggested_fix: string | null; } export type RuntimeModelReceiptEnforceability = 'explicit-token-needs-runtime-proof' | 'inherits-or-runtime-default' | 'unsupported'; export interface RuntimeModelReceipt extends SerializedRuntimeModelResolution { role: string; provider_family: ModelFamily; resolved_by_gsd: boolean; passed_to_runtime: boolean; runtime_enforced: RuntimeEnforcementStatus; enforceability: RuntimeModelReceiptEnforceability; runtime_binding_channel: RuntimeBindingChannel; } export declare const MODEL_ALIAS_MAP: Record; export declare function detectModelFamily(model: string | null | undefined): ModelFamily; export interface RuntimeCompatibilityResult { supported: boolean; runtime: Runtime; model: string | null; family: ModelFamily; reason: string | null; } export declare function evaluateRuntimeModelCompatibility(runtime: Runtime, model: string | null): RuntimeCompatibilityResult; export declare function runtimeBindingChannelForRuntime(runtime: Runtime, options?: { hermesDelegateModelChannelAvailable?: boolean; }): RuntimeBindingChannel; export declare function normalizeModelProfile(profile: unknown): AcceptedModelProfile; export declare function isAcceptedModelProfile(profile: string): profile is AcceptedModelProfile; export declare function getAgentToModelMapForProfile(profileInput: string): Record; export declare function resolveAgentBinding(config: GSDConfig | Record, agent: string): RuntimeModelResolution; export declare function toLegacyResolveModelResult(resolution: RuntimeModelResolution): Record; export declare function serializeRuntimeModelResolution(resolution: RuntimeModelResolution): SerializedRuntimeModelResolution; export declare function toRuntimeModelReceipt(resolution: RuntimeModelResolution, role: string): RuntimeModelReceipt; export declare function toLegacyModelToken(resolution: RuntimeModelResolution, fallback?: string): string; export declare function toInitModelToken(resolution: RuntimeModelResolution): string; //# sourceMappingURL=runtime-model-contract.d.ts.map