Optional ReadonlyaccountSigns the account identity proof on the group creator's own leaf
Crypto provider for cryptographic operations
ReadonlynetworkThe nostr relay pool to use for the client
ReadonlysignerThe signer used for the clients identity
ReadonlystoreThe backend storing serialized group state bytes
Returns the list of currently loaded group instances
Persists and caches a group built from a ClientState, emitting the given lifecycle event. Used by higher-level flows (e.g. joining from a welcome message) that construct ClientStates themselves.
The ClientState to adopt
Optionaloptions: { emit?: "imported" | "joined" }Optionalemit?: "imported" | "joined"Which lifecycle event to emit. Defaults to "imported".
The persisted and cached MarmotGroup
Creates a commit from proposals and publishes it to the group.
Resolves the committing member from the manager's signer, builds a commit
intent, and drives it through the group session/runtime. See
GroupSessionSendIntent for how extraProposals, proposalRefs, and
welcomeRecipients are interpreted. Requires a group admin.
Optionaloptions: Omit<Per-relay publish responses for the commit group event.
Connects a single group to its relays: backfills its kind-445 transport
events (by #h routing tag) and drains them through MarmotGroup.ingest,
then opens a live subscription that ingests each subsequent event. Inbound
events are de-duplicated, and unreadable ones surface via the unreadable
event. Call .unsubscribe() on the result to disconnect.
This is the inbound counterpart to the library's outbound publishing — the relay-subscription/backfill/drain loop an app would otherwise hand-write.
Optionaloptions: ConnectOptionsConnects every loaded group (see connect) and keeps the set of
connections in lockstep with the loaded groups: newly created/joined/
imported/loaded groups are connected automatically, and
destroyed/left/unloaded/removed groups are disconnected. Returns a handle
whose .unsubscribe() tears down every connection and stops tracking.
Optionaloptions: ConnectOptionsCreates a new simple group
Optionaloptions: CreateGroupOptionsDestroys a group and purges the group history
Gets a group from cache or loads it from store
Checks if a group exists in the backend
Imports a new group from a ClientState object, persisting it to
the store and emitting imported.
Returns the complete group info/debug model for a loaded or persisted group.
Ingests group transport events through the group's protocol session.
Optionaloptions: { maxRetries?: number }Invites a user to a group from their KeyPackage event (kind 30443).
Resolves the committing member from the manager's signer, builds an Add commit intent via createInviteIntent, and drives it through the group session/runtime. After the commit acks, the runtime delivers a Welcome to the invitee via NIP-59 gift wrap.
Per-relay publish responses for the commit group event.
Joins a group from a decoded MLS Welcome using locally held key
package candidates (produced by KeyPackageManager.selectForWelcome).
Mirrors the darkmatter engine do_join_welcome: the KeyPackageRef→private
bundle match and the MLS join happen here, in the group layer, not in the
composition root. Tries candidates in priority order, validates every leaf
carries a valid account identity proof, then adopts the resulting state and
emits joined.
The joined group and the KeyPackageRef that was consumed (so the
caller can mark it used), or consumedKeyPackageRef: null if none matched.
Leaves a group by publishing a self-remove proposal and purging all local group data from storage.
At least one relay must acknowledge the proposals before local state is destroyed. If no relay acks, an error is thrown and local state is preserved so the caller can retry.
The group ID as a hex string or Uint8Array.
The relay publish responses for the leave proposal event(s).
Lists all persisted group IDs, decoded from their hex storage keys.
Loads all groups from the store and returns them
Returns the runtime publisher for a loaded or persisted group.
Sends a session intent through the group, convergence-gated (B5): published
immediately when convergence is Settled, otherwise queued until the
quiescence window settles and the queue drains. Used by commit/invite
and direct application-message sends; leave bypasses the gate.
Returns the protocol session for a loaded or persisted group.
Unloads a group from the client but does not remove it from the store
Watches for changes to the groups in the store. Returns an async generator that yields the current list of groups whenever the store changes.
StaticprefixedOptionalcontext: anyCalls each of the listeners registered for a given event.
Return an array listing the events for which the emitter has registered listeners.
Return the number of listeners listening to a given event.
Return the listeners registered for a given event.
Optionalfn: (Optionalcontext: anyOptionalonce: booleanAdd a listener for a given event.
Optionalcontext: anyAdd a one-time listener for a given event.
Optionalcontext: anyRemove all listeners, or those of the specified event.
Optionalevent: keyof GroupsManagerEvents<THistory, TMedia>Remove the listeners of a given event.
Optionalfn: (Optionalcontext: anyOptionalonce: boolean
Orchestrates the lifecycle of MarmotGroup instances. Delegates in-memory caching and store hydration to a GroupRegistry and group construction to a GroupFactory, layering the public lifecycle events (created/imported/joined/destroyed/left) and the send/ingest facade on top.