feat(cli): refactor about dialog and add proxy field

This commit is contained in:
tanzhenxin 2026-01-19 10:54:45 +08:00
parent c87197d420
commit f0b2a7ef98
15 changed files with 270 additions and 176 deletions

View file

@ -8,7 +8,8 @@ vi.mock('../ui/commands/aboutCommand.js', async () => {
const { CommandKind } = await import('../ui/commands/types.js');
return {
aboutCommand: {
name: 'about',
name: 'status',
altNames: ['about'],
description: 'About the CLI',
kind: CommandKind.BUILT_IN,
},
@ -127,8 +128,8 @@ describe('BuiltinCommandLoader', () => {
expect(ideCmd).toBeDefined();
// Other commands should still be present.
const aboutCmd = commands.find((c) => c.name === 'about');
expect(aboutCmd).toBeDefined();
const statusCmd = commands.find((c) => c.name === 'status');
expect(statusCmd).toBeDefined();
});
it('should handle a null config gracefully when calling factories', async () => {
@ -143,9 +144,9 @@ describe('BuiltinCommandLoader', () => {
const loader = new BuiltinCommandLoader(mockConfig);
const commands = await loader.loadCommands(new AbortController().signal);
const aboutCmd = commands.find((c) => c.name === 'about');
expect(aboutCmd).toBeDefined();
expect(aboutCmd?.kind).toBe(CommandKind.BUILT_IN);
const statusCmd = commands.find((c) => c.name === 'status');
expect(statusCmd).toBeDefined();
expect(statusCmd?.kind).toBe(CommandKind.BUILT_IN);
const approvalModeCmd = commands.find((c) => c.name === 'approval-mode');
expect(approvalModeCmd).toBeDefined();