refactor(extension): extract config/state/logging/models/messages/http modules (SRP)

Co-Authored-By: Lars Baunwall <larslb@thinkability.dk>
This commit is contained in:
Devin AI 2025-08-12 20:40:55 +00:00
parent f4e6b390e3
commit c8afe9ee17
16 changed files with 634 additions and 623 deletions

25
src/http/routes/models.ts Normal file
View file

@ -0,0 +1,25 @@
import { writeJson } from '../utils';
import { listCopilotModels } from '../../models';
export const handleModelsRequest = async (res: any): Promise<void> => {
try {
const models = await listCopilotModels();
writeJson(res, 200, {
data: models.map((id: string) => ({
id,
object: 'model',
owned_by: 'vscode-bridge',
})),
});
} catch {
writeJson(res, 200, {
data: [
{
id: 'copilot',
object: 'model',
owned_by: 'vscode-bridge',
},
],
});
}
};