import { BaseExecutionContext } from "@inkeep/agents-core";
import * as hono18 from "hono";
import { createAuth } from "@inkeep/agents-core/auth";

//#region src/middleware/manageAuth.d.ts

/**
 * Middleware to authenticate API requests using Bearer token authentication
 * Authentication priority:
 * 1. Bypass secret (INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET)
 * 2. Better-auth session token (from device authorization flow)
 * 3. Database API key
 * 4. Internal service token
 */
declare const manageApiKeyAuth: () => hono18.MiddlewareHandler<{
  Variables: {
    executionContext: BaseExecutionContext;
    userId?: string;
    userEmail?: string;
    tenantId?: string;
    auth: ReturnType<typeof createAuth> | null;
  };
}, string, {}, Response>;
//#endregion
export { manageApiKeyAuth };