Implement SEP-2663 Tasks Extension (#1579)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
ed07fdb6f4
commit
dbb7a20176
1 changed files with 8190 additions and 11405 deletions
28
src/ModelContextProtocol.Core/Server/McpTaskInfo.cs
Normal file
28
src/ModelContextProtocol.Core/Server/McpTaskInfo.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using ModelContextProtocol.Protocol;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace ModelContextProtocol.Server;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the state of a task in an <see cref="IMcpTaskStore"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This is the store's representation of a task, decoupled from the MCP protocol wire types.
|
||||
/// The server infrastructure maps <see cref="McpTaskInfo"/> to the appropriate protocol response
|
||||
/// types (<see cref="CreateTaskResult"/>, <see cref="GetTaskResult"/>) when communicating with clients.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
[Experimental(Experimentals.Extensions_DiagnosticId, UrlFormat = Experimentals.Extensions_Url)]
|
||||
public sealed record McpTaskInfo(
|
||||
string TaskId,
|
||||
McpTaskStatus Status,
|
||||
DateTimeOffset CreatedAt,
|
||||
DateTimeOffset LastUpdatedAt,
|
||||
long? TtlMs = null,
|
||||
long? PollIntervalMs = null,
|
||||
string? StatusMessage = null,
|
||||
JsonElement? Result = null,
|
||||
JsonElement? Error = null,
|
||||
IReadOnlyDictionary<string, InputRequest>? InputRequests = null);
|
||||
Loading…
Reference in a new issue