@@ -8,7 +8,7 @@ import { resolve } from 'node:path';
8
8
import { existsSync , readFileSync , writeFileSync } from 'node:fs' ;
9
9
import YAML from 'yaml' ;
10
10
import { SfCommand , Flags } from '@salesforce/sf-plugins-core' ;
11
- import { Lifecycle , Messages } from '@salesforce/core' ;
11
+ import { Lifecycle , Messages , SfProject } from '@salesforce/core' ;
12
12
import { MultiStageOutput } from '@oclif/multi-stage-output' ;
13
13
import { input as inquirerInput } from '@inquirer/prompts' ;
14
14
import { colorize } from '@oclif/core/ux' ;
@@ -164,7 +164,6 @@ export default class AgentCreate extends SfCommand<AgentCreateResult> {
164
164
) ;
165
165
166
166
const connection = flags [ 'target-org' ] . getConnection ( flags [ 'api-version' ] ) ;
167
- const agent = new Agent ( connection , this . project ! ) ;
168
167
169
168
const agentConfig : AgentCreateConfig = {
170
169
agentType : inputSpec . agentType ,
@@ -197,7 +196,7 @@ export default class AgentCreate extends SfCommand<AgentCreateResult> {
197
196
agentConfig . agentSettings . tone = validateTone ( inputSpec . tone ) ;
198
197
}
199
198
}
200
- const response = await agent . create ( agentConfig ) ;
199
+ const response = await Agent . create ( connection , this . project as SfProject , agentConfig ) ;
201
200
const result : AgentCreateResult = response ;
202
201
203
202
mso . stop ( ) ;
0 commit comments