()
| 5 | import type { PostUserMessageFn } from '../types/contracts/send-message' |
| 6 | |
| 7 | export async function handleUsageCommand(): Promise<{ |
| 8 | postUserMessage: PostUserMessageFn |
| 9 | }> { |
| 10 | const authToken = getAuthToken() |
| 11 | |
| 12 | if (!authToken) { |
| 13 | const postUserMessage: PostUserMessageFn = (prev) => [ |
| 14 | ...prev, |
| 15 | getSystemMessage('Please log in first to view your usage.'), |
| 16 | ] |
| 17 | return { postUserMessage } |
| 18 | } |
| 19 | |
| 20 | // Show the usage banner - the useUsageQuery hook will automatically fetch |
| 21 | // the data when the banner becomes visible |
| 22 | useChatStore.getState().setInputMode('usage') |
| 23 | |
| 24 | const postUserMessage: PostUserMessageFn = (prev) => prev |
| 25 | return { postUserMessage } |
| 26 | } |
no test coverage detected