@salesforce/plugin-agent 1.22.8 → 1.23.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.
package/README.md CHANGED
@@ -130,7 +130,7 @@ EXAMPLES
130
130
  $ sf agent create --name "Resort Manager" --spec specs/resortManagerAgent.yaml --preview
131
131
  ```
132
132
 
133
- _See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.22.8/src/commands/agent/create.ts)_
133
+ _See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.1/src/commands/agent/create.ts)_
134
134
 
135
135
  ## `sf agent generate agent-spec`
136
136
 
@@ -235,7 +235,7 @@ EXAMPLES
235
235
  $ sf agent generate agent-spec --tone formal --agent-user resortmanager@myorg.com
236
236
  ```
237
237
 
238
- _See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.22.8/src/commands/agent/generate/agent-spec.ts)_
238
+ _See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.1/src/commands/agent/generate/agent-spec.ts)_
239
239
 
240
240
  ## `sf agent generate template`
241
241
 
@@ -283,7 +283,7 @@ EXAMPLES
283
283
  force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1
284
284
  ```
285
285
 
286
- _See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.22.8/src/commands/agent/generate/template.ts)_
286
+ _See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.1/src/commands/agent/generate/template.ts)_
287
287
 
288
288
  ## `sf agent generate test-spec`
289
289
 
@@ -341,7 +341,7 @@ EXAMPLES
341
341
  force-app//main/default/aiEvaluationDefinitions/Resort_Manager_Tests.aiEvaluationDefinition-meta.xml
342
342
  ```
343
343
 
344
- _See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.22.8/src/commands/agent/generate/test-spec.ts)_
344
+ _See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.1/src/commands/agent/generate/test-spec.ts)_
345
345
 
346
346
  ## `sf agent preview`
347
347
 
@@ -349,18 +349,19 @@ Interact with an active agent to preview how the agent responds to your statemen
349
349
 
