@salesforce/plugin-agent 1.23.3 → 1.23.5
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 +17 -51
- package/messages/agent.preview.md +3 -25
- package/npm-shrinkwrap.json +2 -2
- package/oclif.manifest.json +4 -90
- package/package.json +3 -3
- package/lib/commands/agent/test/cancel.d.ts +0 -21
- package/lib/commands/agent/test/cancel.js +0 -49
- package/lib/commands/agent/test/cancel.js.map +0 -1
- package/messages/agent.test.cancel.md +0 -25
- package/schemas/agent-test-cancel.json +0 -25
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.23.
|
|
133
|
+
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.5/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.23.
|
|
238
|
+
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.5/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.23.
|
|
286
|
+
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.5/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.23.
|
|
344
|
+
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.5/src/commands/agent/generate/test-spec.ts)_
|
|
345
345
|
|
|
346
346
|
## `sf agent preview`
|
|
347
347
|
|
|
@@ -386,59 +386,25 @@ DESCRIPTION
|
|
|
386
386
|
|
|
387
387
|
Find the agent's API name in its main details page in your org's Agent page in Setup.
|
|
388
388
|
|
|
389
|
-
Before you use this command, you must complete
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
these additional steps:
|
|
394
|
-
|
|
395
|
-
a. When specifying the connected app's Callback URL, add this second callback URL on a new line:
|
|
396
|
-
"http://localhost:1717/OauthRedirect".
|
|
397
|
-
|
|
398
|
-
b. When adding the scopes to the connected app, add "Manage user data via Web browsers (web)".
|
|
399
|
-
|
|
400
|
-
2. Add the connected app to your agent as described in the "Add Connected App to Agent" section here:
|
|
401
|
-
https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#add-connected-app-to-agent.
|
|
402
|
-
|
|
403
|
-
3. Copy the consumer key from your connected app as described in the "Obtain Credentials" section here:
|
|
404
|
-
https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#obtain-credentials.
|
|
405
|
-
|
|
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:
|
|
414
|
-
|
|
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"
|
|
417
|
-
|
|
418
|
-
IMPORTANT: You must use the "--client-id <CONNECTED-APP-CONSUMER-KEY>" flag of "org login web", where
|
|
419
|
-
CONNECTED-APP-CONSUMER-KEY is the consumer key you previously copied. This step ensures that the "org login web"
|
|
420
|
-
command uses your custom connected app, and not the default CLI connected app.
|
|
421
|
-
|
|
422
|
-
6. Press Enter to skip sharing the client secret, then log in with your org username as usual and click Accept.
|
|
423
|
-
|
|
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.
|
|
389
|
+
IMPORTANT: Before you use this command, you must complete a number of configuration steps in your org and your DX
|
|
390
|
+
project. The examples in this help assume you've completed the steps. See "Preview an Agent" in the "Agentforce
|
|
391
|
+
Developer Guide" for complete documentation:
|
|
392
|
+
https://developer.salesforce.com/docs/einstein/genai/guide/agent-dx-preview.html.
|
|
427
393
|
|
|
428
394
|
EXAMPLES
|
|
429
395
|
Interact with an agent with API name "Resort_Manager" in the org with alias "my-org" and the linked "agent-app"
|
|
430
396
|
connected app:
|
|
431
397
|
|
|
432
|
-
$ sf agent preview --api-name
|
|
398
|
+
$ sf agent preview --api-name Resort_Manager --target-org my-org --client-app agent-app
|
|
433
399
|
|
|
434
400
|
Same as the preceding example, but this time save the conversation transcripts to the "./transcripts/my-preview"
|
|
435
401
|
directory rather than the default "./temp/agent-preview":
|
|
436
402
|
|
|
437
|
-
$ sf agent preview --api-name
|
|
438
|
-
|
|
403
|
+
$ sf agent preview --api-name Resort_Manager --target-org my-org --client-app agent-app --output-dir \
|
|
404
|
+
transcripts/my-preview
|
|
439
405
|
```
|
|
440
406
|
|
|
441
|
-
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.
|
|
407
|
+
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.5/src/commands/agent/preview.ts)_
|
|
442
408
|
|
|
443
409
|
## `sf agent test create`
|
|
444
410
|
|
|
@@ -493,7 +459,7 @@ EXAMPLES
|
|
|
493
459
|
$ sf agent test create --spec specs/Resort_Manager-testSpec.yaml --api-name Resort_Manager_Test --preview
|
|
494
460
|
```
|
|
495
461
|
|
|
496
|
-
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.
|
|
462
|
+
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.5/src/commands/agent/test/create.ts)_
|
|
497
463
|
|
|
498
464
|
## `sf agent test list`
|
|
499
465
|
|
|
@@ -528,7 +494,7 @@ EXAMPLES
|
|
|
528
494
|
$ sf agent test list --target-org my-org
|
|
529
495
|
```
|
|
530
496
|
|
|
531
|
-
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.
|
|
497
|
+
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.5/src/commands/agent/test/list.ts)_
|
|
532
498
|
|
|
533
499
|
## `sf agent test results`
|
|
534
500
|
|
|
@@ -584,7 +550,7 @@ FLAG DESCRIPTIONS
|
|
|
584
550
|
test results aren't written.
|
|
585
551
|
```
|
|
586
552
|
|
|
587
|
-
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.
|
|
553
|
+
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.5/src/commands/agent/test/results.ts)_
|
|
588
554
|
|
|
589
555
|
## `sf agent test resume`
|
|
590
556
|
|
|
@@ -647,7 +613,7 @@ FLAG DESCRIPTIONS
|
|
|
647
613
|
test results aren't written.
|
|
648
614
|
```
|
|
649
615
|
|
|
650
|
-
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.
|
|
616
|
+
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.5/src/commands/agent/test/resume.ts)_
|
|
651
617
|
|
|
652
618
|
## `sf agent test run`
|
|
653
619
|
|
|
@@ -711,6 +677,6 @@ FLAG DESCRIPTIONS
|
|
|
711
677
|
test results aren't written.
|
|
712
678
|
```
|
|
713
679
|
|
|
714
|
-
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.
|
|
680
|
+
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.23.5/src/commands/agent/test/run.ts)_
|
|
715
681
|
|
|
716
682
|
<!-- commandsstop -->
|
|
@@ -12,29 +12,7 @@ When the session concludes, the command asks if you want to save the API respons
|
|
|
12
12
|
|
|
13
13
|
Find the agent's API name in its main details page in your org's Agent page in Setup.
|
|
14
14
|
|
|
15
|
-
Before you use this command, you must complete
|
|
16
|
-
|
|
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
|
-
|
|
19
|
-
a. When specifying the connected app's Callback URL, add this second callback URL on a new line: "http://localhost:1717/OauthRedirect".
|
|
20
|
-
|
|
21
|
-
b. When adding the scopes to the connected app, add "Manage user data via Web browsers (web)".
|
|
22
|
-
|
|
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.
|
|
24
|
-
|
|
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.
|
|
26
|
-
|
|
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:
|
|
30
|
-
|
|
31
|
-
sf org login web --client-app agent-app --username <username> --client-id <consumer-key> --scopes "sfap_api chatbot_api refresh_token api web"
|
|
32
|
-
|
|
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.
|
|
34
|
-
|
|
35
|
-
6. Press Enter to skip sharing the client secret, then log in with your org username as usual and click Accept.
|
|
36
|
-
|
|
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.
|
|
15
|
+
IMPORTANT: Before you use this command, you must complete a number of configuration steps in your org and your DX project. The examples in this help assume you've completed the steps. See "Preview an Agent" in the "Agentforce Developer Guide" for complete documentation: https://developer.salesforce.com/docs/einstein/genai/guide/agent-dx-preview.html.
|
|
38
16
|
|
|
39
17
|
# flags.api-name.summary
|
|
40
18
|
|
|
@@ -56,8 +34,8 @@ Enable Apex debug logging during the agent preview conversation.
|
|
|
56
34
|
|
|
57
35
|
- Interact with an agent with API name "Resort_Manager" in the org with alias "my-org" and the linked "agent-app" connected app:
|
|
58
36
|
|
|
59
|
-
<%= config.bin %> <%= command.id %> --api-name
|
|
37
|
+
<%= config.bin %> <%= command.id %> --api-name Resort_Manager --target-org my-org --client-app agent-app
|
|
60
38
|
|
|
61
39
|
- 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":
|
|
62
40
|
|
|
63
|
-
<%= config.bin %> <%= command.id %> --api-name
|
|
41
|
+
<%= config.bin %> <%= command.id %> --api-name Resort_Manager --target-org my-org --client-app agent-app --output-dir transcripts/my-preview
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-agent",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.5",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@salesforce/plugin-agent",
|
|
9
|
-
"version": "1.23.
|
|
9
|
+
"version": "1.23.5",
|
|
10
10
|
"license": "BSD-3-Clause",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@inquirer/core": "^10.1.6",
|
package/oclif.manifest.json
CHANGED
|
@@ -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\
|
|
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\nIMPORTANT: Before you use this command, you must complete a number of configuration steps in your org and your DX project. The examples in this help assume you've completed the steps. See \"Preview an Agent\" in the \"Agentforce Developer Guide\" for complete documentation: https://developer.salesforce.com/docs/einstein/genai/guide/agent-dx-preview.html.",
|
|
108
108
|
"examples": [
|
|
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
|
|
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
|
|
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": {
|
|
@@ -532,92 +532,6 @@
|
|
|
532
532
|
"test-spec:generate:agent"
|
|
533
533
|
]
|
|
534
534
|
},
|
|
535
|
-
"agent:test:cancel": {
|
|
536
|
-
"aliases": [],
|
|
537
|
-
"args": {},
|
|
538
|
-
"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.",
|
|
539
|
-
"examples": [
|
|
540
|
-
"Cancel an agent test currently running in your default org using a job ID:\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ",
|
|
541
|
-
"Cancel the most recently run agent test in the org with alias \"my-org\":\n<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ --target-org my-org"
|
|
542
|
-
],
|
|
543
|
-
"flags": {
|
|
544
|
-
"json": {
|
|
545
|
-
"description": "Format output as json.",
|
|
546
|
-
"helpGroup": "GLOBAL",
|
|
547
|
-
"name": "json",
|
|
548
|
-
"allowNo": false,
|
|
549
|
-
"type": "boolean"
|
|
550
|
-
},
|
|
551
|
-
"flags-dir": {
|
|
552
|
-
"helpGroup": "GLOBAL",
|
|
553
|
-
"name": "flags-dir",
|
|
554
|
-
"summary": "Import flag values from a directory.",
|
|
555
|
-
"hasDynamicHelp": false,
|
|
556
|
-
"multiple": false,
|
|
557
|
-
"type": "option"
|
|
558
|
-
},
|
|
559
|
-
"target-org": {
|
|
560
|
-
"char": "o",
|
|
561
|
-
"name": "target-org",
|
|
562
|
-
"noCacheDefault": true,
|
|
563
|
-
"required": true,
|
|
564
|
-
"summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
|
|
565
|
-
"hasDynamicHelp": true,
|
|
566
|
-
"multiple": false,
|
|
567
|
-
"type": "option"
|
|
568
|
-
},
|
|
569
|
-
"api-version": {
|
|
570
|
-
"description": "Override the api version used for api requests made by this command",
|
|
571
|
-
"name": "api-version",
|
|
572
|
-
"hasDynamicHelp": false,
|
|
573
|
-
"multiple": false,
|
|
574
|
-
"type": "option"
|
|
575
|
-
},
|
|
576
|
-
"job-id": {
|
|
577
|
-
"char": "i",
|
|
578
|
-
"name": "job-id",
|
|
579
|
-
"summary": "Job ID of the running agent test that you want to cancel.",
|
|
580
|
-
"hasDynamicHelp": false,
|
|
581
|
-
"multiple": false,
|
|
582
|
-
"type": "option"
|
|
583
|
-
},
|
|
584
|
-
"use-most-recent": {
|
|
585
|
-
"char": "r",
|
|
586
|
-
"name": "use-most-recent",
|
|
587
|
-
"summary": "Use the job ID of the most recently-run agent test.",
|
|
588
|
-
"allowNo": false,
|
|
589
|
-
"type": "boolean"
|
|
590
|
-
}
|
|
591
|
-
},
|
|
592
|
-
"hasDynamicHelp": true,
|
|
593
|
-
"hidden": true,
|
|
594
|
-
"hiddenAliases": [],
|
|
595
|
-
"id": "agent:test:cancel",
|
|
596
|
-
"pluginAlias": "@salesforce/plugin-agent",
|
|
597
|
-
"pluginName": "@salesforce/plugin-agent",
|
|
598
|
-
"pluginType": "core",
|
|
599
|
-
"state": "beta",
|
|
600
|
-
"strict": true,
|
|
601
|
-
"summary": "Cancel an agent test that's currently running in your org.",
|
|
602
|
-
"enableJsonFlag": true,
|
|
603
|
-
"isESM": true,
|
|
604
|
-
"relativePath": [
|
|
605
|
-
"lib",
|
|
606
|
-
"commands",
|
|
607
|
-
"agent",
|
|
608
|
-
"test",
|
|
609
|
-
"cancel.js"
|
|
610
|
-
],
|
|
611
|
-
"aliasPermutations": [],
|
|
612
|
-
"permutations": [
|
|
613
|
-
"agent:test:cancel",
|
|
614
|
-
"test:agent:cancel",
|
|
615
|
-
"test:cancel:agent",
|
|
616
|
-
"agent:cancel:test",
|
|
617
|
-
"cancel:agent:test",
|
|
618
|
-
"cancel:test:agent"
|
|
619
|
-
]
|
|
620
|
-
},
|
|
621
535
|
"agent:test:create": {
|
|
622
536
|
"aliases": [],
|
|
623
537
|
"args": {},
|
|
@@ -1112,5 +1026,5 @@
|
|
|
1112
1026
|
]
|
|
1113
1027
|
}
|
|
1114
1028
|
},
|
|
1115
|
-
"version": "1.23.
|
|
1029
|
+
"version": "1.23.5"
|
|
1116
1030
|
}
|
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.23.
|
|
4
|
+
"version": "1.23.5",
|
|
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.23.
|
|
233
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.23.
|
|
232
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.23.5.crt",
|
|
233
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.23.5.sig"
|
|
234
234
|
}
|
|
235
235
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
export type AgentTestCancelResult = {
|
|
3
|
-
runId: string;
|
|
4
|
-
success: boolean;
|
|
5
|
-
errorCode?: string;
|
|
6
|
-
message?: string;
|
|
7
|
-
};
|
|
8
|
-
export default class AgentTestCancel extends SfCommand<AgentTestCancelResult> {
|
|
9
|
-
static readonly summary: string;
|
|
10
|
-
static readonly description: string;
|
|
11
|
-
static readonly examples: string[];
|
|
12
|
-
static readonly state = "beta";
|
|
13
|
-
static readonly hidden = true;
|
|
14
|
-
static readonly flags: {
|
|
15
|
-
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
-
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
-
'job-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
-
'use-most-recent': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
|
-
};
|
|
20
|
-
run(): Promise<AgentTestCancelResult>;
|
|
21
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2024, salesforce.com, inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* Licensed under the BSD 3-Clause license.
|
|
5
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
-
*/
|
|
7
|
-
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
8
|
-
import { Messages } from '@salesforce/core';
|
|
9
|
-
import { AgentTester } from '@salesforce/agents';
|
|
10
|
-
import { AgentTestCache } from '../../../agentTestCache.js';
|
|
11
|
-
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
12
|
-
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.test.cancel');
|
|
13
|
-
export default class AgentTestCancel extends SfCommand {
|
|
14
|
-
static summary = messages.getMessage('summary');
|
|
15
|
-
static description = messages.getMessage('description');
|
|
16
|
-
static examples = messages.getMessages('examples');
|
|
17
|
-
static state = 'beta';
|
|
18
|
-
static hidden = true;
|
|
19
|
-
static flags = {
|
|
20
|
-
'target-org': Flags.requiredOrg(),
|
|
21
|
-
'api-version': Flags.orgApiVersion(),
|
|
22
|
-
'job-id': Flags.string({
|
|
23
|
-
char: 'i',
|
|
24
|
-
summary: messages.getMessage('flags.job-id.summary'),
|
|
25
|
-
exactlyOne: ['use-most-recent', 'job-id'],
|
|
26
|
-
}),
|
|
27
|
-
'use-most-recent': Flags.boolean({
|
|
28
|
-
char: 'r',
|
|
29
|
-
summary: messages.getMessage('flags.use-most-recent.summary'),
|
|
30
|
-
exactlyOne: ['use-most-recent', 'job-id'],
|
|
31
|
-
}),
|
|
32
|
-
};
|
|
33
|
-
async run() {
|
|
34
|
-
const { flags } = await this.parse(AgentTestCancel);
|
|
35
|
-
const agentTestCache = await AgentTestCache.create();
|
|
36
|
-
const { runId } = agentTestCache.useIdOrMostRecent(flags['job-id'], flags['use-most-recent']);
|
|
37
|
-
this.log(`Canceling tests for AiEvaluation Job: ${runId}`);
|
|
38
|
-
const agentTester = new AgentTester(flags['target-org'].getConnection(flags['api-version']));
|
|
39
|
-
const result = await agentTester.cancel(runId);
|
|
40
|
-
if (result.success) {
|
|
41
|
-
await agentTestCache.removeCacheEntry(runId);
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
success: result.success,
|
|
45
|
-
runId,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=cancel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cancel.js","sourceRoot":"","sources":["../../../../src/commands/agent/test/cancel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,mBAAmB,CAAC,CAAC;AASxF,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,SAAgC;IACpE,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,CAAU,KAAK,GAAG,MAAM,CAAC;IAC/B,MAAM,CAAU,MAAM,GAAG,IAAI,CAAC;IAE9B,MAAM,CAAU,KAAK,GAAG;QAC7B,YAAY,EAAE,KAAK,CAAC,WAAW,EAAE;QACjC,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE;QACpC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC;YACrB,IAAI,EAAE,GAAG;YACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,sBAAsB,CAAC;YACpD,UAAU,EAAE,CAAC,iBAAiB,EAAE,QAAQ,CAAC;SAC1C,CAAC;QACF,iBAAiB,EAAE,KAAK,CAAC,OAAO,CAAC;YAC/B,IAAI,EAAE,GAAG;YACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,+BAA+B,CAAC;YAC7D,UAAU,EAAE,CAAC,iBAAiB,EAAE,QAAQ,CAAC;SAC1C,CAAC;KACH,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAEpD,MAAM,cAAc,GAAG,MAAM,cAAc,CAAC,MAAM,EAAE,CAAC;QACrD,MAAM,EAAE,KAAK,EAAE,GAAG,cAAc,CAAC,iBAAiB,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAE9F,IAAI,CAAC,GAAG,CAAC,yCAAyC,KAAK,EAAE,CAAC,CAAC;QAE3D,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QAC7F,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAE/C,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,MAAM,cAAc,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC/C,CAAC;QAED,OAAO;YACL,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,KAAK;SACN,CAAC;IACJ,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# summary
|
|
2
|
-
|
|
3
|
-
Cancel an agent test that's currently running in your org.
|
|
4
|
-
|
|
5
|
-
# description
|
|
6
|
-
|
|
7
|
-
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.
|
|
8
|
-
|
|
9
|
-
# flags.job-id.summary
|
|
10
|
-
|
|
11
|
-
Job ID of the running agent test that you want to cancel.
|
|
12
|
-
|
|
13
|
-
# flags.use-most-recent.summary
|
|
14
|
-
|
|
15
|
-
Use the job ID of the most recently-run agent test.
|
|
16
|
-
|
|
17
|
-
# examples
|
|
18
|
-
|
|
19
|
-
- Cancel an agent test currently running in your default org using a job ID:
|
|
20
|
-
|
|
21
|
-
<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ
|
|
22
|
-
|
|
23
|
-
- Cancel the most recently run agent test in the org with alias "my-org":
|
|
24
|
-
|
|
25
|
-
<%= config.bin %> <%= command.id %> --job-id 4KBfake0000003F4AQ --target-org my-org
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$ref": "#/definitions/AgentTestCancelResult",
|
|
4
|
-
"definitions": {
|
|
5
|
-
"AgentTestCancelResult": {
|
|
6
|
-
"type": "object",
|
|
7
|
-
"properties": {
|
|
8
|
-
"runId": {
|
|
9
|
-
"type": "string"
|
|
10
|
-
},
|
|
11
|
-
"success": {
|
|
12
|
-
"type": "boolean"
|
|
13
|
-
},
|
|
14
|
-
"errorCode": {
|
|
15
|
-
"type": "string"
|
|
16
|
-
},
|
|
17
|
-
"message": {
|
|
18
|
-
"type": "string"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"required": ["runId", "success"],
|
|
22
|
-
"additionalProperties": false
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|