import { type Anomaly, type AnomalyDetector } from '../debug/detector.js'; import type { ChatHandler } from './chat.js'; import { InvestigationBudget } from './budget.js'; import type { CheckRunner } from '../checks/runner.js'; import { type CheckRule } from '../checks/types.js'; import type { StorageAdapter } from './types.js'; export interface CollectorOptions { /** Default 4318 (standard OTLP/HTTP port). 0 = random free port. */ port?: number; host?: string; storage?: StorageAdapter; /** When set, ingest requires a matching `x-api-key` header. */ apiKey?: string; /** * Password for the UI, the query API and the chat (HTTP Basic Auth, any user name) — what people open in a browser. * Ingest keeps its x-api-key, /health stays open for uptime checks. */ uiPassword?: string; /** Default 10 MB. */ maxBodyBytes?: number; /** Built UI to serve at /. Default: the package's dist/ui. `false` disables it. */ uiDir?: string | false; /** Agents answering /api/chat (the CLI always provides them); absent → chat disabled. */ chat?: { mode: 'mock' | 'real'; handle: ChatHandler; }; /** Watches ingested spans; on an anomaly pushes it to /api/chat/events and, with `chat`, investigates on its own. */ detector?: Pick; /** How often the detector window is checked. Default 5 s. */ detectorIntervalMs?: number; /** How many investigations the observer starts on its own per period. Default 5 per 60 min. */ budget?: InvestigationBudget; /** Scheduled checks (observe.checks.ts) whose results /api/checks reports; absent → none configured. */ checks?: Pick & Partial> & { anomalies?: () => Anomaly[]; /** The thresholds behind `anomalies`, for the Checks page. */ rule?: CheckRule; }; } export interface Collector { url: string; port: number; storage: StorageAdapter; close(): Promise; } export declare function startCollector(options?: CollectorOptions): Promise;