@salesforce/plugin-agent 1.20.8 → 1.20.9

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 CHANGED
@@ -132,7 +132,7 @@ EXAMPLES
132
132
  $ sf agent create --agent-name "Resort Manager" --spec specs/resortManagerAgent.yaml --preview
133
133
  ```
134
134
 
135
- _See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.8/src/commands/agent/create.ts)_
135
+ _See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.9/src/commands/agent/create.ts)_
136
136
 
137
137
  ## `sf agent generate agent-spec`
138
138
 
@@ -237,7 +237,7 @@ EXAMPLES
237
237
  $ sf agent generate agent-spec --tone formal --agent-user resortmanager@myorg.com
238
238
  ```
239
239
 
240
- _See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.8/src/commands/agent/generate/agent-spec.ts)_
240
+ _See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.9/src/commands/agent/generate/agent-spec.ts)_
241
241
 
242
242
  ## `sf agent generate template`
243
243
 
@@ -285,7 +285,7 @@ EXAMPLES
285
285
  force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1
286
286
  ```
287
287
 
288
- _See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.8/src/commands/agent/generate/template.ts)_
288
+ _See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.9/src/commands/agent/generate/template.ts)_
289
289
 
290
290
  ## `sf agent generate test-spec`
291
291
 
@@ -343,7 +343,7 @@ EXAMPLES
343
343
  force-app//main/default/aiEvaluationDefinitions/Resort_Manager_Tests.aiEvaluationDefinition-meta.xml
344
344
  ```
345
345
 
346
- _See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.8/src/commands/agent/generate/test-spec.ts)_
346
+ _See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.9/src/commands/agent/generate/test-spec.ts)_
347
347
 
348
348
  ## `sf agent preview`
349
349
 
@@ -355,7 +355,7 @@ USAGE
355
355
 
356
356
  FLAGS
357
357
  -a, --connected-app-user=<value> (required) Username or alias of the connected app user that's configured with
358
- JWT-based access tokens to the agent.
358
+ web-based access tokens to the agent.
359
359
  -d, --output-dir=<value> Directory where conversation transcripts are saved.
360
360
  -n, --api-name=<value> API name of the agent you want to interact with.
361
361
  -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
@@ -386,40 +386,57 @@ DESCRIPTION
386
386
  Find the agent's API name in its main details page in your org's Agent page in Setup.
387
387
 
388
388
  Before you use this command, you must complete these steps:
389
+ -----------------------------------------------------------
389
390
 
390
391
  1. Create a connected app in your org as described in the "Create a Connected App" section here:
391
392
  https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#create-a-connected-app. Do these
392
- two additional steps:
393
+ four additional steps:
393
394
 
394
395
  a. When specifying the connected app's Callback URL, add this second callback URL on a new line:
395
- http://localhost:1717/OauthRedirect
396
+ "http://localhost:1717/OauthRedirect".
396
397
 
397
- b. Make note of the user that you specified as the "Run As" user when updating the Client Credentials Flow section.
398
+ b. When adding the scopes to the connected app, add "Manage user data via Web browsers (web)".
399
+
400
+ c. Ensure that the "Require Secret for Web Server Flow" option is not selected.
401
+
402
+ d. Make note of the user that you specified as the "Run As" user when updating the Client Credentials Flow section.
398
403
 
399
404
  2. Add the connected app to your agent as described in the "Add Connected App to Agent" section here:
400
405
  https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#add-connected-app-to-agent.
401
406
 
402
- 3. Using the username of the user you specified as the "Run As" user above, authorize your org using the JWT flow, as
403
- described in this document:
404
- https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_jwt_flow.htm.
407
+ 3. Copy the consumer key from your connected app as described in the "Obtain Credentials" section here:
408
+ https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#obtain-credentials.
409
+
410
+ 4. Set the "SFDX_AUTH_SCOPES" environment variable to "refresh_token sfap_api chatbot_api web api". This step ensures
411
+ that you get the specific OAuth scopes required by this command.
412
+
413
+ 5. Using the username of the user you specified as the "Run As" user above, authorize your org using the web server
414
+ flow, as described in this document:
415
+ https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_web_flow.htm.
416
+
417
+ IMPORTANT: You must use the "--client-id <CONNECTED-APP-CONSUMER-KEY>" flag of "org login web", where
418
+ CONNECTED-APP-CONSUMER-KEY is the consumer key you previously copied. This step ensures that the "org login web"
419
+ command uses your custom connected app, and not the default CLI connected app.
420
+
421
+ Press Enter to skip sharing the client secret.
405
422
 
406
- 4. When you run this command to interact with an agent, specify the username you authorized in the preceding step with
423
+ 6. When you run this command to interact with an agent, specify the username you authorized in the preceding step with
407
424
  the --connected-app-user (-a) flag.
