/** * infinicode — Extended config schema for OpenKernel. * * Adds worker model pinning + cloud provider credentials on top of the * original Ollama master config. */ import type { WorkerType } from '../kernel/types.js'; export interface CloudProviderConfig { id: string; name: string; /** * Provider kind. 'local' registers the provider as a local (offline-eligible) * endpoint — the router applies its localBonus and 'offline' mode includes it, * and no API key is required. Defaults to 'cloud' when omitted. */ type?: 'local' | 'cloud'; baseURL: string; apiKey?: string; headerName?: string; enabled: boolean; } export interface WorkerModelPref { /** Provider+model pair, e.g. "ollama/qwen2.5-coder:14b" or "groq/llama-3.3-70b-versatile". */ providerId: string; modelId: string; } /** Device-mesh / federation settings. */ export interface FederationConfig { /** Enable the mesh on `infinicode serve`. */ enabled?: boolean; /** This node's role in the mesh. */ role?: 'hub' | 'peer' | 'satellite' | 'relay'; /** Friendly node name (defaults to hostname). */ displayName?: string; /** Mesh listen port (default 47913). */ port?: number; host?: string; /** Shared bearer token peers must present (app-layer auth). */ token?: string; /** Base URLs of peers to connect to on start. */ seeds?: string[]; /** Seconds between peer heartbeats (default 30). */ heartbeatSec?: number; /** Accept + apply auto-updates announced by a hub/relay. */ autoUpdate?: boolean; /** Hub/relay npm-release polling interval in milliseconds (default 60000). */ updatePollMs?: number; /** Node runs under a process supervisor — allow `/update` to exit-for-restart. */ supervised?: boolean; /** Zero-config LAN discovery: broadcast + auto-connect peers on this subnet. */ lan?: boolean; /** UDP discovery port for LAN discovery (default 47915). */ lanPort?: number; } export interface InfinicodeConfig { masterUrl: string; tailscaleMasterUrl?: string; defaultModel: string; theme: string; policy?: string; workerModels?: Partial>; cloudProviders?: CloudProviderConfig[]; /** * Local OpenAI-compatible servers (LM Studio, vLLM, SGLang, llama.cpp). * Registered with type 'local'; no API key required. */ localProviders?: CloudProviderConfig[]; federation?: FederationConfig; } export declare const DEFAULT_CONFIG: InfinicodeConfig; export declare const WORKER_TYPES_ORDER: WorkerType[]; export declare const WORKER_DESCRIPTIONS: Record;