vlt / affordances
  • Quickstart
  • Concepts
  • Guides
  • Reference
  • For agents
  • Why Affordances
  • Quickstart
  • Benchmarks

Concepts
  • Overview
  • Actions
  • State
  • Expose
  • Guards and confirm
  • Deltas
  • Plugins

Guides
  • Overview
  • React and WebMCP
  • MCP
  • Lint
  • Security

Plugins
  • Overview

Reference
  • Overview
  • Protocol
  • Options
  • CLI
  • Effects
  • Availability
  • Messages
  1. Concepts
  2. /
  3. Deltas

Deltas

Calling an action returns what changed on the page, so the agent doesn't have to read it again.

After an action runs, the handler reloads the page's state and compares it with the state from before. The response is a delta:

JSON
{
  "ok": true,
  "changed": { "cart": { "count": 2, "subtotal": { "amount": 6000, "currency": "USD" } } },
  "message": "Added Heavyweight Tee (M) to your cart"
}
FieldPresent when
changedSome entity changed. With effects, it holds those keys; without, the diff
outputrun returned something other than undefined
actionsAddedAn action appeared, or its descriptor changed (for example, available flipped)
actionsRemovedAn action is no longer listed
redirectThe action redirected; the agent should request this path next
messageThe action has a message option
errorok is false; see the protocol for codes

Effects

effects lists the entities an action changes. When it's set, changed holds the new value of exactly those entities, whether or not they differ. When it's omitted, the handler compares every top-level entity and includes the ones whose JSON changed.

Declaring effects is cheaper to reason about and tells agents in advance what an action touches, since effects is part of the descriptor.

Availability

Deltas carry action changes too. Adding the first item to a cart can make checkout available; placing the order makes it unavailable again. The descriptor in actionsAdded is the new one, with its available and reason, so the agent's picture of the page stays current without another GET.

Messages

message is a short sentence an agent can repeat to the person:

TypeScript
message: ({ input, output }) => `Added ${input.quantity} × ${output.name} to the cart`,

PreviousGuards and confirmNextPlugins

On this page

  • Effects
  • Availability
  • Messages
Edit this page

Make your app agent-operable

Give every page a graph and every server action an agent path: HTTP, WebMCP, and MCP, with the same session and the same checks. One command sets it up.

Read the quickstart