* Copyright (C) 2026 Nick Fragoulis * Copyright (C) 2026 Jose Martinez * Copyright (C) 2026 Anthony Damhet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY, without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * or see https://www.gnu.org/ */ /** * \file htdocs/ai/assistant/index.php * \ingroup ai * \brief Main Chat Interface for MCP Server AI Assistant */ // Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/ai/lib/ai.lib.php'; /** * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager * @var Translate $langs * @var User $user */ // Security check if (!isModEnabled('ai') || !getDolGlobalString('AI_ASSISTANT_ENABLED')) { accessforbidden('Module or feature not allowed'); } // Per-user gate: the Assistant page is now governed by the standard // 'ai/assistant/use' right (granted by default to new users), so admins // can revoke access per user/group via the standard permission UI. if (!$user->hasRight('ai', 'assistant', 'use')) { accessforbidden(); } global $langs; $langs->loadLangs(array("main", "other", "dict")); $page_name = $langs->trans("AIAssistant"); // 'ai-fullpage' body class: lets the chat fill the whole content area (no .fiche // padding, full height) so the assistant looks like a full-page app, see ai_assistant.css. llxHeader('', $page_name, '', '', 0, 0, '', '', '', 'ai-fullpage'); ?>