SIGNALS Documentation
API Reference

Plugin Palette Registry

Contract for accumulating plugin command-palette providers and resolving permission-filtered commands per user at palette-open time.

Overview

App\Sdk\Nav\PluginPaletteRegistry is the in-memory registry of plugin command-palette providers, registered at plugin boot via the registrar's paletteCommands() seam. Providers are callables invoked lazily when the palette opens, so command lists can reflect live state.

Each command's permission must be one of the registering plugin's declared permissions (or null); commands from throwing providers are dropped with a logged warning (failure isolation), never surfaced as errors to the palette.

Public surface

Method Purpose
register() Append one provider callable for a package, with its declared-permission allowlist
commandsFor() Resolve every provider and return the merged, permission-filtered command list for a user
flush() Clear all providers (Octane-safe boot lifecycle)

Accepted definition shape

Providers return list<array{key: string, label: string, url: string, icon?: string, group?: string, keywords?: string, permission?: string|null}>. Commands merge into the core NavigationService palette list at query time; group defaults to the plugin's display name.

Worked example

use App\Sdk\Nav\PluginPaletteRegistry;

$registry = app(PluginPaletteRegistry::class);

$registry->register('signals/slots-demo', static fn (): array => [
    [
        'key' => 'signals.slotsdemo.overview',
        'label' => 'Slots Demo: Overview',
        'url' => '/plugins/signals/slots-demo/overview',
        'icon' => 'puzzle-piece',
        'permission' => 'signals.slotsdemo.view',
    ],
], ['signals.slotsdemo.view']);

// Palette-open time — merged, permission-filtered for the current user:
$commands = $registry->commandsFor(auth()->user());