@salesforce/plugin-agent 1.5.2 → 1.6.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 +57 -7
- package/lib/commands/agent/generate/definition.d.ts +9 -0
- package/lib/commands/agent/generate/definition.js +76 -0
- package/lib/commands/agent/generate/definition.js.map +1 -0
- package/lib/commands/agent/generate/spec.js +3 -6
- package/lib/commands/agent/generate/spec.js.map +1 -1
- package/lib/commands/agent/generate/testset.d.ts +17 -0
- package/lib/commands/agent/generate/testset.js +101 -0
- package/lib/commands/agent/generate/testset.js.map +1 -0
- package/lib/inquirer-theme.d.ts +5 -0
- package/lib/inquirer-theme.js +11 -0
- package/lib/inquirer-theme.js.map +1 -0
- package/messages/agent.generate.definition.md +13 -0
- package/messages/agent.generate.testset.md +11 -0
- package/npm-shrinkwrap.json +157 -7
- package/oclif.lock +36 -28
- package/oclif.manifest.json +91 -1
- package/package.json +7 -6
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 generate definition`](#sf-agent-generate-definition)
|
|
65
66
|
- [`sf agent generate spec`](#sf-agent-generate-spec)
|
|
67
|
+
- [`sf agent generate testset`](#sf-agent-generate-testset)
|
|
66
68
|
- [`sf agent preview`](#sf-agent-preview)
|
|
67
69
|
- [`sf agent test cancel`](#sf-agent-test-cancel)
|
|
68
70
|
- [`sf agent test results`](#sf-agent-test-results)
|
|
@@ -109,7 +111,32 @@ EXAMPLES
|
|
|
109
111
|
$ sf agent create --name CustomerSupportAgent --job-spec ./config/agentSpec.json --target-org my-org
|
|
110
112
|
```
|
|
111
113
|
|
|
112
|
-
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
114
|
+
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.6.0/src/commands/agent/create.ts)_
|
|
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.6.0/src/commands/agent/generate/definition.ts)_
|
|
113
140
|
|
|
114
141
|
## `sf agent generate spec`
|
|
115
142
|
|
|
@@ -170,7 +197,30 @@ EXAMPLES
|
|
|
170
197
|
$ sf agent generate spec --output-dir specs --target-org my-org
|
|
171
198
|
```
|
|
172
199
|
|
|
173
|
-
_See code: [src/commands/agent/generate/spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
200
|
+
_See code: [src/commands/agent/generate/spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.6.0/src/commands/agent/generate/spec.ts)_
|
|
201
|
+
|
|
202
|
+
## `sf agent generate testset`
|
|
203
|
+
|
|
204
|
+
Interactively generate an AiEvaluationTestSet.
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
USAGE
|
|
208
|
+
$ sf agent generate testset [--flags-dir <value>]
|
|
209
|
+
|
|
210
|
+
GLOBAL FLAGS
|
|
211
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
212
|
+
|
|
213
|
+
DESCRIPTION
|
|
214
|
+
Interactively generate an AiEvaluationTestSet.
|
|
215
|
+
|
|
216
|
+
Answer the prompts to generate an AiEvaluationTestSet that will be written to a file. You can then run "sf agent
|
|
217
|
+
generate definition" to generate the AiEvaluationDefinition that can be used to evaluate the test set.
|
|
218
|
+
|
|
219
|
+
EXAMPLES
|
|
220
|
+
$ sf agent generate testset
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
_See code: [src/commands/agent/generate/testset.ts](https://github.com/salesforcecli/plugin-agent/blob/1.6.0/src/commands/agent/generate/testset.ts)_
|
|
174
224
|
|
|
175
225
|
## `sf agent preview`
|
|
176
226
|
|
|
@@ -205,7 +255,7 @@ FLAG DESCRIPTIONS
|
|
|
205
255
|
the API name of the agent? (TBD based on agents library)
|
|
206
256
|
```
|
|
207
257
|
|
|
208
|
-
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
258
|
+
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.6.0/src/commands/agent/preview.ts)_
|
|
209
259
|
|
|
210
260
|
## `sf agent test cancel`
|
|
211
261
|
|
|
@@ -237,7 +287,7 @@ EXAMPLES
|
|
|
237
287
|
$ sf agent test cancel --job-id AiEvalId
|
|
238
288
|
```
|
|
239
289
|
|
|
240
|
-
_See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
290
|
+
_See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.6.0/src/commands/agent/test/cancel.ts)_
|
|
241
291
|
|
|
242
292
|
## `sf agent test results`
|
|
243
293
|
|
|
@@ -276,7 +326,7 @@ FLAG DESCRIPTIONS
|
|
|
276
326
|
results will not be written.
|
|
277
327
|
```
|
|
278
328
|
|
|
279
|
-
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
329
|
+
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.6.0/src/commands/agent/test/results.ts)_
|
|
280
330
|
|
|
281
331
|
## `sf agent test resume`
|
|
282
332
|
|
|
@@ -324,7 +374,7 @@ FLAG DESCRIPTIONS
|
|
|
324
374
|
If the command continues to run after the wait period, the CLI returns control of the terminal window to you.
|
|
325
375
|
```
|
|
326
376
|
|
|
327
|
-
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
377
|
+
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.6.0/src/commands/agent/test/resume.ts)_
|
|
328
378
|
|
|
329
379
|
## `sf agent test run`
|
|
330
380
|
|
|
@@ -375,6 +425,6 @@ FLAG DESCRIPTIONS
|
|
|
375
425
|
If the command continues to run after the wait period, the CLI returns control of the terminal window to you.
|
|
376
426
|
```
|
|
377
427
|
|
|
378
|
-
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
428
|
+
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.6.0/src/commands/agent/test/run.ts)_
|
|
379
429
|
|
|
380
430
|
<!-- commandsstop -->
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export default class AgentGenerateDefinition extends SfCommand<void> {
|
|
3
|
+
static readonly summary: string;
|
|
4
|
+
static readonly description: string;
|
|
5
|
+
static readonly examples: string[];
|
|
6
|
+
static readonly enableJsonFlag = false;
|
|
7
|
+
static readonly state = "beta";
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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, readdir, writeFile } from 'node:fs/promises';
|
|
9
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
10
|
+
import { Messages, SfError } from '@salesforce/core';
|
|
11
|
+
import select from '@inquirer/select';
|
|
12
|
+
import input from '@inquirer/input';
|
|
13
|
+
import { theme } from '../../../inquirer-theme.js';
|
|
14
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
15
|
+
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.generate.definition');
|
|
16
|
+
export default class AgentGenerateDefinition extends SfCommand {
|
|
17
|
+
static summary = messages.getMessage('summary');
|
|
18
|
+
static description = messages.getMessage('description');
|
|
19
|
+
static examples = messages.getMessages('examples');
|
|
20
|
+
static enableJsonFlag = false;
|
|
21
|
+
static state = 'beta';
|
|
22
|
+
async run() {
|
|
23
|
+
const testSetDir = join('force-app', 'main', 'default', 'aiEvaluationTestSets');
|
|
24
|
+
const testSets = (await readdir(testSetDir)).map((testSet) => testSet.replace('.xml', ''));
|
|
25
|
+
if (testSets.length === 0) {
|
|
26
|
+
throw new SfError(`No test sets found in ${testSetDir}`, 'NoTestSetsFoundError', [
|
|
27
|
+
'Run the "sf agent generate testset" command to create a test set',
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
const botsDir = join('force-app', 'main', 'default', 'bots');
|
|
31
|
+
const bots = await readdir(botsDir);
|
|
32
|
+
if (bots.length === 0) {
|
|
33
|
+
throw new SfError(`No bots found in ${botsDir}`, 'NoBotsFoundError');
|
|
34
|
+
}
|
|
35
|
+
const testSet = await select({
|
|
36
|
+
message: 'Select the AiEvaluationTestSet to use',
|
|
37
|
+
choices: testSets,
|
|
38
|
+
theme,
|
|
39
|
+
});
|
|
40
|
+
const bot = await select({
|
|
41
|
+
message: 'Select the Bot to run the tests against',
|
|
42
|
+
choices: bots,
|
|
43
|
+
theme,
|
|
44
|
+
});
|
|
45
|
+
const name = await input({
|
|
46
|
+
message: 'Enter a name for the AiEvaluationDefinition',
|
|
47
|
+
validate: (i) => (i.length > 0 ? true : 'Name cannot be empty'),
|
|
48
|
+
theme,
|
|
49
|
+
});
|
|
50
|
+
const description = await input({
|
|
51
|
+
message: 'Enter a description for the AiEvaluationDefinition',
|
|
52
|
+
theme,
|
|
53
|
+
});
|
|
54
|
+
const subjectType = await select({
|
|
55
|
+
message: 'Select the type for the AiEvaluationDefinition',
|
|
56
|
+
choices: ['AGENT'],
|
|
57
|
+
theme,
|
|
58
|
+
});
|
|
59
|
+
this.log(`Generating AiEvaluationDefinition for ${bot} using ${testSet} AiEvaluationTestSet`);
|
|
60
|
+
const xml = `<?xml version="1.0" encoding="UTF-8"?>
|
|
61
|
+
<AiEvaluationDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
62
|
+
${description ? `<description>${description}</description>` : ''}
|
|
63
|
+
<name>${name}</name>
|
|
64
|
+
<subjectType>${subjectType}</subjectType>
|
|
65
|
+
<subjectName>${bot}</subjectName>
|
|
66
|
+
<testSetName>${testSet}</testSetName>
|
|
67
|
+
</AiEvaluationDefinition>`;
|
|
68
|
+
// remove all empty lines
|
|
69
|
+
const cleanedXml = xml.replace(/^\s*[\r\n]/gm, '');
|
|
70
|
+
const definitionPath = join('force-app', 'main', 'default', 'aiEvaluationDefinitions', `${name}.xml`);
|
|
71
|
+
await mkdir(dirname(definitionPath), { recursive: true });
|
|
72
|
+
this.log(`Writing AiEvaluationDefinition to ${definitionPath}`);
|
|
73
|
+
await writeFile(definitionPath, cleanedXml);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/definition.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAC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AM,GAAG,GAAG;;MAEV,WAAW,CAAC,CAAC,CAAC,gBAAgB,WAAW,gBAAgB,CAAC,CAAC,CAAC,EAAE;YACxD,IAAI;mBACG,WAAW;mBACX,GAAG;mBACH,OAAO;0BACA,CAAC;QAEvB,yBAAyB;QACzB,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;QAEnD,MAAM,cAAc,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,yBAAyB,EAAE,GAAG,IAAI,MAAM,CAAC,CAAC;QACtG,MAAM,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,IAAI,CAAC,GAAG,CAAC,qCAAqC,cAAc,EAAE,CAAC,CAAC;QAChE,MAAM,SAAS,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;IAC9C,CAAC"}
|
|
@@ -13,6 +13,7 @@ import select from '@inquirer/select';
|
|
|
13
13
|
import inquirerInput from '@inquirer/input';
|
|
14
14
|
import figures from '@inquirer/figures';
|
|
15
15
|
import { Agent } from '@salesforce/agents';
|
|
16
|
+
import { theme } from '../../../inquirer-theme.js';
|
|
16
17
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
17
18
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.generate.spec');
|
|
18
19
|
const FLAGGABLE_PROMPTS = {
|
|
@@ -154,17 +155,13 @@ export default class AgentCreateSpec extends SfCommand {
|
|
|
154
155
|
return select({
|
|
155
156
|
choices: flagDef.options.map((o) => ({ name: o, value: o })),
|
|
156
157
|
message,
|
|
157
|
-
theme
|
|
158
|
-
prefix: { idle: ansis.blueBright('?') },
|
|
159
|
-
},
|
|
158
|
+
theme,
|
|
160
159
|
});
|
|
161
160
|
}
|
|
162
161
|
return inquirerInput({
|
|
163
162
|
message,
|
|
164
163
|
validate: flagDef.validate,
|
|
165
|
-
theme
|
|
166
|
-
prefix: { idle: ansis.blueBright('?') },
|
|
167
|
-
},
|
|
164
|
+
theme,
|
|
168
165
|
});
|
|
169
166
|
}
|
|
170
167
|
}
|
|
@@ -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,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,KAAK,EAA8B,MAAM,oBAAoB,CAAC;
|
|
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,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,KAAK,EAA8B,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;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AQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,KAAK;SACN,CAAC,CAAC;IACL,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
type ExpectationType = 'topic_sequence_match' | 'action_sequence_match' | 'bot_response_rating';
|
|
3
|
+
export type TestSetInputs = {
|
|
4
|
+
utterance: string;
|
|
5
|
+
expectationType: ExpectationType;
|
|
6
|
+
expectedValue: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function constructTestSetXML(testCases: TestSetInputs[]): string;
|
|
9
|
+
export default class AgentGenerateTestset extends SfCommand<void> {
|
|
10
|
+
static readonly summary: string;
|
|
11
|
+
static readonly description: string;
|
|
12
|
+
static readonly examples: string[];
|
|
13
|
+
static readonly enableJsonFlag = false;
|
|
14
|
+
static readonly state = "beta";
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
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, writeFile } from 'node:fs/promises';
|
|
9
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
10
|
+
import { Messages } from '@salesforce/core';
|
|
11
|
+
import input from '@inquirer/input';
|
|
12
|
+
import select from '@inquirer/select';
|
|
13
|
+
import confirm from '@inquirer/confirm';
|
|
14
|
+
import { theme } from '../../../inquirer-theme.js';
|
|
15
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
16
|
+
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.generate.testset');
|
|
17
|
+
async function promptForTestCase() {
|
|
18
|
+
const utterance = await input({
|
|
19
|
+
message: 'What utterance would you like to test?',
|
|
20
|
+
validate: (d) => d.length > 0 || 'utterance cannot be empty',
|
|
21
|
+
theme,
|
|
22
|
+
});
|
|
23
|
+
const expectationType = await select({
|
|
24
|
+
message: 'What type of expectation would you like to test for the utterance?',
|
|
25
|
+
choices: ['topic_sequence_match', 'action_sequence_match', 'bot_response_rating'],
|
|
26
|
+
theme,
|
|
27
|
+
});
|
|
28
|
+
const expectedValue = await input({
|
|
29
|
+
message: 'What is the expected value for the expectation?',
|
|
30
|
+
validate: (d) => {
|
|
31
|
+
if (!d.length) {
|
|
32
|
+
return 'expected value cannot be empty';
|
|
33
|
+
}
|
|
34
|
+
if (expectationType === 'action_sequence_match') {
|
|
35
|
+
return d.split(',').length > 1 || 'expected value must be a comma-separated list of actions';
|
|
36
|
+
}
|
|
37
|
+
return true;
|
|
38
|
+
},
|
|
39
|
+
theme,
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
utterance,
|
|
43
|
+
expectationType,
|
|
44
|
+
expectedValue,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export function constructTestSetXML(testCases) {
|
|
48
|
+
const tab = ' ';
|
|
49
|
+
let xml = `<?xml version="1.0" encoding="UTF-8"?>\n<AiEvaluationTestSet>\n${tab}<subjectType>AGENT</subjectType>\n`;
|
|
50
|
+
testCases.forEach((testCase, i) => {
|
|
51
|
+
const expectedValue = testCase.expectationType === 'action_sequence_match'
|
|
52
|
+
? `[${testCase.expectedValue
|
|
53
|
+
.split(',')
|
|
54
|
+
.map((v) => `"${v}"`)
|
|
55
|
+
.join(',')}]`
|
|
56
|
+
: testCase.expectedValue;
|
|
57
|
+
xml += ` <testCase>
|
|
58
|
+
<number>${i + 1}</number>
|
|
59
|
+
<inputs>
|
|
60
|
+
<utterance>${testCase.utterance}</utterance>
|
|
61
|
+
</inputs>
|
|
62
|
+
<expectations>
|
|
63
|
+
<expectation>
|
|
64
|
+
<name>${testCase.expectationType}</name>
|
|
65
|
+
<expectedValue>${expectedValue}</expectedValue>
|
|
66
|
+
</expectation>
|
|
67
|
+
</expectations>
|
|
68
|
+
</testCase>\n`;
|
|
69
|
+
});
|
|
70
|
+
xml += '</AiEvaluationTestSet>';
|
|
71
|
+
return xml;
|
|
72
|
+
}
|
|
73
|
+
export default class AgentGenerateTestset extends SfCommand {
|
|
74
|
+
static summary = messages.getMessage('summary');
|
|
75
|
+
static description = messages.getMessage('description');
|
|
76
|
+
static examples = messages.getMessages('examples');
|
|
77
|
+
static enableJsonFlag = false;
|
|
78
|
+
static state = 'beta';
|
|
79
|
+
async run() {
|
|
80
|
+
const testSetName = await input({
|
|
81
|
+
message: 'What is the name of the test set?',
|
|
82
|
+
});
|
|
83
|
+
const testCases = [];
|
|
84
|
+
do {
|
|
85
|
+
this.log();
|
|
86
|
+
this.styledHeader(`Adding test case #${testCases.length + 1}`);
|
|
87
|
+
// eslint-disable-next-line no-await-in-loop
|
|
88
|
+
testCases.push(await promptForTestCase());
|
|
89
|
+
} while ( // eslint-disable-next-line no-await-in-loop
|
|
90
|
+
await confirm({
|
|
91
|
+
message: 'Would you like to add another test case?',
|
|
92
|
+
default: true,
|
|
93
|
+
}));
|
|
94
|
+
const testSetPath = join('force-app', 'main', 'default', 'aiEvaluationTestsets', `${testSetName}.xml`);
|
|
95
|
+
await mkdir(dirname(testSetPath), { recursive: true });
|
|
96
|
+
this.log();
|
|
97
|
+
this.log(`Writing new AiEvaluationTestSet to ${testSetPath}`);
|
|
98
|
+
await writeFile(testSetPath, constructTestSetXML(testCases));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=testset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testset.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/testset.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,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M,KAAK,CAAC;YAC9B,OAAO,EAAE,mCAAmC;SAC7C,CAAC,CAAC;QACH,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,EAAE,CAAC,CAAC;QAC5C,CAAC,SAAS,4CAA4C;QACpD,MAAM,OAAO,CAAC;YACZ,OAAO,EAAE,0CAA0C;YACnD,OAAO,EAAE,IAAI;SACd,CAAC,EACF;QAEF,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,sBAAsB,EAAE,GAAG,WAAW,MAAM,CAAC,CAAC;QACvG,MAAM,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACvD,IAAI,CAAC,GAAG,EAAE,CAAC;QACX,IAAI,CAAC,GAAG,CAAC,sCAAsC,WAAW,EAAE,CAAC,CAAC;QAC9D,MAAM,SAAS,CAAC,WAAW,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC;IAC/D,CAAC"}
|
|
@@ -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 ansis from 'ansis';
|
|
8
|
+
export const theme = {
|
|
9
|
+
prefix: { idle: ansis.blueBright('?') },
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=inquirer-theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inquirer-theme.js","sourceRoot":"","sources":["../src/inquirer-theme.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;CACxC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Interactively generate a new AiEvaluationDefinition.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
This command will prompt you for the necessary information to create a new AiEvaluationDefinition. The definition will be saved to the `aiEvaluationDefinitions` directory in the project.
|
|
8
|
+
|
|
9
|
+
You must have the `Bots` and `AiEvaluationTestSets` metadata types present in your project to use this command.
|
|
10
|
+
|
|
11
|
+
# examples
|
|
12
|
+
|
|
13
|
+
- <%= config.bin %> <%= command.id %>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Interactively generate an AiEvaluationTestSet.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Answer the prompts to generate an AiEvaluationTestSet that will be written to a file. You can then run "sf agent generate definition" to generate the AiEvaluationDefinition that can be used to evaluate the test set.
|
|
8
|
+
|
|
9
|
+
# examples
|
|
10
|
+
|
|
11
|
+
- <%= config.bin %> <%= command.id %>
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-agent",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@salesforce/plugin-agent",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.6.0",
|
|
10
10
|
"license": "BSD-3-Clause",
|
|
11
11
|
"dependencies": {
|
|
12
|
+
"@inquirer/confirm": "^5.1.0",
|
|
12
13
|
"@inquirer/figures": "^1.0.7",
|
|
13
14
|
"@inquirer/input": "^4.0.1",
|
|
14
15
|
"@inquirer/select": "^4.0.1",
|
|
@@ -2140,18 +2141,112 @@
|
|
|
2140
2141
|
"license": "BSD-3-Clause"
|
|
2141
2142
|
},
|
|
2142
2143
|
"node_modules/@inquirer/confirm": {
|
|
2143
|
-
"version": "
|
|
2144
|
-
"resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-
|
|
2145
|
-
"integrity": "sha512-
|
|
2144
|
+
"version": "5.1.0",
|
|
2145
|
+
"resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.1.0.tgz",
|
|
2146
|
+
"integrity": "sha512-osaBbIMEqVFjTX5exoqPXs6PilWQdjaLhGtMDXMXg/yxkHXNq43GlxGyTA35lK2HpzUgDN+Cjh/2AmqCN0QJpw==",
|
|
2146
2147
|
"license": "MIT",
|
|
2147
2148
|
"dependencies": {
|
|
2148
|
-
"@inquirer/core": "^
|
|
2149
|
-
"@inquirer/type": "^
|
|
2149
|
+
"@inquirer/core": "^10.1.1",
|
|
2150
|
+
"@inquirer/type": "^3.0.1"
|
|
2151
|
+
},
|
|
2152
|
+
"engines": {
|
|
2153
|
+
"node": ">=18"
|
|
2154
|
+
},
|
|
2155
|
+
"peerDependencies": {
|
|
2156
|
+
"@types/node": ">=18"
|
|
2157
|
+
}
|
|
2158
|
+
},
|
|
2159
|
+
"node_modules/@inquirer/confirm/node_modules/@inquirer/core": {
|
|
2160
|
+
"version": "10.1.1",
|
|
2161
|
+
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.1.tgz",
|
|
2162
|
+
"integrity": "sha512-rmZVXy9iZvO3ZStEe/ayuuwIJ23LSF13aPMlLMTQARX6lGUBDHGV8UB5i9MRrfy0+mZwt5/9bdy8llszSD3NQA==",
|
|
2163
|
+
"license": "MIT",
|
|
2164
|
+
"dependencies": {
|
|
2165
|
+
"@inquirer/figures": "^1.0.8",
|
|
2166
|
+
"@inquirer/type": "^3.0.1",
|
|
2167
|
+
"ansi-escapes": "^4.3.2",
|
|
2168
|
+
"cli-width": "^4.1.0",
|
|
2169
|
+
"mute-stream": "^2.0.0",
|
|
2170
|
+
"signal-exit": "^4.1.0",
|
|
2171
|
+
"strip-ansi": "^6.0.1",
|
|
2172
|
+
"wrap-ansi": "^6.2.0",
|
|
2173
|
+
"yoctocolors-cjs": "^2.1.2"
|
|
2150
2174
|
},
|
|
2151
2175
|
"engines": {
|
|
2152
2176
|
"node": ">=18"
|
|
2153
2177
|
}
|
|
2154
2178
|
},
|
|
2179
|
+
"node_modules/@inquirer/confirm/node_modules/@inquirer/figures": {
|
|
2180
|
+
"version": "1.0.8",
|
|
2181
|
+
"resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.8.tgz",
|
|
2182
|
+
"integrity": "sha512-tKd+jsmhq21AP1LhexC0pPwsCxEhGgAkg28byjJAd+xhmIs8LUX8JbUc3vBf3PhLxWiB5EvyBE5X7JSPAqMAqg==",
|
|
2183
|
+
"license": "MIT",
|
|
2184
|
+
"engines": {
|
|
2185
|
+
"node": ">=18"
|
|
2186
|
+
}
|
|
2187
|
+
},
|
|
2188
|
+
"node_modules/@inquirer/confirm/node_modules/@inquirer/type": {
|
|
2189
|
+
"version": "3.0.1",
|
|
2190
|
+
"resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.1.tgz",
|
|
2191
|
+
"integrity": "sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==",
|
|
2192
|
+
"license": "MIT",
|
|
2193
|
+
"engines": {
|
|
2194
|
+
"node": ">=18"
|
|
2195
|
+
},
|
|
2196
|
+
"peerDependencies": {
|
|
2197
|
+
"@types/node": ">=18"
|
|
2198
|
+
}
|
|
2199
|
+
},
|
|
2200
|
+
"node_modules/@inquirer/confirm/node_modules/ansi-styles": {
|
|
2201
|
+
"version": "4.3.0",
|
|
2202
|
+
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
|
2203
|
+
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
|
2204
|
+
"license": "MIT",
|
|
2205
|
+
"dependencies": {
|
|
2206
|
+
"color-convert": "^2.0.1"
|
|
2207
|
+
},
|
|
2208
|
+
"engines": {
|
|
2209
|
+
"node": ">=8"
|
|
2210
|
+
},
|
|
2211
|
+
"funding": {
|
|
2212
|
+
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
|
2213
|
+
}
|
|
2214
|
+
},
|
|
2215
|
+
"node_modules/@inquirer/confirm/node_modules/mute-stream": {
|
|
2216
|
+
"version": "2.0.0",
|
|
2217
|
+
"resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-2.0.0.tgz",
|
|
2218
|
+
"integrity": "sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==",
|
|
2219
|
+
"license": "ISC",
|
|
2220
|
+
"engines": {
|
|
2221
|
+
"node": "^18.17.0 || >=20.5.0"
|
|
2222
|
+
}
|
|
2223
|
+
},
|
|
2224
|
+
"node_modules/@inquirer/confirm/node_modules/signal-exit": {
|
|
2225
|
+
"version": "4.1.0",
|
|
2226
|
+
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
|
|
2227
|
+
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
|
|
2228
|
+
"license": "ISC",
|
|
2229
|
+
"engines": {
|
|
2230
|
+
"node": ">=14"
|
|
2231
|
+
},
|
|
2232
|
+
"funding": {
|
|
2233
|
+
"url": "https://github.com/sponsors/isaacs"
|
|
2234
|
+
}
|
|
2235
|
+
},
|
|
2236
|
+
"node_modules/@inquirer/confirm/node_modules/wrap-ansi": {
|
|
2237
|
+
"version": "6.2.0",
|
|
2238
|
+
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
|
|
2239
|
+
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
|
|
2240
|
+
"license": "MIT",
|
|
2241
|
+
"dependencies": {
|
|
2242
|
+
"ansi-styles": "^4.0.0",
|
|
2243
|
+
"string-width": "^4.1.0",
|
|
2244
|
+
"strip-ansi": "^6.0.0"
|
|
2245
|
+
},
|
|
2246
|
+
"engines": {
|
|
2247
|
+
"node": ">=8"
|
|
2248
|
+
}
|
|
2249
|
+
},
|
|
2155
2250
|
"node_modules/@inquirer/core": {
|
|
2156
2251
|
"version": "9.1.0",
|
|
2157
2252
|
"resolved": "https://registry.npmjs.org/@inquirer/core/-/core-9.1.0.tgz",
|
|
@@ -2944,6 +3039,20 @@
|
|
|
2944
3039
|
"node": ">=18.0.0"
|
|
2945
3040
|
}
|
|
2946
3041
|
},
|
|
3042
|
+
"node_modules/@oclif/plugin-not-found/node_modules/@inquirer/confirm": {
|
|
3043
|
+
"version": "3.2.0",
|
|
3044
|
+
"resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-3.2.0.tgz",
|
|
3045
|
+
"integrity": "sha512-oOIwPs0Dvq5220Z8lGL/6LHRTEr9TgLHmiI99Rj1PJ1p1czTys+olrgBqZk4E2qC0YTzeHprxSQmoHioVdJ7Lw==",
|
|
3046
|
+
"dev": true,
|
|
3047
|
+
"license": "MIT",
|
|
3048
|
+
"dependencies": {
|
|
3049
|
+
"@inquirer/core": "^9.1.0",
|
|
3050
|
+
"@inquirer/type": "^1.5.3"
|
|
3051
|
+
},
|
|
3052
|
+
"engines": {
|
|
3053
|
+
"node": ">=18"
|
|
3054
|
+
}
|
|
3055
|
+
},
|
|
2947
3056
|
"node_modules/@oclif/plugin-warn-if-update-available": {
|
|
2948
3057
|
"version": "3.1.11",
|
|
2949
3058
|
"resolved": "https://registry.npmjs.org/@oclif/plugin-warn-if-update-available/-/plugin-warn-if-update-available-3.1.11.tgz",
|
|
@@ -3508,6 +3617,20 @@
|
|
|
3508
3617
|
"node": ">=18.0.0"
|
|
3509
3618
|
}
|
|
3510
3619
|
},
|
|
3620
|
+
"node_modules/@salesforce/plugin-command-reference/node_modules/@inquirer/confirm": {
|
|
3621
|
+
"version": "3.2.0",
|
|
3622
|
+
"resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-3.2.0.tgz",
|
|
3623
|
+
"integrity": "sha512-oOIwPs0Dvq5220Z8lGL/6LHRTEr9TgLHmiI99Rj1PJ1p1czTys+olrgBqZk4E2qC0YTzeHprxSQmoHioVdJ7Lw==",
|
|
3624
|
+
"dev": true,
|
|
3625
|
+
"license": "MIT",
|
|
3626
|
+
"dependencies": {
|
|
3627
|
+
"@inquirer/core": "^9.1.0",
|
|
3628
|
+
"@inquirer/type": "^1.5.3"
|
|
3629
|
+
},
|
|
3630
|
+
"engines": {
|
|
3631
|
+
"node": ">=18"
|
|
3632
|
+
}
|
|
3633
|
+
},
|
|
3511
3634
|
"node_modules/@salesforce/plugin-command-reference/node_modules/@salesforce/sf-plugins-core": {
|
|
3512
3635
|
"version": "11.3.12",
|
|
3513
3636
|
"resolved": "https://registry.npmjs.org/@salesforce/sf-plugins-core/-/sf-plugins-core-11.3.12.tgz",
|
|
@@ -3633,6 +3756,19 @@
|
|
|
3633
3756
|
"node": ">=18.0.0"
|
|
3634
3757
|
}
|
|
3635
3758
|
},
|
|
3759
|
+
"node_modules/@salesforce/sf-plugins-core/node_modules/@inquirer/confirm": {
|
|
3760
|
+
"version": "3.2.0",
|
|
3761
|
+
"resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-3.2.0.tgz",
|
|
3762
|
+
"integrity": "sha512-oOIwPs0Dvq5220Z8lGL/6LHRTEr9TgLHmiI99Rj1PJ1p1czTys+olrgBqZk4E2qC0YTzeHprxSQmoHioVdJ7Lw==",
|
|
3763
|
+
"license": "MIT",
|
|
3764
|
+
"dependencies": {
|
|
3765
|
+
"@inquirer/core": "^9.1.0",
|
|
3766
|
+
"@inquirer/type": "^1.5.3"
|
|
3767
|
+
},
|
|
3768
|
+
"engines": {
|
|
3769
|
+
"node": ">=18"
|
|
3770
|
+
}
|
|
3771
|
+
},
|
|
3636
3772
|
"node_modules/@salesforce/source-deploy-retrieve": {
|
|
3637
3773
|
"version": "12.10.2",
|
|
3638
3774
|
"resolved": "https://registry.npmjs.org/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-12.10.2.tgz",
|
|
@@ -16138,6 +16274,20 @@
|
|
|
16138
16274
|
"node": ">=18.0.0"
|
|
16139
16275
|
}
|
|
16140
16276
|
},
|
|
16277
|
+
"node_modules/oclif/node_modules/@inquirer/confirm": {
|
|
16278
|
+
"version": "3.2.0",
|
|
16279
|
+
"resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-3.2.0.tgz",
|
|
16280
|
+
"integrity": "sha512-oOIwPs0Dvq5220Z8lGL/6LHRTEr9TgLHmiI99Rj1PJ1p1czTys+olrgBqZk4E2qC0YTzeHprxSQmoHioVdJ7Lw==",
|
|
16281
|
+
"dev": true,
|
|
16282
|
+
"license": "MIT",
|
|
16283
|
+
"dependencies": {
|
|
16284
|
+
"@inquirer/core": "^9.1.0",
|
|
16285
|
+
"@inquirer/type": "^1.5.3"
|
|
16286
|
+
},
|
|
16287
|
+
"engines": {
|
|
16288
|
+
"node": ">=18"
|
|
16289
|
+
}
|
|
16290
|
+
},
|
|
16141
16291
|
"node_modules/oclif/node_modules/@inquirer/input": {
|
|
16142
16292
|
"version": "2.2.7",
|
|
16143
16293
|
"resolved": "https://registry.npmjs.org/@inquirer/input/-/input-2.2.7.tgz",
|
package/oclif.lock
CHANGED
|
@@ -1061,6 +1061,14 @@
|
|
|
1061
1061
|
"@inquirer/core" "^9.1.0"
|
|
1062
1062
|
"@inquirer/type" "^1.5.3"
|
|
1063
1063
|
|
|
1064
|
+
"@inquirer/confirm@^5.1.0":
|
|
1065
|
+
version "5.1.0"
|
|
1066
|
+
resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-5.1.0.tgz#061cd0790c8debe092353589a501211b0d6c53ef"
|
|
1067
|
+
integrity sha512-osaBbIMEqVFjTX5exoqPXs6PilWQdjaLhGtMDXMXg/yxkHXNq43GlxGyTA35lK2HpzUgDN+Cjh/2AmqCN0QJpw==
|
|
1068
|
+
dependencies:
|
|
1069
|
+
"@inquirer/core" "^10.1.1"
|
|
1070
|
+
"@inquirer/type" "^3.0.1"
|
|
1071
|
+
|
|
1064
1072
|
"@inquirer/core@^10.0.1":
|
|
1065
1073
|
version "10.0.1"
|
|
1066
1074
|
resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-10.0.1.tgz#22068da87d8f6317452172dfd521e811ccbcb90e"
|
|
@@ -1076,6 +1084,21 @@
|
|
|
1076
1084
|
wrap-ansi "^6.2.0"
|
|
1077
1085
|
yoctocolors-cjs "^2.1.2"
|
|
1078
1086
|
|
|
1087
|
+
"@inquirer/core@^10.1.1":
|
|
1088
|
+
version "10.1.1"
|
|
1089
|
+
resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-10.1.1.tgz#801e82649fb64bcb2b5e4667397ff8c25bccebab"
|
|
1090
|
+
integrity sha512-rmZVXy9iZvO3ZStEe/ayuuwIJ23LSF13aPMlLMTQARX6lGUBDHGV8UB5i9MRrfy0+mZwt5/9bdy8llszSD3NQA==
|
|
1091
|
+
dependencies:
|
|
1092
|
+
"@inquirer/figures" "^1.0.8"
|
|
1093
|
+
"@inquirer/type" "^3.0.1"
|
|
1094
|
+
ansi-escapes "^4.3.2"
|
|
1095
|
+
cli-width "^4.1.0"
|
|
1096
|
+
mute-stream "^2.0.0"
|
|
1097
|
+
signal-exit "^4.1.0"
|
|
1098
|
+
strip-ansi "^6.0.1"
|
|
1099
|
+
wrap-ansi "^6.2.0"
|
|
1100
|
+
yoctocolors-cjs "^2.1.2"
|
|
1101
|
+
|
|
1079
1102
|
"@inquirer/core@^9.0.8", "@inquirer/core@^9.1.0":
|
|
1080
1103
|
version "9.1.0"
|
|
1081
1104
|
resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-9.1.0.tgz#158b82dc44564a1abd0ce14723d50c3efa0634a2"
|
|
@@ -1100,6 +1123,11 @@
|
|
|
1100
1123
|
resolved "https://registry.yarnpkg.com/@inquirer/figures/-/figures-1.0.7.tgz#d050ccc0eabfacc0248c4ff647a9dfba1b01594b"
|
|
1101
1124
|
integrity sha512-m+Trk77mp54Zma6xLkLuY+mvanPxlE4A7yNKs2HBiyZ4UkVs28Mv5c/pgWrHeInx+USHeX/WEPzjrWrcJiQgjw==
|
|
1102
1125
|
|
|
1126
|
+
"@inquirer/figures@^1.0.8":
|
|
1127
|
+
version "1.0.8"
|
|
1128
|
+
resolved "https://registry.yarnpkg.com/@inquirer/figures/-/figures-1.0.8.tgz#d9e414a1376a331a0e71b151fea27c48845788b0"
|
|
1129
|
+
integrity sha512-tKd+jsmhq21AP1LhexC0pPwsCxEhGgAkg28byjJAd+xhmIs8LUX8JbUc3vBf3PhLxWiB5EvyBE5X7JSPAqMAqg==
|
|
1130
|
+
|
|
1103
1131
|
"@inquirer/input@^2.2.4":
|
|
1104
1132
|
version "2.2.7"
|
|
1105
1133
|
resolved "https://registry.yarnpkg.com/@inquirer/input/-/input-2.2.7.tgz#87a922243a6c833ee5f1d4a6102c68b3cee9f19d"
|
|
@@ -1159,6 +1187,11 @@
|
|
|
1159
1187
|
resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-3.0.0.tgz#1762ebe667ec1d838012b20bf0cf90b841ba68bc"
|
|
1160
1188
|
integrity sha512-YYykfbw/lefC7yKj7nanzQXILM7r3suIvyFlCcMskc99axmsSewXWkAfXKwMbgxL76iAFVmRwmYdwNZNc8gjog==
|
|
1161
1189
|
|
|
1190
|
+
"@inquirer/type@^3.0.1":
|
|
1191
|
+
version "3.0.1"
|
|
1192
|
+
resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-3.0.1.tgz#619ce9f65c3e114d8e39c41822bed3440d20b478"
|
|
1193
|
+
integrity sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==
|
|
1194
|
+
|
|
1162
1195
|
"@isaacs/cliui@^8.0.2":
|
|
1163
1196
|
version "8.0.2"
|
|
1164
1197
|
resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550"
|
|
@@ -7741,16 +7774,7 @@ stack-utils@^2.0.6:
|
|
|
7741
7774
|
dependencies:
|
|
7742
7775
|
escape-string-regexp "^2.0.0"
|
|
7743
7776
|
|
|
7744
|
-
"string-width-cjs@npm:string-width@^4.2.0":
|
|
7745
|
-
version "4.2.3"
|
|
7746
|
-
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
|
7747
|
-
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
|
7748
|
-
dependencies:
|
|
7749
|
-
emoji-regex "^8.0.0"
|
|
7750
|
-
is-fullwidth-code-point "^3.0.0"
|
|
7751
|
-
strip-ansi "^6.0.1"
|
|
7752
|
-
|
|
7753
|
-
string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
|
|
7777
|
+
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
|
|
7754
7778
|
version "4.2.3"
|
|
7755
7779
|
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
|
7756
7780
|
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
|
@@ -7872,14 +7896,7 @@ string_decoder@~1.1.1:
|
|
|
7872
7896
|
dependencies:
|
|
7873
7897
|
safe-buffer "~5.1.0"
|
|
7874
7898
|
|
|
7875
|
-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
|
|
7876
|
-
version "6.0.1"
|
|
7877
|
-
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
|
7878
|
-
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
|
7879
|
-
dependencies:
|
|
7880
|
-
ansi-regex "^5.0.1"
|
|
7881
|
-
|
|
7882
|
-
strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
|
7899
|
+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
|
7883
7900
|
version "6.0.1"
|
|
7884
7901
|
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
|
7885
7902
|
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
|
@@ -8546,7 +8563,7 @@ workerpool@^6.5.1:
|
|
|
8546
8563
|
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544"
|
|
8547
8564
|
integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==
|
|
8548
8565
|
|
|
8549
|
-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
|
|
8566
|
+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
|
|
8550
8567
|
version "7.0.0"
|
|
8551
8568
|
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
|
8552
8569
|
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
|
@@ -8564,15 +8581,6 @@ wrap-ansi@^6.2.0:
|
|
|
8564
8581
|
string-width "^4.1.0"
|
|
8565
8582
|
strip-ansi "^6.0.0"
|
|
8566
8583
|
|
|
8567
|
-
wrap-ansi@^7.0.0:
|
|
8568
|
-
version "7.0.0"
|
|
8569
|
-
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
|
8570
|
-
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
|
8571
|
-
dependencies:
|
|
8572
|
-
ansi-styles "^4.0.0"
|
|
8573
|
-
string-width "^4.1.0"
|
|
8574
|
-
strip-ansi "^6.0.0"
|
|
8575
|
-
|
|
8576
8584
|
wrap-ansi@^8.1.0:
|
|
8577
8585
|
version "8.1.0"
|
|
8578
8586
|
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
|
package/oclif.manifest.json
CHANGED
|
@@ -151,6 +151,51 @@
|
|
|
151
151
|
"preview:agent"
|
|
152
152
|
]
|
|
153
153
|
},
|
|
154
|
+
"agent:generate:definition": {
|
|
155
|
+
"aliases": [],
|
|
156
|
+
"args": {},
|
|
157
|
+
"description": "This command will prompt you for the necessary information to create a new AiEvaluationDefinition. The definition will be saved to the `aiEvaluationDefinitions` directory in the project.\n\nYou must have the `Bots` and `AiEvaluationTestSets` metadata types present in your project to use this command.",
|
|
158
|
+
"examples": [
|
|
159
|
+
"<%= config.bin %> <%= command.id %>"
|
|
160
|
+
],
|
|
161
|
+
"flags": {
|
|
162
|
+
"flags-dir": {
|
|
163
|
+
"helpGroup": "GLOBAL",
|
|
164
|
+
"name": "flags-dir",
|
|
165
|
+
"summary": "Import flag values from a directory.",
|
|
166
|
+
"hasDynamicHelp": false,
|
|
167
|
+
"multiple": false,
|
|
168
|
+
"type": "option"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"hasDynamicHelp": false,
|
|
172
|
+
"hiddenAliases": [],
|
|
173
|
+
"id": "agent:generate:definition",
|
|
174
|
+
"pluginAlias": "@salesforce/plugin-agent",
|
|
175
|
+
"pluginName": "@salesforce/plugin-agent",
|
|
176
|
+
"pluginType": "core",
|
|
177
|
+
"state": "beta",
|
|
178
|
+
"strict": true,
|
|
179
|
+
"summary": "Interactively generate a new AiEvaluationDefinition.",
|
|
180
|
+
"enableJsonFlag": false,
|
|
181
|
+
"isESM": true,
|
|
182
|
+
"relativePath": [
|
|
183
|
+
"lib",
|
|
184
|
+
"commands",
|
|
185
|
+
"agent",
|
|
186
|
+
"generate",
|
|
187
|
+
"definition.js"
|
|
188
|
+
],
|
|
189
|
+
"aliasPermutations": [],
|
|
190
|
+
"permutations": [
|
|
191
|
+
"agent:generate:definition",
|
|
192
|
+
"generate:agent:definition",
|
|
193
|
+
"generate:definition:agent",
|
|
194
|
+
"agent:definition:generate",
|
|
195
|
+
"definition:agent:generate",
|
|
196
|
+
"definition:generate:agent"
|
|
197
|
+
]
|
|
198
|
+
},
|
|
154
199
|
"agent:generate:spec": {
|
|
155
200
|
"aliases": [],
|
|
156
201
|
"args": {},
|
|
@@ -280,6 +325,51 @@
|
|
|
280
325
|
"spec:generate:agent"
|
|
281
326
|
]
|
|
282
327
|
},
|
|
328
|
+
"agent:generate:testset": {
|
|
329
|
+
"aliases": [],
|
|
330
|
+
"args": {},
|
|
331
|
+
"description": "Answer the prompts to generate an AiEvaluationTestSet that will be written to a file. You can then run \"sf agent generate definition\" to generate the AiEvaluationDefinition that can be used to evaluate the test set.",
|
|
332
|
+
"examples": [
|
|
333
|
+
"<%= config.bin %> <%= command.id %>"
|
|
334
|
+
],
|
|
335
|
+
"flags": {
|
|
336
|
+
"flags-dir": {
|
|
337
|
+
"helpGroup": "GLOBAL",
|
|
338
|
+
"name": "flags-dir",
|
|
339
|
+
"summary": "Import flag values from a directory.",
|
|
340
|
+
"hasDynamicHelp": false,
|
|
341
|
+
"multiple": false,
|
|
342
|
+
"type": "option"
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
"hasDynamicHelp": false,
|
|
346
|
+
"hiddenAliases": [],
|
|
347
|
+
"id": "agent:generate:testset",
|
|
348
|
+
"pluginAlias": "@salesforce/plugin-agent",
|
|
349
|
+
"pluginName": "@salesforce/plugin-agent",
|
|
350
|
+
"pluginType": "core",
|
|
351
|
+
"state": "beta",
|
|
352
|
+
"strict": true,
|
|
353
|
+
"summary": "Interactively generate an AiEvaluationTestSet.",
|
|
354
|
+
"enableJsonFlag": false,
|
|
355
|
+
"isESM": true,
|
|
356
|
+
"relativePath": [
|
|
357
|
+
"lib",
|
|
358
|
+
"commands",
|
|
359
|
+
"agent",
|
|
360
|
+
"generate",
|
|
361
|
+
"testset.js"
|
|
362
|
+
],
|
|
363
|
+
"aliasPermutations": [],
|
|
364
|
+
"permutations": [
|
|
365
|
+
"agent:generate:testset",
|
|
366
|
+
"generate:agent:testset",
|
|
367
|
+
"generate:testset:agent",
|
|
368
|
+
"agent:testset:generate",
|
|
369
|
+
"testset:agent:generate",
|
|
370
|
+
"testset:generate:agent"
|
|
371
|
+
]
|
|
372
|
+
},
|
|
283
373
|
"agent:test:cancel": {
|
|
284
374
|
"aliases": [],
|
|
285
375
|
"args": {},
|
|
@@ -691,5 +781,5 @@
|
|
|
691
781
|
]
|
|
692
782
|
}
|
|
693
783
|
},
|
|
694
|
-
"version": "1.
|
|
784
|
+
"version": "1.6.0"
|
|
695
785
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-agent",
|
|
3
3
|
"description": "Commands to interact with Salesforce agents",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.6.0",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
+
"@inquirer/confirm": "^5.1.0",
|
|
8
9
|
"@inquirer/figures": "^1.0.7",
|
|
9
10
|
"@inquirer/input": "^4.0.1",
|
|
10
11
|
"@inquirer/select": "^4.0.1",
|
|
@@ -15,8 +16,8 @@
|
|
|
15
16
|
"@salesforce/kit": "^3.2.1",
|
|
16
17
|
"@salesforce/sf-plugins-core": "^12.1.0",
|
|
17
18
|
"ansis": "^3.3.2",
|
|
18
|
-
"ink-text-input": "^6.0.0",
|
|
19
19
|
"ink": "^5.0.1",
|
|
20
|
+
"ink-text-input": "^6.0.0",
|
|
20
21
|
"react": "^18.3.1"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
@@ -26,10 +27,10 @@
|
|
|
26
27
|
"@salesforce/dev-scripts": "^10.2.10",
|
|
27
28
|
"@salesforce/plugin-command-reference": "^3.1.29",
|
|
28
29
|
"@types/react": "^18.3.3",
|
|
29
|
-
"eslint-config-xo-react": "^0.27.0",
|
|
30
30
|
"eslint-config-xo": "^0.45.0",
|
|
31
|
-
"eslint-
|
|
31
|
+
"eslint-config-xo-react": "^0.27.0",
|
|
32
32
|
"eslint-plugin-react": "^7.34.3",
|
|
33
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
33
34
|
"eslint-plugin-sf-plugin": "^1.20.9",
|
|
34
35
|
"oclif": "^4.15.12",
|
|
35
36
|
"ts-node": "^10.9.2",
|
|
@@ -221,7 +222,7 @@
|
|
|
221
222
|
"exports": "./lib/index.js",
|
|
222
223
|
"type": "module",
|
|
223
224
|
"sfdx": {
|
|
224
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.
|
|
225
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.
|
|
225
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.6.0.crt",
|
|
226
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.6.0.sig"
|
|
226
227
|
}
|
|
227
228
|
}
|