@salesforce/plugin-agent 1.3.2
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/LICENSE.txt +12 -0
- package/README.md +223 -0
- package/lib/commands/agent/create.d.ts +17 -0
- package/lib/commands/agent/create.js +65 -0
- package/lib/commands/agent/create.js.map +1 -0
- package/lib/commands/agent/generate/spec.d.ts +41 -0
- package/lib/commands/agent/generate/spec.js +170 -0
- package/lib/commands/agent/generate/spec.js.map +1 -0
- package/lib/commands/agent/test/cancel.d.ts +18 -0
- package/lib/commands/agent/test/cancel.js +43 -0
- package/lib/commands/agent/test/cancel.js.map +1 -0
- package/lib/commands/agent/test/run.d.ts +19 -0
- package/lib/commands/agent/test/run.js +54 -0
- package/lib/commands/agent/test/run.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -0
- package/messages/agent.create.md +25 -0
- package/messages/agent.generate.spec.md +41 -0
- package/messages/agent.test.cancel.md +21 -0
- package/messages/agent.test.run.md +33 -0
- package/npm-shrinkwrap.json +13900 -0
- package/oclif.lock +7583 -0
- package/oclif.manifest.json +379 -0
- package/package.json +209 -0
- package/schemas/agent-create.json +21 -0
- package/schemas/agent-generate-spec.json +24 -0
- package/schemas/agent-test-cancel.json +28 -0
- package/schemas/agent-test-run.json +28 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024, salesforce.com, inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
8
|
+
import { Messages } from '@salesforce/core';
|
|
9
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
10
|
+
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.test.run');
|
|
11
|
+
export default class AgentTestRun extends SfCommand {
|
|
12
|
+
static summary = messages.getMessage('summary');
|
|
13
|
+
static description = messages.getMessage('description');
|
|
14
|
+
static examples = messages.getMessages('examples');
|
|
15
|
+
static flags = {
|
|
16
|
+
'target-org': Flags.requiredOrg(),
|
|
17
|
+
// AiEvalDefinitionVersion.Id -- This should really be "test-name"
|
|
18
|
+
id: Flags.string({
|
|
19
|
+
char: 'i',
|
|
20
|
+
required: true,
|
|
21
|
+
summary: messages.getMessage('flags.id.summary'),
|
|
22
|
+
description: messages.getMessage('flags.id.description'),
|
|
23
|
+
}),
|
|
24
|
+
wait: Flags.duration({
|
|
25
|
+
char: 'w',
|
|
26
|
+
unit: 'minutes',
|
|
27
|
+
min: 1,
|
|
28
|
+
summary: messages.getMessage('flags.wait.summary'),
|
|
29
|
+
description: messages.getMessage('flags.wait.description'),
|
|
30
|
+
}),
|
|
31
|
+
'output-dir': Flags.directory({
|
|
32
|
+
char: 'd',
|
|
33
|
+
summary: messages.getMessage('flags.output-dir.summary'),
|
|
34
|
+
}),
|
|
35
|
+
//
|
|
36
|
+
// Future flags:
|
|
37
|
+
// result-format [csv, json, table, junit, TAP]
|
|
38
|
+
// suites [array of suite names]
|
|
39
|
+
// verbose [boolean]
|
|
40
|
+
// ??? api-version or build-version ???
|
|
41
|
+
};
|
|
42
|
+
async run() {
|
|
43
|
+
const { flags } = await this.parse(AgentTestRun);
|
|
44
|
+
this.log(`Starting tests for AiEvalDefinitionVersion: ${flags.id}`);
|
|
45
|
+
// Call SF Eval Connect API passing AiEvalDefinitionVersion.Id
|
|
46
|
+
// POST to /einstein/ai-evaluations/{aiEvalDefinitionVersionId}/start
|
|
47
|
+
// Returns: AiEvaluation.Id
|
|
48
|
+
return {
|
|
49
|
+
success: true,
|
|
50
|
+
jobId: '4KBSM000000003F4AQ', // AiEvaluation.Id; needed for getting status and stopping
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
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AC;SAC3D,CAAC;QACF,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC;YAC5B,IAAI,EAAE,GAAG;YACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;SACzD,CAAC;QACF,EAAE;QACF,gBAAgB;QAChB,iDAAiD;QACjD,kCAAkC;QAClC,sBAAsB;QACtB,yCAAyC;KAC1C,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAEjD,IAAI,CAAC,GAAG,CAAC,+CAA+C,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;QAEpE,8DAA8D;QAC9D,qEAAqE;QAErE,2BAA2B;QAE3B,OAAO;YACL,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,oBAAoB,EAAE,0DAA0D;SACxF,CAAC;IACJ,CAAC"}
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021, salesforce.com, inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
export default {};
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Create an Agent from an agent spec.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Create an Agent from an agent spec. Agent metadata is created in the target org and retrieved to the local project.
|
|
8
|
+
|
|
9
|
+
# flags.job-spec.summary
|
|
10
|
+
|
|
11
|
+
The path to an agent spec file.
|
|
12
|
+
|
|
13
|
+
# flags.job-spec.description
|
|
14
|
+
|
|
15
|
+
The agent spec file defines job titles and descriptions for the agent and can be created using the `sf agent create spec` command.
|
|
16
|
+
|
|
17
|
+
# flags.name.summary
|
|
18
|
+
|
|
19
|
+
The name of the agent.
|
|
20
|
+
|
|
21
|
+
# examples
|
|
22
|
+
|
|
23
|
+
- Create an Agent:
|
|
24
|
+
|
|
25
|
+
<%= config.bin %> <%= command.id %> --spec ./agent-spec.json
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Create an Agent spec.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Create an Agent spec, which is a list of job titles and descriptions that the agent performs.
|
|
8
|
+
|
|
9
|
+
# flags.type.summary
|
|
10
|
+
|
|
11
|
+
The type of agent to create.
|
|
12
|
+
|
|
13
|
+
# flags.role.summary
|
|
14
|
+
|
|
15
|
+
The role of the agent.
|
|
16
|
+
|
|
17
|
+
# flags.company-name.summary
|
|
18
|
+
|
|
19
|
+
The name of the company.
|
|
20
|
+
|
|
21
|
+
# flags.company-description.summary
|
|
22
|
+
|
|
23
|
+
The description of the company, containing details to be used when generating agent job descriptions.
|
|
24
|
+
|
|
25
|
+
# flags.company-website.summary
|
|
26
|
+
|
|
27
|
+
The website URL for the company.
|
|
28
|
+
|
|
29
|
+
# flags.output-dir.summary
|
|
30
|
+
|
|
31
|
+
The location within the project where the agent spec will be written.
|
|
32
|
+
|
|
33
|
+
# flags.file-name.summary
|
|
34
|
+
|
|
35
|
+
The name of the file to write the agent spec to.
|
|
36
|
+
|
|
37
|
+
# examples
|
|
38
|
+
|
|
39
|
+
- Create an Agent spec in the default location:
|
|
40
|
+
|
|
41
|
+
<%= config.bin %> <%= command.id %> --type customer_facing --role Support --company-name "Coral Cloud" --company-description "A meaningful description"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Cancel a running test for an Agent.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Cancel a running test for an Agent, providing the AiEvaluation ID.
|
|
8
|
+
|
|
9
|
+
# flags.id.summary
|
|
10
|
+
|
|
11
|
+
The AiEvaluation ID.
|
|
12
|
+
|
|
13
|
+
# flags.use-most-recent.summary
|
|
14
|
+
|
|
15
|
+
Use the job ID of the most recent test evaluation.
|
|
16
|
+
|
|
17
|
+
# examples
|
|
18
|
+
|
|
19
|
+
- Cancel a test for an Agent:
|
|
20
|
+
|
|
21
|
+
<%= config.bin %> <%= command.id %> --id AiEvalId
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Start a test for an Agent.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Start a test for an Agent, providing the AiEvalDefinitionVersion ID. Returns the job ID.
|
|
8
|
+
|
|
9
|
+
# flags.id.summary
|
|
10
|
+
|
|
11
|
+
The AiEvalDefinitionVersion ID.
|
|
12
|
+
|
|
13
|
+
# flags.id.description
|
|
14
|
+
|
|
15
|
+
The AiEvalDefinitionVersion ID.
|
|
16
|
+
|
|
17
|
+
# flags.wait.summary
|
|
18
|
+
|
|
19
|
+
Number of minutes to wait for the command to complete and display results to the terminal window.
|
|
20
|
+
|
|
21
|
+
# flags.wait.description
|
|
22
|
+
|
|
23
|
+
If the command continues to run after the wait period, the CLI returns control of the terminal window to you.
|
|
24
|
+
|
|
25
|
+
# flags.output-dir.summary
|
|
26
|
+
|
|
27
|
+
Directory in which to store test run files.
|
|
28
|
+
|
|
29
|
+
# examples
|
|
30
|
+
|
|
31
|
+
- Start a test for an Agent:
|
|
32
|
+
|
|
33
|
+
<%= config.bin %> <%= command.id %> --id AiEvalDefVerId
|