import { MusterContext } from "./common.mjs"; //#region src/domain/ports/subject.bridge.d.ts interface SubjectSnapshot { /** Opaque ID — whatever the host stores (ObjectId hex, UUID, email, …). */ id: string; /** Model/type/kind as the host calls it. */ model: string; /** Human-readable label for UI / events. */ displayName?: string; /** Optional free-form metadata the host wants to piggyback. */ metadata?: Record; } /** * Shape of the reference pair muster passes to bridge methods. Matches * `@classytic/primitives/reference.ExternalRef` field-for-field — just * renamed to the domain term "subject". */ interface SubjectReference { subjectRef: string; subjectModel: string; } interface SubjectBridge { /** Resolve a single subject reference to a snapshot. */ resolve?(subjectRef: string, subjectModel: string, ctx: MusterContext): Promise; /** Batch resolver — avoids N+1 on list endpoints. */ resolveMany?(refs: ReadonlyArray, ctx: MusterContext): Promise>; /** * Verify the reference actually exists (used by `checkIn` when the host * wants strict validation). When omitted, muster does NOT call the host * on write paths — the reference is trusted. */ verify?(subjectRef: string, subjectModel: string, ctx: MusterContext): Promise; } //#endregion export { SubjectBridge, SubjectReference, SubjectSnapshot };