/** * Which pack roots the editor reads — the same ones a run would. * * This lives apart from `server-impl.ts` on purpose. That file is a thin * protocol adapter, excluded from coverage because only a real editor * exercises it; deciding where the packs are is a real decision and has to be * testable without an LSP client. * * The first version of this logic scanned the bundled packs and two * conventional folders inside the workspace, and stopped. That left out the * packs people actually install: `tdcv2 pack add sd` unpacks into the store * named by `~/.config/tdcv2/config.json` or the project's `tdcv2.config.json` * and registers that store under `dataPaths`. So somebody could install Sindhi, * watch the CLI render it, and get completion for not one `sd.` address — * autocomplete disagreeing with the engine about what exists, which is the one * thing autocomplete must never do. */ import { type PackRegistry } from '../data-pack/index.js'; import type { PackAddressInfo } from './completion.js'; /** * Roots for a set of workspace directories, lowest priority first. * * `loadConfig` is the same call the CLI, `pack`, `init` and the Quick API make, * so the editor resolves roots exactly as a run does. A config that will not * parse is the run's problem to report — losing every pack the editor can still * see would be a worse answer than ignoring one broken file, so it is caught. */ export declare function packRootsFor(workspaceDirs: readonly string[]): readonly string[]; /** * One stat per root — the cheap half of the freshness check. * * Installing a pack changes the store directory's mtime, and registering it * changes the set of roots. Walking a hundred locale packs takes seconds and * cannot happen per keystroke; comparing stamps takes microseconds, so the walk * only runs when something actually moved. */ export declare function stampRoots(roots: readonly string[]): ReadonlyMap; /** True when the roots or their timestamps have moved since `previous`. */ export declare function rootsChanged(previous: ReadonlyMap, current: ReadonlyMap): boolean; /** * A workspace folder's URI as a plain directory, or nothing. * * The protocol hands folders over as URIs and says nothing about the scheme. A remote or virtual * workspace arrives as something other than `file:`, and there is no directory behind it to scan — * so it is dropped rather than guessed at. A malformed `file:` URI is dropped the same way: the * editor keeps working with the roots it could resolve, which is a better answer than a language * server that will not start. */ export declare function uriToPath(uri: string): string | undefined; /** * The pack roots for a set of workspace folders, straight from what `initialize` sent. * * Takes the folders rather than the whole `InitializeParams` so this module never imports the * LSP packages — they are OPTIONAL peer dependencies, absent from a plain `npm install tdcv2`, * and a module that is measured and tested must not need them. */ export declare function workspaceRootsFrom(folders: readonly { readonly uri: string; }[] | undefined): readonly string[]; /** * A scanned registry as the two shapes the editor answers from. * * Addresses feed diagnostics — so a known pack template is not flagged as unknown — and the * richer infos feed completion, where the description is what tells one address from another in * the list. A pack without a description contributes none rather than an empty one, or the list * shows a dangling separator against half its rows. */ export declare function packViewOf(registry: PackRegistry): { readonly addresses: readonly string[]; readonly infos: readonly PackAddressInfo[]; }; //# sourceMappingURL=pack-roots.d.ts.map