@salesforce/plugin-agent 1.36.1 → 1.37.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 CHANGED
@@ -77,6 +77,7 @@ sf plugins
77
77
  - [`sf agent test results`](#sf-agent-test-results)
78
78
  - [`sf agent test resume`](#sf-agent-test-resume)
79
79
  - [`sf agent test run`](#sf-agent-test-run)
80
+ - [`sf agent test run-eval`](#sf-agent-test-run-eval)
80
81
  - [`sf agent validate authoring-bundle`](#sf-agent-validate-authoring-bundle)
81
82
 
82
83
  ## `sf agent activate`
@@ -126,7 +127,7 @@ EXAMPLES
126
127
  $ sf agent activate --api-name Resort_Manager --version 2 --target-org my-org
127
128
  ```
128
129
 
129
- _See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/activate.ts)_
130
+ _See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/activate.ts)_
130
131
 
131
132
  ## `sf agent create`
132
133
 
@@ -193,7 +194,7 @@ EXAMPLES
193
194
  $ sf agent create --name "Resort Manager" --spec specs/resortManagerAgent.yaml --preview
194
195
  ```
195
196
 
196
- _See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/create.ts)_
197
+ _See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/create.ts)_
197
198
 
198
199
  ## `sf agent deactivate`
199
200
 
@@ -234,7 +235,7 @@ EXAMPLES
234
235
  $ sf agent deactivate --api-name Resort_Manager --target-org my-org
235
236
  ```
236
237
 
237
- _See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/deactivate.ts)_
238
+ _See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/deactivate.ts)_
238
239
 
239
240
  ## `sf agent generate agent-spec`
240
241
 
@@ -341,7 +342,7 @@ EXAMPLES
341
342
  $ sf agent generate agent-spec --tone formal --agent-user resortmanager@myorg.com
342
343
  ```
343
344
 
344
- _See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/generate/agent-spec.ts)_
345
+ _See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/generate/agent-spec.ts)_
345
346
 
346
347
  ## `sf agent generate authoring-bundle`
347
348
 
@@ -418,7 +419,7 @@ EXAMPLES
418
419
  other-package-dir/main/default --target-org my-dev-org
419
420
  ```
420
421
 
421
- _See code: [src/commands/agent/generate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/generate/authoring-bundle.ts)_
422
+ _See code: [src/commands/agent/generate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/generate/authoring-bundle.ts)_
422
423
 
423
424
  ## `sf agent generate template`
424
425
 
@@ -480,7 +481,7 @@ EXAMPLES
480
481
  my-package --source-org my-scratch-org
481
482
  ```
482
483
 
483
- _See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/generate/template.ts)_
484
+ _See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/generate/template.ts)_
484
485
 
485
486
  ## `sf agent generate test-spec`
486
487
 
@@ -545,7 +546,7 @@ EXAMPLES
545
546
  force-app//main/default/aiEvaluationDefinitions/Resort_Manager_Tests.aiEvaluationDefinition-meta.xml
546
547
  ```
547
548
 
548
- _See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/generate/test-spec.ts)_
549
+ _See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/generate/test-spec.ts)_
549
550
 
550
551
  ## `sf agent preview`
551
552
 
@@ -618,7 +619,7 @@ EXAMPLES
618
619
  $ sf agent preview --use-live-actions --apex-debug --output-dir transcripts/my-preview
619
620
  ```
620
621
 
621
- _See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/preview.ts)_
622
+ _See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/preview.ts)_
622
623
 
623
624
  ## `sf agent preview end`
624
625
 
@@ -673,7 +674,7 @@ EXAMPLES
673
674
  $ sf agent preview end --authoring-bundle My_Local_Agent
674
675
  ```
675
676
 
676
- _See code: [src/commands/agent/preview/end.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/preview/end.ts)_
677
+ _See code: [src/commands/agent/preview/end.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/preview/end.ts)_
677
678
 
678
679
  ## `sf agent preview send`
679
680
 
@@ -731,7 +732,7 @@ EXAMPLES
731
732
  $ sf agent preview send --utterance "what can you help me with?" --authoring-bundle My_Local_Agent
732
733
  ```
