Skip to content

Town Overview & Rig Detail Dashboard Pages #289

@jrf0110

Description

@jrf0110

Part of #271 — Gastown Cloud Proposal A (Sandbox-per-Town)

Goal

Build the main dashboard pages for managing gastown towns: town list, town detail with agent grid, rig list, and convoy tracker.

Requirements

Town Overview Page

Route: /gastown

Components:

  • Town card for each active town:
    • Town name
    • Status indicator (running/stopped/provisioning/error)
    • Active agent count (from listSessions)
    • Last heartbeat timestamp
    • Resource usage (disk, memory) from health check
  • Create town button → provisioning wizard dialog:
    • Town name input
    • Region selector (default: closest)
    • Submit → calls gastown.createTown
    • Show provisioning progress
  • Quick actions per town: start/stop, open terminal, destroy (with confirmation)

Town Detail Page

Route: /gastown/[townId]

Sections:

a) Agent Grid — Real-time view of all running agents

  • Card per tmux session:
    • Role icon + name (e.g., "Polecat Toast")
    • Status badge: active/idle/dead
    • Current bead title (if polecat with hooked work)
    • Uptime
    • Click to open terminal view (PR 8 component)
  • Data source: sandbox internal API GET /sessions via gastown.listSessions

b) Rig List — Each rig with its status

  • Rig name, repo URL (linked), default branch
  • Active polecat count, pending bead count
  • Expand to show bead list (open, in_progress, closed)
  • Data source: sandbox internal API GET /rigs/:name/beads

c) Convoy Tracker — Active convoys with progress

  • Convoy name/title
  • Total beads, completed/in-progress/pending counts
  • Progress bar with color coding (red=pending, yellow=in_progress, green=closed)
  • Data source: sandbox internal API GET /rigs/:name/convoys

d) Activity Feed — Recent events (stretch goal for this PR)

  • Polecat spawned/completed, merges, escalations
  • Data source: sandbox internal API (Dolt events query)

Data Flow

All dashboard data comes from the sandbox internal API (PR 3), which queries Dolt and tmux directly. No Postgres duplication — the sandbox is the source of truth.

Polling intervals:

  • Agent grid: 5 seconds
  • Beads/convoys: 30 seconds
  • Town status: 30 seconds

tRPC Additions

Route Type Description
gastown.getRigBeads query Proxy to sandbox GET /rigs/:name/beads
gastown.getRigConvoys query Proxy to sandbox GET /rigs/:name/convoys
gastown.getRigPolecats query Proxy to sandbox GET /rigs/:name/polecats

Files

  • cloud/src/app/gastown/page.tsx (new) — town list
  • cloud/src/app/gastown/[townId]/page.tsx (new) — town detail
  • cloud/src/components/gastown/TownCard.tsx (new)
  • cloud/src/components/gastown/CreateTownDialog.tsx (new)
  • cloud/src/components/gastown/AgentGrid.tsx (new)
  • cloud/src/components/gastown/RigList.tsx (new)
  • cloud/src/components/gastown/ConvoyTracker.tsx (new)
  • Updates to cloud/src/server/api/routers/gastown.ts — proxy queries

Acceptance Criteria

  • /gastown page lists all active towns with status, agent count, and heartbeat
  • Create town wizard provisions a new town and shows progress
  • Quick actions (start/stop/destroy) work with confirmation dialogs
  • Town detail page shows agent grid with real-time session data
  • Agent cards are clickable and open the terminal component (PR 8)
  • Rig list shows repos with bead counts and expandable bead details
  • Convoy tracker shows progress bars with correct counts
  • Polling intervals are respected (5s for agents, 30s for beads)
  • Pages handle loading, error, and empty states gracefully
  • Auto-start if user visits a stopped town (calls startTown)
  • Follows existing dashboard design patterns and component library

Dependencies

  • PR 2 (Provisioning API) — createTown, listTowns, getTownStatus
  • PR 3 (Sandbox Internal API) — data endpoints
  • PR 6 (Lifecycle Management) — start/stop/destroy
  • PR 8 (Terminal Component) — embedded terminal view

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions