Concepts
The few ideas Affordances is built on. A page says what it shows and what can be done there, once, for people and agents alike.
An Affordances page has two files next to it. state.ts says what the page shows, and actions.ts says what can be done there. Everything an agent sees is derived from those two files.
- Actions: one
defineActioncall describes something a person or an agent can do on a page, and returns the server action that does it. - State: a route's
state.tssays what the page shows, as entities. It's loaded for the graph and again after every action. - Expose: nothing reaches agents until an action says who may call it.
exposeispublic,session, orconfirm. - Guards and confirm: a guard is the precondition an action checks before it runs. Agents see it before they call, and get its reason when it fails.
- Deltas: calling an action returns what changed on the page, so the agent doesn't have to read it again.
- Plugins: a plugin serves the same pages in another form, such as Markdown, at the same URLs and from the same render. The Plugins section lists each one.