Declare named resources
# Coordinate calendar work.
app CalendarDemo
context
binding Schedule DurableObject key=CalendarDemo.Calendar
queue Reconcile type=ReconcileWork
cache KV ttl=10m
analytics Usage { event:text, occurred:datetime }
Given
Calendar at=Schedule { name:text }
contract ReconcileWork { calendar:Calendar }
When
Then
This complete declaration example owns the calendar model, queue payload type, and telemetry schema. It declares resources but no business operations or user page. A Durable Object binding names a key path that routes a root and its contained group to one authoritative SQLite owner. Queue declarations bind a name to an exact payload type; consumers are declared as trusted handlers. KV caching is positive-TTL and only for reconstructible public data; it cannot become business authority or cache private policy results. Analytics carries bounded telemetry, never transactional state.
The only additional context forms are theme with supported mode/accent/density values, files with an allowed type list and/or positive maximum size, and locale default="..." using a canonical BCP 47 tag. Repeated, unchanged defaults and arbitrary resource attributes are invalid. Provisioning and credentials belong to environments and secrets; exact syntax is indexed in syntax reference.