/** * KGContextTools - Knowledge-graph-driven targeted context retrieval * * Provides: * - `get_targeted_context`: Uses the KG as an index over Memory Bank files * to return a budgeted, minimal "context pack" for a query. * - `graph_add_doc_pointer`: Convenience tool to link an entity to a * Memory Bank file path + heading. * * Also exports deterministic excerpt utilities: * - readSectionByHeading * - excerptAroundMatches */ import { MemoryBankManager } from '../../core/MemoryBankManager.js'; /** * Find a section by heading in markdown and return its content. * * Match is case-insensitive substring against heading text (ignoring leading `#`). * Returns from the matched heading to the next heading of same or higher level. */ export declare function readSectionByHeading(markdown: string, headingHint: string, maxChars: number): { excerpt: string; truncated: boolean; } | null; /** * Extract lines around query matches in markdown content. * * Returns a single excerpt per file with `windowLines` context above/below * each match. Prefers earliest/highest-density matches. */ export declare function excerptAroundMatches(markdown: string, query: string, windowLines?: number, maxChars?: number): { excerpt: string; truncated: boolean; } | null; export declare const kgContextTools: ({ name: string; description: string; inputSchema: { type: string; properties: { query: { type: string; description: string; }; maxChars: { type: string; description: string; minimum: number; }; maxFiles: { type: string; description: string; minimum: number; maximum: number; }; graphLimit: { type: string; description: string; minimum: number; maximum: number; }; graphDepth: { type: string; description: string; enum: number[]; }; preferActiveContext: { type: string; description: string; }; entityNameOrId?: undefined; docPath?: undefined; heading?: undefined; note?: undefined; }; required: string[]; }; } | { name: string; description: string; inputSchema: { type: string; properties: { entityNameOrId: { type: string; description: string; }; docPath: { type: string; description: string; }; heading: { type: string; description: string; }; note: { type: string; description: string; }; query?: undefined; maxChars?: undefined; maxFiles?: undefined; graphLimit?: undefined; graphDepth?: undefined; preferActiveContext?: undefined; }; required: string[]; }; })[]; /** * Handle get_targeted_context tool call. */ export declare function handleGetTargetedContext(memoryBankManager: MemoryBankManager, input: { query: string; maxChars?: number; maxFiles?: number; graphLimit?: number; graphDepth?: 1 | 2; preferActiveContext?: boolean; }): Promise<{ content: Array<{ type: string; text: string; }>; isError?: boolean; }>; /** * Handle graph_add_doc_pointer tool call. * Links a KG entity to a Memory Bank file path + optional heading. */ export declare function handleGraphAddDocPointer(memoryBankManager: MemoryBankManager, input: { entityNameOrId: string; docPath: string; heading?: string; note?: string; }): Promise<{ content: Array<{ type: string; text: string; }>; isError?: boolean; }>; //# sourceMappingURL=KGContextTools.d.ts.map