Find all code related to "demo" functionality in this codebase. I'm looking for code that handles zooming, animation, or visual demo/recording features - particularly anything that zooms in on text content. Search thoroughly for:
Files with "demo" in the name
Code referencing "zoom", "camera", "viewport", "scroll", "animation" in the context of demos
Any recording or playback functionality
Return the full content of the most relevant files.
Assistant
I'll conduct a thorough search for demo-related functionality in your codebase. Let me start by searching for files and code patterns related to demos, zooming, animation, and visual recording features.
Assistant
Great! I found a demo/ directory with multiple files related to camera, recording, and playback. Let me read the core demo files:
Assistant
Now let me read the schema and scenes files to understand the full structure:
Assistant
Now let me check the scenes init.py to understand the timing and context structures:
Assistant
Perfect! Let me get more of the example screenplay and also check the conversation scene handler:
Assistant
Now let me get the complete example screenplay and finish reading the conversation handler:
Assistant
Excellent! Now let me check if there are any other demo-related files and get the demo init.py:
Assistant
Perfect! Now let me create a comprehensive summary. Let me also check one more script example to show the variety:
Assistant
Perfect! Now I have a comprehensive understanding. Let me compile my findings:
Summary: Demo Functionality in Hermes Agent Codebase
I've found an extensive demo video framework in your codebase with sophisticated zooming, camera, animation, and recording capabilities. Here's the complete analysis:
Core Demo Files
The demo system is located in /Users/user_c042661f/Documents/hermes-agent/demo/ and consists of:
This file implements the core camera system that handles zooming and viewport control:
python
"""Camera system: resolve keyframes from screenplay + timing, interpolate zoom/pan.
Camera coordinates:
- x, y: normalized 0.0–1.0 (viewport center position)
- zoom: multiplier (1.0 = full frame, 2.0 = 2x zoom)
Used by compositor.py to crop each frame during encoding.
"""
@dataclass
class CameraKeyframe:
"""Resolved camera keyframe with absolute timestamp."""
t: float # Absolute time in seconds
zoom: float # 1.0 = full frame
x: float # 0.0–1.0
y: float # 0.0–1.0
duration: float # Transition time to reach this state
ease: str # "linear", "ease-in", "ease-out", "ease-in-out"
def interpolate_keyframes(
keyframes: List[CameraKeyframe], t: float
) -> tuple[float, float, float]:
"""Interpolate zoom, x, y at time t given sorted keyframes."""
Key features:
Normalized viewport coordinates (0.0-1.0 for center positioning)
Orchestrates the complete 3-step recording pipeline:
python
"""Orchestrates the full demo video pipeline: record → render → composite."""
def run_pipeline(
screenplay: Screenplay,
output_path: Path,
skin_override: Optional[str] = None,
typing_speed_override: Optional[float] = None,
dry_run: bool = False,
) -> None:
"""Run the full recording + rendering pipeline.
Steps:
1. Record terminal session with asciinema (running player in --play mode)
2. Render .cast → GIF with agg at high resolution
3. Composite: read GIF frames, apply camera crop in Python, encode to MP4
"""
def _action_camera(scene: ActionScene, ctx: PlaybackContext):
"""Standalone camera directive — only records timing, no visual output."""
scene_timing = SceneTiming(
index=ctx.scene_index, scene_type="action", action="camera"
)
scene_timing.start_t = ctx.now()
scene_timing.markers["camera"] = ctx.now()
# Store camera params in markers for the camera resolver
if scene.zoom is not None:
scene_timing.markers["_zoom"] = scene.zoom
if scene.x is not None:
scene_timing.markers["_x"] = scene.x
if scene.y is not None:
scene_timing.markers["_y"] = scene.y
if scene.duration is not None:
scene_timing.markers["_duration"] = scene.duration
scene_timing.end_t = ctx.now()
if ctx.timing:
ctx.timing.add_scene(scene_timing)
Complete example screenplay showing camera directives in action:
yaml
title: "Hermes Agent Demo — Camera Example"
output:
width: 2560 # Render at 2x resolution
height: 1440
final_width: 1280 # Output at 720p
final_height: 720
scenes:
# First exchange: zoom into the prompt area
- user: "Search for the latest AI agent frameworks and compare them"
thinking_time: 3.0
camera:
zoom: 1.8
y: 0.15 # Focus near top (prompt area)
at: "user_start"
duration: 0.8
ease: "ease-in-out"
tools:
- icon: "🔍"
verb: "search"
detail: '"AI agent frameworks comparison 2026"'
camera_response:
zoom: 1.4
y: 0.65 # Pan down to response area
at: "response_start"
duration: 0.5
ease: "ease-in-out"
response: |
Here's a comparison of the top AI agent frameworks...
# Camera reset: zoom back out
- action: camera
zoom: 1.0
duration: 1.0
ease: "ease-out"