@salesforce/plugin-agent 1.11.1 → 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 +19 -124
- package/lib/commands/agent/create.d.ts +8 -5
- package/lib/commands/agent/create.js +129 -39
- package/lib/commands/agent/create.js.map +1 -1
- package/lib/commands/agent/generate/spec.d.ts +76 -26
- package/lib/commands/agent/generate/spec.js +183 -82
- package/lib/commands/agent/generate/spec.js.map +1 -1
- package/messages/agent.create.md +33 -7
- package/messages/agent.generate.spec.md +84 -12
- package/npm-shrinkwrap.json +2 -2
- package/oclif.manifest.json +5 -217
- package/package.json +3 -3
- package/schemas/agent-create.json +129 -5
- package/schemas/agent-generate-spec.json +54 -6
- 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.d.ts +0 -92
- package/lib/commands/agent/generate/spec-v2.js +0 -268
- package/lib/commands/agent/generate/spec-v2.js.map +0 -1
- package/messages/agent.create-v2.md +0 -51
- package/messages/agent.generate.spec-v2.md +0 -121
- package/schemas/agent-create__v2.json +0 -145
- package/schemas/agent-generate-spec__v2.json +0 -85
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,53 +74,11 @@ 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
|
|
81
|
+
$ sf agent create -o <value> --spec <value> [--json] [--flags-dir <value>] [--api-version <value>] [--agent-name
|
|
126
82
|
<value>] [--preview] [--agent-api-name <value>]
|
|
127
83
|
|
|
128
84
|
FLAGS
|
|
@@ -161,83 +117,22 @@ 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.12.0/src/commands/agent/create.ts)_
|
|
172
128
|
|
|
173
129
|
## `sf agent generate spec`
|
|
174
130
|
|
|
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`
|
|
235
|
-
|
|
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 spec -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-t 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
138
|
[--output-file <value>] [--full-interview] [--grounding-context <value> --prompt-template <value>] [--no-prompt]
|
|
@@ -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 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 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
|
|
321
|
-
|
|
322
|
-
|
|
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
|
|
323
218
|
```
|
|
324
219
|
|
|
325
|
-
_See code: [src/commands/agent/generate/spec
|
|
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)_
|
|
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.12.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.12.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.12.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.12.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.12.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.12.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.12.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.12.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
|
+
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
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
64
|
-
const
|
|
65
|
-
const
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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;
|
|
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,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,EACL,KAAK,EAGL,4BAA4B,EAE5B,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAmB,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAG9F,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,EAAE,oBAAoB;IAC3B,OAAO,EAAE,4BAA4B;IACrC,MAAM,EAAE,uBAAuB;IAC/B,QAAQ,EAAE,2BAA2B;CACtC,CAAC;AAEF,MAAM,iBAAiB,GAAG;IACxB,YAAY,EAAE;QACZ,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;QACxD,QAAQ,EAAE,CAAC,CAAS,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I,IAAI,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC;gBACnF,aAAa,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;gBAClE,MAAM,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;gBAClD,IAAI,CAAC,GAAG,CAAC,+CAA+C,eAAe,IAAI,CAAC,CAAC;YAC/E,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,2BAA2B,QAAQ,CAAC,YAAY,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;QACtF,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;;AAGH,sFAAsF;AACtF,+CAA+C;AAC/C,MAAM,YAAY,GAAG,CAAC,IAA6B,EAAQ,EAAE;IAC3D,MAAM,kBAAkB,GAAkF;QACxG,WAAW;QACX,MAAM;QACN,aAAa;QACb,oBAAoB;QACpB,QAAQ;KACT,CAAC;IACF,MAAM,YAAY,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAChE,IAAI,YAAY,CAAC,MAAM,EAAE,CAAC;QACxB,MAAM,QAAQ,CAAC,WAAW,CAAC,qCAAqC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/F,CAAC;IAED,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAC1C,CAAC,CAAC"}
|
|
@@ -1,16 +1,67 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
import {
|
|
2
|
+
import { AgentJobSpecV2 } from '@salesforce/agents';
|
|
3
3
|
export type AgentCreateSpecResult = {
|
|
4
4
|
isSuccess: boolean;
|
|
5
5
|
errorMessage?: string;
|
|
6
|
-
|
|
6
|
+
specPath?: string;
|
|
7
|
+
} & AgentJobSpecV2;
|
|
8
|
+
export type AgentSpecFileContents = AgentJobSpecV2 & {
|
|
9
|
+
agentUser?: string;
|
|
10
|
+
enrichLogs?: boolean;
|
|
11
|
+
tone?: 'casual' | 'formal' | 'neutral';
|
|
12
|
+
primaryLanguage?: 'en_US';
|
|
7
13
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
export declare const FLAGGABLE_PROMPTS: {
|
|
15
|
+
type: {
|
|
16
|
+
message: string;
|
|
17
|
+
validate: (d: string) => boolean | string;
|
|
18
|
+
char: "t";
|
|
19
|
+
options: string[];
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
role: {
|
|
23
|
+
message: string;
|
|
24
|
+
validate: (d: string) => boolean | string;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
'company-name': {
|
|
28
|
+
message: string;
|
|
29
|
+
validate: (d: string) => boolean | string;
|
|
30
|
+
required: true;
|
|
31
|
+
};
|
|
32
|
+
'company-description': {
|
|
33
|
+
message: string;
|
|
34
|
+
validate: (d: string) => boolean | string;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
'company-website': {
|
|
38
|
+
message: string;
|
|
39
|
+
validate: (d: string) => boolean | string;
|
|
40
|
+
};
|
|
41
|
+
'max-topics': {
|
|
42
|
+
message: string;
|
|
43
|
+
promptMessage: string;
|
|
44
|
+
validate: () => boolean | string;
|
|
45
|
+
};
|
|
46
|
+
'agent-user': {
|
|
47
|
+
message: string;
|
|
48
|
+
promptMessage: string;
|
|
49
|
+
validate: () => boolean | string;
|
|
50
|
+
};
|
|
51
|
+
'enrich-logs': {
|
|
52
|
+
message: string;
|
|
53
|
+
promptMessage: string;
|
|
54
|
+
validate: () => boolean | string;
|
|
55
|
+
options: string[];
|
|
56
|
+
default: string;
|
|
57
|
+
};
|
|
58
|
+
tone: {
|
|
59
|
+
message: string;
|
|
60
|
+
promptMessage: string;
|
|
61
|
+
validate: () => boolean | string;
|
|
62
|
+
options: string[];
|
|
63
|
+
default: string;
|
|
64
|
+
};
|
|
14
65
|
};
|
|
15
66
|
export default class AgentCreateSpec extends SfCommand<AgentCreateSpecResult> {
|
|
16
67
|
static readonly summary: string;
|
|
@@ -19,24 +70,23 @@ export default class AgentCreateSpec extends SfCommand<AgentCreateSpecResult> {
|
|
|
19
70
|
static state: string;
|
|
20
71
|
static readonly requiresProject = true;
|
|
21
72
|
static readonly flags: {
|
|
22
|
-
|
|
23
|
-
'file
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
73
|
+
spec: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
74
|
+
'output-file': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
75
|
+
'full-interview': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
76
|
+
'prompt-template': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
77
|
+
'grounding-context': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
78
|
+
'no-prompt': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
79
|
+
type: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
80
|
+
role: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
81
|
+
"company-name": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
82
|
+
"company-description": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
83
|
+
"company-website": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
84
|
+
"max-topics": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
85
|
+
"agent-user": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
86
|
+
"enrich-logs": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
87
|
+
tone: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
88
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
89
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
31
90
|
};
|
|
32
91
|
run(): Promise<AgentCreateSpecResult>;
|
|
33
|
-
/**
|
|
34
|
-
* Get a flag value or prompt the user for a value.
|
|
35
|
-
*
|
|
36
|
-
* Resolution order:
|
|
37
|
-
* - Flag value provided by the user
|
|
38
|
-
* - Prompt the user for a value
|
|
39
|
-
*/
|
|
40
|
-
getFlagOrPrompt(valueFromFlag: string | undefined, flagDef: FlaggablePrompt): Promise<string>;
|
|
41
92
|
}
|
|
42
|
-
export {};
|