Problem
Currently the Cap store manages the state of installed Cap and the current selected Cap.
The chat store manages the state of all the chat sessions.
In order to connect the state of chat sessions and caps, we need to add the cap information the chat session data.
This is also a good time to refactor the chat store and hooks.
Solution
- Adding Cap ID and Cap Version metadata to the Chat Session type.
- Update the Chat Store for handling the new Chat Session type. Adding new actions if needed. Also make sure the chat store has proper naming and definition of the actions. The naming should be following CRUD pattern.
- Update the hooks to use the new store actions. Remove the unused chat hooks.
4.Update the components to use the new hooks.
Note that currently there is a service logic getting embedded in the chat store: the title generation. This should not be handled by the store and should be explicitely handled by the handleAIRequest function. This is also the same place where the currentCap should be stored into the current chat session.
Problem
Currently the Cap store manages the state of installed Cap and the current selected Cap.
The chat store manages the state of all the chat sessions.
In order to connect the state of chat sessions and caps, we need to add the cap information the chat session data.
This is also a good time to refactor the chat store and hooks.
Solution
4.Update the components to use the new hooks.
Note that currently there is a service logic getting embedded in the chat store: the title generation. This should not be handled by the store and should be explicitely handled by the
handleAIRequestfunction. This is also the same place where the currentCap should be stored into the current chat session.