Skip to content

ArgCompleters

Category: Commands

Source: arg_completers.dart

Pure-function candidate producers for slash-command argument autocomplete. The App class wires these into [SlashCommandRegistry.attachArgCompleter] after pulling the required live state (catalog, skill list) out of its own fields.

Keeping the logic here — as pure functions that take their inputs by parameter — means tests can exercise the same code path that runs in production without spinning up a full App.

Functions

List<SlashArgCandidate> openArgCandidates(List<String> prior, String partial)

List<SlashArgCandidate> providerSubcommandCandidates(String partial)

`List<SlashArgCandidate> providerIdCandidates(

Map<String, ProviderDef> providers, String partial, )`

`List<SlashArgCandidate> modelRefCandidates(

Map<String, ProviderDef> providers, String partial, { int cap = defaultModelResultCap, })`

Searches the catalog by provider prefix, model id substring, model display-name substring, or full-ref substring. Callers should gate on non-empty [partial] (see App._modelArgCandidates).

`List<SlashArgCandidate> skillCandidates(

List<SkillMeta> skills, String partial, )`

`List<SlashArgCandidate> sessionArgCandidates(

List<String> prior, String partial, )`

List&lt;SlashArgCandidate&gt; shareArgCandidates(List&lt;String&gt; prior, String partial)

List&lt;SlashArgCandidate&gt; mcpSubcommandCandidates(String partial)

List&lt;SlashArgCandidate&gt; mcpAuthSubcommandCandidates(String partial)

`List<SlashArgCandidate> mcpServerIdCandidates(

Iterable<McpServerSnapshot> servers, String partial, { bool requireRemote = false, })`

Completes server IDs from the live pool. When [requireRemote] is true, stdio servers are filtered out — used for auth login/logout which only applies to HTTP/WebSocket transports.

Constants

NameTypeDescription
defaultModelResultCapintDefault cap for [modelRefCandidates] — large enough to cover a full filtered result set in the dropdown, small enough that a blank match against a 500-model catalog doesn't stall rendering.

Released under the MIT License.