350
350
  ```
351
351
  USAGE
352
- $ sf agent preview -o <value> -a <value> [--flags-dir <value>] [--api-version <value>] [-n <value>] [-d <value>]
353
- [-x]
352
+ $ sf agent preview (-c <value> -o <value>) [--flags-dir <value>] [--api-version <value>] [-n <value>] [-d
353
+ <value>] [-x]
354
354
 
355
355
  FLAGS
356
- -a, --connected-app-user=<value> (required) Username or alias of the connected app user that's configured with
357
- web-based access tokens to the agent.
358
- -d, --output-dir=<value> Directory where conversation transcripts are saved.
359
- -n, --api-name=<value> API name of the agent you want to interact with.
360
- -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
361
- configuration variable is already set.
362
- -x, --apex-debug Enable Apex debug logging during the agent preview conversation.
363
- --api-version=<value> Override the api version used for api requests made by this command
356
+ -c, --client-app=<value> (required) Name of the linked client app to use for the agent connection. You must have
357
+ previously created this link with "org login web --client-app". Run "org display" to see
358
+ the available linked client apps.
359
+ -d, --output-dir=<value> Directory where conversation transcripts are saved.
360
+ -n, --api-name=<value> API name of the agent you want to interact with.
361
+ -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
362
+ configuration variable is already set.
363
+ -x, --apex-debug Enable Apex debug logging during the agent preview conversation.
364
+ --api-version=<value> Override the api version used for api requests made by this command
364
365
 
365
366
  GLOBAL FLAGS
366
367
  --flags-dir=<value> Import flag values from a directory.
@@ -387,55 +388,57 @@ DESCRIPTION
387
388
 
388
389
  Before you use this command, you must complete these steps:
389
390
 
390
- 1. Create a connected app in your org as described in the "Create a Connected App" section here:
391
- https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#create-a-connected-app. Do these
392
- four additional steps:
391
+ 1. Using your org's Setup UI, create a connected app in your org as described in the "Create a Connected App" section
392
+ here: https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#create-a-connected-app. Do
393
+ these 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
396
  "http://localhost:1717/OauthRedirect".
396
397
 
397
398
  b. When adding the scopes to the connected app, add "Manage user data via Web browsers (web)".
398
399
 
399
- c. Ensure that the "Require Secret for Web Server Flow" option is not selected.
400
-
401
- d. Make note of the user that you specified as the "Run As" user when updating the Client Credentials Flow section.
402
-
403
400
  2. Add the connected app to your agent as described in the "Add Connected App to Agent" section here:
404
401
  https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#add-connected-app-to-agent.
405
402
 
406
403
  3. Copy the consumer key from your connected app as described in the "Obtain Credentials" section here:
407
404
  https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#obtain-credentials.
408
405
 
409
- 4. Set the "SFDX_AUTH_SCOPES" environment variable to "refresh_token sfap_api chatbot_api web api". This step ensures
410
- that you get the specific OAuth scopes required by this command.
406
+ 4. If you haven't already, run the "org login web" CLI command as usual to authorize the development org that contains
407
+ the agent you want to preview.
408
+
409
+ 5. Re-run the "org web login" command to link the new connected app to your already-authenticated user. Use the
410
+ --client-app flag to give the link a name; you can specify any string, but make a note of it because you'll need it
411
+ later. Use --username to specify the username that you used to log into the org in the previous step. Use --client-id
412
+ to specify the consumer key you previously copied. Finally, use --scopes as indicated to specify the required API
413
+ scopes. Here's an example:
411
414
 
412
- 5. Using the username of the user you specified as the "Run As" user above, authorize your org using the web server
413
- flow, as described in this document:
414
- https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_web_flow.htm.
415
+ sf org login web --client-app agent-app --username <username> --client-id <consumer-key> --scopes "sfap_api
416
+ chatbot_api refresh_token api web"
415
417
 
416
418
  IMPORTANT: You must use the "--client-id <CONNECTED-APP-CONSUMER-KEY>" flag of "org login web", where
417
419
  CONNECTED-APP-CONSUMER-KEY is the consumer key you previously copied. This step ensures that the "org login web"
418
420
  command uses your custom connected app, and not the default CLI connected app.
419
421
 
420
- Press Enter to skip sharing the client secret.
422
+ 6. Press Enter to skip sharing the client secret, then log in with your org username as usual and click Accept.
421
423
 
422
- 6. When you run this command to interact with an agent, specify the username you authorized in the preceding step with
423
- the --connected-app-user (-a) flag.
424
+ 7. Run this command ("agent preview") to interact with an agent by using the --target-org flag to specify the org
425
+ username or alias as usual and --client-app to specify the linked connected app ("agent-app" in the previous example).
426
+ Use the "org display" command to get the list of client apps associated with an org.
424
427
 
425
428
  EXAMPLES
426
- Interact with an agent with API name "Resort_Manager" in the org with alias "my-org". Connect to your agent using
427
- the alias "my-agent-user"; this alias must point to the username who is authorized using the Web server flow:
429
+ Interact with an agent with API name "Resort_Manager" in the org with alias "my-org" and the linked "agent-app"
430
+ connected app:
428
431
 
429
- $ sf agent preview --api-name "Resort_Manager" --target-org my-org --connected-app-user my-agent-user
432
+ $ sf agent preview --api-name "Resort_Manager" --target-org my-org --client-app agent-app
430
433
 
431
434
  Same as the preceding example, but this time save the conversation transcripts to the "./transcripts/my-preview"
432
435
  directory rather than the default "./temp/agent-preview":
433
436
 
434
- $ sf agent preview --api-name "Resort_Manager" --target-org my-org --connected-app-user my-agent-user \
435
- --output-dir "transcripts/my-preview"
437
+ $ sf agent preview --api-name "Resort_Manager" --target-org my-org --client-app agent-app --output-dir \
438
+ "transcripts/my-preview"
436
439
  ```
437
440
 
438
- _See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.22.8/src/commands/agent/preview.ts)_
441
+ _See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.1/src/commands/agent/preview.ts)_
439
442
 
440
443
  ## `sf agent test create`
441
444
 
@@ -490,7 +493,7 @@ EXAMPLES
490
493
  $ sf agent test create --spec specs/Resort_Manager-testSpec.yaml --api-name Resort_Manager_Test --preview
491
494
  ```
492
495
 
493
- _See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.22.8/src/commands/agent/test/create.ts)_
496
+ _See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.1/src/commands/agent/test/create.ts)_
494
497
 
495
498
  ## `sf agent test list`
496
499
 
@@ -525,7 +528,7 @@ EXAMPLES
525
528
  $ sf agent test list --target-org my-org
526
529
  ```
527
530
 
528
- _See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.22.8/src/commands/agent/test/list.ts)_
531
+ _See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.1/src/commands/agent/test/list.ts)_
529
532
 
530
533
  ## `sf agent test results`
531
534
 
@@ -581,7 +584,7 @@ FLAG DESCRIPTIONS
581
584
  test results aren't written.
582
585
  ```
583
586
 
584
- _See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.22.8/src/commands/agent/test/results.ts)_
587
+ _See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.1/src/commands/agent/test/results.ts)_
585
588
 
586
589
  ## `sf agent test resume`
587
590
 
@@ -644,7 +647,7 @@ FLAG DESCRIPTIONS
644
647
  test results aren't written.
645
648
  ```
646
649
 
647
- _See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.22.8/src/commands/agent/test/resume.ts)_
650
+ _See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.1/src/commands/agent/test/resume.ts)_
648
651
 
649
652
  ## `sf agent test run`
650
653
 
