/** * `scai setup bootstrap [env]` — one guided flow from (optionally) nothing to a * working head app. It composes the steps an operator otherwise runs (and * discovers one-error-at-a-time) by hand: * * 0. Init (conditional) — if no profile exists for the env, run `setup init` * first. `init` stays a thin standalone command; this * is just so bootstrap can start from zero. * 1. Workspace policy — enroll + permit minting + raise the ceiling to * `destructive` (consent-gated; these are deny-by-default * safety guardrails, so we ask before flipping them). * 2. Authenticate — device login to mint the deploy token. * 3. CM automation client — mint the env-scoped client the Authoring API needs. * 4. Site identity — pick the SXA site (now that discovery can auth), * writing `site` + `siteCollection` so recipeRoots derive. * 5. Repo assets — generate `.env.local` + `xmcloud.build.json` for the * head app, using the just-picked site. On by default * in a head-app repo; `--skip-assets` / `--assets` override. * 6. Push the recipes — optional, consent-gated (`--skip-push` to provision only). * 7. Prune (opt-in) — `--prune-defaults` removes the SXA OOTB default folders. * * Every step is idempotent: re-running bootstrap re-grants (no-op), re-mints * (skips if present), re-writes the merged repo assets, and re-pushes (zero * mutations) — so it doubles as a "fix my setup" command. */ import type { CommonOptions } from "../shared/cli-options.js"; export type BootstrapOptions = CommonOptions & { environmentName?: string; /** Answer "yes" to every consent prompt (policy grants, login, assets, push). */ yes?: boolean; /** Force-generate the repo assets (.env.local + xmcloud.build.json) even outside a head-app repo. */ assets?: boolean; /** Skip the repo-assets step. */ skipAssets?: boolean; /** Rendering-host key for xmcloud.build.json (defaults to `-editing-host`). */ renderingHost?: string; /** Skip the recipe push. */ skipPush?: boolean; /** After pushing, prune the SXA Headless OOTB default folders. */ pruneDefaults?: boolean; }; /** * Does `dir` look like a Content SDK head app? Used to decide whether the * repo-assets step runs by default. Cheap signal checks, never throws. */ export declare const isHeadAppRepo: (dir?: string) => boolean; export declare const runBootstrap: (options: BootstrapOptions) => Promise;