@salesforce/plugin-agent 1.18.3 → 1.19.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
@@ -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.18.3/src/commands/agent/create.ts)_
135
+ _See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.0/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.18.3/src/commands/agent/generate/agent-spec.ts)_
240
+ _See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.0/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.18.3/src/commands/agent/generate/template.ts)_
288
+ _See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.0/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.18.3/src/commands/agent/generate/test-spec.ts)_
346
+ _See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.0/src/commands/agent/generate/test-spec.ts)_
347
347
 
348
348
  ## `sf agent preview`
349
349
 
@@ -368,9 +368,9 @@ DESCRIPTION
368
368
  XXX
369
369
 
370
370
  EXAMPLES
371
- $ sf agent preview --agent HelpDeskAgent
371
+ $ sf agent preview --name HelpDeskAgent
372
372
 
373
- $ sf agent preview --agent ConciergeAgent --target-org production
373
+ $ sf agent preview --name ConciergeAgent --target-org production
374
374
 
375
375
  FLAG DESCRIPTIONS
376
376
  -n, --name=<value> The name of the agent you want to preview
@@ -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.18.3/src/commands/agent/preview.ts)_
381
+ _See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.0/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.18.3/src/commands/agent/test/create.ts)_
436
+ _See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.0/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.18.3/src/commands/agent/test/list.ts)_
471
+ _See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.0/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.18.3/src/commands/agent/test/results.ts)_
527
+ _See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.0/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.18.3/src/commands/agent/test/resume.ts)_
590
+ _See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.0/src/commands/agent/test/resume.ts)_
591
591
 
592
592
  ## `sf agent test run`
593
593
 
@@ -595,12 +595,13 @@ Start an agent test in your org.
595
595
 
596
596
  ```
597
597
  USAGE
598
- $ sf agent test run -o <value> -n <value> [--json] [--flags-dir <value>] [--api-version <value>] [-w <value>]
598
+ $ sf agent test run -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-n <value>] [-w <value>]
599
599
  [--result-format json|human|junit|tap] [-d <value>]
600
600
 
601
601
  FLAGS
602
602
  -d, --output-dir=<value> Directory to write the agent test results into.
603
- -n, --name=<value> (required) Name of the agent test to start.
603
+ -n, --api-name=<value> API name of the agent test to run; corresponds to the name of the AiEvaluationDefinition
604
+ metadata component that implements the agent test.
604
605
  -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
605
606
  configuration variable is already set.
606
607
  -w, --wait=<value> Number of minutes to wait for the command to complete and display results to the
@@ -616,7 +617,7 @@ GLOBAL FLAGS
616
617
  DESCRIPTION
617
618
  Start an agent test in your org.
618
619
 
619
- Use the --name flag to specify the name of the agent test you want to run. Use the output of the "agent test list"
620
+ Use the --api-name flag to specify the name of the agent test you want to run. Use the output of the "agent test list"
620
621
  command to get the names of all the available agent tests in your org.
621
622
 
622
623
  By default, this command starts the agent test in your org, but it doesn't wait for the test to finish. Instead, it
@@ -633,15 +634,15 @@ DESCRIPTION
633
634
  EXAMPLES
634
635
  Start an agent test called Resort_Manager_Test for an agent in your default org, don't wait for the test to finish:
635
636
 
636
- $ sf agent test run --name Resort_Manager_Test
637
+ $ sf agent test run --api-name Resort_Manager_Test
637
638
 
638
639
  Start an agent test for an agent in an org with alias "my-org" and wait for 10 minutes for the test to finish:
639
640
 
640
- $ sf agent test run --name Resort_Manager_Test --wait 10 --target-org my-org
641
+ $ sf agent test run --api-name Resort_Manager_Test --wait 10 --target-org my-org
641
642
 
642
643
  Start an agent test and write the JSON-formatted results into a directory called "test-results":
643
644
 
644
- $ sf agent test run --name Resort_Manager_Test --wait 10 --output-dir ./test-results --result-format json
645
+ $ sf agent test run --api-name Resort_Manager_Test --wait 10 --output-dir ./test-results --result-format json
645
646
 
646
647
  FLAG DESCRIPTIONS
647
648
  -d, --output-dir=<value> Directory to write the agent test results into.
@@ -650,6 +651,6 @@ FLAG DESCRIPTIONS
650
651
  test results aren't written.
651
652
  ```
652
653
 
