import type { DaemonRuntimeConfig, LocalAiBootstrapMode, LocalAiMode } from "../config.js"; import { type LocalAiTaskName, type LocalAiTaskPosture, type LocalAiTaskRequiredTier } from "./policy.js"; export type { LocalAiTaskName, LocalAiTaskPosture, LocalAiTaskRequiredTier } from "./policy.js"; export declare const LOCAL_AI_MODEL_ID = "LiquidAI/LFM2.5-1.2B-Instruct"; export declare const LOCAL_AI_RUNTIME_ID = "lfm2.5-1.2b-instruct"; export declare const LOCAL_AI_MODEL_FORMAT = "gguf"; export declare const LOCAL_AI_RUNNER_ENTRY = "lfm-runner.mjs"; export declare const LOCAL_AI_RUNTIME_FAMILY = "llama.cpp"; export declare const LOCAL_AI_RUNTIME_BINARY_NAME = "llama-cli"; export declare const LOCAL_AI_RUNTIME_SERVER_NAME = "llama-server"; export declare const LOCAL_AI_RUNTIME_ARCHIVE_FORMAT = "tar.gz"; export type LocalAiBundleState = "disabled" | "installing" | "healthy" | "degraded" | "missing-bundle" | "checksum-failure" | "invalid-metadata"; export type LocalAiFailureCategory = "bootstrap-failure" | "missing-bundle" | "checksum-failure" | "invalid-metadata" | "runner-unavailable" | "runner-failure" | "inference-timeout" | "invalid-json" | "fallback-activation" | "adapter-unavailable" | "unknown"; export type LocalAiWorkerState = "disabled" | "stopped" | "starting" | "warm" | "busy" | "unhealthy" | "restart-requested"; export interface LocalAiBundledManifest { version: string; modelId: typeof LOCAL_AI_MODEL_ID; runtimeId: typeof LOCAL_AI_RUNTIME_ID; format: typeof LOCAL_AI_MODEL_FORMAT; quantization: string; sourceFilename: string; sourceUrl: string; sha256: string; maxContext: number; recommendedTasks: LocalAiTaskName[]; } export interface LocalAiManifest { model_id: typeof LOCAL_AI_MODEL_ID; runtime_id: typeof LOCAL_AI_RUNTIME_ID; format: typeof LOCAL_AI_MODEL_FORMAT; version: string; quantization: string; sha256: string; source: string; max_context: number; recommended_tasks: LocalAiTaskName[]; } export interface LocalAiBundledRunnerManifest { version: string; modelId: typeof LOCAL_AI_MODEL_ID; runtimeId: typeof LOCAL_AI_RUNTIME_ID; entryFilename: typeof LOCAL_AI_RUNNER_ENTRY; source: "coppermind-managed"; entrySha256: string; runtimeFamily: typeof LOCAL_AI_RUNTIME_FAMILY; runtimeBinaryName: typeof LOCAL_AI_RUNTIME_BINARY_NAME; runtimeArchiveFormat: typeof LOCAL_AI_RUNTIME_ARCHIVE_FORMAT; runtimeExtractStripComponents: 1; platforms: Record; } export interface LocalAiRunnerManifest { model_id: typeof LOCAL_AI_MODEL_ID; runtime_id: typeof LOCAL_AI_RUNTIME_ID; entry_filename: typeof LOCAL_AI_RUNNER_ENTRY; version: string; source: "coppermind-managed"; entry_sha256: string; runtime_family: typeof LOCAL_AI_RUNTIME_FAMILY; runtime_binary_name: typeof LOCAL_AI_RUNTIME_BINARY_NAME; runtime_archive_format: typeof LOCAL_AI_RUNTIME_ARCHIVE_FORMAT; runtime_extract_strip_components: 1; platforms: Record; } export interface LocalAiRunnerPlatformAsset { sourceFilename: string; sourceUrl: string; sha256: string; } export interface LocalAiRunnerPlatformAssetOnDisk { source_filename: string; source_url: string; sha256: string; } export interface LocalAiChecksums { version: 1; files: { "model.gguf": string; }; } export interface LocalAiRunnerChecksums { version: 1; files: { [LOCAL_AI_RUNNER_ENTRY]: string; }; } export interface LocalAiInstallState { version: 4; model_id: typeof LOCAL_AI_MODEL_ID; runtime_id: typeof LOCAL_AI_RUNTIME_ID; bootstrap: LocalAiBootstrapMode; advisory_only: true; structured_output_only: boolean; bundle_state: Exclude; installed: boolean; healthy: boolean; runner_installed: boolean; runner_healthy: boolean; fallback_mode: boolean; metadata_prepared_at: string; last_checked_at: string | null; last_verified_at: string | null; last_bootstrap_started_at: string | null; last_bootstrap_completed_at: string | null; last_bootstrap_failed_at: string | null; last_error: string | null; last_error_category: LocalAiFailureCategory | null; last_task_name: LocalAiTaskName | null; last_task_at: string | null; last_task_mode: "model" | "fallback" | null; last_task_reason: string | null; task_status: Record; } export interface LocalAiSnapshot { enabled: boolean; mode: LocalAiMode; bootstrap: LocalAiBootstrapMode; modelId: typeof LOCAL_AI_MODEL_ID; runtimeId: typeof LOCAL_AI_RUNTIME_ID; advisoryOnly: true; structuredOutputOnly: boolean; state: LocalAiBundleState; bundleState: LocalAiBundleState; bundleHealthy: boolean; deterministicFallbackActive: boolean; fallbackMode: boolean; workerState: LocalAiWorkerState; workerHealthy: boolean; workerPid: number | null; workerStartedAt: string | null; workerReadyAt: string | null; workerLastError: string | null; rootDir: string; modelPath: string; manifestPath: string; checksumsPath: string; installPath: string; runnerRootDir: string; runnerEntryPath: string; runnerManifestPath: string; runnerChecksumsPath: string; installed: boolean; healthy: boolean; modelPresent: boolean; runnerPresent: boolean; runnerInstalled: boolean; runnerHealthy: boolean; lastCheckedAt: string | null; lastVerifiedAt: string | null; metadataPreparedAt: string | null; lastBootstrapStartedAt: string | null; lastBootstrapCompletedAt: string | null; lastBootstrapFailedAt: string | null; lastTaskName: LocalAiTaskName | null; lastTaskAt: string | null; lastTaskMode: "model" | "fallback" | null; lastTaskReason: string | null; lastError: string | null; lastErrorCategory: LocalAiFailureCategory | null; taskStatus: Record; activeTasks: LocalAiTaskName[]; shadowOnlyTasks: LocalAiTaskName[]; deterministicOnlyTasks: LocalAiTaskName[]; taskFallbacks: LocalAiTaskName[]; } export interface LocalAiRepairAction { action: string; status: "applied" | "skipped" | "failed"; detail: string; } export interface LocalAiTaskOutcome { taskName: LocalAiTaskName; mode: "model" | "fallback"; reason: string | null; failureCategory?: LocalAiFailureCategory | null; } export interface LocalAiTaskStatusRecord { posture: LocalAiTaskPosture; required_tier: LocalAiTaskRequiredTier; eligible: boolean; fallback_active: boolean; last_at: string | null; last_mode: "model" | "fallback" | null; last_reason: string | null; last_failure_category: LocalAiFailureCategory | null; timeout_count: number; invalid_json_count: number; validator_rejection_count: number; } export interface LocalAiTaskStatus { posture: LocalAiTaskPosture; requiredTier: LocalAiTaskRequiredTier; eligible: boolean; fallbackActive: boolean; lastAt: string | null; lastMode: "model" | "fallback" | null; lastReason: string | null; lastFailureCategory: LocalAiFailureCategory | null; timeoutCount: number; invalidJsonCount: number; validatorRejectionCount: number; } export interface LocalAiWorkerRuntimeSnapshot { state: LocalAiWorkerState; healthy: boolean; pid: number | null; startedAt: string | null; readyAt: string | null; lastError: string | null; } export declare function getLocalAiLockPath(config: DaemonRuntimeConfig): string; export declare function readBundledLocalAiManifest(): LocalAiBundledManifest; export declare function readBundledLocalAiRunnerManifest(): LocalAiBundledRunnerManifest; export declare function resolveBundledLocalAiRunnerScript(): { path: string; sha256: string; }; export declare function resolveLocalAiRuntimePlatformKey(platform?: NodeJS.Platform, arch?: string): string; export declare function resolveBundledLocalAiRuntimeAsset(platformKey?: string): LocalAiRunnerPlatformAsset; export declare function readLocalAiSnapshot(config: DaemonRuntimeConfig): LocalAiSnapshot; export declare function ensureLocalAiBootstrapMetadata(config: DaemonRuntimeConfig): { snapshot: LocalAiSnapshot; actions: LocalAiRepairAction[]; }; export declare function updateLocalAiInstallState(config: DaemonRuntimeConfig, updater: (current: LocalAiInstallState) => LocalAiInstallState): LocalAiSnapshot; export declare function recordLocalAiTaskOutcome(config: DaemonRuntimeConfig, outcome: LocalAiTaskOutcome): LocalAiSnapshot; export declare function markLocalAiInstalling(config: DaemonRuntimeConfig): LocalAiSnapshot; export declare function markLocalAiHealthy(config: DaemonRuntimeConfig): LocalAiSnapshot; export declare function markLocalAiFailure(config: DaemonRuntimeConfig, state: Exclude, error: string, category: LocalAiFailureCategory): LocalAiSnapshot; export declare function withLocalAiWorkerSnapshot(snapshot: LocalAiSnapshot, worker: LocalAiWorkerRuntimeSnapshot | null): LocalAiSnapshot; export declare function shouldLogLocalAiTaskFallback(previous: LocalAiSnapshot, next: LocalAiSnapshot, taskName: LocalAiTaskName, reason: string | null): boolean; export declare function hydrateLocalAiSnapshotFromRecord(base: LocalAiSnapshot, value: unknown): LocalAiSnapshot; //# sourceMappingURL=model-manager.d.ts.map