import { addUserRole, removeUserRole, getUserRoles } from '../user'; import type { LTUserRecord, LTRoleType } from '../../types'; import { listBotApiKeys, revokeBotApiKey } from '../auth/bot-api-key'; import type { BotApiKeyRecord } from '../auth/bot-api-key'; export type { BotApiKeyRecord }; export interface CreateBotInput { /** Unique identifier (used as external_id). */ name: string; /** Human-readable description of the bot's purpose. */ description?: string; /** Display name shown in audit logs. */ display_name?: string; /** Initial roles to assign. */ roles?: Array<{ role: string; type: LTRoleType; }>; /** ID of the user creating this bot (for audit). */ created_by?: string; } export interface BotAccountRecord extends LTUserRecord { /** Always 'bot' for bot accounts. */ account_type: 'bot'; /** Description from metadata. */ description?: string; /** Who created this bot. */ created_by?: string; } /** * Create a new bot account. */ export declare function createBot(input: CreateBotInput): Promise; /** * Get a single bot account by ID. */ export declare function getBot(id: string): Promise; /** * List all bot accounts with pagination. */ export declare function listBots(limit?: number, offset?: number): Promise<{ bots: BotAccountRecord[]; total: number; }>; /** * Update a bot account. */ export declare function updateBot(id: string, input: { display_name?: string; description?: string; status?: string; }): Promise; /** * Deactivate a bot account (sets status to 'inactive'). */ export declare function deactivateBot(id: string): Promise; /** * Delete a bot account and all its API keys (cascaded). */ export declare function deleteBot(id: string): Promise; /** * Generate a new API key for a bot. */ export declare function createBotKey(botId: string, name: string, scopes?: string[], expiresAt?: Date): Promise<{ id: string; rawKey: string; }>; /** * List API keys for a bot (without hashes). */ export { listBotApiKeys as listBotKeys }; /** * Revoke a bot API key. */ export { revokeBotApiKey as revokeBotKey }; export { addUserRole as addBotRole }; export { removeUserRole as removeBotRole }; export { getUserRoles as getBotRoles }; /** * Ensure the system bot account exists. * Called at startup so cron and system-initiated workflows * always have a principal (the `lt-system` bot). */ export declare function ensureSystemBot(): Promise;