Show notification when there's a conflict with an extensions command (#17890)

This commit is contained in:
christine betts
2026-02-12 11:29:06 -05:00
committed by GitHub
parent 099aa9621c
commit 2ca183ffc9
7 changed files with 395 additions and 4 deletions

View File

@@ -127,6 +127,17 @@ export interface AgentsDiscoveredPayload {
agents: AgentDefinition[];
}
export interface SlashCommandConflict {
name: string;
renamedTo: string;
loserExtensionName?: string;
winnerExtensionName?: string;
}
export interface SlashCommandConflictsPayload {
conflicts: SlashCommandConflict[];
}
/**
* Payload for the 'quota-changed' event.
*/
@@ -155,6 +166,7 @@ export enum CoreEvent {
AgentsDiscovered = 'agents-discovered',
RequestEditorSelection = 'request-editor-selection',
EditorSelected = 'editor-selected',
SlashCommandConflicts = 'slash-command-conflicts',
QuotaChanged = 'quota-changed',
}
@@ -185,6 +197,7 @@ export interface CoreEvents extends ExtensionEvents {
[CoreEvent.AgentsDiscovered]: [AgentsDiscoveredPayload];
[CoreEvent.RequestEditorSelection]: never[];
[CoreEvent.EditorSelected]: [EditorSelectedPayload];
[CoreEvent.SlashCommandConflicts]: [SlashCommandConflictsPayload];
}
type EventBacklogItem = {
@@ -322,6 +335,11 @@ export class CoreEventEmitter extends EventEmitter<CoreEvents> {
this._emitOrQueue(CoreEvent.AgentsDiscovered, payload);
}
emitSlashCommandConflicts(conflicts: SlashCommandConflict[]): void {
const payload: SlashCommandConflictsPayload = { conflicts };
this._emitOrQueue(CoreEvent.SlashCommandConflicts, payload);
}
/**
* Notifies subscribers that the quota has changed.
*/