@salesforce/plugin-agent 1.7.3-dev.5 → 1.9.2
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 +126 -9
- package/lib/commands/agent/create-v2.d.ts +26 -0
- package/lib/commands/agent/create-v2.js +202 -0
- package/lib/commands/agent/create-v2.js.map +1 -0
- package/lib/commands/agent/generate/spec-v2.d.ts +29 -0
- package/lib/commands/agent/generate/spec-v2.js +117 -0
- package/lib/commands/agent/generate/spec-v2.js.map +1 -0
- package/lib/commands/agent/generate/test-definition.js +1 -1
- package/lib/commands/agent/generate/test-definition.js.map +1 -1
- package/lib/flags.d.ts +45 -2
- package/lib/flags.js +99 -0
- package/lib/flags.js.map +1 -1
- package/lib/handleTestResults.js +5 -5
- package/lib/handleTestResults.js.map +1 -1
- package/lib/testStages.js +1 -1
- package/lib/testStages.js.map +1 -1
- package/messages/agent.create-v2.md +57 -0
- package/messages/agent.generate.spec-v2.md +45 -0
- package/messages/shared.md +28 -0
- package/npm-shrinkwrap.json +7847 -14319
- package/oclif.lock +182 -702
- package/oclif.manifest.json +294 -1
- package/package.json +6 -5
- package/schemas/agent-create.json +4 -2
- package/schemas/agent-create__v2.json +21 -0
- package/schemas/agent-generate-spec.json +4 -2
- package/schemas/agent-generate-spec__v2.json +85 -0
- package/schemas/agent-preview.json +1 -1
- package/schemas/agent-test-cancel.json +5 -2
- package/schemas/agent-test-results.json +4 -8
- package/schemas/agent-test-resume.json +5 -2
- package/schemas/agent-test-run.json +5 -2
package/README.md
CHANGED
|
@@ -62,7 +62,9 @@ sf plugins
|
|
|
62
62
|
<!-- commands -->
|
|
63
63
|
|
|
64
64
|
- [`sf agent create`](#sf-agent-create)
|
|
65
|
+
- [`sf agent create-v2`](#sf-agent-create-v2)
|
|
65
66
|
- [`sf agent generate spec`](#sf-agent-generate-spec)
|
|
67
|
+
- [`sf agent generate spec-v2`](#sf-agent-generate-spec-v2)
|
|
66
68
|
- [`sf agent generate test-cases`](#sf-agent-generate-test-cases)
|
|
67
69
|
- [`sf agent generate test-definition`](#sf-agent-generate-test-definition)
|
|
68
70
|
- [`sf agent preview`](#sf-agent-preview)
|
|
@@ -111,7 +113,58 @@ EXAMPLES
|
|
|
111
113
|
$ sf agent create --name CustomerSupportAgent --spec ./config/agentSpec.json --target-org my-org
|
|
112
114
|
```
|
|
113
115
|
|
|
114
|
-
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
116
|
+
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.9.2/src/commands/agent/create.ts)_
|
|
117
|
+
|
|
118
|
+
## `sf agent create-v2`
|
|
119
|
+
|
|
120
|
+
Create an agent in your org from a local agent spec file.
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
USAGE
|
|
124
|
+
$ sf agent create-v2 -o <value> --spec <value> [--json] [--flags-dir <value>] [--api-version <value>] [--agent-name
|
|
125
|
+
<value>] [--user-id <value>] [--enrich-logs true|false] [--tone formal|casual|neutral] [--preview] [--planner-id
|
|
126
|
+
<value>]
|
|
127
|
+
|
|
128
|
+
FLAGS
|
|
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-name=<value> Name for the new agent.
|
|
132
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
133
|
+
--enrich-logs=<option> Adds agent conversation data to event logs.
|
|
134
|
+
<options: true|false>
|
|
135
|
+
--planner-id=<value> The GenAiPlanner ID to associate with the agent.
|
|
136
|
+
--preview Preview the agent without saving in your org.
|
|
137
|
+
--spec=<value> (required) Path to an agent spec file.
|
|
138
|
+
--tone=<option> Conversational style of agent responses.
|
|
139
|
+
<options: formal|casual|neutral>
|
|
140
|
+
--user-id=<value> Custom user ID for the agent.
|
|
141
|
+
|
|
142
|
+
GLOBAL FLAGS
|
|
143
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
144
|
+
--json Format output as json.
|
|
145
|
+
|
|
146
|
+
DESCRIPTION
|
|
147
|
+
Create an agent in your org from a local agent spec file.
|
|
148
|
+
|
|
149
|
+
To generate an agent spec file, run the "agent generate spec" CLI command, which outputs a YAML file with the list of
|
|
150
|
+
jobs and descriptions that the new agent can perform. Then specify this generated spec file to the --spec flag of this
|
|
151
|
+
command, along with the name of the new agent.
|
|
152
|
+
|
|
153
|
+
When this command finishes, your org contains the new agent, which you can then edit in the Agent Builder UI. The new
|
|
154
|
+
agent already has a list of topics and actions that were automatically created from the list of jobs in the provided
|
|
155
|
+
agent spec file. This command also retrieves all the metadata files associated with the new agent to your local DX
|
|
156
|
+
project.
|
|
157
|
+
|
|
158
|
+
To open the new agent in your org's Agent Builder UI, run this command: "sf org open agent --name
|
|
159
|
+
<api-name-of-your-agent>".
|
|
160
|
+
|
|
161
|
+
EXAMPLES
|
|
162
|
+
Create an agent called "CustomerSupportAgent" in an org with alias "my-org" using the specified agent spec file:
|
|
163
|
+
|
|
164
|
+
$ sf agent create-v2 --name CustomerSupportAgent --spec ./config/agentSpec.json --target-org my-org
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
_See code: [src/commands/agent/create-v2.ts](https://github.com/salesforcecli/plugin-agent/blob/1.9.2/src/commands/agent/create-v2.ts)_
|
|
115
168
|
|
|
116
169
|
## `sf agent generate spec`
|
|
117
170
|
|
|
@@ -172,7 +225,71 @@ EXAMPLES
|
|
|
172
225
|
$ sf agent generate spec --output-dir specs --target-org my-org
|
|
173
226
|
```
|
|
174
227
|
|
|
175
|
-
_See code: [src/commands/agent/generate/spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
228
|
+
_See code: [src/commands/agent/generate/spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.9.2/src/commands/agent/generate/spec.ts)_
|
|
229
|
+
|
|
230
|
+
## `sf agent generate spec-v2`
|
|
231
|
+
|
|
232
|
+
Generate an agent spec, which is the list of jobs that the agent performs.
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
USAGE
|
|
236
|
+
$ sf agent generate spec-v2 -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-t customer|internal]
|
|
237
|
+
[--role <value>] [--company-name <value>] [--company-description <value>] [--company-website <value>] [--spec
|
|
238
|
+
<value>] [--output-file <value>] [--max-topics <value>] [--grounding-context <value> --prompt-template <value>]
|
|
239
|
+
|
|
240
|
+
FLAGS
|
|
241
|
+
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
242
|
+
configuration variable is already set.
|
|
243
|
+
-t, --type=<option> Type of agent to create.
|
|
244
|
+
<options: customer|internal>
|
|
245
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
246
|
+
--company-description=<value> Description of your company.
|
|
247
|
+
--company-name=<value> Name of your company.
|
|
248
|
+
--company-website=<value> Website URL of your company.
|
|
249
|
+
--grounding-context=<value> Context information to be used with the customized prompt template.
|
|
250
|
+
--max-topics=<value> Maximum number of agent job topics to generate in the spec; default is 10.
|
|
251
|
+
--output-file=<value> [default: config/agentSpec.yaml] Path for the generated agent spec file (yaml); can
|
|
252
|
+
be an absolute or relative path.
|
|
253
|
+
--prompt-template=<value> Developer name of a customized prompt template to use instead of the default.
|
|
254
|
+
--role=<value> Role of the agent.
|
|
255
|
+
--spec=<value> Spec file (yaml) to use as input to the command.
|
|
256
|
+
|
|
257
|
+
GLOBAL FLAGS
|
|
258
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
259
|
+
--json Format output as json.
|
|
260
|
+
|
|
261
|
+
DESCRIPTION
|
|
262
|
+
Generate an agent spec, which is the list of jobs that the agent performs.
|
|
263
|
+
|
|
264
|
+
When using Salesforce CLI to create an agent in your org, you can choose to generate a YAML-formatted agent spec file
|
|
265
|
+
with this command as a first step.
|
|
266
|
+
|
|
267
|
+
An agent spec is a list of jobs and descriptions that capture what the agent can do. Use flags such as --role and
|
|
268
|
+
--company-description to provide details about your company and the role that the agent plays in your company; you can
|
|
269
|
+
also enter the information interactively if you prefer. When you then execute this command, the large language model
|
|
270
|
+
(LLM) associated with your org uses the information to generate the list of jobs that the agent most likely performs.
|
|
271
|
+
We recommend that you provide good details for --role, --company-description, etc, so that the LLM can generate the
|
|
272
|
+
best and most relevant list of jobs and descriptions. Once generated, you can edit the spec file; for example, you can
|
|
273
|
+
remove jobs that don't apply to your agent.
|
|
274
|
+
|
|
275
|
+
When your agent spec is ready, you then create the agent in your org by specifying the agent spec file to the
|
|
276
|
+
--job-spec flag of the "agent create" CLI command.
|
|
277
|
+
|
|
278
|
+
EXAMPLES
|
|
279
|
+
Create an agent spec for your default org in the default location and use flags to specify the agent's role and your
|
|
280
|
+
company details:
|
|
281
|
+
|
|
282
|
+
$ sf agent generate spec-v2 --type customer --role "Assist users in navigating and managing bookings" \
|
|
283
|
+
--company-name "Coral Cloud" --company-description "Resort that manages guests and their reservations and \
|
|
284
|
+
experiences"
|
|
285
|
+
|
|
286
|
+
Create an agent spec by being prompted for role and company details interactively; write the generated file to the
|
|
287
|
+
"specs" directory and use the org with alias "my-org":
|
|
288
|
+
|
|
289
|
+
$ sf agent generate spec-v2 --output-dir specs --target-org my-org
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
_See code: [src/commands/agent/generate/spec-v2.ts](https://github.com/salesforcecli/plugin-agent/blob/1.9.2/src/commands/agent/generate/spec-v2.ts)_
|
|
176
293
|
|
|
177
294
|
## `sf agent generate test-cases`
|
|
178
295
|
|
|
@@ -195,7 +312,7 @@ EXAMPLES
|
|
|
195
312
|
$ sf agent generate test-cases
|
|
196
313
|
```
|
|
197
314
|
|
|
198
|
-
_See code: [src/commands/agent/generate/test-cases.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
315
|
+
_See code: [src/commands/agent/generate/test-cases.ts](https://github.com/salesforcecli/plugin-agent/blob/1.9.2/src/commands/agent/generate/test-cases.ts)_
|
|
199
316
|
|
|
200
317
|
## `sf agent generate test-definition`
|
|
201
318
|
|
|
@@ -220,7 +337,7 @@ EXAMPLES
|
|
|
220
337
|
$ sf agent generate test-definition
|
|
221
338
|
```
|
|
222
339
|
|
|
223
|
-
_See code: [src/commands/agent/generate/test-definition.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
340
|
+
_See code: [src/commands/agent/generate/test-definition.ts](https://github.com/salesforcecli/plugin-agent/blob/1.9.2/src/commands/agent/generate/test-definition.ts)_
|
|
224
341
|
|
|
225
342
|
## `sf agent preview`
|
|
226
343
|
|
|
@@ -255,7 +372,7 @@ FLAG DESCRIPTIONS
|
|
|
255
372
|
the API name of the agent? (TBD based on agents library)
|
|
256
373
|
```
|
|
257
374
|
|
|
258
|
-
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
375
|
+
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.9.2/src/commands/agent/preview.ts)_
|
|
259
376
|
|
|
260
377
|
## `sf agent test cancel`
|
|
261
378
|
|
|
@@ -292,7 +409,7 @@ EXAMPLES
|
|
|
292
409
|
$ sf agent test cancel --job-id 4KBfake0000003F4AQ --target-org my-org
|
|
293
410
|
```
|
|
294
411
|
|
|
295
|
-
_See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
412
|
+
_See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.9.2/src/commands/agent/test/cancel.ts)_
|
|
296
413
|
|
|
297
414
|
## `sf agent test results`
|
|
298
415
|
|
|
@@ -348,7 +465,7 @@ FLAG DESCRIPTIONS
|
|
|
348
465
|
test results aren't written.
|
|
349
466
|
```
|
|
350
467
|
|
|
351
|
-
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
468
|
+
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.9.2/src/commands/agent/test/results.ts)_
|
|
352
469
|
|
|
353
470
|
## `sf agent test resume`
|
|
354
471
|
|
|
@@ -411,7 +528,7 @@ FLAG DESCRIPTIONS
|
|
|
411
528
|
test results aren't written.
|
|
412
529
|
```
|
|
413
530
|
|
|
414
|
-
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
531
|
+
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.9.2/src/commands/agent/test/resume.ts)_
|
|
415
532
|
|
|
416
533
|
## `sf agent test run`
|
|
417
534
|
|
|
@@ -474,6 +591,6 @@ FLAG DESCRIPTIONS
|
|
|
474
591
|
test results aren't written.
|
|
475
592
|
```
|
|
476
593
|
|
|
477
|
-
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
594
|
+
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.9.2/src/commands/agent/test/run.ts)_
|
|
478
595
|
|
|
479
596
|
<!-- commandsstop -->
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export type AgentCreateResult = {
|
|
3
|
+
isSuccess: boolean;
|
|
4
|
+
errorMessage?: string;
|
|
5
|
+
};
|
|
6
|
+
export default class AgentCreateV2 extends SfCommand<AgentCreateResult> {
|
|
7
|
+
static readonly summary: string;
|
|
8
|
+
static readonly description: string;
|
|
9
|
+
static readonly examples: string[];
|
|
10
|
+
static readonly requiresProject = true;
|
|
11
|
+
static state: string;
|
|
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
|
+
'primary-language': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
'planner-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
"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
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
};
|
|
25
|
+
run(): Promise<AgentCreateResult>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024, salesforce.com, inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import { resolve } from 'node:path';
|
|
8
|
+
import { readFileSync, writeFileSync } from 'node:fs';
|
|
9
|
+
import YAML from 'yaml';
|
|
10
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
11
|
+
import { Lifecycle, Messages } from '@salesforce/core';
|
|
12
|
+
import { MultiStageOutput } from '@oclif/multi-stage-output';
|
|
13
|
+
import { colorize } from '@oclif/core/ux';
|
|
14
|
+
import { Agent, AgentCreateLifecycleStagesV2 } from '@salesforce/agents';
|
|
15
|
+
import { makeFlags, promptForFlag, validateAgentType } from '../../flags.js';
|
|
16
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
17
|
+
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.create-v2');
|
|
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
|
+
'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
|
+
};
|
|
57
|
+
export default class AgentCreateV2 extends SfCommand {
|
|
58
|
+
static summary = messages.getMessage('summary');
|
|
59
|
+
static description = messages.getMessage('description');
|
|
60
|
+
static examples = messages.getMessages('examples');
|
|
61
|
+
static requiresProject = true;
|
|
62
|
+
static state = 'beta';
|
|
63
|
+
static flags = {
|
|
64
|
+
'target-org': Flags.requiredOrg(),
|
|
65
|
+
'api-version': Flags.orgApiVersion(),
|
|
66
|
+
...makeFlags(FLAGGABLE_PROMPTS),
|
|
67
|
+
spec: Flags.file({
|
|
68
|
+
// char: 'f',
|
|
69
|
+
summary: messages.getMessage('flags.spec.summary'),
|
|
70
|
+
exists: true,
|
|
71
|
+
required: true,
|
|
72
|
+
}),
|
|
73
|
+
preview: Flags.boolean({
|
|
74
|
+
summary: messages.getMessage('flags.preview.summary'),
|
|
75
|
+
}),
|
|
76
|
+
// Currently hidden; Do we even want to expose this?
|
|
77
|
+
'agent-api-name': Flags.string({
|
|
78
|
+
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
|
+
}),
|
|
88
|
+
// Seems a very uncommon usecase, but it's possible to do it in the server side API
|
|
89
|
+
'planner-id': Flags.string({
|
|
90
|
+
summary: messages.getMessage('flags.planner-id.summary'),
|
|
91
|
+
}),
|
|
92
|
+
};
|
|
93
|
+
// eslint-disable-next-line complexity
|
|
94
|
+
async run() {
|
|
95
|
+
const { flags } = await this.parse(AgentCreateV2);
|
|
96
|
+
// 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
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// Read the agent spec and validate
|
|
103
|
+
const inputSpec = YAML.parse(readFileSync(resolve(flags.spec), 'utf8'));
|
|
104
|
+
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
|
+
}
|
|
116
|
+
let title;
|
|
117
|
+
const stages = [MSO_STAGES.parse];
|
|
118
|
+
if (flags.preview) {
|
|
119
|
+
title = 'Previewing Agent Creation';
|
|
120
|
+
stages.push(MSO_STAGES.preview);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
title = `Creating ${agentName} Agent`;
|
|
124
|
+
stages.push(MSO_STAGES.create);
|
|
125
|
+
stages.push(MSO_STAGES.retrieve);
|
|
126
|
+
}
|
|
127
|
+
const mso = new MultiStageOutput({
|
|
128
|
+
jsonEnabled: this.jsonEnabled(),
|
|
129
|
+
title,
|
|
130
|
+
stages,
|
|
131
|
+
});
|
|
132
|
+
mso.goto(MSO_STAGES.parse);
|
|
133
|
+
// @ts-expect-error not using async method in callback
|
|
134
|
+
Lifecycle.getInstance().on(AgentCreateLifecycleStagesV2.Previewing, () => mso.goto(MSO_STAGES.preview));
|
|
135
|
+
// @ts-expect-error not using async method in callback
|
|
136
|
+
Lifecycle.getInstance().on(AgentCreateLifecycleStagesV2.Creating, () => mso.goto(MSO_STAGES.create));
|
|
137
|
+
// @ts-expect-error not using async method in callback
|
|
138
|
+
Lifecycle.getInstance().on(AgentCreateLifecycleStagesV2.Retrieving, () => mso.goto(MSO_STAGES.retrieve));
|
|
139
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
140
|
+
const agent = new Agent(connection, this.project);
|
|
141
|
+
const agentConfig = {
|
|
142
|
+
agentType: inputSpec.agentType,
|
|
143
|
+
generationInfo: {
|
|
144
|
+
defaultInfo: {
|
|
145
|
+
role: inputSpec.role,
|
|
146
|
+
companyName: inputSpec.companyName,
|
|
147
|
+
companyDescription: inputSpec.companyDescription,
|
|
148
|
+
preDefinedTopics: inputSpec.topics,
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
generationSettings: {},
|
|
152
|
+
};
|
|
153
|
+
if (inputSpec?.companyWebsite) {
|
|
154
|
+
agentConfig.generationInfo.defaultInfo.companyWebsite = inputSpec?.companyWebsite;
|
|
155
|
+
}
|
|
156
|
+
if (!flags.preview) {
|
|
157
|
+
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
|
+
}
|
|
164
|
+
if (flags['planner-id']) {
|
|
165
|
+
agentConfig.agentSettings.plannerId = flags['planner-id'];
|
|
166
|
+
}
|
|
167
|
+
if (flags['user-id']) {
|
|
168
|
+
agentConfig.agentSettings.userId = userId;
|
|
169
|
+
}
|
|
170
|
+
agentConfig.agentSettings.enrichLogs = Boolean(enrichLogs);
|
|
171
|
+
agentConfig.agentSettings.tone = tone;
|
|
172
|
+
}
|
|
173
|
+
const response = await agent.createV2(agentConfig);
|
|
174
|
+
mso.stop();
|
|
175
|
+
if (response.isSuccess) {
|
|
176
|
+
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.`);
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
const previewFileName = `agentPreview_${new Date().toISOString()}.json`;
|
|
182
|
+
writeFileSync(previewFileName, JSON.stringify(response, null, 2));
|
|
183
|
+
this.log(colorize('green', `Successfully created agent for preview. See ${previewFileName}`));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
this.log(colorize('red', `failed to create agent: ${response.errorMessage ?? ''}`));
|
|
188
|
+
}
|
|
189
|
+
return response;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
// The spec must define: agentType, role, companyName, companyDescription, and topics.
|
|
193
|
+
// Agent type must be 'customer' or 'internal'.
|
|
194
|
+
const validateSpec = (spec) => {
|
|
195
|
+
const requiredSpecValues = ['agentType', 'role', 'companyName', 'companyDescription', 'topics'];
|
|
196
|
+
const missingFlags = requiredSpecValues.filter(f => !spec[f]);
|
|
197
|
+
if (missingFlags.length) {
|
|
198
|
+
throw messages.createError('error.missingRequiredFlags', [missingFlags.join(', ')]);
|
|
199
|
+
}
|
|
200
|
+
validateAgentType(spec.agentType, true);
|
|
201
|
+
};
|
|
202
|
+
//# sourceMappingURL=create-v2.js.map
|
|
@@ -0,0 +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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AAM,YAAY,GAAG,CAAC,IAA6B,EAAQ,EAAE;IAC3D,MAAM,kBAAkB,GACtB,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,oBAAoB,EAAE,QAAQ,CAAC,CAAC;IACvE,MAAM,YAAY,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D,IAAI,YAAY,CAAC,MAAM,EAAE,CAAC;QACxB,MAAM,QAAQ,CAAC,WAAW,CAAC,4BAA4B,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtF,CAAC;IAED,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAC1C,CAAC,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { AgentJobSpecV2 } from '@salesforce/agents';
|
|
3
|
+
export type AgentCreateSpecResult = {
|
|
4
|
+
isSuccess: boolean;
|
|
5
|
+
errorMessage?: string;
|
|
6
|
+
specPath?: string;
|
|
7
|
+
} & AgentJobSpecV2;
|
|
8
|
+
export default class AgentCreateSpecV2 extends SfCommand<AgentCreateSpecResult> {
|
|
9
|
+
static readonly summary: string;
|
|
10
|
+
static readonly description: string;
|
|
11
|
+
static readonly examples: string[];
|
|
12
|
+
static state: string;
|
|
13
|
+
static readonly requiresProject = true;
|
|
14
|
+
static readonly flags: {
|
|
15
|
+
spec: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'output-file': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
'max-topics': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
'prompt-template': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
'grounding-context': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
type: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
role: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
"company-name": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
"company-description": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
"company-website": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
25
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
27
|
+
};
|
|
28
|
+
run(): Promise<AgentCreateSpecResult>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024, salesforce.com, inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import { join, resolve, dirname } from 'node:path';
|
|
8
|
+
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
9
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
10
|
+
import { Messages } from '@salesforce/core';
|
|
11
|
+
import YAML from 'yaml';
|
|
12
|
+
import { Agent } from '@salesforce/agents';
|
|
13
|
+
import { FLAGGABLE_SPEC_PROMPTS, makeFlags, promptForFlag, validateAgentType, validateMaxTopics } from '../../../flags.js';
|
|
14
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
15
|
+
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.generate.spec-v2');
|
|
16
|
+
export default class AgentCreateSpecV2 extends SfCommand {
|
|
17
|
+
static summary = messages.getMessage('summary');
|
|
18
|
+
static description = messages.getMessage('description');
|
|
19
|
+
static examples = messages.getMessages('examples');
|
|
20
|
+
static state = 'beta';
|
|
21
|
+
static requiresProject = true;
|
|
22
|
+
static flags = {
|
|
23
|
+
'target-org': Flags.requiredOrg(),
|
|
24
|
+
'api-version': Flags.orgApiVersion(),
|
|
25
|
+
...makeFlags(FLAGGABLE_SPEC_PROMPTS),
|
|
26
|
+
spec: Flags.file({
|
|
27
|
+
summary: messages.getMessage('flags.spec.summary'),
|
|
28
|
+
exists: true,
|
|
29
|
+
}),
|
|
30
|
+
'output-file': Flags.file({
|
|
31
|
+
summary: messages.getMessage('flags.output-file.summary'),
|
|
32
|
+
default: join('config', 'agentSpec.yaml'),
|
|
33
|
+
}),
|
|
34
|
+
'max-topics': Flags.integer({
|
|
35
|
+
summary: messages.getMessage('flags.max-topics.summary'),
|
|
36
|
+
min: 1,
|
|
37
|
+
}),
|
|
38
|
+
'prompt-template': Flags.string({
|
|
39
|
+
summary: messages.getMessage('flags.prompt-template.summary'),
|
|
40
|
+
}),
|
|
41
|
+
'grounding-context': Flags.string({
|
|
42
|
+
summary: messages.getMessage('flags.grounding-context.summary'),
|
|
43
|
+
dependsOn: ['prompt-template'],
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
46
|
+
// eslint-disable-next-line complexity
|
|
47
|
+
async run() {
|
|
48
|
+
const { flags } = await this.parse(AgentCreateSpecV2);
|
|
49
|
+
// throw error if --json is used and not all required flags are provided
|
|
50
|
+
if (this.jsonEnabled()) {
|
|
51
|
+
const missingFlags = Object.entries(FLAGGABLE_SPEC_PROMPTS)
|
|
52
|
+
.filter(([key, prompt]) => 'required' in prompt && prompt.required && !(key in flags))
|
|
53
|
+
.map(([key]) => key);
|
|
54
|
+
if (missingFlags.length) {
|
|
55
|
+
throw messages.createError('error.missingRequiredFlags', [missingFlags.join(', ')]);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
this.log();
|
|
59
|
+
this.styledHeader('Agent Details');
|
|
60
|
+
// If spec is provided, read it first
|
|
61
|
+
let inputSpec = {};
|
|
62
|
+
if (flags.spec) {
|
|
63
|
+
inputSpec = YAML.parse(readFileSync(resolve(flags.spec), 'utf8'));
|
|
64
|
+
}
|
|
65
|
+
// Flags override inputSpec values. Prompt if neither is set.
|
|
66
|
+
const type = flags.type ?? validateAgentType(inputSpec?.agentType) ?? (await promptForFlag(FLAGGABLE_SPEC_PROMPTS.type));
|
|
67
|
+
const role = flags.role ?? inputSpec?.role ?? (await promptForFlag(FLAGGABLE_SPEC_PROMPTS.role));
|
|
68
|
+
const companyName = flags['company-name'] ?? inputSpec?.companyName ?? (await promptForFlag(FLAGGABLE_SPEC_PROMPTS['company-name']));
|
|
69
|
+
const companyDescription = flags['company-description'] ??
|
|
70
|
+
inputSpec?.companyDescription ??
|
|
71
|
+
(await promptForFlag(FLAGGABLE_SPEC_PROMPTS['company-description']));
|
|
72
|
+
const companyWebsite = flags['company-website'] ??
|
|
73
|
+
inputSpec?.companyWebsite ??
|
|
74
|
+
(await promptForFlag(FLAGGABLE_SPEC_PROMPTS['company-website']));
|
|
75
|
+
this.log();
|
|
76
|
+
this.spinner.start('Creating agent spec');
|
|
77
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
78
|
+
const agent = new Agent(connection, this.project);
|
|
79
|
+
const specConfig = {
|
|
80
|
+
agentType: type,
|
|
81
|
+
role,
|
|
82
|
+
companyName,
|
|
83
|
+
companyDescription,
|
|
84
|
+
};
|
|
85
|
+
if (companyWebsite) {
|
|
86
|
+
specConfig.companyWebsite = companyWebsite;
|
|
87
|
+
}
|
|
88
|
+
const promptTemplateName = flags['prompt-template'] ?? inputSpec?.promptTemplateName;
|
|
89
|
+
if (promptTemplateName) {
|
|
90
|
+
specConfig.promptTemplateName = promptTemplateName;
|
|
91
|
+
const groundingContext = flags['grounding-context'] ?? inputSpec?.groundingContext;
|
|
92
|
+
if (groundingContext) {
|
|
93
|
+
specConfig.groundingContext = groundingContext;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
const maxNumOfTopics = flags['max-topics'] ?? validateMaxTopics(inputSpec?.maxNumOfTopics);
|
|
97
|
+
if (maxNumOfTopics) {
|
|
98
|
+
specConfig.maxNumOfTopics = maxNumOfTopics;
|
|
99
|
+
}
|
|
100
|
+
// Should we log the specConfig being used? It's returned in the JSON and the generated spec.
|
|
101
|
+
// this.log(`${ansis.green(figures.tick)} ${ansis.bold(message)} ${ansis.cyan(valueFromFlag)}`);
|
|
102
|
+
const agentSpec = await agent.createSpecV2(specConfig);
|
|
103
|
+
const outputFilePath = writeSpecFile(flags['output-file'], agentSpec);
|
|
104
|
+
this.spinner.stop();
|
|
105
|
+
this.log(`\nSaved agent spec: ${outputFilePath}`);
|
|
106
|
+
return { ...{ isSuccess: true, specPath: outputFilePath }, ...agentSpec };
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const writeSpecFile = (outputFile, agentSpec) => {
|
|
110
|
+
// create the directory if not already created
|
|
111
|
+
const outputFilePath = resolve(outputFile);
|
|
112
|
+
mkdirSync(dirname(outputFilePath), { recursive: true });
|
|
113
|
+
// Write a yaml file with the returned job specs
|
|
114
|
+
writeFileSync(outputFilePath, YAML.stringify(agentSpec));
|
|
115
|
+
return outputFilePath;
|
|
116
|
+
};
|
|
117
|
+
//# sourceMappingURL=spec-v2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-v2.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/spec-v2.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,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Q,EAAE,cAAc,EAAE,EAAE,GAAG,SAAS,EAAE,CAAC;IAC5E,CAAC;;AAGH,MAAM,aAAa,GAAG,CAAC,UAAkB,EAAE,SAAyB,EAAU,EAAE;IAC9E,8CAA8C;IAC9C,MAAM,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3C,SAAS,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAExD,gDAAgD;IAChD,aAAa,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IAEzD,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC"}
|
|
@@ -24,7 +24,7 @@ export default class AgentGenerateTestDefinition extends SfCommand {
|
|
|
24
24
|
const testSets = (await readDir(testSetDir)).map((testSet) => testSet.replace('.aiEvaluationTestSet-meta.xml', ''));
|
|
25
25
|
if (testSets.length === 0) {
|
|
26
26
|
throw new SfError(`No test sets found in ${testSetDir}`, 'NoTestSetsFoundError', [
|
|
27
|
-
'Run the "sf agent generate
|
|
27
|
+
'Run the "sf agent generate test-cases" command to create a test set',
|
|
28
28
|
]);
|
|
29
29
|
}
|
|
30
30
|
const botsDir = join('force-app', 'main', 'default', 'bots');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-definition.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/test-definition.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO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