import type { Id } from "./_generated/dataModel.js"; type UserAgentStatus = "draft" | "pairing" | "active" | "disabled" | "failed"; type PairingStatus = "pending" | "used" | "expired" | null; type UserAgentView = { consumerUserId: string; agentKey: string; displayName: string | null; telegramUsername: string | null; version: string | null; status: UserAgentStatus; bindingStatus: "active" | "revoked" | null; pairingStatus: PairingStatus; conversationId: string | null; canCreateNewAgent: boolean; canDisable: boolean; canChat: boolean; canManagePushJobs: boolean; }; type UserAgentsOverview = { agents: Array; activeAgentKey: string | null; canCreateNewAgent: boolean; }; type OnboardingNextAction = "import_token" | "configure_webhook" | "create_pairing" | "complete_pairing" | "ready"; type OnboardingState = { agentKey: string; telegramUsername: string | null; botIdentity: string | null; tokenSecretRef: string | null; tokenImported: boolean; webhookReady: boolean; pairingCode: string | null; pairingStatus: PairingStatus; pairingDeepLink: string | null; nextAction: OnboardingNextAction; }; export declare const configureTelegramWebhook: import("convex/server").RegisteredAction<"public", { agentKey?: string | undefined; secretRef?: string | undefined; convexSiteUrl: string; }, Promise<{ ok: boolean; webhookUrl: string; currentUrl: string | null; botIdentity: string; secretTokenConfigured: boolean; isReady: boolean; pendingUpdateCount: number; lastErrorMessage: string | null; lastErrorDate: number | null; description: string; }>>; export declare const createPairingCode: import("convex/server").RegisteredMutation<"public", { nowMs?: number | undefined; ttlMs?: number | undefined; agentKey: string; consumerUserId: string; }, Promise<{ code: string; consumerUserId: string; agentKey: string; botIdentity: string; status: "pending"; createdAt: number; expiresAt: number; usedAt: null; telegramUserId: null; telegramChatId: null; }>>; export declare const consumePairingCode: import("convex/server").RegisteredMutation<"public", { botIdentity?: string | undefined; nowMs?: number | undefined; telegramChatId: string; telegramUserId: string; code: string; }, Promise<{ code: string; consumerUserId: string; agentKey: string; botIdentity: string; status: "used"; createdAt: number; expiresAt: number; usedAt: number; telegramUserId: string; telegramChatId: string; }>>; export declare const getPairingCodeStatus: import("convex/server").RegisteredQuery<"public", { nowMs?: number | undefined; code: string; }, Promise<{ code: string; consumerUserId: string; agentKey: string; botIdentity: string | null; status: "pending" | "used" | "expired"; createdAt: number; expiresAt: number; usedAt: number | null; telegramUserId: string | null; telegramChatId: string | null; } | null>>; export declare const bindUserAgent: import("convex/server").RegisteredMutation<"public", { botIdentity?: string | undefined; metadata?: Record | undefined; nowMs?: number | undefined; source?: "manual" | "telegram_pairing" | "api" | undefined; telegramChatId?: string | undefined; telegramUserId?: string | undefined; agentKey: string; consumerUserId: string; }, Promise<{ consumerUserId: string; agentKey: string; conversationId: string; botIdentity: string | null; status: "active" | "revoked"; source: "manual" | "telegram_pairing" | "api"; telegramUserId: string | null; telegramChatId: string | null; metadata: Record | null; boundAt: number; revokedAt: number | null; }>>; export declare const revokeUserAgentBinding: import("convex/server").RegisteredMutation<"public", { nowMs?: number | undefined; consumerUserId: string; }, Promise<{ revoked: number; }>>; export declare const resolveAgentForUser: import("convex/server").RegisteredQuery<"public", { consumerUserId: string; }, Promise<{ consumerUserId: string; agentKey: string | null; }>>; export declare const resolveAgentForTelegram: import("convex/server").RegisteredQuery<"public", { botIdentity?: string | undefined; telegramChatId?: string | undefined; telegramUserId?: string | undefined; }, Promise<{ consumerUserId: string | null; agentKey: string | null; conversationId: string | null; }>>; export declare const getUserAgentBinding: import("convex/server").RegisteredQuery<"public", { consumerUserId: string; }, Promise<{ consumerUserId: string; agentKey: string; conversationId: string; botIdentity: string | null; status: "active" | "revoked"; source: "manual" | "telegram_pairing" | "api"; telegramUserId: string | null; telegramChatId: string | null; metadata: Record | null; boundAt: number; revokedAt: number | null; } | null>>; export declare const listUserAgents: import("convex/server").RegisteredQuery<"public", { nowMs?: number | undefined; includeDisabled?: boolean | undefined; consumerUserId: string; }, Promise>; export declare const getUserAgent: import("convex/server").RegisteredQuery<"public", { nowMs?: number | undefined; agentKey: string; consumerUserId: string; }, Promise>; export declare const getActiveUserAgent: import("convex/server").RegisteredQuery<"public", { nowMs?: number | undefined; consumerUserId: string; }, Promise>; export declare const getUserAgentsOverview: import("convex/server").RegisteredQuery<"public", { nowMs?: number | undefined; consumerUserId: string; }, Promise>; export declare const createUserAgentPairing: import("convex/server").RegisteredMutation<"public", { nowMs?: number | undefined; ttlMs?: number | undefined; agentKey: string; consumerUserId: string; }, Promise<{ pairing: { code: string; consumerUserId: string; agentKey: string; botIdentity: string; status: "pending"; createdAt: number; expiresAt: number; usedAt: null; telegramUserId: null; telegramChatId: null; }; deepLink: string | null; }>>; export declare const getUserAgentPairingStatus: import("convex/server").RegisteredQuery<"public", { nowMs?: number | undefined; agentKey: string; consumerUserId: string; }, Promise<{ code: string; consumerUserId: string; agentKey: string; botIdentity: string | null; status: "pending" | "used" | "expired"; createdAt: number; expiresAt: number; usedAt: number | null; telegramUserId: string | null; telegramChatId: string | null; } | null>>; export declare const importTelegramTokenForAgent: import("convex/server").RegisteredAction<"public", { metadata?: Record | undefined; agentKey: string; consumerUserId: string; plaintextValue: string; }, Promise<{ secretId: Id<"secrets">; secretRef: string; version: number; botIdentity: string; telegramUsername: string | null; }>>; export declare const getRequiredSecretRefs: import("convex/server").RegisteredQuery<"public", { agentKey?: string | undefined; }, Promise<{ agentKey: string; secretRefs: string[]; } | { agentKey: null; secretRefs: string[]; }>>; export declare const getProviderOperationalReadiness: import("convex/server").RegisteredQuery<"public", {}, Promise<{ providerRuntimeConfigPresent: boolean; workerRuntimeConfigPresent: boolean; issues: string[]; }>>; export declare const getTelegramAgentReadiness: import("convex/server").RegisteredQuery<"public", { nowMs?: number | undefined; agentKey: string; consumerUserId: string; }, Promise<{ missingSecrets: string[]; hasTelegramToken: boolean; webhookReady: boolean; providerRuntimeConfigPresent: boolean; workerRuntimeConfigPresent: boolean; issues: string[]; }>>; export declare const getAgentOperationalReadiness: import("convex/server").RegisteredQuery<"public", { nowMs?: number | undefined; agentKey: string; consumerUserId: string; }, Promise<{ missingSecrets: string[]; hasTelegramToken: boolean; webhookReady: boolean; providerRuntimeConfigPresent: boolean; workerRuntimeConfigPresent: boolean; issues: string[]; }>>; export declare const getUserAgentOnboardingState: import("convex/server").RegisteredQuery<"public", { nowMs?: number | undefined; agentKey: string; consumerUserId: string; }, Promise>; export declare const getWebhookReadiness: import("convex/server").RegisteredAction<"public", { agentKey: string; }, Promise<{ agentKey: string; secretRef: string | null; currentUrl: string | null; pendingUpdateCount: number; lastErrorMessage: string | null; lastErrorDate: number | null; webhookReady: boolean; }>>; export declare const syncAgentProfileTelegramBotIdentity: import("convex/server").RegisteredMutation<"internal", { telegramUsername?: string | undefined; agentKey: string; botIdentity: string; }, Promise>; export declare const persistImportedTelegramTokenForAgent: import("convex/server").RegisteredMutation<"internal", { metadata?: Record | undefined; telegramUsername?: string | undefined; agentKey: string; botIdentity: string; consumerUserId: string; plaintextValue: string; }, Promise<{ botIdentity: string; telegramUsername: string | null; secretId: import("convex/values").GenericId<"secrets">; secretRef: string; version: number; }>>; export declare const reconcileTelegramBotIdentityForAgent: import("convex/server").RegisteredAction<"public", { secretRef?: string | undefined; agentKey: string; }, Promise<{ agentKey: string; secretRef: string; botIdentity: string; telegramUsername: string | null; }>>; export declare const softResetTelegramBindingsMissingBotIdentity: import("convex/server").RegisteredMutation<"public", { nowMs?: number | undefined; expirePendingPairings?: boolean | undefined; revokeActiveBindings?: boolean | undefined; }, Promise<{ revokedBindings: number; annotatedBindings: number; expiredPairings: number; pendingPairingsMissingBotIdentity: number; legacyBindingsMissingBotIdentity: number; profilesMissingBotIdentity: number; }>>; export declare function parseTelegramWebhookSecretToken(secretToken: string | null | undefined): string | null; export {}; //# sourceMappingURL=identity.d.ts.map