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

//#region src/domains/run/context/ContextResolver.d.ts
interface ResolvedContext {
  [templateKey: string]: unknown;
}
interface ContextResolutionOptions {
  triggerEvent: 'initialization' | 'invocation';
  conversationId: string;
  headers?: Record<string, unknown>;
  tenantId: string;
}
interface ContextResolutionResult {
  resolvedContext: ResolvedContext;
  headers: Record<string, unknown>;
  fetchedDefinitions: string[];
  cacheHits: string[];
  cacheMisses: string[];
  errors: Array<{
    definitionId: string;
    error: string;
  }>;
  skipped: Array<{
    definitionId: string;
    reason: string;
  }>;
  totalDurationMs: number;
}
declare class ContextResolver {
  private fetcher;
  private cache;
  private executionContext;
  constructor(executionContext: FullExecutionContext, credentialStoreRegistry?: CredentialStoreRegistry);
  /**
   * Resolve all contexts for a given configuration and trigger event
   */
  resolve(contextConfig: ContextConfigApiSelect, options: ContextResolutionOptions): Promise<ContextResolutionResult>;
  /**
   * Resolve a single context variable
   */
  private resolveSingleFetchDefinition;
  /**
   * Resolve the headers for a given conversation
   */
  resolveHeaders(conversationId: string, contextConfigId: string): Promise<Record<string, unknown>>;
  /**
   * Create a hash of the headers for cache invalidation
   */
  private createRequestHash;
  /**
   * Clear cache
   */
  clearCache(tenantId: string, projectId: string, conversationId: string): Promise<void>;
}
//#endregion
export { ContextResolutionOptions, ContextResolutionResult, ContextResolver, ResolvedContext };