• Discover every archetype candidate for a document type across the world directory and all compendium packs whose metadata.type matches — the Foundry-boundary half of the Create-dialog archetype picker (issue #604).

    A candidate is any document carrying a numeric flags.sohl.docArchetype (its priority). This gathers them into the plain sohl.entity.archetype.ArchetypeCandidate records the Foundry-free sohl.entity.archetype.resolveArchetypes rules consume — so all the filter/dedup/winner logic stays unit-testable. Packs are read through their index (with the shortcode / subType / flag fields requested) to avoid loading full documents; the winner's toObject() is only fetched on confirm.

    Source tier is derived from the pack's packageType (world < system < module); world-directory documents are ARCHETYPE_TIER.WORLD.

    Parameters

    • documentName: string

      "Actor" or "Item".

    Returns Promise<ArchetypeCandidate[]>

    Every discovered candidate for that document type (unfiltered by type/subType — the pure resolver filters per the dialog's current selection).