/** * Tier-aware operation gate — Phase 2 of the workspace policy. * * `enforceEnvironmentPolicy` (Phase 1) answers "may scai touch this * environment at all". `authorizeOperation` answers the Phase 2 * question: "may *this caller* perform a *write* / *destructive* / * *mint* operation here". See docs/policy-and-guardrails.md. */ import { type CallerContext } from "./caller.js"; import { type RiskTier } from "./types.js"; export interface AuthorizeOperationParams { envName: string; /** * Directory holding the resolved `sitecoreai.cli.json`. Optional — * when absent, the repo-policy narrowing layer is skipped (the * user-global policy still applies). */ configRootDir?: string; /** Risk tier of the operation being attempted. */ tier: RiskTier; /** Override the detected caller context — for tests. */ caller?: CallerContext; /** * ISO timestamp the deploy token was last minted (`deployTokenLastUpdated` * on the env profile). Drives the Phase 3 step-up freshness check on * `destructive` / `mint` operations; ignored when the policy sets no * step-up window. */ tokenLastUpdated?: string; } /** * Throws `POLICY_DENIED` when the workspace policy does not permit the * current caller to run a `tier` operation against `envName`. A no-op * for the `read` tier and in unmanaged mode (no `~/.sitecoreai/policy.json`). */ export declare const authorizeOperation: (params: AuthorizeOperationParams) => void;