UNPKG

@git.zone/tsdoc

Version:

A comprehensive TypeScript documentation tool that leverages AI to generate and enhance project documentation, including dynamic README creation, API docs via TypeDoc, and smart commit message generation.

74 lines (73 loc) 2.3 kB
import type { ContextMode, IContextResult, TaskType, IFileMetadata } from './types.js'; /** * Enhanced ProjectContext that supports context optimization strategies */ export declare class EnhancedContext { private projectDir; private trimmer; private configManager; private lazyLoader; private cache; private analyzer; private contextMode; private tokenBudget; private contextResult; /** * Create a new EnhancedContext * @param projectDirArg The project directory */ constructor(projectDirArg: string); /** * Initialize the context builder */ initialize(): Promise<void>; /** * Set the context mode * @param mode The context mode to use */ setContextMode(mode: ContextMode): void; /** * Set the token budget * @param maxTokens The maximum tokens to use */ setTokenBudget(maxTokens: number): void; /** * Convert files to context with smart analysis and prioritization * @param metadata - File metadata to analyze * @param taskType - Task type for context-aware prioritization * @param mode - Context mode to use * @returns Context string */ convertFilesToContextWithAnalysis(metadata: IFileMetadata[], taskType: TaskType, mode?: ContextMode): Promise<string>; /** * Build context for the project using smart analysis * @param taskType Task type for context-aware prioritization (defaults to 'description') */ buildContext(taskType?: TaskType): Promise<IContextResult>; /** * Update the context with git diff information for commit tasks * @param gitDiff The git diff to include */ updateWithGitDiff(gitDiff: string): IContextResult; /** * Count tokens in a string * @param text The text to count tokens for * @param model The model to use for token counting */ countTokens(text: string, model?: string): number; /** * Get the context result */ getContextResult(): IContextResult; /** * Get the token count for the current context */ getTokenCount(): number; /** * Get both the context string and its token count */ getContextWithTokenCount(): { context: string; tokenCount: number; }; }