import { Part, ResolvedRef } from "@inkeep/agents-core";

//#region src/domains/run/workflow/steps/agentExecutionSteps.d.ts
type AgentExecutionStepPayload = {
  tenantId: string;
  projectId: string;
  agentId: string;
  conversationId: string;
  userMessage: string;
  messageParts?: Part[];
  requestId: string;
  resolvedRef: ResolvedRef;
  forwardedHeaders?: Record<string, string>;
  outputFormat?: 'sse' | 'vercel';
  emitOperations?: boolean;
};
type CallLlmStepParams = {
  payload: AgentExecutionStepPayload;
  currentSubAgentId: string;
  isFirstMessage: boolean;
  workflowRunId: string;
  streamNamespace?: string;
  taskId: string;
};
type CallLlmResult = {
  type: 'completion';
} | {
  type: 'transfer';
  targetSubAgentId: string;
} | {
  type: 'tool_calls';
  toolCalls: Array<{
    toolCallId: string;
    toolName: string;
    args: unknown;
  }>;
};
type ExecuteToolStepParams = {
  payload: AgentExecutionStepPayload;
  currentSubAgentId: string;
  toolCallId: string;
  toolName: string;
  args: unknown;
  workflowRunId: string;
  streamNamespace?: string;
  preApproved?: boolean;
  approvalReason?: string;
  taskId: string;
};
type ExecuteToolResult = {
  type: 'completed';
} | {
  type: 'needs_approval';
};
declare function markWorkflowRunningStep(params: {
  payload: AgentExecutionStepPayload;
  workflowRunId: string;
}): Promise<void>;
declare function initializeTaskStep(params: {
  payload: AgentExecutionStepPayload;
}): Promise<{
  taskId: string;
  defaultSubAgentId: string;
  maxTransfers: number;
}>;
declare function callLlmStep(params: CallLlmStepParams): Promise<CallLlmResult>;
declare function executeToolStep(params: ExecuteToolStepParams): Promise<ExecuteToolResult>;
declare function markWorkflowSuspendedStep(params: {
  tenantId: string;
  projectId: string;
  workflowRunId: string;
  continuationStreamNamespace: string;
}): Promise<void>;
declare function markWorkflowResumingStep(params: {
  tenantId: string;
  projectId: string;
  workflowRunId: string;
}): Promise<void>;
declare function markWorkflowCompleteStep(params: {
  tenantId: string;
  projectId: string;
  workflowRunId: string;
}): Promise<void>;
declare function markWorkflowFailedStep(params: {
  tenantId: string;
  projectId: string;
  workflowRunId: string;
  error: string;
}): Promise<void>;
//#endregion
export { AgentExecutionStepPayload, CallLlmResult, CallLlmStepParams, ExecuteToolResult, ExecuteToolStepParams, callLlmStep, executeToolStep, initializeTaskStep, markWorkflowCompleteStep, markWorkflowFailedStep, markWorkflowResumingStep, markWorkflowRunningStep, markWorkflowSuspendedStep };