How 777genius/agent-teams-ai works
1. System shape
- This is a monorepo centered on a desktop Electron app for orchestrating AI agent teams.
- The repo also contains a separate MCP server, a landing/docs site, a shared visualization package, and a few helper/controller packages.
2. Primary runtime boundary: Electron
- The main app is split into the standard Electron layers:
- src/main: privileged process for file system, process launching, HTTP, IPC, persistence, and provider/runtime orchestration.
- src/preload: narrow bridge layer that exposes selected APIs to the UI.
- src/renderer: React UI, state management, and user workflows.
- This boundary is important because the renderer never talks directly to local files, runtimes, or OS processes.
3. Feature-based modular architecture
- src/features/* follows a consistent feature pattern with contracts, core, main, preload, and renderer folders.
- The core layer holds domain/application logic; main binds to local infrastructure; preload exposes a safe bridge; renderer renders UI and invokes the feature through typed contracts.
- Notable feature modules include agent attachments, agent graph, Codex account/model/runtime handling, member log streaming, member work sync, recent projects, runtime provider management, team runtime lanes, and tmux installation.
4. Team orchestration is the heart of the app
- Most of the business logic in src/main/services/team manages:
- team creation and provisioning
- member lifecycle and worktrees
- task boards, task changes, comments, and inbox messages
- cross-team messaging and handoffs
- review workflows and approval flows
- live process tracking and task log aggregation
- This layer is the main coordination engine that ties provider runtimes, local project state, and UI together.
5. Provider/runtime integration is local and adapter-driven
- The app auto-detects and manages multiple agent runtimes/providers: Claude, Codex, and OpenCode.
- Runtime integration is handled by services and adapters such as:
- provider connection / readiness / auth helpers
- CLI environment and launch configuration builders
- Codex app-server clients and model catalog queries
- OpenCode bridge, delivery watchdog, and state-managing adapters
- The architecture assumes providers are accessed through local CLI/app-server/runtime channels, not through a centralized backend.
6. Persistent state is file-backed and local-first
- The app reads local Claude/runtime/session data under ~/.claude/ and project-owned state under the selected workspace.
- Persistence uses JSON stores, journals, caches, atomic writes, and file locks rather than a database server.
- Team/task state, task-change ledgers, inboxes, runtime manifests, and review decisions are stored on disk, with helpers for recovery and tamper-safe updates.
7. Data discovery and analysis pipeline
- src/main/services/discovery, parsing, and analysis turn raw local artifacts into searchable project/session/task data.
- This includes project scanning, session indexing/search, transcript parsing, tool-result extraction, semantic grouping, and task/session linking.
- Worker processes in src/main/workers are used for heavier or more isolated work such as task-change and team-data processing.
8. Task logs, review, and diff views form a dedicated subsystem
- The repo has a rich pipeline for task-specific logs:
- exact logs
- streaming logs
- historical/fallback transcript sources
- log attribution and candidate selection
- activity summaries and preview extraction
- Review is a first-class flow: the UI can show per-task diffs and supports accept/reject/comment-style actions, with main-process services computing change sets and review decisions.
9. UI is a large React shell over store slices
- src/renderer is organized into feature-heavy UI components, Zustand store slices, and many hooks.
- Major visible areas include:
- dashboard and recent projects
- team list/detail views
- kanban board and task detail
- session/chat history and execution logs
- review/diff views
- editor, settings, extensions, notifications, schedules, and terminal panes
- The renderer consumes data from IPC/HTTP bridges and focuses on presentation, navigation, and user actions.
10. Visualization is separated into a reusable graph package
- packages/agent-graph is a standalone visualization engine for rendering team/task/process graphs.
- It has its own layout, canvas rendering, interaction hooks, and data/event ports.
- The app reuses this for team graph-like UI surfaces, keeping graph rendering concerns isolated from the main React screens.
11. IPC and local HTTP are the main integration surfaces
- src/main/ipc exposes most app capabilities to the renderer through typed channel handlers.
- src/main/http provides local HTTP endpoints for certain integrations and external access patterns.
- Security boundaries are explicit: IDs, paths, and payload shapes are validated at the boundary, and write operations are constrained to the selected project root.
12. MCP/server integration is a separate tool-facing boundary
- mcp-server exposes the controller functionality as MCP tools over stdio, with tool groups for teams, tasks, runtime, review, messages, work sync, kanban, process, and cross-team operations.
- This makes the app’s orchestration layer available to external agents/tools without coupling them to the Electron UI.
13. Landing/docs are intentionally decoupled
- landing/ is a separate Nuxt-based marketing/documentation site with i18n, SEO routes, downloads, and release content.
- It is not part of the runtime orchestration path; it supports distribution and product discovery.
14. Build and release shape the deployment model
- The repo uses a workspace setup with Electron/Vite for the app, Vitest for tests, and CI/release workflows for packaging.
- Distribution targets desktop installers and AppImage/deb/rpm/pacman artifacts, reinforcing that the primary runtime is a locally installed desktop application.
Main entry points: main Main process · team Team engine · renderer Renderer shell · runtime Runtime adapters
Components 21
Monorepo
Desktop app, controller surface, shared packages, and docs site.
- Shared core · Common contracts, constants, and utilities used across runtimes.
src/shared
Electron App
Local-first desktop runtime and UI boundary.
- Main process · Privileged process handling IPC, HTTP, local filesystem, persistence, and orchestration.
src/main - Preload bridge · Narrow bridge exposing selected APIs from main to the renderer.
src/preload - Renderer shell · React application for dashboards, teams, tasks, review, and settings.
src/renderer - IPC and HTTP · Typed renderer-facing IPC handlers and local HTTP endpoints.
src/main/ipc
Feature Modules
Typed, layered features shared across main, preload, and renderer.
- Feature modules · Feature packages with contracts, core, main, preload, and renderer boundaries.
src/features
Main Services
Core orchestration, discovery, parsing, runtime, and persistence services.
- Team engine · Main coordination engine for team creation, members, tasks, inbox, reviews, and live process tracking.
src/main/services/team - Runtime adapters · Local adapter layer for Claude, Codex, and OpenCode readiness, launch, and environment setup.
src/main/services/runtime - Discovery pipeline · Scans local artifacts and turns them into searchable project, session, and task data.
src/main/services/discovery - Task log pipeline · Exact, streaming, and historical task log sourcing plus attribution and diff/review support.
src/main/services/team/taskLogs - Local persistence · JSON stores, journals, caches, locks, and atomic writes on disk.
src/main/services/infrastructure
External Surfaces
MCP tools, reusable graph package, and landing/docs site.
- Graph package · Reusable canvas/layout/interaction engine for team and task graph surfaces.
packages/agent-graph - MCP server · StdIO MCP tool boundary exposing team, task, runtime, review, and work-sync operations.
mcp-server - Controller pkg · Shared controller logic and internal stores used by the MCP server.
agent-teams-controller - Landing/docs · Decoupled marketing and documentation site with product docs and release content.
landing
Subsystem Features
Architecturally central feature packages with their own contracts and runtime bridges.
- Recent projects · Dashboard subsystem for discovering, merging, and opening recent projects.
src/features/recent-projects - Runtime manager · UI and IPC for provider/runtime management and model selection.
src/features/runtime-provider-management - Log streaming · Member log previews and streams across Claude, Codex, and OpenCode.
src/features/member-log-stream - Work sync · Turn-settled ingestion, nudging, and reconciliation for member work state.
src/features/member-work-sync - Tmux installer · Cross-platform tmux detection and installation flow with runtime adapters.
src/features/tmux-installer - Attachments · Agent-facing attachment handling and optimization across providers.
src/features/agent-attachments
Connections 26
- Renderer shell → Preload bridge: safe API access · Renderer invokes only exposed bridges, not OS or filesystem APIs.
- Preload bridge → Main process: IPC bridge · Preload forwards typed calls into privileged handlers.
- Renderer shell → IPC and HTTP: UI requests · Renderer uses IPC and local HTTP through typed clients.
- IPC and HTTP → Main process: dispatches · IPC and HTTP route requests into main-process services.
- Main process → Team engine: orchestrates · Main process delegates team lifecycle, messaging, review, and task operations.
- Main process → Runtime adapters: adapts providers · Main process manages provider readiness, auth, and launch configuration.
- Main process → Discovery pipeline: indexes data · Main process scans and analyzes local artifacts into searchable state.
- Main process → Task log pipeline: builds logs · Main process assembles exact and streaming task log views.
- Main process → Local persistence: persists state · Main process writes file-backed stores, journals, and caches.
- Team engine → Runtime adapters: uses runtimes · Team orchestration launches and supervises agent runtimes.
- Team engine → Task log pipeline: feeds review · Team orchestration relies on task log extraction for summaries and diffs.
- Team engine → Local persistence: stores ledgers · Team, inbox, review, and launch state are kept on disk.
- Discovery pipeline → Local persistence: indexes cache · Discovery uses local caches and indices for session and project search.
- Runtime adapters → Shared core: uses contracts · Provider integration shares common types, utilities, and constants.
- Feature modules → Main process: binds main · Feature packages attach main-process infrastructure and IPC handlers.
- Feature modules → Preload bridge: exposes bridge · Feature packages publish narrow preload bridges.
- Feature modules → Renderer shell: renders UI · Feature packages provide renderer hooks and views.
- Recent projects → Renderer shell: dashboard surface · Recent-projects data powers the dashboard and project launcher.
- Runtime manager → Runtime adapters: controls providers · Runtime management reflects and configures provider state.
- Log streaming → Task log pipeline: streams output · Log-stream feature consumes transcript and trace sources.
- Work sync → Team engine: syncs work · Work-sync feature feeds team state and inbox/reconciliation flows.
- Tmux installer → Runtime adapters: checks tools · Tmux installation integrates with runtime and platform readiness.
- Attachments → Team engine: supports work · Attachment handling feeds team and task workflows.
- Graph package → Renderer shell: shared viz · Reusable graph rendering is embedded in the React shell.
- MCP server → Controller pkg: wraps · MCP tools are backed by the controller library.
- MCP server → Team engine: tool access · MCP exposes team orchestration outside the Electron UI.