@salesforce/plugin-agent 1.32.10 → 1.32.11

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.
@@ -657,9 +657,9 @@
657
657
  "agent:generate:template": {
658
658
  "aliases": [],
659
659
  "args": {},
660
- "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.",
661
661
  "examples": [
662
- "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. The agent that the template is based on is in the org with alias \"my-scratch-org\":\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"
663
663
  ],
664
664
  "flags": {
665
665
  "json": {
@@ -684,6 +684,16 @@
684
684
  "multiple": false,
685
685
  "type": "option"
686
686
  },
687
+ "source-org": {
688
+ "char": "s",
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
+ },
687
697
  "agent-version": {
688
698
  "name": "agent-version",
689
699
  "required": true,
@@ -700,16 +710,24 @@
700
710
  "hasDynamicHelp": false,
701
711
  "multiple": false,
702
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"
703
721
  }
704
722
  },
705
- "hasDynamicHelp": false,
723
+ "hasDynamicHelp": true,
706
724
  "hiddenAliases": [],
707
725
  "id": "agent:generate:template",
708
726
  "pluginAlias": "@salesforce/plugin-agent",
709
727
  "pluginName": "@salesforce/plugin-agent",
710
728
  "pluginType": "core",
711
729
  "strict": true,
712
- "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.",
713
731
  "enableJsonFlag": true,
714
732
  "requiresProject": true,
715
733
  "isESM": true,
@@ -798,14 +816,13 @@
798
816
  "test-spec:generate:agent"
799
817
  ]
800
818
  },
