Skip to content

Assistant Module

Slug: assistant

Overview

The built-in AI assistant is powered by the Claude Agent SDK with streaming chat support. It acts as a "task management operator" — rather than writing code directly, it manages workspaces, projects, and tasks through Tower's MCP tools. You can ask the assistant to create tasks, move them between statuses, search across projects, generate summaries, and more.

The assistant supports image uploads for multimodal conversations and maintains chat history that is automatically saved. Sessions can be resumed later to continue where you left off.

Details

  • Streaming responses: Chat responses arrive via Server-Sent Events (SSE), so you see the assistant's reply as it is generated in real time.
  • MCP tool integration: The assistant has access to all Tower MCP tools, allowing it to perform actions like creating workspaces, listing tasks, or checking terminal output on your behalf.
  • Multimodal input: Upload images alongside text messages. Images are processed and included in the conversation context for the AI to reference.
  • Session management: Each conversation is a session with a unique ID. Sessions persist across page navigations and can be resumed from the session list.
  • Message format conversion: Internal SDK message formats are converted to a UI-friendly format for display, handling tool calls, thinking blocks, and rich content.

File Reference

Server Actions (src/actions/assistant-actions.ts)

Session management and message handling.

API Routes

RouteDescription
/api/internal/assistant/route.tsAssistant management
/api/internal/assistant/chat/route.tsChat messages (SSE streaming)
/api/internal/assistant/images/route.tsImage upload
/api/internal/assistant/sessions/route.tsSession management

Components (src/components/assistant/)

ComponentDescription
assistant-chat.tsxMain chat interface
assistant-panel.tsxAssistant panel
image-preview.tsxImage preview
chat-bubble.tsxMessage bubble

Hooks (src/hooks/)

HookDescription
use-assistant-chat.tsSSE event handling
use-image-upload.tsImage upload
sse-event-reducer.tsSSE stream parsing

Core Library

FileDescription
lib/assistant-sessions.tsSession management
lib/assistant-message-converter.tsMessage format conversion
lib/claude-session.tsClaude API session
lib/build-multimodal-prompt.tsMultimodal prompt construction