import type { Db } from "@rudderhq/db";
import { activityLog } from "@rudderhq/db";
import { type UserActivityLedgerInclude, type UserActivityLedgerItem } from "@rudderhq/shared";
export interface ActivityFilters {
    orgId: string;
    agentId?: string;
    userId?: string;
    actorType?: "agent" | "user" | "system";
    actorId?: string;
    entityType?: string;
    entityId?: string;
}
export interface ActivityPageFilters extends ActivityFilters {
    limit?: number;
    cursor?: string | null;
}
export interface UserActivityLedgerFilters {
    orgId: string;
    userId: string;
    since?: Date;
    until?: Date;
    include?: UserActivityLedgerInclude[];
    agentId?: string;
    projectId?: string;
    issueId?: string;
    limit?: number;
    cursor?: string | null;
}
export declare function activityService(db: Db): {
    listUserActivityLedger: (filters: UserActivityLedgerFilters) => Promise<{
        items: UserActivityLedgerItem[];
        nextCursor: string | null;
    }>;
    list: (filters: ActivityFilters) => Promise<{
        id: string;
        orgId: string;
        createdAt: Date;
        runId: string | null;
        agentId: string | null;
        action: string;
        entityType: string;
        entityId: string;
        actorType: string;
        actorId: string;
        details: Record<string, unknown> | null;
    }[]>;
    listPage: (filters: ActivityPageFilters) => Promise<{
        items: {
            id: string;
            orgId: string;
            createdAt: Date;
            runId: string | null;
            agentId: string | null;
            action: string;
            entityType: string;
            entityId: string;
            actorType: string;
            actorId: string;
            details: Record<string, unknown> | null;
        }[];
        nextCursor: string | null;
    }>;
    forIssue: (issueId: string) => Promise<({
        id: string;
        orgId: string;
        createdAt: Date;
        runId: string | null;
        agentId: string | null;
        action: string;
        entityType: string;
        entityId: string;
        actorType: string;
        actorId: string;
        details: Record<string, unknown> | null;
    } | {
        details: {
            conversationTitle: string;
        };
        id: string;
        orgId: string;
        createdAt: Date;
        runId: string | null;
        agentId: string | null;
        action: string;
        entityType: string;
        entityId: string;
        actorType: string;
        actorId: string;
    })[]>;
    runsForIssue: (orgId: string, issueId: string) => Omit<import("drizzle-orm/pg-core").PgSelectBase<"heartbeat_runs", {
        runId: import("drizzle-orm/pg-core").PgColumn<{
            name: "id";
            tableName: "heartbeat_runs";
            dataType: "string";
            columnType: "PgUUID";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: true;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        status: import("drizzle-orm/pg-core").PgColumn<{
            name: "status";
            tableName: "heartbeat_runs";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        agentId: import("drizzle-orm/pg-core").PgColumn<{
            name: "agent_id";
            tableName: "heartbeat_runs";
            dataType: "string";
            columnType: "PgUUID";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        startedAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "started_at";
            tableName: "heartbeat_runs";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        finishedAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "finished_at";
            tableName: "heartbeat_runs";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        createdAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "created_at";
            tableName: "heartbeat_runs";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        invocationSource: import("drizzle-orm/pg-core").PgColumn<{
            name: "invocation_source";
            tableName: "heartbeat_runs";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        triggerDetail: import("drizzle-orm/pg-core").PgColumn<{
            name: "trigger_detail";
            tableName: "heartbeat_runs";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        contextSnapshot: import("drizzle-orm/pg-core").PgColumn<{
            name: "context_snapshot";
            tableName: "heartbeat_runs";
            dataType: "json";
            columnType: "PgJsonb";
            data: Record<string, unknown>;
            driverParam: unknown;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            $type: Record<string, unknown>;
        }>;
        usageJson: import("drizzle-orm/pg-core").PgColumn<{
            name: "usage_json";
            tableName: "heartbeat_runs";
            dataType: "json";
            columnType: "PgJsonb";
            data: Record<string, unknown>;
            driverParam: unknown;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            $type: Record<string, unknown>;
        }>;
        resultJson: import("drizzle-orm/pg-core").PgColumn<{
            name: "result_json";
            tableName: "heartbeat_runs";
            dataType: "json";
            columnType: "PgJsonb";
            data: Record<string, unknown>;
            driverParam: unknown;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            $type: Record<string, unknown>;
        }>;
    }, "partial", Record<"heartbeat_runs", "not-null">, false, "where" | "orderBy", {
        runId: string;
        status: string;
        agentId: string;
        startedAt: Date | null;
        finishedAt: Date | null;
        createdAt: Date;
        invocationSource: string;
        triggerDetail: string | null;
        contextSnapshot: Record<string, unknown> | null;
        usageJson: Record<string, unknown> | null;
        resultJson: Record<string, unknown> | null;
    }[], {
        runId: import("drizzle-orm/pg-core").PgColumn<{
            name: "id";
            tableName: "heartbeat_runs";
            dataType: "string";
            columnType: "PgUUID";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: true;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        status: import("drizzle-orm/pg-core").PgColumn<{
            name: "status";
            tableName: "heartbeat_runs";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        agentId: import("drizzle-orm/pg-core").PgColumn<{
            name: "agent_id";
            tableName: "heartbeat_runs";
            dataType: "string";
            columnType: "PgUUID";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        startedAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "started_at";
            tableName: "heartbeat_runs";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        finishedAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "finished_at";
            tableName: "heartbeat_runs";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        createdAt: import("drizzle-orm/pg-core").PgColumn<{
            name: "created_at";
            tableName: "heartbeat_runs";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        invocationSource: import("drizzle-orm/pg-core").PgColumn<{
            name: "invocation_source";
            tableName: "heartbeat_runs";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        triggerDetail: import("drizzle-orm/pg-core").PgColumn<{
            name: "trigger_detail";
            tableName: "heartbeat_runs";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        contextSnapshot: import("drizzle-orm/pg-core").PgColumn<{
            name: "context_snapshot";
            tableName: "heartbeat_runs";
            dataType: "json";
            columnType: "PgJsonb";
            data: Record<string, unknown>;
            driverParam: unknown;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            $type: Record<string, unknown>;
        }>;
        usageJson: import("drizzle-orm/pg-core").PgColumn<{
            name: "usage_json";
            tableName: "heartbeat_runs";
            dataType: "json";
            columnType: "PgJsonb";
            data: Record<string, unknown>;
            driverParam: unknown;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            $type: Record<string, unknown>;
        }>;
        resultJson: import("drizzle-orm/pg-core").PgColumn<{
            name: "result_json";
            tableName: "heartbeat_runs";
            dataType: "json";
            columnType: "PgJsonb";
            data: Record<string, unknown>;
            driverParam: unknown;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            $type: Record<string, unknown>;
        }>;
    }>, "where" | "orderBy">;
    issuesForRun: (runId: string) => Promise<{
        issueId: string;
        identifier: string | null;
        title: string;
        status: string;
        priority: string;
    }[]>;
    create: (data: typeof activityLog.$inferInsert) => Promise<{
        id: string;
        orgId: string;
        createdAt: Date;
        runId: string | null;
        agentId: string | null;
        action: string;
        entityType: string;
        entityId: string;
        actorType: string;
        actorId: string;
        details: Record<string, unknown> | null;
    }>;
};
//# sourceMappingURL=activity.d.ts.map