addPrompt method
Adds a prompt and notifies clients that the list has changed.
Implementation
void addPrompt(
Prompt prompt,
FutureOr<GetPromptResult> Function(GetPromptRequest) impl,
) {
if (_prompts.containsKey(prompt.name)) {
throw StateError(
'Failed to add prompt ${prompt.name}, it already exists',
);
}
_prompts[prompt.name] = prompt;
_promptImpls[prompt.name] = impl;
if (ready) {
_notifyPromptListChanged();
}
}