import { type AuthSpaceCatalogAccount, type AuthSpaceCatalogResult, type ParsedArgs } from "@cotal-ai/core"; import { type RefusalCode } from "@cotal-ai/workspace"; import { type UserBundle } from "./meshes-add.js"; export interface CatalogSpace { id: string; slug: string; name: string; kind: string; role: string; registration: UserBundle; } export interface SpaceCatalogSnapshot { v: 1; account: { idpUrl: string; issuer: string; sub: string; }; spaces: CatalogSpace[]; } export interface CatalogDiff { added: string[]; changed: string[]; removed: string[]; unchanged: string[]; collisions: string[]; selectionInvalidated?: string; } declare const syncFlags: readonly [{ readonly name: "json"; readonly short: "j"; readonly type: "boolean"; readonly description: "structured output on stdout"; }, { readonly name: "plain"; readonly type: "boolean"; readonly description: "plain line-oriented output"; }, { readonly name: "idp"; readonly type: "string"; readonly value: ""; readonly description: "refresh only this signed-in IdP account"; }]; export { syncFlags }; export declare function validateCatalogSnapshot(value: unknown, account: AuthSpaceCatalogAccount): asserts value is SpaceCatalogSnapshot; export declare function prepareCatalogTargets(opts?: { idpUrl?: string; force?: boolean; }): Promise<{ results: AuthSpaceCatalogResult[]; diffs: CatalogDiff[]; }>; /** The account results prepared by the dispatcher immediately before `status` renders. */ export declare function preparedCatalogDiagnostics(): readonly AuthSpaceCatalogResult[]; /** A space catalog that stopped a command before it ran, with the stable code a structured command * reports it under: the selected space left its catalog, or the catalog for the target's account * could not be refreshed. */ export declare class CatalogPreparationError extends Error { readonly code: RefusalCode; constructor(message: string, code: RefusalCode); } /** Shared once-per-command preparation. Every target-resolving call gives each signed-in account a * chance to refresh inside the provider's freshness window. An operational catalog target scopes * that work to its own account and treats its failure as fatal. Other targets warn once per account * outage; diagnostics retain every result for `status` and never refuse the command. Unknown names * force a refresh even inside the freshness window. */ export declare function prepareCatalogCommand(args: ParsedArgs, diagnostics?: boolean, command?: "meshes" | "use"): Promise; /** * `cotal sync` refreshes every signed-in account's space catalog, or the one `--idp` names, and * applies it to the registry. An account whose catalog could not be refreshed keeps its last * snapshot and is named in a warning; when some failed the result is partial, and when every one * failed the command is refused. */ export declare function sync(args: ParsedArgs): Promise; //# sourceMappingURL=sync.d.ts.map