ultisuite-client/lib/ai/ultiai-tool-groups.ts
R3D347HR4Y 2a0958b70d
Some checks are pending
E2E / Playwright e2e (push) Waiting to run
feat: update agenda references to use ULTICAL_APP_NAME and enhance AI usage sections
- Replaced hardcoded "Agenda" labels with dynamic ULTICAL_APP_NAME in various components for consistency.
- Introduced new AiUsageSection and CompteAiUsageSection components to track AI usage and costs.
- Updated settings and metadata to reflect changes in AI cost policies and usage limits.
- Enhanced user interface elements for better accessibility and user experience across admin settings.
2026-06-16 10:46:31 +02:00

56 lines
1.5 KiB
TypeScript

import { ULTICAL_APP_NAME } from "@/lib/suite/page-metadata"
export type UltiAiToolGroup = {
id: string
label: string
description: string
}
/** Tool groups exposed to UltiAI via MCP (X-Ulti-Enabled-Tools). */
export const ULTIAI_TOOL_GROUPS: UltiAiToolGroup[] = [
{
id: "mail",
label: "Mail",
description: "Recherche, lecture, envoi, libellés et suppression de messages.",
},
{
id: "drive",
label: "Drive",
description: "Fichiers, dossiers, partages et déplacements.",
},
{
id: "contacts",
label: "Contacts",
description: "Carnets d'adresses et fiches contacts.",
},
{
id: "agenda",
label: ULTICAL_APP_NAME,
description: "Calendriers, événements, invitations et visioconférence.",
},
{
id: "search",
label: "Recherche suite",
description: "Index unifié mail, drive et contacts (pas le web public).",
},
{
id: "web_search",
label: "Recherche web",
description:
"Recherche en ligne (Brave, Bing, SearXNG, DuckDuckGo, API JSON). Même réglages que contacts — onglet Recherche.",
},
]
export const DEFAULT_ULTIAI_ENABLED_TOOLS = ULTIAI_TOOL_GROUPS.map((group) => group.id)
export function toggleUltiAiToolGroup(
enabledTools: string[],
groupId: string,
enabled: boolean,
): string[] {
const set = new Set(enabledTools)
if (enabled) set.add(groupId)
else set.delete(groupId)
return ULTIAI_TOOL_GROUPS.map((group) => group.id).filter((id) => set.has(id))
}