npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@memberjunction/ng-composer

v5.48.0

Published

MemberJunction: Generic message composer components — mention editor with pluggable trigger providers (ComposerTriggerProvider), mention dropdown, and send-button input box wrapper. Ships zero AI knowledge; trigger plugins are supplied by hosts (see @memb

Readme

@memberjunction/ng-composer

Generic message-composer components for MemberJunction Angular applications — the mention editor, its autocomplete dropdown, and the send-button input box wrapper. Extracted from @memberjunction/ng-conversations so lower-level packages (e.g. @memberjunction/ng-user-routines) can embed the composer without depending on the full conversations stack (ng-conversations itself depends on ng-user-routines, so the composer must live below both).

The composer ships ZERO AI knowledge. Mention/command triggers are pluggable: without any trigger providers the editor is a plain text editor with attachments. The AI-aware providers ('@' agents, '#' entities/queries, '/' skills) live in @memberjunction/ng-conversations.

Components

| Selector | Class | Purpose | |---|---|---| | mj-mention-editor | MentionEditorComponent | ContentEditable editor with Slack/Teams-style mention chips, attachment support (paste / drag-drop / picker), and ControlValueAccessor ([(ngModel)] works) | | mj-mention-dropdown | MentionDropdownComponent | Keyboard-navigable autocomplete dropdown for mention suggestions | | mj-message-input-box | MessageInputBoxComponent | Presentational wrapper around the mention editor adding the send button (+ optional voice / plan-mode buttons) |

Plus the trigger-provider contract (ComposerTriggerProvider, ComposerSuggestionRequest, DiscoverComposerTriggerProviders) and the exported types MentionSuggestion, MentionSuggestionPreset, and PendingAttachment.

Pluggable triggers — the ComposerTriggerProvider contract

Each provider owns ONE trigger character and supplies the suggestions shown while the user types after it:

export abstract class ComposerTriggerProvider {
  public abstract readonly TriggerChar: string;   // e.g. '@'
  public abstract readonly Key: string;           // stable id, e.g. 'agent-mentions'
  public readonly Priority: number = 0;           // higher first when chars collide
  public abstract GetSuggestions(request: ComposerSuggestionRequest): Promise<MentionSuggestion[]>;
  public async Initialize(contextUser: UserInfo | null): Promise<void> { /* optional warm-up */ }
}

Suggestions are generic (type is an open string; optional icon / color / imageUrl drive chip + dropdown cosmetics). A suggestion may carry presets — when there are 2+ the inserted chip renders a preset picker and the selection travels with the chip (data-preset-id / data-preset-name, surviving getPlainTextWithJsonMentions() serialization).

Two ways to supply providers

  1. Explicit mode — bind instances; exactly this list is active (wins over discovery):
    <mj-mention-editor [TriggerProviders]="myProviders" ...></mj-mention-editor>
  2. Discovery mode (default, TriggerProviders unbound) — the editor resolves every ClassFactory registration of ComposerTriggerProvider:
    @RegisterClass(ComposerTriggerProvider, 'agent-mentions')
    export class AgentMentionProvider extends ComposerTriggerProvider { ... }
    Hosts opt individual triggers out by stable key:
    <mj-mention-editor [ExcludedTriggerKeys]="['agent-mentions']" ...></mj-mention-editor>
    With no providers registered, the editor degrades gracefully to a plain text editor.

enableMentions (default true) remains the master switch — when false, no providers are consulted at all. MessageInputBoxComponent passes enableMentions / TriggerProviders / ExcludedTriggerKeys / Provider through to the editor.

The AI providers + the mj-ai-composer wrapper

@memberjunction/ng-conversations registers three plugins (loaded via its LoadComposerPlugins() guard):

| Key | Trigger | Suggests | |---|---|---| | agent-mentions | @ | Permission-filtered agents (+ configuration presets) and users | | record-mentions | # | Entities the user can read + queries the user can run | | skill-commands | / | Active skills the user can Run |

It also ships <mj-ai-composer> — a wrapper around mj-message-input-box with those plugins built in and the familiar convenience flags EnableAgentMentions / EnableEntityMentions / EnableSkillCommands (all default true). Use it wherever you want the standard AI chat composer; use the raw mj-message-input-box / mj-mention-editor for custom or discovery-driven trigger sets.

<!-- Example: the routine editor — discovery mode, '@' excluded (its agent is fixed by a picker) -->
<mj-mention-editor
  [(ngModel)]="InitialMessage"
  [ExcludedTriggerKeys]="['agent-mentions']"
  [enableAttachments]="false"
  [autoFocus]="false"
  [currentUser]="ProviderToUse.CurrentUser">
</mj-mention-editor>

Other notable inputs: autoFocus (default true — the chat-composer behavior; set false when embedding in a form), enableAttachments / maxAttachments / maxAttachmentSizeBytes / acceptedFileTypes, placeholder, disabled, Provider (multi-provider hosts; threaded to providers via ComposerSuggestionRequest.Provider).

Value formats

  • [(ngModel)] / valueChange carry the plain-text serialization: mention chips render as @Name (agents/users), #Name (entities/queries), or /Name (skills), quoted when the name contains spaces (e.g. #"Membership Renewals"); line breaks become \n.
  • getPlainTextWithJsonMentions() (used by MessageInputBoxComponent's send path) encodes each chip as @{"type":"agent","id":"...","name":"...",...} so configuration presets survive persistence.
  • writeValue renders inbound text as plain text (chips are not re-hydrated from text).

Usage

import { ComposerModule } from '@memberjunction/ng-composer';

@NgModule({ imports: [ComposerModule] })
export class MyModule {}

Consumers

  • @memberjunction/ng-conversations — hosts the AI trigger plugins + mj-ai-composer; the chat message composer (message-input, chat area, overlay, workspace)
  • @memberjunction/ng-user-routines — the routine editor's "Message sent on each run" field (discovery mode, agent-mentions excluded)
  • @memberjunction/ng-explorer-core — the Chat resource wrapper
  • @memberjunction/ng-dashboards — Component Studio AI assistant (types only)