# cocofhu/anime-find architecture

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

- Interactive diagram: https://gitdiagram.com/cocofhu/anime-find
- Repository: https://github.com/cocofhu/anime-find

## Overview

anime-find is a DeepSeek Harness plugin for conversational anime search, resource browsing, and optional rule-based streaming. The main path is an Agent search request through the plugin host to parallel source searches, enrichment, and paginated cards rendered in the conversation; selecting a card loads grouped download resources and Bangumi details. Settings control sources and stream rules, while separate settings actions check and apply releases. The graph also includes the documented streaming playback path. Some client and host internals were not excerpted, so those links rely on README statements rather than claims about unseen calls.

Main entry points: [`src/host.ts`](https://github.com/cocofhu/anime-find/blob/main/src/host.ts) (Plugin Host), [`src/search.ts`](https://github.com/cocofhu/anime-find/blob/main/src/search.ts) (Search Orchestrator), [`src/client.js`](https://github.com/cocofhu/anime-find/blob/main/src/client.js) (Conversation Cards), [`src/config-store.ts`](https://github.com/cocofhu/anime-find/blob/main/src/config-store.ts) (Config Store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["Plugin Interface"]
  node_host["Plugin Host<br/>[host.ts]"]
  node_conversation["Conversation Cards<br/>[client.js]"]
end

subgraph group_discovery["Anime Discovery"]
  node_search["Search Orchestrator<br/>[search.ts]"]
  node_season["Season Resolver<br/>[season.ts]"]
  node_text["Search Text<br/>[search-text.ts]"]
  node_normalize["Result Normalization<br/>[normalize.ts]"]
  node_release["Release Parsing<br/>[release.ts]"]
  node_mikan["Mikan Source<br/>[mikan.ts]"]
  node_anibt["AniBT Source<br/>[anibt.ts]"]
  node_garden["AnimeGarden Source<br/>[garden.ts]"]
  node_http["HTTP Utilities<br/>[http.ts]"]
end

subgraph group_resources["Details and Playback"]
  node_bangumi["Bangumi Enrichment<br/>[bangumi.ts]"]
  node_detail["Resource Details<br/>[search.ts]"]
  node_streaming["Stream Resolver<br/>[streaming.ts]"]
  node_player["Stream Player<br/>[client.js]"]
end

subgraph group_operations["Settings and Updates"]
  node_settings["Plugin Settings<br/>[client.js]"]
  node_config["Config Store<br/>[config-store.ts]"]
  node_update_check["Release Check<br/>[update-check.ts]"]
  node_apply_update["Apply Update<br/>[apply-update.ts]"]
end

node_agent(("Harness Agent"))
node_media(("Media Sites"))
node_settings_service(("Harness Settings"))
node_github[("GitHub Releases")]

node_agent -->|"invokes search"| node_host
node_host -->|"runs search"| node_search
node_host -->|"returns cards"| node_conversation
node_conversation -->|"requests details"| node_host
node_search -->|"resolves season"| node_season
node_search -->|"searches source"| node_mikan
node_search -->|"searches source"| node_anibt
node_search -->|"searches source"| node_garden
node_search -->|"enriches cards"| node_bangumi
node_search -->|"normalizes results"| node_normalize
node_search -->|"parses releases"| node_release
node_mikan -->|"fetches pages"| node_http
node_anibt -->|"fetches API"| node_http
node_garden -->|"fetches API"| node_http
node_host -->|"loads resources"| node_detail
node_detail -->|"loads metadata"| node_bangumi
node_conversation -->|"selects episode"| node_player
node_host -->|"proxies media"| node_streaming
node_streaming -->|"resolves playback"| node_media
node_player -->|"requests playback"| node_host
node_settings -->|"updates rules"| node_config
node_host -->|"reads config"| node_config
node_config -->|"persists settings"| node_settings_service
node_host -->|"checks release"| node_update_check
node_update_check -->|"checks latest"| node_github
node_host -->|"applies update"| node_apply_update
node_apply_update -->|"uses metadata"| node_update_check

click node_host "https://github.com/cocofhu/anime-find/blob/main/src/host.ts"
click node_conversation "https://github.com/cocofhu/anime-find/blob/main/src/client.js"
click node_settings "https://github.com/cocofhu/anime-find/blob/main/src/client.js"
click node_config "https://github.com/cocofhu/anime-find/blob/main/src/config-store.ts"
click node_search "https://github.com/cocofhu/anime-find/blob/main/src/search.ts"
click node_season "https://github.com/cocofhu/anime-find/blob/main/src/season.ts"
click node_text "https://github.com/cocofhu/anime-find/blob/main/src/search-text.ts"
click node_normalize "https://github.com/cocofhu/anime-find/blob/main/src/normalize.ts"
click node_release "https://github.com/cocofhu/anime-find/blob/main/src/release.ts"
click node_mikan "https://github.com/cocofhu/anime-find/blob/main/src/sources/mikan.ts"
click node_anibt "https://github.com/cocofhu/anime-find/blob/main/src/sources/anibt.ts"
click node_garden "https://github.com/cocofhu/anime-find/blob/main/src/sources/garden.ts"
click node_http "https://github.com/cocofhu/anime-find/blob/main/src/http.ts"
click node_bangumi "https://github.com/cocofhu/anime-find/blob/main/src/bangumi.ts"
click node_detail "https://github.com/cocofhu/anime-find/blob/main/src/search.ts"
click node_streaming "https://github.com/cocofhu/anime-find/blob/main/src/streaming.ts"
click node_player "https://github.com/cocofhu/anime-find/blob/main/src/client.js"
click node_update_check "https://github.com/cocofhu/anime-find/blob/main/src/update-check.ts"
click node_apply_update "https://github.com/cocofhu/anime-find/blob/main/src/apply-update.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_host,node_conversation toneBlue
class node_search,node_season,node_text,node_normalize,node_release,node_mikan,node_anibt,node_garden,node_http,node_github toneAmber
class node_bangumi,node_detail,node_streaming,node_player toneMint
class node_settings,node_config,node_update_check,node_apply_update toneRose
class node_agent,node_media,node_settings_service toneIndigo
```

## Components

### Plugin Interface

- [Plugin Host](https://github.com/cocofhu/anime-find/blob/main/src/host.ts): `src/host.ts`
- [Conversation Cards](https://github.com/cocofhu/anime-find/blob/main/src/client.js): `src/client.js`

### Anime Discovery

- [Search Orchestrator](https://github.com/cocofhu/anime-find/blob/main/src/search.ts): `src/search.ts`
- [Season Resolver](https://github.com/cocofhu/anime-find/blob/main/src/season.ts): `src/season.ts`
- [Search Text](https://github.com/cocofhu/anime-find/blob/main/src/search-text.ts): `src/search-text.ts`
- [Result Normalization](https://github.com/cocofhu/anime-find/blob/main/src/normalize.ts): `src/normalize.ts`
- [Release Parsing](https://github.com/cocofhu/anime-find/blob/main/src/release.ts): `src/release.ts`
- [Mikan Source](https://github.com/cocofhu/anime-find/blob/main/src/sources/mikan.ts): `src/sources/mikan.ts`
- [AniBT Source](https://github.com/cocofhu/anime-find/blob/main/src/sources/anibt.ts): `src/sources/anibt.ts`
- [AnimeGarden Source](https://github.com/cocofhu/anime-find/blob/main/src/sources/garden.ts): `src/sources/garden.ts`
- [HTTP Utilities](https://github.com/cocofhu/anime-find/blob/main/src/http.ts): `src/http.ts`

### Details and Playback

- [Bangumi Enrichment](https://github.com/cocofhu/anime-find/blob/main/src/bangumi.ts): `src/bangumi.ts`
- [Resource Details](https://github.com/cocofhu/anime-find/blob/main/src/search.ts): `src/search.ts`
- [Stream Resolver](https://github.com/cocofhu/anime-find/blob/main/src/streaming.ts): `src/streaming.ts`
- [Stream Player](https://github.com/cocofhu/anime-find/blob/main/src/client.js): `src/client.js`

### Settings and Updates

- [Plugin Settings](https://github.com/cocofhu/anime-find/blob/main/src/client.js): `src/client.js`
- [Config Store](https://github.com/cocofhu/anime-find/blob/main/src/config-store.ts): `src/config-store.ts`
- [Release Check](https://github.com/cocofhu/anime-find/blob/main/src/update-check.ts): `src/update-check.ts`
- [Apply Update](https://github.com/cocofhu/anime-find/blob/main/src/apply-update.ts): `src/apply-update.ts`

### Other components

- **Harness Agent**
- **Media Sites**
- **Harness Settings**
- **GitHub Releases**

## Connections

- Harness Agent → Plugin Host: invokes search (evidence: `README.md`)
- Plugin Host → Search Orchestrator: runs search (evidence: `src/host.ts`)
- Plugin Host → Conversation Cards: returns cards (evidence: `README.md`)
- Conversation Cards → Plugin Host: requests details (evidence: `README.md`)
- Search Orchestrator → Season Resolver: resolves season (evidence: `src/search.ts`)
- Search Orchestrator → Mikan Source: searches source (evidence: `src/search.ts`)
- Search Orchestrator → AniBT Source: searches source (evidence: `src/search.ts`)
- Search Orchestrator → AnimeGarden Source: searches source (evidence: `src/search.ts`)
- Search Orchestrator → Bangumi Enrichment: enriches cards (evidence: `src/search.ts`)
- Search Orchestrator → Result Normalization: normalizes results (evidence: `src/search.ts`)
- Search Orchestrator → Release Parsing: parses releases (evidence: `src/search.ts`)
- Mikan Source → HTTP Utilities: fetches pages (evidence: `src/sources/mikan.ts`)
- AniBT Source → HTTP Utilities: fetches API (evidence: `src/sources/anibt.ts`)
- AnimeGarden Source → HTTP Utilities: fetches API (evidence: `src/sources/garden.ts`)
- Plugin Host → Resource Details: loads resources (evidence: `src/host.ts`)
- Resource Details → Bangumi Enrichment: loads metadata (evidence: `src/search.ts`)
- Conversation Cards → Stream Player: selects episode (evidence: `README.md`)
- Plugin Host → Stream Resolver: proxies media (evidence: `src/host.ts`)
- Stream Resolver → Media Sites: resolves playback (evidence: `README.md`)
- Stream Player → Plugin Host: requests playback (evidence: `README.md`)
- Plugin Settings → Config Store: updates rules (evidence: `README.md`)
- Plugin Host → Config Store: reads config (evidence: `src/host.ts`)
- Config Store → Harness Settings: persists settings (evidence: `README.md`)
- Plugin Host → Release Check: checks release (evidence: `src/host.ts`)
- Release Check → GitHub Releases: checks latest (evidence: `src/update-check.ts`)
- Plugin Host → Apply Update: applies update (evidence: `src/host.ts`)
- Apply Update → Release Check: uses metadata (evidence: `src/apply-update.ts`)
