@salesforce/plugin-agent 1.11.1 → 1.13.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 +27 -132
- package/lib/commands/agent/create.d.ts +8 -5
- package/lib/commands/agent/create.js +169 -41
- package/lib/commands/agent/create.js.map +1 -1
- package/lib/commands/agent/generate/{spec-v2.d.ts → agent-spec.d.ts} +1 -2
- package/lib/commands/agent/generate/{spec-v2.js → agent-spec.js} +19 -7
- package/lib/commands/agent/generate/agent-spec.js.map +1 -0
- package/messages/agent.create.md +37 -7
- package/npm-shrinkwrap.json +2 -2
- package/oclif.manifest.json +21 -234
- package/package.json +3 -3
- package/schemas/agent-create.json +129 -5
- package/schemas/{agent-generate-spec__v2.json → agent-generate-agent__spec.json} +4 -17
- package/lib/commands/agent/create-v2.d.ts +0 -22
- package/lib/commands/agent/create-v2.js +0 -164
- package/lib/commands/agent/create-v2.js.map +0 -1
- package/lib/commands/agent/generate/spec-v2.js.map +0 -1
- package/lib/commands/agent/generate/spec.d.ts +0 -42
- package/lib/commands/agent/generate/spec.js +0 -167
- package/lib/commands/agent/generate/spec.js.map +0 -1
- package/messages/agent.create-v2.md +0 -51
- package/messages/agent.generate.spec.md +0 -49
- package/schemas/agent-create__v2.json +0 -145
- package/schemas/agent-generate-spec.json +0 -24
- /package/messages/{agent.generate.spec-v2.md → agent.generate.agent-spec.md} +0 -0
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
|
|
66
|
-
- [`sf agent generate spec`](#sf-agent-generate-spec)
|
|
67
|
-
- [`sf agent generate spec-v2`](#sf-agent-generate-spec-v2)
|
|
65
|
+
- [`sf agent generate agent-spec`](#sf-agent-generate-agent-spec)
|
|
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,54 +74,12 @@ 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.1/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
|
|
126
|
-
|
|
81
|
+
$ sf agent create -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [--agent-name <value>]
|
|
82
|
+
[--agent-api-name <value>] [--spec <value>] [--preview]
|
|
127
83
|
|
|
128
84
|
FLAGS
|
|
129
85
|
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
@@ -133,7 +89,7 @@ FLAGS
|
|
|
133
89
|
--agent-name=<value> Name (label) of the new agent.
|
|
134
90
|
--api-version=<value> Override the api version used for api requests made by this command
|
|
135
91
|
--preview Preview the agent without saving it in your org.
|
|
136
|
-
--spec=<value>
|
|
92
|
+
--spec=<value> Path to an agent spec file.
|
|
137
93
|
|
|
138
94
|
GLOBAL FLAGS
|
|
139
95
|
--flags-dir=<value> Import flag values from a directory.
|
|
@@ -161,92 +117,30 @@ DESCRIPTION
|
|
|
161
117
|
EXAMPLES
|
|
162
118
|
Create an agent called "ResortManager" in an org with alias "my-org" using the specified agent spec file:
|
|
163
119
|
|
|
164
|
-
$ sf agent create
|
|
120
|
+
$ sf agent create --agent-name ResortManager --spec specs/resortManagerAgent.yaml --target-org my-org
|
|
165
121
|
|
|
166
122
|
Preview the creation of an agent called "ResortManager" and use your default org:
|
|
167
123
|
|
|
168
|
-
$ sf agent create
|
|
124
|
+
$ sf agent create --agent-name ResortManager --spec specs/resortManagerAgent.yaml --preview
|
|
169
125
|
```
|
|
170
126
|
|
|
171
|
-
_See code: [src/commands/agent/create
|
|
127
|
+
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.13.0/src/commands/agent/create.ts)_
|
|
172
128
|
|
|
173
|
-
## `sf agent generate spec`
|
|
174
|
-
|
|
175
|
-
Generate an agent spec, which is the list of jobs that the agent performs.
|
|
176
|
-
|
|
177
|
-
```
|
|
178
|
-
USAGE
|
|
179
|
-
$ sf agent generate spec -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-t customer|internal]
|
|
180
|
-
[--role <value>] [--company-name <value>] [--company-description <value>] [--company-website <value>] [-d <value>]
|
|
181
|
-
[-f <value>]
|
|
182
|
-
|
|
183
|
-
FLAGS
|
|
184
|
-
-d, --output-dir=<value> [default: config] Directory where the agent spec file is written; can be an
|
|
185
|
-
absolute or relative path.
|
|
186
|
-
-f, --file-name=<value> [default: agentSpec.json] Name of the generated agent spec file.
|
|
187
|
-
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
188
|
-
configuration variable is already set.
|
|
189
|
-
-t, --type=<option> Type of agent to create.
|
|
190
|
-
<options: customer|internal>
|
|
191
|
-
--api-version=<value> Override the api version used for api requests made by this command
|
|
192
|
-
--company-description=<value> Description of your company.
|
|
193
|
-
--company-name=<value> Name of your company.
|
|
194
|
-
--company-website=<value> Website URL of your company.
|
|
195
|
-
--role=<value> Role of the agent.
|
|
196
|
-
|
|
197
|
-
GLOBAL FLAGS
|
|
198
|
-
--flags-dir=<value> Import flag values from a directory.
|
|
199
|
-
--json Format output as json.
|
|
200
|
-
|
|
201
|
-
DESCRIPTION
|
|
202
|
-
Generate an agent spec, which is the list of jobs that the agent performs.
|
|
203
|
-
|
|
204
|
-
When using Salesforce CLI to create an agent in your org, the first step is to generate the local JSON-formatted agent
|
|
205
|
-
spec file with this command.
|
|
206
|
-
|
|
207
|
-
An agent spec is a list of jobs and descriptions that capture what the agent can do. Use flags such as --role and
|
|
208
|
-
--company-description to provide details about your company and the role that the agent plays in your company; you can
|
|
209
|
-
also enter the information interactively if you prefer. When you then execute this command, the large language model
|
|
210
|
-
(LLM) associated with your org uses the information to generate the list of jobs that the agent most likely performs.
|
|
211
|
-
We recommend that you provide good details for --role, --company-description, etc, so that the LLM can generate the
|
|
212
|
-
best and most relevant list of jobs and descriptions. Once generated, you can edit the spec file; for example, you can
|
|
213
|
-
remove jobs that don't apply to your agent.
|
|
214
|
-
|
|
215
|
-
When your agent spec is ready, you then create the agent in your org by specifying the agent spec file to the
|
|
216
|
-
--job-spec flag of the "agent create" CLI command.
|
|
217
|
-
|
|
218
|
-
EXAMPLES
|
|
219
|
-
Create an agent spec for your default org in the default location and use flags to specify the agent's role and your
|
|
220
|
-
company details:
|
|
221
|
-
|
|
222
|
-
$ sf agent generate spec --type customer --role "Assist users in navigating and managing bookings" \
|
|
223
|
-
--company-name "Coral Cloud" --company-description "Resort that manages guests and their reservations and \
|
|
224
|
-
experiences"
|
|
225
|
-
|
|
226
|
-
Create an agent spec by being prompted for role and company details interactively; write the generated file to the
|
|
227
|
-
"specs" directory and use the org with alias "my-org":
|
|
228
|
-
|
|
229
|
-
$ sf agent generate spec --output-dir specs --target-org my-org
|
|
230
|
-
```
|
|
231
|
-
|
|
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)_
|
|
233
|
-
|
|
234
|
-
## `sf agent generate spec-v2`
|
|
129
|
+
## `sf agent generate agent-spec`
|
|
235
130
|
|
|
236
131
|
Generate an agent spec, which is a YAML file that captures what an agent can do.
|
|
237
132
|
|
|
238
133
|
```
|
|
239
134
|
USAGE
|
|
240
|
-
$ sf agent generate spec
|
|
135
|
+
$ sf agent generate agent-spec -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [--type customer|internal]
|
|
241
136
|
[--role <value>] [--company-name <value>] [--company-description <value>] [--company-website <value>] [--max-topics
|
|
242
137
|
<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>] [
|
|
138
|
+
[--output-file <value>] [--full-interview] [--grounding-context <value> --prompt-template <value>] [-p]
|
|
244
139
|
|
|
245
140
|
FLAGS
|
|
246
141
|
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
247
142
|
configuration variable is already set.
|
|
248
|
-
-
|
|
249
|
-
<options: customer|internal>
|
|
143
|
+
-p, --no-prompt Don't prompt the user to confirm spec file overwrite.
|
|
250
144
|
--agent-user=<value> Username of a user in your org to assign to your agent; determines what your agent
|
|
251
145
|
can access and do.
|
|
252
146
|
--api-version=<value> Override the api version used for api requests made by this command
|
|
@@ -260,9 +154,8 @@ FLAGS
|
|
|
260
154
|
--grounding-context=<value> Context information and personalization that's added to your prompts when using a
|
|
261
155
|
custom prompt template.
|
|
262
156
|
--max-topics=<value> Maximum number of topics to generate in the agent spec; default is 10.
|
|
263
|
-
--
|
|
264
|
-
|
|
265
|
-
be an absolute or relative path.
|
|
157
|
+
--output-file=<value> [default: specs/agentSpec.yaml] Path for the generated YAML agent spec file; can be
|
|
158
|
+
an absolute or relative path.
|
|
266
159
|
--prompt-template=<value> API name of a customized prompt template to use instead of the default prompt
|
|
267
160
|
template.
|
|
268
161
|
--role=<value> Role of the agent.
|
|
@@ -270,6 +163,8 @@ FLAGS
|
|
|
270
163
|
--tone=<option> Conversational style of the agent, such as how it expresses your brand personality
|
|
271
164
|
in its messages through word choice, punctuation, and sentence structure.
|
|
272
165
|
<options: formal|casual|neutral>
|
|
166
|
+
--type=<option> Type of agent to create.
|
|
167
|
+
<options: customer|internal>
|
|
273
168
|
|
|
274
169
|
GLOBAL FLAGS
|
|
275
170
|
--flags-dir=<value> Import flag values from a directory.
|
|
@@ -305,24 +200,24 @@ EXAMPLES
|
|
|
305
200
|
Generate an agent spec in the default location and use flags to specify the agent properties, such as its role and
|
|
306
201
|
your company details; use your default org:
|
|
307
202
|
|
|
308
|
-
$ sf agent generate spec
|
|
203
|
+
$ sf agent generate agent-spec --type customer --role "Field customer complaints and manage employee schedules." \
|
|
309
204
|
--company-name "Coral Cloud Resorts" --company-description "Provide customers with exceptional destination \
|
|
310
205
|
activities, unforgettable experiences, and reservation services."
|
|
311
206
|
|
|
312
207
|
Generate an agent spec by being prompted for the required agent properties and generate a maxiumum of 5 topics;
|
|
313
208
|
write the generated file to the "specs/resortManagerSpec.yaml" file and use the org with alias "my-org":
|
|
314
209
|
|
|
315
|
-
$ sf agent generate spec
|
|
210
|
+
$ sf agent generate agent-spec --max-topics 5 --output-file specs/resortManagerAgent.yaml --target-org my-org
|
|
316
211
|
|
|
317
212
|
Specify an existing agent spec file called "specs/resortManagerAgent.yaml", and then overwrite it with a new version
|
|
318
213
|
that contains newly AI-generated topics based on the updated role information passed in with the --role flag:
|
|
319
214
|
|
|
320
|
-
$ sf agent generate spec
|
|
215
|
+
$ sf agent generate agent-spec --spec specs/resortManagerAgent.yaml --output-file specs/resortManagerAgent.yaml \
|
|
321
216
|
--role "Field customer complaints, manage employee schedules, and ensure all resort operations are running \
|
|
322
217
|
smoothly" --target-org my-org
|
|
323
218
|
```
|
|
324
219
|
|
|
325
|
-
_See code: [src/commands/agent/generate/spec
|
|
220
|
+
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.13.0/src/commands/agent/generate/agent-spec.ts)_
|
|
326
221
|
|
|
327
222
|
## `sf agent generate test-spec`
|
|
328
223
|
|
|
@@ -345,7 +240,7 @@ EXAMPLES
|
|
|
345
240
|
$ sf agent generate test-spec
|
|
346
241
|
```
|
|
347
242
|
|
|
348
|
-
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
243
|
+
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.13.0/src/commands/agent/generate/test-spec.ts)_
|
|
349
244
|
|
|
350
245
|
## `sf agent preview`
|
|
351
246
|
|
|
@@ -380,7 +275,7 @@ FLAG DESCRIPTIONS
|
|
|
380
275
|
the API name of the agent? (TBD based on agents library)
|
|
381
276
|
```
|
|
382
277
|
|
|
383
|
-
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
278
|
+
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.13.0/src/commands/agent/preview.ts)_
|
|
384
279
|
|
|
385
280
|
## `sf agent test cancel`
|
|
386
281
|
|
|
@@ -417,7 +312,7 @@ EXAMPLES
|
|
|
417
312
|
$ sf agent test cancel --job-id 4KBfake0000003F4AQ --target-org my-org
|
|
418
313
|
```
|
|
419
314
|
|
|
420
|
-
_See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
315
|
+
_See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.13.0/src/commands/agent/test/cancel.ts)_
|
|
421
316
|
|
|
422
317
|
## `sf agent test create`
|
|
423
318
|
|
|
@@ -453,7 +348,7 @@ FLAG DESCRIPTIONS
|
|
|
453
348
|
More information about a flag. Don't repeat the summary.
|
|
454
349
|
```
|
|
455
350
|
|
|
456
|
-
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
351
|
+
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.13.0/src/commands/agent/test/create.ts)_
|
|
457
352
|
|
|
458
353
|
## `sf agent test list`
|
|
459
354
|
|
|
@@ -482,7 +377,7 @@ EXAMPLES
|
|
|
482
377
|
$ sf agent test list
|
|
483
378
|
```
|
|
484
379
|
|
|
485
|
-
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
380
|
+
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.13.0/src/commands/agent/test/list.ts)_
|
|
486
381
|
|
|
487
382
|
## `sf agent test results`
|
|
488
383
|
|
|
@@ -538,7 +433,7 @@ FLAG DESCRIPTIONS
|
|
|
538
433
|
test results aren't written.
|
|
539
434
|
```
|
|
540
435
|
|
|
541
|
-
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
436
|
+
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.13.0/src/commands/agent/test/results.ts)_
|
|
542
437
|
|
|
543
438
|
## `sf agent test resume`
|
|
544
439
|
|
|
@@ -601,7 +496,7 @@ FLAG DESCRIPTIONS
|
|
|
601
496
|
test results aren't written.
|
|
602
497
|
```
|
|
603
498
|
|
|
604
|
-
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
499
|
+
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.13.0/src/commands/agent/test/resume.ts)_
|
|
605
500
|
|
|
606
501
|
## `sf agent test run`
|
|
607
502
|
|
|
@@ -664,6 +559,6 @@ FLAG DESCRIPTIONS
|
|
|
664
559
|
test results aren't written.
|
|
665
560
|
```
|
|
666
561
|
|
|
667
|
-
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
562
|
+
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.13.0/src/commands/agent/test/run.ts)_
|
|
668
563
|
|
|
669
564
|
<!-- commandsstop -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
+
preview: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
'planner-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
spec: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
"agent-name": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
"agent-api-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,59 @@
|
|
|
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
|
|
7
|
+
import { resolve } from 'node:path';
|
|
8
|
+
import { existsSync, 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';
|
|
13
|
+
import { input as inquirerInput } from '@inquirer/prompts';
|
|
11
14
|
import { colorize } from '@oclif/core/ux';
|
|
12
|
-
import { Agent,
|
|
15
|
+
import { Agent, AgentCreateLifecycleStagesV2, generateAgentApiName, } from '@salesforce/agents';
|
|
16
|
+
import { makeFlags, promptForFlag, validateAgentType } from '../../flags.js';
|
|
17
|
+
import { theme } from '../../inquirer-theme.js';
|
|
13
18
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
14
19
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.create');
|
|
20
|
+
const MSO_STAGES = {
|
|
21
|
+
parse: 'Parsing Agent spec',
|
|
22
|
+
preview: 'Creating Agent for preview',
|
|
23
|
+
create: 'Creating Agent in org',
|
|
24
|
+
retrieve: 'Retrieving Agent metadata',
|
|
25
|
+
};
|
|
26
|
+
const FLAGGABLE_PROMPTS = {
|
|
27
|
+
'agent-name': {
|
|
28
|
+
message: messages.getMessage('flags.agent-name.summary'),
|
|
29
|
+
validate: (d) => d.length > 0 || 'Agent Name cannot be empty',
|
|
30
|
+
required: true,
|
|
31
|
+
},
|
|
32
|
+
'agent-api-name': {
|
|
33
|
+
message: messages.getMessage('flags.agent-api-name.summary'),
|
|
34
|
+
validate: (d) => {
|
|
35
|
+
if (d.length === 0) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
if (d.length > 80) {
|
|
39
|
+
return 'API name cannot be over 80 characters.';
|
|
40
|
+
}
|
|
41
|
+
const regex = /^[A-Za-z][A-Za-z0-9_]*[A-Za-z0-9]+$/;
|
|
42
|
+
if (!regex.test(d)) {
|
|
43
|
+
return 'Invalid API name.';
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
spec: {
|
|
49
|
+
message: messages.getMessage('flags.spec.summary'),
|
|
50
|
+
validate: (d) => {
|
|
51
|
+
const specPath = resolve(d);
|
|
52
|
+
if (!existsSync(specPath)) {
|
|
53
|
+
return 'Please enter an existing agent spec (yaml) file';
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
},
|
|
57
|
+
required: true,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
15
60
|
export default class AgentCreate extends SfCommand {
|
|
16
61
|
static summary = messages.getMessage('summary');
|
|
17
62
|
static description = messages.getMessage('description');
|
|
@@ -21,54 +66,137 @@ export default class AgentCreate extends SfCommand {
|
|
|
21
66
|
static flags = {
|
|
22
67
|
'target-org': Flags.requiredOrg(),
|
|
23
68
|
'api-version': Flags.orgApiVersion(),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
summary: messages.getMessage('flags.spec.summary'),
|
|
69
|
+
...makeFlags(FLAGGABLE_PROMPTS),
|
|
70
|
+
preview: Flags.boolean({
|
|
71
|
+
summary: messages.getMessage('flags.preview.summary'),
|
|
28
72
|
}),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
summary: messages.getMessage('flags.
|
|
73
|
+
// This would be used as more of an agent update than create.
|
|
74
|
+
// Could possibly move to an `agent update` command.
|
|
75
|
+
'planner-id': Flags.string({
|
|
76
|
+
summary: messages.getMessage('flags.planner-id.summary'),
|
|
77
|
+
hidden: true,
|
|
33
78
|
}),
|
|
34
79
|
};
|
|
80
|
+
// eslint-disable-next-line complexity
|
|
35
81
|
async run() {
|
|
36
82
|
const { flags } = await this.parse(AgentCreate);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
'
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
83
|
+
// throw error if --json is used and not all required flags are provided
|
|
84
|
+
if (this.jsonEnabled()) {
|
|
85
|
+
if (!flags['agent-name']) {
|
|
86
|
+
throw messages.createError('error.missingRequiredFlags', ['agent-name']);
|
|
87
|
+
}
|
|
88
|
+
if (!flags.spec) {
|
|
89
|
+
throw messages.createError('error.missingRequiredFlags', ['spec']);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// If we don't have an agent spec yet, prompt.
|
|
93
|
+
const specPath = flags.spec ?? (await promptForFlag(FLAGGABLE_PROMPTS['spec']));
|
|
94
|
+
// Read the agent spec and validate
|
|
95
|
+
const inputSpec = YAML.parse(readFileSync(resolve(specPath), 'utf8'));
|
|
96
|
+
validateSpec(inputSpec);
|
|
97
|
+
// If we don't have an agent name yet, prompt.
|
|
98
|
+
const agentName = flags['agent-name'] ?? (await promptForFlag(FLAGGABLE_PROMPTS['agent-name']));
|
|
99
|
+
let agentApiName = flags['agent-api-name'];
|
|
100
|
+
if (!agentApiName) {
|
|
101
|
+
agentApiName = generateAgentApiName(agentName);
|
|
102
|
+
const promptedValue = await inquirerInput({
|
|
103
|
+
message: messages.getMessage('flags.agent-api-name.prompt', [agentApiName]),
|
|
104
|
+
validate: FLAGGABLE_PROMPTS['agent-api-name'].validate,
|
|
105
|
+
theme,
|
|
106
|
+
});
|
|
107
|
+
if (promptedValue?.length) {
|
|
108
|
+
agentApiName = promptedValue;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
let title;
|
|
112
|
+
const stages = [MSO_STAGES.parse];
|
|
113
|
+
if (flags.preview) {
|
|
114
|
+
title = `Previewing ${agentName} Creation`;
|
|
115
|
+
stages.push(MSO_STAGES.preview);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
title = `Creating ${agentName} Agent`;
|
|
119
|
+
stages.push(MSO_STAGES.create);
|
|
120
|
+
stages.push(MSO_STAGES.retrieve);
|
|
121
|
+
}
|
|
122
|
+
const mso = new MultiStageOutput({ jsonEnabled: this.jsonEnabled(), title, stages });
|
|
123
|
+
mso.goto(MSO_STAGES.parse);
|
|
57
124
|
// @ts-expect-error not using async method in callback
|
|
58
|
-
|
|
125
|
+
Lifecycle.getInstance().on(AgentCreateLifecycleStagesV2.Previewing, () => mso.goto(MSO_STAGES.preview));
|
|
59
126
|
// @ts-expect-error not using async method in callback
|
|
60
|
-
Lifecycle.getInstance().on(
|
|
61
|
-
Lifecycle.getInstance().on(AgentCreateLifecycleStages.RetrievingMetadata, () =>
|
|
127
|
+
Lifecycle.getInstance().on(AgentCreateLifecycleStagesV2.Creating, () => mso.goto(MSO_STAGES.create));
|
|
62
128
|
// @ts-expect-error not using async method in callback
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
const
|
|
129
|
+
Lifecycle.getInstance().on(AgentCreateLifecycleStagesV2.Retrieving, () => mso.goto(MSO_STAGES.retrieve));
|
|
130
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
131
|
+
const agent = new Agent(connection, this.project);
|
|
132
|
+
const agentConfig = {
|
|
133
|
+
agentType: inputSpec.agentType,
|
|
134
|
+
generationInfo: {
|
|
135
|
+
defaultInfo: {
|
|
136
|
+
role: inputSpec.role,
|
|
137
|
+
companyName: inputSpec.companyName,
|
|
138
|
+
companyDescription: inputSpec.companyDescription,
|
|
139
|
+
preDefinedTopics: inputSpec.topics,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
generationSettings: {},
|
|
143
|
+
};
|
|
144
|
+
if (inputSpec?.companyWebsite) {
|
|
145
|
+
agentConfig.generationInfo.defaultInfo.companyWebsite = inputSpec?.companyWebsite;
|
|
146
|
+
}
|
|
147
|
+
if (!flags.preview) {
|
|
148
|
+
agentConfig.saveAgent = true;
|
|
149
|
+
agentConfig.agentSettings = { agentName, agentApiName };
|
|
150
|
+
if (flags['planner-id']) {
|
|
151
|
+
agentConfig.agentSettings.plannerId = flags['planner-id'];
|
|
152
|
+
}
|
|
153
|
+
if (inputSpec?.agentUser) {
|
|
154
|
+
// TODO: query for the user ID from the username
|
|
155
|
+
agentConfig.agentSettings.userId = inputSpec.agentUser;
|
|
156
|
+
}
|
|
157
|
+
if (inputSpec?.enrichLogs) {
|
|
158
|
+
agentConfig.agentSettings.enrichLogs = inputSpec.enrichLogs;
|
|
159
|
+
}
|
|
160
|
+
if (inputSpec?.tone) {
|
|
161
|
+
agentConfig.agentSettings.tone = inputSpec.tone;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
const response = await agent.createV2(agentConfig);
|
|
165
|
+
const result = response;
|
|
66
166
|
mso.stop();
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
167
|
+
if (response.isSuccess) {
|
|
168
|
+
if (!flags.preview) {
|
|
169
|
+
const orgUsername = flags['target-org'].getUsername();
|
|
170
|
+
this.log(`Successfully created ${agentName} in ${orgUsername}.\n`);
|
|
171
|
+
this.log(`Use ${colorize('dim', `sf org open agent --name ${agentApiName} -o ${orgUsername}`)} to view the agent in the browser.`);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
const previewFileName = `${agentApiName}_Preview_${new Date().toISOString()}.json`;
|
|
175
|
+
writeFileSync(previewFileName, JSON.stringify(response, null, 2));
|
|
176
|
+
result.previewFilePath = resolve(previewFileName);
|
|
177
|
+
this.log(`Successfully created agent for preview. See ${previewFileName}\n`);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
this.log(colorize('red', `Failed to create agent: ${response.errorMessage ?? ''}`));
|
|
182
|
+
}
|
|
183
|
+
return result;
|
|
72
184
|
}
|
|
73
185
|
}
|
|
186
|
+
// The spec must define: agentType, role, companyName, companyDescription, and topics.
|
|
187
|
+
// Agent type must be 'customer' or 'internal'.
|
|
188
|
+
const validateSpec = (spec) => {
|
|
189
|
+
const requiredSpecValues = [
|
|
190
|
+
'agentType',
|
|
191
|
+
'role',
|
|
192
|
+
'companyName',
|
|
193
|
+
'companyDescription',
|
|
194
|
+
'topics',
|
|
195
|
+
];
|
|
196
|
+
const missingFlags = requiredSpecValues.filter((f) => !spec[f]);
|
|
197
|
+
if (missingFlags.length) {
|
|
198
|
+
throw messages.createError('error.missingRequiredSpecProperties', [missingFlags.join(', ')]);
|
|
199
|
+
}
|
|
200
|
+
validateAgentType(spec.agentType, true);
|
|
201
|
+
};
|
|
74
202
|
//# sourceMappingURL=create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/agent/create.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/agent/create.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,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,KAAK,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,KAAK,EAGL,4BAA4B,EAE5B,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAmB,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC9F,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGhD,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,UAAU,GAAG;IACjB,KAAK,EA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AC,CAAC"}
|
|
@@ -15,7 +15,6 @@ export declare const FLAGGABLE_PROMPTS: {
|
|
|
15
15
|
type: {
|
|
16
16
|
message: string;
|
|
17
17
|
validate: (d: string) => boolean | string;
|
|
18
|
-
char: "t";
|
|
19
18
|
options: string[];
|
|
20
19
|
required: true;
|
|
21
20
|
};
|
|
@@ -63,7 +62,7 @@ export declare const FLAGGABLE_PROMPTS: {
|
|
|
63
62
|
default: string;
|
|
64
63
|
};
|
|
65
64
|
};
|
|
66
|
-
export default class
|
|
65
|
+
export default class AgentCreateSpec extends SfCommand<AgentCreateSpecResult> {
|
|
67
66
|
static readonly summary: string;
|
|
68
67
|
static readonly description: string;
|
|
69
68
|
static readonly examples: string[];
|