import type { CommonOptions } from "../../shared/cli-options.js"; import type { BrandReviewScore, BrandReviewSectionSelector } from "../api/types.js"; import { type ReviewOutcome } from "../review/outcomes.js"; import { type BrandReviewJsonReport } from "../review/format-json.js"; import { type SarifReport } from "../review/format-sarif.js"; export type BrandReviewFormat = "text" | "json" | "sarif"; export interface BrandReviewCommandOptions extends CommonOptions { environmentName?: string; /** Override the orgId resolved from the active env profile. */ orgId?: string; /** Positional file paths to review. Mixed with `--glob` results. */ inputs?: string[]; /** Glob pattern(s) relative to the project root. */ glob?: string[]; /** Brand kit ID to evaluate against. Required for v1. */ kit?: string; /** * Restrict the review to these brand kit section UUIDs. Each value * may be a bare section UUID, or `:` to narrow * to a specific subsection within that section. Section names * (e.g. "Tone of Voice") are NOT accepted — name lookup lands when * the Brand Management read primitives ship. */ sectionId?: string[]; /** 1–5; exit non-zero if any score is below this. */ threshold?: number; /** Parallel in-flight reviews. Defaults to 4. */ concurrency?: number; /** Stop scheduling on first failure (in-flight still drain). */ failFast?: boolean; /** Output format. Defaults to `text`. */ format?: BrandReviewFormat; /** Write the formatted report to a file instead of stdout. */ output?: string; /** Max files to review without `--force`. Defaults to 1000. */ limit?: number; /** Bypass the `--limit` guardrail. */ force?: boolean; /** Print the resolved file list + count and exit without calling the API. */ whatIf?: boolean; } export interface BrandReviewRunResult { outcomes: ReviewOutcome[]; exitCode: number; /** What scai _wrote_ — useful for tests and JSON-mode callers. */ report?: string; json?: BrandReviewJsonReport; sarif?: SarifReport; } /** * Detect a file's content-format hint from its extension. The Brand * Review API uses a flexible `input` map and doesn't surface a * format-discriminator field today — this helper exists for callers * that want a stable categorization (e.g. logging, future routing of * `.json` content through an `ExtractableFile` reference instead of * raw text). Returns one of `"text" | "markdown" | "json"`. */ export type InputFormatHint = "text" | "markdown" | "json"; export declare const detectInputFormat: (filePath: string) => InputFormatHint; /** * Parse CLI `--section-id` values into the Brand Review API's * `Section[]` selector shape. * * Each value is either: * - `` → section-level evaluation * - `:` → field-level evaluation (multiple * `--section-id :` * occurrences merge into one * `Section` entry) * * Multiple values for the same sectionId accumulate into the * section's `fieldIds[]`. An empty / undefined input list returns * `undefined` (= API evaluates every section). */ export declare const parseSectionSelectors: (raw: readonly string[] | undefined) => BrandReviewSectionSelector[] | undefined; /** * Resolve positional file paths + glob patterns to a deduplicated, * sorted list of absolute file paths. Resolution rules: * * - Positional paths must exist; if any are missing the call * errors with INPUT_INVALID listing the missing entries. * - Glob patterns expand relative to `cwd`. * - Duplicates across positional+glob are removed. * - Directories and non-files are filtered out — Brand Review * operates on file content, not directory listings. * * Returns the resolved files in input order (positionals first, * then glob hits in their natural order). */ export declare const resolveReviewInputs: (positionals: readonly string[], globs: readonly string[], cwd: string) => Promise; /** * Compute the CLI exit code for a batch review run. * * 0 → no API errors and no scores below threshold * 1 → threshold violated by at least one file * 7 → at least one API call failed (`BRAND_API_FAILED`) * * Threshold violations and API errors can co-occur — when both fire, * the threshold violation wins (1) so CI failure modes are * distinguishable from infrastructure failures. */ export declare const computeExitCode: (outcomes: readonly ReviewOutcome[], threshold: BrandReviewScore | undefined) => number; /** * Run a batch Brand Review. * * The CLI verb is a thin wrapper around this — pass the same options * and inspect the returned `BrandReviewRunResult` to drive exit * codes, stdout writes, or downstream tooling. SDK consumers should * use this directly (exported through `@sitecoreai-labs/sitecoreai-cli/unstable/brand`). */ export declare const runBrandReview: (options: BrandReviewCommandOptions) => Promise;