/** * Document Detector Service * * Analyses command outputs to detect document-worthy content * and suggest appropriate document types and categories. */ import { type DocumentCategory, type DocumentDetectionResult } from '../types/document.types.js'; export declare class DocumentDetectorService { private readonly logger; /** * Check if a command should skip document output entirely */ shouldSkipDocumentOutput(commandName: string): boolean; /** * Error indicators that signal the output should not be saved * * NOTE: "missing_information" was removed from this list because it's a valid * JSON field name used by prompts like understand-intent to indicate gaps. * The check for missing_information as an error is now more specific - see * checkForErrors() which checks if it's an error flag rather than a field name. * * NOTE: '"error":' was removed because it's a valid JSON field name used in * API schema documentation (e.g., "error": null in response schemas). The * checkForErrors() method already properly checks for outputs['error'] as a * top-level error field. * * NOTE: '[Pending' was removed because it's a valid status marker in Open * Questions sections (e.g., "[Pending - recommend 2xx range]"). Placeholder * detection via PLACEHOLDER_PATTERNS handles actual incomplete content, and * the context-aware filtering in checkContentQuality() excludes matches * inside tracked sections like "Open Questions". */ private static readonly ERROR_INDICATORS; /** * Placeholder patterns that indicate incomplete content */ private static readonly PLACEHOLDER_PATTERNS; /** * Section headers where placeholder-like markers (e.g., "[Pending - ...]") * are valid status annotations rather than incomplete content. */ private static readonly STATUS_MARKER_SECTIONS; /** * Detect if command output is document-worthy and suggest type/category */ detect(outputs: Record, commandName: string): DocumentDetectionResult; /** * Build result for command-mapped document types */ private buildMappedTypeResult; /** * Build result based on content pattern analysis */ private buildPatternAnalysisResult; /** * Check outputs object for explicit error responses */ private checkForErrors; /** * Check content quality for error indicators and placeholders */ private checkContentQuality; /** * Identify line numbers that fall within status-tracking sections * where placeholder-like markers are valid annotations. * * A status-tracking section starts at a markdown heading (##, ###, etc.) * whose text matches STATUS_MARKER_SECTIONS and ends at the next heading * of equal or higher level (or end of content). */ private getStatusMarkerLines; /** * Get the 0-based line number for a character offset in a string */ private getLineNumber; /** * Extract text content from outputs object */ private extractContent; /** * Analyse content for document type patterns */ private analyzeContent; /** * Suggest category based on content analysis */ suggestCategory(content: string, _commandName: string): DocumentCategory; } //# sourceMappingURL=document-detector.service.d.ts.map