Member Junction
    Preparing search index...

    PromptComponentResolver — decides which MJ: Scoped Prompt Parts are included for a given prompt under a given scope, and assembles them into a role-faithful ChatMessage[].

    Pluggable (ClassFactory) + metadata-driven (template method). The public Resolve / AssembleMessages fix the orchestration; the protected hooks (getCandidates, isInScope, score, selectIncluded, order) are the extension points. MJ core obtains the resolver via MJGlobal.Instance.ClassFactory.CreateInstance(PromptComponentResolver), which returns this base by default (no registration ⇒ base instance) or the highest-priority registered subclass. So any downstream consumer can plug in custom inclusion logic with no core change:

    @RegisterClass(PromptComponentResolver)            // priority auto-increments by import order
    export class MyResolver extends PromptComponentResolver {
    protected override score(p, scope) { ... } // custom ranking
    protected override selectIncluded(parts, scope) { ... } // custom merge rules
    }

    Base (metadata-driven) defaults:

    • Additive across part Names — distinct names all survive.
    • Within a Name, the row's MergeBehavior decides: 'Override' (default) ⇒ the most-specific part wins (replace), 'Append' ⇒ all in-scope same-named parts are included.
    • Specificity (the override ranking): SecondaryScopes match (+4) > PrimaryScopeRecord (+2) > Global (+1), tie-broken by Priority.
    • Final order: Sort ASC, then Priority DESC.
    • Roles are preserved (System/User/Assistant) so the assembled messages drive the model directly.
    Index

    Constructors

    Methods