import { type RecurringRequest, type RecurringActivation, type RecurringPreview, type RecurringConsentView, type RecurringActivationResult, type RecurringPage, type RecurringOccurrenceView, type RecurringRevocation } from "./remote-recurring-contract.js"; import type { RemoteWorkspaceIdentity } from "./remote-workspace-selection.js"; export * from "./remote-recurring-contract.js"; export interface RecurringCapability { contractVersion: 1; available: boolean; } export type RecurringListOptions = Readonly<{ limit?: number; cursor?: string; }>; export type RecurringAction = "preview" | "draft" | "activate" | "list" | "get" | "occurrences" | "revoke"; export type RecurringInputs = { preview: RecurringRequest; draft: { draftId: string; }; activate: { draftId: string; approval: RecurringActivation; }; list: RecurringListOptions; get: { consentId: string; }; occurrences: RecurringListOptions & { consentId: string; }; revoke: { consentId: string; }; }; export type RecurringResults = { preview: RecurringPreview; draft: RecurringPreview | null; activate: RecurringActivationResult; list: RecurringPage; get: RecurringConsentView | null; occurrences: RecurringPage; revoke: RecurringRevocation; }; export declare class RecurringInputError extends Error { readonly code = "RECURRING_INPUT_INVALID"; constructor(); } export declare class RemoteRecurringUnavailableError extends Error { readonly code = "RECURRING_UNAVAILABLE"; constructor(); } export declare class RemoteRecurringReadError extends Error { readonly code = "RECURRING_READ_FAILED"; constructor(); } export declare class RemoteRecurringUnconfirmedError extends Error { readonly code = "RECURRING_OUTCOME_UNKNOWN"; readonly outcomeUnknown = true; constructor(); } declare const failures: { readonly RECURRING_INVALID_REQUEST: readonly [400, "Recurring parameters were refused."]; readonly RECURRING_INVALID_CURSOR: readonly [400, "Recurring page cursor was refused."]; readonly RECURRING_BODY_TOO_LARGE: readonly [413, "Recurring input exceeds the server limit."]; readonly RECURRING_UNAUTHENTICATED: readonly [401, "A current authenticated membership is required."]; readonly RECURRING_HUMAN_APPROVAL_REQUIRED: readonly [403, "A fresh human sign-in is required to activate recurring consent."]; readonly RECURRING_IMPERSONATION_DENIED: readonly [403, "Recurring changes are unavailable while impersonating."]; readonly RECURRING_AUTHORITY_REFUSED: readonly [403, "Current recurring authority was refused."]; readonly RECURRING_DEPLOYMENT_MISMATCH: readonly [403, "The recurring draft belongs to another deployment."]; readonly RECURRING_SKILL_CHANGED: readonly [409, "The recurring skill has changed."]; readonly RECURRING_TERMS_UNAVAILABLE: readonly [409, "The original recurring terms are unavailable."]; readonly RECURRING_QUOTE_EXCEEDS_CEILING: readonly [409, "The current quote exceeds the approved recurring ceiling."]; readonly RECURRING_NOT_FOUND: readonly [404, "Recurring state is unavailable for this account."]; readonly RECURRING_METHOD_NOT_ALLOWED: readonly [405, "The recurring operation is unsupported."]; readonly RECURRING_UNAVAILABLE: readonly [503, "Recurring operations are unavailable on this server."]; readonly INSUFFICIENT_SCOPE: readonly [403, "The credential lacks the required recurring scope."]; readonly RATE_LIMITED: readonly [429, "The recurring request limit was reached. Wait before another explicit request."]; }; export type RemoteRecurringErrorCode = keyof typeof failures; export declare class RemoteRecurringError extends Error { readonly code: RemoteRecurringErrorCode; readonly status: number; constructor(code: RemoteRecurringErrorCode); } export declare function recurringFailure(value: unknown, status: number): RemoteRecurringErrorCode | null; /** Snapshot before any await. Validation does not substitute for server policy. */ export declare function recurringInput(action: A, raw: RecurringInputs[A]): RecurringInputs[A]; export declare function parseRecurringCapability(value: unknown): RecurringCapability | undefined; export declare function assertRecurringCapability(value: unknown, action: RecurringAction): void; export declare function recurringRequest(action: A, input: RecurringInputs[A]): { path: string; read: boolean; method: string; body: string | undefined; }; /** Projects known response fields. Immutable terms remain exact and hash-bound. */ export declare function parseRecurringResult(action: A, value: unknown, input: RecurringInputs[A], identity: RemoteWorkspaceIdentity): RecurringResults[A];