@salesforce/plugin-agent 1.26.5 → 1.26.7
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.
- package/README.md +38 -44
- package/lib/agentActivation.d.ts +3 -4
- package/lib/agentActivation.js +8 -4
- package/lib/agentActivation.js.map +1 -1
- package/lib/commands/agent/activate.js +1 -2
- package/lib/commands/agent/activate.js.map +1 -1
- package/lib/commands/agent/deactivate.js +1 -2
- package/lib/commands/agent/deactivate.js.map +1 -1
- package/lib/commands/agent/generate/authoring-bundle.js +8 -9
- package/lib/commands/agent/generate/authoring-bundle.js.map +1 -1
- package/lib/commands/agent/preview.d.ts +0 -4
- package/lib/commands/agent/preview.js +34 -113
- package/lib/commands/agent/preview.js.map +1 -1
- package/lib/commands/agent/publish/authoring-bundle.js +6 -13
- package/lib/commands/agent/publish/authoring-bundle.js.map +1 -1
- package/lib/commands/agent/validate/authoring-bundle.js +5 -12
- package/lib/commands/agent/validate/authoring-bundle.js.map +1 -1
- package/lib/components/agent-preview-react.d.ts +6 -13
- package/lib/components/agent-preview-react.js +36 -100
- package/lib/components/agent-preview-react.js.map +1 -1
- package/lib/flags.d.ts +1 -0
- package/lib/flags.js +18 -0
- package/lib/flags.js.map +1 -1
- package/messages/agent.preview.md +9 -13
- package/oclif.manifest.json +88 -99
- package/package.json +4 -4
|
@@ -4,20 +4,20 @@ Interact with an agent to preview how it responds to your statements, questions,
|
|
|
4
4
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
|
-
Use this command to have a natural language conversation with an agent while you code its Agent Script file. Previewing an agent
|
|
7
|
+
Use this command to have a natural language conversation with an agent, either while you code its local Agent Script file or when it's published to an org. Previewing an agent acts like an initial test to make sure it responds to your utterances as you expect. For example, you can test that the agent uses a particular topic when asked a question, and then whether it invokes the correct action associated with that topic. This command is the CLI-equivalent of the Preview panel in your org's Agentforce Builder UI.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Run without flags, this command provides a list of agents to preview, divided into two categories: "Agent Script", which are agents that have a local authoring bundle in your DX project, or "Published", which are agents that are published and activated in your org. Authoring bundles contain an agent's Agent Script file. You then choose the agent you want to preview from the list. Or you can use the --authoring-bundle flag to specify a local authoring bundle's API name or --api-name to specify an activated published agent.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
When previewing an agent from its Agent Script file, you can use these two modes:
|
|
12
12
|
|
|
13
|
-
- Simulated mode (Default): Uses only the Agent Script file to converse, and it simulates (mocks) all the actions. Use this mode if none of the Apex classes, flows,
|
|
14
|
-
- Live mode: Uses the actual Apex classes, flows, and prompt templates in your development org in the agent preview. If you've changed the Apex classe, flows, or prompt templates in your local DX project, then you must deploy them to your development org if you want to use them in your live preview.
|
|
13
|
+
- Simulated mode (Default): Uses only the Agent Script file to converse, and it simulates (mocks) all the actions. Use this mode if none of the Apex classes, flows, or prompt templates that implement your actions are available yet. The LLM uses the information about topics in the Agent Script file to simulate what the action does or how it responds.
|
|
14
|
+
- Live mode: Uses the actual Apex classes, flows, and prompt templates in your development org in the agent preview. If you've changed the Apex classe, flows, or prompt templates in your local DX project, then you must deploy them to your development org if you want to use them in your live preview.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
You can use the Apex Replay Debugger to debug your Apex classes when using live mode for Agent Script files and for activated published agents; specify the --apex-debug flag.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
Once connected to your agent, the preview interface is simple: in the "Start typing..." prompt, enter a statement, question, or command; when you're done, enter Return. Your utterance is posted on the right along with a timestamp. The agent then responds on the left. To exit the conversation, hit ESC or Control+C.
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
When the session concludes, the command asks if you want to save the API responses and chat transcripts. By default, the files are saved to the "./temp/agent-preview" directory. Specify a new default directory with the --output-dir flag.
|
|
21
21
|
|
|
22
22
|
# flags.api-name.summary
|
|
23
23
|
|
|
@@ -27,10 +27,6 @@ API name of the published and active agent you want to interact with.
|
|
|
27
27
|
|
|
28
28
|
API name of the authoring bundle metadata component that contains the agent's Agent Script file.
|
|
29
29
|
|
|
30
|
-
# flags.client-app.summary
|
|
31
|
-
|
|
32
|
-
Name of the linked client app to use for the connection to the published and active agent.
|
|
33
|
-
|
|
34
30
|
# flags.output-dir.summary
|
|
35
31
|
|
|
36
32
|
Directory where conversation transcripts are saved.
|
|
@@ -45,7 +41,7 @@ Enable Apex debug logging during the agent preview conversation.
|
|
|
45
41
|
|
|
46
42
|
# examples
|
|
47
43
|
|
|
48
|
-
- Preview an agent
|
|
44
|
+
- Preview an agent by choosing from the list of available local Agent Script or published agents. If previewing a local Agent Script agent, use simulated mode. Use the org with alias "my-dev-org".
|
|
49
45
|
|
|
50
46
|
<%= config.bin %> <%= command.id %> --target-org my-dev-org
|
|
51
47
|
|
package/oclif.manifest.json
CHANGED
|
@@ -248,9 +248,9 @@
|
|
|
248
248
|
"agent:preview": {
|
|
249
249
|
"aliases": [],
|
|
250
250
|
"args": {},
|
|
251
|
-
"description": "Use this command to have a natural language conversation with an agent while you code its Agent Script file. Previewing an agent
|
|
251
|
+
"description": "Use this command to have a natural language conversation with an agent, either while you code its local Agent Script file or when it's published to an org. Previewing an agent acts like an initial test to make sure it responds to your utterances as you expect. For example, you can test that the agent uses a particular topic when asked a question, and then whether it invokes the correct action associated with that topic. This command is the CLI-equivalent of the Preview panel in your org's Agentforce Builder UI.\n\nRun without flags, this command provides a list of agents to preview, divided into two categories: \"Agent Script\", which are agents that have a local authoring bundle in your DX project, or \"Published\", which are agents that are published and activated in your org. Authoring bundles contain an agent's Agent Script file. You then choose the agent you want to preview from the list. Or you can use the --authoring-bundle flag to specify a local authoring bundle's API name or --api-name to specify an activated published agent.\n\nWhen previewing an agent from its Agent Script file, you can use these two modes:\n\n- Simulated mode (Default): Uses only the Agent Script file to converse, and it simulates (mocks) all the actions. Use this mode if none of the Apex classes, flows, or prompt templates that implement your actions are available yet. The LLM uses the information about topics in the Agent Script file to simulate what the action does or how it responds.\n- Live mode: Uses the actual Apex classes, flows, and prompt templates in your development org in the agent preview. If you've changed the Apex classe, flows, or prompt templates in your local DX project, then you must deploy them to your development org if you want to use them in your live preview.\n\nYou can use the Apex Replay Debugger to debug your Apex classes when using live mode for Agent Script files and for activated published agents; specify the --apex-debug flag.\n\nOnce connected to your agent, the preview interface is simple: in the \"Start typing...\" prompt, enter a statement, question, or command; when you're done, enter Return. Your utterance is posted on the right along with a timestamp. The agent then responds on the left. To exit the conversation, hit ESC or Control+C.\n\nWhen the session concludes, the command asks if you want to save the API responses and chat transcripts. By default, the files are saved to the \"./temp/agent-preview\" directory. Specify a new default directory with the --output-dir flag.",
|
|
252
252
|
"examples": [
|
|
253
|
-
"Preview an agent
|
|
253
|
+
"Preview an agent by choosing from the list of available local Agent Script or published agents. If previewing a local Agent Script agent, use simulated mode. Use the org with alias \"my-dev-org\".\n<%= config.bin %> <%= command.id %> --target-org my-dev-org",
|
|
254
254
|
"Preview an agent in live mode by choosing from a list of authoring bundles. Save the conversation transcripts to the \"./transcripts/my-preview\" directory, enable the Apex debug logs, and use your default org:\n<%= config.bin %> <%= command.id %> --use-live-actions --apex-debug --output-dir transcripts/my-preview"
|
|
255
255
|
],
|
|
256
256
|
"flags": {
|
|
@@ -279,17 +279,6 @@
|
|
|
279
279
|
"multiple": false,
|
|
280
280
|
"type": "option"
|
|
281
281
|
},
|
|
282
|
-
"client-app": {
|
|
283
|
-
"char": "c",
|
|
284
|
-
"dependsOn": [
|
|
285
|
-
"target-org"
|
|
286
|
-
],
|
|
287
|
-
"name": "client-app",
|
|
288
|
-
"summary": "Name of the linked client app to use for the connection to the published and active agent.",
|
|
289
|
-
"hasDynamicHelp": false,
|
|
290
|
-
"multiple": false,
|
|
291
|
-
"type": "option"
|
|
292
|
-
},
|
|
293
282
|
"api-name": {
|
|
294
283
|
"char": "n",
|
|
295
284
|
"name": "api-name",
|
|
@@ -892,6 +881,91 @@
|
|
|
892
881
|
"authoring-bundle:publish:agent"
|
|
893
882
|
]
|
|
894
883
|
},
|
|
884
|
+
"agent:validate:authoring-bundle": {
|
|
885
|
+
"aliases": [],
|
|
886
|
+
"args": {},
|
|
887
|
+
"description": "An authoring bundle is a metadata type (named aiAuthoringBundle) that provides the blueprint for an agent. The metadata type contains two files: the standard metatada XML file and an Agent Script file (extension \".agent\") that fully describes the agent using the Agent Script language.\n\nThis command validates that the Agent Script file in the authoring bundle compiles without errors so that you can later publish the bundle to your org. Use this command while you code the Agent Script file to ensure that it's valid. If the validation fails, the command outputs the list of syntax errors, a brief description of the error, and the location in the Agent Script file where the error occurred.\n\nThis command uses the API name of the authoring bundle. If you don't provide an API name with the --api-name flag, the command searches the current DX project and outputs a list of authoring bundles that it found for you to choose from.",
|
|
888
|
+
"examples": [
|
|
889
|
+
"Validate an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
|
|
890
|
+
"Validate an authoring bundle with API name MyAuthoringBundle; use the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --api-name MyAuthoringBundle --target-org my-dev-org"
|
|
891
|
+
],
|
|
892
|
+
"flags": {
|
|
893
|
+
"json": {
|
|
894
|
+
"description": "Format output as json.",
|
|
895
|
+
"helpGroup": "GLOBAL",
|
|
896
|
+
"name": "json",
|
|
897
|
+
"allowNo": false,
|
|
898
|
+
"type": "boolean"
|
|
899
|
+
},
|
|
900
|
+
"flags-dir": {
|
|
901
|
+
"helpGroup": "GLOBAL",
|
|
902
|
+
"name": "flags-dir",
|
|
903
|
+
"summary": "Import flag values from a directory.",
|
|
904
|
+
"hasDynamicHelp": false,
|
|
905
|
+
"multiple": false,
|
|
906
|
+
"type": "option"
|
|
907
|
+
},
|
|
908
|
+
"target-org": {
|
|
909
|
+
"char": "o",
|
|
910
|
+
"name": "target-org",
|
|
911
|
+
"noCacheDefault": true,
|
|
912
|
+
"required": true,
|
|
913
|
+
"summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
|
|
914
|
+
"hasDynamicHelp": true,
|
|
915
|
+
"multiple": false,
|
|
916
|
+
"type": "option"
|
|
917
|
+
},
|
|
918
|
+
"api-version": {
|
|
919
|
+
"description": "Override the api version used for api requests made by this command",
|
|
920
|
+
"name": "api-version",
|
|
921
|
+
"hasDynamicHelp": false,
|
|
922
|
+
"multiple": false,
|
|
923
|
+
"type": "option"
|
|
924
|
+
},
|
|
925
|
+
"api-name": {
|
|
926
|
+
"char": "n",
|
|
927
|
+
"name": "api-name",
|
|
928
|
+
"summary": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
|
|
929
|
+
"hasDynamicHelp": false,
|
|
930
|
+
"multiple": false,
|
|
931
|
+
"type": "option"
|
|
932
|
+
}
|
|
933
|
+
},
|
|
934
|
+
"hasDynamicHelp": true,
|
|
935
|
+
"hiddenAliases": [],
|
|
936
|
+
"id": "agent:validate:authoring-bundle",
|
|
937
|
+
"pluginAlias": "@salesforce/plugin-agent",
|
|
938
|
+
"pluginName": "@salesforce/plugin-agent",
|
|
939
|
+
"pluginType": "core",
|
|
940
|
+
"state": "beta",
|
|
941
|
+
"strict": true,
|
|
942
|
+
"summary": "Validate an authoring bundle to ensure its Agent Script file compiles successfully and can be used to publish an agent.",
|
|
943
|
+
"enableJsonFlag": true,
|
|
944
|
+
"requiresProject": true,
|
|
945
|
+
"FLAGGABLE_PROMPTS": {
|
|
946
|
+
"api-name": {
|
|
947
|
+
"message": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
|
|
948
|
+
"promptMessage": "API name of the authoring bundle to validate"
|
|
949
|
+
}
|
|
950
|
+
},
|
|
951
|
+
"isESM": true,
|
|
952
|
+
"relativePath": [
|
|
953
|
+
"lib",
|
|
954
|
+
"commands",
|
|
955
|
+
"agent",
|
|
956
|
+
"validate",
|
|
957
|
+
"authoring-bundle.js"
|
|
958
|
+
],
|
|
959
|
+
"aliasPermutations": [],
|
|
960
|
+
"permutations": [
|
|
961
|
+
"agent:validate:authoring-bundle",
|
|
962
|
+
"validate:agent:authoring-bundle",
|
|
963
|
+
"validate:authoring-bundle:agent",
|
|
964
|
+
"agent:authoring-bundle:validate",
|
|
965
|
+
"authoring-bundle:agent:validate",
|
|
966
|
+
"authoring-bundle:validate:agent"
|
|
967
|
+
]
|
|
968
|
+
},
|
|
895
969
|
"agent:test:create": {
|
|
896
970
|
"aliases": [],
|
|
897
971
|
"args": {},
|
|
@@ -1405,92 +1479,7 @@
|
|
|
1405
1479
|
"run:agent:test",
|
|
1406
1480
|
"run:test:agent"
|
|
1407
1481
|
]
|
|
1408
|
-
},
|
|
1409
|
-
"agent:validate:authoring-bundle": {
|
|
1410
|
-
"aliases": [],
|
|
1411
|
-
"args": {},
|
|
1412
|
-
"description": "An authoring bundle is a metadata type (named aiAuthoringBundle) that provides the blueprint for an agent. The metadata type contains two files: the standard metatada XML file and an Agent Script file (extension \".agent\") that fully describes the agent using the Agent Script language.\n\nThis command validates that the Agent Script file in the authoring bundle compiles without errors so that you can later publish the bundle to your org. Use this command while you code the Agent Script file to ensure that it's valid. If the validation fails, the command outputs the list of syntax errors, a brief description of the error, and the location in the Agent Script file where the error occurred.\n\nThis command uses the API name of the authoring bundle. If you don't provide an API name with the --api-name flag, the command searches the current DX project and outputs a list of authoring bundles that it found for you to choose from.",
|
|
1413
|
-
"examples": [
|
|
1414
|
-
"Validate an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
|
|
1415
|
-
"Validate an authoring bundle with API name MyAuthoringBundle; use the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --api-name MyAuthoringBundle --target-org my-dev-org"
|
|
1416
|
-
],
|
|
1417
|
-
"flags": {
|
|
1418
|
-
"json": {
|
|
1419
|
-
"description": "Format output as json.",
|
|
1420
|
-
"helpGroup": "GLOBAL",
|
|
1421
|
-
"name": "json",
|
|
1422
|
-
"allowNo": false,
|
|
1423
|
-
"type": "boolean"
|
|
1424
|
-
},
|
|
1425
|
-
"flags-dir": {
|
|
1426
|
-
"helpGroup": "GLOBAL",
|
|
1427
|
-
"name": "flags-dir",
|
|
1428
|
-
"summary": "Import flag values from a directory.",
|
|
1429
|
-
"hasDynamicHelp": false,
|
|
1430
|
-
"multiple": false,
|
|
1431
|
-
"type": "option"
|
|
1432
|
-
},
|
|
1433
|
-
"target-org": {
|
|
1434
|
-
"char": "o",
|
|
1435
|
-
"name": "target-org",
|
|
1436
|
-
"noCacheDefault": true,
|
|
1437
|
-
"required": true,
|
|
1438
|
-
"summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
|
|
1439
|
-
"hasDynamicHelp": true,
|
|
1440
|
-
"multiple": false,
|
|
1441
|
-
"type": "option"
|
|
1442
|
-
},
|
|
1443
|
-
"api-version": {
|
|
1444
|
-
"description": "Override the api version used for api requests made by this command",
|
|
1445
|
-
"name": "api-version",
|
|
1446
|
-
"hasDynamicHelp": false,
|
|
1447
|
-
"multiple": false,
|
|
1448
|
-
"type": "option"
|
|
1449
|
-
},
|
|
1450
|
-
"api-name": {
|
|
1451
|
-
"char": "n",
|
|
1452
|
-
"name": "api-name",
|
|
1453
|
-
"summary": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
|
|
1454
|
-
"hasDynamicHelp": false,
|
|
1455
|
-
"multiple": false,
|
|
1456
|
-
"type": "option"
|
|
1457
|
-
}
|
|
1458
|
-
},
|
|
1459
|
-
"hasDynamicHelp": true,
|
|
1460
|
-
"hiddenAliases": [],
|
|
1461
|
-
"id": "agent:validate:authoring-bundle",
|
|
1462
|
-
"pluginAlias": "@salesforce/plugin-agent",
|
|
1463
|
-
"pluginName": "@salesforce/plugin-agent",
|
|
1464
|
-
"pluginType": "core",
|
|
1465
|
-
"state": "beta",
|
|
1466
|
-
"strict": true,
|
|
1467
|
-
"summary": "Validate an authoring bundle to ensure its Agent Script file compiles successfully and can be used to publish an agent.",
|
|
1468
|
-
"enableJsonFlag": true,
|
|
1469
|
-
"requiresProject": true,
|
|
1470
|
-
"FLAGGABLE_PROMPTS": {
|
|
1471
|
-
"api-name": {
|
|
1472
|
-
"message": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
|
|
1473
|
-
"promptMessage": "API name of the authoring bundle to validate"
|
|
1474
|
-
}
|
|
1475
|
-
},
|
|
1476
|
-
"isESM": true,
|
|
1477
|
-
"relativePath": [
|
|
1478
|
-
"lib",
|
|
1479
|
-
"commands",
|
|
1480
|
-
"agent",
|
|
1481
|
-
"validate",
|
|
1482
|
-
"authoring-bundle.js"
|
|
1483
|
-
],
|
|
1484
|
-
"aliasPermutations": [],
|
|
1485
|
-
"permutations": [
|
|
1486
|
-
"agent:validate:authoring-bundle",
|
|
1487
|
-
"validate:agent:authoring-bundle",
|
|
1488
|
-
"validate:authoring-bundle:agent",
|
|
1489
|
-
"agent:authoring-bundle:validate",
|
|
1490
|
-
"authoring-bundle:agent:validate",
|
|
1491
|
-
"authoring-bundle:validate:agent"
|
|
1492
|
-
]
|
|
1493
1482
|
}
|
|
1494
1483
|
},
|
|
1495
|
-
"version": "1.26.
|
|
1484
|
+
"version": "1.26.7"
|
|
1496
1485
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-agent",
|
|
3
3
|
"description": "Commands to interact with Salesforce agents",
|
|
4
|
-
"version": "1.26.
|
|
4
|
+
"version": "1.26.7",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"@inquirer/prompts": "^7.10.1",
|
|
10
10
|
"@oclif/core": "^4",
|
|
11
11
|
"@oclif/multi-stage-output": "^0.8.29",
|
|
12
|
-
"@salesforce/agents": "^0.
|
|
12
|
+
"@salesforce/agents": "^0.21.1",
|
|
13
13
|
"@salesforce/core": "^8.24.3",
|
|
14
14
|
"@salesforce/kit": "^3.2.3",
|
|
15
15
|
"@salesforce/sf-plugins-core": "^12.2.6",
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
"exports": "./lib/index.js",
|
|
238
238
|
"type": "module",
|
|
239
239
|
"sfdx": {
|
|
240
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.26.
|
|
241
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.26.
|
|
240
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.26.7.crt",
|
|
241
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.26.7.sig"
|
|
242
242
|
}
|
|
243
243
|
}
|