Skip to content

Commit 3f942b2

Browse files
committed
feat: add command stubs
1 parent 81ec3a3 commit 3f942b2

21 files changed

+453
-62
lines changed

messages/agent.generate.test.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# summary
2+
3+
Summary of a command.
4+
5+
# description
6+
7+
More information about a command. Don't repeat the summary.
8+
9+
# flags.name.summary
10+
11+
Description of a flag.
12+
13+
# flags.name.description
14+
15+
More information about a flag. Don't repeat the summary.
16+
17+
# examples
18+
19+
- <%= config.bin %> <%= command.id %>

messages/agent.test.cancel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Cancel a running test for an Agent.
66

77
Cancel a running test for an Agent, providing the AiEvaluation ID.
88

9-
# flags.id.summary
9+
# flags.job-id.summary
1010

1111
The AiEvaluation ID.
1212

messages/agent.test.results.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# summary
2+
3+
Summary of a command.
4+
5+
# description
6+
7+
More information about a command. Don't repeat the summary.
8+
9+
# flags.name.summary
10+
11+
Description of a flag.
12+
13+
# flags.name.description
14+
15+
More information about a flag. Don't repeat the summary.
16+
17+
# examples
18+
19+
- <%= config.bin %> <%= command.id %>

messages/agent.test.resume.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# summary
2+
3+
Summary of a command.
4+
5+
# description
6+
7+
More information about a command. Don't repeat the summary.
8+
9+
# flags.name.summary
10+
11+
Description of a flag.
12+
13+
# flags.name.description
14+
15+
More information about a flag. Don't repeat the summary.
16+
17+
# examples
18+
19+
- <%= config.bin %> <%= command.id %>

package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"@oclif/core": "^4",
1212
"@oclif/multi-stage-output": "^0.7.12",
1313
"@salesforce/agents": "^0.1.4",
14-
"@salesforce/core": "^8.5.2",
14+
"@salesforce/core": "^8.8.0",
1515
"@salesforce/kit": "^3.2.1",
16-
"@salesforce/sf-plugins-core": "^12",
16+
"@salesforce/sf-plugins-core": "^12.1.0",
1717
"ansis": "^3.3.2"
1818
},
1919
"devDependencies": {
@@ -60,7 +60,16 @@
6060
],
6161
"topics": {
6262
"agent": {
63-
"description": "Commands to work with agents."
63+
"description": "Commands to work with agents.",
64+
"external": true,
65+
"subtopics": {
66+
"test": {
67+
"external": true
68+
},
69+
"generate": {
70+
"external": true
71+
}
72+
}
6473
}
6574
},
6675
"flexibleTaxonomy": true

schemas/agent-create.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@
1212
"type": "string"
1313
}
1414
},
15-
"required": [
16-
"isSuccess"
17-
],
15+
"required": ["isSuccess"],
1816
"additionalProperties": false
1917
}
2018
}
21-
}
19+
}

schemas/agent-generate-spec.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
"type": "string"
1616
}
1717
},
18-
"required": [
19-
"isSuccess"
20-
],
18+
"required": ["isSuccess"],
2119
"additionalProperties": false
2220
}
2321
}
24-
}
22+
}

schemas/agent-test-cancel.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@
1818
"type": "string"
1919
}
2020
},
21-
"required": [
22-
"jobId",
23-
"success"
24-
],
21+
"required": ["jobId", "success"],
2522
"additionalProperties": false
2623
}
2724
}
28-
}
25+
}

schemas/agent-test-run.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@
1818
"type": "string"
1919
}
2020
},
21-
"required": [
22-
"jobId",
23-
"success"
24-
],
21+
"required": ["jobId", "success"],
2522
"additionalProperties": false
2623
}
2724
}
28-
}
25+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (c) 2023, 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+
8+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
9+
import { Messages } from '@salesforce/core';
10+
11+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
12+
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.generate.test');
13+
14+
export type AgentGenerateTestResult = {
15+
path: string;
16+
};
17+
18+
export default class AgentGenerateTest extends SfCommand<AgentGenerateTestResult> {
19+
public static readonly summary = messages.getMessage('summary');
20+
public static readonly description = messages.getMessage('description');
21+
public static readonly examples = messages.getMessages('examples');
22+
23+
public static readonly flags = {
24+
name: Flags.string({
25+
summary: messages.getMessage('flags.name.summary'),
26+
description: messages.getMessage('flags.name.description'),
27+
char: 'n',
28+
required: false,
29+
}),
30+
};
31+
32+
public async run(): Promise<AgentGenerateTestResult> {
33+
const { flags } = await this.parse(AgentGenerateTest);
34+
35+
const name = flags.name ?? 'world';
36+
this.log(`hello ${name} from src/commands/agent/generate/test.ts`);
37+
return {
38+
path: 'src/commands/agent/generate/test.ts',
39+
};
40+
}
41+
}

0 commit comments

Comments
 (0)