@salesforce/plugin-agent 1.45.0 → 2.0.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.
Files changed (3) hide show
  1. package/README.md +41 -41
  2. package/oclif.manifest.json +1489 -1489
  3. package/package.json +9 -9
@@ -1120,13 +1120,16 @@
1120
1120
  "upload:adl:agent"
1121
1121
  ]
1122
1122
  },
1123
- "agent:mcp:create": {
1123
+ "agent:preview:end": {
1124
1124
  "aliases": [],
1125
1125
  "args": {},
1126
- "description": "Registers an external Model Context Protocol (MCP) server with the API Catalog and discovers its assets (tools, prompts, and resources). Provide the server URL and, when the server requires it, OAuth authorization details. When the authorization type is OAUTH you must supply the identity provider, client ID, client secret, and scope.",
1126
+ "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.",
1127
1127
  "examples": [
1128
- "Create an MCP server with no authentication:\n<%= config.bin %> <%= command.id %> --name myServer --server-url https://mcp.example.com --target-org myOrg",
1129
- "Create an MCP server that uses OAuth authentication, piping the client secret from stdin to keep it out of shell history:\ncat secret.txt | <%= config.bin %> <%= command.id %> --name myServer --server-url https://mcp.example.com --auth-type OAUTH --identity-provider myIdp --client-id abc123 --client-secret - --scope \"read write\" --target-org myOrg"
1128
+ "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",
1129
+ "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",
1130
+ "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",
1131
+ "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",
1132
+ "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>"
1130
1133
  ],
1131
1134
  "flags": {
1132
1135
  "json": {
@@ -1161,113 +1164,129 @@
1161
1164
  "multiple": false,
1162
1165
  "type": "option"
1163
1166
  },
1164
- "name": {
1165
- "char": "n",
1166
- "name": "name",
1167
- "required": true,
1168
- "summary": "Unique name of the MCP server.",
1169
- "hasDynamicHelp": false,
1170
- "multiple": false,
1171
- "type": "option"
1172
- },
1173
- "label": {
1174
- "name": "label",
1175
- "summary": "Human-readable label for the MCP server.",
1176
- "hasDynamicHelp": false,
1177
- "multiple": false,
1178
- "type": "option"
1179
- },
1180
- "description": {
1181
- "name": "description",
1182
- "summary": "Description of the MCP server.",
1183
- "hasDynamicHelp": false,
1184
- "multiple": false,
1185
- "type": "option"
1186
- },
1187
- "server-url": {
1188
- "name": "server-url",
1189
- "required": true,
1190
- "summary": "URL of the external MCP server.",
1167
+ "session-id": {
1168
+ "exclusive": [
1169
+ "all"
1170
+ ],
1171
+ "name": "session-id",
1172
+ "required": false,
1173
+ "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.",
1191
1174
  "hasDynamicHelp": false,
1192
1175
  "multiple": false,
1193
1176
  "type": "option"
1194
1177
  },
1195
- "auth-type": {
1196
- "name": "auth-type",
1197
- "summary": "Authorization type to use when connecting to the MCP server.",
1198
- "default": "NO_AUTH",
1199
- "hasDynamicHelp": false,
1200
- "multiple": false,
1201
- "options": [
1202
- "OAUTH",
1203
- "NO_AUTH"
1178
+ "api-name": {
1179
+ "char": "n",
1180
+ "exclusive": [
1181
+ "authoring-bundle"
1204
1182
  ],
1205
- "type": "option"
1206
- },
1207
- "identity-provider": {
1208
- "name": "identity-provider",
1209
- "summary": "Identity provider to use for OAuth authorization. Required when auth-type is OAUTH.",
1183
+ "name": "api-name",
1184
+ "summary": "API name of the activated published agent you want to preview.",
1210
1185
  "hasDynamicHelp": false,
1211
1186
  "multiple": false,
1212
1187
  "type": "option"
1213
1188
  },
1214
- "client-id": {
1215
- "name": "client-id",
1216
- "summary": "OAuth client ID. Required when auth-type is OAUTH.",
1189
+ "authoring-bundle": {
1190
+ "exclusive": [
1191
+ "api-name"
1192
+ ],
1193
+ "name": "authoring-bundle",
1194
+ "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
1217
1195
  "hasDynamicHelp": false,
1218
1196
  "multiple": false,
1219
1197
  "type": "option"
1220
1198
  },
1221
- "client-secret": {
1222
- "name": "client-secret",
1223
- "summary": "OAuth client secret. Required when auth-type is OAUTH. Pass \"-\" to read it from stdin (piped) and keep it out of shell history.",
1224
- "hasDynamicHelp": false,
1225
- "multiple": false,
1226
- "type": "option"
1199
+ "all": {
1200
+ "exclusive": [
1201
+ "session-id"
1202
+ ],
1203
+ "name": "all",
1204
+ "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.",
1205
+ "allowNo": false,
1206
+ "type": "boolean"
1227
1207
  },
1228
- "scope": {
1229
- "name": "scope",
1230
- "summary": "OAuth scope to request. Required when auth-type is OAUTH.",
1231
- "hasDynamicHelp": false,
1232
- "multiple": false,
1233
- "type": "option"
1208
+ "no-prompt": {
1209
+ "char": "p",
1210
+ "name": "no-prompt",
1211
+ "summary": "Don't prompt for confirmation before ending sessions. Has an effect only when used with --all.",
1212
+ "allowNo": false,
1213
+ "type": "boolean"
1234
1214
  }
1235
1215
  },
1236
1216
  "hasDynamicHelp": true,
1237
1217
  "hiddenAliases": [],
1238
- "id": "agent:mcp:create",
1218
+ "id": "agent:preview:end",
1239
1219
  "pluginAlias": "@salesforce/plugin-agent",
1240
1220
  "pluginName": "@salesforce/plugin-agent",
1241
1221
  "pluginType": "core",
1242
- "state": "preview",
1243
1222
  "strict": true,
1244
- "summary": "Create an MCP server in the API Catalog.",
1223
+ "summary": "End an existing programmatic agent preview session and get trace location.",
1245
1224
  "enableJsonFlag": true,
1225
+ "requiresProject": true,
1226
+ "envVariablesSection": {
1227
+ "header": "ENVIRONMENT VARIABLES",
1228
+ "body": [
1229
+ {
1230
+ "name": "SF_TARGET_ORG",
1231
+ "description": "Username or alias of your default org. Overrides the target-org configuration variable."
1232
+ }
1233
+ ]
1234
+ },
1235
+ "errorCodes": {
1236
+ "header": "ERROR CODES",
1237
+ "body": [
1238
+ {
1239
+ "name": "Succeeded (0)",
1240
+ "description": "Preview session ended successfully and traces saved."
1241
+ },
1242
+ {
1243
+ "name": "ExactlyOneRequired (2)",
1244
+ "description": "Neither --api-name nor --authoring-bundle was provided (required when --all is not set)."
1245
+ },
1246
+ {
1247
+ "name": "NotFound (2)",
1248
+ "description": "Agent not found, or no preview session exists for this agent."
1249
+ },
1250
+ {
1251
+ "name": "PreviewEndFailed (4)",
1252
+ "description": "Failed to end the preview session."
1253
+ },
1254
+ {
1255
+ "name": "PreviewEndPartialFailure (68)",
1256
+ "description": "With --all, one or more sessions failed to end while others succeeded."
1257
+ },
1258
+ {
1259
+ "name": "SessionAmbiguous (5)",
1260
+ "description": "Multiple preview sessions found; specify --session-id to choose one."
1261
+ }
1262
+ ]
1263
+ },
1246
1264
  "isESM": true,
1247
1265
  "relativePath": [
1248
1266
  "lib",
1249
1267
  "commands",
1250
1268
  "agent",
1251
- "mcp",
1252
- "create.js"
1269
+ "preview",
1270
+ "end.js"
1253
1271
  ],
1254
1272
  "aliasPermutations": [],
1255
1273
  "permutations": [
1256
- "agent:mcp:create",
1257
- "mcp:agent:create",
1258
- "mcp:create:agent",
1259
- "agent:create:mcp",
1260
- "create:agent:mcp",
1261
- "create:mcp:agent"
1274
+ "agent:preview:end",
1275
+ "preview:agent:end",
1276
+ "preview:end:agent",
1277
+ "agent:end:preview",
1278
+ "end:agent:preview",
1279
+ "end:preview:agent"
1262
1280
  ]
1263
1281
  },
1264
- "agent:mcp:delete": {
1282
+ "agent:preview:send": {
1265
1283
  "aliases": [],
1266
1284
  "args": {},
1267
- "description": "Permanently removes an MCP (Model Context Protocol) server registration from the API Catalog, identified by its ID. By default you are prompted to confirm the deletion; pass --no-prompt to skip the confirmation (for example in scripts and CI).",
1285
+ "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.",
1268
1286
  "examples": [
1269
- "Delete an MCP server, confirming interactively:\n<%= config.bin %> <%= command.id %> --mcp-server-id 0XSxx0000000001 --target-org myOrg",
1270
- "Delete an MCP server without a confirmation prompt:\n<%= config.bin %> <%= command.id %> --mcp-server-id 0XSxx0000000001 --target-org myOrg --no-prompt"
1287
+ "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>",
1288
+ "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",
1289
+ "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"
1271
1290
  ],
1272
1291
  "flags": {
1273
1292
  "json": {
@@ -1302,57 +1321,103 @@
1302
1321
  "multiple": false,
1303
1322
  "type": "option"
1304
1323
  },
1305
- "mcp-server-id": {
1306
- "char": "i",
1307
- "name": "mcp-server-id",
1324
+ "session-id": {
1325
+ "name": "session-id",
1326
+ "required": false,
1327
+ "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.",
1328
+ "hasDynamicHelp": false,
1329
+ "multiple": false,
1330
+ "type": "option"
1331
+ },
1332
+ "utterance": {
1333
+ "char": "u",
1334
+ "name": "utterance",
1308
1335
  "required": true,
1309
- "summary": "ID of the MCP server to delete.",
1336
+ "summary": "Utterance to send to the agent, enclosed in double quotes.",
1310
1337
  "hasDynamicHelp": false,
1311
1338
  "multiple": false,
1312
1339
  "type": "option"
1313
1340
  },
1314
- "no-prompt": {
1315
- "name": "no-prompt",
1316
- "summary": "Skip the confirmation prompt and delete the MCP server immediately.",
1317
- "allowNo": false,
1318
- "type": "boolean"
1341
+ "api-name": {
1342
+ "char": "n",
1343
+ "name": "api-name",
1344
+ "summary": "API name of the activated published agent you want to preview.",
1345
+ "hasDynamicHelp": false,
1346
+ "multiple": false,
1347
+ "type": "option"
1348
+ },
1349
+ "authoring-bundle": {
1350
+ "name": "authoring-bundle",
1351
+ "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
1352
+ "hasDynamicHelp": false,
1353
+ "multiple": false,
1354
+ "type": "option"
1319
1355
  }
1320
1356
  },
1321
1357
  "hasDynamicHelp": true,
1322
1358
  "hiddenAliases": [],
1323
- "id": "agent:mcp:delete",
1359
+ "id": "agent:preview:send",
1324
1360
  "pluginAlias": "@salesforce/plugin-agent",
1325
1361
  "pluginName": "@salesforce/plugin-agent",
1326
1362
  "pluginType": "core",
1327
- "state": "preview",
1328
1363
  "strict": true,
1329
- "summary": "Delete an MCP server from the API Catalog.",
1364
+ "summary": "Send a message to an existing agent preview session.",
1330
1365
  "enableJsonFlag": true,
1366
+ "requiresProject": true,
1367
+ "envVariablesSection": {
1368
+ "header": "ENVIRONMENT VARIABLES",
1369
+ "body": [
1370
+ {
1371
+ "name": "SF_TARGET_ORG",
1372
+ "description": "Username or alias of your default org. Overrides the target-org configuration variable."
1373
+ }
1374
+ ]
1375
+ },
1376
+ "errorCodes": {
1377
+ "header": "ERROR CODES",
1378
+ "body": [
1379
+ {
1380
+ "name": "Succeeded (0)",
1381
+ "description": "Message sent successfully and agent response received."
1382
+ },
1383
+ {
1384
+ "name": "NotFound (2)",
1385
+ "description": "Agent not found, or no preview session exists for this agent."
1386
+ },
1387
+ {
1388
+ "name": "PreviewSendFailed (4)",
1389
+ "description": "Failed to send message or receive response from the preview session."
1390
+ },
1391
+ {
1392
+ "name": "SessionAmbiguous (5)",
1393
+ "description": "Multiple preview sessions found; specify --session-id to choose one."
1394
+ }
1395
+ ]
1396
+ },
1331
1397
  "isESM": true,
1332
1398
  "relativePath": [
1333
1399
  "lib",
1334
1400
  "commands",
1335
1401
  "agent",
1336
- "mcp",
1337
- "delete.js"
1402
+ "preview",
1403
+ "send.js"
1338
1404
  ],
1339
1405
  "aliasPermutations": [],
1340
1406
  "permutations": [
1341
- "agent:mcp:delete",
1342
- "mcp:agent:delete",
1343
- "mcp:delete:agent",
1344
- "agent:delete:mcp",
1345
- "delete:agent:mcp",
1346
- "delete:mcp:agent"
1407
+ "agent:preview:send",
1408
+ "preview:agent:send",
1409
+ "preview:send:agent",
1410
+ "agent:send:preview",
1411
+ "send:agent:preview",
1412
+ "send:preview:agent"
1347
1413
  ]
1348
1414
  },
1349
- "agent:mcp:fetch": {
1415
+ "agent:preview:sessions": {
1350
1416
  "aliases": [],
1351
1417
  "args": {},
1352
- "description": "Performs a live fetch against the configured MCP server identified by its ID, returning the assets (MCP tools, prompts, and resources) it currently advertises along with their status and activation state. Use this to refresh the view of what an MCP server exposes before activating its assets as agent actions.",
1418
+ "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.",
1353
1419
  "examples": [
1354
- "Fetch the assets advertised by an MCP server in the default target org:\n<%= config.bin %> <%= command.id %> --target-org myOrg --mcp-server-id 0XSxx0000000001",
1355
- "Fetch MCP server assets and output as JSON:\n<%= config.bin %> <%= command.id %> --target-org myOrg --mcp-server-id 0XSxx0000000001 --json"
1420
+ "List all cached agent preview sessions:\n<%= config.bin %> <%= command.id %>"
1356
1421
  ],
1357
1422
  "flags": {
1358
1423
  "json": {
@@ -1369,69 +1434,53 @@
1369
1434
  "hasDynamicHelp": false,
1370
1435
  "multiple": false,
1371
1436
  "type": "option"
1372
- },
1373
- "target-org": {
1374
- "char": "o",
1375
- "name": "target-org",
1376
- "noCacheDefault": true,
1377
- "required": true,
1378
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
1379
- "hasDynamicHelp": true,
1380
- "multiple": false,
1381
- "type": "option"
1382
- },
1383
- "api-version": {
1384
- "description": "Override the api version used for api requests made by this command",
1385
- "name": "api-version",
1386
- "hasDynamicHelp": false,
1387
- "multiple": false,
1388
- "type": "option"
1389
- },
1390
- "mcp-server-id": {
1391
- "char": "i",
1392
- "name": "mcp-server-id",
1393
- "required": true,
1394
- "summary": "ID of the MCP server to fetch assets from.",
1395
- "hasDynamicHelp": false,
1396
- "multiple": false,
1397
- "type": "option"
1398
1437
  }
1399
1438
  },
1400
- "hasDynamicHelp": true,
1439
+ "hasDynamicHelp": false,
1401
1440
  "hiddenAliases": [],
1402
- "id": "agent:mcp:fetch",
1441
+ "id": "agent:preview:sessions",
1403
1442
  "pluginAlias": "@salesforce/plugin-agent",
1404
1443
  "pluginName": "@salesforce/plugin-agent",
1405
1444
  "pluginType": "core",
1406
- "state": "preview",
1407
1445
  "strict": true,
1408
- "summary": "Fetch the live assets (tools, prompts, resources) advertised by an MCP server.",
1446
+ "summary": "List all known programmatic agent preview sessions.",
1409
1447
  "enableJsonFlag": true,
1448
+ "requiresProject": true,
1449
+ "errorCodes": {
1450
+ "header": "ERROR CODES",
1451
+ "body": [
1452
+ {
1453
+ "name": "Succeeded (0)",
1454
+ "description": "Sessions listed successfully (or empty list if no active sessions)."
1455
+ }
1456
+ ]
1457
+ },
1410
1458
  "isESM": true,
1411
1459
  "relativePath": [
1412
1460
  "lib",
1413
1461
  "commands",
1414
1462
  "agent",
1415
- "mcp",
1416
- "fetch.js"
1463
+ "preview",
1464
+ "sessions.js"
1417
1465
  ],
1418
1466
  "aliasPermutations": [],
1419
1467
  "permutations": [
1420
- "agent:mcp:fetch",
1421
- "mcp:agent:fetch",
1422
- "mcp:fetch:agent",
1423
- "agent:fetch:mcp",
1424
- "fetch:agent:mcp",
1425
- "fetch:mcp:agent"
1468
+ "agent:preview:sessions",
1469
+ "preview:agent:sessions",
1470
+ "preview:sessions:agent",
1471
+ "agent:sessions:preview",
1472
+ "sessions:agent:preview",
1473
+ "sessions:preview:agent"
1426
1474
  ]
1427
1475
  },
1428
- "agent:mcp:get": {
1476
+ "agent:preview:start": {
1429
1477
  "aliases": [],
1430
1478
  "args": {},
1431
- "description": "Retrieves the details of an MCP (Model Context Protocol) server by its identifier, including its name, label, type, status, and server URL.",
1479
+ "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.",
1432
1480
  "examples": [
1433
- "Get an MCP server by id in the default target org:\n<%= config.bin %> <%= command.id %> --target-org myOrg --mcp-server-id 0Mx000000000001",
1434
- "Get an MCP server and output as JSON:\n<%= config.bin %> <%= command.id %> --target-org myOrg --mcp-server-id 0Mx000000000001 --json"
1481
+ "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",
1482
+ "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",
1483
+ "Start a preview session with an activated published agent (always uses live actions):\n<%= config.bin %> <%= command.id %> --api-name My_Published_Agent"
1435
1484
  ],
1436
1485
  "flags": {
1437
1486
  "json": {
@@ -1466,11 +1515,55 @@
1466
1515
  "multiple": false,
1467
1516
  "type": "option"
1468
1517
  },
1469
- "mcp-server-id": {
1470
- "char": "i",
1471
- "name": "mcp-server-id",
1472
- "required": true,
1473
- "summary": "The identifier of the MCP server to retrieve.",
1518
+ "api-name": {
1519
+ "char": "n",
1520
+ "name": "api-name",
1521
+ "summary": "API name of the activated published agent you want to preview.",
1522
+ "hasDynamicHelp": false,
1523
+ "multiple": false,
1524
+ "type": "option"
1525
+ },
1526
+ "authoring-bundle": {
1527
+ "name": "authoring-bundle",
1528
+ "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
1529
+ "hasDynamicHelp": false,
1530
+ "multiple": false,
1531
+ "type": "option"
1532
+ },
1533
+ "use-live-actions": {
1534
+ "exclusive": [
1535
+ "simulate-actions"
1536
+ ],
1537
+ "name": "use-live-actions",
1538
+ "summary": "Execute real actions in the org (Apex classes, flows, etc.). Required with --authoring-bundle.",
1539
+ "allowNo": false,
1540
+ "type": "boolean"
1541
+ },
1542
+ "simulate-actions": {
1543
+ "exclusive": [
1544
+ "use-live-actions"
1545
+ ],
1546
+ "name": "simulate-actions",
1547
+ "summary": "Use AI to simulate action execution instead of calling real actions. Required with --authoring-bundle.",
1548
+ "allowNo": false,
1549
+ "type": "boolean"
1550
+ },
1551
+ "context-variables": {
1552
+ "description": "Sets variables on the agent preview session, mirroring what the in-org Agentforce Builder UI does when you override variables before sending a message. Specify this flag multiple times or use comma-separated values. Two namespaces are supported, distinguished by the name shape. Names pass through to the runtime verbatim — the CLI doesn't transform them.\n\nLinked context variables use the \"$Context.\" prefix. These map to externally-provided fields that the runtime resolves (declared in the bundle's globalConfiguration.contextVariables) and are read by live actions and topic-routing expressions via $Context.Name. Example: $Context.MyLinkedVar=some-value.\n\nState variables use the bare developerName, no prefix. These seed mutable agent state declared in agentVersion.stateVariables. Example: MyStateVar=some-value.\n\nBoth namespaces can be mixed in one value. Example: --context-variables '$Context.MyLinkedVar=foo,MyStateVar=bar'.\n\nTips: (1) Quote the whole value in single quotes so $Context isn't shell-expanded. (2) Names are sent verbatim — a bare name is treated as a state variable, not a linked context variable, so live actions that bind via $Context.Name will see null. (3) Type defaults to Text.",
1553
+ "name": "context-variables",
1554
+ "summary": "Session variables for the agent preview session, in the form Name=Value.",
1555
+ "delimiter": ",",
1556
+ "hasDynamicHelp": false,
1557
+ "multiple": true,
1558
+ "type": "option"
1559
+ },
1560
+ "agent-json": {
1561
+ "dependsOn": [
1562
+ "authoring-bundle"
1563
+ ],
1564
+ "hidden": true,
1565
+ "name": "agent-json",
1566
+ "summary": "Path to a pre-compiled AgentJSON file to use instead of compiling the Agent Script file. Intended for internal use and testing.",
1474
1567
  "hasDynamicHelp": false,
1475
1568
  "multiple": false,
1476
1569
  "type": "option"
@@ -1478,39 +1571,73 @@
1478
1571
  },
1479
1572
  "hasDynamicHelp": true,
1480
1573
  "hiddenAliases": [],
1481
- "id": "agent:mcp:get",
1574
+ "id": "agent:preview:start",
1482
1575
  "pluginAlias": "@salesforce/plugin-agent",
1483
1576
  "pluginName": "@salesforce/plugin-agent",
1484
1577
  "pluginType": "core",
1485
- "state": "preview",
1486
1578
  "strict": true,
1487
- "summary": "Get a single MCP server registered in the API Catalog.",
1579
+ "summary": "Start a programmatic agent preview session.",
1488
1580
  "enableJsonFlag": true,
1581
+ "requiresProject": true,
1582
+ "envVariablesSection": {
1583
+ "header": "ENVIRONMENT VARIABLES",
1584
+ "body": [
1585
+ {
1586
+ "name": "SF_TARGET_ORG",
1587
+ "description": "Username or alias of your default org. Overrides the target-org configuration variable."
1588
+ }
1589
+ ]
1590
+ },
1591
+ "errorCodes": {
1592
+ "header": "ERROR CODES",
1593
+ "body": [
1594
+ {
1595
+ "name": "Succeeded (0)",
1596
+ "description": "Preview session started successfully."
1597
+ },
1598
+ {
1599
+ "name": "Failed (1)",
1600
+ "description": "Agent Script compilation failed (syntax errors in the script)."
1601
+ },
1602
+ {
1603
+ "name": "NotFound (2)",
1604
+ "description": "Agent not found, or compilation API returned HTTP 404 (endpoint may not be available in your org or region)."
1605
+ },
1606
+ {
1607
+ "name": "ServerError (3)",
1608
+ "description": "Compilation API returned HTTP 500 (server error during compilation)."
1609
+ },
1610
+ {
1611
+ "name": "PreviewStartFailed (4)",
1612
+ "description": "Preview session failed to start due to API or network errors."
1613
+ }
1614
+ ]
1615
+ },
1489
1616
  "isESM": true,
1490
1617
  "relativePath": [
1491
1618
  "lib",
1492
1619
  "commands",
1493
1620
  "agent",
1494
- "mcp",
1495
- "get.js"
1621
+ "preview",
1622
+ "start.js"
1496
1623
  ],
1497
1624
  "aliasPermutations": [],
1498
1625
  "permutations": [
1499
- "agent:mcp:get",
1500
- "mcp:agent:get",
1501
- "mcp:get:agent",
1502
- "agent:get:mcp",
1503
- "get:agent:mcp",
1504
- "get:mcp:agent"
1626
+ "agent:preview:start",
1627
+ "preview:agent:start",
1628
+ "preview:start:agent",
1629
+ "agent:start:preview",
1630
+ "start:agent:preview",
1631
+ "start:preview:agent"
1505
1632
  ]
1506
1633
  },
1507
- "agent:mcp:list": {
1634
+ "agent:mcp:create": {
1508
1635
  "aliases": [],
1509
1636
  "args": {},
1510
- "description": "Returns the Model Context Protocol (MCP) servers registered in the API Catalog, optionally filtered by label, type, or status. Use this to discover which MCP servers are available and inspect their server URLs and current status.",
1637
+ "description": "Registers an external Model Context Protocol (MCP) server with the API Catalog and discovers its assets (tools, prompts, and resources). Provide the server URL and, when the server requires it, OAuth authorization details. When the authorization type is OAUTH you must supply the identity provider, client ID, client secret, and scope.",
1511
1638
  "examples": [
1512
- "List all MCP servers in the default target org:\n<%= config.bin %> <%= command.id %> --target-org myOrg",
1513
- "List external MCP servers filtered by status and output as JSON:\n<%= config.bin %> <%= command.id %> --target-org myOrg --type EXTERNAL --status ACTIVE --json"
1639
+ "Create an MCP server with no authentication:\n<%= config.bin %> <%= command.id %> --name myServer --server-url https://mcp.example.com --target-org myOrg",
1640
+ "Create an MCP server that uses OAuth authentication, piping the client secret from stdin to keep it out of shell history:\ncat secret.txt | <%= config.bin %> <%= command.id %> --name myServer --server-url https://mcp.example.com --auth-type OAUTH --identity-provider myIdp --client-id abc123 --client-secret - --scope \"read write\" --target-org myOrg"
1514
1641
  ],
1515
1642
  "flags": {
1516
1643
  "json": {
@@ -1545,169 +1672,73 @@
1545
1672
  "multiple": false,
1546
1673
  "type": "option"
1547
1674
  },
1675
+ "name": {
1676
+ "char": "n",
1677
+ "name": "name",
1678
+ "required": true,
1679
+ "summary": "Unique name of the MCP server.",
1680
+ "hasDynamicHelp": false,
1681
+ "multiple": false,
1682
+ "type": "option"
1683
+ },
1548
1684
  "label": {
1549
1685
  "name": "label",
1550
- "summary": "Filter the MCP servers by label.",
1686
+ "summary": "Human-readable label for the MCP server.",
1551
1687
  "hasDynamicHelp": false,
1552
1688
  "multiple": false,
1553
1689
  "type": "option"
1554
1690
  },
1555
- "type": {
1556
- "name": "type",
1557
- "summary": "Filter the MCP servers by type.",
1691
+ "description": {
1692
+ "name": "description",
1693
+ "summary": "Description of the MCP server.",
1558
1694
  "hasDynamicHelp": false,
1559
1695
  "multiple": false,
1560
- "options": [
1561
- "EXTERNAL"
1562
- ],
1563
1696
  "type": "option"
1564
1697
  },
1565
- "status": {
1566
- "name": "status",
1567
- "summary": "Filter the MCP servers by connection status. Only ACTIVE and DISCONNECTED are supported as filters.",
1698
+ "server-url": {
1699
+ "name": "server-url",
1700
+ "required": true,
1701
+ "summary": "URL of the external MCP server.",
1702
+ "hasDynamicHelp": false,
1703
+ "multiple": false,
1704
+ "type": "option"
1705
+ },
1706
+ "auth-type": {
1707
+ "name": "auth-type",
1708
+ "summary": "Authorization type to use when connecting to the MCP server.",
1709
+ "default": "NO_AUTH",
1568
1710
  "hasDynamicHelp": false,
1569
1711
  "multiple": false,
1570
1712
  "options": [
1571
- "ACTIVE",
1572
- "DISCONNECTED"
1573
- ],
1574
- "type": "option"
1575
- }
1576
- },
1577
- "hasDynamicHelp": true,
1578
- "hiddenAliases": [],
1579
- "id": "agent:mcp:list",
1580
- "pluginAlias": "@salesforce/plugin-agent",
1581
- "pluginName": "@salesforce/plugin-agent",
1582
- "pluginType": "core",
1583
- "state": "preview",
1584
- "strict": true,
1585
- "summary": "List the MCP servers registered in the API Catalog.",
1586
- "enableJsonFlag": true,
1587
- "isESM": true,
1588
- "relativePath": [
1589
- "lib",
1590
- "commands",
1591
- "agent",
1592
- "mcp",
1593
- "list.js"
1594
- ],
1595
- "aliasPermutations": [],
1596
- "permutations": [
1597
- "agent:mcp:list",
1598
- "mcp:agent:list",
1599
- "mcp:list:agent",
1600
- "agent:list:mcp",
1601
- "list:agent:mcp",
1602
- "list:mcp:agent"
1603
- ]
1604
- },
1605
- "agent:mcp:update": {
1606
- "aliases": [],
1607
- "args": {},
1608
- "description": "Updates an existing MCP server in the API Catalog. Only the fields you provide are changed; omitted fields are left untouched. You can update the label, description, and server URL, and replace the authorization configuration. When setting `--auth-type OAUTH`, you must also provide `--identity-provider`, `--client-id`, `--client-secret`, and `--scope`. When setting `--auth-type NO_AUTH`, no authorization credentials are required. At least one updatable field must be supplied.",
1609
- "examples": [
1610
- "Update the label and description of an MCP server in the default target org:\n<%= config.bin %> <%= command.id %> --mcp-server-id 0XSxx0000000001 --label \"Orders MCP\" --description \"Order tooling\" --target-org myOrg",
1611
- "Update the server URL and switch the authorization to OAuth, piping the client secret from stdin and outputting as JSON:\ncat secret.txt | <%= config.bin %> <%= command.id %> --mcp-server-id 0XSxx0000000001 --server-url https://mcp.example.com --auth-type OAUTH --identity-provider MyIdp --client-id abc --client-secret - --scope \"read write\" --target-org myOrg --json"
1612
- ],
1613
- "flags": {
1614
- "json": {
1615
- "description": "Format output as json.",
1616
- "helpGroup": "GLOBAL",
1617
- "name": "json",
1618
- "allowNo": false,
1619
- "type": "boolean"
1620
- },
1621
- "flags-dir": {
1622
- "helpGroup": "GLOBAL",
1623
- "name": "flags-dir",
1624
- "summary": "Import flag values from a directory.",
1625
- "hasDynamicHelp": false,
1626
- "multiple": false,
1627
- "type": "option"
1628
- },
1629
- "target-org": {
1630
- "char": "o",
1631
- "name": "target-org",
1632
- "noCacheDefault": true,
1633
- "required": true,
1634
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
1635
- "hasDynamicHelp": true,
1636
- "multiple": false,
1637
- "type": "option"
1638
- },
1639
- "api-version": {
1640
- "description": "Override the api version used for api requests made by this command",
1641
- "name": "api-version",
1642
- "hasDynamicHelp": false,
1643
- "multiple": false,
1644
- "type": "option"
1645
- },
1646
- "mcp-server-id": {
1647
- "char": "i",
1648
- "name": "mcp-server-id",
1649
- "required": true,
1650
- "summary": "ID of the MCP server to update.",
1651
- "hasDynamicHelp": false,
1652
- "multiple": false,
1653
- "type": "option"
1654
- },
1655
- "label": {
1656
- "name": "label",
1657
- "summary": "New display label for the MCP server.",
1658
- "hasDynamicHelp": false,
1659
- "multiple": false,
1660
- "type": "option"
1661
- },
1662
- "description": {
1663
- "name": "description",
1664
- "summary": "New description for the MCP server.",
1665
- "hasDynamicHelp": false,
1666
- "multiple": false,
1667
- "type": "option"
1668
- },
1669
- "server-url": {
1670
- "name": "server-url",
1671
- "summary": "New endpoint URL of the MCP server.",
1672
- "hasDynamicHelp": false,
1673
- "multiple": false,
1674
- "type": "option"
1675
- },
1676
- "auth-type": {
1677
- "name": "auth-type",
1678
- "summary": "Authorization type to apply to the MCP server (OAUTH or NO_AUTH).",
1679
- "hasDynamicHelp": false,
1680
- "multiple": false,
1681
- "options": [
1682
- "OAUTH",
1683
- "NO_AUTH"
1713
+ "OAUTH",
1714
+ "NO_AUTH"
1684
1715
  ],
1685
1716
  "type": "option"
1686
1717
  },
1687
1718
  "identity-provider": {
1688
1719
  "name": "identity-provider",
1689
- "summary": "Identity provider name for OAuth authorization (required when --auth-type is OAUTH).",
1720
+ "summary": "Identity provider to use for OAuth authorization. Required when auth-type is OAUTH.",
1690
1721
  "hasDynamicHelp": false,
1691
1722
  "multiple": false,
1692
1723
  "type": "option"
1693
1724
  },
1694
1725
  "client-id": {
1695
1726
  "name": "client-id",
1696
- "summary": "OAuth client ID (required when --auth-type is OAUTH).",
1727
+ "summary": "OAuth client ID. Required when auth-type is OAUTH.",
1697
1728
  "hasDynamicHelp": false,
1698
1729
  "multiple": false,
1699
1730
  "type": "option"
1700
1731
  },
1701
1732
  "client-secret": {
1702
1733
  "name": "client-secret",
1703
- "summary": "OAuth client secret (required when --auth-type is OAUTH). Pass \"-\" to read it from stdin (piped) and keep it out of shell history.",
1734
+ "summary": "OAuth client secret. Required when auth-type is OAUTH. Pass \"-\" to read it from stdin (piped) and keep it out of shell history.",
1704
1735
  "hasDynamicHelp": false,
1705
1736
  "multiple": false,
1706
1737
  "type": "option"
1707
1738
  },
1708
1739
  "scope": {
1709
1740
  "name": "scope",
1710
- "summary": "OAuth scope (required when --auth-type is OAUTH).",
1741
+ "summary": "OAuth scope to request. Required when auth-type is OAUTH.",
1711
1742
  "hasDynamicHelp": false,
1712
1743
  "multiple": false,
1713
1744
  "type": "option"
@@ -1715,13 +1746,13 @@
1715
1746
  },
1716
1747
  "hasDynamicHelp": true,
1717
1748
  "hiddenAliases": [],
1718
- "id": "agent:mcp:update",
1749
+ "id": "agent:mcp:create",
1719
1750
  "pluginAlias": "@salesforce/plugin-agent",
1720
1751
  "pluginName": "@salesforce/plugin-agent",
1721
1752
  "pluginType": "core",
1722
1753
  "state": "preview",
1723
1754
  "strict": true,
1724
- "summary": "Update an MCP server registered in the API Catalog.",
1755
+ "summary": "Create an MCP server in the API Catalog.",
1725
1756
  "enableJsonFlag": true,
1726
1757
  "isESM": true,
1727
1758
  "relativePath": [
@@ -1729,28 +1760,25 @@
1729
1760
  "commands",
1730
1761
  "agent",
1731
1762
  "mcp",
1732
- "update.js"
1763
+ "create.js"
1733
1764
  ],
1734
1765
  "aliasPermutations": [],
1735
1766
  "permutations": [
1736
- "agent:mcp:update",
1737
- "mcp:agent:update",
1738
- "mcp:update:agent",
1739
- "agent:update:mcp",
1740
- "update:agent:mcp",
1741
- "update:mcp:agent"
1767
+ "agent:mcp:create",
1768
+ "mcp:agent:create",
1769
+ "mcp:create:agent",
1770
+ "agent:create:mcp",
1771
+ "create:agent:mcp",
1772
+ "create:mcp:agent"
1742
1773
  ]
1743
1774
  },
1744
- "agent:preview:end": {
1775
+ "agent:mcp:delete": {
1745
1776
  "aliases": [],
1746
1777
  "args": {},
1747
- "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.",
1778
+ "description": "Permanently removes an MCP (Model Context Protocol) server registration from the API Catalog, identified by its ID. By default you are prompted to confirm the deletion; pass --no-prompt to skip the confirmation (for example in scripts and CI).",
1748
1779
  "examples": [
1749
- "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",
1750
- "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",
1751
- "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",
1752
- "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",
1753
- "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>"
1780
+ "Delete an MCP server, confirming interactively:\n<%= config.bin %> <%= command.id %> --mcp-server-id 0XSxx0000000001 --target-org myOrg",
1781
+ "Delete an MCP server without a confirmation prompt:\n<%= config.bin %> <%= command.id %> --mcp-server-id 0XSxx0000000001 --target-org myOrg --no-prompt"
1754
1782
  ],
1755
1783
  "flags": {
1756
1784
  "json": {
@@ -1785,129 +1813,57 @@
1785
1813
  "multiple": false,
1786
1814
  "type": "option"
1787
1815
  },
1788
- "session-id": {
1789
- "exclusive": [
1790
- "all"
1791
- ],
1792
- "name": "session-id",
1793
- "required": false,
1794
- "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.",
1795
- "hasDynamicHelp": false,
1796
- "multiple": false,
1797
- "type": "option"
1798
- },
1799
- "api-name": {
1800
- "char": "n",
1801
- "exclusive": [
1802
- "authoring-bundle"
1803
- ],
1804
- "name": "api-name",
1805
- "summary": "API name of the activated published agent you want to preview.",
1806
- "hasDynamicHelp": false,
1807
- "multiple": false,
1808
- "type": "option"
1809
- },
1810
- "authoring-bundle": {
1811
- "exclusive": [
1812
- "api-name"
1813
- ],
1814
- "name": "authoring-bundle",
1815
- "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
1816
+ "mcp-server-id": {
1817
+ "char": "i",
1818
+ "name": "mcp-server-id",
1819
+ "required": true,
1820
+ "summary": "ID of the MCP server to delete.",
1816
1821
  "hasDynamicHelp": false,
1817
1822
  "multiple": false,
1818
1823
  "type": "option"
1819
1824
  },
1820
- "all": {
1821
- "exclusive": [
1822
- "session-id"
1823
- ],
1824
- "name": "all",
1825
- "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.",
1826
- "allowNo": false,
1827
- "type": "boolean"
1828
- },
1829
1825
  "no-prompt": {
1830
- "char": "p",
1831
1826
  "name": "no-prompt",
1832
- "summary": "Don't prompt for confirmation before ending sessions. Has an effect only when used with --all.",
1827
+ "summary": "Skip the confirmation prompt and delete the MCP server immediately.",
1833
1828
  "allowNo": false,
1834
1829
  "type": "boolean"
1835
1830
  }
1836
1831
  },
1837
1832
  "hasDynamicHelp": true,
1838
1833
  "hiddenAliases": [],
1839
- "id": "agent:preview:end",
1834
+ "id": "agent:mcp:delete",
1840
1835
  "pluginAlias": "@salesforce/plugin-agent",
1841
1836
  "pluginName": "@salesforce/plugin-agent",
1842
1837
  "pluginType": "core",
1838
+ "state": "preview",
1843
1839
  "strict": true,
1844
- "summary": "End an existing programmatic agent preview session and get trace location.",
1840
+ "summary": "Delete an MCP server from the API Catalog.",
1845
1841
  "enableJsonFlag": true,
1846
- "requiresProject": true,
1847
- "envVariablesSection": {
1848
- "header": "ENVIRONMENT VARIABLES",
1849
- "body": [
1850
- {
1851
- "name": "SF_TARGET_ORG",
1852
- "description": "Username or alias of your default org. Overrides the target-org configuration variable."
1853
- }
1854
- ]
1855
- },
1856
- "errorCodes": {
1857
- "header": "ERROR CODES",
1858
- "body": [
1859
- {
1860
- "name": "Succeeded (0)",
1861
- "description": "Preview session ended successfully and traces saved."
1862
- },
1863
- {
1864
- "name": "ExactlyOneRequired (2)",
1865
- "description": "Neither --api-name nor --authoring-bundle was provided (required when --all is not set)."
1866
- },
1867
- {
1868
- "name": "NotFound (2)",
1869
- "description": "Agent not found, or no preview session exists for this agent."
1870
- },
1871
- {
1872
- "name": "PreviewEndFailed (4)",
1873
- "description": "Failed to end the preview session."
1874
- },
1875
- {
1876
- "name": "PreviewEndPartialFailure (68)",
1877
- "description": "With --all, one or more sessions failed to end while others succeeded."
1878
- },
1879
- {
1880
- "name": "SessionAmbiguous (5)",
1881
- "description": "Multiple preview sessions found; specify --session-id to choose one."
1882
- }
1883
- ]
1884
- },
1885
1842
  "isESM": true,
1886
1843
  "relativePath": [
1887
1844
  "lib",
1888
1845
  "commands",
1889
1846
  "agent",
1890
- "preview",
1891
- "end.js"
1847
+ "mcp",
1848
+ "delete.js"
1892
1849
  ],
1893
1850
  "aliasPermutations": [],
1894
1851
  "permutations": [
1895
- "agent:preview:end",
1896
- "preview:agent:end",
1897
- "preview:end:agent",
1898
- "agent:end:preview",
1899
- "end:agent:preview",
1900
- "end:preview:agent"
1852
+ "agent:mcp:delete",
1853
+ "mcp:agent:delete",
1854
+ "mcp:delete:agent",
1855
+ "agent:delete:mcp",
1856
+ "delete:agent:mcp",
1857
+ "delete:mcp:agent"
1901
1858
  ]
1902
1859
  },
1903
- "agent:preview:send": {
1860
+ "agent:mcp:fetch": {
1904
1861
  "aliases": [],
1905
1862
  "args": {},
1906
- "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.",
1863
+ "description": "Performs a live fetch against the configured MCP server identified by its ID, returning the assets (MCP tools, prompts, and resources) it currently advertises along with their status and activation state. Use this to refresh the view of what an MCP server exposes before activating its assets as agent actions.",
1907
1864
  "examples": [
1908
- "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>",
1909
- "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",
1910
- "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"
1865
+ "Fetch the assets advertised by an MCP server in the default target org:\n<%= config.bin %> <%= command.id %> --target-org myOrg --mcp-server-id 0XSxx0000000001",
1866
+ "Fetch MCP server assets and output as JSON:\n<%= config.bin %> <%= command.id %> --target-org myOrg --mcp-server-id 0XSxx0000000001 --json"
1911
1867
  ],
1912
1868
  "flags": {
1913
1869
  "json": {
@@ -1942,34 +1898,11 @@
1942
1898
  "multiple": false,
1943
1899
  "type": "option"
1944
1900
  },
1945
- "session-id": {
1946
- "name": "session-id",
1947
- "required": false,
1948
- "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.",
1949
- "hasDynamicHelp": false,
1950
- "multiple": false,
1951
- "type": "option"
1952
- },
1953
- "utterance": {
1954
- "char": "u",
1955
- "name": "utterance",
1901
+ "mcp-server-id": {
1902
+ "char": "i",
1903
+ "name": "mcp-server-id",
1956
1904
  "required": true,
1957
- "summary": "Utterance to send to the agent, enclosed in double quotes.",
1958
- "hasDynamicHelp": false,
1959
- "multiple": false,
1960
- "type": "option"
1961
- },
1962
- "api-name": {
1963
- "char": "n",
1964
- "name": "api-name",
1965
- "summary": "API name of the activated published agent you want to preview.",
1966
- "hasDynamicHelp": false,
1967
- "multiple": false,
1968
- "type": "option"
1969
- },
1970
- "authoring-bundle": {
1971
- "name": "authoring-bundle",
1972
- "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
1905
+ "summary": "ID of the MCP server to fetch assets from.",
1973
1906
  "hasDynamicHelp": false,
1974
1907
  "multiple": false,
1975
1908
  "type": "option"
@@ -1977,68 +1910,39 @@
1977
1910
  },
1978
1911
  "hasDynamicHelp": true,
1979
1912
  "hiddenAliases": [],
1980
- "id": "agent:preview:send",
1913
+ "id": "agent:mcp:fetch",
1981
1914
  "pluginAlias": "@salesforce/plugin-agent",
1982
1915
  "pluginName": "@salesforce/plugin-agent",
1983
1916
  "pluginType": "core",
1917
+ "state": "preview",
1984
1918
  "strict": true,
1985
- "summary": "Send a message to an existing agent preview session.",
1919
+ "summary": "Fetch the live assets (tools, prompts, resources) advertised by an MCP server.",
1986
1920
  "enableJsonFlag": true,
1987
- "requiresProject": true,
1988
- "envVariablesSection": {
1989
- "header": "ENVIRONMENT VARIABLES",
1990
- "body": [
1991
- {
1992
- "name": "SF_TARGET_ORG",
1993
- "description": "Username or alias of your default org. Overrides the target-org configuration variable."
1994
- }
1995
- ]
1996
- },
1997
- "errorCodes": {
1998
- "header": "ERROR CODES",
1999
- "body": [
2000
- {
2001
- "name": "Succeeded (0)",
2002
- "description": "Message sent successfully and agent response received."
2003
- },
2004
- {
2005
- "name": "NotFound (2)",
2006
- "description": "Agent not found, or no preview session exists for this agent."
2007
- },
2008
- {
2009
- "name": "PreviewSendFailed (4)",
2010
- "description": "Failed to send message or receive response from the preview session."
2011
- },
2012
- {
2013
- "name": "SessionAmbiguous (5)",
2014
- "description": "Multiple preview sessions found; specify --session-id to choose one."
2015
- }
2016
- ]
2017
- },
2018
1921
  "isESM": true,
2019
1922
  "relativePath": [
2020
1923
  "lib",
2021
1924
  "commands",
2022
1925
  "agent",
2023
- "preview",
2024
- "send.js"
1926
+ "mcp",
1927
+ "fetch.js"
2025
1928
  ],
2026
1929
  "aliasPermutations": [],
2027
1930
  "permutations": [
2028
- "agent:preview:send",
2029
- "preview:agent:send",
2030
- "preview:send:agent",
2031
- "agent:send:preview",
2032
- "send:agent:preview",
2033
- "send:preview:agent"
1931
+ "agent:mcp:fetch",
1932
+ "mcp:agent:fetch",
1933
+ "mcp:fetch:agent",
1934
+ "agent:fetch:mcp",
1935
+ "fetch:agent:mcp",
1936
+ "fetch:mcp:agent"
2034
1937
  ]
2035
1938
  },
2036
- "agent:preview:sessions": {
1939
+ "agent:mcp:get": {
2037
1940
  "aliases": [],
2038
1941
  "args": {},
2039
- "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.",
1942
+ "description": "Retrieves the details of an MCP (Model Context Protocol) server by its identifier, including its name, label, type, status, and server URL.",
2040
1943
  "examples": [
2041
- "List all cached agent preview sessions:\n<%= config.bin %> <%= command.id %>"
1944
+ "Get an MCP server by id in the default target org:\n<%= config.bin %> <%= command.id %> --target-org myOrg --mcp-server-id 0Mx000000000001",
1945
+ "Get an MCP server and output as JSON:\n<%= config.bin %> <%= command.id %> --target-org myOrg --mcp-server-id 0Mx000000000001 --json"
2042
1946
  ],
2043
1947
  "flags": {
2044
1948
  "json": {
@@ -2055,53 +1959,69 @@
2055
1959
  "hasDynamicHelp": false,
2056
1960
  "multiple": false,
2057
1961
  "type": "option"
1962
+ },
1963
+ "target-org": {
1964
+ "char": "o",
1965
+ "name": "target-org",
1966
+ "noCacheDefault": true,
1967
+ "required": true,
1968
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
1969
+ "hasDynamicHelp": true,
1970
+ "multiple": false,
1971
+ "type": "option"
1972
+ },
1973
+ "api-version": {
1974
+ "description": "Override the api version used for api requests made by this command",
1975
+ "name": "api-version",
1976
+ "hasDynamicHelp": false,
1977
+ "multiple": false,
1978
+ "type": "option"
1979
+ },
1980
+ "mcp-server-id": {
1981
+ "char": "i",
1982
+ "name": "mcp-server-id",
1983
+ "required": true,
1984
+ "summary": "The identifier of the MCP server to retrieve.",
1985
+ "hasDynamicHelp": false,
1986
+ "multiple": false,
1987
+ "type": "option"
2058
1988
  }
2059
1989
  },
2060
- "hasDynamicHelp": false,
1990
+ "hasDynamicHelp": true,
2061
1991
  "hiddenAliases": [],
2062
- "id": "agent:preview:sessions",
1992
+ "id": "agent:mcp:get",
2063
1993
  "pluginAlias": "@salesforce/plugin-agent",
2064
1994
  "pluginName": "@salesforce/plugin-agent",
2065
1995
  "pluginType": "core",
1996
+ "state": "preview",
2066
1997
  "strict": true,
2067
- "summary": "List all known programmatic agent preview sessions.",
1998
+ "summary": "Get a single MCP server registered in the API Catalog.",
2068
1999
  "enableJsonFlag": true,
2069
- "requiresProject": true,
2070
- "errorCodes": {
2071
- "header": "ERROR CODES",
2072
- "body": [
2073
- {
2074
- "name": "Succeeded (0)",
2075
- "description": "Sessions listed successfully (or empty list if no active sessions)."
2076
- }
2077
- ]
2078
- },
2079
2000
  "isESM": true,
2080
2001
  "relativePath": [
2081
2002
  "lib",
2082
2003
  "commands",
2083
2004
  "agent",
2084
- "preview",
2085
- "sessions.js"
2005
+ "mcp",
2006
+ "get.js"
2086
2007
  ],
2087
2008
  "aliasPermutations": [],
2088
2009
  "permutations": [
2089
- "agent:preview:sessions",
2090
- "preview:agent:sessions",
2091
- "preview:sessions:agent",
2092
- "agent:sessions:preview",
2093
- "sessions:agent:preview",
2094
- "sessions:preview:agent"
2010
+ "agent:mcp:get",
2011
+ "mcp:agent:get",
2012
+ "mcp:get:agent",
2013
+ "agent:get:mcp",
2014
+ "get:agent:mcp",
2015
+ "get:mcp:agent"
2095
2016
  ]
2096
2017
  },
2097
- "agent:preview:start": {
2018
+ "agent:mcp:list": {
2098
2019
  "aliases": [],
2099
2020
  "args": {},
2100
- "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.",
2021
+ "description": "Returns the Model Context Protocol (MCP) servers registered in the API Catalog, optionally filtered by label, type, or status. Use this to discover which MCP servers are available and inspect their server URLs and current status.",
2101
2022
  "examples": [
2102
- "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",
2103
- "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",
2104
- "Start a preview session with an activated published agent (always uses live actions):\n<%= config.bin %> <%= command.id %> --api-name My_Published_Agent"
2023
+ "List all MCP servers in the default target org:\n<%= config.bin %> <%= command.id %> --target-org myOrg",
2024
+ "List external MCP servers filtered by status and output as JSON:\n<%= config.bin %> <%= command.id %> --target-org myOrg --type EXTERNAL --status ACTIVE --json"
2105
2025
  ],
2106
2026
  "flags": {
2107
2027
  "json": {
@@ -2136,131 +2056,70 @@
2136
2056
  "multiple": false,
2137
2057
  "type": "option"
2138
2058
  },
2139
- "api-name": {
2140
- "char": "n",
2141
- "name": "api-name",
2142
- "summary": "API name of the activated published agent you want to preview.",
2059
+ "label": {
2060
+ "name": "label",
2061
+ "summary": "Filter the MCP servers by label.",
2143
2062
  "hasDynamicHelp": false,
2144
2063
  "multiple": false,
2145
2064
  "type": "option"
2146
2065
  },
2147
- "authoring-bundle": {
2148
- "name": "authoring-bundle",
2149
- "summary": "API name of the authoring bundle metadata component that contains the agent's Agent Script file.",
2066
+ "type": {
2067
+ "name": "type",
2068
+ "summary": "Filter the MCP servers by type.",
2150
2069
  "hasDynamicHelp": false,
2151
2070
  "multiple": false,
2152
- "type": "option"
2153
- },
2154
- "use-live-actions": {
2155
- "exclusive": [
2156
- "simulate-actions"
2157
- ],
2158
- "name": "use-live-actions",
2159
- "summary": "Execute real actions in the org (Apex classes, flows, etc.). Required with --authoring-bundle.",
2160
- "allowNo": false,
2161
- "type": "boolean"
2162
- },
2163
- "simulate-actions": {
2164
- "exclusive": [
2165
- "use-live-actions"
2071
+ "options": [
2072
+ "EXTERNAL"
2166
2073
  ],
2167
- "name": "simulate-actions",
2168
- "summary": "Use AI to simulate action execution instead of calling real actions. Required with --authoring-bundle.",
2169
- "allowNo": false,
2170
- "type": "boolean"
2171
- },
2172
- "context-variables": {
2173
- "description": "Sets variables on the agent preview session, mirroring what the in-org Agentforce Builder UI does when you override variables before sending a message. Specify this flag multiple times or use comma-separated values. Two namespaces are supported, distinguished by the name shape. Names pass through to the runtime verbatim — the CLI doesn't transform them.\n\nLinked context variables use the \"$Context.\" prefix. These map to externally-provided fields that the runtime resolves (declared in the bundle's globalConfiguration.contextVariables) and are read by live actions and topic-routing expressions via $Context.Name. Example: $Context.MyLinkedVar=some-value.\n\nState variables use the bare developerName, no prefix. These seed mutable agent state declared in agentVersion.stateVariables. Example: MyStateVar=some-value.\n\nBoth namespaces can be mixed in one value. Example: --context-variables '$Context.MyLinkedVar=foo,MyStateVar=bar'.\n\nTips: (1) Quote the whole value in single quotes so $Context isn't shell-expanded. (2) Names are sent verbatim — a bare name is treated as a state variable, not a linked context variable, so live actions that bind via $Context.Name will see null. (3) Type defaults to Text.",
2174
- "name": "context-variables",
2175
- "summary": "Session variables for the agent preview session, in the form Name=Value.",
2176
- "delimiter": ",",
2177
- "hasDynamicHelp": false,
2178
- "multiple": true,
2179
2074
  "type": "option"
2180
2075
  },
2181
- "agent-json": {
2182
- "dependsOn": [
2183
- "authoring-bundle"
2184
- ],
2185
- "hidden": true,
2186
- "name": "agent-json",
2187
- "summary": "Path to a pre-compiled AgentJSON file to use instead of compiling the Agent Script file. Intended for internal use and testing.",
2076
+ "status": {
2077
+ "name": "status",
2078
+ "summary": "Filter the MCP servers by connection status. Only ACTIVE and DISCONNECTED are supported as filters.",
2188
2079
  "hasDynamicHelp": false,
2189
2080
  "multiple": false,
2081
+ "options": [
2082
+ "ACTIVE",
2083
+ "DISCONNECTED"
2084
+ ],
2190
2085
  "type": "option"
2191
2086
  }
2192
2087
  },
2193
2088
  "hasDynamicHelp": true,
2194
2089
  "hiddenAliases": [],
2195
- "id": "agent:preview:start",
2090
+ "id": "agent:mcp:list",
2196
2091
  "pluginAlias": "@salesforce/plugin-agent",
2197
2092
  "pluginName": "@salesforce/plugin-agent",
2198
2093
  "pluginType": "core",
2094
+ "state": "preview",
2199
2095
  "strict": true,
2200
- "summary": "Start a programmatic agent preview session.",
2096
+ "summary": "List the MCP servers registered in the API Catalog.",
2201
2097
  "enableJsonFlag": true,
2202
- "requiresProject": true,
2203
- "envVariablesSection": {
2204
- "header": "ENVIRONMENT VARIABLES",
2205
- "body": [
2206
- {
2207
- "name": "SF_TARGET_ORG",
2208
- "description": "Username or alias of your default org. Overrides the target-org configuration variable."
2209
- }
2210
- ]
2211
- },
2212
- "errorCodes": {
2213
- "header": "ERROR CODES",
2214
- "body": [
2215
- {
2216
- "name": "Succeeded (0)",
2217
- "description": "Preview session started successfully."
2218
- },
2219
- {
2220
- "name": "Failed (1)",
2221
- "description": "Agent Script compilation failed (syntax errors in the script)."
2222
- },
2223
- {
2224
- "name": "NotFound (2)",
2225
- "description": "Agent not found, or compilation API returned HTTP 404 (endpoint may not be available in your org or region)."
2226
- },
2227
- {
2228
- "name": "ServerError (3)",
2229
- "description": "Compilation API returned HTTP 500 (server error during compilation)."
2230
- },
2231
- {
2232
- "name": "PreviewStartFailed (4)",
2233
- "description": "Preview session failed to start due to API or network errors."
2234
- }
2235
- ]
2236
- },
2237
2098
  "isESM": true,
2238
2099
  "relativePath": [
2239
2100
  "lib",
2240
2101
  "commands",
2241
2102
  "agent",
2242
- "preview",
2243
- "start.js"
2103
+ "mcp",
2104
+ "list.js"
2244
2105
  ],
2245
2106
  "aliasPermutations": [],
2246
2107
  "permutations": [
2247
- "agent:preview:start",
2248
- "preview:agent:start",
2249
- "preview:start:agent",
2250
- "agent:start:preview",
2251
- "start:agent:preview",
2252
- "start:preview:agent"
2108
+ "agent:mcp:list",
2109
+ "mcp:agent:list",
2110
+ "mcp:list:agent",
2111
+ "agent:list:mcp",
2112
+ "list:agent:mcp",
2113
+ "list:mcp:agent"
2253
2114
  ]
2254
2115
  },
2255
- "agent:publish:authoring-bundle": {
2116
+ "agent:mcp:update": {
2256
2117
  "aliases": [],
2257
2118
  "args": {},
2258
- "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.",
2119
+ "description": "Updates an existing MCP server in the API Catalog. Only the fields you provide are changed; omitted fields are left untouched. You can update the label, description, and server URL, and replace the authorization configuration. When setting `--auth-type OAUTH`, you must also provide `--identity-provider`, `--client-id`, `--client-secret`, and `--scope`. When setting `--auth-type NO_AUTH`, no authorization credentials are required. At least one updatable field must be supplied.",
2259
2120
  "examples": [
2260
- "Publish an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
2261
- "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",
2262
- "Publish with verbose output to see all retrieved and deployed metadata components:\n<%= config.bin %> <%= command.id %> --api-name MyAuthoringbundle --verbose",
2263
- "Publish with concise output showing only essential information:\n<%= config.bin %> <%= command.id %> --api-name MyAuthoringbundle --concise"
2121
+ "Update the label and description of an MCP server in the default target org:\n<%= config.bin %> <%= command.id %> --mcp-server-id 0XSxx0000000001 --label \"Orders MCP\" --description \"Order tooling\" --target-org myOrg",
2122
+ "Update the server URL and switch the authorization to OAuth, piping the client secret from stdin and outputting as JSON:\ncat secret.txt | <%= config.bin %> <%= command.id %> --mcp-server-id 0XSxx0000000001 --server-url https://mcp.example.com --auth-type OAUTH --identity-provider MyIdp --client-id abc --client-secret - --scope \"read write\" --target-org myOrg --json"
2264
2123
  ],
2265
2124
  "flags": {
2266
2125
  "json": {
@@ -2295,233 +2154,114 @@
2295
2154
  "multiple": false,
2296
2155
  "type": "option"
2297
2156
  },
2298
- "api-name": {
2299
- "char": "n",
2300
- "name": "api-name",
2301
- "summary": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
2157
+ "mcp-server-id": {
2158
+ "char": "i",
2159
+ "name": "mcp-server-id",
2160
+ "required": true,
2161
+ "summary": "ID of the MCP server to update.",
2302
2162
  "hasDynamicHelp": false,
2303
2163
  "multiple": false,
2304
2164
  "type": "option"
2305
2165
  },
2306
- "skip-retrieve": {
2307
- "name": "skip-retrieve",
2308
- "summary": "Don't retrieve the metadata associated with the agent to your DX project.",
2309
- "allowNo": false,
2310
- "type": "boolean"
2311
- },
2312
- "verbose": {
2313
- "char": "v",
2314
- "exclusive": [
2315
- "concise"
2316
- ],
2317
- "name": "verbose",
2318
- "summary": "Display detailed output showing all metadata components retrieved and deployed during the publish process.",
2319
- "allowNo": false,
2320
- "type": "boolean"
2321
- },
2322
- "concise": {
2323
- "exclusive": [
2324
- "verbose"
2325
- ],
2326
- "name": "concise",
2327
- "summary": "Display minimal output with only essential information about the publish operation.",
2328
- "allowNo": false,
2329
- "type": "boolean"
2330
- }
2331
- },
2332
- "hasDynamicHelp": true,
2333
- "hiddenAliases": [],
2334
- "id": "agent:publish:authoring-bundle",
2335
- "pluginAlias": "@salesforce/plugin-agent",
2336
- "pluginName": "@salesforce/plugin-agent",
2337
- "pluginType": "core",
2338
- "strict": true,
2339
- "summary": "Publish an authoring bundle to your org, which results in a new agent or a new version of an existing agent.",
2340
- "enableJsonFlag": true,
2341
- "requiresProject": true,
2342
- "errorCodes": {
2343
- "header": "ERROR CODES",
2344
- "body": [
2345
- {
2346
- "name": "Succeeded (0)",
2347
- "description": "Agent published successfully without errors."
2348
- },
2349
- {
2350
- "name": "Failed (1)",
2351
- "description": "Compilation errors found in the Agent Script file."
2352
- }
2353
- ]
2354
- },
2355
- "FLAGGABLE_PROMPTS": {
2356
- "api-name": {
2357
- "message": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
2358
- "promptMessage": "API name of the authoring bundle to publish"
2359
- }
2360
- },
2361
- "isESM": true,
2362
- "relativePath": [
2363
- "lib",
2364
- "commands",
2365
- "agent",
2366
- "publish",
2367
- "authoring-bundle.js"
2368
- ],
2369
- "aliasPermutations": [],
2370
- "permutations": [
2371
- "agent:publish:authoring-bundle",
2372
- "publish:agent:authoring-bundle",
2373
- "publish:authoring-bundle:agent",
2374
- "agent:authoring-bundle:publish",
2375
- "authoring-bundle:agent:publish",
2376
- "authoring-bundle:publish:agent"
2377
- ]
2378
- },
2379
- "agent:test:create": {
2380
- "aliases": [],
2381
- "args": {},
2382
- "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 (legacy) or Agentforce Studio (NGT). This command also retrieves the metadata component associated with the new test to your local Salesforce DX project and displays its filename. By default, the legacy AiEvaluationDefinition is created; use --test-runner agentforce-studio to author an AiTestingDefinition (NGT) instead.\n\nAfter you've created the test in the org, use the \"agent test run\" command to run it.",
2383
- "examples": [
2384
- "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 %>",
2385
- "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",
2386
- "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",
2387
- "Author an Agentforce Studio (NGT) test from an NGT-shaped YAML; writes an AiTestingDefinition metadata file:\n<%= config.bin %> <%= command.id %> --spec specs/ReturnsCheckout.ngt.yaml --api-name Returns_Checkout --test-runner agentforce-studio --target-org my-org"
2388
- ],
2389
- "flags": {
2390
- "json": {
2391
- "description": "Format output as json.",
2392
- "helpGroup": "GLOBAL",
2393
- "name": "json",
2394
- "allowNo": false,
2395
- "type": "boolean"
2396
- },
2397
- "flags-dir": {
2398
- "helpGroup": "GLOBAL",
2399
- "name": "flags-dir",
2400
- "summary": "Import flag values from a directory.",
2166
+ "label": {
2167
+ "name": "label",
2168
+ "summary": "New display label for the MCP server.",
2401
2169
  "hasDynamicHelp": false,
2402
2170
  "multiple": false,
2403
2171
  "type": "option"
2404
2172
  },
2405
- "api-name": {
2406
- "name": "api-name",
2407
- "summary": "API name of the new test; the API name must not exist in the org.",
2173
+ "description": {
2174
+ "name": "description",
2175
+ "summary": "New description for the MCP server.",
2408
2176
  "hasDynamicHelp": false,
2409
2177
  "multiple": false,
2410
2178
  "type": "option"
2411
2179
  },
2412
- "spec": {
2413
- "name": "spec",
2414
- "summary": "Path to the test spec YAML file.",
2180
+ "server-url": {
2181
+ "name": "server-url",
2182
+ "summary": "New endpoint URL of the MCP server.",
2415
2183
  "hasDynamicHelp": false,
2416
2184
  "multiple": false,
2417
2185
  "type": "option"
2418
2186
  },
2419
- "target-org": {
2420
- "char": "o",
2421
- "name": "target-org",
2422
- "noCacheDefault": true,
2423
- "required": true,
2424
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
2425
- "hasDynamicHelp": true,
2187
+ "auth-type": {
2188
+ "name": "auth-type",
2189
+ "summary": "Authorization type to apply to the MCP server (OAUTH or NO_AUTH).",
2190
+ "hasDynamicHelp": false,
2426
2191
  "multiple": false,
2192
+ "options": [
2193
+ "OAUTH",
2194
+ "NO_AUTH"
2195
+ ],
2427
2196
  "type": "option"
2428
2197
  },
2429
- "api-version": {
2430
- "description": "Override the api version used for api requests made by this command",
2431
- "name": "api-version",
2198
+ "identity-provider": {
2199
+ "name": "identity-provider",
2200
+ "summary": "Identity provider name for OAuth authorization (required when --auth-type is OAUTH).",
2432
2201
  "hasDynamicHelp": false,
2433
2202
  "multiple": false,
2434
2203
  "type": "option"
2435
2204
  },
2436
- "preview": {
2437
- "name": "preview",
2438
- "summary": "Preview the test metadata file without deploying to your org.",
2439
- "allowNo": false,
2440
- "type": "boolean"
2205
+ "client-id": {
2206
+ "name": "client-id",
2207
+ "summary": "OAuth client ID (required when --auth-type is OAUTH).",
2208
+ "hasDynamicHelp": false,
2209
+ "multiple": false,
2210
+ "type": "option"
2441
2211
  },
2442
- "force-overwrite": {
2443
- "name": "force-overwrite",
2444
- "summary": "Don't prompt for confirmation when overwriting an existing test (based on API name) in your org.",
2445
- "allowNo": false,
2446
- "type": "boolean"
2212
+ "client-secret": {
2213
+ "name": "client-secret",
2214
+ "summary": "OAuth client secret (required when --auth-type is OAUTH). Pass \"-\" to read it from stdin (piped) and keep it out of shell history.",
2215
+ "hasDynamicHelp": false,
2216
+ "multiple": false,
2217
+ "type": "option"
2447
2218
  },
2448
- "test-runner": {
2449
- "description": "By default, the command automatically detects which test runner to use based on the test definition metadata type in your org. Use this flag to explicitly specify the runner type. 'agentforce-studio' uses AiTestingDefinition metadata. 'testing-center' uses AiEvaluationDefinition metadata.",
2450
- "name": "test-runner",
2451
- "summary": "Explicitly specify which test runner to use (agentforce-studio or testing-center).",
2219
+ "scope": {
2220
+ "name": "scope",
2221
+ "summary": "OAuth scope (required when --auth-type is OAUTH).",
2452
2222
  "hasDynamicHelp": false,
2453
2223
  "multiple": false,
2454
- "options": [
2455
- "agentforce-studio",
2456
- "testing-center"
2457
- ],
2458
2224
  "type": "option"
2459
2225
  }
2460
2226
  },
2461
2227
  "hasDynamicHelp": true,
2462
2228
  "hiddenAliases": [],
2463
- "id": "agent:test:create",
2229
+ "id": "agent:mcp:update",
2464
2230
  "pluginAlias": "@salesforce/plugin-agent",
2465
2231
  "pluginName": "@salesforce/plugin-agent",
2466
2232
  "pluginType": "core",
2233
+ "state": "preview",
2467
2234
  "strict": true,
2468
- "summary": "Create an agent test in your org using a local test spec YAML file.",
2235
+ "summary": "Update an MCP server registered in the API Catalog.",
2469
2236
  "enableJsonFlag": true,
2470
- "envVariablesSection": {
2471
- "header": "ENVIRONMENT VARIABLES",
2472
- "body": [
2473
- {
2474
- "name": "SF_TARGET_ORG",
2475
- "description": "Username or alias of your default org. Overrides the target-org configuration variable."
2476
- }
2477
- ]
2478
- },
2479
- "errorCodes": {
2480
- "header": "ERROR CODES",
2481
- "body": [
2482
- {
2483
- "name": "Succeeded (0)",
2484
- "description": "Test created and deployed successfully."
2485
- },
2486
- {
2487
- "name": "Failed (1)",
2488
- "description": "Test validation errors or metadata format issues."
2489
- },
2490
- {
2491
- "name": "NotFound (2)",
2492
- "description": "Test spec file not found or org connection failed."
2493
- },
2494
- {
2495
- "name": "DeploymentFailed (4)",
2496
- "description": "Deployment failed due to API or network errors."
2497
- }
2498
- ]
2499
- },
2500
2237
  "isESM": true,
2501
2238
  "relativePath": [
2502
2239
  "lib",
2503
2240
  "commands",
2504
2241
  "agent",
2505
- "test",
2506
- "create.js"
2242
+ "mcp",
2243
+ "update.js"
2507
2244
  ],
2508
2245
  "aliasPermutations": [],
2509
2246
  "permutations": [
2510
- "agent:test:create",
2511
- "test:agent:create",
2512
- "test:create:agent",
2513
- "agent:create:test",
2514
- "create:agent:test",
2515
- "create:test:agent"
2247
+ "agent:mcp:update",
2248
+ "mcp:agent:update",
2249
+ "mcp:update:agent",
2250
+ "agent:update:mcp",
2251
+ "update:agent:mcp",
2252
+ "update:mcp:agent"
2516
2253
  ]
2517
2254
  },
2518
- "agent:test:list": {
2255
+ "agent:generate:agent-spec": {
2519
2256
  "aliases": [],
2520
2257
  "args": {},
2521
- "description": "The command outputs a table with the name (API name) of each test along with its unique ID, type ('agentforce-studio' or 'testing-center'), and the date it was created in the org.",
2258
+ "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.)",
2522
2259
  "examples": [
2523
- "List the agent tests in your default org:\n<%= config.bin %> <%= command.id %>",
2524
- "List the agent tests in an org with alias \"my-org\"\"\n<%= config.bin %> <%= command.id %> --target-org my-org"
2260
+ "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.\"",
2261
+ "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",
2262
+ "Be prompted for all required and optional agent properties; use your default org:\n<%= config.bin %> <%= command.id %> --full-interview",
2263
+ "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\"",
2264
+ "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"
2525
2265
  ],
2526
2266
  "flags": {
2527
2267
  "json": {
@@ -2555,65 +2295,456 @@
2555
2295
  "hasDynamicHelp": false,
2556
2296
  "multiple": false,
2557
2297
  "type": "option"
2558
- }
2559
- },
2560
- "hasDynamicHelp": true,
2561
- "hiddenAliases": [],
2562
- "id": "agent:test:list",
2563
- "pluginAlias": "@salesforce/plugin-agent",
2564
- "pluginName": "@salesforce/plugin-agent",
2565
- "pluginType": "core",
2566
- "strict": true,
2567
- "summary": "List the available agent tests in your org.",
2568
- "enableJsonFlag": true,
2569
- "envVariablesSection": {
2570
- "header": "ENVIRONMENT VARIABLES",
2571
- "body": [
2572
- {
2573
- "name": "SF_TARGET_ORG",
2574
- "description": "Username or alias of your default org. Overrides the target-org configuration variable."
2575
- }
2576
- ]
2298
+ },
2299
+ "type": {
2300
+ "name": "type",
2301
+ "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.",
2302
+ "hasDynamicHelp": false,
2303
+ "multiple": false,
2304
+ "options": [
2305
+ "customer",
2306
+ "internal"
2307
+ ],
2308
+ "type": "option"
2309
+ },
2310
+ "role": {
2311
+ "name": "role",
2312
+ "summary": "Role of the agent.",
2313
+ "hasDynamicHelp": false,
2314
+ "multiple": false,
2315
+ "type": "option"
2316
+ },
2317
+ "company-name": {
2318
+ "name": "company-name",
2319
+ "summary": "Name of your company.",
2320
+ "hasDynamicHelp": false,
2321
+ "multiple": false,
2322
+ "type": "option"
2323
+ },
2324
+ "company-description": {
2325
+ "name": "company-description",
2326
+ "summary": "Description of your company.",
2327
+ "hasDynamicHelp": false,
2328
+ "multiple": false,
2329
+ "type": "option"
2330
+ },
2331
+ "company-website": {
2332
+ "name": "company-website",
2333
+ "summary": "Website URL of your company.",
2334
+ "hasDynamicHelp": false,
2335
+ "multiple": false,
2336
+ "type": "option"
2337
+ },
2338
+ "max-topics": {
2339
+ "name": "max-topics",
2340
+ "summary": "Maximum number of topics to generate in the agent spec; default is 5.",
2341
+ "hasDynamicHelp": false,
2342
+ "multiple": false,
2343
+ "type": "option"
2344
+ },
2345
+ "agent-user": {
2346
+ "name": "agent-user",
2347
+ "summary": "Username of a user in your org to assign to your agent; determines what your agent can access and do.",
2348
+ "hasDynamicHelp": false,
2349
+ "multiple": false,
2350
+ "type": "option"
2351
+ },
2352
+ "enrich-logs": {
2353
+ "name": "enrich-logs",
2354
+ "summary": "Adds agent conversation data to event logs so you can view all agent session activity in one place.",
2355
+ "hasDynamicHelp": false,
2356
+ "multiple": false,
2357
+ "options": [
2358
+ "true",
2359
+ "false"
2360
+ ],
2361
+ "type": "option"
2362
+ },
2363
+ "tone": {
2364
+ "name": "tone",
2365
+ "summary": "Conversational style of the agent, such as how it expresses your brand personality in its messages through word choice, punctuation, and sentence structure.",
2366
+ "hasDynamicHelp": false,
2367
+ "multiple": false,
2368
+ "options": [
2369
+ "formal",
2370
+ "casual",
2371
+ "neutral"
2372
+ ],
2373
+ "type": "option"
2374
+ },
2375
+ "spec": {
2376
+ "name": "spec",
2377
+ "summary": "Agent spec file, in YAML format, to use as input to the command.",
2378
+ "hasDynamicHelp": false,
2379
+ "multiple": false,
2380
+ "type": "option"
2381
+ },
2382
+ "output-file": {
2383
+ "name": "output-file",
2384
+ "summary": "Path for the generated YAML agent spec file; can be an absolute or relative path.",
2385
+ "default": "specs/agentSpec.yaml",
2386
+ "hasDynamicHelp": false,
2387
+ "multiple": false,
2388
+ "type": "option"
2389
+ },
2390
+ "full-interview": {
2391
+ "name": "full-interview",
2392
+ "summary": "Prompt for both required and optional flags.",
2393
+ "allowNo": false,
2394
+ "type": "boolean"
2395
+ },
2396
+ "prompt-template": {
2397
+ "name": "prompt-template",
2398
+ "summary": "API name of a customized prompt template to use instead of the default prompt template.",
2399
+ "hasDynamicHelp": false,
2400
+ "multiple": false,
2401
+ "type": "option"
2402
+ },
2403
+ "grounding-context": {
2404
+ "dependsOn": [
2405
+ "prompt-template"
2406
+ ],
2407
+ "name": "grounding-context",
2408
+ "summary": "Context information and personalization that's added to your prompts when using a custom prompt template.",
2409
+ "hasDynamicHelp": false,
2410
+ "multiple": false,
2411
+ "type": "option"
2412
+ },
2413
+ "force-overwrite": {
2414
+ "name": "force-overwrite",
2415
+ "summary": "Don't prompt the user to confirm that an existing spec file will be overwritten.",
2416
+ "allowNo": false,
2417
+ "type": "boolean"
2418
+ }
2577
2419
  },
2578
- "errorCodes": {
2579
- "header": "ERROR CODES",
2580
- "body": [
2581
- {
2582
- "name": "Succeeded (0)",
2583
- "description": "Agent tests listed successfully."
2584
- },
2585
- {
2586
- "name": "Failed (4)",
2587
- "description": "Failed to retrieve agent tests due to API or network errors."
2588
- }
2589
- ]
2420
+ "hasDynamicHelp": true,
2421
+ "hiddenAliases": [],
2422
+ "id": "agent:generate:agent-spec",
2423
+ "pluginAlias": "@salesforce/plugin-agent",
2424
+ "pluginName": "@salesforce/plugin-agent",
2425
+ "pluginType": "core",
2426
+ "strict": true,
2427
+ "summary": "Generate an agent spec, which is a YAML file that captures what an agent can do.",
2428
+ "enableJsonFlag": true,
2429
+ "requiresProject": true,
2430
+ "isESM": true,
2431
+ "relativePath": [
2432
+ "lib",
2433
+ "commands",
2434
+ "agent",
2435
+ "generate",
2436
+ "agent-spec.js"
2437
+ ],
2438
+ "aliasPermutations": [],
2439
+ "permutations": [
2440
+ "agent:generate:agent-spec",
2441
+ "generate:agent:agent-spec",
2442
+ "generate:agent-spec:agent",
2443
+ "agent:agent-spec:generate",
2444
+ "agent-spec:agent:generate",
2445
+ "agent-spec:generate:agent"
2446
+ ]
2447
+ },
2448
+ "agent:generate:authoring-bundle": {
2449
+ "aliases": [],
2450
+ "args": {},
2451
+ "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. The resulting Agent Script file is customized to reflect what's in the agent spec file. You can also create an authoring bundle without an agent spec file by specifying the \"--no-spec\" flag; in this case, the resulting Agent Script file is just the default boilerplate.\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.",
2452
+ "examples": [
2453
+ "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 %>",
2454
+ "Generate an authoring bundle without using an agent spec file; give the bundle the label \"My Authoring Bundle\" and use your default org:\n<%= config.bin %> <%= command.id %> --no-spec --name \"My Authoring Bundle\"",
2455
+ "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\"",
2456
+ "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"
2457
+ ],
2458
+ "flags": {
2459
+ "json": {
2460
+ "description": "Format output as json.",
2461
+ "helpGroup": "GLOBAL",
2462
+ "name": "json",
2463
+ "allowNo": false,
2464
+ "type": "boolean"
2465
+ },
2466
+ "flags-dir": {
2467
+ "helpGroup": "GLOBAL",
2468
+ "name": "flags-dir",
2469
+ "summary": "Import flag values from a directory.",
2470
+ "hasDynamicHelp": false,
2471
+ "multiple": false,
2472
+ "type": "option"
2473
+ },
2474
+ "target-org": {
2475
+ "char": "o",
2476
+ "name": "target-org",
2477
+ "noCacheDefault": true,
2478
+ "required": true,
2479
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
2480
+ "hasDynamicHelp": true,
2481
+ "multiple": false,
2482
+ "type": "option"
2483
+ },
2484
+ "api-name": {
2485
+ "name": "api-name",
2486
+ "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.",
2487
+ "hasDynamicHelp": false,
2488
+ "multiple": false,
2489
+ "type": "option"
2490
+ },
2491
+ "api-version": {
2492
+ "description": "Override the api version used for api requests made by this command",
2493
+ "name": "api-version",
2494
+ "hasDynamicHelp": false,
2495
+ "multiple": false,
2496
+ "type": "option"
2497
+ },
2498
+ "spec": {
2499
+ "char": "f",
2500
+ "name": "spec",
2501
+ "summary": "Path to the agent spec YAML file. If you don't specify the flag, the command provides a list that you can choose from. Use the --no-spec flag to skip using an agent spec entirely.",
2502
+ "hasDynamicHelp": false,
2503
+ "multiple": false,
2504
+ "type": "option"
2505
+ },
2506
+ "no-spec": {
2507
+ "name": "no-spec",
2508
+ "summary": "Skip prompting for an agent spec and use the default Agent Script boilerplate in the generated authoring bundle.",
2509
+ "allowNo": false,
2510
+ "type": "boolean"
2511
+ },
2512
+ "output-dir": {
2513
+ "char": "d",
2514
+ "name": "output-dir",
2515
+ "summary": "Directory where the authoring bundle files are generated.",
2516
+ "hasDynamicHelp": false,
2517
+ "multiple": false,
2518
+ "type": "option"
2519
+ },
2520
+ "name": {
2521
+ "char": "n",
2522
+ "name": "name",
2523
+ "summary": "Name (label) of the authoring bundle; if not specified, you're prompted for the name.",
2524
+ "hasDynamicHelp": false,
2525
+ "multiple": false,
2526
+ "type": "option"
2527
+ },
2528
+ "force-overwrite": {
2529
+ "name": "force-overwrite",
2530
+ "summary": "Overwrite the existing authoring bundle if one with the same API name already exists locally.",
2531
+ "allowNo": false,
2532
+ "type": "boolean"
2533
+ }
2534
+ },
2535
+ "hasDynamicHelp": true,
2536
+ "hiddenAliases": [],
2537
+ "id": "agent:generate:authoring-bundle",
2538
+ "pluginAlias": "@salesforce/plugin-agent",
2539
+ "pluginName": "@salesforce/plugin-agent",
2540
+ "pluginType": "core",
2541
+ "strict": true,
2542
+ "summary": "Generate an authoring bundle from an existing agent spec YAML file.",
2543
+ "enableJsonFlag": true,
2544
+ "requiresProject": true,
2545
+ "isESM": true,
2546
+ "relativePath": [
2547
+ "lib",
2548
+ "commands",
2549
+ "agent",
2550
+ "generate",
2551
+ "authoring-bundle.js"
2552
+ ],
2553
+ "aliasPermutations": [],
2554
+ "permutations": [
2555
+ "agent:generate:authoring-bundle",
2556
+ "generate:agent:authoring-bundle",
2557
+ "generate:authoring-bundle:agent",
2558
+ "agent:authoring-bundle:generate",
2559
+ "authoring-bundle:agent:generate",
2560
+ "authoring-bundle:generate:agent"
2561
+ ]
2562
+ },
2563
+ "agent:generate:template": {
2564
+ "aliases": [],
2565
+ "args": {},
2566
+ "description": "WARNING: This command doesn't work for agents that were created from an Agent Script file. In other words, you can't currently package an agent template for agents that use Agent Script.\n\nAt a high-level, agents are defined by the Bot, BotVersion, and GenAiPlannerBundle metadata types. The GenAiPlannerBundle type in turn defines the agent's topics and actions. This command uses the metadata files for these three types, located in your local DX project, to generate a BotTemplate metadata file for a specific agent (Bot). You then use the BotTemplate metadata file, along with the GenAiPlannerBundle metadata file that references the BotTemplate, to package the template in a managed package that you can share between orgs or on AppExchange.\n\nUse the --agent-file flag to specify the relative or full pathname of the Bot metadata file, such as force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml. A single Bot can have multiple BotVersions, so use the --agent-version flag to specify the version. The corresponding BotVersion metadata file must exist locally. For example, if you specify \"--agent-version 4\", then the file force-app/main/default/bots/My_Awesome_Agent/v4.botVersion-meta.xml must exist.\n\nThe new BotTemplate metadata file is generated in the \"botTemplates\" directory in the output directory specified with the --output-dir flag, and has the name <Agent_API_name>\\_v<Version>\\_Template.botTemplate-meta.xml, such as my-package/botTemplates/My_Awesome_Agent_v4_Template.botTemplate-meta.xml. The command displays the full pathname of the generated files when it completes.\n\nSee \"Develop and Package Agent Templates Using Scratch Orgs\" (https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/dev2gp_package_agent_templates.htm) for details about the complete process, which includes using a scratch org to create and test the agent, retrieving the agent metadata to your DX project, running this command to create the agent template, and then packaging the template.",
2567
+ "examples": [
2568
+ "Generate an agent template from the My_Awesome_Agent Bot metadata file in your DX project and save the BotTemplate and GenAiPlannerBundle to the specified directory; use version 1 of the agent. The agent that the template is based on is in the org with alias \"my-scratch-org\":\n<%= config.bin %> <%= command.id %> --agent-file force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1 --output-dir my-package --source-org my-scratch-org"
2569
+ ],
2570
+ "flags": {
2571
+ "json": {
2572
+ "description": "Format output as json.",
2573
+ "helpGroup": "GLOBAL",
2574
+ "name": "json",
2575
+ "allowNo": false,
2576
+ "type": "boolean"
2577
+ },
2578
+ "flags-dir": {
2579
+ "helpGroup": "GLOBAL",
2580
+ "name": "flags-dir",
2581
+ "summary": "Import flag values from a directory.",
2582
+ "hasDynamicHelp": false,
2583
+ "multiple": false,
2584
+ "type": "option"
2585
+ },
2586
+ "api-version": {
2587
+ "description": "Override the api version used for api requests made by this command",
2588
+ "name": "api-version",
2589
+ "hasDynamicHelp": false,
2590
+ "multiple": false,
2591
+ "type": "option"
2592
+ },
2593
+ "source-org": {
2594
+ "char": "s",
2595
+ "name": "source-org",
2596
+ "noCacheDefault": true,
2597
+ "required": true,
2598
+ "summary": "Username or alias of the namespaced scratch org that contains the agent which this template is based on.",
2599
+ "hasDynamicHelp": true,
2600
+ "multiple": false,
2601
+ "type": "option"
2602
+ },
2603
+ "agent-version": {
2604
+ "name": "agent-version",
2605
+ "required": true,
2606
+ "summary": "Version of the agent (BotVersion).",
2607
+ "hasDynamicHelp": false,
2608
+ "multiple": false,
2609
+ "type": "option"
2610
+ },
2611
+ "agent-file": {
2612
+ "char": "f",
2613
+ "name": "agent-file",
2614
+ "required": true,
2615
+ "summary": "Path to an agent (Bot) metadata file.",
2616
+ "hasDynamicHelp": false,
2617
+ "multiple": false,
2618
+ "type": "option"
2619
+ },
2620
+ "output-dir": {
2621
+ "char": "r",
2622
+ "name": "output-dir",
2623
+ "summary": "Directory where the generated BotTemplate and GenAiPlannerBundle files are saved.",
2624
+ "hasDynamicHelp": false,
2625
+ "multiple": false,
2626
+ "type": "option"
2627
+ }
2628
+ },
2629
+ "hasDynamicHelp": true,
2630
+ "hiddenAliases": [],
2631
+ "id": "agent:generate:template",
2632
+ "pluginAlias": "@salesforce/plugin-agent",
2633
+ "pluginName": "@salesforce/plugin-agent",
2634
+ "pluginType": "core",
2635
+ "strict": true,
2636
+ "summary": "Generate an agent template from an existing agent in your DX project so you can then package the template in a second-generation managed package.",
2637
+ "enableJsonFlag": true,
2638
+ "requiresProject": true,
2639
+ "isESM": true,
2640
+ "relativePath": [
2641
+ "lib",
2642
+ "commands",
2643
+ "agent",
2644
+ "generate",
2645
+ "template.js"
2646
+ ],
2647
+ "aliasPermutations": [],
2648
+ "permutations": [
2649
+ "agent:generate:template",
2650
+ "generate:agent:template",
2651
+ "generate:template:agent",
2652
+ "agent:template:generate",
2653
+ "template:agent:generate",
2654
+ "template:generate:agent"
2655
+ ]
2656
+ },
2657
+ "agent:generate:test-spec": {
2658
+ "aliases": [],
2659
+ "args": {},
2660
+ "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\nYou can manually add contextVariables to test cases in the generated YAML file to inject contextual data (such as CaseId or RoutableId) into agent sessions. This is useful for testing agent behavior with different contextual information.\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` (legacy testing-center) or `AiTestingDefinition` (Agentforce Studio / NGT), selected via --test-runner.\n\nIf you have an existing AiEvaluationDefinition or AiTestingDefinition metadata XML file in your DX project, you can generate its equivalent YAML test spec file with the --from-definition flag. The runner is inferred from the file extension; pass --test-runner to override.",
2661
+ "examples": [
2662
+ "Generate an agent test spec YAML file interactively:\n<%= config.bin %> <%= command.id %>",
2663
+ "Generate an Agentforce Studio (NGT) test spec YAML file interactively:\n<%= config.bin %> <%= command.id %> --test-runner agentforce-studio",
2664
+ "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",
2665
+ "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",
2666
+ "Generate an Agentforce Studio (NGT) test spec YAML file from an existing AiTestingDefinition metadata XML file:\n<%= config.bin %> <%= command.id %> --from-definition force-app/main/default/aiTestingDefinitions/Returns_Checkout_Tests.aiTestingDefinition-meta.xml"
2667
+ ],
2668
+ "flags": {
2669
+ "flags-dir": {
2670
+ "helpGroup": "GLOBAL",
2671
+ "name": "flags-dir",
2672
+ "summary": "Import flag values from a directory.",
2673
+ "hasDynamicHelp": false,
2674
+ "multiple": false,
2675
+ "type": "option"
2676
+ },
2677
+ "from-definition": {
2678
+ "char": "d",
2679
+ "name": "from-definition",
2680
+ "summary": "Filepath to an AiEvaluationDefinition or AiTestingDefinition metadata XML file in your DX project that you want to convert to a test spec YAML file.",
2681
+ "hasDynamicHelp": false,
2682
+ "multiple": false,
2683
+ "type": "option"
2684
+ },
2685
+ "force-overwrite": {
2686
+ "name": "force-overwrite",
2687
+ "summary": "Don't prompt for confirmation when overwriting an existing test spec YAML file.",
2688
+ "allowNo": false,
2689
+ "type": "boolean"
2690
+ },
2691
+ "output-file": {
2692
+ "char": "f",
2693
+ "name": "output-file",
2694
+ "summary": "Name of the generated test spec YAML file. Default value is \"specs/<AGENT_API_NAME>-testSpec.yaml\" (legacy) or \"specs/<AGENT_API_NAME>-ngtTestSpec.yaml\" (Agentforce Studio).",
2695
+ "hasDynamicHelp": false,
2696
+ "multiple": false,
2697
+ "type": "option"
2698
+ },
2699
+ "test-runner": {
2700
+ "description": "By default, the command automatically detects which test runner to use based on the test definition metadata type in your org. Use this flag to explicitly specify the runner type. 'agentforce-studio' uses AiTestingDefinition metadata. 'testing-center' uses AiEvaluationDefinition metadata.",
2701
+ "name": "test-runner",
2702
+ "summary": "Explicitly specify which test runner to use (agentforce-studio or testing-center).",
2703
+ "hasDynamicHelp": false,
2704
+ "multiple": false,
2705
+ "options": [
2706
+ "agentforce-studio",
2707
+ "testing-center"
2708
+ ],
2709
+ "type": "option"
2710
+ }
2590
2711
  },
2712
+ "hasDynamicHelp": false,
2713
+ "hiddenAliases": [],
2714
+ "id": "agent:generate:test-spec",
2715
+ "pluginAlias": "@salesforce/plugin-agent",
2716
+ "pluginName": "@salesforce/plugin-agent",
2717
+ "pluginType": "core",
2718
+ "strict": true,
2719
+ "summary": "Generate an agent test spec, which is a YAML file that lists the test cases for testing a specific agent.",
2720
+ "enableJsonFlag": false,
2591
2721
  "isESM": true,
2592
2722
  "relativePath": [
2593
2723
  "lib",
2594
2724
  "commands",
2595
2725
  "agent",
2596
- "test",
2597
- "list.js"
2726
+ "generate",
2727
+ "test-spec.js"
2598
2728
  ],
2599
2729
  "aliasPermutations": [],
2600
2730
  "permutations": [
2601
- "agent:test:list",
2602
- "test:agent:list",
2603
- "test:list:agent",
2604
- "agent:list:test",
2605
- "list:agent:test",
2606
- "list:test:agent"
2731
+ "agent:generate:test-spec",
2732
+ "generate:agent:test-spec",
2733
+ "generate:test-spec:agent",
2734
+ "agent:test-spec:generate",
2735
+ "test-spec:agent:generate",
2736
+ "test-spec:generate:agent"
2607
2737
  ]
2608
2738
  },
2609
- "agent:test:results": {
2739
+ "agent:publish:authoring-bundle": {
2610
2740
  "aliases": [],
2611
2741
  "args": {},
2612
- "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.",
2742
+ "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.",
2613
2743
  "examples": [
2614
- "Get the results of an agent test run in your default org using its job ID:\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ",
2615
- "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",
2616
- "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"
2744
+ "Publish an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
2745
+ "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",
2746
+ "Publish with verbose output to see all retrieved and deployed metadata components:\n<%= config.bin %> <%= command.id %> --api-name MyAuthoringbundle --verbose",
2747
+ "Publish with concise output showing only essential information:\n<%= config.bin %> <%= command.id %> --api-name MyAuthoringbundle --concise"
2617
2748
  ],
2618
2749
  "flags": {
2619
2750
  "json": {
@@ -2648,119 +2779,96 @@
2648
2779
  "multiple": false,
2649
2780
  "type": "option"
2650
2781
  },
2651
- "job-id": {
2652
- "char": "i",
2653
- "name": "job-id",
2654
- "required": true,
2655
- "summary": "Job ID of the completed agent test run.",
2656
- "hasDynamicHelp": false,
2657
- "multiple": false,
2658
- "type": "option"
2659
- },
2660
- "result-format": {
2661
- "name": "result-format",
2662
- "summary": "Format of the agent test run results.",
2663
- "default": "human",
2664
- "hasDynamicHelp": false,
2665
- "multiple": false,
2666
- "options": [
2667
- "json",
2668
- "human",
2669
- "junit",
2670
- "tap"
2671
- ],
2672
- "type": "option"
2673
- },
2674
- "output-dir": {
2675
- "char": "d",
2676
- "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.",
2677
- "name": "output-dir",
2678
- "summary": "Directory to write the agent test results into.",
2782
+ "api-name": {
2783
+ "char": "n",
2784
+ "name": "api-name",
2785
+ "summary": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
2679
2786
  "hasDynamicHelp": false,
2680
2787
  "multiple": false,
2681
2788
  "type": "option"
2682
2789
  },
2683
- "test-runner": {
2684
- "description": "By default, the command automatically detects which test runner to use based on the test definition metadata type in your org. Use this flag to explicitly specify the runner type. 'agentforce-studio' uses AiTestingDefinition metadata. 'testing-center' uses AiEvaluationDefinition metadata.",
2685
- "name": "test-runner",
2686
- "summary": "Explicitly specify which test runner to use (agentforce-studio or testing-center).",
2687
- "hasDynamicHelp": false,
2688
- "multiple": false,
2689
- "options": [
2690
- "agentforce-studio",
2691
- "testing-center"
2692
- ],
2693
- "type": "option"
2790
+ "skip-retrieve": {
2791
+ "name": "skip-retrieve",
2792
+ "summary": "Don't retrieve the metadata associated with the agent to your DX project.",
2793
+ "allowNo": false,
2794
+ "type": "boolean"
2694
2795
  },
2695
2796
  "verbose": {
2696
- "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.",
2797
+ "char": "v",
2798
+ "exclusive": [
2799
+ "concise"
2800
+ ],
2697
2801
  "name": "verbose",
2698
- "summary": "Show generated data in the test results output.",
2802
+ "summary": "Display detailed output showing all metadata components retrieved and deployed during the publish process.",
2803
+ "allowNo": false,
2804
+ "type": "boolean"
2805
+ },
2806
+ "concise": {
2807
+ "exclusive": [
2808
+ "verbose"
2809
+ ],
2810
+ "name": "concise",
2811
+ "summary": "Display minimal output with only essential information about the publish operation.",
2699
2812
  "allowNo": false,
2700
2813
  "type": "boolean"
2701
2814
  }
2702
2815
  },
2703
2816
  "hasDynamicHelp": true,
2704
2817
  "hiddenAliases": [],
2705
- "id": "agent:test:results",
2818
+ "id": "agent:publish:authoring-bundle",
2706
2819
  "pluginAlias": "@salesforce/plugin-agent",
2707
2820
  "pluginName": "@salesforce/plugin-agent",
2708
2821
  "pluginType": "core",
2709
2822
  "strict": true,
2710
- "summary": "Get the results of a completed agent test run.",
2823
+ "summary": "Publish an authoring bundle to your org, which results in a new agent or a new version of an existing agent.",
2711
2824
  "enableJsonFlag": true,
2712
- "envVariablesSection": {
2713
- "header": "ENVIRONMENT VARIABLES",
2714
- "body": [
2715
- {
2716
- "name": "SF_TARGET_ORG",
2717
- "description": "Username or alias of your default org. Overrides the target-org configuration variable."
2718
- }
2719
- ]
2720
- },
2825
+ "requiresProject": true,
2721
2826
  "errorCodes": {
2722
2827
  "header": "ERROR CODES",
2723
2828
  "body": [
2724
2829
  {
2725
2830
  "name": "Succeeded (0)",
2726
- "description": "Results retrieved successfully. Test results (passed/failed) are in the output."
2727
- },
2728
- {
2729
- "name": "NotFound (2)",
2730
- "description": "Job ID not found or invalid."
2831
+ "description": "Agent published successfully without errors."
2731
2832
  },
2732
2833
  {
2733
- "name": "Failed (4)",
2734
- "description": "Failed to retrieve results due to API or network errors."
2834
+ "name": "Failed (1)",
2835
+ "description": "Compilation errors found in the Agent Script file."
2735
2836
  }
2736
2837
  ]
2737
2838
  },
2839
+ "FLAGGABLE_PROMPTS": {
2840
+ "api-name": {
2841
+ "message": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
2842
+ "promptMessage": "API name of the authoring bundle to publish"
2843
+ }
2844
+ },
2738
2845
  "isESM": true,
2739
2846
  "relativePath": [
2740
2847
  "lib",
2741
2848
  "commands",
2742
2849
  "agent",
2743
- "test",
2744
- "results.js"
2850
+ "publish",
2851
+ "authoring-bundle.js"
2745
2852
  ],
2746
2853
  "aliasPermutations": [],
2747
2854
  "permutations": [
2748
- "agent:test:results",
2749
- "test:agent:results",
2750
- "test:results:agent",
2751
- "agent:results:test",
2752
- "results:agent:test",
2753
- "results:test:agent"
2855
+ "agent:publish:authoring-bundle",
2856
+ "publish:agent:authoring-bundle",
2857
+ "publish:authoring-bundle:agent",
2858
+ "agent:authoring-bundle:publish",
2859
+ "authoring-bundle:agent:publish",
2860
+ "authoring-bundle:publish:agent"
2754
2861
  ]
2755
2862
  },
2756
- "agent:test:resume": {
2863
+ "agent:test:create": {
2757
2864
  "aliases": [],
2758
2865
  "args": {},
2759
- "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.",
2866
+ "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 (legacy) or Agentforce Studio (NGT). This command also retrieves the metadata component associated with the new test to your local Salesforce DX project and displays its filename. By default, the legacy AiEvaluationDefinition is created; use --test-runner agentforce-studio to author an AiTestingDefinition (NGT) instead.\n\nAfter you've created the test in the org, use the \"agent test run\" command to run it.",
2760
2867
  "examples": [
2761
- "Resume an agent test in your default org using a job ID:\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ",
2762
- "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",
2763
- "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"
2868
+ "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 %>",
2869
+ "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",
2870
+ "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",
2871
+ "Author an Agentforce Studio (NGT) test from an NGT-shaped YAML; writes an AiTestingDefinition metadata file:\n<%= config.bin %> <%= command.id %> --spec specs/ReturnsCheckout.ngt.yaml --api-name Returns_Checkout --test-runner agentforce-studio --target-org my-org"
2764
2872
  ],
2765
2873
  "flags": {
2766
2874
  "json": {
@@ -2778,6 +2886,20 @@
2778
2886
  "multiple": false,
2779
2887
  "type": "option"
2780
2888
  },
2889
+ "api-name": {
2890
+ "name": "api-name",
2891
+ "summary": "API name of the new test; the API name must not exist in the org.",
2892
+ "hasDynamicHelp": false,
2893
+ "multiple": false,
2894
+ "type": "option"
2895
+ },
2896
+ "spec": {
2897
+ "name": "spec",
2898
+ "summary": "Path to the test spec YAML file.",
2899
+ "hasDynamicHelp": false,
2900
+ "multiple": false,
2901
+ "type": "option"
2902
+ },
2781
2903
  "target-org": {
2782
2904
  "char": "o",
2783
2905
  "name": "target-org",
@@ -2795,52 +2917,17 @@
2795
2917
  "multiple": false,
2796
2918
  "type": "option"
2797
2919
  },
2798
- "job-id": {
2799
- "char": "i",
2800
- "name": "job-id",
2801
- "summary": "Job ID of the original agent test run.",
2802
- "hasDynamicHelp": false,
2803
- "multiple": false,
2804
- "type": "option"
2805
- },
2806
- "use-most-recent": {
2807
- "char": "r",
2808
- "name": "use-most-recent",
2809
- "summary": "Use the job ID of the most recent agent test run.",
2920
+ "preview": {
2921
+ "name": "preview",
2922
+ "summary": "Preview the test metadata file without deploying to your org.",
2810
2923
  "allowNo": false,
2811
2924
  "type": "boolean"
2812
2925
  },
2813
- "wait": {
2814
- "char": "w",
2815
- "name": "wait",
2816
- "summary": "Number of minutes to wait for the command to complete and display results to the terminal window.",
2817
- "default": "5 minutes",
2818
- "hasDynamicHelp": true,
2819
- "multiple": false,
2820
- "type": "option"
2821
- },
2822
- "result-format": {
2823
- "name": "result-format",
2824
- "summary": "Format of the agent test run results.",
2825
- "default": "human",
2826
- "hasDynamicHelp": false,
2827
- "multiple": false,
2828
- "options": [
2829
- "json",
2830
- "human",
2831
- "junit",
2832
- "tap"
2833
- ],
2834
- "type": "option"
2835
- },
2836
- "output-dir": {
2837
- "char": "d",
2838
- "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.",
2839
- "name": "output-dir",
2840
- "summary": "Directory to write the agent test results into.",
2841
- "hasDynamicHelp": false,
2842
- "multiple": false,
2843
- "type": "option"
2926
+ "force-overwrite": {
2927
+ "name": "force-overwrite",
2928
+ "summary": "Don't prompt for confirmation when overwriting an existing test (based on API name) in your org.",
2929
+ "allowNo": false,
2930
+ "type": "boolean"
2844
2931
  },
2845
2932
  "test-runner": {
2846
2933
  "description": "By default, the command automatically detects which test runner to use based on the test definition metadata type in your org. Use this flag to explicitly specify the runner type. 'agentforce-studio' uses AiTestingDefinition metadata. 'testing-center' uses AiEvaluationDefinition metadata.",
@@ -2853,23 +2940,16 @@
2853
2940
  "testing-center"
2854
2941
  ],
2855
2942
  "type": "option"
2856
- },
2857
- "verbose": {
2858
- "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.",
2859
- "name": "verbose",
2860
- "summary": "Show generated data in the test results output.",
2861
- "allowNo": false,
2862
- "type": "boolean"
2863
2943
  }
2864
2944
  },
2865
2945
  "hasDynamicHelp": true,
2866
2946
  "hiddenAliases": [],
2867
- "id": "agent:test:resume",
2947
+ "id": "agent:test:create",
2868
2948
  "pluginAlias": "@salesforce/plugin-agent",
2869
2949
  "pluginName": "@salesforce/plugin-agent",
2870
2950
  "pluginType": "core",
2871
2951
  "strict": true,
2872
- "summary": "Resume an agent test that you previously started in your org so you can view the test results.",
2952
+ "summary": "Create an agent test in your org using a local test spec YAML file.",
2873
2953
  "enableJsonFlag": true,
2874
2954
  "envVariablesSection": {
2875
2955
  "header": "ENVIRONMENT VARIABLES",
@@ -2885,19 +2965,19 @@
2885
2965
  "body": [
2886
2966
  {
2887
2967
  "name": "Succeeded (0)",
2888
- "description": "Test completed successfully (with test results in the output)."
2968
+ "description": "Test created and deployed successfully."
2889
2969
  },
2890
2970
  {
2891
2971
  "name": "Failed (1)",
2892
- "description": "Tests encountered execution errors (test cases with ERROR status)."
2972
+ "description": "Test validation errors or metadata format issues."
2893
2973
  },
2894
2974
  {
2895
2975
  "name": "NotFound (2)",
2896
- "description": "Job ID not found or invalid."
2976
+ "description": "Test spec file not found or org connection failed."
2897
2977
  },
2898
2978
  {
2899
- "name": "OperationFailed (4)",
2900
- "description": "Failed to poll test due to API or network errors."
2979
+ "name": "DeploymentFailed (4)",
2980
+ "description": "Deployment failed due to API or network errors."
2901
2981
  }
2902
2982
  ]
2903
2983
  },
@@ -2907,29 +2987,25 @@
2907
2987
  "commands",
2908
2988
  "agent",
2909
2989
  "test",
2910
- "resume.js"
2990
+ "create.js"
2911
2991
  ],
2912
2992
  "aliasPermutations": [],
2913
2993
  "permutations": [
2914
- "agent:test:resume",
2915
- "test:agent:resume",
2916
- "test:resume:agent",
2917
- "agent:resume:test",
2918
- "resume:agent:test",
2919
- "resume:test:agent"
2994
+ "agent:test:create",
2995
+ "test:agent:create",
2996
+ "test:create:agent",
2997
+ "agent:create:test",
2998
+ "create:agent:test",
2999
+ "create:test:agent"
2920
3000
  ]
2921
3001
  },
2922
- "agent:test:run-eval": {
3002
+ "agent:test:list": {
2923
3003
  "aliases": [],
2924
3004
  "args": {},
2925
- "description": "Specify the tests you want to run with one of these inputs to the --spec flag:\n\n- YAML test spec generated by the `agent generate test-spec` CLI command\n- JSON payload\n\nWhen you provide a YAML test spec, this command automatically translates test cases into internal state-based evaluation framework calls and infers the agent name from the test spec's `subjectName` field. As a result, you can use the same test spec with both the `agent test run` and `agent test run-eval` commands. YAML test specs also support context variables, which allow you to inject contextual data (such as CaseId or RoutableId) into agent sessions for testing with different contexts.\n\nWhen you provide a JSON payload, it's sent directly to the evaluation framework with optional normalization. The normalizer auto-corrects common field name mistakes, converts shorthand references to JSONPath, and injects defaults. Use `--no-normalize` to disable this auto-normalization. JSON payloads can also include context_variables on agent.create_session steps for the same contextual testing capabilities as when you use a YAML test spec.\n\nThis command supports more than 8 evaluator types, including subagent routing assertions, action invocation checks, string/numeric assertions, semantic similarity scoring, and LLM-based quality ratings.",
3005
+ "description": "The command outputs a table with the name (API name) of each test along with its unique ID, type ('agentforce-studio' or 'testing-center'), and the date it was created in the org.",
2926
3006
  "examples": [
2927
- "Run tests using a YAML test spec on the org with alias \"my-org\":\n<%= config.bin %> <%= command.id %> --spec specs/my-agent-testSpec.yaml --target-org my-org",
2928
- "Run tests using a YAML spec with explicit agent name override; use your default org:\n<%= config.bin %> <%= command.id %> --spec specs/my-agent-testSpec.yaml --api-name My_Agent",
2929
- "Run tests using a JSON payload:\n<%= config.bin %> <%= command.id %> --spec specs/eval-payload.json --target-org my-org",
2930
- "Run tests and output results in JUnit format; useful for continuous integration and deployment (CI/CD):\n<%= config.bin %> <%= command.id %> --spec specs/my-agent-testSpec.yaml --target-org my-org --result-format junit",
2931
- "Run tests with contextVariables to inject contextual data into agent sessions (add contextVariables to test cases in your YAML spec):\n<%= config.bin %> <%= command.id %> --spec specs/agent-with-context.yaml --target-org my-org",
2932
- "Pipe JSON payload from stdin (--spec flag is automatically populated from stdin):\n$ echo '{\"tests\":[...]}' | <%= config.bin %> <%= command.id %> --spec --target-org my-org"
3007
+ "List the agent tests in your default org:\n<%= config.bin %> <%= command.id %>",
3008
+ "List the agent tests in an org with alias \"my-org\"\"\n<%= config.bin %> <%= command.id %> --target-org my-org"
2933
3009
  ],
2934
3010
  "flags": {
2935
3011
  "json": {
@@ -2963,62 +3039,16 @@
2963
3039
  "hasDynamicHelp": false,
2964
3040
  "multiple": false,
2965
3041
  "type": "option"
2966
- },
2967
- "spec": {
2968
- "char": "s",
2969
- "name": "spec",
2970
- "required": true,
2971
- "summary": "Path to test spec file (YAML or JSON). Supports reading from stdin when piping content.",
2972
- "hasDynamicHelp": false,
2973
- "multiple": false,
2974
- "type": "option"
2975
- },
2976
- "api-name": {
2977
- "char": "n",
2978
- "name": "api-name",
2979
- "summary": "Agent API name (also called DeveloperName) used to resolve agent_id and agent_version_id. Auto-inferred from the YAML spec's subjectName.",
2980
- "hasDynamicHelp": false,
2981
- "multiple": false,
2982
- "type": "option"
2983
- },
2984
- "result-format": {
2985
- "name": "result-format",
2986
- "summary": "Format of the agent test run results.",
2987
- "default": "human",
2988
- "hasDynamicHelp": false,
2989
- "multiple": false,
2990
- "options": [
2991
- "json",
2992
- "human",
2993
- "junit",
2994
- "tap"
2995
- ],
2996
- "type": "option"
2997
- },
2998
- "batch-size": {
2999
- "name": "batch-size",
3000
- "summary": "Number of tests per API request (max 5).",
3001
- "default": 5,
3002
- "hasDynamicHelp": false,
3003
- "multiple": false,
3004
- "type": "option"
3005
- },
3006
- "no-normalize": {
3007
- "name": "no-normalize",
3008
- "summary": "Disable auto-normalization of field names and shorthand references.",
3009
- "allowNo": false,
3010
- "type": "boolean"
3011
3042
  }
3012
3043
  },
3013
3044
  "hasDynamicHelp": true,
3014
3045
  "hiddenAliases": [],
3015
- "id": "agent:test:run-eval",
3046
+ "id": "agent:test:list",
3016
3047
  "pluginAlias": "@salesforce/plugin-agent",
3017
3048
  "pluginName": "@salesforce/plugin-agent",
3018
3049
  "pluginType": "core",
3019
- "state": "beta",
3020
3050
  "strict": true,
3021
- "summary": "Run rich evaluation tests against an Agentforce agent.",
3051
+ "summary": "List the available agent tests in your org.",
3022
3052
  "enableJsonFlag": true,
3023
3053
  "envVariablesSection": {
3024
3054
  "header": "ENVIRONMENT VARIABLES",
@@ -3034,19 +3064,11 @@
3034
3064
  "body": [
3035
3065
  {
3036
3066
  "name": "Succeeded (0)",
3037
- "description": "Tests completed successfully. Test results (passed/failed) are in the JSON output."
3038
- },
3039
- {
3040
- "name": "Failed (1)",
3041
- "description": "Tests encountered execution errors (tests couldn't run properly)."
3042
- },
3043
- {
3044
- "name": "NotFound (2)",
3045
- "description": "Agent not found, spec file not found, or invalid agent name."
3067
+ "description": "Agent tests listed successfully."
3046
3068
  },
3047
3069
  {
3048
- "name": "OperationFailed (4)",
3049
- "description": "Failed to execute tests due to API or network errors."
3070
+ "name": "Failed (4)",
3071
+ "description": "Failed to retrieve agent tests due to API or network errors."
3050
3072
  }
3051
3073
  ]
3052
3074
  },
@@ -3056,26 +3078,26 @@
3056
3078
  "commands",
3057
3079
  "agent",
3058
3080
  "test",
3059
- "run-eval.js"
3081
+ "list.js"
3060
3082
  ],
3061
3083
  "aliasPermutations": [],
3062
3084
  "permutations": [
3063
- "agent:test:run-eval",
3064
- "test:agent:run-eval",
3065
- "test:run-eval:agent",
3066
- "agent:run-eval:test",
3067
- "run-eval:agent:test",
3068
- "run-eval:test:agent"
3085
+ "agent:test:list",
3086
+ "test:agent:list",
3087
+ "test:list:agent",
3088
+ "agent:list:test",
3089
+ "list:agent:test",
3090
+ "list:test:agent"
3069
3091
  ]
3070
3092
  },
3071
- "agent:test:run": {
3093
+ "agent:test:results": {
3072
3094
  "aliases": [],
3073
3095
  "args": {},
3074
- "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.",
3096
+ "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.",
3075
3097
  "examples": [
3076
- "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",
3077
- "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",
3078
- "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"
3098
+ "Get the results of an agent test run in your default org using its job ID:\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ",
3099
+ "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",
3100
+ "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"
3079
3101
  ],
3080
3102
  "flags": {
3081
3103
  "json": {
@@ -3110,22 +3132,15 @@
3110
3132
  "multiple": false,
3111
3133
  "type": "option"
3112
3134
  },
3113
- "api-name": {
3114
- "char": "n",
3115
- "name": "api-name",
3116
- "summary": "API name of the agent test to run; corresponds to the name of the AiEvaluationDefinition metadata component that implements the agent test.",
3135
+ "job-id": {
3136
+ "char": "i",
3137
+ "name": "job-id",
3138
+ "required": true,
3139
+ "summary": "Job ID of the completed agent test run.",
3117
3140
  "hasDynamicHelp": false,
3118
3141
  "multiple": false,
3119
3142
  "type": "option"
3120
3143
  },
3121
- "wait": {
3122
- "char": "w",
3123
- "name": "wait",
3124
- "summary": "Number of minutes to wait for the command to complete and display results to the terminal window.",
3125
- "hasDynamicHelp": true,
3126
- "multiple": false,
3127
- "type": "option"
3128
- },
3129
3144
  "result-format": {
3130
3145
  "name": "result-format",
3131
3146
  "summary": "Format of the agent test run results.",
@@ -3171,12 +3186,12 @@
3171
3186
  },
3172
3187
  "hasDynamicHelp": true,
3173
3188
  "hiddenAliases": [],
3174
- "id": "agent:test:run",
3189
+ "id": "agent:test:results",
3175
3190
  "pluginAlias": "@salesforce/plugin-agent",
3176
3191
  "pluginName": "@salesforce/plugin-agent",
3177
3192
  "pluginType": "core",
3178
3193
  "strict": true,
3179
- "summary": "Start an agent test in your org.",
3194
+ "summary": "Get the results of a completed agent test run.",
3180
3195
  "enableJsonFlag": true,
3181
3196
  "envVariablesSection": {
3182
3197
  "header": "ENVIRONMENT VARIABLES",
@@ -3192,19 +3207,15 @@
3192
3207
  "body": [
3193
3208
  {
3194
3209
  "name": "Succeeded (0)",
3195
- "description": "Test started successfully (without --wait), or test completed successfully (with --wait)."
3196
- },
3197
- {
3198
- "name": "Failed (1)",
3199
- "description": "Tests encountered execution errors (test cases with ERROR status when using --wait)."
3210
+ "description": "Results retrieved successfully. Test results (passed/failed) are in the output."
3200
3211
  },
3201
3212
  {
3202
3213
  "name": "NotFound (2)",
3203
- "description": "Test definition not found or invalid test name."
3214
+ "description": "Job ID not found or invalid."
3204
3215
  },
3205
3216
  {
3206
- "name": "OperationFailed (4)",
3207
- "description": "Failed to start or poll test due to API or network errors."
3217
+ "name": "Failed (4)",
3218
+ "description": "Failed to retrieve results due to API or network errors."
3208
3219
  }
3209
3220
  ]
3210
3221
  },
@@ -3214,124 +3225,26 @@
3214
3225
  "commands",
3215
3226
  "agent",
3216
3227
  "test",
3217
- "run.js"
3218
- ],
3219
- "aliasPermutations": [],
3220
- "permutations": [
3221
- "agent:test:run",
3222
- "test:agent:run",
3223
- "test:run:agent",
3224
- "agent:run:test",
3225
- "run:agent:test",
3226
- "run:test:agent"
3227
- ]
3228
- },
3229
- "agent:trace:delete": {
3230
- "aliases": [],
3231
- "args": {},
3232
- "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).",
3233
- "examples": [
3234
- "Delete all traces for all agents and sessions; prompt for confirmation:\n<%= config.bin %> <%= command.id %>",
3235
- "Delete all traces for a specific agent:\n<%= config.bin %> <%= command.id %> --agent My_Agent",
3236
- "Delete traces from a specific session:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID>",
3237
- "Delete traces older than 7 days:\n<%= config.bin %> <%= command.id %> --older-than 7d",
3238
- "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",
3239
- "Delete all traces for all agents and sessions; don't prompt for confirmation:\n<%= config.bin %> <%= command.id %> --no-prompt"
3240
- ],
3241
- "flags": {
3242
- "json": {
3243
- "description": "Format output as json.",
3244
- "helpGroup": "GLOBAL",
3245
- "name": "json",
3246
- "allowNo": false,
3247
- "type": "boolean"
3248
- },
3249
- "flags-dir": {
3250
- "helpGroup": "GLOBAL",
3251
- "name": "flags-dir",
3252
- "summary": "Import flag values from a directory.",
3253
- "hasDynamicHelp": false,
3254
- "multiple": false,
3255
- "type": "option"
3256
- },
3257
- "agent": {
3258
- "char": "a",
3259
- "name": "agent",
3260
- "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.",
3261
- "hasDynamicHelp": false,
3262
- "multiple": false,
3263
- "type": "option"
3264
- },
3265
- "session-id": {
3266
- "name": "session-id",
3267
- "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.",
3268
- "hasDynamicHelp": false,
3269
- "multiple": false,
3270
- "type": "option"
3271
- },
3272
- "older-than": {
3273
- "name": "older-than",
3274
- "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.",
3275
- "hasDynamicHelp": false,
3276
- "multiple": false,
3277
- "type": "option"
3278
- },
3279
- "no-prompt": {
3280
- "name": "no-prompt",
3281
- "summary": "Skip the confirmation prompt and delete immediately.",
3282
- "allowNo": false,
3283
- "type": "boolean"
3284
- }
3285
- },
3286
- "hasDynamicHelp": false,
3287
- "hiddenAliases": [],
3288
- "id": "agent:trace:delete",
3289
- "pluginAlias": "@salesforce/plugin-agent",
3290
- "pluginName": "@salesforce/plugin-agent",
3291
- "pluginType": "core",
3292
- "strict": true,
3293
- "summary": "Delete trace files from an agent preview session.",
3294
- "enableJsonFlag": true,
3295
- "requiresProject": true,
3296
- "errorCodes": {
3297
- "header": "ERROR CODES",
3298
- "body": [
3299
- {
3300
- "name": "Succeeded (0)",
3301
- "description": "Traces deleted successfully (or no traces matched)."
3302
- }
3303
- ]
3304
- },
3305
- "isESM": true,
3306
- "relativePath": [
3307
- "lib",
3308
- "commands",
3309
- "agent",
3310
- "trace",
3311
- "delete.js"
3228
+ "results.js"
3312
3229
  ],
3313
3230
  "aliasPermutations": [],
3314
3231
  "permutations": [
3315
- "agent:trace:delete",
3316
- "trace:agent:delete",
3317
- "trace:delete:agent",
3318
- "agent:delete:trace",
3319
- "delete:agent:trace",
3320
- "delete:trace:agent"
3232
+ "agent:test:results",
3233
+ "test:agent:results",
3234
+ "test:results:agent",
3235
+ "agent:results:test",
3236
+ "results:agent:test",
3237
+ "results:test:agent"
3321
3238
  ]
3322
3239
  },
3323
- "agent:trace:list": {
3240
+ "agent:test:resume": {
3324
3241
  "aliases": [],
3325
3242
  "args": {},
3326
- "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.",
3243
+ "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.",
3327
3244
  "examples": [
3328
- "List all trace files for all agents and sessions:\n<%= config.bin %> <%= command.id %>",
3329
- "List all trace files for a specific agent:\n<%= config.bin %> <%= command.id %> --agent My_Agent",
3330
- "List trace files for a specific session:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID>",
3331
- "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",
3332
- "List trace files recorded on or after a specific UTC time:\n<%= config.bin %> <%= command.id %> --since 2026-04-20T14:00:00Z",
3333
- "Filter by agent and date together:\n<%= config.bin %> <%= command.id %> --agent My_Agent --since 2026-04-20",
3334
- "Return results as JSON:\n<%= config.bin %> <%= command.id %> --json"
3245
+ "Resume an agent test in your default org using a job ID:\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ",
3246
+ "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",
3247
+ "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"
3335
3248
  ],
3336
3249
  "flags": {
3337
3250
  "json": {
@@ -3349,46 +3262,126 @@
3349
3262
  "multiple": false,
3350
3263
  "type": "option"
3351
3264
  },
3352
- "session-id": {
3353
- "name": "session-id",
3354
- "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.",
3265
+ "target-org": {
3266
+ "char": "o",
3267
+ "name": "target-org",
3268
+ "noCacheDefault": true,
3269
+ "required": true,
3270
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
3271
+ "hasDynamicHelp": true,
3272
+ "multiple": false,
3273
+ "type": "option"
3274
+ },
3275
+ "api-version": {
3276
+ "description": "Override the api version used for api requests made by this command",
3277
+ "name": "api-version",
3355
3278
  "hasDynamicHelp": false,
3356
3279
  "multiple": false,
3357
3280
  "type": "option"
3358
3281
  },
3359
- "agent": {
3360
- "char": "a",
3361
- "name": "agent",
3362
- "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.",
3282
+ "job-id": {
3283
+ "char": "i",
3284
+ "name": "job-id",
3285
+ "summary": "Job ID of the original agent test run.",
3363
3286
  "hasDynamicHelp": false,
3364
3287
  "multiple": false,
3365
3288
  "type": "option"
3366
3289
  },
3367
- "since": {
3368
- "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.",
3369
- "name": "since",
3370
- "summary": "Date used to filter the list of trace files; only those recorded on or after the date are listed.",
3290
+ "use-most-recent": {
3291
+ "char": "r",
3292
+ "name": "use-most-recent",
3293
+ "summary": "Use the job ID of the most recent agent test run.",
3294
+ "allowNo": false,
3295
+ "type": "boolean"
3296
+ },
3297
+ "wait": {
3298
+ "char": "w",
3299
+ "name": "wait",
3300
+ "summary": "Number of minutes to wait for the command to complete and display results to the terminal window.",
3301
+ "default": "5 minutes",
3302
+ "hasDynamicHelp": true,
3303
+ "multiple": false,
3304
+ "type": "option"
3305
+ },
3306
+ "result-format": {
3307
+ "name": "result-format",
3308
+ "summary": "Format of the agent test run results.",
3309
+ "default": "human",
3310
+ "hasDynamicHelp": false,
3311
+ "multiple": false,
3312
+ "options": [
3313
+ "json",
3314
+ "human",
3315
+ "junit",
3316
+ "tap"
3317
+ ],
3318
+ "type": "option"
3319
+ },
3320
+ "output-dir": {
3321
+ "char": "d",
3322
+ "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.",
3323
+ "name": "output-dir",
3324
+ "summary": "Directory to write the agent test results into.",
3325
+ "hasDynamicHelp": false,
3326
+ "multiple": false,
3327
+ "type": "option"
3328
+ },
3329
+ "test-runner": {
3330
+ "description": "By default, the command automatically detects which test runner to use based on the test definition metadata type in your org. Use this flag to explicitly specify the runner type. 'agentforce-studio' uses AiTestingDefinition metadata. 'testing-center' uses AiEvaluationDefinition metadata.",
3331
+ "name": "test-runner",
3332
+ "summary": "Explicitly specify which test runner to use (agentforce-studio or testing-center).",
3371
3333
  "hasDynamicHelp": false,
3372
3334
  "multiple": false,
3335
+ "options": [
3336
+ "agentforce-studio",
3337
+ "testing-center"
3338
+ ],
3373
3339
  "type": "option"
3340
+ },
3341
+ "verbose": {
3342
+ "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.",
3343
+ "name": "verbose",
3344
+ "summary": "Show generated data in the test results output.",
3345
+ "allowNo": false,
3346
+ "type": "boolean"
3374
3347
  }
3375
3348
  },
3376
- "hasDynamicHelp": false,
3349
+ "hasDynamicHelp": true,
3377
3350
  "hiddenAliases": [],
3378
- "id": "agent:trace:list",
3351
+ "id": "agent:test:resume",
3379
3352
  "pluginAlias": "@salesforce/plugin-agent",
3380
3353
  "pluginName": "@salesforce/plugin-agent",
3381
3354
  "pluginType": "core",
3382
3355
  "strict": true,
3383
- "summary": "List the available trace files that were recorded during all agent preview sessions.",
3356
+ "summary": "Resume an agent test that you previously started in your org so you can view the test results.",
3384
3357
  "enableJsonFlag": true,
3385
- "requiresProject": true,
3358
+ "envVariablesSection": {
3359
+ "header": "ENVIRONMENT VARIABLES",
3360
+ "body": [
3361
+ {
3362
+ "name": "SF_TARGET_ORG",
3363
+ "description": "Username or alias of your default org. Overrides the target-org configuration variable."
3364
+ }
3365
+ ]
3366
+ },
3386
3367
  "errorCodes": {
3387
3368
  "header": "ERROR CODES",
3388
3369
  "body": [
3389
3370
  {
3390
3371
  "name": "Succeeded (0)",
3391
- "description": "Trace files listed successfully (or empty list if none found)."
3372
+ "description": "Test completed successfully (with test results in the output)."
3373
+ },
3374
+ {
3375
+ "name": "Failed (1)",
3376
+ "description": "Tests encountered execution errors (test cases with ERROR status)."
3377
+ },
3378
+ {
3379
+ "name": "NotFound (2)",
3380
+ "description": "Job ID not found or invalid."
3381
+ },
3382
+ {
3383
+ "name": "OperationFailed (4)",
3384
+ "description": "Failed to poll test due to API or network errors."
3392
3385
  }
3393
3386
  ]
3394
3387
  },
@@ -3397,31 +3390,30 @@
3397
3390
  "lib",
3398
3391
  "commands",
3399
3392
  "agent",
3400
- "trace",
3401
- "list.js"
3393
+ "test",
3394
+ "resume.js"
3402
3395
  ],
3403
3396
  "aliasPermutations": [],
3404
3397
  "permutations": [
3405
- "agent:trace:list",
3406
- "trace:agent:list",
3407
- "trace:list:agent",
3408
- "agent:list:trace",
3409
- "list:agent:trace",
3410
- "list:trace:agent"
3398
+ "agent:test:resume",
3399
+ "test:agent:resume",
3400
+ "test:resume:agent",
3401
+ "agent:resume:test",
3402
+ "resume:agent:test",
3403
+ "resume:test:agent"
3411
3404
  ]
3412
3405
  },
3413
- "agent:trace:read": {
3406
+ "agent:test:run-eval": {
3414
3407
  "aliases": [],
3415
3408
  "args": {},
3416
- "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.",
3409
+ "description": "Specify the tests you want to run with one of these inputs to the --spec flag:\n\n- YAML test spec generated by the `agent generate test-spec` CLI command\n- JSON payload\n\nWhen you provide a YAML test spec, this command automatically translates test cases into internal state-based evaluation framework calls and infers the agent name from the test spec's `subjectName` field. As a result, you can use the same test spec with both the `agent test run` and `agent test run-eval` commands. YAML test specs also support context variables, which allow you to inject contextual data (such as CaseId or RoutableId) into agent sessions for testing with different contexts.\n\nWhen you provide a JSON payload, it's sent directly to the evaluation framework with optional normalization. The normalizer auto-corrects common field name mistakes, converts shorthand references to JSONPath, and injects defaults. Use `--no-normalize` to disable this auto-normalization. JSON payloads can also include context_variables on agent.create_session steps for the same contextual testing capabilities as when you use a YAML test spec.\n\nThis command supports more than 8 evaluator types, including subagent routing assertions, action invocation checks, string/numeric assertions, semantic similarity scoring, and LLM-based quality ratings.",
3417
3410
  "examples": [
3418
- "Show a session trace summary for all turns in the session with the specified ID:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID>",
3419
- "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",
3420
- "Drill into action execution across all turns:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --format detail --dimension actions",
3421
- "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",
3422
- "Show all errors across the session:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --format detail --dimension errors",
3423
- "Output raw trace JSON for custom parsing:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --format raw",
3424
- "Return results as JSON:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --json"
3411
+ "Run tests using a YAML test spec on the org with alias \"my-org\":\n<%= config.bin %> <%= command.id %> --spec specs/my-agent-testSpec.yaml --target-org my-org",
3412
+ "Run tests using a YAML spec with explicit agent name override; use your default org:\n<%= config.bin %> <%= command.id %> --spec specs/my-agent-testSpec.yaml --api-name My_Agent",
3413
+ "Run tests using a JSON payload:\n<%= config.bin %> <%= command.id %> --spec specs/eval-payload.json --target-org my-org",
3414
+ "Run tests and output results in JUnit format; useful for continuous integration and deployment (CI/CD):\n<%= config.bin %> <%= command.id %> --spec specs/my-agent-testSpec.yaml --target-org my-org --result-format junit",
3415
+ "Run tests with contextVariables to inject contextual data into agent sessions (add contextVariables to test cases in your YAML spec):\n<%= config.bin %> <%= command.id %> --spec specs/agent-with-context.yaml --target-org my-org",
3416
+ "Pipe JSON payload from stdin (--spec flag is automatically populated from stdin):\n$ echo '{\"tests\":[...]}' | <%= config.bin %> <%= command.id %> --spec --target-org my-org"
3425
3417
  ],
3426
3418
  "flags": {
3427
3419
  "json": {
@@ -3439,90 +3431,135 @@
3439
3431
  "multiple": false,
3440
3432
  "type": "option"
3441
3433
  },
3442
- "session-id": {
3434
+ "target-org": {
3435
+ "char": "o",
3436
+ "name": "target-org",
3437
+ "noCacheDefault": true,
3438
+ "required": true,
3439
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
3440
+ "hasDynamicHelp": true,
3441
+ "multiple": false,
3442
+ "type": "option"
3443
+ },
3444
+ "api-version": {
3445
+ "description": "Override the api version used for api requests made by this command",
3446
+ "name": "api-version",
3447
+ "hasDynamicHelp": false,
3448
+ "multiple": false,
3449
+ "type": "option"
3450
+ },
3451
+ "spec": {
3443
3452
  "char": "s",
3444
- "name": "session-id",
3453
+ "name": "spec",
3445
3454
  "required": true,
3446
- "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",
3455
+ "summary": "Path to test spec file (YAML or JSON). Supports reading from stdin when piping content.",
3447
3456
  "hasDynamicHelp": false,
3448
3457
  "multiple": false,
3449
3458
  "type": "option"
3450
3459
  },
3451
- "format": {
3452
- "char": "f",
3453
- "name": "format",
3454
- "summary": "Output format of the trace data; specifies the level of detail you want in the trace files.",
3455
- "default": "summary",
3460
+ "api-name": {
3461
+ "char": "n",
3462
+ "name": "api-name",
3463
+ "summary": "Agent API name (also called DeveloperName) used to resolve agent_id and agent_version_id. Auto-inferred from the YAML spec's subjectName.",
3456
3464
  "hasDynamicHelp": false,
3457
3465
  "multiple": false,
3458
- "options": [
3459
- "summary",
3460
- "detail",
3461
- "raw"
3462
- ],
3463
3466
  "type": "option"
3464
3467
  },
3465
- "dimension": {
3466
- "char": "d",
3467
- "name": "dimension",
3468
- "summary": "Dimension to drill into when using \"--format detail\"; used to filter and organize the trace data to answer a specific type of question.",
3468
+ "result-format": {
3469
+ "name": "result-format",
3470
+ "summary": "Format of the agent test run results.",
3471
+ "default": "human",
3469
3472
  "hasDynamicHelp": false,
3470
3473
  "multiple": false,
3471
3474
  "options": [
3472
- "actions",
3473
- "grounding",
3474
- "routing",
3475
- "errors"
3475
+ "json",
3476
+ "human",
3477
+ "junit",
3478
+ "tap"
3476
3479
  ],
3477
3480
  "type": "option"
3478
3481
  },
3479
- "turn": {
3480
- "char": "t",
3481
- "name": "turn",
3482
- "summary": "Turn number for which you want trace data. A turn is a single utterance or response in a conversation, starting with 1.",
3482
+ "batch-size": {
3483
+ "name": "batch-size",
3484
+ "summary": "Number of tests per API request (max 5).",
3485
+ "default": 5,
3483
3486
  "hasDynamicHelp": false,
3484
3487
  "multiple": false,
3485
3488
  "type": "option"
3489
+ },
3490
+ "no-normalize": {
3491
+ "name": "no-normalize",
3492
+ "summary": "Disable auto-normalization of field names and shorthand references.",
3493
+ "allowNo": false,
3494
+ "type": "boolean"
3486
3495
  }
3487
3496
  },
3488
- "hasDynamicHelp": false,
3497
+ "hasDynamicHelp": true,
3489
3498
  "hiddenAliases": [],
3490
- "id": "agent:trace:read",
3499
+ "id": "agent:test:run-eval",
3491
3500
  "pluginAlias": "@salesforce/plugin-agent",
3492
3501
  "pluginName": "@salesforce/plugin-agent",
3493
3502
  "pluginType": "core",
3503
+ "state": "beta",
3494
3504
  "strict": true,
3495
- "summary": "Read trace files from an agent preview session.",
3505
+ "summary": "Run rich evaluation tests against an Agentforce agent.",
3496
3506
  "enableJsonFlag": true,
3497
- "requiresProject": true,
3507
+ "envVariablesSection": {
3508
+ "header": "ENVIRONMENT VARIABLES",
3509
+ "body": [
3510
+ {
3511
+ "name": "SF_TARGET_ORG",
3512
+ "description": "Username or alias of your default org. Overrides the target-org configuration variable."
3513
+ }
3514
+ ]
3515
+ },
3516
+ "errorCodes": {
3517
+ "header": "ERROR CODES",
3518
+ "body": [
3519
+ {
3520
+ "name": "Succeeded (0)",
3521
+ "description": "Tests completed successfully. Test results (passed/failed) are in the JSON output."
3522
+ },
3523
+ {
3524
+ "name": "Failed (1)",
3525
+ "description": "Tests encountered execution errors (tests couldn't run properly)."
3526
+ },
3527
+ {
3528
+ "name": "NotFound (2)",
3529
+ "description": "Agent not found, spec file not found, or invalid agent name."
3530
+ },
3531
+ {
3532
+ "name": "OperationFailed (4)",
3533
+ "description": "Failed to execute tests due to API or network errors."
3534
+ }
3535
+ ]
3536
+ },
3498
3537
  "isESM": true,
3499
3538
  "relativePath": [
3500
3539
  "lib",
3501
3540
  "commands",
3502
3541
  "agent",
3503
- "trace",
3504
- "read.js"
3542
+ "test",
3543
+ "run-eval.js"
3505
3544
  ],
3506
3545
  "aliasPermutations": [],
3507
3546
  "permutations": [
3508
- "agent:trace:read",
3509
- "trace:agent:read",
3510
- "trace:read:agent",
3511
- "agent:read:trace",
3512
- "read:agent:trace",
3513
- "read:trace:agent"
3547
+ "agent:test:run-eval",
3548
+ "test:agent:run-eval",
3549
+ "test:run-eval:agent",
3550
+ "agent:run-eval:test",
3551
+ "run-eval:agent:test",
3552
+ "run-eval:test:agent"
3514
3553
  ]
3515
3554
  },
3516
- "agent:generate:agent-spec": {
3555
+ "agent:test:run": {
3517
3556
  "aliases": [],
3518
3557
  "args": {},
3519
- "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.)",
3558
+ "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.",
3520
3559
  "examples": [
3521
- "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.\"",
3522
- "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",
3523
- "Be prompted for all required and optional agent properties; use your default org:\n<%= config.bin %> <%= command.id %> --full-interview",
3524
- "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\"",
3525
- "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"
3560
+ "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",
3561
+ "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",
3562
+ "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"
3526
3563
  ],
3527
3564
  "flags": {
3528
3565
  "json": {
@@ -3557,276 +3594,228 @@
3557
3594
  "multiple": false,
3558
3595
  "type": "option"
3559
3596
  },
3560
- "type": {
3561
- "name": "type",
3562
- "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.",
3563
- "hasDynamicHelp": false,
3564
- "multiple": false,
3565
- "options": [
3566
- "customer",
3567
- "internal"
3568
- ],
3569
- "type": "option"
3570
- },
3571
- "role": {
3572
- "name": "role",
3573
- "summary": "Role of the agent.",
3574
- "hasDynamicHelp": false,
3575
- "multiple": false,
3576
- "type": "option"
3577
- },
3578
- "company-name": {
3579
- "name": "company-name",
3580
- "summary": "Name of your company.",
3581
- "hasDynamicHelp": false,
3582
- "multiple": false,
3583
- "type": "option"
3584
- },
3585
- "company-description": {
3586
- "name": "company-description",
3587
- "summary": "Description of your company.",
3588
- "hasDynamicHelp": false,
3589
- "multiple": false,
3590
- "type": "option"
3591
- },
3592
- "company-website": {
3593
- "name": "company-website",
3594
- "summary": "Website URL of your company.",
3595
- "hasDynamicHelp": false,
3596
- "multiple": false,
3597
- "type": "option"
3598
- },
3599
- "max-topics": {
3600
- "name": "max-topics",
3601
- "summary": "Maximum number of topics to generate in the agent spec; default is 5.",
3602
- "hasDynamicHelp": false,
3603
- "multiple": false,
3604
- "type": "option"
3605
- },
3606
- "agent-user": {
3607
- "name": "agent-user",
3608
- "summary": "Username of a user in your org to assign to your agent; determines what your agent can access and do.",
3597
+ "api-name": {
3598
+ "char": "n",
3599
+ "name": "api-name",
3600
+ "summary": "API name of the agent test to run; corresponds to the name of the AiEvaluationDefinition metadata component that implements the agent test.",
3609
3601
  "hasDynamicHelp": false,
3610
3602
  "multiple": false,
3611
3603
  "type": "option"
3612
3604
  },
3613
- "enrich-logs": {
3614
- "name": "enrich-logs",
3615
- "summary": "Adds agent conversation data to event logs so you can view all agent session activity in one place.",
3616
- "hasDynamicHelp": false,
3605
+ "wait": {
3606
+ "char": "w",
3607
+ "name": "wait",
3608
+ "summary": "Number of minutes to wait for the command to complete and display results to the terminal window.",
3609
+ "hasDynamicHelp": true,
3617
3610
  "multiple": false,
3618
- "options": [
3619
- "true",
3620
- "false"
3621
- ],
3622
3611
  "type": "option"
3623
3612
  },
3624
- "tone": {
3625
- "name": "tone",
3626
- "summary": "Conversational style of the agent, such as how it expresses your brand personality in its messages through word choice, punctuation, and sentence structure.",
3613
+ "result-format": {
3614
+ "name": "result-format",
3615
+ "summary": "Format of the agent test run results.",
3616
+ "default": "human",
3627
3617
  "hasDynamicHelp": false,
3628
3618
  "multiple": false,
3629
3619
  "options": [
3630
- "formal",
3631
- "casual",
3632
- "neutral"
3620
+ "json",
3621
+ "human",
3622
+ "junit",
3623
+ "tap"
3633
3624
  ],
3634
3625
  "type": "option"
3635
3626
  },
3636
- "spec": {
3637
- "name": "spec",
3638
- "summary": "Agent spec file, in YAML format, to use as input to the command.",
3639
- "hasDynamicHelp": false,
3640
- "multiple": false,
3641
- "type": "option"
3642
- },
3643
- "output-file": {
3644
- "name": "output-file",
3645
- "summary": "Path for the generated YAML agent spec file; can be an absolute or relative path.",
3646
- "default": "specs/agentSpec.yaml",
3627
+ "output-dir": {
3628
+ "char": "d",
3629
+ "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.",
3630
+ "name": "output-dir",
3631
+ "summary": "Directory to write the agent test results into.",
3647
3632
  "hasDynamicHelp": false,
3648
3633
  "multiple": false,
3649
3634
  "type": "option"
3650
3635
  },
3651
- "full-interview": {
3652
- "name": "full-interview",
3653
- "summary": "Prompt for both required and optional flags.",
3654
- "allowNo": false,
3655
- "type": "boolean"
3656
- },
3657
- "prompt-template": {
3658
- "name": "prompt-template",
3659
- "summary": "API name of a customized prompt template to use instead of the default prompt template.",
3636
+ "test-runner": {
3637
+ "description": "By default, the command automatically detects which test runner to use based on the test definition metadata type in your org. Use this flag to explicitly specify the runner type. 'agentforce-studio' uses AiTestingDefinition metadata. 'testing-center' uses AiEvaluationDefinition metadata.",
3638
+ "name": "test-runner",
3639
+ "summary": "Explicitly specify which test runner to use (agentforce-studio or testing-center).",
3660
3640
  "hasDynamicHelp": false,
3661
3641
  "multiple": false,
3662
- "type": "option"
3663
- },
3664
- "grounding-context": {
3665
- "dependsOn": [
3666
- "prompt-template"
3642
+ "options": [
3643
+ "agentforce-studio",
3644
+ "testing-center"
3667
3645
  ],
3668
- "name": "grounding-context",
3669
- "summary": "Context information and personalization that's added to your prompts when using a custom prompt template.",
3670
- "hasDynamicHelp": false,
3671
- "multiple": false,
3672
3646
  "type": "option"
3673
3647
  },
3674
- "force-overwrite": {
3675
- "name": "force-overwrite",
3676
- "summary": "Don't prompt the user to confirm that an existing spec file will be overwritten.",
3648
+ "verbose": {
3649
+ "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.",
3650
+ "name": "verbose",
3651
+ "summary": "Show generated data in the test results output.",
3677
3652
  "allowNo": false,
3678
3653
  "type": "boolean"
3679
3654
  }
3680
3655
  },
3681
3656
  "hasDynamicHelp": true,
3682
3657
  "hiddenAliases": [],
3683
- "id": "agent:generate:agent-spec",
3658
+ "id": "agent:test:run",
3684
3659
  "pluginAlias": "@salesforce/plugin-agent",
3685
3660
  "pluginName": "@salesforce/plugin-agent",
3686
3661
  "pluginType": "core",
3687
3662
  "strict": true,
3688
- "summary": "Generate an agent spec, which is a YAML file that captures what an agent can do.",
3663
+ "summary": "Start an agent test in your org.",
3689
3664
  "enableJsonFlag": true,
3690
- "requiresProject": true,
3665
+ "envVariablesSection": {
3666
+ "header": "ENVIRONMENT VARIABLES",
3667
+ "body": [
3668
+ {
3669
+ "name": "SF_TARGET_ORG",
3670
+ "description": "Username or alias of your default org. Overrides the target-org configuration variable."
3671
+ }
3672
+ ]
3673
+ },
3674
+ "errorCodes": {
3675
+ "header": "ERROR CODES",
3676
+ "body": [
3677
+ {
3678
+ "name": "Succeeded (0)",
3679
+ "description": "Test started successfully (without --wait), or test completed successfully (with --wait)."
3680
+ },
3681
+ {
3682
+ "name": "Failed (1)",
3683
+ "description": "Tests encountered execution errors (test cases with ERROR status when using --wait)."
3684
+ },
3685
+ {
3686
+ "name": "NotFound (2)",
3687
+ "description": "Test definition not found or invalid test name."
3688
+ },
3689
+ {
3690
+ "name": "OperationFailed (4)",
3691
+ "description": "Failed to start or poll test due to API or network errors."
3692
+ }
3693
+ ]
3694
+ },
3691
3695
  "isESM": true,
3692
3696
  "relativePath": [
3693
3697
  "lib",
3694
3698
  "commands",
3695
3699
  "agent",
3696
- "generate",
3697
- "agent-spec.js"
3700
+ "test",
3701
+ "run.js"
3698
3702
  ],
3699
3703
  "aliasPermutations": [],
3700
3704
  "permutations": [
3701
- "agent:generate:agent-spec",
3702
- "generate:agent:agent-spec",
3703
- "generate:agent-spec:agent",
3704
- "agent:agent-spec:generate",
3705
- "agent-spec:agent:generate",
3706
- "agent-spec:generate:agent"
3705
+ "agent:test:run",
3706
+ "test:agent:run",
3707
+ "test:run:agent",
3708
+ "agent:run:test",
3709
+ "run:agent:test",
3710
+ "run:test:agent"
3707
3711
  ]
3708
3712
  },
3709
- "agent:generate:authoring-bundle": {
3713
+ "agent:trace:delete": {
3710
3714
  "aliases": [],
3711
3715
  "args": {},
3712
- "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. The resulting Agent Script file is customized to reflect what's in the agent spec file. You can also create an authoring bundle without an agent spec file by specifying the \"--no-spec\" flag; in this case, the resulting Agent Script file is just the default boilerplate.\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.",
3716
+ "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).",
3713
3717
  "examples": [
3714
- "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 %>",
3715
- "Generate an authoring bundle without using an agent spec file; give the bundle the label \"My Authoring Bundle\" and use your default org:\n<%= config.bin %> <%= command.id %> --no-spec --name \"My Authoring Bundle\"",
3716
- "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\"",
3717
- "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"
3718
+ "Delete all traces for all agents and sessions; prompt for confirmation:\n<%= config.bin %> <%= command.id %>",
3719
+ "Delete all traces for a specific agent:\n<%= config.bin %> <%= command.id %> --agent My_Agent",
3720
+ "Delete traces from a specific session:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID>",
3721
+ "Delete traces older than 7 days:\n<%= config.bin %> <%= command.id %> --older-than 7d",
3722
+ "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",
3723
+ "Delete all traces for all agents and sessions; don't prompt for confirmation:\n<%= config.bin %> <%= command.id %> --no-prompt"
3718
3724
  ],
3719
3725
  "flags": {
3720
3726
  "json": {
3721
- "description": "Format output as json.",
3722
- "helpGroup": "GLOBAL",
3723
- "name": "json",
3724
- "allowNo": false,
3725
- "type": "boolean"
3726
- },
3727
- "flags-dir": {
3728
- "helpGroup": "GLOBAL",
3729
- "name": "flags-dir",
3730
- "summary": "Import flag values from a directory.",
3731
- "hasDynamicHelp": false,
3732
- "multiple": false,
3733
- "type": "option"
3734
- },
3735
- "target-org": {
3736
- "char": "o",
3737
- "name": "target-org",
3738
- "noCacheDefault": true,
3739
- "required": true,
3740
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
3741
- "hasDynamicHelp": true,
3742
- "multiple": false,
3743
- "type": "option"
3744
- },
3745
- "api-name": {
3746
- "name": "api-name",
3747
- "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.",
3748
- "hasDynamicHelp": false,
3749
- "multiple": false,
3750
- "type": "option"
3727
+ "description": "Format output as json.",
3728
+ "helpGroup": "GLOBAL",
3729
+ "name": "json",
3730
+ "allowNo": false,
3731
+ "type": "boolean"
3751
3732
  },
3752
- "api-version": {
3753
- "description": "Override the api version used for api requests made by this command",
3754
- "name": "api-version",
3733
+ "flags-dir": {
3734
+ "helpGroup": "GLOBAL",
3735
+ "name": "flags-dir",
3736
+ "summary": "Import flag values from a directory.",
3755
3737
  "hasDynamicHelp": false,
3756
3738
  "multiple": false,
3757
3739
  "type": "option"
3758
3740
  },
3759
- "spec": {
3760
- "char": "f",
3761
- "name": "spec",
3762
- "summary": "Path to the agent spec YAML file. If you don't specify the flag, the command provides a list that you can choose from. Use the --no-spec flag to skip using an agent spec entirely.",
3741
+ "agent": {
3742
+ "char": "a",
3743
+ "name": "agent",
3744
+ "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.",
3763
3745
  "hasDynamicHelp": false,
3764
3746
  "multiple": false,
3765
3747
  "type": "option"
3766
3748
  },
3767
- "no-spec": {
3768
- "name": "no-spec",
3769
- "summary": "Skip prompting for an agent spec and use the default Agent Script boilerplate in the generated authoring bundle.",
3770
- "allowNo": false,
3771
- "type": "boolean"
3772
- },
3773
- "output-dir": {
3774
- "char": "d",
3775
- "name": "output-dir",
3776
- "summary": "Directory where the authoring bundle files are generated.",
3749
+ "session-id": {
3750
+ "name": "session-id",
3751
+ "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.",
3777
3752
  "hasDynamicHelp": false,
3778
3753
  "multiple": false,
3779
3754
  "type": "option"
3780
3755
  },
3781
- "name": {
3782
- "char": "n",
3783
- "name": "name",
3784
- "summary": "Name (label) of the authoring bundle; if not specified, you're prompted for the name.",
3756
+ "older-than": {
3757
+ "name": "older-than",
3758
+ "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.",
3785
3759
  "hasDynamicHelp": false,
3786
3760
  "multiple": false,
3787
3761
  "type": "option"
3788
3762
  },
3789
- "force-overwrite": {
3790
- "name": "force-overwrite",
3791
- "summary": "Overwrite the existing authoring bundle if one with the same API name already exists locally.",
3763
+ "no-prompt": {
3764
+ "name": "no-prompt",
3765
+ "summary": "Skip the confirmation prompt and delete immediately.",
3792
3766
  "allowNo": false,
3793
3767
  "type": "boolean"
3794
3768
  }
3795
3769
  },
3796
- "hasDynamicHelp": true,
3770
+ "hasDynamicHelp": false,
3797
3771
  "hiddenAliases": [],
3798
- "id": "agent:generate:authoring-bundle",
3772
+ "id": "agent:trace:delete",
3799
3773
  "pluginAlias": "@salesforce/plugin-agent",
3800
3774
  "pluginName": "@salesforce/plugin-agent",
3801
3775
  "pluginType": "core",
3802
3776
  "strict": true,
3803
- "summary": "Generate an authoring bundle from an existing agent spec YAML file.",
3777
+ "summary": "Delete trace files from an agent preview session.",
3804
3778
  "enableJsonFlag": true,
3805
3779
  "requiresProject": true,
3780
+ "errorCodes": {
3781
+ "header": "ERROR CODES",
3782
+ "body": [
3783
+ {
3784
+ "name": "Succeeded (0)",
3785
+ "description": "Traces deleted successfully (or no traces matched)."
3786
+ }
3787
+ ]
3788
+ },
3806
3789
  "isESM": true,
3807
3790
  "relativePath": [
3808
3791
  "lib",
3809
3792
  "commands",
3810
3793
  "agent",
3811
- "generate",
3812
- "authoring-bundle.js"
3794
+ "trace",
3795
+ "delete.js"
3813
3796
  ],
3814
3797
  "aliasPermutations": [],
3815
3798
  "permutations": [
3816
- "agent:generate:authoring-bundle",
3817
- "generate:agent:authoring-bundle",
3818
- "generate:authoring-bundle:agent",
3819
- "agent:authoring-bundle:generate",
3820
- "authoring-bundle:agent:generate",
3821
- "authoring-bundle:generate:agent"
3799
+ "agent:trace:delete",
3800
+ "trace:agent:delete",
3801
+ "trace:delete:agent",
3802
+ "agent:delete:trace",
3803
+ "delete:agent:trace",
3804
+ "delete:trace:agent"
3822
3805
  ]
3823
3806
  },
3824
- "agent:generate:template": {
3807
+ "agent:trace:list": {
3825
3808
  "aliases": [],
3826
3809
  "args": {},
3827
- "description": "WARNING: This command doesn't work for agents that were created from an Agent Script file. In other words, you can't currently package an agent template for agents that use Agent Script.\n\nAt a high-level, agents are defined by the Bot, BotVersion, and GenAiPlannerBundle metadata types. The GenAiPlannerBundle type in turn defines the agent's topics and actions. This command uses the metadata files for these three types, located in your local DX project, to generate a BotTemplate metadata file for a specific agent (Bot). You then use the BotTemplate metadata file, along with the GenAiPlannerBundle metadata file that references the BotTemplate, to package the template in a managed package that you can share between orgs or on AppExchange.\n\nUse the --agent-file flag to specify the relative or full pathname of the Bot metadata file, such as force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml. A single Bot can have multiple BotVersions, so use the --agent-version flag to specify the version. The corresponding BotVersion metadata file must exist locally. For example, if you specify \"--agent-version 4\", then the file force-app/main/default/bots/My_Awesome_Agent/v4.botVersion-meta.xml must exist.\n\nThe new BotTemplate metadata file is generated in the \"botTemplates\" directory in the output directory specified with the --output-dir flag, and has the name <Agent_API_name>\\_v<Version>\\_Template.botTemplate-meta.xml, such as my-package/botTemplates/My_Awesome_Agent_v4_Template.botTemplate-meta.xml. The command displays the full pathname of the generated files when it completes.\n\nSee \"Develop and Package Agent Templates Using Scratch Orgs\" (https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/dev2gp_package_agent_templates.htm) for details about the complete process, which includes using a scratch org to create and test the agent, retrieving the agent metadata to your DX project, running this command to create the agent template, and then packaging the template.",
3810
+ "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.",
3828
3811
  "examples": [
3829
- "Generate an agent template from the My_Awesome_Agent Bot metadata file in your DX project and save the BotTemplate and GenAiPlannerBundle to the specified directory; use version 1 of the agent. The agent that the template is based on is in the org with alias \"my-scratch-org\":\n<%= config.bin %> <%= command.id %> --agent-file force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1 --output-dir my-package --source-org my-scratch-org"
3812
+ "List all trace files for all agents and sessions:\n<%= config.bin %> <%= command.id %>",
3813
+ "List all trace files for a specific agent:\n<%= config.bin %> <%= command.id %> --agent My_Agent",
3814
+ "List trace files for a specific session:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID>",
3815
+ "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",
3816
+ "List trace files recorded on or after a specific UTC time:\n<%= config.bin %> <%= command.id %> --since 2026-04-20T14:00:00Z",
3817
+ "Filter by agent and date together:\n<%= config.bin %> <%= command.id %> --agent My_Agent --since 2026-04-20",
3818
+ "Return results as JSON:\n<%= config.bin %> <%= command.id %> --json"
3830
3819
  ],
3831
3820
  "flags": {
3832
3821
  "json": {
@@ -3844,89 +3833,88 @@
3844
3833
  "multiple": false,
3845
3834
  "type": "option"
3846
3835
  },
3847
- "api-version": {
3848
- "description": "Override the api version used for api requests made by this command",
3849
- "name": "api-version",
3850
- "hasDynamicHelp": false,
3851
- "multiple": false,
3852
- "type": "option"
3853
- },
3854
- "source-org": {
3855
- "char": "s",
3856
- "name": "source-org",
3857
- "noCacheDefault": true,
3858
- "required": true,
3859
- "summary": "Username or alias of the namespaced scratch org that contains the agent which this template is based on.",
3860
- "hasDynamicHelp": true,
3861
- "multiple": false,
3862
- "type": "option"
3863
- },
3864
- "agent-version": {
3865
- "name": "agent-version",
3866
- "required": true,
3867
- "summary": "Version of the agent (BotVersion).",
3836
+ "session-id": {
3837
+ "name": "session-id",
3838
+ "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.",
3868
3839
  "hasDynamicHelp": false,
3869
3840
  "multiple": false,
3870
3841
  "type": "option"
3871
3842
  },
3872
- "agent-file": {
3873
- "char": "f",
3874
- "name": "agent-file",
3875
- "required": true,
3876
- "summary": "Path to an agent (Bot) metadata file.",
3843
+ "agent": {
3844
+ "char": "a",
3845
+ "name": "agent",
3846
+ "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.",
3877
3847
  "hasDynamicHelp": false,
3878
3848
  "multiple": false,
3879
3849
  "type": "option"
3880
3850
  },
3881
- "output-dir": {
3882
- "char": "r",
3883
- "name": "output-dir",
3884
- "summary": "Directory where the generated BotTemplate and GenAiPlannerBundle files are saved.",
3851
+ "since": {
3852
+ "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.",
3853
+ "name": "since",
3854
+ "summary": "Date used to filter the list of trace files; only those recorded on or after the date are listed.",
3885
3855
  "hasDynamicHelp": false,
3886
3856
  "multiple": false,
3887
3857
  "type": "option"
3888
3858
  }
3889
3859
  },
3890
- "hasDynamicHelp": true,
3860
+ "hasDynamicHelp": false,
3891
3861
  "hiddenAliases": [],
3892
- "id": "agent:generate:template",
3862
+ "id": "agent:trace:list",
3893
3863
  "pluginAlias": "@salesforce/plugin-agent",
3894
3864
  "pluginName": "@salesforce/plugin-agent",
3895
3865
  "pluginType": "core",
3896
3866
  "strict": true,
3897
- "summary": "Generate an agent template from an existing agent in your DX project so you can then package the template in a second-generation managed package.",
3867
+ "summary": "List the available trace files that were recorded during all agent preview sessions.",
3898
3868
  "enableJsonFlag": true,
3899
3869
  "requiresProject": true,
3870
+ "errorCodes": {
3871
+ "header": "ERROR CODES",
3872
+ "body": [
3873
+ {
3874
+ "name": "Succeeded (0)",
3875
+ "description": "Trace files listed successfully (or empty list if none found)."
3876
+ }
3877
+ ]
3878
+ },
3900
3879
  "isESM": true,
3901
3880
  "relativePath": [
3902
3881
  "lib",
3903
3882
  "commands",
3904
3883
  "agent",
3905
- "generate",
3906
- "template.js"
3884
+ "trace",
3885
+ "list.js"
3907
3886
  ],
3908
3887
  "aliasPermutations": [],
3909
3888
  "permutations": [
3910
- "agent:generate:template",
3911
- "generate:agent:template",
3912
- "generate:template:agent",
3913
- "agent:template:generate",
3914
- "template:agent:generate",
3915
- "template:generate:agent"
3889
+ "agent:trace:list",
3890
+ "trace:agent:list",
3891
+ "trace:list:agent",
3892
+ "agent:list:trace",
3893
+ "list:agent:trace",
3894
+ "list:trace:agent"
3916
3895
  ]
3917
3896
  },
3918
- "agent:generate:test-spec": {
3897
+ "agent:trace:read": {
3919
3898
  "aliases": [],
3920
3899
  "args": {},
3921
- "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\nYou can manually add contextVariables to test cases in the generated YAML file to inject contextual data (such as CaseId or RoutableId) into agent sessions. This is useful for testing agent behavior with different contextual information.\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` (legacy testing-center) or `AiTestingDefinition` (Agentforce Studio / NGT), selected via --test-runner.\n\nIf you have an existing AiEvaluationDefinition or AiTestingDefinition metadata XML file in your DX project, you can generate its equivalent YAML test spec file with the --from-definition flag. The runner is inferred from the file extension; pass --test-runner to override.",
3900
+ "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.",
3922
3901
  "examples": [
3923
- "Generate an agent test spec YAML file interactively:\n<%= config.bin %> <%= command.id %>",
3924
- "Generate an Agentforce Studio (NGT) test spec YAML file interactively:\n<%= config.bin %> <%= command.id %> --test-runner agentforce-studio",
3925
- "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",
3926
- "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",
3927
- "Generate an Agentforce Studio (NGT) test spec YAML file from an existing AiTestingDefinition metadata XML file:\n<%= config.bin %> <%= command.id %> --from-definition force-app/main/default/aiTestingDefinitions/Returns_Checkout_Tests.aiTestingDefinition-meta.xml"
3902
+ "Show a session trace summary for all turns in the session with the specified ID:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID>",
3903
+ "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",
3904
+ "Drill into action execution across all turns:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --format detail --dimension actions",
3905
+ "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",
3906
+ "Show all errors across the session:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --format detail --dimension errors",
3907
+ "Output raw trace JSON for custom parsing:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --format raw",
3908
+ "Return results as JSON:\n<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --json"
3928
3909
  ],
3929
3910
  "flags": {
3911
+ "json": {
3912
+ "description": "Format output as json.",
3913
+ "helpGroup": "GLOBAL",
3914
+ "name": "json",
3915
+ "allowNo": false,
3916
+ "type": "boolean"
3917
+ },
3930
3918
  "flags-dir": {
3931
3919
  "helpGroup": "GLOBAL",
3932
3920
  "name": "flags-dir",
@@ -3935,66 +3923,78 @@
3935
3923
  "multiple": false,
3936
3924
  "type": "option"
3937
3925
  },
3938
- "from-definition": {
3939
- "char": "d",
3940
- "name": "from-definition",
3941
- "summary": "Filepath to an AiEvaluationDefinition or AiTestingDefinition metadata XML file in your DX project that you want to convert to a test spec YAML file.",
3926
+ "session-id": {
3927
+ "char": "s",
3928
+ "name": "session-id",
3929
+ "required": true,
3930
+ "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",
3942
3931
  "hasDynamicHelp": false,
3943
3932
  "multiple": false,
3944
3933
  "type": "option"
3945
3934
  },
3946
- "force-overwrite": {
3947
- "name": "force-overwrite",
3948
- "summary": "Don't prompt for confirmation when overwriting an existing test spec YAML file.",
3949
- "allowNo": false,
3950
- "type": "boolean"
3951
- },
3952
- "output-file": {
3935
+ "format": {
3953
3936
  "char": "f",
3954
- "name": "output-file",
3955
- "summary": "Name of the generated test spec YAML file. Default value is \"specs/<AGENT_API_NAME>-testSpec.yaml\" (legacy) or \"specs/<AGENT_API_NAME>-ngtTestSpec.yaml\" (Agentforce Studio).",
3937
+ "name": "format",
3938
+ "summary": "Output format of the trace data; specifies the level of detail you want in the trace files.",
3939
+ "default": "summary",
3956
3940
  "hasDynamicHelp": false,
3957
3941
  "multiple": false,
3942
+ "options": [
3943
+ "summary",
3944
+ "detail",
3945
+ "raw"
3946
+ ],
3958
3947
  "type": "option"
3959
3948
  },
3960
- "test-runner": {
3961
- "description": "By default, the command automatically detects which test runner to use based on the test definition metadata type in your org. Use this flag to explicitly specify the runner type. 'agentforce-studio' uses AiTestingDefinition metadata. 'testing-center' uses AiEvaluationDefinition metadata.",
3962
- "name": "test-runner",
3963
- "summary": "Explicitly specify which test runner to use (agentforce-studio or testing-center).",
3949
+ "dimension": {
3950
+ "char": "d",
3951
+ "name": "dimension",
3952
+ "summary": "Dimension to drill into when using \"--format detail\"; used to filter and organize the trace data to answer a specific type of question.",
3964
3953
  "hasDynamicHelp": false,
3965
3954
  "multiple": false,
3966
3955
  "options": [
3967
- "agentforce-studio",
3968
- "testing-center"
3956
+ "actions",
3957
+ "grounding",
3958
+ "routing",
3959
+ "errors"
3969
3960
  ],
3970
3961
  "type": "option"
3962
+ },
3963
+ "turn": {
3964
+ "char": "t",
3965
+ "name": "turn",
3966
+ "summary": "Turn number for which you want trace data. A turn is a single utterance or response in a conversation, starting with 1.",
3967
+ "hasDynamicHelp": false,
3968
+ "multiple": false,
3969
+ "type": "option"
3971
3970
  }
3972
3971
  },
3973
3972
  "hasDynamicHelp": false,
3974
3973
  "hiddenAliases": [],
3975
- "id": "agent:generate:test-spec",
3974
+ "id": "agent:trace:read",
3976
3975
  "pluginAlias": "@salesforce/plugin-agent",
3977
3976
  "pluginName": "@salesforce/plugin-agent",
3978
3977
  "pluginType": "core",
3979
3978
  "strict": true,
3980
- "summary": "Generate an agent test spec, which is a YAML file that lists the test cases for testing a specific agent.",
3981
- "enableJsonFlag": false,
3979
+ "summary": "Read trace files from an agent preview session.",
3980
+ "enableJsonFlag": true,
3981
+ "requiresProject": true,
3982
3982
  "isESM": true,
3983
3983
  "relativePath": [
3984
3984
  "lib",
3985
3985
  "commands",
3986
3986
  "agent",
3987
- "generate",
3988
- "test-spec.js"
3987
+ "trace",
3988
+ "read.js"
3989
3989
  ],
3990
3990
  "aliasPermutations": [],
3991
3991
  "permutations": [
3992
- "agent:generate:test-spec",
3993
- "generate:agent:test-spec",
3994
- "generate:test-spec:agent",
3995
- "agent:test-spec:generate",
3996
- "test-spec:agent:generate",
3997
- "test-spec:generate:agent"
3992
+ "agent:trace:read",
3993
+ "trace:agent:read",
3994
+ "trace:read:agent",
3995
+ "agent:read:trace",
3996
+ "read:agent:trace",
3997
+ "read:trace:agent"
3998
3998
  ]
3999
3999
  },
4000
4000
  "agent:validate:authoring-bundle": {
@@ -4667,5 +4667,5 @@
4667
4667
  ]
4668
4668
  }
4669
4669
  },
4670
- "version": "1.45.0"
4670
+ "version": "2.0.1"
4671
4671
  }