Table of Contents

Class SlashCommandRouter

Namespace
JD.AI.Commands
Assembly
JD.AI.dll

Routes slash commands to their handlers.

public sealed class SlashCommandRouter : ISlashCommandRouter
Inheritance
SlashCommandRouter
Implements
Inherited Members

Constructors

SlashCommandRouter(AgentSession, IProviderRegistry, InstructionsResult?, ICheckpointStrategy?, PluginLoader?, IPluginLifecycleManager?, IWorkflowCatalog?, Func<SpinnerStyle>?, Action<SpinnerStyle>?, ProviderConfigurationManager?, McpManager?, AtomicConfigStore?, ModelSearchAggregator?, IWorkflowStore?, ModelMetadataProvider?, Func<TuiTheme>?, Action<TuiTheme>?, Func<bool>?, Action<bool>?, Func<OutputStyle>?, Action<OutputStyle>?, IUsageMeter?, IPolicyEvaluator?, Func<string>?, Func<string>?)

public SlashCommandRouter(AgentSession session, IProviderRegistry registry, InstructionsResult? instructions = null, ICheckpointStrategy? checkpointStrategy = null, PluginLoader? pluginLoader = null, IPluginLifecycleManager? pluginManager = null, IWorkflowCatalog? workflowCatalog = null, Func<SpinnerStyle>? getSpinnerStyle = null, Action<SpinnerStyle>? onSpinnerStyleChanged = null, ProviderConfigurationManager? providerConfig = null, McpManager? mcpManager = null, AtomicConfigStore? configStore = null, ModelSearchAggregator? modelSearchAggregator = null, IWorkflowStore? workflowStore = null, ModelMetadataProvider? metadataProvider = null, Func<TuiTheme>? getTheme = null, Action<TuiTheme>? onThemeChanged = null, Func<bool>? getVimMode = null, Action<bool>? onVimModeChanged = null, Func<OutputStyle>? getOutputStyle = null, Action<OutputStyle>? onOutputStyleChanged = null, IUsageMeter? usageMeter = null, IPolicyEvaluator? policyEvaluator = null, Func<string>? getSkillsStatus = null, Func<string>? reloadSkills = null)

Parameters

session AgentSession
registry IProviderRegistry
instructions InstructionsResult
checkpointStrategy ICheckpointStrategy
pluginLoader PluginLoader
pluginManager IPluginLifecycleManager
workflowCatalog IWorkflowCatalog
getSpinnerStyle Func<SpinnerStyle>
onSpinnerStyleChanged Action<SpinnerStyle>
providerConfig ProviderConfigurationManager
mcpManager McpManager
configStore AtomicConfigStore
modelSearchAggregator ModelSearchAggregator
workflowStore IWorkflowStore
metadataProvider ModelMetadataProvider
getTheme Func<TuiTheme>
onThemeChanged Action<TuiTheme>
getVimMode Func<bool>
onVimModeChanged Action<bool>
getOutputStyle Func<OutputStyle>
onOutputStyleChanged Action<OutputStyle>
usageMeter IUsageMeter
policyEvaluator IPolicyEvaluator
getSkillsStatus Func<string>
reloadSkills Func<string>

Methods

ExecuteAsync(string, CancellationToken)

Execute a slash command and return the output text.

public Task<string?> ExecuteAsync(string input, CancellationToken ct = default)

Parameters

input string
ct CancellationToken

Returns

Task<string>

IsSlashCommand(string)

Returns true if the input starts with /.

public bool IsSlashCommand(string input)

Parameters

input string

Returns

bool

TryResolveFreeformUpdateIntent(string, out string, out string?)

public bool TryResolveFreeformUpdateIntent(string input, out string slashCommand, out string? rejectionReason)

Parameters

input string
slashCommand string
rejectionReason string

Returns

bool