408
425
 
409
426
  EXAMPLES
410
427
  Interact with an agent with API name "Resort_Manager" in the org with alias "my-org". Connect to your agent using
411
- the alias "my-jwt-user"; this alias must point to the username who is authorized using JWT:
428
+ the alias "my-agent-user"; this alias must point to the username who is authorized using the Web server flow:
412
429
 
413
- $ sf agent preview --api-name "Resort_Manager" --target-org my-org --connected-app-user my-jwt-user
430
+ $ sf agent preview --api-name "Resort_Manager" --target-org my-org --connected-app-user my-agent-user
414
431
 
415
432
  Same as the preceding example, but this time save the conversation transcripts to the "./transcripts/my-preview"
416
433
  directory rather than the default "./temp/agent-preview":
417
434
 
418
- $ sf agent preview --api-name "Resort_Manager" --target-org my-org --connected-app-user my-jwt-user --output-dir \
419
- "transcripts/my-preview"
435
+ $ sf agent preview --api-name "Resort_Manager" --target-org my-org --connected-app-user my-agent-user \
436
+ --output-dir "transcripts/my-preview"
420
437
  ```
421
438
 
422
- _See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.8/src/commands/agent/preview.ts)_
439
+ _See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.9/src/commands/agent/preview.ts)_
423
440
 
424
441
  ## `sf agent test create`
425
442
 
@@ -474,7 +491,7 @@ EXAMPLES
474
491
  $ sf agent test create --spec specs/Resort_Manager-testSpec.yaml --test-api-name Resort_Manager_Test --preview
475
492
  ```
476
493
 
477
- _See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.8/src/commands/agent/test/create.ts)_
494
+ _See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.9/src/commands/agent/test/create.ts)_
478
495
 
479
496
  ## `sf agent test list`
480
497
 
@@ -509,7 +526,7 @@ EXAMPLES
509
526
  $ sf agent test list --target-org my-org
510
527
  ```
511
528
 
512
- _See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.8/src/commands/agent/test/list.ts)_
529
+ _See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.9/src/commands/agent/test/list.ts)_
513
530
 
514
531
  ## `sf agent test results`
515
532
 
@@ -565,7 +582,7 @@ FLAG DESCRIPTIONS
565
582
  test results aren't written.
566
583
  ```
567
584
 
568
- _See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.8/src/commands/agent/test/results.ts)_
585
+ _See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.9/src/commands/agent/test/results.ts)_
569
586
 
570
587
  ## `sf agent test resume`
571
588
 
@@ -628,7 +645,7 @@ FLAG DESCRIPTIONS
628
645
  test results aren't written.
629
646
  ```
630
647
 
631
- _See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.8/src/commands/agent/test/resume.ts)_
648
+ _See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.9/src/commands/agent/test/resume.ts)_
632
649
 
633
650
  ## `sf agent test run`
634
651
 
@@ -692,6 +709,6 @@ FLAG DESCRIPTIONS
692
709
  test results aren't written.
693
710
  ```
694
711
 
695
- _See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.8/src/commands/agent/test/run.ts)_
712
+ _See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.9/src/commands/agent/test/run.ts)_
696
713
 
697
714
  <!-- commandsstop -->
@@ -13,18 +13,31 @@ When the session concludes, the command asks if you want to save the API respons
13
13
  Find the agent's API name in its main details page in your org's Agent page in Setup.
14
14
 
15
15
  Before you use this command, you must complete these steps:
16
+ -----------------------------------------------------------
16
17
 
17
- 1. Create a connected app in your org as described in the "Create a Connected App" section here: https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#create-a-connected-app. Do these two additional steps:
18
+ 1. Create a connected app in your org as described in the "Create a Connected App" section here: https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#create-a-connected-app. Do these four additional steps:
18
19
 
19
- a. When specifying the connected app's Callback URL, add this second callback URL on a new line: http://localhost:1717/OauthRedirect
20
+ a. When specifying the connected app's Callback URL, add this second callback URL on a new line: "http://localhost:1717/OauthRedirect".
20
21
 
21
- b. Make note of the user that you specified as the "Run As" user when updating the Client Credentials Flow section.
22
+ b. When adding the scopes to the connected app, add "Manage user data via Web browsers (web)".
23
+
24
+ c. Ensure that the "Require Secret for Web Server Flow" option is not selected.
25
+
26
+ d. Make note of the user that you specified as the "Run As" user when updating the Client Credentials Flow section.
22
27
 
23
28
  2. Add the connected app to your agent as described in the "Add Connected App to Agent" section here: https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#add-connected-app-to-agent.
24
29
 
