import { ContextFetchDefinition, CredentialStoreRegistry, FullExecutionContext, TemplateContext } from "@inkeep/agents-core";

//#region src/domains/run/context/ContextFetcher.d.ts
declare class MissingRequiredVariableError extends Error {
  constructor(variable: string);
}
interface FetchResult {
  data: unknown;
  source: string;
  durationMs: number;
}
declare class ContextFetcher {
  private executionContext;
  private defaultTimeout;
  private credentialStuffer?;
  constructor(executionContext: FullExecutionContext, credentialStoreRegistry?: CredentialStoreRegistry, defaultTimeout?: number);
  /**
   * Fetch data according to a fetch definition
   */
  fetch(definition: ContextFetchDefinition, context: TemplateContext): Promise<{
    data: unknown;
    resolvedUrl: string;
  }>;
  private getCredential;
  /**
   * Resolve template variables in fetch configuration and inject credential headers
   */
  private resolveTemplateVariables;
  /**
   * Interpolate template variables in a string using TemplateEngine
   */
  private interpolateTemplate;
  /**
   * Interpolate template variables in an object recursively using TemplateEngine
   */
  private interpolateObjectTemplates;
  /**
   * Perform HTTP request
   */
  private performRequest;
  /**
   * Transform response data using JsonTransformer (JMESPath)
   */
  private transformResponse;
  /**
   * Validate response against JSON Schema
   */
  private validateResponseWithJsonSchema;
  /**
   * Test a fetch definition without caching
   */
  test(definition: ContextFetchDefinition, context: TemplateContext): Promise<{
    success: boolean;
    data?: unknown;
    resolvedUrl?: string;
    error?: string;
    durationMs: number;
  }>;
  /**
   * Get fetcher statistics
   */
  getStats(): {
    tenantId: string;
    defaultTimeout: number;
  };
}
//#endregion
export { ContextFetcher, FetchResult, MissingRequiredVariableError };