733
734
 
734
- _See code: [src/commands/agent/preview/send.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/preview/send.ts)_
735
+ _See code: [src/commands/agent/preview/send.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/preview/send.ts)_
735
736
 
736
737
  ## `sf agent preview sessions`
737
738
 
@@ -764,7 +765,7 @@ EXAMPLES
764
765
  $ sf agent preview sessions
765
766
  ```
766
767
 
767
- _See code: [src/commands/agent/preview/sessions.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/preview/sessions.ts)_
768
+ _See code: [src/commands/agent/preview/sessions.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/preview/sessions.ts)_
768
769
 
769
770
  ## `sf agent preview start`
770
771
 
@@ -829,7 +830,7 @@ EXAMPLES
829
830
  $ sf agent preview start --api-name My_Published_Agent
830
831
  ```
831
832
 
832
- _See code: [src/commands/agent/preview/start.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/preview/start.ts)_
833
+ _See code: [src/commands/agent/preview/start.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/preview/start.ts)_
833
834
 
834
835
  ## `sf agent publish authoring-bundle`
835
836
 
@@ -889,7 +890,7 @@ EXAMPLES
889
890
  $ sf agent publish authoring-bundle --api-name MyAuthoringbundle --concise
890
891
  ```
891
892
 
892
- _See code: [src/commands/agent/publish/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/publish/authoring-bundle.ts)_
893
+ _See code: [src/commands/agent/publish/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/publish/authoring-bundle.ts)_
893
894
 
894
895
  ## `sf agent test create`
895
896
 
@@ -944,7 +945,7 @@ EXAMPLES
944
945
  $ sf agent test create --spec specs/Resort_Manager-testSpec.yaml --api-name Resort_Manager_Test --preview
945
946
  ```
946
947
 
947
- _See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/test/create.ts)_
948
+ _See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/test/create.ts)_
948
949
 
949
950
  ## `sf agent test list`
950
951
 
@@ -979,7 +980,7 @@ EXAMPLES
979
980
  $ sf agent test list --target-org my-org
980
981
  ```
981
982
 
982
- _See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/test/list.ts)_
983
+ _See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/test/list.ts)_
983
984
 
984
985
  ## `sf agent test results`
985
986
 
@@ -1055,7 +1056,7 @@ FLAG DESCRIPTIONS
1055
1056
  expression when using custom evaluations.
1056
1057
  ```
1057
1058
 
1058
- _See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/test/results.ts)_
1059
+ _See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/test/results.ts)_
1059
1060
 
1060
1061
  ## `sf agent test resume`
1061
1062
 
@@ -1139,7 +1140,7 @@ FLAG DESCRIPTIONS
1139
1140
  expression when using custom evaluations.
1140
1141
  ```
1141
1142
 
1142
- _See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/test/resume.ts)_
1143
+ _See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/test/resume.ts)_
1143
1144
 
1144
1145
  ## `sf agent test run`
1145
1146
 
@@ -1223,7 +1224,80 @@ FLAG DESCRIPTIONS
1223
1224
  expression when using custom evaluations.
1224
1225
  ```
1225
1226
 
