export type Principal = Readonly<{ id: string; kind: "user" | "system" }>; export type TenantIdentity = Readonly<{ organizationId: string }>; export type Permissions = ReadonlySet; export type CorrelationContext = Readonly<{ correlationId: string; causationId?: string; }>; export interface Clock { now(): Date; } export interface Logger { info(event: string, context?: Readonly>): void; warn(event: string, context?: Readonly>): void; error(event: string, context?: Readonly>): void; } export interface Features { enabled(name: string, context?: Readonly>): boolean | Promise; } export type ExecutionContext = Readonly<{ principal: Principal; tenant: TenantIdentity; permissions: Permissions; correlation: CorrelationContext; data: Data; log: Logger; clock: Clock; features: Features; services: Services; }>;