25
- 3. Using the username of the user you specified as the "Run As" user above, authorize your org using the JWT flow, as described in this document: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_jwt_flow.htm.
30
+ 3. Copy the consumer key from your connected app as described in the "Obtain Credentials" section here: https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#obtain-credentials.
31
+
32
+ 4. Set the "SFDX_AUTH_SCOPES" environment variable to "refresh_token sfap_api chatbot_api web api". This step ensures that you get the specific OAuth scopes required by this command.
33
+
34
+ 5. Using the username of the user you specified as the "Run As" user above, authorize your org using the web server flow, as described in this document: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_web_flow.htm.
35
+
36
+ IMPORTANT: You must use the "--client-id <CONNECTED-APP-CONSUMER-KEY>" flag of "org login web", where CONNECTED-APP-CONSUMER-KEY is the consumer key you previously copied. This step ensures that the "org login web" command uses your custom connected app, and not the default CLI connected app.
37
+
38
+ Press Enter to skip sharing the client secret.
26
39
 
27
- 4. When you run this command to interact with an agent, specify the username you authorized in the preceding step with the --connected-app-user (-a) flag.
40
+ 6. When you run this command to interact with an agent, specify the username you authorized in the preceding step with the --connected-app-user (-a) flag.
28
41
 
29
42
  # flags.api-name.summary
30
43
 
@@ -32,7 +45,7 @@ API name of the agent you want to interact with.
32
45
 
33
46
  # flags.connected-app-user.summary
34
47
 
35
- Username or alias of the connected app user that's configured with JWT-based access tokens to the agent.
48
+ Username or alias of the connected app user that's configured with web-based access tokens to the agent.
36
49
 
37
50
  # flags.output-dir.summary
38
51
 
@@ -40,10 +53,10 @@ Directory where conversation transcripts are saved.
40
53
 
41
54
  # examples
42
55
 
43
- - Interact with an agent with API name "Resort_Manager" in the org with alias "my-org". Connect to your agent using the alias "my-jwt-user"; this alias must point to the username who is authorized using JWT:
56
+ - Interact with an agent with API name "Resort_Manager" in the org with alias "my-org". Connect to your agent using the alias "my-agent-user"; this alias must point to the username who is authorized using the Web server flow:
44
57
 
45
- <%= config.bin %> <%= command.id %> --api-name "Resort_Manager" --target-org my-org --connected-app-user my-jwt-user
58
+ <%= config.bin %> <%= command.id %> --api-name "Resort_Manager" --target-org my-org --connected-app-user my-agent-user
46
59
 
47
60
  - Same as the preceding example, but this time save the conversation transcripts to the "./transcripts/my-preview" directory rather than the default "./temp/agent-preview":
48
61
 
49
- <%= config.bin %> <%= command.id %> --api-name "Resort_Manager" --target-org my-org --connected-app-user my-jwt-user --output-dir "transcripts/my-preview"
62
+ <%= config.bin %> <%= command.id %> --api-name "Resort_Manager" --target-org my-org --connected-app-user my-agent-user --output-dir "transcripts/my-preview"
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-agent",
3
- "version": "1.20.8",
3
+ "version": "1.20.9",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@salesforce/plugin-agent",
9
- "version": "1.20.8",
9
+ "version": "1.20.9",
10
10
  "license": "BSD-3-Clause",
