From f23c41f216f4ae5abb18eba8a778e6bb66b233c0 Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 19:40:43 -0600 Subject: [PATCH 01/19] Update config.rs --- backend/src/server/config.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/backend/src/server/config.rs b/backend/src/server/config.rs index a0f135a2d..da232bc37 100644 --- a/backend/src/server/config.rs +++ b/backend/src/server/config.rs @@ -1,6 +1,7 @@ use super::services::{ deepseek::DeepSeekService, github_issue::GitHubService, + groq::GroqService, oauth::{github::GitHubOAuth, scramble::ScrambleOAuth, OAuthConfig}, openrouter::OpenRouterService, solver::SolverService, @@ -28,6 +29,7 @@ pub struct AppState { pub scramble_oauth: Arc, pub pool: PgPool, pub frontend_url: String, + pub groq: Arc, } #[derive(Clone)] @@ -129,6 +131,11 @@ pub fn configure_app_with_config(pool: PgPool, config: Option) -> Rou let chat_model = Arc::new(DeepSeekService::with_base_url(api_key, base_url)); + // Initialize Groq service + let groq = Arc::new(GroqService::new( + env::var("GROQ_API_KEY").expect("GROQ_API_KEY must be set"), + )); + let tools = create_tools(); let ws_state = Arc::new(WebSocketState::new( @@ -177,6 +184,7 @@ pub fn configure_app_with_config(pool: PgPool, config: Option) -> Rou scramble_oauth, pool: pool.clone(), frontend_url: config.frontend_url, + groq, }; // Create the main router @@ -263,4 +271,4 @@ pub fn app_router(state: AppState) -> Router { ) .layer(middleware::from_fn(log_request)) .with_state(state) -} +} \ No newline at end of file From 7b4ebbd0128262f27d1943de1336e869b9f16b50 Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 19:41:29 -0600 Subject: [PATCH 02/19] Update chat.rs --- backend/src/server/handlers/chat.rs | 80 +++++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 5 deletions(-) diff --git a/backend/src/server/handlers/chat.rs b/backend/src/server/handlers/chat.rs index 2cf2b2900..b55d25361 100644 --- a/backend/src/server/handlers/chat.rs +++ b/backend/src/server/handlers/chat.rs @@ -103,6 +103,42 @@ pub async fn start_repo_chat( info!("Created message with id: {}", message.id); + // Get Groq response + let (ai_response, _) = state + .groq + .chat(request.message.clone(), false) + .await + .map_err(|e| { + error!("Failed to get Groq response: {:?}", e); + ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("Failed to get AI response: {}", e), + ) + })?; + + // Save AI response + let ai_message = chat_db + .create_message(&CreateMessageRequest { + conversation_id: conversation.id, + user_id: user_id.clone(), + role: "assistant".to_string(), + content: ai_response, + metadata: Some(json!({ + "repos": request.repos + })), + tool_calls: None, + }) + .await + .map_err(|e| { + error!("Failed to save AI response: {:?}", e); + ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("Failed to save AI response: {}", e), + ) + })?; + + info!("Created AI message with id: {}", ai_message.id); + Ok(Json(StartChatResponse { id: conversation.id.to_string(), initial_message: message.content, @@ -165,7 +201,7 @@ pub async fn send_message( } }; - // Create message + // Create user message let message = chat_db .create_message(&CreateMessageRequest { conversation_id: request.conversation_id, @@ -184,11 +220,45 @@ pub async fn send_message( ) })?; - info!("Created message with id: {}", message.id); + info!("Created user message with id: {}", message.id); + + // Get Groq response + let (ai_response, _) = state + .groq + .chat(request.message.clone(), false) + .await + .map_err(|e| { + error!("Failed to get Groq response: {:?}", e); + ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("Failed to get AI response: {}", e), + ) + })?; + + // Save AI response + let ai_message = chat_db + .create_message(&CreateMessageRequest { + conversation_id: request.conversation_id, + user_id: user_id.clone(), + role: "assistant".to_string(), + content: ai_response, + metadata, + tool_calls: None, + }) + .await + .map_err(|e| { + error!("Failed to save AI response: {:?}", e); + ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("Failed to save AI response: {}", e), + ) + })?; + + info!("Created AI message with id: {}", ai_message.id); Ok(Json(SendMessageResponse { - id: message.id.to_string(), - message: message.content, + id: ai_message.id.to_string(), + message: ai_message.content, })) } @@ -228,4 +298,4 @@ pub async fn get_conversation_messages( info!("Found {} messages", messages.len()); Ok(Json(messages)) -} +} \ No newline at end of file From bdf11345395bf65e1bbfd13934a2f7e9ce60cf16 Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 19:41:58 -0600 Subject: [PATCH 03/19] Update $id.tsx --- frontend/app/routes/chat/$id.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/app/routes/chat/$id.tsx b/frontend/app/routes/chat/$id.tsx index 73fb0658c..de39feb19 100644 --- a/frontend/app/routes/chat/$id.tsx +++ b/frontend/app/routes/chat/$id.tsx @@ -72,15 +72,15 @@ export default function ChatSession() {
- {message.role === "user" ? ">" : "⏻"} + {message.role === "user" ? "👤" : "🤖"}
- {message.content} - {/* {message.metadata?.repos && ( +
{message.content}
+ {message.metadata?.repos && (
Repos: {message.metadata.repos.join(", ")}
- )} */} + )}
@@ -103,4 +103,4 @@ export default function ChatSession() { ); -} +} \ No newline at end of file From 70096ee415052a25f80fdd2a4811fc4e3cb34252 Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 19:52:53 -0600 Subject: [PATCH 04/19] Update chat.rs --- backend/src/server/handlers/chat.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/server/handlers/chat.rs b/backend/src/server/handlers/chat.rs index b55d25361..2ce1faa8e 100644 --- a/backend/src/server/handlers/chat.rs +++ b/backend/src/server/handlers/chat.rs @@ -12,7 +12,7 @@ use crate::server::{ config::AppState, handlers::oauth::session::SESSION_COOKIE_NAME, models::chat::{CreateConversationRequest, CreateMessageRequest, Message}, - services::chat_database::ChatDatabaseService, + services::{chat_database::ChatDatabaseService, gateway::Gateway}, }; #[derive(Debug, Deserialize)] From f95abd1598a8a0cd59fc664462e06b97352d7918 Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 19:54:39 -0600 Subject: [PATCH 05/19] Update chat.rs --- backend/src/server/handlers/chat.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/server/handlers/chat.rs b/backend/src/server/handlers/chat.rs index 2ce1faa8e..afe90b2ae 100644 --- a/backend/src/server/handlers/chat.rs +++ b/backend/src/server/handlers/chat.rs @@ -208,7 +208,7 @@ pub async fn send_message( user_id: user_id.clone(), role: "user".to_string(), content: request.message.clone(), - metadata, + metadata: metadata.clone(), // Clone here tool_calls: None, }) .await @@ -242,7 +242,7 @@ pub async fn send_message( user_id: user_id.clone(), role: "assistant".to_string(), content: ai_response, - metadata, + metadata, // Original value used here tool_calls: None, }) .await From 747f3609748a271833b581042c28cca170e35a92 Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 19:55:49 -0600 Subject: [PATCH 06/19] format --- backend/src/server/config.rs | 2 +- backend/src/server/handlers/chat.rs | 2 +- docs/repomap.md | 147 ++++++++++++++-------------- frontend/app/routes/chat/$id.tsx | 2 +- 4 files changed, 76 insertions(+), 77 deletions(-) diff --git a/backend/src/server/config.rs b/backend/src/server/config.rs index da232bc37..b2044dcf7 100644 --- a/backend/src/server/config.rs +++ b/backend/src/server/config.rs @@ -271,4 +271,4 @@ pub fn app_router(state: AppState) -> Router { ) .layer(middleware::from_fn(log_request)) .with_state(state) -} \ No newline at end of file +} diff --git a/backend/src/server/handlers/chat.rs b/backend/src/server/handlers/chat.rs index afe90b2ae..039fd15b1 100644 --- a/backend/src/server/handlers/chat.rs +++ b/backend/src/server/handlers/chat.rs @@ -298,4 +298,4 @@ pub async fn get_conversation_messages( info!("Found {} messages", messages.len()); Ok(Json(messages)) -} \ No newline at end of file +} diff --git a/docs/repomap.md b/docs/repomap.md index d696502c8..6029b8a1b 100644 --- a/docs/repomap.md +++ b/docs/repomap.md @@ -86,11 +86,11 @@ backend/src/repo/types.rs: backend/src/repomap.rs: │#id: test │fn generate_repo_map -│fn +│fn │fn extract_id │fn extract_function_name -│fn -│fn +│fn +│fn │fn extract_class_name │fn extract_const_name │fn init_logging @@ -102,15 +102,15 @@ backend/src/repomap.rs: │fn test_extractors │fn test_func │class in -│class -│class -│class -│class +│class +│class +│class +│class │class TestClass │const DEFAULT_BLACKLIST -│const -│const -│const +│const +│const +│const │const TEST_CONST backend/src/routes.rs: @@ -483,7 +483,7 @@ backend/src/server/ws/types.rs: │fn fmt backend/tailwind.config.cjs: -│const +│const backend/templates/admin/dashboard.html: │#id: bg @@ -628,7 +628,7 @@ backend/templates/layouts/content.html: │#id: content backend/templates/macros/ui.html: -│class +│class backend/templates/pages/company.html: │class of @@ -839,10 +839,10 @@ frontend/app/+types/video-series.ts: │const VIDEOS frontend/app/components/chat/chat-input.tsx: -│const -│const -│const -│const +│const +│const +│const +│const │const textareaRef │const handleSubmitMessage │const repos @@ -856,9 +856,9 @@ frontend/app/components/chat/chat-input.tsx: frontend/app/components/chat/repo-selector.tsx: │const RepoForm -│const -│const -│const +│const +│const +│const │const handleRepoInputChange │const handleRepoSubmit │const handleRemoveRepo @@ -868,7 +868,7 @@ frontend/app/components/chat/repo-selector.tsx: frontend/app/components/chat/thinking.tsx: │const scrollRef │const contentRef -│const +│const │const shouldScroll │const getIcon │const getLabel @@ -877,7 +877,7 @@ frontend/app/components/chat/thinking.tsx: frontend/app/components/header-bar.tsx: │#id: login-button │#id: signup-button -│const +│const │const navigateTo frontend/app/components/library/chat.tsx: @@ -892,17 +892,17 @@ frontend/app/components/library/shad.tsx: │#id: name │#id: bio │#id: message -│const +│const frontend/app/components/login-form.tsx: │#id: email │#id: password -│const -│const -│const -│const -│const -│const +│const +│const +│const +│const +│const +│const │const checkEmail │const url │const response @@ -930,17 +930,17 @@ frontend/app/components/ui/button.tsx: frontend/app/components/ui/carousel.tsx: │const CarouselContext │const context -│const -│const -│const +│const +│const +│const │const onSelect │const scrollPrev │const scrollNext │const handleKeyDown -│const -│const -│const -│const +│const +│const +│const +│const frontend/app/components/ui/chart.tsx: │const THEMES @@ -954,9 +954,9 @@ frontend/app/components/ui/chart.tsx: │const color │const ChartTooltip │const ChartTooltipContent -│const +│const │const tooltipLabel -│const +│const │const key │const itemConfig │const value @@ -966,7 +966,7 @@ frontend/app/components/ui/chart.tsx: │const indicatorColor │const ChartLegend │const ChartLegendContent -│const +│const │const key │const itemConfig │const payloadPayload @@ -978,21 +978,21 @@ frontend/app/components/ui/form.tsx: │const useFormField │const fieldContext │const itemContext -│const +│const │const formState │const fieldState -│const +│const │const FormItemContext │const id -│const -│const -│const -│const +│const +│const +│const +│const │const body frontend/app/components/ui/input-otp.tsx: │const inputOTPContext -│const +│const frontend/app/components/ui/navigation-menu.tsx: │const navigationMenuTriggerStyle @@ -1008,8 +1008,8 @@ frontend/app/components/ui/sidebar.tsx: │const context │const SidebarProvider │const isMobile -│const -│const +│const +│const │const open │const setOpen │const openState @@ -1017,25 +1017,25 @@ frontend/app/components/ui/sidebar.tsx: │const handleKeyDown │const state │const contextValue -│const -│const -│const +│const +│const +│const │const Comp │const Comp │const sidebarMenuButtonVariants │const Comp -│const +│const │const button │const Comp │const width │const Comp frontend/app/components/ui/slider.tsx: -│const _values +│const \_values frontend/app/components/ui/sonner.tsx: │const Toaster -│const +│const frontend/app/components/ui/toggle-group.tsx: │const ToggleGroupContext @@ -1046,13 +1046,13 @@ frontend/app/components/ui/toggle.tsx: frontend/app/hooks/use-mobile.ts: │const MOBILE_BREAKPOINT -│const +│const │const mql │const onChange frontend/app/lib/agentsync/hooks/useAgentSync.ts: │const INITIAL_STATE -│const +│const │const handleOnline │const handleOffline │const sendMessage @@ -1067,18 +1067,18 @@ frontend/app/lib/agentsync/hooks/useAgentSync.ts: frontend/app/root.tsx: │const links -frontend/app/routes/_layout.tsx: +frontend/app/routes/\_layout.tsx: │const navItems │const location frontend/app/routes/chat/$id.tsx: │const EMPTY_MESSAGES -│const -│const +│const +│const │const messageContainerRef │const messagesSelector │const messages -│const +│const │const loadMessages │const response │const data @@ -1086,8 +1086,8 @@ frontend/app/routes/chat/$id.tsx: frontend/app/routes/chat/index.tsx: │const navigate -│const -│const +│const +│const │const handleSubmit │const response @@ -1096,11 +1096,11 @@ frontend/app/routes/company.tsx: frontend/app/routes/components/thinking.tsx: │const DEMO_TEXT -│const -│const -│const -│const -│const +│const +│const +│const +│const +│const │const allLines │const timer │const elapsed @@ -1114,8 +1114,8 @@ frontend/app/routes/login.tsx: frontend/app/routes/repomap.tsx: │#id: repo_url -│const -│const +│const +│const │const handleSubmit │const formData │const repoUrl @@ -1124,11 +1124,11 @@ frontend/app/routes/repomap.tsx: frontend/app/routes/thinking.tsx: │const DEMO_TEXT -│const -│const -│const -│const -│const +│const +│const +│const +│const +│const │const allLines │const timer │const elapsed @@ -1145,4 +1145,3 @@ frontend/app/welcome/logo-light.svg: frontend/app/welcome/welcome.tsx: │const resources - diff --git a/frontend/app/routes/chat/$id.tsx b/frontend/app/routes/chat/$id.tsx index de39feb19..025094835 100644 --- a/frontend/app/routes/chat/$id.tsx +++ b/frontend/app/routes/chat/$id.tsx @@ -103,4 +103,4 @@ export default function ChatSession() { ); -} \ No newline at end of file +} From 9195f3c94b7b3c0a00202f1dd7c3fb33821df831 Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 20:00:40 -0600 Subject: [PATCH 07/19] use llama --- backend/src/server/services/groq/service.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/server/services/groq/service.rs b/backend/src/server/services/groq/service.rs index f5d0ac720..58c1bb3b2 100644 --- a/backend/src/server/services/groq/service.rs +++ b/backend/src/server/services/groq/service.rs @@ -53,7 +53,7 @@ impl Gateway for GroqService { name: "Groq".to_string(), openai_compatible: true, supported_features: vec!["chat".to_string(), "streaming".to_string()], - default_model: "mixtral-8x7b-32768".to_string(), + default_model: "llama-3.1-8b-instant".to_string(), available_models: vec![ "llama-3.1-8b-instant".to_string(), "llama-3.3-70b-versatile".to_string(), From f88b5c42f72313b5856cc1deb6190095895ba305 Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 20:01:16 -0600 Subject: [PATCH 08/19] not repos --- frontend/app/routes/chat/$id.tsx | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/frontend/app/routes/chat/$id.tsx b/frontend/app/routes/chat/$id.tsx index 025094835..de75408ce 100644 --- a/frontend/app/routes/chat/$id.tsx +++ b/frontend/app/routes/chat/$id.tsx @@ -1,8 +1,8 @@ -import { useAgentSync } from "agentsync"; -import { useCallback, useEffect, useRef } from "react"; -import { useParams } from "react-router"; -import { ChatInput } from "~/components/chat/chat-input"; -import { useMessagesStore } from "~/stores/messages"; +import { useAgentSync } from "agentsync" +import { useCallback, useEffect, useRef } from "react" +import { useParams } from "react-router" +import { ChatInput } from "~/components/chat/chat-input" +import { useMessagesStore } from "~/stores/messages" import type { Message } from "~/stores/messages"; @@ -76,11 +76,6 @@ export default function ChatSession() {
{message.content}
- {message.metadata?.repos && ( -
- Repos: {message.metadata.repos.join(", ")} -
- )}
From 78f48e4007721a2d065d43455ee6ecfafd712d2c Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 20:02:06 -0600 Subject: [PATCH 09/19] textsm --- frontend/app/routes/chat/$id.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/app/routes/chat/$id.tsx b/frontend/app/routes/chat/$id.tsx index de75408ce..621452a67 100644 --- a/frontend/app/routes/chat/$id.tsx +++ b/frontend/app/routes/chat/$id.tsx @@ -65,7 +65,7 @@ export default function ChatSession() { }; return ( -
+
{messages.map((message) => ( From 1625bfe5238a33fd7c2e6eee920f89c60b33fc7d Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 20:04:37 -0600 Subject: [PATCH 10/19] Update service.rs --- backend/src/server/services/groq/service.rs | 58 +++++++++++++-------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/backend/src/server/services/groq/service.rs b/backend/src/server/services/groq/service.rs index 58c1bb3b2..d78635ce4 100644 --- a/backend/src/server/services/groq/service.rs +++ b/backend/src/server/services/groq/service.rs @@ -1,5 +1,6 @@ use anyhow::{Context, Result}; use reqwest::{Client, ClientBuilder}; +use serde_json::Value; use std::pin::Pin; use std::time::Duration; use tokio_stream::Stream; @@ -44,35 +45,19 @@ impl GroqService { base_url, } } -} - -#[async_trait::async_trait] -impl Gateway for GroqService { - fn metadata(&self) -> GatewayMetadata { - GatewayMetadata { - name: "Groq".to_string(), - openai_compatible: true, - supported_features: vec!["chat".to_string(), "streaming".to_string()], - default_model: "llama-3.1-8b-instant".to_string(), - available_models: vec![ - "llama-3.1-8b-instant".to_string(), - "llama-3.3-70b-versatile".to_string(), - "mixtral-8x7b-32768".to_string(), - ], - } - } - async fn chat(&self, prompt: String, use_reasoner: bool) -> Result<(String, Option)> { + pub async fn chat_with_history( + &self, + messages: Vec, + use_reasoner: bool, + ) -> Result<(String, Option)> { let response = self .client .post(format!("{}/chat/completions", self.base_url)) .header("Authorization", format!("Bearer {}", self.api_key)) .json(&serde_json::json!({ "model": self.metadata().default_model, - "messages": [{ - "role": "user", - "content": prompt - }], + "messages": messages, "temperature": if use_reasoner { 0.0 } else { 0.7 }, "stream": false })) @@ -100,6 +85,33 @@ impl Gateway for GroqService { Ok((content, None)) } +} + +#[async_trait::async_trait] +impl Gateway for GroqService { + fn metadata(&self) -> GatewayMetadata { + GatewayMetadata { + name: "Groq".to_string(), + openai_compatible: true, + supported_features: vec!["chat".to_string(), "streaming".to_string()], + default_model: "mixtral-8x7b-32768".to_string(), + available_models: vec![ + "llama-3.1-8b-instant".to_string(), + "llama-3.3-70b-versatile".to_string(), + "mixtral-8x7b-32768".to_string(), + ], + } + } + + async fn chat(&self, prompt: String, use_reasoner: bool) -> Result<(String, Option)> { + // Convert single message to messages array format + let messages = vec![serde_json::json!({ + "role": "user", + "content": prompt + })]; + + self.chat_with_history(messages, use_reasoner).await + } async fn chat_stream( &self, @@ -109,4 +121,4 @@ impl Gateway for GroqService { // TODO: Implement streaming using SSE todo!("Implement streaming") } -} +} \ No newline at end of file From 1c8aafe11cfb2f36e8a2c05db16f847e2bfc9a1b Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 20:05:15 -0600 Subject: [PATCH 11/19] Update service.rs --- backend/src/server/services/groq/service.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/server/services/groq/service.rs b/backend/src/server/services/groq/service.rs index d78635ce4..1bdbd396e 100644 --- a/backend/src/server/services/groq/service.rs +++ b/backend/src/server/services/groq/service.rs @@ -46,7 +46,7 @@ impl GroqService { } } - pub async fn chat_with_history( + async fn chat_with_history( &self, messages: Vec, use_reasoner: bool, @@ -104,7 +104,7 @@ impl Gateway for GroqService { } async fn chat(&self, prompt: String, use_reasoner: bool) -> Result<(String, Option)> { - // Convert single message to messages array format + // Convert single prompt into messages format let messages = vec![serde_json::json!({ "role": "user", "content": prompt From 678d2dd379aff828a639fa157346704cce392f03 Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 20:07:36 -0600 Subject: [PATCH 12/19] new button --- frontend/app/components/header-bar.tsx | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/frontend/app/components/header-bar.tsx b/frontend/app/components/header-bar.tsx index aefb171f2..71424ca50 100644 --- a/frontend/app/components/header-bar.tsx +++ b/frontend/app/components/header-bar.tsx @@ -1,13 +1,10 @@ -import { useEffect, useState } from "react"; -import { Link } from "react-router"; -import { Button } from "./ui/button"; +import { useEffect, useState } from "react" +import { Link } from "react-router" +import { Button } from "./ui/button" import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuSeparator, - DropdownMenuTrigger, -} from "./ui/dropdown-menu"; + DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, + DropdownMenuTrigger +} from "./ui/dropdown-menu" interface UserMetadata { name: string; @@ -51,11 +48,11 @@ export function HeaderBar() { {/* Left/Middle Section */}
- - {/* + + - */} +
From c242797c9444811cd0805c69945cf44daa3c74fa Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 20:14:45 -0600 Subject: [PATCH 13/19] hm --- backend/src/server/handlers/chat.rs | 117 ++++++++++------------------ 1 file changed, 40 insertions(+), 77 deletions(-) diff --git a/backend/src/server/handlers/chat.rs b/backend/src/server/handlers/chat.rs index 039fd15b1..fbae66c69 100644 --- a/backend/src/server/handlers/chat.rs +++ b/backend/src/server/handlers/chat.rs @@ -103,18 +103,20 @@ pub async fn start_repo_chat( info!("Created message with id: {}", message.id); + // Convert message to Groq format + let _messages = vec![json!({ + "role": "user", + "content": request.message + })]; + // Get Groq response - let (ai_response, _) = state - .groq - .chat(request.message.clone(), false) - .await - .map_err(|e| { - error!("Failed to get Groq response: {:?}", e); - ( - StatusCode::INTERNAL_SERVER_ERROR, - format!("Failed to get AI response: {}", e), - ) - })?; + let (ai_response, _) = state.groq.chat(request.message, false).await.map_err(|e| { + error!("Failed to get Groq response: {:?}", e); + ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("Failed to get AI response: {}", e), + ) + })?; // Save AI response let ai_message = chat_db @@ -164,51 +166,15 @@ pub async fn send_message( "No session found. Please log in.".to_string(), )); }; - info!("Using user_id: {}", user_id); - - // If no repos provided in the request, try to get them from the conversation's first message - let metadata = if let Some(repos) = request.repos { - info!("Using repos from request: {:?}", repos); - Some(json!({ "repos": repos })) - } else { - // Get the first message of the conversation to find the repos - let messages = chat_db - .get_conversation_messages(request.conversation_id) - .await - .map_err(|e| { - error!("Failed to fetch conversation messages: {:?}", e); - ( - StatusCode::INTERNAL_SERVER_ERROR, - format!("Failed to fetch conversation messages: {}", e), - ) - })?; - - // Find the first message with repos metadata - let first_message_repos = messages.iter().find_map(|msg| { - msg.metadata.as_ref().and_then(|meta| { - meta.get("repos") - .and_then(|repos| repos.as_array()) - .map(|repos| repos.to_owned()) - }) - }); - - if let Some(repos) = first_message_repos { - info!("Using repos from first message: {:?}", repos); - Some(json!({ "repos": repos })) - } else { - info!("No repos found in request or first message"); - None - } - }; // Create user message - let message = chat_db + let _message = chat_db .create_message(&CreateMessageRequest { conversation_id: request.conversation_id, user_id: user_id.clone(), role: "user".to_string(), content: request.message.clone(), - metadata: metadata.clone(), // Clone here + metadata: request.repos.clone().map(|repos| json!({ "repos": repos })), tool_calls: None, }) .await @@ -220,29 +186,23 @@ pub async fn send_message( ) })?; - info!("Created user message with id: {}", message.id); - - // Get Groq response - let (ai_response, _) = state - .groq - .chat(request.message.clone(), false) - .await - .map_err(|e| { - error!("Failed to get Groq response: {:?}", e); - ( - StatusCode::INTERNAL_SERVER_ERROR, - format!("Failed to get AI response: {}", e), - ) - })?; + // Get AI response + let (ai_response, _) = state.groq.chat(request.message, false).await.map_err(|e| { + error!("Failed to get Groq response: {:?}", e); + ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("Failed to get AI response: {}", e), + ) + })?; // Save AI response let ai_message = chat_db .create_message(&CreateMessageRequest { conversation_id: request.conversation_id, - user_id: user_id.clone(), + user_id: user_id, role: "assistant".to_string(), - content: ai_response, - metadata, // Original value used here + content: ai_response.clone(), + metadata: request.repos.clone().map(|repos| json!({ "repos": repos })), tool_calls: None, }) .await @@ -254,11 +214,9 @@ pub async fn send_message( ) })?; - info!("Created AI message with id: {}", ai_message.id); - Ok(Json(SendMessageResponse { id: ai_message.id.to_string(), - message: ai_message.content, + message: ai_response, })) } @@ -267,7 +225,8 @@ pub async fn get_conversation_messages( State(state): State, Path(conversation_id): Path, ) -> Result>, (StatusCode, String)> { - info!("Fetching messages for conversation: {}", conversation_id); + // Create chat database service + let chat_db = ChatDatabaseService::new(state.pool); // Get user info from session let user_id = if let Some(session_cookie) = cookies.get(SESSION_COOKIE_NAME) { @@ -278,24 +237,28 @@ pub async fn get_conversation_messages( "No session found. Please log in.".to_string(), )); }; - info!("Using user_id: {}", user_id); - - // Create chat database service - let chat_db = ChatDatabaseService::new(state.pool); // Get messages let messages = chat_db .get_conversation_messages(conversation_id) .await .map_err(|e| { - error!("Failed to fetch conversation messages: {:?}", e); + error!("Failed to get messages: {:?}", e); ( StatusCode::INTERNAL_SERVER_ERROR, - format!("Failed to fetch conversation messages: {}", e), + format!("Failed to get messages: {}", e), ) })?; - info!("Found {} messages", messages.len()); + // Verify user has access to this conversation + if let Some(first_message) = messages.first() { + if first_message.user_id != user_id { + return Err(( + StatusCode::FORBIDDEN, + "You do not have access to this conversation".to_string(), + )); + } + } Ok(Json(messages)) } From 070dc0c904f304c9de1bf773f16c4ca71ff51459 Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 20:15:24 -0600 Subject: [PATCH 14/19] Update repomap --- docs/repomap.md | 148 ++++++++++++++++++++++++------------------------ 1 file changed, 75 insertions(+), 73 deletions(-) diff --git a/docs/repomap.md b/docs/repomap.md index 6029b8a1b..29c82054c 100644 --- a/docs/repomap.md +++ b/docs/repomap.md @@ -86,11 +86,11 @@ backend/src/repo/types.rs: backend/src/repomap.rs: │#id: test │fn generate_repo_map -│fn +│fn │fn extract_id │fn extract_function_name -│fn -│fn +│fn +│fn │fn extract_class_name │fn extract_const_name │fn init_logging @@ -102,15 +102,15 @@ backend/src/repomap.rs: │fn test_extractors │fn test_func │class in -│class -│class -│class -│class +│class +│class +│class +│class │class TestClass │const DEFAULT_BLACKLIST -│const -│const -│const +│const +│const +│const │const TEST_CONST backend/src/routes.rs: @@ -298,6 +298,7 @@ backend/src/server/services/groq/config.rs: backend/src/server/services/groq/service.rs: │fn new │fn with_base_url +│fn chat_with_history │fn metadata │fn chat │fn chat_stream @@ -483,7 +484,7 @@ backend/src/server/ws/types.rs: │fn fmt backend/tailwind.config.cjs: -│const +│const backend/templates/admin/dashboard.html: │#id: bg @@ -628,7 +629,7 @@ backend/templates/layouts/content.html: │#id: content backend/templates/macros/ui.html: -│class +│class backend/templates/pages/company.html: │class of @@ -839,10 +840,10 @@ frontend/app/+types/video-series.ts: │const VIDEOS frontend/app/components/chat/chat-input.tsx: -│const -│const -│const -│const +│const +│const +│const +│const │const textareaRef │const handleSubmitMessage │const repos @@ -856,9 +857,9 @@ frontend/app/components/chat/chat-input.tsx: frontend/app/components/chat/repo-selector.tsx: │const RepoForm -│const -│const -│const +│const +│const +│const │const handleRepoInputChange │const handleRepoSubmit │const handleRemoveRepo @@ -868,7 +869,7 @@ frontend/app/components/chat/repo-selector.tsx: frontend/app/components/chat/thinking.tsx: │const scrollRef │const contentRef -│const +│const │const shouldScroll │const getIcon │const getLabel @@ -877,7 +878,7 @@ frontend/app/components/chat/thinking.tsx: frontend/app/components/header-bar.tsx: │#id: login-button │#id: signup-button -│const +│const │const navigateTo frontend/app/components/library/chat.tsx: @@ -892,17 +893,17 @@ frontend/app/components/library/shad.tsx: │#id: name │#id: bio │#id: message -│const +│const frontend/app/components/login-form.tsx: │#id: email │#id: password -│const -│const -│const -│const -│const -│const +│const +│const +│const +│const +│const +│const │const checkEmail │const url │const response @@ -930,17 +931,17 @@ frontend/app/components/ui/button.tsx: frontend/app/components/ui/carousel.tsx: │const CarouselContext │const context -│const -│const -│const +│const +│const +│const │const onSelect │const scrollPrev │const scrollNext │const handleKeyDown -│const -│const -│const -│const +│const +│const +│const +│const frontend/app/components/ui/chart.tsx: │const THEMES @@ -954,9 +955,9 @@ frontend/app/components/ui/chart.tsx: │const color │const ChartTooltip │const ChartTooltipContent -│const +│const │const tooltipLabel -│const +│const │const key │const itemConfig │const value @@ -966,7 +967,7 @@ frontend/app/components/ui/chart.tsx: │const indicatorColor │const ChartLegend │const ChartLegendContent -│const +│const │const key │const itemConfig │const payloadPayload @@ -978,21 +979,21 @@ frontend/app/components/ui/form.tsx: │const useFormField │const fieldContext │const itemContext -│const +│const │const formState │const fieldState -│const +│const │const FormItemContext │const id -│const -│const -│const -│const +│const +│const +│const +│const │const body frontend/app/components/ui/input-otp.tsx: │const inputOTPContext -│const +│const frontend/app/components/ui/navigation-menu.tsx: │const navigationMenuTriggerStyle @@ -1008,8 +1009,8 @@ frontend/app/components/ui/sidebar.tsx: │const context │const SidebarProvider │const isMobile -│const -│const +│const +│const │const open │const setOpen │const openState @@ -1017,25 +1018,25 @@ frontend/app/components/ui/sidebar.tsx: │const handleKeyDown │const state │const contextValue -│const -│const -│const +│const +│const +│const │const Comp │const Comp │const sidebarMenuButtonVariants │const Comp -│const +│const │const button │const Comp │const width │const Comp frontend/app/components/ui/slider.tsx: -│const \_values +│const _values frontend/app/components/ui/sonner.tsx: │const Toaster -│const +│const frontend/app/components/ui/toggle-group.tsx: │const ToggleGroupContext @@ -1046,13 +1047,13 @@ frontend/app/components/ui/toggle.tsx: frontend/app/hooks/use-mobile.ts: │const MOBILE_BREAKPOINT -│const +│const │const mql │const onChange frontend/app/lib/agentsync/hooks/useAgentSync.ts: │const INITIAL_STATE -│const +│const │const handleOnline │const handleOffline │const sendMessage @@ -1067,18 +1068,18 @@ frontend/app/lib/agentsync/hooks/useAgentSync.ts: frontend/app/root.tsx: │const links -frontend/app/routes/\_layout.tsx: +frontend/app/routes/_layout.tsx: │const navItems │const location frontend/app/routes/chat/$id.tsx: │const EMPTY_MESSAGES -│const -│const +│const +│const │const messageContainerRef │const messagesSelector │const messages -│const +│const │const loadMessages │const response │const data @@ -1086,8 +1087,8 @@ frontend/app/routes/chat/$id.tsx: frontend/app/routes/chat/index.tsx: │const navigate -│const -│const +│const +│const │const handleSubmit │const response @@ -1096,11 +1097,11 @@ frontend/app/routes/company.tsx: frontend/app/routes/components/thinking.tsx: │const DEMO_TEXT -│const -│const -│const -│const -│const +│const +│const +│const +│const +│const │const allLines │const timer │const elapsed @@ -1114,8 +1115,8 @@ frontend/app/routes/login.tsx: frontend/app/routes/repomap.tsx: │#id: repo_url -│const -│const +│const +│const │const handleSubmit │const formData │const repoUrl @@ -1124,11 +1125,11 @@ frontend/app/routes/repomap.tsx: frontend/app/routes/thinking.tsx: │const DEMO_TEXT -│const -│const -│const -│const -│const +│const +│const +│const +│const +│const │const allLines │const timer │const elapsed @@ -1145,3 +1146,4 @@ frontend/app/welcome/logo-light.svg: frontend/app/welcome/welcome.tsx: │const resources + From 49b5244fb8da3a29a864f93c4bf392ea525bc5ff Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 20:18:25 -0600 Subject: [PATCH 15/19] llama 31 --- backend/src/server/services/groq/service.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/src/server/services/groq/service.rs b/backend/src/server/services/groq/service.rs index 1bdbd396e..1f93cb252 100644 --- a/backend/src/server/services/groq/service.rs +++ b/backend/src/server/services/groq/service.rs @@ -94,11 +94,10 @@ impl Gateway for GroqService { name: "Groq".to_string(), openai_compatible: true, supported_features: vec!["chat".to_string(), "streaming".to_string()], - default_model: "mixtral-8x7b-32768".to_string(), + default_model: "llama-3.1-8b-instant".to_string(), available_models: vec![ "llama-3.1-8b-instant".to_string(), "llama-3.3-70b-versatile".to_string(), - "mixtral-8x7b-32768".to_string(), ], } } @@ -121,4 +120,4 @@ impl Gateway for GroqService { // TODO: Implement streaming using SSE todo!("Implement streaming") } -} \ No newline at end of file +} From a25c65e7eb2b3b4c25ad928ff3f4232b0614e159 Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 20:21:56 -0600 Subject: [PATCH 16/19] Update chat.rs --- backend/src/server/handlers/chat.rs | 39 ++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/backend/src/server/handlers/chat.rs b/backend/src/server/handlers/chat.rs index fbae66c69..085b77394 100644 --- a/backend/src/server/handlers/chat.rs +++ b/backend/src/server/handlers/chat.rs @@ -104,13 +104,13 @@ pub async fn start_repo_chat( info!("Created message with id: {}", message.id); // Convert message to Groq format - let _messages = vec![json!({ + let messages = vec![json!({ "role": "user", "content": request.message })]; // Get Groq response - let (ai_response, _) = state.groq.chat(request.message, false).await.map_err(|e| { + let (ai_response, _) = state.groq.chat_with_history(messages, false).await.map_err(|e| { error!("Failed to get Groq response: {:?}", e); ( StatusCode::INTERNAL_SERVER_ERROR, @@ -167,8 +167,20 @@ pub async fn send_message( )); }; + // Get conversation history + let messages = chat_db + .get_conversation_messages(request.conversation_id) + .await + .map_err(|e| { + error!("Failed to get conversation history: {:?}", e); + ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("Failed to get conversation history: {}", e), + ) + })?; + // Create user message - let _message = chat_db + let message = chat_db .create_message(&CreateMessageRequest { conversation_id: request.conversation_id, user_id: user_id.clone(), @@ -186,8 +198,23 @@ pub async fn send_message( ) })?; - // Get AI response - let (ai_response, _) = state.groq.chat(request.message, false).await.map_err(|e| { + // Convert messages to Groq format + let mut chat_messages: Vec = messages + .iter() + .map(|msg| json!({ + "role": msg.role, + "content": msg.content + })) + .collect(); + + // Add current message + chat_messages.push(json!({ + "role": "user", + "content": request.message + })); + + // Get AI response with full history + let (ai_response, _) = state.groq.chat_with_history(chat_messages, false).await.map_err(|e| { error!("Failed to get Groq response: {:?}", e); ( StatusCode::INTERNAL_SERVER_ERROR, @@ -261,4 +288,4 @@ pub async fn get_conversation_messages( } Ok(Json(messages)) -} +} \ No newline at end of file From 0e8eeb038f34a6e9f63e2ea4757b51a943fece24 Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 20:25:35 -0600 Subject: [PATCH 17/19] Update service.rs --- backend/src/server/services/groq/service.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/server/services/groq/service.rs b/backend/src/server/services/groq/service.rs index 1f93cb252..1e8028206 100644 --- a/backend/src/server/services/groq/service.rs +++ b/backend/src/server/services/groq/service.rs @@ -46,7 +46,7 @@ impl GroqService { } } - async fn chat_with_history( + pub async fn chat_with_history( &self, messages: Vec, use_reasoner: bool, @@ -120,4 +120,4 @@ impl Gateway for GroqService { // TODO: Implement streaming using SSE todo!("Implement streaming") } -} +} \ No newline at end of file From f7caf0254d809dffb199cd3aa9bd16c02011d3c0 Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 20:30:30 -0600 Subject: [PATCH 18/19] Update useAgentSync.ts --- .../app/lib/agentsync/hooks/useAgentSync.ts | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/frontend/app/lib/agentsync/hooks/useAgentSync.ts b/frontend/app/lib/agentsync/hooks/useAgentSync.ts index 93dec04e1..9e6495db1 100644 --- a/frontend/app/lib/agentsync/hooks/useAgentSync.ts +++ b/frontend/app/lib/agentsync/hooks/useAgentSync.ts @@ -69,10 +69,19 @@ export function useAgentSync({ scope, conversationId }: AgentSyncOptions) { const data = await response.json(); console.log("Follow-up message response:", data); - // Store the message + // Store the user message + const userMessageId = uuid(); addMessage(conversationId, { - id: data.id, + id: userMessageId, role: "user", + content: message, // Use the original message + metadata: repos ? { repos } : undefined, + }); + + // Store the AI response + addMessage(conversationId, { + id: data.id, + role: "assistant", content: data.message, metadata: repos ? { repos } : undefined, }); @@ -121,9 +130,18 @@ export function useAgentSync({ scope, conversationId }: AgentSyncOptions) { console.log("New chat response:", data); // Store first message + const userMessageId = uuid(); addMessage(data.id, { - id: chatId, + id: userMessageId, role: "user", + content: message, // Use the original message + metadata: repos ? { repos } : undefined, + }); + + // Store AI response + addMessage(data.id, { + id: chatId, + role: "assistant", content: data.initial_message, metadata: repos ? { repos } : undefined, }); @@ -139,4 +157,4 @@ export function useAgentSync({ scope, conversationId }: AgentSyncOptions) { state: INITIAL_STATE, sendMessage, }; -} +} \ No newline at end of file From 92a353debd7992a7e96241804043283848db3c7d Mon Sep 17 00:00:00 2001 From: Christopher David Date: Thu, 20 Feb 2025 20:37:48 -0600 Subject: [PATCH 19/19] format --- backend/src/server/handlers/chat.rs | 60 ++++--- backend/src/server/services/groq/service.rs | 2 +- docs/repomap.md | 147 +++++++++--------- frontend/app/components/header-bar.tsx | 15 +- .../app/lib/agentsync/hooks/useAgentSync.ts | 2 +- frontend/app/routes/chat/$id.tsx | 10 +- 6 files changed, 124 insertions(+), 112 deletions(-) diff --git a/backend/src/server/handlers/chat.rs b/backend/src/server/handlers/chat.rs index 085b77394..eafd1cd06 100644 --- a/backend/src/server/handlers/chat.rs +++ b/backend/src/server/handlers/chat.rs @@ -12,7 +12,7 @@ use crate::server::{ config::AppState, handlers::oauth::session::SESSION_COOKIE_NAME, models::chat::{CreateConversationRequest, CreateMessageRequest, Message}, - services::{chat_database::ChatDatabaseService, gateway::Gateway}, + services::chat_database::ChatDatabaseService, }; #[derive(Debug, Deserialize)] @@ -81,7 +81,7 @@ pub async fn start_repo_chat( info!("Created conversation with id: {}", conversation.id); // Create initial message with repos metadata - let message = chat_db + let _message = chat_db .create_message(&CreateMessageRequest { conversation_id: conversation.id, user_id: user_id.clone(), @@ -101,7 +101,7 @@ pub async fn start_repo_chat( ) })?; - info!("Created message with id: {}", message.id); + info!("Created message with id: {}", _message.id); // Convert message to Groq format let messages = vec![json!({ @@ -110,13 +110,17 @@ pub async fn start_repo_chat( })]; // Get Groq response - let (ai_response, _) = state.groq.chat_with_history(messages, false).await.map_err(|e| { - error!("Failed to get Groq response: {:?}", e); - ( - StatusCode::INTERNAL_SERVER_ERROR, - format!("Failed to get AI response: {}", e), - ) - })?; + let (ai_response, _) = state + .groq + .chat_with_history(messages, false) + .await + .map_err(|e| { + error!("Failed to get Groq response: {:?}", e); + ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("Failed to get AI response: {}", e), + ) + })?; // Save AI response let ai_message = chat_db @@ -143,7 +147,7 @@ pub async fn start_repo_chat( Ok(Json(StartChatResponse { id: conversation.id.to_string(), - initial_message: message.content, + initial_message: _message.content, })) } @@ -180,7 +184,7 @@ pub async fn send_message( })?; // Create user message - let message = chat_db + let _message = chat_db .create_message(&CreateMessageRequest { conversation_id: request.conversation_id, user_id: user_id.clone(), @@ -201,10 +205,12 @@ pub async fn send_message( // Convert messages to Groq format let mut chat_messages: Vec = messages .iter() - .map(|msg| json!({ - "role": msg.role, - "content": msg.content - })) + .map(|msg| { + json!({ + "role": msg.role, + "content": msg.content + }) + }) .collect(); // Add current message @@ -214,19 +220,23 @@ pub async fn send_message( })); // Get AI response with full history - let (ai_response, _) = state.groq.chat_with_history(chat_messages, false).await.map_err(|e| { - error!("Failed to get Groq response: {:?}", e); - ( - StatusCode::INTERNAL_SERVER_ERROR, - format!("Failed to get AI response: {}", e), - ) - })?; + let (ai_response, _) = state + .groq + .chat_with_history(chat_messages, false) + .await + .map_err(|e| { + error!("Failed to get Groq response: {:?}", e); + ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("Failed to get AI response: {}", e), + ) + })?; // Save AI response let ai_message = chat_db .create_message(&CreateMessageRequest { conversation_id: request.conversation_id, - user_id: user_id, + user_id, role: "assistant".to_string(), content: ai_response.clone(), metadata: request.repos.clone().map(|repos| json!({ "repos": repos })), @@ -288,4 +298,4 @@ pub async fn get_conversation_messages( } Ok(Json(messages)) -} \ No newline at end of file +} diff --git a/backend/src/server/services/groq/service.rs b/backend/src/server/services/groq/service.rs index 1e8028206..010d6d398 100644 --- a/backend/src/server/services/groq/service.rs +++ b/backend/src/server/services/groq/service.rs @@ -120,4 +120,4 @@ impl Gateway for GroqService { // TODO: Implement streaming using SSE todo!("Implement streaming") } -} \ No newline at end of file +} diff --git a/docs/repomap.md b/docs/repomap.md index 29c82054c..7d4426540 100644 --- a/docs/repomap.md +++ b/docs/repomap.md @@ -86,11 +86,11 @@ backend/src/repo/types.rs: backend/src/repomap.rs: │#id: test │fn generate_repo_map -│fn +│fn │fn extract_id │fn extract_function_name -│fn -│fn +│fn +│fn │fn extract_class_name │fn extract_const_name │fn init_logging @@ -102,15 +102,15 @@ backend/src/repomap.rs: │fn test_extractors │fn test_func │class in -│class -│class -│class -│class +│class +│class +│class +│class │class TestClass │const DEFAULT_BLACKLIST -│const -│const -│const +│const +│const +│const │const TEST_CONST backend/src/routes.rs: @@ -484,7 +484,7 @@ backend/src/server/ws/types.rs: │fn fmt backend/tailwind.config.cjs: -│const +│const backend/templates/admin/dashboard.html: │#id: bg @@ -629,7 +629,7 @@ backend/templates/layouts/content.html: │#id: content backend/templates/macros/ui.html: -│class +│class backend/templates/pages/company.html: │class of @@ -840,10 +840,10 @@ frontend/app/+types/video-series.ts: │const VIDEOS frontend/app/components/chat/chat-input.tsx: -│const -│const -│const -│const +│const +│const +│const +│const │const textareaRef │const handleSubmitMessage │const repos @@ -857,9 +857,9 @@ frontend/app/components/chat/chat-input.tsx: frontend/app/components/chat/repo-selector.tsx: │const RepoForm -│const -│const -│const +│const +│const +│const │const handleRepoInputChange │const handleRepoSubmit │const handleRemoveRepo @@ -869,7 +869,7 @@ frontend/app/components/chat/repo-selector.tsx: frontend/app/components/chat/thinking.tsx: │const scrollRef │const contentRef -│const +│const │const shouldScroll │const getIcon │const getLabel @@ -878,7 +878,7 @@ frontend/app/components/chat/thinking.tsx: frontend/app/components/header-bar.tsx: │#id: login-button │#id: signup-button -│const +│const │const navigateTo frontend/app/components/library/chat.tsx: @@ -893,17 +893,17 @@ frontend/app/components/library/shad.tsx: │#id: name │#id: bio │#id: message -│const +│const frontend/app/components/login-form.tsx: │#id: email │#id: password -│const -│const -│const -│const -│const -│const +│const +│const +│const +│const +│const +│const │const checkEmail │const url │const response @@ -931,17 +931,17 @@ frontend/app/components/ui/button.tsx: frontend/app/components/ui/carousel.tsx: │const CarouselContext │const context -│const -│const -│const +│const +│const +│const │const onSelect │const scrollPrev │const scrollNext │const handleKeyDown -│const -│const -│const -│const +│const +│const +│const +│const frontend/app/components/ui/chart.tsx: │const THEMES @@ -955,9 +955,9 @@ frontend/app/components/ui/chart.tsx: │const color │const ChartTooltip │const ChartTooltipContent -│const +│const │const tooltipLabel -│const +│const │const key │const itemConfig │const value @@ -967,7 +967,7 @@ frontend/app/components/ui/chart.tsx: │const indicatorColor │const ChartLegend │const ChartLegendContent -│const +│const │const key │const itemConfig │const payloadPayload @@ -979,21 +979,21 @@ frontend/app/components/ui/form.tsx: │const useFormField │const fieldContext │const itemContext -│const +│const │const formState │const fieldState -│const +│const │const FormItemContext │const id -│const -│const -│const -│const +│const +│const +│const +│const │const body frontend/app/components/ui/input-otp.tsx: │const inputOTPContext -│const +│const frontend/app/components/ui/navigation-menu.tsx: │const navigationMenuTriggerStyle @@ -1009,8 +1009,8 @@ frontend/app/components/ui/sidebar.tsx: │const context │const SidebarProvider │const isMobile -│const -│const +│const +│const │const open │const setOpen │const openState @@ -1018,25 +1018,25 @@ frontend/app/components/ui/sidebar.tsx: │const handleKeyDown │const state │const contextValue -│const -│const -│const +│const +│const +│const │const Comp │const Comp │const sidebarMenuButtonVariants │const Comp -│const +│const │const button │const Comp │const width │const Comp frontend/app/components/ui/slider.tsx: -│const _values +│const \_values frontend/app/components/ui/sonner.tsx: │const Toaster -│const +│const frontend/app/components/ui/toggle-group.tsx: │const ToggleGroupContext @@ -1047,13 +1047,13 @@ frontend/app/components/ui/toggle.tsx: frontend/app/hooks/use-mobile.ts: │const MOBILE_BREAKPOINT -│const +│const │const mql │const onChange frontend/app/lib/agentsync/hooks/useAgentSync.ts: │const INITIAL_STATE -│const +│const │const handleOnline │const handleOffline │const sendMessage @@ -1068,18 +1068,18 @@ frontend/app/lib/agentsync/hooks/useAgentSync.ts: frontend/app/root.tsx: │const links -frontend/app/routes/_layout.tsx: +frontend/app/routes/\_layout.tsx: │const navItems │const location frontend/app/routes/chat/$id.tsx: │const EMPTY_MESSAGES -│const -│const +│const +│const │const messageContainerRef │const messagesSelector │const messages -│const +│const │const loadMessages │const response │const data @@ -1087,8 +1087,8 @@ frontend/app/routes/chat/$id.tsx: frontend/app/routes/chat/index.tsx: │const navigate -│const -│const +│const +│const │const handleSubmit │const response @@ -1097,11 +1097,11 @@ frontend/app/routes/company.tsx: frontend/app/routes/components/thinking.tsx: │const DEMO_TEXT -│const -│const -│const -│const -│const +│const +│const +│const +│const +│const │const allLines │const timer │const elapsed @@ -1115,8 +1115,8 @@ frontend/app/routes/login.tsx: frontend/app/routes/repomap.tsx: │#id: repo_url -│const -│const +│const +│const │const handleSubmit │const formData │const repoUrl @@ -1125,11 +1125,11 @@ frontend/app/routes/repomap.tsx: frontend/app/routes/thinking.tsx: │const DEMO_TEXT -│const -│const -│const -│const -│const +│const +│const +│const +│const +│const │const allLines │const timer │const elapsed @@ -1146,4 +1146,3 @@ frontend/app/welcome/logo-light.svg: frontend/app/welcome/welcome.tsx: │const resources - diff --git a/frontend/app/components/header-bar.tsx b/frontend/app/components/header-bar.tsx index 71424ca50..a98be8000 100644 --- a/frontend/app/components/header-bar.tsx +++ b/frontend/app/components/header-bar.tsx @@ -1,10 +1,13 @@ -import { useEffect, useState } from "react" -import { Link } from "react-router" -import { Button } from "./ui/button" +import { useEffect, useState } from "react"; +import { Link } from "react-router"; +import { Button } from "./ui/button"; import { - DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, - DropdownMenuTrigger -} from "./ui/dropdown-menu" + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuSeparator, + DropdownMenuTrigger, +} from "./ui/dropdown-menu"; interface UserMetadata { name: string; diff --git a/frontend/app/lib/agentsync/hooks/useAgentSync.ts b/frontend/app/lib/agentsync/hooks/useAgentSync.ts index 9e6495db1..1e4239d89 100644 --- a/frontend/app/lib/agentsync/hooks/useAgentSync.ts +++ b/frontend/app/lib/agentsync/hooks/useAgentSync.ts @@ -157,4 +157,4 @@ export function useAgentSync({ scope, conversationId }: AgentSyncOptions) { state: INITIAL_STATE, sendMessage, }; -} \ No newline at end of file +} diff --git a/frontend/app/routes/chat/$id.tsx b/frontend/app/routes/chat/$id.tsx index 621452a67..87ed1dc15 100644 --- a/frontend/app/routes/chat/$id.tsx +++ b/frontend/app/routes/chat/$id.tsx @@ -1,8 +1,8 @@ -import { useAgentSync } from "agentsync" -import { useCallback, useEffect, useRef } from "react" -import { useParams } from "react-router" -import { ChatInput } from "~/components/chat/chat-input" -import { useMessagesStore } from "~/stores/messages" +import { useAgentSync } from "agentsync"; +import { useCallback, useEffect, useRef } from "react"; +import { useParams } from "react-router"; +import { ChatInput } from "~/components/chat/chat-input"; +import { useMessagesStore } from "~/stores/messages"; import type { Message } from "~/stores/messages";