import { type ProductDeclaration } from './volter-manifest'; export declare const PRODUCT_DECLARATION_KEY = "contributes.volter.product"; /** Light or dark — the two the workbench's own `ColorScheme` has plain names * for, and the only two a product needs to state (a high-contrast scheme is a * person's accessibility choice, never a product's declaration). */ export type ProductColorTheme = 'dark' | 'light'; export interface ProductWorkbench { /** The GitHub Release tag on `volter-ai/code-oss`. */ readonly release: string; /** The sha256 of that release's tarball asset, hex. */ readonly tarballSha256: string; } /** A product package, as everything outside it needs to know it. */ export interface ProductIdentity { readonly name: string; /** Its version, reported beside the workbench by the editor's `status` command. */ readonly version: string; readonly command: string; /** The name a person sees — `contributes.volter.product.displayName`. */ readonly displayName: string; /** * `contributes.volter.product.upgrade: true` — its command has `upgrade [version]` * (the product CLI's own), so a pinned-engine refusal * may tell a person to run it. Optional: a product that says nothing has none. */ readonly upgrade?: boolean; /** * `contributes.volter.product.adapterRequired: true` — a project this product opens must have its own * adapter module (`editor/volter.adapter.ts`), because the product's layout and document * finders are declared there and the native default shows none of them. Such a product refuses * a project without one. Optional: a product that says nothing opens it on the native default. */ readonly adapterRequired?: boolean; /** Its package root, absolute. */ readonly dir: string; /** * Its ONE source entry, package-relative and POSIX (`./src/index.ts`). That * entry IS the product's frame entry: it composes and re-exports `mountVolter`, * which is the name the fork's contribution reads off the served module. */ readonly entry: string; /** * The packages this product mounts, in order — `contributes.volter.product.composes`. The ONE statement of * the composition: the session reads it here for the packages it installs and serves, the catalog and the * serving doors. */ readonly composes: readonly string[]; readonly colorTheme: ProductColorTheme; /** WHICH WORKBENCH THIS PRODUCT IS — see {@link ProductWorkbench}. */ readonly workbench: ProductWorkbench | null; /** * The ONE LINE that installs this product and starts a project in it — * `contributes.volter.product.install` (`npx create my-project`). A limited view quotes * it wherever it cannot do what the local editor does (its agent answers with it, and every * route it does not carry names it), so it is a declaration read without running the product. * An undeclared one is `npx create my-project`, which is what every product's `create` * verb accepts. */ readonly install: string; } /** What a project without a product is told to add: the declaration this module reads, naming no package. */ export declare const PRODUCT_DECLARATION_HINT = "a product package as a dev dependency: one whose package.json declares `contributes.volter.product`"; /** * Read one product package's declaration, or `null` when the manifest is not a * product's. Throws when it declares `contributes.volter.product` and the declaration is * unusable — a half-written product must be named, never skipped. */ export declare function readProductManifest(packageDir: string): ProductIdentity | null; /** A product declaration's `composes`, checked: the packages it mounts, by name, in order. The * build's composition module and the session read it through this one check. */ export declare function productComposes(manifestPath: string, declared: ProductDeclaration): string[]; /** * A product's SHORT id — `@/` → ``. * * It is the product's own `product({ id })`, the directory its workbench half * lives in (`packages//workbench`), the `--product` flag the overlay and the * release build take, and what a release records in `BUILD.json`. One derivation * rather than four literals: the package name is the only place the product is * NAMED, and everything else is that name's last segment. */ export declare function workbenchProductId(packageName: string): string; /** A product's entry as a path relative to `fromDir`, POSIX — the spelling a * Vite manifest key and a dev-server URL both use. */ export declare function productEntryPath(product: ProductIdentity, fromDir: string): string; /** * The packages `product` mounts that are installed and contribute: its `contributes.volter.product.composes`, * each resolved from the product's own directory and kept when its manifest declares * a `contributes.volter` object (its serving half, `contributes.volter.serving`, may be all a package contributes). */ export declare function productComposedPackages(product: ProductIdentity): string[]; /** The products this project declares AND resolves, in declaration order. */ export declare function declaredProducts(projectRoot: string): ProductIdentity[]; /** * THE product this project opens in, or a throw naming what is wrong. * * The refusals are the whole point: a project with none and a project with two * are both states a person can be in, and neither has an answer this code may * invent. */ export declare function resolveProductForProject(projectRoot: string): ProductIdentity;