11import {
22 AssistantUnrolled ,
3- parseWorkflowTools ,
3+ parseAgentFileTools ,
44 Rule ,
55} from "@continuedev/config-yaml" ;
66
@@ -12,24 +12,24 @@ import {
1212 modelProcessor ,
1313 processRule ,
1414} from "./hubLoader.js" ;
15- import { WorkflowServiceState } from "./services/types.js" ;
15+ import { AgentFileServiceState } from "./services/types.js" ;
1616import { logger } from "./util/logger.js" ;
1717
1818/**
1919 * Enhances a configuration by injecting additional components from CLI flags
2020 */
2121export class ConfigEnhancer {
2222 // added this for lint complexity rule
23- private async enhanceConfigFromWorkflow (
23+ private async enhanceConfigFromAgentFile (
2424 config : AssistantUnrolled ,
2525 _options : BaseCommandOptions | undefined ,
26- workflowState ?: WorkflowServiceState ,
26+ agentFileState ?: AgentFileServiceState ,
2727 ) {
2828 const enhancedConfig = { ...config } ;
2929 const options = { ..._options } ;
3030
31- if ( workflowState ?. workflowFile ) {
32- const { rules, model, tools, prompt } = workflowState ?. workflowFile ;
31+ if ( agentFileState ?. agentFile ) {
32+ const { rules, model, tools, prompt } = agentFileState ?. agentFile ;
3333 if ( rules ) {
3434 options . rule = [
3535 ...rules
@@ -42,38 +42,41 @@ export class ConfigEnhancer {
4242
4343 if ( tools ) {
4444 try {
45- const parsedTools = parseWorkflowTools ( tools ) ;
45+ const parsedTools = parseAgentFileTools ( tools ) ;
4646 if ( parsedTools . mcpServers . length > 0 ) {
4747 options . mcp = [ ...parsedTools . mcpServers , ...( options . mcp || [ ] ) ] ;
4848 }
4949 } catch ( e ) {
50- logger . error ( "Failed to parse workflow tools" , e ) ;
50+ logger . error ( "Failed to parse agent file tools" , e ) ;
5151 }
5252 }
5353
54- // --model takes precedence over workflow model
54+ // --model takes precedence over agent file model
5555 if ( model ) {
5656 try {
57- const workflowModel = await loadPackageFromHub ( model , modelProcessor ) ;
57+ const agentFileModel = await loadPackageFromHub (
58+ model ,
59+ modelProcessor ,
60+ ) ;
5861 enhancedConfig . models = [
59- workflowModel ,
62+ agentFileModel ,
6063 ...( enhancedConfig . models ?? [ ] ) ,
6164 ] ;
62- workflowState ?. workflowService ?. setWorkflowModelName (
63- workflowModel . name ,
65+ agentFileState ?. agentFileService ?. setagentFileModelName (
66+ agentFileModel . name ,
6467 ) ;
6568 } catch ( e ) {
66- logger . error ( "Failed to load workflow model" , e ) ;
69+ logger . error ( "Failed to load agent model" , e ) ;
6770 }
6871 }
6972
70- // Workflow prompt is included as a slash command, initial kickoff is handled elsewhere
73+ // Agent file prompt is included as a slash command, initial kickoff is handled elsewhere
7174 if ( prompt ) {
7275 enhancedConfig . prompts = [
7376 {
74- name : `Workflow prompt (${ workflowState . workflowFile . name } )` ,
77+ name : `Agent prompt (${ agentFileState . agentFile . name } )` ,
7578 prompt,
76- description : workflowState . workflowFile . description ,
79+ description : agentFileState . agentFile . description ,
7780 } ,
7881 ...( enhancedConfig . prompts ?? [ ] ) ,
7982 ] ;
@@ -87,12 +90,12 @@ export class ConfigEnhancer {
8790 async enhanceConfig (
8891 config : AssistantUnrolled ,
8992 _options ?: BaseCommandOptions ,
90- workflowState ?: WorkflowServiceState ,
93+ agentFileState ?: AgentFileServiceState ,
9194 ) : Promise < AssistantUnrolled > {
92- const enhanced = await this . enhanceConfigFromWorkflow (
95+ const enhanced = await this . enhanceConfigFromAgentFile (
9396 config ,
9497 _options ,
95- workflowState ,
98+ agentFileState ,
9699 ) ;
97100 let { enhancedConfig } = enhanced ;
98101 const { options } = enhanced ;
0 commit comments