Nabs.Launchpad.Core.Ai.Menu
10.0.239
Prefix Reserved
dotnet add package Nabs.Launchpad.Core.Ai.Menu --version 10.0.239
NuGet\Install-Package Nabs.Launchpad.Core.Ai.Menu -Version 10.0.239
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nabs.Launchpad.Core.Ai.Menu" Version="10.0.239" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nabs.Launchpad.Core.Ai.Menu" Version="10.0.239" />
<PackageReference Include="Nabs.Launchpad.Core.Ai.Menu" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nabs.Launchpad.Core.Ai.Menu --version 10.0.239
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Nabs.Launchpad.Core.Ai.Menu, 10.0.239"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nabs.Launchpad.Core.Ai.Menu@10.0.239
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nabs.Launchpad.Core.Ai.Menu&version=10.0.239
#tool nuget:?package=Nabs.Launchpad.Core.Ai.Menu&version=10.0.239
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Nabs.Launchpad.Core.Ai.Menu
Nabs.Launchpad.Core.Ai.Menu provides a strongly typed command registry for building reliable, discoverable AI-driven console menus without fragile reflection or duplicated plumbing.
Installation
dotnet add package Nabs.Launchpad.Core.Ai.Menu
The Problem
// 1) Duplicate command names silently overwrite intent in ad-hoc dictionaries
var commands = new Dictionary<string, Func<Task>>();
commands["run"] = () => Task.CompletedTask;
commands["run"] = () => Task.Delay(1); // accidental replacement
// 2) Exit behavior gets scattered and can appear in inconsistent positions
menuItems.Add("Exit", ExitAsync);
menuItems.Insert(0, "Exit", ExitAsync); // multiple paths, unclear behavior
// 3) Input conversion is hand-rolled and fails late at runtime
var retries = int.Parse(userInput); // throws on invalid input
// 4) Generic command results are hard to normalize
var result = await command.Run(); // each command returns different shapes
if (result == null) { /* unclear failure handling */ }
Features
- Strongly typed menu command registration with
IMenuCommand<TResult>andIMenuCommand<TInput, TResult>support. - Duplicate name protection to prevent conflicting command registrations.
- Consistent exit command ordering, keeping exit actions at the end of the menu.
- Built-in string-to-input conversion for typed commands (including enum support).
- Unified execution result model via
MenuCommandExecutionResult.
Usage
using Ardalis.Result;
using Nabs.Launchpad.Core.Ai;
using Nabs.Launchpad.Core.Ai.Menu;
public sealed class GreetCommand : IMenuCommand<string, string>
{
public string ChoiceLabel => "Say hello";
public string Name => "greet";
public string Description => "Greets a user by name.";
public Task<Result<string>> RunMenuAsync(string input)
{
return Task.FromResult(Result.Success($"Hello, {input}!"));
}
}
var registry = new MenuCommandRegistry();
registry.AddHeading("AI Utility Menu");
registry.ConfigureMenuCommands(
[
new GreetCommand(),
new ExitMenuCommand()
]);
var greet = registry.MenuCommands.Single(c => c.Name == "greet");
var execution = await greet.RunMenuAsync("Launchpad");
if (execution.IsSuccess)
{
Console.WriteLine(execution.Value);
}
Configuration
No package-level configuration is required. Register commands at runtime through MenuCommandRegistry.
Project Structure
MenuCommandRegistry- registers commands, validates uniqueness, orders exit commands, and executes commands.MenuCommandRegistration- immutable registration record containing metadata and executable delegate.MenuCommandExecutionResult- normalized execution response (IsSuccess,Value,ValidationErrors).ExitMenuCommand- default exit command implementation.IMenuPrompt- minimal prompt contract exposing a command registry.
License
Copyright (c) Net Advantage Business Solutions.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Nabs.Launchpad.Core.Ai (>= 10.0.239)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.