export type RetentionScopeKind = 'NAMESPACE' | 'WORKFLOW' | 'RUN'; export type RetentionJobState = 'PENDING' | 'LEASED' | 'RETRY' | 'POISONED' | 'COMPLETED' | 'HELD'; export type RetentionJobPhase = 'DELETE_RUN' | 'DELETE_BLOBS'; export type RetentionMutationOutcome = 'APPLIED' | 'DUPLICATE'; export interface RetentionScope { namespace: string; kind: RetentionScopeKind; workflowId?: string; runId?: string; } export interface RetentionPolicy { schemaVersion: 1; policyId: string; scope: RetentionScope; retentionDays: number; policyVersion: bigint; auditId: string; updatedAt: Date; } export interface RetentionLegalHold { holdId: string; scope: RetentionScope; reason: string; createAuditId: string; createdAt: Date; releaseAuditId?: string; releasedAt?: Date; } export interface RetentionDeletionJob { jobId: string; namespace: string; workflowId: string; runId: string; state: RetentionJobState; phase: RetentionJobPhase; policyId?: string; policyVersion?: bigint; expiresAt: Date; availableAt: Date; leaseOwner?: string; leaseExpiresAt?: Date; attempts: number; maxAttempts: number; lastErrorClass?: string; lastErrorDigest?: string; runDeletedAt?: Date; createdAt: Date; updatedAt: Date; completedAt?: Date; } export interface RetentionExpiryReconciliation { namespace: string; workflowId: string; runId: string; expectedExpiresAt?: Date; desiredExpiresAt: Date; policyId: string; policyVersion: bigint; } export interface RetentionReconciliationCandidate { change: RetentionExpiryReconciliation; status: string; terminalAt: Date; eligibleNow: boolean; action: 'RESTAMP' | 'RESTAMP_AND_STAGE_IF_DUE'; effectivePolicyScope: RetentionScope; } export interface RetentionReconciliationPreview { dryRun: true; scope: RetentionScope; asOf: Date; scannedRuns: number; driftedRuns: number; sourceTruncated: boolean; candidateTruncated: boolean; candidates: RetentionReconciliationCandidate[]; } export interface RetentionReconciliationResult { auditId: string; reconciledRuns: number; } export interface RetentionMutationResult { outcome: RetentionMutationOutcome; resource: T; } export interface RetentionClientOptions { serverAddress: string; apiKey?: string; defaultTimeoutMs?: number; } export interface RetentionScopeInput { scopeKind: RetentionScopeKind; workflowId?: string; runId?: string; } export interface RetentionAuditInput { auditId: string; occurredAt: Date; reason: string; } export interface PutRetentionPolicyInput extends RetentionScopeInput, RetentionAuditInput { namespace: string; policyId: string; retentionDays: number; policyVersion: bigint; } export interface CreateRetentionHoldInput extends RetentionScopeInput, RetentionAuditInput { namespace: string; holdId: string; } export interface ReleaseRetentionHoldInput extends RetentionAuditInput { namespace: string; holdId: string; } export interface PreviewRetentionReconciliationInput extends RetentionScopeInput { namespace: string; asOf?: Date; limit?: number; scanLimitPerStatus?: number; } export interface ApplyRetentionReconciliationInput extends RetentionAuditInput { namespace: string; preview: RetentionReconciliationPreview; } export declare class RetentionHttpError extends Error { readonly status: number; readonly body: string; readonly auditId?: string | undefined; constructor(status: number, body: string, auditId?: string | undefined); } export declare class RetentionClient { private readonly options; private readonly baseUrl; constructor(options: RetentionClientOptions); private request; listPolicies(namespace: string): Promise; putPolicy(input: PutRetentionPolicyInput): Promise>; listHolds(namespace: string, activeOnly?: boolean): Promise; createHold(input: CreateRetentionHoldInput): Promise>; releaseHold(input: ReleaseRetentionHoldInput): Promise>; listJobs(options?: { state?: RetentionJobState; limit?: number; }): Promise; previewReconciliation(input: PreviewRetentionReconciliationInput): Promise; applyReconciliation(input: ApplyRetentionReconciliationInput): Promise>; }