mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-01-31 06:42:06 +00:00
feat: Add conversational AI assistant panel for project codebase Q&A
Implement a slide-in chat panel that allows users to ask questions about their codebase using Claude Opus 4.5 with read-only access to project files. Backend changes: - Add SQLAlchemy models for conversation persistence (assistant_database.py) - Create AssistantChatSession with read-only Claude SDK client - Add WebSocket endpoint for real-time chat streaming - Include read-only MCP tools: feature_get_stats, feature_get_next, etc. Frontend changes: - Add floating action button (bottom-right) to toggle panel - Create slide-in panel component (400px width) - Implement WebSocket hook with reconnection logic - Add keyboard shortcut 'A' to toggle assistant Key features: - Read-only access: Only Read, Glob, Grep, WebFetch, WebSearch tools - Persistent history: Conversations saved to SQLite per project - Real-time streaming: Text chunks streamed as Claude generates response - Tool visibility: Shows when assistant is using tools to explore code 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,8 @@ import type {
|
||||
SetupStatus,
|
||||
DirectoryListResponse,
|
||||
PathValidationResponse,
|
||||
AssistantConversation,
|
||||
AssistantConversationDetail,
|
||||
} from './types'
|
||||
|
||||
const API_BASE = '/api'
|
||||
@@ -228,3 +230,40 @@ export async function validatePath(path: string): Promise<PathValidationResponse
|
||||
body: JSON.stringify({ path }),
|
||||
})
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Assistant Chat API
|
||||
// ============================================================================
|
||||
|
||||
export async function listAssistantConversations(
|
||||
projectName: string
|
||||
): Promise<AssistantConversation[]> {
|
||||
return fetchJSON(`/assistant/conversations/${encodeURIComponent(projectName)}`)
|
||||
}
|
||||
|
||||
export async function getAssistantConversation(
|
||||
projectName: string,
|
||||
conversationId: number
|
||||
): Promise<AssistantConversationDetail> {
|
||||
return fetchJSON(
|
||||
`/assistant/conversations/${encodeURIComponent(projectName)}/${conversationId}`
|
||||
)
|
||||
}
|
||||
|
||||
export async function createAssistantConversation(
|
||||
projectName: string
|
||||
): Promise<AssistantConversation> {
|
||||
return fetchJSON(`/assistant/conversations/${encodeURIComponent(projectName)}`, {
|
||||
method: 'POST',
|
||||
})
|
||||
}
|
||||
|
||||
export async function deleteAssistantConversation(
|
||||
projectName: string,
|
||||
conversationId: number
|
||||
): Promise<void> {
|
||||
await fetchJSON(
|
||||
`/assistant/conversations/${encodeURIComponent(projectName)}/${conversationId}`,
|
||||
{ method: 'DELETE' }
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user