ReadonlyonReadonlyonEvent fired when the selected variant for a prompt variant set changes
Adds a prompt fragment to the service
The fragment to store
OptionalpromptVariantSetId: stringOptional ID of the prompt variant set this is a variant of
OptionalisDefault: booleanThe following methods delegate to the PromptFragmentCustomizationService
Gets all active prompts (highest priority version of each fragment)
Array of active prompt fragments
Gets all known prompts, including variants and customizations
Map of fragment IDs to arrays of fragments
Gets the built-in raw prompt fragment (before any customizations)
The prompt fragment ID
The built-in fragment or undefined if not found
Gets all prompt fragments marked as commands, optionally filtered by agent
OptionalagentId: stringOptional agent ID to filter commands (undefined returns commands for all agents)
Array of command prompt fragments
Gets the default variant ID of the given set
The prompt variant set id
The default variant ID or undefined if no default is set
Gets the effective variant ID that is guaranteed to be valid if one exists. This checks if the selected variant ID is valid, and falls back to the default variant if it isn't.
The prompt variant set id
A valid variant ID if one exists, or undefined if no valid variant can be found
Gets the raw prompt fragment without comments
The prompt fragment ID
The raw prompt fragment or undefined if not found
Gets a prompt fragment by command name (for slash commands)
The command name to search for
The fragment with the matching command name or undefined if not found
Gets all prompt variant sets and their variants
Map of prompt variant set IDs to arrays of variant IDs
Gets the raw prompt fragment with comments
The prompt fragment ID
The raw prompt fragment or undefined if not found
Resolves a prompt fragment by replacing variables and function references
The prompt fragment ID
Optionalargs: { [key: string]: unknown }Optional object with values for variable replacement
Optionalcontext: AIVariableContextOptional context for variable resolution
The resolved prompt fragment or undefined if not found
Resolves a prompt fragment by replacing variables but preserving function references
The prompt fragment ID
Optionalargs: { [key: string]: unknown }Optional object with values for variable replacement
Optionalcontext: AIVariableContextOptional context for variable resolution
OptionalresolveVariable: (variable: AIVariableArg) => Promise<undefined | ResolvedAIVariable>Optional custom variable resolution function
The partially resolved prompt fragment or undefined if not found
Gets the explicitly selected variant ID for a prompt fragment from settings. This returns only the variant that was explicitly selected in settings, not the default.
The prompt variant set id
The selected variant ID from settings, or undefined if none is selected
Returns all IDs of all prompt fragments of the given set
The prompt variant set id
Array of variant IDs
Removes a prompt fragment from the service
The fragment ID to remove
Updates the selected variant for a prompt variant set
The ID of the agent to update
The prompt variant set ID
The new variant ID to set as selected
Event fired when the prompts change