diff --git "a/frontend/script.js" "b/frontend/script.js" --- "a/frontend/script.js" +++ "b/frontend/script.js" @@ -1,1646 +1,1790 @@ -/* ================================================================ - J.A.R.V.I.S Frontend — Main Application Logic - ================================================================ - - ARCHITECTURE OVERVIEW - --------------------- - This file powers the entire frontend of the J.A.R.V.I.S AI assistant. - It handles: - - 1. CHAT MESSAGING — The user types (or speaks) a message, which is - sent to the backend via a POST request. The backend responds using - Server-Sent Events (SSE), allowing the reply to stream in - token-by-token (like ChatGPT's typing effect). - - 2. TEXT-TO-SPEECH (TTS) — When TTS is enabled, the backend also - sends base64-encoded audio chunks inside the SSE stream. These - are queued up and played sequentially through a single