import { type EditorialEvidenceKind, type SectionEvidencePlan } from "../config/editorial-plans.js"; import { type TaskContext } from "../context/task-context-compiler.js"; import { type RetrievalProfile } from "./text-analysis.js"; import { type WikiPageType } from "./wiki-validation.js"; import { type DiagramMode } from "../config/document-options.js"; export { DOCUMENT_TYPES, type DocumentType } from "../config/document-contracts.js"; export { WIKI_PAGE_TYPES, type WikiPageType } from "./wiki-validation.js"; export interface WikiPageInventoryEntry { relPath: string; title: string; type: string; tags: string[]; sources: string[]; body: string; charCount: number; } export interface TemplateSection { level: number; title: string; heading: string; } export interface SectionContextOptions { wikiRoot: string; sectionTitle: string; query?: string; documentType?: string; diagramMode?: DiagramMode; writerLanguage?: string; evidencePlan?: Partial; pagePaths?: string[]; pageTypes?: readonly string[]; maxPages?: number; maxCharsPerPage?: number; maxTotalChars?: number; maxOutputChars?: number; heuristicTokenBudget?: number; retrievalProfile?: RetrievalProfile; /** Retained for API compatibility. The accuracy-safe compiler always uses the graph. */ useGraph?: boolean; } export interface SectionContextPage { relPath: string; title: string; type: string; tags: string[]; sources: string[]; evidenceUri?: string; heading?: string; score: number; includedChars: number; originalChars: number; truncated: boolean; body: string; } export interface SectionSourceCoverage { referencedSources: number; knownSources: number; fullyCoveredSources: number; unknownSources: string[]; averageCoveragePercent: number | null; } export interface SectionCoverageMatrix { status: "COVERED" | "GAP"; requiredEvidence: EditorialEvidenceKind[]; foundEvidence: EditorialEvidenceKind[]; missingEvidence: EditorialEvidenceKind[]; sourceCoverage: SectionSourceCoverage; contradictions: string[]; unprovenancedEvidenceCount: number; } export interface SectionContextResult { documentType?: string; writerLanguage?: string; diagramRelevant: boolean; diagramMode: DiagramMode | null; diagramEvidencePack?: DiagramEvidencePack; pages: SectionContextPage[]; totalIncludedChars: number; totalOriginalChars: number; coverage: SectionCoverageMatrix; graphSummary?: string; compiler: { strategy: TaskContext["retrieval"]["strategy"]; wideningLevel: TaskContext["retrieval"]["wideningLevel"]; manifestHeuristicTokens: number; withinHeuristicBudget: boolean; fallbackUsed: boolean; fullGraphScanAttempted: false; fullSourceGrepAttempted: false; }; omittedPaths?: string[]; } export interface ReviewFinding { severity: "BLOCKER" | "WARNING" | "INFO"; code: string; message: string; evidence?: string; } export interface DocumentReviewResult { documentType?: string; effectiveDiagramMode: DiagramMode | null; readyForDelivery: boolean; blockerCount: number; contractCheckCount: number; contractChecksPassed: number; findings: ReviewFinding[]; missingSections: string[]; weakSections: string[]; placeholderCount: number; mermaidIssueCount: number; clientFacingIssueCount: number; languageIssueCount: number; coverage: Array<{ section: string; status: "ok" | "weak"; evidence: string[]; }>; } export interface ReviewOptions { documentType?: string; diagramMode?: DiagramMode; language?: string; clientFacing?: boolean; includeWikiUpdatePlan?: boolean; assetResolver?: DocumentAssetResolver; } export interface DocumentPlanOptions { documentType: string; template?: string; projectName?: string; objective?: string; audience?: string; language?: string; maxSections?: number; } export { DIAGRAM_MODES, type DiagramMode } from "../config/document-options.js"; export interface DiagramEvidenceNode { id: string; label: string; type: string; path?: string; evidenceRefs: string[]; } export interface DiagramEvidenceRelation { from: string; to: string; kind: string; evidenceRefs: string[]; } export interface DiagramEvidencePack { nodes: DiagramEvidenceNode[]; relations: DiagramEvidenceRelation[]; gaps: string[]; } export interface DocumentAssetRequest { relativePath: string; readLimit: number; } export type DocumentAssetResolution = { status: "resolved"; byteLength: number; bytes?: Uint8Array; } | { status: "missing"; detail?: string; } | { status: "escape"; detail?: string; } | { status: "invalid"; detail?: string; }; export type DocumentAssetResolver = (request: DocumentAssetRequest) => Promise; export declare const DOCUMENT_ASSET_MAX_BYTES: number; export declare function isDiagramRelevantSection(sectionTitle: string): boolean; export interface KnowledgeUpdateOptions { finding: string; targetPagePath?: string; pageType?: WikiPageType; title?: string; wikiContext?: string; codeContext?: string; sources?: string[]; date?: string; } export declare function collectWikiInventory(wikiRoot: string, pageTypes?: readonly string[]): Promise; export declare function parseTemplateSections(template: string, maxSections?: number): TemplateSection[]; export declare function buildDocumentPlan(wikiRoot: string, options: DocumentPlanOptions): Promise; export declare function createSectionContext(options: SectionContextOptions): Promise; export declare function formatSectionContext(result: SectionContextResult, sectionTitle: string, maxOutputChars?: number): string; export declare function markdownImageTargets(markdown: string): string[]; export declare function reviewDocumentStructure(markdown: string, template?: string, options?: ReviewOptions): Promise; export declare function formatWikiUpdatePlan(result: DocumentReviewResult): string; export declare function formatReviewResult(result: DocumentReviewResult, filename: string, options?: ReviewOptions): string; export declare function prepareKnowledgeUpdateDraft(options: KnowledgeUpdateOptions): { path: string; content: string; }; //# sourceMappingURL=document-workflow.d.ts.map