Problem
- The app can only invoke extension handlers (registered by plugins), which is suitable for simple tasks, such as inserting or updating data.
- We need a mechanism to let plugin control over the entire LLM streaming and update app states, create a communication channels between app & plugins.
- Cases: move streaming session & download progress retrieval to plugin
Solution
- The event emitter mechanism helps to address more complex tasks, like managing the entire LLM stream or handling multiple bots replying.
- This will also enable the ability to build Use-Case Plugins. With this capability, plugins can now control the entire LLM inference process, from receiving the message to updating it. For example, if the app sends a message, the plugin can build a chain of agents to process it and gradually update the message.
App now wrap the entire streaming process

Plugin should be able to control over the llm agent and sync states:
Use case based plugin:
