/**
 * Session trace uploader.
 *
 * Listens for agent_end events and uploads the session JSONL (and any
 * subagent JONLs) to the Shortcut backend for centralized trace storage.
 *
 * Subagent linking: when the parent session contains task tool results
 * with sessionFile paths, those subagent JONLs are uploaded too. The
 * parent's JSONL references subagent session IDs via details.sessionId,
 * forming a tree queryable in ClickHouse.
 */
import type { AgentSession } from '../../app/agent-session.js';
interface TraceUploadLogInput {
    module: 'trace_upload';
    event: string;
    data?: Record<string, unknown>;
}
interface TraceUploadLogger {
    info(input: TraceUploadLogInput): void;
    warn(input: TraceUploadLogInput): void;
    error(input: TraceUploadLogInput): void;
}
interface SessionUploadOptions {
    getAccessToken: () => string | undefined;
    /** Reactive check — evaluated at upload time so mid-session toggles take effect. */
    isEnabled: () => boolean;
    /** When true, subagent session files are NOT deleted after upload. Used by benchmarks. */
    keepSubagentFiles?: boolean;
    logger?: TraceUploadLogger;
}
/**
 * Upload JSONL content to the trace endpoint.
 * Pure HTTP — no file I/O, no constants. Exported for testing.
 */
export declare function uploadTrace(content: string, baseUrl: string, accessToken: string): Promise<{
    ok: boolean;
    status: number;
    body?: string;
}>;
/** Subscribe to a session and upload its trace JSONL on agent_end. */
export declare function attachSessionUpload(session: AgentSession, options: SessionUploadOptions): () => void;
export {};
//# sourceMappingURL=session-upload.d.ts.map