feat(infrastructure,backend,app-tauri,frontend): tools MCP workspace natifs read-only idea_workspace_map/list/read/search, activés par défaut et configurables dans les permissions MCP et les templates — #341 (QA verte)
This commit is contained in:
@ -12,6 +12,7 @@ import type { McpToolCatalogue } from "@/domain";
|
||||
export interface McpToolGroupDef {
|
||||
id: string;
|
||||
label: string;
|
||||
description?: string;
|
||||
tools: string[];
|
||||
}
|
||||
type Tr = (french: string, english: string) => string;
|
||||
@ -19,6 +20,17 @@ const fr: Tr = (french) => french;
|
||||
|
||||
/** Domain groups, in display order (carnet #82 — Conception UX/F). */
|
||||
export const MCP_TOOL_GROUPS: McpToolGroupDef[] = [
|
||||
{
|
||||
id: "workspace",
|
||||
label: "Outils du projet",
|
||||
description: "Permet à l’agent d’explorer, rechercher et lire les fichiers du projet.",
|
||||
tools: [
|
||||
"idea_workspace_map",
|
||||
"idea_workspace_list",
|
||||
"idea_workspace_read",
|
||||
"idea_workspace_search",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "crossProject",
|
||||
label: "IdeA inter-projets",
|
||||
@ -93,6 +105,10 @@ export const MCP_TOOL_GROUPS: McpToolGroupDef[] = [
|
||||
|
||||
/** Short, human French label per exact MCP tool name. */
|
||||
export const MCP_TOOL_LABELS: Record<string, string> = {
|
||||
idea_workspace_map: "Cartographier le projet",
|
||||
idea_workspace_list: "Lister les éléments du projet",
|
||||
idea_workspace_read: "Lire un élément du projet",
|
||||
idea_workspace_search: "Rechercher dans le projet",
|
||||
idea_project_list: "Lister les projets IdeA",
|
||||
idea_project_read_context: "Lire le contexte d'un autre projet",
|
||||
idea_project_list_agents: "Lister les agents d'un autre projet",
|
||||
@ -127,6 +143,7 @@ export const MCP_TOOL_LABELS: Record<string, string> = {
|
||||
};
|
||||
|
||||
const MCP_TOOL_LABELS_EN: Record<string, string> = {
|
||||
idea_workspace_map: "Map the project", idea_workspace_list: "List project items", idea_workspace_read: "Read a project item", idea_workspace_search: "Search the project",
|
||||
idea_project_list: "List IdeA projects", idea_project_read_context: "Read another project's context", idea_project_list_agents: "List agents in another project", idea_project_ask_agent: "Ask an agent in another project", idea_project_cancel_agent: "Cancel a cross-project request",
|
||||
idea_list_agents: "List agents", idea_context_read: "Read an agent's context", idea_memory_read: "Read project memory", idea_skill_read: "Read a skill", idea_workstate_read: "Read work state", idea_ticket_read: "Read a ticket", idea_ticket_list: "List tickets", idea_ticket_read_carnet: "Read ticket notes", idea_sprint_list: "List sprints",
|
||||
idea_ask_agent: "Delegate to an agent", idea_ask_agents: "Ask several agents", idea_launch_agent: "Launch an agent", idea_stop_agent: "Stop an agent", idea_update_context: "Update an agent's context", idea_context_propose: "Propose context", idea_memory_write: "Write project memory", idea_workstate_set: "Write work state", idea_create_skill: "Create a skill",
|
||||
@ -134,10 +151,24 @@ const MCP_TOOL_LABELS_EN: Record<string, string> = {
|
||||
};
|
||||
|
||||
export function mcpToolGroupLabel(group: McpToolGroupDef, tr: Tr = fr): string {
|
||||
const english: Record<string, string> = { crossProject: "IdeA cross-project", readProject: "Project read", readTickets: "Ticket read", delegation: "Agent delegation", contextMemory: "Context and memory", tickets: "Tickets", work: "Work and execution", skills: "Skills", other: "Other" };
|
||||
const english: Record<string, string> = { workspace: "Project tools", crossProject: "IdeA cross-project", readProject: "Project read", readTickets: "Ticket read", delegation: "Agent delegation", contextMemory: "Context and memory", tickets: "Tickets", work: "Work and execution", skills: "Skills", other: "Other" };
|
||||
return tr(group.label, english[group.id] ?? group.label);
|
||||
}
|
||||
|
||||
export function mcpToolGroupDescription(
|
||||
group: McpToolGroupDef,
|
||||
tr: Tr = fr,
|
||||
): string | undefined {
|
||||
if (!group.description) return undefined;
|
||||
if (group.id === "workspace") {
|
||||
return tr(
|
||||
group.description,
|
||||
"Lets the agent explore, search, and read project files.",
|
||||
);
|
||||
}
|
||||
return group.description;
|
||||
}
|
||||
|
||||
/** Short human label for `tool`, falling back to the exact name if unmapped. */
|
||||
export function mcpToolLabel(tool: string, tr: Tr = fr): string {
|
||||
const french = MCP_TOOL_LABELS[tool];
|
||||
|
||||
Reference in New Issue
Block a user