diff --git a/app/types/__tests__/agents.test.ts b/app/types/__tests__/agents.test.ts new file mode 100644 index 0000000..58c028b --- /dev/null +++ b/app/types/__tests__/agents.test.ts @@ -0,0 +1,27 @@ +import { describe, it, expect } from 'vitest' +import type { AgentSignal, AnalystReport } from '../agents' + +describe('Agent Types', () => { + it('should define valid agent signal structure', () => { + const signal: AgentSignal = { + agent: 'fundamentals', + signal: 'bullish', + confidence: 0.85, + reasoning: 'Strong fundamentals', + timestamp: '2026-01-15T00:00:00.000Z' + } + expect(signal.agent).toBe('fundamentals') + expect(signal.signal).toBe('bullish') + }) + + it('should allow neutral signal', () => { + const signal: AgentSignal = { + agent: 'technical', + signal: 'neutral', + confidence: 0.5, + reasoning: 'Market indecision', + timestamp: '2026-01-15T00:00:00.000Z' + } + expect(signal.signal).toBe('neutral') + }) +}) \ No newline at end of file diff --git a/app/types/agents.ts b/app/types/agents.ts new file mode 100644 index 0000000..21c7a0d --- /dev/null +++ b/app/types/agents.ts @@ -0,0 +1,38 @@ +export type SignalType = 'bullish' | 'bearish' | 'neutral' + +export interface AgentSignal { + agent: 'fundamentals' | 'sentiment' | 'news' | 'technical' | 'trader' + signal: SignalType + confidence: number + reasoning: string + timestamp: string +} + +export interface AnalystReport { + analyst: 'fundamentals' | 'sentiment' | 'news' | 'technical' + report: string + signal: AgentSignal +} + +export interface DebateRound { + bullishView: string + bearishView: string + researcher: 'bullish' | 'bearish' +} + +export interface TradingDecision { + action: 'buy' | 'sell' | 'hold' + confidence: number + targetPrice?: number + stopLoss?: number + reasoning: string + agentSignals: AgentSignal[] + debateRounds: DebateRound[] +} + +export interface AgentConfig { + llmProvider: 'openrouter' + model: string + maxDebateRounds: number + temperature: number +} \ No newline at end of file