@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.
Files changed (89) hide show
  1. package/README.md +214 -0
  2. package/dist/client.d.ts +17 -0
  3. package/dist/client.d.ts.map +1 -0
  4. package/dist/client.js +92 -0
  5. package/dist/client.js.map +1 -0
  6. package/dist/config.d.ts +7 -0
  7. package/dist/config.d.ts.map +1 -0
  8. package/dist/config.js +7 -0
  9. package/dist/config.js.map +1 -0
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +84 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/resources/block-types.d.ts +318 -0
  15. package/dist/resources/block-types.d.ts.map +1 -0
  16. package/dist/resources/block-types.js +297 -0
  17. package/dist/resources/block-types.js.map +1 -0
  18. package/dist/resources/flow-schema.d.ts +147 -0
  19. package/dist/resources/flow-schema.d.ts.map +1 -0
  20. package/dist/resources/flow-schema.js +143 -0
  21. package/dist/resources/flow-schema.js.map +1 -0
  22. package/dist/tools/admin.d.ts +133 -0
  23. package/dist/tools/admin.d.ts.map +1 -0
  24. package/dist/tools/admin.js +114 -0
  25. package/dist/tools/admin.js.map +1 -0
  26. package/dist/tools/ai-designer.d.ts +149 -0
  27. package/dist/tools/ai-designer.d.ts.map +1 -0
  28. package/dist/tools/ai-designer.js +85 -0
  29. package/dist/tools/ai-designer.js.map +1 -0
  30. package/dist/tools/analytics.d.ts +48 -0
  31. package/dist/tools/analytics.d.ts.map +1 -0
  32. package/dist/tools/analytics.js +40 -0
  33. package/dist/tools/analytics.js.map +1 -0
  34. package/dist/tools/auth.d.ts +31 -0
  35. package/dist/tools/auth.d.ts.map +1 -0
  36. package/dist/tools/auth.js +32 -0
  37. package/dist/tools/auth.js.map +1 -0
  38. package/dist/tools/blocks.d.ts +201 -0
  39. package/dist/tools/blocks.d.ts.map +1 -0
  40. package/dist/tools/blocks.js +163 -0
  41. package/dist/tools/blocks.js.map +1 -0
  42. package/dist/tools/connections.d.ts +87 -0
  43. package/dist/tools/connections.d.ts.map +1 -0
  44. package/dist/tools/connections.js +77 -0
  45. package/dist/tools/connections.js.map +1 -0
  46. package/dist/tools/eduflow.d.ts +186 -0
  47. package/dist/tools/eduflow.d.ts.map +1 -0
  48. package/dist/tools/eduflow.js +104 -0
  49. package/dist/tools/eduflow.js.map +1 -0
  50. package/dist/tools/participants.d.ts +111 -0
  51. package/dist/tools/participants.d.ts.map +1 -0
  52. package/dist/tools/participants.js +66 -0
  53. package/dist/tools/participants.js.map +1 -0
  54. package/dist/tools/presentation.d.ts +117 -0
  55. package/dist/tools/presentation.d.ts.map +1 -0
  56. package/dist/tools/presentation.js +53 -0
  57. package/dist/tools/presentation.js.map +1 -0
  58. package/dist/tools/projects.d.ts +66 -0
  59. package/dist/tools/projects.d.ts.map +1 -0
  60. package/dist/tools/projects.js +51 -0
  61. package/dist/tools/projects.js.map +1 -0
  62. package/dist/tools/resources.d.ts +47 -0
  63. package/dist/tools/resources.d.ts.map +1 -0
  64. package/dist/tools/resources.js +33 -0
  65. package/dist/tools/resources.js.map +1 -0
  66. package/dist/tools/store.d.ts +63 -0
  67. package/dist/tools/store.d.ts.map +1 -0
  68. package/dist/tools/store.js +62 -0
  69. package/dist/tools/store.js.map +1 -0
  70. package/mcp-config.example.json +15 -0
  71. package/package.json +24 -0
  72. package/src/client.ts +99 -0
  73. package/src/config.ts +6 -0
  74. package/src/index.ts +112 -0
  75. package/src/resources/block-types.ts +298 -0
  76. package/src/resources/flow-schema.ts +148 -0
  77. package/src/tools/admin.ts +122 -0
  78. package/src/tools/ai-designer.ts +91 -0
  79. package/src/tools/analytics.ts +43 -0
  80. package/src/tools/auth.ts +33 -0
  81. package/src/tools/blocks.ts +174 -0
  82. package/src/tools/connections.ts +77 -0
  83. package/src/tools/eduflow.ts +112 -0
  84. package/src/tools/participants.ts +71 -0
  85. package/src/tools/presentation.ts +55 -0
  86. package/src/tools/projects.ts +55 -0
  87. package/src/tools/resources.ts +35 -0
  88. package/src/tools/store.ts +61 -0
  89. package/tsconfig.json +19 -0
