export type NodeLabel = 'File' | 'Folder' | 'Function' | 'Class' | 'Method' | 'Interface' | 'Variable' | 'Struct' | 'Enum' | 'Macro' | 'Typedef' | 'Union' | 'Namespace' | 'Trait' | 'Impl' | 'TypeAlias' | 'Const' | 'Static' | 'Property' | 'Record' | 'Delegate' | 'Annotation' | 'Constructor' | 'Template' | 'Module' | 'Process' | 'Route' | 'Community' | 'Concept' | 'Section' | 'Document' | 'Tool' | 'Agent' | 'Skill' | 'Entity' | 'Field'; export declare const SYMBOL_NODE_LABELS: Set; export type EdgeRelation = 'CONTAINS' | 'DEFINES' | 'CALLS' | 'IMPORTS' | 'RE_EXPORTS' | 'EXTENDS' | 'IMPLEMENTS' | 'HAS_METHOD' | 'HAS_PROPERTY' | 'ACCESSES' | 'METHOD_OVERRIDES' | 'METHOD_IMPLEMENTS' | 'MEMBER_OF' | 'STEP_IN_PROCESS' | 'HANDLES_ROUTE' | 'FETCHES' | 'HANDLES_TOOL' | 'ENTRY_POINT_OF' | 'WRAPS' | 'QUERIES' | 'REFERENCES' | 'PARENT_SECTION' | 'TAGGED_AS' | 'TESTS' | 'HAS_FIELD' | 'CO_OCCURS' | 'DESCRIBES' | 'CAUSES' | 'CONTRASTS_WITH' | 'PART_OF' | 'RELATED_TO' | 'USES' | 'STRUCTURALLY_SIMILAR'; export type EdgeConfidence = 'EXTRACTED' | 'INFERRED' | 'AMBIGUOUS'; export declare const CONFIDENCE_SCORE: Record; export interface MonographNode { id: string; label: NodeLabel; name: string; normLabel: string; filePath?: string; startLine?: number; endLine?: number; communityId?: number; isExported: boolean; language?: string; reachabilityRole?: 'runtime' | 'test' | 'support' | 'unreachable'; properties?: Record; } export interface EvidenceEntry { kind: string; weight: number; note?: string; } export interface MonographEdge { id: string; sourceId: string; targetId: string; relation: EdgeRelation; confidence: EdgeConfidence; confidenceScore: number; weight?: number; reason?: string; evidence?: EvidenceEntry[]; } export interface MonographCommunity { id: number; label?: string; size: number; cohesionScore: number; } export interface GodNode extends MonographNode { degree: number; inDegree: number; outDegree: number; } export interface ComplexityMetrics { cyclomaticComplexity: number; cognitiveComplexity: number; linesOfCode: number; paramCount: number; } export interface CrapScore { cc: number; coverage: number; score: number; risk: 'low' | 'medium' | 'high' | 'critical'; } export interface SurprisingConnection { edge: MonographEdge; score: number; reasons: string[]; } export type SuggestedQuestion = { type: 'ambiguous_edge'; edge: MonographEdge; reason: string; } | { type: 'bridge_node'; node: MonographNode; commA: number; commB: number; } | { type: 'verify_inferred'; edge: MonographEdge; inferredFrom: string; } | { type: 'isolated_nodes'; nodes: MonographNode[]; reason: string; } | { type: 'low_cohesion'; community: MonographCommunity; } | { type: 'no_signal'; edge: MonographEdge; reason: string; } | { type: 'thin_community'; communityId: number; memberCount: number; reason: string; }; export type FindingActionType = 'investigate' | 'refactor' | 'delete' | 'add-test' | 'add-import' | 'extract' | 'review' | 'add-edge'; export interface FindingAction { type: FindingActionType; file?: string; symbol?: string; description: string; confidence: 'high' | 'medium' | 'low'; } export interface AnnotatedFinding { title: string; severity: 'error' | 'warning' | 'info'; nodeId?: string; nodeName?: string; filePath?: string | null; introduced?: boolean; actions: FindingAction[]; } export declare function makeId(...parts: string[]): string; /** * Version of the node identity scheme implemented by `symbolId` and `fileId`. * * Bump this whenever either derivation changes, so that anything caching * extraction results keyed by node ID can detect that stored IDs are stale and * rebuild. A rebuild that mixed cached old-format IDs with freshly minted * new-format ones would produce edges pointing at nodes that no longer exist. * * Version 1 was the pre-`symbolId` scheme (`makeId(mangledPath, name, kind)`), * which collided across files whose paths differed only in punctuation and * across same-named symbols in different lexical scopes within one file. * Version 2 fixed that for symbols only; File/Folder/Document nodes still used * the lossy `makeId(path.replace(/\//g, '_'), kind)` scheme, so `src/a-b.ts` and * `src/a_b.ts` shared one node and containment edges attached to whichever * survived. Version 3 routes those through `fileId` as well. */ export declare const SYMBOL_ID_VERSION = 3; export interface SymbolIdParts { /** Exact repository-relative path (e.g. `src/a-b.ts`), used verbatim. */ filePath: string; /** Enclosing lexical scope names, outermost first (e.g. `['First']`). */ scope: readonly string[]; /** Symbol name as written in the source. */ name: string; /** Symbol kind — the node label (e.g. `Method`). */ kind: string; /** Discriminator for otherwise-identical declarations (overloads). 0 = first. */ overload?: number; } /** * Build a collision-free ID for a code symbol. * * Every component is length-prefixed before hashing, so the serialization is * injective: no component's content can masquerade as a delimiter or bleed into * a neighbouring component, and no two distinct `SymbolIdParts` can produce the * same input string. Path punctuation, lexical scope, kind, and overload index * are therefore all preserved rather than normalized away. * * The result is restricted to `[a-z0-9_]` and never starts or ends with `_`, so * that `makeId` — which callers use to derive edge IDs from node IDs — is the * identity function on it and cannot re-introduce the collisions this function * exists to prevent. * * The ID also keeps the `_` suffix the previous scheme ended with, because * relationship resolution disambiguates same-name call targets by testing for * `_method` / `_function` / `_class` on the ID (see * `pipeline/phases/scope-resolution.ts`). Preserving the suffix keeps that * working; it is not a substitute for reading the node's `label` column. */ export declare function symbolId(parts: SymbolIdParts): string; /** Node kinds that are identified by a repository-relative path rather than a symbol. */ export type PathNodeKind = 'file' | 'folder' | 'doc'; /** Collision-free ID for a File node, keyed on the exact repository-relative path. */ export declare function fileId(repoRelativePath: string): string; /** Collision-free ID for a Folder node, keyed on the exact repository-relative path. */ export declare function folderId(repoRelativePath: string): string; /** Collision-free ID for a Document node, keyed on the exact repository-relative path. */ export declare function docId(repoRelativePath: string): string; export declare function toNormLabel(name: string): string; export interface PipelineProgress { phase: string; filesProcessed?: number; totalFiles?: number; message?: string; } export declare class MonographError extends Error { readonly cause?: unknown; constructor(message: string, cause?: unknown); } //# sourceMappingURL=types.d.ts.map