IReplApp
DI-enabled app contract for mapping commands, contexts, and modules.
- Kind:
Interface - Namespace: Repl
- Assembly:
Repl.Defaults - Source: src/Repl.Defaults/IReplApp.cs
Signature
Section titled “Signature”public interface IReplApp : ICoreReplApp, IReplMapDerived Classes
Section titled “Derived Classes”Extension Methods
Section titled “Extension Methods”BuildMcpServerOptions(ICoreReplApp, Action<ReplMcpServerOptions>, IServiceProvider)
Methods
Section titled “Methods”Context(string, Action<IReplApp>, Delegate?)
Section titled “Context(string, Action<IReplApp>, Delegate?)”Creates a context segment and configures child routes within it.
IContextBuilder Context(string segment, Action<IReplApp> configure, Delegate? validation = null)Parameters
Section titled “Parameters”segment(string): Context segment template.configure(Action<IReplApp>): Mapping callback for nested routes.validation(Delegate): Optional validator for scope entry.
Returns
Section titled “Returns”IContextBuilder - A context builder for context-level metadata configuration.
InvalidateRouting()
Section titled “InvalidateRouting()”Invalidates the active routing cache so module presence predicates are re-evaluated on next resolution.
void InvalidateRouting()MapModule(IReplModule)
Section titled “MapModule(IReplModule)”Maps a reusable module instance into the current route scope.
IReplApp MapModule(IReplModule module)Parameters
Section titled “Parameters”module(IReplModule): Module instance.
Returns
Section titled “Returns”IReplApp - The same app contract for fluent chaining.
MapModule(IReplModule, Delegate)
Section titled “MapModule(IReplModule, Delegate)”Maps a reusable module instance into the current route scope with an injectable runtime presence predicate.
IReplApp MapModule(IReplModule module, Delegate isPresent)Parameters
Section titled “Parameters”module(IReplModule): Module instance.isPresent(Delegate): Predicate delegate that must return bool. Parameters are resolved from defaults services, with special handling for ModulePresenceContext, ReplRuntimeChannel, IReplSessionState, and IReplSessionInfo.
Returns
Section titled “Returns”IReplApp - The same app contract for fluent chaining.
MapModule(IReplModule, Func<ModulePresenceContext, bool>)
Section titled “MapModule(IReplModule, Func<ModulePresenceContext, bool>)”Maps a reusable module instance into the current route scope with a runtime presence predicate.
IReplApp MapModule(IReplModule module, Func<ModulePresenceContext, bool> isPresent)Parameters
Section titled “Parameters”module(IReplModule): Module instance.isPresent(Func<ModulePresenceContext, bool>): Runtime presence predicate.
Returns
Section titled “Returns”IReplApp - The same app contract for fluent chaining.
MapModule<TModule>()
Section titled “MapModule<TModule>()”Maps a module resolved through DI activation.
IReplApp MapModule<TModule>() where TModule : class, IReplModuleType Parameters
Section titled “Type Parameters”TModule: Module type.
Returns
Section titled “Returns”IReplApp - The same app contract for fluent chaining.
WithBanner(Delegate)
Section titled “WithBanner(Delegate)”Registers a banner delegate rendered when the scope is entered.
IReplApp WithBanner(Delegate bannerProvider)Parameters
Section titled “Parameters”bannerProvider(Delegate): Banner delegate with injectable parameters.
Returns
Section titled “Returns”IReplApp - The same app contract for fluent chaining.
WithBanner(string)
Section titled “WithBanner(string)”Registers a static banner string rendered when the scope is entered.
IReplApp WithBanner(string text)Parameters
Section titled “Parameters”text(string): Banner text.
Returns
Section titled “Returns”IReplApp - The same app contract for fluent chaining.