@salesforce/plugin-agent 1.10.0 → 1.11.1

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.
Files changed (34) hide show
  1. package/README.md +136 -93
  2. package/lib/commands/agent/create-v2.d.ts +3 -7
  3. package/lib/commands/agent/create-v2.js +31 -75
  4. package/lib/commands/agent/create-v2.js.map +1 -1
  5. package/lib/commands/agent/generate/spec-v2.d.ts +64 -1
  6. package/lib/commands/agent/generate/spec-v2.js +170 -19
  7. package/lib/commands/agent/generate/spec-v2.js.map +1 -1
  8. package/lib/commands/agent/generate/{test-definition.d.ts → test-spec.d.ts} +1 -1
  9. package/lib/commands/agent/generate/{test-cases.js → test-spec.js} +50 -51
  10. package/lib/commands/agent/generate/test-spec.js.map +1 -0
  11. package/lib/commands/agent/test/create.d.ts +23 -0
  12. package/lib/commands/agent/test/create.js +95 -0
  13. package/lib/commands/agent/test/create.js.map +1 -0
  14. package/lib/flags.d.ts +1 -28
  15. package/lib/flags.js +3 -41
  16. package/lib/flags.js.map +1 -1
  17. package/messages/agent.create-v2.md +19 -25
  18. package/messages/agent.generate.spec-v2.md +89 -13
  19. package/messages/agent.generate.test-spec.md +11 -0
  20. package/messages/agent.test.create.md +27 -0
  21. package/messages/shared.md +0 -20
  22. package/npm-shrinkwrap.json +280 -266
  23. package/oclif.lock +64 -17
  24. package/oclif.manifest.json +164 -115
  25. package/package.json +8 -4
  26. package/schemas/agent-create__v2.json +129 -5
  27. package/schemas/agent-test-create.json +19 -0
  28. package/schemas/agent-test-results.json +14 -17
  29. package/lib/commands/agent/generate/test-cases.d.ts +0 -16
  30. package/lib/commands/agent/generate/test-cases.js.map +0 -1
  31. package/lib/commands/agent/generate/test-definition.js +0 -76
  32. package/lib/commands/agent/generate/test-definition.js.map +0 -1
  33. package/messages/agent.generate.test-cases.md +0 -11
  34. package/messages/agent.generate.test-definition.md +0 -13
