@salesforce/plugin-agent 1.24.14-demo.2 → 1.24.14-demo.3
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 +30 -29
- package/lib/commands/agent/generate/authoring-bundle.d.ts +2 -2
- package/lib/commands/agent/generate/authoring-bundle.js +58 -19
- package/lib/commands/agent/generate/authoring-bundle.js.map +1 -1
- package/lib/commands/agent/preview.d.ts +1 -2
- package/lib/commands/agent/preview.js +4 -3
- package/lib/commands/agent/preview.js.map +1 -1
- package/lib/commands/agent/publish/authoring-bundle.d.ts +2 -2
- package/lib/commands/agent/publish/authoring-bundle.js +24 -7
- package/lib/commands/agent/publish/authoring-bundle.js.map +1 -1
- package/lib/commands/agent/validate/authoring-bundle.d.ts +2 -2
- package/lib/commands/agent/validate/authoring-bundle.js +60 -9
- package/lib/commands/agent/validate/authoring-bundle.js.map +1 -1
- package/lib/flags.d.ts +1 -0
- package/lib/flags.js +12 -1
- package/lib/flags.js.map +1 -1
- package/messages/agent.generate.authoring-bundle.md +12 -4
- package/messages/agent.preview.md +1 -1
- package/messages/agent.publish.authoring-bundle.md +8 -4
- package/messages/agent.validate.authoring-bundle.md +8 -4
- package/oclif.manifest.json +105 -89
- package/package.json +4 -4
- package/schemas/agent-generate-authoring__bundle.json +2 -2
package/README.md
CHANGED
|
@@ -112,7 +112,7 @@ EXAMPLES
|
|
|
112
112
|
$ sf agent activate --api-name Resort_Manager --target-org my-org
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
-
_See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.
|
|
115
|
+
_See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.3/src/commands/agent/activate.ts)_
|
|
116
116
|
|
|
117
117
|
## `sf agent create`
|
|
118
118
|
|
|
@@ -174,7 +174,7 @@ EXAMPLES
|
|
|
174
174
|
$ sf agent create --name "Resort Manager" --spec specs/resortManagerAgent.yaml --preview
|
|
175
175
|
```
|
|
176
176
|
|
|
177
|
-
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.
|
|
177
|
+
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.3/src/commands/agent/create.ts)_
|
|
178
178
|
|
|
179
179
|
## `sf agent deactivate`
|
|
180
180
|
|
|
@@ -214,7 +214,7 @@ EXAMPLES
|
|
|
214
214
|
$ sf agent deactivate --api-name Resort_Manager --target-org my-org
|
|
215
215
|
```
|
|
216
216
|
|
|
217
|
-
_See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.
|
|
217
|
+
_See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.3/src/commands/agent/deactivate.ts)_
|
|
218
218
|
|
|
219
219
|
## `sf agent generate agent-spec`
|
|
220
220
|
|
|
@@ -319,7 +319,7 @@ EXAMPLES
|
|
|
319
319
|
$ sf agent generate agent-spec --tone formal --agent-user resortmanager@myorg.com
|
|
320
320
|
```
|
|
321
321
|
|
|
322
|
-
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.
|
|
322
|
+
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.3/src/commands/agent/generate/agent-spec.ts)_
|
|
323
323
|
|
|
324
324
|
## `sf agent generate authoring-bundle`
|
|
325
325
|
|
|
@@ -327,15 +327,17 @@ Generate an authoring bundle from an agent specification.
|
|
|
327
327
|
|
|
328
328
|
```
|
|
329
329
|
USAGE
|
|
330
|
-
$ sf agent generate authoring-bundle -o <value> [--json] [--flags-dir <value>] [--api-
|
|
331
|
-
[-n <value>]
|
|
330
|
+
$ sf agent generate authoring-bundle -o <value> [--json] [--flags-dir <value>] [--api-name <value>] [--api-version <value>] [-f
|
|
331
|
+
<value>] [-d <value>] [-n <value>]
|
|
332
332
|
|
|
333
333
|
FLAGS
|
|
334
334
|
-d, --output-dir=<value> Directory where the authoring bundle files will be generated.
|
|
335
335
|
-f, --spec=<value> Path to the agent specification file.
|
|
336
|
-
-n, --name=<value> Name (label) of the authoring bundle.
|
|
336
|
+
-n, --name=<value> Name (label) of the authoring bundle.
|
|
337
337
|
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
338
338
|
configuration variable is already set.
|
|
339
|
+
--api-name=<value> API name of the new authoring bundle; if not specified, the API name is derived from the
|
|
340
|
+
authoring bundle name (label); the API name must not exist in the org.
|
|
339
341
|
--api-version=<value> Override the api version used for api requests made by this command
|
|
340
342
|
|
|
341
343
|
GLOBAL FLAGS
|
|
@@ -345,7 +347,7 @@ GLOBAL FLAGS
|
|
|
345
347
|
DESCRIPTION
|
|
346
348
|
Generate an authoring bundle from an agent specification.
|
|
347
349
|
|
|
348
|
-
Generates an authoring bundle containing
|
|
350
|
+
Generates an authoring bundle containing Agent and its meta.xml file from an agent specification file.
|
|
349
351
|
|
|
350
352
|
EXAMPLES
|
|
351
353
|
Generate an authoring bundle from a specification file:
|
|
@@ -358,7 +360,7 @@ EXAMPLES
|
|
|
358
360
|
path/to/output
|
|
359
361
|
```
|
|
360
362
|
|
|
361
|
-
_See code: [src/commands/agent/generate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.
|
|
363
|
+
_See code: [src/commands/agent/generate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.3/src/commands/agent/generate/authoring-bundle.ts)_
|
|
362
364
|
|
|
363
365
|
## `sf agent generate template`
|
|
364
366
|
|
|
@@ -406,7 +408,7 @@ EXAMPLES
|
|
|
406
408
|
force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1
|
|
407
409
|
```
|
|
408
410
|
|
|
409
|
-
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.
|
|
411
|
+
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.3/src/commands/agent/generate/template.ts)_
|
|
410
412
|
|
|
411
413
|
## `sf agent generate test-spec`
|
|
412
414
|
|
|
@@ -467,7 +469,7 @@ EXAMPLES
|
|
|
467
469
|
force-app//main/default/aiEvaluationDefinitions/Resort_Manager_Tests.aiEvaluationDefinition-meta.xml
|
|
468
470
|
```
|
|
469
471
|
|
|
470
|
-
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.
|
|
472
|
+
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.3/src/commands/agent/generate/test-spec.ts)_
|
|
471
473
|
|
|
472
474
|
## `sf agent preview`
|
|
473
475
|
|
|
@@ -475,21 +477,20 @@ Interact with an active agent to preview how the agent responds to your statemen
|
|
|
475
477
|
|
|
476
478
|
```
|
|
477
479
|
USAGE
|
|
478
|
-
$ sf agent preview
|
|
480
|
+
$ sf agent preview [--flags-dir <value>] [--api-version <value>] (-c <value> -o <value>) [-n <value>]
|
|
479
481
|
[--authoring-bundle <value>] [-d <value>] [-x]
|
|
480
482
|
|
|
481
483
|
FLAGS
|
|
482
|
-
-c, --client-app=<value>
|
|
483
|
-
|
|
484
|
-
|
|
484
|
+
-c, --client-app=<value> Name of the linked client app to use for the agent connection. You must have
|
|
485
|
+
previously created this link with "org login web --client-app". Run "org display" to
|
|
486
|
+
see the available linked client apps.
|
|
485
487
|
-d, --output-dir=<value> Directory where conversation transcripts are saved.
|
|
486
488
|
-n, --api-name=<value> API name of the agent you want to interact with.
|
|
487
489
|
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
488
490
|
configuration variable is already set.
|
|
489
491
|
-x, --apex-debug Enable Apex debug logging during the agent preview conversation.
|
|
490
492
|
--api-version=<value> Override the api version used for api requests made by this command
|
|
491
|
-
--authoring-bundle=<value> Preview an ephemeral
|
|
492
|
-
metadata
|
|
493
|
+
--authoring-bundle=<value> Preview an ephemeral agent by specifying the API name of the Authoring Bundle metadata
|
|
493
494
|
|
|
494
495
|
GLOBAL FLAGS
|
|
495
496
|
--flags-dir=<value> Import flag values from a directory.
|
|
@@ -533,7 +534,7 @@ EXAMPLES
|
|
|
533
534
|
transcripts/my-preview
|
|
534
535
|
```
|
|
535
536
|
|
|
536
|
-
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.
|
|
537
|
+
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.3/src/commands/agent/preview.ts)_
|
|
537
538
|
|
|
538
539
|
## `sf agent publish authoring-bundle`
|
|
539
540
|
|
|
@@ -541,10 +542,10 @@ Publish an Agent Authoring Bundle as a new agent
|
|
|
541
542
|
|
|
542
543
|
```
|
|
543
544
|
USAGE
|
|
544
|
-
$ sf agent publish authoring-bundle -o <value>
|
|
545
|
+
$ sf agent publish authoring-bundle -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-n <value>]
|
|
545
546
|
|
|
546
547
|
FLAGS
|
|
547
|
-
-n, --api-name=<value>
|
|
548
|
+
-n, --api-name=<value> API name of the Agent Authoring Bundle to publish
|
|
548
549
|
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
549
550
|
configuration variable is already set.
|
|
550
551
|
--api-version=<value> Override the api version used for api requests made by this command
|
|
@@ -565,7 +566,7 @@ EXAMPLES
|
|
|
565
566
|
myorg@example.com
|
|
566
567
|
```
|
|
567
568
|
|
|
568
|
-
_See code: [src/commands/agent/publish/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.
|
|
569
|
+
_See code: [src/commands/agent/publish/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.3/src/commands/agent/publish/authoring-bundle.ts)_
|
|
569
570
|
|
|
570
571
|
## `sf agent test create`
|
|
571
572
|
|
|
@@ -620,7 +621,7 @@ EXAMPLES
|
|
|
620
621
|
$ sf agent test create --spec specs/Resort_Manager-testSpec.yaml --api-name Resort_Manager_Test --preview
|
|
621
622
|
```
|
|
622
623
|
|
|
623
|
-
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.
|
|
624
|
+
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.3/src/commands/agent/test/create.ts)_
|
|
624
625
|
|
|
625
626
|
## `sf agent test list`
|
|
626
627
|
|
|
@@ -655,7 +656,7 @@ EXAMPLES
|
|
|
655
656
|
$ sf agent test list --target-org my-org
|
|
656
657
|
```
|
|
657
658
|
|
|
658
|
-
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.
|
|
659
|
+
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.3/src/commands/agent/test/list.ts)_
|
|
659
660
|
|
|
660
661
|
## `sf agent test results`
|
|
661
662
|
|
|
@@ -721,7 +722,7 @@ FLAG DESCRIPTIONS
|
|
|
721
722
|
expression when using custom evaluations.
|
|
722
723
|
```
|
|
723
724
|
|
|
724
|
-
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.
|
|
725
|
+
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.3/src/commands/agent/test/results.ts)_
|
|
725
726
|
|
|
726
727
|
## `sf agent test resume`
|
|
727
728
|
|
|
@@ -794,7 +795,7 @@ FLAG DESCRIPTIONS
|
|
|
794
795
|
expression when using custom evaluations.
|
|
795
796
|
```
|
|
796
797
|
|
|
797
|
-
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.
|
|
798
|
+
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.3/src/commands/agent/test/resume.ts)_
|
|
798
799
|
|
|
799
800
|
## `sf agent test run`
|
|
800
801
|
|
|
@@ -868,7 +869,7 @@ FLAG DESCRIPTIONS
|
|
|
868
869
|
expression when using custom evaluations.
|
|
869
870
|
```
|
|
870
871
|
|
|
871
|
-
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.
|
|
872
|
+
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.3/src/commands/agent/test/run.ts)_
|
|
872
873
|
|
|
873
874
|
## `sf agent validate authoring-bundle`
|
|
874
875
|
|
|
@@ -876,10 +877,10 @@ Validate an Agent Authoring Bundle
|
|
|
876
877
|
|
|
877
878
|
```
|
|
878
879
|
USAGE
|
|
879
|
-
$ sf agent validate authoring-bundle -o <value>
|
|
880
|
+
$ sf agent validate authoring-bundle -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-n <value>]
|
|
880
881
|
|
|
881
882
|
FLAGS
|
|
882
|
-
-n, --api-name=<value>
|
|
883
|
+
-n, --api-name=<value> Path to the Agent Authoring Bundle to validate
|
|
883
884
|
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
884
885
|
configuration variable is already set.
|
|
885
886
|
--api-version=<value> Override the api version used for api requests made by this command
|
|
@@ -899,6 +900,6 @@ EXAMPLES
|
|
|
899
900
|
$ sf agent validate authoring-bundle --api-name path/to/bundle
|
|
900
901
|
```
|
|
901
902
|
|
|
902
|
-
_See code: [src/commands/agent/validate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.
|
|
903
|
+
_See code: [src/commands/agent/validate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.14-demo.3/src/commands/agent/validate/authoring-bundle.ts)_
|
|
903
904
|
|
|
904
905
|
<!-- commandsstop -->
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
2
|
export type AgentGenerateAuthoringBundleResult = {
|
|
3
|
-
|
|
3
|
+
agentPath: string;
|
|
4
4
|
metaXmlPath: string;
|
|
5
5
|
outputDir: string;
|
|
6
6
|
};
|
|
@@ -9,9 +9,9 @@ export default class AgentGenerateAuthoringBundle extends SfCommand<AgentGenerat
|
|
|
9
9
|
static readonly description: string;
|
|
10
10
|
static readonly examples: string[];
|
|
11
11
|
static readonly requiresProject = true;
|
|
12
|
-
static state: string;
|
|
13
12
|
static readonly flags: {
|
|
14
13
|
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
'api-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
15
|
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
16
|
spec: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
17
|
'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -13,13 +13,15 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { join } from 'node:path';
|
|
17
|
-
import { mkdirSync, writeFileSync, readFileSync } from 'node:fs';
|
|
16
|
+
import { join, resolve } from 'node:path';
|
|
17
|
+
import { mkdirSync, writeFileSync, readFileSync, existsSync } from 'node:fs';
|
|
18
18
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
19
|
-
import { Messages, SfError } from '@salesforce/core';
|
|
19
|
+
import { generateApiName, Messages, SfError } from '@salesforce/core';
|
|
20
20
|
import { Agent } from '@salesforce/agents';
|
|
21
21
|
import YAML from 'yaml';
|
|
22
|
-
import {
|
|
22
|
+
import { input as inquirerInput } from '@inquirer/prompts';
|
|
23
|
+
import { theme } from '../../../inquirer-theme.js';
|
|
24
|
+
import { promptForFlag, promptForYamlFile } from '../../../flags.js';
|
|
23
25
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
24
26
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.generate.authoring-bundle');
|
|
25
27
|
export default class AgentGenerateAuthoringBundle extends SfCommand {
|
|
@@ -27,9 +29,11 @@ export default class AgentGenerateAuthoringBundle extends SfCommand {
|
|
|
27
29
|
static description = messages.getMessage('description');
|
|
28
30
|
static examples = messages.getMessages('examples');
|
|
29
31
|
static requiresProject = true;
|
|
30
|
-
static state = 'beta';
|
|
31
32
|
static flags = {
|
|
32
33
|
'target-org': Flags.requiredOrg(),
|
|
34
|
+
'api-name': Flags.string({
|
|
35
|
+
summary: messages.getMessage('flags.api-name.summary'),
|
|
36
|
+
}),
|
|
33
37
|
'api-version': Flags.orgApiVersion(),
|
|
34
38
|
spec: Flags.file({
|
|
35
39
|
summary: messages.getMessage('flags.spec.summary'),
|
|
@@ -48,12 +52,35 @@ export default class AgentGenerateAuthoringBundle extends SfCommand {
|
|
|
48
52
|
static FLAGGABLE_PROMPTS = {
|
|
49
53
|
name: {
|
|
50
54
|
message: messages.getMessage('flags.name.summary'),
|
|
51
|
-
validate: (d) => d.length > 0 || 'Name cannot be empty',
|
|
55
|
+
validate: (d) => d.trim().length > 0 || 'Name cannot be empty or contain only whitespace',
|
|
52
56
|
required: true,
|
|
53
57
|
},
|
|
58
|
+
'api-name': {
|
|
59
|
+
message: messages.getMessage('flags.api-name.summary'),
|
|
60
|
+
promptMessage: messages.getMessage('flags.api-name.prompt'),
|
|
61
|
+
validate: (d) => {
|
|
62
|
+
if (d.length === 0) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
if (d.length > 80) {
|
|
66
|
+
return 'API name cannot be over 80 characters.';
|
|
67
|
+
}
|
|
68
|
+
const regex = /^[A-Za-z][A-Za-z0-9_]*[A-Za-z0-9]+$/;
|
|
69
|
+
if (!regex.test(d)) {
|
|
70
|
+
return 'Invalid API name.';
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
73
|
+
},
|
|
74
|
+
},
|
|
54
75
|
spec: {
|
|
55
76
|
message: messages.getMessage('flags.spec.summary'),
|
|
56
|
-
validate: (d) =>
|
|
77
|
+
validate: (d) => {
|
|
78
|
+
const specPath = resolve(d);
|
|
79
|
+
if (!existsSync(specPath)) {
|
|
80
|
+
return 'Please enter an existing agent spec (yaml) file';
|
|
81
|
+
}
|
|
82
|
+
return true;
|
|
83
|
+
},
|
|
57
84
|
required: true,
|
|
58
85
|
},
|
|
59
86
|
};
|
|
@@ -61,23 +88,37 @@ export default class AgentGenerateAuthoringBundle extends SfCommand {
|
|
|
61
88
|
const { flags } = await this.parse(AgentGenerateAuthoringBundle);
|
|
62
89
|
const { 'output-dir': outputDir, 'target-org': targetOrg } = flags;
|
|
63
90
|
// If we don't have a spec yet, prompt for it
|
|
64
|
-
const spec = flags
|
|
91
|
+
const spec = flags.spec ?? (await promptForYamlFile(AgentGenerateAuthoringBundle.FLAGGABLE_PROMPTS['spec']));
|
|
65
92
|
// If we don't have a name yet, prompt for it
|
|
66
|
-
const name =
|
|
93
|
+
const name = flags['name'] ?? (await promptForFlag(AgentGenerateAuthoringBundle.FLAGGABLE_PROMPTS['name']));
|
|
94
|
+
// If we don't have an api name yet, prompt for it
|
|
95
|
+
let bundleApiName = flags['api-name'];
|
|
96
|
+
if (!bundleApiName) {
|
|
97
|
+
bundleApiName = generateApiName(name);
|
|
98
|
+
const promptedValue = await inquirerInput({
|
|
99
|
+
message: messages.getMessage('flags.api-name.prompt'),
|
|
100
|
+
validate: AgentGenerateAuthoringBundle.FLAGGABLE_PROMPTS['api-name'].validate,
|
|
101
|
+
default: bundleApiName,
|
|
102
|
+
theme,
|
|
103
|
+
});
|
|
104
|
+
if (promptedValue?.length) {
|
|
105
|
+
bundleApiName = promptedValue;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
67
108
|
try {
|
|
68
109
|
// Get default output directory if not specified
|
|
69
110
|
const defaultOutputDir = join(this.project.getDefaultPackage().fullPath, 'main', 'default');
|
|
70
|
-
const targetOutputDir = join(outputDir ?? defaultOutputDir, '
|
|
111
|
+
const targetOutputDir = join(outputDir ?? defaultOutputDir, 'aiAuthoringBundles', name);
|
|
71
112
|
// Generate file paths
|
|
72
|
-
const
|
|
73
|
-
const metaXmlPath = join(targetOutputDir, `${name}.
|
|
74
|
-
// Write
|
|
113
|
+
const agentPath = join(targetOutputDir, `${name}.agent`);
|
|
114
|
+
const metaXmlPath = join(targetOutputDir, `${name}.aiAuthoringBundle-meta.xml`);
|
|
115
|
+
// Write Agent file
|
|
75
116
|
const conn = targetOrg.getConnection(flags['api-version']);
|
|
76
117
|
const specContents = YAML.parse(readFileSync(spec, 'utf8'));
|
|
77
|
-
const
|
|
118
|
+
const agent = await Agent.createAfScript(conn, specContents);
|
|
78
119
|
// Create output directory if it doesn't exist
|
|
79
120
|
mkdirSync(targetOutputDir, { recursive: true });
|
|
80
|
-
writeFileSync(
|
|
121
|
+
writeFileSync(agentPath, agent);
|
|
81
122
|
// Write meta.xml file
|
|
82
123
|
const metaXml = `<?xml version="1.0" encoding="UTF-8"?>
|
|
83
124
|
<aiAuthoringBundle>
|
|
@@ -91,16 +132,14 @@ export default class AgentGenerateAuthoringBundle extends SfCommand {
|
|
|
91
132
|
writeFileSync(metaXmlPath, metaXml);
|
|
92
133
|
this.logSuccess(`Successfully generated ${name} Authoring Bundle`);
|
|
93
134
|
return {
|
|
94
|
-
|
|
135
|
+
agentPath,
|
|
95
136
|
metaXmlPath,
|
|
96
137
|
outputDir: targetOutputDir,
|
|
97
138
|
};
|
|
98
139
|
}
|
|
99
140
|
catch (error) {
|
|
100
141
|
const err = SfError.wrap(error);
|
|
101
|
-
throw new SfError(messages.getMessage('error.failed-to-create-
|
|
102
|
-
err.message,
|
|
103
|
-
]);
|
|
142
|
+
throw new SfError(messages.getMessage('error.failed-to-create-agent'), 'AgentGenerationError', [err.message]);
|
|
104
143
|
}
|
|
105
144
|
}
|
|
106
145
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring-bundle.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/authoring-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"authoring-bundle.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/authoring-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,KAAK,EAAgB,MAAM,oBAAoB,CAAC;AACzD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAmB,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtF,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,iCAAiC,CAAC,CAAC;AAQtG,MAAM,CAAC,OAAO,OAAO,4BAA6B,SAAQ,SAA6C;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AC5E,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;YAC7D,8CAA8C;YAC9C,SAAS,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAChD,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;YAEhC,sBAAsB;YACtB,MAAM,OAAO,GAAG;;WAEX,YAAY,CAAC,IAAI;gBACZ,YAAY,CAAC,SAAS;;4CAEM,IAAI;;;qBAG3B,CAAC;YAChB,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YAEpC,IAAI,CAAC,UAAU,CAAC,0BAA0B,IAAI,mBAAmB,CAAC,CAAC;YAEnE,OAAO;gBACL,SAAS;gBACT,WAAW;gBACX,SAAS,EAAE,eAAe;aAC3B,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAChC,MAAM,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC,EAAE,sBAAsB,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;QAChH,CAAC;IACH,CAAC"}
|
|
@@ -26,11 +26,10 @@ export default class AgentPreview extends SfCommand<AgentPreviewResult> {
|
|
|
26
26
|
static readonly examples: string[];
|
|
27
27
|
static readonly enableJsonFlag = false;
|
|
28
28
|
static readonly requiresProject = true;
|
|
29
|
-
static state: string;
|
|
30
29
|
static readonly flags: {
|
|
31
30
|
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
32
31
|
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
33
|
-
'client-app': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
32
|
+
'client-app': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
34
33
|
'api-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
35
34
|
'authoring-bundle': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
36
35
|
'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -32,14 +32,12 @@ export default class AgentPreview extends SfCommand {
|
|
|
32
32
|
static examples = messages.getMessages('examples');
|
|
33
33
|
static enableJsonFlag = false;
|
|
34
34
|
static requiresProject = true;
|
|
35
|
-
static state = 'beta';
|
|
36
35
|
static flags = {
|
|
37
36
|
'target-org': Flags.requiredOrg(),
|
|
38
37
|
'api-version': Flags.orgApiVersion(),
|
|
39
38
|
'client-app': Flags.string({
|
|
40
39
|
char: 'c',
|
|
41
40
|
summary: messages.getMessage('flags.client-app.summary'),
|
|
42
|
-
required: true,
|
|
43
41
|
dependsOn: ['target-org'],
|
|
44
42
|
}),
|
|
45
43
|
'api-name': Flags.string({
|
|
@@ -65,9 +63,12 @@ export default class AgentPreview extends SfCommand {
|
|
|
65
63
|
const authInfo = await AuthInfo.create({
|
|
66
64
|
username: flags['target-org'].getUsername(),
|
|
67
65
|
});
|
|
66
|
+
if (!(flags['client-app'] ?? env.getString('SF_DEMO_AGENT_CLIENT_APP'))) {
|
|
67
|
+
throw new SfError('SF_DEMO_AGENT_CLIENT_APP is unset!');
|
|
68
|
+
}
|
|
68
69
|
const jwtConn = await Connection.create({
|
|
69
70
|
authInfo,
|
|
70
|
-
clientApp: flags['client-app'],
|
|
71
|
+
clientApp: env.getString('SF_DEMO_AGENT_CLIENT_APP') ?? flags['client-app'],
|
|
71
72
|
});
|
|
72
73
|
const agentsQuery = await conn.query('SELECT Id, DeveloperName, (SELECT Status FROM BotVersions) FROM BotDefinition WHERE IsDe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Z,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"}
|
|
@@ -9,11 +9,11 @@ export default class AgentPublishAuthoringBundle extends SfCommand<AgentPublishA
|
|
|
9
9
|
static readonly description: string;
|
|
10
10
|
static readonly examples: string[];
|
|
11
11
|
static readonly requiresProject = true;
|
|
12
|
-
static state: string;
|
|
13
12
|
static readonly flags: {
|
|
14
13
|
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
14
|
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
-
'api-name': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'api-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
16
|
};
|
|
17
|
+
private static readonly FLAGGABLE_PROMPTS;
|
|
18
18
|
run(): Promise<AgentPublishAuthoringBundleResult>;
|
|
19
19
|
}
|
|
@@ -22,6 +22,7 @@ import { Messages, Lifecycle, SfError } from '@salesforce/core';
|
|
|
22
22
|
import { Agent, findAuthoringBundle } from '@salesforce/agents';
|
|
23
23
|
import { RequestStatus } from '@salesforce/source-deploy-retrieve';
|
|
24
24
|
import { ensureArray } from '@salesforce/kit';
|
|
25
|
+
import { promptForFlag } from '../../../flags.js';
|
|
25
26
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
26
27
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.publish.authoring-bundle');
|
|
27
28
|
export default class AgentPublishAuthoringBundle extends SfCommand {
|
|
@@ -29,31 +30,47 @@ export default class AgentPublishAuthoringBundle extends SfCommand {
|
|
|
29
30
|
static description = messages.getMessage('description');
|
|
30
31
|
static examples = messages.getMessages('examples');
|
|
31
32
|
static requiresProject = true;
|
|
32
|
-
static state = 'beta';
|
|
33
33
|
static flags = {
|
|
34
34
|
'target-org': Flags.requiredOrg(),
|
|
35
35
|
'api-version': Flags.orgApiVersion(),
|
|
36
36
|
'api-name': Flags.string({
|
|
37
37
|
char: 'n',
|
|
38
38
|
summary: messages.getMessage('flags.api-name.summary'),
|
|
39
|
-
required: true,
|
|
40
39
|
}),
|
|
41
40
|
};
|
|
41
|
+
static FLAGGABLE_PROMPTS = {
|
|
42
|
+
'api-name': {
|
|
43
|
+
message: messages.getMessage('flags.api-name.summary'),
|
|
44
|
+
promptMessage: messages.getMessage('flags.api-name.prompt'),
|
|
45
|
+
validate: (d) => {
|
|
46
|
+
if (d.length > 80) {
|
|
47
|
+
return 'API name cannot be over 80 characters.';
|
|
48
|
+
}
|
|
49
|
+
const regex = /^[A-Za-z][A-Za-z0-9_]*[A-Za-z0-9]+$/;
|
|
50
|
+
if (d.length === 0 || !regex.test(d)) {
|
|
51
|
+
return 'Invalid API name.';
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
42
57
|
async run() {
|
|
43
58
|
const { flags } = await this.parse(AgentPublishAuthoringBundle);
|
|
59
|
+
// If we don't have an api name yet, prompt for it
|
|
60
|
+
const apiName = flags['api-name'] ?? (await promptForFlag(AgentPublishAuthoringBundle.FLAGGABLE_PROMPTS['api-name']));
|
|
44
61
|
// todo: this eslint warning can be removed once published
|
|
45
62
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
46
|
-
const authoringBundleDir = findAuthoringBundle(this.project.getPath(),
|
|
63
|
+
const authoringBundleDir = findAuthoringBundle(this.project.getPath(), apiName);
|
|
47
64
|
if (!authoringBundleDir) {
|
|
48
|
-
throw new SfError(messages.getMessage('error.
|
|
49
|
-
messages.getMessage('error.
|
|
65
|
+
throw new SfError(messages.getMessage('error.agentNotFound', [apiName]), 'AgentNotFoundError', [
|
|
66
|
+
messages.getMessage('error.agentNotFoundAction'),
|
|
50
67
|
]);
|
|
51
68
|
}
|
|
52
69
|
// Create multi-stage output
|
|
53
70
|
const mso = new MultiStageOutput({
|
|
54
71
|
stages: ['Validate Bundle', 'Publish Agent', 'Retrieve Metadata'],
|
|
55
72
|
title: 'Publishing Agent',
|
|
56
|
-
data: { agentName:
|
|
73
|
+
data: { agentName: apiName },
|
|
57
74
|
jsonEnabled: this.jsonEnabled(),
|
|
58
75
|
postStagesBlock: [
|
|
59
76
|
{
|
|
@@ -70,7 +87,7 @@ export default class AgentPublishAuthoringBundle extends SfCommand {
|
|
|
70
87
|
const targetOrg = flags['target-org'];
|
|
71
88
|
const conn = targetOrg.getConnection(flags['api-version']);
|
|
72
89
|
// First compile the AF script to get the Agent JSON
|
|
73
|
-
const agentJson = await Agent.compileAfScript(conn, readFileSync(join(authoringBundleDir, `${
|
|
90
|
+
const agentJson = await Agent.compileAfScript(conn, readFileSync(join(authoringBundleDir, `${apiName}.agent`), 'utf8'));
|
|
74
91
|
mso.skipTo('Publish Agent');
|
|
75
92
|
// Then publish the Agent JSON to create the agent
|
|
76
93
|
// Set up lifecycle listeners for retrieve events
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring-bundle.js","sourceRoot":"","sources":["../../../../src/commands/agent/publish/authoring-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,aAAa,EAA2B,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"authoring-bundle.js","sourceRoot":"","sources":["../../../../src/commands/agent/publish/authoring-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,aAAa,EAA2B,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,E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AM,MAAM,GAAG,MAAM,KAAK,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,OAAQ,EAAE,SAAS,CAAC,CAAC;YAC5E,GAAG,CAAC,IAAI,EAAE,CAAC;YAEX,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,gBAAgB,EAAE,MAAM,CAAC,aAAa;aACvC,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,2BAA2B;YAC3B,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAChC,MAAM,YAAY,GAAG,QAAQ,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;YAE/E,uCAAuC;YACvC,GAAG,CAAC,KAAK,EAAE,CAAC;YAEZ,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YAEzB,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;aAChC,CAAC;QACJ,CAAC;IACH,CAAC"}
|
|
@@ -8,11 +8,11 @@ export default class AgentValidateAuthoringBundle extends SfCommand<AgentValidat
|
|
|
8
8
|
static readonly description: string;
|
|
9
9
|
static readonly examples: string[];
|
|
10
10
|
static readonly requiresProject = true;
|
|
11
|
-
static state: string;
|
|
12
11
|
static readonly flags: {
|
|
13
12
|
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
13
|
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
-
'api-name': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
'api-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
15
|
};
|
|
16
|
+
private static readonly FLAGGABLE_PROMPTS;
|
|
17
17
|
run(): Promise<AgentValidateAuthoringBundleResult>;
|
|
18
18
|
}
|
|
@@ -17,7 +17,11 @@ import { readFileSync } from 'node:fs';
|
|
|
17
17
|
import { join } from 'node:path';
|
|
18
18
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
19
19
|
import { Messages, SfError } from '@salesforce/core';
|
|
20
|
+
import { MultiStageOutput } from '@oclif/multi-stage-output';
|
|
20
21
|
import { Agent, findAuthoringBundle } from '@salesforce/agents';
|
|
22
|
+
import { Duration, sleep } from '@salesforce/kit';
|
|
23
|
+
import { colorize } from '@oclif/core/ux';
|
|
24
|
+
import { promptForFlag } from '../../../flags.js';
|
|
21
25
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
22
26
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.validate.authoring-bundle');
|
|
23
27
|
export default class AgentValidateAuthoringBundle extends SfCommand {
|
|
@@ -25,32 +29,71 @@ export default class AgentValidateAuthoringBundle extends SfCommand {
|
|
|
25
29
|
static description = messages.getMessage('description');
|
|
26
30
|
static examples = messages.getMessages('examples');
|
|
27
31
|
static requiresProject = true;
|
|
28
|
-
static state = 'beta';
|
|
29
32
|
static flags = {
|
|
30
33
|
'target-org': Flags.requiredOrg(),
|
|
31
34
|
'api-version': Flags.orgApiVersion(),
|
|
32
35
|
'api-name': Flags.string({
|
|
33
36
|
char: 'n',
|
|
34
37
|
summary: messages.getMessage('flags.api-name.summary'),
|
|
35
|
-
required: true,
|
|
36
38
|
}),
|
|
37
39
|
};
|
|
40
|
+
static FLAGGABLE_PROMPTS = {
|
|
41
|
+
'api-name': {
|
|
42
|
+
message: messages.getMessage('flags.api-name.summary'),
|
|
43
|
+
promptMessage: messages.getMessage('flags.api-name.prompt'),
|
|
44
|
+
validate: (d) => {
|
|
45
|
+
if (d.length > 80) {
|
|
46
|
+
return 'API name cannot be over 80 characters.';
|
|
47
|
+
}
|
|
48
|
+
const regex = /^[A-Za-z][A-Za-z0-9_]*[A-Za-z0-9]+$/;
|
|
49
|
+
if (d.length === 0 || !regex.test(d)) {
|
|
50
|
+
return 'Invalid API name.';
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
38
56
|
async run() {
|
|
39
57
|
const { flags } = await this.parse(AgentValidateAuthoringBundle);
|
|
58
|
+
// If we don't have an api name yet, prompt for it
|
|
59
|
+
const apiName = flags['api-name'] ?? (await promptForFlag(AgentValidateAuthoringBundle.FLAGGABLE_PROMPTS['api-name']));
|
|
40
60
|
// todo: this eslint warning can be removed once published
|
|
41
61
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
42
|
-
const authoringBundleDir = findAuthoringBundle(this.project.getPath(),
|
|
62
|
+
const authoringBundleDir = findAuthoringBundle(this.project.getPath(), apiName);
|
|
43
63
|
if (!authoringBundleDir) {
|
|
44
|
-
throw new SfError(messages.getMessage('error.
|
|
45
|
-
messages.getMessage('error.
|
|
64
|
+
throw new SfError(messages.getMessage('error.agentNotFound', [apiName]), 'AgentNotFoundError', [
|
|
65
|
+
messages.getMessage('error.agentNotFoundAction'),
|
|
46
66
|
]);
|
|
47
67
|
}
|
|
68
|
+
const mso = new MultiStageOutput({
|
|
69
|
+
jsonEnabled: this.jsonEnabled(),
|
|
70
|
+
title: `Validating ${apiName} Authoring Bundle`,
|
|
71
|
+
showTitle: true,
|
|
72
|
+
stages: ['Validating Authoring Bundle'],
|
|
73
|
+
stageSpecificBlock: [
|
|
74
|
+
{
|
|
75
|
+
stage: 'Validating Authoring Bundle',
|
|
76
|
+
label: 'Status',
|
|
77
|
+
type: 'dynamic-key-value',
|
|
78
|
+
get: (data) => data?.status ?? 'IN PROGRESS',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
stage: 'Validating Authoring Bundle',
|
|
82
|
+
label: 'Errors',
|
|
83
|
+
type: 'dynamic-key-value',
|
|
84
|
+
get: (data) => data?.errors ?? '0',
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
});
|
|
48
88
|
try {
|
|
89
|
+
mso.skipTo('Validating Authoring Bundle');
|
|
49
90
|
const targetOrg = flags['target-org'];
|
|
50
91
|
const conn = targetOrg.getConnection(flags['api-version']);
|
|
51
92
|
// Call Agent.compileAfScript() API
|
|
52
|
-
await
|
|
53
|
-
|
|
93
|
+
await sleep(Duration.seconds(2));
|
|
94
|
+
await Agent.compileAfScript(conn, readFileSync(join(authoringBundleDir, `${!apiName}.agent`), 'utf8'));
|
|
95
|
+
mso.updateData({ status: 'COMPLETED' });
|
|
96
|
+
mso.stop('completed');
|
|
54
97
|
return {
|
|
55
98
|
success: true,
|
|
56
99
|
};
|
|
@@ -58,11 +101,19 @@ export default class AgentValidateAuthoringBundle extends SfCommand {
|
|
|
58
101
|
catch (error) {
|
|
59
102
|
// Handle validation errors
|
|
60
103
|
const err = SfError.wrap(error);
|
|
104
|
+
let count = 0;
|
|
61
105
|
const formattedError = err.message
|
|
62
106
|
.split('\n')
|
|
63
|
-
.map((line) =>
|
|
107
|
+
.map((line) => {
|
|
108
|
+
count += 1;
|
|
109
|
+
const type = line.split(':')[0];
|
|
110
|
+
const rest = line.substring(line.indexOf(':')).trim();
|
|
111
|
+
return `- ${colorize('red', type)} ${rest}`;
|
|
112
|
+
})
|
|
64
113
|
.join('\n');
|
|
65
|
-
|
|
114
|
+
mso.updateData({ errors: count.toString(), status: 'ERROR' });
|
|
115
|
+
mso.error();
|
|
116
|
+
this.log(messages.getMessage('error.compilationFailed', [formattedError]));
|
|
66
117
|
return {
|
|
67
118
|
success: false,
|
|
68
119
|
errors: err.message.split('\n'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring-bundle.js","sourceRoot":"","sources":["../../../../src/commands/agent/validate/authoring-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAA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AM,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;aAChC,CAAC;QACJ,CAAC;IACH,CAAC"}
|
package/lib/flags.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export declare const testOutputDirFlag: Interfaces.FlagDefinition<string, Interf
|
|
|
30
30
|
}>;
|
|
31
31
|
export declare const verboseFlag: Interfaces.BooleanFlag<boolean>;
|
|
32
32
|
export declare function makeFlags<T extends Record<string, FlaggablePrompt>>(flaggablePrompts: T): FlagsOfPrompts<T>;
|
|
33
|
+
export declare function getHiddenDirs(projectRoot?: string): Promise<string[]>;
|
|
33
34
|
export declare function traverseForFiles(dir: string, suffixes: string[], excludeDirs?: string[]): Promise<string[]>;
|
|
34
35
|
export declare const promptForAiEvaluationDefinitionApiName: (flagDef: FlaggablePrompt, connection: Connection) => Promise<string>;
|
|
35
36
|
export declare const promptForYamlFile: (flagDef: FlaggablePrompt) => Promise<string>;
|
package/lib/flags.js
CHANGED
|
@@ -59,6 +59,16 @@ export function makeFlags(flaggablePrompts) {
|
|
|
59
59
|
}),
|
|
60
60
|
]));
|
|
61
61
|
}
|
|
62
|
+
export async function getHiddenDirs(projectRoot) {
|
|
63
|
+
const rootDir = projectRoot ?? process.cwd();
|
|
64
|
+
try {
|
|
65
|
+
const files = await readdir(rootDir, { withFileTypes: true });
|
|
66
|
+
return files.filter((file) => file.isDirectory() && file.name.startsWith('.')).map((file) => file.name);
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
62
72
|
export async function traverseForFiles(dir, suffixes, excludeDirs) {
|
|
63
73
|
const files = await readdir(dir, { withFileTypes: true });
|
|
64
74
|
const results = [];
|
|
@@ -100,7 +110,8 @@ export const promptForAiEvaluationDefinitionApiName = async (flagDef, connection
|
|
|
100
110
|
});
|
|
101
111
|
};
|
|
102
112
|
export const promptForYamlFile = async (flagDef) => {
|
|
103
|
-
const
|
|
113
|
+
const hiddenDirs = await getHiddenDirs();
|
|
114
|
+
const yamlFiles = await traverseForFiles(process.cwd(), ['.yml', '.yaml'], ['node_modules', ...hiddenDirs]);
|
|
104
115
|
return autocomplete({
|
|
105
116
|
message: flagDef.message,
|
|
106
117
|
// eslint-disable-next-line @typescript-eslint/require-await
|
package/lib/flags.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../src/flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAc,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,YAAY,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,SAAS,EAA4B,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,QAAQ,CAAC,CAAC;AAuB7E,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAU;IACnD,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,6BAA6B,CAAC;CAC5D,CAAC,CAAC;A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AM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAChC,MAAM,OAAO,CAAC,MAAM,CAAC;gBACnB,IAAI,EAAE,kBAAkB;gBACxB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,EAAE,CAAC,SAAS,CAAC,CAAC;gBACnE,KAAK,EAAE,GAAG;aACX,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,UAAsB,EAAE,SAAiB,EAAmB,EAAE;IACjG,MAAM,CAAC,GAAG,yCAAyC,SAAS,GAAG,CAAC;IAChE,OAAO,CAAC,MAAM,UAAU,CAAC,iBAAiB,CAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACpE,CAAC,CAAC"}
|
|
@@ -4,7 +4,7 @@ Generate an authoring bundle from an agent specification.
|
|
|
4
4
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
|
-
Generates an authoring bundle containing
|
|
7
|
+
Generates an authoring bundle containing Agent and its meta.xml file from an agent specification file.
|
|
8
8
|
|
|
9
9
|
# flags.spec.summary
|
|
10
10
|
|
|
@@ -16,7 +16,15 @@ Directory where the authoring bundle files will be generated.
|
|
|
16
16
|
|
|
17
17
|
# flags.name.summary
|
|
18
18
|
|
|
19
|
-
Name (label) of the authoring bundle.
|
|
19
|
+
Name (label) of the authoring bundle.
|
|
20
|
+
|
|
21
|
+
# flags.api-name.summary
|
|
22
|
+
|
|
23
|
+
API name of the new authoring bundle; if not specified, the API name is derived from the authoring bundle name (label); the API name must not exist in the org.
|
|
24
|
+
|
|
25
|
+
# flags.api-name.prompt
|
|
26
|
+
|
|
27
|
+
API name of the new authoring bundle
|
|
20
28
|
|
|
21
29
|
# examples
|
|
22
30
|
|
|
@@ -34,6 +42,6 @@ No agent specification file found at the specified path.
|
|
|
34
42
|
|
|
35
43
|
The specified file is not a valid agent specification file.
|
|
36
44
|
|
|
37
|
-
# error.failed-to-create-
|
|
45
|
+
# error.failed-to-create-agent
|
|
38
46
|
|
|
39
|
-
Failed to create
|
|
47
|
+
Failed to create Agent from the agent specification.
|
|
@@ -20,7 +20,7 @@ API name of the agent you want to interact with.
|
|
|
20
20
|
|
|
21
21
|
# flags.authoring-bundle.summary
|
|
22
22
|
|
|
23
|
-
Preview an ephemeral
|
|
23
|
+
Preview an ephemeral agent by specifying the API name of the Authoring Bundle metadata
|
|
24
24
|
|
|
25
25
|
# flags.client-app.summary
|
|
26
26
|
|
|
@@ -15,6 +15,10 @@ Publishes an Agent Authoring Bundle by compiling the AF script and creating a ne
|
|
|
15
15
|
|
|
16
16
|
API name of the Agent Authoring Bundle to publish
|
|
17
17
|
|
|
18
|
+
# flags.api-name.prompt
|
|
19
|
+
|
|
20
|
+
API name of the authoring bundle to publish
|
|
21
|
+
|
|
18
22
|
# flags.agent-name.summary
|
|
19
23
|
|
|
20
24
|
Name for the new agent to be created
|
|
@@ -32,10 +36,10 @@ Invalid bundle path. Please provide a valid path to an Agent Authoring Bundle.
|
|
|
32
36
|
Failed to publish agent with the following errors:
|
|
33
37
|
%s
|
|
34
38
|
|
|
35
|
-
# error.
|
|
39
|
+
# error.agentNotFound
|
|
36
40
|
|
|
37
|
-
Could not find an .
|
|
41
|
+
Could not find an .agent file with API name '%s' in the project.
|
|
38
42
|
|
|
39
|
-
# error.
|
|
43
|
+
# error.agentNotFoundAction
|
|
40
44
|
|
|
41
|
-
Please check that the API name is correct and that the .
|
|
45
|
+
Please check that the API name is correct and that the .agent file exists in your project directory.
|
|
@@ -15,6 +15,10 @@ Validates an Agent Authoring Bundle by compiling the AF script and checking for
|
|
|
15
15
|
|
|
16
16
|
Path to the Agent Authoring Bundle to validate
|
|
17
17
|
|
|
18
|
+
# flags.api-name.prompt
|
|
19
|
+
|
|
20
|
+
API name of the authoring bundle to validate
|
|
21
|
+
|
|
18
22
|
# error.missingRequiredFlags
|
|
19
23
|
|
|
20
24
|
Required flag(s) missing: %s
|
|
@@ -28,10 +32,10 @@ Invalid bundle path. Please provide a valid path to an Agent Authoring Bundle.
|
|
|
28
32
|
AF Script compilation failed with the following errors:
|
|
29
33
|
%s
|
|
30
34
|
|
|
31
|
-
# error.
|
|
35
|
+
# error.agentNotFound
|
|
32
36
|
|
|
33
|
-
Could not find an .
|
|
37
|
+
Could not find an .agent file with API name '%s' in the project.
|
|
34
38
|
|
|
35
|
-
# error.
|
|
39
|
+
# error.agentNotFoundAction
|
|
36
40
|
|
|
37
|
-
Please check that the API name is correct and that the .
|
|
41
|
+
Please check that the API name is correct and that the .agent file exists in your project directory.
|
package/oclif.manifest.json
CHANGED
|
@@ -285,7 +285,6 @@
|
|
|
285
285
|
"target-org"
|
|
286
286
|
],
|
|
287
287
|
"name": "client-app",
|
|
288
|
-
"required": true,
|
|
289
288
|
"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.",
|
|
290
289
|
"hasDynamicHelp": false,
|
|
291
290
|
"multiple": false,
|
|
@@ -301,7 +300,7 @@
|
|
|
301
300
|
},
|
|
302
301
|
"authoring-bundle": {
|
|
303
302
|
"name": "authoring-bundle",
|
|
304
|
-
"summary": "Preview an ephemeral
|
|
303
|
+
"summary": "Preview an ephemeral agent by specifying the API name of the Authoring Bundle metadata",
|
|
305
304
|
"hasDynamicHelp": false,
|
|
306
305
|
"multiple": false,
|
|
307
306
|
"type": "option"
|
|
@@ -328,7 +327,6 @@
|
|
|
328
327
|
"pluginAlias": "@salesforce/plugin-agent",
|
|
329
328
|
"pluginName": "@salesforce/plugin-agent",
|
|
330
329
|
"pluginType": "core",
|
|
331
|
-
"state": "beta",
|
|
332
330
|
"strict": true,
|
|
333
331
|
"summary": "Interact with an active agent to preview how the agent responds to your statements, questions, and commands (utterances).",
|
|
334
332
|
"enableJsonFlag": false,
|
|
@@ -542,7 +540,7 @@
|
|
|
542
540
|
"agent:generate:authoring-bundle": {
|
|
543
541
|
"aliases": [],
|
|
544
542
|
"args": {},
|
|
545
|
-
"description": "Generates an authoring bundle containing
|
|
543
|
+
"description": "Generates an authoring bundle containing Agent and its meta.xml file from an agent specification file.",
|
|
546
544
|
"examples": [
|
|
547
545
|
"Generate an authoring bundle from a specification file:\n<%= config.bin %> <%= command.id %> --spec-file path/to/spec.yaml --name \"My Authoring Bundle\"",
|
|
548
546
|
"Generate an authoring bundle with a custom output directory:\n<%= config.bin %> <%= command.id %> --spec-file path/to/spec.yaml --name \"My Authoring Bundle\" --output-dir path/to/output"
|
|
@@ -573,6 +571,13 @@
|
|
|
573
571
|
"multiple": false,
|
|
574
572
|
"type": "option"
|
|
575
573
|
},
|
|
574
|
+
"api-name": {
|
|
575
|
+
"name": "api-name",
|
|
576
|
+
"summary": "API name of the new authoring bundle; if not specified, the API name is derived from the authoring bundle name (label); the API name must not exist in the org.",
|
|
577
|
+
"hasDynamicHelp": false,
|
|
578
|
+
"multiple": false,
|
|
579
|
+
"type": "option"
|
|
580
|
+
},
|
|
576
581
|
"api-version": {
|
|
577
582
|
"description": "Override the api version used for api requests made by this command",
|
|
578
583
|
"name": "api-version",
|
|
@@ -599,7 +604,7 @@
|
|
|
599
604
|
"name": {
|
|
600
605
|
"char": "n",
|
|
601
606
|
"name": "name",
|
|
602
|
-
"summary": "Name (label) of the authoring bundle.
|
|
607
|
+
"summary": "Name (label) of the authoring bundle.",
|
|
603
608
|
"hasDynamicHelp": false,
|
|
604
609
|
"multiple": false,
|
|
605
610
|
"type": "option"
|
|
@@ -611,16 +616,19 @@
|
|
|
611
616
|
"pluginAlias": "@salesforce/plugin-agent",
|
|
612
617
|
"pluginName": "@salesforce/plugin-agent",
|
|
613
618
|
"pluginType": "core",
|
|
614
|
-
"state": "beta",
|
|
615
619
|
"strict": true,
|
|
616
620
|
"summary": "Generate an authoring bundle from an agent specification.",
|
|
617
621
|
"enableJsonFlag": true,
|
|
618
622
|
"requiresProject": true,
|
|
619
623
|
"FLAGGABLE_PROMPTS": {
|
|
620
624
|
"name": {
|
|
621
|
-
"message": "Name (label) of the authoring bundle.
|
|
625
|
+
"message": "Name (label) of the authoring bundle.",
|
|
622
626
|
"required": true
|
|
623
627
|
},
|
|
628
|
+
"api-name": {
|
|
629
|
+
"message": "API name of the new authoring bundle; if not specified, the API name is derived from the authoring bundle name (label); the API name must not exist in the org.",
|
|
630
|
+
"promptMessage": "API name of the new authoring bundle"
|
|
631
|
+
},
|
|
624
632
|
"spec": {
|
|
625
633
|
"message": "Path to the agent specification file.",
|
|
626
634
|
"required": true
|
|
@@ -831,7 +839,6 @@
|
|
|
831
839
|
"api-name": {
|
|
832
840
|
"char": "n",
|
|
833
841
|
"name": "api-name",
|
|
834
|
-
"required": true,
|
|
835
842
|
"summary": "API name of the Agent Authoring Bundle to publish",
|
|
836
843
|
"hasDynamicHelp": false,
|
|
837
844
|
"multiple": false,
|
|
@@ -844,11 +851,16 @@
|
|
|
844
851
|
"pluginAlias": "@salesforce/plugin-agent",
|
|
845
852
|
"pluginName": "@salesforce/plugin-agent",
|
|
846
853
|
"pluginType": "core",
|
|
847
|
-
"state": "beta",
|
|
848
854
|
"strict": true,
|
|
849
855
|
"summary": "Publish an Agent Authoring Bundle as a new agent",
|
|
850
856
|
"enableJsonFlag": true,
|
|
851
857
|
"requiresProject": true,
|
|
858
|
+
"FLAGGABLE_PROMPTS": {
|
|
859
|
+
"api-name": {
|
|
860
|
+
"message": "API name of the Agent Authoring Bundle to publish",
|
|
861
|
+
"promptMessage": "API name of the authoring bundle to publish"
|
|
862
|
+
}
|
|
863
|
+
},
|
|
852
864
|
"isESM": true,
|
|
853
865
|
"relativePath": [
|
|
854
866
|
"lib",
|
|
@@ -867,6 +879,89 @@
|
|
|
867
879
|
"authoring-bundle:publish:agent"
|
|
868
880
|
]
|
|
869
881
|
},
|
|
882
|
+
"agent:validate:authoring-bundle": {
|
|
883
|
+
"aliases": [],
|
|
884
|
+
"args": {},
|
|
885
|
+
"description": "Validates an Agent Authoring Bundle by compiling the AF script and checking for errors.",
|
|
886
|
+
"examples": [
|
|
887
|
+
"Validate an Agent Authoring Bundle:\n<%= config.bin %> <%= command.id %> --api-name path/to/bundle"
|
|
888
|
+
],
|
|
889
|
+
"flags": {
|
|
890
|
+
"json": {
|
|
891
|
+
"description": "Format output as json.",
|
|
892
|
+
"helpGroup": "GLOBAL",
|
|
893
|
+
"name": "json",
|
|
894
|
+
"allowNo": false,
|
|
895
|
+
"type": "boolean"
|
|
896
|
+
},
|
|
897
|
+
"flags-dir": {
|
|
898
|
+
"helpGroup": "GLOBAL",
|
|
899
|
+
"name": "flags-dir",
|
|
900
|
+
"summary": "Import flag values from a directory.",
|
|
901
|
+
"hasDynamicHelp": false,
|
|
902
|
+
"multiple": false,
|
|
903
|
+
"type": "option"
|
|
904
|
+
},
|
|
905
|
+
"target-org": {
|
|
906
|
+
"char": "o",
|
|
907
|
+
"name": "target-org",
|
|
908
|
+
"noCacheDefault": true,
|
|
909
|
+
"required": true,
|
|
910
|
+
"summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
|
|
911
|
+
"hasDynamicHelp": true,
|
|
912
|
+
"multiple": false,
|
|
913
|
+
"type": "option"
|
|
914
|
+
},
|
|
915
|
+
"api-version": {
|
|
916
|
+
"description": "Override the api version used for api requests made by this command",
|
|
917
|
+
"name": "api-version",
|
|
918
|
+
"hasDynamicHelp": false,
|
|
919
|
+
"multiple": false,
|
|
920
|
+
"type": "option"
|
|
921
|
+
},
|
|
922
|
+
"api-name": {
|
|
923
|
+
"char": "n",
|
|
924
|
+
"name": "api-name",
|
|
925
|
+
"summary": "Path to the Agent Authoring Bundle to validate",
|
|
926
|
+
"hasDynamicHelp": false,
|
|
927
|
+
"multiple": false,
|
|
928
|
+
"type": "option"
|
|
929
|
+
}
|
|
930
|
+
},
|
|
931
|
+
"hasDynamicHelp": true,
|
|
932
|
+
"hiddenAliases": [],
|
|
933
|
+
"id": "agent:validate:authoring-bundle",
|
|
934
|
+
"pluginAlias": "@salesforce/plugin-agent",
|
|
935
|
+
"pluginName": "@salesforce/plugin-agent",
|
|
936
|
+
"pluginType": "core",
|
|
937
|
+
"strict": true,
|
|
938
|
+
"summary": "Validate an Agent Authoring Bundle",
|
|
939
|
+
"enableJsonFlag": true,
|
|
940
|
+
"requiresProject": true,
|
|
941
|
+
"FLAGGABLE_PROMPTS": {
|
|
942
|
+
"api-name": {
|
|
943
|
+
"message": "Path to the Agent Authoring Bundle to validate",
|
|
944
|
+
"promptMessage": "API name of the authoring bundle to validate"
|
|
945
|
+
}
|
|
946
|
+
},
|
|
947
|
+
"isESM": true,
|
|
948
|
+
"relativePath": [
|
|
949
|
+
"lib",
|
|
950
|
+
"commands",
|
|
951
|
+
"agent",
|
|
952
|
+
"validate",
|
|
953
|
+
"authoring-bundle.js"
|
|
954
|
+
],
|
|
955
|
+
"aliasPermutations": [],
|
|
956
|
+
"permutations": [
|
|
957
|
+
"agent:validate:authoring-bundle",
|
|
958
|
+
"validate:agent:authoring-bundle",
|
|
959
|
+
"validate:authoring-bundle:agent",
|
|
960
|
+
"agent:authoring-bundle:validate",
|
|
961
|
+
"authoring-bundle:agent:validate",
|
|
962
|
+
"authoring-bundle:validate:agent"
|
|
963
|
+
]
|
|
964
|
+
},
|
|
870
965
|
"agent:test:create": {
|
|
871
966
|
"aliases": [],
|
|
872
967
|
"args": {},
|
|
@@ -1380,86 +1475,7 @@
|
|
|
1380
1475
|
"run:agent:test",
|
|
1381
1476
|
"run:test:agent"
|
|
1382
1477
|
]
|
|
1383
|
-
},
|
|
1384
|
-
"agent:validate:authoring-bundle": {
|
|
1385
|
-
"aliases": [],
|
|
1386
|
-
"args": {},
|
|
1387
|
-
"description": "Validates an Agent Authoring Bundle by compiling the AF script and checking for errors.",
|
|
1388
|
-
"examples": [
|
|
1389
|
-
"Validate an Agent Authoring Bundle:\n<%= config.bin %> <%= command.id %> --api-name path/to/bundle"
|
|
1390
|
-
],
|
|
1391
|
-
"flags": {
|
|
1392
|
-
"json": {
|
|
1393
|
-
"description": "Format output as json.",
|
|
1394
|
-
"helpGroup": "GLOBAL",
|
|
1395
|
-
"name": "json",
|
|
1396
|
-
"allowNo": false,
|
|
1397
|
-
"type": "boolean"
|
|
1398
|
-
},
|
|
1399
|
-
"flags-dir": {
|
|
1400
|
-
"helpGroup": "GLOBAL",
|
|
1401
|
-
"name": "flags-dir",
|
|
1402
|
-
"summary": "Import flag values from a directory.",
|
|
1403
|
-
"hasDynamicHelp": false,
|
|
1404
|
-
"multiple": false,
|
|
1405
|
-
"type": "option"
|
|
1406
|
-
},
|
|
1407
|
-
"target-org": {
|
|
1408
|
-
"char": "o",
|
|
1409
|
-
"name": "target-org",
|
|
1410
|
-
"noCacheDefault": true,
|
|
1411
|
-
"required": true,
|
|
1412
|
-
"summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
|
|
1413
|
-
"hasDynamicHelp": true,
|
|
1414
|
-
"multiple": false,
|
|
1415
|
-
"type": "option"
|
|
1416
|
-
},
|
|
1417
|
-
"api-version": {
|
|
1418
|
-
"description": "Override the api version used for api requests made by this command",
|
|
1419
|
-
"name": "api-version",
|
|
1420
|
-
"hasDynamicHelp": false,
|
|
1421
|
-
"multiple": false,
|
|
1422
|
-
"type": "option"
|
|
1423
|
-
},
|
|
1424
|
-
"api-name": {
|
|
1425
|
-
"char": "n",
|
|
1426
|
-
"name": "api-name",
|
|
1427
|
-
"required": true,
|
|
1428
|
-
"summary": "Path to the Agent Authoring Bundle to validate",
|
|
1429
|
-
"hasDynamicHelp": false,
|
|
1430
|
-
"multiple": false,
|
|
1431
|
-
"type": "option"
|
|
1432
|
-
}
|
|
1433
|
-
},
|
|
1434
|
-
"hasDynamicHelp": true,
|
|
1435
|
-
"hiddenAliases": [],
|
|
1436
|
-
"id": "agent:validate:authoring-bundle",
|
|
1437
|
-
"pluginAlias": "@salesforce/plugin-agent",
|
|
1438
|
-
"pluginName": "@salesforce/plugin-agent",
|
|
1439
|
-
"pluginType": "core",
|
|
1440
|
-
"state": "beta",
|
|
1441
|
-
"strict": true,
|
|
1442
|
-
"summary": "Validate an Agent Authoring Bundle",
|
|
1443
|
-
"enableJsonFlag": true,
|
|
1444
|
-
"requiresProject": true,
|
|
1445
|
-
"isESM": true,
|
|
1446
|
-
"relativePath": [
|
|
1447
|
-
"lib",
|
|
1448
|
-
"commands",
|
|
1449
|
-
"agent",
|
|
1450
|
-
"validate",
|
|
1451
|
-
"authoring-bundle.js"
|
|
1452
|
-
],
|
|
1453
|
-
"aliasPermutations": [],
|
|
1454
|
-
"permutations": [
|
|
1455
|
-
"agent:validate:authoring-bundle",
|
|
1456
|
-
"validate:agent:authoring-bundle",
|
|
1457
|
-
"validate:authoring-bundle:agent",
|
|
1458
|
-
"agent:authoring-bundle:validate",
|
|
1459
|
-
"authoring-bundle:agent:validate",
|
|
1460
|
-
"authoring-bundle:validate:agent"
|
|
1461
|
-
]
|
|
1462
1478
|
}
|
|
1463
1479
|
},
|
|
1464
|
-
"version": "1.24.14-demo.
|
|
1480
|
+
"version": "1.24.14-demo.3"
|
|
1465
1481
|
}
|
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.24.14-demo.
|
|
4
|
+
"version": "1.24.14-demo.3",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"@inquirer/prompts": "^7.8.6",
|
|
10
10
|
"@oclif/core": "^4",
|
|
11
11
|
"@oclif/multi-stage-output": "^0.8.23",
|
|
12
|
-
"@salesforce/agents": "^0.17.
|
|
12
|
+
"@salesforce/agents": "^0.17.11",
|
|
13
13
|
"@salesforce/core": "^8.23.1",
|
|
14
14
|
"@salesforce/kit": "^3.2.3",
|
|
15
15
|
"@salesforce/sf-plugins-core": "^12.2.4",
|
|
@@ -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.24.14-demo.
|
|
233
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.24.14-demo.
|
|
232
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.24.14-demo.3.crt",
|
|
233
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.24.14-demo.3.sig"
|
|
234
234
|
}
|
|
235
235
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"AgentGenerateAuthoringBundleResult": {
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
8
|
+
"agentPath": {
|
|
9
9
|
"type": "string"
|
|
10
10
|
},
|
|
11
11
|
"metaXmlPath": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"type": "string"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
-
"required": ["
|
|
18
|
+
"required": ["agentPath", "metaXmlPath", "outputDir"],
|
|
19
19
|
"additionalProperties": false
|
|
20
20
|
}
|
|
21
21
|
}
|