Commit Graph

3 Commits

Author SHA1 Message Date
egutierrez ea3c62d2f2 feat(agents_dashboard): apikey via env (pass agentes/api-key), e2e tests
Security: apikey NUNCA mas vive en local DB ni se introduce por UI.
Se lee al arranque via getenv("AGENTS_API_KEY"), sourced typically con
`pass agentes/api-key` antes de lanzar el .exe.

Connection panel:
- Removed apikey TextInput (+show/hide button)
- Removed UI mask flag
- Replaced con indicador "loaded from env" verde / "missing" rojo
- Hint visible: "Launch with: AGENTS_API_KEY=$(pass agentes/api-key) <exe>"

Persistencia local:
- db_save_connection: solo base_url (blob de apikey ya no se cifra)
- db_load_connection: solo base_url
- No mas roundtrip a fn_secret en runtime de la UI (la funcion del
  registry secret_store_cpp_infra sigue util para otras apps)

CLI:
- --connect-test <url> ahora lee apikey de AGENTS_API_KEY env var
- trim_url() en make_url + en CLI defensivo contra paste con CR/LF
- run_self_test sin cambios (secret_store roundtrip se mantiene)

E2E tests (tests/test_connect_e2e.py, 5 casos):
- test_connect_succeeds_with_valid_apikey
- test_connect_fails_without_apikey
- test_connect_fails_on_bad_host
- test_count_matches_direct_curl
- test_url_trim_robust_to_whitespace

Lanzar con:
  AGENTS_API_KEY=$(pass agentes/api-key) \
    python3 -m pytest -v tests/test_connect_e2e.py

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 22:15:55 +02:00
fn-orquestador 460b7f1484 fix: build errors — nlohmann include path, fn_log printf style, crypt32 link
- Fix nlohmann include: 'vendor/nlohmann/json.hpp' -> 'nlohmann/json.hpp'
  (cpp/vendor is in include path, no double-vendor prefix needed)
- Fix fn_log API: log_info/log_warn/log_error (not info/warn/error)
- Fix format strings: {} -> %s (logger uses printf-style, not fmtlib)
- CMakeLists: add crypt32 link for Windows DPAPI (MinGW needs explicit link,
  #pragma comment(lib) only works with MSVC)
- Build: exit 0, exe 22MB, .rsrc section present (icon embedded)

Issue: 0129
Co-Authored-By: fn-orquestador <noreply@fn-registry.local>
2026-05-22 21:47:39 +02:00
fn-orquestador 8795f2842b feat: initial implementation of agents_dashboard v0.1.0
Panels: Connection + Agents + Logs + Status Feed.
- HTTP GET /agents + POST /agents/{id}/{start,stop,restart}
- SSE streaming: /sse/agents/{id}/logs + /sse/status
- DPAPI/XOR credential storage in local_files/agents_dashboard.db
- data_table style agents table with filter + status icons
- SQLite migrations via sqlite3_exec at startup
- --self-test mode: db + secret_store round-trip + subsystem checks
- pytest mock server emulating agents_and_robots API

Registry functions: http_request_cpp_core, sse_client_cpp_core,
  secret_store_cpp_infra, logger_cpp_core
App icon: robot phosphor violet-500 (#8b5cf6)

Issue: 0129
Co-Authored-By: fn-orquestador <noreply@fn-registry.local>
2026-05-22 21:42:54 +02:00