Factory
{ chatServer, getCapabilities, getModels, getSkills, getMcp, searchAgents, saveAgent, deleteAgent?, catalog? }.
Combines a chat server with your agent-management callbacks into a complete AgentUIServer.
deleteAgent and catalog are the only optional entries; if you omit deleteAgent, calling it
throws.
Context
Shell mode
useShellMode() reports which surfaces the current agentConfig permits —
isLibraryEnabled, isComposerEnabled, isNewChatEnabled — and returns the actions
selectAgent, openDraft, and clearChat, plus settingsOpen / setSettingsOpen. Use it in
a custom layout to render only the controls that apply. See
Agent modes.
Contract types
The full server contract is re-exported from the package root. The types you are most likely to reference:Server interfaces
Server interfaces
AgentUIServer, AgentChatServer, AgentBuilderServer,
AgentBuilderCapabilitiesResponse, CatalogServer, TrueForgeServerConfig,
CreateTrueForgeServerOptions, TrueForgeServer.Sessions and turns
Sessions and turns
Session, CreateSessionRequest, UpdateSessionRequest, Turn, TurnState,
PreviousTurnIdInput.Turn input
Turn input
TurnInputItem, UserMessage, UserMessageContent, UserToolApprovalEvent,
UserToolResponseEvent, ApprovalDecision.Events and streaming
Events and streaming
TurnStreamData, TurnStreamingEvent, SessionEventItem. The concrete event shapes are in
Streaming events.Agents and models
Agents and models
AgentSpec, AgentConfig, ShellMode, Model, ModelParams, SkillMount,
McpServerMount, SaveAgentRequest.Picker rows
Picker rows
ModelSelection, AgentSkill, ConnectorState, AgentLibraryEntry,
SearchAgentsParams.Pagination
Pagination
PageResult, PageParams, TokenPagination, ListSessionsParams, ListSessionsOrder,
ListSessionsResponse, ListTurnsResponse, ListSessionEventsResponse.Catalog
Catalog
ModelCatalogServer, ConnectorCatalogServer, SkillCatalogServer,
SandboxCatalogServer, plus the ModelProvider*, Connector*, Skill*, and Sandbox*
families. See Settings catalog.