Add /ide status & /ide install commands to manage IDE integration (#4265)

This commit is contained in:
Shreya Keshive
2025-07-16 18:36:14 -04:00
committed by GitHub
parent 69a8ae6a89
commit ab9eb9377f
7 changed files with 514 additions and 28 deletions

View File

@@ -153,6 +153,7 @@ describe('useSlashCommandProcessor', () => {
getCheckpointingEnabled: vi.fn(() => true),
getBugCommand: vi.fn(() => undefined),
getSessionId: vi.fn(() => 'test-session-id'),
getIdeMode: vi.fn(() => false),
} as unknown as Config;
mockCorgiMode = vi.fn();
mockUseSessionStats.mockReturnValue({
@@ -237,7 +238,10 @@ describe('useSlashCommandProcessor', () => {
const mockLoader = async () => [newCommand];
// We create the instance outside the mock implementation.
const commandServiceInstance = new ActualCommandService(mockLoader);
const commandServiceInstance = new ActualCommandService(
mockConfig,
mockLoader,
);
// This mock ensures the hook uses our pre-configured instance.
vi.mocked(CommandService).mockImplementation(
@@ -271,7 +275,10 @@ describe('useSlashCommandProcessor', () => {
});
const newCommand: SlashCommand = { name: 'test', action: mockAction };
const mockLoader = async () => [newCommand];
const commandServiceInstance = new ActualCommandService(mockLoader);
const commandServiceInstance = new ActualCommandService(
mockConfig,
mockLoader,
);
vi.mocked(CommandService).mockImplementation(
() => commandServiceInstance,
);
@@ -301,7 +308,10 @@ describe('useSlashCommandProcessor', () => {
});
const newCommand: SlashCommand = { name: 'test', action: mockAction };
const mockLoader = async () => [newCommand];
const commandServiceInstance = new ActualCommandService(mockLoader);
const commandServiceInstance = new ActualCommandService(
mockConfig,
mockLoader,
);
vi.mocked(CommandService).mockImplementation(
() => commandServiceInstance,
);
@@ -333,7 +343,10 @@ describe('useSlashCommandProcessor', () => {
});
const newCommand: SlashCommand = { name: 'test', action: mockAction };
const mockLoader = async () => [newCommand];
const commandServiceInstance = new ActualCommandService(mockLoader);
const commandServiceInstance = new ActualCommandService(
mockConfig,
mockLoader,
);
vi.mocked(CommandService).mockImplementation(
() => commandServiceInstance,
);
@@ -360,7 +373,10 @@ describe('useSlashCommandProcessor', () => {
const newAuthCommand: SlashCommand = { name: 'auth', action: mockAction };
const mockLoader = async () => [newAuthCommand];
const commandServiceInstance = new ActualCommandService(mockLoader);
const commandServiceInstance = new ActualCommandService(
mockConfig,
mockLoader,
);
vi.mocked(CommandService).mockImplementation(
() => commandServiceInstance,
);
@@ -386,7 +402,10 @@ describe('useSlashCommandProcessor', () => {
});
const newCommand: SlashCommand = { name: 'test', action: mockAction };
const mockLoader = async () => [newCommand];
const commandServiceInstance = new ActualCommandService(mockLoader);
const commandServiceInstance = new ActualCommandService(
mockConfig,
mockLoader,
);
vi.mocked(CommandService).mockImplementation(
() => commandServiceInstance,
);
@@ -414,7 +433,10 @@ describe('useSlashCommandProcessor', () => {
};
const mockLoader = async () => [parentCommand];
const commandServiceInstance = new ActualCommandService(mockLoader);
const commandServiceInstance = new ActualCommandService(
mockConfig,
mockLoader,
);
vi.mocked(CommandService).mockImplementation(
() => commandServiceInstance,
);