Core Decorators
@field
Marks a property as persisted and client-synced state.- Automatically persisted across Durable Object hibernation
- Changes broadcast to all connected clients
- Supports all JSON-serializable types
@action()
Marks a method as callable from outside the system.- Callable via WebSocket from clients
- Typed parameters and return values
- Automatically generates client types
@tool()
Marks a method as available to the LLM for invocation.description: Explains what the tool does (shown to LLM)- Optional:
permission: 'always' | 'confirm' | 'never'
@schedule()
Marks a method for periodic or scheduled execution.'every N minutes''every N hours''every day at HH:MM''every monday at HH:MM'
Streaming Values
stream<T>()
Creates a streaming value that can be appended to incrementally.
- Token-by-token LLM output
- Progress indicators
- Real-time logs