mcp-think-tank
Version:
Structured thinking and knowledge management tool for Model Context Protocol
112 lines • 3.93 kB
TypeScript
import { IAgent } from './IAgent.js';
import { MemoryStore } from '../memory/store/MemoryStore.js';
import { z } from 'zod';
export declare const ExtendedThinkSchema: z.ZodObject<{
structuredReasoning: z.ZodString;
associateWithEntity: z.ZodOptional<z.ZodString>;
category: z.ZodOptional<z.ZodString>;
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
storeInMemory: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
context: z.ZodOptional<z.ZodString>;
} & {
plannedSteps: z.ZodOptional<z.ZodNumber>;
currentStep: z.ZodOptional<z.ZodNumber>;
selfReflect: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
allowResearch: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
reflectPrompt: z.ZodOptional<z.ZodString>;
researchQuery: z.ZodOptional<z.ZodString>;
formatOutput: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
formatType: z.ZodDefault<z.ZodOptional<z.ZodEnum<["auto", "general", "problem", "comparison"]>>>;
}, "strip", z.ZodTypeAny, {
structuredReasoning: string;
storeInMemory: boolean;
selfReflect: boolean;
allowResearch: boolean;
formatOutput: boolean;
formatType: "general" | "problem" | "comparison" | "auto";
context?: string | undefined;
associateWithEntity?: string | undefined;
category?: string | undefined;
tags?: string[] | undefined;
plannedSteps?: number | undefined;
currentStep?: number | undefined;
reflectPrompt?: string | undefined;
researchQuery?: string | undefined;
}, {
structuredReasoning: string;
context?: string | undefined;
associateWithEntity?: string | undefined;
category?: string | undefined;
tags?: string[] | undefined;
storeInMemory?: boolean | undefined;
plannedSteps?: number | undefined;
currentStep?: number | undefined;
selfReflect?: boolean | undefined;
allowResearch?: boolean | undefined;
reflectPrompt?: string | undefined;
researchQuery?: string | undefined;
formatOutput?: boolean | undefined;
formatType?: "general" | "problem" | "comparison" | "auto" | undefined;
}>;
export type ThinkParams = z.infer<typeof ExtendedThinkSchema>;
/**
* Basic agent implementation that uses the think tool for reasoning.
* This implementation refactors the original think tool logic to follow the IAgent interface.
*/
export declare class BasicAgent implements IAgent {
agentId: string;
memory: MemoryStore;
private params;
private output;
private reflection;
private researchResults;
private formattedOutput;
/**
* Create a new BasicAgent instance
*
* @param agentId - Unique identifier for this agent
* @param memory - Memory store for persistence
* @param params - Optional think tool parameters
*/
constructor(agentId: string, memory: MemoryStore, params?: Partial<ThinkParams>);
/**
* Initialize the agent
*
* @param ctx - Initialization context
*/
init(ctx: Record<string, unknown>): Promise<void>;
/**
* Process a step of reasoning
*
* @param input - Input for this reasoning step
* @returns The processed output
*/
step(input: string): Promise<string>;
/**
* Scan the output for research requests and process them
* Format: [research: query to search]
*/
private handleResearchRequests;
/**
* Conduct research using external tools
* In a real implementation, this would call a search API
*/
private conductResearch;
/**
* Perform a self-reflection pass on the current reasoning
*/
private performSelfReflection;
/**
* Apply markdown formatting to the output
*/
private applyFormatting;
/**
* Return the final formatted output
*/
private finalOutput;
/**
* Finalize the agent's work and persist to memory if needed
*/
finalize(): Promise<void>;
}
//# sourceMappingURL=BasicAgent.d.ts.map