@salesforce/plugin-agent 1.20.5 → 1.20.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/lib/commands/agent/generate/template.d.ts +19 -1
- package/lib/commands/agent/generate/template.js +15 -12
- package/lib/commands/agent/generate/template.js.map +1 -1
- package/lib/commands/agent/preview.js +2 -2
- package/lib/commands/agent/preview.js.map +1 -1
- package/messages/agent.generate.template.md +20 -0
- package/npm-shrinkwrap.json +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +4 -4
- package/schemas/agent-generate-template.json +2 -2
package/README.md
CHANGED
|
@@ -132,7 +132,7 @@ EXAMPLES
|
|
|
132
132
|
$ sf agent create --agent-name "Resort Manager" --spec specs/resortManagerAgent.yaml --preview
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
-
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.
|
|
135
|
+
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.7/src/commands/agent/create.ts)_
|
|
136
136
|
|
|
137
137
|
## `sf agent generate agent-spec`
|
|
138
138
|
|
|
@@ -237,7 +237,7 @@ EXAMPLES
|
|
|
237
237
|
$ sf agent generate agent-spec --tone formal --agent-user resortmanager@myorg.com
|
|
238
238
|
```
|
|
239
239
|
|
|
240
|
-
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.
|
|
240
|
+
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.7/src/commands/agent/generate/agent-spec.ts)_
|
|
241
241
|
|
|
242
242
|
## `sf agent generate template`
|
|
243
243
|
|
|
@@ -285,7 +285,7 @@ EXAMPLES
|
|
|
285
285
|
force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1
|
|
286
286
|
```
|
|
287
287
|
|
|
288
|
-
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.
|
|
288
|
+
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.7/src/commands/agent/generate/template.ts)_
|
|
289
289
|
|
|
290
290
|
## `sf agent generate test-spec`
|
|
291
291
|
|
|
@@ -343,7 +343,7 @@ EXAMPLES
|
|
|
343
343
|
force-app//main/default/aiEvaluationDefinitions/Resort_Manager_Tests.aiEvaluationDefinition-meta.xml
|
|
344
344
|
```
|
|
345
345
|
|
|
346
|
-
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.
|
|
346
|
+
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.7/src/commands/agent/generate/test-spec.ts)_
|
|
347
347
|
|
|
348
348
|
## `sf agent preview`
|
|
349
349
|
|
|
@@ -419,7 +419,7 @@ EXAMPLES
|
|
|
419
419
|
"transcripts/my-preview"
|
|
420
420
|
```
|
|
421
421
|
|
|
422
|
-
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.
|
|
422
|
+
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.7/src/commands/agent/preview.ts)_
|
|
423
423
|
|
|
424
424
|
## `sf agent test create`
|
|
425
425
|
|
|
@@ -474,7 +474,7 @@ EXAMPLES
|
|
|
474
474
|
$ sf agent test create --spec specs/Resort_Manager-testSpec.yaml --test-api-name Resort_Manager_Test --preview
|
|
475
475
|
```
|
|
476
476
|
|
|
477
|
-
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.
|
|
477
|
+
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.7/src/commands/agent/test/create.ts)_
|
|
478
478
|
|
|
479
479
|
## `sf agent test list`
|
|
480
480
|
|
|
@@ -509,7 +509,7 @@ EXAMPLES
|
|
|
509
509
|
$ sf agent test list --target-org my-org
|
|
510
510
|
```
|
|
511
511
|
|
|
512
|
-
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.
|
|
512
|
+
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.7/src/commands/agent/test/list.ts)_
|
|
513
513
|
|
|
514
514
|
## `sf agent test results`
|
|
515
515
|
|
|
@@ -565,7 +565,7 @@ FLAG DESCRIPTIONS
|
|
|
565
565
|
test results aren't written.
|
|
566
566
|
```
|
|
567
567
|
|
|
568
|
-
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.
|
|
568
|
+
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.7/src/commands/agent/test/results.ts)_
|
|
569
569
|
|
|
570
570
|
## `sf agent test resume`
|
|
571
571
|
|
|
@@ -628,7 +628,7 @@ FLAG DESCRIPTIONS
|
|
|
628
628
|
test results aren't written.
|
|
629
629
|
```
|
|
630
630
|
|
|
631
|
-
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.
|
|
631
|
+
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.7/src/commands/agent/test/resume.ts)_
|
|
632
632
|
|
|
633
633
|
## `sf agent test run`
|
|
634
634
|
|
|
@@ -692,6 +692,6 @@ FLAG DESCRIPTIONS
|
|
|
692
692
|
test results aren't written.
|
|
693
693
|
```
|
|
694
694
|
|
|
695
|
-
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.
|
|
695
|
+
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.20.7/src/commands/agent/test/run.ts)_
|
|
696
696
|
|
|
697
697
|
<!-- commandsstop -->
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import type { BotTemplate, GenAiPlanner, BotDialogGroup, ConversationDefinitionGoal, ConversationVariable } from '@salesforce/types/metadata';
|
|
3
|
+
export type GenAiPlannerBundleExt = {
|
|
4
|
+
GenAiPlannerBundle: GenAiPlanner & {
|
|
5
|
+
botTemplate?: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export type BotTemplateExt = {
|
|
9
|
+
'?xml': {
|
|
10
|
+
'@_version': '1.0';
|
|
11
|
+
'@_encoding': 'UTF-8';
|
|
12
|
+
};
|
|
13
|
+
BotTemplate: Omit<BotTemplate, 'botDialogGroups' | 'conversationGoals' | 'conversationVariables'> & {
|
|
14
|
+
agentType?: string;
|
|
15
|
+
botDialogGroups?: BotDialogGroup[];
|
|
16
|
+
conversationGoals?: ConversationDefinitionGoal[];
|
|
17
|
+
conversationVariables?: ConversationVariable[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
2
20
|
export type AgentGenerateTemplateResult = {
|
|
3
|
-
|
|
21
|
+
genAiPlannerBundlePath: string;
|
|
4
22
|
botTemplatePath: string;
|
|
5
23
|
};
|
|
6
24
|
export default class AgentGenerateTemplate extends SfCommand<AgentGenerateTemplateResult> {
|
|
@@ -34,36 +34,36 @@ export default class AgentGenerateTemplate extends SfCommand {
|
|
|
34
34
|
const { flags } = await this.parse(AgentGenerateTemplate);
|
|
35
35
|
const { 'agent-file': agentFile, 'agent-version': botVersion } = flags;
|
|
36
36
|
if (!agentFile.endsWith('.bot-meta.xml')) {
|
|
37
|
-
throw new SfError('
|
|
37
|
+
throw new SfError(messages.getMessage('error.invalid-agent-file'));
|
|
38
38
|
}
|
|
39
39
|
const parser = new XMLParser({ ignoreAttributes: false });
|
|
40
40
|
const builder = new XMLBuilder({ format: true, ignoreAttributes: false, indentBy: ' ' });
|
|
41
41
|
const botName = basename(agentFile, '.bot-meta.xml');
|
|
42
|
-
// Since we are cloning the
|
|
42
|
+
// Since we are cloning the GenAiPlannerBundle, we need to use a different name than the Agent (Bot) we started with
|
|
43
43
|
// We will use this name for the BotTemplate also to make it clear they are related
|
|
44
44
|
const finalFilename = `${botName}_v${botVersion}_Template`;
|
|
45
45
|
// Build the base dir from the AgentFile
|
|
46
46
|
const basePath = resolve(dirname(agentFile), '..', '..');
|
|
47
47
|
const botDir = join(basePath, 'bots', botName);
|
|
48
|
-
const
|
|
48
|
+
const genAiPlannerBundleDir = join(basePath, 'genAiPlannerBundles');
|
|
49
49
|
const botTemplateDir = join(basePath, 'botTemplates');
|
|
50
50
|
const botTemplateFilePath = join(botTemplateDir, `${finalFilename}.botTemplate-meta.xml`);
|
|
51
|
-
const
|
|
51
|
+
const clonedGenAiPlannerBundleFilePath = join(genAiPlannerBundleDir, finalFilename, `${finalFilename}.genAiPlannerBundle`);
|
|
52
52
|
// Parse the metadata files as JSON
|
|
53
53
|
const botJson = xmlToJson(join(botDir, `${botName}.bot-meta.xml`), parser);
|
|
54
54
|
const botVersionJson = xmlToJson(join(botDir, `v${botVersion}.botVersion-meta.xml`), parser);
|
|
55
|
-
const
|
|
55
|
+
const genAiPlannerBundleMetaJson = xmlToJson(join(genAiPlannerBundleDir, botName, `${botName}.genAiPlannerBundle`), parser);
|
|
56
56
|
// Modify the metadata files for final output
|
|
57
57
|
// TODO: Confirm this name (might be conversationDefinitionPlanners)
|
|
58
|
-
|
|
58
|
+
genAiPlannerBundleMetaJson.GenAiPlannerBundle.botTemplate = finalFilename;
|
|
59
59
|
const botTemplate = convertBotToBotTemplate(botJson, botVersionJson, finalFilename, botTemplateFilePath);
|
|
60
60
|
// Build and save the metadata files
|
|
61
|
-
jsonToXml(
|
|
61
|
+
jsonToXml(clonedGenAiPlannerBundleFilePath, genAiPlannerBundleMetaJson, builder);
|
|
62
62
|
jsonToXml(botTemplateFilePath, botTemplate, builder);
|
|
63
63
|
this.log(`\nSaved BotTemplate to:\n - ${botTemplateFilePath}`);
|
|
64
|
-
this.log(`Saved
|
|
64
|
+
this.log(`Saved GenAiPlannerBundle to:\n - ${clonedGenAiPlannerBundleFilePath}`);
|
|
65
65
|
return {
|
|
66
|
-
|
|
66
|
+
genAiPlannerBundlePath: clonedGenAiPlannerBundleFilePath,
|
|
67
67
|
botTemplatePath: botTemplateFilePath,
|
|
68
68
|
};
|
|
69
69
|
}
|
|
@@ -75,13 +75,16 @@ const convertBotToBotTemplate = (bot, botVersionJson, newMlDomainName, botFilePa
|
|
|
75
75
|
// This will be added to the BotTemplate
|
|
76
76
|
const entryDialogJson = botVersionJson.BotVersion.botDialogs.find((dialog) => dialog.developerName === entryDialog);
|
|
77
77
|
if (!entryDialogJson)
|
|
78
|
-
throw new SfError('
|
|
78
|
+
throw new SfError(messages.getMessage('error.no-entry-dialog'));
|
|
79
79
|
// TODO: Test this on a newer org. I had to have this renamed.
|
|
80
80
|
entryDialogJson.label = entryDialog;
|
|
81
|
+
// Validate the Bot file to ensure successful Agent creation from a BotTemplate
|
|
82
|
+
if (bot.Bot.type === 'Bot')
|
|
83
|
+
throw new SfError(messages.getMessage('error.invalid-bot-type', [botFilePath]));
|
|
81
84
|
if (!bot.Bot.label)
|
|
82
|
-
throw new SfError(
|
|
85
|
+
throw new SfError(messages.getMessage('error.no-label', [botFilePath]));
|
|
83
86
|
if (!bot.Bot.botMlDomain)
|
|
84
|
-
throw new SfError(
|
|
87
|
+
throw new SfError(messages.getMessage('error.no-ml-domain', [botFilePath]));
|
|
85
88
|
const masterLabel = bot.Bot.label;
|
|
86
89
|
const mlDomain = bot.Bot.botMlDomain;
|
|
87
90
|
delete bot.Bot.botMlDomain;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/template.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,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,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAElD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAW,CAAC;QAC1C,aAAa,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,OAAO,CAAC,wBAAwB,QAAQ,EAAE,CAAC,CAAC;IACxD,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the BSD 3-Clause license.
|
|
5
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
6
|
*/
|
|
7
|
-
import { resolve } from 'node:path';
|
|
7
|
+
import { resolve, join } from 'node:path';
|
|
8
8
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
9
9
|
import { Messages, SfError } from '@salesforce/core';
|
|
10
10
|
import React from 'react';
|
|
@@ -115,7 +115,7 @@ export const resolveOutputDir = async (outputDir) => {
|
|
|
115
115
|
if (response) {
|
|
116
116
|
const getDir = await input({
|
|
117
117
|
message: 'Enter the output directory',
|
|
118
|
-
default: env.getString('SF_AGENT_PREVIEW_OUTPUT_DIR', 'temp
|
|
118
|
+
default: env.getString('SF_AGENT_PREVIEW_OUTPUT_DIR', join('temp', 'agent-preview')),
|
|
119
119
|
required: true,
|
|
120
120
|
});
|
|
121
121
|
return resolve(getDir);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview.js","sourceRoot":"","sources":["../../../src/commands/agent/preview.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"preview.js","sourceRoot":"","sources":["../../../src/commands/agent/preview.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,E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OAAO,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -23,3 +23,23 @@ Version of the agent (BotVersion).
|
|
|
23
23
|
# flags.agent-file.summary
|
|
24
24
|
|
|
25
25
|
Path to an agent (Bot) metadata file.
|
|
26
|
+
|
|
27
|
+
# error.invalid-agent-file
|
|
28
|
+
|
|
29
|
+
Invalid Agent file. Must be a Bot metadata file. Example: force-app/main/default/bots/MyBot/MyBot.bot-meta.xml
|
|
30
|
+
|
|
31
|
+
# error.no-entry-dialog
|
|
32
|
+
|
|
33
|
+
No entryDialog found in BotVersion file.
|
|
34
|
+
|
|
35
|
+
# error.invalid-bot-type
|
|
36
|
+
|
|
37
|
+
The 'type' attribute of this Bot metadata component XML file can't have a value of 'Bot', which indicates that it's an Einstein Bot and not an agent: %s.
|
|
38
|
+
|
|
39
|
+
# error.no-label
|
|
40
|
+
|
|
41
|
+
No label found in Agent (Bot) file: %s.
|
|
42
|
+
|
|
43
|
+
# error.no-ml-domain
|
|
44
|
+
|
|
45
|
+
No botMlDomain found in Agent (Bot) file: %s.
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-agent",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.7",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@salesforce/plugin-agent",
|
|
9
|
-
"version": "1.20.
|
|
9
|
+
"version": "1.20.7",
|
|
10
10
|
"license": "BSD-3-Clause",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@inquirer/core": "^10.1.6",
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-agent",
|
|
3
3
|
"description": "Commands to interact with Salesforce agents",
|
|
4
|
-
"version": "1.20.
|
|
4
|
+
"version": "1.20.7",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"prepack": "sf-prepack",
|
|
105
105
|
"prepare": "sf-install",
|
|
106
106
|
"test": "wireit",
|
|
107
|
-
"test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel",
|
|
107
|
+
"test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --reporter-options maxDiffSize=15000",
|
|
108
108
|
"test:only": "wireit",
|
|
109
109
|
"version": "oclif readme"
|
|
110
110
|
},
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
"exports": "./lib/index.js",
|
|
230
230
|
"type": "module",
|
|
231
231
|
"sfdx": {
|
|
232
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.20.
|
|
233
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.20.
|
|
232
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.20.7.crt",
|
|
233
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.20.7.sig"
|
|
234
234
|
}
|
|
235
235
|
}
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
"AgentGenerateTemplateResult": {
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
8
|
+
"genAiPlannerBundlePath": {
|
|
9
9
|
"type": "string"
|
|
10
10
|
},
|
|
11
11
|
"botTemplatePath": {
|
|
12
12
|
"type": "string"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
|
-
"required": ["
|
|
15
|
+
"required": ["genAiPlannerBundlePath", "botTemplatePath"],
|
|
16
16
|
"additionalProperties": false
|
|
17
17
|
}
|
|
18
18
|
}
|