Fix compact command validation flow (#28)

* feat: Implement /compact command with processing feedback

- Add 'compact' status type to session status store
- Update SessionStatusIndicator to show purple pulsing animation for compaction
- Add summarizeSession() API method to OpenCode client
- Modify command handler for /compact to:
  - Get current model from state
  - Show compaction toast
  - Set session to compacting status
  - Call summarize endpoint with provider/model
- Update SSE handler to clear compact status on session.compacted event

The user sees a purple animated indicator and 'Compacting' text during the operation, matching the TUI experience.

* Fix compact command to use break instead of return for model validation

---------

Co-authored-by: Chris Scott <chris@cstech.dev>
This commit is contained in:
Chris ScottandChris Scott authored and GitHub committed 2025-12-19 00:10:12 -05:00
1 parent 516a894627
commit a9ebee72c4
5 files changed
+47 -7

No files matched your search

+8
View File
@@ -82,6 +82,14 @@ export class OpenCodeClient {
return response.data
}
async summarizeSession(sessionID: string, providerID: string, modelID: string) {
const response = await this.client.post(`/session/${sessionID}/summarize`, {
providerID,
modelID
})
return response.data
}
async getConfig() {
const response = await this.client.get<ConfigResponse>('/config')
return response.data