@salesforce/plugin-agent 1.15.0 → 1.15.1-dev.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 +30 -26
- package/lib/commands/agent/create.js +2 -2
- package/lib/commands/agent/create.js.map +1 -1
- package/lib/commands/agent/generate/test-spec.d.ts +4 -0
- package/lib/commands/agent/generate/test-spec.js +131 -78
- package/lib/commands/agent/generate/test-spec.js.map +1 -1
- package/lib/commands/agent/test/create.d.ts +2 -1
- package/lib/commands/agent/test/create.js +75 -18
- package/lib/commands/agent/test/create.js.map +1 -1
- package/lib/flags.d.ts +1 -0
- package/lib/flags.js +31 -0
- package/lib/flags.js.map +1 -1
- package/lib/handleTestResults.js +2 -21
- package/lib/handleTestResults.js.map +1 -1
- package/lib/yes-no-cancel.d.ts +10 -0
- package/lib/yes-no-cancel.js +60 -0
- package/lib/yes-no-cancel.js.map +1 -0
- package/messages/agent.generate.test-spec.md +8 -0
- package/messages/agent.test.create.md +17 -7
- package/npm-shrinkwrap.json +522 -30
- package/oclif.lock +115 -11
- package/oclif.manifest.json +28 -7
- package/package.json +7 -5
- package/lib/read-dir.d.ts +0 -1
- package/lib/read-dir.js +0 -16
- package/lib/read-dir.js.map +0 -1
package/README.md
CHANGED
|
@@ -132,7 +132,7 @@ EXAMPLES
|
|
|
132
132
|
$ sf agent create --agent-name "Resort Manager" --spec specs/resortManagerAgent.yaml --preview
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
-
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.0/src/commands/agent/create.ts)_
|
|
135
|
+
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/create.ts)_
|
|
136
136
|
|
|
137
137
|
## `sf agent generate agent-spec`
|
|
138
138
|
|
|
@@ -236,7 +236,7 @@ EXAMPLES
|
|
|
236
236
|
$ sf agent generate agent-spec --tone formal --agent-user resortmanager@myorg.com
|
|
237
237
|
```
|
|
238
238
|
|
|
239
|
-
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.0/src/commands/agent/generate/agent-spec.ts)_
|
|
239
|
+
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/generate/agent-spec.ts)_
|
|
240
240
|
|
|
241
241
|
## `sf agent generate template`
|
|
242
242
|
|
|
@@ -270,7 +270,7 @@ EXAMPLES
|
|
|
270
270
|
force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1
|
|
271
271
|
```
|
|
272
272
|
|
|
273
|
-
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.0/src/commands/agent/generate/template.ts)_
|
|
273
|
+
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/generate/template.ts)_
|
|
274
274
|
|
|
275
275
|
## `sf agent generate test-spec`
|
|
276
276
|
|
|
@@ -278,7 +278,11 @@ Interactively generate a specification file for a AI evaluation test.
|
|
|
278
278
|
|
|
279
279
|
```
|
|
280
280
|
USAGE
|
|
281
|
-
$ sf agent generate test-spec [--flags-dir <value>]
|
|
281
|
+
$ sf agent generate test-spec [--flags-dir <value>] [-d <value>] [-f <value>]
|
|
282
|
+
|
|
283
|
+
FLAGS
|
|
284
|
+
-d, --output-dir=<value> [default: specs] The directory to save the generated spec file.
|
|
285
|
+
-f, --output-file=<value> The name of the generated spec file.
|
|
282
286
|
|
|
283
287
|
GLOBAL FLAGS
|
|
284
288
|
--flags-dir=<value> Import flag values from a directory.
|
|
@@ -293,7 +297,7 @@ EXAMPLES
|
|
|
293
297
|
$ sf agent generate test-spec
|
|
294
298
|
```
|
|
295
299
|
|
|
296
|
-
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.0/src/commands/agent/generate/test-spec.ts)_
|
|
300
|
+
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/generate/test-spec.ts)_
|
|
297
301
|
|
|
298
302
|
## `sf agent preview`
|
|
299
303
|
|
|
@@ -328,43 +332,43 @@ FLAG DESCRIPTIONS
|
|
|
328
332
|
the API name of the agent? (TBD based on agents library)
|
|
329
333
|
```
|
|
330
334
|
|
|
331
|
-
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.0/src/commands/agent/preview.ts)_
|
|
335
|
+
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/preview.ts)_
|
|
332
336
|
|
|
333
337
|
## `sf agent test create`
|
|
334
338
|
|
|
335
|
-
|
|
339
|
+
Convert a test spec file into an AiEvaluationDefinition and deploy it to your org.
|
|
336
340
|
|
|
337
341
|
```
|
|
338
342
|
USAGE
|
|
339
|
-
$ sf agent test create -
|
|
343
|
+
$ sf agent test create -o <value> [--json] [--flags-dir <value>] [--test-api-name <value>] [--spec <value>]
|
|
344
|
+
[--api-version <value>] [--preview] [-p]
|
|
340
345
|
|
|
341
346
|
FLAGS
|
|
342
|
-
-o, --target-org=<value>
|
|
343
|
-
|
|
344
|
-
-p, --no-prompt
|
|
345
|
-
|
|
346
|
-
--
|
|
347
|
-
--
|
|
347
|
+
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
348
|
+
configuration variable is already set.
|
|
349
|
+
-p, --no-prompt Don't prompt for confirmation when overwriting an existing test.
|
|
350
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
351
|
+
--preview Preview the test metadata without deploying to your org.
|
|
352
|
+
--spec=<value> The path to the spec file.
|
|
353
|
+
--test-api-name=<value> The API name of the AiEvaluationDefinition.
|
|
348
354
|
|
|
349
355
|
GLOBAL FLAGS
|
|
350
356
|
--flags-dir=<value> Import flag values from a directory.
|
|
351
357
|
--json Format output as json.
|
|
352
358
|
|
|
353
359
|
DESCRIPTION
|
|
354
|
-
|
|
360
|
+
Convert a test spec file into an AiEvaluationDefinition and deploy it to your org.
|
|
361
|
+
|
|
362
|
+
This command will convert a test spec file into an AiEvaluationDefinition and deploy it to your org. The spec file
|
|
363
|
+
must be in yaml format.
|
|
355
364
|
|
|
356
|
-
|
|
365
|
+
Use the --preview flag to see the metadata that will be deployed without actually deploying it.
|
|
357
366
|
|
|
358
367
|
EXAMPLES
|
|
359
368
|
$ sf agent test create
|
|
360
|
-
|
|
361
|
-
FLAG DESCRIPTIONS
|
|
362
|
-
-s, --spec=<value> Description of a flag.
|
|
363
|
-
|
|
364
|
-
More information about a flag. Don't repeat the summary.
|
|
365
369
|
```
|
|
366
370
|
|
|
367
|
-
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.0/src/commands/agent/test/create.ts)_
|
|
371
|
+
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/test/create.ts)_
|
|
368
372
|
|
|
369
373
|
## `sf agent test list`
|
|
370
374
|
|
|
@@ -393,7 +397,7 @@ EXAMPLES
|
|
|
393
397
|
$ sf agent test list
|
|
394
398
|
```
|
|
395
399
|
|
|
396
|
-
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.0/src/commands/agent/test/list.ts)_
|
|
400
|
+
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/test/list.ts)_
|
|
397
401
|
|
|
398
402
|
## `sf agent test results`
|
|
399
403
|
|
|
@@ -449,7 +453,7 @@ FLAG DESCRIPTIONS
|
|
|
449
453
|
test results aren't written.
|
|
450
454
|
```
|
|
451
455
|
|
|
452
|
-
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.0/src/commands/agent/test/results.ts)_
|
|
456
|
+
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/test/results.ts)_
|
|
453
457
|
|
|
454
458
|
## `sf agent test resume`
|
|
455
459
|
|
|
@@ -512,7 +516,7 @@ FLAG DESCRIPTIONS
|
|
|
512
516
|
test results aren't written.
|
|
513
517
|
```
|
|
514
518
|
|
|
515
|
-
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.0/src/commands/agent/test/resume.ts)_
|
|
519
|
+
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/test/resume.ts)_
|
|
516
520
|
|
|
517
521
|
## `sf agent test run`
|
|
518
522
|
|
|
@@ -575,6 +579,6 @@ FLAG DESCRIPTIONS
|
|
|
575
579
|
test results aren't written.
|
|
576
580
|
```
|
|
577
581
|
|
|
578
|
-
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.0/src/commands/agent/test/run.ts)_
|
|
582
|
+
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/test/run.ts)_
|
|
579
583
|
|
|
580
584
|
<!-- commandsstop -->
|
|
@@ -13,7 +13,7 @@ import { MultiStageOutput } from '@oclif/multi-stage-output';
|
|
|
13
13
|
import { input as inquirerInput } from '@inquirer/prompts';
|
|
14
14
|
import { colorize } from '@oclif/core/ux';
|
|
15
15
|
import { Agent, AgentCreateLifecycleStagesV2, generateAgentApiName, } from '@salesforce/agents';
|
|
16
|
-
import { makeFlags, promptForFlag, getAgentUserId, validateAgentType, validateTone, } from '../../flags.js';
|
|
16
|
+
import { makeFlags, promptForFlag, getAgentUserId, validateAgentType, validateTone, promptForYamlFile, } from '../../flags.js';
|
|
17
17
|
import { theme } from '../../inquirer-theme.js';
|
|
18
18
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
19
19
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.create');
|
|
@@ -90,7 +90,7 @@ export default class AgentCreate extends SfCommand {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
// If we don't have an agent spec yet, prompt.
|
|
93
|
-
const specPath = flags.spec ?? (await
|
|
93
|
+
const specPath = flags.spec ?? (await promptForYamlFile(FLAGGABLE_PROMPTS['spec']));
|
|
94
94
|
// Read the agent spec and validate
|
|
95
95
|
const inputSpec = YAML.parse(readFileSync(resolve(specPath), 'utf8'));
|
|
96
96
|
validateSpec(inputSpec);
|
|
@@ -1 +1 @@
|
|
|
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,EAEL,SAAS,EACT,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,YAAY,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/agent/create.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,E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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"}
|
|
@@ -5,5 +5,9 @@ export default class AgentGenerateTestSpec extends SfCommand<void> {
|
|
|
5
5
|
static readonly examples: string[];
|
|
6
6
|
static readonly enableJsonFlag = false;
|
|
7
7
|
static readonly state = "beta";
|
|
8
|
+
static readonly flags: {
|
|
9
|
+
'output-dir': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'output-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
};
|
|
8
12
|
run(): Promise<void>;
|
|
9
13
|
}
|
|
@@ -1,45 +1,71 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2025, salesforce.com, inc.
|
|
3
3
|
* All rights reserved.
|
|
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 { join } from 'node:path';
|
|
8
7
|
import { readFile } from 'node:fs/promises';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { join } from 'node:path';
|
|
9
|
+
import { existsSync } from 'node:fs';
|
|
10
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
11
|
+
import { Messages, SfError, SfProject } from '@salesforce/core';
|
|
12
|
+
import { writeTestSpec } from '@salesforce/agents';
|
|
12
13
|
import { select, input, confirm, checkbox } from '@inquirer/prompts';
|
|
13
14
|
import { XMLParser } from 'fast-xml-parser';
|
|
15
|
+
import { ComponentSetBuilder } from '@salesforce/source-deploy-retrieve';
|
|
14
16
|
import { theme } from '../../../inquirer-theme.js';
|
|
15
|
-
import { readDir } from '../../../read-dir.js';
|
|
16
17
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
17
18
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.generate.test-spec');
|
|
18
19
|
function castArray(value) {
|
|
19
20
|
return Array.isArray(value) ? value : [value];
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Prompts the user for test case information through interactive prompts.
|
|
24
|
+
*
|
|
25
|
+
* @param genAiPlugins - Record mapping topic names to GenAiPlugin XML file paths (used to find the related actions)
|
|
26
|
+
* @param genAiFunctions - Array of GenAiFunction names from the GenAiPlanner
|
|
27
|
+
* @returns Promise resolving to a TestCase object containing:
|
|
28
|
+
* - utterance: The user input string
|
|
29
|
+
* - expectedTopic: The expected topic for classification
|
|
30
|
+
* - expectedActions: Array of expected action names
|
|
31
|
+
* - expectedOutcome: Expected outcome string
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* This function guides users through creating a test case by:
|
|
35
|
+
* 1. Prompting for an utterance
|
|
36
|
+
* 2. Selecting an expected topic (from GenAiPlugins specified in the Bot's GenAiPlanner)
|
|
37
|
+
* 3. Choosing expected actions (from GenAiFunctions in the GenAiPlanner or GenAiPlugin)
|
|
38
|
+
* 4. Defining an expected outcome
|
|
39
|
+
*/
|
|
40
|
+
async function promptForTestCase(genAiPlugins, genAiFunctions) {
|
|
22
41
|
const utterance = await input({
|
|
23
42
|
message: 'Utterance',
|
|
24
43
|
validate: (d) => d.length > 0 || 'utterance cannot be empty',
|
|
25
44
|
theme,
|
|
26
45
|
});
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
46
|
+
const expectedTopic = await select({
|
|
47
|
+
message: 'Expected topic',
|
|
48
|
+
choices: Object.keys(genAiPlugins),
|
|
49
|
+
theme,
|
|
50
|
+
});
|
|
51
|
+
// GenAiFunctions (aka actions) can be defined in the GenAiPlugin or GenAiPlanner
|
|
52
|
+
// the actions from the planner are passed in as an argument to this function
|
|
53
|
+
// the actions from the plugin are read from the GenAiPlugin file
|
|
54
|
+
let actions = [];
|
|
55
|
+
if (genAiPlugins[expectedTopic]) {
|
|
56
|
+
const genAiPluginXml = await readFile(genAiPlugins[expectedTopic], 'utf-8');
|
|
57
|
+
const parser = new XMLParser();
|
|
58
|
+
const parsed = parser.parse(genAiPluginXml);
|
|
59
|
+
actions = castArray(parsed.GenAiPlugin.genAiFunctions ?? []).map((f) => f.functionName);
|
|
60
|
+
}
|
|
61
|
+
const expectedActions = await checkbox({
|
|
30
62
|
message: 'Expected action(s)',
|
|
31
|
-
|
|
32
|
-
if (!d.length) {
|
|
33
|
-
return 'expected value cannot be empty';
|
|
34
|
-
}
|
|
35
|
-
return true;
|
|
36
|
-
},
|
|
63
|
+
choices: [...actions, ...genAiFunctions],
|
|
37
64
|
theme,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
message: 'Expected response',
|
|
65
|
+
required: true,
|
|
66
|
+
});
|
|
67
|
+
const expectedOutcome = await input({
|
|
68
|
+
message: 'Expected outcome',
|
|
43
69
|
validate: (d) => {
|
|
44
70
|
if (!d.length) {
|
|
45
71
|
return 'expected value cannot be empty';
|
|
@@ -48,62 +74,95 @@ async function promptForTestCase(genAiPlugins) {
|
|
|
48
74
|
},
|
|
49
75
|
theme,
|
|
50
76
|
});
|
|
51
|
-
const expectedTopic = await select({
|
|
52
|
-
message: 'Expected topic',
|
|
53
|
-
choices: [...topics, customKey],
|
|
54
|
-
theme,
|
|
55
|
-
});
|
|
56
|
-
if (expectedTopic === customKey) {
|
|
57
|
-
return {
|
|
58
|
-
utterance,
|
|
59
|
-
expectedTopic: await input({
|
|
60
|
-
message: 'Expected topic',
|
|
61
|
-
validate: (d) => {
|
|
62
|
-
if (!d.length) {
|
|
63
|
-
return 'expected value cannot be empty';
|
|
64
|
-
}
|
|
65
|
-
return true;
|
|
66
|
-
},
|
|
67
|
-
theme,
|
|
68
|
-
}),
|
|
69
|
-
// If the user selects OTHER for the topic, then we don't have a genAiPlugin to get actions from so we ask for them for custom input
|
|
70
|
-
expectedActions: await askForOtherActions(),
|
|
71
|
-
expectedOutcome: await askForBotRating(),
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
const genAiPluginXml = await readFile(genAiPlugins[expectedTopic], 'utf-8');
|
|
75
|
-
const parser = new XMLParser();
|
|
76
|
-
const parsed = parser.parse(genAiPluginXml);
|
|
77
|
-
const actions = castArray(parsed.GenAiPlugin.genAiFunctions).map((f) => f.functionName);
|
|
78
|
-
let expectedActions = await checkbox({
|
|
79
|
-
message: 'Expected action(s)',
|
|
80
|
-
choices: [...actions, customKey],
|
|
81
|
-
theme,
|
|
82
|
-
required: true,
|
|
83
|
-
});
|
|
84
|
-
if (expectedActions.includes(customKey)) {
|
|
85
|
-
const additional = await askForOtherActions();
|
|
86
|
-
expectedActions = [...expectedActions.filter((a) => a !== customKey), ...additional];
|
|
87
|
-
}
|
|
88
|
-
const expectedOutcome = await askForBotRating();
|
|
89
77
|
return {
|
|
90
78
|
utterance,
|
|
79
|
+
expectedTopic,
|
|
91
80
|
expectedActions,
|
|
92
81
|
expectedOutcome,
|
|
93
|
-
expectedTopic,
|
|
94
82
|
};
|
|
95
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Retrieves GenAIPlugins and GenAiFunctions from a Bot's GenAiPlanner
|
|
86
|
+
*
|
|
87
|
+
* We have to get the bot version and planner for the selected bot so that we can get
|
|
88
|
+
* the actions (GenAiFunctions) and topics (GenAiPlugins) that can be selected for the
|
|
89
|
+
* test cases.
|
|
90
|
+
*
|
|
91
|
+
* The BotVersion tells us which GenAiPlanner to use, and the GenAiPlanner
|
|
92
|
+
* tells us which GenAiPlugins and GenAiFunctions are available. More GenAiFunctions
|
|
93
|
+
* might be available in the GenAiPlugin, so we read those later when the user
|
|
94
|
+
* has selected a GenAiPlugin/topic - inside of `promptForTestCase`.
|
|
95
|
+
*
|
|
96
|
+
* @param subjectName - The name of the Bot to analyze
|
|
97
|
+
* @param cs - ComponentSet containing Bot, GenAiPlanner, and GenAiPlugin components
|
|
98
|
+
*
|
|
99
|
+
* @returns Object containing:
|
|
100
|
+
* - genAiPlugins: Record of plugin names to their file paths
|
|
101
|
+
* - genAiFunctions: Array of function names
|
|
102
|
+
*/
|
|
103
|
+
async function getPluginsAndFunctions(subjectName, cs) {
|
|
104
|
+
const botVersions = [...cs.filter((component) => component.type.name === 'Bot' && component.fullName !== '*')].reduce((acc, component) => ({
|
|
105
|
+
...acc,
|
|
106
|
+
// this resolves to the BotVersion filepath
|
|
107
|
+
[component.fullName]: cs.getComponentFilenamesByNameAndType({
|
|
108
|
+
fullName: component.fullName,
|
|
109
|
+
type: 'Bot',
|
|
110
|
+
})[0],
|
|
111
|
+
}), {});
|
|
112
|
+
const genAiPlanners = [
|
|
113
|
+
...cs.filter((component) => component.type.name === 'GenAiPlanner' && component.fullName !== '*'),
|
|
114
|
+
].reduce((acc, component) => ({
|
|
115
|
+
...acc,
|
|
116
|
+
[component.fullName]: cs.getComponentFilenamesByNameAndType({
|
|
117
|
+
fullName: component.fullName,
|
|
118
|
+
type: 'GenAiPlanner',
|
|
119
|
+
})[0],
|
|
120
|
+
}), {});
|
|
121
|
+
const parser = new XMLParser();
|
|
122
|
+
const botVersionXml = await readFile(botVersions[subjectName], 'utf-8');
|
|
123
|
+
const parsedBotVersion = parser.parse(botVersionXml);
|
|
124
|
+
const plannerXml = await readFile(genAiPlanners[parsedBotVersion.BotVersion.conversationDefinitionPlanners.genAiPlannerName ?? subjectName], 'utf-8');
|
|
125
|
+
const parsedPlanner = parser.parse(plannerXml);
|
|
126
|
+
const genAiFunctions = castArray(parsedPlanner.GenAiPlanner.genAiFunctions).map(({ genAiFunctionName }) => genAiFunctionName);
|
|
127
|
+
const genAiPlugins = castArray(parsedPlanner.GenAiPlanner.genAiPlugins).reduce((acc, { genAiPluginName }) => ({
|
|
128
|
+
...acc,
|
|
129
|
+
[genAiPluginName]: cs.getComponentFilenamesByNameAndType({
|
|
130
|
+
fullName: genAiPluginName,
|
|
131
|
+
type: 'GenAiPlugin',
|
|
132
|
+
})[0],
|
|
133
|
+
}), {});
|
|
134
|
+
return { genAiPlugins, genAiFunctions };
|
|
135
|
+
}
|
|
96
136
|
export default class AgentGenerateTestSpec extends SfCommand {
|
|
97
137
|
static summary = messages.getMessage('summary');
|
|
98
138
|
static description = messages.getMessage('description');
|
|
99
139
|
static examples = messages.getMessages('examples');
|
|
100
140
|
static enableJsonFlag = false;
|
|
101
141
|
static state = 'beta';
|
|
142
|
+
static flags = {
|
|
143
|
+
'output-dir': Flags.directory({
|
|
144
|
+
char: 'd',
|
|
145
|
+
summary: messages.getMessage('flags.output-dir.summary'),
|
|
146
|
+
default: 'specs',
|
|
147
|
+
}),
|
|
148
|
+
'output-file': Flags.string({
|
|
149
|
+
char: 'f',
|
|
150
|
+
summary: messages.getMessage('flags.output-file.summary'),
|
|
151
|
+
}),
|
|
152
|
+
};
|
|
102
153
|
async run() {
|
|
103
|
-
const
|
|
104
|
-
const
|
|
154
|
+
const { flags } = await this.parse(AgentGenerateTestSpec);
|
|
155
|
+
const directoryPaths = (await SfProject.resolve().then((project) => project.getPackageDirectories())).map((dir) => dir.fullPath);
|
|
156
|
+
const cs = await ComponentSetBuilder.build({
|
|
157
|
+
metadata: {
|
|
158
|
+
metadataEntries: ['GenAiPlanner', 'GenAiPlugin', 'Bot'],
|
|
159
|
+
directoryPaths,
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
const botsComponents = cs.filter((component) => component.type.name === 'Bot');
|
|
163
|
+
const bots = [...botsComponents.map((c) => c.fullName).filter((n) => n !== '*')];
|
|
105
164
|
if (bots.length === 0) {
|
|
106
|
-
throw new SfError(`No agents found in ${
|
|
165
|
+
throw new SfError(`No agents found in ${directoryPaths.join(', ')}`, 'NoAgentsFoundError');
|
|
107
166
|
}
|
|
108
167
|
const subjectType = await select({
|
|
109
168
|
message: 'What are you testing',
|
|
@@ -115,6 +174,11 @@ export default class AgentGenerateTestSpec extends SfCommand {
|
|
|
115
174
|
choices: bots,
|
|
116
175
|
theme,
|
|
117
176
|
});
|
|
177
|
+
const outputFile = join(flags['output-dir'], flags['output-file'] ?? `${subjectName}-agentTestSpec.yaml`);
|
|
178
|
+
if (existsSync(outputFile)) {
|
|
179
|
+
await this.confirm({ message: `File ${outputFile} already exists. Overwrite?`, defaultAnswer: false });
|
|
180
|
+
}
|
|
181
|
+
const { genAiPlugins, genAiFunctions } = await getPluginsAndFunctions(subjectName, cs);
|
|
118
182
|
const name = await input({
|
|
119
183
|
message: 'Enter a name for the test definition',
|
|
120
184
|
validate(d) {
|
|
@@ -123,12 +187,6 @@ export default class AgentGenerateTestSpec extends SfCommand {
|
|
|
123
187
|
return 'Name cannot be empty';
|
|
124
188
|
}
|
|
125
189
|
return true;
|
|
126
|
-
// TODO: add back validation once we refine the regex
|
|
127
|
-
// check against FORTY_CHAR_API_NAME_REGEX
|
|
128
|
-
// if (!FORTY_CHAR_API_NAME_REGEX.test(d)) {
|
|
129
|
-
// return 'The non-namespaced portion an API name must begin with a letter, contain only letters, numbers, and underscores, not contain consecutive underscores, and not end with an underscore.';
|
|
130
|
-
// }
|
|
131
|
-
// return true;
|
|
132
190
|
},
|
|
133
191
|
theme,
|
|
134
192
|
});
|
|
@@ -136,31 +194,26 @@ export default class AgentGenerateTestSpec extends SfCommand {
|
|
|
136
194
|
message: 'Enter a description for test definition (optional)',
|
|
137
195
|
theme,
|
|
138
196
|
});
|
|
139
|
-
const genAiPluginDir = join('force-app', 'main', 'default', 'genAiPlugins');
|
|
140
|
-
const genAiPlugins = Object.fromEntries((await readDir(genAiPluginDir)).map((genAiPlugin) => [
|
|
141
|
-
genAiPlugin.replace('.genAiPlugin-meta.xml', ''),
|
|
142
|
-
join(genAiPluginDir, genAiPlugin),
|
|
143
|
-
]));
|
|
144
197
|
const testCases = [];
|
|
145
198
|
do {
|
|
146
199
|
this.log();
|
|
147
200
|
this.styledHeader(`Adding test case #${testCases.length + 1}`);
|
|
148
201
|
// eslint-disable-next-line no-await-in-loop
|
|
149
|
-
testCases.push(await promptForTestCase(genAiPlugins));
|
|
202
|
+
testCases.push(await promptForTestCase(genAiPlugins, genAiFunctions));
|
|
150
203
|
} while ( // eslint-disable-next-line no-await-in-loop
|
|
151
204
|
await confirm({
|
|
152
205
|
message: 'Would you like to add another test case',
|
|
153
206
|
default: true,
|
|
154
207
|
}));
|
|
155
208
|
this.log();
|
|
156
|
-
await
|
|
209
|
+
await writeTestSpec({
|
|
157
210
|
name,
|
|
158
211
|
description,
|
|
159
212
|
subjectType,
|
|
160
213
|
subjectName,
|
|
161
214
|
testCases,
|
|
162
|
-
},
|
|
163
|
-
this.log(`Created ${
|
|
215
|
+
}, outputFile);
|
|
216
|
+
this.log(`Created ${outputFile}`);
|
|
164
217
|
}
|
|
165
218
|
}
|
|
166
219
|
//# sourceMappingURL=test-spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-spec.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/test-spec.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"test-spec.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/test-spec.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAgB,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAEnD,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,0BAA0B,CAAC,CAAC;AAS/F,SAAS,SAAS,CAAI,KAAc;IAClC,OAA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AED,OAAO,IAAI,CAAC;YACd,CAAC;YACD,KAAK;SACN,CAAC,CAAC;QAEH,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC;YAC9B,OAAO,EAAE,oDAAoD;YAC7D,KAAK;SACN,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,EAAE,CAAC;QACrB,GAAG,CAAC;YACF,IAAI,CAAC,GAAG,EAAE,CAAC;YACX,IAAI,CAAC,YAAY,CAAC,qBAAqB,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC;YAC/D,4CAA4C;YAC5C,SAAS,CAAC,IAAI,CAAC,MAAM,iBAAiB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC;QACxE,CAAC,SAAS,4CAA4C;QACpD,MAAM,OAAO,CAAC;YACZ,OAAO,EAAE,yCAAyC;YAClD,OAAO,EAAE,IAAI;SACd,CAAC,EACF;QAEF,IAAI,CAAC,GAAG,EAAE,CAAC;QAEX,MAAM,aAAa,CACjB;YACE,IAAI;YACJ,WAAW;YACX,WAAW;YACX,WAAW;YACX,SAAS;SACV,EACD,UAAU,CACX,CAAC;QACF,IAAI,CAAC,GAAG,CAAC,WAAW,UAAU,EAAE,CAAC,CAAC;IACpC,CAAC"}
|
|
@@ -11,11 +11,12 @@ export default class AgentTestCreate extends SfCommand<AgentTestCreateResult> {
|
|
|
11
11
|
static readonly examples: string[];
|
|
12
12
|
static readonly state = "beta";
|
|
13
13
|
static readonly flags: {
|
|
14
|
-
spec: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
14
|
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
15
|
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
16
|
preview: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
17
|
'no-prompt': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
|
+
spec: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
"test-api-name": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
20
|
};
|
|
20
21
|
private mso?;
|
|
21
22
|
run(): Promise<AgentTestCreateResult>;
|