Agent / Expose, do not reimplement

Four values from application to live runtime

Agent code separates four values cleanly:

  1. Application (App): Captured with Surface.application({ Model, Message, initial, update }).
  2. Builder (AgentBuilder): Agent.forApplication(App).withPrincipal<Principal>() creates a typed DSL bound to your app's Model, Message, and Principal types.
  3. Contract (AssistantAgent): AgentBuilder.make(...) declares the agent's context, exposed messages, authorize policies, completion rules, and read-only resources.
  4. Live runtime (agentRuntime): AgentBuilder.bind({ definition: AssistantAgent, host }) connects the static contract to a running Foldkit app or Sync.mount host, then mounts protocol adapters.