package/README.md CHANGED
@@ -65,10 +65,10 @@ sf plugins
65
65
  - [`sf agent create-v2`](#sf-agent-create-v2)
66
66
  - [`sf agent generate spec`](#sf-agent-generate-spec)
67
67
  - [`sf agent generate spec-v2`](#sf-agent-generate-spec-v2)
68
- - [`sf agent generate test-cases`](#sf-agent-generate-test-cases)
69
- - [`sf agent generate test-definition`](#sf-agent-generate-test-definition)
68
+ - [`sf agent generate test-spec`](#sf-agent-generate-test-spec)
70
69
  - [`sf agent preview`](#sf-agent-preview)
71
70
  - [`sf agent test cancel`](#sf-agent-test-cancel)
71
+ - [`sf agent test create`](#sf-agent-test-create)
72
72
  - [`sf agent test list`](#sf-agent-test-list)
73
73
  - [`sf agent test results`](#sf-agent-test-results)
74
74
  - [`sf agent test resume`](#sf-agent-test-resume)
@@ -114,58 +114,61 @@ EXAMPLES
114
114
  $ sf agent create --name CustomerSupportAgent --spec ./config/agentSpec.json --target-org my-org
115
115
  ```
116
116
 
117
- _See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.10.0/src/commands/agent/create.ts)_
117
+ _See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.1/src/commands/agent/create.ts)_
118
118
 
119
119
  ## `sf agent create-v2`
120
120
 
121
- Create an agent in your org from a local agent spec file.
121
+ Create an agent in your org using a local agent spec file.
122
122
 
123
123
  ```
124
124
  USAGE
125
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>]
126
+ <value>] [--preview] [--agent-api-name <value>]
128
127
 
129
128
  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 for 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.
135
- <options: true|false>
136
- --planner-id=<value> The GenAiPlanner ID to associate with the agent.
137
- --preview Preview the agent without saving in your org.
138
- --spec=<value> (required) Path to an agent spec file.
139
- --tone=<option> Conversational style of agent responses.
140
- <options: formal|casual|neutral>
141
- --user-id=<value> Custom user ID for the agent.
129
+ -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
130
+ configuration variable is already set.
131
+ --agent-api-name=<value> API name of the new agent; if not specified, the API name is derived from the agent name
132
+ (label); the API name must not exist in the org.
133
+ --agent-name=<value> Name (label) of the new agent.
134
+ --api-version=<value> Override the api version used for api requests made by this command
135
+ --preview Preview the agent without saving it in your org.
136
+ --spec=<value> (required) Path to an agent spec file.
142
137
 
143
138
  GLOBAL FLAGS
144
139
  --flags-dir=<value> Import flag values from a directory.
145
140
  --json Format output as json.
146
141
 
147
142
  DESCRIPTION
148
- Create an agent in your org from a local agent spec file.
143
+ Create an agent in your org using a local agent spec file.
149
144
 
150
- To generate an agent spec file, run the "agent generate spec" CLI command, which outputs a YAML file with the list of
151
- jobs and descriptions that the new agent can perform. Then specify this generated spec file to the --spec flag of this
152
- command, along with the name of the new agent.
145
+ Before you run this command, you must first generate an agent spec file by running the "agent generate spec" CLI
146
+ command, which outputs a YAML file with the agent properties and list of AI-generated topics. Topics define the range
147
+ of jobs the agent can handle. Then specify the generated agent spec file to this command using the --spec flag, along
148
+ with the name (label) of the new agent using the --agent-name flag.
153
149
 
154
150
  When this command finishes, your org contains the new agent, which you can then edit in the Agent Builder UI. The new
155
- agent already has a list of topics and actions that were automatically created from the list of jobs in the provided
156
- agent spec file. This command also retrieves all the metadata files associated with the new agent to your local DX
151
+ agent's topics are the same as the ones listed in the agent spec file. The agent might also have some AI-generated
152
+ actions. This command also retrieves all the metadata files associated with the new agent to your local Salesforce DX
157
153
  project.
158
154
 
155
+ Use the --preview flag to review what the agent looks like without actually saving it in your org. Rather, the command
156
+ creates a JSON file with all the agent details in the current directory.
157
+
159
158
  To open the new agent in your org's Agent Builder UI, run this command: "sf org open agent --name
160
159
  <api-name-of-your-agent>".
161
160
 
162
161
  EXAMPLES
163
- Create an agent called "CustomerSupportAgent" in an org with alias "my-org" using the specified agent spec file:
162
+ Create an agent called "ResortManager" in an org with alias "my-org" using the specified agent spec file:
163
+
164
+ $ sf agent create-v2 --agent-name ResortManager --spec specs/resortManagerAgent.yaml --target-org my-org
165
+
166
+ Preview the creation of an agent called "ResortManager" and use your default org:
164
167
 
165
- $ sf agent create-v2 --name CustomerSupportAgent --spec ./config/agentSpec.json --target-org my-org
168
+ $ sf agent create-v2 --agent-name ResortManager --spec specs/resortManagerAgent.yaml --preview
166
169
  ```
167
170
 
168
- _See code: [src/commands/agent/create-v2.ts](https://github.com/salesforcecli/plugin-agent/blob/1.10.0/src/commands/agent/create-v2.ts)_
171
+ _See code: [src/commands/agent/create-v2.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.1/src/commands/agent/create-v2.ts)_
169
172
 
170
173
  ## `sf agent generate spec`
171
174
 
@@ -226,119 +229,123 @@ EXAMPLES
226
229
  $ sf agent generate spec --output-dir specs --target-org my-org
227
230
  ```
228
231
 
229
- _See code: [src/commands/agent/generate/spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.10.0/src/commands/agent/generate/spec.ts)_
232
+ _See code: [src/commands/agent/generate/spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.1/src/commands/agent/generate/spec.ts)_
230
233
 
231
234
  ## `sf agent generate spec-v2`
232
235
 
233
- Generate an agent spec, which is the list of jobs that the agent performs.
236
+ Generate an agent spec, which is a YAML file that captures what an agent can do.
234
237
 
235
238
  ```
236
239
  USAGE
237
240
  $ sf agent generate spec-v2 -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-t customer|internal]
238
- [--role <value>] [--company-name <value>] [--company-description <value>] [--company-website <value>] [--spec
239
- <value>] [--output-file <value>] [--max-topics <value>] [--grounding-context <value> --prompt-template <value>]
241
+ [--role <value>] [--company-name <value>] [--company-description <value>] [--company-website <value>] [--max-topics
242
+ <value>] [--agent-user <value>] [--enrich-logs true|false] [--tone formal|casual|neutral] [--spec <value>]
243
+ [--output-file <value>] [--full-interview] [--grounding-context <value> --prompt-template <value>] [--no-prompt]
240
244
 
241
245
  FLAGS
242
246
  -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
243
247
  configuration variable is already set.
244
248
  -t, --type=<option> Type of agent to create.
245
249
  <options: customer|internal>
250
+ --agent-user=<value> Username of a user in your org to assign to your agent; determines what your agent
251
+ can access and do.
246
252
  --api-version=<value> Override the api version used for api requests made by this command
247
253
  --company-description=<value> Description of your company.
248
254
  --company-name=<value> Name of your company.
249
255
  --company-website=<value> Website URL of your company.
250
- --grounding-context=<value> Context information to be used with the customized prompt template.
251
- --max-topics=<value> Maximum number of agent job topics to generate in the spec; default is 10.
252
- --output-file=<value> [default: config/agentSpec.yaml] Path for the generated agent spec file (yaml); can
256
+ --enrich-logs=<option> Adds agent conversation data to event logs so you can view all agent session
257
+ activity in one place.
258
+ <options: true|false>
259
+ --full-interview Prompt for both required and optional flags.
260
+ --grounding-context=<value> Context information and personalization that's added to your prompts when using a
261
+ custom prompt template.
262
+ --max-topics=<value> Maximum number of topics to generate in the agent spec; default is 10.
263
+ --no-prompt Don't prompt the user to confirm spec file overwrite.
264
+ --output-file=<value> [default: config/agentSpec.yaml] Path for the generated YAML agent spec file; can
253
265
  be an absolute or relative path.
254
- --prompt-template=<value> Developer name of a customized prompt template to use instead of the default.
266
+ --prompt-template=<value> API name of a customized prompt template to use instead of the default prompt
267
+ template.
255
268
  --role=<value> Role of the agent.
256
- --spec=<value> Spec file (yaml) to use as input to the command.
269
+ --spec=<value> Agent spec file, in YAML format, to use as input to the command.
270
+ --tone=<option> Conversational style of the agent, such as how it expresses your brand personality
271
+ in its messages through word choice, punctuation, and sentence structure.
272
+ <options: formal|casual|neutral>
257
273
 
258
274
  GLOBAL FLAGS
259
275
  --flags-dir=<value> Import flag values from a directory.
260
276
  --json Format output as json.
261
277
 
262
278
  DESCRIPTION
263
- Generate an agent spec, which is the list of jobs that the agent performs.
264
-
265
- When using Salesforce CLI to create an agent in your org, you can choose to generate a YAML-formatted agent spec file
266
- with this command as a first step.
267
-
268
- An agent spec is a list of jobs and descriptions that capture what the agent can do. Use flags such as --role and
269
- --company-description to provide details about your company and the role that the agent plays in your company; you can
270
- also enter the information interactively if you prefer. When you then execute this command, the large language model
271
- (LLM) associated with your org uses the information to generate the list of jobs that the agent most likely performs.
272
- We recommend that you provide good details for --role, --company-description, etc, so that the LLM can generate the
273
- best and most relevant list of jobs and descriptions. Once generated, you can edit the spec file; for example, you can
274
- remove jobs that don't apply to your agent.
279
+ Generate an agent spec, which is a YAML file that captures what an agent can do.
275
280
 
276
- When your agent spec is ready, you then create the agent in your org by specifying the agent spec file to the
277
- --job-spec flag of the "agent create" CLI command.
281
+ Before you use Salesforce CLI to create an agent in your org, you must first generate an agent spec with this command.
282
+ An agent spec is a YAML-formatted file that contains information about the agent, such as its role and company
283
+ description, and then an AI-generated list of topics based on this information. Topics define the range of jobs your
284
+ agent can handle.
278
285
 
279
- EXAMPLES
280
- Create an agent spec for your default org in the default location and use flags to specify the agent's role and your
281
- company details:
282
-
283
- $ sf agent generate spec-v2 --type customer --role "Assist users in navigating and managing bookings" \
284
- --company-name "Coral Cloud" --company-description "Resort that manages guests and their reservations and \
285
- experiences"
286
-
287
- Create an agent spec by being prompted for role and company details interactively; write the generated file to the
288
- "specs" directory and use the org with alias "my-org":
286
+ Use flags, such as --role and --company-description, to provide details about your company and the role that the agent
287
+ plays in your company. If you prefer, you can also be prompted for the information. Upon command execution, the large
288
+ language model (LLM) associated with your org uses the information you provided to generate a list of topics for the
289
+ agent. Because the LLM uses the company and role information to generate the topics, we recommend that you provide
290
+ accurate and specific details so the LLM generates the best and most relevant topics. Once generated, you can edit the
291
+ spec file; for example, you can remove topics that don't apply to your agent or change the description of a particular
292
+ topic.
289
293
 
290
- $ sf agent generate spec-v2 --output-dir specs --target-org my-org
291
- ```
294
+ You can iterate the spec generation process by using the --spec flag to pass an existing agent spec file to this
295
+ command, and then using the --role, --company-description, etc, flags to refine your agent properties. Iteratively
296
+ improving the description of your agent allows the LLM to generate progressively better topics.
292
297
 
293
- _See code: [src/commands/agent/generate/spec-v2.ts](https://github.com/salesforcecli/plugin-agent/blob/1.10.0/src/commands/agent/generate/spec-v2.ts)_
298
+ You can also specify a custom prompt template that the agent uses, and ground the prompt template to add context and
299
+ personalization to the agent's prompts.
294
300
 
295
- ## `sf agent generate test-cases`
301
+ When your agent spec is ready, you then create the agent in your org by running the "agent create" CLI command and
302
+ specifying the spec with the --spec flag.
296
303
 
297
- Interactively generate a new Set of AI Evaluation test cases.
304
+ EXAMPLES
305
+ Generate an agent spec in the default location and use flags to specify the agent properties, such as its role and
306
+ your company details; use your default org:
298
307
 
299
- ```
300
- USAGE
301
- $ sf agent generate test-cases [--flags-dir <value>]
308
+ $ sf agent generate spec-v2 --type customer --role "Field customer complaints and manage employee schedules." \
309
+ --company-name "Coral Cloud Resorts" --company-description "Provide customers with exceptional destination \
310
+ activities, unforgettable experiences, and reservation services."
302
311
 
303
- GLOBAL FLAGS
304
- --flags-dir=<value> Import flag values from a directory.
312
+ Generate an agent spec by being prompted for the required agent properties and generate a maxiumum of 5 topics;
313
+ write the generated file to the "specs/resortManagerSpec.yaml" file and use the org with alias "my-org":
305
314
 
306
- DESCRIPTION
307
- Interactively generate a new Set of AI Evaluation test cases.
315
+ $ sf agent generate spec-v2 --max-topics 5 --output-file specs/resortManagerAgent.yaml --target-org my-org
308
316
 
309
- Answer the prompts to generate an AiEvaluationTestSet that will be written to a file. You can then run "sf agent
310
- generate definition" to generate the AiEvaluationDefinition that can be used to evaluate the test set.
317
+ Specify an existing agent spec file called "specs/resortManagerAgent.yaml", and then overwrite it with a new version
318
+ that contains newly AI-generated topics based on the updated role information passed in with the --role flag:
311
319
 
312
- EXAMPLES
313
- $ sf agent generate test-cases
320
+ $ sf agent generate spec-v2 --spec specs/resortManagerAgent.yaml --output-file specs/resortManagerAgent.yaml \
321
+ --role "Field customer complaints, manage employee schedules, and ensure all resort operations are running \
322
+ smoothly" --target-org my-org
314
323
  ```
315
324
 
316
- _See code: [src/commands/agent/generate/test-cases.ts](https://github.com/salesforcecli/plugin-agent/blob/1.10.0/src/commands/agent/generate/test-cases.ts)_
325
+ _See code: [src/commands/agent/generate/spec-v2.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.1/src/commands/agent/generate/spec-v2.ts)_
317
326
 
318
- ## `sf agent generate test-definition`
327
+ ## `sf agent generate test-spec`
319
328
 
320
- Interactively generate a new AI Evaluation Test Definition.
329
+ Interactively generate a specification file for a AI evaluation test.
321
330
 
322
331
  ```
323
332
  USAGE
324
- $ sf agent generate test-definition [--flags-dir <value>]
333
+ $ sf agent generate test-spec [--flags-dir <value>]
325
334
 
326
335
  GLOBAL FLAGS
327
336
  --flags-dir=<value> Import flag values from a directory.
328
337
 
329
338
  DESCRIPTION
330
- Interactively generate a new AI Evaluation Test Definition.
339
+ Interactively generate a specification file for a AI evaluation test.
331
340
 
332
- This command will prompt you for the necessary information to create a new AiEvaluationDefinition. The definition will
333
- be saved to the `aiEvaluationDefinitions` directory in the project.
334
-
335
- You must have the `Bots` and `AiEvaluationTestSets` metadata types present in your project to use this command.
341
+ This command will prompt you for the necessary information to create a new spec file (in yaml format). You can then
342
+ create a new AI evaluation using "sf agent test create --spec <spec-file>".
336
343
 
337
344
  EXAMPLES
338
- $ sf agent generate test-definition
345
+ $ sf agent generate test-spec
339
346
  ```
340
347
 
341
- _See code: [src/commands/agent/generate/test-definition.ts](https://github.com/salesforcecli/plugin-agent/blob/1.10.0/src/commands/agent/generate/test-definition.ts)_
348
+ _See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.1/src/commands/agent/generate/test-spec.ts)_
342
349
 
343
350
  ## `sf agent preview`
344
351
 
@@ -373,7 +380,7 @@ FLAG DESCRIPTIONS
373
380
  the API name of the agent? (TBD based on agents library)
374
381
  ```
375
382
 
376
- _See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.10.0/src/commands/agent/preview.ts)_
383
+ _See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.1/src/commands/agent/preview.ts)_
377
384
 
378
385
  ## `sf agent test cancel`
379
386
 
@@ -410,7 +417,43 @@ EXAMPLES
410
417
  $ sf agent test cancel --job-id 4KBfake0000003F4AQ --target-org my-org
411
418
  ```
412
419
 
413
- _See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.10.0/src/commands/agent/test/cancel.ts)_
420
+ _See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.1/src/commands/agent/test/cancel.ts)_
421
+
422
+ ## `sf agent test create`
423
+
424
+ Summary of a command.
425
+
426
+ ```
427
+ USAGE
428
+ $ sf agent test create -s <value> -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [--preview] [-p]
429
+
430
+ FLAGS
431
+ -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
432
+ configuration variable is already set.
433
+ -p, --no-prompt Don't prompt for confirmation when overwriting an existing test.
434
+ -s, --spec=<value> (required) Description of a flag.
435
+ --api-version=<value> Override the api version used for api requests made by this command
436
+ --preview Preview the test metadata without deploying to your org.
437
+
438
+ GLOBAL FLAGS
439
+ --flags-dir=<value> Import flag values from a directory.
440
+ --json Format output as json.
441
+
442
+ DESCRIPTION
443
+ Summary of a command.
444
+
445
+ More information about a command. Don't repeat the summary.
446
+
447
+ EXAMPLES
448
+ $ sf agent test create
449
+
450
+ FLAG DESCRIPTIONS
451
+ -s, --spec=<value> Description of a flag.
452
+
453
+ More information about a flag. Don't repeat the summary.
454
+ ```
455
+
456
+ _See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.1/src/commands/agent/test/create.ts)_
414
457
 
415
458
  ## `sf agent test list`
416
459
 
@@ -439,7 +482,7 @@ EXAMPLES
439
482
  $ sf agent test list
440
483
  ```
441
484
 
442
- _See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.10.0/src/commands/agent/test/list.ts)_
485
+ _See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.1/src/commands/agent/test/list.ts)_
443
486
 
444
487
  ## `sf agent test results`
445
488
 
@@ -495,7 +538,7 @@ FLAG DESCRIPTIONS
495
538
  test results aren't written.
496
539
  ```
497
540
 
498
- _See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.10.0/src/commands/agent/test/results.ts)_
541
+ _See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.1/src/commands/agent/test/results.ts)_
499
542
 
500
543
  ## `sf agent test resume`
501
544
 
@@ -558,7 +601,7 @@ FLAG DESCRIPTIONS
558
601
  test results aren't written.
559
602
  ```
560
603
 
561
- _See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.10.0/src/commands/agent/test/resume.ts)_
604
+ _See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.1/src/commands/agent/test/resume.ts)_
562
605
 
563
606
  ## `sf agent test run`
564
607
 
@@ -621,6 +664,6 @@ FLAG DESCRIPTIONS
621
664
  test results aren't written.
622
665
  ```
623
666
 
624
- _See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.10.0/src/commands/agent/test/run.ts)_
667
+ _See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.11.1/src/commands/agent/test/run.ts)_
625
668
 
626
669
  <!-- 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 AgentCreateV2 extends SfCommand<AgentCreateResult> {
7
7
  static readonly summary: string;
@@ -13,12 +13,8 @@ export default class AgentCreateV2 extends SfCommand<AgentCreateResult> {
13
13
  spec: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
14
14
  preview: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
15
  'agent-api-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
- 'primary-language': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
17
16
  'planner-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
17
  "agent-name": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
- "user-id": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
- "enrich-logs": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
- tone: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
18
  'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
23
19
  'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
20
  };
@@ -11,7 +11,7 @@ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
11
11
  import { Lifecycle, Messages } from '@salesforce/core';
12
12
  import { MultiStageOutput } from '@oclif/multi-stage-output';
13
13
  import { colorize } from '@oclif/core/ux';
14
- import { Agent, AgentCreateLifecycleStagesV2 } from '@salesforce/agents';
14
+ import { Agent, AgentCreateLifecycleStagesV2, generateAgentApiName, } from '@salesforce/agents';
15
15
  import { makeFlags, promptForFlag, validateAgentType } from '../../flags.js';
16
16
  Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
17
17
  const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.create-v2');
@@ -27,32 +27,6 @@ const FLAGGABLE_PROMPTS = {
27
27
  validate: (d) => d.length > 0 || 'Agent Name cannot be empty',
28
28
  required: true,
29
29
  },
30
- 'user-id': {
31
- message: messages.getMessage('flags.user-id.summary'),
32
- validate: (d) => {
33
- // Allow empty string
34
- if (d.length === 0)
35
- return true;
36
- if (d.length === 15 || d.length === 18) {
37
- if (d.startsWith('005')) {
38
- return true;
39
- }
40
- }
41
- return 'Please enter a valid User ID (005 prefix)';
42
- },
43
- },
44
- 'enrich-logs': {
45
- message: messages.getMessage('flags.enrich-logs.summary'),
46
- validate: () => true,
47
- options: ['true', 'false'],
48
- default: 'false',
49
- },
50
- tone: {
51
- message: messages.getMessage('flags.tone.summary'),
52
- validate: () => true,
53
- options: ['formal', 'casual', 'neutral'],
54
- default: 'casual',
55
- },
56
30
  };
57
31
  export default class AgentCreateV2 extends SfCommand {
58
32
  static summary = messages.getMessage('summary');
@@ -73,50 +47,33 @@ export default class AgentCreateV2 extends SfCommand {
73
47
  preview: Flags.boolean({
74
48
  summary: messages.getMessage('flags.preview.summary'),
75
49
  }),
76
- // Currently hidden; Do we even want to expose this?
77
50
  'agent-api-name': Flags.string({
78
51
  summary: messages.getMessage('flags.agent-api-name.summary'),
79
- hidden: true,
80
- }),
81
- // Currently hidden because only 'en_US' is supported
82
- 'primary-language': Flags.string({
83
- summary: messages.getMessage('flags.primary-language.summary'),
84
- options: ['en_US'],
85
- default: 'en_US',
86
- hidden: true,
87
52
  }),
88
- // Seems a very uncommon usecase, but it's possible to do it in the server side API
53
+ // This would be used as more of an agent update than create.
54
+ // Could possibly move to an `agent update` command.
89
55
  'planner-id': Flags.string({
90
56
  summary: messages.getMessage('flags.planner-id.summary'),
57
+ hidden: true,
91
58
  }),
92
59
  };
93
60
  // eslint-disable-next-line complexity
94
61
  async run() {
95
62
  const { flags } = await this.parse(AgentCreateV2);
96
63
  // throw error if --json is used and not all required flags are provided
97
- if (this.jsonEnabled()) {
98
- if (!flags.preview && !flags['agent-name']) {
99
- throw messages.createError('error.missingRequiredFlags', ['agent-name']);
100
- }
64
+ if (this.jsonEnabled() && !flags['agent-name']) {
65
+ throw messages.createError('error.missingRequiredFlags', ['agent-name']);
101
66
  }
102
67
  // Read the agent spec and validate
103
68
  const inputSpec = YAML.parse(readFileSync(resolve(flags.spec), 'utf8'));
104
69
  validateSpec(inputSpec);
105
- // If we're saving the agent and we don't have flag values, prompt.
106
- let agentName = flags['agent-name'];
107
- let userId = flags['user-id'];
108
- let enrichLogs = flags['enrich-logs'];
109
- let tone = flags.tone;
110
- if (!this.jsonEnabled() && !flags.preview) {
111
- agentName ??= await promptForFlag(FLAGGABLE_PROMPTS['agent-name']);
112
- userId ??= await promptForFlag(FLAGGABLE_PROMPTS['user-id']);
113
- enrichLogs ??= await promptForFlag(FLAGGABLE_PROMPTS['enrich-logs']);
114
- tone ??= await promptForFlag(FLAGGABLE_PROMPTS.tone);
115
- }
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);
116
73
  let title;
117
74
  const stages = [MSO_STAGES.parse];
118
75
  if (flags.preview) {
119
- title = 'Previewing Agent Creation';
76
+ title = `Previewing ${agentName} Creation`;
120
77
  stages.push(MSO_STAGES.preview);
121
78
  }
122
79
  else {
@@ -124,11 +81,7 @@ export default class AgentCreateV2 extends SfCommand {
124
81
  stages.push(MSO_STAGES.create);
125
82
  stages.push(MSO_STAGES.retrieve);
126
83
  }
127
- const mso = new MultiStageOutput({
128
- jsonEnabled: this.jsonEnabled(),
129
- title,
130
- stages,
131
- });
84
+ const mso = new MultiStageOutput({ jsonEnabled: this.jsonEnabled(), title, stages });
132
85
  mso.goto(MSO_STAGES.parse);
133
86
  // @ts-expect-error not using async method in callback
134
87
  Lifecycle.getInstance().on(AgentCreateLifecycleStagesV2.Previewing, () => mso.goto(MSO_STAGES.preview));
@@ -155,38 +108,41 @@ export default class AgentCreateV2 extends SfCommand {
155
108
  }
156
109
  if (!flags.preview) {
157
110
  agentConfig.saveAgent = true;
158
- agentConfig.agentSettings = {
159
- agentName: agentName,
160
- };
161
- if (flags['agent-api-name']) {
162
- agentConfig.agentSettings.agentApiName = flags['agent-api-name'];
163
- }
111
+ agentConfig.agentSettings = { agentName, agentApiName };
164
112
  if (flags['planner-id']) {
165
113
  agentConfig.agentSettings.plannerId = flags['planner-id'];
166
114
  }
167
- if (flags['user-id']) {
168
- agentConfig.agentSettings.userId = userId;
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;
169
124
  }
170
- agentConfig.agentSettings.enrichLogs = Boolean(enrichLogs);
171
- agentConfig.agentSettings.tone = tone;
172
125
  }
173
126
  const response = await agent.createV2(agentConfig);
127
+ const result = response;
174
128
  mso.stop();
175
129
  if (response.isSuccess) {
176
130
  if (!flags.preview) {
177
- this.log(colorize('green', `Successfully created ${agentName} in ${flags['target-org'].getUsername() ?? 'the target org'}.`));
178
- this.log(`Use ${colorize('dim', `sf org open agent --name ${agentName}`)} to view the agent in the browser.`);
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.`);
179
134
  }
180
135
  else {
181
- const previewFileName = `agentPreview_${new Date().toISOString()}.json`;
136
+ const previewFileName = `${agentApiName}_Preview_${new Date().toISOString()}.json`;
182
137
  writeFileSync(previewFileName, JSON.stringify(response, null, 2));
183
- this.log(colorize('green', `Successfully created agent for preview. See ${previewFileName}`));
138
+ result.previewFilePath = resolve(previewFileName);
139
+ this.log(`Successfully created agent for preview. See ${previewFileName}\n`);
184
140
  }
185
141
  }
186
142
  else {
187
- this.log(colorize('red', `failed to create agent: ${response.errorMessage ?? ''}`));
143
+ this.log(colorize('red', `Failed to create agent: ${response.errorMessage ?? ''}`));
188
144
  }
189
- return response;
145
+ return result;
190
146
  }
191
147
  }
192
148
  // The spec must define: agentType, role, companyName, companyDescription, and topics.
@@ -201,7 +157,7 @@ const validateSpec = (spec) => {
201
157
  ];
202
158
  const missingFlags = requiredSpecValues.filter((f) => !spec[f]);
203
159
  if (missingFlags.length) {
204
- throw messages.createError('error.missingRequiredFlags', [missingFlags.join(', ')]);
160
+ throw messages.createError('error.missingRequiredSpecProperties', [missingFlags.join(', ')]);
205
161
  }
206
162
  validateAgentType(spec.agentType, true);
207
163
  };
@@ -1 +1 @@
1
- {"version":3,"file":"create-v2.js","sourceRoot":"","sources":["../../../src/commands/agent/create-v2.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,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,EAAuC,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAC9G,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,QAAQ,CAAC,kCAAkC,CAAC,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