import type { TelemetryPrefs } from './app-config.js';
export interface LangfuseConfig {
    authHeader: string;
    baseUrl: string;
    timeoutMs: number;
    retries: number;
}
export type TelemetrySinkConfig = {
    kind: 'relay';
    relayUrl: string;
    timeoutMs: number;
    retries: number;
} | ({
    kind: 'langfuse';
} & LangfuseConfig);
export interface RunSummary {
    runId: string;
    status: 'succeeded' | 'failed' | 'canceled';
    startedAt: number;
    endedAt: number;
    error?: string;
}
export interface MessageSummary {
    messageId: string;
    prompt: string;
    output: string;
    usage?: {
        inputTokens?: number;
        outputTokens?: number;
        totalTokens?: number;
    };
}
export interface ArtifactSummary {
    slug: string;
    type: string;
    sizeBytes: number;
    sha256?: string;
    createdAt?: string;
}
export interface ToolCallSummary {
    id: string;
    name: string;
    startedAt: number;
    endedAt: number;
    input?: string;
    output?: string;
    isError?: boolean;
}
export interface EventsSummary {
    toolCalls: number;
    errors: number;
    durationMs: number;
}
export interface RuntimeInfo {
    /** Node.js runtime version (`process.version`, e.g. 'v22.22.0'). */
    nodeVersion?: string;
    /** OS family (`os.platform()`, e.g. 'darwin' | 'win32' | 'linux'). */
    os?: string;
    /** OS kernel/release version (`os.release()`). */
    osRelease?: string;
    /** CPU architecture (`os.arch()`, e.g. 'arm64' | 'x64'). */
    arch?: string;
    /** Open Design app version reported by the daemon. */
    appVersion?: string;
    /** Build channel (development / nightly / beta / stable). */
    appChannel?: string;
    /** Whether the daemon is running inside a packaged build. */
    packaged?: boolean;
    /** Front-end carrier — `desktop` (Electron), `web` (browser), or unknown. */
    clientType?: 'desktop' | 'web' | 'unknown';
}
export interface TurnInfo {
    /** Model id at the time of this turn (e.g. 'claude-sonnet-4-5'). */
    model?: string;
    /** Reasoning level / effort knob if the agent supports it. */
    reasoning?: string;
    /** Skill id selected for this turn (if any). */
    skillId?: string;
    /** Design system id selected for this turn (if any). */
    designSystemId?: string;
}
export interface ReportContext {
    installationId: string | null;
    projectId: string;
    conversationId: string;
    agentId?: string;
    run: RunSummary;
    message: MessageSummary;
    artifacts: ArtifactSummary[];
    tools?: ToolCallSummary[];
    eventsSummary: EventsSummary;
    prefs: TelemetryPrefs;
    /** Per-turn config (model + skill + DS). May vary turn-to-turn within a session. */
    turn?: TurnInfo;
    /** Process- / build-level info collected once per daemon process. */
    runtime?: RuntimeInfo;
    extraTags?: string[];
}
export interface ReportRunOpts {
    config?: TelemetrySinkConfig | LangfuseConfig | null;
    fetchImpl?: typeof fetch;
}
export declare function readLangfuseConfig(env?: NodeJS.ProcessEnv): LangfuseConfig | null;
/**
 * Resolve telemetry delivery in release-safe order: hosted relay first,
 * direct Langfuse credentials second for local smoke tests, disabled last.
 */
export declare function readTelemetrySinkConfig(env?: NodeJS.ProcessEnv): TelemetrySinkConfig | null;
export declare function buildTracePayload(ctx: ReportContext): unknown[];
export declare function reportRunCompleted(ctx: ReportContext, opts?: ReportRunOpts): Promise<void>;
