import type { RootDef } from './core/command.js'; /** Every shipped subtree name. Cheap (no module loading) — the front-door * recursion guard and the dispatcher's first-token routing need only names. */ export declare const SUBTREE_NAMES: string[]; /** Build a root that contains only the subtree `first` dispatches into. * Returns the FULL root when `first` is not a recognized subtree — bare `crtr`, * `-h`/`--help`, `--version`, and any unknown leading token all need the * complete tree (root -h lists every subtree; the unknown-path error names * every valid child). This keeps every help/error surface byte-identical while * the common leaf-dispatch path loads exactly one subtree. */ export declare function resolveRoot(first: string | undefined): Promise; /** Assemble the full crtr command tree: every core subtree plus every top-level * branch contributed by an external command source — enabled command plugins * AND registered configured CLIs, folded together through ONE unified, * collision-resolved snapshot (`buildExternalCommandSnapshot`). Used for root * -h, the unknown-path error, bare-root boot, front-door recognition, and the * listing-completeness test — i.e. only the FALLTHROUGH path, never the core * fast path (`resolveRoot` short-circuits a recognized core first token with * zero plugin/CLI I/O). Root owns only the tagline; every subtree (core or * external) declares its own root representation via its rootEntry. * * Order is deterministic: core subtrees in declared order first, then accepted * external branches sorted by contributor name (from the unified snapshot). * Composition is invocation-local and reads only stored manifest bytes — no * cache, no persistence, ZERO network — so a plugin enable/update/remove or a * configured-CLI register/refresh/remove takes effect on the next invocation * automatically. The one network path (absent-store hydration, §5.1) is * isolated in `hydrateAbsentStoresAndRebuild`, off this composition path. */ export declare function buildRoot(): Promise; /** The ONE unknown-first-token retry step (amended spec §5.1, §8), invoked by * dispatch only when an unknown FIRST token misses (not a core command, not * any stored external contribution) — never for a deeper unknown token under a * known command. Hydrate EVERY registered configured CLI whose manifest store * is absent exactly once, write one stderr diagnostic per FAILED hydration, * and — if anything was hydrated — return a freshly rebuilt root so dispatch * can re-walk the original argv once. Returns undefined when nothing was * hydrated (no absent stores, or every attempt failed): the caller then * surfaces the plain `unknown_path`/USAGE error, with the failed-hydration * diagnostics already emitted and NO NETWORK precedence over that outcome. * When every registration holds a stored manifest this performs ZERO network * I/O and returns undefined. It is the ONLY network the dispatch path can * trigger; composition (`buildRoot`) never fetches. */ export declare function hydrateAbsentStoresAndRebuild(): Promise;