Skip to main content

Characters

Character sprites represent the AI agents in the office. Each character has walk, typing, and reading animations across four directions.

Sprite Format

Each character is a single 112×96 pixel PNG containing a grid of frames:

  • 3 rows — one per direction (down, up, right; left is mirrored from right)
  • 7 columns — animation frames
Frame IndexPurpose
0Walk frame 1
1Idle / standing
2Walk frame 2
3–4Typing animation (2-frame blink)
5–6Reading animation (2-frame blink)

Individual frame size: 16×32 pixels.

Palettes

There are 6 pre-colored character palettes (char_0.png through char_5.png) in assets/characters/. Each agent is assigned a palette, and an optional hue shift (0–360°) can be applied for further variation.

Animation States

interface CharacterSprites {
walk: Record<Direction, [SpriteData, SpriteData, SpriteData, SpriteData]>
typing: Record<Direction, [SpriteData, SpriteData]>
reading: Record<Direction, [SpriteData, SpriteData]>
}
StateFramesDuration per FrameTrigger
Walk40.15s (600ms loop)Agent moving between tiles
Typing20.3s (600ms loop)Agent using a tool (non-reading)
Reading20.3s (600ms loop)Agent using Read, Grep, Glob, WebFetch, or WebSearch
Idle1Agent stationary

Walk speed is 48 px/sec (3 tiles/sec at TILE_SIZE = 16).

Direction Handling

Four directions are supported: DOWN (0), LEFT (1), RIGHT (2), UP (3).

The LEFT direction is generated at runtime by horizontally flipping the RIGHT sprites — no separate LEFT row exists in the PNG.

Key Files

FilePurpose
webview-ui/src/office/sprites/spriteData.tsSprite template loading, palette hue shifts, frame extraction
webview-ui/src/office/sprites/spriteCache.tsZoom-level canvas caching and outline generation
shared/assets/pngDecoder.tsdecodeCharacterPng() — PNG buffer to direction sprites
webview-ui/src/office/engine/characters.tsCharacter state machine, animation selection