import { HandoffLocalGitState as HandoffLocalGitState$1, GitHandoffCheckpoint } from '@posthog/git/handoff';

/**
 * Stored custom notification following ACP extensibility model.
 * Custom notifications use underscore-prefixed methods (e.g., `_posthog/phase_start`).
 * See: https://agentclientprotocol.com/docs/extensibility
 */
interface StoredNotification {
    type: "notification";
    /** When this notification was stored */
    timestamp: string;
    /** JSON-RPC 2.0 notification (no id field = notification, not request) */
    notification: {
        jsonrpc: "2.0";
        method: string;
        params?: Record<string, unknown>;
    };
}
/**
 * Type alias for stored log entries.
 */
type StoredEntry = StoredNotification;
interface Task {
    id: string;
    task_number?: number;
    slug?: string;
    title: string;
    description: string;
    origin_product: "error_tracking" | "eval_clusters" | "user_created" | "support_queue" | "session_summaries" | "signal_report";
    github_integration?: number | null;
    repository: string;
    json_schema?: Record<string, unknown> | null;
    internal?: boolean;
    created_at: string;
    updated_at: string;
    created_by?: {
        id: number;
        uuid: string;
        distinct_id: string;
        first_name: string;
        email: string;
    };
    latest_run?: TaskRun;
}
type ArtifactType = "plan" | "context" | "reference" | "output" | "artifact" | "user_attachment";
interface TaskRunArtifact {
    id?: string;
    name: string;
    type: ArtifactType;
    source?: string;
    size?: number;
    content_type?: string;
    storage_path?: string;
    uploaded_at?: string;
}
type TaskRunStatus = "not_started" | "queued" | "in_progress" | "completed" | "failed" | "cancelled";
type TaskRunEnvironment = "local" | "cloud";
interface TaskRun {
    id: string;
    task: string;
    team: number;
    branch: string | null;
    stage: string | null;
    environment: TaskRunEnvironment;
    status: TaskRunStatus;
    log_url: string;
    error_message: string | null;
    output: Record<string, unknown> | null;
    state: Record<string, unknown>;
    artifacts?: TaskRunArtifact[];
    created_at: string;
    updated_at: string;
    completed_at: string | null;
}
interface ProcessSpawnedCallback {
    onProcessSpawned?: (info: {
        pid: number;
        command: string;
        sessionId?: string;
    }) => void;
    onProcessExited?: (pid: number) => void;
    onMcpServersReady?: (serverNames: string[]) => void;
}
interface TaskExecutionOptions {
    repositoryPath?: string;
    adapter?: "claude" | "codex";
    model?: string;
    gatewayUrl?: string;
    codexBinaryPath?: string;
    instructions?: string;
    processCallbacks?: ProcessSpawnedCallback;
    /** Callback invoked when the agent calls the create_output tool for structured output */
    onStructuredOutput?: (output: Record<string, unknown>) => Promise<void>;
    /** Additional directories the agent process can access beyond cwd. */
    additionalDirectories?: string[];
}
type LogLevel = "debug" | "info" | "warn" | "error";
type OnLogCallback = (level: LogLevel, scope: string, message: string, data?: unknown) => void;
interface PostHogAPIConfig {
    apiUrl: string;
    getApiKey: () => string | Promise<string>;
    refreshApiKey?: () => string | Promise<string>;
    projectId: number;
    userAgent?: string;
}
interface OtelTransportConfig {
    /** PostHog ingest host, e.g., "https://us.i.posthog.com" */
    host: string;
    /** Project API key */
    apiKey: string;
    /** Override the logs endpoint path (default: /i/v1/logs) */
    logsPath?: string;
}
interface AgentConfig {
    posthog?: PostHogAPIConfig;
    /** OTEL transport config for shipping logs to PostHog Logs */
    otelTransport?: OtelTransportConfig;
    /** Skip session log persistence (e.g. for preview sessions with no real task) */
    skipLogPersistence?: boolean;
    /** Local cache path for instant log loading (e.g., ~/.posthog-code) */
    localCachePath?: string;
    /**
     * Annotate files the agent reads with PostHog enrichment (event volume,
     * flag rollout/staleness, experiment links). Defaults to enabled when
     * `posthog` config is present; set `{ enabled: false }` to opt out.
     */
    enricher?: {
        enabled?: boolean;
    };
    debug?: boolean;
    onLog?: OnLogCallback;
}
interface DeviceInfo {
    type: "local" | "cloud";
    name?: string;
}
type AgentMode = "interactive" | "background";
type FileStatus = "A" | "M" | "D";
interface FileChange {
    path: string;
    status: FileStatus;
}
type HandoffLocalGitState = HandoffLocalGitState$1;
interface GitCheckpoint extends GitHandoffCheckpoint {
    artifactPath?: string;
    indexArtifactPath?: string;
}
interface GitCheckpointEvent extends GitCheckpoint {
    device?: DeviceInfo;
}
/**
 * Keeps the emitted `@posthog/agent/types` entrypoint as a runtime ESM module.
 *
 * `export {}` is stripped by tsup in this package, which leaves `dist/types.js`
 * empty and breaks downstream type resolution for the exported subpath.
 */
declare const AGENT_TYPES_MODULE = true;

export { AGENT_TYPES_MODULE, type AgentConfig, type AgentMode, type ArtifactType, type DeviceInfo, type FileChange, type FileStatus, type GitCheckpoint, type GitCheckpointEvent, type HandoffLocalGitState, type LogLevel, type OnLogCallback, type OtelTransportConfig, type PostHogAPIConfig, type ProcessSpawnedCallback, type StoredEntry, type StoredNotification, type Task, type TaskExecutionOptions, type TaskRun, type TaskRunArtifact, type TaskRunEnvironment, type TaskRunStatus };
