@salesforce/plugin-agent 1.42.0 → 1.42.1

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.
@@ -745,6 +745,18 @@
745
745
  "hasDynamicHelp": false,
746
746
  "multiple": false,
747
747
  "type": "option"
748
+ },
749
+ "source-type": {
750
+ "name": "source-type",
751
+ "summary": "Filter by source type: sfdrive, knowledge, or retriever.",
752
+ "hasDynamicHelp": false,
753
+ "multiple": false,
754
+ "options": [
755
+ "sfdrive",
756
+ "knowledge",
757
+ "retriever"
758
+ ],
759
+ "type": "option"
748
760
  }
749
761
  },
750
762
  "hasDynamicHelp": true,
@@ -932,6 +944,13 @@
932
944
  "summary": "Restrict to public Knowledge articles only (KNOWLEDGE libraries, triggers re-indexing).",
933
945
  "allowNo": true,
934
946
  "type": "boolean"
947
+ },
948
+ "retriever-id": {
949
+ "name": "retriever-id",
950
+ "summary": "Swap the retriever for a RETRIEVER library (must be an active Custom Retriever ID).",
951
+ "hasDynamicHelp": false,
952
+ "multiple": false,
953
+ "type": "option"
935
954
  }
936
955
  },
937
956
  "hasDynamicHelp": true,
@@ -1018,7 +1037,7 @@
1018
1037
  "required": true,
1019
1038
  "summary": "Path to the file to upload.",
1020
1039
  "hasDynamicHelp": false,
1021
- "multiple": false,
1040
+ "multiple": true,
1022
1041
  "type": "option"
1023
1042
  },
1024
1043
  "wait": {
@@ -2502,13 +2521,16 @@
2502
2521
  "run:test:agent"
2503
2522
  ]
2504
2523
  },
