All command keys reachable from the owning scope (its chain → root) whose merged definition
carries tag. The authoring counterpart of CommandScope.collectKeysByTag — it lets a
contributor apply a cross-cutting rule by tag without hand-maintaining a parallel key list:
e.g. a sheet's protection reducer does for (const key of getKeysByTag('mutator')) updateCommand(key, { disabledReasons }), so the tag authored in the catalog is the single source of truth (the
resolved disabled() then accumulates the reasons — no new resolve-time machinery needed).
Remove every command + middleware this contribution touched. Idempotent.
Register dispatch CommandMiddleware on the owning scope — the cross-cutting wrapper for the callbacks this contribution authors (e.g. a sheet's transactional batch/busy wrapper, so each command callback stays pure). Tracked like commands: undone by remove. This is the authoring facet's equivalent of CommandScope.use, so a contributor never needs the raw scope.
A tracked contribution session on a scope (see CommandScope.contribution). Every updateCommand through it records the key; remove tears down exactly those keys in one call — so a contributor's teardown is a single
contribution.remove()instead of an easy-to-miss, per-keyremoveCommandlist (which gets long for large contributors). Re-updateCommandfor a key already tracked is idempotent.