Skip to main content
This appendix provides a quick reference for Idyllic constructs used throughout the book. Idyllic is notation for exploring ideas—the principles transfer to any implementation.

Core Decorators

@field

Marks a property as persisted and client-synced state.
Behavior:
  • 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.
Behavior:
  • 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.
Parameters:
  • description: Explains what the tool does (shown to LLM)
  • Optional: permission: 'always' | 'confirm' | 'never'

@schedule()

Marks a method for periodic or scheduled execution.
Schedule formats:
  • '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.
Use cases:
  • Token-by-token LLM output
  • Progress indicators
  • Real-time logs

Vector Store

VectorStore<T>

Semantic storage with similarity search.

System Lifecycle

Initialization

State Access

State Synchronization

Client Integration

React Hook

Streaming Values in React

LLM Integration

Basic Completion

With Tools

Streaming Completion

Complete Example