/** * The Atlas brief — what an agent should already know before it asks anything. * * Every other part of this subsystem answers a question. This one answers the * question nobody asks: *what is this repository?* An agent that has to * discover the shape of an 8,000-file monorepo by search costs a dozen tool * calls per session and rediscovers the same thing every session. A few * hundred tokens of "here are the twenty files everything depends on, here is * what each package is for" removes that repeatedly-paid cost. * * ## Why it is a structure, not a string * * The renderer lives with the caller because the budget does. The CLI's * system-prompt contributor has a hard token ceiling and trims from the * bottom; a webui panel or a `--brief` flag would want different cuts of the * same data. Building a string here would force one budget on all of them. * * ## Why it reports staleness rather than hiding it * * A brief describing code that has since changed is worse than no brief: it * is confidently wrong in a way the reader cannot detect. `staleFiles` is * carried so the caller can say so out loud. */ import { type IndexStore } from './writer.js'; /** Hubs named in the brief. Past roughly this many, it stops being a summary. */ export declare const BRIEF_HUB_LIMIT = 20; /** Packages named in the brief. */ export declare const BRIEF_PACKAGE_LIMIT = 12; /** Subsystem one-liners included when the concept layer has run. */ export declare const BRIEF_SUBSYSTEM_LIMIT = 10; export interface AtlasBriefHub { path: string; /** Rank relative to the most central file in the repository. */ rank: number; /** Concept-layer summary, when the layer has run for this file. */ concept?: string | undefined; } export interface AtlasBriefPackage { name: string; files: number; /** The package's most central file. */ hub: string; } export interface AtlasBriefSubsystem { name: string; summary: string; } export interface AtlasBrief { /** True once the rank pass has run; false means only counts are meaningful. */ ranked: boolean; counts: { files: number; symbols: number; packages: number; }; hubs: AtlasBriefHub[]; packages: AtlasBriefPackage[]; subsystems: AtlasBriefSubsystem[]; /** * Files whose content changed since the written atlas was generated, or * `undefined` when no atlas has been written — a project that never ran * `--write` is not stale, it simply has no projection. */ staleFiles?: number | undefined; } /** * Build the brief from an open store. * * Reads only what it names: the ranked head, not the whole ranking. On an * index with no ranks this returns `ranked: false` and empty lists rather * than falling back to a filename heuristic — a guess presented as the * repository's structure is the failure mode this whole subsystem exists to * remove. */ export declare function buildAtlasBrief(store: IndexStore, projectRoot: string): Promise; /** Reported when a project has no index to summarise. */ export type AtlasBriefIndexMissing = { indexed: false; }; /** * Build a project's brief, owning the store lifetime. * * Refuses without an index for the same reason every other project-level * entry point does: acquiring a store CREATES the database, and a prompt * contributor must never be the thing that indexes a repository. */ export declare function buildProjectAtlasBrief(projectRoot: string, opts?: { indexDir?: string | undefined; }): Promise; //# sourceMappingURL=atlas-brief.d.ts.map