@@ -708,6 +711,6 @@ FLAG DESCRIPTIONS
708
711
  test results aren't written.
709
712
  ```
710
713
 
711
- _See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.22.8/src/commands/agent/test/run.ts)_
714
+ _See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.1/src/commands/agent/test/run.ts)_
712
715
 
713
716
  <!-- commandsstop -->
@@ -30,7 +30,7 @@ export default class AgentPreview extends SfCommand<AgentPreviewResult> {
30
30
  static readonly flags: {
31
31
  'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
32
32
  'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
33
- 'connected-app-user': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
33
+ 'client-app': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
34
34
  'api-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
35
35
  'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
36
36
  'apex-debug': import("@oclif/core/interfaces").BooleanFlag<boolean>;
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { resolve, join } from 'node:path';
8
8
  import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
9
- import { Messages, SfError } from '@salesforce/core';
9
+ import { AuthInfo, Connection, Messages, SfError } from '@salesforce/core';
10
10
  import React from 'react';
11
11
  import { render } from 'ink';
12
12
  import { env } from '@salesforce/kit';
@@ -27,10 +27,11 @@ export default class AgentPreview extends SfCommand {
27
27
  static flags = {
28
28
  'target-org': Flags.requiredOrg(),
29
29
  'api-version': Flags.orgApiVersion(),
30
- 'connected-app-user': Flags.requiredOrg({
31
- summary: messages.getMessage('flags.connected-app-user.summary'),
32
- char: 'a',
30
+ 'client-app': Flags.string({
31
+ char: 'c',
32
+ summary: messages.getMessage('flags.client-app.summary'),
33
33
  required: true,
34
+ dependsOn: ['target-org'],
34
35
  }),
35
36
  'api-name': Flags.string({
36
37
  summary: messages.getMessage('flags.api-name.summary'),
@@ -49,7 +50,13 @@ export default class AgentPreview extends SfCommand {
49
50
  const { flags } = await this.parse(AgentPreview);
50
51
  const { 'api-name': apiNameFlag } = flags;
51
52
  const conn = flags['target-org'].getConnection(flags['api-version']);
52
- const apiConn = flags['connected-app-user'].getConnection(flags['api-version']);
53
+ const authInfo = await AuthInfo.create({
54
+ username: flags['target-org'].getUsername(),
55
+ });
56
+ const jwtConn = await Connection.create({
57
+ authInfo,
58
+ clientApp: flags['client-app'],
59
+ });
53
60
  const agentsQuery = await conn.query('SELECT Id, DeveloperName, (SELECT Status FROM BotVersions) FROM BotDefinition WHERE IsDeleted = false');
54
61
  if (agentsQuery.totalSize === 0)
55
62
  throw new SfError('No Agents found in the org');
@@ -68,7 +75,7 @@ export default class AgentPreview extends SfCommand {
68
75
  });
69
76
  }
70
77
  const outputDir = await resolveOutputDir(flags['output-dir'], flags['apex-debug']);
71
- const agentPreview = new Preview(apiConn, selectedAgent.Id);
78
+ const agentPreview = new Preview(jwtConn, selectedAgent.Id);
72
79
  agentPreview.toggleApexDebugMode(flags['apex-debug']);
73
80
  const instance = render(React.createElement(AgentPreviewReact, {
74
81
  connection: conn,
@@ -1 +1 @@
1
- {"version":3,"file":"preview.js","sourceRoot":"","sources":["../../../src/commands/agent/preview.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,YAAY,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,O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kB,CAAC,KAAK,CAAC,aAAa,CAAC;QAAE,QAAQ,GAAG,iBAAiB,CAAC;IAE1E,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,aAAa;QACzB,KAAK,EAAE;YACL,EAAE,EAAE,KAAK,CAAC,EAAE;YACZ,aAAa,EAAE,KAAK,CAAC,aAAa;SACnC;QACD,QAAQ;KACT,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EACnC,SAA6B,EAC7B,SAA8B,EACD,EAAE;IAC/B,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,QAAQ,GAAG,SAAS;YACxB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,MAAM,OAAO,CAAC;gBACZ,OAAO,EAAE,0CAA0C;gBACnD,OAAO,EAAE,IAAI;aACd,CAAC,CAAC;QAEP,MAAM,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,aAAa,CAAC;QAC7E,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC;gBACzB,OAAO,EAAE,kCAAkC,WAAW,EAAE;gBACxD,OAAO,EAAE,GAAG,CAAC,SAAS,CAAC,6BAA6B,EAAE,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;gBACpF,QAAQ,EAAE,IAAI;aACf,CAAC,CAAC;YAEH,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;AACH,CAAC,CAAC"}
@@ -14,37 +14,35 @@ Find the agent's API name in its main details page in your org's Agent page in S
14
14
 
15
15
  Before you use this command, you must complete these steps:
16
16
 
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 four additional steps:
17
+ 1. Using your org's Setup UI, 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 additional steps:
18
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
20
 
21
21
  b. When adding the scopes to the connected app, add "Manage user data via Web browsers (web)".
22
22
 
23
- c. Ensure that the "Require Secret for Web Server Flow" option is not selected.
24
-
25
- d. Make note of the user that you specified as the "Run As" user when updating the Client Credentials Flow section.
26
-
27
23
  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.
28
24
 
29
25
  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.
30
26
 
31
- 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.
27
+ 4. If you haven't already, run the "org login web" CLI command as usual to authorize the development org that contains the agent you want to preview.
28
+
29
+ 5. Re-run the "org web login" command to link the new connected app to your already-authenticated user. Use the --client-app flag to give the link a name; you can specify any string, but make a note of it because you'll need it later. Use --username to specify the username that you used to log into the org in the previous step. Use --client-id to specify the consumer key you previously copied. Finally, use --scopes as indicated to specify the required API scopes. Here's an example:
32
30
 
33
- 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.
31
+ sf org login web --client-app agent-app --username <username> --client-id <consumer-key> --scopes "sfap_api chatbot_api refresh_token api web"
34
32
 
35
- 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.
33
+ 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.
36
34
 
37
- Press Enter to skip sharing the client secret.
35
+ 6. Press Enter to skip sharing the client secret, then log in with your org username as usual and click Accept.
38
36
 
39
- 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.
37
+ 7. Run this command ("agent preview") to interact with an agent by using the --target-org flag to specify the org username or alias as usual and --client-app to specify the linked connected app ("agent-app" in the previous example). Use the "org display" command to get the list of client apps associated with an org.
40
38
 
41
39
  # flags.api-name.summary
42
40
 
43
41
  API name of the agent you want to interact with.
44
42
 
45
- # flags.connected-app-user.summary
43
+ # flags.client-app.summary
46
44
 
47
- Username or alias of the connected app user that's configured with web-based access tokens to the agent.
45
+ Name of the linked client app to use for the agent connection. You must have previously created this link with "org login web --client-app". Run "org display" to see the available linked client apps.
48
46
 
49
47
  # flags.output-dir.summary
50
48
 
@@ -56,10 +54,10 @@ Enable Apex debug logging during the agent preview conversation.
56
54
 
57
55
  # examples
58
56
 
59
- - 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:
57
+ - Interact with an agent with API name "Resort_Manager" in the org with alias "my-org" and the linked "agent-app" connected app:
60
58
 
61
- <%= config.bin %> <%= command.id %> --api-name "Resort_Manager" --target-org my-org --connected-app-user my-agent-user
59
+ <%= config.bin %> <%= command.id %> --api-name "Resort_Manager" --target-org my-org --client-app agent-app
62
60
 
63
61
  - 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":
64
62
 
65
- <%= config.bin %> <%= command.id %> --api-name "Resort_Manager" --target-org my-org --connected-app-user my-agent-user --output-dir "transcripts/my-preview"
63
+ <%= config.bin %> <%= command.id %> --api-name "Resort_Manager" --target-org my-org --client-app agent-app --output-dir "transcripts/my-preview"
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-agent",
3
- "version": "1.22.8",
3
+ "version": "1.23.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@salesforce/plugin-agent",
9
- "version": "1.22.8",
9
+ "version": "1.23.1",
10
10
  "license": "BSD-3-Clause",
11
11
  "dependencies": {
12
12
  "@inquirer/core": "^10.1.6",
13
13
  "@inquirer/prompts": "^7.2.0",
14
14
  "@oclif/core": "^4",
15
15
  "@oclif/multi-stage-output": "^0.7.12",
16
- "@salesforce/agents": "0.15.0",
17
- "@salesforce/core": "^8.10.2",
16
+ "@salesforce/agents": "0.15.3",
17
+ "@salesforce/core": "^8.13.0",
18
18
  "@salesforce/kit": "^3.2.3",
19
19
  "@salesforce/sf-plugins-core": "^12.2.0",
20
20
  "@salesforce/source-deploy-retrieve": "^12.19.3",
@@ -2860,9 +2860,9 @@
2860
2860
  }
2861
2861
  },
2862
2862
  "node_modules/@jsforce/jsforce-node": {
2863
- "version": "3.8.1",
2864
- "resolved": "https://registry.npmjs.org/@jsforce/jsforce-node/-/jsforce-node-3.8.1.tgz",
2865
- "integrity": "sha512-+IZZC7VfNjhkTyeAspBc4Z35Y5eAP0RIWQnyfKahsbY/aLjiFRIM9ejl1YbWbrbabf5ODFSUgBGmOiEYLW3f7Q==",
2863
+ "version": "3.8.2",
2864
+ "resolved": "https://registry.npmjs.org/@jsforce/jsforce-node/-/jsforce-node-3.8.2.tgz",
2865
+ "integrity": "sha512-ewaRr9JnZRW6I28C/TzUnv5p70zMrWsKCq2ovRW6X557/ikdfvA24F9k4cQXZnTG2lZLEfVn+WwdBGEtY7pPnQ==",
2866
2866
  "license": "MIT",
2867
2867
  "dependencies": {
2868
2868
  "@sindresorhus/is": "^4",
@@ -3556,9 +3556,9 @@
3556
3556
  "license": "MIT"
3557
3557
  },
3558
3558
  "node_modules/@salesforce/agents": {
3559
- "version": "0.15.0",
3560
- "resolved": "https://registry.npmjs.org/@salesforce/agents/-/agents-0.15.0.tgz",
3561
- "integrity": "sha512-chshRBql+Yxm68vl2vI3BlmJdIBvyxVcj9WqlXQ51XwtzIsC64JSXZ1maybf05tdLQQiq+y8Z+b9/Vn6bfzvyw==",
3559
+ "version": "0.15.3",
3560
+ "resolved": "https://registry.npmjs.org/@salesforce/agents/-/agents-0.15.3.tgz",
3561
+ "integrity": "sha512-M/wMK9ok2ytzf6ZV9DiQG+LKMoaXtoXheZKsxJVYJOxLcCL4SSy5IQNtXdqGbZ23TzbWdSBrp73WffIGWkD4Jw==",
3562
3562
  "license": "BSD-3-Clause",
3563
3563
  "dependencies": {
3564
3564
  "@salesforce/core": "^8.10.3",
@@ -3695,12 +3695,12 @@
3695
3695
  }
3696
3696
  },
3697
3697
  "node_modules/@salesforce/core": {
3698
- "version": "8.10.3",
3699
- "resolved": "https://registry.npmjs.org/@salesforce/core/-/core-8.10.3.tgz",
3700
- "integrity": "sha512-juqbU304TBrrjb8sZGw+QkeAJISKu4+v2XIMTCxGJoEjs4LLhsyI7/drxCUY+7FNye+veAGeJdn/PCxkKhSgcA==",
3698
+ "version": "8.13.0",
3699
+ "resolved": "https://registry.npmjs.org/@salesforce/core/-/core-8.13.0.tgz",
3700
+ "integrity": "sha512-FyAn0UGa93D0N++8poeJt7yEaWQH++qxrv/Wf4TjNaUCLoh19g57lrXuos3qDJPr8Ut4x6QjVxEc49XLy+vBkw==",
3701
3701
  "license": "BSD-3-Clause",
3702
3702
  "dependencies": {
3703
- "@jsforce/jsforce-node": "^3.8.1",
3703
+ "@jsforce/jsforce-node": "^3.8.2",
3704
3704
  "@salesforce/kit": "^3.2.2",
3705
3705
  "@salesforce/schemas": "^1.9.0",
3706
3706
  "@salesforce/ts-types": "^2.0.10",
@@ -3712,9 +3712,9 @@
3712
3712
  "js2xmlparser": "^4.0.1",
3713
3713
  "jsonwebtoken": "9.0.2",
3714
3714
  "jszip": "3.10.1",
3715
- "pino": "^9.4.0",
3715
+ "pino": "^9.7.0",
3716
3716
  "pino-abstract-transport": "^1.2.0",
3717
- "pino-pretty": "^11.2.2",
3717
+ "pino-pretty": "^11.3.0",
3718
3718
  "proper-lockfile": "^4.1.2",
3719
3719
  "semver": "^7.6.3",
3720
3720
  "ts-retry-promise": "^0.8.1"
@@ -13352,9 +13352,9 @@
13352
13352
  }
13353
13353
  },
13354
13354
  "node_modules/pino": {
13355
- "version": "9.6.0",
13356
- "resolved": "https://registry.npmjs.org/pino/-/pino-9.6.0.tgz",
13357
- "integrity": "sha512-i85pKRCt4qMjZ1+L7sy2Ag4t1atFcdbEt76+7iRJn1g2BvsnRMGu9p8pivl9fs63M2kF/A0OacFZhTub+m/qMg==",
13355
+ "version": "9.7.0",
13356
+ "resolved": "https://registry.npmjs.org/pino/-/pino-9.7.0.tgz",
13357
+ "integrity": "sha512-vnMCM6xZTb1WDmLvtG2lE/2p+t9hDEIvTWJsu6FejkE62vB7gDhvzrpFR4Cw2to+9JNQxVnkAKVPA1KPB98vWg==",
13358
13358
  "license": "MIT",
13359
13359
  "dependencies": {
13360
13360
  "atomic-sleep": "^1.0.0",
@@ -13362,7 +13362,7 @@
13362
13362
  "on-exit-leak-free": "^2.1.0",
13363
13363
  "pino-abstract-transport": "^2.0.0",
13364
13364
  "pino-std-serializers": "^7.0.0",
13365
- "process-warning": "^4.0.0",
13365
+ "process-warning": "^5.0.0",
13366
13366
  "quick-format-unescaped": "^4.0.3",
13367
13367
  "real-require": "^0.2.0",
13368
13368
  "safe-stable-stringify": "^2.3.1",
@@ -13614,9 +13614,9 @@
13614
13614
  }
13615
13615
  },
13616
13616
  "node_modules/process-warning": {
13617
- "version": "4.0.1",
13618
- "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-4.0.1.tgz",
13619
- "integrity": "sha512-3c2LzQ3rY9d0hc1emcsHhfT9Jwz0cChib/QN89oME2R451w5fy3f0afAhERFZAwrbDU43wk12d0ORBpDVME50Q==",
13617
+ "version": "5.0.0",
13618
+ "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-5.0.0.tgz",
13619
+ "integrity": "sha512-a39t9ApHNx2L4+HBnQKqxxHNs1r7KF+Intd8Q/g1bUh6q0WIp9voPXJ/x0j+ZL45KF1pJd9+q2jLIRMfvEshkA==",
13620
13620
  "funding": [
13621
13621
  {
13622
13622
  "type": "github",
package/oclif.lock CHANGED
@@ -1271,10 +1271,10 @@
1271
1271
  "@jridgewell/resolve-uri" "^3.1.0"
1272
1272
  "@jridgewell/sourcemap-codec" "^1.4.14"
1273
1273
 
1274
- "@jsforce/jsforce-node@^3.8.1":
1275
- version "3.8.1"
1276
- resolved "https://registry.yarnpkg.com/@jsforce/jsforce-node/-/jsforce-node-3.8.1.tgz#482fcf2820b48a6b10930d33550eb4e4cbd1e480"
1277
- integrity sha512-+IZZC7VfNjhkTyeAspBc4Z35Y5eAP0RIWQnyfKahsbY/aLjiFRIM9ejl1YbWbrbabf5ODFSUgBGmOiEYLW3f7Q==
1274
+ "@jsforce/jsforce-node@^3.8.2":
1275
+ version "3.8.2"
1276
+ resolved "https://registry.yarnpkg.com/@jsforce/jsforce-node/-/jsforce-node-3.8.2.tgz#68b903f6733ae479086ab02ea4a2de87a7f208eb"
1277
+ integrity sha512-ewaRr9JnZRW6I28C/TzUnv5p70zMrWsKCq2ovRW6X557/ikdfvA24F9k4cQXZnTG2lZLEfVn+WwdBGEtY7pPnQ==
1278
1278
  dependencies:
1279
1279
  "@sindresorhus/is" "^4"
1280
1280
  base64url "^3.0.1"
@@ -1443,10 +1443,10 @@
1443
1443
  resolved "https://registry.yarnpkg.com/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8"
1444
1444
  integrity sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==
1445
1445
 
1446
- "@salesforce/agents@0.15.0":
1447
- version "0.15.0"
1448
- resolved "https://registry.yarnpkg.com/@salesforce/agents/-/agents-0.15.0.tgz#0cec640cef0f02714bfa8cf842239c9d00e6ca15"
1449
- integrity sha512-chshRBql+Yxm68vl2vI3BlmJdIBvyxVcj9WqlXQ51XwtzIsC64JSXZ1maybf05tdLQQiq+y8Z+b9/Vn6bfzvyw==
1446
+ "@salesforce/agents@0.15.3":
1447
+ version "0.15.3"
1448
+ resolved "https://registry.yarnpkg.com/@salesforce/agents/-/agents-0.15.3.tgz#1a0936e6908e36459dcee1471fda13b3d560b5d1"
1449
+ integrity sha512-M/wMK9ok2ytzf6ZV9DiQG+LKMoaXtoXheZKsxJVYJOxLcCL4SSy5IQNtXdqGbZ23TzbWdSBrp73WffIGWkD4Jw==
1450
1450
  dependencies:
1451
1451
  "@salesforce/core" "^8.10.3"
1452
1452
  "@salesforce/kit" "^3.2.3"
@@ -1472,12 +1472,12 @@
1472
1472
  strip-ansi "6.0.1"
1473
1473
  ts-retry-promise "^0.8.1"
1474
1474
 
1475
- "@salesforce/core@^8.10.0", "@salesforce/core@^8.10.2", "@salesforce/core@^8.10.3", "@salesforce/core@^8.5.1", "@salesforce/core@^8.8.0", "@salesforce/core@^8.8.5":
1476
- version "8.10.3"
1477
- resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-8.10.3.tgz#3cc2c99d097757cb4b08dab921254cfa3a00c7c1"
1478
- integrity sha512-juqbU304TBrrjb8sZGw+QkeAJISKu4+v2XIMTCxGJoEjs4LLhsyI7/drxCUY+7FNye+veAGeJdn/PCxkKhSgcA==
1475
+ "@salesforce/core@^8.10.0", "@salesforce/core@^8.10.3", "@salesforce/core@^8.13.0", "@salesforce/core@^8.5.1", "@salesforce/core@^8.8.0", "@salesforce/core@^8.8.5":
1476
+ version "8.13.0"
1477
+ resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-8.13.0.tgz#ffc00a776c60a401d4385abfeb6cd7fee0d90f3b"
1478
+ integrity sha512-FyAn0UGa93D0N++8poeJt7yEaWQH++qxrv/Wf4TjNaUCLoh19g57lrXuos3qDJPr8Ut4x6QjVxEc49XLy+vBkw==
1479
1479
  dependencies:
1480
- "@jsforce/jsforce-node" "^3.8.1"
1480
+ "@jsforce/jsforce-node" "^3.8.2"
1481
1481
  "@salesforce/kit" "^3.2.2"
1482
1482
  "@salesforce/schemas" "^1.9.0"
1483
1483
  "@salesforce/ts-types" "^2.0.10"
@@ -1489,9 +1489,9 @@
1489
1489
  js2xmlparser "^4.0.1"
1490
1490
  jsonwebtoken "9.0.2"
1491
1491
  jszip "3.10.1"
1492
- pino "^9.4.0"
1492
+ pino "^9.7.0"
1493
1493
  pino-abstract-transport "^1.2.0"
1494
- pino-pretty "^11.2.2"
1494
+ pino-pretty "^11.3.0"
1495
1495
  proper-lockfile "^4.1.2"
1496
1496
  semver "^7.6.3"
1497
1497
  ts-retry-promise "^0.8.1"
@@ -6985,7 +6985,7 @@ pino-abstract-transport@^2.0.0:
6985
6985
  dependencies:
6986
6986
  split2 "^4.0.0"
6987
6987
 
6988
- pino-pretty@^11.2.2:
6988
+ pino-pretty@^11.3.0:
6989
6989
  version "11.3.0"
6990
6990
  resolved "https://registry.yarnpkg.com/pino-pretty/-/pino-pretty-11.3.0.tgz#390b3be044cf3d2e9192c7d19d44f6b690468f2e"
6991
6991
  integrity sha512-oXwn7ICywaZPHmu3epHGU2oJX4nPmKvHvB/bwrJHlGcbEWaVcotkpyVHMKLKmiVryWYByNp0jpgAcXpFJDXJzA==
@@ -7010,17 +7010,17 @@ pino-std-serializers@^7.0.0:
7010
7010
  resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-7.0.0.tgz#7c625038b13718dbbd84ab446bd673dc52259e3b"
7011
7011
  integrity sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==
7012
7012
 
7013
- pino@^9.4.0:
7014
- version "9.6.0"
7015
- resolved "https://registry.yarnpkg.com/pino/-/pino-9.6.0.tgz#6bc628159ba0cc81806d286718903b7fc6b13169"
7016
- integrity sha512-i85pKRCt4qMjZ1+L7sy2Ag4t1atFcdbEt76+7iRJn1g2BvsnRMGu9p8pivl9fs63M2kF/A0OacFZhTub+m/qMg==
7013
+ pino@^9.7.0:
7014
+ version "9.7.0"
7015
+ resolved "https://registry.yarnpkg.com/pino/-/pino-9.7.0.tgz#ff7cd86eb3103ee620204dbd5ca6ffda8b53f645"
7016
+ integrity sha512-vnMCM6xZTb1WDmLvtG2lE/2p+t9hDEIvTWJsu6FejkE62vB7gDhvzrpFR4Cw2to+9JNQxVnkAKVPA1KPB98vWg==
7017
7017
  dependencies:
7018
7018
  atomic-sleep "^1.0.0"
7019
7019
  fast-redact "^3.1.1"
7020
7020
  on-exit-leak-free "^2.1.0"
7021
7021
  pino-abstract-transport "^2.0.0"
7022
7022
  pino-std-serializers "^7.0.0"
7023
- process-warning "^4.0.0"
7023
+ process-warning "^5.0.0"
7024
7024
  quick-format-unescaped "^4.0.3"
7025
7025
  real-require "^0.2.0"
7026
7026
  safe-stable-stringify "^2.3.1"
@@ -7079,10 +7079,10 @@ process-on-spawn@^1.0.0:
7079
7079
  dependencies:
7080
7080
  fromentries "^1.2.0"
7081
7081
 
7082
- process-warning@^4.0.0:
7083
- version "4.0.1"
7084
- resolved "https://registry.yarnpkg.com/process-warning/-/process-warning-4.0.1.tgz#5c1db66007c67c756e4e09eb170cdece15da32fb"
7085
- integrity sha512-3c2LzQ3rY9d0hc1emcsHhfT9Jwz0cChib/QN89oME2R451w5fy3f0afAhERFZAwrbDU43wk12d0ORBpDVME50Q==
7082
+ process-warning@^5.0.0:
7083
+ version "5.0.0"
7084
+ resolved "https://registry.yarnpkg.com/process-warning/-/process-warning-5.0.0.tgz#566e0bf79d1dff30a72d8bbbe9e8ecefe8d378d7"
7085
+ integrity sha512-a39t9ApHNx2L4+HBnQKqxxHNs1r7KF+Intd8Q/g1bUh6q0WIp9voPXJ/x0j+ZL45KF1pJd9+q2jLIRMfvEshkA==
7086
7086
 
7087
7087
  process@^0.11.10:
7088
7088
  version "0.11.10"
@@ -104,10 +104,10 @@
104
104
  "agent:preview": {
105
105
  "aliases": [],
106
106
  "args": {},
107
- "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 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.",
107
+ "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. Using your org's Setup UI, 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 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\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. If you haven't already, run the \"org login web\" CLI command as usual to authorize the development org that contains the agent you want to preview.\n\n5. Re-run the \"org web login\" command to link the new connected app to your already-authenticated user. Use the --client-app flag to give the link a name; you can specify any string, but make a note of it because you'll need it later. Use --username to specify the username that you used to log into the org in the previous step. Use --client-id to specify the consumer key you previously copied. Finally, use --scopes as indicated to specify the required API scopes. Here's an example:\n\nsf org login web --client-app agent-app --username <username> --client-id <consumer-key> --scopes \"sfap_api chatbot_api refresh_token api web\"\n\nIMPORTANT: 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\n6. Press Enter to skip sharing the client secret, then log in with your org username as usual and click Accept.\n\n7. Run this command (\"agent preview\") to interact with an agent by using the --target-org flag to specify the org username or alias as usual and --client-app to specify the linked connected app (\"agent-app\" in the previous example). Use the \"org display\" command to get the list of client apps associated with an org.",
108
108
  "examples": [
109
- "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",
110
- "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\""
109
+ "Interact with an agent with API name \"Resort_Manager\" in the org with alias \"my-org\" and the linked \"agent-app\" connected app:\n<%= config.bin %> <%= command.id %> --api-name \"Resort_Manager\" --target-org my-org --client-app agent-app",
110
+ "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 --client-app agent-app --output-dir \"transcripts/my-preview\""
111
111
  ],
112
112
  "flags": {
113
113
  "flags-dir": {
@@ -135,13 +135,15 @@
135
135
  "multiple": false,
136
136
  "type": "option"
137
137
  },
138
- "connected-app-user": {
139
- "char": "a",
140
- "name": "connected-app-user",
141
- "noCacheDefault": true,
138
+ "client-app": {
139
+ "char": "c",
140
+ "dependsOn": [
141
+ "target-org"
142
+ ],
143
+ "name": "client-app",
142
144
  "required": true,
143
- "summary": "Username or alias of the connected app user that's configured with web-based access tokens to the agent.",
144
- "hasDynamicHelp": true,
145
+ "summary": "Name of the linked client app to use for the agent connection. You must have previously created this link with \"org login web --client-app\". Run \"org display\" to see the available linked client apps.",
146
+ "hasDynamicHelp": false,
145
147
  "multiple": false,
146
148
  "type": "option"
147
149
  },
@@ -1110,5 +1112,5 @@
1110
1112
  ]
1111
1113
  }
1112
1114
  },
1113
- "version": "1.22.8"
1115
+ "version": "1.23.1"
1114
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.22.8",
4
+ "version": "1.23.1",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/forcedotcom/cli/issues",
7
7
  "dependencies": {
@@ -9,8 +9,8 @@
9
9
  "@inquirer/prompts": "^7.2.0",
10
10
  "@oclif/core": "^4",
11
11
  "@oclif/multi-stage-output": "^0.7.12",
12
- "@salesforce/agents": "0.15.0",
13
- "@salesforce/core": "^8.10.2",
12
+ "@salesforce/agents": "0.15.3",
13
+ "@salesforce/core": "^8.13.0",
14
14
  "@salesforce/kit": "^3.2.3",
15
15
  "@salesforce/sf-plugins-core": "^12.2.0",
16
16
  "@salesforce/source-deploy-retrieve": "^12.19.3",
@@ -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.22.8.crt",
233
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.22.8.sig"
232
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.23.1.crt",
233
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.23.1.sig"
234
234
  }
235
235
  }