refactor: improve type safety by removing 'as any' casts

Created database.ts with proper database result types and replaced 38+ 'as any' casts throughout the codebase with proper type annotations.

Changes:
- Created src/types/database.ts with TableColumnInfo, IndexInfo, and database record types
- Fixed all type casts in SessionStore.ts (migrations, query results)
- Fixed type casts in SessionSearch.ts, SettingsManager.ts, SettingsRoutes.ts
- Improved MCP server JSON schema typing

All builds pass and worker service runs successfully.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Alex Newman
2025-12-07 21:41:40 -05:00
parent b1fb135d9c
commit 922f04e66a
9 changed files with 260 additions and 108 deletions
+1 -1
View File
@@ -383,7 +383,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
tools: tools.map(tool => ({
name: tool.name,
description: tool.description,
inputSchema: zodToJsonSchema(tool.inputSchema) as any
inputSchema: zodToJsonSchema(tool.inputSchema) as Record<string, unknown>
}))
};
});