11
11
  "dependencies": {
12
12
  "@inquirer/core": "^10.1.6",
@@ -105,10 +105,10 @@
105
105
  "agent:preview": {
106
106
  "aliases": [],
107
107
  "args": {},
108
- "description": "Use this command to have a natural language conversation with an active agent in your org, as if you were an actual user. The 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\nThis command is useful to test if the agent 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 Conversation Preview panel in your org's Agent Builder UI.\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 by setting the environment variable \"SF_AGENT_PREVIEW_OUTPUT_DIR\" to the directory. Or you can pass the directory to the --output-dir flag.\n\nFind the agent's API name in its main details page in your org's Agent page in Setup.\n\nBefore you use this command, you must complete these steps:\n\n1. Create a connected app in your org as described in the \"Create a Connected App\" section here: https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#create-a-connected-app. Do these two additional steps:\n\n a. When specifying the connected app's Callback URL, add this second callback URL on a new line: http://localhost:1717/OauthRedirect\n\n b. Make note of the user that you specified as the \"Run As\" user when updating the Client Credentials Flow section.\n\n2. Add the connected app to your agent as described in the \"Add Connected App to Agent\" section here: https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#add-connected-app-to-agent.\n\n3. Using the username of the user you specified as the \"Run As\" user above, authorize your org using the JWT flow, as described in this document: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_jwt_flow.htm.\n\n4. When you run this command to interact with an agent, specify the username you authorized in the preceding step with the --connected-app-user (-a) flag.",
108
+ "description": "Use this command to have a natural language conversation with an active agent in your org, as if you were an actual user. The 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\nThis command is useful to test if the agent 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 Conversation Preview panel in your org's Agent Builder UI.\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 by setting the environment variable \"SF_AGENT_PREVIEW_OUTPUT_DIR\" to the directory. Or you can pass the directory to the --output-dir flag.\n\nFind the agent's API name in its main details page in your org's Agent page in Setup.\n\nBefore you use this command, you must complete these steps:\n-----------------------------------------------------------\n\n1. Create a connected app in your org as described in the \"Create a Connected App\" section here: https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#create-a-connected-app. Do these four additional steps:\n\n a. When specifying the connected app's Callback URL, add this second callback URL on a new line: \"http://localhost:1717/OauthRedirect\".\n\n b. When adding the scopes to the connected app, add \"Manage user data via Web browsers (web)\".\n\n c. Ensure that the \"Require Secret for Web Server Flow\" option is not selected.\n\n d. Make note of the user that you specified as the \"Run As\" user when updating the Client Credentials Flow section.\n\n2. Add the connected app to your agent as described in the \"Add Connected App to Agent\" section here: https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#add-connected-app-to-agent.\n\n3. Copy the consumer key from your connected app as described in the \"Obtain Credentials\" section here: https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#obtain-credentials.\n\n4. Set the \"SFDX_AUTH_SCOPES\" environment variable to \"refresh_token sfap_api chatbot_api web api\". This step ensures that you get the specific OAuth scopes required by this command.\n\n5. Using the username of the user you specified as the \"Run As\" user above, authorize your org using the web server flow, as described in this document: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_web_flow.htm.\n\n IMPORTANT: You must use the \"--client-id <CONNECTED-APP-CONSUMER-KEY>\" flag of \"org login web\", where CONNECTED-APP-CONSUMER-KEY is the consumer key you previously copied. This step ensures that the \"org login web\" command uses your custom connected app, and not the default CLI connected app.\n\n Press Enter to skip sharing the client secret.\n\n6. When you run this command to interact with an agent, specify the username you authorized in the preceding step with the --connected-app-user (-a) flag.",
109
109
  "examples": [
110
- "Interact with an agent with API name \"Resort_Manager\" in the org with alias \"my-org\". Connect to your agent using the alias \"my-jwt-user\"; this alias must point to the username who is authorized using JWT:\n<%= config.bin %> <%= command.id %> --api-name \"Resort_Manager\" --target-org my-org --connected-app-user my-jwt-user",
111
- "Same as the preceding example, but this time save the conversation transcripts to the \"./transcripts/my-preview\" directory rather than the default \"./temp/agent-preview\":\n<%= config.bin %> <%= command.id %> --api-name \"Resort_Manager\" --target-org my-org --connected-app-user my-jwt-user --output-dir \"transcripts/my-preview\""
110
+ "Interact with an agent with API name \"Resort_Manager\" in the org with alias \"my-org\". Connect to your agent using the alias \"my-agent-user\"; this alias must point to the username who is authorized using the Web server flow:\n<%= config.bin %> <%= command.id %> --api-name \"Resort_Manager\" --target-org my-org --connected-app-user my-agent-user",
111
+ "Same as the preceding example, but this time save the conversation transcripts to the \"./transcripts/my-preview\" directory rather than the default \"./temp/agent-preview\":\n<%= config.bin %> <%= command.id %> --api-name \"Resort_Manager\" --target-org my-org --connected-app-user my-agent-user --output-dir \"transcripts/my-preview\""
112
112
  ],
113
113
  "flags": {
114
114
  "flags-dir": {
@@ -141,7 +141,7 @@
141
141
  "name": "connected-app-user",
142
142
  "noCacheDefault": true,
143
143
  "required": true,
144
- "summary": "Username or alias of the connected app user that's configured with JWT-based access tokens to the agent.",
144
+ "summary": "Username or alias of the connected app user that's configured with web-based access tokens to the agent.",
145
145
  "hasDynamicHelp": true,
146
146
  "multiple": false,
147
147
  "type": "option"
@@ -1112,5 +1112,5 @@
1112
1112
  ]
1113
1113
  }
1114
1114
  },
1115
- "version": "1.20.8"
1115
+ "version": "1.20.9"
1116
1116
  }
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.20.8",
4
+ "version": "1.20.9",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/forcedotcom/cli/issues",
7
7
  "dependencies": {
@@ -229,7 +229,7 @@
229
229
  "exports": "./lib/index.js",
230
230
  "type": "module",
231
231
  "sfdx": {
232
- "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.20.8.crt",
233
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.20.8.sig"
232
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.20.9.crt",
233
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.20.9.sig"
234
234
  }
235
235
  }