@salesforce/plugin-agent 1.32.0 → 1.32.2-dev.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.
@@ -3,10 +3,10 @@
3
3
  "agent:activate": {
4
4
  "aliases": [],
5
5
  "args": {},
6
- "description": "Activating an agent makes it immediately available to your users. An agent must be active before you can preview it with the \"agent preview\" CLI command or VS Code.\n\nYou must know the agent's API name to activate it; you can either be prompted for it or you can specify it with the --api-name flag. Find the agent's API name in its Agent Details page of your org's Agentforce Studio UI in Setup.",
6
+ "description": "Activating an agent makes it immediately available to your users. A published agent must be active before you can preview it with the \"agent preview\" CLI command or VS Code. Agents can have multiple versions; only one version can be active at a time.\n\nIf you run the command without the --api-name or --version flags, the command provides a list of agent API names and versions for you to choose from. Use the flags to specify the exact agent and version without being prompted. If you use the --json flag and not --version, then the latest agent version is automatically activated.\n\nThe value of the --version flag is always a number, corresponding to the \"vX\" part of the \"BotVersion\" metadata in your project. For example, if you have a force-app/main/default/bots/My_Agent/v4.botVersion-meta.xml file in your project, then you activate this version with the \"--version 4\" flag.",
7
7
  "examples": [
8
- "Activate an agent in your default target org by being prompted:\n<%= config.bin %> <%= command.id %>",
9
- "Activate an agent with API name Resort_Manager in the org with alias \"my-org\":\n<%= config.bin %> <%= command.id %> --api-name Resort_Manager --target-org my-org"
8
+ "Activate an agent in your default target org by being prompted for both its API name and version:\n<%= config.bin %> <%= command.id %>",
9
+ "Activate version 2 of an agent with API name Resort_Manager in the org with alias \"my-org\":\n<%= config.bin %> <%= command.id %> --api-name Resort_Manager --version 2 --target-org my-org"
10
10
  ],
11
11
  "flags": {
12
12
  "json": {
@@ -44,7 +44,14 @@
44
44
  "api-name": {
45
45
  "char": "n",
46
46
  "name": "api-name",
47
- "summary": "API name of the agent to activate.",
47
+ "summary": "API name of the agent to activate; if not specified, the command provides a list that you choose from.",
48
+ "hasDynamicHelp": false,
49
+ "multiple": false,
50
+ "type": "option"
51
+ },
52
+ "version": {
53
+ "name": "version",
54
+ "summary": "Version number of the agent to activate; if not specified, the command provides a list that you choose from.",
48
55
  "hasDynamicHelp": false,
49
56
  "multiple": false,
50
57
  "type": "option"
@@ -176,7 +183,7 @@
176
183
  "agent:deactivate": {
177
184
  "aliases": [],
178
185
  "args": {},
179
- "description": "Deactivating an agent makes it unavailable to your users. To make changes to an agent, such as adding or removing topics or actions, you must deactivate it. You can't preview an agent with the \"agent preview\" CLI command or VS Code if it's deactivated.\n\nYou must know the agent's API name to deactivate it; you can either be prompted for it or you can specify it with the --api-name flag. Find the agent's API name in its Agent Details page of your org's Agentforce Studio UI in Setup.",
186
+ "description": "Deactivating an agent makes it unavailable to your users. To make changes to an agent, such as adding or removing topics or actions, you must deactivate it. You can't preview an agent with the \"agent preview\" CLI command or VS Code if it's deactivated.\n\nIf you run the command without the --api-name flag, the command provides a list of agent API names for you to choose from. Use the flag to specify the exact agent without being prompted.",
180
187
  "examples": [
181
188
  "Deactivate an agent in your default target org by being prompted:\n<%= config.bin %> <%= command.id %>",
182
189
  "Deactivate the agent Resort_Manager in the org with alias \"my_org\":\n<%= config.bin %> <%= command.id %> --api-name Resort_Manager --target-org my-org"
@@ -217,7 +224,7 @@
217
224
  "api-name": {
218
225
  "char": "n",
219
226
  "name": "api-name",
220
- "summary": "API name of the agent to deactivate.",
227
+ "summary": "API name of the agent to deactivate; if not specified, the command provides a list that you choose from.",
221
228
  "hasDynamicHelp": false,
222
229
  "multiple": false,
223
230
  "type": "option"
@@ -650,9 +657,9 @@
650
657
  "agent:generate:template": {
651
658
  "aliases": [],
652
659
  "args": {},
653
- "description": "At a high-level, agents are defined by the Bot, BotVersion, and GenAiPlannerBundle metadata types. The GenAiPlannerBundle type in turn defines the agent's topics and actions. This command uses the metadata files for these three types, located in your local DX project, to generate a BotTemplate file for a specific agent (Bot). You then use the BotTemplate file, along with the GenAiPlannerBundle file that references the BotTemplate, to package the template in a managed package that you can share between orgs or on AppExchange.\n\nUse the --agent-file flag to specify the relative or full pathname of the Bot metadata file, such as force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml. A single Bot can have multiple BotVersions, so use the --agent-version flag to specify the version. The corresponding BotVersion file must exist locally. For example, if you specify \"--agent-version 4\", then the file force-app/main/default/bots/My_Awesome_Agent/v4.botVersion-meta.xml must exist.\n\nThe new BotTemplate file is generated in the \"botTemplates\" directory in your local package directory, and has the name <Agent_API_name>_v<Version>_Template.botTemplate-meta.xml, such as force-app/main/default/botTemplates/My_Awesome_Agent_v4_Template.botTemplate-meta.xml. The command displays the full pathname of the generated files when it completes.",
660
+ "description": "WARNING: This command doesn't work for agents that were created from an Agent Script file. In other words, you can't currently package an agent template for agents that use Agent Script.\n\nAt a high-level, agents are defined by the Bot, BotVersion, and GenAiPlannerBundle metadata types. The GenAiPlannerBundle type in turn defines the agent's topics and actions. This command uses the metadata files for these three types, located in your local DX project, to generate a BotTemplate metadata file for a specific agent (Bot). You then use the BotTemplate metadata file, along with the GenAiPlannerBundle metadata file that references the BotTemplate, to package the template in a managed package that you can share between orgs or on AppExchange.\n\nUse the --agent-file flag to specify the relative or full pathname of the Bot metadata file, such as force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml. A single Bot can have multiple BotVersions, so use the --agent-version flag to specify the version. The corresponding BotVersion metadata file must exist locally. For example, if you specify \"--agent-version 4\", then the file force-app/main/default/bots/My_Awesome_Agent/v4.botVersion-meta.xml must exist.\n\nThe new BotTemplate metadata file is generated in the \"botTemplates\" directory in the output directory specified with the --output-dir flag, and has the name <Agent_API_name>\\_v<Version>\\_Template.botTemplate-meta.xml, such as my-package/botTemplates/My_Awesome_Agent_v4_Template.botTemplate-meta.xml. The command displays the full pathname of the generated files when it completes.\n\nSee \"Develop and Package Agent Templates Using Scratch Orgs\" (https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/dev2gp_package_agent_templates.htm) for details about the complete process, which includes using a scratch org to create and test the agent, retrieving the agent metadata to your DX project, running this command to create the agent template, and then packaging the template.",
654
661
  "examples": [
655
- "Generate an agent template from a Bot metadata file in your DX project that corresponds to the My_Awesome_Agent agent; use version 1 of the agent.\n<%= config.bin %> <%= command.id %> --agent-file force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1"
662
+ "Generate an agent template from the My_Awesome_Agent Bot metadata file in your DX project and save the BotTemplate and GenAiPlannerBundle to the specified directory; use version 1 of the agent:\n<%= config.bin %> <%= command.id %> --agent-file force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1 --output-dir my-package --source-org my-scratch-org"
656
663
  ],
657
664
  "flags": {
658
665
  "json": {
@@ -677,6 +684,16 @@
677
684
  "multiple": false,
678
685
  "type": "option"
679
686
  },
687
+ "source-org": {
688
+ "char": "o",
689
+ "name": "source-org",
690
+ "noCacheDefault": true,
691
+ "required": true,
692
+ "summary": "Username or alias of the namespaced scratch org that contains the agent which this template is based on.",
693
+ "hasDynamicHelp": true,
694
+ "multiple": false,
695
+ "type": "option"
696
+ },
680
697
  "agent-version": {
681
698
  "name": "agent-version",
682
699
  "required": true,
@@ -693,16 +710,24 @@
693
710
  "hasDynamicHelp": false,
694
711
  "multiple": false,
695
712
  "type": "option"
713
+ },
714
+ "output-dir": {
715
+ "char": "r",
716
+ "name": "output-dir",
717
+ "summary": "Directory where the generated BotTemplate and GenAiPlannerBundle files are saved.",
718
+ "hasDynamicHelp": false,
719
+ "multiple": false,
720
+ "type": "option"
696
721
  }
697
722
  },
698
- "hasDynamicHelp": false,
723
+ "hasDynamicHelp": true,
699
724
  "hiddenAliases": [],
700
725
  "id": "agent:generate:template",
701
726
  "pluginAlias": "@salesforce/plugin-agent",
702
727
  "pluginName": "@salesforce/plugin-agent",
703
728
  "pluginType": "core",
704
729
  "strict": true,
705
- "summary": "Generate an agent template from an existing agent in your DX project so you can then package the template in a managed package.",
730
+ "summary": "Generate an agent template from an existing agent in your DX project so you can then package the template in a second-generation managed package.",
706
731
  "enableJsonFlag": true,
707
732
  "requiresProject": true,
708
733
  "isESM": true,
@@ -791,13 +816,14 @@
791
816
  "test-spec:generate:agent"
792
817
  ]
793
818
  },
794
- "agent:publish:authoring-bundle": {
819
+ "agent:test:create": {
795
820
  "aliases": [],
796
821
  "args": {},
797
- "description": "An authoring bundle is a metadata type (named aiAuthoringBundle) that provides the blueprint for an agent. The metadata type contains two files: the standard metatada XML file and an Agent Script file (extension \".agent\") that fully describes the agent using the Agent Script language.\n\nWhen you publish an authoring bundle to your org, a number of things happen. First, this command validates that the Agent Script file successfully compiles. If there are compilation errors, the command exits and you must fix the Agent Script file to continue. Once the Agent Script file compiles, then it's published to the org, which in turn creates new associated metadata (Bot, BotVersion, GenAiX), or new versions of the metadata if the agent already exists. The new or updated metadata is retrieved back to your DX project; specify the --skip-retrieve flag to skip this step. Finally, the authoring bundle metadata (AiAuthoringBundle) is deployed to your org.\n\nThis command uses the API name of the authoring bundle.",
822
+ "description": "To run this command, you must have an agent test spec file, which is a YAML file that lists the test cases for testing a specific agent. Use the \"agent generate test-spec\" CLI command to generate a test spec file. Then specify the file to this command with the --spec flag, or run this command with no flags to be prompted.\n\nWhen this command completes, your org contains the new agent test, which you can view and edit using the Testing Center UI. This command also retrieves the metadata component (AiEvaluationDefinition) associated with the new test to your local Salesforce DX project and displays its filename.\n\nAfter you've created the test in the org, use the \"agent test run\" command to run it.",
798
823
  "examples": [
799
- "Publish an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
800
- "Publish an authoring bundle with API name MyAuthoringBundle to the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --api-name MyAuthoringbundle --target-org my-dev-org"
824
+ "Create an agent test interactively and be prompted for the test spec and API name of the test in the org; use the default org:\n<%= config.bin %> <%= command.id %>",
825
+ "Create an agent test and use flags to specify all required information; if a test with same API name already exists in the org, overwrite it without confirmation. Use the org with alias \"my-org\":\n<%= config.bin %> <%= command.id %> --spec specs/Resort_Manager-testSpec.yaml --api-name Resort_Manager_Test --force-overwrite --target-org my-org",
826
+ "Preview what the agent test metadata (AiEvaluationDefinition) looks like without deploying it to your default org:\n<%= config.bin %> <%= command.id %> --spec specs/Resort_Manager-testSpec.yaml --api-name Resort_Manager_Test --preview"
801
827
  ],
802
828
  "flags": {
803
829
  "json": {
@@ -815,6 +841,20 @@
815
841
  "multiple": false,
816
842
  "type": "option"
817
843
  },
844
+ "api-name": {
845
+ "name": "api-name",
846
+ "summary": "API name of the new test; the API name must not exist in the org.",
847
+ "hasDynamicHelp": false,
848
+ "multiple": false,
849
+ "type": "option"
850
+ },
851
+ "spec": {
852
+ "name": "spec",
853
+ "summary": "Path to the test spec YAML file.",
854
+ "hasDynamicHelp": false,
855
+ "multiple": false,
856
+ "type": "option"
857
+ },
818
858
  "target-org": {
819
859
  "char": "o",
820
860
  "name": "target-org",
@@ -832,63 +872,53 @@
832
872
  "multiple": false,
833
873
  "type": "option"
834
874
  },
835
- "api-name": {
836
- "char": "n",
837
- "name": "api-name",
838
- "summary": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
839
- "hasDynamicHelp": false,
840
- "multiple": false,
841
- "type": "option"
875
+ "preview": {
876
+ "name": "preview",
877
+ "summary": "Preview the test metadata file (AiEvaluationDefinition) without deploying to your org.",
878
+ "allowNo": false,
879
+ "type": "boolean"
842
880
  },
843
- "skip-retrieve": {
844
- "name": "skip-retrieve",
845
- "summary": "Don't retrieve the metadata associated with the agent to your DX project.",
881
+ "force-overwrite": {
882
+ "name": "force-overwrite",
883
+ "summary": "Don't prompt for confirmation when overwriting an existing test (based on API name) in your org.",
846
884
  "allowNo": false,
847
885
  "type": "boolean"
848
886
  }
849
887
  },
850
888
  "hasDynamicHelp": true,
851
889
  "hiddenAliases": [],
852
- "id": "agent:publish:authoring-bundle",
890
+ "id": "agent:test:create",
853
891
  "pluginAlias": "@salesforce/plugin-agent",
854
892
  "pluginName": "@salesforce/plugin-agent",
855
893
  "pluginType": "core",
856
894
  "strict": true,
857
- "summary": "Publish an authoring bundle to your org, which results in a new agent or a new version of an existing agent.",
895
+ "summary": "Create an agent test in your org using a local test spec YAML file.",
858
896
  "enableJsonFlag": true,
859
- "requiresProject": true,
860
- "FLAGGABLE_PROMPTS": {
861
- "api-name": {
862
- "message": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
863
- "promptMessage": "API name of the authoring bundle to publish"
864
- }
865
- },
866
897
  "isESM": true,
867
898
  "relativePath": [
868
899
  "lib",
869
900
  "commands",
870
901
  "agent",
871
- "publish",
872
- "authoring-bundle.js"
902
+ "test",
903
+ "create.js"
873
904
  ],
874
905
  "aliasPermutations": [],
875
906
  "permutations": [
876
- "agent:publish:authoring-bundle",
877
- "publish:agent:authoring-bundle",
878
- "publish:authoring-bundle:agent",
879
- "agent:authoring-bundle:publish",
880
- "authoring-bundle:agent:publish",
881
- "authoring-bundle:publish:agent"
907
+ "agent:test:create",
908
+ "test:agent:create",
909
+ "test:create:agent",
910
+ "agent:create:test",
911
+ "create:agent:test",
912
+ "create:test:agent"
882
913
  ]
883
914
  },
884
- "agent:preview:end": {
915
+ "agent:test:list": {
885
916
  "aliases": [],
886
917
  "args": {},
887
- "description": "You must have previously started a programmatic agent preview session with the \"agent preview start\" command to then use this command to end it. This command also displays the local directory where the session trace files are stored. \n\nThe original \"agent preview start\" command outputs a session ID which you then use with the --session-id flag of this command to end the session. You don't have to specify the --session-id flag if an agent has only one active preview session. You must also use either the --authoring-bundle or --api-name flag to specify the API name of the authoring bundle or the published agent, respecitvely. To find either API name, navigate to your package directory in your DX project. The API name of an authoring bundle is the same as its directory name under the \"aiAuthoringBundles\" metadata directory. Similarly, the published agent's API name is the same as its directory name under the \"Bots\" metadata directory.",
918
+ "description": "The command outputs a table with the name (API name) of each test along with its unique ID and the date it was created in the org.",
888
919
  "examples": [
889
- "End a preview session of a published agent by specifying its session ID and API name ; use the default org:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --api-name My_Published_Agent",
890
- "Similar to previous example, but don't specify a session ID; you get an error if the published agent has more than one active session. Use the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --api-name My_Published_Agent --target-org my-dev-org",
891
- "End a preview session of an agent using its authoring bundle API name; you get an error if the agent has more than one active session.\n<%= config.bin %> <%= command.id %> --authoring-bundle My_Local_Agent"
920
+ "List the agent tests in your default org:\n<%= config.bin %> <%= command.id %>",
921
+ "List the agent tests in an org with alias \"my-org\"\"\n<%= config.bin %> <%= command.id %> --target-org my-org"
892
922
  ],
893
923
  "flags": {
894
924
  "json": {
@@ -922,68 +952,43 @@
922
952
  "hasDynamicHelp": false,
923
953
  "multiple": false,
924
954
  "type": "option"
925
- },
926
- "session-id": {
927
- "name": "session-id",
928
- "required": false,
929
- "summary": "Session ID outputted by \"agent preview start\". Not required when the agent has exactly one active session. Run \"agent preview sessions\" to see the list of all sessions.",
930
- "hasDynamicHelp": false,
931
- "multiple": false,
932
- "type": "option"
933
- },
934
- "api-name": {
935
- "char": "n",
936
- "name": "api-name",
937
- "summary": "API name of the activated published agent you want to preview.",
938
- "hasDynamicHelp": false,
939
- "multiple": false,
940
- "type": "option"
941
- },
942
- "authoring-bundle": {
943
- "name": "authoring-bundle",
944
- "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
945
- "hasDynamicHelp": false,
946
- "multiple": false,
947
- "type": "option"
948
955
  }
949
956
  },
950
957
  "hasDynamicHelp": true,
951
958
  "hiddenAliases": [],
952
- "id": "agent:preview:end",
959
+ "id": "agent:test:list",
953
960
  "pluginAlias": "@salesforce/plugin-agent",
954
961
  "pluginName": "@salesforce/plugin-agent",
955
962
  "pluginType": "core",
956
- "state": "beta",
957
963
  "strict": true,
958
- "summary": "End an existing programmatic agent preview session and get trace location.",
964
+ "summary": "List the available agent tests in your org.",
959
965
  "enableJsonFlag": true,
960
- "requiresProject": true,
961
966
  "isESM": true,
962
967
  "relativePath": [
963
968
  "lib",
964
969
  "commands",
965
970
  "agent",
966
- "preview",
967
- "end.js"
971
+ "test",
972
+ "list.js"
968
973
  ],
969
974
  "aliasPermutations": [],
970
975
  "permutations": [
971
- "agent:preview:end",
972
- "preview:agent:end",
973
- "preview:end:agent",
974
- "agent:end:preview",
975
- "end:agent:preview",
976
- "end:preview:agent"
976
+ "agent:test:list",
977
+ "test:agent:list",
978
+ "test:list:agent",
979
+ "agent:list:test",
980
+ "list:agent:test",
981
+ "list:test:agent"
977
982
  ]
978
983
  },
979
- "agent:preview:send": {
984
+ "agent:test:results": {
980
985
  "aliases": [],
981
986
  "args": {},
982
- "description": "You must have previously started a programmatic agent preview session with the \"agent preview start\" command to then use this command to send the agent a message (utterance). This command then displays the agent's response.\n\nThe original \"agent preview start\" command outputs a session ID which you then use with the --session-id flag of this command to send a message. You don't have to specify the --session-id flag if an agent has only one active preview session. You must also use either the --authoring-bundle or --api-name flag to specify the API name of the authoring bundle or the published agent, respecitvely. To find either API name, navigate to your package directory in your DX project. The API name of an authoring bundle is the same as its directory name under the \"aiAuthoringBundles\" metadata directory. Similarly, the published agent's API name is the same as its directory name under the \"Bots\" metadata directory.",
987
+ "description": "This command requires a job ID, which the original \"agent test run\" command displays when it completes. You can also use the --use-most-recent flag to see results for the most recently run agent test.\n\nBy default, this command outputs test results in human-readable tables for each test case. 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.",
983
988
  "examples": [
984
- "Send a message to an activated published agent using its API name and session ID; use the default org:\n<%= config.bin %> <%= command.id %> --utterance \"What can you help me with?\" --api-name My_Published_Agent --session-id <SESSION_ID>",
985
- "Similar to previous example, but don't specify a session ID; you get an error if the agent has more than one active session. Use the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --utterance \"What can you help me with?\" --api-name My_Published_Agent --target-org my-dev-org",
986
- "Send a message to an agent using its authoring bundle API name; you get an error if the agent has more than one active session:\n<%= config.bin %> <%= command.id %> --utterance \"what can you help me with?\" --authoring-bundle My_Local_Agent"
989
+ "Get the results of an agent test run in your default org using its job ID:\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ",
990
+ "Get the results of the most recently run agent test in an org with alias \"my-org\":\n<%= config.bin %> <%= command.id %> --use-most-recent --target-org my-org",
991
+ "Get the results of the most recently run agent test in your default org, and write the JSON-formatted results into a directory called \"test-results\":\n<%= config.bin %> <%= command.id %> --use-most-recent --output-dir ./test-results --result-format json"
987
992
  ],
988
993
  "flags": {
989
994
  "json": {
@@ -1018,129 +1023,81 @@
1018
1023
  "multiple": false,
1019
1024
  "type": "option"
1020
1025
  },
1021
- "session-id": {
1022
- "name": "session-id",
1023
- "required": false,
1024
- "summary": "Session ID outputted by \"agent preview start\". Not required when the agent has exactly one active session. Run \"agent preview sessions\" to see list of all sessions.",
1025
- "hasDynamicHelp": false,
1026
- "multiple": false,
1027
- "type": "option"
1028
- },
1029
- "utterance": {
1030
- "char": "u",
1031
- "name": "utterance",
1026
+ "job-id": {
1027
+ "char": "i",
1028
+ "name": "job-id",
1032
1029
  "required": true,
1033
- "summary": "Utterance to send to the agent, enclosed in double quotes.",
1030
+ "summary": "Job ID of the completed agent test run.",
1034
1031
  "hasDynamicHelp": false,
1035
1032
  "multiple": false,
1036
1033
  "type": "option"
1037
1034
  },
1038
- "api-name": {
1039
- "char": "n",
1040
- "name": "api-name",
1041
- "summary": "API name of the activated published agent you want to preview.",
1035
+ "result-format": {
1036
+ "name": "result-format",
1037
+ "summary": "Format of the agent test run results.",
1038
+ "default": "human",
1042
1039
  "hasDynamicHelp": false,
1043
1040
  "multiple": false,
1041
+ "options": [
1042
+ "json",
1043
+ "human",
1044
+ "junit",
1045
+ "tap"
1046
+ ],
1044
1047
  "type": "option"
1045
1048
  },
1046
- "authoring-bundle": {
1047
- "name": "authoring-bundle",
1048
- "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
1049
+ "output-dir": {
1050
+ "char": "d",
1051
+ "description": "If the agent test run completes, write the results to the specified directory. If the test is still running, the test results aren't written.",
1052
+ "name": "output-dir",
1053
+ "summary": "Directory to write the agent test results into.",
1049
1054
  "hasDynamicHelp": false,
1050
1055
  "multiple": false,
1051
1056
  "type": "option"
1057
+ },
1058
+ "verbose": {
1059
+ "description": "When enabled, includes detailed generated data (such as invoked actions) in the human-readable test results output. This is useful for debugging test failures and understanding what actions were actually invoked during the test run.\n\nThe generated data is in JSON format and includes the Apex classes or Flows that were invoked, the Salesforce objects that were touched, and so on. Use the JSON structure of this information to build the test case JSONPath expression when using custom evaluations.",
1060
+ "name": "verbose",
1061
+ "summary": "Show generated data in the test results output.",
1062
+ "allowNo": false,
1063
+ "type": "boolean"
1052
1064
  }
1053
1065
  },
1054
1066
  "hasDynamicHelp": true,
1055
1067
  "hiddenAliases": [],
1056
- "id": "agent:preview:send",
1068
+ "id": "agent:test:results",
1057
1069
  "pluginAlias": "@salesforce/plugin-agent",
1058
1070
  "pluginName": "@salesforce/plugin-agent",
1059
1071
  "pluginType": "core",
1060
- "state": "beta",
1061
1072
  "strict": true,
1062
- "summary": "Send a message to an existing agent preview session.",
1073
+ "summary": "Get the results of a completed agent test run.",
1063
1074
  "enableJsonFlag": true,
1064
- "requiresProject": true,
1065
1075
  "isESM": true,
1066
1076
  "relativePath": [
1067
1077
  "lib",
1068
1078
  "commands",
1069
1079
  "agent",
1070
- "preview",
1071
- "send.js"
1080
+ "test",
1081
+ "results.js"
1072
1082
  ],
1073
1083
  "aliasPermutations": [],
1074
1084
  "permutations": [
1075
- "agent:preview:send",
1076
- "preview:agent:send",
1077
- "preview:send:agent",
1078
- "agent:send:preview",
1079
- "send:agent:preview",
1080
- "send:preview:agent"
1085
+ "agent:test:results",
1086
+ "test:agent:results",
1087
+ "test:results:agent",
1088
+ "agent:results:test",
1089
+ "results:agent:test",
1090
+ "results:test:agent"
1081
1091
  ]
1082
1092
  },
1083
- "agent:preview:sessions": {
1093
+ "agent:test:resume": {
1084
1094
  "aliases": [],
1085
1095
  "args": {},
1086
- "description": "This command lists the agent preview sessions that were started with the \"agent preview start\" command and are still in the local cache. Use this command to discover specific session IDs that you can pass to the \"agent preview send\" or \"agent preview end\" commands with the --session-id flag.\n\nProgrammatic agent preview sessions can be started for both published activated agents and by using an agent's local authoring bundle, which contains its Agent Script file. In this command's output table, the Agent column contains either the API name of the authoring bundle or the published agent, whichever was used when starting the session. In the table, if the same API name has multiple rows with different session IDs, then it means that you previously started multiple preview sessions with the associated agent.",
1096
+ "description": "This command requires a job ID, which the original \"agent test run\" command displays when it completes. You can also use the --use-most-recent flag to see results for the most recently run agent test.\n\nUse the --wait flag to specify the number of minutes for this 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, the CLI returns control of the terminal to you, and you must run \"agent test resume\" again.\n\nBy default, this command outputs test results in human-readable tables for each test case. 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.",
1087
1097
  "examples": [
1088
- "List all cached agent preview sessions:\n<%= config.bin %> <%= command.id %>"
1089
- ],
1090
- "flags": {
1091
- "json": {
1092
- "description": "Format output as json.",
1093
- "helpGroup": "GLOBAL",
1094
- "name": "json",
1095
- "allowNo": false,
1096
- "type": "boolean"
1097
- },
1098
- "flags-dir": {
1099
- "helpGroup": "GLOBAL",
1100
- "name": "flags-dir",
1101
- "summary": "Import flag values from a directory.",
1102
- "hasDynamicHelp": false,
1103
- "multiple": false,
1104
- "type": "option"
1105
- }
1106
- },
1107
- "hasDynamicHelp": false,
1108
- "hiddenAliases": [],
1109
- "id": "agent:preview:sessions",
1110
- "pluginAlias": "@salesforce/plugin-agent",
1111
- "pluginName": "@salesforce/plugin-agent",
1112
- "pluginType": "core",
1113
- "state": "beta",
1114
- "strict": true,
1115
- "summary": "List all known programmatic agent preview sessions.",
1116
- "enableJsonFlag": true,
1117
- "requiresProject": true,
1118
- "isESM": true,
1119
- "relativePath": [
1120
- "lib",
1121
- "commands",
1122
- "agent",
1123
- "preview",
1124
- "sessions.js"
1125
- ],
1126
- "aliasPermutations": [],
1127
- "permutations": [
1128
- "agent:preview:sessions",
1129
- "preview:agent:sessions",
1130
- "preview:sessions:agent",
1131
- "agent:sessions:preview",
1132
- "sessions:agent:preview",
1133
- "sessions:preview:agent"
1134
- ]
1135
- },
1136
- "agent:preview:start": {
1137
- "aliases": [],
1138
- "args": {},
1139
- "description": "This command outputs a session ID that you then use with the \"agent preview send\" command to send an utterance to the agent. Use the \"agent preview sessions\" command to list all active sessions and the \"agent preview end\" command to end a specific session.\n\nIdentify the agent you want to start previewing with either the --authoring-bundle flag to specify a local authoring bundle's API name or --api-name to specify an activated published agent's API name. To find either API name, navigate to your package directory in your DX project. The API name of an authoring bundle is the same as its directory name under the \"aiAuthoringBundles\" metadata directory. Similarly, the published agent's API name is the same as its directory name under the \"Bots\" metadata directory. \n\nWhen starting a preview session using the authoring bundle, which contains the agent's Agent Script file, the preview uses mocked actions by default. Specify --use-live-actions for live mode, which uses the real Apex classes, flows, etc, in the org for the actions.",
1140
- "examples": [
1141
- "Start a programmatic agent preview session by specifying an authoring bundle; uses mocked actions by default. Use the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --authoring-bundle My_Agent_Bundle --target-org my-dev-org",
1142
- "Similar to previous example but use live actions and the default org:\n<%= config.bin %> <%= command.id %> --authoring-bundle My_Agent_Bundle --use-live-actions",
1143
- "Start a preview session with an activated published agent:\n<%= config.bin %> <%= command.id %> --api-name My_Published_Agent"
1098
+ "Resume an agent test in your default org using a job ID:\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ",
1099
+ "Resume the most recently-run agent test in an org with alias \"my-org\" org; wait 10 minutes for the tests to finish:\n<%= config.bin %> <%= command.id %> --use-most-recent --wait 10 --target-org my-org",
1100
+ "Resume the most recent agent test in your default org, and write the JSON-formatted results into a directory called \"test-results\":\n<%= config.bin %> <%= command.id %> --use-most-recent --output-dir ./test-results --result-format json"
1144
1101
  ],
1145
1102
  "flags": {
1146
1103
  "json": {
@@ -1175,65 +1132,99 @@
1175
1132
  "multiple": false,
1176
1133
  "type": "option"
1177
1134
  },
1178
- "api-name": {
1179
- "char": "n",
1180
- "name": "api-name",
1181
- "summary": "API name of the activated published agent you want to preview.",
1135
+ "job-id": {
1136
+ "char": "i",
1137
+ "name": "job-id",
1138
+ "summary": "Job ID of the original agent test run.",
1182
1139
  "hasDynamicHelp": false,
1183
1140
  "multiple": false,
1184
1141
  "type": "option"
1185
1142
  },
1186
- "authoring-bundle": {
1187
- "name": "authoring-bundle",
1188
- "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
1143
+ "use-most-recent": {
1144
+ "char": "r",
1145
+ "name": "use-most-recent",
1146
+ "summary": "Use the job ID of the most recent agent test run.",
1147
+ "allowNo": false,
1148
+ "type": "boolean"
1149
+ },
1150
+ "wait": {
1151
+ "char": "w",
1152
+ "name": "wait",
1153
+ "summary": "Number of minutes to wait for the command to complete and display results to the terminal window.",
1154
+ "default": "5 minutes",
1155
+ "hasDynamicHelp": true,
1156
+ "multiple": false,
1157
+ "type": "option"
1158
+ },
1159
+ "result-format": {
1160
+ "name": "result-format",
1161
+ "summary": "Format of the agent test run results.",
1162
+ "default": "human",
1189
1163
  "hasDynamicHelp": false,
1190
1164
  "multiple": false,
1165
+ "options": [
1166
+ "json",
1167
+ "human",
1168
+ "junit",
1169
+ "tap"
1170
+ ],
1191
1171
  "type": "option"
1192
1172
  },
1193
- "use-live-actions": {
1194
- "name": "use-live-actions",
1195
- "summary": "Use real actions in the org; if not specified, preview uses AI to simulate (mock) actions.",
1173
+ "output-dir": {
1174
+ "char": "d",
1175
+ "description": "If the agent test run completes, write the results to the specified directory. If the test is still running, the test results aren't written.",
1176
+ "name": "output-dir",
1177
+ "summary": "Directory to write the agent test results into.",
1178
+ "hasDynamicHelp": false,
1179
+ "multiple": false,
1180
+ "type": "option"
1181
+ },
1182
+ "verbose": {
1183
+ "description": "When enabled, includes detailed generated data (such as invoked actions) in the human-readable test results output. This is useful for debugging test failures and understanding what actions were actually invoked during the test run.\n\nThe generated data is in JSON format and includes the Apex classes or Flows that were invoked, the Salesforce objects that were touched, and so on. Use the JSON structure of this information to build the test case JSONPath expression when using custom evaluations.",
1184
+ "name": "verbose",
1185
+ "summary": "Show generated data in the test results output.",
1196
1186
  "allowNo": false,
1197
1187
  "type": "boolean"
1198
1188
  }
1199
1189
  },
1200
1190
  "hasDynamicHelp": true,
1201
1191
  "hiddenAliases": [],
1202
- "id": "agent:preview:start",
1192
+ "id": "agent:test:resume",
1203
1193
  "pluginAlias": "@salesforce/plugin-agent",
1204
1194
  "pluginName": "@salesforce/plugin-agent",
1205
1195
  "pluginType": "core",
1206
- "state": "beta",
1207
1196
  "strict": true,
1208
- "summary": "Start a programmatic agent preview session.",
1197
+ "summary": "Resume an agent test that you previously started in your org so you can view the test results.",
1209
1198
  "enableJsonFlag": true,
1210
- "requiresProject": true,
1211
1199
  "isESM": true,
1212
1200
  "relativePath": [
1213
1201
  "lib",
1214
1202
  "commands",
1215
1203
  "agent",
1216
- "preview",
1217
- "start.js"
1204
+ "test",
1205
+ "resume.js"
1218
1206
  ],
1219
1207
  "aliasPermutations": [],
1220
1208
  "permutations": [
1221
- "agent:preview:start",
1222
- "preview:agent:start",
1223
- "preview:start:agent",
1224
- "agent:start:preview",
1225
- "start:agent:preview",
1226
- "start:preview:agent"
1209
+ "agent:test:resume",
1210
+ "test:agent:resume",
1211
+ "test:resume:agent",
1212
+ "agent:resume:test",
1213
+ "resume:agent:test",
1214
+ "resume:test:agent"
1227
1215
  ]
1228
1216
  },
1229
- "agent:test:create": {
1217
+ "agent:test:run-eval": {
1230
1218
  "aliases": [],
1231
1219
  "args": {},
1232
- "description": "To run this command, you must have an agent test spec file, which is a YAML file that lists the test cases for testing a specific agent. Use the \"agent generate test-spec\" CLI command to generate a test spec file. Then specify the file to this command with the --spec flag, or run this command with no flags to be prompted.\n\nWhen this command completes, your org contains the new agent test, which you can view and edit using the Testing Center UI. This command also retrieves the metadata component (AiEvaluationDefinition) associated with the new test to your local Salesforce DX project and displays its filename.\n\nAfter you've created the test in the org, use the \"agent test run\" command to run it.",
1220
+ "description": "Execute rich evaluation tests against an Agentforce agent using the Einstein Evaluation API. Supports both YAML test specs (same format as `sf agent generate test-spec`) and JSON payloads.\n\nWhen you provide a YAML test spec, the command automatically translates test cases into Evaluation API calls and infers the agent name from the spec's `subjectName` field. This means you can use the same test spec with both `sf agent test run` and `sf agent test run-eval`. YAML test specs also support contextVariables, which allow you to inject contextual data (such as CaseId or RoutableId) into agent sessions for testing with different contexts.\n\nWhen you provide a JSON payload, it's sent directly to the API with optional normalization. The normalizer auto-corrects common field name mistakes, converts shorthand references to JSONPath, and injects defaults. Use `--no-normalize` to disable this auto-normalization. JSON payloads can also include context_variables on agent.create_session steps for the same contextual testing capabilities.\n\nSupports 8+ evaluator types, including topic routing assertions, action invocation checks, string/numeric assertions, semantic similarity scoring, and LLM-based quality ratings.",
1233
1221
  "examples": [
1234
- "Create an agent test interactively and be prompted for the test spec and API name of the test in the org; use the default org:\n<%= config.bin %> <%= command.id %>",
1235
- "Create an agent test and use flags to specify all required information; if a test with same API name already exists in the org, overwrite it without confirmation. Use the org with alias \"my-org\":\n<%= config.bin %> <%= command.id %> --spec specs/Resort_Manager-testSpec.yaml --api-name Resort_Manager_Test --force-overwrite --target-org my-org",
1236
- "Preview what the agent test metadata (AiEvaluationDefinition) looks like without deploying it to your default org:\n<%= config.bin %> <%= command.id %> --spec specs/Resort_Manager-testSpec.yaml --api-name Resort_Manager_Test --preview"
1222
+ "Run tests using a YAML test spec on the org with alias \"my-org\":\n<%= config.bin %> <%= command.id %> --spec tests/my-agent-testSpec.yaml --target-org my-org",
1223
+ "Run tests using a YAML spec with explicit agent name override; use your default org:\n<%= config.bin %> <%= command.id %> --spec tests/my-agent-testSpec.yaml --api-name My_Agent --target-org my-org",
1224
+ "Run tests using a JSON payload:\n<%= config.bin %> <%= command.id %> --spec tests/eval-payload.json --target-org my-org",
1225
+ "Run tests and output results in JUnit format; useful for continuous integration and deployment (CI/CD):\n<%= config.bin %> <%= command.id %> --spec tests/my-agent-testSpec.yaml --target-org my-org --result-format junit",
1226
+ "Run tests with contextVariables to inject contextual data into agent sessions (add contextVariables to test cases in your YAML spec):\n<%= config.bin %> <%= command.id %> --spec tests/agent-with-context.yaml --target-org my-org",
1227
+ "Pipe JSON payload from stdin (--spec flag is automatically populated from stdin):\n$ echo '{\"tests\":[...]}' | <%= config.bin %> <%= command.id %> --spec --target-org my-org"
1237
1228
  ],
1238
1229
  "flags": {
1239
1230
  "json": {
@@ -1251,20 +1242,6 @@
1251
1242
  "multiple": false,
1252
1243
  "type": "option"
1253
1244
  },
1254
- "api-name": {
1255
- "name": "api-name",
1256
- "summary": "API name of the new test; the API name must not exist in the org.",
1257
- "hasDynamicHelp": false,
1258
- "multiple": false,
1259
- "type": "option"
1260
- },
1261
- "spec": {
1262
- "name": "spec",
1263
- "summary": "Path to the test spec YAML file.",
1264
- "hasDynamicHelp": false,
1265
- "multiple": false,
1266
- "type": "option"
1267
- },
1268
1245
  "target-org": {
1269
1246
  "char": "o",
1270
1247
  "name": "target-org",
@@ -1282,27 +1259,71 @@
1282
1259
  "multiple": false,
1283
1260
  "type": "option"
1284
1261
  },
1285
- "preview": {
1286
- "name": "preview",
1287
- "summary": "Preview the test metadata file (AiEvaluationDefinition) without deploying to your org.",
1288
- "allowNo": false,
1289
- "type": "boolean"
1262
+ "spec": {
1263
+ "char": "s",
1264
+ "name": "spec",
1265
+ "required": true,
1266
+ "summary": "Path to test spec file (YAML or JSON). Supports reading from stdin when piping content.",
1267
+ "hasDynamicHelp": false,
1268
+ "multiple": false,
1269
+ "type": "option"
1290
1270
  },
1291
- "force-overwrite": {
1292
- "name": "force-overwrite",
1293
- "summary": "Don't prompt for confirmation when overwriting an existing test (based on API name) in your org.",
1271
+ "api-name": {
1272
+ "char": "n",
1273
+ "name": "api-name",
1274
+ "summary": "Agent DeveloperName (also called API name) to resolve agent_id and agent_version_id. Auto-inferred from the YAML spec's subjectName.",
1275
+ "hasDynamicHelp": false,
1276
+ "multiple": false,
1277
+ "type": "option"
1278
+ },
1279
+ "wait": {
1280
+ "char": "w",
1281
+ "name": "wait",
1282
+ "summary": "Number of minutes to wait for results.",
1283
+ "default": 10,
1284
+ "hasDynamicHelp": false,
1285
+ "multiple": false,
1286
+ "type": "option"
1287
+ },
1288
+ "result-format": {
1289
+ "name": "result-format",
1290
+ "summary": "Format of the agent test run results.",
1291
+ "default": "human",
1292
+ "hasDynamicHelp": false,
1293
+ "multiple": false,
1294
+ "options": [
1295
+ "json",
1296
+ "human",
1297
+ "junit",
1298
+ "tap"
1299
+ ],
1300
+ "type": "option"
1301
+ },
1302
+ "batch-size": {
1303
+ "name": "batch-size",
1304
+ "summary": "Number of tests per API request (max 5).",
1305
+ "default": 5,
1306
+ "hasDynamicHelp": false,
1307
+ "multiple": false,
1308
+ "type": "option"
1309
+ },
1310
+ "no-normalize": {
1311
+ "name": "no-normalize",
1312
+ "summary": "Disable auto-normalization of field names and shorthand references.",
1294
1313
  "allowNo": false,
1295
1314
  "type": "boolean"
1296
1315
  }
1297
1316
  },
1298
1317
  "hasDynamicHelp": true,
1318
+ "hidden": true,
1299
1319
  "hiddenAliases": [],
1300
- "id": "agent:test:create",
1320
+ "id": "agent:test:run-eval",
1301
1321
  "pluginAlias": "@salesforce/plugin-agent",
1302
1322
  "pluginName": "@salesforce/plugin-agent",
1303
1323
  "pluginType": "core",
1324
+ "state": "beta",
1304
1325
  "strict": true,
1305
- "summary": "Create an agent test in your org using a local test spec YAML file.",
1326
+ "summary": "Run evaluation tests against an Agentforce agent.",
1306
1327
  "enableJsonFlag": true,
1307
1328
  "isESM": true,
1308
1329
  "relativePath": [
@@ -1310,25 +1331,26 @@
1310
1331
  "commands",
1311
1332
  "agent",
1312
1333
  "test",
1313
- "create.js"
1334
+ "run-eval.js"
1314
1335
  ],
1315
1336
  "aliasPermutations": [],
1316
1337
  "permutations": [
1317
- "agent:test:create",
1318
- "test:agent:create",
1319
- "test:create:agent",
1320
- "agent:create:test",
1321
- "create:agent:test",
1322
- "create:test:agent"
1338
+ "agent:test:run-eval",
1339
+ "test:agent:run-eval",
1340
+ "test:run-eval:agent",
1341
+ "agent:run-eval:test",
1342
+ "run-eval:agent:test",
1343
+ "run-eval:test:agent"
1323
1344
  ]
1324
1345
  },
1325
- "agent:test:list": {
1346
+ "agent:test:run": {
1326
1347
  "aliases": [],
1327
1348
  "args": {},
1328
- "description": "The command outputs a table with the name (API name) of each test along with its unique ID and the date it was created in the org.",
1349
+ "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.",
1329
1350
  "examples": [
1330
- "List the agent tests in your default org:\n<%= config.bin %> <%= command.id %>",
1331
- "List the agent tests in an org with alias \"my-org\"\"\n<%= config.bin %> <%= command.id %> --target-org my-org"
1351
+ "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",
1352
+ "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",
1353
+ "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"
1332
1354
  ],
1333
1355
  "flags": {
1334
1356
  "json": {
@@ -1362,16 +1384,62 @@
1362
1384
  "hasDynamicHelp": false,
1363
1385
  "multiple": false,
1364
1386
  "type": "option"
1387
+ },
1388
+ "api-name": {
1389
+ "char": "n",
1390
+ "name": "api-name",
1391
+ "summary": "API name of the agent test to run; corresponds to the name of the AiEvaluationDefinition metadata component that implements the agent test.",
1392
+ "hasDynamicHelp": false,
1393
+ "multiple": false,
1394
+ "type": "option"
1395
+ },
1396
+ "wait": {
1397
+ "char": "w",
1398
+ "name": "wait",
1399
+ "summary": "Number of minutes to wait for the command to complete and display results to the terminal window.",
1400
+ "hasDynamicHelp": true,
1401
+ "multiple": false,
1402
+ "type": "option"
1403
+ },
1404
+ "result-format": {
1405
+ "name": "result-format",
1406
+ "summary": "Format of the agent test run results.",
1407
+ "default": "human",
1408
+ "hasDynamicHelp": false,
1409
+ "multiple": false,
1410
+ "options": [
1411
+ "json",
1412
+ "human",
1413
+ "junit",
1414
+ "tap"
1415
+ ],
1416
+ "type": "option"
1417
+ },
1418
+ "output-dir": {
1419
+ "char": "d",
1420
+ "description": "If the agent test run completes, write the results to the specified directory. If the test is still running, the test results aren't written.",
1421
+ "name": "output-dir",
1422
+ "summary": "Directory to write the agent test results into.",
1423
+ "hasDynamicHelp": false,
1424
+ "multiple": false,
1425
+ "type": "option"
1426
+ },
1427
+ "verbose": {
1428
+ "description": "When enabled, includes detailed generated data (such as invoked actions) in the human-readable test results output. This is useful for debugging test failures and understanding what actions were actually invoked during the test run.\n\nThe generated data is in JSON format and includes the Apex classes or Flows that were invoked, the Salesforce objects that were touched, and so on. Use the JSON structure of this information to build the test case JSONPath expression when using custom evaluations.",
1429
+ "name": "verbose",
1430
+ "summary": "Show generated data in the test results output.",
1431
+ "allowNo": false,
1432
+ "type": "boolean"
1365
1433
  }
1366
1434
  },
1367
1435
  "hasDynamicHelp": true,
1368
1436
  "hiddenAliases": [],
1369
- "id": "agent:test:list",
1437
+ "id": "agent:test:run",
1370
1438
  "pluginAlias": "@salesforce/plugin-agent",
1371
1439
  "pluginName": "@salesforce/plugin-agent",
1372
1440
  "pluginType": "core",
1373
1441
  "strict": true,
1374
- "summary": "List the available agent tests in your org.",
1442
+ "summary": "Start an agent test in your org.",
1375
1443
  "enableJsonFlag": true,
1376
1444
  "isESM": true,
1377
1445
  "relativePath": [
@@ -1379,26 +1447,25 @@
1379
1447
  "commands",
1380
1448
  "agent",
1381
1449
  "test",
1382
- "list.js"
1450
+ "run.js"
1383
1451
  ],
1384
1452
  "aliasPermutations": [],
1385
1453
  "permutations": [
1386
- "agent:test:list",
1387
- "test:agent:list",
1388
- "test:list:agent",
1389
- "agent:list:test",
1390
- "list:agent:test",
1391
- "list:test:agent"
1454
+ "agent:test:run",
1455
+ "test:agent:run",
1456
+ "test:run:agent",
1457
+ "agent:run:test",
1458
+ "run:agent:test",
1459
+ "run:test:agent"
1392
1460
  ]
1393
1461
  },
1394
- "agent:test:results": {
1462
+ "agent:validate:authoring-bundle": {
1395
1463
  "aliases": [],
1396
1464
  "args": {},
1397
- "description": "This command requires a job ID, which the original \"agent test run\" command displays when it completes. You can also use the --use-most-recent flag to see results for the most recently run agent test.\n\nBy default, this command outputs test results in human-readable tables for each test case. 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.",
1465
+ "description": "An authoring bundle is a metadata type (named aiAuthoringBundle) that provides the blueprint for an agent. The metadata type contains two files: the standard metatada XML file and an Agent Script file (extension \".agent\") that fully describes the agent using the Agent Script language.\n\nThis command validates that the Agent Script file in the authoring bundle compiles without errors so that you can later publish the bundle to your org. Use this command while you code the Agent Script file to ensure that it's valid. If the validation fails, the command outputs the list of syntax errors, a brief description of the error, and the location in the Agent Script file where the error occurred.\n\nThis command uses the API name of the authoring bundle. If you don't provide an API name with the --api-name flag, the command searches the current DX project and outputs a list of authoring bundles that it found for you to choose from.",
1398
1466
  "examples": [
1399
- "Get the results of an agent test run in your default org using its job ID:\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ",
1400
- "Get the results of the most recently run agent test in an org with alias \"my-org\":\n<%= config.bin %> <%= command.id %> --use-most-recent --target-org my-org",
1401
- "Get the results of the most recently run agent test in your default org, and write the JSON-formatted results into a directory called \"test-results\":\n<%= config.bin %> <%= command.id %> --use-most-recent --output-dir ./test-results --result-format json"
1467
+ "Validate an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
1468
+ "Validate an authoring bundle with API name MyAuthoringBundle; use the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --api-name MyAuthoringBundle --target-org my-dev-org"
1402
1469
  ],
1403
1470
  "flags": {
1404
1471
  "json": {
@@ -1433,81 +1500,57 @@
1433
1500
  "multiple": false,
1434
1501
  "type": "option"
1435
1502
  },
1436
- "job-id": {
1437
- "char": "i",
1438
- "name": "job-id",
1439
- "required": true,
1440
- "summary": "Job ID of the completed agent test run.",
1441
- "hasDynamicHelp": false,
1442
- "multiple": false,
1443
- "type": "option"
1444
- },
1445
- "result-format": {
1446
- "name": "result-format",
1447
- "summary": "Format of the agent test run results.",
1448
- "default": "human",
1449
- "hasDynamicHelp": false,
1450
- "multiple": false,
1451
- "options": [
1452
- "json",
1453
- "human",
1454
- "junit",
1455
- "tap"
1456
- ],
1457
- "type": "option"
1458
- },
1459
- "output-dir": {
1460
- "char": "d",
1461
- "description": "If the agent test run completes, write the results to the specified directory. If the test is still running, the test results aren't written.",
1462
- "name": "output-dir",
1463
- "summary": "Directory to write the agent test results into.",
1503
+ "api-name": {
1504
+ "char": "n",
1505
+ "name": "api-name",
1506
+ "summary": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
1464
1507
  "hasDynamicHelp": false,
1465
1508
  "multiple": false,
1466
1509
  "type": "option"
1467
- },
1468
- "verbose": {
1469
- "description": "When enabled, includes detailed generated data (such as invoked actions) in the human-readable test results output. This is useful for debugging test failures and understanding what actions were actually invoked during the test run.\n\nThe generated data is in JSON format and includes the Apex classes or Flows that were invoked, the Salesforce objects that were touched, and so on. Use the JSON structure of this information to build the test case JSONPath expression when using custom evaluations.",
1470
- "name": "verbose",
1471
- "summary": "Show generated data in the test results output.",
1472
- "allowNo": false,
1473
- "type": "boolean"
1474
1510
  }
1475
1511
  },
1476
1512
  "hasDynamicHelp": true,
1477
1513
  "hiddenAliases": [],
1478
- "id": "agent:test:results",
1514
+ "id": "agent:validate:authoring-bundle",
1479
1515
  "pluginAlias": "@salesforce/plugin-agent",
1480
1516
  "pluginName": "@salesforce/plugin-agent",
1481
1517
  "pluginType": "core",
1482
1518
  "strict": true,
1483
- "summary": "Get the results of a completed agent test run.",
1519
+ "summary": "Validate an authoring bundle to ensure its Agent Script file compiles successfully and can be used to publish an agent.",
1484
1520
  "enableJsonFlag": true,
1521
+ "requiresProject": true,
1522
+ "FLAGGABLE_PROMPTS": {
1523
+ "api-name": {
1524
+ "message": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
1525
+ "promptMessage": "API name of the authoring bundle to validate"
1526
+ }
1527
+ },
1485
1528
  "isESM": true,
1486
1529
  "relativePath": [
1487
1530
  "lib",
1488
1531
  "commands",
1489
1532
  "agent",
1490
- "test",
1491
- "results.js"
1533
+ "validate",
1534
+ "authoring-bundle.js"
1492
1535
  ],
1493
1536
  "aliasPermutations": [],
1494
1537
  "permutations": [
1495
- "agent:test:results",
1496
- "test:agent:results",
1497
- "test:results:agent",
1498
- "agent:results:test",
1499
- "results:agent:test",
1500
- "results:test:agent"
1538
+ "agent:validate:authoring-bundle",
1539
+ "validate:agent:authoring-bundle",
1540
+ "validate:authoring-bundle:agent",
1541
+ "agent:authoring-bundle:validate",
1542
+ "authoring-bundle:agent:validate",
1543
+ "authoring-bundle:validate:agent"
1501
1544
  ]
1502
1545
  },
1503
- "agent:test:resume": {
1546
+ "agent:preview:end": {
1504
1547
  "aliases": [],
1505
1548
  "args": {},
1506
- "description": "This command requires a job ID, which the original \"agent test run\" command displays when it completes. You can also use the --use-most-recent flag to see results for the most recently run agent test.\n\nUse the --wait flag to specify the number of minutes for this 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, the CLI returns control of the terminal to you, and you must run \"agent test resume\" again.\n\nBy default, this command outputs test results in human-readable tables for each test case. 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.",
1549
+ "description": "You must have previously started a programmatic agent preview session with the \"agent preview start\" command to then use this command to end it. This command also displays the local directory where the session trace files are stored. \n\nThe original \"agent preview start\" command outputs a session ID which you then use with the --session-id flag of this command to end the session. You don't have to specify the --session-id flag if an agent has only one active preview session. You must also use either the --authoring-bundle or --api-name flag to specify the API name of the authoring bundle or the published agent, respecitvely. To find either API name, navigate to your package directory in your DX project. The API name of an authoring bundle is the same as its directory name under the \"aiAuthoringBundles\" metadata directory. Similarly, the published agent's API name is the same as its directory name under the \"Bots\" metadata directory.",
1507
1550
  "examples": [
1508
- "Resume an agent test in your default org using a job ID:\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ",
1509
- "Resume the most recently-run agent test in an org with alias \"my-org\" org; wait 10 minutes for the tests to finish:\n<%= config.bin %> <%= command.id %> --use-most-recent --wait 10 --target-org my-org",
1510
- "Resume the most recent agent test in your default org, and write the JSON-formatted results into a directory called \"test-results\":\n<%= config.bin %> <%= command.id %> --use-most-recent --output-dir ./test-results --result-format json"
1551
+ "End a preview session of a published agent by specifying its session ID and API name ; use the default org:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --api-name My_Published_Agent",
1552
+ "Similar to previous example, but don't specify a session ID; you get an error if the published agent has more than one active session. Use the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --api-name My_Published_Agent --target-org my-dev-org",
1553
+ "End a preview session of an agent using its authoring bundle API name; you get an error if the agent has more than one active session.\n<%= config.bin %> <%= command.id %> --authoring-bundle My_Local_Agent"
1511
1554
  ],
1512
1555
  "flags": {
1513
1556
  "json": {
@@ -1542,99 +1585,67 @@
1542
1585
  "multiple": false,
1543
1586
  "type": "option"
1544
1587
  },
1545
- "job-id": {
1546
- "char": "i",
1547
- "name": "job-id",
1548
- "summary": "Job ID of the original agent test run.",
1588
+ "session-id": {
1589
+ "name": "session-id",
1590
+ "required": false,
1591
+ "summary": "Session ID outputted by \"agent preview start\". Not required when the agent has exactly one active session. Run \"agent preview sessions\" to see the list of all sessions.",
1549
1592
  "hasDynamicHelp": false,
1550
1593
  "multiple": false,
1551
1594
  "type": "option"
1552
1595
  },
1553
- "use-most-recent": {
1554
- "char": "r",
1555
- "name": "use-most-recent",
1556
- "summary": "Use the job ID of the most recent agent test run.",
1557
- "allowNo": false,
1558
- "type": "boolean"
1559
- },
1560
- "wait": {
1561
- "char": "w",
1562
- "name": "wait",
1563
- "summary": "Number of minutes to wait for the command to complete and display results to the terminal window.",
1564
- "default": "5 minutes",
1565
- "hasDynamicHelp": true,
1566
- "multiple": false,
1567
- "type": "option"
1568
- },
1569
- "result-format": {
1570
- "name": "result-format",
1571
- "summary": "Format of the agent test run results.",
1572
- "default": "human",
1596
+ "api-name": {
1597
+ "char": "n",
1598
+ "name": "api-name",
1599
+ "summary": "API name of the activated published agent you want to preview.",
1573
1600
  "hasDynamicHelp": false,
1574
1601
  "multiple": false,
1575
- "options": [
1576
- "json",
1577
- "human",
1578
- "junit",
1579
- "tap"
1580
- ],
1581
1602
  "type": "option"
1582
1603
  },
1583
- "output-dir": {
1584
- "char": "d",
1585
- "description": "If the agent test run completes, write the results to the specified directory. If the test is still running, the test results aren't written.",
1586
- "name": "output-dir",
1587
- "summary": "Directory to write the agent test results into.",
1604
+ "authoring-bundle": {
1605
+ "name": "authoring-bundle",
1606
+ "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
1588
1607
  "hasDynamicHelp": false,
1589
1608
  "multiple": false,
1590
1609
  "type": "option"
1591
- },
1592
- "verbose": {
1593
- "description": "When enabled, includes detailed generated data (such as invoked actions) in the human-readable test results output. This is useful for debugging test failures and understanding what actions were actually invoked during the test run.\n\nThe generated data is in JSON format and includes the Apex classes or Flows that were invoked, the Salesforce objects that were touched, and so on. Use the JSON structure of this information to build the test case JSONPath expression when using custom evaluations.",
1594
- "name": "verbose",
1595
- "summary": "Show generated data in the test results output.",
1596
- "allowNo": false,
1597
- "type": "boolean"
1598
1610
  }
1599
1611
  },
1600
1612
  "hasDynamicHelp": true,
1601
1613
  "hiddenAliases": [],
1602
- "id": "agent:test:resume",
1614
+ "id": "agent:preview:end",
1603
1615
  "pluginAlias": "@salesforce/plugin-agent",
1604
1616
  "pluginName": "@salesforce/plugin-agent",
1605
1617
  "pluginType": "core",
1618
+ "state": "beta",
1606
1619
  "strict": true,
1607
- "summary": "Resume an agent test that you previously started in your org so you can view the test results.",
1620
+ "summary": "End an existing programmatic agent preview session and get trace location.",
1608
1621
  "enableJsonFlag": true,
1622
+ "requiresProject": true,
1609
1623
  "isESM": true,
1610
1624
  "relativePath": [
1611
1625
  "lib",
1612
1626
  "commands",
1613
1627
  "agent",
1614
- "test",
1615
- "resume.js"
1616
- ],
1617
- "aliasPermutations": [],
1618
- "permutations": [
1619
- "agent:test:resume",
1620
- "test:agent:resume",
1621
- "test:resume:agent",
1622
- "agent:resume:test",
1623
- "resume:agent:test",
1624
- "resume:test:agent"
1628
+ "preview",
1629
+ "end.js"
1630
+ ],
1631
+ "aliasPermutations": [],
1632
+ "permutations": [
1633
+ "agent:preview:end",
1634
+ "preview:agent:end",
1635
+ "preview:end:agent",
1636
+ "agent:end:preview",
1637
+ "end:agent:preview",
1638
+ "end:preview:agent"
1625
1639
  ]
1626
1640
  },
1627
- "agent:test:run-eval": {
1641
+ "agent:preview:send": {
1628
1642
  "aliases": [],
1629
1643
  "args": {},
1630
- "description": "Execute rich evaluation tests against an Agentforce agent using the Einstein Evaluation API. Supports both YAML test specs (same format as `sf agent generate test-spec`) and JSON payloads.\n\nWhen you provide a YAML test spec, the command automatically translates test cases into Evaluation API calls and infers the agent name from the spec's `subjectName` field. This means you can use the same test spec with both `sf agent test run` and `sf agent test run-eval`. YAML test specs also support contextVariables, which allow you to inject contextual data (such as CaseId or RoutableId) into agent sessions for testing with different contexts.\n\nWhen you provide a JSON payload, it's sent directly to the API with optional normalization. The normalizer auto-corrects common field name mistakes, converts shorthand references to JSONPath, and injects defaults. Use `--no-normalize` to disable this auto-normalization. JSON payloads can also include context_variables on agent.create_session steps for the same contextual testing capabilities.\n\nSupports 8+ evaluator types, including topic routing assertions, action invocation checks, string/numeric assertions, semantic similarity scoring, and LLM-based quality ratings.",
1644
+ "description": "You must have previously started a programmatic agent preview session with the \"agent preview start\" command to then use this command to send the agent a message (utterance). This command then displays the agent's response.\n\nThe original \"agent preview start\" command outputs a session ID which you then use with the --session-id flag of this command to send a message. You don't have to specify the --session-id flag if an agent has only one active preview session. You must also use either the --authoring-bundle or --api-name flag to specify the API name of the authoring bundle or the published agent, respecitvely. To find either API name, navigate to your package directory in your DX project. The API name of an authoring bundle is the same as its directory name under the \"aiAuthoringBundles\" metadata directory. Similarly, the published agent's API name is the same as its directory name under the \"Bots\" metadata directory.",
1631
1645
  "examples": [
1632
- "Run tests using a YAML test spec on the org with alias \"my-org\":\n<%= config.bin %> <%= command.id %> --spec tests/my-agent-testSpec.yaml --target-org my-org",
1633
- "Run tests using a YAML spec with explicit agent name override; use your default org:\n<%= config.bin %> <%= command.id %> --spec tests/my-agent-testSpec.yaml --api-name My_Agent --target-org my-org",
1634
- "Run tests using a JSON payload:\n<%= config.bin %> <%= command.id %> --spec tests/eval-payload.json --target-org my-org",
1635
- "Run tests and output results in JUnit format; useful for continuous integration and deployment (CI/CD):\n<%= config.bin %> <%= command.id %> --spec tests/my-agent-testSpec.yaml --target-org my-org --result-format junit",
1636
- "Run tests with contextVariables to inject contextual data into agent sessions (add contextVariables to test cases in your YAML spec):\n<%= config.bin %> <%= command.id %> --spec tests/agent-with-context.yaml --target-org my-org",
1637
- "Pipe JSON payload from stdin (--spec flag is automatically populated from stdin):\n$ echo '{\"tests\":[...]}' | <%= config.bin %> <%= command.id %> --spec --target-org my-org"
1646
+ "Send a message to an activated published agent using its API name and session ID; use the default org:\n<%= config.bin %> <%= command.id %> --utterance \"What can you help me with?\" --api-name My_Published_Agent --session-id <SESSION_ID>",
1647
+ "Similar to previous example, but don't specify a session ID; you get an error if the agent has more than one active session. Use the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --utterance \"What can you help me with?\" --api-name My_Published_Agent --target-org my-dev-org",
1648
+ "Send a message to an agent using its authoring bundle API name; you get an error if the agent has more than one active session:\n<%= config.bin %> <%= command.id %> --utterance \"what can you help me with?\" --authoring-bundle My_Local_Agent"
1638
1649
  ],
1639
1650
  "flags": {
1640
1651
  "json": {
@@ -1669,98 +1680,129 @@
1669
1680
  "multiple": false,
1670
1681
  "type": "option"
1671
1682
  },
1672
- "spec": {
1673
- "char": "s",
1674
- "name": "spec",
1675
- "required": true,
1676
- "summary": "Path to test spec file (YAML or JSON). Supports reading from stdin when piping content.",
1683
+ "session-id": {
1684
+ "name": "session-id",
1685
+ "required": false,
1686
+ "summary": "Session ID outputted by \"agent preview start\". Not required when the agent has exactly one active session. Run \"agent preview sessions\" to see list of all sessions.",
1677
1687
  "hasDynamicHelp": false,
1678
1688
  "multiple": false,
1679
1689
  "type": "option"
1680
1690
  },
1681
- "api-name": {
1682
- "char": "n",
1683
- "name": "api-name",
1684
- "summary": "Agent DeveloperName (also called API name) to resolve agent_id and agent_version_id. Auto-inferred from the YAML spec's subjectName.",
1691
+ "utterance": {
1692
+ "char": "u",
1693
+ "name": "utterance",
1694
+ "required": true,
1695
+ "summary": "Utterance to send to the agent, enclosed in double quotes.",
1685
1696
  "hasDynamicHelp": false,
1686
1697
  "multiple": false,
1687
1698
  "type": "option"
1688
1699
  },
1689
- "wait": {
1690
- "char": "w",
1691
- "name": "wait",
1692
- "summary": "Number of minutes to wait for results.",
1693
- "default": 10,
1700
+ "api-name": {
1701
+ "char": "n",
1702
+ "name": "api-name",
1703
+ "summary": "API name of the activated published agent you want to preview.",
1694
1704
  "hasDynamicHelp": false,
1695
1705
  "multiple": false,
1696
1706
  "type": "option"
1697
1707
  },
1698
- "result-format": {
1699
- "name": "result-format",
1700
- "summary": "Format of the agent test run results.",
1701
- "default": "human",
1708
+ "authoring-bundle": {
1709
+ "name": "authoring-bundle",
1710
+ "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
1702
1711
  "hasDynamicHelp": false,
1703
1712
  "multiple": false,
1704
- "options": [
1705
- "json",
1706
- "human",
1707
- "junit",
1708
- "tap"
1709
- ],
1710
1713
  "type": "option"
1714
+ }
1715
+ },
1716
+ "hasDynamicHelp": true,
1717
+ "hiddenAliases": [],
1718
+ "id": "agent:preview:send",
1719
+ "pluginAlias": "@salesforce/plugin-agent",
1720
+ "pluginName": "@salesforce/plugin-agent",
1721
+ "pluginType": "core",
1722
+ "state": "beta",
1723
+ "strict": true,
1724
+ "summary": "Send a message to an existing agent preview session.",
1725
+ "enableJsonFlag": true,
1726
+ "requiresProject": true,
1727
+ "isESM": true,
1728
+ "relativePath": [
1729
+ "lib",
1730
+ "commands",
1731
+ "agent",
1732
+ "preview",
1733
+ "send.js"
1734
+ ],
1735
+ "aliasPermutations": [],
1736
+ "permutations": [
1737
+ "agent:preview:send",
1738
+ "preview:agent:send",
1739
+ "preview:send:agent",
1740
+ "agent:send:preview",
1741
+ "send:agent:preview",
1742
+ "send:preview:agent"
1743
+ ]
1744
+ },
1745
+ "agent:preview:sessions": {
1746
+ "aliases": [],
1747
+ "args": {},
1748
+ "description": "This command lists the agent preview sessions that were started with the \"agent preview start\" command and are still in the local cache. Use this command to discover specific session IDs that you can pass to the \"agent preview send\" or \"agent preview end\" commands with the --session-id flag.\n\nProgrammatic agent preview sessions can be started for both published activated agents and by using an agent's local authoring bundle, which contains its Agent Script file. In this command's output table, the Agent column contains either the API name of the authoring bundle or the published agent, whichever was used when starting the session. In the table, if the same API name has multiple rows with different session IDs, then it means that you previously started multiple preview sessions with the associated agent.",
1749
+ "examples": [
1750
+ "List all cached agent preview sessions:\n<%= config.bin %> <%= command.id %>"
1751
+ ],
1752
+ "flags": {
1753
+ "json": {
1754
+ "description": "Format output as json.",
1755
+ "helpGroup": "GLOBAL",
1756
+ "name": "json",
1757
+ "allowNo": false,
1758
+ "type": "boolean"
1711
1759
  },
1712
- "batch-size": {
1713
- "name": "batch-size",
1714
- "summary": "Number of tests per API request (max 5).",
1715
- "default": 5,
1760
+ "flags-dir": {
1761
+ "helpGroup": "GLOBAL",
1762
+ "name": "flags-dir",
1763
+ "summary": "Import flag values from a directory.",
1716
1764
  "hasDynamicHelp": false,
1717
1765
  "multiple": false,
1718
1766
  "type": "option"
1719
- },
1720
- "no-normalize": {
1721
- "name": "no-normalize",
1722
- "summary": "Disable auto-normalization of field names and shorthand references.",
1723
- "allowNo": false,
1724
- "type": "boolean"
1725
1767
  }
1726
1768
  },
1727
- "hasDynamicHelp": true,
1728
- "hidden": true,
1769
+ "hasDynamicHelp": false,
1729
1770
  "hiddenAliases": [],
1730
- "id": "agent:test:run-eval",
1771
+ "id": "agent:preview:sessions",
1731
1772
  "pluginAlias": "@salesforce/plugin-agent",
1732
1773
  "pluginName": "@salesforce/plugin-agent",
1733
1774
  "pluginType": "core",
1734
1775
  "state": "beta",
1735
1776
  "strict": true,
1736
- "summary": "Run evaluation tests against an Agentforce agent.",
1777
+ "summary": "List all known programmatic agent preview sessions.",
1737
1778
  "enableJsonFlag": true,
1779
+ "requiresProject": true,
1738
1780
  "isESM": true,
1739
1781
  "relativePath": [
1740
1782
  "lib",
1741
1783
  "commands",
1742
1784
  "agent",
1743
- "test",
1744
- "run-eval.js"
1785
+ "preview",
1786
+ "sessions.js"
1745
1787
  ],
1746
1788
  "aliasPermutations": [],
1747
1789
  "permutations": [
1748
- "agent:test:run-eval",
1749
- "test:agent:run-eval",
1750
- "test:run-eval:agent",
1751
- "agent:run-eval:test",
1752
- "run-eval:agent:test",
1753
- "run-eval:test:agent"
1790
+ "agent:preview:sessions",
1791
+ "preview:agent:sessions",
1792
+ "preview:sessions:agent",
1793
+ "agent:sessions:preview",
1794
+ "sessions:agent:preview",
1795
+ "sessions:preview:agent"
1754
1796
  ]
1755
1797
  },
1756
- "agent:test:run": {
1798
+ "agent:preview:start": {
1757
1799
  "aliases": [],
1758
1800
  "args": {},
1759
- "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.",
1801
+ "description": "This command outputs a session ID that you then use with the \"agent preview send\" command to send an utterance to the agent. Use the \"agent preview sessions\" command to list all active sessions and the \"agent preview end\" command to end a specific session.\n\nIdentify the agent you want to start previewing with either the --authoring-bundle flag to specify a local authoring bundle's API name or --api-name to specify an activated published agent's API name. To find either API name, navigate to your package directory in your DX project. The API name of an authoring bundle is the same as its directory name under the \"aiAuthoringBundles\" metadata directory. Similarly, the published agent's API name is the same as its directory name under the \"Bots\" metadata directory. \n\nWhen starting a preview session using the authoring bundle, which contains the agent's Agent Script file, the preview uses mocked actions by default. Specify --use-live-actions for live mode, which uses the real Apex classes, flows, etc, in the org for the actions.",
1760
1802
  "examples": [
1761
- "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",
1762
- "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",
1763
- "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"
1803
+ "Start a programmatic agent preview session by specifying an authoring bundle; uses mocked actions by default. Use the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --authoring-bundle My_Agent_Bundle --target-org my-dev-org",
1804
+ "Similar to previous example but use live actions and the default org:\n<%= config.bin %> <%= command.id %> --authoring-bundle My_Agent_Bundle --use-live-actions",
1805
+ "Start a preview session with an activated published agent:\n<%= config.bin %> <%= command.id %> --api-name My_Published_Agent"
1764
1806
  ],
1765
1807
  "flags": {
1766
1808
  "json": {
@@ -1798,84 +1840,61 @@
1798
1840
  "api-name": {
1799
1841
  "char": "n",
1800
1842
  "name": "api-name",
1801
- "summary": "API name of the agent test to run; corresponds to the name of the AiEvaluationDefinition metadata component that implements the agent test.",
1802
- "hasDynamicHelp": false,
1803
- "multiple": false,
1804
- "type": "option"
1805
- },
1806
- "wait": {
1807
- "char": "w",
1808
- "name": "wait",
1809
- "summary": "Number of minutes to wait for the command to complete and display results to the terminal window.",
1810
- "hasDynamicHelp": true,
1811
- "multiple": false,
1812
- "type": "option"
1813
- },
1814
- "result-format": {
1815
- "name": "result-format",
1816
- "summary": "Format of the agent test run results.",
1817
- "default": "human",
1843
+ "summary": "API name of the activated published agent you want to preview.",
1818
1844
  "hasDynamicHelp": false,
1819
1845
  "multiple": false,
1820
- "options": [
1821
- "json",
1822
- "human",
1823
- "junit",
1824
- "tap"
1825
- ],
1826
1846
  "type": "option"
1827
1847
  },
1828
- "output-dir": {
1829
- "char": "d",
1830
- "description": "If the agent test run completes, write the results to the specified directory. If the test is still running, the test results aren't written.",
1831
- "name": "output-dir",
1832
- "summary": "Directory to write the agent test results into.",
1848
+ "authoring-bundle": {
1849
+ "name": "authoring-bundle",
1850
+ "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
1833
1851
  "hasDynamicHelp": false,
1834
1852
  "multiple": false,
1835
1853
  "type": "option"
1836
1854
  },
1837
- "verbose": {
1838
- "description": "When enabled, includes detailed generated data (such as invoked actions) in the human-readable test results output. This is useful for debugging test failures and understanding what actions were actually invoked during the test run.\n\nThe generated data is in JSON format and includes the Apex classes or Flows that were invoked, the Salesforce objects that were touched, and so on. Use the JSON structure of this information to build the test case JSONPath expression when using custom evaluations.",
1839
- "name": "verbose",
1840
- "summary": "Show generated data in the test results output.",
1855
+ "use-live-actions": {
1856
+ "name": "use-live-actions",
1857
+ "summary": "Use real actions in the org; if not specified, preview uses AI to simulate (mock) actions.",
1841
1858
  "allowNo": false,
1842
1859
  "type": "boolean"
1843
1860
  }
1844
1861
  },
1845
1862
  "hasDynamicHelp": true,
1846
1863
  "hiddenAliases": [],
1847
- "id": "agent:test:run",
1864
+ "id": "agent:preview:start",
1848
1865
  "pluginAlias": "@salesforce/plugin-agent",
1849
1866
  "pluginName": "@salesforce/plugin-agent",
1850
1867
  "pluginType": "core",
1868
+ "state": "beta",
1851
1869
  "strict": true,
1852
- "summary": "Start an agent test in your org.",
1870
+ "summary": "Start a programmatic agent preview session.",
1853
1871
  "enableJsonFlag": true,
1872
+ "requiresProject": true,
1854
1873
  "isESM": true,
1855
1874
  "relativePath": [
1856
1875
  "lib",
1857
1876
  "commands",
1858
1877
  "agent",
1859
- "test",
1860
- "run.js"
1878
+ "preview",
1879
+ "start.js"
1861
1880
  ],
1862
1881
  "aliasPermutations": [],
1863
1882
  "permutations": [
1864
- "agent:test:run",
1865
- "test:agent:run",
1866
- "test:run:agent",
1867
- "agent:run:test",
1868
- "run:agent:test",
1869
- "run:test:agent"
1883
+ "agent:preview:start",
1884
+ "preview:agent:start",
1885
+ "preview:start:agent",
1886
+ "agent:start:preview",
1887
+ "start:agent:preview",
1888
+ "start:preview:agent"
1870
1889
  ]
1871
1890
  },
1872
- "agent:validate:authoring-bundle": {
1891
+ "agent:publish:authoring-bundle": {
1873
1892
  "aliases": [],
1874
1893
  "args": {},
1875
- "description": "An authoring bundle is a metadata type (named aiAuthoringBundle) that provides the blueprint for an agent. The metadata type contains two files: the standard metatada XML file and an Agent Script file (extension \".agent\") that fully describes the agent using the Agent Script language.\n\nThis command validates that the Agent Script file in the authoring bundle compiles without errors so that you can later publish the bundle to your org. Use this command while you code the Agent Script file to ensure that it's valid. If the validation fails, the command outputs the list of syntax errors, a brief description of the error, and the location in the Agent Script file where the error occurred.\n\nThis command uses the API name of the authoring bundle. If you don't provide an API name with the --api-name flag, the command searches the current DX project and outputs a list of authoring bundles that it found for you to choose from.",
1894
+ "description": "An authoring bundle is a metadata type (named aiAuthoringBundle) that provides the blueprint for an agent. The metadata type contains two files: the standard metatada XML file and an Agent Script file (extension \".agent\") that fully describes the agent using the Agent Script language.\n\nWhen you publish an authoring bundle to your org, a number of things happen. First, this command validates that the Agent Script file successfully compiles. If there are compilation errors, the command exits and you must fix the Agent Script file to continue. Once the Agent Script file compiles, then it's published to the org, which in turn creates new associated metadata (Bot, BotVersion, GenAiX), or new versions of the metadata if the agent already exists. The new or updated metadata is retrieved back to your DX project; specify the --skip-retrieve flag to skip this step. Finally, the authoring bundle metadata (AiAuthoringBundle) is deployed to your org.\n\nThis command uses the API name of the authoring bundle.",
1876
1895
  "examples": [
1877
- "Validate an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
1878
- "Validate an authoring bundle with API name MyAuthoringBundle; use the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --api-name MyAuthoringBundle --target-org my-dev-org"
1896
+ "Publish an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
1897
+ "Publish an authoring bundle with API name MyAuthoringBundle to the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --api-name MyAuthoringbundle --target-org my-dev-org"
1879
1898
  ],
1880
1899
  "flags": {
1881
1900
  "json": {
@@ -1913,26 +1932,32 @@
1913
1932
  "api-name": {
1914
1933
  "char": "n",
1915
1934
  "name": "api-name",
1916
- "summary": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
1935
+ "summary": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
1917
1936
  "hasDynamicHelp": false,
1918
1937
  "multiple": false,
1919
1938
  "type": "option"
1939
+ },
1940
+ "skip-retrieve": {
1941
+ "name": "skip-retrieve",
1942
+ "summary": "Don't retrieve the metadata associated with the agent to your DX project.",
1943
+ "allowNo": false,
1944
+ "type": "boolean"
1920
1945
  }
1921
1946
  },
1922
1947
  "hasDynamicHelp": true,
1923
1948
  "hiddenAliases": [],
1924
- "id": "agent:validate:authoring-bundle",
1949
+ "id": "agent:publish:authoring-bundle",
1925
1950
  "pluginAlias": "@salesforce/plugin-agent",
1926
1951
  "pluginName": "@salesforce/plugin-agent",
1927
1952
  "pluginType": "core",
1928
1953
  "strict": true,
1929
- "summary": "Validate an authoring bundle to ensure its Agent Script file compiles successfully and can be used to publish an agent.",
1954
+ "summary": "Publish an authoring bundle to your org, which results in a new agent or a new version of an existing agent.",
1930
1955
  "enableJsonFlag": true,
1931
1956
  "requiresProject": true,
1932
1957
  "FLAGGABLE_PROMPTS": {
1933
1958
  "api-name": {
1934
- "message": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
1935
- "promptMessage": "API name of the authoring bundle to validate"
1959
+ "message": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
1960
+ "promptMessage": "API name of the authoring bundle to publish"
1936
1961
  }
1937
1962
  },
1938
1963
  "isESM": true,
@@ -1940,19 +1965,19 @@
1940
1965
  "lib",
1941
1966
  "commands",
1942
1967
  "agent",
1943
- "validate",
1968
+ "publish",
1944
1969
  "authoring-bundle.js"
1945
1970
  ],
1946
1971
  "aliasPermutations": [],
1947
1972
  "permutations": [
1948
- "agent:validate:authoring-bundle",
1949
- "validate:agent:authoring-bundle",
1950
- "validate:authoring-bundle:agent",
1951
- "agent:authoring-bundle:validate",
1952
- "authoring-bundle:agent:validate",
1953
- "authoring-bundle:validate:agent"
1973
+ "agent:publish:authoring-bundle",
1974
+ "publish:agent:authoring-bundle",
1975
+ "publish:authoring-bundle:agent",
1976
+ "agent:authoring-bundle:publish",
1977
+ "authoring-bundle:agent:publish",
1978
+ "authoring-bundle:publish:agent"
1954
1979
  ]
1955
1980
  }
1956
1981
  },
1957
- "version": "1.32.0"
1982
+ "version": "1.32.2-dev.0"
1958
1983
  }