/** * RiskGuard: real-time stateless gate evaluation via MCP API calls. * * Gates 1–2 use `strategy_get_pnl_and_account_value_history` (today_snapshot); gates 3–4 use * `discovery_get_trader_history` and/or `discovery_get_trader_state`. Gate 5 uses trader state + * history for entry counts; when `bypass_max_entries_per_day_on_profit` applies at the cap it * also uses `today_snapshot.pnl.delta_since_open` (shared snapshot with gates 1–2 when those ran, * or a single lazy `getPnlHistoryWithSnapshot` when gates 1–2 are off). * Every checkGate call logs the decision to the audit log (write-only). * If any risk API call fails, the gate is CLOSED (fail-closed). * * Supports two modes: * - Default (short-circuit): returns on first non-OPEN gate. * - evaluateAll: evaluates every configured gate, returns per-gate details. */ import type { RiskGuard as IRiskGuard } from "../types/action.js"; import type { NotificationService } from "../types/notification.js"; import type { StrategyConfig } from "../types/strategy.js"; import type { SenpiClient } from "../senpi/client.js"; import type { RiskGateEvaluation, RiskSource } from "../health/types.js"; import type { RiskAuditLog } from "../risk/risk-audit-log.js"; export declare function createRiskGuardStub(): IRiskGuard; export interface RiskGuardConfig { senpi: SenpiClient; notifications: NotificationService; strategies: Map; strategyNames?: Record; auditLog?: RiskAuditLog; /** * Optional strategy-lifecycle tracker. RiskGuard is stateless and only reports; the * lifecycle component owns the self-pause state (which gates are paused) and fires the * hook event + user notification on a running→paused transition. Optional so existing * call sites/tests don't break. */ lifecycleTracker?: { observe(address: string, label: string, evaluations: RiskGateEvaluation[], source: RiskSource): void; }; } export declare function createRiskGuard(config: RiskGuardConfig): IRiskGuard; //# sourceMappingURL=risk-guard.d.ts.map