@salesforce/plugin-agent 1.14.1-dev.0 → 1.14.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 +16 -15
- package/lib/agentTestCache.d.ts +5 -5
- package/lib/agentTestCache.js +16 -16
- package/lib/agentTestCache.js.map +1 -1
- package/lib/commands/agent/test/cancel.d.ts +1 -1
- package/lib/commands/agent/test/cancel.js +5 -5
- package/lib/commands/agent/test/cancel.js.map +1 -1
- package/lib/commands/agent/test/create.js +2 -0
- package/lib/commands/agent/test/create.js.map +1 -1
- package/lib/commands/agent/test/resume.d.ts +1 -1
- package/lib/commands/agent/test/resume.js +7 -7
- package/lib/commands/agent/test/resume.js.map +1 -1
- package/lib/commands/agent/test/run.d.ts +1 -5
- package/lib/commands/agent/test/run.js +11 -16
- package/lib/commands/agent/test/run.js.map +1 -1
- package/messages/agent.create.md +4 -4
- package/messages/agent.generate.agent-spec.md +1 -1
- package/npm-shrinkwrap.json +207 -542
- package/oclif.lock +36 -71
- package/oclif.manifest.json +4 -4
- package/package.json +4 -4
- package/schemas/agent-test-cancel.json +6 -3
- package/schemas/agent-test-results.json +17 -10
- package/schemas/agent-test-resume.json +6 -3
- package/schemas/agent-test-run.json +6 -3
package/README.md
CHANGED
|
@@ -111,13 +111,14 @@ DESCRIPTION
|
|
|
111
111
|
new agent to your local Salesforce DX project.
|
|
112
112
|
|
|
113
113
|
Use the --preview flag to review what the agent looks like without actually saving it in your org. When previewing,
|
|
114
|
-
the command creates a JSON file in the current directory with all the agent details.
|
|
114
|
+
the command creates a JSON file in the current directory with all the agent details. The name of the JSON file is the
|
|
115
|
+
agent's API name and a timestamp.
|
|
115
116
|
|
|
116
117
|
To open the new agent in your org's Agent Builder UI, run this command: "sf org open agent --name <agent-api-name>".
|
|
117
118
|
|
|
118
119
|
EXAMPLES
|
|
119
|
-
Create an agent by being prompted for the required information, such as the agent spec file
|
|
120
|
-
|
|
120
|
+
Create an agent by being prompted for the required information, such as the agent spec file and agent name, and then
|
|
121
|
+
create it in your default org:
|
|
121
122
|
|
|
122
123
|
$ sf agent create
|
|
123
124
|
|
|
@@ -132,7 +133,7 @@ EXAMPLES
|
|
|
132
133
|
$ sf agent create --agent-name "Resort Manager" --spec specs/resortManagerAgent.yaml --preview
|
|
133
134
|
```
|
|
134
135
|
|
|
135
|
-
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1
|
|
136
|
+
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1/src/commands/agent/create.ts)_
|
|
136
137
|
|
|
137
138
|
## `sf agent generate agent-spec`
|
|
138
139
|
|
|
@@ -161,7 +162,7 @@ FLAGS
|
|
|
161
162
|
--full-interview Prompt for both required and optional flags.
|
|
162
163
|
--grounding-context=<value> Context information and personalization that's added to your prompts when using a
|
|
163
164
|
custom prompt template.
|
|
164
|
-
--max-topics=<value> Maximum number of topics to generate in the agent spec; default is
|
|
165
|
+
--max-topics=<value> Maximum number of topics to generate in the agent spec; default is 5.
|
|
165
166
|
--output-file=<value> [default: specs/agentSpec.yaml] Path for the generated YAML agent spec file; can be
|
|
166
167
|
an absolute or relative path.
|
|
167
168
|
--prompt-template=<value> API name of a customized prompt template to use instead of the default prompt
|
|
@@ -236,7 +237,7 @@ EXAMPLES
|
|
|
236
237
|
$ sf agent generate agent-spec --tone formal --agent-user resortmanager@myorg.com
|
|
237
238
|
```
|
|
238
239
|
|
|
239
|
-
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1
|
|
240
|
+
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1/src/commands/agent/generate/agent-spec.ts)_
|
|
240
241
|
|
|
241
242
|
## `sf agent generate template`
|
|
242
243
|
|
|
@@ -269,7 +270,7 @@ EXAMPLES
|
|
|
269
270
|
$ sf agent generate template --agent-api-name My_Packaged_Agent
|
|
270
271
|
```
|
|
271
272
|
|
|
272
|
-
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1
|
|
273
|
+
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1/src/commands/agent/generate/template.ts)_
|
|
273
274
|
|
|
274
275
|
## `sf agent generate test-spec`
|
|
275
276
|
|
|
@@ -292,7 +293,7 @@ EXAMPLES
|
|
|
292
293
|
$ sf agent generate test-spec
|
|
293
294
|
```
|
|
294
295
|
|
|
295
|
-
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1
|
|
296
|
+
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1/src/commands/agent/generate/test-spec.ts)_
|
|
296
297
|
|
|
297
298
|
## `sf agent preview`
|
|
298
299
|
|
|
@@ -327,7 +328,7 @@ FLAG DESCRIPTIONS
|
|
|
327
328
|
the API name of the agent? (TBD based on agents library)
|
|
328
329
|
```
|
|
329
330
|
|
|
330
|
-
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1
|
|
331
|
+
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1/src/commands/agent/preview.ts)_
|
|
331
332
|
|
|
332
333
|
## `sf agent test cancel`
|
|
333
334
|
|
|
@@ -364,7 +365,7 @@ EXAMPLES
|
|
|
364
365
|
$ sf agent test cancel --job-id 4KBfake0000003F4AQ --target-org my-org
|
|
365
366
|
```
|
|
366
367
|
|
|
367
|
-
_See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1
|
|
368
|
+
_See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1/src/commands/agent/test/cancel.ts)_
|
|
368
369
|
|
|
369
370
|
## `sf agent test create`
|
|
370
371
|
|
|
@@ -400,7 +401,7 @@ FLAG DESCRIPTIONS
|
|
|
400
401
|
More information about a flag. Don't repeat the summary.
|
|
401
402
|
```
|
|
402
403
|
|
|
403
|
-
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1
|
|
404
|
+
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1/src/commands/agent/test/create.ts)_
|
|
404
405
|
|
|
405
406
|
## `sf agent test list`
|
|
406
407
|
|
|
@@ -429,7 +430,7 @@ EXAMPLES
|
|
|
429
430
|
$ sf agent test list
|
|
430
431
|
```
|
|
431
432
|
|
|
432
|
-
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1
|
|
433
|
+
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1/src/commands/agent/test/list.ts)_
|
|
433
434
|
|
|
434
435
|
## `sf agent test results`
|
|
435
436
|
|
|
@@ -485,7 +486,7 @@ FLAG DESCRIPTIONS
|
|
|
485
486
|
test results aren't written.
|
|
486
487
|
```
|
|
487
488
|
|
|
488
|
-
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1
|
|
489
|
+
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1/src/commands/agent/test/results.ts)_
|
|
489
490
|
|
|
490
491
|
## `sf agent test resume`
|
|
491
492
|
|
|
@@ -548,7 +549,7 @@ FLAG DESCRIPTIONS
|
|
|
548
549
|
test results aren't written.
|
|
549
550
|
```
|
|
550
551
|
|
|
551
|
-
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1
|
|
552
|
+
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1/src/commands/agent/test/resume.ts)_
|
|
552
553
|
|
|
553
554
|
## `sf agent test run`
|
|
554
555
|
|
|
@@ -611,6 +612,6 @@ FLAG DESCRIPTIONS
|
|
|
611
612
|
test results aren't written.
|
|
612
613
|
```
|
|
613
614
|
|
|
614
|
-
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1
|
|
615
|
+
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.14.1/src/commands/agent/test/run.ts)_
|
|
615
616
|
|
|
616
617
|
<!-- commandsstop -->
|
package/lib/agentTestCache.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { TTLConfig } from '@salesforce/core';
|
|
2
2
|
type CacheContents = {
|
|
3
|
-
|
|
3
|
+
aiEvaluationId: string;
|
|
4
4
|
name: string;
|
|
5
5
|
};
|
|
6
6
|
export declare class AgentTestCache extends TTLConfig<TTLConfig.Options, CacheContents> {
|
|
7
7
|
static getFileName(): string;
|
|
8
8
|
static getDefaultOptions(): TTLConfig.Options;
|
|
9
|
-
createCacheEntry(
|
|
10
|
-
removeCacheEntry(
|
|
9
|
+
createCacheEntry(aiEvaluationId: string, name: string): Promise<void>;
|
|
10
|
+
removeCacheEntry(aiEvaluationId: string): Promise<void>;
|
|
11
11
|
resolveFromCache(): CacheContents;
|
|
12
|
-
useIdOrMostRecent(
|
|
13
|
-
|
|
12
|
+
useIdOrMostRecent(aiEvaluationId: string | undefined, useMostRecent: boolean): {
|
|
13
|
+
aiEvaluationId: string;
|
|
14
14
|
name?: string;
|
|
15
15
|
};
|
|
16
16
|
}
|
package/lib/agentTestCache.js
CHANGED
|
@@ -19,33 +19,33 @@ export class AgentTestCache extends TTLConfig {
|
|
|
19
19
|
ttl: Duration.days(7),
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
async createCacheEntry(
|
|
23
|
-
if (!
|
|
24
|
-
throw new SfError('
|
|
25
|
-
this.set(
|
|
22
|
+
async createCacheEntry(aiEvaluationId, name) {
|
|
23
|
+
if (!aiEvaluationId)
|
|
24
|
+
throw new SfError('aiEvaluationId is required to create a cache entry');
|
|
25
|
+
this.set(aiEvaluationId, { aiEvaluationId, name });
|
|
26
26
|
await this.write();
|
|
27
27
|
}
|
|
28
|
-
async removeCacheEntry(
|
|
29
|
-
if (!
|
|
30
|
-
throw new SfError('
|
|
31
|
-
this.unset(
|
|
28
|
+
async removeCacheEntry(aiEvaluationId) {
|
|
29
|
+
if (!aiEvaluationId)
|
|
30
|
+
throw new SfError('aiEvaluationId is required to remove a cache entry');
|
|
31
|
+
this.unset(aiEvaluationId);
|
|
32
32
|
await this.write();
|
|
33
33
|
}
|
|
34
34
|
resolveFromCache() {
|
|
35
35
|
const key = this.getLatestKey();
|
|
36
36
|
if (!key)
|
|
37
|
-
throw new SfError('Could not find
|
|
37
|
+
throw new SfError('Could not find an aiEvaluationId to resume');
|
|
38
38
|
return this.get(key);
|
|
39
39
|
}
|
|
40
|
-
useIdOrMostRecent(
|
|
41
|
-
if (
|
|
42
|
-
throw new SfError('Cannot specify both
|
|
40
|
+
useIdOrMostRecent(aiEvaluationId, useMostRecent) {
|
|
41
|
+
if (aiEvaluationId && useMostRecent) {
|
|
42
|
+
throw new SfError('Cannot specify both an aiEvaluationId and use most recent flag');
|
|
43
43
|
}
|
|
44
|
-
if (!
|
|
45
|
-
throw new SfError('Must specify either
|
|
44
|
+
if (!aiEvaluationId && !useMostRecent) {
|
|
45
|
+
throw new SfError('Must specify either an aiEvaluationId or use most recent flag');
|
|
46
46
|
}
|
|
47
|
-
if (
|
|
48
|
-
return {
|
|
47
|
+
if (aiEvaluationId) {
|
|
48
|
+
return { aiEvaluationId };
|
|
49
49
|
}
|
|
50
50
|
return this.resolveFromCache();
|
|
51
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentTestCache.js","sourceRoot":"","sources":["../src/agentTestCache.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,QAAQ,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IACrB,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,cAAsB;QAClD,IAAI,CAAC,cAAc;YAAE,MAAM,IAAI,OAAO,CAAC,oDAAoD,CAAC,CAAC;QAE7F,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QAC3B,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;IAEM,gBAAgB;QACrB,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAChC,IAAI,CAAC,GAAG;YAAE,MAAM,IAAI,OAAO,CAAC,4CAA4C,CAAC,CAAC;QAE1E,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;IAEM,iBAAiB,CACtB,cAAkC,EAClC,aAAsB;QAEtB,IAAI,cAAc,IAAI,aAAa,EAAE,CAAC;YACpC,MAAM,IAAI,OAAO,CAAC,gEAAgE,CAAC,CAAC;QACtF,CAAC;QAED,IAAI,CAAC,cAAc,IAAI,CAAC,aAAa,EAAE,CAAC;YACtC,MAAM,IAAI,OAAO,CAAC,+DAA+D,CAAC,CAAC;QACrF,CAAC;QAED,IAAI,cAAc,EAAE,CAAC;YACnB,OAAO,EAAE,cAAc,EAAE,CAAC;QAC5B,CAAC;QAED,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACjC,CAAC;CACF"}
|
|
@@ -32,16 +32,16 @@ export default class AgentTestCancel extends SfCommand {
|
|
|
32
32
|
async run() {
|
|
33
33
|
const { flags } = await this.parse(AgentTestCancel);
|
|
34
34
|
const agentTestCache = await AgentTestCache.create();
|
|
35
|
-
const {
|
|
36
|
-
this.log(`Canceling tests for AiEvaluation Job: ${
|
|
35
|
+
const { aiEvaluationId } = agentTestCache.useIdOrMostRecent(flags['job-id'], flags['use-most-recent']);
|
|
36
|
+
this.log(`Canceling tests for AiEvaluation Job: ${aiEvaluationId}`);
|
|
37
37
|
const agentTester = new AgentTester(flags['target-org'].getConnection(flags['api-version']));
|
|
38
|
-
const result = await agentTester.cancel(
|
|
38
|
+
const result = await agentTester.cancel(aiEvaluationId);
|
|
39
39
|
if (result.success) {
|
|
40
|
-
await agentTestCache.removeCacheEntry(
|
|
40
|
+
await agentTestCache.removeCacheEntry(aiEvaluationId);
|
|
41
41
|
}
|
|
42
42
|
return {
|
|
43
43
|
success: result.success,
|
|
44
|
-
|
|
44
|
+
aiEvaluationId,
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancel.js","sourceRoot":"","sources":["../../../../src/commands/agent/test/cancel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,mBAAmB,CAAC,CAAC;AASxF,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,SAAgC;IACpE,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,CAAU,KAAK,GAAG,MAAM,CAAC;IAE/B,MAAM,CAAU,KAAK,GAAG;QAC7B,YAAY,EAAE,KAAK,CAAC,WAAW,EAAE;QACjC,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE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I,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,MAAM,cAAc,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;QACxD,CAAC;QAED,OAAO;YACL,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,cAAc;SACf,CAAC;IACJ,CAAC"}
|
|
@@ -76,6 +76,8 @@ export default class AgentTestCreate extends SfCommand {
|
|
|
76
76
|
this.mso?.skipTo(AgentTestCreateLifecycleStages.Done);
|
|
77
77
|
this.mso?.stop();
|
|
78
78
|
this.log(`Preview of AiEvaluationDefinition created at ${path}`);
|
|
79
|
+
this.log();
|
|
80
|
+
this.log(contents);
|
|
79
81
|
}
|
|
80
82
|
else {
|
|
81
83
|
this.log(`AiEvaluationDefinition created at ${path} and deployed to ${flags['target-org'].getUsername() ?? flags['target-org'].getOrgId()}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/agent/test/create.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAW,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAEjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG7D,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,mBAAmB,CAAC,CAAC;AAOxF,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,SAAgC;IACpE,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAA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C;IAES,KAAK,CAAC,KAAiC;QAC/C,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC"}
|
|
@@ -44,19 +44,19 @@ export default class AgentTestResume extends SfCommand {
|
|
|
44
44
|
async run() {
|
|
45
45
|
const { flags } = await this.parse(AgentTestResume);
|
|
46
46
|
const agentTestCache = await AgentTestCache.create();
|
|
47
|
-
const { name,
|
|
47
|
+
const { name, aiEvaluationId } = agentTestCache.useIdOrMostRecent(flags['job-id'], flags['use-most-recent']);
|
|
48
48
|
const mso = new TestStages({
|
|
49
|
-
title: `Agent Test Run: ${name ??
|
|
49
|
+
title: `Agent Test Run: ${name ?? aiEvaluationId}`,
|
|
50
50
|
jsonEnabled: this.jsonEnabled(),
|
|
51
51
|
});
|
|
52
|
-
mso.start({ id:
|
|
52
|
+
mso.start({ id: aiEvaluationId });
|
|
53
53
|
const agentTester = new AgentTester(flags['target-org'].getConnection(flags['api-version']));
|
|
54
|
-
const { completed, response } = await mso.poll(agentTester,
|
|
54
|
+
const { completed, response } = await mso.poll(agentTester, aiEvaluationId, flags.wait);
|
|
55
55
|
if (completed)
|
|
56
|
-
await agentTestCache.removeCacheEntry(
|
|
56
|
+
await agentTestCache.removeCacheEntry(aiEvaluationId);
|
|
57
57
|
mso.stop();
|
|
58
58
|
await handleTestResults({
|
|
59
|
-
id:
|
|
59
|
+
id: aiEvaluationId,
|
|
60
60
|
format: flags['result-format'],
|
|
61
61
|
results: response,
|
|
62
62
|
jsonEnabled: this.jsonEnabled(),
|
|
@@ -64,7 +64,7 @@ export default class AgentTestResume extends SfCommand {
|
|
|
64
64
|
});
|
|
65
65
|
return {
|
|
66
66
|
status: 'COMPLETED',
|
|
67
|
-
|
|
67
|
+
aiEvaluationId,
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"res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force/sf-plugins-core';
|
|
2
|
-
import { SfError } from '@salesforce/core';
|
|
3
|
-
import { CLIError } from '@oclif/core/errors';
|
|
4
2
|
export type AgentTestRunResult = {
|
|
5
|
-
|
|
3
|
+
aiEvaluationId: string;
|
|
6
4
|
status: string;
|
|
7
5
|
};
|
|
8
6
|
export default class AgentTestRun extends SfCommand<AgentTestRunResult> {
|
|
@@ -18,7 +16,5 @@ export default class AgentTestRun extends SfCommand<AgentTestRunResult> {
|
|
|
18
16
|
'result-format': import("@oclif/core/interfaces").OptionFlag<"json" | "human" | "junit" | "tap", import("@oclif/core/interfaces").CustomOptions>;
|
|
19
17
|
'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
18
|
};
|
|
21
|
-
private mso;
|
|
22
19
|
run(): Promise<AgentTestRunResult>;
|
|
23
|
-
protected catch(error: Error | SfError | CLIError): Promise<never>;
|
|
24
20
|
}
|
|
@@ -38,23 +38,22 @@ export default class AgentTestRun extends SfCommand {
|
|
|
38
38
|
'result-format': resultFormatFlag(),
|
|
39
39
|
'output-dir': testOutputDirFlag(),
|
|
40
40
|
};
|
|
41
|
-
mso;
|
|
42
41
|
async run() {
|
|
43
42
|
const { flags } = await this.parse(AgentTestRun);
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
const mso = new TestStages({ title: `Agent Test Run: ${flags.name}`, jsonEnabled: this.jsonEnabled() });
|
|
44
|
+
mso.start();
|
|
46
45
|
const agentTester = new AgentTester(flags['target-org'].getConnection(flags['api-version']));
|
|
47
46
|
const response = await agentTester.start(flags.name);
|
|
48
|
-
|
|
47
|
+
mso.update({ id: response.aiEvaluationId });
|
|
49
48
|
const agentTestCache = await AgentTestCache.create();
|
|
50
|
-
await agentTestCache.createCacheEntry(response.
|
|
49
|
+
await agentTestCache.createCacheEntry(response.aiEvaluationId, flags.name);
|
|
51
50
|
if (flags.wait?.minutes) {
|
|
52
|
-
const { completed, response: detailsResponse } = await
|
|
51
|
+
const { completed, response: detailsResponse } = await mso.poll(agentTester, response.aiEvaluationId, flags.wait);
|
|
53
52
|
if (completed)
|
|
54
|
-
await agentTestCache.removeCacheEntry(response.
|
|
55
|
-
|
|
53
|
+
await agentTestCache.removeCacheEntry(response.aiEvaluationId);
|
|
54
|
+
mso.stop();
|
|
56
55
|
await handleTestResults({
|
|
57
|
-
id: response.
|
|
56
|
+
id: response.aiEvaluationId,
|
|
58
57
|
format: flags['result-format'],
|
|
59
58
|
results: detailsResponse,
|
|
60
59
|
jsonEnabled: this.jsonEnabled(),
|
|
@@ -62,18 +61,14 @@ export default class AgentTestRun extends SfCommand {
|
|
|
62
61
|
});
|
|
63
62
|
return {
|
|
64
63
|
status: 'COMPLETED',
|
|
65
|
-
|
|
64
|
+
aiEvaluationId: response.aiEvaluationId,
|
|
66
65
|
};
|
|
67
66
|
}
|
|
68
67
|
else {
|
|
69
|
-
|
|
70
|
-
this.log(`Run ${colorize('dim', `sf agent test resume --job-id ${response.
|
|
68
|
+
mso.stop();
|
|
69
|
+
this.log(`Run ${colorize('dim', `sf agent test resume --job-id ${response.aiEvaluationId}`)} to resuming watching this test.`);
|
|
71
70
|
}
|
|
72
71
|
return response;
|
|
73
72
|
}
|
|
74
|
-
catch(error) {
|
|
75
|
-
this.mso?.error();
|
|
76
|
-
return super.catch(error);
|
|
77
|
-
}
|
|
78
73
|
}
|
|
79
74
|
//# sourceMappingURL=run.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../../src/commands/agent/test/run.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../../src/commands/agent/test/run.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KA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AAgB,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;YAE9E,GAAG,CAAC,IAAI,EAAE,CAAC;YAEX,MAAM,iBAAiB,CAAC;gBACtB,EAAE,EAAE,QAAQ,CAAC,cAAc;gBAC3B,MAAM,EAAE,KAAK,CAAC,eAAe,CAAC;gBAC9B,OAAO,EAAE,eAAe;gBACxB,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;gBAC/B,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;aAC/B,CAAC,CAAC;YAEH,OAAO;gBACL,MAAM,EAAE,WAAW;gBACnB,cAAc,EAAE,QAAQ,CAAC,cAAc;aACxC,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,IAAI,EAAE,CAAC;YACX,IAAI,CAAC,GAAG,CACN,OAAO,QAAQ,CACb,KAAK,EACL,iCAAiC,QAAQ,CAAC,cAAc,EAAE,CAC3D,kCAAkC,CACpC,CAAC;QACJ,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC"}
|
package/messages/agent.create.md
CHANGED
|
@@ -8,7 +8,7 @@ To run this comand, you must have an agent spec file, which is a YAML file that
|
|
|
8
8
|
|
|
9
9
|
When this command completes, your org contains the new agent, which you can then edit and customize 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, or you can add them. This command also retrieves all the metadata files associated with the new agent to your local Salesforce DX project.
|
|
10
10
|
|
|
11
|
-
Use the --preview flag to review what the agent looks like without actually saving it in your org. When previewing, the command creates a JSON file in the current directory with all the agent details.
|
|
11
|
+
Use the --preview flag to review what the agent looks like without actually saving it in your org. When previewing, the command creates a JSON file in the current directory with all the agent details. The name of the JSON file is the agent's API name and a timestamp.
|
|
12
12
|
|
|
13
13
|
To open the new agent in your org's Agent Builder UI, run this command: "sf org open agent --name <agent-api-name>".
|
|
14
14
|
|
|
@@ -30,7 +30,7 @@ API name of the new agent; if not specified, the API name is derived from the ag
|
|
|
30
30
|
|
|
31
31
|
# flags.agent-api-name.prompt
|
|
32
32
|
|
|
33
|
-
API name of the new agent
|
|
33
|
+
API name of the new agent
|
|
34
34
|
|
|
35
35
|
# flags.planner-id.summary
|
|
36
36
|
|
|
@@ -38,7 +38,7 @@ An existing GenAiPlanner ID to associate with the agent.
|
|
|
38
38
|
|
|
39
39
|
# error.missingRequiredFlags
|
|
40
40
|
|
|
41
|
-
Missing required flags: %s
|
|
41
|
+
Missing required flags: %s.
|
|
42
42
|
|
|
43
43
|
# error.missingRequiredSpecProperties
|
|
44
44
|
|
|
@@ -46,7 +46,7 @@ Your agent spec file is missing these required properties: %s.
|
|
|
46
46
|
|
|
47
47
|
# examples
|
|
48
48
|
|
|
49
|
-
- Create an agent by being prompted for the required information, such as the agent spec file
|
|
49
|
+
- Create an agent by being prompted for the required information, such as the agent spec file and agent name, and then create it in your default org:
|
|
50
50
|
|
|
51
51
|
<%= config.bin %> <%= command.id %>
|
|
52
52
|
|
|
@@ -44,7 +44,7 @@ Path for the generated YAML agent spec file; can be an absolute or relative path
|
|
|
44
44
|
|
|
45
45
|
# flags.max-topics.summary
|
|
46
46
|
|
|
47
|
-
Maximum number of topics to generate in the agent spec; default is
|
|
47
|
+
Maximum number of topics to generate in the agent spec; default is 5.
|
|
48
48
|
|
|
49
49
|
# flags.max-topics.prompt
|
|
50
50
|
|