import { type ProductIdentity } from './product-locator'; /** Where a project declares its workbench, relative to the project root. */ export declare const WORKBENCH_LOCATOR_PATH = ".volter/workbench.json"; /** What the session reports about the workbench it is running. */ export interface WorkbenchIdentity { readonly kind: 'release' | 'sources'; /** The directory named by the declaration or the flag, resolved absolute. */ readonly dir: string; /** The Code-OSS fork commit these bytes are. */ readonly commit: string; readonly product: string; } /** Everything the session needs to run it, identity included. */ export interface ResolvedWorkbench extends WorkbenchIdentity { /** The executable to spawn, already known to exist. */ readonly serverBin: string; /** Its working directory — the package root, or the checkout. */ readonly cwd: string; } /** The exact file to write, quoted in every refusal that wants one. */ export declare function workbenchDeclarationExample(projectRoot: string): string; /** * The workbench directory this project declares, or `null` when it declares * none. Throws when the file exists and is not exactly `{ "workbench": }` * — unrecognized keys are refused. */ export declare function readWorkbenchDeclaration(projectRoot: string): string | null; /** * WRITE THE DECLARATION — the one record of which workbench THIS machine opens * this project in. Written by ` create --workbench `, and written * by the fetch below, so the two paths cannot leave two different shapes of * file behind. */ export declare function writeWorkbenchDeclaration(projectRoot: string, workbenchDir: string): void; /** * The url the workbench answers on — the ONE url a person opens under the * frame. Spelled here so the CLI's launch line and the session's tab bijection * cannot disagree about it. * * `?project=` is the one boot param the Volter editor carries; the session's * one-origin proxy redirects it to the workbench's own `?folder=`, and * `frame-proxy.ts` says why it must be a redirect. */ export declare function workbenchUrl(proxyPort: number, projectRoot: string): string; /** A project's stable key on this machine: its page's host, and its workbench extensions folder. */ export declare function projectKey(projectRoot: string): string; /** The workbench at `dir`, refused where it is built for another product than `expectedProduct`; none named (a session * whose project's product cannot be resolved, which `/__editor/served-modules` explains) is not judged. */ export declare function resolveWorkbench(dir: string, expectedProduct?: string): ResolvedWorkbench; /** * WHERE FETCHED BYTES LIVE — one directory per release tag, per user (`~/.volter/workbenches`). * * Keyed by the TAG and nothing else, because that is what makes it a cache and * not a decision: two projects on the same release share one directory, * a second `create` consults no network, and a release is immutable, so a tag * that is here is the tag that was published. Which workbench a project opens * in is still recorded in the PROJECT (`.volter/workbench.json`, written the * moment this resolves) — nothing ever searches this directory. */ export declare const WORKBENCH_CACHE_ROOT: string; /** Where the fetch talks. `log` is a line; `progress` is ONE line rewritten in * place (216 MB is a wait, and a wait with no number is a hang). */ export interface WorkbenchFetchIO { readonly log: (line: string) => void; readonly progress?: (line: string) => void; } /** * THE WORKBENCH THIS PROJECT OPENS IN, resolved in three steps: * * 1. `--workbench ` — one launch, writes nothing. * 2. `/.volter/workbench.json` — this machine's record for this project. * 3. the PRODUCT's declared release — fetched once, then written into (2). * * Step 3 is what makes the product's `create` open something * on a machine that has never built anything, and it is why the CLI resolves * the product BEFORE the workbench. */ export declare function resolveWorkbenchForProject(options: { projectRoot: string; product: ProductIdentity; /** `--workbench `, when the person passed one. */ override?: string | undefined; io: WorkbenchFetchIO; }): Promise;