1226
- _See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/test/run.ts)_
1227
+ _See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/test/run.ts)_
1228
+
1229
+ ## `sf agent test run-eval`
1230
+
1231
+ Run evaluation tests against an Agentforce agent.
1232
+
1233
+ ```
1234
+ USAGE
1235
+ $ sf agent test run-eval -o <value> -s <value> [--json] [--flags-dir <value>] [--api-version <value>] [-n <value>]
1236
+ [--result-format json|human|junit|tap] [--batch-size <value>] [--no-normalize]
1237
+
1238
+ FLAGS
1239
+ -n, --api-name=<value> Agent DeveloperName (also called API name) to resolve agent_id and agent_version_id.
1240
+ Auto-inferred from the YAML spec's subjectName.
1241
+ -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
1242
+ configuration variable is already set.
1243
+ -s, --spec=<value> (required) Path to test spec file (YAML or JSON). Supports reading from stdin when
1244
+ piping content.
1245
+ --api-version=<value> Override the api version used for api requests made by this command
1246
+ --batch-size=<value> [default: 5] Number of tests per API request (max 5).
1247
+ --no-normalize Disable auto-normalization of field names and shorthand references.
1248
+ --result-format=<option> [default: human] Format of the agent test run results.
1249
+ <options: json|human|junit|tap>
1250
+
1251
+ GLOBAL FLAGS
1252
+ --flags-dir=<value> Import flag values from a directory.
1253
+ --json Format output as json.
1254
+
1255
+ DESCRIPTION
1256
+ Run evaluation tests against an Agentforce agent.
1257
+
1258
+ Execute rich evaluation tests against an Agentforce agent using the Einstein Evaluation API. Supports both YAML test
1259
+ specs (same format as `sf agent generate test-spec`) and JSON payloads.
1260
+
1261
+ When you provide a YAML test spec, the command automatically translates test cases into Evaluation API calls and
1262
+ infers the agent name from the spec's `subjectName` field. This means you can use the same test spec with both `sf
1263
+ agent test run` and `sf agent test run-eval`. YAML test specs also support contextVariables, which allow you to inject
1264
+ contextual data (such as CaseId or RoutableId) into agent sessions for testing with different contexts.
1265
+
1266
+ When you provide a JSON payload, it's sent directly to the API with optional normalization. The normalizer
1267
+ auto-corrects common field name mistakes, converts shorthand references to JSONPath, and injects defaults. Use
1268
+ `--no-normalize` to disable this auto-normalization. JSON payloads can also include context_variables on
1269
+ agent.create_session steps for the same contextual testing capabilities.
1270
+
1271
+ Supports 8+ evaluator types, including topic routing assertions, action invocation checks, string/numeric assertions,
1272
+ semantic similarity scoring, and LLM-based quality ratings.
1273
+
1274
+ EXAMPLES
1275
+ Run tests using a YAML test spec on the org with alias "my-org":
1276
+
1277
+ $ sf agent test run-eval --spec tests/my-agent-testSpec.yaml --target-org my-org
1278
+
1279
+ Run tests using a YAML spec with explicit agent name override; use your default org:
1280
+
1281
+ $ sf agent test run-eval --spec tests/my-agent-testSpec.yaml --api-name My_Agent --target-org my-org
1282
+
1283
+ Run tests using a JSON payload:
1284
+
1285
+ $ sf agent test run-eval --spec tests/eval-payload.json --target-org my-org
1286
+
1287
+ Run tests and output results in JUnit format; useful for continuous integration and deployment (CI/CD):
1288
+
1289
+ $ sf agent test run-eval --spec tests/my-agent-testSpec.yaml --target-org my-org --result-format junit
1290
+
1291
+ Run tests with contextVariables to inject contextual data into agent sessions (add contextVariables to test cases in
1292
+ your YAML spec):
1293
+
1294
+ $ sf agent test run-eval --spec tests/agent-with-context.yaml --target-org my-org
1295
+
1296
+ Pipe JSON payload from stdin (--spec flag is automatically populated from stdin):
1297
+ $ echo '{"tests":[...]}' | sf agent test run-eval --spec --target-org my-org
1298
+ ```
1299
+
1300
+ _See code: [src/commands/agent/test/run-eval.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/test/run-eval.ts)_
1227
1301
 
1228
1302
  ## `sf agent validate authoring-bundle`
1229
1303
 
@@ -1270,6 +1344,6 @@ EXAMPLES
1270
1344
  $ sf agent validate authoring-bundle --api-name MyAuthoringBundle --target-org my-dev-org
