/** * THE NODE READER of a package's `package.json` as Volter reads it: its name, its dependency * names and its `contributes.volter` declarations, which `@volter/sdk/volter-contributions` reads as the workbench and * the page read them. The build's product plugin, the session's catalog and * serving doors, the shared-React scope and the pre-bundle crawl all read a package here, so a * declaration means one thing everywhere it is read. * * It parses and does no policy. What an unusable declaration costs is the caller's to say: a * product build refuses it, the catalog reports it as a load error, a scope decision treats it * as no declaration. {@link declaredContributions} is the one test of "this package contributes". */ export interface VolterManifest { /** The `package.json`, absolute. */ readonly path: string; /** Its package's directory. */ readonly dir: string; readonly name: string | null; readonly version: string | null; readonly private: boolean; readonly bin: unknown; /** Every name in `dependencies`, `devDependencies` and `optionalDependencies`, in that order, * each once. */ readonly dependencyNames: readonly string[]; /** `package.json#contributes.volter`, unchecked: the package's contribution modules, an object * keyed by kind, and its declarations (`serving`, `viewRoutes`, `product`). It is where Code-OSS's extension * service reads them too, through the kit's `volter` extension point. */ readonly contributions: unknown; /** `package.json#contributes.languageModelTools`, unchecked: the agent tools Code-OSS registers from it. */ readonly languageModelTools: unknown; /** `package.json#contributes.volter.product`, a product's declaration, read and checked by `product-locator.ts`; * `undefined` when the package declares none or it is not an object. */ readonly product: ProductDeclaration | undefined; } /** `package.json#contributes.volter.product`, as declared and unchecked. */ export interface ProductDeclaration { readonly entry?: unknown; readonly composes?: unknown; readonly colorTheme?: unknown; readonly workbench?: unknown; readonly displayName?: unknown; readonly install?: unknown; readonly upgrade?: unknown; readonly adapterRequired?: unknown; } /** `path`'s manifest, or `null` when there is no file there or it is not a JSON object. */ export declare function readVolterManifest(path: string): VolterManifest | null; /** * The package's declared modules, each contribution's and its page half's, with why any entry is refused; `null` when * it declares none (an absent `contributes.volter`, or one that is not an object). A package with the object, even an * empty one, is a contributing package: its modules are editor-tree code. */ export declare function declaredContributions(manifest: VolterManifest | null): { readonly modules: readonly string[]; readonly errors: readonly string[]; } | null;