From ed05dbf69cae34a2376df8ec9902311250301450 Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Mon, 30 Nov 2026 21:52:51 +0100 Subject: [PATCH 1/3] =?UTF-8?q?MCP:=20modal=20Conectar=20agente,=20secci?= =?UTF-8?q?=C3=B3n=20Agentes=20IA=20conectados=20en=20el=20perfil,=20men?= =?UTF-8?q?=C3=BA,=20=E2=8C=98K=20y=20badge=20(#142)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - PUBLIC_MCP_URL (env pública) activa la promoción; sin ella no se muestra nada. - ConnectAgentModal montado una vez en el layout y abierto con openConnectAgent(). - Conexión MCP activa calculada en servidor (OAuth por refreshExpiresAt, manual por expiresAt). - Perfil: sección de agentes separada de las claves de API, revocar con alertdialog. - i18n es/en, tests Vitest y e2e. Co-Authored-By: Claude Opus 5.5 --- .env.example | 4 + CLAUDE.md | 7 + e2e/global-setup.ts | 2 + e2e/specs/mcp-connect.spec.ts | 82 +++++++++ src/env.ts | 1 + src/lib/components/AppNavbar.svelte | 26 ++- .../components/mcp/ConnectAgentModal.svelte | 120 ++++++++++++++ .../components/mcp/connect-agent.svelte.ts | 10 ++ src/lib/components/mcp/connect.ts | 4 + src/lib/components/mcp/copy.ts | 17 ++ src/lib/i18n/locales/en.json | 49 +++++- src/lib/i18n/locales/es.json | 49 +++++- .../auth/application/apikeys.service.ts | 6 + .../auth/domain/mcp-connection.test.ts | 48 ++++++ src/modules/auth/domain/mcp-connection.ts | 30 ++++ src/modules/auth/index.ts | 1 + src/routes/+layout.server.ts | 13 +- src/routes/+layout.svelte | 22 ++- src/routes/profile/+page.server.ts | 11 +- src/routes/profile/+page.svelte | 155 +++++++++++++++++- 20 files changed, 640 insertions(+), 17 deletions(-) create mode 100644 e2e/specs/mcp-connect.spec.ts create mode 100644 src/lib/components/mcp/ConnectAgentModal.svelte create mode 100644 src/lib/components/mcp/connect-agent.svelte.ts create mode 100644 src/lib/components/mcp/connect.ts create mode 100644 src/lib/components/mcp/copy.ts create mode 100644 src/modules/auth/domain/mcp-connection.test.ts create mode 100644 src/modules/auth/domain/mcp-connection.ts diff --git a/.env.example b/.env.example index b7a00c6..75012e0 100644 --- a/.env.example +++ b/.env.example @@ -146,6 +146,10 @@ GITDB_ENCRYPTION_KEY="development" # /.well-known/oauth-authorization-server answer 404. Manual MCP keys work either way. # MCP_OAUTH_RESOURCES=https://mcp.cloud.getgitops.com/mcp +# Public URL of the MCP server. When set, the app promotes the MCP ("Connect AI agent" modal, profile +# section, shortcuts) and shows it to users; when empty nothing about MCP is promoted. +# PUBLIC_MCP_URL=https://mcp.cloud.getgitops.com/mcp + # ─── CVE feed (/org//cves, "CVEs por tecnología" tab; docs/adr/0004-cve-feed.md) ───────── # Follows the CVEs published in public sources (OSV.dev, NVD, CISA KEV, FIRST EPSS) for the # technologies each organization chooses, and emits cve_feed.* events. OFF by default: with false diff --git a/CLAUDE.md b/CLAUDE.md index 204c092..9e04659 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -146,6 +146,13 @@ session like any other page. Check it there before inventing a new style. (`gitops-sidebar-collapsed`); below `md` the sidebar is off-canvas. Auth, bootstrap and `/brand` keep the bare layout. The sidebar must stay the first `