import { AgentScopeConfig } from "../../db/manage/scope-definitions.js";
import { ConversationHistoryConfig, PaginationConfig } from "../../types/utility.js";
import { AgentsManageDatabaseClient } from "../../db/manage/manage-client.js";
import "../../index.js";
import { SubAgentInsert, SubAgentSelect, SubAgentUpdate } from "../../types/entities.js";

//#region src/data-access/manage/subAgents.d.ts
declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
  scopes: AgentScopeConfig;
  subAgentId: string;
}) => Promise<{
  id: string;
  name: string;
  description: string | null;
  models: {
    base?: {
      model?: string | undefined;
      providerOptions?: Record<string, unknown> | undefined;
      fallbackModels?: string[] | undefined;
      allowedProviders?: string[] | undefined;
    } | undefined;
    structuredOutput?: {
      model?: string | undefined;
      providerOptions?: Record<string, unknown> | undefined;
      fallbackModels?: string[] | undefined;
      allowedProviders?: string[] | undefined;
    } | undefined;
    summarizer?: {
      model?: string | undefined;
      providerOptions?: Record<string, unknown> | undefined;
      fallbackModels?: string[] | undefined;
      allowedProviders?: string[] | undefined;
    } | undefined;
  } | null;
  stopWhen: {
    stepCountIs?: number | undefined;
  } | null;
  createdAt: string;
  updatedAt: string;
  tenantId: string;
  projectId: string;
  prompt: string | null;
  agentId: string;
  conversationHistoryConfig: ConversationHistoryConfig | null;
  outputContract: {
    [x: string]: unknown;
    allowText?: boolean | undefined;
    requireComponent?: string[] | undefined;
    requireArtifact?: string[] | undefined;
    requireTransfer?: boolean | undefined;
    onViolation?: "retry" | "reject" | "warn" | undefined;
    retryBudget?: number | undefined;
  } | null;
} | undefined>;
declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
  scopes: AgentScopeConfig;
}) => Promise<{
  id: string;
  name: string;
  description: string | null;
  models: {
    base?: {
      model?: string | undefined;
      providerOptions?: Record<string, unknown> | undefined;
      fallbackModels?: string[] | undefined;
      allowedProviders?: string[] | undefined;
    } | undefined;
    structuredOutput?: {
      model?: string | undefined;
      providerOptions?: Record<string, unknown> | undefined;
      fallbackModels?: string[] | undefined;
      allowedProviders?: string[] | undefined;
    } | undefined;
    summarizer?: {
      model?: string | undefined;
      providerOptions?: Record<string, unknown> | undefined;
      fallbackModels?: string[] | undefined;
      allowedProviders?: string[] | undefined;
    } | undefined;
  } | null;
  stopWhen: {
    stepCountIs?: number | undefined;
  } | null;
  createdAt: string;
  updatedAt: string;
  tenantId: string;
  projectId: string;
  prompt: string | null;
  agentId: string;
  conversationHistoryConfig: ConversationHistoryConfig | null;
  outputContract: {
    [x: string]: unknown;
    allowText?: boolean | undefined;
    requireComponent?: string[] | undefined;
    requireArtifact?: string[] | undefined;
    requireTransfer?: boolean | undefined;
    onViolation?: "retry" | "reject" | "warn" | undefined;
    retryBudget?: number | undefined;
  } | null;
}[]>;
declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
  scopes: AgentScopeConfig;
  pagination?: PaginationConfig;
}) => Promise<{
  data: {
    createdAt: string;
    updatedAt: string;
    prompt: string | null;
    conversationHistoryConfig: ConversationHistoryConfig | null;
    models: {
      base?: {
        model?: string | undefined;
        providerOptions?: Record<string, unknown> | undefined;
        fallbackModels?: string[] | undefined;
        allowedProviders?: string[] | undefined;
      } | undefined;
      structuredOutput?: {
        model?: string | undefined;
        providerOptions?: Record<string, unknown> | undefined;
        fallbackModels?: string[] | undefined;
        allowedProviders?: string[] | undefined;
      } | undefined;
      summarizer?: {
        model?: string | undefined;
        providerOptions?: Record<string, unknown> | undefined;
        fallbackModels?: string[] | undefined;
        allowedProviders?: string[] | undefined;
      } | undefined;
    } | null;
    stopWhen: {
      stepCountIs?: number | undefined;
    } | null;
    outputContract: {
      [x: string]: unknown;
      allowText?: boolean | undefined;
      requireComponent?: string[] | undefined;
      requireArtifact?: string[] | undefined;
      requireTransfer?: boolean | undefined;
      onViolation?: "retry" | "reject" | "warn" | undefined;
      retryBudget?: number | undefined;
    } | null;
    name: string;
    description: string | null;
    agentId: string;
    projectId: string;
    tenantId: string;
    id: string;
  }[];
  pagination: {
    page: number;
    limit: number;
    total: number;
    pages: number;
  };
}>;
declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAgentInsert) => Promise<{
  id: string;
  name: string;
  description: string | null;
  models: {
    base?: {
      model?: string | undefined;
      providerOptions?: Record<string, unknown> | undefined;
      fallbackModels?: string[] | undefined;
      allowedProviders?: string[] | undefined;
    } | undefined;
    structuredOutput?: {
      model?: string | undefined;
      providerOptions?: Record<string, unknown> | undefined;
      fallbackModels?: string[] | undefined;
      allowedProviders?: string[] | undefined;
    } | undefined;
    summarizer?: {
      model?: string | undefined;
      providerOptions?: Record<string, unknown> | undefined;
      fallbackModels?: string[] | undefined;
      allowedProviders?: string[] | undefined;
    } | undefined;
  } | null;
  stopWhen: {
    stepCountIs?: number | undefined;
  } | null;
  createdAt: string;
  updatedAt: string;
  tenantId: string;
  projectId: string;
  prompt: string | null;
  agentId: string;
  conversationHistoryConfig: ConversationHistoryConfig | null;
  outputContract: {
    [x: string]: unknown;
    allowText?: boolean | undefined;
    requireComponent?: string[] | undefined;
    requireArtifact?: string[] | undefined;
    requireTransfer?: boolean | undefined;
    onViolation?: "retry" | "reject" | "warn" | undefined;
    retryBudget?: number | undefined;
  } | null;
}>;
declare const updateSubAgent: (db: AgentsManageDatabaseClient) => (params: {
  scopes: AgentScopeConfig;
  subAgentId: string;
  data: SubAgentUpdate;
}) => Promise<{
  createdAt: string;
  updatedAt: string;
  prompt: string | null;
  conversationHistoryConfig: ConversationHistoryConfig | null;
  models: {
    base?: {
      model?: string | undefined;
      providerOptions?: Record<string, unknown> | undefined;
      fallbackModels?: string[] | undefined;
      allowedProviders?: string[] | undefined;
    } | undefined;
    structuredOutput?: {
      model?: string | undefined;
      providerOptions?: Record<string, unknown> | undefined;
      fallbackModels?: string[] | undefined;
      allowedProviders?: string[] | undefined;
    } | undefined;
    summarizer?: {
      model?: string | undefined;
      providerOptions?: Record<string, unknown> | undefined;
      fallbackModels?: string[] | undefined;
      allowedProviders?: string[] | undefined;
    } | undefined;
  } | null;
  stopWhen: {
    stepCountIs?: number | undefined;
  } | null;
  outputContract: {
    [x: string]: unknown;
    allowText?: boolean | undefined;
    requireComponent?: string[] | undefined;
    requireArtifact?: string[] | undefined;
    requireTransfer?: boolean | undefined;
    onViolation?: "retry" | "reject" | "warn" | undefined;
    retryBudget?: number | undefined;
  } | null;
  name: string;
  description: string | null;
  agentId: string;
  projectId: string;
  tenantId: string;
  id: string;
}>;
/**
 * Upsert agent (create if it doesn't exist, update if it does)
 */
