UNPKG

smart-thinking-mcp

Version:

Un serveur MCP avancé pour le raisonnement multi-dimensionnel, adaptatif et collaboratif

355 lines (354 loc) 21.3 kB
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { z } from 'zod'; import { SmartThinkingEnvironment } from './environment'; interface SmartThinkingServerOptions { includeSmartThinkingTool?: boolean; } export declare const SmartThinkingParamsSchema: z.ZodObject<{ thought: z.ZodString; thoughtType: z.ZodDefault<z.ZodEnum<["regular", "revision", "meta", "hypothesis", "conclusion"]>>; connections: z.ZodDefault<z.ZodArray<z.ZodObject<{ targetId: z.ZodString; type: z.ZodEnum<["supports", "contradicts", "refines", "branches", "derives", "associates", "exemplifies", "generalizes", "compares", "contrasts", "questions", "extends", "analyzes", "synthesizes", "applies", "evaluates", "cites", "extended-by", "analyzed-by", "component-of", "applied-by", "evaluated-by", "cited-by"]>; strength: z.ZodNumber; description: z.ZodOptional<z.ZodString>; attributes: z.ZodOptional<z.ZodObject<{ temporality: z.ZodOptional<z.ZodEnum<["before", "after", "during", "concurrent"]>>; certainty: z.ZodOptional<z.ZodEnum<["definite", "high", "moderate", "low", "speculative"]>>; directionality: z.ZodOptional<z.ZodEnum<["unidirectional", "bidirectional", "multidirectional"]>>; scope: z.ZodOptional<z.ZodEnum<["broad", "specific", "partial", "complete"]>>; nature: z.ZodOptional<z.ZodEnum<["causal", "correlational", "sequential", "hierarchical", "associative"]>>; customAttributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; }, "strip", z.ZodTypeAny, { nature?: "causal" | "correlational" | "sequential" | "hierarchical" | "associative" | undefined; scope?: "broad" | "specific" | "partial" | "complete" | undefined; temporality?: "before" | "after" | "during" | "concurrent" | undefined; certainty?: "definite" | "high" | "moderate" | "low" | "speculative" | undefined; directionality?: "unidirectional" | "bidirectional" | "multidirectional" | undefined; customAttributes?: Record<string, string> | undefined; }, { nature?: "causal" | "correlational" | "sequential" | "hierarchical" | "associative" | undefined; scope?: "broad" | "specific" | "partial" | "complete" | undefined; temporality?: "before" | "after" | "during" | "concurrent" | undefined; certainty?: "definite" | "high" | "moderate" | "low" | "speculative" | undefined; directionality?: "unidirectional" | "bidirectional" | "multidirectional" | undefined; customAttributes?: Record<string, string> | undefined; }>>; inferred: z.ZodOptional<z.ZodBoolean>; inferenceConfidence: z.ZodOptional<z.ZodNumber>; bidirectional: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { type: "supports" | "contradicts" | "refines" | "branches" | "derives" | "associates" | "exemplifies" | "generalizes" | "compares" | "contrasts" | "questions" | "extends" | "analyzes" | "synthesizes" | "applies" | "evaluates" | "cites" | "extended-by" | "analyzed-by" | "component-of" | "applied-by" | "evaluated-by" | "cited-by"; targetId: string; strength: number; bidirectional?: boolean | undefined; description?: string | undefined; attributes?: { nature?: "causal" | "correlational" | "sequential" | "hierarchical" | "associative" | undefined; scope?: "broad" | "specific" | "partial" | "complete" | undefined; temporality?: "before" | "after" | "during" | "concurrent" | undefined; certainty?: "definite" | "high" | "moderate" | "low" | "speculative" | undefined; directionality?: "unidirectional" | "bidirectional" | "multidirectional" | undefined; customAttributes?: Record<string, string> | undefined; } | undefined; inferred?: boolean | undefined; inferenceConfidence?: number | undefined; }, { type: "supports" | "contradicts" | "refines" | "branches" | "derives" | "associates" | "exemplifies" | "generalizes" | "compares" | "contrasts" | "questions" | "extends" | "analyzes" | "synthesizes" | "applies" | "evaluates" | "cites" | "extended-by" | "analyzed-by" | "component-of" | "applied-by" | "evaluated-by" | "cited-by"; targetId: string; strength: number; bidirectional?: boolean | undefined; description?: string | undefined; attributes?: { nature?: "causal" | "correlational" | "sequential" | "hierarchical" | "associative" | undefined; scope?: "broad" | "specific" | "partial" | "complete" | undefined; temporality?: "before" | "after" | "during" | "concurrent" | undefined; certainty?: "definite" | "high" | "moderate" | "low" | "speculative" | undefined; directionality?: "unidirectional" | "bidirectional" | "multidirectional" | undefined; customAttributes?: Record<string, string> | undefined; } | undefined; inferred?: boolean | undefined; inferenceConfidence?: number | undefined; }>, "many">>; requestSuggestions: z.ZodDefault<z.ZodBoolean>; generateVisualization: z.ZodDefault<z.ZodBoolean>; visualizationType: z.ZodDefault<z.ZodEnum<["graph", "chronological", "thematic", "hierarchical", "force", "radial"]>>; suggestTools: z.ZodDefault<z.ZodBoolean>; sessionId: z.ZodOptional<z.ZodString>; userId: z.ZodOptional<z.ZodString>; help: z.ZodDefault<z.ZodBoolean>; requestVerification: z.ZodDefault<z.ZodBoolean>; containsCalculations: z.ZodDefault<z.ZodBoolean>; visualizationOptions: z.ZodOptional<z.ZodObject<{ clusterBy: z.ZodOptional<z.ZodEnum<["type", "theme", "metric", "connectivity"]>>; direction: z.ZodDefault<z.ZodOptional<z.ZodEnum<["LR", "RL", "TB", "BT"]>>>; centerNode: z.ZodOptional<z.ZodString>; maxDepth: z.ZodOptional<z.ZodNumber>; filters: z.ZodOptional<z.ZodObject<{ nodeTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["regular", "revision", "meta", "hypothesis", "conclusion"]>, "many">>; connectionTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["supports", "contradicts", "refines", "branches", "derives", "associates", "exemplifies", "generalizes", "compares", "contrasts", "questions", "extends", "analyzes", "synthesizes", "applies", "evaluates", "cites", "extended-by", "analyzed-by", "component-of", "applied-by", "evaluated-by", "cited-by"]>, "many">>; metricThresholds: z.ZodOptional<z.ZodObject<{ confidence: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>; relevance: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>; quality: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>; }, "strip", z.ZodTypeAny, { confidence?: [number, number] | undefined; relevance?: [number, number] | undefined; quality?: [number, number] | undefined; }, { confidence?: [number, number] | undefined; relevance?: [number, number] | undefined; quality?: [number, number] | undefined; }>>; textSearch: z.ZodOptional<z.ZodString>; dateRange: z.ZodOptional<z.ZodTuple<[z.ZodDate, z.ZodDate], null>>; customFilters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; }, "strip", z.ZodTypeAny, { nodeTypes?: ("regular" | "revision" | "meta" | "hypothesis" | "conclusion")[] | undefined; connectionTypes?: ("supports" | "contradicts" | "refines" | "branches" | "derives" | "associates" | "exemplifies" | "generalizes" | "compares" | "contrasts" | "questions" | "extends" | "analyzes" | "synthesizes" | "applies" | "evaluates" | "cites" | "extended-by" | "analyzed-by" | "component-of" | "applied-by" | "evaluated-by" | "cited-by")[] | undefined; metricThresholds?: { confidence?: [number, number] | undefined; relevance?: [number, number] | undefined; quality?: [number, number] | undefined; } | undefined; textSearch?: string | undefined; dateRange?: [Date, Date] | undefined; customFilters?: Record<string, unknown> | undefined; }, { nodeTypes?: ("regular" | "revision" | "meta" | "hypothesis" | "conclusion")[] | undefined; connectionTypes?: ("supports" | "contradicts" | "refines" | "branches" | "derives" | "associates" | "exemplifies" | "generalizes" | "compares" | "contrasts" | "questions" | "extends" | "analyzes" | "synthesizes" | "applies" | "evaluates" | "cites" | "extended-by" | "analyzed-by" | "component-of" | "applied-by" | "evaluated-by" | "cited-by")[] | undefined; metricThresholds?: { confidence?: [number, number] | undefined; relevance?: [number, number] | undefined; quality?: [number, number] | undefined; } | undefined; textSearch?: string | undefined; dateRange?: [Date, Date] | undefined; customFilters?: Record<string, unknown> | undefined; }>>; interactivity: z.ZodOptional<z.ZodObject<{ zoomable: z.ZodOptional<z.ZodBoolean>; draggable: z.ZodOptional<z.ZodBoolean>; selectable: z.ZodOptional<z.ZodBoolean>; tooltips: z.ZodOptional<z.ZodBoolean>; expandableNodes: z.ZodOptional<z.ZodBoolean>; initialZoom: z.ZodOptional<z.ZodNumber>; zoomRange: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>; highlightOnHover: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { zoomable?: boolean | undefined; draggable?: boolean | undefined; selectable?: boolean | undefined; tooltips?: boolean | undefined; expandableNodes?: boolean | undefined; initialZoom?: number | undefined; zoomRange?: [number, number] | undefined; highlightOnHover?: boolean | undefined; }, { zoomable?: boolean | undefined; draggable?: boolean | undefined; selectable?: boolean | undefined; tooltips?: boolean | undefined; expandableNodes?: boolean | undefined; initialZoom?: number | undefined; zoomRange?: [number, number] | undefined; highlightOnHover?: boolean | undefined; }>>; }, "strip", z.ZodTypeAny, { direction: "LR" | "RL" | "TB" | "BT"; centerNode?: string | undefined; maxDepth?: number | undefined; clusterBy?: "type" | "theme" | "metric" | "connectivity" | undefined; filters?: { nodeTypes?: ("regular" | "revision" | "meta" | "hypothesis" | "conclusion")[] | undefined; connectionTypes?: ("supports" | "contradicts" | "refines" | "branches" | "derives" | "associates" | "exemplifies" | "generalizes" | "compares" | "contrasts" | "questions" | "extends" | "analyzes" | "synthesizes" | "applies" | "evaluates" | "cites" | "extended-by" | "analyzed-by" | "component-of" | "applied-by" | "evaluated-by" | "cited-by")[] | undefined; metricThresholds?: { confidence?: [number, number] | undefined; relevance?: [number, number] | undefined; quality?: [number, number] | undefined; } | undefined; textSearch?: string | undefined; dateRange?: [Date, Date] | undefined; customFilters?: Record<string, unknown> | undefined; } | undefined; interactivity?: { zoomable?: boolean | undefined; draggable?: boolean | undefined; selectable?: boolean | undefined; tooltips?: boolean | undefined; expandableNodes?: boolean | undefined; initialZoom?: number | undefined; zoomRange?: [number, number] | undefined; highlightOnHover?: boolean | undefined; } | undefined; }, { centerNode?: string | undefined; maxDepth?: number | undefined; clusterBy?: "type" | "theme" | "metric" | "connectivity" | undefined; direction?: "LR" | "RL" | "TB" | "BT" | undefined; filters?: { nodeTypes?: ("regular" | "revision" | "meta" | "hypothesis" | "conclusion")[] | undefined; connectionTypes?: ("supports" | "contradicts" | "refines" | "branches" | "derives" | "associates" | "exemplifies" | "generalizes" | "compares" | "contrasts" | "questions" | "extends" | "analyzes" | "synthesizes" | "applies" | "evaluates" | "cites" | "extended-by" | "analyzed-by" | "component-of" | "applied-by" | "evaluated-by" | "cited-by")[] | undefined; metricThresholds?: { confidence?: [number, number] | undefined; relevance?: [number, number] | undefined; quality?: [number, number] | undefined; } | undefined; textSearch?: string | undefined; dateRange?: [Date, Date] | undefined; customFilters?: Record<string, unknown> | undefined; } | undefined; interactivity?: { zoomable?: boolean | undefined; draggable?: boolean | undefined; selectable?: boolean | undefined; tooltips?: boolean | undefined; expandableNodes?: boolean | undefined; initialZoom?: number | undefined; zoomRange?: [number, number] | undefined; highlightOnHover?: boolean | undefined; } | undefined; }>>; }, "strip", z.ZodTypeAny, { thoughtType: "regular" | "revision" | "meta" | "hypothesis" | "conclusion"; thought: string; connections: { type: "supports" | "contradicts" | "refines" | "branches" | "derives" | "associates" | "exemplifies" | "generalizes" | "compares" | "contrasts" | "questions" | "extends" | "analyzes" | "synthesizes" | "applies" | "evaluates" | "cites" | "extended-by" | "analyzed-by" | "component-of" | "applied-by" | "evaluated-by" | "cited-by"; targetId: string; strength: number; bidirectional?: boolean | undefined; description?: string | undefined; attributes?: { nature?: "causal" | "correlational" | "sequential" | "hierarchical" | "associative" | undefined; scope?: "broad" | "specific" | "partial" | "complete" | undefined; temporality?: "before" | "after" | "during" | "concurrent" | undefined; certainty?: "definite" | "high" | "moderate" | "low" | "speculative" | undefined; directionality?: "unidirectional" | "bidirectional" | "multidirectional" | undefined; customAttributes?: Record<string, string> | undefined; } | undefined; inferred?: boolean | undefined; inferenceConfidence?: number | undefined; }[]; requestSuggestions: boolean; generateVisualization: boolean; visualizationType: "hierarchical" | "graph" | "force" | "radial" | "chronological" | "thematic"; suggestTools: boolean; help: boolean; requestVerification: boolean; containsCalculations: boolean; sessionId?: string | undefined; userId?: string | undefined; visualizationOptions?: { direction: "LR" | "RL" | "TB" | "BT"; centerNode?: string | undefined; maxDepth?: number | undefined; clusterBy?: "type" | "theme" | "metric" | "connectivity" | undefined; filters?: { nodeTypes?: ("regular" | "revision" | "meta" | "hypothesis" | "conclusion")[] | undefined; connectionTypes?: ("supports" | "contradicts" | "refines" | "branches" | "derives" | "associates" | "exemplifies" | "generalizes" | "compares" | "contrasts" | "questions" | "extends" | "analyzes" | "synthesizes" | "applies" | "evaluates" | "cites" | "extended-by" | "analyzed-by" | "component-of" | "applied-by" | "evaluated-by" | "cited-by")[] | undefined; metricThresholds?: { confidence?: [number, number] | undefined; relevance?: [number, number] | undefined; quality?: [number, number] | undefined; } | undefined; textSearch?: string | undefined; dateRange?: [Date, Date] | undefined; customFilters?: Record<string, unknown> | undefined; } | undefined; interactivity?: { zoomable?: boolean | undefined; draggable?: boolean | undefined; selectable?: boolean | undefined; tooltips?: boolean | undefined; expandableNodes?: boolean | undefined; initialZoom?: number | undefined; zoomRange?: [number, number] | undefined; highlightOnHover?: boolean | undefined; } | undefined; } | undefined; }, { thought: string; sessionId?: string | undefined; thoughtType?: "regular" | "revision" | "meta" | "hypothesis" | "conclusion" | undefined; connections?: { type: "supports" | "contradicts" | "refines" | "branches" | "derives" | "associates" | "exemplifies" | "generalizes" | "compares" | "contrasts" | "questions" | "extends" | "analyzes" | "synthesizes" | "applies" | "evaluates" | "cites" | "extended-by" | "analyzed-by" | "component-of" | "applied-by" | "evaluated-by" | "cited-by"; targetId: string; strength: number; bidirectional?: boolean | undefined; description?: string | undefined; attributes?: { nature?: "causal" | "correlational" | "sequential" | "hierarchical" | "associative" | undefined; scope?: "broad" | "specific" | "partial" | "complete" | undefined; temporality?: "before" | "after" | "during" | "concurrent" | undefined; certainty?: "definite" | "high" | "moderate" | "low" | "speculative" | undefined; directionality?: "unidirectional" | "bidirectional" | "multidirectional" | undefined; customAttributes?: Record<string, string> | undefined; } | undefined; inferred?: boolean | undefined; inferenceConfidence?: number | undefined; }[] | undefined; requestSuggestions?: boolean | undefined; generateVisualization?: boolean | undefined; visualizationType?: "hierarchical" | "graph" | "force" | "radial" | "chronological" | "thematic" | undefined; suggestTools?: boolean | undefined; userId?: string | undefined; help?: boolean | undefined; requestVerification?: boolean | undefined; containsCalculations?: boolean | undefined; visualizationOptions?: { centerNode?: string | undefined; maxDepth?: number | undefined; clusterBy?: "type" | "theme" | "metric" | "connectivity" | undefined; direction?: "LR" | "RL" | "TB" | "BT" | undefined; filters?: { nodeTypes?: ("regular" | "revision" | "meta" | "hypothesis" | "conclusion")[] | undefined; connectionTypes?: ("supports" | "contradicts" | "refines" | "branches" | "derives" | "associates" | "exemplifies" | "generalizes" | "compares" | "contrasts" | "questions" | "extends" | "analyzes" | "synthesizes" | "applies" | "evaluates" | "cites" | "extended-by" | "analyzed-by" | "component-of" | "applied-by" | "evaluated-by" | "cited-by")[] | undefined; metricThresholds?: { confidence?: [number, number] | undefined; relevance?: [number, number] | undefined; quality?: [number, number] | undefined; } | undefined; textSearch?: string | undefined; dateRange?: [Date, Date] | undefined; customFilters?: Record<string, unknown> | undefined; } | undefined; interactivity?: { zoomable?: boolean | undefined; draggable?: boolean | undefined; selectable?: boolean | undefined; tooltips?: boolean | undefined; expandableNodes?: boolean | undefined; initialZoom?: number | undefined; zoomRange?: [number, number] | undefined; highlightOnHover?: boolean | undefined; } | undefined; } | undefined; }>; export declare function createSmartThinkingServer(env?: SmartThinkingEnvironment, options?: SmartThinkingServerOptions): { server: McpServer; env: SmartThinkingEnvironment; }; export declare const SearchSchema: z.ZodObject<{ query: z.ZodString; limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; sessionId: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { limit: number; query: string; sessionId?: string | undefined; }, { query: string; sessionId?: string | undefined; limit?: number | undefined; }>; export declare const FetchSchema: z.ZodObject<{ id: z.ZodString; sessionId: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { id: string; sessionId?: string | undefined; }, { id: string; sessionId?: string | undefined; }>; export type { SmartThinkingServerOptions };