import type { EnvironmentConfiguration } from "../../config/types.js"; import type { Logger } from "../../shared/logger.js"; /** * Sites API helpers for resolving per-site or tenant-wide publish * languages. Used by `scai content publish *` verbs to back the explicit * `--languages-from-site ` and `--all-tenant-languages` flags * (no implicit resolution — each flag does exactly what its name * says). * * Auth: the Sites API uses `xmcloud.cm:admin` (already in scai's * deploy token scope set). No additional grants required — same * credentials that mint the publishing token cover site lookups. */ /** * Look up a single site by exact `name` and return its configured * languages. Throws if the site doesn't exist in the env so the * caller surfaces a clear error before any publish-API write. */ export declare const lookupSiteLanguages: (environment: EnvironmentConfiguration, siteName: string) => Promise; /** * Look up the env's tenant-wide language inventory (all languages * registered in the tenant, regardless of which sites use them). * Useful as a fallback when an operator wants "every language the * tenant supports." */ /** * The three mutually-exclusive locale-source flags every publish-side * task accepts. Pass exactly one (or none, to let the Publishing API * use the env's configured publish languages). `resolvePublishingLocales` * enforces the exclusivity contract and surfaces the resolved set in * non-quiet output so operators never wonder which locales the publish * job will see. */ export interface PublishLocaleOptions { /** Literal language list (e.g. `["en-US"]`). */ languages?: string[]; /** Resolve from the named site's `languages` array via Sites API. */ languagesFromSite?: string; /** Resolve from the tenant-wide `listLanguages` set. */ allTenantLanguages?: boolean; } /** * Pick the locale list for a publishing call. * * Exactly one of the three flags may be set. When none is set, scai * auto-resolves the tenant-wide language inventory (same as * `--all-tenant-languages`) and logs it as "auto-resolved" so the * operator sees what's being sent. This default exists because the * Publishing API rejects requests with no locales — empirically * verified 2026-05-14 against the agents env, the request returns * `400 "Publishing locales should be specified either in the job * options or per item"`. The `[]` fall-through (claimed by the prior * docstring to use "env-configured defaults") is a phantom path the * API doesn't support, so we close it here. * * If the tenant truly has zero languages (misconfigured env), the * function still returns `[]` and surfaces a warning — the publish * will fail at the API with a clearer error than scai could synthesize. */ export declare const resolvePublishingLocales: (logger: Logger, environment: EnvironmentConfiguration, options: PublishLocaleOptions) => Promise; export declare const lookupTenantLanguages: (environment: EnvironmentConfiguration) => Promise;