export declare function _isValidDb(p: string): boolean; /** * Resolve the monograph DB path for a given repo root (defaults to project cwd). * Falls back to searching up to the git root when the DB isn't directly under * `/.monomind` — e.g. when called from a subdirectory of the repo. Only * the no-arg (project cwd) form is cached; explicit `repoPath` overrides are * cheap one-off lookups (staleness checks with a user-supplied path) so caching * them isn't worth the invalidation complexity. */ export declare function getDbPath(repoPathOverride?: string): string; export declare function text(t: string): { content: { type: 'text'; text: string; }[]; }; /** A direct search hit used to seed the expansion. */ export type SeedNode = { id: string; name: string; label: string; filePath: string; startLine: number | null; score: number; }; /** @deprecated Use {@link SeedNode}. */ export type PprScoredNode = SeedNode; export type ExpandedNode = SeedNode & { /** * True when the node was NOT a direct search hit — it is in the result set * only because a direct hit points at it. Supporting context, not a match. */ isSupportingContext: boolean; /** * True when the displayed score is higher than the node's own direct-match * score because a neighbor raised it. A node with this set must not be * reported as a plain lexical match — its rank is not purely its own. */ scoreRaisedByNeighbors: boolean; }; /** Hard caps so expansion stays bounded regardless of graph shape. */ export declare const MAX_EXPANSION_EDGES = 5000; export declare const MAX_SUPPORTING_NODES = 200; export declare const DEFAULT_EXPANSION_DAMPING = 0.5; /** * Coerce a caller-supplied damping factor into [0, 1]. * Non-finite input (NaN, Infinity, a non-number from an MCP client) falls back * to the default rather than silently poisoning every propagated score. */ export declare function normalizeExpansionDamping(damping: unknown): number; /** * Expand one outgoing hop from `seedNodes` and merge the neighbors in as * supporting context. * * `options.label`, when set, is reapplied AFTER expansion: a filtered query * must not return an off-label node just because an on-label hit points at it. */ export declare function expandWithNeighbors(db: any, seedNodes: SeedNode[], damping: number, maxResults: number, options?: { label?: string; }): ExpandedNode[]; /** * Compute how many commits the index is behind HEAD. * Returns { commitsBehind, lastCommit } — or null if the index has never been * built or git is unavailable. */ export declare function computeCommitsBehind(repoPath: string): Promise<{ commitsBehind: number; lastCommit: string; } | null>; /** * Shared staleness threshold: both monograph_staleness and monograph_suggest (checkStaleness) * trigger a background rebuild only when the index is more than this many commits behind HEAD. * Using a shared constant prevents conflicting rebuild pressure during active dev sessions. * Was 10 → 3 → 1. Even 3 let routine small commits accumulate stale results * silently. At 1 (rebuild triggers at 2+ behind), staleness rarely persists * across sessions. */ export declare const STALENESS_THRESHOLD = 1; /** * Fire-and-forget background rebuild. Uses a module-level guard so concurrent * MCP tool calls (e.g. repeated monograph_suggest checkStaleness) don't pile up builds. * threshold: minimum commitsBehind to trigger (default STALENESS_THRESHOLD + 1). */ export declare function triggerBackgroundBuildIfNeeded(repoPath: string, commitsBehind: number, threshold?: number): boolean; /** * BM25 ranks purely on literal keyword overlap, so a doc/concept node whose * prose happens to mention task-related words (e.g. a report mentioning * "retry" constants) can outrank the actual code symbol the task is really * about, which is conceptually related but lexically different (issue #38). * Prefer code-symbol hits (Function/Class/Method/...) over doc-type hits * (Document/Concept/Section/...) when there are any, falling back to the * full hit list so a genuinely doc-only task still gets results. */ export declare function preferSymbolHits(hits: T[], symbolLabels: ReadonlySet): T[]; //# sourceMappingURL=shared.d.ts.map