How beorn/silvery works
Silvery is a React framework for interactive terminal applications, with composable rendering targets and terminal-aware components. Its central workflow is: an app supplies a React tree and terminal, the runtime handles input and coordinates rendering, and the renderer measures and lays out nodes before producing terminal output. The README also documents focus, selection, search, themes, rich UI components, alternate layout engines, and headless or canvas/DOM targets. Some runtime files are indexed but unsampled, so those internal links are omitted unless documented or supported by the index.
Main entry points: adapter-pipeline.ts Render Pipeline · event-handlers.ts Event Dispatch · index.ts Public API · components React Components
Components 22
App and Components
- React App Tree
- Public API
src/index.ts - React Components
packages/ag-react/src/ui/components - React Hooks
packages/ag-react/src/hooks - Text Editing
packages/ag-react/src/ui/components/useTextArea.ts
Runtime and Interaction
- App Runtime
packages/ag-term/src/runtime/create-app.tsx - Event Dispatch
packages/ag-term/src/runtime/event-handlers.ts - Focus Management
packages/ag/src/focus-manager.ts - Mouse and Hit Testing
packages/ag-term/src/mouse-events.ts - Selection and Copy
packages/selection/src/apply.ts - Find Overlay
packages/ag-term/src/search-overlay.ts
Layout and Rendering
- Render Entry
packages/ag-react/src/render.tsx - Render Pipeline
packages/ag-term/src/pipeline/adapter-pipeline.ts - Measure and Layout
packages/ag-term/src/pipeline/layout-phase.ts - Layout Engines
packages/ag-term/src/layout-engine.ts
Terminal Capabilities
- Terminal Output
packages/ag-term/src/output.ts - Terminal
- ANSI Protocols
packages/ansi/src/index.ts - Canvas and DOM Targets
packages/ag-term/src/adapters
Themes and Styling
- Theme Palettes
packages/theme/src/schemes/index.ts - Theme Detection
packages/ansi/src/theme/orchestrator.ts
Other components
- App Developer
Connections 23
- App Developer → Public API: uses
README.md - Public API → React App Tree: accepts
src/index.ts - Public API → Render Entry: delegates
src/index.ts - React App Tree → React Components: composes
README.md - React Components → React Hooks: uses
packages/ag-react/src/ui/components/useTextArea.ts - React Components → Text Editing: uses
packages/ag-react/src/ui/components/useTextArea.ts - App Developer → Theme Palettes: chooses
README.md - Theme Detection → Theme Palettes: resolves palettes
packages/ansi/src/theme/orchestrator.ts - React App Tree → App Runtime: runs in
README.md - App Runtime → Event Dispatch: dispatches input
packages/ag-term/src/runtime/event-handlers.ts - Event Dispatch → Focus Management: dispatches focus
packages/ag-term/src/runtime/event-handlers.ts - Event Dispatch → Mouse and Hit Testing: processes mouse
packages/ag-term/src/runtime/event-handlers.ts - Mouse and Hit Testing → Selection and Copy: supports selection
packages/ag-term/src/mouse-events.ts - App Runtime → Find Overlay: provides find
README.md - Render Entry → Render Pipeline: renders through
packages/ag-term/src/pipeline/adapter-pipeline.ts - Render Pipeline → Measure and Layout: runs layout
packages/ag-term/src/pipeline/adapter-pipeline.ts - Measure and Layout → Layout Engines: uses engine
- Render Pipeline → Terminal Output: flushes output
- Terminal Output → Terminal: writes
README.md - Terminal → ANSI Protocols: negotiates protocols
README.md - Render Pipeline → Canvas and DOM Targets: supports targets
README.md - React Hooks → Focus Management: controls focus
packages/ag-react/src/hooks/useFocusManager.ts - React Hooks → Event Dispatch: reads drag state
packages/ag-react/src/hooks/useDragState.ts