feat: implement UHF 20Hz real-time tick streaming, Hermes multimodal copilot with voice studio, and autonomous armed quant sentinel

This commit is contained in:
2026-10-23 01:50:35 +06:00
parent fc393a90dd
commit 8ee3a30b24
8 changed files with 1096 additions and 11 deletions
+60
View File
@@ -9,6 +9,8 @@ import { CockpitDock } from "@/components/dock/CockpitDock";
import { ConfluenceMeter } from "@/components/execution/ConfluenceMeter";
import { TitanOrderTerminal } from "@/components/execution/TitanOrderTerminal";
import { AuraAgenticCopilot } from "@/components/agentic/AuraAgenticCopilot";
import { HermesAgentChatDrawer } from "@/components/agentic/HermesAgentChatDrawer";
import { AutonomousPilotToggle } from "@/components/agentic/AutonomousPilotToggle";
import { SecurityGate } from "@/components/auth/SecurityGate";
import { TradePosition } from "@/components/positions/ActiveTradesTable";
import { AccountVaultModal, MT5AccountVaultItem } from "@/components/broker/AccountVaultModal";
@@ -32,6 +34,11 @@ export default function TitanQuantTerminalPage() {
const [activeAccount, setActiveAccount] = useState<MT5AccountVaultItem | null>(null);
const [showVaultModal, setShowVaultModal] = useState(false);
// Hermes Multimodal Copilot & Autonomous Pilot States
const [isHermesDrawerOpen, setIsHermesDrawerOpen] = useState(false);
const [isArmedPilot, setIsArmedPilot] = useState(false);
const lastAutoExecutionRef = React.useRef<number>(0);
const [apiBaseUrl, setApiBaseUrl] = useState(() => {
if (typeof window !== "undefined") {
if (window.location.hostname === "localhost" && window.location.port === "3000") {
@@ -235,6 +242,38 @@ export default function TitanQuantTerminalPage() {
}
};
// Autonomous Pilot Execution Sentinel Watcher (Real Exness MT5 Auto-Execution)
useEffect(() => {
if (!isArmedPilot) return;
if (!confluence || !confluence.is_qualifying || (confluence.total_score || 0) < 85) return;
if (positions.length > 0) return; // Prevent over-trading: strictly 1 position at a time
if (packet?.circuit_breaker?.is_tripped) return;
if (packet?.news_quarantine?.is_active) return;
// Cooldown: 15 minutes between auto executions
const now = Date.now();
if (now - lastAutoExecutionRef.current < 15 * 60 * 1000) return;
lastAutoExecutionRef.current = now;
const currentPrice = packet?.tick?.bid || 2735.40;
const direction: "BUY" | "SELL" = confluence.direction === "SELL" ? "SELL" : "BUY";
const sl = Number((direction === "BUY" ? currentPrice - 1.50 : currentPrice + 1.50).toFixed(2));
const tp = Number((direction === "BUY" ? currentPrice + 4.20 : currentPrice - 4.20).toFixed(2));
const autoTrade = {
symbol: activeSymbol,
order_type: direction,
lot: 0.01,
price: currentPrice,
sl: sl,
tp: tp,
comment: "Aura Sentinel Autonomous A+"
};
console.log("⚡ [AUTONOMOUS SENTINEL] Auto-executing A+ trade setup:", autoTrade);
handleExecuteTrade(autoTrade);
}, [isArmedPilot, confluence, packet, positions.length, activeSymbol]);
// Emergency Panic Kill All
const handleEmergencyKill = async () => {
if (!confirm("🚨 ARE YOU SURE YOU WANT TO TERMINATE 100% OF ACTIVE POSITIONS ON EXNESS INSTANTLY?")) {
@@ -307,6 +346,8 @@ export default function TitanQuantTerminalPage() {
name: activeAccount.name
} : null}
onOpenAccountVault={() => setShowVaultModal(true)}
onToggleHermesChat={() => setIsHermesDrawerOpen((prev) => !prev)}
isHermesChatOpen={isHermesDrawerOpen}
/>
{/* 2. Dynamic Institutional Workspace (Pro, Focus, or Agentic Cockpit) */}
@@ -376,6 +417,13 @@ export default function TitanQuantTerminalPage() {
workspaceMode === "agentic" ? "xl:col-span-5" : "xl:col-span-3"
}`}
>
{/* Autonomous Pilot Mode Switcher (Armed Quant vs Supervised Advisory) */}
<AutonomousPilotToggle
isArmed={isArmedPilot}
onToggle={(armed) => setIsArmedPilot(armed)}
maxRiskDollars={Math.max(0.15, Number((accountEquity * 0.01).toFixed(2)))}
/>
{/* Hermes Agentic Copilot HUD */}
<div className="shrink-0">
<AuraAgenticCopilot
@@ -484,6 +532,18 @@ export default function TitanQuantTerminalPage() {
</div>
</div>
)}
{/* Hermes Multimodal Copilot & Voice Studio Drawer */}
<HermesAgentChatDrawer
isOpen={isHermesDrawerOpen}
onClose={() => setIsHermesDrawerOpen(false)}
apiBaseUrl={apiBaseUrl}
currentSymbol={activeSymbol}
currentPrice={packet?.tick?.bid || 2735.40}
accountEquity={accountEquity}
onExecuteTrade={handleExecuteTrade}
onApplySetupToTerminal={(setup) => setAgentSetup(setup)}
/>
</main>
);
}