FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.
C++ ai-agentsalgorithmic-tradingbloomberg-terminalcppfinancefinancial-marketsfintechgood-first-issueinvestmentinvestment-researchmachine-learningopensourcepythonqtquantitative-financestock-markettrading
marketplace removed
tilakpatel2289981c878b92
diff --git a/fincept-terminal-desktop/install.cmd b/fincept-terminal-desktop/install.cmdnew file mode 100644index 000000000..7e52707f6--- /dev/null+++ b/fincept-terminal-desktop/install.cmd@@ -0,0 +1,221 @@+@echo off+setlocal enabledelayedexpansion++REM Claude Code Windows CMD Bootstrap Script+REM Installs Claude Code for environments where PowerShell is not available++REM Parse command line argument+set "TARGET=%~1"+if "!TARGET!"=="" set "TARGET=latest"++REM Validate target parameter+if /i "!TARGET!"=="stable" goto :target_valid+if /i "!TARGET!"=="latest" goto :target_valid+echo !TARGET! | findstr /r "^[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*" >nul+if !ERRORLEVEL! equ 0 goto :target_valid++echo Usage: %0 [stable^|latest^|VERSION] >&2+echo Example: %0 1.0.58 >&2+exit /b 1++:target_valid++REM Check for 64-bit Windows+if /i "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto :arch_valid+if /i "%PROCESSOR_ARCHITECTURE%"=="ARM64" goto :arch_valid+if /i "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto :arch_valid+if /i "%PROCESSOR_ARCHITEW6432%"=="ARM64" goto :arch_valid++echo Claude Code does not support 32-bit Windows. Please use a 64-bit version of Windows. >&2+exit /b 1++:arch_valid++REM Set constants+set "GCS_BUCKET=https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases"+set "DOWNLOAD_DIR=%USERPROFILE%\.claude\downloads"+REM Use native ARM64 binary on ARM64 Windows, x64 otherwise+if /i "%PROCESSOR_ARCHITECTURE%"=="ARM64" (+ set "PLATFORM=win32-arm64"+) else (+ set "PLATFORM=win32-x64"+)++REM Create download directory+if not exist "!DOWNLOAD_DIR!" mkdir "!DOWNLOAD_DIR!"++REM Check for curl availability+curl --version >nul 2>&1+if !ERRORLEVEL! neq 0 (+ echo curl is required but not available. Please install curl or use PowerShell installer. >&2+ exit /b 1+)++REM Always download latest version (which has the most up-to-date installer)+call :download_file "!GCS_BUCKET!/latest" "!DOWNLOAD_DIR!\latest"+if !ERRORLEVEL! neq 0 (+ echo Failed to get latest version >&2+ exit /b 1+)++REM Read version from file+set /p VERSION=<"!DOWNLOAD_DIR!\latest"+del "!DOWNLOAD_DIR!\latest"++REM Download manifest+call :download_file "!GCS_BUCKET!/!VERSION!/manifest.json" "!DOWNLOAD_DIR!\manifest.json"+if !ERRORLEVEL! neq 0 (+ echo Failed to get manifest >&2+ exit /b 1+)++REM Extract checksum from manifest+call :parse_manifest "!DOWNLOAD_DIR!\manifest.json" "!PLATFORM!"+if !ERRORLEVEL! neq 0 (+ echo Platform !PLATFORM! not found in manifest >&2+ del "!DOWNLOAD_DIR!\manifest.json" 2>nul+ exit /b 1+)+del "!DOWNLOAD_DIR!\manifest.json"++REM Download binary+set "BINARY_PATH=!DOWNLOAD_DIR!\claude-!VERSION!-!PLATFORM!.exe"+call :download_file "!GCS_BUCKET!/!VERSION!/!PLATFORM!/claude.exe" "!BINARY_PATH!"+if !ERRORLEVEL! neq 0 (+ echo Failed to download binary >&2+ if exist "!BINARY_PATH!" del "!BINARY_PATH!"+ exit /b 1+)++REM Verify checksum+call :verify_checksum "!BINARY_PATH!" "!EXPECTED_CHECKSUM!"+if !ERRORLEVEL! neq 0 (+ echo Checksum verification failed >&2+ del "!BINARY_PATH!"+ exit /b 1+)++REM Run claude install to set up launcher and shell integration+echo Setting up Claude Code...+"!BINARY_PATH!" install "!TARGET!"+set "INSTALL_RESULT=!ERRORLEVEL!"++REM Clean up downloaded file+REM Wait a moment for any file handles to be released+timeout /t 1 /nobreak >nul 2>&1+del /f "!BINARY_PATH!" >nul 2>&1+if exist "!BINARY_PATH!" (+ echo Warning: Could not remove temporary file: !BINARY_PATH!+)++if !INSTALL_RESULT! neq 0 (+ echo Installation failed >&2+ exit /b 1+)++echo.+echo Installation complete^^!+echo.+exit /b 0++REM ============================================================================+REM SUBROUTINES+REM ============================================================================++:download_file+REM Downloads a file using curl+REM Args: %1=URL, %2=OutputPath+set "URL=%~1"+set "OUTPUT=%~2"++curl -fsSL "!URL!" -o "!OUTPUT!"+exit /b !ERRORLEVEL!++:parse_manifest+REM Parse JSON manifest to extract checksum for platform+REM Args: %1=ManifestPath, %2=Platform+set "MANIFEST_PATH=%~1"+set "PLATFORM_NAME=%~2"+set "EXPECTED_CHECKSUM="++REM Use findstr to find platform section, then look for checksum+set "FOUND_PLATFORM="+set "IN_PLATFORM_SECTION="++REM Read the manifest line by line+for /f "usebackq tokens=*" %%i in ("!MANIFEST_PATH!") do (+ set "LINE=%%i"++ REM Check if this line contains our platform+ echo !LINE! | findstr /c:"\"%PLATFORM_NAME%\":" >nul+ if !ERRORLEVEL! equ 0 (+ set "IN_PLATFORM_SECTION=1"+ )++ REM If we're in the platform section, look for checksum+ if defined IN_PLATFORM_SECTION (+ echo !LINE! | findstr /c:"\"checksum\":" >nul+ if !ERRORLEVEL! equ 0 (+ REM Extract checksum value+ for /f "tokens=2 delims=:" %%j in ("!LINE!") do (+ set "CHECKSUM_PART=%%j"+ REM Remove quotes, whitespace, and comma+ set "CHECKSUM_PART=!CHECKSUM_PART: =!"+ set "CHECKSUM_PART=!CHECKSUM_PART:"=!"+ set "CHECKSUM_PART=!CHECKSUM_PART:,=!"++ REM Check if it looks like a SHA256 (64 hex chars)+ if not "!CHECKSUM_PART!"=="" (+ call :check_length "!CHECKSUM_PART!" 64+ if !ERRORLEVEL! equ 0 (+ set "EXPECTED_CHECKSUM=!CHECKSUM_PART!"+ exit /b 0+ )+ )+ )+ )++ REM Check if we've left the platform section (closing brace)+ echo !LINE! | findstr /c:"}" >nul+ if !ERRORLEVEL! equ 0 set "IN_PLATFORM_SECTION="+ )+)++if "!EXPECTED_CHECKSUM!"=="" exit /b 1+exit /b 0++:check_length+REM Check if string length equals expected length+REM Args: %1=String, %2=ExpectedLength+set "STR=%~1"+set "EXPECTED_LEN=%~2"+set "LEN=0"+:count_loop+if "!STR:~%LEN%,1!"=="" goto :count_done+set /a LEN+=1+goto :count_loop+:count_done+if %LEN%==%EXPECTED_LEN% exit /b 0+exit /b 1++:verify_checksum+REM Verify file checksum using certutil+REM Args: %1=FilePath, %2=ExpectedChecksum+set "FILE_PATH=%~1"+set "EXPECTED=%~2"++for /f "skip=1 tokens=*" %%i in ('certutil -hashfile "!FILE_PATH!" SHA256') do (+ set "ACTUAL=%%i"+ set "ACTUAL=!ACTUAL: =!"+ if "!ACTUAL!"=="CertUtil:Thecommandcompletedsuccessfully." goto :verify_done+ if "!ACTUAL!" neq "" (+ if /i "!ACTUAL!"=="!EXPECTED!" (+ exit /b 0+ ) else (+ exit /b 1+ )+ )+)++:verify_done+exit /b 1diff --git a/fincept-terminal-desktop/src-tauri/src/commands/brokers/kotak/mod.rs b/fincept-terminal-desktop/src-tauri/src/commands/brokers/kotak/mod.rsindex 16cfa01fc..d7cfb3918 100644--- a/fincept-terminal-desktop/src-tauri/src/commands/brokers/kotak/mod.rs+++ b/fincept-terminal-desktop/src-tauri/src/commands/brokers/kotak/mod.rs@@ -18,7 +18,7 @@ pub use market_data::*;use reqwest::Client;use serde::{Deserialize, Serialize};-use serde_json::{json, Value};+use serde_json::Value;use crate::database::pool::get_db;use rusqlite::params;diff --git a/fincept-terminal-desktop/src-tauri/src/commands/brokers/motilal/auth.rs b/fincept-terminal-desktop/src-tauri/src/commands/brokers/motilal/auth.rsindex 99026439d..00a3743f3 100644--- a/fincept-terminal-desktop/src-tauri/src/commands/brokers/motilal/auth.rs+++ b/fincept-terminal-desktop/src-tauri/src/commands/brokers/motilal/auth.rs@@ -1,7 +1,7 @@// Motilal Oswal Authentication Commandsuse reqwest::Client;-use serde_json::{json, Value};+use serde_json::json;use sha2::{Sha256, Digest};use tauri::command;use super::{ApiResponse, get_timestamp, get_motilal_headers, motilal_request};diff --git a/fincept-terminal-desktop/src-tauri/src/commands/database/admin.rs b/fincept-terminal-desktop/src-tauri/src/commands/database/admin.rsindex 65869f5f3..8d6b69c78 100644--- a/fincept-terminal-desktop/src-tauri/src/commands/database/admin.rs+++ b/fincept-terminal-desktop/src-tauri/src/commands/database/admin.rs@@ -153,16 +153,22 @@ fn hmac_sha256_hash(password: &str, salt: &[u8]) -> String {hex::encode(mac.finalize().into_bytes())}-/// Constant-time comparison of two byte slices to prevent timing attacks+/// Constant-time comparison of two byte slices to prevent timing attacks.+/// Does not short-circuit on length mismatch to avoid leaking length information.fn constant_time_eq(a: &[u8], b: &[u8]) -> bool {- if a.len() != b.len() {- return false;- }+ let len_matches = a.len() == b.len();+ // Always iterate over both slices fully to avoid timing leaks.+ // If lengths differ, XOR against 0xFF to guarantee mismatch without early return.let mut result = 0u8;- for (x, y) in a.iter().zip(b.iter()) {- result |= x ^ y;+ for i in 0..a.len() {+ let b_byte = if i < b.len() { b[i] } else { !a[i] };+ result |= a[i] ^ b_byte;+ }+ // Also iterate any remaining bytes in b (if b is longer)+ for i in a.len()..b.len() {+ result |= b[i] ^ 0xFF;}- result == 0+ len_matches && result == 0}// Get all databases@@ -375,10 +381,15 @@ pub async fn db_admin_execute_query(return Err("Multiple SQL statements are not allowed".to_string());}// Check for dangerous keywords in the rest of the query (skip the leading SELECT)+ // Split on non-alphanumeric/underscore boundaries to catch keywords inside parentheses,+ // e.g. "SELECT * FROM (DELETE FROM ...)" where "(DELETE" wouldn't match with whitespace splitlet rest_upper = query_upper.get(6..).unwrap_or("");+ let tokens: Vec<&str> = rest_upper+ .split(|c: char| !c.is_alphanumeric() && c != '_')+ .filter(|s| !s.is_empty())+ .collect();for kw in &dangerous_keywords {- // Match whole word boundaries to avoid false positives (e.g. column named "updated")- if rest_upper.split_whitespace().any(|word| word == *kw) {+ if tokens.iter().any(|word| word == kw) {return Err(format!("Query contains disallowed keyword: {}", kw));}}diff --git a/fincept-terminal-desktop/src-tauri/src/market_sim/agents/mod.rs b/fincept-terminal-desktop/src-tauri/src/market_sim/agents/mod.rsindex 41f0450c5..9325ffb90 100644--- a/fincept-terminal-desktop/src-tauri/src/market_sim/agents/mod.rs+++ b/fincept-terminal-desktop/src-tauri/src/market_sim/agents/mod.rs@@ -17,8 +17,10 @@ pub use hft::HFTAgent;pub use stat_arb::StatArbAgent;pub use momentum::MomentumAgent;pub use noise::NoiseTraderAgent;+#[allow(unused_imports)]pub use informed::InformedTraderAgent;pub use institutional::{InstitutionalAgent, ExecutionAlgo};+#[allow(unused_imports)]pub use spoofing::SpoofingAgent;pub use sniper::SniperAgent;diff --git a/fincept-terminal-desktop/src-tauri/src/market_sim/exchange/mod.rs b/fincept-terminal-desktop/src-tauri/src/market_sim/exchange/mod.rsindex cbc998cdd..63c9fa99b 100644--- a/fincept-terminal-desktop/src-tauri/src/market_sim/exchange/mod.rs+++ b/fincept-terminal-desktop/src-tauri/src/market_sim/exchange/mod.rs@@ -1,6 +1,6 @@use crate::market_sim::types::*;use crate::market_sim::matching_engine::MatchingEngine;-use crate::market_sim::risk_engine::{RiskEngine, RiskLimits};+use crate::market_sim::risk_engine::RiskEngine;use crate::market_sim::clearing::ClearingHouse;use crate::market_sim::market_data::MarketDataFeed;use crate::market_sim::latency::{LatencySimulator, PriceGenerator};diff --git a/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx b/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsxindex 2832fcb99..da77494c5 100644--- a/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx+++ b/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx@@ -1,6 +1,6 @@import React, { useState, useEffect } from 'react';import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';-import { Maximize, Minimize, Download, Settings, RefreshCw, User, Database, Eye, HelpCircle, LogOut, CheckCircle2, XCircle, MessageSquare, Terminal, Bot, ArrowUpCircle, X, StickyNote } from 'lucide-react';+import { Maximize, Minimize, Download, RefreshCw, Eye, LogOut, CheckCircle2, XCircle, MessageSquare, Terminal, ArrowUpCircle, X, StickyNote } from 'lucide-react';import { useAuth } from '@/contexts/AuthContext';import { useNavigation } from '@/contexts/NavigationContext';import { InterfaceModeProvider, useInterfaceMode } from '@/contexts/InterfaceModeContext';diff --git a/fincept-terminal-desktop/src/components/tabs/news/LiveNewsPanel.tsx b/fincept-terminal-desktop/src/components/tabs/news/LiveNewsPanel.tsxindex 07943e91d..431002a5f 100644--- a/fincept-terminal-desktop/src/components/tabs/news/LiveNewsPanel.tsx+++ b/fincept-terminal-desktop/src/components/tabs/news/LiveNewsPanel.tsx@@ -67,9 +67,7 @@ function getChannels(): LiveChannel[] {type PlayerState = 'idle' | 'loading' | 'playing' | 'error';-interface Props { colors: Record<string, string>; }--export const LiveNewsPanel: React.FC<Props> = () => {+export const LiveNewsPanel: React.FC = () => {const [channels] = useState<LiveChannel[]>(getChannels);const [activeId, setActiveId] = useState<string>(channels[0]?.id ?? '');const [muted, setMuted] = useState(true);diff --git a/fincept-terminal-desktop/src/components/tabs/news/NewsTab.tsx b/fincept-terminal-desktop/src/components/tabs/news/NewsTab.tsxindex 9a001814a..11d5852fc 100644--- a/fincept-terminal-desktop/src/components/tabs/news/NewsTab.tsx+++ b/fincept-terminal-desktop/src/components/tabs/news/NewsTab.tsx@@ -741,7 +741,7 @@ const NewsTab: React.FC = () => {backgroundSize: '20px 20px',}}>{/* Live TV (optional) */}- {!liveCollapsed && <LiveNewsPanel colors={{}} />}+ {!liveCollapsed && <LiveNewsPanel />}{/* Map (optional) */}{!mapCollapsed && <NewsMapPanel markers={newsMarkers} onMarkerClick={scrollToCluster} colors={{}} />}diff --git a/fincept-terminal-desktop/src/contexts/BrokerContext.tsx b/fincept-terminal-desktop/src/contexts/BrokerContext.tsxindex c200dac27..25b99b779 100644--- a/fincept-terminal-desktop/src/contexts/BrokerContext.tsx+++ b/fincept-terminal-desktop/src/contexts/BrokerContext.tsx@@ -147,14 +147,16 @@ export function BrokerProvider({ children }: BrokerProviderProps) {const [paperAdapter, setPaperAdapter] = useState<PaperTradingAdapter | null>(null);const [paperPortfolio, setPaperPortfolio] = useState<Portfolio | null>(null);- // Keep ref in sync with state so initializeAdapters can read latest without being in deps+ // Keep refs in sync with state so initializeAdapters can read latest without being in depsuseEffect(() => { realAdapterRef.current = realAdapter; }, [realAdapter]);+ useEffect(() => { paperAdapterRef.current = paperAdapter; }, [paperAdapter]);// Refs for cleanup and abort controlconst abortControllerRef = useRef<AbortController | null>(null);const hasInitializedRef = useRef(false); // Prevent duplicate initializationconst marketDataInitializedRef = useRef(false); // Track market data service initconst realAdapterRef = useRef<IExchangeAdapter | null>(null); // Ref to avoid dep loop in initializeAdapters+ const paperAdapterRef = useRef<PaperTradingAdapter | null>(null); // Ref to avoid stale closure in initializeAdapters// Get available brokers (memoized once, doesn't change)const availableBrokers = useMemo(() => {@@ -316,8 +318,8 @@ export function BrokerProvider({ children }: BrokerProviderProps) {try {// Clean up old adaptersawait cleanupAdapters(realAdapterRef.current);- if (paperAdapter) {- try { await paperAdapter.disconnect(); } catch (err) {+ if (paperAdapterRef.current) {+ try { await paperAdapterRef.current.disconnect(); } catch (err) {console.error('[BrokerContext] Paper adapter disconnect error:', err);}}diff --git a/fincept-terminal-desktop/src/i18n/config.ts b/fincept-terminal-desktop/src/i18n/config.tsindex bfd8993fd..61aeb00d2 100644--- a/fincept-terminal-desktop/src/i18n/config.ts+++ b/fincept-terminal-desktop/src/i18n/config.ts@@ -7,44 +7,6 @@ import LanguageDetector from 'i18next-browser-languagedetector';import Backend from 'i18next-http-backend';import { invoke } from '@tauri-apps/api/core';-// Custom storage backend using SQLite-const sqliteStorage = {- name: 'sqliteStorage',- async: true,-- // Async read- read: async (language: string, namespace: string, callback: (error: any, data: any) => void) => {- // Not used by i18next-browser-languagedetector- callback(null, null);- },-- // Async write- save: async (language: string, namespace: string, data: any) => {- // Not used by i18next-browser-languagedetector- }-};--// Custom language detector using SQLite-const sqliteLanguageDetector = {- name: 'sqliteDetector',- lookup: async (): Promise<string | undefined> => {- try {- const lang = await invoke<string>('storage_get_optional', { key: 'i18nextLng' });- return lang || undefined;- } catch (error) {- console.error('[i18n] Failed to get language from SQLite:', error);- return undefined;- }- },- cacheUserLanguage: async (lng: string) => {- try {- await invoke('storage_set', { key: 'i18nextLng', value: lng });- } catch (error) {- console.error('[i18n] Failed to save language to SQLite:', error);- }- }-};-i18next.use(Backend) // Load translations from public folder.use(LanguageDetector) // Auto-detect user language