Skip to content

Remove legacy inline HTML dashboard and serve alias #809

@christso

Description

@christso

Objective

Remove the legacy inline HTML dashboard from serve.ts and the fallback logic in createApp(). The React SPA (apps/studio/) fully replaces it. The dashboard has never been published, so there are no backward-compat concerns.

Context

PR #806 scaffolded apps/studio/ (React SPA) and renamed agentv serveagentv studio. The old dashboard was a ~1000-line generateServeHtml() function that inlined all HTML/CSS/JS as template strings in apps/cli/src/commands/results/serve.ts. The SPA fallback path in createApp() still calls generateServeHtml() if the studio dist directory isn't found.

Scope

Delete

  • generateServeHtml() function and all its helpers (inline CSS, JS template strings) in serve.ts
  • The fallback branch at the '/' route in createApp():
    // Delete this fallback:
    return c.html(generateServeHtml(results, sourceFile));

Simplify

  • createApp() route for '/': serve studioDistPath/index.html or throw a clear error:
    Error: Studio dist not found. Run "bun run build" to build the SPA.
    
  • Remove the studioDir?: string | false option if it was only used to disable SPA serving for the inline fallback. Check if tests rely on it — if so, update tests to build studio first or mock the dist path.
  • Remove the serve alias — studio is the only command name. No backward-compat needed since dashboard was never published.

Keep

  • All API routes (/api/runs, /api/feedback, /api/index, /api/results/:filename, static asset serving)
  • resolveStudioDistDir() — still needed to locate the built SPA
  • The studio command registration in cli.ts

Acceptance signals

  • generateServeHtml and inline HTML/CSS/JS template strings are deleted from serve.ts
  • agentv studio errors clearly if studio dist is missing (not a silent fallback)
  • agentv serve alias is removed
  • Existing tests pass (update any that relied on studioDir: false or generateServeHtml)
  • bun run build && bun apps/cli/src/cli.ts studio still serves the React SPA

Non-goals

  • No new features — this is pure cleanup
  • Don't restructure API routes or change the Hono app shape
  • Don't rename the package or command

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions