@salesforce/plugin-agent 1.11.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -62,9 +62,7 @@ sf plugins
62
62
  <!-- commands -->
63
63
 
64
64
  - [`sf agent create`](#sf-agent-create)
65
- - [`sf agent create-v2`](#sf-agent-create-v2)
66
65
  - [`sf agent generate spec`](#sf-agent-generate-spec)
67
- - [`sf agent generate spec-v2`](#sf-agent-generate-spec-v2)
68
66
  - [`sf agent generate test-spec`](#sf-agent-generate-test-spec)
69
67
  - [`sf agent preview`](#sf-agent-preview)
70
68
  - [`sf agent test cancel`](#sf-agent-test-cancel)
@@ -76,72 +74,22 @@ sf plugins
76
74
 
77
75
  ## `sf agent create`
78
76
 
79
- Create an agent in your org from a local agent spec file.
80
-
81
- ```
82
- USAGE
83
- $ sf agent create -o <value> -f <value> -n <value> [--json] [--flags-dir <value>] [--api-version <value>]
84
-
85
- FLAGS
86
- -f, --spec=<value> (required) Path to an agent spec file.
87
- -n, --name=<value> (required) API name of the new agent.
88
- -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
89
- configuration variable is already set.
90
- --api-version=<value> Override the api version used for api requests made by this command
91
-
92
- GLOBAL FLAGS
93
- --flags-dir=<value> Import flag values from a directory.
94
- --json Format output as json.
95
-
96
- DESCRIPTION
97
- Create an agent in your org from a local agent spec file.
98
-
99
- To generate an agent spec file, run the "agent generate spec" CLI command, which outputs a JSON file with the list of
100
- jobs and descriptions that the new agent can perform. Then specify this generated spec file to the --spec flag of this
101
- command, along with the name of the new agent.
102
-
103
- When this command finishes, your org contains the new agent, which you can then edit in the Agent Builder UI. The new
104
- agent already has a list of topics and actions that were automatically created from the list of jobs in the provided
105
- agent spec file. This command also retrieves all the metadata files associated with the new agent to your local DX
106
- project.
107
-
108
- To open the new agent in your org's Agent Builder UI, run this command: "sf org open agent --name
109
- <api-name-of-your-agent>".
110
-
111
- EXAMPLES
112
- Create an agent called "CustomerSupportAgent" in an org with alias "my-org" using the specified agent spec file:
113
-
114
- $ sf agent create --name CustomerSupportAgent --spec ./config/agentSpec.json --target-org my-org
115
- ```
116
-
117
- _See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.0/src/commands/agent/create.ts)_
118
-
119
- ## `sf agent create-v2`
120
-
121
77
  Create an agent in your org using a local agent spec file.
122
78
 
123
79
  ```
124
80
  USAGE
125
- $ sf agent create-v2 -o <value> --spec <value> [--json] [--flags-dir <value>] [--api-version <value>] [--agent-name
126
- <value>] [--user-id <value>] [--enrich-logs true|false] [--tone formal|casual|neutral] [--preview] [--planner-id
127
- <value>]
81
+ $ sf agent create -o <value> --spec <value> [--json] [--flags-dir <value>] [--api-version <value>] [--agent-name
82
+ <value>] [--preview] [--agent-api-name <value>]
128
83
 
129
84
  FLAGS
130
- -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
131
- configuration variable is already set.
132
- --agent-name=<value> Name (label) of the new agent.
133
- --api-version=<value> Override the api version used for api requests made by this command
134
- --enrich-logs=<option> Adds agent conversation data to event logs so you can view all agent session activity in
135
- one place.
136
- <options: true|false>
137
- --planner-id=<value> The GenAiPlanner ID to associate with the agent.
138
- --preview Preview the agent without saving it in your org.
139
- --spec=<value> (required) Path to an agent spec file.
140
- --tone=<option> Conversational style of the agent, such as how it expresses your brand personality in its
141
- messages through word choice, punctuation, and sentence structure.
142
- <options: formal|casual|neutral>
143
- --user-id=<value> ID of a user in your org that is assigned to your agent; determines what your agent can
144
- access and do.
85
+ -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
86
+ configuration variable is already set.
87
+ --agent-api-name=<value> API name of the new agent; if not specified, the API name is derived from the agent name
88
+ (label); the API name must not exist in the org.
89
+ --agent-name=<value> Name (label) of the new agent.
90
+ --api-version=<value> Override the api version used for api requests made by this command
91
+ --preview Preview the agent without saving it in your org.
92
+ --spec=<value> (required) Path to an agent spec file.
145
93
 
146
94
  GLOBAL FLAGS
147
95
  --flags-dir=<value> Import flag values from a directory.
@@ -169,104 +117,54 @@ DESCRIPTION
169
117
  EXAMPLES
170
118
  Create an agent called "ResortManager" in an org with alias "my-org" using the specified agent spec file:
171
119
 
172
- $ sf agent create-v2 --agent-name ResortManager --spec specs/resortManagerAgent.yaml --target-org my-org
120
+ $ sf agent create --agent-name ResortManager --spec specs/resortManagerAgent.yaml --target-org my-org
173
121
 
174
122
  Preview the creation of an agent called "ResortManager" and use your default org:
175
123
 
176
- $ sf agent create-v2 --agent-name ResortManager --spec specs/resortManagerAgent.yaml --preview
124
+ $ sf agent create --agent-name ResortManager --spec specs/resortManagerAgent.yaml --preview
177
125
  ```
178
126
 
179
- _See code: [src/commands/agent/create-v2.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.0/src/commands/agent/create-v2.ts)_
127
+ _See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.12.0/src/commands/agent/create.ts)_
180
128
 
181
129
  ## `sf agent generate spec`
182
130
 
183
- Generate an agent spec, which is the list of jobs that the agent performs.
184
-
185
- ```
186
- USAGE
187
- $ sf agent generate spec -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-t customer|internal]
188
- [--role <value>] [--company-name <value>] [--company-description <value>] [--company-website <value>] [-d <value>]
189
- [-f <value>]
190
-
191
- FLAGS
192
- -d, --output-dir=<value> [default: config] Directory where the agent spec file is written; can be an
193
- absolute or relative path.
194
- -f, --file-name=<value> [default: agentSpec.json] Name of the generated agent spec file.
195
- -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
196
- configuration variable is already set.
197
- -t, --type=<option> Type of agent to create.
198
- <options: customer|internal>
199
- --api-version=<value> Override the api version used for api requests made by this command
200
- --company-description=<value> Description of your company.
201
- --company-name=<value> Name of your company.
202
- --company-website=<value> Website URL of your company.
203
- --role=<value> Role of the agent.
204
-
205
- GLOBAL FLAGS
206
- --flags-dir=<value> Import flag values from a directory.
207
- --json Format output as json.
208
-
209
- DESCRIPTION
210
- Generate an agent spec, which is the list of jobs that the agent performs.
211
-
212
- When using Salesforce CLI to create an agent in your org, the first step is to generate the local JSON-formatted agent
213
- spec file with this command.
214
-
215
- An agent spec is a list of jobs and descriptions that capture what the agent can do. Use flags such as --role and
216
- --company-description to provide details about your company and the role that the agent plays in your company; you can
217
- also enter the information interactively if you prefer. When you then execute this command, the large language model
218
- (LLM) associated with your org uses the information to generate the list of jobs that the agent most likely performs.
219
- We recommend that you provide good details for --role, --company-description, etc, so that the LLM can generate the
220
- best and most relevant list of jobs and descriptions. Once generated, you can edit the spec file; for example, you can
221
- remove jobs that don't apply to your agent.
222
-
223
- When your agent spec is ready, you then create the agent in your org by specifying the agent spec file to the
224
- --job-spec flag of the "agent create" CLI command.
225
-
226
- EXAMPLES
227
- Create an agent spec for your default org in the default location and use flags to specify the agent's role and your
228
- company details:
229
-
230
- $ sf agent generate spec --type customer --role "Assist users in navigating and managing bookings" \
231
- --company-name "Coral Cloud" --company-description "Resort that manages guests and their reservations and \
232
- experiences"
233
-
234
- Create an agent spec by being prompted for role and company details interactively; write the generated file to the
235
- "specs" directory and use the org with alias "my-org":
236
-
237
- $ sf agent generate spec --output-dir specs --target-org my-org
238
- ```
239
-
240
- _See code: [src/commands/agent/generate/spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.0/src/commands/agent/generate/spec.ts)_
241
-
242
- ## `sf agent generate spec-v2`
243
-
244
131
  Generate an agent spec, which is a YAML file that captures what an agent can do.
245
132
 
246
133
  ```
247
134
  USAGE
248
- $ sf agent generate spec-v2 -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-t customer|internal]
249
- [--role <value>] [--company-name <value>] [--company-description <value>] [--company-website <value>] [--spec
250
- <value>] [--output-file <value>] [--max-topics <value>] [--grounding-context <value> --prompt-template <value>]
135
+ $ sf agent generate spec -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-t customer|internal]
136
+ [--role <value>] [--company-name <value>] [--company-description <value>] [--company-website <value>] [--max-topics
137
+ <value>] [--agent-user <value>] [--enrich-logs true|false] [--tone formal|casual|neutral] [--spec <value>]
138
+ [--output-file <value>] [--full-interview] [--grounding-context <value> --prompt-template <value>] [--no-prompt]
251
139
 
252
140
  FLAGS
253
141
  -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
254
142
  configuration variable is already set.
255
143
  -t, --type=<option> Type of agent to create.
256
144
  <options: customer|internal>
145
+ --agent-user=<value> Username of a user in your org to assign to your agent; determines what your agent
146
+ can access and do.
257
147
  --api-version=<value> Override the api version used for api requests made by this command
258
148
  --company-description=<value> Description of your company.
259
149
  --company-name=<value> Name of your company.
260
150
  --company-website=<value> Website URL of your company.
151
+ --enrich-logs=<option> Adds agent conversation data to event logs so you can view all agent session
152
+ activity in one place.
153
+ <options: true|false>
154
+ --full-interview Prompt for both required and optional flags.
261
155
  --grounding-context=<value> Context information and personalization that's added to your prompts when using a
262
156
  custom prompt template.
263
157
  --max-topics=<value> Maximum number of topics to generate in the agent spec; default is 10.
158
+ --no-prompt Don't prompt the user to confirm spec file overwrite.
264
159
  --output-file=<value> [default: config/agentSpec.yaml] Path for the generated YAML agent spec file; can
265
160
  be an absolute or relative path.
266
161
  --prompt-template=<value> API name of a customized prompt template to use instead of the default prompt
267
162
  template.
268
163
  --role=<value> Role of the agent.
269
164
  --spec=<value> Agent spec file, in YAML format, to use as input to the command.
165
+ --tone=<option> Conversational style of the agent, such as how it expresses your brand personality
166
+ in its messages through word choice, punctuation, and sentence structure.
167
+ <options: formal|casual|neutral>
270
168
 
271
169
  GLOBAL FLAGS
272
170
  --flags-dir=<value> Import flag values from a directory.
@@ -302,24 +200,24 @@ EXAMPLES
302
200
  Generate an agent spec in the default location and use flags to specify the agent properties, such as its role and
303
201
  your company details; use your default org:
304
202
 
305
- $ sf agent generate spec-v2 --type customer --role "Field customer complaints and manage employee schedules." \
203
+ $ sf agent generate spec --type customer --role "Field customer complaints and manage employee schedules." \
306
204
  --company-name "Coral Cloud Resorts" --company-description "Provide customers with exceptional destination \
307
205
  activities, unforgettable experiences, and reservation services."
308
206
 
309
207
  Generate an agent spec by being prompted for the required agent properties and generate a maxiumum of 5 topics;
310
208
  write the generated file to the "specs/resortManagerSpec.yaml" file and use the org with alias "my-org":
311
209
 
312
- $ sf agent generate spec-v2 --max-topics 5 --output-file specs/resortManagerAgent.yaml --target-org my-org
210
+ $ sf agent generate spec --max-topics 5 --output-file specs/resortManagerAgent.yaml --target-org my-org
313
211
 
314
212
  Specify an existing agent spec file called "specs/resortManagerAgent.yaml", and then overwrite it with a new version
315
213
  that contains newly AI-generated topics based on the updated role information passed in with the --role flag:
316
214
 
317
- $ sf agent generate spec-v2 --spec specs/resortManagerAgent.yaml --output-file specs/resortManagerAgent.yaml \
318
- --role "Field customer complaints, manage employee schedules, and ensure all resort operations are running \
319
- smoothly" --target-org my-org
215
+ $ sf agent generate spec --spec specs/resortManagerAgent.yaml --output-file specs/resortManagerAgent.yaml --role \
216
+ "Field customer complaints, manage employee schedules, and ensure all resort operations are running smoothly" \
217
+ --target-org my-org
320
218
  ```
321
219
 
322
- _See code: [src/commands/agent/generate/spec-v2.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.0/src/commands/agent/generate/spec-v2.ts)_
220
+ _See code: [src/commands/agent/generate/spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.12.0/src/commands/agent/generate/spec.ts)_
323
221
 
324
222
  ## `sf agent generate test-spec`
325
223
 
@@ -342,7 +240,7 @@ EXAMPLES
342
240
  $ sf agent generate test-spec
343
241
  ```
344
242
 
345
- _See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.0/src/commands/agent/generate/test-spec.ts)_
243
+ _See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.12.0/src/commands/agent/generate/test-spec.ts)_
346
244
 
347
245
  ## `sf agent preview`
348
246
 
@@ -377,7 +275,7 @@ FLAG DESCRIPTIONS
377
275
  the API name of the agent? (TBD based on agents library)
378
276
  ```
379
277
 
380
- _See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.0/src/commands/agent/preview.ts)_
278
+ _See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.12.0/src/commands/agent/preview.ts)_
381
279
 
382
280
  ## `sf agent test cancel`
383
281
 
@@ -414,7 +312,7 @@ EXAMPLES
414
312
  $ sf agent test cancel --job-id 4KBfake0000003F4AQ --target-org my-org
415
313
  ```
416
314
 
417
- _See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.0/src/commands/agent/test/cancel.ts)_
315
+ _See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.12.0/src/commands/agent/test/cancel.ts)_
418
316
 
419
317
  ## `sf agent test create`
420
318
 
@@ -450,7 +348,7 @@ FLAG DESCRIPTIONS
450
348
  More information about a flag. Don't repeat the summary.
451
349
  ```
452
350
 
453
- _See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.0/src/commands/agent/test/create.ts)_
351
+ _See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.12.0/src/commands/agent/test/create.ts)_
454
352
 
455
353
  ## `sf agent test list`
456
354
 
@@ -479,7 +377,7 @@ EXAMPLES
479
377
  $ sf agent test list
480
378
  ```
481
379
 
482
- _See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.0/src/commands/agent/test/list.ts)_
380
+ _See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.12.0/src/commands/agent/test/list.ts)_
483
381
 
484
382
  ## `sf agent test results`
485
383
 
@@ -535,7 +433,7 @@ FLAG DESCRIPTIONS
535
433
  test results aren't written.
536
434
  ```
537
435
 
538
- _See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.0/src/commands/agent/test/results.ts)_
436
+ _See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.12.0/src/commands/agent/test/results.ts)_
539
437
 
540
438
  ## `sf agent test resume`
541
439
 
@@ -598,7 +496,7 @@ FLAG DESCRIPTIONS
598
496
  test results aren't written.
599
497
  ```
600
498
 
601
- _See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.0/src/commands/agent/test/resume.ts)_
499
+ _See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.12.0/src/commands/agent/test/resume.ts)_
602
500
 
603
501
  ## `sf agent test run`
604
502
 
@@ -661,6 +559,6 @@ FLAG DESCRIPTIONS
661
559
  test results aren't written.
662
560
  ```
663
561
 
664
- _See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.0/src/commands/agent/test/run.ts)_
562
+ _See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.12.0/src/commands/agent/test/run.ts)_
665
563
 
666
564
  <!-- commandsstop -->
@@ -1,7 +1,7 @@
1
1
  import { SfCommand } from '@salesforce/sf-plugins-core';
2
- export type AgentCreateResult = {
3
- isSuccess: boolean;
4
- errorMessage?: string;
2
+ import { AgentCreateResponseV2 } from '@salesforce/agents';
3
+ export type AgentCreateResult = AgentCreateResponseV2 & {
4
+ previewFilePath?: string;
5
5
  };
6
6
  export default class AgentCreate extends SfCommand<AgentCreateResult> {
7
7
  static readonly summary: string;
@@ -10,10 +10,13 @@ export default class AgentCreate extends SfCommand<AgentCreateResult> {
10
10
  static readonly requiresProject = true;
11
11
  static state: string;
12
12
  static readonly flags: {
13
+ spec: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
14
+ preview: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
+ 'agent-api-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
+ 'planner-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ "agent-name": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
18
  'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
14
19
  'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
- spec: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
16
- name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
17
20
  };
18
21
  run(): Promise<AgentCreateResult>;
19
22
  }
@@ -4,14 +4,30 @@
4
4
  * Licensed under the BSD 3-Clause license.
5
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
6
  */
7
- import * as fs from 'node:fs';
7
+ import { resolve } from 'node:path';
8
+ import { readFileSync, writeFileSync } from 'node:fs';
9
+ import YAML from 'yaml';
8
10
  import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
9
11
  import { Lifecycle, Messages } from '@salesforce/core';
10
12
  import { MultiStageOutput } from '@oclif/multi-stage-output';
11
13
  import { colorize } from '@oclif/core/ux';
12
- import { Agent, AgentCreateLifecycleStages } from '@salesforce/agents';
14
+ import { Agent, AgentCreateLifecycleStagesV2, generateAgentApiName, } from '@salesforce/agents';
15
+ import { makeFlags, promptForFlag, validateAgentType } from '../../flags.js';
13
16
  Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
14
17
  const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.create');
18
+ const MSO_STAGES = {
19
+ parse: 'Parsing Agent spec',
20
+ preview: 'Creating Agent for preview',
21
+ create: 'Creating Agent in org',
22
+ retrieve: 'Retrieving Agent metadata',
23
+ };
24
+ const FLAGGABLE_PROMPTS = {
25
+ 'agent-name': {
26
+ message: messages.getMessage('flags.agent-name.summary'),
27
+ validate: (d) => d.length > 0 || 'Agent Name cannot be empty',
28
+ required: true,
29
+ },
30
+ };
15
31
  export default class AgentCreate extends SfCommand {
16
32
  static summary = messages.getMessage('summary');
17
33
  static description = messages.getMessage('description');
@@ -21,54 +37,128 @@ export default class AgentCreate extends SfCommand {
21
37
  static flags = {
22
38
  'target-org': Flags.requiredOrg(),
23
39
  'api-version': Flags.orgApiVersion(),
40
+ ...makeFlags(FLAGGABLE_PROMPTS),
24
41
  spec: Flags.file({
25
- char: 'f',
26
- required: true,
42
+ // char: 'f',
27
43
  summary: messages.getMessage('flags.spec.summary'),
28
- }),
29
- name: Flags.string({
30
- char: 'n',
44
+ exists: true,
31
45
  required: true,
32
- summary: messages.getMessage('flags.name.summary'),
46
+ }),
47
+ preview: Flags.boolean({
48
+ summary: messages.getMessage('flags.preview.summary'),
49
+ }),
50
+ 'agent-api-name': Flags.string({
51
+ summary: messages.getMessage('flags.agent-api-name.summary'),
52
+ }),
53
+ // This would be used as more of an agent update than create.
54
+ // Could possibly move to an `agent update` command.
55
+ 'planner-id': Flags.string({
56
+ summary: messages.getMessage('flags.planner-id.summary'),
57
+ hidden: true,
33
58
  }),
34
59
  };
60
+ // eslint-disable-next-line complexity
35
61
  async run() {
36
62
  const { flags } = await this.parse(AgentCreate);
37
- const jsonParsingStage = `Parsing ${flags.spec}`;
38
- const mso = new MultiStageOutput({
39
- jsonEnabled: this.jsonEnabled(),
40
- title: `Creating ${flags.name} Agent`,
41
- stages: [
42
- jsonParsingStage,
43
- 'Generating local metadata',
44
- 'Deploying metadata to org',
45
- 'Creating Agent in org',
46
- 'Retrieving Agent metadata',
47
- ],
48
- });
49
- mso.goto(jsonParsingStage);
50
- const agentConfig = {
51
- ...JSON.parse(fs.readFileSync(flags.spec, 'utf8')),
52
- name: flags.name,
53
- };
54
- // @ts-expect-error not using async method in callback
55
- Lifecycle.getInstance().on(AgentCreateLifecycleStages.CreatingLocally, () => mso.goto('Generating local metadata'));
56
- Lifecycle.getInstance().on(AgentCreateLifecycleStages.DeployingMetadata, () =>
63
+ // throw error if --json is used and not all required flags are provided
64
+ if (this.jsonEnabled() && !flags['agent-name']) {
65
+ throw messages.createError('error.missingRequiredFlags', ['agent-name']);
66
+ }
67
+ // Read the agent spec and validate
68
+ const inputSpec = YAML.parse(readFileSync(resolve(flags.spec), 'utf8'));
69
+ validateSpec(inputSpec);
70
+ // If we don't have an agent name yet, prompt.
71
+ const agentName = flags['agent-name'] ?? (await promptForFlag(FLAGGABLE_PROMPTS['agent-name']));
72
+ const agentApiName = flags['agent-api-name'] ?? generateAgentApiName(agentName);
73
+ let title;
74
+ const stages = [MSO_STAGES.parse];
75
+ if (flags.preview) {
76
+ title = `Previewing ${agentName} Creation`;
77
+ stages.push(MSO_STAGES.preview);
78
+ }
79
+ else {
80
+ title = `Creating ${agentName} Agent`;
81
+ stages.push(MSO_STAGES.create);
82
+ stages.push(MSO_STAGES.retrieve);
83
+ }
84
+ const mso = new MultiStageOutput({ jsonEnabled: this.jsonEnabled(), title, stages });
85
+ mso.goto(MSO_STAGES.parse);
57
86
  // @ts-expect-error not using async method in callback
58
- mso.goto('Deploying metadata to org'));
87
+ Lifecycle.getInstance().on(AgentCreateLifecycleStagesV2.Previewing, () => mso.goto(MSO_STAGES.preview));
59
88
  // @ts-expect-error not using async method in callback
60
- Lifecycle.getInstance().on(AgentCreateLifecycleStages.CreatingRemotely, () => mso.goto('Creating Agent in org'));
61
- Lifecycle.getInstance().on(AgentCreateLifecycleStages.RetrievingMetadata, () =>
89
+ Lifecycle.getInstance().on(AgentCreateLifecycleStagesV2.Creating, () => mso.goto(MSO_STAGES.create));
62
90
  // @ts-expect-error not using async method in callback
63
- mso.goto('Retrieving Agent metadata'));
64
- const agent = new Agent(flags['target-org'].getConnection(flags['api-version']), this.project);
65
- const created = await agent.create(agentConfig);
91
+ Lifecycle.getInstance().on(AgentCreateLifecycleStagesV2.Retrieving, () => mso.goto(MSO_STAGES.retrieve));
92
+ const connection = flags['target-org'].getConnection(flags['api-version']);
93
+ const agent = new Agent(connection, this.project);
94
+ const agentConfig = {
95
+ agentType: inputSpec.agentType,
96
+ generationInfo: {
97
+ defaultInfo: {
98
+ role: inputSpec.role,
99
+ companyName: inputSpec.companyName,
100
+ companyDescription: inputSpec.companyDescription,
101
+ preDefinedTopics: inputSpec.topics,
102
+ },
103
+ },
104
+ generationSettings: {},
105
+ };
106
+ if (inputSpec?.companyWebsite) {
107
+ agentConfig.generationInfo.defaultInfo.companyWebsite = inputSpec?.companyWebsite;
108
+ }
109
+ if (!flags.preview) {
110
+ agentConfig.saveAgent = true;
111
+ agentConfig.agentSettings = { agentName, agentApiName };
112
+ if (flags['planner-id']) {
113
+ agentConfig.agentSettings.plannerId = flags['planner-id'];
114
+ }
115
+ if (inputSpec?.agentUser) {
116
+ // TODO: query for the user ID from the username
117
+ agentConfig.agentSettings.userId = inputSpec.agentUser;
118
+ }
119
+ if (inputSpec?.enrichLogs) {
120
+ agentConfig.agentSettings.enrichLogs = inputSpec.enrichLogs;
121
+ }
122
+ if (inputSpec?.tone) {
123
+ agentConfig.agentSettings.tone = inputSpec.tone;
124
+ }
125
+ }
126
+ const response = await agent.createV2(agentConfig);
127
+ const result = response;
66
128
  mso.stop();
67
- this.log(created.isSuccess
68
- ? colorize('green', `Successfully created ${flags.name} in ${flags['target-org'].getUsername() ?? 'the target org'}.`)
69
- : colorize('red', `failed to create agent ${flags.name}: ${created.errorMessage ?? ''}`));
70
- this.log(`Use ${colorize('dim', `sf org open agent --name ${flags.name}`)} to view the agent in the browser.`);
71
- return { isSuccess: created.isSuccess };
129
+ if (response.isSuccess) {
130
+ if (!flags.preview) {
131
+ const orgUsername = flags['target-org'].getUsername();
132
+ this.log(`Successfully created ${agentName} in ${orgUsername}.\n`);
133
+ this.log(`Use ${colorize('dim', `sf org open agent --name ${agentApiName} -o ${orgUsername}`)} to view the agent in the browser.`);
134
+ }
135
+ else {
136
+ const previewFileName = `${agentApiName}_Preview_${new Date().toISOString()}.json`;
137
+ writeFileSync(previewFileName, JSON.stringify(response, null, 2));
138
+ result.previewFilePath = resolve(previewFileName);
139
+ this.log(`Successfully created agent for preview. See ${previewFileName}\n`);
140
+ }
141
+ }
142
+ else {
143
+ this.log(colorize('red', `Failed to create agent: ${response.errorMessage ?? ''}`));
144
+ }
145
+ return result;
72
146
  }
73
147
  }
148
+ // The spec must define: agentType, role, companyName, companyDescription, and topics.
149
+ // Agent type must be 'customer' or 'internal'.
150
+ const validateSpec = (spec) => {
151
+ const requiredSpecValues = [
152
+ 'agentType',
153
+ 'role',
154
+ 'companyName',
155
+ 'companyDescription',
156
+ 'topics',
157
+ ];
158
+ const missingFlags = requiredSpecValues.filter((f) => !spec[f]);
159
+ if (missingFlags.length) {
160
+ throw messages.createError('error.missingRequiredSpecProperties', [missingFlags.join(', ')]);
161
+ }
162
+ validateAgentType(spec.agentType, true);
163
+ };
74
164
  //# sourceMappingURL=create.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/agent/create.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAqB,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAE1F,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,cAAc,CAAC,CAAC;AAOnF,MAAM,CAAC,OA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