653
- _See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.18.3/src/commands/agent/test/run.ts)_
654
+ _See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.19.0/src/commands/agent/test/run.ts)_
654
655
 
655
656
  <!-- commandsstop -->
@@ -11,12 +11,12 @@ export default class AgentTestRun extends SfCommand<AgentTestRunResult> {
11
11
  static readonly examples: string[];
12
12
  static readonly state = "beta";
13
13
  static readonly flags: {
14
- 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
15
- 'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
- name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
17
14
  wait: import("@oclif/core/interfaces").OptionFlag<import("@salesforce/kit").Duration, import("@oclif/core/interfaces").CustomOptions>;
18
15
  'result-format': import("@oclif/core/interfaces").OptionFlag<"json" | "human" | "junit" | "tap", import("@oclif/core/interfaces").CustomOptions>;
19
16
  'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ "api-name": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
19
+ 'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
20
  };
21
21
  private mso;
22
22
  run(): Promise<AgentTestRunResult>;
@@ -8,12 +8,32 @@ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
8
8
  import { Messages } from '@salesforce/core';
9
9
  import { AgentTester } from '@salesforce/agents';
10
10
  import { colorize } from '@oclif/core/ux';
11
- import { resultFormatFlag, testOutputDirFlag } from '../../../flags.js';
11
+ import { makeFlags, promptForAiEvaluationDefinitionApiName, resultFormatFlag, testOutputDirFlag, } from '../../../flags.js';
12
12
  import { AgentTestCache } from '../../../agentTestCache.js';
13
13
  import { TestStages } from '../../../testStages.js';
14
14
  import { handleTestResults } from '../../../handleTestResults.js';
15
15
  Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
16
16
  const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.test.run');
17
+ const FLAGGABLE_PROMPTS = {
18
+ 'api-name': {
19
+ char: 'n',
20
+ required: true,
21
+ message: messages.getMessage('flags.api-name.summary'),
22
+ validate: (d) => {
23
+ if (d.length === 0) {
24
+ return true;
25
+ }
26
+ if (d.length > 80) {
27
+ return 'API name cannot be over 80 characters.';
28
+ }
29
+ const regex = /^[A-Za-z][A-Za-z0-9_]*[A-Za-z0-9]+$/;
30
+ if (!regex.test(d)) {
31
+ return 'Invalid API name.';
32
+ }
33
+ return true;
34
+ },
35
+ },
36
+ };
17
37
  export default class AgentTestRun extends SfCommand {
18
38
  static summary = messages.getMessage('summary');
19
39
  static description = messages.getMessage('description');
@@ -22,11 +42,7 @@ export default class AgentTestRun extends SfCommand {
22
42
  static flags = {
23
43
  'target-org': Flags.requiredOrg(),
24
44
  'api-version': Flags.orgApiVersion(),
25
- name: Flags.string({
26
- char: 'n',
27
- required: true,
28
- summary: messages.getMessage('flags.name.summary'),
29
- }),
45
+ ...makeFlags(FLAGGABLE_PROMPTS),
30
46
  // we want to pass `undefined` to the API
31
47
  // eslint-disable-next-line sf-plugin/flag-min-max-default
32
48
  wait: Flags.duration({
@@ -41,13 +57,15 @@ export default class AgentTestRun extends SfCommand {
41
57
  mso;
42
58
  async run() {
43
59
  const { flags } = await this.parse(AgentTestRun);
44
- this.mso = new TestStages({ title: `Agent Test Run: ${flags.name}`, jsonEnabled: this.jsonEnabled() });
60
+ const connection = flags['target-org'].getConnection(flags['api-version']);
61
+ const apiName = flags['api-name'] ?? (await promptForAiEvaluationDefinitionApiName(FLAGGABLE_PROMPTS['api-name'], connection));
62
+ this.mso = new TestStages({ title: `Agent Test Run: ${apiName}`, jsonEnabled: this.jsonEnabled() });
45
63
  this.mso.start();
46
- const agentTester = new AgentTester(flags['target-org'].getConnection(flags['api-version']));
47
- const response = await agentTester.start(flags.name);
64
+ const agentTester = new AgentTester(connection);
65
+ const response = await agentTester.start(apiName);
48
66
  this.mso.update({ id: response.runId });
49
67
  const agentTestCache = await AgentTestCache.create();
50
- await agentTestCache.createCacheEntry(response.runId, flags.name);
68
+ await agentTestCache.createCacheEntry(response.runId, apiName);
51
69
  if (flags.wait?.minutes) {
52
70
  const { completed, response: detailsResponse } = await this.mso.poll(agentTester, response.runId, flags.wait);
53
71
  if (completed)
@@ -1 +1 @@
1
- {"version":3,"file":"run.js","sourceRoot":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,GAAG,EAAE,KAAK,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC"}
package/lib/flags.d.ts CHANGED
@@ -20,6 +20,7 @@ export declare const testOutputDirFlag: Interfaces.FlagDefinition<string, Interf
20
20
  requiredOrDefaulted: false;
21
21
  }>;
22
22
  export declare function makeFlags<T extends Record<string, FlaggablePrompt>>(flaggablePrompts: T): FlagsOfPrompts<T>;
23
+ export declare const promptForAiEvaluationDefinitionApiName: (flagDef: FlaggablePrompt, connection: Connection) => Promise<string>;
23
24
  export declare const promptForYamlFile: (flagDef: FlaggablePrompt) => Promise<string>;
24
25
  export declare const promptForFlag: (flagDef: FlaggablePrompt) => Promise<string>;
25
26
  export declare const validateAgentType: (agentType?: string, required?: boolean) => string | undefined;
package/lib/flags.js CHANGED
@@ -11,6 +11,7 @@ import { Messages, SfError } from '@salesforce/core';
11
11
  import { camelCaseToTitleCase } from '@salesforce/kit';
12
12
  import { select, input as inquirerInput } from '@inquirer/prompts';
13
13
  import autocomplete from 'inquirer-autocomplete-standalone';
14
+ import { AgentTester } from '@salesforce/agents';
14
15
  import { theme } from './inquirer-theme.js';
15
16
  Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
16
17
  const messages = Messages.loadMessages('@salesforce/plugin-agent', 'shared');
@@ -45,23 +46,49 @@ export function makeFlags(flaggablePrompts) {
45
46
  }),
46
47
  ]));
47
48
  }
48
- async function traverseForYamlFiles(dir) {
49
+ async function traverseForFiles(dir, suffixes) {
49
50
  const files = await readdir(dir, { withFileTypes: true });
50
51
  const results = [];
51
52
  for (const file of files) {
52
53
  const fullPath = join(dir, file.name);
53
54
  if (file.isDirectory()) {
54
55
  // eslint-disable-next-line no-await-in-loop
55
- results.push(...(await traverseForYamlFiles(fullPath)));
56
+ results.push(...(await traverseForFiles(fullPath, suffixes)));
56
57
  }
57
- else if (file.name.endsWith('.yaml') || file.name.endsWith('.yml')) {
58
+ else if (suffixes.some((suffix) => file.name.endsWith(suffix))) {
58
59
  results.push(fullPath);
59
60
  }
60
61
  }
61
62
  return results;
62
63
  }
64
+ export const promptForAiEvaluationDefinitionApiName = async (flagDef, connection) => {
65
+ const agents = new AgentTester(connection);
66
+ const aiDefFiles = await agents.list();
67
+ let id;
68
+ const timeout = new Promise((_, reject) => {
69
+ id = setTimeout(() => {
70
+ reject(new Error('Selection timed out after 30 seconds'));
71
+ }, 30 * 1000).unref();
72
+ });
73
+ return Promise.race([
74
+ autocomplete({
75
+ message: flagDef.message,
76
+ // eslint-disable-next-line @typescript-eslint/require-await
77
+ source: async (input) => {
78
+ const arr = aiDefFiles.map((o) => ({ name: o.fullName, value: o.fullName }));
79
+ if (!input)
80
+ return arr;
81
+ return arr.filter((o) => o.name.includes(input));
82
+ },
83
+ }),
84
+ timeout,
85
+ ]).then((result) => {
86
+ clearTimeout(id);
87
+ return result;
88
+ });
89
+ };
63
90
  export const promptForYamlFile = async (flagDef) => {
64
- const yamlFiles = await traverseForYamlFiles(process.cwd());
91
+ const yamlFiles = await traverseForFiles(process.cwd(), ['.yml', '.yaml']);
65
92
  return autocomplete({
66
93
  message: flagDef.message,
67
94
  // eslint-disable-next-line @typescript-eslint/require-await
package/lib/flags.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"flags.js","sourceRoot":"","sources":["../src/flags.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAc,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE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AAC;QACxD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAChC,MAAM,OAAO,CAAC,MAAM,CAAC;gBACnB,IAAI,EAAE,kBAAkB;gBACxB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,EAAE,CAAC,SAAS,CAAC,CAAC;gBACnE,KAAK,EAAE,GAAG;aACX,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,UAAsB,EAAE,SAAiB,EAAmB,EAAE;IACjG,MAAM,CAAC,GAAG,yCAAyC,SAAS,GAAG,CAAC;IAChE,OAAO,CAAC,MAAM,UAAU,CAAC,iBAAiB,CAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACpE,CAAC,CAAC"}
@@ -16,5 +16,5 @@ the API name of the agent? (TBD based on agents library)
16
16
 
17
17
  # examples
18
18
 
19
- - <%= config.bin %> <%= command.id %> --agent HelpDeskAgent
20
- - <%= config.bin %> <%= command.id %> --agent ConciergeAgent --target-org production
19
+ - <%= config.bin %> <%= command.id %> --name HelpDeskAgent
20
+ - <%= config.bin %> <%= command.id %> --name ConciergeAgent --target-org production
@@ -4,15 +4,15 @@ Start an agent test in your org.
4
4
 
5
5
  # description
6
6
 
7
- Use the --name flag to specify the name of the agent test you want to run. Use the output of the "agent test list" command to get the names of all the available agent tests in your org.
7
+ Use the --api-name flag to specify the name of the agent test you want to run. Use the output of the "agent test list" command to get the names of all the available agent tests in your org.
8
8
 
9
9
  By default, this command starts the agent test in your org, but it doesn't wait for the test to finish. Instead, it displays the "agent test resume" command, with a job ID, that you execute to see the results of the test run, and then returns control of the terminal window to you. Use the --wait flag to specify the number of minutes for the command to wait for the agent test to complete; if the test completes by the end of the wait time, the command displays the test results. If not, run "agent test resume".
10
10
 
11
11
  By default, this command outputs test results in human-readable tables for each test case, if the test completes in time. The tables show whether the test case passed, the expected and actual values, the test score, how long the test took, and more. Use the --result-format to display the test results in JSON or Junit format. Use the --output-dir flag to write the results to a file rather than to the terminal.
12
12
 
13
- # flags.name.summary
13
+ # flags.api-name.summary
14
14
 
15
- Name of the agent test to start.
15
+ API name of the agent test to run; corresponds to the name of the AiEvaluationDefinition metadata component that implements the agent test.
16
16
 
17
17
  # flags.wait.summary
18
18
 
@@ -22,12 +22,12 @@ Number of minutes to wait for the command to complete and display results to the
22
22
 
23
23
  - Start an agent test called Resort_Manager_Test for an agent in your default org, don't wait for the test to finish:
24
24
 
25
- <%= config.bin %> <%= command.id %> --name Resort_Manager_Test
25
+ <%= config.bin %> <%= command.id %> --api-name Resort_Manager_Test
26
26
 
27
27
  - Start an agent test for an agent in an org with alias "my-org" and wait for 10 minutes for the test to finish:
28
28
 
29
- <%= config.bin %> <%= command.id %> --name Resort_Manager_Test --wait 10 --target-org my-org
29
+ <%= config.bin %> <%= command.id %> --api-name Resort_Manager_Test --wait 10 --target-org my-org
30
30
 
31
31
  - Start an agent test and write the JSON-formatted results into a directory called "test-results":
32
32
 
33
- <%= config.bin %> <%= command.id %> --name Resort_Manager_Test --wait 10 --output-dir ./test-results --result-format json
33
+ <%= config.bin %> <%= command.id %> --api-name Resort_Manager_Test --wait 10 --output-dir ./test-results --result-format json
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-agent",
3
- "version": "1.18.3",
3
+ "version": "1.19.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@salesforce/plugin-agent",
9
- "version": "1.18.3",
9
+ "version": "1.19.0",
10
10
  "license": "BSD-3-Clause",
11
11
  "dependencies": {
12
12
  "@inquirer/core": "^10.1.6",
@@ -107,8 +107,8 @@
107
107
  "args": {},
108
108
  "description": "XXX",
109
109
  "examples": [
110
- "<%= config.bin %> <%= command.id %> --agent HelpDeskAgent",
111
- "<%= config.bin %> <%= command.id %> --agent ConciergeAgent --target-org production"
110
+ "<%= config.bin %> <%= command.id %> --name HelpDeskAgent",
111
+ "<%= config.bin %> <%= command.id %> --name ConciergeAgent --target-org production"
112
112
  ],
113
113
  "flags": {
114
114
  "flags-dir": {
@@ -987,11 +987,11 @@
987
987
  "agent:test:run": {
988
988
  "aliases": [],
989
989
  "args": {},
990
- "description": "Use the --name flag to specify the name of the agent test you want to run. Use the output of the \"agent test list\" command to get the names of all the available agent tests in your org.\n\nBy default, this command starts the agent test in your org, but it doesn't wait for the test to finish. Instead, it displays the \"agent test resume\" command, with a job ID, that you execute to see the results of the test run, and then returns control of the terminal window to you. Use the --wait flag to specify the number of minutes for the command to wait for the agent test to complete; if the test completes by the end of the wait time, the command displays the test results. If not, run \"agent test resume\".\n\nBy default, this command outputs test results in human-readable tables for each test case, if the test completes in time. The tables show whether the test case passed, the expected and actual values, the test score, how long the test took, and more. Use the --result-format to display the test results in JSON or Junit format. Use the --output-dir flag to write the results to a file rather than to the terminal.",
990
+ "description": "Use the --api-name flag to specify the name of the agent test you want to run. Use the output of the \"agent test list\" command to get the names of all the available agent tests in your org.\n\nBy default, this command starts the agent test in your org, but it doesn't wait for the test to finish. Instead, it displays the \"agent test resume\" command, with a job ID, that you execute to see the results of the test run, and then returns control of the terminal window to you. Use the --wait flag to specify the number of minutes for the command to wait for the agent test to complete; if the test completes by the end of the wait time, the command displays the test results. If not, run \"agent test resume\".\n\nBy default, this command outputs test results in human-readable tables for each test case, if the test completes in time. The tables show whether the test case passed, the expected and actual values, the test score, how long the test took, and more. Use the --result-format to display the test results in JSON or Junit format. Use the --output-dir flag to write the results to a file rather than to the terminal.",
991
991
  "examples": [
992
- "Start an agent test called Resort_Manager_Test for an agent in your default org, don't wait for the test to finish:\n<%= config.bin %> <%= command.id %> --name Resort_Manager_Test",
993
- "Start an agent test for an agent in an org with alias \"my-org\" and wait for 10 minutes for the test to finish:\n<%= config.bin %> <%= command.id %> --name Resort_Manager_Test --wait 10 --target-org my-org",
994
- "Start an agent test and write the JSON-formatted results into a directory called \"test-results\":\n<%= config.bin %> <%= command.id %> --name Resort_Manager_Test --wait 10 --output-dir ./test-results --result-format json"
992
+ "Start an agent test called Resort_Manager_Test for an agent in your default org, don't wait for the test to finish:\n<%= config.bin %> <%= command.id %> --api-name Resort_Manager_Test",
993
+ "Start an agent test for an agent in an org with alias \"my-org\" and wait for 10 minutes for the test to finish:\n<%= config.bin %> <%= command.id %> --api-name Resort_Manager_Test --wait 10 --target-org my-org",
994
+ "Start an agent test and write the JSON-formatted results into a directory called \"test-results\":\n<%= config.bin %> <%= command.id %> --api-name Resort_Manager_Test --wait 10 --output-dir ./test-results --result-format json"
995
995
  ],
996
996
  "flags": {
997
997
  "json": {
@@ -1026,11 +1026,10 @@
1026
1026
  "multiple": false,
1027
1027
  "type": "option"
1028
1028
  },
1029
- "name": {
1029
+ "api-name": {
1030
1030
  "char": "n",
1031
- "name": "name",
1032
- "required": true,
1033
- "summary": "Name of the agent test to start.",
1031
+ "name": "api-name",
1032
+ "summary": "API name of the agent test to run; corresponds to the name of the AiEvaluationDefinition metadata component that implements the agent test.",
1034
1033
  "hasDynamicHelp": false,
1035
1034
  "multiple": false,
1036
1035
  "type": "option"
@@ -1096,5 +1095,5 @@
1096
1095
  ]
1097
1096
  }
1098
1097
  },
1099
- "version": "1.18.3"
1098
+ "version": "1.19.0"
1100
1099
  }
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.18.3",
4
+ "version": "1.19.0",
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.18.3.crt",
233
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.18.3.sig"
232
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.19.0.crt",
233
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.19.0.sig"
234
234
  }
235
235
  }