import { BaseExecutionContext } from "@inkeep/agents-core";
import * as hono1 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: () => hono1.MiddlewareHandler<{
  Variables: {
    executionContext: BaseExecutionContext;
    userId?: string;
    userEmail?: string;
    tenantId?: string;
    auth: ReturnType<typeof createAuth>;
  };
}, string, {}, Response>;
/**
 * Middleware that gates a route with manage-domain authentication.
 * Uses Bearer token → API key auth, otherwise falls back to session auth.
 */
declare const manageApiKeyOrSessionAuth: () => hono1.MiddlewareHandler<any, string, {}, Response>;
//#endregion
export { manageApiKeyAuth, manageApiKeyOrSessionAuth };