2505
- "agent:validate:authoring-bundle": {
2524
+ "agent:preview:end": {
2506
2525
  "aliases": [],
2507
2526
  "args": {},
2508
- "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.",
2527
+ "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, respectively. 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\nUse the --all flag to end all active preview sessions at once. You can combine --all with --api-name or --authoring-bundle to end only sessions for a specific agent, or use --all on its own to end every session across all agents in the project.",
2509
2528
  "examples": [
2510
- "Validate an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
2511
- "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"
2529
+ "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",
2530
+ "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",
2531
+ "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",
2532
+ "End all active preview sessions for a specific agent without prompting:\n<%= config.bin %> <%= command.id %> --all --authoring-bundle My_Local_Agent --target-org <target_org> --no-prompt",
2533
+ "End all active preview sessions across every agent in the local session cache for an org:\n<%= config.bin %> <%= command.id %> --all --target-org <target_org>"
2512
2534
  ],
2513
2535
  "flags": {
2514
2536
  "json": {
@@ -2543,23 +2565,63 @@
2543
2565
  "multiple": false,
2544
2566
  "type": "option"
2545
2567
  },
2568
+ "session-id": {
2569
+ "exclusive": [
2570
+ "all"
2571
+ ],
2572
+ "name": "session-id",
2573
+ "required": false,
2574
+ "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.",
2575
+ "hasDynamicHelp": false,
2576
+ "multiple": false,
2577
+ "type": "option"
2578
+ },
2546
2579
  "api-name": {
2547
2580
  "char": "n",
2581
+ "exclusive": [
2582
+ "authoring-bundle"
2583
+ ],
2548
2584
  "name": "api-name",
2549
- "summary": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
2585
+ "summary": "API name of the activated published agent you want to preview.",
2586
+ "hasDynamicHelp": false,
2587
+ "multiple": false,
2588
+ "type": "option"
2589
+ },
2590
+ "authoring-bundle": {
2591
+ "exclusive": [
2592
+ "api-name"
2593
+ ],
2594
+ "name": "authoring-bundle",
2595
+ "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
2550
2596
  "hasDynamicHelp": false,
2551
2597
  "multiple": false,
2552
2598
  "type": "option"
2599
+ },
2600
+ "all": {
2601
+ "exclusive": [
2602
+ "session-id"
2603
+ ],
2604
+ "name": "all",
2605
+ "summary": "End all active preview sessions. Combine with --api-name or --authoring-bundle to limit to a specific agent, or use with only --target-org to end sessions for all agents found in the local session cache. Requires --target-org.",
2606
+ "allowNo": false,
2607
+ "type": "boolean"
2608
+ },
2609
+ "no-prompt": {
2610
+ "char": "p",
2611
+ "name": "no-prompt",
2612
+ "summary": "Don't prompt for confirmation before ending sessions. Has an effect only when used with --all.",
2613
+ "allowNo": false,
2614
+ "type": "boolean"
2553
2615
  }
2554
2616
  },
2555
2617
  "hasDynamicHelp": true,
2556
2618
  "hiddenAliases": [],
2557
- "id": "agent:validate:authoring-bundle",
2619
+ "id": "agent:preview:end",
2558
2620
  "pluginAlias": "@salesforce/plugin-agent",
2559
2621
  "pluginName": "@salesforce/plugin-agent",
2560
2622
  "pluginType": "core",
2561
2623
  "strict": true,
2562
- "summary": "Validate an authoring bundle to ensure its Agent Script file compiles successfully and can be used to publish an agent.",
2624
+ "summary": "End an existing programmatic agent preview session and get trace location.",
2563
2625
  "enableJsonFlag": true,
2564
2626
  "requiresProject": true,
2565
2627
  "envVariablesSection": {
@@ -2576,57 +2638,56 @@
2576
2638
  "body": [
2577
2639
  {
2578
2640
  "name": "Succeeded (0)",
2579
- "description": "Agent Script file compiled successfully without errors."
2641
+ "description": "Preview session ended successfully and traces saved."
2580
2642
  },
2581
2643
  {
2582
- "name": "Failed (1)",
2583
- "description": "Compilation errors found in the Agent Script file."
2644
+ "name": "ExactlyOneRequired (2)",
2645
+ "description": "Neither --api-name nor --authoring-bundle was provided (required when --all is not set)."
2584
2646
  },
2585
2647
  {
2586
2648
  "name": "NotFound (2)",
2587
- "description": "Validation/compilation API returned HTTP 404. The API endpoint may not be available in your org or region."
2649
+ "description": "Agent not found, or no preview session exists for this agent."
2588
2650
  },
2589
2651
  {
2590
- "name": "ServerError (3)",
2591
- "description": "Validation/compilation API returned HTTP 500. A server error occurred during compilation."
2652
+ "name": "PreviewEndFailed (4)",
2653
+ "description": "Failed to end the preview session."
2654
+ },
2655
+ {
2656
+ "name": "PreviewEndPartialFailure (68)",
2657
+ "description": "With --all, one or more sessions failed to end while others succeeded."
2658
+ },
2659
+ {
2660
+ "name": "SessionAmbiguous (5)",
2661
+ "description": "Multiple preview sessions found; specify --session-id to choose one."
2592
2662
  }
2593
2663
  ]
2594
2664
  },
2595
- "FLAGGABLE_PROMPTS": {
2596
- "api-name": {
2597
- "message": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
2598
- "promptMessage": "API name of the authoring bundle to validate"
2599
- }
2600
- },
2601
2665
  "isESM": true,
2602
2666
  "relativePath": [
2603
2667
  "lib",
2604
2668
  "commands",
2605
2669
  "agent",
2606
- "validate",
2607
- "authoring-bundle.js"
2670
+ "preview",
2671
+ "end.js"
2608
2672
  ],
2609
2673
  "aliasPermutations": [],
2610
2674
  "permutations": [
2611
- "agent:validate:authoring-bundle",
2612
- "validate:agent:authoring-bundle",
2613
- "validate:authoring-bundle:agent",
2614
- "agent:authoring-bundle:validate",
2615
- "authoring-bundle:agent:validate",
2616
- "authoring-bundle:validate:agent"
2675
+ "agent:preview:end",
2676
+ "preview:agent:end",
2677
+ "preview:end:agent",
2678
+ "agent:end:preview",
2679
+ "end:agent:preview",
2680
+ "end:preview:agent"
2617
2681
  ]
2618
2682
  },
2619
- "agent:trace:delete": {
2683
+ "agent:preview:send": {
2620
2684
  "aliases": [],
2621
2685
  "args": {},
2622
- "description": "When you run an agent preview conversation (either interactive or programmatic), trace files are automatically recorded and saved in your local DX project. Use this command to delete some or all of the trace files.\n\nBy default, this command shows a preview of what will be deleted and prompts for confirmation. Use --no-prompt to skip confirmation.\n\nWithout filters, this comamnd deletes all trace files for all agents and sessions. Use flags to narrow the scope: filter by agent API name (--agent), by session (--session-id), or by age (--older-than).",
2686
+ "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.",
2623
2687
  "examples": [
2624
- "Delete all traces for all agents and sessions; prompt for confirmation:\n<%= config.bin %> <%= command.id %>",
2625
- "Delete all traces for a specific agent:\n<%= config.bin %> <%= command.id %> --agent My_Agent",
2626
- "Delete traces from a specific session:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID>",
2627
- "Delete traces older than 7 days:\n<%= config.bin %> <%= command.id %> --older-than 7d",
2628
- "Delete traces older than 24 hours for a specific agent; don't prompt for confirmation:\n<%= config.bin %> <%= command.id %> --agent My_Agent --older-than 24h --no-prompt",
2629
- "Delete all traces for all agents and sessions; don't prompt for confirmation:\n<%= config.bin %> <%= command.id %> --no-prompt"
2688
+ "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>",
2689
+ "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",
2690
+ "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"
2630
2691
  ],
2631
2692
  "flags": {
2632
2693
  "json": {
@@ -2644,51 +2705,93 @@
2644
2705
  "multiple": false,
2645
2706
  "type": "option"
2646
2707
  },
2647
- "agent": {
2648
- "char": "a",
2649
- "name": "agent",
2650
- "summary": "API name of the agent used to filter the list of trace files you want to delete. Matches against the API name used when starting the session, either an authoring bundle or a published agent API name.",
2708
+ "target-org": {
2709
+ "char": "o",
2710
+ "name": "target-org",
2711
+ "noCacheDefault": true,
2712
+ "required": true,
2713
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
2714
+ "hasDynamicHelp": true,
2715
+ "multiple": false,
2716
+ "type": "option"
2717
+ },
2718
+ "api-version": {
2719
+ "description": "Override the api version used for api requests made by this command",
2720
+ "name": "api-version",
2651
2721
  "hasDynamicHelp": false,
2652
2722
  "multiple": false,
2653
2723
  "type": "option"
2654
2724
  },
2655
2725
  "session-id": {
2656
2726
  "name": "session-id",
2657
- "summary": "Session ID used to filter the list of trace files you want to delete. Use the \"agent preview sessions\" CLI command to list all known agent preview sessions along with their session IDs.",
2727
+ "required": false,
2728
+ "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.",
2658
2729
  "hasDynamicHelp": false,
2659
2730
  "multiple": false,
2660
2731
  "type": "option"
2661
2732
  },
2662
- "older-than": {
2663
- "name": "older-than",
2664
- "summary": "Duration used to filter the list of trace files; only files older than the duration are deleted. Accepts a number followed by a unit: m/minutes, h/hours, d/days, w/weeks. Examples: 7d, 24h, 2w.",
2733
+ "utterance": {
2734
+ "char": "u",
2735
+ "name": "utterance",
2736
+ "required": true,
2737
+ "summary": "Utterance to send to the agent, enclosed in double quotes.",
2665
2738
  "hasDynamicHelp": false,
2666
2739
  "multiple": false,
2667
2740
  "type": "option"
2668
2741
  },
2669
- "no-prompt": {
2670
- "name": "no-prompt",
2671
- "summary": "Skip the confirmation prompt and delete immediately.",
2672
- "allowNo": false,
2673
- "type": "boolean"
2742
+ "api-name": {
2743
+ "char": "n",
2744
+ "name": "api-name",
2745
+ "summary": "API name of the activated published agent you want to preview.",
2746
+ "hasDynamicHelp": false,
2747
+ "multiple": false,
2748
+ "type": "option"
2749
+ },
2750
+ "authoring-bundle": {
2751
+ "name": "authoring-bundle",
2752
+ "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
2753
+ "hasDynamicHelp": false,
2754
+ "multiple": false,
2755
+ "type": "option"
2674
2756
  }
2675
2757
  },
2676
- "hasDynamicHelp": false,
2758
+ "hasDynamicHelp": true,
2677
2759
  "hiddenAliases": [],
2678
- "id": "agent:trace:delete",
2760
+ "id": "agent:preview:send",
2679
2761
  "pluginAlias": "@salesforce/plugin-agent",
2680
2762
  "pluginName": "@salesforce/plugin-agent",
2681
2763
  "pluginType": "core",
2682
2764
  "strict": true,
2683
- "summary": "Delete trace files from an agent preview session.",
2765
+ "summary": "Send a message to an existing agent preview session.",
2684
2766
  "enableJsonFlag": true,
2685
2767
  "requiresProject": true,
2768
+ "envVariablesSection": {
2769
+ "header": "ENVIRONMENT VARIABLES",
2770
+ "body": [
2771
+ {
2772
+ "name": "SF_TARGET_ORG",
2773
+ "description": "Username or alias of your default org. Overrides the target-org configuration variable."
2774
+ }
2775
+ ]
2776
+ },
2686
2777
  "errorCodes": {
2687
2778
  "header": "ERROR CODES",
2688
2779
  "body": [
2689
2780
  {
2690
2781
  "name": "Succeeded (0)",
2691
- "description": "Traces deleted successfully (or no traces matched)."
2782
+ "description": "Message sent successfully and agent response received."
2783
+ },
2784
+ {
2785
+ "name": "NotFound (2)",
2786
+ "description": "Agent not found, or no preview session exists for this agent."
2787
+ },
2788
+ {
2789
+ "name": "PreviewSendFailed (4)",
2790
+ "description": "Failed to send message or receive response from the preview session."
2791
+ },
2792
+ {
2793
+ "name": "SessionAmbiguous (5)",
2794
+ "description": "Multiple preview sessions found; specify --session-id to choose one."
2692
2795
  }
2693
2796
  ]
2694
2797
  },
@@ -2697,31 +2800,25 @@
2697
2800
  "lib",
2698
2801
  "commands",
2699
2802
  "agent",
2700
- "trace",
2701
- "delete.js"
2803
+ "preview",
2804
+ "send.js"
2702
2805
  ],
2703
2806
  "aliasPermutations": [],
2704
2807
  "permutations": [
2705
- "agent:trace:delete",
2706
- "trace:agent:delete",
2707
- "trace:delete:agent",
2708
- "agent:delete:trace",
2709
- "delete:agent:trace",
2710
- "delete:trace:agent"
2808
+ "agent:preview:send",
2809
+ "preview:agent:send",
2810
+ "preview:send:agent",
2811
+ "agent:send:preview",
2812
+ "send:agent:preview",
2813
+ "send:preview:agent"
2711
2814
  ]
2712
2815
  },
2713
- "agent:trace:list": {
2816
+ "agent:preview:sessions": {
2714
2817
  "aliases": [],
2715
2818
  "args": {},
2716
- "description": "When you run an agent preview conversation (either interactive or programmatic), trace files are automatically recorded and saved in your local DX project. By default, this command lists all trace files for all agents and all of their sessions. Use flags to narrow results: filter by agent name (--agent), by session (--session-id), or by date (--since).\n\nEach row in the output corresponds to one trace file, which in turn corresponds to one agent session. The Agent column shows the authoring bundle or API name used when starting the session.",
2819
+ "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.",
2717
2820
  "examples": [
2718
- "List all trace files for all agents and sessions:\n<%= config.bin %> <%= command.id %>",
2719
- "List all trace files for a specific agent:\n<%= config.bin %> <%= command.id %> --agent My_Agent",
2720
- "List trace files for a specific session:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID>",
2721
- "List trace files recorded on or after April 20, 2026 (date-only, interpreted as UTC midnight):\n<%= config.bin %> <%= command.id %> --since 2026-04-20",
2722
- "List trace files recorded on or after a specific UTC time:\n<%= config.bin %> <%= command.id %> --since 2026-04-20T14:00:00Z",
2723
- "Filter by agent and date together:\n<%= config.bin %> <%= command.id %> --agent My_Agent --since 2026-04-20",
2724
- "Return results as JSON:\n<%= config.bin %> <%= command.id %> --json"
2821
+ "List all cached agent preview sessions:\n<%= config.bin %> <%= command.id %>"
2725
2822
  ],
2726
2823
  "flags": {
2727
2824
  "json": {
@@ -2738,39 +2835,16 @@
2738
2835
  "hasDynamicHelp": false,
2739
2836
  "multiple": false,
2740
2837
  "type": "option"
2741
- },
2742
- "session-id": {
2743
- "name": "session-id",
2744
- "summary": "Session ID used to filter the list of trace files. Use the \"agent preview sessions\" CLI command to list all known agent preview sessions along with their session IDs.",
2745
- "hasDynamicHelp": false,
2746
- "multiple": false,
2747
- "type": "option"
2748
- },
2749
- "agent": {
2750
- "char": "a",
2751
- "name": "agent",
2752
- "summary": "API name of the agent used to filter the list of available trace files. Matches against the API name used when starting the session, either an authoring bundle or a published agent API name.",
2753
- "hasDynamicHelp": false,
2754
- "multiple": false,
2755
- "type": "option"
2756
- },
2757
- "since": {
2758
- "description": "Accepts ISO 8601 format: date-only (2026-04-20), date-time (2026-04-20T14:00:00Z), or date-time with milliseconds (2026-04-20T14:00:00.000Z). The \"Recorded At\" values shown in the table output are valid inputs.",
2759
- "name": "since",
2760
- "summary": "Date used to filter the list of trace files; only those recorded on or after the date are listed.",
2761
- "hasDynamicHelp": false,
2762
- "multiple": false,
2763
- "type": "option"
2764
2838
  }
2765
2839
  },
2766
2840
  "hasDynamicHelp": false,
2767
2841
  "hiddenAliases": [],
2768
- "id": "agent:trace:list",
2842
+ "id": "agent:preview:sessions",
2769
2843
  "pluginAlias": "@salesforce/plugin-agent",
2770
2844
  "pluginName": "@salesforce/plugin-agent",
2771
2845
  "pluginType": "core",
2772
2846
  "strict": true,
2773
- "summary": "List the available trace files that were recorded during all agent preview sessions.",
2847
+ "summary": "List all known programmatic agent preview sessions.",
2774
2848
  "enableJsonFlag": true,
2775
2849
  "requiresProject": true,
2776
2850
  "errorCodes": {
@@ -2778,7 +2852,7 @@
2778
2852
  "body": [
2779
2853
  {
2780
2854
  "name": "Succeeded (0)",
2781
- "description": "Trace files listed successfully (or empty list if none found)."
2855
+ "description": "Sessions listed successfully (or empty list if no active sessions)."
2782
2856
  }
2783
2857
  ]
2784
2858
  },
@@ -2787,132 +2861,27 @@
2787
2861
  "lib",
2788
2862
  "commands",
2789
2863
  "agent",
2790
- "trace",
2791
- "list.js"
2792
- ],
2793
- "aliasPermutations": [],
2794
- "permutations": [
2795
- "agent:trace:list",
2796
- "trace:agent:list",
2797
- "trace:list:agent",
2798
- "agent:list:trace",
2799
- "list:agent:trace",
2800
- "list:trace:agent"
2801
- ]
2802
- },
2803
- "agent:trace:read": {
2804
- "aliases": [],
2805
- "args": {},
2806
- "description": "When you run an agent preview conversation (either interactive or programmatic), trace files are automatically recorded and saved in your local DX project. Each turn (utterance or response) of a conversation creates trace data. Use this command to view trace data for a specific preview session, so you can then analyze the trace data to observe, monitor, investigate, and troubleshoot agent events and behavior.\n\nUse the --format flag to specify one of these formats of the outputted trace data:\n\n- summary (Default): A per-turn narrative showing topic routing, actions executed, and the agent's response. Use this to quickly understand what happened in a preview session.\n- detail: Diagnostic drill-down into a specific dimension. Filters output to only the trace steps relevant to that dimension, minimizing noise.\n- raw: Unprocessed trace JSON. Use this as a fallback when the trace schema has changed or you need to perform custom analysis.\n\nIf you specify \"--format detail\", you must also specify a dimension with the --dimension flag. Dimensions are a way to slice and analyze the agent execution trace from a specific angle or concern. Instead of looking at the raw sequence of everything that happened, each dimension filters and organizes the trace data to answer a specific type of question. These are the available dimensions and the information they provide:\n\n- actions: The actions the agent executed. Includes action name, input parameters, output, and latency. Use this dimension to understand what the agent actually did when answering an utterance in the preview session.\n- grounding: The reasoning steps used by the LLM. Use this dimension to see how the agent \"thought\" about the problem - the AI reasoning that determined which actions to take.\n- routing: How the agent navigated between subagents. Use this dimension to understand conversation flow - when and why the agent switched between different subagents or contexts during the conversation.\n- errors: Aggregates all errors during the session. Use this dimension to quickly identify and debug issues across all steps.",
2807
- "examples": [
2808
- "Show a session trace summary for all turns in the session with the specified ID:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID>",
2809
- "Show a trace summary for the second turn (utterance or response) of the conversation:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --turn 2",
2810
- "Drill into action execution across all turns:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --format detail --dimension actions",
2811
- "Drill into routing decisions for the first turn of the conversation:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --format detail --dimension routing --turn 1",
2812
- "Show all errors across the session:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --format detail --dimension errors",
2813
- "Output raw trace JSON for custom parsing:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --format raw",
2814
- "Return results as JSON:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --json"
2815
- ],
2816
- "flags": {
2817
- "json": {
2818
- "description": "Format output as json.",
2819
- "helpGroup": "GLOBAL",
2820
- "name": "json",
2821
- "allowNo": false,
2822
- "type": "boolean"
2823
- },
2824
- "flags-dir": {
2825
- "helpGroup": "GLOBAL",
2826
- "name": "flags-dir",
2827
- "summary": "Import flag values from a directory.",
2828
- "hasDynamicHelp": false,
2829
- "multiple": false,
2830
- "type": "option"
2831
- },
2832
- "session-id": {
2833
- "char": "s",
2834
- "name": "session-id",
2835
- "required": true,
2836
- "summary": "Session ID to read traces for. Use the \"agent preview sessions\" CLI command to list all known agent preview sessions along with their session IDs",
2837
- "hasDynamicHelp": false,
2838
- "multiple": false,
2839
- "type": "option"
2840
- },
2841
- "format": {
2842
- "char": "f",
2843
- "name": "format",
2844
- "summary": "Output format of the trace data; specifies the level of detail you want in the trace files.",
2845
- "default": "summary",
2846
- "hasDynamicHelp": false,
2847
- "multiple": false,
2848
- "options": [
2849
- "summary",
2850
- "detail",
2851
- "raw"
2852
- ],
2853
- "type": "option"
2854
- },
2855
- "dimension": {
2856
- "char": "d",
2857
- "name": "dimension",
2858
- "summary": "Dimension to drill into when using \"--format detail\"; used to filter and organize the trace data to answer a specific type of question.",
2859
- "hasDynamicHelp": false,
2860
- "multiple": false,
2861
- "options": [
2862
- "actions",
2863
- "grounding",
2864
- "routing",
2865
- "errors"
2866
- ],
2867
- "type": "option"
2868
- },
2869
- "turn": {
2870
- "char": "t",
2871
- "name": "turn",
2872
- "summary": "Turn number for which you want trace data. A turn is a single utterance or response in a conversation, starting with 1.",
2873
- "hasDynamicHelp": false,
2874
- "multiple": false,
2875
- "type": "option"
2876
- }
2877
- },
2878
- "hasDynamicHelp": false,
2879
- "hiddenAliases": [],
2880
- "id": "agent:trace:read",
2881
- "pluginAlias": "@salesforce/plugin-agent",
2882
- "pluginName": "@salesforce/plugin-agent",
2883
- "pluginType": "core",
2884
- "strict": true,
2885
- "summary": "Read trace files from an agent preview session.",
2886
- "enableJsonFlag": true,
2887
- "requiresProject": true,
2888
- "isESM": true,
2889
- "relativePath": [
2890
- "lib",
2891
- "commands",
2892
- "agent",
2893
- "trace",
2894
- "read.js"
2864
+ "preview",
2865
+ "sessions.js"
2895
2866
  ],
2896
2867
  "aliasPermutations": [],
2897
2868
  "permutations": [
2898
- "agent:trace:read",
2899
- "trace:agent:read",
2900
- "trace:read:agent",
2901
- "agent:read:trace",
2902
- "read:agent:trace",
2903
- "read:trace:agent"
2869
+ "agent:preview:sessions",
2870
+ "preview:agent:sessions",
2871
+ "preview:sessions:agent",
2872
+ "agent:sessions:preview",
2873
+ "sessions:agent:preview",
2874
+ "sessions:preview:agent"
2904
2875
  ]
2905
2876
  },
2906
- "agent:preview:end": {
2877
+ "agent:preview:start": {
2907
2878
  "aliases": [],
2908
2879
  "args": {},
2909
- "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, respectively. 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\nUse the --all flag to end all active preview sessions at once. You can combine --all with --api-name or --authoring-bundle to end only sessions for a specific agent, or use --all on its own to end every session across all agents in the project.",
2880
+ "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 with --authoring-bundle, you must explicitly specify the execution mode using one of these flags:\n\n- --use-live-actions: Executes real Apex classes, flows, and other actions in the org. This surfaces compile and validation errors during preview.\n- --simulate-actions: Uses AI to simulate action execution without calling real implementations.\n\nPublished agents (--api-name) always use live actions. The mode flags are optional and have no effect for published agents.",
2910
2881
  "examples": [
2911
- "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",
2912
- "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",
2913
- "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",
2914
- "End all active preview sessions for a specific agent without prompting:\n<%= config.bin %> <%= command.id %> --all --authoring-bundle My_Local_Agent --target-org <target_org> --no-prompt",
2915
- "End all active preview sessions across every agent in the local session cache for an org:\n<%= config.bin %> <%= command.id %> --all --target-org <target_org>"
2882
+ "Start a programmatic agent preview session by specifying an authoring bundle; use simulated actions. Use the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --authoring-bundle My_Agent_Bundle --target-org my-dev-org --simulate-actions",
2883
+ "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",
2884
+ "Start a preview session with an activated published agent (always uses live actions):\n<%= config.bin %> <%= command.id %> --api-name My_Published_Agent"
2916
2885
  ],
2917
2886
  "flags": {
2918
2887
  "json": {
@@ -2947,22 +2916,8 @@
2947
2916
  "multiple": false,
2948
2917
  "type": "option"
2949
2918
  },
2950
- "session-id": {
2951
- "exclusive": [
2952
- "all"
2953
- ],
2954
- "name": "session-id",
2955
- "required": false,
2956
- "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.",
2957
- "hasDynamicHelp": false,
2958
- "multiple": false,
2959
- "type": "option"
2960
- },
2961
2919
  "api-name": {
2962
2920
  "char": "n",
2963
- "exclusive": [
2964
- "authoring-bundle"
2965
- ],
2966
2921
  "name": "api-name",
2967
2922
  "summary": "API name of the activated published agent you want to preview.",
2968
2923
  "hasDynamicHelp": false,
@@ -2970,40 +2925,50 @@
2970
2925
  "type": "option"
2971
2926
  },
2972
2927
  "authoring-bundle": {
2973
- "exclusive": [
2974
- "api-name"
2975
- ],
2976
2928
  "name": "authoring-bundle",
2977
2929
  "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
2978
2930
  "hasDynamicHelp": false,
2979
2931
  "multiple": false,
2980
2932
  "type": "option"
2981
2933
  },
2982
- "all": {
2934
+ "use-live-actions": {
2983
2935
  "exclusive": [
2984
- "session-id"
2936
+ "simulate-actions"
2985
2937
  ],
2986
- "name": "all",
2987
- "summary": "End all active preview sessions. Combine with --api-name or --authoring-bundle to limit to a specific agent, or use with only --target-org to end sessions for all agents found in the local session cache. Requires --target-org.",
2938
+ "name": "use-live-actions",
2939
+ "summary": "Execute real actions in the org (Apex classes, flows, etc.). Required with --authoring-bundle.",
2988
2940
  "allowNo": false,
2989
2941
  "type": "boolean"
2990
2942
  },
2991
- "no-prompt": {
2992
- "char": "p",
2993
- "name": "no-prompt",
2994
- "summary": "Don't prompt for confirmation before ending sessions. Has an effect only when used with --all.",
2943
+ "simulate-actions": {
2944
+ "exclusive": [
2945
+ "use-live-actions"
2946
+ ],
2947
+ "name": "simulate-actions",
2948
+ "summary": "Use AI to simulate action execution instead of calling real actions. Required with --authoring-bundle.",
2995
2949
  "allowNo": false,
2996
2950
  "type": "boolean"
2951
+ },
2952
+ "agent-json": {
2953
+ "dependsOn": [
2954
+ "authoring-bundle"
2955
+ ],
2956
+ "hidden": true,
2957
+ "name": "agent-json",
2958
+ "summary": "Path to a pre-compiled AgentJSON file to use instead of compiling the Agent Script file. Intended for internal use and testing.",
2959
+ "hasDynamicHelp": false,
2960
+ "multiple": false,
2961
+ "type": "option"
2997
2962
  }
2998
2963
  },
2999
2964
  "hasDynamicHelp": true,
3000
2965
  "hiddenAliases": [],
3001
- "id": "agent:preview:end",
2966
+ "id": "agent:preview:start",
3002
2967
  "pluginAlias": "@salesforce/plugin-agent",
3003
2968
  "pluginName": "@salesforce/plugin-agent",
3004
2969
  "pluginType": "core",
3005
2970
  "strict": true,
3006
- "summary": "End an existing programmatic agent preview session and get trace location.",
2971
+ "summary": "Start a programmatic agent preview session.",
3007
2972
  "enableJsonFlag": true,
3008
2973
  "requiresProject": true,
3009
2974
  "envVariablesSection": {
@@ -3020,27 +2985,23 @@
3020
2985
  "body": [
3021
2986
  {
3022
2987
  "name": "Succeeded (0)",
3023
- "description": "Preview session ended successfully and traces saved."
2988
+ "description": "Preview session started successfully."
3024
2989
  },
3025
2990
  {
3026
- "name": "ExactlyOneRequired (2)",
3027
- "description": "Neither --api-name nor --authoring-bundle was provided (required when --all is not set)."
2991
+ "name": "Failed (1)",
2992
+ "description": "Agent Script compilation failed (syntax errors in the script)."
3028
2993
  },
3029
2994
  {
3030
2995
  "name": "NotFound (2)",
3031
- "description": "Agent not found, or no preview session exists for this agent."
3032
- },
3033
- {
3034
- "name": "PreviewEndFailed (4)",
3035
- "description": "Failed to end the preview session."
2996
+ "description": "Agent not found, or compilation API returned HTTP 404 (endpoint may not be available in your org or region)."
3036
2997
  },
3037
2998
  {
3038
- "name": "PreviewEndPartialFailure (68)",
3039
- "description": "With --all, one or more sessions failed to end while others succeeded."
2999
+ "name": "ServerError (3)",
3000
+ "description": "Compilation API returned HTTP 500 (server error during compilation)."
3040
3001
  },
3041
3002
  {
3042
- "name": "SessionAmbiguous (5)",
3043
- "description": "Multiple preview sessions found; specify --session-id to choose one."
3003
+ "name": "PreviewStartFailed (4)",
3004
+ "description": "Preview session failed to start due to API or network errors."
3044
3005
  }
3045
3006
  ]
3046
3007
  },
@@ -3050,26 +3011,29 @@
3050
3011
  "commands",
3051
3012
  "agent",
3052
3013
  "preview",
3053
- "end.js"
3014
+ "start.js"
3054
3015
  ],
3055
3016
  "aliasPermutations": [],
3056
3017
  "permutations": [
3057
- "agent:preview:end",
3058
- "preview:agent:end",
3059
- "preview:end:agent",
3060
- "agent:end:preview",
3061
- "end:agent:preview",
3062
- "end:preview:agent"
3018
+ "agent:preview:start",
3019
+ "preview:agent:start",
3020
+ "preview:start:agent",
3021
+ "agent:start:preview",
3022
+ "start:agent:preview",
3023
+ "start:preview:agent"
3063
3024
  ]
3064
3025
  },
3065
- "agent:preview:send": {
3026
+ "agent:trace:delete": {
3066
3027
  "aliases": [],
3067
3028
  "args": {},
3068
- "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.",
3029
+ "description": "When you run an agent preview conversation (either interactive or programmatic), trace files are automatically recorded and saved in your local DX project. Use this command to delete some or all of the trace files.\n\nBy default, this command shows a preview of what will be deleted and prompts for confirmation. Use --no-prompt to skip confirmation.\n\nWithout filters, this comamnd deletes all trace files for all agents and sessions. Use flags to narrow the scope: filter by agent API name (--agent), by session (--session-id), or by age (--older-than).",
3069
3030
  "examples": [
3070
- "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>",
3071
- "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",
3072
- "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"
3031
+ "Delete all traces for all agents and sessions; prompt for confirmation:\n<%= config.bin %> <%= command.id %>",
3032
+ "Delete all traces for a specific agent:\n<%= config.bin %> <%= command.id %> --agent My_Agent",
3033
+ "Delete traces from a specific session:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID>",
3034
+ "Delete traces older than 7 days:\n<%= config.bin %> <%= command.id %> --older-than 7d",
3035
+ "Delete traces older than 24 hours for a specific agent; don't prompt for confirmation:\n<%= config.bin %> <%= command.id %> --agent My_Agent --older-than 24h --no-prompt",
3036
+ "Delete all traces for all agents and sessions; don't prompt for confirmation:\n<%= config.bin %> <%= command.id %> --no-prompt"
3073
3037
  ],
3074
3038
  "flags": {
3075
3039
  "json": {
@@ -3087,93 +3051,141 @@
3087
3051
  "multiple": false,
3088
3052
  "type": "option"
3089
3053
  },
3090
- "target-org": {
3091
- "char": "o",
3092
- "name": "target-org",
3093
- "noCacheDefault": true,
3094
- "required": true,
3095
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
3096
- "hasDynamicHelp": true,
3054
+ "agent": {
3055
+ "char": "a",
3056
+ "name": "agent",
3057
+ "summary": "API name of the agent used to filter the list of trace files you want to delete. Matches against the API name used when starting the session, either an authoring bundle or a published agent API name.",
3058
+ "hasDynamicHelp": false,
3059
+ "multiple": false,
3060
+ "type": "option"
3061
+ },
3062
+ "session-id": {
3063
+ "name": "session-id",
3064
+ "summary": "Session ID used to filter the list of trace files you want to delete. Use the \"agent preview sessions\" CLI command to list all known agent preview sessions along with their session IDs.",
3065
+ "hasDynamicHelp": false,
3066
+ "multiple": false,
3067
+ "type": "option"
3068
+ },
3069
+ "older-than": {
3070
+ "name": "older-than",
3071
+ "summary": "Duration used to filter the list of trace files; only files older than the duration are deleted. Accepts a number followed by a unit: m/minutes, h/hours, d/days, w/weeks. Examples: 7d, 24h, 2w.",
3072
+ "hasDynamicHelp": false,
3097
3073
  "multiple": false,
3098
3074
  "type": "option"
3099
3075
  },
3100
- "api-version": {
3101
- "description": "Override the api version used for api requests made by this command",
3102
- "name": "api-version",
3076
+ "no-prompt": {
3077
+ "name": "no-prompt",
3078
+ "summary": "Skip the confirmation prompt and delete immediately.",
3079
+ "allowNo": false,
3080
+ "type": "boolean"
3081
+ }
3082
+ },
3083
+ "hasDynamicHelp": false,
3084
+ "hiddenAliases": [],
3085
+ "id": "agent:trace:delete",
3086
+ "pluginAlias": "@salesforce/plugin-agent",
3087
+ "pluginName": "@salesforce/plugin-agent",
3088
+ "pluginType": "core",
3089
+ "strict": true,
3090
+ "summary": "Delete trace files from an agent preview session.",
3091
+ "enableJsonFlag": true,
3092
+ "requiresProject": true,
3093
+ "errorCodes": {
3094
+ "header": "ERROR CODES",
3095
+ "body": [
3096
+ {
3097
+ "name": "Succeeded (0)",
3098
+ "description": "Traces deleted successfully (or no traces matched)."
3099
+ }
3100
+ ]
3101
+ },
3102
+ "isESM": true,
3103
+ "relativePath": [
3104
+ "lib",
3105
+ "commands",
3106
+ "agent",
3107
+ "trace",
3108
+ "delete.js"
3109
+ ],
3110
+ "aliasPermutations": [],
3111
+ "permutations": [
3112
+ "agent:trace:delete",
3113
+ "trace:agent:delete",
3114
+ "trace:delete:agent",
3115
+ "agent:delete:trace",
3116
+ "delete:agent:trace",
3117
+ "delete:trace:agent"
3118
+ ]
3119
+ },
3120
+ "agent:trace:list": {
3121
+ "aliases": [],
3122
+ "args": {},
3123
+ "description": "When you run an agent preview conversation (either interactive or programmatic), trace files are automatically recorded and saved in your local DX project. By default, this command lists all trace files for all agents and all of their sessions. Use flags to narrow results: filter by agent name (--agent), by session (--session-id), or by date (--since).\n\nEach row in the output corresponds to one trace file, which in turn corresponds to one agent session. The Agent column shows the authoring bundle or API name used when starting the session.",
3124
+ "examples": [
3125
+ "List all trace files for all agents and sessions:\n<%= config.bin %> <%= command.id %>",
3126
+ "List all trace files for a specific agent:\n<%= config.bin %> <%= command.id %> --agent My_Agent",
3127
+ "List trace files for a specific session:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID>",
3128
+ "List trace files recorded on or after April 20, 2026 (date-only, interpreted as UTC midnight):\n<%= config.bin %> <%= command.id %> --since 2026-04-20",
3129
+ "List trace files recorded on or after a specific UTC time:\n<%= config.bin %> <%= command.id %> --since 2026-04-20T14:00:00Z",
3130
+ "Filter by agent and date together:\n<%= config.bin %> <%= command.id %> --agent My_Agent --since 2026-04-20",
3131
+ "Return results as JSON:\n<%= config.bin %> <%= command.id %> --json"
3132
+ ],
3133
+ "flags": {
3134
+ "json": {
3135
+ "description": "Format output as json.",
3136
+ "helpGroup": "GLOBAL",
3137
+ "name": "json",
3138
+ "allowNo": false,
3139
+ "type": "boolean"
3140
+ },
3141
+ "flags-dir": {
3142
+ "helpGroup": "GLOBAL",
3143
+ "name": "flags-dir",
3144
+ "summary": "Import flag values from a directory.",
3103
3145
  "hasDynamicHelp": false,
3104
3146
  "multiple": false,
3105
3147
  "type": "option"
3106
3148
  },
3107
3149
  "session-id": {
3108
3150
  "name": "session-id",
3109
- "required": false,
3110
- "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.",
3111
- "hasDynamicHelp": false,
3112
- "multiple": false,
3113
- "type": "option"
3114
- },
3115
- "utterance": {
3116
- "char": "u",
3117
- "name": "utterance",
3118
- "required": true,
3119
- "summary": "Utterance to send to the agent, enclosed in double quotes.",
3151
+ "summary": "Session ID used to filter the list of trace files. Use the \"agent preview sessions\" CLI command to list all known agent preview sessions along with their session IDs.",
3120
3152
  "hasDynamicHelp": false,
3121
3153
  "multiple": false,
3122
3154
  "type": "option"
3123
3155
  },
3124
- "api-name": {
3125
- "char": "n",
3126
- "name": "api-name",
3127
- "summary": "API name of the activated published agent you want to preview.",
3156
+ "agent": {
3157
+ "char": "a",
3158
+ "name": "agent",
3159
+ "summary": "API name of the agent used to filter the list of available trace files. Matches against the API name used when starting the session, either an authoring bundle or a published agent API name.",
3128
3160
  "hasDynamicHelp": false,
3129
3161
  "multiple": false,
3130
3162
  "type": "option"
3131
3163
  },
3132
- "authoring-bundle": {
3133
- "name": "authoring-bundle",
3134
- "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
3164
+ "since": {
3165
+ "description": "Accepts ISO 8601 format: date-only (2026-04-20), date-time (2026-04-20T14:00:00Z), or date-time with milliseconds (2026-04-20T14:00:00.000Z). The \"Recorded At\" values shown in the table output are valid inputs.",
3166
+ "name": "since",
3167
+ "summary": "Date used to filter the list of trace files; only those recorded on or after the date are listed.",
3135
3168
  "hasDynamicHelp": false,
3136
3169
  "multiple": false,
3137
3170
  "type": "option"
3138
3171
  }
3139
3172
  },
3140
- "hasDynamicHelp": true,
3173
+ "hasDynamicHelp": false,
3141
3174
  "hiddenAliases": [],
3142
- "id": "agent:preview:send",
3175
+ "id": "agent:trace:list",
3143
3176
  "pluginAlias": "@salesforce/plugin-agent",
3144
3177
  "pluginName": "@salesforce/plugin-agent",
3145
3178
  "pluginType": "core",
3146
3179
  "strict": true,
3147
- "summary": "Send a message to an existing agent preview session.",
3180
+ "summary": "List the available trace files that were recorded during all agent preview sessions.",
3148
3181
  "enableJsonFlag": true,
3149
3182
  "requiresProject": true,
3150
- "envVariablesSection": {
3151
- "header": "ENVIRONMENT VARIABLES",
3152
- "body": [
3153
- {
3154
- "name": "SF_TARGET_ORG",
3155
- "description": "Username or alias of your default org. Overrides the target-org configuration variable."
3156
- }
3157
- ]
3158
- },
3159
3183
  "errorCodes": {
3160
3184
  "header": "ERROR CODES",
3161
3185
  "body": [
3162
3186
  {
3163
3187
  "name": "Succeeded (0)",
3164
- "description": "Message sent successfully and agent response received."
3165
- },
3166
- {
3167
- "name": "NotFound (2)",
3168
- "description": "Agent not found, or no preview session exists for this agent."
3169
- },
3170
- {
3171
- "name": "PreviewSendFailed (4)",
3172
- "description": "Failed to send message or receive response from the preview session."
3173
- },
3174
- {
3175
- "name": "SessionAmbiguous (5)",
3176
- "description": "Multiple preview sessions found; specify --session-id to choose one."
3188
+ "description": "Trace files listed successfully (or empty list if none found)."
3177
3189
  }
3178
3190
  ]
3179
3191
  },
@@ -3182,25 +3194,31 @@
3182
3194
  "lib",
3183
3195
  "commands",
3184
3196
  "agent",
3185
- "preview",
3186
- "send.js"
3197
+ "trace",
3198
+ "list.js"
3187
3199
  ],
3188
3200
  "aliasPermutations": [],
3189
3201
  "permutations": [
3190
- "agent:preview:send",
3191
- "preview:agent:send",
3192
- "preview:send:agent",
3193
- "agent:send:preview",
3194
- "send:agent:preview",
3195
- "send:preview:agent"
3202
+ "agent:trace:list",
3203
+ "trace:agent:list",
3204
+ "trace:list:agent",
3205
+ "agent:list:trace",
3206
+ "list:agent:trace",
3207
+ "list:trace:agent"
3196
3208
  ]
3197
3209
  },
3198
- "agent:preview:sessions": {
3210
+ "agent:trace:read": {
3199
3211
  "aliases": [],
3200
3212
  "args": {},
3201
- "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.",
3213
+ "description": "When you run an agent preview conversation (either interactive or programmatic), trace files are automatically recorded and saved in your local DX project. Each turn (utterance or response) of a conversation creates trace data. Use this command to view trace data for a specific preview session, so you can then analyze the trace data to observe, monitor, investigate, and troubleshoot agent events and behavior.\n\nUse the --format flag to specify one of these formats of the outputted trace data:\n\n- summary (Default): A per-turn narrative showing topic routing, actions executed, and the agent's response. Use this to quickly understand what happened in a preview session.\n- detail: Diagnostic drill-down into a specific dimension. Filters output to only the trace steps relevant to that dimension, minimizing noise.\n- raw: Unprocessed trace JSON. Use this as a fallback when the trace schema has changed or you need to perform custom analysis.\n\nIf you specify \"--format detail\", you must also specify a dimension with the --dimension flag. Dimensions are a way to slice and analyze the agent execution trace from a specific angle or concern. Instead of looking at the raw sequence of everything that happened, each dimension filters and organizes the trace data to answer a specific type of question. These are the available dimensions and the information they provide:\n\n- actions: The actions the agent executed. Includes action name, input parameters, output, and latency. Use this dimension to understand what the agent actually did when answering an utterance in the preview session.\n- grounding: The reasoning steps used by the LLM. Use this dimension to see how the agent \"thought\" about the problem - the AI reasoning that determined which actions to take.\n- routing: How the agent navigated between subagents. Use this dimension to understand conversation flow - when and why the agent switched between different subagents or contexts during the conversation.\n- errors: Aggregates all errors during the session. Use this dimension to quickly identify and debug issues across all steps.",
3202
3214
  "examples": [
3203
- "List all cached agent preview sessions:\n<%= config.bin %> <%= command.id %>"
3215
+ "Show a session trace summary for all turns in the session with the specified ID:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID>",
3216
+ "Show a trace summary for the second turn (utterance or response) of the conversation:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --turn 2",
3217
+ "Drill into action execution across all turns:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --format detail --dimension actions",
3218
+ "Drill into routing decisions for the first turn of the conversation:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --format detail --dimension routing --turn 1",
3219
+ "Show all errors across the session:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --format detail --dimension errors",
3220
+ "Output raw trace JSON for custom parsing:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --format raw",
3221
+ "Return results as JSON:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --json"
3204
3222
  ],
3205
3223
  "flags": {
3206
3224
  "json": {
@@ -3217,53 +3235,88 @@
3217
3235
  "hasDynamicHelp": false,
3218
3236
  "multiple": false,
3219
3237
  "type": "option"
3238
+ },
3239
+ "session-id": {
3240
+ "char": "s",
3241
+ "name": "session-id",
3242
+ "required": true,
3243
+ "summary": "Session ID to read traces for. Use the \"agent preview sessions\" CLI command to list all known agent preview sessions along with their session IDs",
3244
+ "hasDynamicHelp": false,
3245
+ "multiple": false,
3246
+ "type": "option"
3247
+ },
3248
+ "format": {
3249
+ "char": "f",
3250
+ "name": "format",
3251
+ "summary": "Output format of the trace data; specifies the level of detail you want in the trace files.",
3252
+ "default": "summary",
3253
+ "hasDynamicHelp": false,
3254
+ "multiple": false,
3255
+ "options": [
3256
+ "summary",
3257
+ "detail",
3258
+ "raw"
3259
+ ],
3260
+ "type": "option"
3261
+ },
3262
+ "dimension": {
3263
+ "char": "d",
3264
+ "name": "dimension",
3265
+ "summary": "Dimension to drill into when using \"--format detail\"; used to filter and organize the trace data to answer a specific type of question.",
3266
+ "hasDynamicHelp": false,
3267
+ "multiple": false,
3268
+ "options": [
3269
+ "actions",
3270
+ "grounding",
3271
+ "routing",
3272
+ "errors"
3273
+ ],
3274
+ "type": "option"
3275
+ },
3276
+ "turn": {
3277
+ "char": "t",
3278
+ "name": "turn",
3279
+ "summary": "Turn number for which you want trace data. A turn is a single utterance or response in a conversation, starting with 1.",
3280
+ "hasDynamicHelp": false,
3281
+ "multiple": false,
3282
+ "type": "option"
3220
3283
  }
3221
3284
  },
3222
3285
  "hasDynamicHelp": false,
3223
3286
  "hiddenAliases": [],
3224
- "id": "agent:preview:sessions",
3287
+ "id": "agent:trace:read",
3225
3288
  "pluginAlias": "@salesforce/plugin-agent",
3226
3289
  "pluginName": "@salesforce/plugin-agent",
3227
3290
  "pluginType": "core",
3228
3291
  "strict": true,
3229
- "summary": "List all known programmatic agent preview sessions.",
3292
+ "summary": "Read trace files from an agent preview session.",
3230
3293
  "enableJsonFlag": true,
3231
3294
  "requiresProject": true,
3232
- "errorCodes": {
3233
- "header": "ERROR CODES",
3234
- "body": [
3235
- {
3236
- "name": "Succeeded (0)",
3237
- "description": "Sessions listed successfully (or empty list if no active sessions)."
3238
- }
3239
- ]
3240
- },
3241
3295
  "isESM": true,
3242
3296
  "relativePath": [
3243
3297
  "lib",
3244
3298
  "commands",
3245
3299
  "agent",
3246
- "preview",
3247
- "sessions.js"
3300
+ "trace",
3301
+ "read.js"
3248
3302
  ],
3249
3303
  "aliasPermutations": [],
3250
3304
  "permutations": [
3251
- "agent:preview:sessions",
3252
- "preview:agent:sessions",
3253
- "preview:sessions:agent",
3254
- "agent:sessions:preview",
3255
- "sessions:agent:preview",
3256
- "sessions:preview:agent"
3305
+ "agent:trace:read",
3306
+ "trace:agent:read",
3307
+ "trace:read:agent",
3308
+ "agent:read:trace",
3309
+ "read:agent:trace",
3310
+ "read:trace:agent"
3257
3311
  ]
3258
3312
  },
3259
- "agent:preview:start": {
3313
+ "agent:validate:authoring-bundle": {
3260
3314
  "aliases": [],
3261
3315
  "args": {},
3262
- "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 with --authoring-bundle, you must explicitly specify the execution mode using one of these flags:\n\n- --use-live-actions: Executes real Apex classes, flows, and other actions in the org. This surfaces compile and validation errors during preview.\n- --simulate-actions: Uses AI to simulate action execution without calling real implementations.\n\nPublished agents (--api-name) always use live actions. The mode flags are optional and have no effect for published agents.",
3316
+ "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.",
3263
3317
  "examples": [
3264
- "Start a programmatic agent preview session by specifying an authoring bundle; use simulated actions. Use the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --authoring-bundle My_Agent_Bundle --target-org my-dev-org --simulate-actions",
3265
- "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",
3266
- "Start a preview session with an activated published agent (always uses live actions):\n<%= config.bin %> <%= command.id %> --api-name My_Published_Agent"
3318
+ "Validate an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
3319
+ "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"
3267
3320
  ],
3268
3321
  "flags": {
3269
3322
  "json": {
@@ -3301,43 +3354,7 @@
3301
3354
  "api-name": {
3302
3355
  "char": "n",
3303
3356
  "name": "api-name",
3304
- "summary": "API name of the activated published agent you want to preview.",
3305
- "hasDynamicHelp": false,
3306
- "multiple": false,
3307
- "type": "option"
3308
- },
3309
- "authoring-bundle": {
3310
- "name": "authoring-bundle",
3311
- "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
3312
- "hasDynamicHelp": false,
3313
- "multiple": false,
3314
- "type": "option"
3315
- },
3316
- "use-live-actions": {
3317
- "exclusive": [
3318
- "simulate-actions"
3319
- ],
3320
- "name": "use-live-actions",
3321
- "summary": "Execute real actions in the org (Apex classes, flows, etc.). Required with --authoring-bundle.",
3322
- "allowNo": false,
3323
- "type": "boolean"
3324
- },
3325
- "simulate-actions": {
3326
- "exclusive": [
3327
- "use-live-actions"
3328
- ],
3329
- "name": "simulate-actions",
3330
- "summary": "Use AI to simulate action execution instead of calling real actions. Required with --authoring-bundle.",
3331
- "allowNo": false,
3332
- "type": "boolean"
3333
- },
3334
- "agent-json": {
3335
- "dependsOn": [
3336
- "authoring-bundle"
3337
- ],
3338
- "hidden": true,
3339
- "name": "agent-json",
3340
- "summary": "Path to a pre-compiled AgentJSON file to use instead of compiling the Agent Script file. Intended for internal use and testing.",
3357
+ "summary": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
3341
3358
  "hasDynamicHelp": false,
3342
3359
  "multiple": false,
3343
3360
  "type": "option"
@@ -3345,12 +3362,12 @@
3345
3362
  },
3346
3363
  "hasDynamicHelp": true,
3347
3364
  "hiddenAliases": [],
3348
- "id": "agent:preview:start",
3365
+ "id": "agent:validate:authoring-bundle",
3349
3366
  "pluginAlias": "@salesforce/plugin-agent",
3350
3367
  "pluginName": "@salesforce/plugin-agent",
3351
3368
  "pluginType": "core",
3352
3369
  "strict": true,
3353
- "summary": "Start a programmatic agent preview session.",
3370
+ "summary": "Validate an authoring bundle to ensure its Agent Script file compiles successfully and can be used to publish an agent.",
3354
3371
  "enableJsonFlag": true,
3355
3372
  "requiresProject": true,
3356
3373
  "envVariablesSection": {
@@ -3367,42 +3384,44 @@
3367
3384
  "body": [
3368
3385
  {
3369
3386
  "name": "Succeeded (0)",
3370
- "description": "Preview session started successfully."
3387
+ "description": "Agent Script file compiled successfully without errors."
3371
3388
  },
3372
3389
  {
3373
3390
  "name": "Failed (1)",
3374
- "description": "Agent Script compilation failed (syntax errors in the script)."
3391
+ "description": "Compilation errors found in the Agent Script file."
3375
3392
  },
3376
3393
  {
3377
3394
  "name": "NotFound (2)",
3378
- "description": "Agent not found, or compilation API returned HTTP 404 (endpoint may not be available in your org or region)."
3395
+ "description": "Validation/compilation API returned HTTP 404. The API endpoint may not be available in your org or region."
3379
3396
  },
3380
3397
  {
3381
3398
  "name": "ServerError (3)",
3382
- "description": "Compilation API returned HTTP 500 (server error during compilation)."
3383
- },
3384
- {
3385
- "name": "PreviewStartFailed (4)",
3386
- "description": "Preview session failed to start due to API or network errors."
3399
+ "description": "Validation/compilation API returned HTTP 500. A server error occurred during compilation."
3387
3400
  }
3388
3401
  ]
3389
3402
  },
3403
+ "FLAGGABLE_PROMPTS": {
3404
+ "api-name": {
3405
+ "message": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
3406
+ "promptMessage": "API name of the authoring bundle to validate"
3407
+ }
3408
+ },
3390
3409
  "isESM": true,
3391
3410
  "relativePath": [
3392
3411
  "lib",
3393
3412
  "commands",
3394
3413
  "agent",
3395
- "preview",
3396
- "start.js"
3414
+ "validate",
3415
+ "authoring-bundle.js"
3397
3416
  ],
3398
3417
  "aliasPermutations": [],
3399
3418
  "permutations": [
3400
- "agent:preview:start",
3401
- "preview:agent:start",
3402
- "preview:start:agent",
3403
- "agent:start:preview",
3404
- "start:agent:preview",
3405
- "start:preview:agent"
3419
+ "agent:validate:authoring-bundle",
3420
+ "validate:agent:authoring-bundle",
3421
+ "validate:authoring-bundle:agent",
3422
+ "agent:authoring-bundle:validate",
3423
+ "authoring-bundle:agent:validate",
3424
+ "authoring-bundle:validate:agent"
3406
3425
  ]
3407
3426
  },
3408
3427
  "agent:adl:file:add": {
@@ -3410,7 +3429,8 @@
3410
3429
  "args": {},
3411
3430
  "description": "Adds one or more files to an existing SFDRIVE data library and triggers SearchIndex re-hydration. This is the day-2 operation for adding files to an already-provisioned library.\n\nConstraints: at least 1 file required, no duplicate file names in a batch, maximum 1000 files per library.",
3412
3431
  "examples": [
3413
- "Add a file to an existing library:\n<%= config.bin %> <%= command.id %> --library-id 1JDSG000007IbWX4A0 --file ./docs/new-guide.pdf --target-org myOrg"
3432
+ "Add a file to an existing library:\n<%= config.bin %> <%= command.id %> -i 1JDSG000007IbWX4A0 --path ./docs/new-guide.pdf --target-org myOrg",
3433
+ "Add multiple files:\n<%= config.bin %> <%= command.id %> -i 1JDSG000007IbWX4A0 --path ./docs/guide.pdf --path ./docs/faq.txt --target-org myOrg"
3414
3434
  ],
3415
3435
  "flags": {
3416
3436
  "json": {
@@ -3454,13 +3474,13 @@
3454
3474
  "multiple": false,
3455
3475
  "type": "option"
3456
3476
  },
3457
- "file": {
3477
+ "path": {
3458
3478
  "char": "f",
3459
- "name": "file",
3479
+ "name": "path",
3460
3480
  "required": true,
3461
- "summary": "Path to the file to add to the library.",
3481
+ "summary": "Path to file(s) to add. Specify multiple times for batch upload.",
3462
3482
  "hasDynamicHelp": false,
3463
- "multiple": false,
3483
+ "multiple": true,
3464
3484
  "type": "option"
3465
3485
  }
3466
3486
  },
@@ -3715,5 +3735,5 @@
3715
3735
  ]
3716
3736
  }
3717
3737
  },
3718
- "version": "1.42.0"
3738
+ "version": "1.42.1"
3719
3739
  }