11import { randomUUID } from 'node:crypto' ;
2- import type { LlmFunctionsImpl } from '#agent/LlmFunctionsImpl' ;
32import { createContext } from '#agent/agentContextLocalStorage' ;
43import { runCodeGenAgent } from '#agent/autonomous/codegen/codegenAutonomousAgent' ;
54import { AGENT_REQUEST_FEEDBACK } from '#agent/autonomous/functions/agentFeedback' ;
@@ -10,57 +9,16 @@ import { FUNC_SEP } from '#functionSchema/functions';
109import { Git } from '#functions/scm/git' ;
1110import { GitHub } from '#functions/scm/github' ;
1211import { logger } from '#o11y/logger' ;
13- import type { AgentCompleted , AgentContext , AgentLLMs , AgentType } from '#shared/agent/agent.model' ;
12+ import type { AgentContext } from '#shared/agent/agent.model' ;
1413import type { FunctionCallResult } from '#shared/llm/llm.model' ;
15- import type { User } from '#shared/user/user.model' ;
1614import { runAsUser } from '#user/userContext' ;
1715import { errorToString } from '#utils/errors' ;
1816import { CDATA_END , CDATA_START } from '#utils/xml-utils' ;
17+ import { RunAgentConfig } from './runAgentTypes' ;
1918
2019export const SUPERVISOR_RESUMED_FUNCTION_NAME : string = `Supervisor${ FUNC_SEP } Resumed` ;
2120export const SUPERVISOR_CANCELLED_FUNCTION_NAME : string = `Supervisor${ FUNC_SEP } Cancelled` ;
2221
23- export type RunWorkflowConfig = Omit < RunAgentConfig , 'type' | 'functions' > & Partial < Pick < RunAgentConfig , 'functions' > > ;
24-
25- /**
26- * Configuration for running an autonomous agent
27- */
28- export interface RunAgentConfig {
29- /** The user who created the agent. Uses currentUser() if not provided */
30- user ?: User ;
31- /** The parent agentId */
32- parentAgentId ?: string ;
33- codeTaskId ?: string ;
34- /** The name of this agent */
35- agentName : string ;
36- /** Autonomous or workflow */
37- type : AgentType ;
38- /** For autonomous agents either xml or codegen. For workflow agents it identifies the workflow type */
39- subtype : string ;
40- /** The function classes the agent has available to call */
41- functions : LlmFunctionsImpl | Array < new ( ) => any > ;
42- /** Handler for when the agent finishes executing. Defaults to console output */
43- completedHandler ?: AgentCompleted ;
44- /** The user prompt */
45- initialPrompt : string ;
46- /** The agent system prompt */
47- systemPrompt ?: string ;
48- /** Settings for requiring a human-in-the-loop */
49- humanInLoop ?: { budget ?: number ; count ?: number ; functionErrorCount ?: number } ;
50- /** The default LLMs available to use */
51- llms ?: AgentLLMs ;
52- /** The agent to resume */
53- resumeAgentId ?: string ;
54- /** The base path of the context FileSystem. Defaults to the process working directory */
55- fileSystemPath ?: string ;
56- /** Use shared repository location instead of agent-specific directory. Defaults to true. */
57- useSharedRepos ?: boolean ;
58- /** If running in a container, the ID of the container */
59- containerId ?: string ;
60- /** Additional details for the agent */
61- metadata ?: Record < string , any > ;
62- }
63-
6422/**
6523 * The reference to a running agent
6624 */
0 commit comments