Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ Manages chat state:
- `sendMessage(text)` - Send a message to the API
- `clearMessages()` - Clear chat history

### API Client

`ChatApiClient` in `widget/src/api/client.ts` handles communication with the Worker:
- Typed requests/responses (`ChatRequest`, `ChatResponse`)
- Retry on 429 (respects `Retry-After`) and 503 (exponential backoff: 1s, 3s)
- Max 2 retries (3 total attempts)
- Debounced sends (configurable, default 300ms)
- Typed errors (`ChatApiError` with status/code, `DebounceError`)

### Worker API

| Endpoint | Method | Description |
Expand Down
Loading
Loading