Commit 554f1c2
Sync documentation from agents PR #812
Updates from cloudflare/agents PR #812 (DO NOT LAND: docs/tests/enhancements):
## State Management
- Add validateStateChange() hook for synchronous validation before persistence
- Clarify that onStateUpdate() runs via waitUntil (best-effort, non-blocking)
- Document execution order: validateStateChange → persist → broadcast → onStateUpdate
## Scheduling
- Add scheduleEvery() method for interval-based scheduling with sub-minute precision
- Document overlap prevention and error resilience for intervals
- Add comparison table between cron and interval scheduling
- Update Schedule type to include "interval" variant
## Routing
- Add custom URL routing with basePath option
- Document server-sent identity system (onIdentity, onIdentityChange callbacks)
- Add identified reactive state property
- Document sendIdentityOnConnect agent option for security
- Add guidance on when to use custom routing vs default patterns
## Callable Methods
- Create new comprehensive callable-methods.mdx documentation
- Document client-side RPC timeouts with timeout option
- Add getCallableMethods() introspection API
- Update CallOptions type to include timeout parameter
- Document connection error handling and retries
## MCP Client API
- Update addMcpServer() to show options-based signature as preferred
- Document transport.type options (streamable-http, sse, auto)
- Add example with custom headers for authentication
- Mark legacy positional parameters as still supported
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent b4100aa commit 554f1c2
File tree
5 files changed
+1170
-6
lines changed- src/content/docs/agents
- api-reference
- model-context-protocol
5 files changed
+1170
-6
lines changed
0 commit comments