@salesforce/plugin-agent 1.11.1 → 1.12.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.
@@ -4,18 +4,16 @@
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 { join } from 'node:path';
8
- import { writeFileSync } from 'node:fs';
9
- import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
7
+ import { join, resolve, dirname } from 'node:path';
8
+ import { mkdirSync, readFileSync, writeFileSync, existsSync } from 'node:fs';
9
+ import { SfCommand, Flags, prompts } from '@salesforce/sf-plugins-core';
10
10
  import { Messages } from '@salesforce/core';
11
- import ansis from 'ansis';
12
- import { select, input as inquirerInput } from '@inquirer/prompts';
13
- import figures from '@inquirer/figures';
11
+ import YAML from 'yaml';
14
12
  import { Agent } from '@salesforce/agents';
15
- import { theme } from '../../../inquirer-theme.js';
13
+ import { makeFlags, promptForFlag, validateAgentType, validateMaxTopics } from '../../../flags.js';
16
14
  Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
17
15
  const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.generate.spec');
18
- const FLAGGABLE_PROMPTS = {
16
+ export const FLAGGABLE_PROMPTS = {
19
17
  type: {
20
18
  message: messages.getMessage('flags.type.summary'),
21
19
  validate: (d) => d.length > 0 || 'Type cannot be empty',
@@ -45,7 +43,10 @@ const FLAGGABLE_PROMPTS = {
45
43
  if (d.length === 0)
46
44
  return true;
47
45
  try {
48
- new URL(d);
46
+ const regExp = new RegExp('^(http|https)://', 'i');
47
+ const companySite = regExp.test(d) ? d : `https://${d}`;
48
+ new URL(companySite);
49
+ d = companySite;
49
50
  return true;
50
51
  }
51
52
  catch (e) {
@@ -53,28 +54,39 @@ const FLAGGABLE_PROMPTS = {
53
54
  }
54
55
  },
55
56
  },
57
+ 'max-topics': {
58
+ message: messages.getMessage('flags.max-topics.summary'),
59
+ promptMessage: messages.getMessage('flags.max-topics.prompt'),
60
+ validate: () => true,
61
+ // min: 1,
62
+ // max: 30,
63
+ },
64
+ 'agent-user': {
65
+ message: messages.getMessage('flags.agent-user.summary'),
66
+ promptMessage: messages.getMessage('flags.agent-user.prompt'),
67
+ validate: () => true,
68
+ },
69
+ 'enrich-logs': {
70
+ message: messages.getMessage('flags.enrich-logs.summary'),
71
+ promptMessage: messages.getMessage('flags.enrich-logs.prompt'),
72
+ validate: () => true,
73
+ options: ['true', 'false'],
74
+ default: 'false',
75
+ },
76
+ tone: {
77
+ message: messages.getMessage('flags.tone.summary'),
78
+ promptMessage: messages.getMessage('flags.tone.prompt'),
79
+ validate: () => true,
80
+ options: ['formal', 'casual', 'neutral'],
81
+ default: 'casual',
82
+ },
83
+ // 'primary-language': {
84
+ // message: messages.getMessage('flags.primary-language.summary'),
85
+ // validate: (): boolean | string => true,
86
+ // options: ['en_US'],
87
+ // default: 'en_US',
88
+ // },
56
89
  };
57
- function validateInput(input, validate) {
58
- const result = validate(input);
59
- if (typeof result === 'string')
60
- throw new Error(result);
61
- return input;
62
- }
63
- function makeFlags(flaggablePrompts) {
64
- return Object.fromEntries(Object.entries(flaggablePrompts).map(([key, value]) => [
65
- key,
66
- Flags.string({
67
- summary: value.message,
68
- options: value.options,
69
- char: value.char,
70
- // eslint-disable-next-line @typescript-eslint/require-await
71
- async parse(input) {
72
- return validateInput(input, value.validate);
73
- },
74
- // NOTE: we purposely omit the required property here because we want to allow the flag to be missing in interactive mode
75
- }),
76
- ]));
77
- }
78
90
  export default class AgentCreateSpec extends SfCommand {
79
91
  static summary = messages.getMessage('summary');
80
92
  static description = messages.getMessage('description');
@@ -85,83 +97,172 @@ export default class AgentCreateSpec extends SfCommand {
85
97
  'target-org': Flags.requiredOrg(),
86
98
  'api-version': Flags.orgApiVersion(),
87
99
  ...makeFlags(FLAGGABLE_PROMPTS),
88
- 'output-dir': Flags.directory({
89
- char: 'd',
100
+ // a spec file can be used as input. Allows iterative spec development.
101
+ spec: Flags.file({
102
+ summary: messages.getMessage('flags.spec.summary'),
90
103
  exists: true,
91
- summary: messages.getMessage('flags.output-dir.summary'),
92
- default: 'config',
93
104
  }),
94
- 'file-name': Flags.string({
95
- char: 'f',
96
- summary: messages.getMessage('flags.file-name.summary'),
97
- default: 'agentSpec.json',
105
+ 'output-file': Flags.file({
106
+ summary: messages.getMessage('flags.output-file.summary'),
107
+ default: join('config', 'agentSpec.yaml'),
108
+ }),
109
+ 'full-interview': Flags.boolean({
110
+ summary: messages.getMessage('flags.full-interview.summary'),
111
+ }),
112
+ 'prompt-template': Flags.string({
113
+ summary: messages.getMessage('flags.prompt-template.summary'),
114
+ }),
115
+ 'grounding-context': Flags.string({
116
+ summary: messages.getMessage('flags.grounding-context.summary'),
117
+ dependsOn: ['prompt-template'],
118
+ }),
119
+ 'no-prompt': Flags.boolean({
120
+ summary: messages.getMessage('flags.no-prompt.summary'),
98
121
  }),
99
122
  };
123
+ // eslint-disable-next-line complexity
100
124
  async run() {
101
125
  const { flags } = await this.parse(AgentCreateSpec);
126
+ let outputFile;
127
+ try {
128
+ outputFile = await resolveOutputFile(flags['output-file'], flags['no-prompt']);
129
+ }
130
+ catch (e) {
131
+ this.log(messages.getMessage('commandCanceled'));
132
+ // @ts-expect-error expected due to command cancelation.
133
+ return;
134
+ }
102
135
  // throw error if --json is used and not all required flags are provided
103
136
  if (this.jsonEnabled()) {
104
137
  const missingFlags = Object.entries(FLAGGABLE_PROMPTS)
105
138
  .filter(([key, prompt]) => 'required' in prompt && prompt.required && !(key in flags))
106
139
  .map(([key]) => key);
107
140
  if (missingFlags.length) {
108
- throw new Error(`Missing required flags: ${missingFlags.join(', ')}`);
141
+ throw messages.createError('error.missingRequiredFlags', [missingFlags.join(', ')]);
109
142
  }
110
143
  }
111
144
  this.log();
112
145
  this.styledHeader('Agent Details');
113
- const type = (await this.getFlagOrPrompt(flags.type, FLAGGABLE_PROMPTS.type));
114
- const role = await this.getFlagOrPrompt(flags.role, FLAGGABLE_PROMPTS.role);
115
- const companyName = await this.getFlagOrPrompt(flags['company-name'], FLAGGABLE_PROMPTS['company-name']);
116
- const companyDescription = await this.getFlagOrPrompt(flags['company-description'], FLAGGABLE_PROMPTS['company-description']);
117
- const companyWebsite = await this.getFlagOrPrompt(flags['company-website'], FLAGGABLE_PROMPTS['company-website']);
146
+ // If spec is provided, read it first
147
+ let inputSpec = {};
148
+ if (flags.spec) {
149
+ inputSpec = YAML.parse(readFileSync(resolve(flags.spec), 'utf8'));
150
+ }
151
+ // Flags override inputSpec values. Prompt if neither is set.
152
+ const type = flags.type ?? validateAgentType(inputSpec?.agentType) ?? (await promptForFlag(FLAGGABLE_PROMPTS.type));
153
+ const companyName = flags['company-name'] ?? inputSpec?.companyName ?? (await promptForFlag(FLAGGABLE_PROMPTS['company-name']));
154
+ const companyDescription = flags['company-description'] ??
155
+ inputSpec?.companyDescription ??
156
+ (await promptForFlag(FLAGGABLE_PROMPTS['company-description']));
157
+ const role = flags.role ?? inputSpec?.role ?? (await promptForFlag(FLAGGABLE_PROMPTS.role));
158
+ // full interview prompts
159
+ const companyWebsite = flags['company-website'] ??
160
+ inputSpec?.companyWebsite ??
161
+ (flags['full-interview'] ? await promptForFlag(FLAGGABLE_PROMPTS['company-website']) : undefined);
162
+ const maxNumOfTopics = flags['max-topics'] ??
163
+ validateMaxTopics(inputSpec?.maxNumOfTopics) ??
164
+ (flags['full-interview'] ? await promptForFlag(FLAGGABLE_PROMPTS['max-topics']) : 10);
165
+ const agentUser = flags['agent-user'] ??
166
+ inputSpec?.agentUser ??
167
+ (flags['full-interview'] ? await promptForFlag(FLAGGABLE_PROMPTS['agent-user']) : undefined);
168
+ let enrichLogs = flags['enrich-logs'] ??
169
+ inputSpec?.enrichLogs ??
170
+ (flags['full-interview'] ? await promptForFlag(FLAGGABLE_PROMPTS['enrich-logs']) : undefined);
171
+ enrichLogs = Boolean(enrichLogs === 'true' || enrichLogs === true);
172
+ const tone = flags.tone ??
173
+ inputSpec?.tone ??
174
+ (flags['full-interview'] ? await promptForFlag(FLAGGABLE_PROMPTS.tone) : undefined);
175
+ // const primaryLanguage =
176
+ // flags['primary-language'] ??
177
+ // inputSpec?.primaryLanguage ??
178
+ // (flags['full-interview'] ? await promptForFlag(FLAGGABLE_PROMPTS['primary-language']) : undefined);
118
179
  this.log();
119
180
  this.spinner.start('Creating agent spec');
120
181
  const connection = flags['target-org'].getConnection(flags['api-version']);
121
182
  const agent = new Agent(connection, this.project);
122
- const agentSpec = await agent.createSpec({
123
- name: flags['file-name'].split('.json')[0],
124
- type,
125
- role,
183
+ const specConfig = {
184
+ agentType: type,
126
185
  companyName,
127
186
  companyDescription,
128
- companyWebsite,
129
- });
130
- // Write a file with the returned job specs
131
- const filePath = join(flags['output-dir'], flags['file-name']);
132
- writeFileSync(filePath, JSON.stringify({ type, role, companyName, companyDescription, companyWebsite, jobSpec: agentSpec }, null, 4));
133
- this.spinner.stop();
134
- this.log(`\nSaved agent spec: ${filePath}`);
135
- return {
136
- isSuccess: true,
137
- jobSpec: filePath,
187
+ role,
138
188
  };
139
- }
140
- /**
141
- * Get a flag value or prompt the user for a value.
142
- *
143
- * Resolution order:
144
- * - Flag value provided by the user
145
- * - Prompt the user for a value
146
- */
147
- async getFlagOrPrompt(valueFromFlag, flagDef) {
148
- const message = flagDef.message.replace(/\.$/, '');
149
- if (valueFromFlag) {
150
- this.log(`${ansis.green(figures.tick)} ${ansis.bold(message)} ${ansis.cyan(valueFromFlag)}`);
151
- return valueFromFlag;
189
+ if (companyWebsite) {
190
+ specConfig.companyWebsite = companyWebsite;
152
191
  }
153
- if (flagDef.options) {
154
- return select({
155
- choices: flagDef.options.map((o) => ({ name: o, value: o })),
156
- message,
157
- theme,
158
- });
192
+ const promptTemplateName = flags['prompt-template'] ?? inputSpec?.promptTemplateName;
193
+ if (promptTemplateName) {
194
+ specConfig.promptTemplateName = promptTemplateName;
195
+ const groundingContext = flags['grounding-context'] ?? inputSpec?.groundingContext;
196
+ if (groundingContext) {
197
+ specConfig.groundingContext = groundingContext;
198
+ }
159
199
  }
160
- return inquirerInput({
161
- message,
162
- validate: flagDef.validate,
163
- theme,
164
- });
200
+ if (maxNumOfTopics) {
201
+ specConfig.maxNumOfTopics = Number(maxNumOfTopics);
202
+ }
203
+ // Should we log the specConfig being used? It's returned in the JSON and the generated spec.
204
+ // this.log(`${ansis.green(figures.tick)} ${ansis.bold(message)} ${ansis.cyan(valueFromFlag)}`);
205
+ const specResponse = await agent.createSpecV2(specConfig);
206
+ // @ts-expect-error Need better typing
207
+ const specFileContents = buildSpecFile(specResponse, { agentUser, enrichLogs, tone });
208
+ const outputFilePath = writeSpecFile(outputFile, specFileContents);
209
+ this.spinner.stop();
210
+ this.log(`\nSaved agent spec: ${outputFilePath}`);
211
+ return { ...{ isSuccess: true, specPath: outputFilePath }, ...specResponse, ...specFileContents };
165
212
  }
166
213
  }
214
+ // Builds spec file contents from the spec response and any additional flags
215
+ // in a specific order.
216
+ const buildSpecFile = (specResponse, extraProps) => {
217
+ const propertyOrder = [
218
+ 'agentType',
219
+ 'companyName',
220
+ 'companyDescription',
221
+ 'companyWebsite',
222
+ 'role',
223
+ 'maxNumOfTopics',
224
+ 'agentUser',
225
+ 'enrichLogs',
226
+ 'tone',
227
+ // 'primaryLanguage',
228
+ 'promptTemplateName',
229
+ 'groundingContext',
230
+ 'topics',
231
+ ];
232
+ const specFileContents = {};
233
+ propertyOrder.map((prop) => {
234
+ // @ts-expect-error need better typing of the array.
235
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
236
+ const val = specResponse[prop] ?? extraProps[prop];
237
+ if (val != null || (typeof val === 'string' && val.length > 0)) {
238
+ // @ts-expect-error need better typing of the array.
239
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
240
+ specFileContents[prop] = val;
241
+ }
242
+ });
243
+ return specFileContents;
244
+ };
245
+ const writeSpecFile = (outputFile, agentSpec) => {
246
+ // create the directory if not already created
247
+ const outputFilePath = resolve(outputFile);
248
+ mkdirSync(dirname(outputFilePath), { recursive: true });
249
+ // Write a yaml file with the returned job specs
250
+ writeFileSync(outputFilePath, YAML.stringify(agentSpec));
251
+ return outputFilePath;
252
+ };
253
+ const resolveOutputFile = async (outputFile, noPrompt = false) => {
254
+ let resolvedOutputFile = resolve(outputFile);
255
+ if (!noPrompt) {
256
+ if (existsSync(resolvedOutputFile)) {
257
+ const message = messages.getMessage('confirmSpecOverwrite', [resolvedOutputFile]);
258
+ if (!(await prompts.confirm({ message }))) {
259
+ throw Error('NoOverwrite');
260
+ }
261
+ }
262
+ }
263
+ if (!resolvedOutputFile.endsWith('.yaml')) {
264
+ resolvedOutputFile = `${resolvedOutputFile}.yaml`;
265
+ }
266
+ return resolvedOutputFile;
267
+ };
167
268
  //# sourceMappingURL=spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/spec.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAa,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,KAAK,EAA8B,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAEnD,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,qB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,CAAC;QAC/B,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,gBAAyC,CAAC;AACnD,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,UAAkB,EAAE,SAAyB,EAAU,EAAE;IAC9E,8CAA8C;IAC9C,MAAM,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3C,SAAS,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAExD,gDAAgD;IAChD,aAAa,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IAEzD,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,KAAK,EAAE,UAAkB,EAAE,QAAQ,GAAG,KAAK,EAAmB,EAAE;IACxF,IAAI,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC7C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,IAAI,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACnC,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;YAClF,IAAI,CAAC,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC;gBAC1C,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC;IACH,CAAC;IACD,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1C,kBAAkB,GAAG,GAAG,kBAAkB,OAAO,CAAC;IACpD,CAAC;IACD,OAAO,kBAAkB,CAAC;AAC5B,CAAC,CAAC"}
@@ -1,12 +1,14 @@
1
1
  # summary
2
2
 
3
- Create an agent in your org from a local agent spec file.
3
+ Create an agent in your org using a local agent spec file.
4
4
 
5
5
  # description
6
6
 
7
- To generate an agent spec file, run the "agent generate spec" CLI command, which outputs a JSON file with the list of jobs and descriptions that the new agent can perform. Then specify this generated spec file to the --spec flag of this command, along with the name of the new agent.
7
+ Before you run this command, you must first generate an agent spec file by running the "agent generate spec" CLI command, which outputs a YAML file with the agent properties and list of AI-generated topics. Topics define the range of jobs the agent can handle. Then specify the generated agent spec file to this command using the --spec flag, along with the name (label) of the new agent using the --agent-name flag.
8
8
 
9
- When this command finishes, your org contains the new agent, which you can then edit in the Agent Builder UI. The new agent already has a list of topics and actions that were automatically created from the list of jobs in the provided agent spec file. This command also retrieves all the metadata files associated with the new agent to your local DX project.
9
+ When this command finishes, your org contains the new agent, which you can then edit in the Agent Builder UI. The new agent's topics are the same as the ones listed in the agent spec file. The agent might also have some AI-generated actions. This command also retrieves all the metadata files associated with the new agent to your local Salesforce DX project.
10
+
11
+ Use the --preview flag to review what the agent looks like without actually saving it in your org. Rather, the command creates a JSON file with all the agent details in the current directory.
10
12
 
11
13
  To open the new agent in your org's Agent Builder UI, run this command: "sf org open agent --name <api-name-of-your-agent>".
12
14
 
@@ -14,12 +16,36 @@ To open the new agent in your org's Agent Builder UI, run this command: "sf org
14
16
 
15
17
  Path to an agent spec file.
16
18
 
17
- # flags.name.summary
19
+ # flags.preview.summary
20
+
21
+ Preview the agent without saving it in your org.
22
+
23
+ # flags.agent-name.summary
24
+
25
+ Name (label) of the new agent.
26
+
27
+ # flags.agent-api-name.summary
28
+
29
+ API name of the new agent; if not specified, the API name is derived from the agent name (label); the API name must not exist in the org.
30
+
31
+ # flags.planner-id.summary
18
32
 
19
- API name of the new agent.
33
+ An existing GenAiPlanner ID to associate with the agent.
34
+
35
+ # error.missingRequiredFlags
36
+
37
+ Missing required flags: %s
38
+
39
+ # error.missingRequiredSpecProperties
40
+
41
+ Missing required spec file properties: %s
20
42
 
21
43
  # examples
22
44
 
23
- - Create an agent called "CustomerSupportAgent" in an org with alias "my-org" using the specified agent spec file:
45
+ - Create an agent called "ResortManager" in an org with alias "my-org" using the specified agent spec file:
46
+
47
+ <%= config.bin %> <%= command.id %> --agent-name ResortManager --spec specs/resortManagerAgent.yaml --target-org my-org
48
+
49
+ - Preview the creation of an agent called "ResortManager" and use your default org:
24
50
 
25
- <%= config.bin %> <%= command.id %> --name CustomerSupportAgent --spec ./config/agentSpec.json --target-org my-org
51
+ <%= config.bin %> <%= command.id %> --agent-name ResortManager --spec specs/resortManagerAgent.yaml --preview
@@ -1,14 +1,18 @@
1
1
  # summary
2
2
 
3
- Generate an agent spec, which is the list of jobs that the agent performs.
3
+ Generate an agent spec, which is a YAML file that captures what an agent can do.
4
4
 
5
5
  # description
6
6
 
7
- When using Salesforce CLI to create an agent in your org, the first step is to generate the local JSON-formatted agent spec file with this command.
7
+ Before you use Salesforce CLI to create an agent in your org, you must first generate an agent spec with this command. An agent spec is a YAML-formatted file that contains information about the agent, such as its role and company description, and then an AI-generated list of topics based on this information. Topics define the range of jobs your agent can handle.
8
8
 
9
- An agent spec is a list of jobs and descriptions that capture what the agent can do. Use flags such as --role and --company-description to provide details about your company and the role that the agent plays in your company; you can also enter the information interactively if you prefer. When you then execute this command, the large language model (LLM) associated with your org uses the information to generate the list of jobs that the agent most likely performs. We recommend that you provide good details for --role, --company-description, etc, so that the LLM can generate the best and most relevant list of jobs and descriptions. Once generated, you can edit the spec file; for example, you can remove jobs that don't apply to your agent.
9
+ Use flags, such as --role and --company-description, to provide details about your company and the role that the agent plays in your company. If you prefer, you can also be prompted for the information. Upon command execution, the large language model (LLM) associated with your org uses the information you provided to generate a list of topics for the agent. Because the LLM uses the company and role information to generate the topics, we recommend that you provide accurate and specific details so the LLM generates the best and most relevant topics. Once generated, you can edit the spec file; for example, you can remove topics that don't apply to your agent or change the description of a particular topic.
10
10
 
11
- When your agent spec is ready, you then create the agent in your org by specifying the agent spec file to the --job-spec flag of the "agent create" CLI command.
11
+ You can iterate the spec generation process by using the --spec flag to pass an existing agent spec file to this command, and then using the --role, --company-description, etc, flags to refine your agent properties. Iteratively improving the description of your agent allows the LLM to generate progressively better topics.
12
+
13
+ You can also specify a custom prompt template that the agent uses, and ground the prompt template to add context and personalization to the agent's prompts.
14
+
15
+ When your agent spec is ready, you then create the agent in your org by running the "agent create" CLI command and specifying the spec with the --spec flag.
12
16
 
13
17
  # flags.type.summary
14
18
 
@@ -30,20 +34,88 @@ Description of your company.
30
34
 
31
35
  Website URL of your company.
32
36
 
33
- # flags.output-dir.summary
37
+ # flags.output-file.summary
38
+
39
+ Path for the generated YAML agent spec file; can be an absolute or relative path.
40
+
41
+ # flags.max-topics.summary
42
+
43
+ Maximum number of topics to generate in the agent spec; default is 10.
44
+
45
+ # flags.max-topics.prompt
46
+
47
+ Max number of topics to generate (1-30)
48
+
49
+ # flags.prompt-template.summary
50
+
51
+ API name of a customized prompt template to use instead of the default prompt template.
52
+
53
+ # flags.grounding-context.summary
54
+
55
+ Context information and personalization that's added to your prompts when using a custom prompt template.
56
+
57
+ # flags.spec.summary
58
+
59
+ Agent spec file, in YAML format, to use as input to the command.
60
+
61
+ # flags.full-interview.summary
62
+
63
+ Prompt for both required and optional flags.
64
+
65
+ # flags.agent-user.summary
66
+
67
+ Username of a user in your org to assign to your agent; determines what your agent can access and do.
68
+
69
+ # flags.agent-user.prompt
34
70
 
35
- Directory where the agent spec file is written; can be an absolute or relative path.
71
+ Username for agent
36
72
 
37
- # flags.file-name.summary
73
+ # flags.enrich-logs.summary
38
74
 
39
- Name of the generated agent spec file.
75
+ Adds agent conversation data to event logs so you can view all agent session activity in one place.
76
+
77
+ # flags.enrich-logs.prompt
78
+
79
+ Enrich event logs
80
+
81
+ # flags.tone.summary
82
+
83
+ Conversational style of the agent, such as how it expresses your brand personality in its messages through word choice, punctuation, and sentence structure.
84
+
85
+ # flags.tone.prompt
86
+
87
+ Agent conversation tone
88
+
89
+ # flags.primary-language.summary
90
+
91
+ Language the agent uses in conversations.
92
+
93
+ # flags.no-prompt.summary
94
+
95
+ Don't prompt the user to confirm spec file overwrite.
40
96
 
41
97
  # examples
42
98
 
43
- - Create an agent spec for your default org in the default location and use flags to specify the agent's role and your company details:
99
+ - Generate an agent spec in the default location and use flags to specify the agent properties, such as its role and your company details; use your default org:
100
+
101
+ <%= config.bin %> <%= command.id %> --type customer --role "Field customer complaints and manage employee schedules." --company-name "Coral Cloud Resorts" --company-description "Provide customers with exceptional destination activities, unforgettable experiences, and reservation services."
102
+
103
+ - Generate an agent spec by being prompted for the required agent properties and generate a maxiumum of 5 topics; write the generated file to the "specs/resortManagerSpec.yaml" file and use the org with alias "my-org":
104
+
105
+ <%= config.bin %> <%= command.id %> --max-topics 5 --output-file specs/resortManagerAgent.yaml --target-org my-org
106
+
107
+ - Specify an existing agent spec file called "specs/resortManagerAgent.yaml", and then overwrite it with a new version that contains newly AI-generated topics based on the updated role information passed in with the --role flag:
108
+
109
+ <%= config.bin %> <%= command.id %> --spec specs/resortManagerAgent.yaml --output-file specs/resortManagerAgent.yaml --role "Field customer complaints, manage employee schedules, and ensure all resort operations are running smoothly" --target-org my-org
110
+
111
+ # error.missingRequiredFlags
112
+
113
+ Missing required flags: %s
114
+
115
+ # confirmSpecOverwrite
44
116
 
45
- <%= config.bin %> <%= command.id %> --type customer --role "Assist users in navigating and managing bookings" --company-name "Coral Cloud" --company-description "Resort that manages guests and their reservations and experiences"
117
+ Confirm overwrite of spec file %s?
46
118
 
47
- - Create an agent spec by being prompted for role and company details interactively; write the generated file to the "specs" directory and use the org with alias "my-org":
119
+ # commandCanceled
48
120
 
49
- <%= config.bin %> <%= command.id %> --output-dir specs --target-org my-org
121
+ Command canceled by user confirmation.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-agent",
3
- "version": "1.11.1",
3
+ "version": "1.12.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@salesforce/plugin-agent",
9
- "version": "1.11.1",
9
+ "version": "1.12.0",
10
10
  "license": "BSD-3-Clause",
11
11
  "dependencies": {
12
12
  "@inquirer/figures": "^1.0.7",