import type { MCPConfig } from '../../../infra/mcp/types.js';

/**
 * Conditional chained prompt path entry
 */
export type ConditionalChainedPath = {
  path: string;
  conditions?: string[];
  conditionsAny?: string[];
  tracks?: string[];
};

/**
 * Single chained prompt path entry - string or conditional object
 */
export type ChainedPathEntry = string | ConditionalChainedPath;

export type AgentDefinition = {
  id: string;
  model?: unknown;
  modelReasoningEffort?: unknown;
  model_reasoning_effort?: unknown;
  engine?: string; // Engine to use for this agent (dynamically determined from registry)
  chainedPromptsPath?: ChainedPathEntry | ChainedPathEntry[]; // Path(s) to folder(s) containing chained prompt .md files
  role?: 'controller'; // Agent role - 'controller' agents can drive autonomous mode
  conditions?: string[];
  conditionsAny?: string[];
  mcp?: MCPConfig; // MCP server access configuration (allowlist/blocklist filtering)
  [key: string]: unknown;
};

export const AGENT_MODULE_FILENAMES = ['main.agents.js', 'sub.agents.js', 'modules.js', 'agents.js'];
