import type { Auth, HttpRouter } from "convex/server"; import type { ComponentApi } from "../component/_generated/component.js"; import { type ProviderConfig } from "../component/config.js"; export { bridgeFunctionKeyFromToolName, executeBridgeFunction, isBridgeToolName, maybeExecuteBridgeToolCall, resolveBridgeRuntimeConfig, type BridgeExecutionResult, type HydratedBridgeRuntimeConfig, type ResolvedBridgeRuntimeConfig, } from "./bridge.js"; export declare function exposeApi(component: ComponentApi, options: { auth: (ctx: { auth: Auth; }, operation: { type: "read"; } | { type: "write"; conversationId?: string; agentKey?: string; }) => Promise; providerConfig?: ProviderConfig; }): { queueStats: import("convex/server").RegisteredQuery<"public", {}, Promise<{ deadLetter: number; processing: number; queuedReady: number; }>>; getProviderRuntimeConfig: import("convex/server").RegisteredQuery<"public", {}, Promise>; setProviderRuntimeConfig: import("convex/server").RegisteredMutation<"public", { providerConfig: { appName: string; kind: "fly" | "runpod" | "ecs"; organizationSlug: string; image: string; region: string; volumeName: string; volumePath: string; volumeSizeGb: number; }; }, Promise>; getMessageRuntimeConfig: import("convex/server").RegisteredQuery<"public", {}, Promise>; setMessageRuntimeConfig: import("convex/server").RegisteredMutation<"public", { messageConfig: { systemPrompt?: string | undefined; telegramAttachmentRetentionMs?: number | undefined; }; }, Promise>; createMessageTemplate: import("convex/server").RegisteredMutation<"public", { enabled?: boolean | undefined; actorUserId: string; tags: string[]; text: string; title: string; }, Promise>; updateMessageTemplate: import("convex/server").RegisteredMutation<"public", { enabled?: boolean | undefined; tags?: string[] | undefined; text?: string | undefined; title?: string | undefined; actorUserId: string; templateId: string; }, Promise>; deleteMessageTemplate: import("convex/server").RegisteredMutation<"public", { templateId: string; }, Promise>; listMessageTemplatesByCompany: import("convex/server").RegisteredQuery<"public", { includeDisabled?: boolean | undefined; limit?: number | undefined; }, Promise>; enqueue: import("convex/server").RegisteredMutation<"public", { providerConfig?: { appName: string; kind: "fly" | "runpod" | "ecs"; organizationSlug: string; image: string; region: string; volumeName: string; volumePath: string; volumeSizeGb: number; } | undefined; metadata?: Record | undefined; priority?: number | undefined; attachments?: { sizeBytes?: number | undefined; fileName?: string | undefined; mimeType?: string | undefined; status: "expired" | "ready"; storageId: string; kind: "photo" | "video" | "audio" | "voice" | "document"; telegramFileId: string; expiresAt: number; }[] | undefined; externalMessageId?: string | undefined; rawUpdateJson?: string | undefined; agentKey: string; conversationId: string; provider: string; providerUserId: string; messageText: string; }, Promise>; workerStats: import("convex/server").RegisteredQuery<"public", {}, Promise<{ activeCount: number; idleCount: number; workers: Array<{ appName: null | string; heartbeatAt: number; load: number; machineId: null | string; status: "active" | "draining" | "stopping" | "stopped"; workerId: string; }>; }>>; workerClaim: import("convex/server").RegisteredMutation<"public", { conversationId?: string | undefined; workerId: string; }, Promise<{ agentKey: string; conversationId: string; leaseExpiresAt: number; leaseId: string; messageId: string; payload: { attachments?: Array<{ downloadUrl?: string; expiresAt: number; fileName?: string; kind: "photo" | "video" | "audio" | "voice" | "document"; mimeType?: string; sizeBytes?: number; status: "ready" | "expired"; storageId: string; telegramFileId: string; }>; externalMessageId?: string; messageText: string; metadata?: Record; provider: string; providerUserId: string; rawUpdateJson?: string; }; } | null>>; workerHeartbeat: import("convex/server").RegisteredMutation<"public", { messageId: string; workerId: string; leaseId: string; }, Promise>; workerComplete: import("convex/server").RegisteredMutation<"public", { messageId: string; workerId: string; leaseId: string; }, Promise>; workerFail: import("convex/server").RegisteredMutation<"public", { messageId: string; workerId: string; leaseId: string; errorMessage: string; }, Promise<{ deadLettered: boolean; nextScheduledFor: null | number; requeued: boolean; }>>; workerHydrationBundle: import("convex/server").RegisteredQuery<"public", { workspaceId: string; messageId: string; }, Promise<{ agentKey: string; bridgeRuntimeConfig: null | { appBaseUrlMapJson: null | string; appKey: null | string; baseUrl: null | string; botIdentity: null | string; serviceId: null | string; serviceKey: null | string; serviceKeySecretRef: null | string; }; conversationId: string; conversationState: { contextHistory: Array<{ at: number; content: string; role: "system" | "user" | "assistant" | "tool"; }>; pendingToolCalls: Array<{ callId: string; status: "pending" | "running" | "done" | "failed"; toolName: string; }>; }; messageId: string; payload: { attachments?: Array<{ downloadUrl?: string; expiresAt: number; fileName?: string; kind: "photo" | "video" | "audio" | "voice" | "document"; mimeType?: string; sizeBytes?: number; status: "ready" | "expired"; storageId: string; telegramFileId: string; }>; externalMessageId?: string; messageText: string; metadata?: Record; provider: string; providerUserId: string; rawUpdateJson?: string; }; telegramBotToken: null | string; } | null>>; workerGlobalSkillsManifest: import("convex/server").RegisteredQuery<"public", { workspaceId?: string | undefined; workerId?: string | undefined; releaseChannel?: "stable" | "canary" | undefined; }, Promise>; workerConversationHasQueued: import("convex/server").RegisteredQuery<"public", { conversationId: string; }, Promise>; workerAppendConversationMessages: import("convex/server").RegisteredMutation<"public", { workspaceId?: string | undefined; conversationId: string; messages: { at?: number | undefined; content: string; role: "system" | "user" | "assistant" | "tool"; }[]; }, Promise<{ messageCount: number; updated: boolean; }>>; workerControlState: import("convex/server").RegisteredQuery<"public", { workerId: string; }, Promise>; workerPrepareSnapshotUpload: import("convex/server").RegisteredMutation<"public", { agentKey: string; conversationId: string; workspaceId: string; workerId: string; reason: "manual" | "drain" | "signal"; }, Promise>; workerFinalizeSnapshotUpload: import("convex/server").RegisteredMutation<"public", { workerId: string; storageId: string; snapshotId: string; sha256: string; sizeBytes: number; }, Promise>; workerFailSnapshotUpload: import("convex/server").RegisteredMutation<"public", { error: string; workerId: string; snapshotId: string; }, Promise>; workerLatestSnapshotForRestore: import("convex/server").RegisteredQuery<"public", { agentKey: string; conversationId: string; workspaceId: string; }, Promise>; workerGenerateMediaUploadUrl: import("convex/server").RegisteredMutation<"public", {}, Promise>; workerGetStorageFileUrl: import("convex/server").RegisteredQuery<"public", { storageId: string; }, Promise>; workerAttachMessageMetadata: import("convex/server").RegisteredMutation<"public", { metadata: Record; messageId: string; }, Promise>; globalSkillsDeploy: import("convex/server").RegisteredMutation<"public", { actor?: string | undefined; description?: string | undefined; displayName?: string | undefined; entryPoint?: string | undefined; moduleFormat?: "esm" | "cjs" | undefined; releaseChannel?: "stable" | "canary" | undefined; version: string; slug: string; files: { content: string; sha256: string; path: string; }[]; }, Promise>; globalSkillsList: import("convex/server").RegisteredQuery<"public", { status?: "active" | "disabled" | undefined; limit?: number | undefined; releaseChannel?: "stable" | "canary" | undefined; }, Promise>; globalSkillsSetStatus: import("convex/server").RegisteredMutation<"public", { actor?: string | undefined; status: "active" | "disabled"; slug: string; }, Promise>; globalSkillsDelete: import("convex/server").RegisteredMutation<"public", { slug: string; }, Promise>; seedDefaultAgent: import("convex/server").RegisteredMutation<"public", {}, Promise>; importSecret: import("convex/server").RegisteredMutation<"public", { metadata?: Record | undefined; secretRef: string; plaintextValue: string; }, Promise<{ secretId: string; secretRef: string; version: number; }>>; secretStatus: import("convex/server").RegisteredQuery<"public", { secretRefs: string[]; }, Promise<{ hasActive: boolean; secretRef: string; version: null | number; }[]>>; startWorkers: import("convex/server").RegisteredAction<"public", { flyApiToken?: string | undefined; workspaceId?: string | undefined; convexUrl?: string | undefined; scalingPolicy?: { maxWorkers: number; queuePerWorkerTarget: number; spawnStep: number; idleTimeoutMs: number; reconcileIntervalMs: number; } | undefined; }, Promise<{ activeWorkers: number; spawned: number; terminated: number; }>>; checkIdleShutdowns: import("convex/server").RegisteredAction<"public", { flyApiToken?: string | undefined; }, Promise>; deleteFlyVolume: import("convex/server").RegisteredAction<"public", { flyApiToken?: string | undefined; appName: string; volumeId: string; }, Promise>; runFlyCleanup: import("convex/server").RegisteredAction<"public", { flyApiToken?: string | undefined; machineConcurrency?: number | undefined; volumeConcurrency?: number | undefined; }, Promise>; recoverQueue: import("convex/server").RegisteredAction<"public", { nowMs?: number | undefined; workspaceId?: string | undefined; scalingPolicy?: { maxWorkers: number; queuePerWorkerTarget: number; spawnStep: number; idleTimeoutMs: number; reconcileIntervalMs: number; } | undefined; releaseLimit?: number | undefined; }, Promise<{ released: { requeued: number; unlocked: number; }; reconcile: { activeWorkers: number; spawned: number; terminated: number; }; }>>; bindUserAgent: import("convex/server").RegisteredMutation<"public", { botIdentity?: string | undefined; metadata?: Record | undefined; source?: "manual" | "telegram_pairing" | "api" | undefined; telegramChatId?: string | undefined; telegramUserId?: string | undefined; agentKey: string; consumerUserId: string; }, Promise<{ agentKey: string; botIdentity: null | string; boundAt: number; consumerUserId: string; conversationId: string; metadata: null | Record; revokedAt: null | number; source: "manual" | "telegram_pairing" | "api"; status: "active" | "revoked"; telegramChatId: null | string; telegramUserId: null | string; }>>; revokeUserAgentBinding: import("convex/server").RegisteredMutation<"public", { consumerUserId: string; }, Promise<{ revoked: number; }>>; myAgentKey: import("convex/server").RegisteredQuery<"public", { consumerUserId?: string | undefined; }, Promise<{ agentKey: null | string; consumerUserId: string; }>>; getUserAgentBinding: import("convex/server").RegisteredQuery<"public", { consumerUserId: string; }, Promise<{ agentKey: string; botIdentity: null | string; boundAt: number; consumerUserId: string; conversationId: string; metadata: null | Record; revokedAt: null | number; source: "manual" | "telegram_pairing" | "api"; status: "active" | "revoked"; telegramChatId: null | string; telegramUserId: null | string; } | null>>; listUserAgents: import("convex/server").RegisteredQuery<"public", { includeDisabled?: boolean | undefined; consumerUserId: string; }, Promise>; getUserAgent: import("convex/server").RegisteredQuery<"public", { agentKey: string; consumerUserId: string; }, Promise>; getActiveUserAgent: import("convex/server").RegisteredQuery<"public", { consumerUserId: string; }, Promise>; getUserAgentsOverview: import("convex/server").RegisteredQuery<"public", { consumerUserId: string; }, Promise>; resolveAgentForTelegram: import("convex/server").RegisteredQuery<"public", { botIdentity?: string | undefined; telegramChatId?: string | undefined; telegramUserId?: string | undefined; }, Promise<{ agentKey: null | string; consumerUserId: null | string; conversationId: null | string; }>>; createPairingCode: import("convex/server").RegisteredMutation<"public", { ttlMs?: number | undefined; agentKey: string; consumerUserId: string; }, Promise<{ agentKey: string; botIdentity: null | string; code: string; consumerUserId: string; createdAt: number; expiresAt: number; status: "pending" | "used" | "expired"; telegramChatId: null | string; telegramUserId: null | string; usedAt: null | number; }>>; createUserAgentPairing: import("convex/server").RegisteredMutation<"public", { ttlMs?: number | undefined; agentKey: string; consumerUserId: string; }, Promise>; consumePairingCode: import("convex/server").RegisteredMutation<"public", { botIdentity?: string | undefined; telegramChatId: string; telegramUserId: string; code: string; }, Promise<{ agentKey: string; botIdentity: null | string; code: string; consumerUserId: string; createdAt: number; expiresAt: number; status: "pending" | "used" | "expired"; telegramChatId: null | string; telegramUserId: null | string; usedAt: null | number; }>>; getPairingCodeStatus: import("convex/server").RegisteredQuery<"public", { code: string; }, Promise<{ agentKey: string; botIdentity: null | string; code: string; consumerUserId: string; createdAt: number; expiresAt: number; status: "pending" | "used" | "expired"; telegramChatId: null | string; telegramUserId: null | string; usedAt: null | number; } | null>>; getUserAgentPairingStatus: import("convex/server").RegisteredQuery<"public", { agentKey: string; consumerUserId: string; }, Promise>; importTelegramTokenForAgent: import("convex/server").RegisteredAction<"public", { metadata?: Record | undefined; agentKey: string; consumerUserId: string; plaintextValue: string; }, Promise>; reconcileTelegramBotIdentityForAgent: import("convex/server").RegisteredAction<"public", { secretRef?: string | undefined; agentKey: string; }, Promise>; getUserAgentOnboardingState: import("convex/server").RegisteredQuery<"public", { agentKey: string; consumerUserId: string; }, Promise>; getRequiredSecretRefs: import("convex/server").RegisteredQuery<"public", { agentKey?: string | undefined; }, Promise>; getProviderOperationalReadiness: import("convex/server").RegisteredQuery<"public", {}, Promise>; getTelegramAgentReadiness: import("convex/server").RegisteredQuery<"public", { agentKey: string; consumerUserId: string; }, Promise>; getAgentOperationalReadiness: import("convex/server").RegisteredQuery<"public", { agentKey: string; consumerUserId: string; }, Promise>; configureTelegramWebhook: import("convex/server").RegisteredAction<"public", { agentKey?: string | undefined; secretRef?: string | undefined; convexSiteUrl: string; }, Promise<{ botIdentity: null | string; currentUrl: null | string; description: string; isReady: boolean; lastErrorDate: null | number; lastErrorMessage: null | string; ok: boolean; pendingUpdateCount: number; secretTokenConfigured: boolean; webhookUrl: string; }>>; softResetTelegramBindingsMissingBotIdentity: import("convex/server").RegisteredMutation<"public", { nowMs?: number | undefined; expirePendingPairings?: boolean | undefined; revokeActiveBindings?: boolean | undefined; }, Promise>; getWebhookReadiness: import("convex/server").RegisteredAction<"public", { agentKey: string; }, Promise>; createPushTemplate: import("convex/server").RegisteredMutation<"public", { enabled?: boolean | undefined; actorUserId: string; text: string; title: string; companyId: string; periodicity: "manual" | "daily" | "weekly" | "monthly"; suggestedTimes: ({ kind: "daily"; time: string; } | { kind: "weekly"; time: string; weekday: number; } | { kind: "monthly"; time: string; dayOfMonth: number | "last"; })[]; templateKey: string; }, Promise>; updatePushTemplate: import("convex/server").RegisteredMutation<"public", { enabled?: boolean | undefined; text?: string | undefined; title?: string | undefined; periodicity?: "manual" | "daily" | "weekly" | "monthly" | undefined; suggestedTimes?: ({ kind: "daily"; time: string; } | { kind: "weekly"; time: string; weekday: number; } | { kind: "monthly"; time: string; dayOfMonth: number | "last"; })[] | undefined; actorUserId: string; templateId: string; }, Promise>; deletePushTemplate: import("convex/server").RegisteredMutation<"public", { templateId: string; }, Promise>; listPushTemplatesByCompany: import("convex/server").RegisteredQuery<"public", { includeDisabled?: boolean | undefined; companyId: string; }, Promise>; createPushJobFromTemplate: import("convex/server").RegisteredMutation<"public", { enabled?: boolean | undefined; schedule?: { kind: "manual"; } | { kind: "daily"; time: string; } | { kind: "weekly"; time: string; weekday: number; } | { kind: "monthly"; time: string; dayOfMonth: number | "last"; } | undefined; consumerUserId: string; companyId: string; timezone: string; templateId: string; }, Promise>; createPushJobCustom: import("convex/server").RegisteredMutation<"public", { enabled?: boolean | undefined; consumerUserId: string; text: string; title: string; companyId: string; periodicity: "manual" | "daily" | "weekly" | "monthly"; schedule: { kind: "manual"; } | { kind: "daily"; time: string; } | { kind: "weekly"; time: string; weekday: number; } | { kind: "monthly"; time: string; dayOfMonth: number | "last"; }; timezone: string; }, Promise>; updatePushJob: import("convex/server").RegisteredMutation<"public", { enabled?: boolean | undefined; text?: string | undefined; title?: string | undefined; periodicity?: "manual" | "daily" | "weekly" | "monthly" | undefined; schedule?: { kind: "manual"; } | { kind: "daily"; time: string; } | { kind: "weekly"; time: string; weekday: number; } | { kind: "monthly"; time: string; dayOfMonth: number | "last"; } | undefined; timezone?: string | undefined; jobId: string; }, Promise>; deletePushJob: import("convex/server").RegisteredMutation<"public", { jobId: string; }, Promise>; setPushJobEnabled: import("convex/server").RegisteredMutation<"public", { enabled: boolean; jobId: string; }, Promise>; listPushJobsForUser: import("convex/server").RegisteredQuery<"public", { includeDisabled?: boolean | undefined; consumerUserId: string; }, Promise>; listQueueItemsForConversation: import("convex/server").RegisteredQuery<"public", { limit?: number | undefined; conversationId: string; }, Promise>; listQueueItemsForUserAgent: import("convex/server").RegisteredQuery<"public", { limit?: number | undefined; statuses?: ("failed" | "done" | "queued" | "processing" | "dead_letter")[] | undefined; agentKey: string; consumerUserId: string; }, Promise>; getConversationViewForUserAgent: import("convex/server").RegisteredQuery<"public", { limit?: number | undefined; agentKey: string; consumerUserId: string; }, Promise>; sendMessageToUserAgent: import("convex/server").RegisteredMutation<"public", { metadata?: Record | undefined; agentKey: string; consumerUserId: string; content: string; }, Promise>; sendMessageTemplateToUserAgent: import("convex/server").RegisteredMutation<"public", { metadata?: Record | undefined; agentKey: string; consumerUserId: string; templateId: string; }, Promise>; listSnapshotsForConversation: import("convex/server").RegisteredQuery<"public", { limit?: number | undefined; conversationId: string; }, Promise>; listSnapshotsForUserAgent: import("convex/server").RegisteredQuery<"public", { limit?: number | undefined; agentKey: string; consumerUserId: string; }, Promise>; getLatestSnapshotForUserAgent: import("convex/server").RegisteredQuery<"public", { agentKey: string; consumerUserId: string; }, Promise>; triggerPushJobNow: import("convex/server").RegisteredMutation<"public", { jobId: string; }, Promise>; listPushJobsForAgent: import("convex/server").RegisteredQuery<"public", { includeDisabled?: boolean | undefined; agentKey: string; consumerUserId: string; }, Promise>; createPushJobFromTemplateForAgent: import("convex/server").RegisteredMutation<"public", { enabled?: boolean | undefined; schedule?: { kind: "manual"; } | { kind: "daily"; time: string; } | { kind: "weekly"; time: string; weekday: number; } | { kind: "monthly"; time: string; dayOfMonth: number | "last"; } | undefined; agentKey: string; consumerUserId: string; companyId: string; timezone: string; templateId: string; }, Promise>; createPushJobCustomForAgent: import("convex/server").RegisteredMutation<"public", { enabled?: boolean | undefined; agentKey: string; consumerUserId: string; text: string; title: string; companyId: string; periodicity: "manual" | "daily" | "weekly" | "monthly"; schedule: { kind: "manual"; } | { kind: "daily"; time: string; } | { kind: "weekly"; time: string; weekday: number; } | { kind: "monthly"; time: string; dayOfMonth: number | "last"; }; timezone: string; }, Promise>; updatePushJobForAgent: import("convex/server").RegisteredMutation<"public", { enabled?: boolean | undefined; text?: string | undefined; title?: string | undefined; periodicity?: "manual" | "daily" | "weekly" | "monthly" | undefined; schedule?: { kind: "manual"; } | { kind: "daily"; time: string; } | { kind: "weekly"; time: string; weekday: number; } | { kind: "monthly"; time: string; dayOfMonth: number | "last"; } | undefined; timezone?: string | undefined; agentKey: string; consumerUserId: string; jobId: string; }, Promise>; triggerPushJobNowForAgent: import("convex/server").RegisteredMutation<"public", { agentKey: string; consumerUserId: string; jobId: string; }, Promise>; listPushDispatchesForAgent: import("convex/server").RegisteredQuery<"public", { limit?: number | undefined; agentKey: string; consumerUserId: string; }, Promise>; getUserAgentPushStats: import("convex/server").RegisteredQuery<"public", { agentKey: string; consumerUserId: string; }, Promise>; getUserAgentConversationStats: import("convex/server").RegisteredQuery<"public", { agentKey: string; consumerUserId: string; }, Promise>; getUserAgentUsageStats: import("convex/server").RegisteredQuery<"public", { agentKey: string; consumerUserId: string; }, Promise>; dispatchDuePushJobs: import("convex/server").RegisteredMutation<"public", { nowMs?: number | undefined; limit?: number | undefined; }, Promise>; sendBroadcastToAllActiveAgents: import("convex/server").RegisteredMutation<"public", { text: string; title: string; companyId: string; requestedBy: string; }, Promise>; listPushDispatchesByJob: import("convex/server").RegisteredQuery<"public", { limit?: number | undefined; jobId: string; }, Promise>; }; /** * Register a Telegram webhook ingress route. * The route only enqueues jobs in Convex and does not process messages. */ export declare function registerRoutes(http: HttpRouter, component: ComponentApi, { pathPrefix, resolveAgentKey, resolveAgentKeyFromBinding, fallbackAgentKey, requireBindingForTelegram, providerConfig, }?: { pathPrefix?: string; resolveAgentKey?: (update: unknown) => string; resolveAgentKeyFromBinding?: boolean; fallbackAgentKey?: string; requireBindingForTelegram?: boolean; providerConfig?: ProviderConfig; }): void; //# sourceMappingURL=index.d.ts.map