Add message undo/refresh functionality with editable user prompts

- Add revertMessage and unrevertSession methods to OpenCode API client
- Create useRemoveMessage and useRefreshMessage hooks for message operations
- Add MessageActionButtons component with X (remove) and refresh buttons
- Add EditableUserMessage component for editing prompts before resend
- Update MessageThread to integrate action buttons and editable messages
- Update AGENTS.md with improved guidelines and pnpm preference
This commit is contained in:
OpenCode Agent committed 2025-12-16 18:53:31 +00:00
1 parent b27d4a9cbb
commit 6c4daaeae7
7 files changed
+525 -43

No files matched your search

+10
View File
@@ -127,6 +127,16 @@ export class OpenCodeClient {
return response.data
}
async revertMessage(sessionID: string, data: { messageID: string, partID?: string }) {
const response = await this.client.post(`/session/${sessionID}/revert`, data)
return response.data
}
async unrevertSession(sessionID: string) {
const response = await this.client.post(`/session/${sessionID}/unrevert`)
return response.data
}
getEventSourceURL() {
const base = this.baseURL.startsWith('http')
? this.baseURL