@salesforce/plugin-agent 1.7.2 → 1.7.3-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -49
- package/lib/commands/agent/generate/spec.js +1 -2
- package/lib/commands/agent/generate/spec.js.map +1 -1
- package/lib/commands/agent/generate/{definition.d.ts → test-definition.d.ts} +1 -1
- package/lib/commands/agent/generate/{definition.js → test-definition.js} +25 -25
- package/lib/commands/agent/generate/test-definition.js.map +1 -0
- package/lib/commands/agent/generate/{testset.d.ts → test-set.d.ts} +1 -1
- package/lib/commands/agent/generate/test-set.js +161 -0
- package/lib/commands/agent/generate/test-set.js.map +1 -0
- package/lib/flags.js +1 -1
- package/lib/handleTestResults.js +24 -8
- package/lib/handleTestResults.js.map +1 -1
- package/lib/read-dir.d.ts +1 -0
- package/lib/read-dir.js +11 -0
- package/lib/read-dir.js.map +1 -0
- package/messages/{agent.generate.definition.md → agent.generate.test-definition.md} +1 -1
- package/messages/{agent.generate.testset.md → agent.generate.test-set.md} +1 -1
- package/npm-shrinkwrap.json +518 -209
- package/oclif.lock +139 -33
- package/oclif.manifest.json +59 -59
- package/package.json +5 -6
- package/lib/commands/agent/generate/definition.js.map +0 -1
- package/lib/commands/agent/generate/testset.js +0 -118
- package/lib/commands/agent/generate/testset.js.map +0 -1
package/README.md
CHANGED
|
@@ -62,9 +62,9 @@ sf plugins
|
|
|
62
62
|
<!-- commands -->
|
|
63
63
|
|
|
64
64
|
- [`sf agent create`](#sf-agent-create)
|
|
65
|
-
- [`sf agent generate definition`](#sf-agent-generate-definition)
|
|
66
65
|
- [`sf agent generate spec`](#sf-agent-generate-spec)
|
|
67
|
-
- [`sf agent generate
|
|
66
|
+
- [`sf agent generate test-definition`](#sf-agent-generate-test-definition)
|
|
67
|
+
- [`sf agent generate test-set`](#sf-agent-generate-test-set)
|
|
68
68
|
- [`sf agent preview`](#sf-agent-preview)
|
|
69
69
|
- [`sf agent test cancel`](#sf-agent-test-cancel)
|
|
70
70
|
- [`sf agent test results`](#sf-agent-test-results)
|
|
@@ -111,32 +111,7 @@ EXAMPLES
|
|
|
111
111
|
$ sf agent create --name CustomerSupportAgent --spec ./config/agentSpec.json --target-org my-org
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.
|
|
115
|
-
|
|
116
|
-
## `sf agent generate definition`
|
|
117
|
-
|
|
118
|
-
Interactively generate a new AiEvaluationDefinition.
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
USAGE
|
|
122
|
-
$ sf agent generate definition [--flags-dir <value>]
|
|
123
|
-
|
|
124
|
-
GLOBAL FLAGS
|
|
125
|
-
--flags-dir=<value> Import flag values from a directory.
|
|
126
|
-
|
|
127
|
-
DESCRIPTION
|
|
128
|
-
Interactively generate a new AiEvaluationDefinition.
|
|
129
|
-
|
|
130
|
-
This command will prompt you for the necessary information to create a new AiEvaluationDefinition. The definition will
|
|
131
|
-
be saved to the `aiEvaluationDefinitions` directory in the project.
|
|
132
|
-
|
|
133
|
-
You must have the `Bots` and `AiEvaluationTestSets` metadata types present in your project to use this command.
|
|
134
|
-
|
|
135
|
-
EXAMPLES
|
|
136
|
-
$ sf agent generate definition
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
_See code: [src/commands/agent/generate/definition.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2/src/commands/agent/generate/definition.ts)_
|
|
114
|
+
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.1/src/commands/agent/create.ts)_
|
|
140
115
|
|
|
141
116
|
## `sf agent generate spec`
|
|
142
117
|
|
|
@@ -197,30 +172,55 @@ EXAMPLES
|
|
|
197
172
|
$ sf agent generate spec --output-dir specs --target-org my-org
|
|
198
173
|
```
|
|
199
174
|
|
|
200
|
-
_See code: [src/commands/agent/generate/spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.
|
|
175
|
+
_See code: [src/commands/agent/generate/spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.1/src/commands/agent/generate/spec.ts)_
|
|
176
|
+
|
|
177
|
+
## `sf agent generate test-definition`
|
|
178
|
+
|
|
179
|
+
Interactively generate a new AI Evaluation Test Definition.
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
USAGE
|
|
183
|
+
$ sf agent generate test-definition [--flags-dir <value>]
|
|
184
|
+
|
|
185
|
+
GLOBAL FLAGS
|
|
186
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
187
|
+
|
|
188
|
+
DESCRIPTION
|
|
189
|
+
Interactively generate a new AI Evaluation Test Definition.
|
|
190
|
+
|
|
191
|
+
This command will prompt you for the necessary information to create a new AiEvaluationDefinition. The definition will
|
|
192
|
+
be saved to the `aiEvaluationDefinitions` directory in the project.
|
|
193
|
+
|
|
194
|
+
You must have the `Bots` and `AiEvaluationTestSets` metadata types present in your project to use this command.
|
|
195
|
+
|
|
196
|
+
EXAMPLES
|
|
197
|
+
$ sf agent generate test-definition
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
_See code: [src/commands/agent/generate/test-definition.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.1/src/commands/agent/generate/test-definition.ts)_
|
|
201
201
|
|
|
202
|
-
## `sf agent generate
|
|
202
|
+
## `sf agent generate test-set`
|
|
203
203
|
|
|
204
|
-
Interactively generate
|
|
204
|
+
Interactively generate a new Set of AI Evaluation test cases.
|
|
205
205
|
|
|
206
206
|
```
|
|
207
207
|
USAGE
|
|
208
|
-
$ sf agent generate
|
|
208
|
+
$ sf agent generate test-set [--flags-dir <value>]
|
|
209
209
|
|
|
210
210
|
GLOBAL FLAGS
|
|
211
211
|
--flags-dir=<value> Import flag values from a directory.
|
|
212
212
|
|
|
213
213
|
DESCRIPTION
|
|
214
|
-
Interactively generate
|
|
214
|
+
Interactively generate a new Set of AI Evaluation test cases.
|
|
215
215
|
|
|
216
216
|
Answer the prompts to generate an AiEvaluationTestSet that will be written to a file. You can then run "sf agent
|
|
217
217
|
generate definition" to generate the AiEvaluationDefinition that can be used to evaluate the test set.
|
|
218
218
|
|
|
219
219
|
EXAMPLES
|
|
220
|
-
$ sf agent generate
|
|
220
|
+
$ sf agent generate test-set
|
|
221
221
|
```
|
|
222
222
|
|
|
223
|
-
_See code: [src/commands/agent/generate/
|
|
223
|
+
_See code: [src/commands/agent/generate/test-set.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.1/src/commands/agent/generate/test-set.ts)_
|
|
224
224
|
|
|
225
225
|
## `sf agent preview`
|
|
226
226
|
|
|
@@ -255,7 +255,7 @@ FLAG DESCRIPTIONS
|
|
|
255
255
|
the API name of the agent? (TBD based on agents library)
|
|
256
256
|
```
|
|
257
257
|
|
|
258
|
-
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.
|
|
258
|
+
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.1/src/commands/agent/preview.ts)_
|
|
259
259
|
|
|
260
260
|
## `sf agent test cancel`
|
|
261
261
|
|
|
@@ -292,7 +292,7 @@ EXAMPLES
|
|
|
292
292
|
$ sf agent test cancel --job-id 4KBfake0000003F4AQ --target-org my-org
|
|
293
293
|
```
|
|
294
294
|
|
|
295
|
-
_See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.
|
|
295
|
+
_See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.1/src/commands/agent/test/cancel.ts)_
|
|
296
296
|
|
|
297
297
|
## `sf agent test results`
|
|
298
298
|
|
|
@@ -301,10 +301,10 @@ Get the results of a completed agent test run.
|
|
|
301
301
|
```
|
|
302
302
|
USAGE
|
|
303
303
|
$ sf agent test results -o <value> -i <value> [--json] [--flags-dir <value>] [--api-version <value>] [--result-format
|
|
304
|
-
json|human|junit|tap] [-
|
|
304
|
+
json|human|junit|tap] [-d <value>]
|
|
305
305
|
|
|
306
306
|
FLAGS
|
|
307
|
-
-
|
|
307
|
+
-d, --output-dir=<value> Directory to write the agent test results into.
|
|
308
308
|
-i, --job-id=<value> (required) Job ID of the completed agent test run.
|
|
309
309
|
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
310
310
|
configuration variable is already set.
|
|
@@ -342,13 +342,13 @@ EXAMPLES
|
|
|
342
342
|
$ sf agent test results --use-most-recent --output-dir ./test-results --result-format json
|
|
343
343
|
|
|
344
344
|
FLAG DESCRIPTIONS
|
|
345
|
-
-
|
|
345
|
+
-d, --output-dir=<value> Directory to write the agent test results into.
|
|
346
346
|
|
|
347
347
|
If the agent test run completes, write the results to the specified directory. If the test is still running, the
|
|
348
348
|
test results aren't written.
|
|
349
349
|
```
|
|
350
350
|
|
|
351
|
-
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.
|
|
351
|
+
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.1/src/commands/agent/test/results.ts)_
|
|
352
352
|
|
|
353
353
|
## `sf agent test resume`
|
|
354
354
|
|
|
@@ -357,10 +357,10 @@ Resume an agent test that you previously started in your org so you can view the
|
|
|
357
357
|
```
|
|
358
358
|
USAGE
|
|
359
359
|
$ sf agent test resume -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-i <value>] [-r] [-w
|
|
360
|
-
<value>] [--result-format json|human|junit|tap] [-
|
|
360
|
+
<value>] [--result-format json|human|junit|tap] [-d <value>]
|
|
361
361
|
|
|
362
362
|
FLAGS
|
|
363
|
-
-
|
|
363
|
+
-d, --output-dir=<value> Directory to write the agent test results into.
|
|
364
364
|
-i, --job-id=<value> Job ID of the original agent test run.
|
|
365
365
|
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
366
366
|
configuration variable is already set.
|
|
@@ -405,13 +405,13 @@ EXAMPLES
|
|
|
405
405
|
$ sf agent test resume --use-most-recent --output-dir ./test-results --result-format json
|
|
406
406
|
|
|
407
407
|
FLAG DESCRIPTIONS
|
|
408
|
-
-
|
|
408
|
+
-d, --output-dir=<value> Directory to write the agent test results into.
|
|
409
409
|
|
|
410
410
|
If the agent test run completes, write the results to the specified directory. If the test is still running, the
|
|
411
411
|
test results aren't written.
|
|
412
412
|
```
|
|
413
413
|
|
|
414
|
-
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.
|
|
414
|
+
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.1/src/commands/agent/test/resume.ts)_
|
|
415
415
|
|
|
416
416
|
## `sf agent test run`
|
|
417
417
|
|
|
@@ -420,10 +420,10 @@ Start an agent test in your org.
|
|
|
420
420
|
```
|
|
421
421
|
USAGE
|
|
422
422
|
$ sf agent test run -o <value> -n <value> [--json] [--flags-dir <value>] [--api-version <value>] [-w <value>]
|
|
423
|
-
[--result-format json|human|junit|tap] [-
|
|
423
|
+
[--result-format json|human|junit|tap] [-d <value>]
|
|
424
424
|
|
|
425
425
|
FLAGS
|
|
426
|
-
-
|
|
426
|
+
-d, --output-dir=<value> Directory to write the agent test results into.
|
|
427
427
|
-n, --name=<value> (required) Name of the agent test to start.
|
|
428
428
|
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
429
429
|
configuration variable is already set.
|
|
@@ -468,12 +468,12 @@ EXAMPLES
|
|
|
468
468
|
$ sf agent test run --name MyAgentTest --wait 10 --output-dir ./test-results --result-format json
|
|
469
469
|
|
|
470
470
|
FLAG DESCRIPTIONS
|
|
471
|
-
-
|
|
471
|
+
-d, --output-dir=<value> Directory to write the agent test results into.
|
|
472
472
|
|
|
473
473
|
If the agent test run completes, write the results to the specified directory. If the test is still running, the
|
|
474
474
|
test results aren't written.
|
|
475
475
|
```
|
|
476
476
|
|
|
477
|
-
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.
|
|
477
|
+
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.1/src/commands/agent/test/run.ts)_
|
|
478
478
|
|
|
479
479
|
<!-- commandsstop -->
|
|
@@ -9,8 +9,7 @@ import { writeFileSync } from 'node:fs';
|
|
|
9
9
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
10
10
|
import { Messages } from '@salesforce/core';
|
|
11
11
|
import ansis from 'ansis';
|
|
12
|
-
import select from '@inquirer/
|
|
13
|
-
import inquirerInput from '@inquirer/input';
|
|
12
|
+
import { select, input as inquirerInput } from '@inquirer/prompts';
|
|
14
13
|
import figures from '@inquirer/figures';
|
|
15
14
|
import { Agent } from '@salesforce/agents';
|
|
16
15
|
import { theme } from '../../../inquirer-theme.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/spec.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAa,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/spec.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAa,MAAM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AO,MAAM,CAAC;gBACZ,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;gBAC5D,OAAO;gBACP,KAAK;aACN,CAAC,CAAC;QACL,CAAC;QAED,OAAO,aAAa,CAAC;YACnB,OAAO;YACP,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,KAAK;SACN,CAAC,CAAC;IACL,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
export default class
|
|
2
|
+
export default class AgentGenerateTestDefinition extends SfCommand<void> {
|
|
3
3
|
static readonly summary: string;
|
|
4
4
|
static readonly description: string;
|
|
5
5
|
static readonly examples: string[];
|
|
@@ -5,15 +5,15 @@
|
|
|
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
7
|
import { dirname, join } from 'node:path';
|
|
8
|
-
import { mkdir,
|
|
8
|
+
import { mkdir, writeFile } from 'node:fs/promises';
|
|
9
9
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
10
10
|
import { Messages, SfError } from '@salesforce/core';
|
|
11
|
-
import select from '@inquirer/
|
|
12
|
-
import input from '@inquirer/input';
|
|
11
|
+
import { input, select } from '@inquirer/prompts';
|
|
13
12
|
import { theme } from '../../../inquirer-theme.js';
|
|
13
|
+
import { readDir } from '../../../read-dir.js';
|
|
14
14
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
15
|
-
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.generate.definition');
|
|
16
|
-
export default class
|
|
15
|
+
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.generate.test-definition');
|
|
16
|
+
export default class AgentGenerateTestDefinition extends SfCommand {
|
|
17
17
|
static summary = messages.getMessage('summary');
|
|
18
18
|
static description = messages.getMessage('description');
|
|
19
19
|
static examples = messages.getMessages('examples');
|
|
@@ -21,56 +21,56 @@ export default class AgentGenerateDefinition extends SfCommand {
|
|
|
21
21
|
static state = 'beta';
|
|
22
22
|
async run() {
|
|
23
23
|
const testSetDir = join('force-app', 'main', 'default', 'aiEvaluationTestSets');
|
|
24
|
-
const testSets = (await
|
|
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
27
|
'Run the "sf agent generate testset" command to create a test set',
|
|
28
28
|
]);
|
|
29
29
|
}
|
|
30
30
|
const botsDir = join('force-app', 'main', 'default', 'bots');
|
|
31
|
-
const bots = await
|
|
31
|
+
const bots = await readDir(botsDir);
|
|
32
32
|
if (bots.length === 0) {
|
|
33
|
-
throw new SfError(`No
|
|
33
|
+
throw new SfError(`No agents found in ${botsDir}`, 'NoAgentsFoundError');
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
message: '
|
|
37
|
-
choices:
|
|
35
|
+
const subjectType = await select({
|
|
36
|
+
message: 'What are you testing',
|
|
37
|
+
choices: ['AGENT'],
|
|
38
38
|
theme,
|
|
39
39
|
});
|
|
40
|
-
const
|
|
41
|
-
message: 'Select the
|
|
40
|
+
const agent = await select({
|
|
41
|
+
message: 'Select the Agent to test',
|
|
42
42
|
choices: bots,
|
|
43
43
|
theme,
|
|
44
44
|
});
|
|
45
|
+
const testSet = await select({
|
|
46
|
+
message: 'Select the test set to use',
|
|
47
|
+
choices: testSets,
|
|
48
|
+
theme,
|
|
49
|
+
});
|
|
45
50
|
const name = await input({
|
|
46
|
-
message: 'Enter a name for the
|
|
51
|
+
message: 'Enter a name for the test definition',
|
|
47
52
|
validate: (i) => (i.length > 0 ? true : 'Name cannot be empty'),
|
|
48
53
|
theme,
|
|
49
54
|
});
|
|
50
55
|
const description = await input({
|
|
51
|
-
message: 'Enter a description for
|
|
52
|
-
theme,
|
|
53
|
-
});
|
|
54
|
-
const subjectType = await select({
|
|
55
|
-
message: 'Select the type for the AiEvaluationDefinition',
|
|
56
|
-
choices: ['AGENT'],
|
|
56
|
+
message: 'Enter a description for test definition (optional)',
|
|
57
57
|
theme,
|
|
58
58
|
});
|
|
59
|
-
this.log(`Generating AiEvaluationDefinition for ${bot} using ${testSet} AiEvaluationTestSet`);
|
|
60
59
|
const xml = `<?xml version="1.0" encoding="UTF-8"?>
|
|
61
60
|
<AiEvaluationDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
62
61
|
${description ? `<description>${description}</description>` : ''}
|
|
63
62
|
<name>${name}</name>
|
|
64
63
|
<subjectType>${subjectType}</subjectType>
|
|
65
|
-
<subjectName>${
|
|
64
|
+
<subjectName>${agent}</subjectName>
|
|
66
65
|
<testSetName>${testSet}</testSetName>
|
|
67
66
|
</AiEvaluationDefinition>`;
|
|
68
67
|
// remove all empty lines
|
|
69
68
|
const cleanedXml = xml.replace(/^\s*[\r\n]/gm, '');
|
|
70
|
-
const definitionPath = join('force-app', 'main', 'default', 'aiEvaluationDefinitions', `${name}.xml`);
|
|
69
|
+
const definitionPath = join('force-app', 'main', 'default', 'aiEvaluationDefinitions', `${name}.aiEvaluationDefinition-meta.xml`);
|
|
71
70
|
await mkdir(dirname(definitionPath), { recursive: true });
|
|
72
|
-
this.log(
|
|
71
|
+
this.log();
|
|
72
|
+
this.log(`Created ${definitionPath}`);
|
|
73
73
|
await writeFile(definitionPath, cleanedXml);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
//# sourceMappingURL=definition.js.map
|
|
76
|
+
//# sourceMappingURL=test-definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-definition.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/test-definition.ts"],"names":[],"mappings":"AAAA;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,CAAC,gBAAgB,WAAW,gBAAgB,CAAC,CAAC,CAAC,EAAE;YACxD,IAAI;mBACG,WAAW;mBACX,KAAK;mBACL,OAAO;0BACA,CAAC;QAEvB,yBAAyB;QACzB,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;QAEnD,MAAM,cAAc,GAAG,IAAI,CACzB,WAAW,EACX,MAAM,EACN,SAAS,EACT,yBAAyB,EACzB,GAAG,IAAI,kCAAkC,CAC1C,CAAC;QACF,MAAM,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,IAAI,CAAC,GAAG,EAAE,CAAC;QACX,IAAI,CAAC,GAAG,CAAC,WAAW,cAAc,EAAE,CAAC,CAAC;QACtC,MAAM,SAAS,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;IAC9C,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
2
|
export type TestSetInputs = {
|
|
3
3
|
utterance: string;
|
|
4
|
-
actionSequenceExpectedValue: string;
|
|
4
|
+
actionSequenceExpectedValue: string[];
|
|
5
5
|
botRatingExpectedValue: string;
|
|
6
6
|
topicSequenceExpectedValue: string;
|
|
7
7
|
};
|
|
@@ -0,0 +1,161 @@
|
|
|
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 { dirname, join } from 'node:path';
|
|
8
|
+
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
9
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
10
|
+
import { Messages } from '@salesforce/core';
|
|
11
|
+
import { select, input, confirm, checkbox } from '@inquirer/prompts';
|
|
12
|
+
import { XMLParser } from 'fast-xml-parser';
|
|
13
|
+
import { theme } from '../../../inquirer-theme.js';
|
|
14
|
+
import { readDir } from '../../../read-dir.js';
|
|
15
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
16
|
+
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.generate.test-set');
|
|
17
|
+
async function promptForTestCase(genAiPlugins) {
|
|
18
|
+
const utterance = await input({
|
|
19
|
+
message: 'Utterance',
|
|
20
|
+
validate: (d) => d.length > 0 || 'utterance cannot be empty',
|
|
21
|
+
theme,
|
|
22
|
+
});
|
|
23
|
+
const customKey = '<OTHER>';
|
|
24
|
+
const topics = Object.keys(genAiPlugins);
|
|
25
|
+
const askForOtherActions = async () => (await input({
|
|
26
|
+
message: 'Expected action(s)',
|
|
27
|
+
validate: (d) => {
|
|
28
|
+
if (!d.length) {
|
|
29
|
+
return 'expected value cannot be empty';
|
|
30
|
+
}
|
|
31
|
+
return true;
|
|
32
|
+
},
|
|
33
|
+
theme,
|
|
34
|
+
}))
|
|
35
|
+
.split(',')
|
|
36
|
+
.map((a) => a.trim());
|
|
37
|
+
const askForBotRating = async () => input({
|
|
38
|
+
message: 'Expected response',
|
|
39
|
+
validate: (d) => {
|
|
40
|
+
if (!d.length) {
|
|
41
|
+
return 'expected value cannot be empty';
|
|
42
|
+
}
|
|
43
|
+
return true;
|
|
44
|
+
},
|
|
45
|
+
theme,
|
|
46
|
+
});
|
|
47
|
+
const topicSequenceExpectedValue = await select({
|
|
48
|
+
message: 'Expected topic',
|
|
49
|
+
choices: [...topics, customKey],
|
|
50
|
+
theme,
|
|
51
|
+
});
|
|
52
|
+
if (topicSequenceExpectedValue === customKey) {
|
|
53
|
+
return {
|
|
54
|
+
utterance,
|
|
55
|
+
topicSequenceExpectedValue: await input({
|
|
56
|
+
message: 'Expected topic',
|
|
57
|
+
validate: (d) => {
|
|
58
|
+
if (!d.length) {
|
|
59
|
+
return 'expected value cannot be empty';
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
},
|
|
63
|
+
theme,
|
|
64
|
+
}),
|
|
65
|
+
// 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
|
|
66
|
+
actionSequenceExpectedValue: await askForOtherActions(),
|
|
67
|
+
botRatingExpectedValue: await askForBotRating(),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const genAiPluginXml = await readFile(genAiPlugins[topicSequenceExpectedValue], 'utf-8');
|
|
71
|
+
const parser = new XMLParser();
|
|
72
|
+
const parsed = parser.parse(genAiPluginXml);
|
|
73
|
+
const actions = parsed.GenAiPlugin.genAiFunctions.map((f) => f.functionName);
|
|
74
|
+
let actionSequenceExpectedValue = await checkbox({
|
|
75
|
+
message: 'Expected action(s)',
|
|
76
|
+
choices: [...actions, customKey],
|
|
77
|
+
theme,
|
|
78
|
+
required: true,
|
|
79
|
+
});
|
|
80
|
+
if (actionSequenceExpectedValue.includes(customKey)) {
|
|
81
|
+
const additional = await askForOtherActions();
|
|
82
|
+
actionSequenceExpectedValue = [...actionSequenceExpectedValue.filter((a) => a !== customKey), ...additional];
|
|
83
|
+
}
|
|
84
|
+
const botRatingExpectedValue = await askForBotRating();
|
|
85
|
+
return {
|
|
86
|
+
utterance,
|
|
87
|
+
actionSequenceExpectedValue,
|
|
88
|
+
botRatingExpectedValue,
|
|
89
|
+
topicSequenceExpectedValue,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
export function constructTestSetXML(testCases) {
|
|
93
|
+
const tab = ' ';
|
|
94
|
+
let xml = `<?xml version="1.0" encoding="UTF-8"?>\n<AiEvaluationTestSet>\n${tab}<subjectType>AGENT</subjectType>\n`;
|
|
95
|
+
testCases.forEach((testCase, i) => {
|
|
96
|
+
xml += ` <testCase>
|
|
97
|
+
<number>${i + 1}</number>
|
|
98
|
+
<inputs>
|
|
99
|
+
<utterance>${testCase.utterance}</utterance>
|
|
100
|
+
</inputs>
|
|
101
|
+
<expectations>
|
|
102
|
+
<expectation>
|
|
103
|
+
<name>topic_sequence_match</name>
|
|
104
|
+
<expectedValue>${testCase.topicSequenceExpectedValue}</expectedValue>
|
|
105
|
+
</expectation>
|
|
106
|
+
<expectation>
|
|
107
|
+
<name>action_sequence_match</name>
|
|
108
|
+
<expectedValue>${`[${testCase.actionSequenceExpectedValue.map((v) => `"${v}"`).join(',')}]`}</expectedValue>
|
|
109
|
+
</expectation>
|
|
110
|
+
<expectation>
|
|
111
|
+
<name>bot_response_rating</name>
|
|
112
|
+
<expectedValue>${testCase.botRatingExpectedValue}</expectedValue>
|
|
113
|
+
</expectation>
|
|
114
|
+
</expectations>
|
|
115
|
+
</testCase>\n`;
|
|
116
|
+
});
|
|
117
|
+
xml += '</AiEvaluationTestSet>';
|
|
118
|
+
return xml;
|
|
119
|
+
}
|
|
120
|
+
export default class AgentGenerateTestset extends SfCommand {
|
|
121
|
+
static summary = messages.getMessage('summary');
|
|
122
|
+
static description = messages.getMessage('description');
|
|
123
|
+
static examples = messages.getMessages('examples');
|
|
124
|
+
static enableJsonFlag = false;
|
|
125
|
+
static state = 'beta';
|
|
126
|
+
async run() {
|
|
127
|
+
const testSetName = await input({
|
|
128
|
+
message: 'What is the name of this set of test cases',
|
|
129
|
+
// TODO: add back validation once we refine the regex
|
|
130
|
+
// validate(d: string): boolean | string {
|
|
131
|
+
// // check against FORTY_CHAR_API_NAME_REGEX
|
|
132
|
+
// if (!FORTY_CHAR_API_NAME_REGEX.test(d)) {
|
|
133
|
+
// 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.';
|
|
134
|
+
// }
|
|
135
|
+
// return true;
|
|
136
|
+
// },
|
|
137
|
+
});
|
|
138
|
+
const genAiPluginDir = join('force-app', 'main', 'default', 'genAiPlugins');
|
|
139
|
+
const genAiPlugins = Object.fromEntries((await readDir(genAiPluginDir)).map((genAiPlugin) => [
|
|
140
|
+
genAiPlugin.replace('.genAiPlugin-meta.xml', ''),
|
|
141
|
+
join(genAiPluginDir, genAiPlugin),
|
|
142
|
+
]));
|
|
143
|
+
const testCases = [];
|
|
144
|
+
do {
|
|
145
|
+
this.log();
|
|
146
|
+
this.styledHeader(`Adding test case #${testCases.length + 1}`);
|
|
147
|
+
// eslint-disable-next-line no-await-in-loop
|
|
148
|
+
testCases.push(await promptForTestCase(genAiPlugins));
|
|
149
|
+
} while ( // eslint-disable-next-line no-await-in-loop
|
|
150
|
+
await confirm({
|
|
151
|
+
message: 'Would you like to add another test case',
|
|
152
|
+
default: true,
|
|
153
|
+
}));
|
|
154
|
+
const testSetPath = join('force-app', 'main', 'default', 'aiEvaluationTestSets', `${testSetName}.aiEvaluationTestSet-meta.xml`);
|
|
155
|
+
await mkdir(dirname(testSetPath), { recursive: true });
|
|
156
|
+
this.log();
|
|
157
|
+
this.log(`Created ${testSetPath}`);
|
|
158
|
+
await writeFile(testSetPath, constructTestSetXML(testCases));
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=test-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-set.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/test-set.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,4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EAAE,CAAC;QACX,IAAI,CAAC,GAAG,CAAC,WAAW,WAAW,EAAE,CAAC,CAAC;QACnC,MAAM,SAAS,CAAC,WAAW,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC;IAC/D,CAAC"}
|
package/lib/flags.js
CHANGED
|
@@ -14,7 +14,7 @@ export const resultFormatFlag = Flags.option({
|
|
|
14
14
|
summary: messages.getMessage('flags.result-format.summary'),
|
|
15
15
|
});
|
|
16
16
|
export const testOutputDirFlag = Flags.custom({
|
|
17
|
-
char: '
|
|
17
|
+
char: 'd',
|
|
18
18
|
description: messages.getMessage('flags.output-dir.description'),
|
|
19
19
|
summary: messages.getMessage('flags.output-dir.summary'),
|
|
20
20
|
});
|
package/lib/handleTestResults.js
CHANGED
|
@@ -21,30 +21,46 @@ export async function handleTestResults({ id, format, results, jsonEnabled, outp
|
|
|
21
21
|
const ux = new Ux({ jsonEnabled });
|
|
22
22
|
if (format === 'human') {
|
|
23
23
|
const formatted = await humanFormat(results);
|
|
24
|
-
ux.log(formatted);
|
|
25
24
|
if (outputDir) {
|
|
26
|
-
|
|
25
|
+
const file = `test-result-${id}.txt`;
|
|
26
|
+
await writeFileToDir(outputDir, file, formatted);
|
|
27
|
+
ux.log(`Created human-readable file at ${join(outputDir, file)}`);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
ux.log(formatted);
|
|
27
31
|
}
|
|
28
32
|
}
|
|
29
33
|
if (format === 'json') {
|
|
30
34
|
const formatted = await jsonFormat(results);
|
|
31
|
-
ux.log(formatted);
|
|
32
35
|
if (outputDir) {
|
|
33
|
-
|
|
36
|
+
const file = `test-result-${id}.json`;
|
|
37
|
+
await writeFileToDir(outputDir, file, formatted);
|
|
38
|
+
ux.log(`Created JSON file at ${join(outputDir, file)}`);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
ux.log(formatted);
|
|
34
42
|
}
|
|
35
43
|
}
|
|
36
44
|
if (format === 'junit') {
|
|
37
45
|
const formatted = await junitFormat(results);
|
|
38
|
-
ux.log(formatted);
|
|
39
46
|
if (outputDir) {
|
|
40
|
-
|
|
47
|
+
const file = `test-result-${id}.xml`;
|
|
48
|
+
await writeFileToDir(outputDir, file, formatted);
|
|
49
|
+
ux.log(`Created JUnit file at ${join(outputDir, file)}`);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
ux.log(formatted);
|
|
41
53
|
}
|
|
42
54
|
}
|
|
43
55
|
if (format === 'tap') {
|
|
44
56
|
const formatted = await tapFormat(results);
|
|
45
|
-
ux.log(formatted);
|
|
46
57
|
if (outputDir) {
|
|
47
|
-
|
|
58
|
+
const file = `test-result-${id}.txt`;
|
|
59
|
+
await writeFileToDir(outputDir, file, formatted);
|
|
60
|
+
ux.log(`Created TAP file at ${join(outputDir, file)}`);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
ux.log(formatted);
|
|
48
64
|
}
|
|
49
65
|
}
|
|
50
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleTestResults.js","sourceRoot":"","sources":["../src/handleTestResults.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAA4B,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/G,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAEpD,KAAK,UAAU,cAAc,CAAC,SAAiB,EAAE,QAAgB,EAAE,OAAe;IAChF,wCAAwC;IACxC,MAAM,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE5C,MAAM,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC;AAED,M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C,GAAG,CAAC,SAAS,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IAED,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QACrB,MAAM,SAAS,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC;QAC3C,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,IAAI,GAAG,eAAe,EAAE,MAAM,CAAC;YACrC,MAAM,cAAc,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;YACjD,EAAE,CAAC,GAAG,CAAC,uBAAuB,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QACzD,CAAC;aAAM,CAAC;YACN,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function readDir(path: string): Promise<string[]>;
|
package/lib/read-dir.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
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 { readdir } from 'node:fs/promises';
|
|
8
|
+
export async function readDir(path) {
|
|
9
|
+
return (await readdir(path)).filter((bot) => !bot.startsWith('.'));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=read-dir.js.map
|