Moved from plit-gw#69.
Overview
Implement plit tui — a terminal UI for chatting with Pipelit agents. Talks to Pipelit API directly (not through gateway).
Commands
plit tui # Interactive agent/workflow selection
plit tui --agent <slug> # Direct agent selection
plit tui --agent <slug> --chat-id <id> # Resume existing chat session
Architecture
TUI connects directly to Pipelit API (same as web frontend did). Gateway is not involved — it handles external adapter traffic only.
plit auth login --url http://localhost:8000 → authenticates against Pipelit
plit tui → connects to Pipelit at stored URL
REST: POST /api/v1/workflows/{slug}/chat/
WS: /ws/?token=... (real-time events)
Features
- Interactive agent/workflow selection (list available triggers)
- Real-time streaming via Pipelit WebSocket (
/ws/?token= and /ws/executions/{execution_id}/)
- Chat history (load from LangGraph checkpoints)
- Activity indicator (node execution progress, tool calls)
- Markdown rendering for assistant messages
- Session management (list, resume, delete sessions)
Pipelit endpoints used
Chat (restored in #154):
POST /api/v1/workflows/{slug}/chat/ — send message, start execution
GET /api/v1/workflows/{slug}/chat/history — load history from checkpoints
DELETE /api/v1/workflows/{slug}/chat/history — clear history
Already exist:
GET /api/v1/workflows/ — list workflows/agents
GET /api/v1/workflows/{slug}/ — get workflow detail + nodes
POST /api/v1/auth/token/ — login
- WebSocket
/ws/?token= — real-time events (chat_message, node_status, execution_completed)
- WebSocket
/ws/executions/{execution_id}/ — per-execution streaming
Pipelit infrastructure still in place
trigger_chat component (registered, functional)
Conversation model (DB table)
ChatMessageIn / ChatMessageOut schemas
- LangGraph checkpoint storage for conversation memory
- Thread ID format:
{user_id}:{workflow_id}
TUI Library
ratatui + crossterm
Dependencies
- plit-gw#63 (
plit auth login) — must be logged in
- Pipelit chat endpoints (restored in #154, verify in v0.3.9)
Moved from plit-gw#69.
Overview
Implement
plit tui— a terminal UI for chatting with Pipelit agents. Talks to Pipelit API directly (not through gateway).Commands
Architecture
TUI connects directly to Pipelit API (same as web frontend did). Gateway is not involved — it handles external adapter traffic only.
Features
/ws/?token=and/ws/executions/{execution_id}/)Pipelit endpoints used
Chat (restored in #154):
POST /api/v1/workflows/{slug}/chat/— send message, start executionGET /api/v1/workflows/{slug}/chat/history— load history from checkpointsDELETE /api/v1/workflows/{slug}/chat/history— clear historyAlready exist:
GET /api/v1/workflows/— list workflows/agentsGET /api/v1/workflows/{slug}/— get workflow detail + nodesPOST /api/v1/auth/token/— login/ws/?token=— real-time events (chat_message, node_status, execution_completed)/ws/executions/{execution_id}/— per-execution streamingPipelit infrastructure still in place
trigger_chatcomponent (registered, functional)Conversationmodel (DB table)ChatMessageIn/ChatMessageOutschemas{user_id}:{workflow_id}TUI Library
ratatui + crossterm
Dependencies
plit auth login) — must be logged in