@@ -0,0 +1,163 @@
1
+ import { z } from 'zod';
2
+ import { client } from '../client.js';
3
+ const blockContentSchema = z.record(z.any()).describe('Contenu du bloc (structure variable selon le type). Utiliser la resource lyrra://block-types pour connaître la structure attendue.');
4
+ export const blocksTools = {
5
+ block_list_types: {
6
+ description: `Lister tous les types de blocs disponibles avec leur documentation complète.
7
+ Types disponibles : text, audio, quiz, video, pdf, image, loop, evaluation, split, merge, timer, start, end, chart, timeline, dys_reader, dys_image_zones, dys_reading_practice, dys_clock, glossary, subflow, mindmap, form, certification, email, voice_assessment, presentation, browser, self_assessment.
8
+ Utiliser plutôt la resource lyrra://block-types pour la documentation complète.`,
9
+ inputSchema: z.object({}),
10
+ handler: async () => {
11
+ return {
12
+ types: [
13
+ { type: 'start', name: 'Début', description: 'Point de départ du parcours. Un seul par flux.' },
14
+ { type: 'end', name: 'Fin', description: 'Point de fin du parcours. Peut avoir plusieurs fins.' },
15
+ { type: 'text', name: 'Texte', description: 'Contenu textuel/HTML enrichi. TOUJOURS utiliser format: "html".' },
16
+ { type: 'audio', name: 'Audio', description: 'Intègre un projet audio LYRRA avec texte synchronisé.' },
17
+ { type: 'video', name: 'Vidéo', description: 'Intègre une vidéo (URL YouTube/Vimeo ou fichier uploadé).' },
18
+ { type: 'pdf', name: 'PDF', description: 'Affiche un document PDF intégré.' },
19
+ { type: 'image', name: 'Image', description: 'Affiche une image avec légende optionnelle.' },
20
+ { type: 'quiz', name: 'Quiz', description: 'Question QCM/vrai-faux/ordonnancement avec branchement conditionnel.' },
21
+ { type: 'evaluation', name: 'Évaluation', description: 'Évaluation complète avec plusieurs questions et scoring.' },
22
+ { type: 'form', name: 'Formulaire', description: 'Formulaire avec champs personnalisés et logique conditionnelle.' },
23
+ { type: 'chart', name: 'Graphique', description: 'Graphique interactif (bar, line, pie, scatter, radar, area, doughnut).' },
24
+ { type: 'timeline', name: 'Frise chronologique', description: 'Frise avec événements datés.' },
25
+ { type: 'mindmap', name: 'Carte mentale', description: 'Carte mentale interactive avec nœuds et liens.' },
26
+ { type: 'glossary', name: 'Glossaire', description: 'Liste de termes et définitions.' },
27
+ { type: 'split', name: 'Embranchement', description: 'Sépare le flux en branches parallèles.' },
28
+ { type: 'merge', name: 'Fusion', description: 'Rejoint les branches parallèles.' },
29
+ { type: 'loop', name: 'Boucle', description: 'Permet de répéter une séquence de blocs.' },
30
+ { type: 'timer', name: 'Minuteur', description: 'Bloc avec temps limité, pause, rappel ou expiration.' },
31
+ { type: 'subflow', name: 'Sous-parcours', description: 'Intègre un autre parcours EduFlow comme bloc.' },
32
+ { type: 'certification', name: 'Certification', description: 'Génère un certificat PDF personnalisé.' },
33
+ { type: 'email', name: 'Email', description: 'Envoie un email automatique (certification, rappel).' },
34
+ { type: 'voice_assessment', name: 'Évaluation vocale', description: 'Enregistrement et évaluation de la voix de l\'étudiant.' },
35
+ { type: 'self_assessment', name: 'Auto-évaluation', description: 'L\'étudiant s\'évalue lui-même sur des critères définis.' },
36
+ { type: 'presentation', name: 'Présentation', description: 'Diaporama avec slides.' },
37
+ { type: 'browser', name: 'Navigateur', description: 'Intègre une page web dans un iframe.' },
38
+ { type: 'dys_reader', name: 'Lecteur DYS', description: 'Texte adapté pour la dyslexie avec police et espacement spéciaux.' },
39
+ { type: 'dys_image_zones', name: 'Zones d\'image DYS', description: 'Image avec zones cliquables pour la dyslexie.' },
40
+ { type: 'dys_reading_practice', name: 'Pratique lecture DYS', description: 'Exercice de lecture adapté dyslexie.' },
41
+ { type: 'dys_clock', name: 'Horloge DYS', description: 'Exercice de lecture de l\'heure pour la dyscalculie.' },
42
+ ],
43
+ };
44
+ },
45
+ },
46
+ block_get: {
47
+ description: 'Récupérer les détails complets d\'un bloc (type, contenu, position, conditions, commentaire).',
48
+ inputSchema: z.object({
49
+ flowId: z.string().uuid().describe('ID du parcours'),
50
+ blockId: z.string().uuid().describe('ID du bloc'),
51
+ }),
52
+ handler: async ({ flowId, blockId }) => {
53
+ return client.get(`/flows/${flowId}/blocks/${blockId}`, 'eduflow');
54
+ },
55
+ },
56
+ block_create: {
57
+ description: `Créer un nouveau bloc dans un parcours EduFlow. Le bloc est ajouté mais pas encore connecté (utiliser connection_add ensuite).
58
+ IMPORTANT pour le type "text" : toujours utiliser content.format = "html" et du HTML dans content.text (pas de Markdown).`,
59
+ inputSchema: z.object({
60
+ flowId: z.string().uuid().describe('ID du parcours'),
61
+ type: z.enum([
62
+ 'text', 'audio', 'quiz', 'video', 'pdf', 'image', 'loop', 'evaluation',
63
+ 'split', 'merge', 'timer', 'start', 'end', 'chart', 'timeline',
64
+ 'dys_reader', 'dys_image_zones', 'dys_reading_practice', 'dys_clock',
65
+ 'glossary', 'subflow', 'mindmap', 'form', 'certification', 'email',
66
+ 'voice_assessment', 'presentation', 'browser', 'self_assessment',
67
+ ]).describe('Type de bloc à créer'),
68
+ title: z.string().describe('Titre du bloc'),
69
+ content: blockContentSchema,
70
+ positionX: z.number().optional().describe('Position X dans l\'éditeur visuel (défaut: 0)'),
71
+ positionY: z.number().optional().describe('Position Y dans l\'éditeur visuel (défaut: 0)'),
72
+ order: z.number().optional().describe('Ordre d\'affichage'),
73
+ }),
74
+ handler: async ({ flowId, ...blockData }) => {
75
+ // Use batch update to add a single block
76
+ const flow = await client.get(`/flows/${flowId}`, 'eduflow');
77
+ const existingBlocks = flow.blocks || [];
78
+ const newBlock = {
79
+ id: crypto.randomUUID(),
80
+ ...blockData,
81
+ positionX: blockData.positionX ?? (existingBlocks.length * 300),
82
+ positionY: blockData.positionY ?? 200,
83
+ order: blockData.order ?? existingBlocks.length,
84
+ };
85
+ const allBlocks = [...existingBlocks.map((b) => ({
86
+ id: b.id, type: b.type, title: b.title,
87
+ content: b.content, positionX: b.positionX, positionY: b.positionY,
88
+ order: b.order, conditions: b.conditions, comment: b.comment,
89
+ })), newBlock];
90
+ await client.put(`/flows/${flowId}/blocks`, allBlocks, 'eduflow');
91
+ return { success: true, block: newBlock };
92
+ },
93
+ },
94
+ block_update: {
95
+ description: 'Mettre à jour un bloc existant (titre, contenu, position, conditions).',
96
+ inputSchema: z.object({
97
+ flowId: z.string().uuid().describe('ID du parcours'),
98
+ blockId: z.string().uuid().describe('ID du bloc à modifier'),
99
+ title: z.string().optional().describe('Nouveau titre'),
100
+ content: blockContentSchema.optional(),
101
+ positionX: z.number().optional().describe('Nouvelle position X'),
102
+ positionY: z.number().optional().describe('Nouvelle position Y'),
103
+ order: z.number().optional().describe('Nouvel ordre'),
104
+ conditions: z.any().optional().describe('Conditions de branchement'),
105
+ comment: z.string().optional().describe('Commentaire créateur'),
106
+ }),
107
+ handler: async ({ flowId, blockId, ...data }) => {
108
+ return client.put(`/flows/${flowId}/blocks/${blockId}`, data, 'eduflow');
109
+ },
110
+ },
111
+ block_batch_update: {
112
+ description: 'Mettre à jour plusieurs blocs en une seule opération. Utile pour repositionner ou réorganiser tous les blocs.',
113
+ inputSchema: z.object({
114
+ flowId: z.string().uuid().describe('ID du parcours'),
115
+ blocks: z.array(z.object({
116
+ id: z.string().describe('ID du bloc'),
117
+ type: z.string().describe('Type du bloc'),
118
+ title: z.string().describe('Titre'),
119
+ content: z.any().describe('Contenu'),
120
+ positionX: z.number().optional(),
121
+ positionY: z.number().optional(),
122
+ order: z.number().optional(),
123
+ conditions: z.any().optional(),
124
+ comment: z.string().optional(),
125
+ })).describe('Liste complète des blocs (REMPLACE tous les blocs existants)'),
126
+ }),
127
+ handler: async ({ flowId, blocks }) => {
128
+ return client.put(`/flows/${flowId}/blocks`, blocks, 'eduflow');
129
+ },
130
+ },
131
+ block_delete: {
132
+ description: 'Supprimer un bloc d\'un parcours. Les connexions liées sont automatiquement supprimées.',
133
+ inputSchema: z.object({
134
+ flowId: z.string().uuid().describe('ID du parcours'),
135
+ blockId: z.string().uuid().describe('ID du bloc à supprimer'),
136
+ }),
137
+ handler: async ({ flowId, blockId }) => {
138
+ // Get current flow, remove block, remove related edges, batch update
139
+ const flow = await client.get(`/flows/${flowId}`, 'eduflow');
140
+ const blocks = (flow.blocks || []).filter((b) => b.id !== blockId);
141
+ const edges = (flow.edges || []).filter((e) => e.source !== blockId && e.target !== blockId);
142
+ const mappedBlocks = blocks.map((b) => ({
143
+ id: b.id, type: b.type, title: b.title,
144
+ content: b.content, positionX: b.positionX, positionY: b.positionY,
145
+ order: b.order, conditions: b.conditions, comment: b.comment,
146
+ }));
147
+ await client.put(`/flows/${flowId}/blocks`, mappedBlocks, 'eduflow');
148
+ await client.put(`/flows/${flowId}`, { edges }, 'eduflow');
149
+ return { success: true, remainingBlocks: blocks.length, remainingEdges: edges.length };
150
+ },
151
+ },
152
+ block_generate_tts: {
153
+ description: 'Générer l\'audio TTS (text-to-speech) pour un bloc texte. L\'audio est attaché au bloc.',
154
+ inputSchema: z.object({
155
+ flowId: z.string().uuid().describe('ID du parcours'),
156
+ blockId: z.string().uuid().describe('ID du bloc'),
157
+ }),
158
+ handler: async ({ flowId, blockId }) => {
159
+ return client.post(`/blocks/${blockId}/generate-tts`, { flowId }, 'eduflow');
160
+ },
161
+ },
162
+ };
163
+ //# sourceMappingURL=blocks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blocks.js","sourceRoot":"","sources":["../../src/tools/blocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,CACnD,oIAAoI,CACrI,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,gBAAgB,EAAE;QAChB,WAAW,EAAE;;gFAE+D;QAC5E,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,OAAO;gBAC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AS,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS;gBAClE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO;aAC7D,CAAC,CAAC,CAAC;YACJ,MAAM,MAAM,CAAC,GAAG,CAAC,UAAU,MAAM,SAAS,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;YACrE,MAAM,MAAM,CAAC,GAAG,CAAC,UAAU,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,CAAC,CAAC;YAC3D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;QACzF,CAAC;KACF;IAED,kBAAkB,EAAE;QAClB,WAAW,EAAE,yFAAyF;QACtG,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;YACpD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;SAClD,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAuC,EAAE,EAAE;YAC1E,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,OAAO,eAAe,EAAE,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC,CAAC;QAC/E,CAAC;KACF;CACF,CAAC"}
@@ -0,0 +1,87 @@
1
+ import { z } from 'zod';
2
+ export declare const connectionsTools: {
3
+ connection_list: {
4
+ description: string;
5
+ inputSchema: z.ZodObject<{
6
+ flowId: z.ZodString;
7
+ }, "strip", z.ZodTypeAny, {
8
+ flowId: string;
9
+ }, {
10
+ flowId: string;
11
+ }>;
12
+ handler: ({ flowId }: {
13
+ flowId: string;
14
+ }) => Promise<{
15
+ edges: any;
16
+ blocks: any;
17
+ }>;
18
+ };
19
+ connection_add: {
20
+ description: string;
21
+ inputSchema: z.ZodObject<{
22
+ flowId: z.ZodString;
23
+ source: z.ZodString;
24
+ target: z.ZodString;
25
+ label: z.ZodOptional<z.ZodString>;
26
+ animated: z.ZodOptional<z.ZodBoolean>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ flowId: string;
29
+ source: string;
30
+ target: string;
31
+ label?: string | undefined;
32
+ animated?: boolean | undefined;
33
+ }, {
34
+ flowId: string;
35
+ source: string;
36
+ target: string;
37
+ label?: string | undefined;
38
+ animated?: boolean | undefined;
39
+ }>;
40
+ handler: ({ flowId, source, target, label, animated }: any) => Promise<{
41
+ success: boolean;
42
+ error: string;
43
+ edge?: undefined;
44
+ totalEdges?: undefined;
45
+ } | {
46
+ success: boolean;
47
+ edge: {
48
+ id: string;
49
+ source: any;
50
+ target: any;
51
+ label: any;
52
+ animated: any;
53
+ };
54
+ totalEdges: any;
55
+ error?: undefined;
56
+ }>;
57
+ };
58
+ connection_remove: {
59
+ description: string;
60
+ inputSchema: z.ZodObject<{
61
+ flowId: z.ZodString;
62
+ edgeId: z.ZodOptional<z.ZodString>;
63
+ source: z.ZodOptional<z.ZodString>;
64
+ target: z.ZodOptional<z.ZodString>;
65
+ }, "strip", z.ZodTypeAny, {
66
+ flowId: string;
67
+ source?: string | undefined;
68
+ target?: string | undefined;
69
+ edgeId?: string | undefined;
70
+ }, {
71
+ flowId: string;
72
+ source?: string | undefined;
73
+ target?: string | undefined;
74
+ edgeId?: string | undefined;
75
+ }>;
76
+ handler: ({ flowId, edgeId, source, target }: any) => Promise<{
77
+ success: boolean;
78
+ error: string;
79
+ remainingEdges?: undefined;
80
+ } | {
81
+ success: boolean;
82
+ remainingEdges: any;
83
+ error?: undefined;
84
+ }>;
85
+ };
86
+ };
87
+ //# sourceMappingURL=connections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../../src/tools/connections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,gBAAgB;;;;;;;;;;8BAYG;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;+DAkBe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDA6BZ,GAAG;;;;;;;;;;CAc1D,CAAC"}
@@ -0,0 +1,77 @@
1
+ import { z } from 'zod';
2
+ import { client } from '../client.js';
3
+ export const connectionsTools = {
4
+ connection_list: {
5
+ description: `Lister toutes les connexions (edges) d'un parcours EduFlow. Chaque connexion relie un bloc source à un bloc cible.
6
+ Règles de connexion :
7
+ - Le bloc "start" ne peut avoir QUE des connexions sortantes
8
+ - Le bloc "end" ne peut avoir QUE des connexions entrantes
9
+ - Un bloc "split" doit avoir au moins 2 connexions sortantes
10
+ - Un bloc "merge" doit avoir au moins 2 connexions entrantes
11
+ - Un bloc "quiz" peut avoir des connexions conditionnelles (branchement selon la réponse)`,
12
+ inputSchema: z.object({
13
+ flowId: z.string().uuid().describe('ID du parcours'),
14
+ }),
15
+ handler: async ({ flowId }) => {
16
+ const flow = await client.get(`/flows/${flowId}`, 'eduflow');
17
+ return {
18
+ edges: flow.edges || [],
19
+ blocks: (flow.blocks || []).map((b) => ({ id: b.id, type: b.type, title: b.title })),
20
+ };
21
+ },
22
+ },
23
+ connection_add: {
24
+ description: 'Ajouter une connexion entre deux blocs. Le parcours est un graphe orienté : source → target.',
25
+ inputSchema: z.object({
26
+ flowId: z.string().uuid().describe('ID du parcours'),
27
+ source: z.string().describe('ID du bloc source (d\'où part la connexion)'),
28
+ target: z.string().describe('ID du bloc cible (où arrive la connexion)'),
29
+ label: z.string().optional().describe('Label affiché sur la connexion (ex: "Bonne réponse", "Mauvaise réponse")'),
30
+ animated: z.boolean().optional().describe('Animer la connexion visuellement'),
31
+ }),
32
+ handler: async ({ flowId, source, target, label, animated }) => {
33
+ const flow = await client.get(`/flows/${flowId}`, 'eduflow');
34
+ const edges = flow.edges || [];
35
+ const newEdge = {
36
+ id: `e-${source}-${target}`,
37
+ source,
38
+ target,
39
+ label: label || '',
40
+ animated: animated || false,
41
+ };
42
+ // Check for duplicate
43
+ const exists = edges.some((e) => e.source === source && e.target === target);
44
+ if (exists) {
45
+ return { success: false, error: 'Cette connexion existe déjà' };
46
+ }
47
+ edges.push(newEdge);
48
+ await client.put(`/flows/${flowId}`, { edges }, 'eduflow');
49
+ return { success: true, edge: newEdge, totalEdges: edges.length };
50
+ },
51
+ },
52
+ connection_remove: {
53
+ description: 'Supprimer une connexion entre deux blocs.',
54
+ inputSchema: z.object({
55
+ flowId: z.string().uuid().describe('ID du parcours'),
56
+ edgeId: z.string().optional().describe('ID de la connexion à supprimer'),
57
+ source: z.string().optional().describe('Alternative : ID du bloc source'),
58
+ target: z.string().optional().describe('Alternative : ID du bloc cible'),
59
+ }),
60
+ handler: async ({ flowId, edgeId, source, target }) => {
61
+ const flow = await client.get(`/flows/${flowId}`, 'eduflow');
62
+ let edges = flow.edges || [];
63
+ if (edgeId) {
64
+ edges = edges.filter((e) => e.id !== edgeId);
65
+ }
66
+ else if (source && target) {
67
+ edges = edges.filter((e) => !(e.source === source && e.target === target));
68
+ }
69
+ else {
70
+ return { success: false, error: 'Fournir edgeId OU source+target' };
71
+ }
72
+ await client.put(`/flows/${flowId}`, { edges }, 'eduflow');
73
+ return { success: true, remainingEdges: edges.length };
74
+ },
75
+ },
76
+ };
77
+ //# sourceMappingURL=connections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connections.js","sourceRoot":"","sources":["../../src/tools/connections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,eAAe,EAAE;QAC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are const eduflowTools: {
3
+ eduflow_list: {
4
+ description: string;
5
+ inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
6
+ handler: () => Promise<any>;
7
+ };
8
+ eduflow_get: {
9
+ description: string;
10
+ inputSchema: z.ZodObject<{
11
+ flowId: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ flowId: string;
14
+ }, {
15
+ flowId: string;
16
+ }>;
17
+ handler: ({ flowId }: {
18
+ flowId: string;
19
+ }) => Promise<any>;
20
+ };
21
+ eduflow_create: {
22
+ description: string;
23
+ inputSchema: z.ZodObject<{
24
+ title: z.ZodString;
25
+ description: z.ZodOptional<z.ZodString>;
26
+ language: z.ZodOptional<z.ZodEnum<["fr", "en", "es", "it", "de"]>>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ title: string;
29
+ description?: string | undefined;
30
+ language?: "fr" | "en" | "es" | "it" | "de" | undefined;
31
+ }, {
32
+ title: string;
33
+ description?: string | undefined;
34
+ language?: "fr" | "en" | "es" | "it" | "de" | undefined;
35
+ }>;
36
+ handler: (args: {
37
+ title: string;
38
+ description?: string;
39
+ language?: string;
40
+ }) => Promise<any>;
41
+ };
42
+ eduflow_update: {
43
+ description: string;
44
+ inputSchema: z.ZodObject<{
45
+ flowId: z.ZodString;
46
+ title: z.ZodOptional<z.ZodString>;
47
+ description: z.ZodOptional<z.ZodString>;
48
+ edges: z.ZodOptional<z.ZodArray<z.ZodObject<{
49
+ id: z.ZodString;
50
+ source: z.ZodString;
51
+ target: z.ZodString;
52
+ label: z.ZodOptional<z.ZodString>;
53
+ animated: z.ZodOptional<z.ZodBoolean>;
54
+ }, "strip", z.ZodTypeAny, {
55
+ id: string;
56
+ source: string;
57
+ target: string;
58
+ label?: string | undefined;
59
+ animated?: boolean | undefined;
60
+ }, {
61
+ id: string;
62
+ source: string;
63
+ target: string;
64
+ label?: string | undefined;
65
+ animated?: boolean | undefined;
66
+ }>, "many">>;
67
+ objectives: z.ZodOptional<z.ZodAny>;
68
+ gamification: z.ZodOptional<z.ZodAny>;
69
+ presentationEnabled: z.ZodOptional<z.ZodBoolean>;
70
+ presentationData: z.ZodOptional<z.ZodAny>;
71
+ chatbotEnabled: z.ZodOptional<z.ZodBoolean>;
72
+ facialVerificationEnabled: z.ZodOptional<z.ZodBoolean>;
73
+ deadline: z.ZodOptional<z.ZodString>;
74
+ language: z.ZodOptional<z.ZodEnum<["fr", "en", "es", "it", "de"]>>;
75
+ }, "strip", z.ZodTypeAny, {
76
+ flowId: string;
77
+ title?: string | undefined;
78
+ description?: string | undefined;
79
+ language?: "fr" | "en" | "es" | "it" | "de" | undefined;
80
+ edges?: {
81
+ id: string;
82
+ source: string;
83
+ target: string;
84
+ label?: string | undefined;
85
+ animated?: boolean | undefined;
86
+ }[] | undefined;
87
+ objectives?: any;
88
+ gamification?: any;
89
+ presentationEnabled?: boolean | undefined;
90
+ presentationData?: any;
91
+ chatbotEnabled?: boolean | undefined;
92
+ facialVerificationEnabled?: boolean | undefined;
93
+ deadline?: string | undefined;
94
+ }, {
95
+ flowId: string;
96
+ title?: string | undefined;
97
+ description?: string | undefined;
98
+ language?: "fr" | "en" | "es" | "it" | "de" | undefined;
99
+ edges?: {
100
+ id: string;
101
+ source: string;
102
+ target: string;
103
+ label?: string | undefined;
104
+ animated?: boolean | undefined;
105
+ }[] | undefined;
106
+ objectives?: any;
107
+ gamification?: any;
108
+ presentationEnabled?: boolean | undefined;
109
+ presentationData?: any;
110
+ chatbotEnabled?: boolean | undefined;
111
+ facialVerificationEnabled?: boolean | undefined;
112
+ deadline?: string | undefined;
113
+ }>;
114
+ handler: ({ flowId, ...data }: any) => Promise<any>;
115
+ };
116
+ eduflow_delete: {
117
+ description: string;
118
+ inputSchema: z.ZodObject<{
119
+ flowId: z.ZodString;
120
+ }, "strip", z.ZodTypeAny, {
121
+ flowId: string;
122
+ }, {
123
+ flowId: string;
124
+ }>;
125
+ handler: ({ flowId }: {
126
+ flowId: string;
127
+ }) => Promise<any>;
128
+ };
129
+ eduflow_duplicate: {
130
+ description: string;
131
+ inputSchema: z.ZodObject<{
132
+ flowId: z.ZodString;
133
+ }, "strip", z.ZodTypeAny, {
134
+ flowId: string;
135
+ }, {
136
+ flowId: string;
137
+ }>;
138
+ handler: ({ flowId }: {
139
+ flowId: string;
140
+ }) => Promise<any>;
141
+ };
142
+ eduflow_change_status: {
143
+ description: string;
144
+ inputSchema: z.ZodObject<{
145
+ flowId: z.ZodString;
146
+ status: z.ZodEnum<["draft", "published", "archived"]>;
147
+ }, "strip", z.ZodTypeAny, {
148
+ status: "draft" | "published" | "archived";
149
+ flowId: string;
150
+ }, {
151
+ status: "draft" | "published" | "archived";
152
+ flowId: string;
153
+ }>;
154
+ handler: ({ flowId, status }: {
155
+ flowId: string;
156
+ status: string;
157
+ }) => Promise<any>;
158
+ };
159
+ eduflow_export: {
160
+ description: string;
161
+ inputSchema: z.ZodObject<{
162
+ flowId: z.ZodString;
163
+ }, "strip", z.ZodTypeAny, {
164
+ flowId: string;
165
+ }, {
166
+ flowId: string;
167
+ }>;
168
+ handler: ({ flowId }: {
169
+ flowId: string;
170
+ }) => Promise<any>;
171
+ };
172
+ eduflow_get_public: {
173
+ description: string;
174
+ inputSchema: z.ZodObject<{
175
+ flowId: z.ZodString;
176
+ }, "strip", z.ZodTypeAny, {
177
+ flowId: string;
178
+ }, {
179
+ flowId: string;
180
+ }>;
181
+ handler: ({ flowId }: {
182
+ flowId: string;
183
+ }) => Promise<any>;
184
+ };
185
+ };
186
+ //# sourceMappingURL=eduflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eduflow.d.ts","sourceRoot":"","sources":["../../src/tools/eduflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;8BAcO;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;wBAYxB;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,WAAW,CAAC,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCA2B3C,GAAG;;;;;;;;;;;8BAUZ;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;8BAUlB;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;sCAWV;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;8BAU1C;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;8BAUlB;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE;;CAIjD,CAAC"}
@@ -0,0 +1,104 @@
1
+ import { z } from 'zod';
2
+ import { client } from '../client.js';
3
+ export const eduflowTools = {
4
+ eduflow_list: {
5
+ description: 'Lister tous les parcours EduFlow de l\'utilisateur. Retourne id, titre, statut, nombre de blocs, dates.',
6
+ inputSchema: z.object({}),
7
+ handler: async () => {
8
+ return client.get('/flows', 'eduflow');
9
+ },
10
+ },
11
+ eduflow_get: {
12
+ description: 'Récupérer les détails complets d\'un parcours EduFlow : blocs, connexions (edges), objectifs, paramètres de gamification, présentation, etc.',
13
+ inputSchema: z.object({
14
+ flowId: z.string().uuid().describe('ID du parcours EduFlow'),
15
+ }),
16
+ handler: async ({ flowId }) => {
17
+ return client.get(`/flows/${flowId}`, 'eduflow');
18
+ },
19
+ },
20
+ eduflow_create: {
21
+ description: 'Créer un nouveau parcours EduFlow. Un bloc "start" et un bloc "end" sont automatiquement créés.',
22
+ inputSchema: z.object({
23
+ title: z.string().describe('Titre du parcours'),
24
+ description: z.string().optional().describe('Description du parcours'),
25
+ language: z.enum(['fr', 'en', 'es', 'it', 'de']).optional().describe('Langue du parcours (défaut: fr)'),
26
+ }),
27
+ handler: async (args) => {
28
+ return client.post('/flows', args, 'eduflow');
29
+ },
30
+ },
31
+ eduflow_update: {
32
+ description: 'Mettre à jour les propriétés d\'un parcours EduFlow (titre, description, edges, gamification, objectifs, présentation, etc.).',
33
+ inputSchema: z.object({
34
+ flowId: z.string().uuid().describe('ID du parcours'),
35
+ title: z.string().optional().describe('Nouveau titre'),
36
+ description: z.string().optional().describe('Nouvelle description'),
37
+ edges: z.array(z.object({
38
+ id: z.string(),
39
+ source: z.string().describe('ID du bloc source'),
40
+ target: z.string().describe('ID du bloc cible'),
41
+ label: z.string().optional().describe('Label de la connexion'),
42
+ animated: z.boolean().optional(),
43
+ })).optional().describe('Connexions entre blocs (remplace toutes les connexions existantes)'),
44
+ objectives: z.any().optional().describe('Objectifs pédagogiques {globalObjective, steps[]}'),
45
+ gamification: z.any().optional().describe('Configuration gamification {badges, missions, leaderboard, certifications}'),
46
+ presentationEnabled: z.boolean().optional().describe('Activer/désactiver la page de présentation'),
47
+ presentationData: z.any().optional().describe('Données de la page de présentation'),
48
+ chatbotEnabled: z.boolean().optional().describe('Activer/désactiver le chatbot IA'),
49
+ facialVerificationEnabled: z.boolean().optional().describe('Activer/désactiver la vérification faciale'),
50
+ deadline: z.string().optional().describe('Date limite ISO 8601'),
51
+ language: z.enum(['fr', 'en', 'es', 'it', 'de']).optional().describe('Langue du parcours'),
52
+ }),
53
+ handler: async ({ flowId, ...data }) => {
54
+ return client.put(`/flows/${flowId}`, data, 'eduflow');
55
+ },
56
+ },
57
+ eduflow_delete: {
58
+ description: 'Supprimer définitivement un parcours EduFlow et tous ses blocs, connexions, participants.',
59
+ inputSchema: z.object({
60
+ flowId: z.string().uuid().describe('ID du parcours à supprimer'),
61
+ }),
62
+ handler: async ({ flowId }) => {
63
+ return client.delete(`/flows/${flowId}`, 'eduflow');
64
+ },
65
+ },
66
+ eduflow_duplicate: {
67
+ description: 'Dupliquer un parcours EduFlow existant avec tous ses blocs et connexions.',
68
+ inputSchema: z.object({
69
+ flowId: z.string().uuid().describe('ID du parcours à dupliquer'),
70
+ }),
71
+ handler: async ({ flowId }) => {
72
+ return client.post(`/flows/${flowId}/duplicate`, {}, 'eduflow');
73
+ },
74
+ },
75
+ eduflow_change_status: {
76
+ description: 'Changer le statut d\'un parcours : draft (brouillon), published (publié, accessible aux étudiants), archived (archivé).',
77
+ inputSchema: z.object({
78
+ flowId: z.string().uuid().describe('ID du parcours'),
79
+ status: z.enum(['draft', 'published', 'archived']).describe('Nouveau statut'),
80
+ }),
81
+ handler: async ({ flowId, status }) => {
82
+ return client.patch(`/flows/${flowId}/status`, { status }, 'eduflow');
83
+ },
84
+ },
85
+ eduflow_export: {
86
+ description: 'Exporter un parcours EduFlow au format JSON (contient blocs, connexions, paramètres).',
87
+ inputSchema: z.object({
88
+ flowId: z.string().uuid().describe('ID du parcours à exporter'),
89
+ }),
90
+ handler: async ({ flowId }) => {
91
+ return client.get(`/flows/${flowId}/export`, 'eduflow');
92
+ },
93
+ },
94
+ eduflow_get_public: {
95
+ description: 'Récupérer les informations publiques d\'un parcours (page de présentation, objectifs). Ne nécessite pas d\'authentification.',
96
+ inputSchema: z.object({
97
+ flowId: z.string().uuid().describe('ID du parcours'),
98
+ }),
99
+ handler: async ({ flowId }) => {
100
+ return client.get(`/flows/${flowId}/public`, 'eduflow');
101
+ },
102
+ },
103
+ };
104
+ //# sourceMappingURL=eduflow.js.map