@lyrra/mcp-server 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +214 -0
- package/dist/client.d.ts +17 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +92 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +7 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +84 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/block-types.d.ts +318 -0
- package/dist/resources/block-types.d.ts.map +1 -0
- package/dist/resources/block-types.js +297 -0
- package/dist/resources/block-types.js.map +1 -0
- package/dist/resources/flow-schema.d.ts +147 -0
- package/dist/resources/flow-schema.d.ts.map +1 -0
- package/dist/resources/flow-schema.js +143 -0
- package/dist/resources/flow-schema.js.map +1 -0
- package/dist/tools/admin.d.ts +133 -0
- package/dist/tools/admin.d.ts.map +1 -0
- package/dist/tools/admin.js +114 -0
- package/dist/tools/admin.js.map +1 -0
- package/dist/tools/ai-designer.d.ts +149 -0
- package/dist/tools/ai-designer.d.ts.map +1 -0
- package/dist/tools/ai-designer.js +85 -0
- package/dist/tools/ai-designer.js.map +1 -0
- package/dist/tools/analytics.d.ts +48 -0
- package/dist/tools/analytics.d.ts.map +1 -0
- package/dist/tools/analytics.js +40 -0
- package/dist/tools/analytics.js.map +1 -0
- package/dist/tools/auth.d.ts +31 -0
- package/dist/tools/auth.d.ts.map +1 -0
- package/dist/tools/auth.js +32 -0
- package/dist/tools/auth.js.map +1 -0
- package/dist/tools/blocks.d.ts +201 -0
- package/dist/tools/blocks.d.ts.map +1 -0
- package/dist/tools/blocks.js +163 -0
- package/dist/tools/blocks.js.map +1 -0
- package/dist/tools/connections.d.ts +87 -0
- package/dist/tools/connections.d.ts.map +1 -0
- package/dist/tools/connections.js +77 -0
- package/dist/tools/connections.js.map +1 -0
- package/dist/tools/eduflow.d.ts +186 -0
- package/dist/tools/eduflow.d.ts.map +1 -0
- package/dist/tools/eduflow.js +104 -0
- package/dist/tools/eduflow.js.map +1 -0
- package/dist/tools/participants.d.ts +111 -0
- package/dist/tools/participants.d.ts.map +1 -0
- package/dist/tools/participants.js +66 -0
- package/dist/tools/participants.js.map +1 -0
- package/dist/tools/presentation.d.ts +117 -0
- package/dist/tools/presentation.d.ts.map +1 -0
- package/dist/tools/presentation.js +53 -0
- package/dist/tools/presentation.js.map +1 -0
- package/dist/tools/projects.d.ts +66 -0
- package/dist/tools/projects.d.ts.map +1 -0
- package/dist/tools/projects.js +51 -0
- package/dist/tools/projects.js.map +1 -0
- package/dist/tools/resources.d.ts +47 -0
- package/dist/tools/resources.d.ts.map +1 -0
- package/dist/tools/resources.js +33 -0
- package/dist/tools/resources.js.map +1 -0
- package/dist/tools/store.d.ts +63 -0
- package/dist/tools/store.d.ts.map +1 -0
- package/dist/tools/store.js +62 -0
- package/dist/tools/store.js.map +1 -0
- package/mcp-config.example.json +15 -0
- package/package.json +24 -0
- package/src/client.ts +99 -0
- package/src/config.ts +6 -0
- package/src/index.ts +112 -0
- package/src/resources/block-types.ts +298 -0
- package/src/resources/flow-schema.ts +148 -0
- package/src/tools/admin.ts +122 -0
- package/src/tools/ai-designer.ts +91 -0
- package/src/tools/analytics.ts +43 -0
- package/src/tools/auth.ts +33 -0
- package/src/tools/blocks.ts +174 -0
- package/src/tools/connections.ts +77 -0
- package/src/tools/eduflow.ts +112 -0
- package/src/tools/participants.ts +71 -0
- package/src/tools/presentation.ts +55 -0
- package/src/tools/projects.ts +55 -0
- package/src/tools/resources.ts +35 -0
- package/src/tools/store.ts +61 -0
- package/tsconfig.json +19 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { client } from '../client.js';
|
|
3
|
+
|
|
4
|
+
export const connectionsTools = {
|
|
5
|
+
connection_list: {
|
|
6
|
+
description: `Lister toutes les connexions (edges) d'un parcours EduFlow. Chaque connexion relie un bloc source à un bloc cible.
|
|
7
|
+
Règles de connexion :
|
|
8
|
+
- Le bloc "start" ne peut avoir QUE des connexions sortantes
|
|
9
|
+
- Le bloc "end" ne peut avoir QUE des connexions entrantes
|
|
10
|
+
- Un bloc "split" doit avoir au moins 2 connexions sortantes
|
|
11
|
+
- Un bloc "merge" doit avoir au moins 2 connexions entrantes
|
|
12
|
+
- Un bloc "quiz" peut avoir des connexions conditionnelles (branchement selon la réponse)`,
|
|
13
|
+
inputSchema: z.object({
|
|
14
|
+
flowId: z.string().uuid().describe('ID du parcours'),
|
|
15
|
+
}),
|
|
16
|
+
handler: async ({ flowId }: { flowId: string }) => {
|
|
17
|
+
const flow = await client.get(`/flows/${flowId}`, 'eduflow');
|
|
18
|
+
return {
|
|
19
|
+
edges: flow.edges || [],
|
|
20
|
+
blocks: (flow.blocks || []).map((b: any) => ({ id: b.id, type: b.type, title: b.title })),
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
connection_add: {
|
|
26
|
+
description: 'Ajouter une connexion entre deux blocs. Le parcours est un graphe orienté : source → target.',
|
|
27
|
+
inputSchema: z.object({
|
|
28
|
+
flowId: z.string().uuid().describe('ID du parcours'),
|
|
29
|
+
source: z.string().describe('ID du bloc source (d\'où part la connexion)'),
|
|
30
|
+
target: z.string().describe('ID du bloc cible (où arrive la connexion)'),
|
|
31
|
+
label: z.string().optional().describe('Label affiché sur la connexion (ex: "Bonne réponse", "Mauvaise réponse")'),
|
|
32
|
+
animated: z.boolean().optional().describe('Animer la connexion visuellement'),
|
|
33
|
+
}),
|
|
34
|
+
handler: async ({ flowId, source, target, label, animated }: any) => {
|
|
35
|
+
const flow = await client.get(`/flows/${flowId}`, 'eduflow');
|
|
36
|
+
const edges = flow.edges || [];
|
|
37
|
+
const newEdge = {
|
|
38
|
+
id: `e-${source}-${target}`,
|
|
39
|
+
source,
|
|
40
|
+
target,
|
|
41
|
+
label: label || '',
|
|
42
|
+
animated: animated || false,
|
|
43
|
+
};
|
|
44
|
+
// Check for duplicate
|
|
45
|
+
const exists = edges.some((e: any) => e.source === source && e.target === target);
|
|
46
|
+
if (exists) {
|
|
47
|
+
return { success: false, error: 'Cette connexion existe déjà' };
|
|
48
|
+
}
|
|
49
|
+
edges.push(newEdge);
|
|
50
|
+
await client.put(`/flows/${flowId}`, { edges }, 'eduflow');
|
|
51
|
+
return { success: true, edge: newEdge, totalEdges: edges.length };
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
connection_remove: {
|
|
56
|
+
description: 'Supprimer une connexion entre deux blocs.',
|
|
57
|
+
inputSchema: z.object({
|
|
58
|
+
flowId: z.string().uuid().describe('ID du parcours'),
|
|
59
|
+
edgeId: z.string().optional().describe('ID de la connexion à supprimer'),
|
|
60
|
+
source: z.string().optional().describe('Alternative : ID du bloc source'),
|
|
61
|
+
target: z.string().optional().describe('Alternative : ID du bloc cible'),
|
|
62
|
+
}),
|
|
63
|
+
handler: async ({ flowId, edgeId, source, target }: any) => {
|
|
64
|
+
const flow = await client.get(`/flows/${flowId}`, 'eduflow');
|
|
65
|
+
let edges = flow.edges || [];
|
|
66
|
+
if (edgeId) {
|
|
67
|
+
edges = edges.filter((e: any) => e.id !== edgeId);
|
|
68
|
+
} else if (source && target) {
|
|
69
|
+
edges = edges.filter((e: any) => !(e.source === source && e.target === target));
|
|
70
|
+
} else {
|
|
71
|
+
return { success: false, error: 'Fournir edgeId OU source+target' };
|
|
72
|
+
}
|
|
73
|
+
await client.put(`/flows/${flowId}`, { edges }, 'eduflow');
|
|
74
|
+
return { success: true, remainingEdges: edges.length };
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { client } from '../client.js';
|
|
3
|
+
|
|
4
|
+
export const eduflowTools = {
|
|
5
|
+
eduflow_list: {
|
|
6
|
+
description: 'Lister tous les parcours EduFlow de l\'utilisateur. Retourne id, titre, statut, nombre de blocs, dates.',
|
|
7
|
+
inputSchema: z.object({}),
|
|
8
|
+
handler: async () => {
|
|
9
|
+
return client.get('/flows', 'eduflow');
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
eduflow_get: {
|
|
14
|
+
description: 'Récupérer les détails complets d\'un parcours EduFlow : blocs, connexions (edges), objectifs, paramètres de gamification, présentation, etc.',
|
|
15
|
+
inputSchema: z.object({
|
|
16
|
+
flowId: z.string().uuid().describe('ID du parcours EduFlow'),
|
|
17
|
+
}),
|
|
18
|
+
handler: async ({ flowId }: { flowId: string }) => {
|
|
19
|
+
return client.get(`/flows/${flowId}`, 'eduflow');
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
eduflow_create: {
|
|
24
|
+
description: 'Créer un nouveau parcours EduFlow. Un bloc "start" et un bloc "end" sont automatiquement créés.',
|
|
25
|
+
inputSchema: z.object({
|
|
26
|
+
title: z.string().describe('Titre du parcours'),
|
|
27
|
+
description: z.string().optional().describe('Description du parcours'),
|
|
28
|
+
language: z.enum(['fr', 'en', 'es', 'it', 'de']).optional().describe('Langue du parcours (défaut: fr)'),
|
|
29
|
+
}),
|
|
30
|
+
handler: async (args: { title: string; description?: string; language?: string }) => {
|
|
31
|
+
return client.post('/flows', args, 'eduflow');
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
eduflow_update: {
|
|
36
|
+
description: 'Mettre à jour les propriétés d\'un parcours EduFlow (titre, description, edges, gamification, objectifs, présentation, etc.).',
|
|
37
|
+
inputSchema: z.object({
|
|
38
|
+
flowId: z.string().uuid().describe('ID du parcours'),
|
|
39
|
+
title: z.string().optional().describe('Nouveau titre'),
|
|
40
|
+
description: z.string().optional().describe('Nouvelle description'),
|
|
41
|
+
edges: z.array(z.object({
|
|
42
|
+
id: z.string(),
|
|
43
|
+
source: z.string().describe('ID du bloc source'),
|
|
44
|
+
target: z.string().describe('ID du bloc cible'),
|
|
45
|
+
label: z.string().optional().describe('Label de la connexion'),
|
|
46
|
+
animated: z.boolean().optional(),
|
|
47
|
+
})).optional().describe('Connexions entre blocs (remplace toutes les connexions existantes)'),
|
|
48
|
+
objectives: z.any().optional().describe('Objectifs pédagogiques {globalObjective, steps[]}'),
|
|
49
|
+
gamification: z.any().optional().describe('Configuration gamification {badges, missions, leaderboard, certifications}'),
|
|
50
|
+
presentationEnabled: z.boolean().optional().describe('Activer/désactiver la page de présentation'),
|
|
51
|
+
presentationData: z.any().optional().describe('Données de la page de présentation'),
|
|
52
|
+
chatbotEnabled: z.boolean().optional().describe('Activer/désactiver le chatbot IA'),
|
|
53
|
+
facialVerificationEnabled: z.boolean().optional().describe('Activer/désactiver la vérification faciale'),
|
|
54
|
+
deadline: z.string().optional().describe('Date limite ISO 8601'),
|
|
55
|
+
language: z.enum(['fr', 'en', 'es', 'it', 'de']).optional().describe('Langue du parcours'),
|
|
56
|
+
}),
|
|
57
|
+
handler: async ({ flowId, ...data }: any) => {
|
|
58
|
+
return client.put(`/flows/${flowId}`, data, 'eduflow');
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
eduflow_delete: {
|
|
63
|
+
description: 'Supprimer définitivement un parcours EduFlow et tous ses blocs, connexions, participants.',
|
|
64
|
+
inputSchema: z.object({
|
|
65
|
+
flowId: z.string().uuid().describe('ID du parcours à supprimer'),
|
|
66
|
+
}),
|
|
67
|
+
handler: async ({ flowId }: { flowId: string }) => {
|
|
68
|
+
return client.delete(`/flows/${flowId}`, 'eduflow');
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
eduflow_duplicate: {
|
|
73
|
+
description: 'Dupliquer un parcours EduFlow existant avec tous ses blocs et connexions.',
|
|
74
|
+
inputSchema: z.object({
|
|
75
|
+
flowId: z.string().uuid().describe('ID du parcours à dupliquer'),
|
|
76
|
+
}),
|
|
77
|
+
handler: async ({ flowId }: { flowId: string }) => {
|
|
78
|
+
return client.post(`/flows/${flowId}/duplicate`, {}, 'eduflow');
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
eduflow_change_status: {
|
|
83
|
+
description: 'Changer le statut d\'un parcours : draft (brouillon), published (publié, accessible aux étudiants), archived (archivé).',
|
|
84
|
+
inputSchema: z.object({
|
|
85
|
+
flowId: z.string().uuid().describe('ID du parcours'),
|
|
86
|
+
status: z.enum(['draft', 'published', 'archived']).describe('Nouveau statut'),
|
|
87
|
+
}),
|
|
88
|
+
handler: async ({ flowId, status }: { flowId: string; status: string }) => {
|
|
89
|
+
return client.patch(`/flows/${flowId}/status`, { status }, 'eduflow');
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
eduflow_export: {
|
|
94
|
+
description: 'Exporter un parcours EduFlow au format JSON (contient blocs, connexions, paramètres).',
|
|
95
|
+
inputSchema: z.object({
|
|
96
|
+
flowId: z.string().uuid().describe('ID du parcours à exporter'),
|
|
97
|
+
}),
|
|
98
|
+
handler: async ({ flowId }: { flowId: string }) => {
|
|
99
|
+
return client.get(`/flows/${flowId}/export`, 'eduflow');
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
eduflow_get_public: {
|
|
104
|
+
description: 'Récupérer les informations publiques d\'un parcours (page de présentation, objectifs). Ne nécessite pas d\'authentification.',
|
|
105
|
+
inputSchema: z.object({
|
|
106
|
+
flowId: z.string().uuid().describe('ID du parcours'),
|
|
107
|
+
}),
|
|
108
|
+
handler: async ({ flowId }: { flowId: string }) => {
|
|
109
|
+
return client.get(`/flows/${flowId}/public`, 'eduflow');
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { client } from '../client.js';
|
|
3
|
+
|
|
4
|
+
export const participantsTools = {
|
|
5
|
+
participant_list: {
|
|
6
|
+
description: 'Lister tous les participants/étudiants inscrits à un parcours EduFlow avec leur progression.',
|
|
7
|
+
inputSchema: z.object({
|
|
8
|
+
flowId: z.string().uuid().describe('ID du parcours'),
|
|
9
|
+
}),
|
|
10
|
+
handler: async ({ flowId }: { flowId: string }) => {
|
|
11
|
+
return client.get(`/flows/${flowId}/students`, 'eduflow');
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
participant_add: {
|
|
16
|
+
description: 'Ajouter un ou plusieurs participants à un parcours EduFlow. Chaque participant reçoit un lien unique.',
|
|
17
|
+
inputSchema: z.object({
|
|
18
|
+
flowId: z.string().uuid().describe('ID du parcours'),
|
|
19
|
+
participants: z.array(z.object({
|
|
20
|
+
email: z.string().email().describe('Email du participant'),
|
|
21
|
+
firstName: z.string().optional().describe('Prénom'),
|
|
22
|
+
lastName: z.string().optional().describe('Nom'),
|
|
23
|
+
})).describe('Liste des participants à ajouter'),
|
|
24
|
+
}),
|
|
25
|
+
handler: async ({ flowId, participants }: any) => {
|
|
26
|
+
return client.post(`/flows/${flowId}/students`, { students: participants }, 'eduflow');
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
participant_remove: {
|
|
31
|
+
description: 'Retirer un participant d\'un parcours EduFlow.',
|
|
32
|
+
inputSchema: z.object({
|
|
33
|
+
flowId: z.string().uuid().describe('ID du parcours'),
|
|
34
|
+
studentId: z.string().uuid().describe('ID de l\'inscription étudiant'),
|
|
35
|
+
}),
|
|
36
|
+
handler: async ({ flowId, studentId }: { flowId: string; studentId: string }) => {
|
|
37
|
+
return client.delete(`/flows/${flowId}/students/${studentId}`, 'eduflow');
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
participant_get_progress: {
|
|
42
|
+
description: 'Récupérer la progression détaillée d\'un participant : blocs complétés, scores, temps passé par bloc.',
|
|
43
|
+
inputSchema: z.object({
|
|
44
|
+
flowId: z.string().uuid().describe('ID du parcours'),
|
|
45
|
+
studentToken: z.string().describe('Token unique du participant'),
|
|
46
|
+
}),
|
|
47
|
+
handler: async ({ flowId, studentToken }: { flowId: string; studentToken: string }) => {
|
|
48
|
+
return client.get(`/eduflow/progress/stats/${flowId}/${studentToken}`);
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
participant_get_overview: {
|
|
53
|
+
description: 'Vue d\'ensemble d\'un participant global : tous les parcours suivis, certifications, progression globale.',
|
|
54
|
+
inputSchema: z.object({
|
|
55
|
+
participantId: z.string().uuid().describe('ID global du participant'),
|
|
56
|
+
}),
|
|
57
|
+
handler: async ({ participantId }: { participantId: string }) => {
|
|
58
|
+
return client.get(`/participants/${participantId}/overview`, 'eduflow');
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
participant_get_flow_stats: {
|
|
63
|
+
description: 'Récupérer les statistiques de tous les participants d\'un parcours (taux de complétion, scores moyens, temps moyen).',
|
|
64
|
+
inputSchema: z.object({
|
|
65
|
+
flowId: z.string().uuid().describe('ID du parcours'),
|
|
66
|
+
}),
|
|
67
|
+
handler: async ({ flowId }: { flowId: string }) => {
|
|
68
|
+
return client.get(`/eduflow/progress/stats/flow/${flowId}`);
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { client } from '../client.js';
|
|
3
|
+
|
|
4
|
+
export const presentationTools = {
|
|
5
|
+
presentation_get: {
|
|
6
|
+
description: 'Récupérer la page de présentation d\'un parcours EduFlow (description, objectifs, image de couverture, structure affichée).',
|
|
7
|
+
inputSchema: z.object({
|
|
8
|
+
flowId: z.string().uuid().describe('ID du parcours'),
|
|
9
|
+
}),
|
|
10
|
+
handler: async ({ flowId }: { flowId: string }) => {
|
|
11
|
+
const flow = await client.get(`/flows/${flowId}`, 'eduflow');
|
|
12
|
+
return {
|
|
13
|
+
presentationEnabled: flow.presentationEnabled,
|
|
14
|
+
presentationData: flow.presentationData,
|
|
15
|
+
objectives: flow.objectives,
|
|
16
|
+
title: flow.title,
|
|
17
|
+
description: flow.description,
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
presentation_update: {
|
|
23
|
+
description: `Mettre à jour la page de présentation d'un parcours. La présentation est la page publique visible par les futurs participants.
|
|
24
|
+
Structure de presentationData : { heroTitle, heroSubtitle, heroImage, sections[{ type, title, content }], ctaText, ctaUrl }`,
|
|
25
|
+
inputSchema: z.object({
|
|
26
|
+
flowId: z.string().uuid().describe('ID du parcours'),
|
|
27
|
+
presentationData: z.object({
|
|
28
|
+
heroTitle: z.string().optional().describe('Titre principal de la page'),
|
|
29
|
+
heroSubtitle: z.string().optional().describe('Sous-titre'),
|
|
30
|
+
heroImage: z.string().optional().describe('URL de l\'image de couverture'),
|
|
31
|
+
sections: z.array(z.object({
|
|
32
|
+
type: z.string().describe('Type de section (text, objectives, structure, testimonials)'),
|
|
33
|
+
title: z.string().describe('Titre de la section'),
|
|
34
|
+
content: z.any().describe('Contenu de la section'),
|
|
35
|
+
})).optional().describe('Sections de la page'),
|
|
36
|
+
ctaText: z.string().optional().describe('Texte du bouton d\'action'),
|
|
37
|
+
ctaUrl: z.string().optional().describe('URL du bouton d\'action'),
|
|
38
|
+
}).describe('Données de la page de présentation'),
|
|
39
|
+
}),
|
|
40
|
+
handler: async ({ flowId, presentationData }: any) => {
|
|
41
|
+
return client.put(`/flows/${flowId}`, { presentationData }, 'eduflow');
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
presentation_toggle: {
|
|
46
|
+
description: 'Activer ou désactiver la page de présentation publique d\'un parcours.',
|
|
47
|
+
inputSchema: z.object({
|
|
48
|
+
flowId: z.string().uuid().describe('ID du parcours'),
|
|
49
|
+
enabled: z.boolean().describe('true pour activer, false pour désactiver'),
|
|
50
|
+
}),
|
|
51
|
+
handler: async ({ flowId, enabled }: { flowId: string; enabled: boolean }) => {
|
|
52
|
+
return client.put(`/flows/${flowId}`, { presentationEnabled: enabled }, 'eduflow');
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { client } from '../client.js';
|
|
3
|
+
|
|
4
|
+
export const projectsTools = {
|
|
5
|
+
project_list: {
|
|
6
|
+
description: 'Lister tous les projets audio de l\'utilisateur (PDF convertis en audio).',
|
|
7
|
+
inputSchema: z.object({}),
|
|
8
|
+
handler: async () => {
|
|
9
|
+
return client.get('/projects');
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
project_get: {
|
|
14
|
+
description: 'Détails d\'un projet audio : titre, chapitres, voix, durée, statut, fichiers générés.',
|
|
15
|
+
inputSchema: z.object({
|
|
16
|
+
projectId: z.string().uuid().describe('ID du projet'),
|
|
17
|
+
}),
|
|
18
|
+
handler: async ({ projectId }: { projectId: string }) => {
|
|
19
|
+
return client.get(`/projects/${projectId}`);
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
project_create: {
|
|
24
|
+
description: 'Créer un nouveau projet audio.',
|
|
25
|
+
inputSchema: z.object({
|
|
26
|
+
title: z.string().describe('Titre du projet'),
|
|
27
|
+
description: z.string().optional().describe('Description'),
|
|
28
|
+
}),
|
|
29
|
+
handler: async (data: any) => {
|
|
30
|
+
return client.post('/projects', data);
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
project_update: {
|
|
35
|
+
description: 'Mettre à jour un projet audio (titre, description, paramètres de voix).',
|
|
36
|
+
inputSchema: z.object({
|
|
37
|
+
projectId: z.string().uuid().describe('ID du projet'),
|
|
38
|
+
title: z.string().optional().describe('Nouveau titre'),
|
|
39
|
+
description: z.string().optional().describe('Nouvelle description'),
|
|
40
|
+
}),
|
|
41
|
+
handler: async ({ projectId, ...data }: any) => {
|
|
42
|
+
return client.put(`/projects/${projectId}`, data);
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
project_delete: {
|
|
47
|
+
description: 'Supprimer un projet audio et tous ses fichiers associés.',
|
|
48
|
+
inputSchema: z.object({
|
|
49
|
+
projectId: z.string().uuid().describe('ID du projet à supprimer'),
|
|
50
|
+
}),
|
|
51
|
+
handler: async ({ projectId }: { projectId: string }) => {
|
|
52
|
+
return client.delete(`/projects/${projectId}`);
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { client } from '../client.js';
|
|
3
|
+
|
|
4
|
+
export const resourcesTools = {
|
|
5
|
+
resource_list: {
|
|
6
|
+
description: 'Lister les ressources de l\'utilisateur (images, documents, sons, vidéos) avec pagination.',
|
|
7
|
+
inputSchema: z.object({
|
|
8
|
+
type: z.enum(['images', 'documents', 'sounds', 'videos']).describe('Type de ressource'),
|
|
9
|
+
}),
|
|
10
|
+
handler: async ({ type }: { type: string }) => {
|
|
11
|
+
return client.get(`/user-resources/${type}`);
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
resource_delete: {
|
|
16
|
+
description: 'Supprimer une ressource uploadée.',
|
|
17
|
+
inputSchema: z.object({
|
|
18
|
+
type: z.enum(['images', 'documents', 'sounds', 'videos']).describe('Type de ressource'),
|
|
19
|
+
resourceId: z.string().uuid().describe('ID de la ressource'),
|
|
20
|
+
}),
|
|
21
|
+
handler: async ({ type, resourceId }: { type: string; resourceId: string }) => {
|
|
22
|
+
return client.delete(`/user-resources/${type}/${resourceId}`);
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
resource_list_categories: {
|
|
27
|
+
description: 'Lister les catégories disponibles pour un type de ressource.',
|
|
28
|
+
inputSchema: z.object({
|
|
29
|
+
type: z.enum(['images', 'documents', 'sounds', 'videos']).describe('Type de ressource'),
|
|
30
|
+
}),
|
|
31
|
+
handler: async ({ type }: { type: string }) => {
|
|
32
|
+
return client.get(`/categories/${type}`);
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { client } from '../client.js';
|
|
3
|
+
|
|
4
|
+
export const storeTools = {
|
|
5
|
+
store_list_audiobooks: {
|
|
6
|
+
description: 'Lister les audiobooks disponibles dans le store LYRRA. Supporte la pagination, recherche et filtres.',
|
|
7
|
+
inputSchema: z.object({
|
|
8
|
+
page: z.number().optional().describe('Page (défaut: 1)'),
|
|
9
|
+
limit: z.number().optional().describe('Nombre par page (défaut: 20)'),
|
|
10
|
+
search: z.string().optional().describe('Recherche par titre/auteur'),
|
|
11
|
+
category: z.string().optional().describe('Filtrer par catégorie'),
|
|
12
|
+
featured: z.boolean().optional().describe('Uniquement les audiobooks mis en avant'),
|
|
13
|
+
}),
|
|
14
|
+
handler: async ({ page, limit, search, category, featured }: any) => {
|
|
15
|
+
const params = new URLSearchParams();
|
|
16
|
+
if (page) params.set('page', String(page));
|
|
17
|
+
if (limit) params.set('limit', String(limit));
|
|
18
|
+
if (search) params.set('search', search);
|
|
19
|
+
if (category) params.set('category', category);
|
|
20
|
+
if (featured) params.set('featured', 'true');
|
|
21
|
+
const query = params.toString() ? `?${params}` : '';
|
|
22
|
+
return client.post(`/store/public/audiobooks${query}`, {});
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
store_get_audiobook: {
|
|
27
|
+
description: 'Détails complets d\'un audiobook : chapitres, auteur, avis, prix en crédits, statistiques.',
|
|
28
|
+
inputSchema: z.object({
|
|
29
|
+
audiobookId: z.string().describe('ID de l\'audiobook'),
|
|
30
|
+
}),
|
|
31
|
+
handler: async ({ audiobookId }: { audiobookId: string }) => {
|
|
32
|
+
return client.get(`/store/public/audiobooks/${audiobookId}`);
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
store_list_authors: {
|
|
37
|
+
description: 'Lister les auteurs mis en avant sur le store.',
|
|
38
|
+
inputSchema: z.object({}),
|
|
39
|
+
handler: async () => {
|
|
40
|
+
return client.get('/store/public/authors/featured');
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
store_my_library: {
|
|
45
|
+
description: 'Récupérer ma bibliothèque d\'audiobooks achetés.',
|
|
46
|
+
inputSchema: z.object({}),
|
|
47
|
+
handler: async () => {
|
|
48
|
+
return client.get('/store/my-library');
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
store_search: {
|
|
53
|
+
description: 'Rechercher des audiobooks dans le store par mot-clé.',
|
|
54
|
+
inputSchema: z.object({
|
|
55
|
+
query: z.string().describe('Terme de recherche'),
|
|
56
|
+
}),
|
|
57
|
+
handler: async ({ query }: { query: string }) => {
|
|
58
|
+
return client.post('/store/public/audiobooks', { search: query });
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
};
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ES2022",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"declaration": true,
|
|
14
|
+
"declarationMap": true,
|
|
15
|
+
"sourceMap": true
|
|
16
|
+
},
|
|
17
|
+
"include": ["src/**/*"],
|
|
18
|
+
"exclude": ["node_modules", "dist"]
|
|
19
|
+
}
|