@lyrra/mcp-server 1.1.3 → 1.1.7
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 +80 -250
- package/dist/auth-session.js +171 -0
- package/dist/eduflow-block-docs.js +438 -0
- package/dist/http-incoming-auth.js +48 -0
- package/dist/http-main.js +104 -0
- package/dist/index.js +16 -12
- package/dist/lyrra-http.js +80 -0
- package/dist/lyrra-mcp-core.js +174 -0
- package/dist/openapi-parse.js +61 -0
- package/dist/register-eduflow-block-tools.js +31 -0
- package/package.json +41 -13
- package/Dockerfile +0 -16
- package/dist/client.d.ts +0 -23
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -92
- package/dist/client.js.map +0 -1
- package/dist/config.d.ts +0 -8
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -8
- package/dist/config.js.map +0 -1
- package/dist/http-server.d.ts +0 -8
- package/dist/http-server.d.ts.map +0 -1
- package/dist/http-server.js +0 -481
- package/dist/http-server.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/resources/block-types.d.ts +0 -318
- package/dist/resources/block-types.d.ts.map +0 -1
- package/dist/resources/block-types.js +0 -297
- package/dist/resources/block-types.js.map +0 -1
- package/dist/resources/flow-schema.d.ts +0 -147
- package/dist/resources/flow-schema.d.ts.map +0 -1
- package/dist/resources/flow-schema.js +0 -143
- package/dist/resources/flow-schema.js.map +0 -1
- package/dist/server-factory.d.ts +0 -8
- package/dist/server-factory.d.ts.map +0 -1
- package/dist/server-factory.js +0 -82
- package/dist/server-factory.js.map +0 -1
- package/dist/tools/admin.d.ts +0 -265
- package/dist/tools/admin.d.ts.map +0 -1
- package/dist/tools/admin.js +0 -118
- package/dist/tools/admin.js.map +0 -1
- package/dist/tools/ai-designer.d.ts +0 -297
- package/dist/tools/ai-designer.d.ts.map +0 -1
- package/dist/tools/ai-designer.js +0 -89
- package/dist/tools/ai-designer.js.map +0 -1
- package/dist/tools/analytics.d.ts +0 -95
- package/dist/tools/analytics.d.ts.map +0 -1
- package/dist/tools/analytics.js +0 -44
- package/dist/tools/analytics.js.map +0 -1
- package/dist/tools/auth.d.ts +0 -61
- package/dist/tools/auth.d.ts.map +0 -1
- package/dist/tools/auth.js +0 -36
- package/dist/tools/auth.js.map +0 -1
- package/dist/tools/blocks.d.ts +0 -457
- package/dist/tools/blocks.d.ts.map +0 -1
- package/dist/tools/blocks.js +0 -173
- package/dist/tools/blocks.js.map +0 -1
- package/dist/tools/connections.d.ts +0 -173
- package/dist/tools/connections.d.ts.map +0 -1
- package/dist/tools/connections.js +0 -81
- package/dist/tools/connections.js.map +0 -1
- package/dist/tools/eduflow.d.ts +0 -409
- package/dist/tools/eduflow.d.ts.map +0 -1
- package/dist/tools/eduflow.js +0 -139
- package/dist/tools/eduflow.js.map +0 -1
- package/dist/tools/participants.d.ts +0 -221
- package/dist/tools/participants.d.ts.map +0 -1
- package/dist/tools/participants.js +0 -70
- package/dist/tools/participants.js.map +0 -1
- package/dist/tools/presentation.d.ts +0 -233
- package/dist/tools/presentation.d.ts.map +0 -1
- package/dist/tools/presentation.js +0 -57
- package/dist/tools/presentation.js.map +0 -1
- package/dist/tools/projects.d.ts +0 -131
- package/dist/tools/projects.d.ts.map +0 -1
- package/dist/tools/projects.js +0 -55
- package/dist/tools/projects.js.map +0 -1
- package/dist/tools/resources.d.ts +0 -93
- package/dist/tools/resources.d.ts.map +0 -1
- package/dist/tools/resources.js +0 -37
- package/dist/tools/resources.js.map +0 -1
- package/dist/tools/store.d.ts +0 -125
- package/dist/tools/store.d.ts.map +0 -1
- package/dist/tools/store.js +0 -66
- package/dist/tools/store.js.map +0 -1
- package/mcp-config.example.json +0 -14
- package/src/client.ts +0 -106
- package/src/config.ts +0 -7
- package/src/http-server.ts +0 -591
- package/src/index.ts +0 -23
- package/src/resources/block-types.ts +0 -298
- package/src/resources/flow-schema.ts +0 -148
- package/src/server-factory.ts +0 -109
- package/src/tools/admin.ts +0 -128
- package/src/tools/ai-designer.ts +0 -97
- package/src/tools/analytics.ts +0 -49
- package/src/tools/auth.ts +0 -39
- package/src/tools/blocks.ts +0 -186
- package/src/tools/connections.ts +0 -83
- package/src/tools/eduflow.ts +0 -150
- package/src/tools/participants.ts +0 -77
- package/src/tools/presentation.ts +0 -61
- package/src/tools/projects.ts +0 -61
- package/src/tools/resources.ts +0 -41
- package/src/tools/store.ts +0 -67
- package/tsconfig.json +0 -19
package/dist/tools/blocks.js
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { client as defaultClient } 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 function createBlocksTools(c) {
|
|
5
|
-
return {
|
|
6
|
-
block_list_types: {
|
|
7
|
-
description: `Lister tous les types de blocs disponibles avec leur documentation complète.
|
|
8
|
-
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.
|
|
9
|
-
Utiliser plutôt la resource lyrra://block-types pour la documentation complète.`,
|
|
10
|
-
inputSchema: z.object({}),
|
|
11
|
-
handler: async () => {
|
|
12
|
-
return {
|
|
13
|
-
types: [
|
|
14
|
-
{ type: 'start', name: 'Début', description: 'Point de départ du parcours. Un seul par flux.' },
|
|
15
|
-
{ type: 'end', name: 'Fin', description: 'Point de fin du parcours. Peut avoir plusieurs fins.' },
|
|
16
|
-
{ type: 'text', name: 'Texte', description: 'Contenu textuel/HTML enrichi. TOUJOURS utiliser format: "html".' },
|
|
17
|
-
{ type: 'audio', name: 'Audio', description: 'Intègre un projet audio LYRRA avec texte synchronisé.' },
|
|
18
|
-
{ type: 'video', name: 'Vidéo', description: 'Intègre une vidéo (URL YouTube/Vimeo ou fichier uploadé).' },
|
|
19
|
-
{ type: 'pdf', name: 'PDF', description: 'Affiche un document PDF intégré.' },
|
|
20
|
-
{ type: 'image', name: 'Image', description: 'Affiche une image avec légende optionnelle.' },
|
|
21
|
-
{ type: 'quiz', name: 'Quiz', description: 'Question QCM/vrai-faux/ordonnancement avec branchement conditionnel.' },
|
|
22
|
-
{ type: 'evaluation', name: 'Évaluation', description: 'Évaluation complète avec plusieurs questions et scoring.' },
|
|
23
|
-
{ type: 'form', name: 'Formulaire', description: 'Formulaire avec champs personnalisés et logique conditionnelle.' },
|
|
24
|
-
{ type: 'chart', name: 'Graphique', description: 'Graphique interactif (bar, line, pie, scatter, radar, area, doughnut).' },
|
|
25
|
-
{ type: 'timeline', name: 'Frise chronologique', description: 'Frise avec événements datés.' },
|
|
26
|
-
{ type: 'mindmap', name: 'Carte mentale', description: 'Carte mentale interactive avec nœuds et liens.' },
|
|
27
|
-
{ type: 'glossary', name: 'Glossaire', description: 'Liste de termes et définitions.' },
|
|
28
|
-
{ type: 'split', name: 'Embranchement', description: 'Sépare le flux en branches parallèles.' },
|
|
29
|
-
{ type: 'merge', name: 'Fusion', description: 'Rejoint les branches parallèles.' },
|
|
30
|
-
{ type: 'loop', name: 'Boucle', description: 'Permet de répéter une séquence de blocs.' },
|
|
31
|
-
{ type: 'timer', name: 'Minuteur', description: 'Bloc avec temps limité, pause, rappel ou expiration.' },
|
|
32
|
-
{ type: 'subflow', name: 'Sous-parcours', description: 'Intègre un autre parcours EduFlow comme bloc.' },
|
|
33
|
-
{ type: 'certification', name: 'Certification', description: 'Génère un certificat PDF personnalisé.' },
|
|
34
|
-
{ type: 'email', name: 'Email', description: 'Envoie un email automatique (certification, rappel).' },
|
|
35
|
-
{ type: 'voice_assessment', name: 'Évaluation vocale', description: 'Enregistrement et évaluation de la voix de l\'étudiant.' },
|
|
36
|
-
{ type: 'self_assessment', name: 'Auto-évaluation', description: 'L\'étudiant s\'évalue lui-même sur des critères définis.' },
|
|
37
|
-
{ type: 'presentation', name: 'Présentation', description: 'Diaporama avec slides.' },
|
|
38
|
-
{ type: 'browser', name: 'Navigateur', description: 'Intègre une page web dans un iframe.' },
|
|
39
|
-
{ type: 'dys_reader', name: 'Lecteur DYS', description: 'Texte adapté pour la dyslexie avec police et espacement spéciaux.' },
|
|
40
|
-
{ type: 'dys_image_zones', name: 'Zones d\'image DYS', description: 'Image avec zones cliquables pour la dyslexie.' },
|
|
41
|
-
{ type: 'dys_reading_practice', name: 'Pratique lecture DYS', description: 'Exercice de lecture adapté dyslexie.' },
|
|
42
|
-
{ type: 'dys_clock', name: 'Horloge DYS', description: 'Exercice de lecture de l\'heure pour la dyscalculie.' },
|
|
43
|
-
],
|
|
44
|
-
};
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
block_get: {
|
|
48
|
-
description: 'Récupérer les détails complets d\'un bloc (type, contenu, position, conditions, commentaire).',
|
|
49
|
-
inputSchema: z.object({
|
|
50
|
-
flowId: z.string().uuid().describe('ID du parcours'),
|
|
51
|
-
blockId: z.string().uuid().describe('ID du bloc'),
|
|
52
|
-
}),
|
|
53
|
-
handler: async ({ flowId, blockId }) => {
|
|
54
|
-
return c.get(`/flows/${flowId}/blocks/${blockId}`, 'eduflow');
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
block_create: {
|
|
58
|
-
description: `Créer un nouveau bloc dans un parcours EduFlow. Le bloc est ajouté mais pas encore connecté (utiliser connection_add ensuite).
|
|
59
|
-
IMPORTANT pour le type "text" : toujours utiliser content.format = "html" et du HTML dans content.text (pas de Markdown).`,
|
|
60
|
-
inputSchema: z.object({
|
|
61
|
-
flowId: z.string().uuid().describe('ID du parcours'),
|
|
62
|
-
type: z.enum([
|
|
63
|
-
'text', 'audio', 'quiz', 'video', 'pdf', 'image', 'loop', 'evaluation',
|
|
64
|
-
'split', 'merge', 'timer', 'start', 'end', 'chart', 'timeline',
|
|
65
|
-
'dys_reader', 'dys_image_zones', 'dys_reading_practice', 'dys_clock',
|
|
66
|
-
'glossary', 'subflow', 'mindmap', 'form', 'certification', 'email',
|
|
67
|
-
'voice_assessment', 'presentation', 'browser', 'self_assessment',
|
|
68
|
-
]).describe('Type de bloc à créer'),
|
|
69
|
-
title: z.string().describe('Titre du bloc'),
|
|
70
|
-
content: blockContentSchema,
|
|
71
|
-
positionX: z.number().optional().describe('Position X dans l\'éditeur visuel (défaut: 0)'),
|
|
72
|
-
positionY: z.number().optional().describe('Position Y dans l\'éditeur visuel (défaut: 0)'),
|
|
73
|
-
order: z.number().optional().describe('Ordre d\'affichage'),
|
|
74
|
-
}),
|
|
75
|
-
handler: async ({ flowId, ...blockData }) => {
|
|
76
|
-
// Use batch update to add a single block
|
|
77
|
-
const flow = await c.get(`/flows/${flowId}`, 'eduflow');
|
|
78
|
-
const existingBlocks = flow.blocks || [];
|
|
79
|
-
const newBlock = {
|
|
80
|
-
id: crypto.randomUUID(),
|
|
81
|
-
...blockData,
|
|
82
|
-
positionX: blockData.positionX ?? (existingBlocks.length * 300),
|
|
83
|
-
positionY: blockData.positionY ?? 200,
|
|
84
|
-
order: blockData.order ?? existingBlocks.length,
|
|
85
|
-
};
|
|
86
|
-
const allBlocks = [...existingBlocks.map((b) => ({
|
|
87
|
-
id: b.id, type: b.type, title: b.title,
|
|
88
|
-
content: b.content, positionX: b.positionX, positionY: b.positionY,
|
|
89
|
-
order: b.order, conditions: b.conditions, comment: b.comment,
|
|
90
|
-
})), newBlock];
|
|
91
|
-
await c.put(`/flows/${flowId}/blocks`, allBlocks, 'eduflow');
|
|
92
|
-
return { success: true, block: newBlock };
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
block_update: {
|
|
96
|
-
description: 'Mettre à jour un bloc existant (titre, contenu, position, conditions).',
|
|
97
|
-
inputSchema: z.object({
|
|
98
|
-
flowId: z.string().uuid().describe('ID du parcours'),
|
|
99
|
-
blockId: z.string().uuid().describe('ID du bloc à modifier'),
|
|
100
|
-
title: z.string().optional().describe('Nouveau titre'),
|
|
101
|
-
content: blockContentSchema.optional(),
|
|
102
|
-
positionX: z.number().optional().describe('Nouvelle position X'),
|
|
103
|
-
positionY: z.number().optional().describe('Nouvelle position Y'),
|
|
104
|
-
order: z.number().optional().describe('Nouvel ordre'),
|
|
105
|
-
conditions: z.any().optional().describe('Conditions de branchement'),
|
|
106
|
-
comment: z.string().optional().describe('Commentaire créateur'),
|
|
107
|
-
}),
|
|
108
|
-
handler: async ({ flowId, blockId, ...data }) => {
|
|
109
|
-
return c.put(`/flows/${flowId}/blocks/${blockId}`, data, 'eduflow');
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
block_batch_update: {
|
|
113
|
-
description: 'Mettre à jour plusieurs blocs en une seule opération. Utile pour repositionner ou réorganiser tous les blocs. Envoie aussi les edges (connexions) si fournis.',
|
|
114
|
-
inputSchema: z.object({
|
|
115
|
-
flowId: z.string().uuid().describe('ID du parcours'),
|
|
116
|
-
blocks: z.array(z.object({
|
|
117
|
-
id: z.string().describe('ID du bloc'),
|
|
118
|
-
type: z.string().describe('Type du bloc'),
|
|
119
|
-
title: z.string().describe('Titre'),
|
|
120
|
-
content: z.any().describe('Contenu'),
|
|
121
|
-
positionX: z.number().optional(),
|
|
122
|
-
positionY: z.number().optional(),
|
|
123
|
-
order: z.number().optional(),
|
|
124
|
-
conditions: z.any().optional(),
|
|
125
|
-
comment: z.string().optional(),
|
|
126
|
-
})).describe('Liste complète des blocs (REMPLACE tous les blocs existants)'),
|
|
127
|
-
edges: z.array(z.object({
|
|
128
|
-
id: z.string().describe('ID de la connexion'),
|
|
129
|
-
source: z.string().describe('ID du bloc source'),
|
|
130
|
-
target: z.string().describe('ID du bloc cible'),
|
|
131
|
-
label: z.string().optional(),
|
|
132
|
-
})).optional().describe('Connexions entre blocs'),
|
|
133
|
-
}),
|
|
134
|
-
handler: async ({ flowId, blocks, edges }) => {
|
|
135
|
-
return c.put(`/flows/${flowId}/blocks`, { blocks, edges: edges || [] }, 'eduflow');
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
block_delete: {
|
|
139
|
-
description: 'Supprimer un bloc d\'un parcours. Les connexions liées sont automatiquement supprimées.',
|
|
140
|
-
inputSchema: z.object({
|
|
141
|
-
flowId: z.string().uuid().describe('ID du parcours'),
|
|
142
|
-
blockId: z.string().uuid().describe('ID du bloc à supprimer'),
|
|
143
|
-
}),
|
|
144
|
-
handler: async ({ flowId, blockId }) => {
|
|
145
|
-
// Get current flow, remove block, remove related edges, batch update
|
|
146
|
-
const flow = await c.get(`/flows/${flowId}`, 'eduflow');
|
|
147
|
-
const blocks = (flow.blocks || []).filter((b) => b.id !== blockId);
|
|
148
|
-
const edges = (flow.edges || []).filter((e) => e.source !== blockId && e.target !== blockId);
|
|
149
|
-
const mappedBlocks = blocks.map((b) => ({
|
|
150
|
-
id: b.id, type: b.type, title: b.title,
|
|
151
|
-
content: b.content, positionX: b.positionX, positionY: b.positionY,
|
|
152
|
-
order: b.order, conditions: b.conditions, comment: b.comment,
|
|
153
|
-
}));
|
|
154
|
-
await c.put(`/flows/${flowId}/blocks`, { blocks: mappedBlocks }, 'eduflow');
|
|
155
|
-
await c.put(`/flows/${flowId}`, { edges }, 'eduflow');
|
|
156
|
-
return { success: true, remainingBlocks: blocks.length, remainingEdges: edges.length };
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
block_generate_tts: {
|
|
160
|
-
description: 'Générer l\'audio TTS (text-to-speech) pour un bloc texte. L\'audio est attaché au bloc.',
|
|
161
|
-
inputSchema: z.object({
|
|
162
|
-
flowId: z.string().uuid().describe('ID du parcours'),
|
|
163
|
-
blockId: z.string().uuid().describe('ID du bloc'),
|
|
164
|
-
}),
|
|
165
|
-
handler: async ({ flowId, blockId }) => {
|
|
166
|
-
return c.post(`/blocks/${blockId}/generate-tts`, { flowId }, 'eduflow');
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
// Backward compatibility for stdio mode
|
|
172
|
-
export const blocksTools = createBlocksTools(defaultClient);
|
|
173
|
-
//# sourceMappingURL=blocks.js.map
|
package/dist/tools/blocks.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.js","sourceRoot":"","sources":["../../src/tools/blocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,CACnD,oIAAoI,CACrI,CAAC;AAEF,MAAM,UAAU,iBAAiB,CAAC,CAAc;IAC9C,OAAO;QACP,gBAAgB,EAAE;YAChB,WAAW,EAAE;;gFAE+D;YAC5E,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;YACzB,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,OAAO;oBACL,KAAK,EAAE;wBACL,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,gDAAgD,EAAE;wBAC/F,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,sDAAsD,EAAE;wBACjG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,iEAAiE,EAAE;wBAC/G,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,uDAAuD,EAAE;wBACtG,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,2DAA2D,EAAE;wBAC1G,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,kCAAkC,EAAE;wBAC7E,EAAE,IAAI,EAAE,OAAO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C,SAAS;oBAClE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO;iBAC7D,CAAC,CAAC,CAAC;gBACJ,MAAM,CAAC,CAAC,GAAG,CAAC,UAAU,MAAM,SAAS,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,SAAS,CAAC,CAAC;gBAC5E,MAAM,CAAC,CAAC,GAAG,CAAC,UAAU,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,CAAC,CAAC;gBACtD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;YACzF,CAAC;SACF;QAED,kBAAkB,EAAE;YAClB,WAAW,EAAE,yFAAyF;YACtG,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;gBACpB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;gBACpD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;aAClD,CAAC;YACF,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAuC,EAAE,EAAE;gBAC1E,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,OAAO,eAAe,EAAE,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC,CAAC;YAC1E,CAAC;SACF;KACA,CAAC;AACJ,CAAC;AAED,wCAAwC;AACxC,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { LyrraClient } from '../client.js';
|
|
3
|
-
export declare function createConnectionsTools(c: LyrraClient): {
|
|
4
|
-
connection_list: {
|
|
5
|
-
description: string;
|
|
6
|
-
inputSchema: z.ZodObject<{
|
|
7
|
-
flowId: z.ZodString;
|
|
8
|
-
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
flowId: string;
|
|
10
|
-
}, {
|
|
11
|
-
flowId: string;
|
|
12
|
-
}>;
|
|
13
|
-
handler: ({ flowId }: {
|
|
14
|
-
flowId: string;
|
|
15
|
-
}) => Promise<{
|
|
16
|
-
edges: any;
|
|
17
|
-
blocks: any;
|
|
18
|
-
}>;
|
|
19
|
-
};
|
|
20
|
-
connection_add: {
|
|
21
|
-
description: string;
|
|
22
|
-
inputSchema: z.ZodObject<{
|
|
23
|
-
flowId: z.ZodString;
|
|
24
|
-
source: z.ZodString;
|
|
25
|
-
target: z.ZodString;
|
|
26
|
-
label: z.ZodOptional<z.ZodString>;
|
|
27
|
-
animated: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
-
}, "strip", z.ZodTypeAny, {
|
|
29
|
-
flowId: string;
|
|
30
|
-
source: string;
|
|
31
|
-
target: string;
|
|
32
|
-
label?: string | undefined;
|
|
33
|
-
animated?: boolean | undefined;
|
|
34
|
-
}, {
|
|
35
|
-
flowId: string;
|
|
36
|
-
source: string;
|
|
37
|
-
target: string;
|
|
38
|
-
label?: string | undefined;
|
|
39
|
-
animated?: boolean | undefined;
|
|
40
|
-
}>;
|
|
41
|
-
handler: ({ flowId, source, target, label, animated }: any) => Promise<{
|
|
42
|
-
success: boolean;
|
|
43
|
-
error: string;
|
|
44
|
-
edge?: undefined;
|
|
45
|
-
totalEdges?: undefined;
|
|
46
|
-
} | {
|
|
47
|
-
success: boolean;
|
|
48
|
-
edge: {
|
|
49
|
-
id: string;
|
|
50
|
-
source: any;
|
|
51
|
-
target: any;
|
|
52
|
-
label: any;
|
|
53
|
-
animated: any;
|
|
54
|
-
};
|
|
55
|
-
totalEdges: any;
|
|
56
|
-
error?: undefined;
|
|
57
|
-
}>;
|
|
58
|
-
};
|
|
59
|
-
connection_remove: {
|
|
60
|
-
description: string;
|
|
61
|
-
inputSchema: z.ZodObject<{
|
|
62
|
-
flowId: z.ZodString;
|
|
63
|
-
edgeId: z.ZodOptional<z.ZodString>;
|
|
64
|
-
source: z.ZodOptional<z.ZodString>;
|
|
65
|
-
target: z.ZodOptional<z.ZodString>;
|
|
66
|
-
}, "strip", z.ZodTypeAny, {
|
|
67
|
-
flowId: string;
|
|
68
|
-
source?: string | undefined;
|
|
69
|
-
target?: string | undefined;
|
|
70
|
-
edgeId?: string | undefined;
|
|
71
|
-
}, {
|
|
72
|
-
flowId: string;
|
|
73
|
-
source?: string | undefined;
|
|
74
|
-
target?: string | undefined;
|
|
75
|
-
edgeId?: string | undefined;
|
|
76
|
-
}>;
|
|
77
|
-
handler: ({ flowId, edgeId, source, target }: any) => Promise<{
|
|
78
|
-
success: boolean;
|
|
79
|
-
error: string;
|
|
80
|
-
remainingEdges?: undefined;
|
|
81
|
-
} | {
|
|
82
|
-
success: boolean;
|
|
83
|
-
remainingEdges: any;
|
|
84
|
-
error?: undefined;
|
|
85
|
-
}>;
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
export declare const connectionsTools: {
|
|
89
|
-
connection_list: {
|
|
90
|
-
description: string;
|
|
91
|
-
inputSchema: z.ZodObject<{
|
|
92
|
-
flowId: z.ZodString;
|
|
93
|
-
}, "strip", z.ZodTypeAny, {
|
|
94
|
-
flowId: string;
|
|
95
|
-
}, {
|
|
96
|
-
flowId: string;
|
|
97
|
-
}>;
|
|
98
|
-
handler: ({ flowId }: {
|
|
99
|
-
flowId: string;
|
|
100
|
-
}) => Promise<{
|
|
101
|
-
edges: any;
|
|
102
|
-
blocks: any;
|
|
103
|
-
}>;
|
|
104
|
-
};
|
|
105
|
-
connection_add: {
|
|
106
|
-
description: string;
|
|
107
|
-
inputSchema: z.ZodObject<{
|
|
108
|
-
flowId: z.ZodString;
|
|
109
|
-
source: z.ZodString;
|
|
110
|
-
target: z.ZodString;
|
|
111
|
-
label: z.ZodOptional<z.ZodString>;
|
|
112
|
-
animated: z.ZodOptional<z.ZodBoolean>;
|
|
113
|
-
}, "strip", z.ZodTypeAny, {
|
|
114
|
-
flowId: string;
|
|
115
|
-
source: string;
|
|
116
|
-
target: string;
|
|
117
|
-
label?: string | undefined;
|
|
118
|
-
animated?: boolean | undefined;
|
|
119
|
-
}, {
|
|
120
|
-
flowId: string;
|
|
121
|
-
source: string;
|
|
122
|
-
target: string;
|
|
123
|
-
label?: string | undefined;
|
|
124
|
-
animated?: boolean | undefined;
|
|
125
|
-
}>;
|
|
126
|
-
handler: ({ flowId, source, target, label, animated }: any) => Promise<{
|
|
127
|
-
success: boolean;
|
|
128
|
-
error: string;
|
|
129
|
-
edge?: undefined;
|
|
130
|
-
totalEdges?: undefined;
|
|
131
|
-
} | {
|
|
132
|
-
success: boolean;
|
|
133
|
-
edge: {
|
|
134
|
-
id: string;
|
|
135
|
-
source: any;
|
|
136
|
-
target: any;
|
|
137
|
-
label: any;
|
|
138
|
-
animated: any;
|
|
139
|
-
};
|
|
140
|
-
totalEdges: any;
|
|
141
|
-
error?: undefined;
|
|
142
|
-
}>;
|
|
143
|
-
};
|
|
144
|
-
connection_remove: {
|
|
145
|
-
description: string;
|
|
146
|
-
inputSchema: z.ZodObject<{
|
|
147
|
-
flowId: z.ZodString;
|
|
148
|
-
edgeId: z.ZodOptional<z.ZodString>;
|
|
149
|
-
source: z.ZodOptional<z.ZodString>;
|
|
150
|
-
target: z.ZodOptional<z.ZodString>;
|
|
151
|
-
}, "strip", z.ZodTypeAny, {
|
|
152
|
-
flowId: string;
|
|
153
|
-
source?: string | undefined;
|
|
154
|
-
target?: string | undefined;
|
|
155
|
-
edgeId?: string | undefined;
|
|
156
|
-
}, {
|
|
157
|
-
flowId: string;
|
|
158
|
-
source?: string | undefined;
|
|
159
|
-
target?: string | undefined;
|
|
160
|
-
edgeId?: string | undefined;
|
|
161
|
-
}>;
|
|
162
|
-
handler: ({ flowId, edgeId, source, target }: any) => Promise<{
|
|
163
|
-
success: boolean;
|
|
164
|
-
error: string;
|
|
165
|
-
remainingEdges?: undefined;
|
|
166
|
-
} | {
|
|
167
|
-
success: boolean;
|
|
168
|
-
remainingEdges: any;
|
|
169
|
-
error?: undefined;
|
|
170
|
-
}>;
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
//# sourceMappingURL=connections.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../../src/tools/connections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,WAAW;;;;;;;;;;8BAarB;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;+DAkBe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDA6BZ,GAAG;;;;;;;;;;EAe1D;AAGD,eAAO,MAAM,gBAAgB;;;;;;;;;;8BAjEG;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;+DAkBe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDA6BZ,GAAG;;;;;;;;;;CAkBU,CAAC"}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { client as defaultClient } from '../client.js';
|
|
3
|
-
export function createConnectionsTools(c) {
|
|
4
|
-
return {
|
|
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 }) => {
|
|
17
|
-
const flow = await c.get(`/flows/${flowId}`, 'eduflow');
|
|
18
|
-
return {
|
|
19
|
-
edges: flow.edges || [],
|
|
20
|
-
blocks: (flow.blocks || []).map((b) => ({ id: b.id, type: b.type, title: b.title })),
|
|
21
|
-
};
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
connection_add: {
|
|
25
|
-
description: 'Ajouter une connexion entre deux blocs. Le parcours est un graphe orienté : source → target.',
|
|
26
|
-
inputSchema: z.object({
|
|
27
|
-
flowId: z.string().uuid().describe('ID du parcours'),
|
|
28
|
-
source: z.string().describe('ID du bloc source (d\'où part la connexion)'),
|
|
29
|
-
target: z.string().describe('ID du bloc cible (où arrive la connexion)'),
|
|
30
|
-
label: z.string().optional().describe('Label affiché sur la connexion (ex: "Bonne réponse", "Mauvaise réponse")'),
|
|
31
|
-
animated: z.boolean().optional().describe('Animer la connexion visuellement'),
|
|
32
|
-
}),
|
|
33
|
-
handler: async ({ flowId, source, target, label, animated }) => {
|
|
34
|
-
const flow = await c.get(`/flows/${flowId}`, 'eduflow');
|
|
35
|
-
const edges = flow.edges || [];
|
|
36
|
-
const newEdge = {
|
|
37
|
-
id: `e-${source}-${target}`,
|
|
38
|
-
source,
|
|
39
|
-
target,
|
|
40
|
-
label: label || '',
|
|
41
|
-
animated: animated || false,
|
|
42
|
-
};
|
|
43
|
-
// Check for duplicate
|
|
44
|
-
const exists = edges.some((e) => e.source === source && e.target === target);
|
|
45
|
-
if (exists) {
|
|
46
|
-
return { success: false, error: 'Cette connexion existe déjà' };
|
|
47
|
-
}
|
|
48
|
-
edges.push(newEdge);
|
|
49
|
-
await c.put(`/flows/${flowId}`, { edges }, 'eduflow');
|
|
50
|
-
return { success: true, edge: newEdge, totalEdges: edges.length };
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
connection_remove: {
|
|
54
|
-
description: 'Supprimer une connexion entre deux blocs.',
|
|
55
|
-
inputSchema: z.object({
|
|
56
|
-
flowId: z.string().uuid().describe('ID du parcours'),
|
|
57
|
-
edgeId: z.string().optional().describe('ID de la connexion à supprimer'),
|
|
58
|
-
source: z.string().optional().describe('Alternative : ID du bloc source'),
|
|
59
|
-
target: z.string().optional().describe('Alternative : ID du bloc cible'),
|
|
60
|
-
}),
|
|
61
|
-
handler: async ({ flowId, edgeId, source, target }) => {
|
|
62
|
-
const flow = await c.get(`/flows/${flowId}`, 'eduflow');
|
|
63
|
-
let edges = flow.edges || [];
|
|
64
|
-
if (edgeId) {
|
|
65
|
-
edges = edges.filter((e) => e.id !== edgeId);
|
|
66
|
-
}
|
|
67
|
-
else if (source && target) {
|
|
68
|
-
edges = edges.filter((e) => !(e.source === source && e.target === target));
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
return { success: false, error: 'Fournir edgeId OU source+target' };
|
|
72
|
-
}
|
|
73
|
-
await c.put(`/flows/${flowId}`, { edges }, 'eduflow');
|
|
74
|
-
return { success: true, remainingEdges: edges.length };
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
// Backward compatibility for stdio mode
|
|
80
|
-
export const connectionsTools = createConnectionsTools(defaultClient);
|
|
81
|
-
//# sourceMappingURL=connections.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connections.js","sourceRoot":"","sources":["../../src/tools/connections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,UAAU,sBAAsB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