import { CredentialStoreRegistry, FullExecutionContext } from "@inkeep/agents-core";
import { Context, Next } from "hono";
import { ValidateFunction } from "ajv";

//#region src/domains/run/context/validation.d.ts
declare const HTTP_REQUEST_PARTS: readonly ["headers"];
type HttpRequestPart = (typeof HTTP_REQUEST_PARTS)[number];
interface ContextValidationError {
  field: string;
  message: string;
  value?: unknown;
}
interface ContextValidationResult {
  valid: boolean;
  errors: ContextValidationError[];
  validatedContext?: Record<string, unknown> | ParsedHttpRequest;
}
interface ParsedHttpRequest {
  headers?: Record<string, string>;
}
declare function isValidHttpRequest(obj: any): obj is ParsedHttpRequest;
declare function getCachedValidator(schema: Record<string, unknown>): ValidateFunction;
declare function validationHelper(jsonSchema: Record<string, unknown>): ValidateFunction<unknown>;
declare function validateAgainstJsonSchema(jsonSchema: Record<string, unknown>, context: unknown): boolean;
declare function validateHttpRequestHeaders(headersSchema: any, httpRequest: ParsedHttpRequest): Promise<ContextValidationResult>;
declare function validateHeaders({
  executionContext,
  conversationId,
  parsedRequest,
  credentialStores
}: {
  executionContext: FullExecutionContext;
  conversationId: string;
  parsedRequest: ParsedHttpRequest;
  credentialStores?: CredentialStoreRegistry;
}): Promise<ContextValidationResult>;
declare function contextValidationMiddleware(c: Context, next: Next): Promise<void>;
//#endregion
export { ContextValidationError, ContextValidationResult, HTTP_REQUEST_PARTS, HttpRequestPart, ParsedHttpRequest, contextValidationMiddleware, getCachedValidator, isValidHttpRequest, validateAgainstJsonSchema, validateHeaders, validateHttpRequestHeaders, validationHelper };