@salesforce/plugin-agent 1.27.3 → 1.27.4

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.
Files changed (3) hide show
  1. package/README.md +15 -15
  2. package/oclif.manifest.json +512 -512
  3. package/package.json +3 -3
@@ -339,14 +339,16 @@
339
339
  "preview:agent"
340
340
  ]
341
341
  },
342
- "agent:test:create": {
342
+ "agent:generate:agent-spec": {
343
343
  "aliases": [],
344
344
  "args": {},
345
- "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.",
345
+ "description": "An agent spec is a YAML-formatted file that contains basic information about the agent, such as its role, company description, and an AI-generated list of topics based on this information. Topics define the range of jobs your agent can handle.\n\nUse flags, such as --role and --company-description, to provide details about your company and the role that the agent plays in your company. If you prefer, you can also be prompted for the basic information; use --full-interview to be prompted for all required and optional properties. Upon command execution, the large language model (LLM) associated with your org uses the provided information to generate a list of topics for the agent. Because the LLM uses the company and role information to generate the topics, we recommend that you provide accurate, complete, and specific details so the LLM generates the best and most relevant topics. Once generated, you can edit the spec file; for example, you can remove topics that don't apply or change a topic's description.\n\nYou can also iterate the spec generation process by using the --spec flag to pass an existing agent spec file to this command, and then using the --role, --company-description, etc, flags to refine your agent properties. Iteratively improving the description of your agent allows the LLM to generate progressively better topics.\n\nYou can also specify other agent properties, such as a custom prompt template, how to ground the prompt template to add context to the agent's prompts, the tone of the prompts, and the username of a user in the org to assign to the agent.\n\nWhen your agent spec is ready, generate an authoring bundle from it by passing the spec file to the --spec flag of the \"agent generate authoring-bundle\" CLI command. An authoring bundle is a metadata type that contains an Agent Script file, which is the blueprint for an agent. (While not recommended, you can also use the agent spec file to immediately create an agent with the \"agent create\" command. We don't recommend this workflow because these types of agents don't use Agent Script, and are thus less flexible and more difficult to maintain.)",
346
346
  "examples": [
347
- "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 %>",
348
- "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",
349
- "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"
347
+ "Generate an agent spec in the default location and use flags to specify the agent properties, such as its role and your company details; use your default org:\n<%= config.bin %> <%= command.id %> --type customer --role \"Field customer complaints and manage employee schedules.\" --company-name \"Coral Cloud Resorts\" --company-description \"Provide customers with exceptional destination activities, unforgettable experiences, and reservation services.\"",
348
+ "Generate an agent spec by being prompted for the required agent properties and generate a maxiumum of 5 topics; write the generated file to the \"specs/resortManagerSpec.yaml\" file and use the org with alias \"my-org\":\n<%= config.bin %> <%= command.id %> --max-topics 5 --output-file specs/resortManagerAgent.yaml --target-org my-org",
349
+ "Be prompted for all required and optional agent properties; use your default org:\n<%= config.bin %> <%= command.id %> --full-interview",
350
+ "Specify an existing agent spec file called \"specs/resortManagerAgent.yaml\", and then overwrite it with a new version that contains newly AI-generated topics based on the updated role information passed in with the --role flag:\n<%= config.bin %> <%= command.id %> --spec specs/resortManagerAgent.yaml --output-file specs/resortManagerAgent.yaml --role \"Field customer complaints, manage employee schedules, and ensure all resort operations are running smoothly\"",
351
+ "Specify that the conversational tone of the agent is formal and to attach the \"resortmanager@myorg.com\" username to it; be prompted for the required properties and use your default org:\n<%= config.bin %> <%= command.id %> --tone formal --agent-user resortmanager@myorg.com"
350
352
  ],
351
353
  "flags": {
352
354
  "json": {
@@ -364,20 +366,6 @@
364
366
  "multiple": false,
365
367
  "type": "option"
366
368
  },
367
- "api-name": {
368
- "name": "api-name",
369
- "summary": "API name of the new test; the API name must not exist in the org.",
370
- "hasDynamicHelp": false,
371
- "multiple": false,
372
- "type": "option"
373
- },
374
- "spec": {
375
- "name": "spec",
376
- "summary": "Path to the test spec YAML file.",
377
- "hasDynamicHelp": false,
378
- "multiple": false,
379
- "type": "option"
380
- },
381
369
  "target-org": {
382
370
  "char": "o",
383
371
  "name": "target-org",
@@ -395,53 +383,163 @@
395
383
  "multiple": false,
396
384
  "type": "option"
397
385
  },
398
- "preview": {
399
- "name": "preview",
400
- "summary": "Preview the test metadata file (AiEvaluationDefinition) without deploying to your org.",
386
+ "type": {
387
+ "name": "type",
388
+ "summary": "Type of agent to create. Internal types are copilots used internally by your company and customer types are the agents you create for your customers.",
389
+ "hasDynamicHelp": false,
390
+ "multiple": false,
391
+ "options": [
392
+ "customer",
393
+ "internal"
394
+ ],
395
+ "type": "option"
396
+ },
397
+ "role": {
398
+ "name": "role",
399
+ "summary": "Role of the agent.",
400
+ "hasDynamicHelp": false,
401
+ "multiple": false,
402
+ "type": "option"
403
+ },
404
+ "company-name": {
405
+ "name": "company-name",
406
+ "summary": "Name of your company.",
407
+ "hasDynamicHelp": false,
408
+ "multiple": false,
409
+ "type": "option"
410
+ },
411
+ "company-description": {
412
+ "name": "company-description",
413
+ "summary": "Description of your company.",
414
+ "hasDynamicHelp": false,
415
+ "multiple": false,
416
+ "type": "option"
417
+ },
418
+ "company-website": {
419
+ "name": "company-website",
420
+ "summary": "Website URL of your company.",
421
+ "hasDynamicHelp": false,
422
+ "multiple": false,
423
+ "type": "option"
424
+ },
425
+ "max-topics": {
426
+ "name": "max-topics",
427
+ "summary": "Maximum number of topics to generate in the agent spec; default is 5.",
428
+ "hasDynamicHelp": false,
429
+ "multiple": false,
430
+ "type": "option"
431
+ },
432
+ "agent-user": {
433
+ "name": "agent-user",
434
+ "summary": "Username of a user in your org to assign to your agent; determines what your agent can access and do.",
435
+ "hasDynamicHelp": false,
436
+ "multiple": false,
437
+ "type": "option"
438
+ },
439
+ "enrich-logs": {
440
+ "name": "enrich-logs",
441
+ "summary": "Adds agent conversation data to event logs so you can view all agent session activity in one place.",
442
+ "hasDynamicHelp": false,
443
+ "multiple": false,
444
+ "options": [
445
+ "true",
446
+ "false"
447
+ ],
448
+ "type": "option"
449
+ },
450
+ "tone": {
451
+ "name": "tone",
452
+ "summary": "Conversational style of the agent, such as how it expresses your brand personality in its messages through word choice, punctuation, and sentence structure.",
453
+ "hasDynamicHelp": false,
454
+ "multiple": false,
455
+ "options": [
456
+ "formal",
457
+ "casual",
458
+ "neutral"
459
+ ],
460
+ "type": "option"
461
+ },
462
+ "spec": {
463
+ "name": "spec",
464
+ "summary": "Agent spec file, in YAML format, to use as input to the command.",
465
+ "hasDynamicHelp": false,
466
+ "multiple": false,
467
+ "type": "option"
468
+ },
469
+ "output-file": {
470
+ "name": "output-file",
471
+ "summary": "Path for the generated YAML agent spec file; can be an absolute or relative path.",
472
+ "default": "specs/agentSpec.yaml",
473
+ "hasDynamicHelp": false,
474
+ "multiple": false,
475
+ "type": "option"
476
+ },
477
+ "full-interview": {
478
+ "name": "full-interview",
479
+ "summary": "Prompt for both required and optional flags.",
401
480
  "allowNo": false,
402
481
  "type": "boolean"
403
482
  },
483
+ "prompt-template": {
484
+ "name": "prompt-template",
485
+ "summary": "API name of a customized prompt template to use instead of the default prompt template.",
486
+ "hasDynamicHelp": false,
487
+ "multiple": false,
488
+ "type": "option"
489
+ },
490
+ "grounding-context": {
491
+ "dependsOn": [
492
+ "prompt-template"
493
+ ],
494
+ "name": "grounding-context",
495
+ "summary": "Context information and personalization that's added to your prompts when using a custom prompt template.",
496
+ "hasDynamicHelp": false,
497
+ "multiple": false,
498
+ "type": "option"
499
+ },
404
500
  "force-overwrite": {
405
501
  "name": "force-overwrite",
406
- "summary": "Don't prompt for confirmation when overwriting an existing test (based on API name) in your org.",
502
+ "summary": "Don't prompt the user to confirm that an existing spec file will be overwritten.",
407
503
  "allowNo": false,
408
504
  "type": "boolean"
409
505
  }
410
506
  },
411
507
  "hasDynamicHelp": true,
412
508
  "hiddenAliases": [],
413
- "id": "agent:test:create",
509
+ "id": "agent:generate:agent-spec",
414
510
  "pluginAlias": "@salesforce/plugin-agent",
415
511
  "pluginName": "@salesforce/plugin-agent",
416
512
  "pluginType": "core",
417
513
  "strict": true,
418
- "summary": "Create an agent test in your org using a local test spec YAML file.",
514
+ "summary": "Generate an agent spec, which is a YAML file that captures what an agent can do.",
419
515
  "enableJsonFlag": true,
516
+ "requiresProject": true,
420
517
  "isESM": true,
421
518
  "relativePath": [
422
519
  "lib",
423
520
  "commands",
424
521
  "agent",
425
- "test",
426
- "create.js"
522
+ "generate",
523
+ "agent-spec.js"
427
524
  ],
428
525
  "aliasPermutations": [],
429
526
  "permutations": [
430
- "agent:test:create",
431
- "test:agent:create",
432
- "test:create:agent",
433
- "agent:create:test",
434
- "create:agent:test",
435
- "create:test:agent"
527
+ "agent:generate:agent-spec",
528
+ "generate:agent:agent-spec",
529
+ "generate:agent-spec:agent",
530
+ "agent:agent-spec:generate",
531
+ "agent-spec:agent:generate",
532
+ "agent-spec:generate:agent"
436
533
  ]
437
534
  },
438
- "agent:test:list": {
535
+ "agent:generate:authoring-bundle": {
439
536
  "aliases": [],
440
537
  "args": {},
441
- "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.",
538
+ "description": "Authoring bundles are metadata components that contain an agent's Agent Script file. The Agent Script file is the agent's blueprint; it fully describes what the agent can do using the Agent Script language.\n\nUse this command to generate a new authoring bundle based on an agent spec YAML file, which you create with the \"agent generate agent-spec\" command. The agent spec YAML file is a high-level description of the agent; it describes its essence rather than exactly what it can do.\n\nThe metadata type for authoring bundles is aiAuthoringBundle, which consist of a standard \"<bundle-api-name>.bundle-meta.xml\" metadata file and the Agent Script file (with extension \".agent\"). When you run this command, the new authoring bundle is generated in the force-app/main/default/aiAuthoringBundles/<bundle-api-name> directory. Use the --output-dir flag to generate them elsewhere.\n\nAfter you generate the initial authoring bundle, code the Agent Script file so your agent behaves exactly as you want. The Agent Script file generated by this command is just a first draft of your agent! Interactively test the agent by conversing with it using the \"agent preview\" command. Then publish the agent to your org with the \"agent publish authoring-bundle\" command.\n\nThis command requires an org because it uses it to access an LLM for generating the Agent Script file.",
442
539
  "examples": [
443
- "List the agent tests in your default org:\n<%= config.bin %> <%= command.id %>",
444
- "List the agent tests in an org with alias \"my-org\"\"\n<%= config.bin %> <%= command.id %> --target-org my-org"
540
+ "Generate an authoring bundle by being prompted for all required values, such as the agent spec YAML file, the bundle name, and the API name; use your default org:\n<%= config.bin %> <%= command.id %>",
541
+ "Generate an authoring bundle from the \"specs/agentSpec.yaml\" agent spec YAML file and give it the label \"My Authoring Bundle\"; use your default org:\n<%= config.bin %> <%= command.id %> --spec specs/agentSpec.yaml --name \"My Authoring Bundle\"",
542
+ "Similar to previous example, but generate the authoring bundle files in the \"other-package-dir/main/default\" package directory; use the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --spec specs/agentSpec.yaml --name \"My Authoring Bundle\" --output-dir other-package-dir/main/default --target-org my-dev-org"
445
543
  ],
446
544
  "flags": {
447
545
  "json": {
@@ -469,49 +567,95 @@
469
567
  "multiple": false,
470
568
  "type": "option"
471
569
  },
570
+ "api-name": {
571
+ "name": "api-name",
572
+ "summary": "API name of the new authoring bundle; if not specified, the API name is derived from the authoring bundle name (label); the API name can't exist in the org.",
573
+ "hasDynamicHelp": false,
574
+ "multiple": false,
575
+ "type": "option"
576
+ },
472
577
  "api-version": {
473
578
  "description": "Override the api version used for api requests made by this command",
474
579
  "name": "api-version",
475
580
  "hasDynamicHelp": false,
476
581
  "multiple": false,
477
582
  "type": "option"
583
+ },
584
+ "spec": {
585
+ "char": "f",
586
+ "name": "spec",
587
+ "summary": "Path to the agent spec YAML file; if not specified, the command provides a list that you can choose from.",
588
+ "hasDynamicHelp": false,
589
+ "multiple": false,
590
+ "type": "option"
591
+ },
592
+ "output-dir": {
593
+ "char": "d",
594
+ "name": "output-dir",
595
+ "summary": "Directory where the authoring bundle files are generated.",
596
+ "hasDynamicHelp": false,
597
+ "multiple": false,
598
+ "type": "option"
599
+ },
600
+ "name": {
601
+ "char": "n",
602
+ "name": "name",
603
+ "summary": "Name (label) of the authoring bundle; if not specified, you're prompted for the name.",
604
+ "hasDynamicHelp": false,
605
+ "multiple": false,
606
+ "type": "option"
478
607
  }
479
608
  },
480
609
  "hasDynamicHelp": true,
481
610
  "hiddenAliases": [],
482
- "id": "agent:test:list",
611
+ "id": "agent:generate:authoring-bundle",
483
612
  "pluginAlias": "@salesforce/plugin-agent",
484
613
  "pluginName": "@salesforce/plugin-agent",
485
614
  "pluginType": "core",
486
615
  "strict": true,
487
- "summary": "List the available agent tests in your org.",
616
+ "summary": "Generate an authoring bundle from an existing agent spec YAML file.",
488
617
  "enableJsonFlag": true,
618
+ "requiresProject": true,
619
+ "FLAGGABLE_PROMPTS": {
620
+ "name": {
621
+ "message": "Name (label) of the authoring bundle; if not specified, you're prompted for the name.",
622
+ "promptMessage": "Name (label) of the authoring bundle",
623
+ "required": true
624
+ },
625
+ "api-name": {
626
+ "message": "API name of the new authoring bundle; if not specified, the API name is derived from the authoring bundle name (label); the API name can't exist in the org.",
627
+ "promptMessage": "API name of the new authoring bundle"
628
+ },
629
+ "spec": {
630
+ "message": "Path to the agent spec YAML file; if not specified, the command provides a list that you can choose from.",
631
+ "promptMessage": "Path to the agent spec YAML file",
632
+ "required": true
633
+ }
634
+ },
489
635
  "isESM": true,
490
636
  "relativePath": [
491
637
  "lib",
492
638
  "commands",
493
639
  "agent",
494
- "test",
495
- "list.js"
640
+ "generate",
641
+ "authoring-bundle.js"
496
642
  ],
497
643
  "aliasPermutations": [],
498
644
  "permutations": [
499
- "agent:test:list",
500
- "test:agent:list",
501
- "test:list:agent",
502
- "agent:list:test",
503
- "list:agent:test",
504
- "list:test:agent"
645
+ "agent:generate:authoring-bundle",
646
+ "generate:agent:authoring-bundle",
647
+ "generate:authoring-bundle:agent",
648
+ "agent:authoring-bundle:generate",
649
+ "authoring-bundle:agent:generate",
650
+ "authoring-bundle:generate:agent"
505
651
  ]
506
652
  },
507
- "agent:test:results": {
653
+ "agent:generate:template": {
508
654
  "aliases": [],
509
655
  "args": {},
510
- "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.",
656
+ "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.",
511
657
  "examples": [
512
- "Get the results of an agent test run in your default org using its job ID:\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ",
513
- "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",
514
- "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"
658
+ "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"
515
659
  ],
516
660
  "flags": {
517
661
  "json": {
@@ -529,16 +673,6 @@
529
673
  "multiple": false,
530
674
  "type": "option"
531
675
  },
532
- "target-org": {
533
- "char": "o",
534
- "name": "target-org",
535
- "noCacheDefault": true,
536
- "required": true,
537
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
538
- "hasDynamicHelp": true,
539
- "multiple": false,
540
- "type": "option"
541
- },
542
676
  "api-version": {
543
677
  "description": "Override the api version used for api requests made by this command",
544
678
  "name": "api-version",
@@ -546,90 +680,62 @@
546
680
  "multiple": false,
547
681
  "type": "option"
548
682
  },
549
- "job-id": {
550
- "char": "i",
551
- "name": "job-id",
683
+ "agent-version": {
684
+ "name": "agent-version",
552
685
  "required": true,
553
- "summary": "Job ID of the completed agent test run.",
554
- "hasDynamicHelp": false,
555
- "multiple": false,
556
- "type": "option"
557
- },
558
- "result-format": {
559
- "name": "result-format",
560
- "summary": "Format of the agent test run results.",
561
- "default": "human",
686
+ "summary": "Version of the agent (BotVersion).",
562
687
  "hasDynamicHelp": false,
563
688
  "multiple": false,
564
- "options": [
565
- "json",
566
- "human",
567
- "junit",
568
- "tap"
569
- ],
570
689
  "type": "option"
571
690
  },
572
- "output-dir": {
573
- "char": "d",
574
- "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.",
575
- "name": "output-dir",
576
- "summary": "Directory to write the agent test results into.",
691
+ "agent-file": {
692
+ "char": "f",
693
+ "name": "agent-file",
694
+ "required": true,
695
+ "summary": "Path to an agent (Bot) metadata file.",
577
696
  "hasDynamicHelp": false,
578
697
  "multiple": false,
579
698
  "type": "option"
580
- },
581
- "verbose": {
582
- "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.",
583
- "name": "verbose",
584
- "summary": "Show generated data in the test results output.",
585
- "allowNo": false,
586
- "type": "boolean"
587
699
  }
588
700
  },
589
- "hasDynamicHelp": true,
701
+ "hasDynamicHelp": false,
590
702
  "hiddenAliases": [],
591
- "id": "agent:test:results",
703
+ "id": "agent:generate:template",
592
704
  "pluginAlias": "@salesforce/plugin-agent",
593
705
  "pluginName": "@salesforce/plugin-agent",
594
706
  "pluginType": "core",
595
707
  "strict": true,
596
- "summary": "Get the results of a completed agent test run.",
708
+ "summary": "Generate an agent template from an existing agent in your DX project so you can then package the template in a managed package.",
597
709
  "enableJsonFlag": true,
710
+ "requiresProject": true,
598
711
  "isESM": true,
599
712
  "relativePath": [
600
713
  "lib",
601
714
  "commands",
602
715
  "agent",
603
- "test",
604
- "results.js"
716
+ "generate",
717
+ "template.js"
605
718
  ],
606
719
  "aliasPermutations": [],
607
720
  "permutations": [
608
- "agent:test:results",
609
- "test:agent:results",
610
- "test:results:agent",
611
- "agent:results:test",
612
- "results:agent:test",
613
- "results:test:agent"
721
+ "agent:generate:template",
722
+ "generate:agent:template",
723
+ "generate:template:agent",
724
+ "agent:template:generate",
725
+ "template:agent:generate",
726
+ "template:generate:agent"
614
727
  ]
615
728
  },
616
- "agent:test:resume": {
729
+ "agent:generate:test-spec": {
617
730
  "aliases": [],
618
731
  "args": {},
619
- "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.",
732
+ "description": "The first step when using Salesforce CLI to create an agent test in your org is to use this interactive command to generate a local YAML-formatted test spec file. The test spec YAML file contains information about the agent being tested, such as its API name, and then one or more test cases. This command uses the metadata components in your DX project when prompting for information, such as the agent API name; it doesn't look in your org.\n\nTo generate a specific agent test case, this command prompts you for this information; when possible, the command provides a list of options for you to choose from:\n\n- Utterance: Natural language statement, question, or command used to test the agent.\n- Expected topic: API name of the topic you expect the agent to use when responding to the utterance.\n- Expected actions: One or more API names of the expection actions the agent takes.\n- Expected outcome: Natural language description of the outcome you expect.\n- (Optional) Custom evaluation: Test an agent's response for specific strings or numbers.\n- (Optional) Conversation history: Boilerplate for additional context you can add to the test in the form of a conversation history.\n\nWhen your test spec is ready, you then run the \"agent test create\" command to actually create the test in your org and synchronize the metadata with your DX project. The metadata type for an agent test is AiEvaluationDefinition.\n\nIf you have an existing AiEvaluationDefinition metadata XML file in your DX project, you can generate its equivalent YAML test spec file with the --from-definition flag.",
620
733
  "examples": [
621
- "Resume an agent test in your default org using a job ID:\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ",
622
- "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",
623
- "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"
734
+ "Generate an agent test spec YAML file interactively:\n<%= config.bin %> <%= command.id %>",
735
+ "Generate an agent test spec YAML file and specify a name for the new file; if the file exists, overwrite it without confirmation:\n<%= config.bin %> <%= command.id %> --output-file specs/Resort_Manager-new-version-testSpec.yaml --force-overwrite",
736
+ "Generate an agent test spec YAML file from an existing AiEvaluationDefinition metadata XML file in your DX project:\n<%= config.bin %> <%= command.id %> --from-definition force-app//main/default/aiEvaluationDefinitions/Resort_Manager_Tests.aiEvaluationDefinition-meta.xml"
624
737
  ],
625
738
  "flags": {
626
- "json": {
627
- "description": "Format output as json.",
628
- "helpGroup": "GLOBAL",
629
- "name": "json",
630
- "allowNo": false,
631
- "type": "boolean"
632
- },
633
739
  "flags-dir": {
634
740
  "helpGroup": "GLOBAL",
635
741
  "name": "flags-dir",
@@ -638,113 +744,63 @@
638
744
  "multiple": false,
639
745
  "type": "option"
640
746
  },
641
- "target-org": {
642
- "char": "o",
643
- "name": "target-org",
644
- "noCacheDefault": true,
645
- "required": true,
646
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
647
- "hasDynamicHelp": true,
648
- "multiple": false,
649
- "type": "option"
650
- },
651
- "api-version": {
652
- "description": "Override the api version used for api requests made by this command",
653
- "name": "api-version",
654
- "hasDynamicHelp": false,
655
- "multiple": false,
656
- "type": "option"
657
- },
658
- "job-id": {
659
- "char": "i",
660
- "name": "job-id",
661
- "summary": "Job ID of the original agent test run.",
747
+ "from-definition": {
748
+ "char": "d",
749
+ "name": "from-definition",
750
+ "summary": "Filepath to the AIEvaluationDefinition metadata XML file in your DX project that you want to convert to a test spec YAML file.",
662
751
  "hasDynamicHelp": false,
663
752
  "multiple": false,
664
753
  "type": "option"
665
754
  },
666
- "use-most-recent": {
667
- "char": "r",
668
- "name": "use-most-recent",
669
- "summary": "Use the job ID of the most recent agent test run.",
755
+ "force-overwrite": {
756
+ "name": "force-overwrite",
757
+ "summary": "Don't prompt for confirmation when overwriting an existing test spec YAML file.",
670
758
  "allowNo": false,
671
759
  "type": "boolean"
672
760
  },
673
- "wait": {
674
- "char": "w",
675
- "name": "wait",
676
- "summary": "Number of minutes to wait for the command to complete and display results to the terminal window.",
677
- "default": "5 minutes",
678
- "hasDynamicHelp": true,
679
- "multiple": false,
680
- "type": "option"
681
- },
682
- "result-format": {
683
- "name": "result-format",
684
- "summary": "Format of the agent test run results.",
685
- "default": "human",
686
- "hasDynamicHelp": false,
687
- "multiple": false,
688
- "options": [
689
- "json",
690
- "human",
691
- "junit",
692
- "tap"
693
- ],
694
- "type": "option"
695
- },
696
- "output-dir": {
697
- "char": "d",
698
- "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.",
699
- "name": "output-dir",
700
- "summary": "Directory to write the agent test results into.",
761
+ "output-file": {
762
+ "char": "f",
763
+ "name": "output-file",
764
+ "summary": "Name of the generated test spec YAML file. Default value is \"specs/<AGENT_API_NAME>-testSpec.yaml\".",
701
765
  "hasDynamicHelp": false,
702
766
  "multiple": false,
703
767
  "type": "option"
704
- },
705
- "verbose": {
706
- "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.",
707
- "name": "verbose",
708
- "summary": "Show generated data in the test results output.",
709
- "allowNo": false,
710
- "type": "boolean"
711
768
  }
712
769
  },
713
- "hasDynamicHelp": true,
770
+ "hasDynamicHelp": false,
714
771
  "hiddenAliases": [],
715
- "id": "agent:test:resume",
772
+ "id": "agent:generate:test-spec",
716
773
  "pluginAlias": "@salesforce/plugin-agent",
717
774
  "pluginName": "@salesforce/plugin-agent",
718
775
  "pluginType": "core",
719
776
  "strict": true,
720
- "summary": "Resume an agent test that you previously started in your org so you can view the test results.",
721
- "enableJsonFlag": true,
777
+ "summary": "Generate an agent test spec, which is a YAML file that lists the test cases for testing a specific agent.",
778
+ "enableJsonFlag": false,
722
779
  "isESM": true,
723
780
  "relativePath": [
724
781
  "lib",
725
782
  "commands",
726
783
  "agent",
727
- "test",
728
- "resume.js"
784
+ "generate",
785
+ "test-spec.js"
729
786
  ],
730
787
  "aliasPermutations": [],
731
788
  "permutations": [
732
- "agent:test:resume",
733
- "test:agent:resume",
734
- "test:resume:agent",
735
- "agent:resume:test",
736
- "resume:agent:test",
737
- "resume:test:agent"
789
+ "agent:generate:test-spec",
790
+ "generate:agent:test-spec",
791
+ "generate:test-spec:agent",
792
+ "agent:test-spec:generate",
793
+ "test-spec:agent:generate",
794
+ "test-spec:generate:agent"
738
795
  ]
739
796
  },
740
- "agent:test:run": {
797
+ "agent:publish:authoring-bundle": {
741
798
  "aliases": [],
742
799
  "args": {},
743
- "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.",
800
+ "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.",
744
801
  "examples": [
745
- "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",
746
- "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",
747
- "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"
802
+ "Publish an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
803
+ "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"
748
804
  ],
749
805
  "flags": {
750
806
  "json": {
@@ -782,84 +838,60 @@
782
838
  "api-name": {
783
839
  "char": "n",
784
840
  "name": "api-name",
785
- "summary": "API name of the agent test to run; corresponds to the name of the AiEvaluationDefinition metadata component that implements the agent test.",
786
- "hasDynamicHelp": false,
787
- "multiple": false,
788
- "type": "option"
789
- },
790
- "wait": {
791
- "char": "w",
792
- "name": "wait",
793
- "summary": "Number of minutes to wait for the command to complete and display results to the terminal window.",
794
- "hasDynamicHelp": true,
795
- "multiple": false,
796
- "type": "option"
797
- },
798
- "result-format": {
799
- "name": "result-format",
800
- "summary": "Format of the agent test run results.",
801
- "default": "human",
802
- "hasDynamicHelp": false,
803
- "multiple": false,
804
- "options": [
805
- "json",
806
- "human",
807
- "junit",
808
- "tap"
809
- ],
810
- "type": "option"
811
- },
812
- "output-dir": {
813
- "char": "d",
814
- "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.",
815
- "name": "output-dir",
816
- "summary": "Directory to write the agent test results into.",
841
+ "summary": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
817
842
  "hasDynamicHelp": false,
818
843
  "multiple": false,
819
844
  "type": "option"
820
845
  },
821
- "verbose": {
822
- "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.",
823
- "name": "verbose",
824
- "summary": "Show generated data in the test results output.",
846
+ "skip-retrieve": {
847
+ "name": "skip-retrieve",
848
+ "summary": "Don't retrieve the metadata associated with the agent to your DX project.",
825
849
  "allowNo": false,
826
850
  "type": "boolean"
827
851
  }
828
852
  },
829
853
  "hasDynamicHelp": true,
830
854
  "hiddenAliases": [],
831
- "id": "agent:test:run",
855
+ "id": "agent:publish:authoring-bundle",
832
856
  "pluginAlias": "@salesforce/plugin-agent",
833
857
  "pluginName": "@salesforce/plugin-agent",
834
858
  "pluginType": "core",
835
859
  "strict": true,
836
- "summary": "Start an agent test in your org.",
860
+ "summary": "Publish an authoring bundle to your org, which results in a new agent or a new version of an existing agent.",
837
861
  "enableJsonFlag": true,
862
+ "requiresProject": true,
863
+ "FLAGGABLE_PROMPTS": {
864
+ "api-name": {
865
+ "message": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
866
+ "promptMessage": "API name of the authoring bundle to publish"
867
+ }
868
+ },
838
869
  "isESM": true,
839
870
  "relativePath": [
840
871
  "lib",
841
872
  "commands",
842
873
  "agent",
843
- "test",
844
- "run.js"
874
+ "publish",
875
+ "authoring-bundle.js"
845
876
  ],
846
877
  "aliasPermutations": [],
847
878
  "permutations": [
848
- "agent:test:run",
849
- "test:agent:run",
850
- "test:run:agent",
851
- "agent:run:test",
852
- "run:agent:test",
853
- "run:test:agent"
879
+ "agent:publish:authoring-bundle",
880
+ "publish:agent:authoring-bundle",
881
+ "publish:authoring-bundle:agent",
882
+ "agent:authoring-bundle:publish",
883
+ "authoring-bundle:agent:publish",
884
+ "authoring-bundle:publish:agent"
854
885
  ]
855
886
  },
856
- "agent:publish:authoring-bundle": {
887
+ "agent:test:create": {
857
888
  "aliases": [],
858
889
  "args": {},
859
- "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.",
890
+ "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.",
860
891
  "examples": [
861
- "Publish an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
862
- "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"
892
+ "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 %>",
893
+ "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",
894
+ "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"
863
895
  ],
864
896
  "flags": {
865
897
  "json": {
@@ -877,6 +909,20 @@
877
909
  "multiple": false,
878
910
  "type": "option"
879
911
  },
912
+ "api-name": {
913
+ "name": "api-name",
914
+ "summary": "API name of the new test; the API name must not exist in the org.",
915
+ "hasDynamicHelp": false,
916
+ "multiple": false,
917
+ "type": "option"
918
+ },
919
+ "spec": {
920
+ "name": "spec",
921
+ "summary": "Path to the test spec YAML file.",
922
+ "hasDynamicHelp": false,
923
+ "multiple": false,
924
+ "type": "option"
925
+ },
880
926
  "target-org": {
881
927
  "char": "o",
882
928
  "name": "target-org",
@@ -894,65 +940,53 @@
894
940
  "multiple": false,
895
941
  "type": "option"
896
942
  },
897
- "api-name": {
898
- "char": "n",
899
- "name": "api-name",
900
- "summary": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
901
- "hasDynamicHelp": false,
902
- "multiple": false,
903
- "type": "option"
943
+ "preview": {
944
+ "name": "preview",
945
+ "summary": "Preview the test metadata file (AiEvaluationDefinition) without deploying to your org.",
946
+ "allowNo": false,
947
+ "type": "boolean"
904
948
  },
905
- "skip-retrieve": {
906
- "name": "skip-retrieve",
907
- "summary": "Don't retrieve the metadata associated with the agent to your DX project.",
949
+ "force-overwrite": {
950
+ "name": "force-overwrite",
951
+ "summary": "Don't prompt for confirmation when overwriting an existing test (based on API name) in your org.",
908
952
  "allowNo": false,
909
953
  "type": "boolean"
910
954
  }
911
955
  },
912
956
  "hasDynamicHelp": true,
913
957
  "hiddenAliases": [],
914
- "id": "agent:publish:authoring-bundle",
958
+ "id": "agent:test:create",
915
959
  "pluginAlias": "@salesforce/plugin-agent",
916
960
  "pluginName": "@salesforce/plugin-agent",
917
961
  "pluginType": "core",
918
962
  "strict": true,
919
- "summary": "Publish an authoring bundle to your org, which results in a new agent or a new version of an existing agent.",
963
+ "summary": "Create an agent test in your org using a local test spec YAML file.",
920
964
  "enableJsonFlag": true,
921
- "requiresProject": true,
922
- "FLAGGABLE_PROMPTS": {
923
- "api-name": {
924
- "message": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
925
- "promptMessage": "API name of the authoring bundle to publish"
926
- }
927
- },
928
965
  "isESM": true,
929
966
  "relativePath": [
930
967
  "lib",
931
968
  "commands",
932
969
  "agent",
933
- "publish",
934
- "authoring-bundle.js"
970
+ "test",
971
+ "create.js"
935
972
  ],
936
973
  "aliasPermutations": [],
937
974
  "permutations": [
938
- "agent:publish:authoring-bundle",
939
- "publish:agent:authoring-bundle",
940
- "publish:authoring-bundle:agent",
941
- "agent:authoring-bundle:publish",
942
- "authoring-bundle:agent:publish",
943
- "authoring-bundle:publish:agent"
975
+ "agent:test:create",
976
+ "test:agent:create",
977
+ "test:create:agent",
978
+ "agent:create:test",
979
+ "create:agent:test",
980
+ "create:test:agent"
944
981
  ]
945
982
  },
946
- "agent:generate:agent-spec": {
983
+ "agent:test:list": {
947
984
  "aliases": [],
948
985
  "args": {},
949
- "description": "An agent spec is a YAML-formatted file that contains basic information about the agent, such as its role, company description, and an AI-generated list of topics based on this information. Topics define the range of jobs your agent can handle.\n\nUse flags, such as --role and --company-description, to provide details about your company and the role that the agent plays in your company. If you prefer, you can also be prompted for the basic information; use --full-interview to be prompted for all required and optional properties. Upon command execution, the large language model (LLM) associated with your org uses the provided information to generate a list of topics for the agent. Because the LLM uses the company and role information to generate the topics, we recommend that you provide accurate, complete, and specific details so the LLM generates the best and most relevant topics. Once generated, you can edit the spec file; for example, you can remove topics that don't apply or change a topic's description.\n\nYou can also iterate the spec generation process by using the --spec flag to pass an existing agent spec file to this command, and then using the --role, --company-description, etc, flags to refine your agent properties. Iteratively improving the description of your agent allows the LLM to generate progressively better topics.\n\nYou can also specify other agent properties, such as a custom prompt template, how to ground the prompt template to add context to the agent's prompts, the tone of the prompts, and the username of a user in the org to assign to the agent.\n\nWhen your agent spec is ready, generate an authoring bundle from it by passing the spec file to the --spec flag of the \"agent generate authoring-bundle\" CLI command. An authoring bundle is a metadata type that contains an Agent Script file, which is the blueprint for an agent. (While not recommended, you can also use the agent spec file to immediately create an agent with the \"agent create\" command. We don't recommend this workflow because these types of agents don't use Agent Script, and are thus less flexible and more difficult to maintain.)",
986
+ "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.",
950
987
  "examples": [
951
- "Generate an agent spec in the default location and use flags to specify the agent properties, such as its role and your company details; use your default org:\n<%= config.bin %> <%= command.id %> --type customer --role \"Field customer complaints and manage employee schedules.\" --company-name \"Coral Cloud Resorts\" --company-description \"Provide customers with exceptional destination activities, unforgettable experiences, and reservation services.\"",
952
- "Generate an agent spec by being prompted for the required agent properties and generate a maxiumum of 5 topics; write the generated file to the \"specs/resortManagerSpec.yaml\" file and use the org with alias \"my-org\":\n<%= config.bin %> <%= command.id %> --max-topics 5 --output-file specs/resortManagerAgent.yaml --target-org my-org",
953
- "Be prompted for all required and optional agent properties; use your default org:\n<%= config.bin %> <%= command.id %> --full-interview",
954
- "Specify an existing agent spec file called \"specs/resortManagerAgent.yaml\", and then overwrite it with a new version that contains newly AI-generated topics based on the updated role information passed in with the --role flag:\n<%= config.bin %> <%= command.id %> --spec specs/resortManagerAgent.yaml --output-file specs/resortManagerAgent.yaml --role \"Field customer complaints, manage employee schedules, and ensure all resort operations are running smoothly\"",
955
- "Specify that the conversational tone of the agent is formal and to attach the \"resortmanager@myorg.com\" username to it; be prompted for the required properties and use your default org:\n<%= config.bin %> <%= command.id %> --tone formal --agent-user resortmanager@myorg.com"
988
+ "List the agent tests in your default org:\n<%= config.bin %> <%= command.id %>",
989
+ "List the agent tests in an org with alias \"my-org\"\"\n<%= config.bin %> <%= command.id %> --target-org my-org"
956
990
  ],
957
991
  "flags": {
958
992
  "json": {
@@ -986,164 +1020,43 @@
986
1020
  "hasDynamicHelp": false,
987
1021
  "multiple": false,
988
1022
  "type": "option"
989
- },
990
- "type": {
991
- "name": "type",
992
- "summary": "Type of agent to create. Internal types are copilots used internally by your company and customer types are the agents you create for your customers.",
993
- "hasDynamicHelp": false,
994
- "multiple": false,
995
- "options": [
996
- "customer",
997
- "internal"
998
- ],
999
- "type": "option"
1000
- },
1001
- "role": {
1002
- "name": "role",
1003
- "summary": "Role of the agent.",
1004
- "hasDynamicHelp": false,
1005
- "multiple": false,
1006
- "type": "option"
1007
- },
1008
- "company-name": {
1009
- "name": "company-name",
1010
- "summary": "Name of your company.",
1011
- "hasDynamicHelp": false,
1012
- "multiple": false,
1013
- "type": "option"
1014
- },
1015
- "company-description": {
1016
- "name": "company-description",
1017
- "summary": "Description of your company.",
1018
- "hasDynamicHelp": false,
1019
- "multiple": false,
1020
- "type": "option"
1021
- },
1022
- "company-website": {
1023
- "name": "company-website",
1024
- "summary": "Website URL of your company.",
1025
- "hasDynamicHelp": false,
1026
- "multiple": false,
1027
- "type": "option"
1028
- },
1029
- "max-topics": {
1030
- "name": "max-topics",
1031
- "summary": "Maximum number of topics to generate in the agent spec; default is 5.",
1032
- "hasDynamicHelp": false,
1033
- "multiple": false,
1034
- "type": "option"
1035
- },
1036
- "agent-user": {
1037
- "name": "agent-user",
1038
- "summary": "Username of a user in your org to assign to your agent; determines what your agent can access and do.",
1039
- "hasDynamicHelp": false,
1040
- "multiple": false,
1041
- "type": "option"
1042
- },
1043
- "enrich-logs": {
1044
- "name": "enrich-logs",
1045
- "summary": "Adds agent conversation data to event logs so you can view all agent session activity in one place.",
1046
- "hasDynamicHelp": false,
1047
- "multiple": false,
1048
- "options": [
1049
- "true",
1050
- "false"
1051
- ],
1052
- "type": "option"
1053
- },
1054
- "tone": {
1055
- "name": "tone",
1056
- "summary": "Conversational style of the agent, such as how it expresses your brand personality in its messages through word choice, punctuation, and sentence structure.",
1057
- "hasDynamicHelp": false,
1058
- "multiple": false,
1059
- "options": [
1060
- "formal",
1061
- "casual",
1062
- "neutral"
1063
- ],
1064
- "type": "option"
1065
- },
1066
- "spec": {
1067
- "name": "spec",
1068
- "summary": "Agent spec file, in YAML format, to use as input to the command.",
1069
- "hasDynamicHelp": false,
1070
- "multiple": false,
1071
- "type": "option"
1072
- },
1073
- "output-file": {
1074
- "name": "output-file",
1075
- "summary": "Path for the generated YAML agent spec file; can be an absolute or relative path.",
1076
- "default": "specs/agentSpec.yaml",
1077
- "hasDynamicHelp": false,
1078
- "multiple": false,
1079
- "type": "option"
1080
- },
1081
- "full-interview": {
1082
- "name": "full-interview",
1083
- "summary": "Prompt for both required and optional flags.",
1084
- "allowNo": false,
1085
- "type": "boolean"
1086
- },
1087
- "prompt-template": {
1088
- "name": "prompt-template",
1089
- "summary": "API name of a customized prompt template to use instead of the default prompt template.",
1090
- "hasDynamicHelp": false,
1091
- "multiple": false,
1092
- "type": "option"
1093
- },
1094
- "grounding-context": {
1095
- "dependsOn": [
1096
- "prompt-template"
1097
- ],
1098
- "name": "grounding-context",
1099
- "summary": "Context information and personalization that's added to your prompts when using a custom prompt template.",
1100
- "hasDynamicHelp": false,
1101
- "multiple": false,
1102
- "type": "option"
1103
- },
1104
- "force-overwrite": {
1105
- "name": "force-overwrite",
1106
- "summary": "Don't prompt the user to confirm that an existing spec file will be overwritten.",
1107
- "allowNo": false,
1108
- "type": "boolean"
1109
1023
  }
1110
1024
  },
1111
1025
  "hasDynamicHelp": true,
1112
1026
  "hiddenAliases": [],
1113
- "id": "agent:generate:agent-spec",
1027
+ "id": "agent:test:list",
1114
1028
  "pluginAlias": "@salesforce/plugin-agent",
1115
1029
  "pluginName": "@salesforce/plugin-agent",
1116
1030
  "pluginType": "core",
1117
1031
  "strict": true,
1118
- "summary": "Generate an agent spec, which is a YAML file that captures what an agent can do.",
1032
+ "summary": "List the available agent tests in your org.",
1119
1033
  "enableJsonFlag": true,
1120
- "requiresProject": true,
1121
1034
  "isESM": true,
1122
1035
  "relativePath": [
1123
1036
  "lib",
1124
1037
  "commands",
1125
1038
  "agent",
1126
- "generate",
1127
- "agent-spec.js"
1039
+ "test",
1040
+ "list.js"
1128
1041
  ],
1129
1042
  "aliasPermutations": [],
1130
1043
  "permutations": [
1131
- "agent:generate:agent-spec",
1132
- "generate:agent:agent-spec",
1133
- "generate:agent-spec:agent",
1134
- "agent:agent-spec:generate",
1135
- "agent-spec:agent:generate",
1136
- "agent-spec:generate:agent"
1044
+ "agent:test:list",
1045
+ "test:agent:list",
1046
+ "test:list:agent",
1047
+ "agent:list:test",
1048
+ "list:agent:test",
1049
+ "list:test:agent"
1137
1050
  ]
1138
1051
  },
1139
- "agent:generate:authoring-bundle": {
1052
+ "agent:test:results": {
1140
1053
  "aliases": [],
1141
1054
  "args": {},
1142
- "description": "Authoring bundles are metadata components that contain an agent's Agent Script file. The Agent Script file is the agent's blueprint; it fully describes what the agent can do using the Agent Script language.\n\nUse this command to generate a new authoring bundle based on an agent spec YAML file, which you create with the \"agent generate agent-spec\" command. The agent spec YAML file is a high-level description of the agent; it describes its essence rather than exactly what it can do.\n\nThe metadata type for authoring bundles is aiAuthoringBundle, which consist of a standard \"<bundle-api-name>.bundle-meta.xml\" metadata file and the Agent Script file (with extension \".agent\"). When you run this command, the new authoring bundle is generated in the force-app/main/default/aiAuthoringBundles/<bundle-api-name> directory. Use the --output-dir flag to generate them elsewhere.\n\nAfter you generate the initial authoring bundle, code the Agent Script file so your agent behaves exactly as you want. The Agent Script file generated by this command is just a first draft of your agent! Interactively test the agent by conversing with it using the \"agent preview\" command. Then publish the agent to your org with the \"agent publish authoring-bundle\" command.\n\nThis command requires an org because it uses it to access an LLM for generating the Agent Script file.",
1055
+ "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.",
1143
1056
  "examples": [
1144
- "Generate an authoring bundle by being prompted for all required values, such as the agent spec YAML file, the bundle name, and the API name; use your default org:\n<%= config.bin %> <%= command.id %>",
1145
- "Generate an authoring bundle from the \"specs/agentSpec.yaml\" agent spec YAML file and give it the label \"My Authoring Bundle\"; use your default org:\n<%= config.bin %> <%= command.id %> --spec specs/agentSpec.yaml --name \"My Authoring Bundle\"",
1146
- "Similar to previous example, but generate the authoring bundle files in the \"other-package-dir/main/default\" package directory; use the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --spec specs/agentSpec.yaml --name \"My Authoring Bundle\" --output-dir other-package-dir/main/default --target-org my-dev-org"
1057
+ "Get the results of an agent test run in your default org using its job ID:\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ",
1058
+ "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",
1059
+ "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"
1147
1060
  ],
1148
1061
  "flags": {
1149
1062
  "json": {
@@ -1171,95 +1084,88 @@
1171
1084
  "multiple": false,
1172
1085
  "type": "option"
1173
1086
  },
1174
- "api-name": {
1175
- "name": "api-name",
1176
- "summary": "API name of the new authoring bundle; if not specified, the API name is derived from the authoring bundle name (label); the API name can't exist in the org.",
1087
+ "api-version": {
1088
+ "description": "Override the api version used for api requests made by this command",
1089
+ "name": "api-version",
1177
1090
  "hasDynamicHelp": false,
1178
1091
  "multiple": false,
1179
1092
  "type": "option"
1180
1093
  },
1181
- "api-version": {
1182
- "description": "Override the api version used for api requests made by this command",
1183
- "name": "api-version",
1094
+ "job-id": {
1095
+ "char": "i",
1096
+ "name": "job-id",
1097
+ "required": true,
1098
+ "summary": "Job ID of the completed agent test run.",
1184
1099
  "hasDynamicHelp": false,
1185
1100
  "multiple": false,
1186
1101
  "type": "option"
1187
1102
  },
1188
- "spec": {
1189
- "char": "f",
1190
- "name": "spec",
1191
- "summary": "Path to the agent spec YAML file; if not specified, the command provides a list that you can choose from.",
1103
+ "result-format": {
1104
+ "name": "result-format",
1105
+ "summary": "Format of the agent test run results.",
1106
+ "default": "human",
1192
1107
  "hasDynamicHelp": false,
1193
1108
  "multiple": false,
1109
+ "options": [
1110
+ "json",
1111
+ "human",
1112
+ "junit",
1113
+ "tap"
1114
+ ],
1194
1115
  "type": "option"
1195
1116
  },
1196
1117
  "output-dir": {
1197
1118
  "char": "d",
1119
+ "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.",
1198
1120
  "name": "output-dir",
1199
- "summary": "Directory where the authoring bundle files are generated.",
1121
+ "summary": "Directory to write the agent test results into.",
1200
1122
  "hasDynamicHelp": false,
1201
1123
  "multiple": false,
1202
1124
  "type": "option"
1203
1125
  },
1204
- "name": {
1205
- "char": "n",
1206
- "name": "name",
1207
- "summary": "Name (label) of the authoring bundle; if not specified, you're prompted for the name.",
1208
- "hasDynamicHelp": false,
1209
- "multiple": false,
1210
- "type": "option"
1126
+ "verbose": {
1127
+ "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.",
1128
+ "name": "verbose",
1129
+ "summary": "Show generated data in the test results output.",
1130
+ "allowNo": false,
1131
+ "type": "boolean"
1211
1132
  }
1212
1133
  },
1213
1134
  "hasDynamicHelp": true,
1214
1135
  "hiddenAliases": [],
1215
- "id": "agent:generate:authoring-bundle",
1136
+ "id": "agent:test:results",
1216
1137
  "pluginAlias": "@salesforce/plugin-agent",
1217
1138
  "pluginName": "@salesforce/plugin-agent",
1218
1139
  "pluginType": "core",
1219
1140
  "strict": true,
1220
- "summary": "Generate an authoring bundle from an existing agent spec YAML file.",
1141
+ "summary": "Get the results of a completed agent test run.",
1221
1142
  "enableJsonFlag": true,
1222
- "requiresProject": true,
1223
- "FLAGGABLE_PROMPTS": {
1224
- "name": {
1225
- "message": "Name (label) of the authoring bundle; if not specified, you're prompted for the name.",
1226
- "promptMessage": "Name (label) of the authoring bundle",
1227
- "required": true
1228
- },
1229
- "api-name": {
1230
- "message": "API name of the new authoring bundle; if not specified, the API name is derived from the authoring bundle name (label); the API name can't exist in the org.",
1231
- "promptMessage": "API name of the new authoring bundle"
1232
- },
1233
- "spec": {
1234
- "message": "Path to the agent spec YAML file; if not specified, the command provides a list that you can choose from.",
1235
- "promptMessage": "Path to the agent spec YAML file",
1236
- "required": true
1237
- }
1238
- },
1239
1143
  "isESM": true,
1240
1144
  "relativePath": [
1241
1145
  "lib",
1242
1146
  "commands",
1243
1147
  "agent",
1244
- "generate",
1245
- "authoring-bundle.js"
1148
+ "test",
1149
+ "results.js"
1246
1150
  ],
1247
1151
  "aliasPermutations": [],
1248
1152
  "permutations": [
1249
- "agent:generate:authoring-bundle",
1250
- "generate:agent:authoring-bundle",
1251
- "generate:authoring-bundle:agent",
1252
- "agent:authoring-bundle:generate",
1253
- "authoring-bundle:agent:generate",
1254
- "authoring-bundle:generate:agent"
1153
+ "agent:test:results",
1154
+ "test:agent:results",
1155
+ "test:results:agent",
1156
+ "agent:results:test",
1157
+ "results:agent:test",
1158
+ "results:test:agent"
1255
1159
  ]
1256
1160
  },
1257
- "agent:generate:template": {
1161
+ "agent:test:resume": {
1258
1162
  "aliases": [],
1259
1163
  "args": {},
1260
- "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.",
1164
+ "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.",
1261
1165
  "examples": [
1262
- "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"
1166
+ "Resume an agent test in your default org using a job ID:\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ",
1167
+ "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",
1168
+ "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"
1263
1169
  ],
1264
1170
  "flags": {
1265
1171
  "json": {
@@ -1277,6 +1183,16 @@
1277
1183
  "multiple": false,
1278
1184
  "type": "option"
1279
1185
  },
1186
+ "target-org": {
1187
+ "char": "o",
1188
+ "name": "target-org",
1189
+ "noCacheDefault": true,
1190
+ "required": true,
1191
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
1192
+ "hasDynamicHelp": true,
1193
+ "multiple": false,
1194
+ "type": "option"
1195
+ },
1280
1196
  "api-version": {
1281
1197
  "description": "Override the api version used for api requests made by this command",
1282
1198
  "name": "api-version",
@@ -1284,62 +1200,105 @@
1284
1200
  "multiple": false,
1285
1201
  "type": "option"
1286
1202
  },
1287
- "agent-version": {
1288
- "name": "agent-version",
1289
- "required": true,
1290
- "summary": "Version of the agent (BotVersion).",
1203
+ "job-id": {
1204
+ "char": "i",
1205
+ "name": "job-id",
1206
+ "summary": "Job ID of the original agent test run.",
1291
1207
  "hasDynamicHelp": false,
1292
1208
  "multiple": false,
1293
1209
  "type": "option"
1294
1210
  },
1295
- "agent-file": {
1296
- "char": "f",
1297
- "name": "agent-file",
1298
- "required": true,
1299
- "summary": "Path to an agent (Bot) metadata file.",
1211
+ "use-most-recent": {
1212
+ "char": "r",
1213
+ "name": "use-most-recent",
1214
+ "summary": "Use the job ID of the most recent agent test run.",
1215
+ "allowNo": false,
1216
+ "type": "boolean"
1217
+ },
1218
+ "wait": {
1219
+ "char": "w",
1220
+ "name": "wait",
1221
+ "summary": "Number of minutes to wait for the command to complete and display results to the terminal window.",
1222
+ "default": "5 minutes",
1223
+ "hasDynamicHelp": true,
1224
+ "multiple": false,
1225
+ "type": "option"
1226
+ },
1227
+ "result-format": {
1228
+ "name": "result-format",
1229
+ "summary": "Format of the agent test run results.",
1230
+ "default": "human",
1231
+ "hasDynamicHelp": false,
1232
+ "multiple": false,
1233
+ "options": [
1234
+ "json",
1235
+ "human",
1236
+ "junit",
1237
+ "tap"
1238
+ ],
1239
+ "type": "option"
1240
+ },
1241
+ "output-dir": {
1242
+ "char": "d",
1243
+ "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.",
1244
+ "name": "output-dir",
1245
+ "summary": "Directory to write the agent test results into.",
1300
1246
  "hasDynamicHelp": false,
1301
1247
  "multiple": false,
1302
1248
  "type": "option"
1249
+ },
1250
+ "verbose": {
1251
+ "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.",
1252
+ "name": "verbose",
1253
+ "summary": "Show generated data in the test results output.",
1254
+ "allowNo": false,
1255
+ "type": "boolean"
1303
1256
  }
1304
1257
  },
1305
- "hasDynamicHelp": false,
1258
+ "hasDynamicHelp": true,
1306
1259
  "hiddenAliases": [],
1307
- "id": "agent:generate:template",
1260
+ "id": "agent:test:resume",
1308
1261
  "pluginAlias": "@salesforce/plugin-agent",
1309
1262
  "pluginName": "@salesforce/plugin-agent",
1310
1263
  "pluginType": "core",
1311
1264
  "strict": true,
1312
- "summary": "Generate an agent template from an existing agent in your DX project so you can then package the template in a managed package.",
1265
+ "summary": "Resume an agent test that you previously started in your org so you can view the test results.",
1313
1266
  "enableJsonFlag": true,
1314
- "requiresProject": true,
1315
1267
  "isESM": true,
1316
1268
  "relativePath": [
1317
1269
  "lib",
1318
1270
  "commands",
1319
1271
  "agent",
1320
- "generate",
1321
- "template.js"
1272
+ "test",
1273
+ "resume.js"
1322
1274
  ],
1323
1275
  "aliasPermutations": [],
1324
1276
  "permutations": [
1325
- "agent:generate:template",
1326
- "generate:agent:template",
1327
- "generate:template:agent",
1328
- "agent:template:generate",
1329
- "template:agent:generate",
1330
- "template:generate:agent"
1277
+ "agent:test:resume",
1278
+ "test:agent:resume",
1279
+ "test:resume:agent",
1280
+ "agent:resume:test",
1281
+ "resume:agent:test",
1282
+ "resume:test:agent"
1331
1283
  ]
1332
1284
  },
1333
- "agent:generate:test-spec": {
1285
+ "agent:test:run": {
1334
1286
  "aliases": [],
1335
1287
  "args": {},
1336
- "description": "The first step when using Salesforce CLI to create an agent test in your org is to use this interactive command to generate a local YAML-formatted test spec file. The test spec YAML file contains information about the agent being tested, such as its API name, and then one or more test cases. This command uses the metadata components in your DX project when prompting for information, such as the agent API name; it doesn't look in your org.\n\nTo generate a specific agent test case, this command prompts you for this information; when possible, the command provides a list of options for you to choose from:\n\n- Utterance: Natural language statement, question, or command used to test the agent.\n- Expected topic: API name of the topic you expect the agent to use when responding to the utterance.\n- Expected actions: One or more API names of the expection actions the agent takes.\n- Expected outcome: Natural language description of the outcome you expect.\n- (Optional) Custom evaluation: Test an agent's response for specific strings or numbers.\n- (Optional) Conversation history: Boilerplate for additional context you can add to the test in the form of a conversation history.\n\nWhen your test spec is ready, you then run the \"agent test create\" command to actually create the test in your org and synchronize the metadata with your DX project. The metadata type for an agent test is AiEvaluationDefinition.\n\nIf you have an existing AiEvaluationDefinition metadata XML file in your DX project, you can generate its equivalent YAML test spec file with the --from-definition flag.",
1288
+ "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.",
1337
1289
  "examples": [
1338
- "Generate an agent test spec YAML file interactively:\n<%= config.bin %> <%= command.id %>",
1339
- "Generate an agent test spec YAML file and specify a name for the new file; if the file exists, overwrite it without confirmation:\n<%= config.bin %> <%= command.id %> --output-file specs/Resort_Manager-new-version-testSpec.yaml --force-overwrite",
1340
- "Generate an agent test spec YAML file from an existing AiEvaluationDefinition metadata XML file in your DX project:\n<%= config.bin %> <%= command.id %> --from-definition force-app//main/default/aiEvaluationDefinitions/Resort_Manager_Tests.aiEvaluationDefinition-meta.xml"
1290
+ "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",
1291
+ "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",
1292
+ "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"
1341
1293
  ],
1342
1294
  "flags": {
1295
+ "json": {
1296
+ "description": "Format output as json.",
1297
+ "helpGroup": "GLOBAL",
1298
+ "name": "json",
1299
+ "allowNo": false,
1300
+ "type": "boolean"
1301
+ },
1343
1302
  "flags-dir": {
1344
1303
  "helpGroup": "GLOBAL",
1345
1304
  "name": "flags-dir",
@@ -1348,54 +1307,95 @@
1348
1307
  "multiple": false,
1349
1308
  "type": "option"
1350
1309
  },
1351
- "from-definition": {
1352
- "char": "d",
1353
- "name": "from-definition",
1354
- "summary": "Filepath to the AIEvaluationDefinition metadata XML file in your DX project that you want to convert to a test spec YAML file.",
1310
+ "target-org": {
1311
+ "char": "o",
1312
+ "name": "target-org",
1313
+ "noCacheDefault": true,
1314
+ "required": true,
1315
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
1316
+ "hasDynamicHelp": true,
1317
+ "multiple": false,
1318
+ "type": "option"
1319
+ },
1320
+ "api-version": {
1321
+ "description": "Override the api version used for api requests made by this command",
1322
+ "name": "api-version",
1355
1323
  "hasDynamicHelp": false,
1356
1324
  "multiple": false,
1357
1325
  "type": "option"
1358
1326
  },
1359
- "force-overwrite": {
1360
- "name": "force-overwrite",
1361
- "summary": "Don't prompt for confirmation when overwriting an existing test spec YAML file.",
1362
- "allowNo": false,
1363
- "type": "boolean"
1327
+ "api-name": {
1328
+ "char": "n",
1329
+ "name": "api-name",
1330
+ "summary": "API name of the agent test to run; corresponds to the name of the AiEvaluationDefinition metadata component that implements the agent test.",
1331
+ "hasDynamicHelp": false,
1332
+ "multiple": false,
1333
+ "type": "option"
1364
1334
  },
1365
- "output-file": {
1366
- "char": "f",
1367
- "name": "output-file",
1368
- "summary": "Name of the generated test spec YAML file. Default value is \"specs/<AGENT_API_NAME>-testSpec.yaml\".",
1335
+ "wait": {
1336
+ "char": "w",
1337
+ "name": "wait",
1338
+ "summary": "Number of minutes to wait for the command to complete and display results to the terminal window.",
1339
+ "hasDynamicHelp": true,
1340
+ "multiple": false,
1341
+ "type": "option"
1342
+ },
1343
+ "result-format": {
1344
+ "name": "result-format",
1345
+ "summary": "Format of the agent test run results.",
1346
+ "default": "human",
1347
+ "hasDynamicHelp": false,
1348
+ "multiple": false,
1349
+ "options": [
1350
+ "json",
1351
+ "human",
1352
+ "junit",
1353
+ "tap"
1354
+ ],
1355
+ "type": "option"
1356
+ },
1357
+ "output-dir": {
1358
+ "char": "d",
1359
+ "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.",
1360
+ "name": "output-dir",
1361
+ "summary": "Directory to write the agent test results into.",
1369
1362
  "hasDynamicHelp": false,
1370
1363
  "multiple": false,
1371
1364
  "type": "option"
1365
+ },
1366
+ "verbose": {
1367
+ "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.",
1368
+ "name": "verbose",
1369
+ "summary": "Show generated data in the test results output.",
1370
+ "allowNo": false,
1371
+ "type": "boolean"
1372
1372
  }
1373
1373
  },
1374
- "hasDynamicHelp": false,
1374
+ "hasDynamicHelp": true,
1375
1375
  "hiddenAliases": [],
1376
- "id": "agent:generate:test-spec",
1376
+ "id": "agent:test:run",
1377
1377
  "pluginAlias": "@salesforce/plugin-agent",
1378
1378
  "pluginName": "@salesforce/plugin-agent",
1379
1379
  "pluginType": "core",
1380
1380
  "strict": true,
1381
- "summary": "Generate an agent test spec, which is a YAML file that lists the test cases for testing a specific agent.",
1382
- "enableJsonFlag": false,
1381
+ "summary": "Start an agent test in your org.",
1382
+ "enableJsonFlag": true,
1383
1383
  "isESM": true,
1384
1384
  "relativePath": [
1385
1385
  "lib",
1386
1386
  "commands",
1387
1387
  "agent",
1388
- "generate",
1389
- "test-spec.js"
1388
+ "test",
1389
+ "run.js"
1390
1390
  ],
1391
1391
  "aliasPermutations": [],
1392
1392
  "permutations": [
1393
- "agent:generate:test-spec",
1394
- "generate:agent:test-spec",
1395
- "generate:test-spec:agent",
1396
- "agent:test-spec:generate",
1397
- "test-spec:agent:generate",
1398
- "test-spec:generate:agent"
1393
+ "agent:test:run",
1394
+ "test:agent:run",
1395
+ "test:run:agent",
1396
+ "agent:run:test",
1397
+ "run:agent:test",
1398
+ "run:test:agent"
1399
1399
  ]
1400
1400
  },
1401
1401
  "agent:validate:authoring-bundle": {
@@ -1483,5 +1483,5 @@
1483
1483
  ]
1484
1484
  }
1485
1485
  },
1486
- "version": "1.27.3"
1486
+ "version": "1.27.4"
1487
1487
  }