feat: Fusion ACC-2.1 — preset connecteur TikTak (MCP) et outils agent mcp_tiktak_* (#19)
FlowDeck CI / lint (push) Failing after 2m9s
FlowDeck CI / test (push) Failing after 29m1s
FlowDeck CI / docker (push) Skipped

This commit is contained in:
Spark
2026-10-20 23:23:26 -04:00
parent d8548eede9
commit 6a75b189ec
8 changed files with 178 additions and 8 deletions
+1 -1
View File
@@ -192,7 +192,7 @@ async def lifespan(_app: FastAPI):
app = FastAPI(
title="FlowDeck",
version="7.72.0",
version="7.73.0",
docs_url="/docs",
redoc_url="/redoc",
lifespan=lifespan,
+9 -3
View File
@@ -24,7 +24,7 @@ from app.services.sso_provisioning import decrypt_secret, encrypt_secret
logger = logging.getLogger(__name__)
NATIVE_KINDS = ("gitea", "github", "web", "google", "ms365")
CUSTOM_KINDS = ("custom", "discord", "telegram", "mcp")
CUSTOM_KINDS = ("custom", "discord", "telegram", "mcp", "tiktak")
AUTH_SCHEMES = ("bearer", "bot", "none")
# Presets proposés par le formulaire du menu + (le jeton reste toujours saisi
# par l'utilisateur — jamais codé en dur ici).
@@ -35,6 +35,12 @@ PRESETS = {
"hint": "BotFather → Bot Token (jeton dans l'URL)"},
"mcp": {"url": "https://", "auth": "bearer",
"hint": "URL du endpoint MCP (streamable HTTP)"},
# Fusion ACC-2.1 — première paire de fédération : le serveur MCP en
# lecture de TikTak (POST /mcp, JSON-RPC) ; la clé `tck_` se crée
# dans TikTak → Réglages → Intégrations. Comportement MCP standard
# (probe, cache d'outils, outils dynamiques mcp_tiktak_*).
"tiktak": {"url": "https://tiktak.dracodev.net/mcp", "auth": "bearer",
"hint": "TikTak → Réglages → Intégrations → clé API tck_…"},
}
OAUTH_KINDS = oauth_connectors.OAUTH_KINDS
FETCH_LIMIT = 20000 # caractères max renvoyés au LLM (ponytail : borne fixe)
@@ -253,7 +259,7 @@ async def probe(connector: str, user_id: int | None = None) -> dict:
"""Teste un connecteur et **persiste** le résultat (personnel uniquement)."""
kind, ref = _resolve(connector)
try:
if kind == "mcp":
if kind in ("mcp", "tiktak"):
from app.services import mcp_client
tools = await mcp_client.initialize_and_list(int(ref))
status, detail = "ok", f"MCP · {len(tools)} outil(s)"
@@ -303,7 +309,7 @@ async def connector_fetch(connector: str, path: str = "", query: str = "",
path = (path or "").strip()
if kind in OAUTH_KINDS:
return await oauth_connectors.api_get(kind, user_id, path)
if kind == "mcp":
if kind in ("mcp", "tiktak"):
from app.services import mcp_client
return {"status": "ok", "text": mcp_client.tools_text(int(ref))}
if kind == "gitea":
+3 -2
View File
@@ -81,7 +81,7 @@ def _server(connector_id: int) -> dict:
row = get(connector_id)
if row is None:
raise ValueError("Serveur MCP introuvable")
if row["kind"] != "mcp":
if row["kind"] not in ("mcp", "tiktak"):
raise ValueError("Ce connecteur n'est pas un serveur MCP")
if not row["enabled"]:
raise ValueError("Serveur MCP désactivé")
@@ -136,7 +136,8 @@ def cached_tools() -> list[dict]:
"""Outils MCP des serveurs **activés** (cache en base) — lu par ToolRegistry."""
with get_conn() as conn:
rows = conn.execute(
"SELECT id, tools_json FROM agent_connectors WHERE kind='mcp' AND enabled=1"
"SELECT id, tools_json FROM agent_connectors "
"WHERE kind IN ('mcp', 'tiktak') AND enabled=1"
).fetchall()
out: list[dict] = []
for r in rows:
+1
View File
@@ -451,6 +451,7 @@ body.fd-ap-resizing *{cursor:col-resize!important}
<option value="discord">Discord (bot)</option>
<option value="telegram">Telegram (bot)</option>
<option value="mcp">Serveur MCP (streamable HTTP)</option>
<option value="tiktak">TikTak — tâches (MCP, Fusion)</option>
</select>
<label for="fd-plus-cn-name">Nom</label>
<input id="fd-plus-cn-name" type="text" x-model="connectorForm.name" placeholder="ex. Base de connaissances" @keydown.enter.prevent="connectorCreate()">