Agent / foldkit-agent

foldkit-agent

Lets an agent use a Foldkit application through the transitions it already has. It adds two boundaries and nothing else:

Model         -> context projection   what an agent may see
Message union -> Agent.expose         what an agent may do

A capability is a Message, so an agent cannot do anything the application cannot, and there is no second implementation of a feature to keep in step. The context is a foldkit-surface projection, so the value a view renders is the value an agent reads. update remains the single source of truth, and the protocol adapters are translation only.

What you get for declaring that once: typed input decoded at the boundary, capabilities that appear and disappear with the Model, authorization beside the Messages it governs, a completion contract so a call resolves on the fact rather than on receipt, an audit log of every decision, and four protocol adapters that add no authority of their own.

Use it when an assistant, a copilot, or another service should drive the application the way a person does. Not for DOM automation: this dispatches Messages, so if the behaviour is not a Message, add one. Not a guarantee of exactly-once effects: completion says a correlated fact was applied, not that an external action can be safely repeated.

Install

bash
pnpm add foldkit-agent

foldkit and effect are peer dependencies. The agents guide covers the mental model, and examples/todo is a worked contract.

A community package, not affiliated with or endorsed by the Foldkit maintainers.