File size: 2,664 Bytes
0c591a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
de4ad41
0c591a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import type { Meta, StoryObj } from '@storybook/react'
import { ProcessFlow } from '../components/ProcessFlow'
import type { MCPStatus } from '@/lib/api'

const meta = {
  title: 'Components/ProcessFlow',
  component: ProcessFlow,
  parameters: {
    layout: 'padded',
  },
  tags: ['autodocs'],
} satisfies Meta<typeof ProcessFlow>

export default meta
type Story = StoryObj<typeof meta>

const emptyMcpStatus: MCPStatus = {
  financials: 'idle',
  valuation: 'idle',
  volatility: 'idle',
  macro: 'idle',
  news: 'idle',
  sentiment: 'idle',
}

const completedMcpStatus: MCPStatus = {
  financials: 'completed',
  valuation: 'completed',
  volatility: 'completed',
  macro: 'completed',
  news: 'completed',
  sentiment: 'completed',
}

const inProgressMcpStatus: MCPStatus = {
  financials: 'completed',
  valuation: 'completed',
  volatility: 'executing',
  macro: 'idle',
  news: 'idle',
  sentiment: 'idle',
}

export const Idle: Story = {
  args: {
    currentStep: '',
    completedSteps: [],
    mcpStatus: emptyMcpStatus,
    llmProvider: 'Claude 3.5',
  },
}

export const InputStep: Story = {
  args: {
    currentStep: 'input',
    completedSteps: [],
    mcpStatus: emptyMcpStatus,
    llmProvider: 'Claude 3.5',
  },
}

export const CheckingCache: Story = {
  args: {
    currentStep: 'cache',
    completedSteps: ['input'],
    mcpStatus: emptyMcpStatus,
    llmProvider: 'Claude 3.5',
  },
}

export const ResearcherActive: Story = {
  args: {
    currentStep: 'researcher',
    completedSteps: ['input', 'cache'],
    mcpStatus: inProgressMcpStatus,
    llmProvider: 'Claude 3.5',
  },
}

export const AnalyzerActive: Story = {
  args: {
    currentStep: 'analyzer',
    completedSteps: ['input', 'cache', 'researcher'],
    mcpStatus: completedMcpStatus,
    llmProvider: 'Claude 3.5',
  },
}

export const CriticActive: Story = {
  args: {
    currentStep: 'critic',
    completedSteps: ['input', 'cache', 'researcher', 'analyzer'],
    mcpStatus: completedMcpStatus,
    llmProvider: 'Claude 3.5',
  },
}

export const Completed: Story = {
  args: {
    currentStep: 'output',
    completedSteps: ['input', 'cache', 'researcher', 'analyzer', 'critic', 'output'],
    mcpStatus: completedMcpStatus,
    llmProvider: 'Claude 3.5',
  },
}

export const CacheHit: Story = {
  args: {
    currentStep: 'output',
    completedSteps: ['input', 'cache', 'output'],
    mcpStatus: emptyMcpStatus,
    llmProvider: 'Claude 3.5',
    cacheHit: true,
  },
}

export const WithGPT4: Story = {
  args: {
    currentStep: 'analyzer',
    completedSteps: ['input', 'cache', 'researcher'],
    mcpStatus: completedMcpStatus,
    llmProvider: 'GPT-4o',
  },
}