smart-thinking-mcp 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/LICENSE +21 -0
- package/README.md +104 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +296 -0
- package/build/index.js.map +1 -0
- package/build/memory-manager.d.ts +89 -0
- package/build/memory-manager.js +226 -0
- package/build/memory-manager.js.map +1 -0
- package/build/quality-evaluator.d.ts +63 -0
- package/build/quality-evaluator.js +275 -0
- package/build/quality-evaluator.js.map +1 -0
- package/build/thought-graph.d.ts +103 -0
- package/build/thought-graph.js +278 -0
- package/build/thought-graph.js.map +1 -0
- package/build/tool-integrator.d.ts +58 -0
- package/build/tool-integrator.js +219 -0
- package/build/tool-integrator.js.map +1 -0
- package/build/types.d.ts +87 -0
- package/build/types.js +6 -0
- package/build/types.js.map +1 -0
- package/build/visualizer.d.ts +55 -0
- package/build/visualizer.js +346 -0
- package/build/visualizer.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-integrator.js","sourceRoot":"","sources":["../src/tool-integrator.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAa,cAAc;IACzB,6BAA6B;IACrB,UAAU,GAKb,IAAI,GAAG,EAAE,CAAC;IAEf;QACE,2CAA2C;QAC3C,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC9B,CAAC;IAED;;OAEG;IACK,oBAAoB;QAC1B,4EAA4E;QAC5E,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,uBAAuB,EAAE;YAC3C,IAAI,EAAE,uBAAuB;YAC7B,WAAW,EAAE,yDAAyD;YACtE,QAAQ,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,CAAC;YAC9F,OAAO,EAAE,kGAAkG;SAC5G,CAAC,CAAC;QAEH,IAAI,CAAC,UAAU,CAAC,GA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AAU,CAAC,GAAG,CAAC,IAAI,EAAE;YACxB,IAAI;YACJ,WAAW;YACX,QAAQ;YACR,OAAO;SACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,UAAU,CAAC,IAAY;QACrB,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAED;;;;OAIG;IACH,WAAW;QACT,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;IAC9C,CAAC;CACF;AA1PD,wCA0PC"}
|
package/build/types.d.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types communs pour le projet Smart-Thinking
|
|
3
|
+
*/
|
|
4
|
+
export type ThoughtType = 'regular' | 'revision' | 'meta' | 'hypothesis' | 'conclusion';
|
|
5
|
+
export type ConnectionType = 'supports' | 'contradicts' | 'refines' | 'branches' | 'derives' | 'associates';
|
|
6
|
+
export interface ThoughtNode {
|
|
7
|
+
id: string;
|
|
8
|
+
content: string;
|
|
9
|
+
type: ThoughtType;
|
|
10
|
+
timestamp: Date;
|
|
11
|
+
connections: Connection[];
|
|
12
|
+
metrics: ThoughtMetrics;
|
|
13
|
+
metadata: Record<string, any>;
|
|
14
|
+
}
|
|
15
|
+
export interface Connection {
|
|
16
|
+
targetId: string;
|
|
17
|
+
type: ConnectionType;
|
|
18
|
+
strength: number;
|
|
19
|
+
description?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ThoughtMetrics {
|
|
22
|
+
confidence: number;
|
|
23
|
+
relevance: number;
|
|
24
|
+
quality: number;
|
|
25
|
+
}
|
|
26
|
+
export interface SuggestedTool {
|
|
27
|
+
name: string;
|
|
28
|
+
confidence: number;
|
|
29
|
+
reason: string;
|
|
30
|
+
priority?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface Visualization {
|
|
33
|
+
nodes: VisualizationNode[];
|
|
34
|
+
links: VisualizationLink[];
|
|
35
|
+
metadata?: Record<string, any>;
|
|
36
|
+
}
|
|
37
|
+
export interface VisualizationNode {
|
|
38
|
+
id: string;
|
|
39
|
+
label: string;
|
|
40
|
+
type: ThoughtType;
|
|
41
|
+
metrics: ThoughtMetrics;
|
|
42
|
+
size?: number;
|
|
43
|
+
color?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface VisualizationLink {
|
|
46
|
+
source: string;
|
|
47
|
+
target: string;
|
|
48
|
+
type: ConnectionType;
|
|
49
|
+
strength: number;
|
|
50
|
+
width?: number;
|
|
51
|
+
color?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface MemoryItem {
|
|
54
|
+
id: string;
|
|
55
|
+
content: string;
|
|
56
|
+
tags: string[];
|
|
57
|
+
timestamp: Date;
|
|
58
|
+
relevanceScore?: number;
|
|
59
|
+
}
|
|
60
|
+
export interface NextStepSuggestion {
|
|
61
|
+
description: string;
|
|
62
|
+
type: ThoughtType;
|
|
63
|
+
confidence: number;
|
|
64
|
+
reasoning: string;
|
|
65
|
+
}
|
|
66
|
+
export interface SmartThinkingParams {
|
|
67
|
+
thought: string;
|
|
68
|
+
thoughtType?: ThoughtType;
|
|
69
|
+
connections?: Connection[];
|
|
70
|
+
requestSuggestions?: boolean;
|
|
71
|
+
generateVisualization?: boolean;
|
|
72
|
+
suggestTools?: boolean;
|
|
73
|
+
sessionId?: string;
|
|
74
|
+
userId?: string;
|
|
75
|
+
visualizationType?: 'graph' | 'chronological' | 'thematic';
|
|
76
|
+
help?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface SmartThinkingResponse {
|
|
79
|
+
thoughtId: string;
|
|
80
|
+
thought: string;
|
|
81
|
+
thoughtType: ThoughtType;
|
|
82
|
+
qualityMetrics: ThoughtMetrics;
|
|
83
|
+
suggestedTools?: SuggestedTool[];
|
|
84
|
+
visualization?: Visualization;
|
|
85
|
+
relevantMemories?: MemoryItem[];
|
|
86
|
+
suggestedNextSteps?: NextStepSuggestion[];
|
|
87
|
+
}
|
package/build/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Visualization } from './types';
|
|
2
|
+
import { ThoughtGraph } from './thought-graph';
|
|
3
|
+
/**
|
|
4
|
+
* Classe qui génère des visualisations du graphe de pensées
|
|
5
|
+
*/
|
|
6
|
+
export declare class Visualizer {
|
|
7
|
+
private thoughtTypeColors;
|
|
8
|
+
private connectionTypeColors;
|
|
9
|
+
/**
|
|
10
|
+
* Génère une visualisation du graphe de pensées
|
|
11
|
+
*
|
|
12
|
+
* @param thoughtGraph Le graphe de pensées à visualiser
|
|
13
|
+
* @param centerThoughtId Optionnel: l'ID de la pensée centrale (si non spécifié, utilise la plus récente)
|
|
14
|
+
* @returns Une visualisation du graphe
|
|
15
|
+
*/
|
|
16
|
+
generateVisualization(thoughtGraph: ThoughtGraph, centerThoughtId?: string): Visualization;
|
|
17
|
+
/**
|
|
18
|
+
* Génère une visualisation chronologique du graphe de pensées
|
|
19
|
+
*
|
|
20
|
+
* @param thoughtGraph Le graphe de pensées à visualiser
|
|
21
|
+
* @returns Une visualisation chronologique du graphe
|
|
22
|
+
*/
|
|
23
|
+
generateChronologicalVisualization(thoughtGraph: ThoughtGraph): Visualization;
|
|
24
|
+
/**
|
|
25
|
+
* Génère une visualisation thématique du graphe de pensées
|
|
26
|
+
*
|
|
27
|
+
* @param thoughtGraph Le graphe de pensées à visualiser
|
|
28
|
+
* @returns Une visualisation thématique du graphe
|
|
29
|
+
*/
|
|
30
|
+
generateThematicVisualization(thoughtGraph: ThoughtGraph): Visualization;
|
|
31
|
+
/**
|
|
32
|
+
* Génère des métadonnées pour la visualisation
|
|
33
|
+
*
|
|
34
|
+
* @param thoughts Les pensées du graphe
|
|
35
|
+
* @param links Les liens de la visualisation
|
|
36
|
+
* @param centerThoughtId L'ID de la pensée centrale
|
|
37
|
+
* @returns Les métadonnées de la visualisation
|
|
38
|
+
*/
|
|
39
|
+
private generateMetadata;
|
|
40
|
+
/**
|
|
41
|
+
* Tronque un texte à une longueur maximale
|
|
42
|
+
*
|
|
43
|
+
* @param text Le texte à tronquer
|
|
44
|
+
* @param maxLength La longueur maximale
|
|
45
|
+
* @returns Le texte tronqué
|
|
46
|
+
*/
|
|
47
|
+
private truncateText;
|
|
48
|
+
/**
|
|
49
|
+
* Extrait les thèmes (mots-clés) des pensées
|
|
50
|
+
*
|
|
51
|
+
* @param thoughts Les pensées dont extraire les thèmes
|
|
52
|
+
* @returns Un tableau de thèmes
|
|
53
|
+
*/
|
|
54
|
+
private extractThemes;
|
|
55
|
+
}
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Visualizer = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Classe qui génère des visualisations du graphe de pensées
|
|
6
|
+
*/
|
|
7
|
+
class Visualizer {
|
|
8
|
+
// Couleurs associées aux types de pensées
|
|
9
|
+
thoughtTypeColors = {
|
|
10
|
+
'regular': '#4285F4', // Bleu
|
|
11
|
+
'revision': '#EA4335', // Rouge
|
|
12
|
+
'meta': '#FBBC05', // Jaune
|
|
13
|
+
'hypothesis': '#34A853', // Vert
|
|
14
|
+
'conclusion': '#9C27B0' // Violet
|
|
15
|
+
};
|
|
16
|
+
// Couleurs associées aux types de connexions
|
|
17
|
+
connectionTypeColors = {
|
|
18
|
+
'supports': '#34A853', // Vert
|
|
19
|
+
'contradicts': '#EA4335', // Rouge
|
|
20
|
+
'refines': '#4285F4', // Bleu
|
|
21
|
+
'branches': '#FBBC05', // Jaune
|
|
22
|
+
'derives': '#9C27B0', // Violet
|
|
23
|
+
'associates': '#757575' // Gris
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Génère une visualisation du graphe de pensées
|
|
27
|
+
*
|
|
28
|
+
* @param thoughtGraph Le graphe de pensées à visualiser
|
|
29
|
+
* @param centerThoughtId Optionnel: l'ID de la pensée centrale (si non spécifié, utilise la plus récente)
|
|
30
|
+
* @returns Une visualisation du graphe
|
|
31
|
+
*/
|
|
32
|
+
generateVisualization(thoughtGraph, centerThoughtId) {
|
|
33
|
+
const thoughts = thoughtGraph.getAllThoughts();
|
|
34
|
+
if (thoughts.length === 0) {
|
|
35
|
+
return {
|
|
36
|
+
nodes: [],
|
|
37
|
+
links: [],
|
|
38
|
+
metadata: {
|
|
39
|
+
isEmpty: true
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
// Si aucun ID central n'est spécifié, utiliser la pensée la plus récente
|
|
44
|
+
if (!centerThoughtId) {
|
|
45
|
+
const recentThoughts = thoughtGraph.getRecentThoughts(1);
|
|
46
|
+
centerThoughtId = recentThoughts[0]?.id;
|
|
47
|
+
}
|
|
48
|
+
// Créer les nœuds de visualisation
|
|
49
|
+
const nodes = thoughts.map(thought => {
|
|
50
|
+
// Calculer la taille du nœud en fonction du nombre de connexions
|
|
51
|
+
const connectionCount = thought.connections.length;
|
|
52
|
+
const size = 10 + Math.min(connectionCount * 2, 15);
|
|
53
|
+
// Obtenir la couleur en fonction du type de pensée
|
|
54
|
+
const color = this.thoughtTypeColors[thought.type] || '#757575';
|
|
55
|
+
return {
|
|
56
|
+
id: thought.id,
|
|
57
|
+
label: this.truncateText(thought.content, 40),
|
|
58
|
+
type: thought.type,
|
|
59
|
+
metrics: thought.metrics,
|
|
60
|
+
size,
|
|
61
|
+
color
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
// Créer les liens de visualisation
|
|
65
|
+
const links = [];
|
|
66
|
+
// Pour chaque pensée, ajouter ses connexions comme liens
|
|
67
|
+
for (const thought of thoughts) {
|
|
68
|
+
for (const connection of thought.connections) {
|
|
69
|
+
// Éviter les doublons (chaque lien ne doit apparaître qu'une fois)
|
|
70
|
+
const linkExists = links.some(link => (link.source === thought.id && link.target === connection.targetId) ||
|
|
71
|
+
(link.source === connection.targetId && link.target === thought.id));
|
|
72
|
+
if (!linkExists) {
|
|
73
|
+
// Calculer l'épaisseur du lien en fonction de la force de la connexion
|
|
74
|
+
const width = 1 + connection.strength * 4;
|
|
75
|
+
// Obtenir la couleur en fonction du type de connexion
|
|
76
|
+
const color = this.connectionTypeColors[connection.type] || '#757575';
|
|
77
|
+
links.push({
|
|
78
|
+
source: thought.id,
|
|
79
|
+
target: connection.targetId,
|
|
80
|
+
type: connection.type,
|
|
81
|
+
strength: connection.strength,
|
|
82
|
+
width,
|
|
83
|
+
color
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// Génération de métadonnées pour la visualisation
|
|
89
|
+
const metadata = this.generateMetadata(thoughts, links, centerThoughtId);
|
|
90
|
+
return {
|
|
91
|
+
nodes,
|
|
92
|
+
links,
|
|
93
|
+
metadata
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Génère une visualisation chronologique du graphe de pensées
|
|
98
|
+
*
|
|
99
|
+
* @param thoughtGraph Le graphe de pensées à visualiser
|
|
100
|
+
* @returns Une visualisation chronologique du graphe
|
|
101
|
+
*/
|
|
102
|
+
generateChronologicalVisualization(thoughtGraph) {
|
|
103
|
+
const thoughts = thoughtGraph.getAllThoughts()
|
|
104
|
+
.sort((a, b) => a.timestamp.getTime() - b.timestamp.getTime());
|
|
105
|
+
if (thoughts.length === 0) {
|
|
106
|
+
return {
|
|
107
|
+
nodes: [],
|
|
108
|
+
links: [],
|
|
109
|
+
metadata: {
|
|
110
|
+
isEmpty: true
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
// Créer les nœuds de visualisation
|
|
115
|
+
const nodes = thoughts.map((thought, index) => {
|
|
116
|
+
// Calculer la taille du nœud en fonction de l'ordre chronologique
|
|
117
|
+
// Les pensées plus récentes sont légèrement plus grandes
|
|
118
|
+
const size = 10 + Math.min(index * 0.5, 10);
|
|
119
|
+
// Obtenir la couleur en fonction du type de pensée
|
|
120
|
+
const color = this.thoughtTypeColors[thought.type] || '#757575';
|
|
121
|
+
return {
|
|
122
|
+
id: thought.id,
|
|
123
|
+
label: this.truncateText(thought.content, 40),
|
|
124
|
+
type: thought.type,
|
|
125
|
+
metrics: thought.metrics,
|
|
126
|
+
size,
|
|
127
|
+
color
|
|
128
|
+
};
|
|
129
|
+
});
|
|
130
|
+
// Créer les liens chronologiques
|
|
131
|
+
const links = [];
|
|
132
|
+
// Connecter chaque pensée à la suivante chronologiquement
|
|
133
|
+
for (let i = 0; i < thoughts.length - 1; i++) {
|
|
134
|
+
links.push({
|
|
135
|
+
source: thoughts[i].id,
|
|
136
|
+
target: thoughts[i + 1].id,
|
|
137
|
+
type: 'associates',
|
|
138
|
+
strength: 0.5,
|
|
139
|
+
width: 1,
|
|
140
|
+
color: '#757575'
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
// Ajouter également les connexions explicites
|
|
144
|
+
for (const thought of thoughts) {
|
|
145
|
+
for (const connection of thought.connections) {
|
|
146
|
+
// Éviter les doublons (chaque lien ne doit apparaître qu'une fois)
|
|
147
|
+
const linkExists = links.some(link => (link.source === thought.id && link.target === connection.targetId) ||
|
|
148
|
+
(link.source === connection.targetId && link.target === thought.id));
|
|
149
|
+
if (!linkExists) {
|
|
150
|
+
// Calculer l'épaisseur du lien en fonction de la force de la connexion
|
|
151
|
+
const width = 1 + connection.strength * 3;
|
|
152
|
+
// Obtenir la couleur en fonction du type de connexion
|
|
153
|
+
const color = this.connectionTypeColors[connection.type] || '#757575';
|
|
154
|
+
links.push({
|
|
155
|
+
source: thought.id,
|
|
156
|
+
target: connection.targetId,
|
|
157
|
+
type: connection.type,
|
|
158
|
+
strength: connection.strength,
|
|
159
|
+
width,
|
|
160
|
+
color
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// Génération de métadonnées pour la visualisation
|
|
166
|
+
const metadata = {
|
|
167
|
+
type: 'chronological',
|
|
168
|
+
thoughtCount: thoughts.length,
|
|
169
|
+
timeline: thoughts.map(thought => ({
|
|
170
|
+
id: thought.id,
|
|
171
|
+
timestamp: thought.timestamp.toISOString()
|
|
172
|
+
}))
|
|
173
|
+
};
|
|
174
|
+
return {
|
|
175
|
+
nodes,
|
|
176
|
+
links,
|
|
177
|
+
metadata
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Génère une visualisation thématique du graphe de pensées
|
|
182
|
+
*
|
|
183
|
+
* @param thoughtGraph Le graphe de pensées à visualiser
|
|
184
|
+
* @returns Une visualisation thématique du graphe
|
|
185
|
+
*/
|
|
186
|
+
generateThematicVisualization(thoughtGraph) {
|
|
187
|
+
const thoughts = thoughtGraph.getAllThoughts();
|
|
188
|
+
if (thoughts.length === 0) {
|
|
189
|
+
return {
|
|
190
|
+
nodes: [],
|
|
191
|
+
links: [],
|
|
192
|
+
metadata: {
|
|
193
|
+
isEmpty: true
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
// Extraire les thèmes (mots-clés) des pensées
|
|
198
|
+
const themes = this.extractThemes(thoughts);
|
|
199
|
+
// Associer chaque pensée à ses thèmes
|
|
200
|
+
const thoughtThemes = {};
|
|
201
|
+
for (const thought of thoughts) {
|
|
202
|
+
thoughtThemes[thought.id] = themes.filter(theme => thought.content.toLowerCase().includes(theme.toLowerCase()));
|
|
203
|
+
}
|
|
204
|
+
// Créer les nœuds de visualisation
|
|
205
|
+
const nodes = thoughts.map(thought => {
|
|
206
|
+
// Obtenir la couleur en fonction du type de pensée
|
|
207
|
+
const color = this.thoughtTypeColors[thought.type] || '#757575';
|
|
208
|
+
// La taille dépend du nombre de thèmes associés
|
|
209
|
+
const themeCount = thoughtThemes[thought.id].length;
|
|
210
|
+
const size = 10 + Math.min(themeCount * 2, 15);
|
|
211
|
+
return {
|
|
212
|
+
id: thought.id,
|
|
213
|
+
label: this.truncateText(thought.content, 40),
|
|
214
|
+
type: thought.type,
|
|
215
|
+
metrics: thought.metrics,
|
|
216
|
+
size,
|
|
217
|
+
color
|
|
218
|
+
};
|
|
219
|
+
});
|
|
220
|
+
// Créer les liens thématiques
|
|
221
|
+
const links = [];
|
|
222
|
+
// Connecter les pensées qui partagent des thèmes
|
|
223
|
+
for (let i = 0; i < thoughts.length; i++) {
|
|
224
|
+
for (let j = i + 1; j < thoughts.length; j++) {
|
|
225
|
+
const thoughtA = thoughts[i];
|
|
226
|
+
const thoughtB = thoughts[j];
|
|
227
|
+
// Trouver les thèmes communs
|
|
228
|
+
const themesA = thoughtThemes[thoughtA.id];
|
|
229
|
+
const themesB = thoughtThemes[thoughtB.id];
|
|
230
|
+
const commonThemes = themesA.filter(theme => themesB.includes(theme));
|
|
231
|
+
// S'il y a des thèmes communs, créer un lien
|
|
232
|
+
if (commonThemes.length > 0) {
|
|
233
|
+
// La force dépend du nombre de thèmes communs
|
|
234
|
+
const strength = Math.min(0.3 + commonThemes.length * 0.1, 0.9);
|
|
235
|
+
links.push({
|
|
236
|
+
source: thoughtA.id,
|
|
237
|
+
target: thoughtB.id,
|
|
238
|
+
type: 'associates',
|
|
239
|
+
strength,
|
|
240
|
+
width: 1 + commonThemes.length,
|
|
241
|
+
color: '#757575'
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
// Génération de métadonnées pour la visualisation
|
|
247
|
+
const metadata = {
|
|
248
|
+
type: 'thematic',
|
|
249
|
+
thoughtCount: thoughts.length,
|
|
250
|
+
themes,
|
|
251
|
+
themeAssociations: Object.entries(thoughtThemes).map(([id, themeList]) => ({
|
|
252
|
+
id,
|
|
253
|
+
themes: themeList
|
|
254
|
+
}))
|
|
255
|
+
};
|
|
256
|
+
return {
|
|
257
|
+
nodes,
|
|
258
|
+
links,
|
|
259
|
+
metadata
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Génère des métadonnées pour la visualisation
|
|
264
|
+
*
|
|
265
|
+
* @param thoughts Les pensées du graphe
|
|
266
|
+
* @param links Les liens de la visualisation
|
|
267
|
+
* @param centerThoughtId L'ID de la pensée centrale
|
|
268
|
+
* @returns Les métadonnées de la visualisation
|
|
269
|
+
*/
|
|
270
|
+
generateMetadata(thoughts, links, centerThoughtId) {
|
|
271
|
+
// Compter les types de pensées
|
|
272
|
+
const thoughtTypeCount = {};
|
|
273
|
+
for (const thought of thoughts) {
|
|
274
|
+
thoughtTypeCount[thought.type] = (thoughtTypeCount[thought.type] || 0) + 1;
|
|
275
|
+
}
|
|
276
|
+
// Compter les types de connexions
|
|
277
|
+
const connectionTypeCount = {};
|
|
278
|
+
for (const link of links) {
|
|
279
|
+
connectionTypeCount[link.type] = (connectionTypeCount[link.type] || 0) + 1;
|
|
280
|
+
}
|
|
281
|
+
// Identifier la pensée centrale
|
|
282
|
+
const centerThought = centerThoughtId
|
|
283
|
+
? thoughts.find(t => t.id === centerThoughtId)
|
|
284
|
+
: thoughts[thoughts.length - 1];
|
|
285
|
+
return {
|
|
286
|
+
type: 'graph',
|
|
287
|
+
thoughtCount: thoughts.length,
|
|
288
|
+
linkCount: links.length,
|
|
289
|
+
thoughtTypeDistribution: thoughtTypeCount,
|
|
290
|
+
connectionTypeDistribution: connectionTypeCount,
|
|
291
|
+
centerThought: centerThought ? {
|
|
292
|
+
id: centerThought.id,
|
|
293
|
+
type: centerThought.type
|
|
294
|
+
} : undefined
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Tronque un texte à une longueur maximale
|
|
299
|
+
*
|
|
300
|
+
* @param text Le texte à tronquer
|
|
301
|
+
* @param maxLength La longueur maximale
|
|
302
|
+
* @returns Le texte tronqué
|
|
303
|
+
*/
|
|
304
|
+
truncateText(text, maxLength) {
|
|
305
|
+
if (text.length <= maxLength) {
|
|
306
|
+
return text;
|
|
307
|
+
}
|
|
308
|
+
return text.substring(0, maxLength - 3) + '...';
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Extrait les thèmes (mots-clés) des pensées
|
|
312
|
+
*
|
|
313
|
+
* @param thoughts Les pensées dont extraire les thèmes
|
|
314
|
+
* @returns Un tableau de thèmes
|
|
315
|
+
*/
|
|
316
|
+
extractThemes(thoughts) {
|
|
317
|
+
// Liste de mots courants à ignorer (stop words)
|
|
318
|
+
const stopWords = [
|
|
319
|
+
'le', 'la', 'les', 'un', 'une', 'des', 'ce', 'cette', 'ces',
|
|
320
|
+
'et', 'ou', 'mais', 'donc', 'car', 'ni', 'que', 'qui',
|
|
321
|
+
'dans', 'sur', 'sous', 'avec', 'sans', 'pour', 'par',
|
|
322
|
+
'je', 'tu', 'il', 'elle', 'nous', 'vous', 'ils', 'elles',
|
|
323
|
+
'est', 'sont', 'être', 'avoir', 'fait', 'faire',
|
|
324
|
+
'plus', 'moins', 'très', 'trop', 'peu', 'beaucoup'
|
|
325
|
+
];
|
|
326
|
+
// Extraire tous les mots de toutes les pensées
|
|
327
|
+
const allWords = thoughts.flatMap(thought => thought.content.toLowerCase()
|
|
328
|
+
.split(/\W+/)
|
|
329
|
+
.filter(word => word.length > 4 &&
|
|
330
|
+
!stopWords.includes(word)));
|
|
331
|
+
// Compter l'occurrence de chaque mot
|
|
332
|
+
const wordCount = {};
|
|
333
|
+
for (const word of allWords) {
|
|
334
|
+
wordCount[word] = (wordCount[word] || 0) + 1;
|
|
335
|
+
}
|
|
336
|
+
// Sélectionner les mots qui apparaissent au moins 2 fois
|
|
337
|
+
const themes = Object.entries(wordCount)
|
|
338
|
+
.filter(([_, count]) => count >= 2)
|
|
339
|
+
.sort(([_, countA], [__, countB]) => countB - countA)
|
|
340
|
+
.map(([word, _]) => word)
|
|
341
|
+
.slice(0, 10); // Limiter aux 10 thèmes les plus fréquents
|
|
342
|
+
return themes;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
exports.Visualizer = Visualizer;
|
|
346
|
+
//# sourceMappingURL=visualizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visualizer.js","sourceRoot":"","sources":["../src/visualizer.ts"],"names":[],"mappings":";;;AASA;;GAEG;AACH,MAAa,UAAU;IACrB,0CAA0C;IAClC,iBAAiB,GAA2B;QAClD,SAAS,EAAE,SAAS,EAAK,OAAO;QAChC,UAAU,EAAE,SAAS,EAAI,QAAQ;QACjC,MAAM,EAAE,SAAS,EAAQ,QAAQ;QACjC,YAAY,EAAE,SAAS,EAAE,OAAO;QAChC,YAAY,EAAE,SAAS,CAAE,SAAS;KACnC,CAAC;IAEF,6CAA6C;IACrC,oBAAoB,GAAmC;QAC7D,UAAU,EAAE,SAAS,EAAI,OAAO;QAChC,aAAa,EAAE,SAAS,EAAE,QAAQ;QAClC,SAAS,EAAE,SAAS,EAAK,OAAO;QAChC,UAAU,EAAE,SAAS,EAAI,QAAQ;QACjC,SAAS,EAAE,SAAS,EAAK,SAAS;QAClC,YAAY,EAAE,SAAS,CAAE,OAAO;KACjC,CAAC;IAEF;;;;;;OAMG;IACH,qBAAqB,CAAC,YAA0B,EAAE,eAAwB;QACxE,MAAM,QAAQ,GAAG,YAAY,CAAC,cAAc,EAAE,CAAC;QAE/C,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1B,OAAO;gBACL,KAAK,EAAE,EAAE;gBACT,KAAK,EAAE,EAAE;gBACT,QAAQ,EAAE;oBACR,OAAO,EAAE,IAAI;iBACd;aACF,CAAC;QACJ,CAAC;QAED,yEAAyE;QACzE,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,cAAc,GAAG,YAAY,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;YACzD,eAAe,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC1C,CAAC;QAED,mCAAmC;QACnC,MAAM,KAAK,GAA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AAE,CAAC;YAC5B,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QAC/C,CAAC;QAED,yDAAyD;QACzD,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;aACrC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,CAAC;aAClC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC;aACpD,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC;aACxB,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,2CAA2C;QAE5D,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAxZD,gCAwZC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "smart-thinking-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Un serveur MCP avancé pour le raisonnement multi-dimensionnel, adaptatif et collaboratif",
|
|
5
|
+
"main": "build/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"smart-thinking-mcp": "./build/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"build"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"dev": "ts-node src/index.ts",
|
|
15
|
+
"watch": "tsc --watch",
|
|
16
|
+
"start": "node build/index.js",
|
|
17
|
+
"test": "jest",
|
|
18
|
+
"prepublishOnly": "npm run build"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"mcp",
|
|
22
|
+
"claude",
|
|
23
|
+
"ai",
|
|
24
|
+
"reasoning",
|
|
25
|
+
"thinking",
|
|
26
|
+
"sequential-thinking",
|
|
27
|
+
"smart-thinking"
|
|
28
|
+
],
|
|
29
|
+
"author": "Smart-Thinking Team",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@modelcontextprotocol/sdk": "^1.7.0",
|
|
33
|
+
"zod": "^3.22.4"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@types/jest": "^29.5.3",
|
|
37
|
+
"@types/node": "^20.4.8",
|
|
38
|
+
"jest": "^29.6.2",
|
|
39
|
+
"ts-jest": "^29.1.1",
|
|
40
|
+
"ts-node": "^10.9.1",
|
|
41
|
+
"typescript": "^5.1.6"
|
|
42
|
+
}
|
|
43
|
+
}
|