feat(dashboard): /config route with Monaco JSON editor #455

Closed
opened 2026-04-27 13:49:53 +00:00 by claude-desktop · 0 comments
Collaborator

User story

As an operator, I want a /config page in the web app where I can edit agents.json in a Monaco editor with schema autocomplete and inline validation, then save and hot-reload the config, so that I can tune agent behaviour without vim'ing on the host.

Why: Phase 2 makes the file the single source of truth. Editing JSON in a terminal is slow and error-prone (no schema awareness, no autocomplete, no preview). Monaco gives autocomplete + validation without building per-field forms.

Acceptance criteria

Server

  • GET /config/agents returns the current resolved agents.json contents as JSON
  • GET /config/agents/schema returns the JSON Schema derived from the Zod agents.json schema
  • PUT /config/agents validates body against schema, atomically writes config/agents.json, hot-reloads, returns the parsed result
  • Validation failure → 400 with field-level errors
  • Foreman-trust gate: only host-mode foreman or operator session can write (no agent token can hit this)

Web

  • New route /config (TanStack)
  • Monaco editor with JSON Schema attached (autocomplete + inline errors)
  • "Save & reload" button — disabled while form has validation errors; shows server-side errors in a toast
  • Diff banner: shows what changed vs. on-disk before save
  • Optimistic-lock check: server returns the file mtime/etag, client sends it back; rejects save if changed under our feet

Tests

  • Schema export endpoint matches the Zod schema (round-trip parse check)
  • PUT validation rejects an invalid agent type entry
  • Hot-reload picks up new threshold value on next dispatch

Out of scope

  • Form UI per field (Phase 4)
  • History / version control (Phase 4 or later)
  • Edit lock for multiple operators (single-operator deployment for now)

References

  • Audit recommendation
  • docs/foreman.md — trust-gate pattern
  • Phase 2 tickets must close before this ships
## User story As an operator, I want a `/config` page in the web app where I can edit `agents.json` in a Monaco editor with schema autocomplete and inline validation, then save and hot-reload the config, so that I can tune agent behaviour without `vim`'ing on the host. **Why:** Phase 2 makes the file the single source of truth. Editing JSON in a terminal is slow and error-prone (no schema awareness, no autocomplete, no preview). Monaco gives autocomplete + validation without building per-field forms. ## Acceptance criteria ### Server - [ ] `GET /config/agents` returns the current resolved `agents.json` contents as JSON - [ ] `GET /config/agents/schema` returns the JSON Schema derived from the Zod `agents.json` schema - [ ] `PUT /config/agents` validates body against schema, atomically writes `config/agents.json`, hot-reloads, returns the parsed result - [ ] Validation failure → 400 with field-level errors - [ ] Foreman-trust gate: only host-mode foreman or operator session can write (no agent token can hit this) ### Web - [ ] New route `/config` (TanStack) - [ ] Monaco editor with JSON Schema attached (autocomplete + inline errors) - [ ] "Save & reload" button — disabled while form has validation errors; shows server-side errors in a toast - [ ] Diff banner: shows what changed vs. on-disk before save - [ ] Optimistic-lock check: server returns the file mtime/etag, client sends it back; rejects save if changed under our feet ### Tests - [ ] Schema export endpoint matches the Zod schema (round-trip parse check) - [ ] PUT validation rejects an invalid agent type entry - [ ] Hot-reload picks up new threshold value on next dispatch ## Out of scope - Form UI per field (Phase 4) - History / version control (Phase 4 or later) - Edit lock for multiple operators (single-operator deployment for now) ## References - Audit recommendation - `docs/foreman.md` — trust-gate pattern - Phase 2 tickets must close before this ships
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks#455
No description provided.