# mahdidavoodi7/expo-thinking-orbs architecture

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

- Interactive diagram: https://gitdiagram.com/mahdidavoodi7/expo-thinking-orbs
- Repository: https://github.com/mahdidavoodi7/expo-thinking-orbs

## Overview

expo-thinking-orbs is a React Native/Expo animation library for AI status indicators and voice-agent orbs. A consumer mounts `ThinkingOrb` or `VoiceOrb`, whose shared picture hook resolves a tuned preset, selects a registered animation mode, builds a dot buffer on the UI thread, and records it as a Skia picture. The library also exposes that hook and lower-level rendering utilities for a shared canvas, plus audio-level hooks and theme/color options. Edges follow excerpted imports or documented behavior; unsampled audio-hook internals and other uncertain links are omitted.

Main entry points: [`src/index.tsx`](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/index.tsx) (Package Exports), [`src/useThinkingOrbPicture.ts`](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/useThinkingOrbPicture.ts) (Picture Hook), [`src/engine/registry.ts`](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/registry.ts) (Mode Registry), [`src/engine/paint.ts`](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/paint.ts) (Skia Painter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_exports["Package Exports<br/>[index.tsx]"]
  node_thinking["Thinking Orb<br/>[ThinkingOrb.tsx]"]
  node_voiceorb["Voice Orb<br/>[VoiceOrb.tsx]"]
  node_amplitude["Amplitude Hook"]
  node_levels["Band Levels Hook<br/>[useVoiceLevels.ts]"]
end

subgraph group_render["Render Pipeline"]
  node_picturehook["Picture Hook"]
  node_presets["Preset Resolver<br/>[presets.ts]"]
  node_registry["Mode Registry<br/>[registry.ts]"]
  node_paint["Skia Painter<br/>[paint.ts]"]
end

subgraph group_modes["Animation Modes"]
  node_lattice["Lattice Modes<br/>[lattice.ts]"]
  node_orbits["Orbit Mode<br/>[orbits.ts]"]
  node_ribbon["Ribbon Mode<br/>[ribbon.ts]"]
  node_morph["Morph Mode<br/>[morph.ts]"]
  node_voiceengine["Voice Mode<br/>[voice.ts]"]
  node_voicepass["Voice Audio Pass<br/>[voice-pass.ts]"]
end

subgraph group_support["Shared Engine"]
  node_scratch["Dot Buffer<br/>[scratch.ts]"]
  node_colors["Color Ramp<br/>[colors.ts]"]
  node_core["Geometry Primitives<br/>[core.ts]"]
  node_profiles["Mode Profiles<br/>[profiles.ts]"]
  node_theme["Theme Resolver<br/>[theme.ts]"]
end

node_consumer(("App Consumer"))

node_consumer -->|"mounts"| node_thinking
node_consumer -->|"mounts"| node_voiceorb
node_thinking -->|"uses"| node_picturehook
node_voiceorb -->|"uses"| node_picturehook
node_picturehook -->|"resolves preset"| node_presets
node_picturehook -->|"selects mode"| node_registry
node_picturehook -->|"acquires buffer"| node_scratch
node_picturehook -->|"records picture"| node_paint
node_picturehook -->|"applies audio pass"| node_voicepass
node_picturehook -->|"builds voice mode"| node_voiceengine
node_picturehook -->|"resolves theme"| node_theme
node_registry -->|"registers modes"| node_lattice
node_registry -->|"registers mode"| node_orbits
node_registry -->|"registers mode"| node_ribbon
node_registry -->|"registers mode"| node_morph
node_registry -->|"registers mode"| node_voiceengine
node_presets -->|"scales profiles"| node_profiles
node_paint -->|"reads buffer"| node_scratch
node_paint -->|"uses color ramp"| node_colors
node_lattice -->|"uses geometry"| node_core
node_orbits -->|"uses geometry"| node_core
node_ribbon -->|"uses geometry"| node_core
node_voiceengine -->|"uses geometry"| node_core
node_exports -->|"exports"| node_thinking
node_exports -->|"exports"| node_voiceorb
node_exports -->|"exports"| node_picturehook
node_exports -->|"exports"| node_amplitude
node_exports -->|"exports"| node_levels
node_exports -->|"exports"| node_presets
node_exports -->|"exports"| node_paint
node_exports -->|"exports"| node_scratch
node_exports -->|"exports"| node_voicepass
node_exports -->|"exports"| node_colors

click node_exports "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/index.tsx"
click node_thinking "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/ThinkingOrb.tsx"
click node_voiceorb "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/VoiceOrb.tsx"
click node_picturehook "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/useThinkingOrbPicture.ts"
click node_presets "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/presets.ts"
click node_registry "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/registry.ts"
click node_paint "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/paint.ts"
click node_scratch "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/scratch.ts"
click node_colors "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/colors.ts"
click node_core "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/core.ts"
click node_profiles "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/profiles.ts"
click node_lattice "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/lattice.ts"
click node_orbits "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/orbits.ts"
click node_ribbon "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/ribbon.ts"
click node_morph "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/morph.ts"
click node_voiceengine "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/voice.ts"
click node_voicepass "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/voice-pass.ts"
click node_amplitude "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/useVoiceAmplitude.ts"
click node_levels "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/useVoiceLevels.ts"
click node_theme "https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/theme.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_exports,node_thinking,node_voiceorb,node_amplitude,node_levels toneBlue
class node_picturehook,node_presets,node_registry,node_paint toneAmber
class node_lattice,node_orbits,node_ribbon,node_morph,node_voiceengine,node_voicepass toneMint
class node_scratch,node_colors,node_core,node_profiles,node_theme toneRose
class node_consumer toneIndigo
```

## Components

### Public API

- [Package Exports](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/index.tsx): `src/index.tsx`
- [Thinking Orb](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/ThinkingOrb.tsx): `src/ThinkingOrb.tsx`
- [Voice Orb](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/VoiceOrb.tsx): `src/VoiceOrb.tsx`
- [Amplitude Hook](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/useVoiceAmplitude.ts): `src/useVoiceAmplitude.ts`
- [Band Levels Hook](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/useVoiceLevels.ts): `src/useVoiceLevels.ts`

### Render Pipeline

- [Picture Hook](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/useThinkingOrbPicture.ts): `src/useThinkingOrbPicture.ts`
- [Preset Resolver](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/presets.ts): `src/presets.ts`
- [Mode Registry](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/registry.ts): `src/engine/registry.ts`
- [Skia Painter](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/paint.ts): `src/engine/paint.ts`

### Animation Modes

- [Lattice Modes](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/lattice.ts): `src/engine/lattice.ts`
- [Orbit Mode](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/orbits.ts): `src/engine/orbits.ts`
- [Ribbon Mode](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/ribbon.ts): `src/engine/ribbon.ts`
- [Morph Mode](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/morph.ts): `src/engine/morph.ts`
- [Voice Mode](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/voice.ts): `src/engine/voice.ts`
- [Voice Audio Pass](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/voice-pass.ts): `src/engine/voice-pass.ts`

### Shared Engine

- [Dot Buffer](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/scratch.ts): `src/engine/scratch.ts`
- [Color Ramp](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/colors.ts): `src/colors.ts`
- [Geometry Primitives](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/core.ts): `src/engine/core.ts`
- [Mode Profiles](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/engine/profiles.ts): `src/engine/profiles.ts`
- [Theme Resolver](https://github.com/mahdidavoodi7/expo-thinking-orbs/blob/main/src/theme.ts): `src/theme.ts`

### Other components

- **App Consumer**

## Connections

- App Consumer → Thinking Orb: mounts (evidence: `README.md`)
- App Consumer → Voice Orb: mounts (evidence: `README.md`)
- Thinking Orb → Picture Hook: uses (evidence: `src/ThinkingOrb.tsx`)
- Voice Orb → Picture Hook: uses (evidence: `src/VoiceOrb.tsx`)
- Picture Hook → Preset Resolver: resolves preset (evidence: `src/useThinkingOrbPicture.ts`)
- Picture Hook → Mode Registry: selects mode (evidence: `src/useThinkingOrbPicture.ts`)
- Picture Hook → Dot Buffer: acquires buffer (evidence: `src/useThinkingOrbPicture.ts`)
- Picture Hook → Skia Painter: records picture (evidence: `src/useThinkingOrbPicture.ts`)
- Picture Hook → Voice Audio Pass: applies audio pass (evidence: `src/useThinkingOrbPicture.ts`)
- Picture Hook → Voice Mode: builds voice mode (evidence: `src/useThinkingOrbPicture.ts`)
- Picture Hook → Theme Resolver: resolves theme (evidence: `src/useThinkingOrbPicture.ts`)
- Mode Registry → Lattice Modes: registers modes (evidence: `src/engine/registry.ts`)
- Mode Registry → Orbit Mode: registers mode (evidence: `src/engine/registry.ts`)
- Mode Registry → Ribbon Mode: registers mode (evidence: `src/engine/registry.ts`)
- Mode Registry → Morph Mode: registers mode (evidence: `src/engine/registry.ts`)
- Mode Registry → Voice Mode: registers mode (evidence: `src/engine/registry.ts`)
- Preset Resolver → Mode Profiles: scales profiles (evidence: `src/presets.ts`)
- Skia Painter → Dot Buffer: reads buffer (evidence: `src/engine/paint.ts`)
- Skia Painter → Color Ramp: uses color ramp (evidence: `src/engine/paint.ts`)
- Lattice Modes → Geometry Primitives: uses geometry (evidence: `src/engine/lattice.ts`)
- Orbit Mode → Geometry Primitives: uses geometry (evidence: `src/engine/orbits.ts`)
- Ribbon Mode → Geometry Primitives: uses geometry (evidence: `src/engine/ribbon.ts`)
- Voice Mode → Geometry Primitives: uses geometry (evidence: `src/engine/voice.ts`)
- Package Exports → Thinking Orb: exports (evidence: `src/index.tsx`)
- Package Exports → Voice Orb: exports (evidence: `src/index.tsx`)
- Package Exports → Picture Hook: exports (evidence: `src/index.tsx`)
- Package Exports → Amplitude Hook: exports (evidence: `src/index.tsx`)
- Package Exports → Band Levels Hook: exports (evidence: `src/index.tsx`)
- Package Exports → Preset Resolver: exports (evidence: `src/index.tsx`)
- Package Exports → Skia Painter: exports (evidence: `src/index.tsx`)
- Package Exports → Dot Buffer: exports (evidence: `src/index.tsx`)
- Package Exports → Voice Audio Pass: exports (evidence: `src/index.tsx`)
- Package Exports → Color Ramp: exports (evidence: `src/index.tsx`)
