Class JDAIToolkit
- Namespace
- JD.AI.Core.Installation
- Assembly
- JD.AI.Core.dll
Provides unified multi-tool detection, version checking, and updating for all JD.AI global tools installed via dotnet tool.
public static class JDAIToolkit
- Inheritance
-
JDAIToolkit
- Inherited Members
Methods
ApplyAllAsync(UpdatePlan, bool, Action<InstalledTool, InstallResult>?, CancellationToken)
Applies updates for all tools that have a newer version available,
in sequence. Stops on first failure unless continueOnError is true.
public static Task ApplyAllAsync(UpdatePlan plan, bool continueOnError = false, Action<InstalledTool, InstallResult>? onToolUpdated = null, CancellationToken ct = default)
Parameters
planUpdatePlancontinueOnErrorboolonToolUpdatedAction<InstalledTool, InstallResult>ctCancellationToken
Returns
ApplyAsync(string, string?, CancellationToken)
Applies an update to a single tool by package ID.
public static Task<InstallResult> ApplyAsync(string packageId, string? targetVersion = null, CancellationToken ct = default)
Parameters
packageIdstringtargetVersionstringctCancellationToken
Returns
CheckAllAsync(IReadOnlyList<InstalledTool>?, CancellationToken)
Checks all detected tools for available updates from NuGet, in parallel. Returns an UpdatePlan describing the current state of each tool.
public static Task<UpdatePlan> CheckAllAsync(IReadOnlyList<InstalledTool>? tools = null, CancellationToken ct = default)
Parameters
toolsIReadOnlyList<InstalledTool>ctCancellationToken
Returns
CompareVersions(string, string)
Compares two semver-ish version strings. Returns positive if latest > current.
public static int CompareVersions(string latest, string current)
Parameters
Returns
GetInstalledToolsAsync(CancellationToken)
Detects all installed JD.AI dotnet global tools by parsing
dotnet tool list -g output and filtering by known package prefixes.
Falls back to checking each known package ID individually if the list is unavailable.
public static Task<IReadOnlyList<InstalledTool>> GetInstalledToolsAsync(CancellationToken ct = default)
Parameters
Returns
GetLatestVersionAsync(string, CancellationToken)
Checks the latest version of a single package from NuGet.
public static Task<string?> GetLatestVersionAsync(string packageId, CancellationToken ct = default)
Parameters
packageIdstringctCancellationToken