# zotoio/zoto-agents architecture

> Architecture diagram of the GitHub repository zotoio/zoto-agents, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zotoio/zoto-agents
- Repository: https://github.com/zotoio/zoto-agents

## Overview

zoto-agents is a monorepo of three independent, composable Cursor plugins. The principal workflows are spec planning and verified execution, eval generation and comparison, and live discovery and display of Cursor agents. The graph preserves all three documented product branches; implementation detail is strongest for cursor-top discovery/UI and the shared LLM eval harness. Some eval and spec capabilities are included from the README, so their internal wiring is intentionally not inferred.

Main entry points: [`plugins/zoto-eval-system`](https://github.com/zotoio/zoto-agents/tree/main/plugins/zoto-eval-system) (Eval workflow), [`plugins/zoto-cursor-top/src/discovery/collector.ts`](https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/discovery/collector.ts) (Agent collector), [`plugins/zoto-cursor-top/src/cli.ts`](https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/cli.ts) (cursor-top CLI), [`evals/llm/_shared/run-llm-suite.ts`](https://github.com/zotoio/zoto-agents/blob/main/evals/llm/_shared/run-llm-suite.ts) (LLM suite runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_spec["Spec planning"]
  node_spec_workflow["Spec workflow"]
  node_spec_aggregator["Spec aggregation<br/>[aggregator.ts]"]
  node_spec_hooks["Session hooks"]
end

subgraph group_eval["Eval lifecycle"]
  node_eval_workflow["Eval workflow"]
  node_eval_analyser["Eval analysis<br/>[eval-analyse.ts]"]
  node_eval_stamper["Eval stamping<br/>[eval-stamp.ts]"]
  node_eval_engine["Eval engine"]
  node_eval_update["Eval updates<br/>[update.ts]"]
  node_eval_sandbox["Eval sandbox<br/>[sandbox.ts]"]
  node_eval_results["Run comparison"]
end

subgraph group_top["Agent monitoring"]
  node_top_cli["cursor-top CLI<br/>[cli.ts]"]
  node_collector["Agent collector<br/>[collector.ts]"]
  node_discovery["Local discovery"]
  node_session_parser["Session parsing<br/>[sessions.ts]"]
  node_cloud_api["Cloud API<br/>[cloud-api.ts]"]
  node_usage_events["Usage events<br/>[usage-events.ts]"]
  node_agent_tree["Agent snapshot<br/>[types.ts]"]
  node_filter["Snapshot filter<br/>[filter.ts]"]
  node_preferences["Display preferences<br/>[prefs.ts]"]
  node_tui["Live terminal UI<br/>[App.tsx]"]
  node_formatting["Tree formatting<br/>[format.ts]"]
end

subgraph group_evalh["LLM eval runtime"]
  node_llm_suite["LLM suite runner<br/>[run-llm-suite.ts]"]
  node_llm_case["Case definitions<br/>[llm-case.ts]"]
  node_sdk_bridge["Agent SDK bridge<br/>[sdk-bridge.ts]"]
  node_graders["LLM graders"]
  node_llm_reporter["LLM reporter"]
  node_eval_artifacts["Eval results"]
end

node_user(("Plugin user"))
node_eval_actor(("Eval runner"))
node_top_user(("Terminal user"))

node_user -->|"plans specs"| node_spec_workflow
node_spec_workflow -->|"aggregates specs"| node_spec_aggregator
node_spec_workflow -->|"verifies execution"| node_spec_hooks
node_user -->|"generates evals"| node_eval_workflow
node_eval_workflow -->|"analyzes primitives"| node_eval_analyser
node_eval_workflow -->|"stamps suites"| node_eval_stamper
node_eval_workflow -->|"runs suites"| node_eval_engine
node_eval_workflow -->|"updates evals"| node_eval_update
node_eval_engine -.->|"isolates runs"| node_eval_sandbox
node_eval_workflow -->|"compares runs"| node_eval_results
node_eval_actor -->|"starts suite"| node_llm_suite
node_llm_suite -->|"evaluates cases"| node_llm_case
node_llm_suite -->|"calls agent"| node_sdk_bridge
node_llm_suite -->|"dispatches grading"| node_graders
node_llm_suite -->|"reports results"| node_llm_reporter
node_llm_reporter -->|"writes reports"| node_eval_artifacts
node_top_user -->|"runs CLI"| node_top_cli
node_top_cli -->|"collects agents"| node_collector
node_collector -->|"discovers processes"| node_discovery
node_collector -->|"reads sessions"| node_session_parser
node_collector -->|"queries cloud"| node_cloud_api
node_collector -->|"fetches usage"| node_usage_events
node_collector -->|"builds snapshot"| node_agent_tree
node_top_cli -->|"filters snapshot"| node_filter
node_top_cli -->|"loads preferences"| node_preferences
node_top_cli -.->|"opens display"| node_tui
node_tui -->|"filters snapshot"| node_filter
node_tui -->|"saves preferences"| node_preferences
node_tui -.->|"formats display"| node_formatting

click node_spec_workflow "https://github.com/zotoio/zoto-agents/tree/main/plugins/zoto-spec-system"
click node_spec_aggregator "https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-spec-system/src/aggregator.ts"
click node_spec_hooks "https://github.com/zotoio/zoto-agents/tree/main/plugins/zoto-spec-system/hooks"
click node_eval_workflow "https://github.com/zotoio/zoto-agents/tree/main/plugins/zoto-eval-system"
click node_eval_analyser "https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-eval-system/scripts/eval-analyse.ts"
click node_eval_stamper "https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-eval-system/scripts/eval-stamp.ts"
click node_eval_engine "https://github.com/zotoio/zoto-agents/tree/main/plugins/zoto-eval-system/engine"
click node_eval_update "https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-eval-system/engine/update.ts"
click node_eval_sandbox "https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-eval-system/engine/sandbox.ts"
click node_eval_results "https://github.com/zotoio/zoto-agents/tree/main/plugins/zoto-eval-system/engine"
click node_llm_suite "https://github.com/zotoio/zoto-agents/blob/main/evals/llm/_shared/run-llm-suite.ts"
click node_llm_case "https://github.com/zotoio/zoto-agents/blob/main/evals/llm/_shared/llm-case.ts"
click node_sdk_bridge "https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-eval-system/engine/sdk-bridge.ts"
click node_graders "https://github.com/zotoio/zoto-agents/tree/main/plugins/zoto-eval-system/engine/graders"
click node_llm_reporter "https://github.com/zotoio/zoto-agents/blob/main/evals/llm/_shared/zoto-llm-reporter.ts"
click node_eval_artifacts "https://github.com/zotoio/zoto-agents/tree/main/evals"
click node_top_cli "https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/cli.ts"
click node_collector "https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/discovery/collector.ts"
click node_discovery "https://github.com/zotoio/zoto-agents/tree/main/plugins/zoto-cursor-top/src/discovery"
click node_session_parser "https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/discovery/sessions.ts"
click node_cloud_api "https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/discovery/cloud-api.ts"
click node_usage_events "https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/discovery/usage-events.ts"
click node_agent_tree "https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/types.ts"
click node_filter "https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/filter.ts"
click node_preferences "https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/prefs.ts"
click node_tui "https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/ui/App.tsx"
click node_formatting "https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/ui/format.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_spec_workflow,node_spec_aggregator,node_spec_hooks,node_user,node_top_user toneBlue
class node_eval_workflow,node_eval_analyser,node_eval_stamper,node_eval_engine,node_eval_update,node_eval_sandbox,node_eval_results toneAmber
class node_top_cli,node_collector,node_discovery,node_session_parser,node_cloud_api,node_usage_events,node_agent_tree,node_filter,node_preferences,node_tui,node_formatting toneMint
class node_llm_suite,node_llm_case,node_sdk_bridge,node_graders,node_llm_reporter,node_eval_artifacts toneRose
class node_eval_actor toneIndigo
```

## Components

### Spec planning

- [Spec workflow](https://github.com/zotoio/zoto-agents/tree/main/plugins/zoto-spec-system): `plugins/zoto-spec-system`
- [Spec aggregation](https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-spec-system/src/aggregator.ts): `plugins/zoto-spec-system/src/aggregator.ts`
- [Session hooks](https://github.com/zotoio/zoto-agents/tree/main/plugins/zoto-spec-system/hooks): `plugins/zoto-spec-system/hooks`

### Eval lifecycle

- [Eval workflow](https://github.com/zotoio/zoto-agents/tree/main/plugins/zoto-eval-system): `plugins/zoto-eval-system`
- [Eval analysis](https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-eval-system/scripts/eval-analyse.ts): `plugins/zoto-eval-system/scripts/eval-analyse.ts`
- [Eval stamping](https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-eval-system/scripts/eval-stamp.ts): `plugins/zoto-eval-system/scripts/eval-stamp.ts`
- [Eval engine](https://github.com/zotoio/zoto-agents/tree/main/plugins/zoto-eval-system/engine): `plugins/zoto-eval-system/engine`
- [Eval updates](https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-eval-system/engine/update.ts): `plugins/zoto-eval-system/engine/update.ts`
- [Eval sandbox](https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-eval-system/engine/sandbox.ts): `plugins/zoto-eval-system/engine/sandbox.ts`
- [Run comparison](https://github.com/zotoio/zoto-agents/tree/main/plugins/zoto-eval-system/engine): `plugins/zoto-eval-system/engine`

### Agent monitoring

- [cursor-top CLI](https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/cli.ts): `plugins/zoto-cursor-top/src/cli.ts`
- [Agent collector](https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/discovery/collector.ts): `plugins/zoto-cursor-top/src/discovery/collector.ts`
- [Local discovery](https://github.com/zotoio/zoto-agents/tree/main/plugins/zoto-cursor-top/src/discovery): `plugins/zoto-cursor-top/src/discovery`
- [Session parsing](https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/discovery/sessions.ts): `plugins/zoto-cursor-top/src/discovery/sessions.ts`
- [Cloud API](https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/discovery/cloud-api.ts): `plugins/zoto-cursor-top/src/discovery/cloud-api.ts`
- [Usage events](https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/discovery/usage-events.ts): `plugins/zoto-cursor-top/src/discovery/usage-events.ts`
- [Agent snapshot](https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/types.ts): `plugins/zoto-cursor-top/src/types.ts`
- [Snapshot filter](https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/filter.ts): `plugins/zoto-cursor-top/src/filter.ts`
- [Display preferences](https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/prefs.ts): `plugins/zoto-cursor-top/src/prefs.ts`
- [Live terminal UI](https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/ui/App.tsx): `plugins/zoto-cursor-top/src/ui/App.tsx`
- [Tree formatting](https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-cursor-top/src/ui/format.ts): `plugins/zoto-cursor-top/src/ui/format.ts`

### LLM eval runtime

- [LLM suite runner](https://github.com/zotoio/zoto-agents/blob/main/evals/llm/_shared/run-llm-suite.ts): `evals/llm/_shared/run-llm-suite.ts`
- [Case definitions](https://github.com/zotoio/zoto-agents/blob/main/evals/llm/_shared/llm-case.ts): `evals/llm/_shared/llm-case.ts`
- [Agent SDK bridge](https://github.com/zotoio/zoto-agents/blob/main/plugins/zoto-eval-system/engine/sdk-bridge.ts): `plugins/zoto-eval-system/engine/sdk-bridge.ts`
- [LLM graders](https://github.com/zotoio/zoto-agents/tree/main/plugins/zoto-eval-system/engine/graders): `plugins/zoto-eval-system/engine/graders`
- [LLM reporter](https://github.com/zotoio/zoto-agents/blob/main/evals/llm/_shared/zoto-llm-reporter.ts): `evals/llm/_shared/zoto-llm-reporter.ts`
- [Eval results](https://github.com/zotoio/zoto-agents/tree/main/evals): `evals`

### Other components

- **Plugin user**
- **Eval runner**
- **Terminal user**

## Connections

- Plugin user → Spec workflow: plans specs
- Spec workflow → Spec aggregation: aggregates specs (evidence: `plugins/zoto-spec-system/src/aggregator.ts`)
- Spec workflow → Session hooks: verifies execution
- Plugin user → Eval workflow: generates evals
- Eval workflow → Eval analysis: analyzes primitives
- Eval workflow → Eval stamping: stamps suites
- Eval workflow → Eval engine: runs suites (evidence: `plugins/zoto-eval-system/engine/graders/llm-judge.ts`)
- Eval workflow → Eval updates: updates evals
- Eval engine → Eval sandbox: isolates runs
- Eval workflow → Run comparison: compares runs (evidence: `plugins/zoto-eval-system/engine/graders/llm-judge.ts`)
- Eval runner → LLM suite runner: starts suite (evidence: `evals/llm/_shared/run-llm-suite.ts`)
- LLM suite runner → Case definitions: evaluates cases (evidence: `evals/llm/_shared/run-llm-suite.ts`)
- LLM suite runner → Agent SDK bridge: calls agent (evidence: `evals/llm/_shared/run-llm-suite.ts`)
- LLM suite runner → LLM graders: dispatches grading (evidence: `evals/llm/_shared/run-llm-suite.ts`)
- LLM suite runner → LLM reporter: reports results (evidence: `evals/llm/_shared/run-llm-suite.ts`)
- LLM reporter → Eval results: writes reports (evidence: `evals/llm/_shared/zoto-llm-reporter.ts`)
- Terminal user → cursor-top CLI: runs CLI
- cursor-top CLI → Agent collector: collects agents (evidence: `plugins/zoto-cursor-top/src/cli.ts`)
- Agent collector → Local discovery: discovers processes (evidence: `plugins/zoto-cursor-top/src/discovery/collector.ts`)
- Agent collector → Session parsing: reads sessions (evidence: `plugins/zoto-cursor-top/src/discovery/collector.ts`)
- Agent collector → Cloud API: queries cloud (evidence: `plugins/zoto-cursor-top/src/discovery/collector.ts`)
- Agent collector → Usage events: fetches usage (evidence: `plugins/zoto-cursor-top/src/discovery/collector.ts`)
- Agent collector → Agent snapshot: builds snapshot (evidence: `plugins/zoto-cursor-top/src/discovery/collector.ts`)
- cursor-top CLI → Snapshot filter: filters snapshot (evidence: `plugins/zoto-cursor-top/src/cli.ts`)
- cursor-top CLI → Display preferences: loads preferences (evidence: `plugins/zoto-cursor-top/src/cli.ts`)
- cursor-top CLI → Live terminal UI: opens display
- Live terminal UI → Snapshot filter: filters snapshot (evidence: `plugins/zoto-cursor-top/src/ui/App.tsx`)
- Live terminal UI → Display preferences: saves preferences (evidence: `plugins/zoto-cursor-top/src/ui/App.tsx`)
- Live terminal UI → Tree formatting: formats display (evidence: `plugins/zoto-cursor-top/src/ui/App.tsx`)
