pub struct CompletionData { /* private fields */ }Expand description
Thread-safe storage for dynamic command and argument completions.
Clone this handle and pass it to background threads that need to update available completions (e.g. when the harness sends a model list or an extension publishes an action schema).
Implementations§
Source§impl CompletionData
impl CompletionData
Sourcepub fn set_dynamic_commands(&self, commands: Vec<CommandCompletion>)
pub fn set_dynamic_commands(&self, commands: Vec<CommandCompletion>)
Replaces extension-provided root commands shown alongside the static command registry.
Sourcepub fn set_dynamic_commands_and_arg_completers(
&self,
commands: Vec<CommandCompletion>,
arg_completers: Vec<(CommandName, ArgCompleter)>,
)
pub fn set_dynamic_commands_and_arg_completers( &self, commands: Vec<CommandCompletion>, arg_completers: Vec<(CommandName, ArgCompleter)>, )
Replaces extension-provided root commands and their nested argument/subcommand completers as one atomic snapshot.
Sourcepub fn set_static_command_descriptions(
&self,
descriptions: impl IntoIterator<Item = (CommandName, String)>,
)
pub fn set_static_command_descriptions( &self, descriptions: impl IntoIterator<Item = (CommandName, String)>, )
Replaces descriptions for existing intrinsic command-root candidates.
This changes display text only: it cannot add a command or alter its insertion text.
Sourcepub fn set_arg_completions(
&self,
command: CommandName,
items: Vec<CompletionItem>,
)
pub fn set_arg_completions( &self, command: CommandName, items: Vec<CompletionItem>, )
Sets a flat, single-arg completion list for a command.
Items are ranked prefix-match-first, substring-match-second
(case-insensitive). For commands that take more than one arg
or need to react to prior args, use
CompletionData::set_arg_completer.
Sourcepub fn set_arg_completer(&self, command: CommandName, completer: ArgCompleter)
pub fn set_arg_completer(&self, command: CommandName, completer: ArgCompleter)
Registers a custom argument completer for a command. The closure receives the args typed so far (with the partial last element being completed) and returns ranked candidates.
Sourcepub fn set_agent_mention_completer(&self, completer: ArgCompleter)
pub fn set_agent_mention_completer(&self, completer: ArgCompleter)
Registers prompt-text completion for active agent mentions typed as
@<partial-agent-id>.
Sourcepub fn set_session_completer(&self, completer: ArgCompleter)
pub fn set_session_completer(&self, completer: ArgCompleter)
Registers prompt-text completion for running sessions typed as
&<partial-session-id>.