How liuqihonggit/joincode works
JoinCode is an AI coding agent with CLI, full-screen TUI, and GUI entry points. The central workflow accepts a prompt, runs an agent query against an LLM, executes tools as needed, then streams results to the user. The README also documents session management, MCP tool discovery, browser and web capabilities, multi-agent work, and adversarial reasoning. The graph combines documented capabilities with sampled implementations; paths for unsampled subsystems use existing enclosing directories, and uncertain internal call wiring is omitted.
Main entry points: QueryEngine.cs Agent query engine · runners CLI runners · JccChatSession.cs GUI chat session · QueryServices LLM client
Components 23
User interfaces
- CLI runners
app/cli/entry/runners - Terminal UI
app/tui/core/tui - Desktop UI
app/gui/views/core - CLI presentation
app/cli/adapters - TUI interaction
app/tui/interaction - GUI chat session
app/gui/hosting/JccChatSession.cs
Agent runtime
- Application builder
app/cli/app/builder/ApplicationBuilder.cs - Engine session factory
app/cli/app/builder/EngineSessionFactory.cs - Agent query engine
kit/brain/query/query2/token_budget/core/QueryEngine.cs - Goal and agents
app/gui/view_models/a_to_c/BackgroundAgentsPanelViewModel.cs - Adversarial reasoning
kit/brain/query
LLM integration
- LLM client
llm/core/Adapters/LLM/QueryServices - OpenAI-compatible API
- Anthropic API
Tools and integrations
- Built-in tools
app/cli/app/modules - MCP tool search
kit/mcp/skill/ToolSearchEngine.cs - MCP client and server
app/cli/core/commands/core - Browser automation
app/cli/app/modules/BrowserModule.cs - Web requests
app/cli/app/modules
Sessions and state
- Session management
app/cli/core/services/CliSession.cs - GUI session store
app/gui/persistence/GuiSessionStore.cs - Pipe code sessions
app/cli/pipe/code_session/CodeSessionManager.cs
Other components
- User or script
Connections 23
- User or script → CLI runners: submits prompt
- User or script → Terminal UI: submits prompt
- User or script → Desktop UI: submits prompt
- CLI runners → Application builder: starts runtime
- Application builder → Engine session factory: builds session
- Engine session factory → Agent query engine: provides chat service
- CLI runners → CLI presentation: presents output
- Terminal UI → TUI interaction: handles interaction
- Desktop UI → GUI chat session: uses chat session
- GUI chat session → Engine session factory: creates engine session
- Agent query engine → LLM client: queries model
- LLM client → OpenAI-compatible API: sends protocol requests
- LLM client → Anthropic API: sends protocol requests
- Agent query engine → Built-in tools: dispatches tools
- Agent query engine → MCP tool search: searches deferred tools
- Agent query engine → Browser automation: invokes browser tools
- Agent query engine → Web requests: invokes web tools
- Agent query engine → MCP client and server: uses MCP tools
- CLI runners → Session management: resumes sessions
- GUI chat session → GUI session store: persists sessions
- CLI runners → Pipe code sessions: serves code sessions
- Agent query engine → Goal and agents: supports agent tasks
- Agent query engine → Adversarial reasoning: supports reasoning modes