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
4 changes: 2 additions & 2 deletions src/content/docs/agents/api-reference/agents-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ flowchart TD
| `onError(connection, error)` | When a WebSocket error occurs |
| `onClose(connection, code, reason, wasClean)` | When a WebSocket connection closes |
| `onEmail(email)` | When an email is routed to the instance |
| `onStateUpdate(state, source)` | When state changes (from server or client) |
| `onStateChanged(state, source)` | When state changes (from server or client) |

## Core properties

Expand All @@ -77,7 +77,7 @@ flowchart TD

| Feature | Methods | Documentation |
| -------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------- |
| **State** | `setState()`, `onStateUpdate()`, `initialState` | [Store and sync state](/agents/api-reference/store-and-sync-state/) |
| **State** | `setState()`, `onStateChanged()`, `initialState` | [Store and sync state](/agents/api-reference/store-and-sync-state/) |
| **Callable methods** | `@callable()` decorator | [Callable methods](/agents/api-reference/callable-methods/) |
| **Scheduling** | `schedule()`, `scheduleEvery()`, `getSchedules()`, `cancelSchedule()` | [Schedule tasks](/agents/api-reference/schedule-tasks/) |
| **Queue** | `queue()`, `dequeue()`, `dequeueAll()`, `getQueue()` | [Queue tasks](/agents/api-reference/queue-tasks/) |
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/agents/api-reference/client-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ agent.setState({ score: 100, level: 5 });
When you call `setState()`:

1. The state is sent to the agent over WebSocket
2. The agent's `onStateUpdate()` method is called
2. The agent's `onStateChanged()` method is called
3. The agent broadcasts the new state to all connected clients
4. Your `onStateUpdate` callback fires with `source: "client"`

Expand Down
Loading
Loading