feat: add a permission-gated UI action registry and action slots for plugins

Moves the terminal toolbar's hardwired AI button into a slot the ssh-terminal
plugin offers and the ai plugin fills, gated on ai.services.use.
This commit is contained in:
LukeGus committed 2026-09-21 16:56:15 -05:00
1 parent 225f618337
commit 2d6c1cdecb
29 files changed
+1971 -40

No files matched your search

+8
View File
@@ -12,10 +12,12 @@
export const id = "ssh-terminal";
export const tabId = "terminal";
export const toolbarSlotId = "terminal.toolbar";
export async function register({
registerRailItem,
registerTabComponent,
declareActionSlot,
icons,
}) {
registerTabComponent(tabId, () =>
@@ -30,12 +32,18 @@ export async function register({
labelKey: "nav.terminal",
kind: "tab",
});
// Offers other plugins a place in the terminal toolbar. The terminal does
// not know or care who fills it.
declareActionSlot({ id: toolbarSlotId, accepts: ["button"] });
}
export async function unregister({
unregisterRailItem,
unregisterTabComponent,
undeclareActionSlot,
}) {
unregisterRailItem(tabId);
unregisterTabComponent(tabId);
undeclareActionSlot(toolbarSlotId);
}