@emmahyde/thinking-patterns
Version:
MCP server combining systematic thinking, mental models, debugging approaches, and stochastic algorithms for comprehensive cognitive pattern support
426 lines (425 loc) • 15.5 kB
TypeScript
import { z } from 'zod';
/**
* Recursive Thinking Schema
*
* Defines the structure for recursive problem-solving and algorithmic thinking.
* Includes base cases, recursive cases, complexity analysis, optimization
* strategies, and iterative alternatives for comprehensive recursive analysis.
*/
export declare const BaseCaseSchema: z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
condition: z.ZodString;
solution: z.ZodString;
complexity: z.ZodOptional<z.ZodString>;
examples: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
condition: string;
solution: string;
complexity?: string | undefined;
id?: string | undefined;
examples?: string[] | undefined;
}, {
condition: string;
solution: string;
complexity?: string | undefined;
id?: string | undefined;
examples?: string[] | undefined;
}>;
export declare const RecursiveCaseSchema: z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
condition: z.ZodString;
decomposition: z.ZodString;
recombination: z.ZodString;
reductionFactor: z.ZodOptional<z.ZodString>;
examples: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
condition: string;
decomposition: string;
recombination: string;
id?: string | undefined;
examples?: string[] | undefined;
reductionFactor?: string | undefined;
}, {
condition: string;
decomposition: string;
recombination: string;
id?: string | undefined;
examples?: string[] | undefined;
reductionFactor?: string | undefined;
}>;
export declare const ComplexityAnalysisSchema: z.ZodObject<{
timeComplexity: z.ZodString;
spaceComplexity: z.ZodString;
maxStackDepth: z.ZodOptional<z.ZodString>;
worstCaseInput: z.ZodOptional<z.ZodString>;
bestCaseInput: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
timeComplexity: string;
spaceComplexity: string;
maxStackDepth?: string | undefined;
worstCaseInput?: string | undefined;
bestCaseInput?: string | undefined;
}, {
timeComplexity: string;
spaceComplexity: string;
maxStackDepth?: string | undefined;
worstCaseInput?: string | undefined;
bestCaseInput?: string | undefined;
}>;
export declare const OptimizationSchema: z.ZodObject<{
technique: z.ZodString;
description: z.ZodString;
complexityImprovement: z.ZodOptional<z.ZodString>;
tradeoffs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
implementation: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
description: string;
technique: string;
implementation?: string | undefined;
complexityImprovement?: string | undefined;
tradeoffs?: string[] | undefined;
}, {
description: string;
technique: string;
implementation?: string | undefined;
complexityImprovement?: string | undefined;
tradeoffs?: string[] | undefined;
}>;
export declare const IterativeAlternativeSchema: z.ZodObject<{
approach: z.ZodString;
description: z.ZodString;
advantages: z.ZodArray<z.ZodString, "many">;
disadvantages: z.ZodArray<z.ZodString, "many">;
complexity: z.ZodOptional<z.ZodObject<{
timeComplexity: z.ZodString;
spaceComplexity: z.ZodString;
maxStackDepth: z.ZodOptional<z.ZodString>;
worstCaseInput: z.ZodOptional<z.ZodString>;
bestCaseInput: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
timeComplexity: string;
spaceComplexity: string;
maxStackDepth?: string | undefined;
worstCaseInput?: string | undefined;
bestCaseInput?: string | undefined;
}, {
timeComplexity: string;
spaceComplexity: string;
maxStackDepth?: string | undefined;
worstCaseInput?: string | undefined;
bestCaseInput?: string | undefined;
}>>;
implementation: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
description: string;
advantages: string[];
disadvantages: string[];
approach: string;
complexity?: {
timeComplexity: string;
spaceComplexity: string;
maxStackDepth?: string | undefined;
worstCaseInput?: string | undefined;
bestCaseInput?: string | undefined;
} | undefined;
implementation?: string | undefined;
}, {
description: string;
advantages: string[];
disadvantages: string[];
approach: string;
complexity?: {
timeComplexity: string;
spaceComplexity: string;
maxStackDepth?: string | undefined;
worstCaseInput?: string | undefined;
bestCaseInput?: string | undefined;
} | undefined;
implementation?: string | undefined;
}>;
export declare const RecursiveThinkingSchema: z.ZodObject<{
problem: z.ZodString;
problemId: z.ZodOptional<z.ZodString>;
domain: z.ZodOptional<z.ZodString>;
baseCases: z.ZodArray<z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
condition: z.ZodString;
solution: z.ZodString;
complexity: z.ZodOptional<z.ZodString>;
examples: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
condition: string;
solution: string;
complexity?: string | undefined;
id?: string | undefined;
examples?: string[] | undefined;
}, {
condition: string;
solution: string;
complexity?: string | undefined;
id?: string | undefined;
examples?: string[] | undefined;
}>, "many">;
recursiveCases: z.ZodArray<z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
condition: z.ZodString;
decomposition: z.ZodString;
recombination: z.ZodString;
reductionFactor: z.ZodOptional<z.ZodString>;
examples: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
condition: string;
decomposition: string;
recombination: string;
id?: string | undefined;
examples?: string[] | undefined;
reductionFactor?: string | undefined;
}, {
condition: string;
decomposition: string;
recombination: string;
id?: string | undefined;
examples?: string[] | undefined;
reductionFactor?: string | undefined;
}>, "many">;
terminationConditions: z.ZodArray<z.ZodString, "many">;
complexityAnalysis: z.ZodOptional<z.ZodObject<{
timeComplexity: z.ZodString;
spaceComplexity: z.ZodString;
maxStackDepth: z.ZodOptional<z.ZodString>;
worstCaseInput: z.ZodOptional<z.ZodString>;
bestCaseInput: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
timeComplexity: string;
spaceComplexity: string;
maxStackDepth?: string | undefined;
worstCaseInput?: string | undefined;
bestCaseInput?: string | undefined;
}, {
timeComplexity: string;
spaceComplexity: string;
maxStackDepth?: string | undefined;
worstCaseInput?: string | undefined;
bestCaseInput?: string | undefined;
}>>;
optimizations: z.ZodOptional<z.ZodArray<z.ZodObject<{
technique: z.ZodString;
description: z.ZodString;
complexityImprovement: z.ZodOptional<z.ZodString>;
tradeoffs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
implementation: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
description: string;
technique: string;
implementation?: string | undefined;
complexityImprovement?: string | undefined;
tradeoffs?: string[] | undefined;
}, {
description: string;
technique: string;
implementation?: string | undefined;
complexityImprovement?: string | undefined;
tradeoffs?: string[] | undefined;
}>, "many">>;
iterativeAlternatives: z.ZodOptional<z.ZodArray<z.ZodObject<{
approach: z.ZodString;
description: z.ZodString;
advantages: z.ZodArray<z.ZodString, "many">;
disadvantages: z.ZodArray<z.ZodString, "many">;
complexity: z.ZodOptional<z.ZodObject<{
timeComplexity: z.ZodString;
spaceComplexity: z.ZodString;
maxStackDepth: z.ZodOptional<z.ZodString>;
worstCaseInput: z.ZodOptional<z.ZodString>;
bestCaseInput: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
timeComplexity: string;
spaceComplexity: string;
maxStackDepth?: string | undefined;
worstCaseInput?: string | undefined;
bestCaseInput?: string | undefined;
}, {
timeComplexity: string;
spaceComplexity: string;
maxStackDepth?: string | undefined;
worstCaseInput?: string | undefined;
bestCaseInput?: string | undefined;
}>>;
implementation: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
description: string;
advantages: string[];
disadvantages: string[];
approach: string;
complexity?: {
timeComplexity: string;
spaceComplexity: string;
maxStackDepth?: string | undefined;
worstCaseInput?: string | undefined;
bestCaseInput?: string | undefined;
} | undefined;
implementation?: string | undefined;
}, {
description: string;
advantages: string[];
disadvantages: string[];
approach: string;
complexity?: {
timeComplexity: string;
spaceComplexity: string;
maxStackDepth?: string | undefined;
worstCaseInput?: string | undefined;
bestCaseInput?: string | undefined;
} | undefined;
implementation?: string | undefined;
}>, "many">>;
stackOverflowRisk: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
inputSizeLimit: z.ZodOptional<z.ZodString>;
tailRecursionOptimizable: z.ZodOptional<z.ZodBoolean>;
invariants: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
testCases: z.ZodOptional<z.ZodArray<z.ZodObject<{
input: z.ZodString;
expectedOutput: z.ZodString;
reasoning: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
input: string;
expectedOutput: string;
reasoning?: string | undefined;
}, {
input: string;
expectedOutput: string;
reasoning?: string | undefined;
}>, "many">>;
recursionPattern: z.ZodOptional<z.ZodEnum<["linear", "binary", "tree", "mutual", "indirect", "nested"]>>;
similarProblems: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
commonMistakes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
problem: string;
baseCases: {
condition: string;
solution: string;
complexity?: string | undefined;
id?: string | undefined;
examples?: string[] | undefined;
}[];
recursiveCases: {
condition: string;
decomposition: string;
recombination: string;
id?: string | undefined;
examples?: string[] | undefined;
reductionFactor?: string | undefined;
}[];
terminationConditions: string[];
domain?: string | undefined;
invariants?: string[] | undefined;
problemId?: string | undefined;
complexityAnalysis?: {
timeComplexity: string;
spaceComplexity: string;
maxStackDepth?: string | undefined;
worstCaseInput?: string | undefined;
bestCaseInput?: string | undefined;
} | undefined;
optimizations?: {
description: string;
technique: string;
implementation?: string | undefined;
complexityImprovement?: string | undefined;
tradeoffs?: string[] | undefined;
}[] | undefined;
iterativeAlternatives?: {
description: string;
advantages: string[];
disadvantages: string[];
approach: string;
complexity?: {
timeComplexity: string;
spaceComplexity: string;
maxStackDepth?: string | undefined;
worstCaseInput?: string | undefined;
bestCaseInput?: string | undefined;
} | undefined;
implementation?: string | undefined;
}[] | undefined;
stackOverflowRisk?: "low" | "medium" | "high" | undefined;
inputSizeLimit?: string | undefined;
tailRecursionOptimizable?: boolean | undefined;
testCases?: {
input: string;
expectedOutput: string;
reasoning?: string | undefined;
}[] | undefined;
recursionPattern?: "linear" | "binary" | "tree" | "mutual" | "indirect" | "nested" | undefined;
similarProblems?: string[] | undefined;
learningObjectives?: string[] | undefined;
commonMistakes?: string[] | undefined;
}, {
problem: string;
baseCases: {
condition: string;
solution: string;
complexity?: string | undefined;
id?: string | undefined;
examples?: string[] | undefined;
}[];
recursiveCases: {
condition: string;
decomposition: string;
recombination: string;
id?: string | undefined;
examples?: string[] | undefined;
reductionFactor?: string | undefined;
}[];
terminationConditions: string[];
domain?: string | undefined;
invariants?: string[] | undefined;
problemId?: string | undefined;
complexityAnalysis?: {
timeComplexity: string;
spaceComplexity: string;
maxStackDepth?: string | undefined;
worstCaseInput?: string | undefined;
bestCaseInput?: string | undefined;
} | undefined;
optimizations?: {
description: string;
technique: string;
implementation?: string | undefined;
complexityImprovement?: string | undefined;
tradeoffs?: string[] | undefined;
}[] | undefined;
iterativeAlternatives?: {
description: string;
advantages: string[];
disadvantages: string[];
approach: string;
complexity?: {
timeComplexity: string;
spaceComplexity: string;
maxStackDepth?: string | undefined;
worstCaseInput?: string | undefined;
bestCaseInput?: string | undefined;
} | undefined;
implementation?: string | undefined;
}[] | undefined;
stackOverflowRisk?: "low" | "medium" | "high" | undefined;
inputSizeLimit?: string | undefined;
tailRecursionOptimizable?: boolean | undefined;
testCases?: {
input: string;
expectedOutput: string;
reasoning?: string | undefined;
}[] | undefined;
recursionPattern?: "linear" | "binary" | "tree" | "mutual" | "indirect" | "nested" | undefined;
similarProblems?: string[] | undefined;
learningObjectives?: string[] | undefined;
commonMistakes?: string[] | undefined;
}>;
export type RecursiveThinkingData = z.infer<typeof RecursiveThinkingSchema>;
export type BaseCaseData = z.infer<typeof BaseCaseSchema>;
export type RecursiveCaseData = z.infer<typeof RecursiveCaseSchema>;
export type ComplexityAnalysisData = z.infer<typeof ComplexityAnalysisSchema>;
export type OptimizationData = z.infer<typeof OptimizationSchema>;
export type IterativeAlternativeData = z.infer<typeof IterativeAlternativeSchema>;