Member Junction
    Preparing search index...

    Pure resolver for matching an upload's MIME type (and optional file extension) to a registered Artifact Type. Has no entity dependency — takes a list of plain matcher records, returns the chosen ID (or undefined when nothing matches).

    Resolution algorithm (per plans/artifact-attachment-unification.md §6):

    1. Filter to types whose ContentType pattern matches the upload MIME.
    2. Bucket by specificity: exact > subtype-wildcard (e.g. image/*).
    3. Within the highest-specificity bucket, sort by Priority desc.
    4. Tiebreaker if priorities are equal: a. SystemSupplied = false beats SystemSupplied = true b. otherwise lowest ID wins (deterministic).

    Octet-stream uploads also consider a file-extension hint when given.

    Conflict detection: callers can pass the same list to FindArtifactTypeConflicts to surface ambiguous registrations at engine boot, where two types share the same (ContentType, Priority, SystemSupplied) triple — almost always a configuration mistake.

    interface ArtifactTypeMatcher {
        contentType: string;
        fileExtensions?: string[];
        id: string;
        name: string;
        priority: number;
        systemSupplied: boolean;
    }
    Index

    Properties

    contentType: string

    MIME pattern: either an exact MIME or a subtype wildcard like text/*.

    fileExtensions?: string[]

    Optional list of file extensions (no leading dot) that map to this type.

    id: string

    Stable identifier (UUID) — used as the final tiebreaker.

    name: string

    Display name — for logging only.

    priority: number

    Higher wins within a specificity tier.

    systemSupplied: boolean

    System-shipped defaults rank below organization customizations at equal priority.