# tefectorg/tefect-zig-package architecture

> Architecture diagram of the GitHub repository tefectorg/tefect-zig-package, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tefectorg/tefect-zig-package
- Repository: https://github.com/tefectorg/tefect-zig-package

## Overview

Tefect is a work-in-progress Zig library for low-level terminal interaction in terminal applications. Its documented user-to-result workflow is an application using the library to interact with a terminal. The filenames indicate input, parsing, terminal output, and window-related areas, but no source excerpts or SOURCE INDEX were provided; those modules are therefore shown as capabilities without inferred call relationships. The two workflow edges reflect only the README’s broad description.

Main entry points: [`src/root.zig`](https://github.com/tefectorg/tefect-zig-package/blob/main/src/root.zig) (Tefect library)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Library Core"]
  node_tefect["Tefect library<br/>[root.zig]"]
  node_errors["Error handling<br/>[tefect_errors.zig]"]
end

subgraph group_input["Input Handling"]
  node_buffer["Input buffer<br/>[tefect_buffer.zig]"]
  node_input["Terminal input<br/>[tefect_input.zig]"]
  node_keys["Key handling<br/>[tefect_keys.zig]"]
  node_mouse["Mouse handling<br/>[tefect_mouse.zig]"]
  node_parsers["Input parsers<br/>[tefect_parsers.zig]"]
  node_parserss["Parser module"]
  node_oldinput["Legacy input"]
end

subgraph group_terminal["Terminal Output"]
  node_console["Console interaction<br/>[tefect_console.zig]"]
end

subgraph group_display["Display and Encoding"]
  node_dynamicansi["Dynamic ANSI"]
  node_staticansi["Static ANSI"]
  node_utf["UTF handling<br/>[tefect_utf.zig]"]
  node_window["Terminal window<br/>[tefect_window.zig]"]
end

node_app(("Terminal application"))
node_terminal(("Terminal"))

node_app -->|"uses"| node_tefect
node_tefect -->|"interacts with"| node_terminal

click node_tefect "https://github.com/tefectorg/tefect-zig-package/blob/main/src/root.zig"
click node_buffer "https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_buffer.zig"
click node_input "https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_input.zig"
click node_keys "https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_keys.zig"
click node_mouse "https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_mouse.zig"
click node_parsers "https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_parsers.zig"
click node_parserss "https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_parserss.zig"
click node_oldinput "https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_OLD_input.zig"
click node_console "https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_console.zig"
click node_errors "https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_errors.zig"
click node_dynamicansi "https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_dynamic_ansi.zig"
click node_staticansi "https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_static_ansi.zig"
click node_utf "https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_utf.zig"
click node_window "https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_window.zig"

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_tefect,node_errors toneBlue
class node_buffer,node_input,node_keys,node_mouse,node_parsers,node_parserss,node_oldinput toneAmber
class node_console toneMint
class node_dynamicansi,node_staticansi,node_utf,node_window toneRose
class node_app,node_terminal toneIndigo
```

## Components

### Library Core

- [Tefect library](https://github.com/tefectorg/tefect-zig-package/blob/main/src/root.zig): `src/root.zig`
- [Error handling](https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_errors.zig): `src/tefect_errors.zig`

### Input Handling

- [Input buffer](https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_buffer.zig): `src/tefect_buffer.zig`
- [Terminal input](https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_input.zig): `src/tefect_input.zig`
- [Key handling](https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_keys.zig): `src/tefect_keys.zig`
- [Mouse handling](https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_mouse.zig): `src/tefect_mouse.zig`
- [Input parsers](https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_parsers.zig): `src/tefect_parsers.zig`
- [Parser module](https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_parserss.zig): `src/tefect_parserss.zig`
- [Legacy input](https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_OLD_input.zig): `src/tefect_OLD_input.zig`

### Terminal Output

- [Console interaction](https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_console.zig): `src/tefect_console.zig`

### Display and Encoding

- [Dynamic ANSI](https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_dynamic_ansi.zig): `src/tefect_dynamic_ansi.zig`
- [Static ANSI](https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_static_ansi.zig): `src/tefect_static_ansi.zig`
- [UTF handling](https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_utf.zig): `src/tefect_utf.zig`
- [Terminal window](https://github.com/tefectorg/tefect-zig-package/blob/main/src/tefect_window.zig): `src/tefect_window.zig`

### Other components

- **Terminal application**
- **Terminal**

## Connections

- Terminal application → Tefect library: uses (evidence: `README.md`)
- Tefect library → Terminal: interacts with (evidence: `README.md`)