1271
1345
  ```
1272
1346
 
1273
- _See code: [src/commands/agent/validate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.36.1/src/commands/agent/validate/authoring-bundle.ts)_
1347
+ _See code: [src/commands/agent/validate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.37.0/src/commands/agent/validate/authoring-bundle.ts)_
1274
1348
 
1275
1349
  <!-- commandsstop -->
@@ -1,5 +1,4 @@
1
1
  import { SfCommand } from '@salesforce/sf-plugins-core';
2
- import { Org } from '@salesforce/core';
3
2
  export type RunEvalResult = {
4
3
  tests: Array<{
5
4
  id: string;
@@ -18,16 +17,13 @@ export default class AgentTestRunEval extends SfCommand<RunEvalResult> {
18
17
  static readonly summary: string;
19
18
  static readonly description: string;
20
19
  static readonly examples: string[];
21
- static state: string;
22
- static readonly hidden = true;
23
20
  static readonly envVariablesSection: import("@oclif/core").HelpSection;
24
21
  static readonly errorCodes: import("@oclif/core").HelpSection;
25
22
  static readonly flags: {
26
- 'target-org': import("@oclif/core/interfaces").OptionFlag<Org, import("@oclif/core/interfaces").CustomOptions>;
23
+ 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
27
24
  'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
28
25
  spec: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
29
26
  'api-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
30
- wait: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
31
27
  'result-format': import("@oclif/core/interfaces").OptionFlag<"json" | "human" | "junit" | "tap", import("@oclif/core/interfaces").CustomOptions>;
32
28
  'batch-size': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
33
29
  'no-normalize': import("@oclif/core/interfaces").BooleanFlag<boolean>;
@@ -16,100 +16,35 @@
16
16
  import { readFile } from 'node:fs/promises';
17
17
  import { Flags, SfCommand, toHelpSection } from '@salesforce/sf-plugins-core';
18
18
  import { EnvironmentVariable, Messages, SfError } from '@salesforce/core';
19
- import { normalizePayload, splitIntoBatches } from '../../../evalNormalizer.js';
20
- import { formatResults } from '../../../evalFormatter.js';
19
+ import { normalizePayload, splitIntoBatches, formatResults, isYamlTestSpec, parseTestSpec, translateTestSpec, resolveAgent, executeBatches, buildResultSummary, } from '@salesforce/agents';
21
20
  import { resultFormatFlag } from '../../../flags.js';
22
- import { isYamlTestSpec, parseTestSpec, translateTestSpec } from '../../../yamlSpecTranslator.js';
23
21
  Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
24
22
  const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.test.run-eval');
25
- async function getApiHeaders(org) {
26
- const conn = org.getConnection();
27
- const userInfo = await conn.request(`${conn.instanceUrl}/services/oauth2/userinfo`);
28
- return {
29
- orgId: org.getOrgId(),
30
- userId: userInfo.user_id,
31
- instanceUrl: conn.instanceUrl,
32
- };
33
- }
34
- async function callEvalApi(org, payload, headers) {
35
- const conn = org.getConnection();
36
- return conn.request({
37
- url: 'https://api.salesforce.com/einstein/evaluation/v1/tests',
38
- method: 'POST',
39
- headers: {
40
- 'Content-Type': 'application/json',
41
- 'x-sfdc-core-tenant-id': `core/prod/${headers.orgId}`,
42
- 'x-org-id': headers.orgId,
43
- 'x-sfdc-core-instance-url': headers.instanceUrl,
44
- 'x-sfdc-user-id': headers.userId,
45
- 'x-client-feature-id': 'AIPlatformEvaluation',
46
- 'x-sfdc-app-context': 'EinsteinGPT',
47
- },
48
- body: JSON.stringify(payload),
49
- });
50
- }
51
- async function resolveAgent(org, apiName) {
52
- const conn = org.getConnection();
53
- // Escape single quotes to prevent SOQL injection
54
- const escapedApiName = apiName.replace(/'/g, "\\'");
55
- const botResult = await conn.query(`SELECT Id FROM BotDefinition WHERE DeveloperName = '${escapedApiName}'`);
56
- if (!botResult.records.length) {
57
- throw messages.createError('error.agentNotFound', [apiName]);
23
+ async function resolveAndInjectAgent(org, agentApiName, payload) {
24
+ let agentId;
25
+ let versionId;
26
+ try {
27
+ ({ agentId, versionId } = await resolveAgent(org, agentApiName));
58
28
  }
59
- const agentId = botResult.records[0].Id;
60
- // Filter to published/active versions only
61
- const versionResult = await conn.query(`SELECT Id FROM BotVersion WHERE BotDefinitionId = '${agentId}' ORDER BY VersionNumber DESC LIMIT 1`);
62
- if (!versionResult.records.length) {
63
- throw messages.createError('error.agentVersionNotFound', [apiName]);
29
+ catch (e) {
30
+ const wrapped = SfError.wrap(e);
31
+ throw new SfError(`Agent '${agentApiName}' not found.`, 'AgentNotFound', [], 2, wrapped);
64
32
  }
65
- const versionId = versionResult.records[0].Id;
66
- return { agentId, versionId };
67
- }
68
- async function executeBatches(org, batches, log) {
69
- // Pre-calculate headers once to avoid redundant API calls
70
- const headers = await getApiHeaders(org);
71
- // Execute all batches in parallel for better performance
72
- if (batches.length > 1) {
73
- log(messages.getMessage('info.batchProgress', [batches.length, batches.length, 'total']));
74
- }
75
- const batchPromises = batches.map(async (batch) => {
76
- const batchPayload = { tests: batch };
77
- const resultObj = await callEvalApi(org, batchPayload, headers);
78
- return resultObj.results ?? [];
79
- });
80
- const batchResults = await Promise.all(batchPromises);
81
- return batchResults.flat();
82
- }
83
- function buildResultSummary(mergedResponse) {
84
- const summary = { passed: 0, failed: 0, scored: 0, errors: 0 };
85
- const testSummaries = [];
86
- for (const testResult of mergedResponse.results ?? []) {
87
- const tr = testResult;
88
- const testId = tr.id ?? 'unknown';
89
- const evalResults = tr.evaluation_results ?? [];
90
- const testErrors = tr.errors ?? [];
91
- const passed = evalResults.filter((e) => e.is_pass === true).length;
92
- const failed = evalResults.filter((e) => e.is_pass === false).length;
93
- const scored = evalResults.filter((e) => e.score != null && e.is_pass == null).length;
94
- summary.passed += passed;
95
- summary.failed += failed;
96
- summary.scored += scored;
97
- summary.errors += testErrors.length;
98
- testSummaries.push({
99
- id: testId,
100
- status: failed > 0 || testErrors.length > 0 ? 'failed' : 'passed',
101
- evaluations: evalResults,
102
- outputs: tr.outputs ?? [],
103
- });
33
+ for (const test of payload.tests) {
34
+ for (const step of test.steps) {
35
+ if (step.type === 'agent.create_session') {
36
+ // eslint-disable-next-line camelcase
37
+ step.agent_id = agentId;
38
+ // eslint-disable-next-line camelcase
39
+ step.agent_version_id = versionId;
40
+ }
41
+ }
104
42
  }
105
- return { summary, testSummaries };
106
43
  }
107
44
  export default class AgentTestRunEval extends SfCommand {
108
45
  static summary = messages.getMessage('summary');
109
46
  static description = messages.getMessage('description');
110
47
  static examples = messages.getMessages('examples');
111
- static state = 'beta';
112
- static hidden = true;
113
48
  static envVariablesSection = toHelpSection('ENVIRONMENT VARIABLES', EnvironmentVariable.SF_TARGET_ORG);
114
49
  static errorCodes = toHelpSection('ERROR CODES', {
115
50
  'Succeeded (0)': 'Tests completed successfully. Test results (passed/failed) are in the JSON output.',
@@ -130,11 +65,6 @@ export default class AgentTestRunEval extends SfCommand {
130
65
  char: 'n',
131
66
  summary: messages.getMessage('flags.api-name.summary'),
132
67
  }),
133
- wait: Flags.integer({
134
- char: 'w',
135
- default: 10,
136
- summary: messages.getMessage('flags.wait.summary'),
137
- }),
138
68
  'result-format': resultFormatFlag(),
139
69
  'batch-size': Flags.integer({
140
70
  default: 5,
@@ -150,40 +80,39 @@ export default class AgentTestRunEval extends SfCommand {
150
80
  const org = flags['target-org'];
151
81
  // 1. Get spec content (from file or stdin via allowStdin)
152
82
  let rawContent = flags.spec;
153
- // If spec looks like it might be a file path (not parseable content), read the file
154
- try {
155
- // Try to detect if it's actual content vs a file path
156
- // If it's a valid YAML/JSON, it's content; otherwise treat as file path
157
- if (!isYamlTestSpec(rawContent)) {
158
- JSON.parse(rawContent);
159
- }
160
- // If we got here, it's valid content
161
- }
162
- catch {
163
- // Not valid content, must be a file path - read it
83
+ let isYaml = isYamlTestSpec(rawContent);
84
+ if (!isYaml) {
164
85
  try {
165
- rawContent = await readFile(flags.spec, 'utf-8');
86
+ JSON.parse(rawContent);
166
87
  }
167
- catch (e) {
168
- const wrapped = SfError.wrap(e);
169
- throw new SfError(`Spec file not found: ${flags.spec}`, 'SpecFileNotFound', [], 2, wrapped);
88
+ catch {
89
+ try {
90
+ rawContent = await readFile(flags.spec, 'utf-8');
91
+ }
92
+ catch (e) {
93
+ const wrapped = SfError.wrap(e);
94
+ throw new SfError(`Spec file not found: ${flags.spec}`, 'SpecFileNotFound', [], 2, wrapped);
95
+ }
96
+ isYaml = isYamlTestSpec(rawContent);
170
97
  }
171
98
  }
172
99
  // 2. Detect format and parse
173
100
  let payload;
174
101
  let agentApiName = flags['api-name'];
175
- if (isYamlTestSpec(rawContent)) {
176
- // YAML TestSpec detected — translate to EvalPayload
177
- const spec = parseTestSpec(rawContent);
178
- payload = translateTestSpec(spec);
179
- // Auto-infer api-name from subjectName if not explicitly provided
180
- if (!agentApiName) {
181
- agentApiName = spec.subjectName;
182
- this.log(messages.getMessage('info.yamlDetected', [spec.subjectName, spec.testCases.length.toString()]));
102
+ if (isYaml) {
103
+ try {
104
+ const spec = parseTestSpec(rawContent);
105
+ payload = translateTestSpec(spec);
106
+ if (!agentApiName) {
107
+ agentApiName = spec.subjectName;
108
+ this.log(messages.getMessage('info.yamlDetected', [spec.subjectName, spec.testCases.length.toString()]));
109
+ }
110
+ }
111
+ catch (e) {
112
+ throw messages.createError('error.invalidPayload', [e.message]);
183
113
  }
184
114
  }
185
115
  else {
186
- // JSON EvalPayload (original behavior)
187
116
  try {
188
117
  payload = JSON.parse(rawContent);
189
118
  }
@@ -194,56 +123,32 @@ export default class AgentTestRunEval extends SfCommand {
194
123
  if (!payload.tests || !Array.isArray(payload.tests) || payload.tests.length === 0) {
195
124
  throw messages.createError('error.invalidPayload', ['missing or empty "tests" array']);
196
125
  }
126
+ for (const test of payload.tests) {
127
+ if (!Array.isArray(test.steps)) {
128
+ throw messages.createError('error.invalidPayload', [`test '${test.id}' has missing or invalid 'steps' array`]);
129
+ }
130
+ }
197
131
  // 3. If --api-name (or auto-inferred from YAML), resolve IDs and inject
198
132
  if (agentApiName) {
199
- let agentId;
200
- let versionId;
201
- try {
202
- const resolved = await resolveAgent(org, agentApiName);
203
- agentId = resolved.agentId;
204
- versionId = resolved.versionId;
205
- }
206
- catch (e) {
207
- const wrapped = SfError.wrap(e);
208
- throw new SfError(`Agent '${agentApiName}' not found.`, 'AgentNotFound', [], 2, wrapped);
209
- }
210
- for (const test of payload.tests) {
211
- for (const step of test.steps) {
212
- if (step.type === 'agent.create_session') {
213
- // eslint-disable-next-line camelcase
214
- step.agent_id = agentId;
215
- // eslint-disable-next-line camelcase
216
- step.agent_version_id = versionId;
217
- }
218
- }
219
- }
133
+ await resolveAndInjectAgent(org, agentApiName, payload);
220
134
  }
221
135
  // 4. Normalize payload unless --no-normalize
222
136
  if (!flags['no-normalize']) {
223
137
  payload = normalizePayload(payload);
224
138
  }
225
- // 5. Clamp batch size
139
+ // 5. Clamp batch size and split into batches
226
140
  const batchSize = Math.min(Math.max(flags['batch-size'], 1), 5);
227
- // 6. Split into batches
228
141
  const batches = splitIntoBatches(payload.tests, batchSize);
229
- // 7. Execute batches
230
- let allResults;
231
- try {
232
- allResults = await executeBatches(org, batches, (msg) => this.log(msg));
233
- }
234
- catch (e) {
142
+ // 6. Execute batches
143
+ const allResults = await executeBatches(org, batches, (msg) => this.log(msg)).catch((e) => {
235
144
  const wrapped = SfError.wrap(e);
236
145
  throw new SfError(`Failed to execute tests: ${wrapped.message}`, 'TestExecutionFailed', [wrapped.message], 4, wrapped);
237
- }
146
+ });
238
147
  const mergedResponse = { results: allResults };
239
- // 9. Format output
240
- const resultFormat = (flags['result-format'] ?? 'human');
241
- const formatted = formatResults(mergedResponse, resultFormat);
242
- this.log(formatted);
243
- // 10. Build structured result for --json
148
+ // 7. Format output
149
+ this.log(formatResults(mergedResponse, (flags['result-format'] ?? 'human')));
150
+ // 8. Build structured result for --json
244
151
  const { summary, testSummaries } = buildResultSummary(mergedResponse);
245
- // Set exit code to 1 only for execution errors (tests couldn't run)
246
- // Test failures (assertions failed) are business logic and should not affect exit code
247
152
  if (summary.errors > 0) {
248
153
  process.exitCode = 1;
249
154
  }
@@ -1 +1 @@
1
- {"version":3,"file":"run-eval.js","sourceRoot":"","sources":["../../../../src/commands/agent/test/run-eval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAO,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAoB,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAClG,OAAO,EAAwB,aAAa,EAAqB,MAAM,2BAA2B,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,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E,OAAO,EAAE,UAAwC,EAAE,CAAC;QAE9F,mBAAmB;QACnB,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,cAAc,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,OAAO,CAAiB,CAAC,CAAC,CAAC;QAE7F,wCAAwC;QACxC,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC;QAEtE,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC;IAC3C,CAAC"}
@@ -20,10 +20,6 @@ Path to test spec file (YAML or JSON). Supports reading from stdin when piping c
20
20
 
21
21
  Agent DeveloperName (also called API name) to resolve agent_id and agent_version_id. Auto-inferred from the YAML spec's subjectName.
22
22
 
23
- # flags.wait.summary
24
-
25
- Number of minutes to wait for results.
26
-
27
23
  # flags.result-format.summary
28
24
 
29
25
  Format of the agent test results.