@salesforce/plugin-agent 1.19.3 → 1.19.4
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 +10 -10
- package/lib/commands/agent/test/run.js +14 -2
- package/lib/commands/agent/test/run.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +3 -3
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.19.
|
|
135
|
+
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.4/src/commands/agent/create.ts)_
|
|
136
136
|
|
|
137
137
|
## `sf agent generate agent-spec`
|
|
138
138
|
|
|
@@ -237,7 +237,7 @@ EXAMPLES
|
|
|
237
237
|
$ sf agent generate agent-spec --tone formal --agent-user resortmanager@myorg.com
|
|
238
238
|
```
|
|
239
239
|
|
|
240
|
-
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.
|
|
240
|
+
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.4/src/commands/agent/generate/agent-spec.ts)_
|
|
241
241
|
|
|
242
242
|
## `sf agent generate template`
|
|
243
243
|
|
|
@@ -285,7 +285,7 @@ EXAMPLES
|
|
|
285
285
|
force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1
|
|
286
286
|
```
|
|
287
287
|
|
|
288
|
-
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.
|
|
288
|
+
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.4/src/commands/agent/generate/template.ts)_
|
|
289
289
|
|
|
290
290
|
## `sf agent generate test-spec`
|
|
291
291
|
|
|
@@ -343,7 +343,7 @@ EXAMPLES
|
|
|
343
343
|
force-app//main/default/aiEvaluationDefinitions/Resort_Manager_Tests.aiEvaluationDefinition-meta.xml
|
|
344
344
|
```
|
|
345
345
|
|
|
346
|
-
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.
|
|
346
|
+
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.4/src/commands/agent/generate/test-spec.ts)_
|
|
347
347
|
|
|
348
348
|
## `sf agent preview`
|
|
349
349
|
|
|
@@ -378,7 +378,7 @@ FLAG DESCRIPTIONS
|
|
|
378
378
|
the API name of the agent? (TBD based on agents library)
|
|
379
379
|
```
|
|
380
380
|
|
|
381
|
-
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.
|
|
381
|
+
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.4/src/commands/agent/preview.ts)_
|
|
382
382
|
|
|
383
383
|
## `sf agent test create`
|
|
384
384
|
|
|
@@ -433,7 +433,7 @@ EXAMPLES
|
|
|
433
433
|
$ sf agent test create --spec specs/Resort_Manager-testSpec.yaml --test-api-name Resort_Manager_Test --preview
|
|
434
434
|
```
|
|
435
435
|
|
|
436
|
-
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.
|
|
436
|
+
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.4/src/commands/agent/test/create.ts)_
|
|
437
437
|
|
|
438
438
|
## `sf agent test list`
|
|
439
439
|
|
|
@@ -468,7 +468,7 @@ EXAMPLES
|
|
|
468
468
|
$ sf agent test list --target-org my-org
|
|
469
469
|
```
|
|
470
470
|
|
|
471
|
-
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.
|
|
471
|
+
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.4/src/commands/agent/test/list.ts)_
|
|
472
472
|
|
|
473
473
|
## `sf agent test results`
|
|
474
474
|
|
|
@@ -524,7 +524,7 @@ FLAG DESCRIPTIONS
|
|
|
524
524
|
test results aren't written.
|
|
525
525
|
```
|
|
526
526
|
|
|
527
|
-
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.
|
|
527
|
+
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.4/src/commands/agent/test/results.ts)_
|
|
528
528
|
|
|
529
529
|
## `sf agent test resume`
|
|
530
530
|
|
|
@@ -587,7 +587,7 @@ FLAG DESCRIPTIONS
|
|
|
587
587
|
test results aren't written.
|
|
588
588
|
```
|
|
589
589
|
|
|
590
|
-
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.
|
|
590
|
+
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.4/src/commands/agent/test/resume.ts)_
|
|
591
591
|
|
|
592
592
|
## `sf agent test run`
|
|
593
593
|
|
|
@@ -651,6 +651,6 @@ FLAG DESCRIPTIONS
|
|
|
651
651
|
test results aren't written.
|
|
652
652
|
```
|
|
653
653
|
|
|
654
|
-
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.
|
|
654
|
+
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.4/src/commands/agent/test/run.ts)_
|
|
655
655
|
|
|
656
656
|
<!-- commandsstop -->
|
|
@@ -5,7 +5,7 @@
|
|
|
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 { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
8
|
-
import { Messages } from '@salesforce/core';
|
|
8
|
+
import { Messages, SfError } from '@salesforce/core';
|
|
9
9
|
import { AgentTester } from '@salesforce/agents';
|
|
10
10
|
import { colorize } from '@oclif/core/ux';
|
|
11
11
|
import { makeFlags, promptForAiEvaluationDefinitionApiName, resultFormatFlag, testOutputDirFlag, } from '../../../flags.js';
|
|
@@ -62,7 +62,19 @@ export default class AgentTestRun extends SfCommand {
|
|
|
62
62
|
this.mso = new TestStages({ title: `Agent Test Run: ${apiName}`, jsonEnabled: this.jsonEnabled() });
|
|
63
63
|
this.mso.start();
|
|
64
64
|
const agentTester = new AgentTester(connection);
|
|
65
|
-
|
|
65
|
+
let response;
|
|
66
|
+
try {
|
|
67
|
+
response = await agentTester.start(apiName);
|
|
68
|
+
}
|
|
69
|
+
catch (e) {
|
|
70
|
+
const wrapped = SfError.wrap(e);
|
|
71
|
+
if (wrapped.message.includes('Invalid AiEvalDefinitionVersion identifier')) {
|
|
72
|
+
wrapped.actions = [
|
|
73
|
+
`Try running "sf agent test list -o ${flags['target-org'].getUsername() ?? ''}" to see available options`,
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
throw wrapped;
|
|
77
|
+
}
|
|
66
78
|
this.mso.update({ id: response.runId });
|
|
67
79
|
const agentTestCache = await AgentTestCache.create();
|
|
68
80
|
await agentTestCache.createCacheEntry(response.runId, apiName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../../src/commands/agent/test/run.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../../src/commands/agent/test/run.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE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AO,EAAE,eAAe;gBACxB,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;gBAC/B,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;aAC/B,CAAC,CAAC;YAEH,OAAO;gBACL,MAAM,EAAE,WAAW;gBACnB,KAAK,EAAE,QAAQ,CAAC,KAAK;aACtB,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;YAChB,IAAI,CAAC,GAAG,CACN,OAAO,QAAQ,CAAC,KAAK,EAAE,iCAAiC,QAAQ,CAAC,KAAK,EAAE,CAAC,kCAAkC,CAC5G,CAAC;QACJ,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAES,KAAK,CAAC,KAAiC;QAC/C,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC"}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-agent",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@salesforce/plugin-agent",
|
|
9
|
-
"version": "1.19.
|
|
9
|
+
"version": "1.19.4",
|
|
10
10
|
"license": "BSD-3-Clause",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@inquirer/core": "^10.1.6",
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-agent",
|
|
3
3
|
"description": "Commands to interact with Salesforce agents",
|
|
4
|
-
"version": "1.19.
|
|
4
|
+
"version": "1.19.4",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
"exports": "./lib/index.js",
|
|
230
230
|
"type": "module",
|
|
231
231
|
"sfdx": {
|
|
232
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.19.
|
|
233
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.19.
|
|
232
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.19.4.crt",
|
|
233
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.19.4.sig"
|
|
234
234
|
}
|
|
235
235
|
}
|