export type JsonPath = readonly (string | number)[]; export type CommandStatus = 'success' | 'partial' | 'failure'; export type CommandSource = | 'backend' | 'transport' | 'protocol' | 'owner' | 'local' | 'hub'; export type EffectStatus = 'success' | 'partial' | 'failure' | 'skipped'; export interface CommandEffect { name: string; status: EffectStatus; data?: unknown; error?: { code: string; message: string; }; reason?: string; } export interface SensitiveDataPolicy { /** Extra object-field names that should always be redacted. */ sensitiveFieldNames?: readonly string[]; /** Exact paths that should always be redacted. */ sensitivePaths?: readonly JsonPath[]; /** Literal secret values to redact when embedded in otherwise safe strings. */ sensitiveValues?: readonly string[]; /** * Exact paths that may carry a capability in a successful result. A capability * is never allowed through for partial or failed results. */ successCapabilityPaths?: readonly JsonPath[]; } export interface CclCommandMeta { schema: 'ccl.command-meta.v1'; command_id: string; command: string; command_status: CommandStatus; source: CommandSource; service?: string; operation?: string; http_status?: number; request_id?: string; diagnostic_id?: string; reason?: string; failed_effect?: string; filtered_fields: string[]; effects?: CommandEffect[]; guidance: string | null; } export interface PresentedCommand { value: Record & { _ccl: CclCommandMeta }; status: CommandStatus; exitCode: number; } export interface CommandDescriptor { /** Canonical command path. It must not contain argument values. */ command: string; service?: string; operation?: string; sensitivePolicy?: SensitiveDataPolicy; } export interface LocalCommandError { code: string; message: string; details?: unknown; } export type SuccessProjector = ( upstream: Readonly>, ) => Record; export type SuccessEnhancer = ( projected: Readonly>, ) => Record; export interface PresentationOverrides { guidance?: string | null; effects?: CommandEffect[]; failedEffect?: string; projectSuccess?: SuccessProjector; enhanceSuccess?: SuccessEnhancer; }