Types
Important public types for agents, tools, chat parts, MCP content, and client renderers.
Agent types
Important types are exported from @tulip-systems/ai/agents/server:
AgentCallOptions: whatAgentsandChatpass with every call: thetoolCall, and in a chat the pagecontextDefineAgentOptions: the options ofdefineAgent():ToolLoopAgentsettings withname,title,tools,output,identityandmaxSteps, withoutprepareCall,toolApproval,stopWhen,toolsContextandcallOptionsSchemaTulipAgent: an agent made withdefineAgent(), with its Tulip fields (TulipAgentInfo) undertulipAgentIdentity: thegrantsandapproversof an agent that runs as itself
defineAgent() returns an AI SDK ToolLoopAgent. Agents only takes agents made with
defineAgent().
Tool types
Important server-side tool types:
ToolBase: the options oftoolBuilder():authorize,verifyProofandcontextToolDefinition: whattool()takes, withpermissionandcontexttyped by the baseTulipToolDefinition: a tool made withtool(): its definition with thebaseit followsToolCaller: who calls a tool and through what (principal,trigger,run), as the base'scontextgets itToolCall: what a service passes to the tools it runs: the caller, an agent'sgrants,authorizeCapabilityandresolveApprovalToolKind,ToolConfirmation,ToolProofMethod,ToolPermissionTulipToolMetadata: the{ kind, confirmation }a Tulip tool sends with its tool partsAiProofInput: whatverifyProofreceives
Chat types
Exported from @tulip-systems/ai/chat/client:
ChatPartToolChatPart: a tool part, the AI SDK'sToolUIPart | DynamicToolUIPart, with the tool'stitleand itstoolMetadata({ tulip: { kind, confirmation } }for Tulip tools). Use the AI SDK'sisToolUIPartandgetToolNameon it, andgetTulipToolMetadatafor the Tulip fields.ToolRenderer: a tool's own card:{ toolName, render(part) }ToolApprovalChoice: an approve button:{ value: "once" | "chat", label }ChatThreadLabels: the texts of a thread (tool,reasoning,sources,activity), withToolCallCardLabels,ToolApprovalLabelsandChatReasoningLabelsChatComposerLabels:attach,send,stopandwaitUseAssistantChatOptions
These are useful when custom-rendering tool parts or building higher-level chat components.
Shared types
@tulip-systems/ai/types exports the types server and client share: the service types below, the
tool types ToolKind, ToolConfirmation and ToolProofMethod, and AgentContextValue (the page
context). Client code imports them from there, since the service entries are server-only.
Service types
Exported from @tulip-systems/ai/tools/server, agents/server, chat/server and mcp/server,
each with its service, and all of them from @tulip-systems/ai/types:
AgentsConfig,ChatConfig,McpConfig: the options ofAgents.init,Chat.initandMcp.init(ChatConfigandMcpConfigfrom their server entry only)AiAgentsDatabase,AiChatDatabase,AiMcpDatabase: the database each service stores its data inAiUser: a user the tools act forAiPrincipal: whose permissions a run uses:{ type: "user", user }or{ type: "agent", agent, title }AiTrigger: what started a run:chat,mcp,action,eventorscheduleAiRun,AiRunStatus,AiRunReference,AiRunFilters: a run, its status, the run as tools see it, and the filters ofagents.runs.listAiRunInput,AiRunResult,AiAgentOutput: the input ofagents.run,agents.streamandagents.start, the result ofagents.run, and an agent's typed outputAiApproval,AiApprovalDetails,AiApprovalStatus,AiApprovalDecision,AiApprovalFilters: approvals outside the chat;AiApprovalDetailsaddsagentTitleandtoolTitleAiAgentInfo,AiAgentStatus,AiAgentTool,AiAgentState: agents as admins see them, and their stored stateAiChat,AiMcpAppSettings: a saved chat, and an MCP app's settings for a userAiChatRequest,AiApprovalAnswer: what the client sends for one chat turn (chatId, amessageorapprovals, and the pagecontext), and one answer to an approvalAiChatSendInput: the input ofchat.send(): the request with theuser,agentandabortSignalAiChatEvent: what theonEventofChat.initreceivesAgentsLabels: the reasons the chat shows for calls the workspace's setting decidedAgentPolicy,PolicyTarget:"allow","ask"or"deny", for an"agent"or an"mcp"app
Exported from @tulip-systems/ai/drizzle:
AiAgentsDrizzleSchema,AiChatDrizzleSchema,AiMcpDrizzleSchema: the tables each adapter takesAiChatsDrizzleTable,AiMessagesDrizzleTable,AiMcpAppSettingsDrizzleTable,AiRunsDrizzleTable,AiApprovalsDrizzleTable,AiAgentStatesDrizzleTable: the columns each table must have
MCP types
MCP types describe content blocks returned by helpers such as text(), json(), resource(), and
table().
Guidance
- Prefer exported package types over internal source paths.
- Import shared types in client code from
@tulip-systems/ai/types. - Keep app-specific schemas in the app; only generic AI abstractions belong in the package.