Factory
{ chatServer, getCapabilities, getModels, getSkills, getMcp, searchAgents, saveAgent }.
Combines a chat server with your agent-management callbacks into a complete AgentUIServer.
Optional callbacks are getMcpConnector, getMcpTools, deleteAgent, and getMe.
Optional ports are catalog, sessions, metrics, schedules, sandboxEnvironments, and
permissions; the factory attaches each supplied port to the resulting server.
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,
TurnStatePaused, TurnStatus, PreviousTurnIdInput.Turn input and answers
Turn input and answers
TurnInputItem, UserMessage, UserMessageContent, TurnInboundEventItem,
UserToolApprovalInputEvent, UserToolApprovalPolicyInputEvent, UserToolResponseInputEvent,
ToolApprovalPolicyItem, ToolApprovalPolicyAllowSession, ApprovalDecision.Events and streaming
Events and streaming
TurnStreamData, TurnStreamingEvent, TurnUpdateEvent, TurnInboundEvent,
UserToolApprovalEvent, UserToolApprovalPolicyEvent, UserToolResponseEvent,
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
ListResult, PageParams, ListSessionsParams, ListSessionsOrder,
ListSessionEventsParams, SearchAgentsParams. List methods return ListResult<T>,
a plain object with data and optional nextPageToken / previousPageToken.Catalog
Catalog
ModelCatalogServer, ConnectorCatalogServer, SkillCatalogServer,
SandboxCatalogServer, plus the ModelProvider*, Connector*, Skill*, and Sandbox*
families. See Settings catalog.