Files
egutierrez c8b7adf81d feat(0131): data_table_cpp_viz migration + botones acción + 7 nuevos tests e2e
Issue 0131 (agents v0.2) — frontend agents_dashboard:

* Migra tabla Agents de ImGui::BeginTable a render_grid_stage0 (data_table_cpp_viz).
  11 columnas: Status(Badge), ID, Name, Uptime, Msg/24h,
  Start/Stop/Restart/Clear Memory/Del Cache/Logs (Button renderers).
* Lee campos reales uptime_seconds + messages_24h del backend (antes leía
  'instances' como proxy para msg_24h; ahora lee el campo correcto).
* Confirmation modal (ImGui::BeginPopupModal) para acciones destructivas
  clear_memory y delete_cache.
* Link fn_module_data_table en CMakeLists (HAS_DATA_TABLE activado).
* Actualiza app.md: data_table_cpp_viz en uses_functions, version 0.2.0.
* Añade 7 tests pytest nuevos (total 24):
  test_uptime_field_present, test_msg_24h_field_present,
  test_clear_memory_requires_apikey, test_delete_cache_requires_apikey,
  test_control_roundtrip, test_unified_stop_does_not_kill_launcher,
  test_clear_memory_response_shape.
  SEGURIDAD: solo test-bot se para/arranca en e2e, nunca agentes reales.

Build verificado: Linux + Windows cross-compile (cmake --build cpp/build/windows).

Co-Authored-By: fn-orquestador (issue 0131) <noreply@fn-registry>
2026-05-22 23:07:01 +02:00

83 lines
3.1 KiB
Markdown

---
name: agents_dashboard
lang: cpp
domain: tools
description: "Frontend C++ ImGui para gestionar agentes Matrix (agents_and_robots) via HTTPS+apikey, SSE para logs/status en vivo"
icon:
phosphor: "robot"
accent: "#8b5cf6"
tags: [agents, dashboard, sse, http-client, imgui]
version: 0.2.0
uses_functions:
- http_request_cpp_core
- http_get_json_cpp_core
- sse_client_cpp_core
- secret_store_cpp_infra
- logger_cpp_core
- data_table_cpp_viz
uses_types: []
framework: "imgui"
entry_point: "main.cpp"
dir_path: "projects/element_agents/apps/agents_dashboard"
repo_url: "https://gitea.organic-machine.com/dataforge/agents_dashboard"
e2e_checks:
- id: build
cmd: "cmake --build /home/lucas/fn_registry/cpp/build/windows --target agents_dashboard -j"
timeout_s: 180
- id: self_test
cmd: "/home/lucas/fn_registry/cpp/build/windows/apps/agents_dashboard/agents_dashboard.exe --self-test"
timeout_s: 30
- id: pytest_mock
cmd: "cd /home/lucas/fn_registry/projects/element_agents/apps/agents_dashboard/tests && python3 -m pytest -x -q"
timeout_s: 60
---
# agents_dashboard
Frontend C++ ImGui para gestionar agentes Matrix de agents_and_robots via HTTPS + apikey. SSE para logs y status feed en vivo.
## Panels
- **Connection** — base_url + apikey input (masked), Test button, LED status SSE. Save credentials cifradas en `local_files/agents_dashboard.db`.
- **Agents** — tabla data_table_cpp_viz (render_grid_stage0) con 11 columnas: Status(Badge), ID, Name, Uptime, Msg/24h, Start/Stop/Restart/Clear Memory/Del Cache/Logs (Buttons). Modals de confirmacion para acciones destructivas.
- **Logs** — selector agente + tail buffer SSE (5000 lineas), autoscroll, pause.
- **Status Feed** — panel colapsable con eventos del `/sse/status` en tiempo real.
## Persistencia
- `local_files/agents_dashboard.db` (SQLite) — tabla `connections` (apikey cifrada DPAPI/XOR), `app_state`.
- Migraciones en `migrations/001_init.sql` aplicadas via sqlite3_exec al arrancar.
## Build
```bash
cmake --build cpp/build/windows --target agents_dashboard -j
```
## Deploy local (Windows)
```bash
./fn run redeploy_cpp_app_windows agents_dashboard projects/element_agents/apps/agents_dashboard --build
```
## Self-test
```bash
./cpp/build/windows/apps/agents_dashboard/agents_dashboard.exe --self-test
# exit 0: db OK, secret_store round-trip OK, subsystems OK
```
## Registry functions used
- `http_request_cpp_core` — GET/POST /agents + /agents/{id}/{action}
- `http_get_json_cpp_core` — /health check
- `sse_client_cpp_core` — /sse/agents/{id}/logs + /sse/status
- `secret_store_cpp_infra` — DPAPI Windows / XOR Linux para apikey en SQLite
- `logger_cpp_core` — logging en memoria + archivo
- `data_table_cpp_viz` — render_grid_stage0 para tabla Agents con Badge/Button renderers
## Capability growth log
v0.1.0 (2026-05-22) — Paneles Connection + Agents + Logs + Status Feed. HTTPS+apikey, SSE reconnect, DPAPI credentials.
v0.2.0 (2026-05-22) — Migrado tabla Agents a data_table_cpp_viz (issue 0131). Botones Start/Stop/Restart/Clear Memory/Del Cache/Logs por fila. Endpoints clear_memory + delete_cache. Campos uptime_seconds + messages_24h reales.