declare const upsertSubAgent: (db: AgentsManageDatabaseClient) => (params: {
  data: SubAgentInsert;
}) => Promise<SubAgentSelect>;
declare class SubAgentIsDefaultError extends Error {
  subAgentId: string;
  agentId: string;
  constructor(subAgentId: string, agentId: string);
}
declare const deleteSubAgent: (db: AgentsManageDatabaseClient) => (params: {
  scopes: AgentScopeConfig;
  subAgentId: string;
}) => Promise<boolean>;
declare const getSubAgentsByIds: (db: AgentsManageDatabaseClient) => (params: {
  scopes: AgentScopeConfig;
  subAgentIds: string[];
}) => Promise<{
  createdAt: string;
  updatedAt: string;
  prompt: string | null;
  conversationHistoryConfig: ConversationHistoryConfig | null;
  models: {
    base?: {
      model?: string | undefined;
      providerOptions?: Record<string, unknown> | undefined;
      fallbackModels?: string[] | undefined;
      allowedProviders?: string[] | undefined;
    } | undefined;
    structuredOutput?: {
      model?: string | undefined;
      providerOptions?: Record<string, unknown> | undefined;
      fallbackModels?: string[] | undefined;
      allowedProviders?: string[] | undefined;
    } | undefined;
    summarizer?: {
      model?: string | undefined;
      providerOptions?: Record<string, unknown> | undefined;
      fallbackModels?: string[] | undefined;
      allowedProviders?: string[] | undefined;
    } | undefined;
  } | null;
  stopWhen: {
    stepCountIs?: number | undefined;
  } | null;
  outputContract: {
    [x: string]: unknown;
    allowText?: boolean | undefined;
    requireComponent?: string[] | undefined;
    requireArtifact?: string[] | undefined;
    requireTransfer?: boolean | undefined;
    onViolation?: "retry" | "reject" | "warn" | undefined;
    retryBudget?: number | undefined;
  } | null;
  name: string;
  description: string | null;
  agentId: string;
  projectId: string;
  tenantId: string;
  id: string;
}[]>;
//#endregion
export { SubAgentIsDefaultError, createSubAgent, deleteSubAgent, getSubAgentById, getSubAgentsByIds, listSubAgents, listSubAgentsPaginated, updateSubAgent, upsertSubAgent };