@salesforce/plugin-agent 1.11.0 → 1.11.1
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 +34 -31
- package/lib/commands/agent/create-v2.d.ts +3 -7
- package/lib/commands/agent/create-v2.js +31 -75
- package/lib/commands/agent/create-v2.js.map +1 -1
- package/lib/commands/agent/generate/spec-v2.d.ts +64 -1
- package/lib/commands/agent/generate/spec-v2.js +170 -19
- package/lib/commands/agent/generate/spec-v2.js.map +1 -1
- package/lib/flags.d.ts +1 -28
- package/lib/flags.js +3 -41
- package/lib/flags.js.map +1 -1
- package/messages/agent.create-v2.md +5 -17
- package/messages/agent.generate.spec-v2.md +68 -0
- package/messages/shared.md +0 -20
- package/npm-shrinkwrap.json +109 -98
- package/oclif.lock +25 -5
- package/oclif.manifest.json +51 -51
- package/package.json +4 -4
- package/schemas/agent-create__v2.json +129 -5
|
@@ -5,14 +5,88 @@
|
|
|
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
7
|
import { join, resolve, dirname } from 'node:path';
|
|
8
|
-
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
9
|
-
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
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
11
|
import YAML from 'yaml';
|
|
12
12
|
import { Agent } from '@salesforce/agents';
|
|
13
|
-
import {
|
|
13
|
+
import { makeFlags, promptForFlag, validateAgentType, validateMaxTopics } from '../../../flags.js';
|
|
14
14
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
15
15
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.generate.spec-v2');
|
|
16
|
+
export const FLAGGABLE_PROMPTS = {
|
|
17
|
+
type: {
|
|
18
|
+
message: messages.getMessage('flags.type.summary'),
|
|
19
|
+
validate: (d) => d.length > 0 || 'Type cannot be empty',
|
|
20
|
+
char: 't',
|
|
21
|
+
options: ['customer', 'internal'],
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
role: {
|
|
25
|
+
message: messages.getMessage('flags.role.summary'),
|
|
26
|
+
validate: (d) => d.length > 0 || 'Role cannot be empty',
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
'company-name': {
|
|
30
|
+
message: messages.getMessage('flags.company-name.summary'),
|
|
31
|
+
validate: (d) => d.length > 0 || 'Company name cannot be empty',
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
'company-description': {
|
|
35
|
+
message: messages.getMessage('flags.company-description.summary'),
|
|
36
|
+
validate: (d) => d.length > 0 || 'Company description cannot be empty',
|
|
37
|
+
required: true,
|
|
38
|
+
},
|
|
39
|
+
'company-website': {
|
|
40
|
+
message: messages.getMessage('flags.company-website.summary'),
|
|
41
|
+
validate: (d) => {
|
|
42
|
+
// Allow empty string
|
|
43
|
+
if (d.length === 0)
|
|
44
|
+
return true;
|
|
45
|
+
try {
|
|
46
|
+
const regExp = new RegExp('^(http|https)://', 'i');
|
|
47
|
+
const companySite = regExp.test(d) ? d : `https://${d}`;
|
|
48
|
+
new URL(companySite);
|
|
49
|
+
d = companySite;
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
catch (e) {
|
|
53
|
+
return 'Please enter a valid URL';
|
|
54
|
+
}
|
|
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
|
+
// },
|
|
89
|
+
};
|
|
16
90
|
export default class AgentCreateSpecV2 extends SfCommand {
|
|
17
91
|
static summary = messages.getMessage('summary');
|
|
18
92
|
static description = messages.getMessage('description');
|
|
@@ -22,7 +96,8 @@ export default class AgentCreateSpecV2 extends SfCommand {
|
|
|
22
96
|
static flags = {
|
|
23
97
|
'target-org': Flags.requiredOrg(),
|
|
24
98
|
'api-version': Flags.orgApiVersion(),
|
|
25
|
-
...makeFlags(
|
|
99
|
+
...makeFlags(FLAGGABLE_PROMPTS),
|
|
100
|
+
// a spec file can be used as input. Allows iterative spec development.
|
|
26
101
|
spec: Flags.file({
|
|
27
102
|
summary: messages.getMessage('flags.spec.summary'),
|
|
28
103
|
exists: true,
|
|
@@ -31,9 +106,8 @@ export default class AgentCreateSpecV2 extends SfCommand {
|
|
|
31
106
|
summary: messages.getMessage('flags.output-file.summary'),
|
|
32
107
|
default: join('config', 'agentSpec.yaml'),
|
|
33
108
|
}),
|
|
34
|
-
'
|
|
35
|
-
summary: messages.getMessage('flags.
|
|
36
|
-
min: 1,
|
|
109
|
+
'full-interview': Flags.boolean({
|
|
110
|
+
summary: messages.getMessage('flags.full-interview.summary'),
|
|
37
111
|
}),
|
|
38
112
|
'prompt-template': Flags.string({
|
|
39
113
|
summary: messages.getMessage('flags.prompt-template.summary'),
|
|
@@ -42,13 +116,25 @@ export default class AgentCreateSpecV2 extends SfCommand {
|
|
|
42
116
|
summary: messages.getMessage('flags.grounding-context.summary'),
|
|
43
117
|
dependsOn: ['prompt-template'],
|
|
44
118
|
}),
|
|
119
|
+
'no-prompt': Flags.boolean({
|
|
120
|
+
summary: messages.getMessage('flags.no-prompt.summary'),
|
|
121
|
+
}),
|
|
45
122
|
};
|
|
46
123
|
// eslint-disable-next-line complexity
|
|
47
124
|
async run() {
|
|
48
125
|
const { flags } = await this.parse(AgentCreateSpecV2);
|
|
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
|
+
}
|
|
49
135
|
// throw error if --json is used and not all required flags are provided
|
|
50
136
|
if (this.jsonEnabled()) {
|
|
51
|
-
const missingFlags = Object.entries(
|
|
137
|
+
const missingFlags = Object.entries(FLAGGABLE_PROMPTS)
|
|
52
138
|
.filter(([key, prompt]) => 'required' in prompt && prompt.required && !(key in flags))
|
|
53
139
|
.map(([key]) => key);
|
|
54
140
|
if (missingFlags.length) {
|
|
@@ -63,24 +149,42 @@ export default class AgentCreateSpecV2 extends SfCommand {
|
|
|
63
149
|
inputSpec = YAML.parse(readFileSync(resolve(flags.spec), 'utf8'));
|
|
64
150
|
}
|
|
65
151
|
// Flags override inputSpec values. Prompt if neither is set.
|
|
66
|
-
const type = flags.type ?? validateAgentType(inputSpec?.agentType) ?? (await promptForFlag(
|
|
67
|
-
const
|
|
68
|
-
const companyName = flags['company-name'] ?? inputSpec?.companyName ?? (await promptForFlag(FLAGGABLE_SPEC_PROMPTS['company-name']));
|
|
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']));
|
|
69
154
|
const companyDescription = flags['company-description'] ??
|
|
70
155
|
inputSpec?.companyDescription ??
|
|
71
|
-
(await promptForFlag(
|
|
156
|
+
(await promptForFlag(FLAGGABLE_PROMPTS['company-description']));
|
|
157
|
+
const role = flags.role ?? inputSpec?.role ?? (await promptForFlag(FLAGGABLE_PROMPTS.role));
|
|
158
|
+
// full interview prompts
|
|
72
159
|
const companyWebsite = flags['company-website'] ??
|
|
73
160
|
inputSpec?.companyWebsite ??
|
|
74
|
-
(await promptForFlag(
|
|
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);
|
|
75
179
|
this.log();
|
|
76
180
|
this.spinner.start('Creating agent spec');
|
|
77
181
|
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
78
182
|
const agent = new Agent(connection, this.project);
|
|
79
183
|
const specConfig = {
|
|
80
184
|
agentType: type,
|
|
81
|
-
role,
|
|
82
185
|
companyName,
|
|
83
186
|
companyDescription,
|
|
187
|
+
role,
|
|
84
188
|
};
|
|
85
189
|
if (companyWebsite) {
|
|
86
190
|
specConfig.companyWebsite = companyWebsite;
|
|
@@ -93,19 +197,51 @@ export default class AgentCreateSpecV2 extends SfCommand {
|
|
|
93
197
|
specConfig.groundingContext = groundingContext;
|
|
94
198
|
}
|
|
95
199
|
}
|
|
96
|
-
const maxNumOfTopics = flags['max-topics'] ?? validateMaxTopics(inputSpec?.maxNumOfTopics);
|
|
97
200
|
if (maxNumOfTopics) {
|
|
98
|
-
specConfig.maxNumOfTopics = maxNumOfTopics;
|
|
201
|
+
specConfig.maxNumOfTopics = Number(maxNumOfTopics);
|
|
99
202
|
}
|
|
100
203
|
// Should we log the specConfig being used? It's returned in the JSON and the generated spec.
|
|
101
204
|
// this.log(`${ansis.green(figures.tick)} ${ansis.bold(message)} ${ansis.cyan(valueFromFlag)}`);
|
|
102
|
-
const
|
|
103
|
-
|
|
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);
|
|
104
209
|
this.spinner.stop();
|
|
105
210
|
this.log(`\nSaved agent spec: ${outputFilePath}`);
|
|
106
|
-
return { ...{ isSuccess: true, specPath: outputFilePath }, ...
|
|
211
|
+
return { ...{ isSuccess: true, specPath: outputFilePath }, ...specResponse, ...specFileContents };
|
|
107
212
|
}
|
|
108
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
|
+
};
|
|
109
245
|
const writeSpecFile = (outputFile, agentSpec) => {
|
|
110
246
|
// create the directory if not already created
|
|
111
247
|
const outputFilePath = resolve(outputFile);
|
|
@@ -114,4 +250,19 @@ const writeSpecFile = (outputFile, agentSpec) => {
|
|
|
114
250
|
writeFileSync(outputFilePath, YAML.stringify(agentSpec));
|
|
115
251
|
return outputFilePath;
|
|
116
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
|
+
};
|
|
117
268
|
//# sourceMappingURL=spec-v2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec-v2.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/spec-v2.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"spec-v2.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/spec-v2.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,KAAK,EAA8C,MAAM,oBAAoB,CAAC;AACvF,OA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AAC;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"}
|
package/lib/flags.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export type FlaggablePrompt = {
|
|
|
6
6
|
char?: Interfaces.AlphabetLowercase | Interfaces.AlphabetUppercase;
|
|
7
7
|
required?: boolean;
|
|
8
8
|
default?: string | boolean;
|
|
9
|
+
promptMessage?: string;
|
|
9
10
|
};
|
|
10
11
|
type FlagsOfPrompts<T extends Record<string, FlaggablePrompt>> = Record<keyof T, Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>>;
|
|
11
12
|
export declare const resultFormatFlag: Interfaces.FlagDefinition<"json" | "human" | "junit" | "tap", Interfaces.CustomOptions, {
|
|
@@ -16,34 +17,6 @@ export declare const testOutputDirFlag: Interfaces.FlagDefinition<string, Interf
|
|
|
16
17
|
multiple: false;
|
|
17
18
|
requiredOrDefaulted: false;
|
|
18
19
|
}>;
|
|
19
|
-
export declare const FLAGGABLE_SPEC_PROMPTS: {
|
|
20
|
-
type: {
|
|
21
|
-
message: string;
|
|
22
|
-
validate: (d: string) => boolean | string;
|
|
23
|
-
char: "t";
|
|
24
|
-
options: string[];
|
|
25
|
-
required: true;
|
|
26
|
-
};
|
|
27
|
-
role: {
|
|
28
|
-
message: string;
|
|
29
|
-
validate: (d: string) => boolean | string;
|
|
30
|
-
required: true;
|
|
31
|
-
};
|
|
32
|
-
'company-name': {
|
|
33
|
-
message: string;
|
|
34
|
-
validate: (d: string) => boolean | string;
|
|
35
|
-
required: true;
|
|
36
|
-
};
|
|
37
|
-
'company-description': {
|
|
38
|
-
message: string;
|
|
39
|
-
validate: (d: string) => boolean | string;
|
|
40
|
-
required: true;
|
|
41
|
-
};
|
|
42
|
-
'company-website': {
|
|
43
|
-
message: string;
|
|
44
|
-
validate: (d: string) => boolean | string;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
20
|
export declare function makeFlags<T extends Record<string, FlaggablePrompt>>(flaggablePrompts: T): FlagsOfPrompts<T>;
|
|
48
21
|
export declare const promptForFlag: (flagDef: FlaggablePrompt) => Promise<string>;
|
|
49
22
|
export declare const validateAgentType: (agentType?: string, required?: boolean) => string | undefined;
|
package/lib/flags.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { Flags } from '@salesforce/sf-plugins-core';
|
|
8
8
|
import { Messages } from '@salesforce/core';
|
|
9
|
+
import { camelCaseToTitleCase } from '@salesforce/kit';
|
|
9
10
|
import { select, input as inquirerInput } from '@inquirer/prompts';
|
|
10
11
|
import { theme } from './inquirer-theme.js';
|
|
11
12
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
@@ -20,45 +21,6 @@ export const testOutputDirFlag = Flags.custom({
|
|
|
20
21
|
description: messages.getMessage('flags.output-dir.description'),
|
|
21
22
|
summary: messages.getMessage('flags.output-dir.summary'),
|
|
22
23
|
});
|
|
23
|
-
export const FLAGGABLE_SPEC_PROMPTS = {
|
|
24
|
-
type: {
|
|
25
|
-
message: messages.getMessage('flags.type.summary'),
|
|
26
|
-
validate: (d) => d.length > 0 || 'Type cannot be empty',
|
|
27
|
-
char: 't',
|
|
28
|
-
options: ['customer', 'internal'],
|
|
29
|
-
required: true,
|
|
30
|
-
},
|
|
31
|
-
role: {
|
|
32
|
-
message: messages.getMessage('flags.role.summary'),
|
|
33
|
-
validate: (d) => d.length > 0 || 'Role cannot be empty',
|
|
34
|
-
required: true,
|
|
35
|
-
},
|
|
36
|
-
'company-name': {
|
|
37
|
-
message: messages.getMessage('flags.company-name.summary'),
|
|
38
|
-
validate: (d) => d.length > 0 || 'Company name cannot be empty',
|
|
39
|
-
required: true,
|
|
40
|
-
},
|
|
41
|
-
'company-description': {
|
|
42
|
-
message: messages.getMessage('flags.company-description.summary'),
|
|
43
|
-
validate: (d) => d.length > 0 || 'Company description cannot be empty',
|
|
44
|
-
required: true,
|
|
45
|
-
},
|
|
46
|
-
'company-website': {
|
|
47
|
-
message: messages.getMessage('flags.company-website.summary'),
|
|
48
|
-
validate: (d) => {
|
|
49
|
-
// Allow empty string
|
|
50
|
-
if (d.length === 0)
|
|
51
|
-
return true;
|
|
52
|
-
try {
|
|
53
|
-
new URL(d);
|
|
54
|
-
return true;
|
|
55
|
-
}
|
|
56
|
-
catch (e) {
|
|
57
|
-
return 'Please enter a valid URL';
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
24
|
function validateInput(input, validate) {
|
|
63
25
|
const result = validate(input);
|
|
64
26
|
if (typeof result === 'string')
|
|
@@ -81,10 +43,10 @@ export function makeFlags(flaggablePrompts) {
|
|
|
81
43
|
]));
|
|
82
44
|
}
|
|
83
45
|
export const promptForFlag = async (flagDef) => {
|
|
84
|
-
const message = flagDef.message.replace(/\.$/, '');
|
|
46
|
+
const message = flagDef.promptMessage ?? flagDef.message.replace(/\.$/, '');
|
|
85
47
|
if (flagDef.options) {
|
|
86
48
|
return select({
|
|
87
|
-
choices: flagDef.options.map((o) => ({ name: o, value: o })),
|
|
49
|
+
choices: flagDef.options.map((o) => ({ name: camelCaseToTitleCase(o), value: o })),
|
|
88
50
|
message,
|
|
89
51
|
theme,
|
|
90
52
|
});
|
package/lib/flags.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../src/flags.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../src/flags.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,Q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IAAI,EAAE,CAAC;QACtB,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7C,IAAI,SAAS,GAAG,CAAC,EAAE,CAAC;gBAClB,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;QACD,MAAM,QAAQ,CAAC,WAAW,CAAC,wBAAwB,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IACpE,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -28,30 +28,18 @@ Name (label) of the new agent.
|
|
|
28
28
|
|
|
29
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
30
|
|
|
31
|
-
# flags.user-id.summary
|
|
32
|
-
|
|
33
|
-
ID of a user in your org that is assigned to your agent; determines what your agent can access and do.
|
|
34
|
-
|
|
35
|
-
# flags.enrich-logs.summary
|
|
36
|
-
|
|
37
|
-
Adds agent conversation data to event logs so you can view all agent session activity in one place.
|
|
38
|
-
|
|
39
|
-
# flags.tone.summary
|
|
40
|
-
|
|
41
|
-
Conversational style of the agent, such as how it expresses your brand personality in its messages through word choice, punctuation, and sentence structure.
|
|
42
|
-
|
|
43
|
-
# flags.primary-language.summary
|
|
44
|
-
|
|
45
|
-
Language the agent uses in conversations.
|
|
46
|
-
|
|
47
31
|
# flags.planner-id.summary
|
|
48
32
|
|
|
49
|
-
|
|
33
|
+
An existing GenAiPlanner ID to associate with the agent.
|
|
50
34
|
|
|
51
35
|
# error.missingRequiredFlags
|
|
52
36
|
|
|
53
37
|
Missing required flags: %s
|
|
54
38
|
|
|
39
|
+
# error.missingRequiredSpecProperties
|
|
40
|
+
|
|
41
|
+
Missing required spec file properties: %s
|
|
42
|
+
|
|
55
43
|
# examples
|
|
56
44
|
|
|
57
45
|
- Create an agent called "ResortManager" in an org with alias "my-org" using the specified agent spec file:
|
|
@@ -14,6 +14,26 @@ You can also specify a custom prompt template that the agent uses, and ground th
|
|
|
14
14
|
|
|
15
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.
|
|
16
16
|
|
|
17
|
+
# flags.type.summary
|
|
18
|
+
|
|
19
|
+
Type of agent to create.
|
|
20
|
+
|
|
21
|
+
# flags.role.summary
|
|
22
|
+
|
|
23
|
+
Role of the agent.
|
|
24
|
+
|
|
25
|
+
# flags.company-name.summary
|
|
26
|
+
|
|
27
|
+
Name of your company.
|
|
28
|
+
|
|
29
|
+
# flags.company-description.summary
|
|
30
|
+
|
|
31
|
+
Description of your company.
|
|
32
|
+
|
|
33
|
+
# flags.company-website.summary
|
|
34
|
+
|
|
35
|
+
Website URL of your company.
|
|
36
|
+
|
|
17
37
|
# flags.output-file.summary
|
|
18
38
|
|
|
19
39
|
Path for the generated YAML agent spec file; can be an absolute or relative path.
|
|
@@ -22,6 +42,10 @@ Path for the generated YAML agent spec file; can be an absolute or relative path
|
|
|
22
42
|
|
|
23
43
|
Maximum number of topics to generate in the agent spec; default is 10.
|
|
24
44
|
|
|
45
|
+
# flags.max-topics.prompt
|
|
46
|
+
|
|
47
|
+
Max number of topics to generate (1-30)
|
|
48
|
+
|
|
25
49
|
# flags.prompt-template.summary
|
|
26
50
|
|
|
27
51
|
API name of a customized prompt template to use instead of the default prompt template.
|
|
@@ -34,6 +58,42 @@ Context information and personalization that's added to your prompts when using
|
|
|
34
58
|
|
|
35
59
|
Agent spec file, in YAML format, to use as input to the command.
|
|
36
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
|
|
70
|
+
|
|
71
|
+
Username for agent
|
|
72
|
+
|
|
73
|
+
# flags.enrich-logs.summary
|
|
74
|
+
|
|
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.
|
|
96
|
+
|
|
37
97
|
# examples
|
|
38
98
|
|
|
39
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:
|
|
@@ -51,3 +111,11 @@ Agent spec file, in YAML format, to use as input to the command.
|
|
|
51
111
|
# error.missingRequiredFlags
|
|
52
112
|
|
|
53
113
|
Missing required flags: %s
|
|
114
|
+
|
|
115
|
+
# confirmSpecOverwrite
|
|
116
|
+
|
|
117
|
+
Confirm overwrite of spec file %s?
|
|
118
|
+
|
|
119
|
+
# commandCanceled
|
|
120
|
+
|
|
121
|
+
Command canceled by user confirmation.
|
package/messages/shared.md
CHANGED
|
@@ -10,26 +10,6 @@ Directory to write the agent test results into.
|
|
|
10
10
|
|
|
11
11
|
If the agent test run completes, write the results to the specified directory. If the test is still running, the test results aren't written.
|
|
12
12
|
|
|
13
|
-
# flags.type.summary
|
|
14
|
-
|
|
15
|
-
Type of agent to create.
|
|
16
|
-
|
|
17
|
-
# flags.role.summary
|
|
18
|
-
|
|
19
|
-
Role of the agent.
|
|
20
|
-
|
|
21
|
-
# flags.company-name.summary
|
|
22
|
-
|
|
23
|
-
Name of your company.
|
|
24
|
-
|
|
25
|
-
# flags.company-description.summary
|
|
26
|
-
|
|
27
|
-
Description of your company.
|
|
28
|
-
|
|
29
|
-
# flags.company-website.summary
|
|
30
|
-
|
|
31
|
-
Website URL of your company.
|
|
32
|
-
|
|
33
13
|
# error.invalidAgentType
|
|
34
14
|
|
|
35
15
|
agentType must be either "customer" or "internal". Found: [%s]
|