@salesforce/plugin-agent 1.14.5-dev.5 → 1.15.1-dev.0
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 +20 -19
- package/lib/commands/agent/generate/template.d.ts +4 -3
- package/lib/commands/agent/generate/template.js +108 -20
- package/lib/commands/agent/generate/template.js.map +1 -1
- package/lib/commands/agent/generate/test-spec.d.ts +1 -1
- package/lib/commands/agent/generate/test-spec.js +6 -7
- package/lib/commands/agent/generate/test-spec.js.map +1 -1
- package/messages/agent.generate.template.md +7 -7
- package/npm-shrinkwrap.json +17 -7
- package/oclif.lock +9 -4
- package/oclif.manifest.json +10 -10
- package/package.json +6 -5
- package/schemas/agent-generate-template.json +5 -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.
|
|
135
|
+
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/create.ts)_
|
|
136
136
|
|
|
137
137
|
## `sf agent generate agent-spec`
|
|
138
138
|
|
|
@@ -236,7 +236,7 @@ EXAMPLES
|
|
|
236
236
|
$ sf agent generate agent-spec --tone formal --agent-user resortmanager@myorg.com
|
|
237
237
|
```
|
|
238
238
|
|
|
239
|
-
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
239
|
+
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/generate/agent-spec.ts)_
|
|
240
240
|
|
|
241
241
|
## `sf agent generate template`
|
|
242
242
|
|
|
@@ -244,15 +244,15 @@ Generate an agent template for packaging.
|
|
|
244
244
|
|
|
245
245
|
```
|
|
246
246
|
USAGE
|
|
247
|
-
$ sf agent generate template -o <value> --agent-
|
|
247
|
+
$ sf agent generate template -o <value> --agent-version <value> -f <value> [--json] [--flags-dir <value>] [--api-version
|
|
248
248
|
<value>]
|
|
249
249
|
|
|
250
250
|
FLAGS
|
|
251
|
-
-
|
|
252
|
-
-o, --target-org=<value>
|
|
253
|
-
|
|
254
|
-
--agent-
|
|
255
|
-
--api-version=<value>
|
|
251
|
+
-f, --agent-file=<value> (required) The path to an Agent (Bot) file.
|
|
252
|
+
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
253
|
+
configuration variable is already set.
|
|
254
|
+
--agent-version=<value> (required) Version of the Agent (botVersion).
|
|
255
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
256
256
|
|
|
257
257
|
GLOBAL FLAGS
|
|
258
258
|
--flags-dir=<value> Import flag values from a directory.
|
|
@@ -264,12 +264,13 @@ DESCRIPTION
|
|
|
264
264
|
Generate agent template metadata to for packaging your agent.
|
|
265
265
|
|
|
266
266
|
EXAMPLES
|
|
267
|
-
Generate an agent template from a Bot
|
|
267
|
+
Generate an agent template from a Bot metadata file in your project:
|
|
268
268
|
|
|
269
|
-
$ sf agent generate template --agent-
|
|
269
|
+
$ sf agent generate template --agent-file \
|
|
270
|
+
force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1
|
|
270
271
|
```
|
|
271
272
|
|
|
272
|
-
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
273
|
+
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/generate/template.ts)_
|
|
273
274
|
|
|
274
275
|
## `sf agent generate test-spec`
|
|
275
276
|
|
|
@@ -281,7 +282,7 @@ USAGE
|
|
|
281
282
|
|
|
282
283
|
FLAGS
|
|
283
284
|
-d, --output-dir=<value> [default: specs] The directory to save the generated spec file.
|
|
284
|
-
-f, --output-file=<value>
|
|
285
|
+
-f, --output-file=<value> The name of the generated spec file.
|
|
285
286
|
|
|
286
287
|
GLOBAL FLAGS
|
|
287
288
|
--flags-dir=<value> Import flag values from a directory.
|
|
@@ -296,7 +297,7 @@ EXAMPLES
|
|
|
296
297
|
$ sf agent generate test-spec
|
|
297
298
|
```
|
|
298
299
|
|
|
299
|
-
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
300
|
+
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/generate/test-spec.ts)_
|
|
300
301
|
|
|
301
302
|
## `sf agent preview`
|
|
302
303
|
|
|
@@ -331,7 +332,7 @@ FLAG DESCRIPTIONS
|
|
|
331
332
|
the API name of the agent? (TBD based on agents library)
|
|
332
333
|
```
|
|
333
334
|
|
|
334
|
-
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
335
|
+
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/preview.ts)_
|
|
335
336
|
|
|
336
337
|
## `sf agent test create`
|
|
337
338
|
|
|
@@ -367,7 +368,7 @@ EXAMPLES
|
|
|
367
368
|
$ sf agent test create
|
|
368
369
|
```
|
|
369
370
|
|
|
370
|
-
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
371
|
+
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/test/create.ts)_
|
|
371
372
|
|
|
372
373
|
## `sf agent test list`
|
|
373
374
|
|
|
@@ -396,7 +397,7 @@ EXAMPLES
|
|
|
396
397
|
$ sf agent test list
|
|
397
398
|
```
|
|
398
399
|
|
|
399
|
-
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
400
|
+
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/test/list.ts)_
|
|
400
401
|
|
|
401
402
|
## `sf agent test results`
|
|
402
403
|
|
|
@@ -452,7 +453,7 @@ FLAG DESCRIPTIONS
|
|
|
452
453
|
test results aren't written.
|
|
453
454
|
```
|
|
454
455
|
|
|
455
|
-
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
456
|
+
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/test/results.ts)_
|
|
456
457
|
|
|
457
458
|
## `sf agent test resume`
|
|
458
459
|
|
|
@@ -515,7 +516,7 @@ FLAG DESCRIPTIONS
|
|
|
515
516
|
test results aren't written.
|
|
516
517
|
```
|
|
517
518
|
|
|
518
|
-
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
519
|
+
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/test/resume.ts)_
|
|
519
520
|
|
|
520
521
|
## `sf agent test run`
|
|
521
522
|
|
|
@@ -578,6 +579,6 @@ FLAG DESCRIPTIONS
|
|
|
578
579
|
test results aren't written.
|
|
579
580
|
```
|
|
580
581
|
|
|
581
|
-
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
582
|
+
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.15.1-dev.0/src/commands/agent/test/run.ts)_
|
|
582
583
|
|
|
583
584
|
<!-- commandsstop -->
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
2
|
export type AgentGenerateTemplateResult = {
|
|
3
|
-
|
|
3
|
+
genAiPlannerPath: string;
|
|
4
|
+
botTemplatePath: string;
|
|
4
5
|
};
|
|
5
6
|
export default class AgentGenerateTemplate extends SfCommand<AgentGenerateTemplateResult> {
|
|
6
7
|
static readonly summary: string;
|
|
@@ -11,8 +12,8 @@ export default class AgentGenerateTemplate extends SfCommand<AgentGenerateTempla
|
|
|
11
12
|
static readonly flags: {
|
|
12
13
|
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
14
|
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
-
'agent-
|
|
15
|
-
'
|
|
15
|
+
'agent-version': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'agent-file': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
17
|
};
|
|
17
18
|
run(): Promise<AgentGenerateTemplateResult>;
|
|
18
19
|
}
|
|
@@ -4,10 +4,11 @@
|
|
|
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 { dirname,
|
|
8
|
-
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
7
|
+
import { join, dirname, basename, resolve } from 'node:path';
|
|
8
|
+
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
9
9
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
10
|
-
import { Messages } from '@salesforce/core';
|
|
10
|
+
import { Messages, SfError } from '@salesforce/core';
|
|
11
|
+
import { XMLParser, XMLBuilder } from 'fast-xml-parser';
|
|
11
12
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
12
13
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.generate.template');
|
|
13
14
|
export default class AgentGenerateTemplate extends SfCommand {
|
|
@@ -19,30 +20,117 @@ export default class AgentGenerateTemplate extends SfCommand {
|
|
|
19
20
|
static flags = {
|
|
20
21
|
'target-org': Flags.requiredOrg(),
|
|
21
22
|
'api-version': Flags.orgApiVersion(),
|
|
22
|
-
'agent-
|
|
23
|
-
summary: messages.getMessage('flags.agent-
|
|
23
|
+
'agent-version': Flags.integer({
|
|
24
|
+
summary: messages.getMessage('flags.agent-version.summary'),
|
|
24
25
|
required: true,
|
|
25
26
|
}),
|
|
26
|
-
'
|
|
27
|
-
|
|
27
|
+
'agent-file': Flags.file({
|
|
28
|
+
summary: messages.getMessage('flags.agent-file.summary'),
|
|
29
|
+
char: 'f',
|
|
30
|
+
required: true,
|
|
28
31
|
exists: true,
|
|
29
|
-
summary: messages.getMessage('flags.output-dir.summary'),
|
|
30
32
|
}),
|
|
31
33
|
};
|
|
32
34
|
async run() {
|
|
33
35
|
const { flags } = await this.parse(AgentGenerateTemplate);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
const { 'agent-file': agentFile, 'agent-version': botVersion } = flags;
|
|
37
|
+
if (!agentFile.endsWith('.bot-meta.xml')) {
|
|
38
|
+
throw new SfError('Invalid Agent file. Must be a Bot metadata file. Example: force-app/main/default/bots/MyBot.bot-meta.xml');
|
|
39
|
+
}
|
|
40
|
+
const parser = new XMLParser({ ignoreAttributes: false });
|
|
41
|
+
const builder = new XMLBuilder({ format: true, ignoreAttributes: false, indentBy: ' ' });
|
|
42
|
+
const botName = basename(agentFile).replace('.bot-meta.xml', '');
|
|
43
|
+
// Since we are cloning the GenAiPlanner, we need to use a different name than the Agent (Bot) we started with
|
|
44
|
+
// We will use this name for the BotTemplate also to make it clear they are related
|
|
45
|
+
const finalFilename = `${botName}_v${botVersion}_Template`;
|
|
46
|
+
// Build the base dir from the AgentFile
|
|
47
|
+
const basePath = resolve(dirname(agentFile), '..', '..');
|
|
48
|
+
const botDir = join(basePath, 'bots', botName);
|
|
49
|
+
const genAiPlannerDir = join(basePath, 'genAiPlanners');
|
|
50
|
+
const botTemplateDir = join(basePath, 'botTemplates');
|
|
51
|
+
const botTemplateFilePath = join(botTemplateDir, `${finalFilename}.botTemplate-meta.xml`);
|
|
52
|
+
const clonedGenAiPlannerFilePath = join(genAiPlannerDir, `${finalFilename}.genAiPlanner-meta.xml`);
|
|
53
|
+
// Parse the metadata files as JSON
|
|
54
|
+
const botJson = xmlToJson(join(botDir, `${botName}.bot-meta.xml`), parser);
|
|
55
|
+
const botVersionJson = xmlToJson(join(botDir, `v${botVersion}.botVersion-meta.xml`), parser);
|
|
56
|
+
const genAiPlannerMetaJson = xmlToJson(join(genAiPlannerDir, `${botName}.genAiPlanner-meta.xml`), parser);
|
|
57
|
+
// Modify the metadata files for final output
|
|
58
|
+
// TODO: Confirm this name (might be conversationDefinitionPlanners)
|
|
59
|
+
genAiPlannerMetaJson.GenAiPlanner.botTemplate = finalFilename;
|
|
60
|
+
const botTemplate = convertBotToBotTemplate(botJson, botVersionJson, finalFilename, botTemplateFilePath);
|
|
61
|
+
// Build and save the metadata files
|
|
62
|
+
jsonToXml(clonedGenAiPlannerFilePath, genAiPlannerMetaJson, builder);
|
|
63
|
+
jsonToXml(botTemplateFilePath, botTemplate, builder);
|
|
64
|
+
this.log(`\nSaved BotTemplate to:\n - ${botTemplateFilePath}`);
|
|
65
|
+
this.log(`Saved GenAiPlanner to:\n - ${clonedGenAiPlannerFilePath}`);
|
|
66
|
+
return {
|
|
67
|
+
genAiPlannerPath: clonedGenAiPlannerFilePath,
|
|
68
|
+
botTemplatePath: botTemplateFilePath,
|
|
69
|
+
};
|
|
42
70
|
}
|
|
43
71
|
}
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
72
|
+
const convertBotToBotTemplate = (bot, botVersionJson, newMlDomainName, botFilePath) => {
|
|
73
|
+
const entryDialog = botVersionJson.BotVersion.entryDialog;
|
|
74
|
+
const { conversationSystemDialogs } = botVersionJson.BotVersion;
|
|
75
|
+
// We need to pull the botDialog from the BotVersion file that matches the entryDialog
|
|
76
|
+
// This will be added to the BotTemplate
|
|
77
|
+
const entryDialogJson = botVersionJson.BotVersion.botDialogs.find((dialog) => dialog.developerName === entryDialog);
|
|
78
|
+
if (!entryDialogJson)
|
|
79
|
+
throw new SfError('No entryDialog found in BotVersion file');
|
|
80
|
+
// TODO: Test this on a newer org. I had to have this renamed.
|
|
81
|
+
entryDialogJson.label = entryDialog;
|
|
82
|
+
if (!bot.Bot.label)
|
|
83
|
+
throw new SfError(`No label found in Agent (Bot) file: ${botFilePath}`);
|
|
84
|
+
if (!bot.Bot.botMlDomain)
|
|
85
|
+
throw new SfError(`No botMlDomain found in Agent (Bot) file: ${botFilePath}`);
|
|
86
|
+
const masterLabel = bot.Bot.label;
|
|
87
|
+
const mlDomain = bot.Bot.botMlDomain;
|
|
88
|
+
delete bot.Bot.botMlDomain;
|
|
89
|
+
delete bot.Bot.label;
|
|
90
|
+
delete bot.Bot.botUser;
|
|
91
|
+
delete bot.Bot.logPrivateConversationData;
|
|
92
|
+
delete bot.Bot.sessionTimeout;
|
|
93
|
+
// botDialogGroups is not required
|
|
94
|
+
const botTemplate = {
|
|
95
|
+
BotTemplate: {
|
|
96
|
+
masterLabel,
|
|
97
|
+
conversationLanguages: 'en_US',
|
|
98
|
+
mainMenuDialog: 'Main_Menu',
|
|
99
|
+
botDialogs: [
|
|
100
|
+
{
|
|
101
|
+
developerName: 'Main_Menu',
|
|
102
|
+
isPlaceholderDialog: false,
|
|
103
|
+
label: 'Main_Menu',
|
|
104
|
+
showInFooterMenu: false,
|
|
105
|
+
botSteps: [],
|
|
106
|
+
},
|
|
107
|
+
entryDialogJson,
|
|
108
|
+
],
|
|
109
|
+
conversationSystemDialogs,
|
|
110
|
+
entryDialog,
|
|
111
|
+
mlDomain,
|
|
112
|
+
...bot.Bot,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
// TODO: Test this on a newer org. I had to have this renamed to avoid a conflict.
|
|
116
|
+
botTemplate.BotTemplate.mlDomain.name = newMlDomainName;
|
|
117
|
+
return botTemplate;
|
|
118
|
+
};
|
|
119
|
+
const xmlToJson = (path, parser) => {
|
|
120
|
+
const file = readFileSync(path, 'utf8');
|
|
121
|
+
if (!file)
|
|
122
|
+
throw new SfError(`No metadata file found at ${path}`);
|
|
123
|
+
return parser.parse(file);
|
|
124
|
+
};
|
|
125
|
+
const jsonToXml = (filename, json, builder) => {
|
|
126
|
+
// Ensure output dir exists (dir of filename)
|
|
127
|
+
mkdirSync(dirname(filename), { recursive: true });
|
|
128
|
+
try {
|
|
129
|
+
const xml = builder.build(json);
|
|
130
|
+
writeFileSync(filename, xml);
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
throw new SfError(`Failed save to file: ${filename}`);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
48
136
|
//# sourceMappingURL=template.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/template.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,
|
|
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,SAAS,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAgCxD,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,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AAM,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAI,QAAgB,EAAE,IAAO,EAAE,OAAmB,EAAQ,EAAE;IAC5E,6CAA6C;IAC7C,SAAS,CAAC,OAAO,CAAC,QAAQ,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"}
|
|
@@ -7,7 +7,7 @@ export default class AgentGenerateTestSpec extends SfCommand<void> {
|
|
|
7
7
|
static readonly state = "beta";
|
|
8
8
|
static readonly flags: {
|
|
9
9
|
'output-dir': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
-
'output-file': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'output-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
};
|
|
12
12
|
run(): Promise<void>;
|
|
13
13
|
}
|
|
@@ -9,7 +9,7 @@ import { join } from 'node:path';
|
|
|
9
9
|
import { existsSync } from 'node:fs';
|
|
10
10
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
11
11
|
import { Messages, SfError, SfProject } from '@salesforce/core';
|
|
12
|
-
import {
|
|
12
|
+
import { writeTestSpec } from '@salesforce/agents';
|
|
13
13
|
import { select, input, confirm, checkbox } from '@inquirer/prompts';
|
|
14
14
|
import { XMLParser } from 'fast-xml-parser';
|
|
15
15
|
import { ComponentSetBuilder } from '@salesforce/source-deploy-retrieve';
|
|
@@ -148,7 +148,6 @@ export default class AgentGenerateTestSpec extends SfCommand {
|
|
|
148
148
|
'output-file': Flags.string({
|
|
149
149
|
char: 'f',
|
|
150
150
|
summary: messages.getMessage('flags.output-file.summary'),
|
|
151
|
-
default: 'agentTestSpec.yaml',
|
|
152
151
|
}),
|
|
153
152
|
};
|
|
154
153
|
async run() {
|
|
@@ -175,6 +174,10 @@ export default class AgentGenerateTestSpec extends SfCommand {
|
|
|
175
174
|
choices: bots,
|
|
176
175
|
theme,
|
|
177
176
|
});
|
|
177
|
+
const outputFile = join(flags['output-dir'], flags['output-file'] ?? `${subjectName}-agentTestSpec.yaml`);
|
|
178
|
+
if (existsSync(outputFile)) {
|
|
179
|
+
await this.confirm({ message: `File ${outputFile} already exists. Overwrite?`, defaultAnswer: false });
|
|
180
|
+
}
|
|
178
181
|
const { genAiPlugins, genAiFunctions } = await getPluginsAndFunctions(subjectName, cs);
|
|
179
182
|
const name = await input({
|
|
180
183
|
message: 'Enter a name for the test definition',
|
|
@@ -203,11 +206,7 @@ export default class AgentGenerateTestSpec extends SfCommand {
|
|
|
203
206
|
default: true,
|
|
204
207
|
}));
|
|
205
208
|
this.log();
|
|
206
|
-
|
|
207
|
-
if (existsSync(outputFile)) {
|
|
208
|
-
await this.confirm({ message: `File ${outputFile} already exists. Overwrite?`, defaultAnswer: false });
|
|
209
|
-
}
|
|
210
|
-
await generateTestSpec({
|
|
209
|
+
await writeTestSpec({
|
|
211
210
|
name,
|
|
212
211
|
description,
|
|
213
212
|
subjectType,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-spec.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/test-spec.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE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QACrB,GAAG,CAAC;YACF,IAAI,CAAC,GAAG,EAAE,CAAC;YACX,IAAI,CAAC,YAAY,CAAC,qBAAqB,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC;YAC/D,4CAA4C;YAC5C,SAAS,CAAC,IAAI,CAAC,MAAM,iBAAiB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC;QACxE,CAAC,SAAS,4CAA4C;QACpD,MAAM,OAAO,CAAC;YACZ,OAAO,EAAE,yCAAyC;YAClD,OAAO,EAAE,IAAI;SACd,CAAC,EACF;QAEF,IAAI,CAAC,GAAG,EAAE,CAAC;QAEX,MAAM,aAAa,CACjB;YACE,IAAI;YACJ,WAAW;YACX,WAAW;YACX,WAAW;YACX,SAAS;SACV,EACD,UAAU,CACX,CAAC;QACF,IAAI,CAAC,GAAG,CAAC,WAAW,UAAU,EAAE,CAAC,CAAC;IACpC,CAAC"}
|
|
@@ -6,16 +6,16 @@ Generate an agent template for packaging.
|
|
|
6
6
|
|
|
7
7
|
Generate agent template metadata to for packaging your agent.
|
|
8
8
|
|
|
9
|
-
#
|
|
9
|
+
# examples
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
- Generate an agent template from a Bot metadata file in your project:
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
<%= config.bin %> <%= command.id %> --agent-file force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
# flags.agent-version.summary
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Version of the Agent (botVersion).
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
# flags.agent-file.summary
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
The path to an Agent (Bot) file.
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-agent",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.1-dev.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@salesforce/plugin-agent",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.15.1-dev.0",
|
|
10
10
|
"license": "BSD-3-Clause",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@inquirer/core": "^10.1.6",
|
|
@@ -14,14 +14,15 @@
|
|
|
14
14
|
"@inquirer/prompts": "^7.2.0",
|
|
15
15
|
"@oclif/core": "^4",
|
|
16
16
|
"@oclif/multi-stage-output": "^0.7.12",
|
|
17
|
-
"@salesforce/agents": "0.9.8-dev.
|
|
17
|
+
"@salesforce/agents": "0.9.8-dev.1",
|
|
18
18
|
"@salesforce/core": "^8.8.0",
|
|
19
19
|
"@salesforce/kit": "^3.2.1",
|
|
20
20
|
"@salesforce/sf-plugins-core": "^12.1.0",
|
|
21
21
|
"@salesforce/source-deploy-retrieve": "^12.14.0",
|
|
22
|
+
"@salesforce/types": "^1.3.0",
|
|
22
23
|
"ansis": "^3.3.2",
|
|
23
24
|
"fast-xml-parser": "^4.5.1",
|
|
24
|
-
"ink": "
|
|
25
|
+
"ink": "5.0.1",
|
|
25
26
|
"ink-text-input": "^6.0.0",
|
|
26
27
|
"inquirer-autocomplete-standalone": "^0.8.1",
|
|
27
28
|
"react": "^18.3.1",
|
|
@@ -3737,9 +3738,9 @@
|
|
|
3737
3738
|
}
|
|
3738
3739
|
},
|
|
3739
3740
|
"node_modules/@salesforce/agents": {
|
|
3740
|
-
"version": "0.9.8-dev.
|
|
3741
|
-
"resolved": "https://registry.npmjs.org/@salesforce/agents/-/agents-0.9.8-dev.
|
|
3742
|
-
"integrity": "sha512-
|
|
3741
|
+
"version": "0.9.8-dev.1",
|
|
3742
|
+
"resolved": "https://registry.npmjs.org/@salesforce/agents/-/agents-0.9.8-dev.1.tgz",
|
|
3743
|
+
"integrity": "sha512-HFupkCFn4EE4rdt7ZPgDOAhhiaHaUKS2HkiG/sQ4HxLPD4OtQBjLSs6lBetcw0qrBu8+oePi8SXetZSy8kJq5A==",
|
|
3743
3744
|
"license": "BSD-3-Clause",
|
|
3744
3745
|
"dependencies": {
|
|
3745
3746
|
"@salesforce/core": "^8.8.2",
|
|
@@ -4223,6 +4224,15 @@
|
|
|
4223
4224
|
"node": ">=18.0.0"
|
|
4224
4225
|
}
|
|
4225
4226
|
},
|
|
4227
|
+
"node_modules/@salesforce/types": {
|
|
4228
|
+
"version": "1.3.0",
|
|
4229
|
+
"resolved": "https://registry.npmjs.org/@salesforce/types/-/types-1.3.0.tgz",
|
|
4230
|
+
"integrity": "sha512-tcjBZrzCukOVIVm7mLHefsfDMyd+MTWWFWXk5wbdIQa+hiehUSA2SG0B0cpDMuOaIa9UiBm/SQCI+zznlt6W6g==",
|
|
4231
|
+
"license": "BSD-3-Clause",
|
|
4232
|
+
"engines": {
|
|
4233
|
+
"node": ">=18"
|
|
4234
|
+
}
|
|
4235
|
+
},
|
|
4226
4236
|
"node_modules/@shikijs/core": {
|
|
4227
4237
|
"version": "1.12.0",
|
|
4228
4238
|
"resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.12.0.tgz",
|
package/oclif.lock
CHANGED
|
@@ -1512,10 +1512,10 @@
|
|
|
1512
1512
|
resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33"
|
|
1513
1513
|
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==
|
|
1514
1514
|
|
|
1515
|
-
"@salesforce/agents@0.9.8-dev.
|
|
1516
|
-
version "0.9.8-dev.
|
|
1517
|
-
resolved "https://registry.yarnpkg.com/@salesforce/agents/-/agents-0.9.8-dev.
|
|
1518
|
-
integrity sha512-
|
|
1515
|
+
"@salesforce/agents@0.9.8-dev.1":
|
|
1516
|
+
version "0.9.8-dev.1"
|
|
1517
|
+
resolved "https://registry.yarnpkg.com/@salesforce/agents/-/agents-0.9.8-dev.1.tgz#317893b7c1f06f5f953972a4c97953016c37fb10"
|
|
1518
|
+
integrity sha512-HFupkCFn4EE4rdt7ZPgDOAhhiaHaUKS2HkiG/sQ4HxLPD4OtQBjLSs6lBetcw0qrBu8+oePi8SXetZSy8kJq5A==
|
|
1519
1519
|
dependencies:
|
|
1520
1520
|
"@salesforce/core" "^8.8.2"
|
|
1521
1521
|
"@salesforce/kit" "^3.2.3"
|
|
@@ -1711,6 +1711,11 @@
|
|
|
1711
1711
|
resolved "https://registry.yarnpkg.com/@salesforce/ts-types/-/ts-types-2.0.12.tgz#60420622812a7ec7e46d220667bc29b42dc247ff"
|
|
1712
1712
|
integrity sha512-BIJyduJC18Kc8z+arUm5AZ9VkPRyw1KKAm+Tk+9LT99eOzhNilyfKzhZ4t+tG2lIGgnJpmytZfVDZ0e2kFul8g==
|
|
1713
1713
|
|
|
1714
|
+
"@salesforce/types@^1.3.0":
|
|
1715
|
+
version "1.3.0"
|
|
1716
|
+
resolved "https://registry.yarnpkg.com/@salesforce/types/-/types-1.3.0.tgz#c8b686cd5d7351aa3b9857ed03561d6a7439e5a8"
|
|
1717
|
+
integrity sha512-tcjBZrzCukOVIVm7mLHefsfDMyd+MTWWFWXk5wbdIQa+hiehUSA2SG0B0cpDMuOaIa9UiBm/SQCI+zznlt6W6g==
|
|
1718
|
+
|
|
1714
1719
|
"@shikijs/core@1.12.0":
|
|
1715
1720
|
version "1.12.0"
|
|
1716
1721
|
resolved "https://registry.yarnpkg.com/@shikijs/core/-/core-1.12.0.tgz#58ae6d02da7934edd9c10951a989c9cde0cf736b"
|
package/oclif.manifest.json
CHANGED
|
@@ -370,7 +370,7 @@
|
|
|
370
370
|
"args": {},
|
|
371
371
|
"description": "Generate agent template metadata to for packaging your agent.",
|
|
372
372
|
"examples": [
|
|
373
|
-
"Generate an agent template from a Bot
|
|
373
|
+
"Generate an agent template from a Bot metadata file in your project:\n<%= config.bin %> <%= command.id %> --agent-file force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1"
|
|
374
374
|
],
|
|
375
375
|
"flags": {
|
|
376
376
|
"json": {
|
|
@@ -405,18 +405,19 @@
|
|
|
405
405
|
"multiple": false,
|
|
406
406
|
"type": "option"
|
|
407
407
|
},
|
|
408
|
-
"agent-
|
|
409
|
-
"name": "agent-
|
|
408
|
+
"agent-version": {
|
|
409
|
+
"name": "agent-version",
|
|
410
410
|
"required": true,
|
|
411
|
-
"summary": "
|
|
411
|
+
"summary": "Version of the Agent (botVersion).",
|
|
412
412
|
"hasDynamicHelp": false,
|
|
413
413
|
"multiple": false,
|
|
414
414
|
"type": "option"
|
|
415
415
|
},
|
|
416
|
-
"
|
|
417
|
-
"char": "
|
|
418
|
-
"name": "
|
|
419
|
-
"
|
|
416
|
+
"agent-file": {
|
|
417
|
+
"char": "f",
|
|
418
|
+
"name": "agent-file",
|
|
419
|
+
"required": true,
|
|
420
|
+
"summary": "The path to an Agent (Bot) file.",
|
|
420
421
|
"hasDynamicHelp": false,
|
|
421
422
|
"multiple": false,
|
|
422
423
|
"type": "option"
|
|
@@ -480,7 +481,6 @@
|
|
|
480
481
|
"char": "f",
|
|
481
482
|
"name": "output-file",
|
|
482
483
|
"summary": "The name of the generated spec file.",
|
|
483
|
-
"default": "agentTestSpec.yaml",
|
|
484
484
|
"hasDynamicHelp": false,
|
|
485
485
|
"multiple": false,
|
|
486
486
|
"type": "option"
|
|
@@ -1097,5 +1097,5 @@
|
|
|
1097
1097
|
]
|
|
1098
1098
|
}
|
|
1099
1099
|
},
|
|
1100
|
-
"version": "1.
|
|
1100
|
+
"version": "1.15.1-dev.0"
|
|
1101
1101
|
}
|
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.
|
|
4
|
+
"version": "1.15.1-dev.0",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -10,14 +10,15 @@
|
|
|
10
10
|
"@inquirer/prompts": "^7.2.0",
|
|
11
11
|
"@oclif/core": "^4",
|
|
12
12
|
"@oclif/multi-stage-output": "^0.7.12",
|
|
13
|
-
"@salesforce/agents": "0.9.8-dev.
|
|
13
|
+
"@salesforce/agents": "0.9.8-dev.1",
|
|
14
14
|
"@salesforce/core": "^8.8.0",
|
|
15
15
|
"@salesforce/kit": "^3.2.1",
|
|
16
16
|
"@salesforce/sf-plugins-core": "^12.1.0",
|
|
17
17
|
"@salesforce/source-deploy-retrieve": "^12.14.0",
|
|
18
|
+
"@salesforce/types": "^1.3.0",
|
|
18
19
|
"ansis": "^3.3.2",
|
|
19
20
|
"fast-xml-parser": "^4.5.1",
|
|
20
|
-
"ink": "
|
|
21
|
+
"ink": "5.0.1",
|
|
21
22
|
"ink-text-input": "^6.0.0",
|
|
22
23
|
"inquirer-autocomplete-standalone": "^0.8.1",
|
|
23
24
|
"react": "^18.3.1",
|
|
@@ -228,7 +229,7 @@
|
|
|
228
229
|
"exports": "./lib/index.js",
|
|
229
230
|
"type": "module",
|
|
230
231
|
"sfdx": {
|
|
231
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.
|
|
232
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.
|
|
232
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.15.1-dev.0.crt",
|
|
233
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.15.1-dev.0.sig"
|
|
233
234
|
}
|
|
234
235
|
}
|
|
@@ -5,11 +5,14 @@
|
|
|
5
5
|
"AgentGenerateTemplateResult": {
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
8
|
+
"genAiPlannerPath": {
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"botTemplatePath": {
|
|
9
12
|
"type": "string"
|
|
10
13
|
}
|
|
11
14
|
},
|
|
12
|
-
"required": ["
|
|
15
|
+
"required": ["genAiPlannerPath", "botTemplatePath"],
|
|
13
16
|
"additionalProperties": false
|
|
14
17
|
}
|
|
15
18
|
}
|