Agent / Expose, do not reimplement
Four values from application to live runtime
Agent code separates four values cleanly:
- Application (
App): Captured withSurface.application({ Model, Message, initial, update }). - Builder (
AgentBuilder):Agent.forApplication(App).withPrincipal<Principal>()creates a typed DSL bound to your app'sModel,Message, andPrincipaltypes. - Contract (
AssistantAgent):AgentBuilder.make(...)declares the agent'scontext, exposedmessages,authorizepolicies,completionrules, and read-onlyresources. - Live runtime (
agentRuntime):AgentBuilder.bind({ definition: AssistantAgent, host })connects the static contract to a running Foldkit app orSync.mounthost, then mounts protocol adapters.