feat: Add source code viewer with Gitea integration

- Add /source page with file explorer and code viewer
- Connect to Gitea API for repository browsing
- Implement MCP tools: get_repo_info, list_repo_files, read_repo_file, search_repo_code
- Default to nucleo000/agent-ui repository
- Support branch switching and file search
This commit is contained in:
2026-02-13 06:50:58 -06:00
parent 97ef49aea4
commit 2a2100bbb2
7 changed files with 1401 additions and 2 deletions

View File

@@ -29,8 +29,13 @@ import {
unregisterDatabaseTools,
DATABASE_TOOLS
} from './tools/databaseTools'
import {
registerSourceCodeTools,
unregisterSourceCodeTools,
SOURCE_CODE_TOOLS
} from './tools/sourceCodeTools'
type PageName = 'home' | 'canvas' | 'components' | 'themes' | 'projects' | 'project-canvas' | 'database'
type PageName = 'home' | 'canvas' | 'components' | 'themes' | 'projects' | 'project-canvas' | 'database' | 'source'
interface PageToolSet {
register: () => void
@@ -95,6 +100,11 @@ const pageTools: Record<PageName, PageToolSet> = {
register: registerDatabaseTools,
unregister: unregisterDatabaseTools,
toolNames: DATABASE_TOOLS
},
source: {
register: registerSourceCodeTools,
unregister: unregisterSourceCodeTools,
toolNames: SOURCE_CODE_TOOLS
}
}