/**
 * Kind of actor performing the operation (for audit trail and UI).
 */
type OpenHiActorType = "human" | "internal-system" | "external-system";
/**
 * Adapter or entry point that created the context (for audit and metrics).
 */
type OpenHiContextSource = "rest" | "graphql" | "step-function";
/**
 * OpenHI context: tenant/workspace scope and acting actor (human or system).
 * Shared by REST, GraphQL, and Step Function adapters when calling the data operations layer.
 * Used for tenant/workspace isolation, audit records, and merging into FHIR data on mutations.
 *
 * @see sites/www-docs/content/packages/@openhi/constructs/rest-api.md — Middleware (REST)
 */
interface OpenHiContext {
    /** Tenant (organization) scope; used for multi-tenant isolation and data partition. */
    tenantId: string;
    /** Workspace scope within the tenant; used for workspace-level isolation and data partition. */
    workspaceId: string;
    /** Timestamp of the request/operation (e.g. ISO 8601). */
    date: string;
    /** Stable identifier for the actor (human, internal system, or external integration). */
    actorId: string;
    /** Display name for the actor for audit and UI (e.g. "Jane Doe", "FHIR Sync Service"). */
    actorName: string;
    /** Kind of actor; optional, for audit and display. */
    actorType?: OpenHiActorType;
    /** Role scope for Configuration and other role-scoped resources; optional. */
    roleId?: string;
    /** Request or correlation ID for tracing across adapters and logs; optional. */
    requestId?: string;
    /** Adapter that created this context (rest, graphql, step-function); optional. */
    source?: OpenHiContextSource;
    /** OAuth or client identifier when the caller is an application; optional. */
    clientId?: string;
}

export type { OpenHiContext as O };