801
- "agent:preview:end": {
819
+ "agent:publish:authoring-bundle": {
802
820
  "aliases": [],
803
821
  "args": {},
804
- "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.",
822
+ "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.",
805
823
  "examples": [
806
- "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",
807
- "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",
808
- "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"
824
+ "Publish an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
825
+ "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"
809
826
  ],
810
827
  "flags": {
811
828
  "json": {
@@ -840,66 +857,63 @@
840
857
  "multiple": false,
841
858
  "type": "option"
842
859
  },
843
- "session-id": {
844
- "name": "session-id",
845
- "required": false,
846
- "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.",
847
- "hasDynamicHelp": false,
848
- "multiple": false,
849
- "type": "option"
850
- },
851
860
  "api-name": {
852
861
  "char": "n",
853
862
  "name": "api-name",
854
- "summary": "API name of the activated published agent you want to preview.",
863
+ "summary": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
855
864
  "hasDynamicHelp": false,
856
865
  "multiple": false,
857
866
  "type": "option"
858
867
  },
859
- "authoring-bundle": {
860
- "name": "authoring-bundle",
861
- "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
862
- "hasDynamicHelp": false,
863
- "multiple": false,
864
- "type": "option"
868
+ "skip-retrieve": {
869
+ "name": "skip-retrieve",
870
+ "summary": "Don't retrieve the metadata associated with the agent to your DX project.",
871
+ "allowNo": false,
872
+ "type": "boolean"
865
873
  }
866
874
  },
867
875
  "hasDynamicHelp": true,
868
876
  "hiddenAliases": [],
869
- "id": "agent:preview:end",
877
+ "id": "agent:publish:authoring-bundle",
870
878
  "pluginAlias": "@salesforce/plugin-agent",
871
879
  "pluginName": "@salesforce/plugin-agent",
872
880
  "pluginType": "core",
873
881
  "strict": true,
874
- "summary": "End an existing programmatic agent preview session and get trace location.",
882
+ "summary": "Publish an authoring bundle to your org, which results in a new agent or a new version of an existing agent.",
875
883
  "enableJsonFlag": true,
876
884
  "requiresProject": true,
885
+ "FLAGGABLE_PROMPTS": {
886
+ "api-name": {
887
+ "message": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
888
+ "promptMessage": "API name of the authoring bundle to publish"
889
+ }
890
+ },
877
891
  "isESM": true,
878
892
  "relativePath": [
879
893
  "lib",
880
894
  "commands",
881
895
  "agent",
882
- "preview",
883
- "end.js"
896
+ "publish",
897
+ "authoring-bundle.js"
884
898
  ],
885
899
  "aliasPermutations": [],
886
900
  "permutations": [
887
- "agent:preview:end",
888
- "preview:agent:end",
889
- "preview:end:agent",
890
- "agent:end:preview",
891
- "end:agent:preview",
892
- "end:preview:agent"
901
+ "agent:publish:authoring-bundle",
902
+ "publish:agent:authoring-bundle",
903
+ "publish:authoring-bundle:agent",
904
+ "agent:authoring-bundle:publish",
905
+ "authoring-bundle:agent:publish",
906
+ "authoring-bundle:publish:agent"
893
907
  ]
894
908
  },
895
- "agent:preview:send": {
909
+ "agent:test:create": {
896
910
  "aliases": [],
897
911
  "args": {},
898
- "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.",
912
+ "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.",
899
913
  "examples": [
900
- "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>",
901
- "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",
902
- "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"
914
+ "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 %>",
915
+ "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",
916
+ "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"
903
917
  ],
904
918
  "flags": {
905
919
  "json": {
@@ -917,6 +931,20 @@
917
931
  "multiple": false,
918
932
  "type": "option"
919
933
  },
934
+ "api-name": {
935
+ "name": "api-name",
936
+ "summary": "API name of the new test; the API name must not exist in the org.",
937
+ "hasDynamicHelp": false,
938
+ "multiple": false,
939
+ "type": "option"
940
+ },
941
+ "spec": {
942
+ "name": "spec",
943
+ "summary": "Path to the test spec YAML file.",
944
+ "hasDynamicHelp": false,
945
+ "multiple": false,
946
+ "type": "option"
947
+ },
920
948
  "target-org": {
921
949
  "char": "o",
922
950
  "name": "target-org",
@@ -934,73 +962,53 @@
934
962
  "multiple": false,
935
963
  "type": "option"
936
964
  },
937
- "session-id": {
938
- "name": "session-id",
939
- "required": false,
940
- "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.",
941
- "hasDynamicHelp": false,
942
- "multiple": false,
943
- "type": "option"
944
- },
945
- "utterance": {
946
- "char": "u",
947
- "name": "utterance",
948
- "required": true,
949
- "summary": "Utterance to send to the agent, enclosed in double quotes.",
950
- "hasDynamicHelp": false,
951
- "multiple": false,
952
- "type": "option"
953
- },
954
- "api-name": {
955
- "char": "n",
956
- "name": "api-name",
957
- "summary": "API name of the activated published agent you want to preview.",
958
- "hasDynamicHelp": false,
959
- "multiple": false,
960
- "type": "option"
965
+ "preview": {
966
+ "name": "preview",
967
+ "summary": "Preview the test metadata file (AiEvaluationDefinition) without deploying to your org.",
968
+ "allowNo": false,
969
+ "type": "boolean"
961
970
  },
962
- "authoring-bundle": {
963
- "name": "authoring-bundle",
964
- "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
965
- "hasDynamicHelp": false,
966
- "multiple": false,
967
- "type": "option"
971
+ "force-overwrite": {
972
+ "name": "force-overwrite",
973
+ "summary": "Don't prompt for confirmation when overwriting an existing test (based on API name) in your org.",
974
+ "allowNo": false,
975
+ "type": "boolean"
968
976
  }
969
977
  },
970
978
  "hasDynamicHelp": true,
971
979
  "hiddenAliases": [],
972
- "id": "agent:preview:send",
980
+ "id": "agent:test:create",
973
981
  "pluginAlias": "@salesforce/plugin-agent",
974
982
  "pluginName": "@salesforce/plugin-agent",
975
983
  "pluginType": "core",
976
984
  "strict": true,
977
- "summary": "Send a message to an existing agent preview session.",
985
+ "summary": "Create an agent test in your org using a local test spec YAML file.",
978
986
  "enableJsonFlag": true,
979
- "requiresProject": true,
980
987
  "isESM": true,
981
988
  "relativePath": [
982
989
  "lib",
983
990
  "commands",
984
991
  "agent",
985
- "preview",
986
- "send.js"
992
+ "test",
993
+ "create.js"
987
994
  ],
988
995
  "aliasPermutations": [],
989
996
  "permutations": [
990
- "agent:preview:send",
991
- "preview:agent:send",
992
- "preview:send:agent",
993
- "agent:send:preview",
994
- "send:agent:preview",
995
- "send:preview:agent"
997
+ "agent:test:create",
998
+ "test:agent:create",
999
+ "test:create:agent",
1000
+ "agent:create:test",
1001
+ "create:agent:test",
1002
+ "create:test:agent"
996
1003
  ]
997
1004
  },
998
- "agent:preview:sessions": {
1005
+ "agent:test:list": {
999
1006
  "aliases": [],
1000
1007
  "args": {},
1001
- "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.",
1008
+ "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.",
1002
1009
  "examples": [
1003
- "List all cached agent preview sessions:\n<%= config.bin %> <%= command.id %>"
1010
+ "List the agent tests in your default org:\n<%= config.bin %> <%= command.id %>",
1011
+ "List the agent tests in an org with alias \"my-org\"\"\n<%= config.bin %> <%= command.id %> --target-org my-org"
1004
1012
  ],
1005
1013
  "flags": {
1006
1014
  "json": {
@@ -1017,44 +1025,60 @@
1017
1025
  "hasDynamicHelp": false,
1018
1026
  "multiple": false,
1019
1027
  "type": "option"
1028
+ },
1029
+ "target-org": {
1030
+ "char": "o",
1031
+ "name": "target-org",
1032
+ "noCacheDefault": true,
1033
+ "required": true,
1034
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
1035
+ "hasDynamicHelp": true,
1036
+ "multiple": false,
1037
+ "type": "option"
1038
+ },
1039
+ "api-version": {
1040
+ "description": "Override the api version used for api requests made by this command",
1041
+ "name": "api-version",
1042
+ "hasDynamicHelp": false,
1043
+ "multiple": false,
1044
+ "type": "option"
1020
1045
  }
1021
1046
  },
1022
- "hasDynamicHelp": false,
1047
+ "hasDynamicHelp": true,
1023
1048
  "hiddenAliases": [],
1024
- "id": "agent:preview:sessions",
1049
+ "id": "agent:test:list",
1025
1050
  "pluginAlias": "@salesforce/plugin-agent",
1026
1051
  "pluginName": "@salesforce/plugin-agent",
1027
1052
  "pluginType": "core",
1028
1053
  "strict": true,
1029
- "summary": "List all known programmatic agent preview sessions.",
1054
+ "summary": "List the available agent tests in your org.",
1030
1055
  "enableJsonFlag": true,
1031
- "requiresProject": true,
1032
1056
  "isESM": true,
1033
1057
  "relativePath": [
1034
1058
  "lib",
1035
1059
  "commands",
1036
1060
  "agent",
1037
- "preview",
1038
- "sessions.js"
1061
+ "test",
1062
+ "list.js"
1039
1063
  ],
1040
1064
  "aliasPermutations": [],
1041
1065
  "permutations": [
1042
- "agent:preview:sessions",
1043
- "preview:agent:sessions",
1044
- "preview:sessions:agent",
1045
- "agent:sessions:preview",
1046
- "sessions:agent:preview",
1047
- "sessions:preview:agent"
1066
+ "agent:test:list",
1067
+ "test:agent:list",
1068
+ "test:list:agent",
1069
+ "agent:list:test",
1070
+ "list:agent:test",
1071
+ "list:test:agent"
1048
1072
  ]
1049
1073
  },
1050
- "agent:preview:start": {
1074
+ "agent:test:results": {
1051
1075
  "aliases": [],
1052
1076
  "args": {},
1053
- "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.",
1077
+ "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.",
1054
1078
  "examples": [
1055
- "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",
1056
- "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",
1057
- "Start a preview session with an activated published agent:\n<%= config.bin %> <%= command.id %> --api-name My_Published_Agent"
1079
+ "Get the results of an agent test run in your default org using its job ID:\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ",
1080
+ "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",
1081
+ "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"
1058
1082
  ],
1059
1083
  "flags": {
1060
1084
  "json": {
@@ -1089,64 +1113,81 @@
1089
1113
  "multiple": false,
1090
1114
  "type": "option"
1091
1115
  },
1092
- "api-name": {
1093
- "char": "n",
1094
- "name": "api-name",
1095
- "summary": "API name of the activated published agent you want to preview.",
1116
+ "job-id": {
1117
+ "char": "i",
1118
+ "name": "job-id",
1119
+ "required": true,
1120
+ "summary": "Job ID of the completed agent test run.",
1096
1121
  "hasDynamicHelp": false,
1097
1122
  "multiple": false,
1098
1123
  "type": "option"
1099
1124
  },
1100
- "authoring-bundle": {
1101
- "name": "authoring-bundle",
1102
- "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
1125
+ "result-format": {
1126
+ "name": "result-format",
1127
+ "summary": "Format of the agent test run results.",
1128
+ "default": "human",
1103
1129
  "hasDynamicHelp": false,
1104
1130
  "multiple": false,
1131
+ "options": [
1132
+ "json",
1133
+ "human",
1134
+ "junit",
1135
+ "tap"
1136
+ ],
1105
1137
  "type": "option"
1106
1138
  },
1107
- "use-live-actions": {
1108
- "name": "use-live-actions",
1109
- "summary": "Use real actions in the org; if not specified, preview uses AI to simulate (mock) actions.",
1139
+ "output-dir": {
1140
+ "char": "d",
1141
+ "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.",
1142
+ "name": "output-dir",
1143
+ "summary": "Directory to write the agent test results into.",
1144
+ "hasDynamicHelp": false,
1145
+ "multiple": false,
1146
+ "type": "option"
1147
+ },
1148
+ "verbose": {
1149
+ "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.",
1150
+ "name": "verbose",
1151
+ "summary": "Show generated data in the test results output.",
1110
1152
  "allowNo": false,
1111
1153
  "type": "boolean"
1112
1154
  }
1113
1155
  },
1114
1156
  "hasDynamicHelp": true,
1115
1157
  "hiddenAliases": [],
1116
- "id": "agent:preview:start",
1158
+ "id": "agent:test:results",
1117
1159
  "pluginAlias": "@salesforce/plugin-agent",
1118
1160
  "pluginName": "@salesforce/plugin-agent",
1119
1161
  "pluginType": "core",
1120
1162
  "strict": true,
1121
- "summary": "Start a programmatic agent preview session.",
1163
+ "summary": "Get the results of a completed agent test run.",
1122
1164
  "enableJsonFlag": true,
1123
- "requiresProject": true,
1124
1165
  "isESM": true,
1125
1166
  "relativePath": [
1126
1167
  "lib",
1127
1168
  "commands",
1128
1169
  "agent",
1129
- "preview",
1130
- "start.js"
1170
+ "test",
1171
+ "results.js"
1131
1172
  ],
1132
1173
  "aliasPermutations": [],
1133
1174
  "permutations": [
1134
- "agent:preview:start",
1135
- "preview:agent:start",
1136
- "preview:start:agent",
1137
- "agent:start:preview",
1138
- "start:agent:preview",
1139
- "start:preview:agent"
1175
+ "agent:test:results",
1176
+ "test:agent:results",
1177
+ "test:results:agent",
1178
+ "agent:results:test",
1179
+ "results:agent:test",
1180
+ "results:test:agent"
1140
1181
  ]
1141
1182
  },
1142
- "agent:test:create": {
1183
+ "agent:test:resume": {
1143
1184
  "aliases": [],
1144
1185
  "args": {},
1145
- "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.",
1186
+ "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.",
1146
1187
  "examples": [
1147
- "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 %>",
1148
- "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",
1149
- "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"
1188
+ "Resume an agent test in your default org using a job ID:\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ",
1189
+ "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",
1190
+ "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"
1150
1191
  ],
1151
1192
  "flags": {
1152
1193
  "json": {
@@ -1164,20 +1205,6 @@
1164
1205
  "multiple": false,
1165
1206
  "type": "option"
1166
1207
  },
1167
- "api-name": {
1168
- "name": "api-name",
1169
- "summary": "API name of the new test; the API name must not exist in the org.",
1170
- "hasDynamicHelp": false,
1171
- "multiple": false,
1172
- "type": "option"
1173
- },
1174
- "spec": {
1175
- "name": "spec",
1176
- "summary": "Path to the test spec YAML file.",
1177
- "hasDynamicHelp": false,
1178
- "multiple": false,
1179
- "type": "option"
1180
- },
1181
1208
  "target-org": {
1182
1209
  "char": "o",
1183
1210
  "name": "target-org",
@@ -1195,27 +1222,69 @@
1195
1222
  "multiple": false,
1196
1223
  "type": "option"
1197
1224
  },
1198
- "preview": {
1199
- "name": "preview",
1200
- "summary": "Preview the test metadata file (AiEvaluationDefinition) without deploying to your org.",
1225
+ "job-id": {
1226
+ "char": "i",
1227
+ "name": "job-id",
1228
+ "summary": "Job ID of the original agent test run.",
1229
+ "hasDynamicHelp": false,
1230
+ "multiple": false,
1231
+ "type": "option"
1232
+ },
1233
+ "use-most-recent": {
1234
+ "char": "r",
1235
+ "name": "use-most-recent",
1236
+ "summary": "Use the job ID of the most recent agent test run.",
1201
1237
  "allowNo": false,
1202
1238
  "type": "boolean"
1203
1239
  },
1204
- "force-overwrite": {
1205
- "name": "force-overwrite",
1206
- "summary": "Don't prompt for confirmation when overwriting an existing test (based on API name) in your org.",
1240
+ "wait": {
1241
+ "char": "w",
1242
+ "name": "wait",
1243
+ "summary": "Number of minutes to wait for the command to complete and display results to the terminal window.",
1244
+ "default": "5 minutes",
1245
+ "hasDynamicHelp": true,
1246
+ "multiple": false,
1247
+ "type": "option"
1248
+ },
1249
+ "result-format": {
1250
+ "name": "result-format",
1251
+ "summary": "Format of the agent test run results.",
1252
+ "default": "human",
1253
+ "hasDynamicHelp": false,
1254
+ "multiple": false,
1255
+ "options": [
1256
+ "json",
1257
+ "human",
1258
+ "junit",
1259
+ "tap"
1260
+ ],
1261
+ "type": "option"
1262
+ },
1263
+ "output-dir": {
1264
+ "char": "d",
1265
+ "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.",
1266
+ "name": "output-dir",
1267
+ "summary": "Directory to write the agent test results into.",
1268
+ "hasDynamicHelp": false,
1269
+ "multiple": false,
1270
+ "type": "option"
1271
+ },
1272
+ "verbose": {
1273
+ "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.",
1274
+ "name": "verbose",
1275
+ "summary": "Show generated data in the test results output.",
1207
1276
  "allowNo": false,
1208
1277
  "type": "boolean"
1209
1278
  }
1210
1279
  },
1211
1280
  "hasDynamicHelp": true,
1212
1281
  "hiddenAliases": [],
1213
- "id": "agent:test:create",
1282
+ "id": "agent:test:resume",
1214
1283
  "pluginAlias": "@salesforce/plugin-agent",
1215
1284
  "pluginName": "@salesforce/plugin-agent",
1216
1285
  "pluginType": "core",
1217
1286
  "strict": true,
1218
- "summary": "Create an agent test in your org using a local test spec YAML file.",
1287
+ "summary": "Resume an agent test that you previously started in your org so you can view the test results.",
1219
1288
  "enableJsonFlag": true,
1220
1289
  "isESM": true,
1221
1290
  "relativePath": [
@@ -1223,25 +1292,29 @@
1223
1292
  "commands",
1224
1293
  "agent",
1225
1294
  "test",
1226
- "create.js"
1295
+ "resume.js"
1227
1296
  ],
1228
1297
  "aliasPermutations": [],
1229
1298
  "permutations": [
1230
- "agent:test:create",
1231
- "test:agent:create",
1232
- "test:create:agent",
1233
- "agent:create:test",
1234
- "create:agent:test",
1235
- "create:test:agent"
1299
+ "agent:test:resume",
1300
+ "test:agent:resume",
1301
+ "test:resume:agent",
1302
+ "agent:resume:test",
1303
+ "resume:agent:test",
1304
+ "resume:test:agent"
1236
1305
  ]
1237
1306
  },
1238
- "agent:test:list": {
1307
+ "agent:test:run-eval": {
1239
1308
  "aliases": [],
1240
1309
  "args": {},
1241
- "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.",
1310
+ "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.",
1242
1311
  "examples": [
1243
- "List the agent tests in your default org:\n<%= config.bin %> <%= command.id %>",
1244
- "List the agent tests in an org with alias \"my-org\"\"\n<%= config.bin %> <%= command.id %> --target-org my-org"
1312
+ "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",
1313
+ "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",
1314
+ "Run tests using a JSON payload:\n<%= config.bin %> <%= command.id %> --spec tests/eval-payload.json --target-org my-org",
1315
+ "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",
1316
+ "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",
1317
+ "Pipe JSON payload from stdin (--spec flag is automatically populated from stdin):\n$ echo '{\"tests\":[...]}' | <%= config.bin %> <%= command.id %> --spec --target-org my-org"
1245
1318
  ],
1246
1319
  "flags": {
1247
1320
  "json": {
@@ -1275,16 +1348,72 @@
1275
1348
  "hasDynamicHelp": false,
1276
1349
  "multiple": false,
1277
1350
  "type": "option"
1351
+ },
1352
+ "spec": {
1353
+ "char": "s",
1354
+ "name": "spec",
1355
+ "required": true,
1356
+ "summary": "Path to test spec file (YAML or JSON). Supports reading from stdin when piping content.",
1357
+ "hasDynamicHelp": false,
1358
+ "multiple": false,
1359
+ "type": "option"
1360
+ },
1361
+ "api-name": {
1362
+ "char": "n",
1363
+ "name": "api-name",
1364
+ "summary": "Agent DeveloperName (also called API name) to resolve agent_id and agent_version_id. Auto-inferred from the YAML spec's subjectName.",
1365
+ "hasDynamicHelp": false,
1366
+ "multiple": false,
1367
+ "type": "option"
1368
+ },
1369
+ "wait": {
1370
+ "char": "w",
1371
+ "name": "wait",
1372
+ "summary": "Number of minutes to wait for results.",
1373
+ "default": 10,
1374
+ "hasDynamicHelp": false,
1375
+ "multiple": false,
1376
+ "type": "option"
1377
+ },
1378
+ "result-format": {
1379
+ "name": "result-format",
1380
+ "summary": "Format of the agent test run results.",
1381
+ "default": "human",
1382
+ "hasDynamicHelp": false,
1383
+ "multiple": false,
1384
+ "options": [
1385
+ "json",
1386
+ "human",
1387
+ "junit",
1388
+ "tap"
1389
+ ],
1390
+ "type": "option"
1391
+ },
1392
+ "batch-size": {
1393
+ "name": "batch-size",
1394
+ "summary": "Number of tests per API request (max 5).",
1395
+ "default": 5,
1396
+ "hasDynamicHelp": false,
1397
+ "multiple": false,
1398
+ "type": "option"
1399
+ },
1400
+ "no-normalize": {
1401
+ "name": "no-normalize",
1402
+ "summary": "Disable auto-normalization of field names and shorthand references.",
1403
+ "allowNo": false,
1404
+ "type": "boolean"
1278
1405
  }
1279
1406
  },
1280
1407
  "hasDynamicHelp": true,
1408
+ "hidden": true,
1281
1409
  "hiddenAliases": [],
1282
- "id": "agent:test:list",
1410
+ "id": "agent:test:run-eval",
1283
1411
  "pluginAlias": "@salesforce/plugin-agent",
1284
1412
  "pluginName": "@salesforce/plugin-agent",
1285
1413
  "pluginType": "core",
1414
+ "state": "beta",
1286
1415
  "strict": true,
1287
- "summary": "List the available agent tests in your org.",
1416
+ "summary": "Run evaluation tests against an Agentforce agent.",
1288
1417
  "enableJsonFlag": true,
1289
1418
  "isESM": true,
1290
1419
  "relativePath": [
@@ -1292,26 +1421,26 @@
1292
1421
  "commands",
1293
1422
  "agent",
1294
1423
  "test",
1295
- "list.js"
1424
+ "run-eval.js"
1296
1425
  ],
1297
1426
  "aliasPermutations": [],
1298
1427
  "permutations": [
1299
- "agent:test:list",
1300
- "test:agent:list",
1301
- "test:list:agent",
1302
- "agent:list:test",
1303
- "list:agent:test",
1304
- "list:test:agent"
1428
+ "agent:test:run-eval",
1429
+ "test:agent:run-eval",
1430
+ "test:run-eval:agent",
1431
+ "agent:run-eval:test",
1432
+ "run-eval:agent:test",
1433
+ "run-eval:test:agent"
1305
1434
  ]
1306
1435
  },
1307
- "agent:test:results": {
1436
+ "agent:test:run": {
1308
1437
  "aliases": [],
1309
1438
  "args": {},
1310
- "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.",
1439
+ "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.",
1311
1440
  "examples": [
1312
- "Get the results of an agent test run in your default org using its job ID:\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ",
1313
- "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",
1314
- "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"
1441
+ "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",
1442
+ "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",
1443
+ "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"
1315
1444
  ],
1316
1445
  "flags": {
1317
1446
  "json": {
@@ -1346,15 +1475,22 @@
1346
1475
  "multiple": false,
1347
1476
  "type": "option"
1348
1477
  },
1349
- "job-id": {
1350
- "char": "i",
1351
- "name": "job-id",
1352
- "required": true,
1353
- "summary": "Job ID of the completed agent test run.",
1478
+ "api-name": {
1479
+ "char": "n",
1480
+ "name": "api-name",
1481
+ "summary": "API name of the agent test to run; corresponds to the name of the AiEvaluationDefinition metadata component that implements the agent test.",
1354
1482
  "hasDynamicHelp": false,
1355
1483
  "multiple": false,
1356
1484
  "type": "option"
1357
1485
  },
1486
+ "wait": {
1487
+ "char": "w",
1488
+ "name": "wait",
1489
+ "summary": "Number of minutes to wait for the command to complete and display results to the terminal window.",
1490
+ "hasDynamicHelp": true,
1491
+ "multiple": false,
1492
+ "type": "option"
1493
+ },
1358
1494
  "result-format": {
1359
1495
  "name": "result-format",
1360
1496
  "summary": "Format of the agent test run results.",
@@ -1388,12 +1524,12 @@
1388
1524
  },
1389
1525
  "hasDynamicHelp": true,
1390
1526
  "hiddenAliases": [],
1391
- "id": "agent:test:results",
1527
+ "id": "agent:test:run",
1392
1528
  "pluginAlias": "@salesforce/plugin-agent",
1393
1529
  "pluginName": "@salesforce/plugin-agent",
1394
1530
  "pluginType": "core",
1395
1531
  "strict": true,
1396
- "summary": "Get the results of a completed agent test run.",
1532
+ "summary": "Start an agent test in your org.",
1397
1533
  "enableJsonFlag": true,
1398
1534
  "isESM": true,
1399
1535
  "relativePath": [
@@ -1401,26 +1537,25 @@
1401
1537
  "commands",
1402
1538
  "agent",
1403
1539
  "test",
1404
- "results.js"
1540
+ "run.js"
1405
1541
  ],
1406
1542
  "aliasPermutations": [],
1407
1543
  "permutations": [
1408
- "agent:test:results",
1409
- "test:agent:results",
1410
- "test:results:agent",
1411
- "agent:results:test",
1412
- "results:agent:test",
1413
- "results:test:agent"
1544
+ "agent:test:run",
1545
+ "test:agent:run",
1546
+ "test:run:agent",
1547
+ "agent:run:test",
1548
+ "run:agent:test",
1549
+ "run:test:agent"
1414
1550
  ]
1415
1551
  },
1416
- "agent:test:resume": {
1552
+ "agent:validate:authoring-bundle": {
1417
1553
  "aliases": [],
1418
1554
  "args": {},
1419
- "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.",
1555
+ "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.",
1420
1556
  "examples": [
1421
- "Resume an agent test in your default org using a job ID:\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ",
1422
- "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",
1423
- "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"
1557
+ "Validate an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
1558
+ "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"
1424
1559
  ],
1425
1560
  "flags": {
1426
1561
  "json": {
@@ -1455,99 +1590,57 @@
1455
1590
  "multiple": false,
1456
1591
  "type": "option"
1457
1592
  },
1458
- "job-id": {
1459
- "char": "i",
1460
- "name": "job-id",
1461
- "summary": "Job ID of the original agent test run.",
1462
- "hasDynamicHelp": false,
1463
- "multiple": false,
1464
- "type": "option"
1465
- },
1466
- "use-most-recent": {
1467
- "char": "r",
1468
- "name": "use-most-recent",
1469
- "summary": "Use the job ID of the most recent agent test run.",
1470
- "allowNo": false,
1471
- "type": "boolean"
1472
- },
1473
- "wait": {
1474
- "char": "w",
1475
- "name": "wait",
1476
- "summary": "Number of minutes to wait for the command to complete and display results to the terminal window.",
1477
- "default": "5 minutes",
1478
- "hasDynamicHelp": true,
1479
- "multiple": false,
1480
- "type": "option"
1481
- },
1482
- "result-format": {
1483
- "name": "result-format",
1484
- "summary": "Format of the agent test run results.",
1485
- "default": "human",
1486
- "hasDynamicHelp": false,
1487
- "multiple": false,
1488
- "options": [
1489
- "json",
1490
- "human",
1491
- "junit",
1492
- "tap"
1493
- ],
1494
- "type": "option"
1495
- },
1496
- "output-dir": {
1497
- "char": "d",
1498
- "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.",
1499
- "name": "output-dir",
1500
- "summary": "Directory to write the agent test results into.",
1593
+ "api-name": {
1594
+ "char": "n",
1595
+ "name": "api-name",
1596
+ "summary": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
1501
1597
  "hasDynamicHelp": false,
1502
1598
  "multiple": false,
1503
1599
  "type": "option"
1504
- },
1505
- "verbose": {
1506
- "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.",
1507
- "name": "verbose",
1508
- "summary": "Show generated data in the test results output.",
1509
- "allowNo": false,
1510
- "type": "boolean"
1511
1600
  }
1512
1601
  },
1513
1602
  "hasDynamicHelp": true,
1514
1603
  "hiddenAliases": [],
1515
- "id": "agent:test:resume",
1604
+ "id": "agent:validate:authoring-bundle",
1516
1605
  "pluginAlias": "@salesforce/plugin-agent",
1517
1606
  "pluginName": "@salesforce/plugin-agent",
1518
1607
  "pluginType": "core",
1519
1608
  "strict": true,
1520
- "summary": "Resume an agent test that you previously started in your org so you can view the test results.",
1609
+ "summary": "Validate an authoring bundle to ensure its Agent Script file compiles successfully and can be used to publish an agent.",
1521
1610
  "enableJsonFlag": true,
1611
+ "requiresProject": true,
1612
+ "FLAGGABLE_PROMPTS": {
1613
+ "api-name": {
1614
+ "message": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
1615
+ "promptMessage": "API name of the authoring bundle to validate"
1616
+ }
1617
+ },
1522
1618
  "isESM": true,
1523
1619
  "relativePath": [
1524
1620
  "lib",
1525
1621
  "commands",
1526
1622
  "agent",
1527
- "test",
1528
- "resume.js"
1623
+ "validate",
1624
+ "authoring-bundle.js"
1529
1625
  ],
1530
1626
  "aliasPermutations": [],
1531
1627
  "permutations": [
1532
- "agent:test:resume",
1533
- "test:agent:resume",
1534
- "test:resume:agent",
1535
- "agent:resume:test",
1536
- "resume:agent:test",
1537
- "resume:test:agent"
1628
+ "agent:validate:authoring-bundle",
1629
+ "validate:agent:authoring-bundle",
1630
+ "validate:authoring-bundle:agent",
1631
+ "agent:authoring-bundle:validate",
1632
+ "authoring-bundle:agent:validate",
1633
+ "authoring-bundle:validate:agent"
1538
1634
  ]
1539
1635
  },
1540
- "agent:test:run-eval": {
1636
+ "agent:preview:end": {
1541
1637
  "aliases": [],
1542
1638
  "args": {},
1543
- "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.",
1639
+ "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.",
1544
1640
  "examples": [
1545
- "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",
1546
- "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",
1547
- "Run tests using a JSON payload:\n<%= config.bin %> <%= command.id %> --spec tests/eval-payload.json --target-org my-org",
1548
- "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",
1549
- "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",
1550
- "Pipe JSON payload from stdin (--spec flag is automatically populated from stdin):\n$ echo '{\"tests\":[...]}' | <%= config.bin %> <%= command.id %> --spec --target-org my-org"
1641
+ "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",
1642
+ "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",
1643
+ "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"
1551
1644
  ],
1552
1645
  "flags": {
1553
1646
  "json": {
@@ -1582,11 +1675,10 @@
1582
1675
  "multiple": false,
1583
1676
  "type": "option"
1584
1677
  },
1585
- "spec": {
1586
- "char": "s",
1587
- "name": "spec",
1588
- "required": true,
1589
- "summary": "Path to test spec file (YAML or JSON). Supports reading from stdin when piping content.",
1678
+ "session-id": {
1679
+ "name": "session-id",
1680
+ "required": false,
1681
+ "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.",
1590
1682
  "hasDynamicHelp": false,
1591
1683
  "multiple": false,
1592
1684
  "type": "option"
@@ -1594,86 +1686,55 @@
1594
1686
  "api-name": {
1595
1687
  "char": "n",
1596
1688
  "name": "api-name",
1597
- "summary": "Agent DeveloperName (also called API name) to resolve agent_id and agent_version_id. Auto-inferred from the YAML spec's subjectName.",
1598
- "hasDynamicHelp": false,
1599
- "multiple": false,
1600
- "type": "option"
1601
- },
1602
- "wait": {
1603
- "char": "w",
1604
- "name": "wait",
1605
- "summary": "Number of minutes to wait for results.",
1606
- "default": 10,
1607
- "hasDynamicHelp": false,
1608
- "multiple": false,
1609
- "type": "option"
1610
- },
1611
- "result-format": {
1612
- "name": "result-format",
1613
- "summary": "Format of the agent test run results.",
1614
- "default": "human",
1689
+ "summary": "API name of the activated published agent you want to preview.",
1615
1690
  "hasDynamicHelp": false,
1616
1691
  "multiple": false,
1617
- "options": [
1618
- "json",
1619
- "human",
1620
- "junit",
1621
- "tap"
1622
- ],
1623
1692
  "type": "option"
1624
1693
  },
1625
- "batch-size": {
1626
- "name": "batch-size",
1627
- "summary": "Number of tests per API request (max 5).",
1628
- "default": 5,
1694
+ "authoring-bundle": {
1695
+ "name": "authoring-bundle",
1696
+ "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
1629
1697
  "hasDynamicHelp": false,
1630
1698
  "multiple": false,
1631
1699
  "type": "option"
1632
- },
1633
- "no-normalize": {
1634
- "name": "no-normalize",
1635
- "summary": "Disable auto-normalization of field names and shorthand references.",
1636
- "allowNo": false,
1637
- "type": "boolean"
1638
1700
  }
1639
1701
  },
1640
1702
  "hasDynamicHelp": true,
1641
- "hidden": true,
1642
1703
  "hiddenAliases": [],
1643
- "id": "agent:test:run-eval",
1704
+ "id": "agent:preview:end",
1644
1705
  "pluginAlias": "@salesforce/plugin-agent",
1645
1706
  "pluginName": "@salesforce/plugin-agent",
1646
1707
  "pluginType": "core",
1647
- "state": "beta",
1648
1708
  "strict": true,
1649
- "summary": "Run evaluation tests against an Agentforce agent.",
1709
+ "summary": "End an existing programmatic agent preview session and get trace location.",
1650
1710
  "enableJsonFlag": true,
1711
+ "requiresProject": true,
1651
1712
  "isESM": true,
1652
1713
  "relativePath": [
1653
1714
  "lib",
1654
1715
  "commands",
1655
1716
  "agent",
1656
- "test",
1657
- "run-eval.js"
1717
+ "preview",
1718
+ "end.js"
1658
1719
  ],
1659
1720
  "aliasPermutations": [],
1660
1721
  "permutations": [
1661
- "agent:test:run-eval",
1662
- "test:agent:run-eval",
1663
- "test:run-eval:agent",
1664
- "agent:run-eval:test",
1665
- "run-eval:agent:test",
1666
- "run-eval:test:agent"
1722
+ "agent:preview:end",
1723
+ "preview:agent:end",
1724
+ "preview:end:agent",
1725
+ "agent:end:preview",
1726
+ "end:agent:preview",
1727
+ "end:preview:agent"
1667
1728
  ]
1668
1729
  },
1669
- "agent:test:run": {
1730
+ "agent:preview:send": {
1670
1731
  "aliases": [],
1671
1732
  "args": {},
1672
- "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.",
1733
+ "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.",
1673
1734
  "examples": [
1674
- "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",
1675
- "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",
1676
- "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"
1735
+ "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>",
1736
+ "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",
1737
+ "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"
1677
1738
  ],
1678
1739
  "flags": {
1679
1740
  "json": {
@@ -1708,87 +1769,73 @@
1708
1769
  "multiple": false,
1709
1770
  "type": "option"
1710
1771
  },
1711
- "api-name": {
1712
- "char": "n",
1713
- "name": "api-name",
1714
- "summary": "API name of the agent test to run; corresponds to the name of the AiEvaluationDefinition metadata component that implements the agent test.",
1772
+ "session-id": {
1773
+ "name": "session-id",
1774
+ "required": false,
1775
+ "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.",
1715
1776
  "hasDynamicHelp": false,
1716
1777
  "multiple": false,
1717
1778
  "type": "option"
1718
1779
  },
1719
- "wait": {
1720
- "char": "w",
1721
- "name": "wait",
1722
- "summary": "Number of minutes to wait for the command to complete and display results to the terminal window.",
1723
- "hasDynamicHelp": true,
1780
+ "utterance": {
1781
+ "char": "u",
1782
+ "name": "utterance",
1783
+ "required": true,
1784
+ "summary": "Utterance to send to the agent, enclosed in double quotes.",
1785
+ "hasDynamicHelp": false,
1724
1786
  "multiple": false,
1725
1787
  "type": "option"
1726
1788
  },
1727
- "result-format": {
1728
- "name": "result-format",
1729
- "summary": "Format of the agent test run results.",
1730
- "default": "human",
1789
+ "api-name": {
1790
+ "char": "n",
1791
+ "name": "api-name",
1792
+ "summary": "API name of the activated published agent you want to preview.",
1731
1793
  "hasDynamicHelp": false,
1732
1794
  "multiple": false,
1733
- "options": [
1734
- "json",
1735
- "human",
1736
- "junit",
1737
- "tap"
1738
- ],
1739
1795
  "type": "option"
1740
1796
  },
1741
- "output-dir": {
1742
- "char": "d",
1743
- "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.",
1744
- "name": "output-dir",
1745
- "summary": "Directory to write the agent test results into.",
1797
+ "authoring-bundle": {
1798
+ "name": "authoring-bundle",
1799
+ "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
1746
1800
  "hasDynamicHelp": false,
1747
1801
  "multiple": false,
1748
1802
  "type": "option"
1749
- },
1750
- "verbose": {
1751
- "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.",
1752
- "name": "verbose",
1753
- "summary": "Show generated data in the test results output.",
1754
- "allowNo": false,
1755
- "type": "boolean"
1756
1803
  }
1757
1804
  },
1758
1805
  "hasDynamicHelp": true,
1759
1806
  "hiddenAliases": [],
1760
- "id": "agent:test:run",
1807
+ "id": "agent:preview:send",
1761
1808
  "pluginAlias": "@salesforce/plugin-agent",
1762
1809
  "pluginName": "@salesforce/plugin-agent",
1763
1810
  "pluginType": "core",
1764
1811
  "strict": true,
1765
- "summary": "Start an agent test in your org.",
1812
+ "summary": "Send a message to an existing agent preview session.",
1766
1813
  "enableJsonFlag": true,
1814
+ "requiresProject": true,
1767
1815
  "isESM": true,
1768
1816
  "relativePath": [
1769
1817
  "lib",
1770
1818
  "commands",
1771
1819
  "agent",
1772
- "test",
1773
- "run.js"
1820
+ "preview",
1821
+ "send.js"
1774
1822
  ],
1775
1823
  "aliasPermutations": [],
1776
1824
  "permutations": [
1777
- "agent:test:run",
1778
- "test:agent:run",
1779
- "test:run:agent",
1780
- "agent:run:test",
1781
- "run:agent:test",
1782
- "run:test:agent"
1825
+ "agent:preview:send",
1826
+ "preview:agent:send",
1827
+ "preview:send:agent",
1828
+ "agent:send:preview",
1829
+ "send:agent:preview",
1830
+ "send:preview:agent"
1783
1831
  ]
1784
1832
  },
1785
- "agent:publish:authoring-bundle": {
1833
+ "agent:preview:sessions": {
1786
1834
  "aliases": [],
1787
1835
  "args": {},
1788
- "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.",
1836
+ "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.",
1789
1837
  "examples": [
1790
- "Publish an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
1791
- "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"
1838
+ "List all cached agent preview sessions:\n<%= config.bin %> <%= command.id %>"
1792
1839
  ],
1793
1840
  "flags": {
1794
1841
  "json": {
@@ -1805,80 +1852,44 @@
1805
1852
  "hasDynamicHelp": false,
1806
1853
  "multiple": false,
1807
1854
  "type": "option"
1808
- },
1809
- "target-org": {
1810
- "char": "o",
1811
- "name": "target-org",
1812
- "noCacheDefault": true,
1813
- "required": true,
1814
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
1815
- "hasDynamicHelp": true,
1816
- "multiple": false,
1817
- "type": "option"
1818
- },
1819
- "api-version": {
1820
- "description": "Override the api version used for api requests made by this command",
1821
- "name": "api-version",
1822
- "hasDynamicHelp": false,
1823
- "multiple": false,
1824
- "type": "option"
1825
- },
1826
- "api-name": {
1827
- "char": "n",
1828
- "name": "api-name",
1829
- "summary": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
1830
- "hasDynamicHelp": false,
1831
- "multiple": false,
1832
- "type": "option"
1833
- },
1834
- "skip-retrieve": {
1835
- "name": "skip-retrieve",
1836
- "summary": "Don't retrieve the metadata associated with the agent to your DX project.",
1837
- "allowNo": false,
1838
- "type": "boolean"
1839
1855
  }
1840
1856
  },
1841
- "hasDynamicHelp": true,
1857
+ "hasDynamicHelp": false,
1842
1858
  "hiddenAliases": [],
1843
- "id": "agent:publish:authoring-bundle",
1859
+ "id": "agent:preview:sessions",
1844
1860
  "pluginAlias": "@salesforce/plugin-agent",
1845
1861
  "pluginName": "@salesforce/plugin-agent",
1846
1862
  "pluginType": "core",
1847
1863
  "strict": true,
1848
- "summary": "Publish an authoring bundle to your org, which results in a new agent or a new version of an existing agent.",
1864
+ "summary": "List all known programmatic agent preview sessions.",
1849
1865
  "enableJsonFlag": true,
1850
1866
  "requiresProject": true,
1851
- "FLAGGABLE_PROMPTS": {
1852
- "api-name": {
1853
- "message": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
1854
- "promptMessage": "API name of the authoring bundle to publish"
1855
- }
1856
- },
1857
1867
  "isESM": true,
1858
1868
  "relativePath": [
1859
1869
  "lib",
1860
1870
  "commands",
1861
1871
  "agent",
1862
- "publish",
1863
- "authoring-bundle.js"
1872
+ "preview",
1873
+ "sessions.js"
1864
1874
  ],
1865
1875
  "aliasPermutations": [],
1866
1876
  "permutations": [
1867
- "agent:publish:authoring-bundle",
1868
- "publish:agent:authoring-bundle",
1869
- "publish:authoring-bundle:agent",
1870
- "agent:authoring-bundle:publish",
1871
- "authoring-bundle:agent:publish",
1872
- "authoring-bundle:publish:agent"
1877
+ "agent:preview:sessions",
1878
+ "preview:agent:sessions",
1879
+ "preview:sessions:agent",
1880
+ "agent:sessions:preview",
1881
+ "sessions:agent:preview",
1882
+ "sessions:preview:agent"
1873
1883
  ]
1874
1884
  },
1875
- "agent:validate:authoring-bundle": {
1885
+ "agent:preview:start": {
1876
1886
  "aliases": [],
1877
1887
  "args": {},
1878
- "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.",
1888
+ "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.",
1879
1889
  "examples": [
1880
- "Validate an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
1881
- "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"
1890
+ "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",
1891
+ "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",
1892
+ "Start a preview session with an activated published agent:\n<%= config.bin %> <%= command.id %> --api-name My_Published_Agent"
1882
1893
  ],
1883
1894
  "flags": {
1884
1895
  "json": {
@@ -1916,46 +1927,53 @@
1916
1927
  "api-name": {
1917
1928
  "char": "n",
1918
1929
  "name": "api-name",
1919
- "summary": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
1930
+ "summary": "API name of the activated published agent you want to preview.",
1931
+ "hasDynamicHelp": false,
1932
+ "multiple": false,
1933
+ "type": "option"
1934
+ },
1935
+ "authoring-bundle": {
1936
+ "name": "authoring-bundle",
1937
+ "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
1920
1938
  "hasDynamicHelp": false,
1921
1939
  "multiple": false,
1922
1940
  "type": "option"
1941
+ },
1942
+ "use-live-actions": {
1943
+ "name": "use-live-actions",
1944
+ "summary": "Use real actions in the org; if not specified, preview uses AI to simulate (mock) actions.",
1945
+ "allowNo": false,
1946
+ "type": "boolean"
1923
1947
  }
1924
1948
  },
1925
1949
  "hasDynamicHelp": true,
1926
1950
  "hiddenAliases": [],
1927
- "id": "agent:validate:authoring-bundle",
1951
+ "id": "agent:preview:start",
1928
1952
  "pluginAlias": "@salesforce/plugin-agent",
1929
1953
  "pluginName": "@salesforce/plugin-agent",
1930
1954
  "pluginType": "core",
1931
1955
  "strict": true,
1932
- "summary": "Validate an authoring bundle to ensure its Agent Script file compiles successfully and can be used to publish an agent.",
1956
+ "summary": "Start a programmatic agent preview session.",
1933
1957
  "enableJsonFlag": true,
1934
1958
  "requiresProject": true,
1935
- "FLAGGABLE_PROMPTS": {
1936
- "api-name": {
1937
- "message": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
1938
- "promptMessage": "API name of the authoring bundle to validate"
1939
- }
1940
- },
1941
1959
  "isESM": true,
1942
1960
  "relativePath": [
1943
1961
  "lib",
1944
1962
  "commands",
1945
1963
  "agent",
1946
- "validate",
1947
- "authoring-bundle.js"
1964
+ "preview",
1965
+ "start.js"
1948
1966
  ],
1949
1967
  "aliasPermutations": [],
1950
1968
  "permutations": [
1951
- "agent:validate:authoring-bundle",
1952
- "validate:agent:authoring-bundle",
1953
- "validate:authoring-bundle:agent",
1954
- "agent:authoring-bundle:validate",
1955
- "authoring-bundle:agent:validate",
1956
- "authoring-bundle:validate:agent"
1969
+ "agent:preview:start",
1970
+ "preview:agent:start",
1971
+ "preview:start:agent",
1972
+ "agent:start:preview",
1973
+ "start:agent:preview",
1974
+ "start:preview:agent"
1957
1975
  ]
1958
1976
  }
1959
1977
  },
1960
- "version": "1.32.10"
1978
+ "version": "1.32.11"
1961
1979
  }