From 85a0b3b21804b5907c9d84195437e96787d4f362 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Tue, 19 May 2026 22:05:52 +0000
Subject: [PATCH 1/6] Update @github/copilot to 1.0.51-1
- Updated nodejs and test harness dependencies
- Re-ran code generators
- Formatted generated code
---
dotnet/src/Generated/Rpc.cs | 13919 ++++++++++++++-----
dotnet/src/Generated/SessionEvents.cs | 263 +-
go/rpc/zrpc.go | 5894 +++++++-
go/rpc/zrpc_encoding.go | 1062 +-
go/rpc/zsession_encoding.go | 203 -
go/rpc/zsession_events.go | 325 +-
go/zsession_events.go | 10 -
nodejs/package-lock.json | 72 +-
nodejs/package.json | 2 +-
nodejs/samples/package-lock.json | 2 +-
nodejs/src/generated/rpc.ts | 5417 +++++++-
nodejs/src/generated/session-events.ts | 6 +-
python/copilot/generated/rpc.py | 13754 ++++++++++++++----
python/copilot/generated/session_events.py | 506 +-
rust/src/generated/api_types.rs | 8050 +++++++++--
rust/src/generated/rpc.rs | 3748 ++++-
rust/src/generated/session_events.rs | 172 +-
test/harness/package-lock.json | 72 +-
test/harness/package.json | 2 +-
19 files changed, 42324 insertions(+), 11155 deletions(-)
diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs
index 79649f1da..11eb343a1 100644
--- a/dotnet/src/Generated/Rpc.cs
+++ b/dotnet/src/Generated/Rpc.cs
@@ -18,7 +18,7 @@
namespace GitHub.Copilot.SDK.Rpc;
-/// Server liveness response, including the echoed message, current timestamp, and protocol version.
+/// Server liveness response, including the echoed message, current server timestamp, and protocol version.
public sealed class PingResult
{
/// Echoed message (or default greeting).
@@ -26,12 +26,13 @@ public sealed class PingResult
public string Message { get; set; } = string.Empty;
/// Server protocol version number.
+ [Range((double)0, (double)long.MaxValue, MinimumIsExclusive = true)]
[JsonPropertyName("protocolVersion")]
public long ProtocolVersion { get; set; }
- /// Server timestamp in milliseconds.
+ /// ISO 8601 timestamp when the server handled the ping.
[JsonPropertyName("timestamp")]
- public long Timestamp { get; set; }
+ public DateTimeOffset Timestamp { get; set; }
}
/// Optional message to echo back to the caller.
@@ -50,6 +51,7 @@ internal sealed class ConnectResult
public bool Ok { get; set; }
/// Server protocol version number.
+ [Range((double)0, (double)long.MaxValue, MinimumIsExclusive = true)]
[JsonPropertyName("protocolVersion")]
public long ProtocolVersion { get; set; }
@@ -70,18 +72,22 @@ internal sealed class ConnectRequest
public sealed class ModelBillingTokenPrices
{
/// Number of tokens per standard billing batch.
+ [Range((double)0, (double)long.MaxValue, MinimumIsExclusive = true)]
[JsonPropertyName("batchSize")]
public long? BatchSize { get; set; }
/// Price per billing batch of cached tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 AIU = $0.01 USD).
+ [Range((double)0, (double)long.MaxValue)]
[JsonPropertyName("cachePrice")]
public long? CachePrice { get; set; }
/// Price per billing batch of input tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 AIU = $0.01 USD).
+ [Range((double)0, (double)long.MaxValue)]
[JsonPropertyName("inputPrice")]
public long? InputPrice { get; set; }
/// Price per billing batch of output tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 AIU = $0.01 USD).
+ [Range((double)0, (double)long.MaxValue)]
[JsonPropertyName("outputPrice")]
public long? OutputPrice { get; set; }
}
@@ -275,6 +281,7 @@ internal sealed class ToolsListRequest
public sealed class AccountQuotaSnapshot
{
/// Number of requests included in the entitlement, or -1 for unlimited entitlements.
+ [Range((double)-1, (double)long.MaxValue)]
[JsonPropertyName("entitlementRequests")]
public long EntitlementRequests { get; set; }
@@ -589,6 +596,7 @@ public sealed class ConnectedRemoteSessionMetadata
public string? Name { get; set; }
/// Pull request number associated with the session.
+ [Range((double)0, (double)long.MaxValue, MinimumIsExclusive = true)]
[JsonPropertyName("pullRequestNumber")]
public long? PullRequestNumber { get; set; }
@@ -643,1094 +651,1575 @@ internal sealed class ConnectRemoteSessionParams
public string SessionId { get; set; } = string.Empty;
}
-/// Identifies the target session.
-internal sealed class SessionSuspendRequest
+/// Schema for the `SessionContext` type.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionContext
{
- /// Target session identifier.
+ /// Active git branch.
+ [JsonPropertyName("branch")]
+ public string? Branch { get; set; }
+
+ /// Most recent working directory for this session.
+ [JsonPropertyName("cwd")]
+ public string Cwd { get; set; } = string.Empty;
+
+ /// Git repository root, if the cwd was inside a git repo.
+ [JsonPropertyName("gitRoot")]
+ public string? GitRoot { get; set; }
+
+ /// Repository host type.
+ [JsonPropertyName("hostType")]
+ public SessionContextHostType? HostType { get; set; }
+
+ /// Repository slug in `owner/name` form, when known.
+ [JsonPropertyName("repository")]
+ public string? Repository { get; set; }
+}
+
+/// Schema for the `SessionMetadata` type.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionMetadata
+{
+ /// Schema for the `SessionContext` type.
+ [JsonPropertyName("context")]
+ public SessionContext? Context { get; set; }
+
+ /// True for remote (GitHub) sessions; false for local.
+ [JsonPropertyName("isRemote")]
+ public bool IsRemote { get; set; }
+
+ /// GitHub task ID, when this local session is bound to one. Only present for local sessions exported to remote control.
+ [JsonPropertyName("mcTaskId")]
+ public string? McTaskId { get; set; }
+
+ /// Last-modified time of the session's persisted state, as ISO 8601.
+ [JsonPropertyName("modifiedTime")]
+ public string ModifiedTime { get; set; } = string.Empty;
+
+ /// Optional human-friendly name set via /rename.
+ [JsonPropertyName("name")]
+ public string? Name { get; set; }
+
+ /// Stable session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
+
+ /// Session creation time as an ISO 8601 timestamp.
+ [JsonPropertyName("startTime")]
+ public string StartTime { get; set; } = string.Empty;
+
+ /// Short summary of the session, when one has been derived.
+ [JsonPropertyName("summary")]
+ public string? Summary { get; set; }
}
-/// Identifier of the session event that was emitted for the log message.
-public sealed class LogResult
+/// Persisted sessions matching the filter, ordered most-recently-modified first.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionList
{
- /// The unique identifier of the emitted session event.
- [JsonPropertyName("eventId")]
- public Guid EventId { get; set; }
+ /// Sessions ordered most-recently-modified first.
+ [JsonPropertyName("sessions")]
+ public IList Sessions { get => field ??= []; set; }
}
-/// Message text, optional severity level, persistence flag, and optional follow-up URL.
-internal sealed class LogRequest
+/// Optional filter applied to the returned sessions.
+public sealed class SessionsListRequestFilter
{
- /// When true, the message is transient and not persisted to the session event log on disk.
- [JsonPropertyName("ephemeral")]
- public bool? Ephemeral { get; set; }
-
- /// Log severity level. Determines how the message is displayed in the timeline. Defaults to "info".
- [JsonPropertyName("level")]
- public SessionLogLevel? Level { get; set; }
+ /// Match sessions whose context.branch equals this value.
+ [JsonPropertyName("branch")]
+ public string? Branch { get; set; }
- /// Human-readable message.
- [JsonPropertyName("message")]
- public string Message { get; set; } = string.Empty;
+ /// Match sessions whose context.cwd equals this value.
+ [JsonPropertyName("cwd")]
+ public string? Cwd { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Match sessions whose context.gitRoot equals this value.
+ [JsonPropertyName("gitRoot")]
+ public string? GitRoot { get; set; }
- /// Optional URL the user can open in their browser for more details.
- [Url]
- [StringSyntax(StringSyntaxAttribute.Uri)]
- [JsonPropertyName("url")]
- public string? Url { get; set; }
+ /// Match sessions whose context.repository equals this value.
+ [JsonPropertyName("repository")]
+ public string? Repository { get; set; }
}
-/// Authentication status and account metadata for the session.
-public sealed class SessionAuthStatus
+/// Optional metadata-load limit and context filter applied to the returned sessions.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsListRequest
{
- /// Authentication type.
- [JsonPropertyName("authType")]
- public AuthInfoType? AuthType { get; set; }
+ /// Optional filter applied to the returned sessions.
+ [JsonPropertyName("filter")]
+ public SessionsListRequestFilter? Filter { get; set; }
- /// Copilot plan tier (e.g., individual_pro, business).
- [JsonPropertyName("copilotPlan")]
- public string? CopilotPlan { get; set; }
+ /// When provided, only the first N sessions (sorted by modification time, newest first) load full metadata; remaining sessions return basic info only. Use 0 to return only basic info for every session.
+ [Range((double)0, (double)long.MaxValue)]
+ [JsonPropertyName("metadataLimit")]
+ public long? MetadataLimit { get; set; }
+}
- /// Authentication host URL.
- [Url]
- [StringSyntax(StringSyntaxAttribute.Uri)]
- [JsonPropertyName("host")]
- public string? Host { get; set; }
+/// ID of the local session bound to the given GitHub task, or omitted when none.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionsFindByTaskIDResult
+{
+ /// Omitted when no local session is bound to that GitHub task.
+ [JsonPropertyName("sessionId")]
+ public string? SessionId { get; set; }
+}
- /// Whether the session has resolved authentication.
- [JsonPropertyName("isAuthenticated")]
- public bool IsAuthenticated { get; set; }
+/// GitHub task ID to look up.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsFindByTaskIDRequest
+{
+ /// GitHub task ID to look up.
+ [JsonPropertyName("taskId")]
+ public string TaskId { get; set; } = string.Empty;
+}
- /// Authenticated login/username, if available.
- [JsonPropertyName("login")]
- public string? Login { get; set; }
+/// Session ID matching the prefix, omitted when no unique match exists.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionsFindByPrefixResult
+{
+ /// Omitted when no unique session matches the prefix (no match or ambiguous).
+ [JsonPropertyName("sessionId")]
+ public string? SessionId { get; set; }
+}
- /// Human-readable authentication status description.
- [JsonPropertyName("statusMessage")]
- public string? StatusMessage { get; set; }
+/// UUID prefix to resolve to a unique session ID.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsFindByPrefixRequest
+{
+ /// UUID prefix (>=7 hex chars, <36 chars). Returns the unique session ID, or undefined when there is no match or the prefix matches multiple sessions.
+ [JsonPropertyName("prefix")]
+ public string Prefix { get; set; } = string.Empty;
}
-/// Identifies the target session.
-internal sealed class SessionAuthGetStatusRequest
+/// Most-relevant session ID for the supplied context, or omitted when no sessions exist.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionsGetLastForContextResult
{
- /// Target session identifier.
+ /// Most-relevant session ID for the supplied context, or omitted when no sessions exist.
[JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ public string? SessionId { get; set; }
}
-/// The currently selected model for the session.
-public sealed class CurrentModel
+/// Optional working-directory context used to score session relevance.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsGetLastForContextRequest
{
- /// Currently active model identifier.
- [JsonPropertyName("modelId")]
- public string? ModelId { get; set; }
+ /// Optional working-directory context used to score session relevance. When omitted the most-recently-modified session wins.
+ [JsonPropertyName("context")]
+ public SessionContext? Context { get; set; }
}
-/// Identifies the target session.
-internal sealed class SessionModelGetCurrentRequest
+/// Absolute path to the session's events.jsonl file on disk.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionsGetEventFilePathResult
{
- /// Target session identifier.
+ /// Absolute path to the session's events.jsonl file.
+ [JsonPropertyName("filePath")]
+ public string FilePath { get; set; } = string.Empty;
+}
+
+/// Session ID whose event-log file path to compute.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsGetEventFilePathRequest
+{
+ /// Session ID whose event-log file path to compute.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// The model identifier active on the session after the switch.
-public sealed class ModelSwitchToResult
+/// Map of sessionId -> on-disk size in bytes for each session's workspace directory.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionSizes
{
- /// Currently active model identifier after the switch.
- [JsonPropertyName("modelId")]
- public string? ModelId { get; set; }
+ /// Map of sessionId -> on-disk size in bytes for the session's workspace directory.
+ [JsonPropertyName("sizes")]
+ public IDictionary Sizes { get => field ??= new Dictionary(); set; }
}
-/// Vision-specific limits.
-public sealed class ModelCapabilitiesOverrideLimitsVision
+/// Session IDs from the input set that are currently in use by another process.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionsCheckInUseResult
{
- /// Maximum image size in bytes.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("max_prompt_image_size")]
- public long? MaxPromptImageSize { get; set; }
-
- /// Maximum number of images per prompt.
- [Range((double)1, (double)long.MaxValue)]
- [JsonPropertyName("max_prompt_images")]
- public long? MaxPromptImages { get; set; }
+ /// Session IDs from the input set that are currently held by another running process via an alive lock file.
+ [JsonPropertyName("inUse")]
+ public IList InUse { get => field ??= []; set; }
+}
- /// MIME types the model accepts.
- [JsonPropertyName("supported_media_types")]
- public IList? SupportedMediaTypes { get; set; }
+/// Session IDs to test for live in-use locks.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsCheckInUseRequest
+{
+ /// Session IDs to test for live in-use locks.
+ [JsonPropertyName("sessionIds")]
+ public IList SessionIds { get => field ??= []; set; }
}
-/// Token limits for prompts, outputs, and context window.
-public sealed class ModelCapabilitiesOverrideLimits
+/// The session's persisted remote-steerable flag, or omitted when no value has been persisted.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionsGetPersistedRemoteSteerableResult
{
- /// Maximum total context window size in tokens.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("max_context_window_tokens")]
- public long? MaxContextWindowTokens { get; set; }
+ /// The session's persisted remote-steerable flag if recorded; omitted when no value has been persisted.
+ [JsonPropertyName("remoteSteerable")]
+ public bool? RemoteSteerable { get; set; }
+}
- /// Maximum number of output/completion tokens.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("max_output_tokens")]
- public long? MaxOutputTokens { get; set; }
+/// Session ID to look up the persisted remote-steerable flag for.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsGetPersistedRemoteSteerableRequest
+{
+ /// Session ID to look up the persisted remote-steerable flag for.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// Maximum number of prompt/input tokens.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("max_prompt_tokens")]
- public long? MaxPromptTokens { get; set; }
+/// Closes a session: emits shutdown, flushes pending events to disk, releases the in-use lock, disposes the active session. Idempotent: succeeds even if the session is not currently active.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionsCloseResult
+{
+}
- /// Vision-specific limits.
- [JsonPropertyName("vision")]
- public ModelCapabilitiesOverrideLimitsVision? Vision { get; set; }
+/// Session ID to close.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsCloseRequest
+{
+ /// Session ID to close.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Feature flags indicating what the model supports.
-public sealed class ModelCapabilitiesOverrideSupports
+/// Map of sessionId -> bytes freed by removing the session's workspace directory.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionBulkDeleteResult
{
- /// Whether this model supports reasoning effort configuration.
- [JsonPropertyName("reasoningEffort")]
- public bool? ReasoningEffort { get; set; }
+ /// Map of sessionId -> bytes freed by removing the session's workspace directory. Sessions whose deletion failed are omitted from this map (failures are logged on the server but not surfaced per-id; check the map for absent IDs to detect them).
+ [JsonPropertyName("freedBytes")]
+ public IDictionary FreedBytes { get => field ??= new Dictionary(); set; }
+}
- /// Whether this model supports vision/image input.
- [JsonPropertyName("vision")]
- public bool? Vision { get; set; }
+/// Session IDs to close, deactivate, and delete from disk.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsBulkDeleteRequest
+{
+ /// Session IDs to close, deactivate, and delete from disk.
+ [JsonPropertyName("sessionIds")]
+ public IList SessionIds { get => field ??= []; set; }
}
-/// Override individual model capabilities resolved by the runtime.
-public sealed class ModelCapabilitiesOverride
+/// Outcome of the prune operation: deleted IDs, dry-run candidates, skipped IDs, total bytes freed, and the dry-run flag.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionPruneResult
{
- /// Token limits for prompts, outputs, and context window.
- [JsonPropertyName("limits")]
- public ModelCapabilitiesOverrideLimits? Limits { get; set; }
+ /// Session IDs that would be deleted in dry-run mode (always empty otherwise).
+ [JsonPropertyName("candidates")]
+ public IList Candidates { get => field ??= []; set; }
- /// Feature flags indicating what the model supports.
- [JsonPropertyName("supports")]
- public ModelCapabilitiesOverrideSupports? Supports { get; set; }
+ /// Session IDs that were deleted (always empty in dry-run mode).
+ [JsonPropertyName("deleted")]
+ public IList Deleted { get => field ??= []; set; }
+
+ /// True when no deletions were actually performed.
+ [JsonPropertyName("dryRun")]
+ public bool DryRun { get; set; }
+
+ /// Total bytes freed (actual when not dry-run, projected when dry-run).
+ [Range((double)0, (double)long.MaxValue)]
+ [JsonPropertyName("freedBytes")]
+ public long FreedBytes { get; set; }
+
+ /// Session IDs that were skipped (e.g., named sessions).
+ [JsonPropertyName("skipped")]
+ public IList Skipped { get => field ??= []; set; }
}
-/// Target model identifier and optional reasoning effort, summary, and capability overrides.
-internal sealed class ModelSwitchToRequest
+/// Age threshold and optional flags controlling which old sessions are pruned (or simulated when dryRun is true).
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsPruneOldRequest
{
- /// Override individual model capabilities resolved by the runtime.
- [JsonPropertyName("modelCapabilities")]
- public ModelCapabilitiesOverride? ModelCapabilities { get; set; }
+ /// When true, only report what would be deleted without performing any deletion.
+ [JsonPropertyName("dryRun")]
+ public bool? DryRun { get; set; }
- /// Model identifier to switch to.
- [JsonPropertyName("modelId")]
- public string ModelId { get; set; } = string.Empty;
+ /// Session IDs that should never be considered for pruning.
+ [JsonPropertyName("excludeSessionIds")]
+ public IList? ExcludeSessionIds { get; set; }
- /// Reasoning effort level to use for the model. "none" disables reasoning.
- [JsonPropertyName("reasoningEffort")]
- public string? ReasoningEffort { get; set; }
+ /// When true, named sessions (set via /rename) are also eligible for pruning.
+ [JsonPropertyName("includeNamed")]
+ public bool? IncludeNamed { get; set; }
- /// Reasoning summary mode to request for supported model clients.
- [JsonPropertyName("reasoningSummary")]
- public ReasoningSummary? ReasoningSummary { get; set; }
+ /// Delete sessions whose modifiedTime is at least this many days old.
+ [Range((double)0, (double)long.MaxValue)]
+ [JsonPropertyName("olderThanDays")]
+ public long OlderThanDays { get; set; }
+}
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+/// Flush a session's pending events to disk. No-op when no writer exists for the session (e.g., already closed).
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionsSaveResult
+{
}
-/// Identifies the target session.
-internal sealed class SessionModeGetRequest
+/// Session ID whose pending events should be flushed to disk.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsSaveRequest
{
- /// Target session identifier.
+ /// Session ID whose pending events should be flushed to disk.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Agent interaction mode to apply to the session.
-internal sealed class ModeSetRequest
+/// Release the in-use lock held by this process for the given session. No-op when this process does not currently hold a lock for the session.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionsReleaseLockResult
{
- /// The session mode the agent is operating in.
- [JsonPropertyName("mode")]
- public SessionMode Mode { get; set; }
+}
- /// Target session identifier.
+/// Session ID whose in-use lock should be released.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsReleaseLockRequest
+{
+ /// Session ID whose in-use lock should be released.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// The session's friendly name, or null when not yet set.
-public sealed class NameGetResult
+/// The same metadata records, with summary and context fields backfilled where available.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionEnrichMetadataResult
{
- /// The session name (user-set or auto-generated), or null if not yet set.
- [JsonPropertyName("name")]
- public string? Name { get; set; }
+ /// Same records, with summary and context backfilled.
+ [JsonPropertyName("sessions")]
+ public IList Sessions { get => field ??= []; set; }
}
-/// Identifies the target session.
-internal sealed class SessionNameGetRequest
+/// Session metadata records to enrich with summary and context information.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsEnrichMetadataRequest
{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Session metadata records to enrich. Records that already have summary and context are returned unchanged.
+ [JsonPropertyName("sessions")]
+ public IList Sessions { get => field ??= []; set; }
}
-/// New friendly name to apply to the session.
-internal sealed class NameSetRequest
+/// Reload all hooks (user, plugin, optionally repo) and apply them to the active session. Call after installing or removing plugins so their hooks take effect immediately. No-op when no active session matches the given sessionId.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionsReloadPluginHooksResult
{
- /// New session name (1–100 characters, trimmed of leading/trailing whitespace).
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
- [MaxLength(100)]
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+}
- /// Target session identifier.
+/// Active session ID and an optional flag for deferring repo-level hooks until folder trust.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsReloadPluginHooksRequest
+{
+ /// When true, skip repo-level hooks. Use before folder trust is confirmed; loadDeferredRepoHooks loads them post-trust.
+ [JsonPropertyName("deferRepoHooks")]
+ public bool? DeferRepoHooks { get; set; }
+
+ /// Active session ID to reload hooks for.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Existence, contents, and resolved path of the session plan file.
-public sealed class PlanReadResult
+/// Queued repo-level startup prompts and the total hook command count after loading.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionLoadDeferredRepoHooksResult
{
- /// The content of the plan file, or null if it does not exist.
- [JsonPropertyName("content")]
- public string? Content { get; set; }
-
- /// Whether the plan file exists in the workspace.
- [JsonPropertyName("exists")]
- public bool Exists { get; set; }
+ /// Total hook command count (user + plugin + repo) loaded for the session by this call. Captured atomically with startupPrompts so callers don't need to read a separate counter.
+ [Range((double)0, (double)long.MaxValue)]
+ [JsonPropertyName("hookCount")]
+ public long HookCount { get; set; }
- /// Absolute file path of the plan file, or null if workspace is not enabled.
- [JsonPropertyName("path")]
- public string? Path { get; set; }
+ /// Repo-level startup prompts queued from repo hook configs. Empty on resume, when no repo configs were pending, or when disableAllHooks is set.
+ [JsonPropertyName("startupPrompts")]
+ public IList StartupPrompts { get => field ??= []; set; }
}
-/// Identifies the target session.
-internal sealed class SessionPlanReadRequest
+/// Active session ID whose deferred repo-level hooks should be loaded.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsLoadDeferredRepoHooksRequest
{
- /// Target session identifier.
+ /// Active session ID whose deferred repo-level hooks should be loaded.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Replacement contents to write to the session plan file.
-internal sealed class PlanUpdateRequest
+/// Replace the manager-wide additional plugins. New session creations and subsequent hook reloads see the new set; already-running sessions keep their existing hook installation until the next reload.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionsSetAdditionalPluginsResult
{
- /// The new content for the plan file.
- [JsonPropertyName("content")]
- public string Content { get; set; } = string.Empty;
+}
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+/// Schema for the `InstalledPlugin` type.
+[Experimental(Diagnostics.Experimental)]
+public sealed class InstalledPlugin
+{
+ /// Path where the plugin is cached locally.
+ [JsonPropertyName("cache_path")]
+ public string? CachePath { get; set; }
+
+ /// Whether the plugin is currently enabled.
+ [JsonPropertyName("enabled")]
+ public bool Enabled { get; set; }
+
+ /// Installation timestamp.
+ [JsonPropertyName("installed_at")]
+ public string InstalledAt { get; set; } = string.Empty;
+
+ /// Marketplace the plugin came from (empty string for direct repo installs).
+ [JsonPropertyName("marketplace")]
+ public string Marketplace { get; set; } = string.Empty;
+
+ /// Plugin name.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
+
+ /// Source for direct repo installs (when marketplace is empty).
+ [JsonPropertyName("source")]
+ public object? Source { get; set; }
+
+ /// Version installed (if available).
+ [JsonPropertyName("version")]
+ public string? Version { get; set; }
+}
+
+/// Manager-wide additional plugins to register; replaces any previously-configured set.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionsSetAdditionalPluginsRequest
+{
+ /// Manager-wide additional plugins to register. Replaces any previously-configured set. Pass an empty array to clear.
+ [JsonPropertyName("plugins")]
+ public IList Plugins { get => field ??= []; set; }
}
/// Identifies the target session.
-internal sealed class SessionPlanDeleteRequest
+internal sealed class SessionSuspendRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// RPC data type for WorkspacesGetWorkspaceResultWorkspace operations.
-public sealed class WorkspacesGetWorkspaceResultWorkspace
+/// Result of sending a user message.
+public sealed class SendResult
{
- /// Gets or sets the branch value.
- [JsonPropertyName("branch")]
- public string? Branch { get; set; }
+ /// Unique identifier assigned to the message.
+ [JsonPropertyName("messageId")]
+ public string MessageId { get; set; } = string.Empty;
+}
- /// Gets or sets the chronicle_sync_dismissed value.
- [JsonPropertyName("chronicle_sync_dismissed")]
- public bool? ChronicleSyncDismissed { get; set; }
+/// A user message attachment — a file, directory, code selection, blob, or GitHub reference.
+/// Polymorphic base type discriminated by type.
+[JsonPolymorphic(
+ TypeDiscriminatorPropertyName = "type",
+ UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
+[JsonDerivedType(typeof(SendAttachmentFile), "file")]
+[JsonDerivedType(typeof(SendAttachmentDirectory), "directory")]
+[JsonDerivedType(typeof(SendAttachmentSelection), "selection")]
+[JsonDerivedType(typeof(SendAttachmentGithubReference), "github_reference")]
+[JsonDerivedType(typeof(SendAttachmentBlob), "blob")]
+public partial class SendAttachment
+{
+ /// The type discriminator.
+ [JsonPropertyName("type")]
+ public virtual string Type { get; set; } = string.Empty;
+}
- /// Gets or sets the created_at value.
- [JsonPropertyName("created_at")]
- public DateTimeOffset? CreatedAt { get; set; }
- /// Gets or sets the cwd value.
- [JsonPropertyName("cwd")]
- public string? Cwd { get; set; }
+/// Optional line range to scope the attachment to a specific section of the file.
+public sealed class SendAttachmentFileLineRange
+{
+ /// End line number (1-based, inclusive).
+ [Range((double)0, (double)long.MaxValue, MinimumIsExclusive = true)]
+ [JsonPropertyName("end")]
+ public long End { get; set; }
- /// Gets or sets the git_root value.
- [JsonPropertyName("git_root")]
- public string? GitRoot { get; set; }
+ /// Start line number (1-based).
+ [Range((double)0, (double)long.MaxValue, MinimumIsExclusive = true)]
+ [JsonPropertyName("start")]
+ public long Start { get; set; }
+}
- /// Gets or sets the host_type value.
- [JsonPropertyName("host_type")]
- public WorkspacesGetWorkspaceResultWorkspaceHostType? HostType { get; set; }
+/// File attachment.
+/// The file variant of .
+public partial class SendAttachmentFile : SendAttachment
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "file";
- /// Gets or sets the id value.
- [JsonPropertyName("id")]
- public Guid Id { get; set; }
+ /// User-facing display name for the attachment.
+ [JsonPropertyName("displayName")]
+ public required string DisplayName { get; set; }
- /// Gets or sets the mc_last_event_id value.
- [JsonPropertyName("mc_last_event_id")]
- public string? McLastEventId { get; set; }
+ /// Optional line range to scope the attachment to a specific section of the file.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("lineRange")]
+ public SendAttachmentFileLineRange? LineRange { get; set; }
- /// Gets or sets the mc_session_id value.
- [JsonPropertyName("mc_session_id")]
- public string? McSessionId { get; set; }
+ /// Absolute file path.
+ [JsonPropertyName("path")]
+ public required string Path { get; set; }
+}
- /// Gets or sets the mc_task_id value.
- [JsonPropertyName("mc_task_id")]
- public string? McTaskId { get; set; }
+/// Directory attachment.
+/// The directory variant of .
+public partial class SendAttachmentDirectory : SendAttachment
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "directory";
- /// Gets or sets the name value.
- [JsonPropertyName("name")]
- public string? Name { get; set; }
+ /// User-facing display name for the attachment.
+ [JsonPropertyName("displayName")]
+ public required string DisplayName { get; set; }
- /// Gets or sets the remote_steerable value.
- [JsonPropertyName("remote_steerable")]
- public bool? RemoteSteerable { get; set; }
+ /// Absolute directory path.
+ [JsonPropertyName("path")]
+ public required string Path { get; set; }
+}
- /// Gets or sets the repository value.
- [JsonPropertyName("repository")]
- public string? Repository { get; set; }
+/// End position of the selection.
+public sealed class SendAttachmentSelectionDetailsEnd
+{
+ /// End character offset within the line (0-based).
+ [Range((double)0, (double)long.MaxValue)]
+ [JsonPropertyName("character")]
+ public long Character { get; set; }
- /// Gets or sets the summary_count value.
+ /// End line number (0-based).
[Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("summary_count")]
- public long? SummaryCount { get; set; }
+ [JsonPropertyName("line")]
+ public long Line { get; set; }
+}
- /// Gets or sets the updated_at value.
- [JsonPropertyName("updated_at")]
- public DateTimeOffset? UpdatedAt { get; set; }
+/// Start position of the selection.
+public sealed class SendAttachmentSelectionDetailsStart
+{
+ /// Start character offset within the line (0-based).
+ [Range((double)0, (double)long.MaxValue)]
+ [JsonPropertyName("character")]
+ public long Character { get; set; }
- /// Gets or sets the user_named value.
- [JsonPropertyName("user_named")]
- public bool? UserNamed { get; set; }
+ /// Start line number (0-based).
+ [Range((double)0, (double)long.MaxValue)]
+ [JsonPropertyName("line")]
+ public long Line { get; set; }
}
-/// Current workspace metadata for the session, or null when not available.
-public sealed class WorkspacesGetWorkspaceResult
+/// Position range of the selection within the file.
+public sealed class SendAttachmentSelectionDetails
{
- /// Current workspace metadata, or null if not available.
- [JsonPropertyName("workspace")]
- public WorkspacesGetWorkspaceResultWorkspace? Workspace { get; set; }
+ /// End position of the selection.
+ [JsonPropertyName("end")]
+ public SendAttachmentSelectionDetailsEnd End { get => field ??= new(); set; }
+
+ /// Start position of the selection.
+ [JsonPropertyName("start")]
+ public SendAttachmentSelectionDetailsStart Start { get => field ??= new(); set; }
}
-/// Identifies the target session.
-internal sealed class SessionWorkspacesGetWorkspaceRequest
+/// Code selection attachment from an editor.
+/// The selection variant of .
+public partial class SendAttachmentSelection : SendAttachment
{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ ///
+ [JsonIgnore]
+ public override string Type => "selection";
+
+ /// User-facing display name for the selection.
+ [JsonPropertyName("displayName")]
+ public required string DisplayName { get; set; }
+
+ /// Absolute path to the file containing the selection.
+ [JsonPropertyName("filePath")]
+ public required string FilePath { get; set; }
+
+ /// Position range of the selection within the file.
+ [JsonPropertyName("selection")]
+ public required SendAttachmentSelectionDetails Selection { get; set; }
+
+ /// The selected text content.
+ [JsonPropertyName("text")]
+ public required string Text { get; set; }
}
-/// Relative paths of files stored in the session workspace files directory.
-public sealed class WorkspacesListFilesResult
+/// GitHub issue, pull request, or discussion reference.
+/// The github_reference variant of .
+public partial class SendAttachmentGithubReference : SendAttachment
{
- /// Relative file paths in the workspace files directory.
- [JsonPropertyName("files")]
- public IList Files { get => field ??= []; set; }
+ ///
+ [JsonIgnore]
+ public override string Type => "github_reference";
+
+ /// Issue, pull request, or discussion number.
+ [Range((double)0, (double)long.MaxValue, MinimumIsExclusive = true)]
+ [JsonPropertyName("number")]
+ public required long Number { get; set; }
+
+ /// Type of GitHub reference.
+ [JsonPropertyName("referenceType")]
+ public required SendAttachmentGithubReferenceType ReferenceType { get; set; }
+
+ /// Current state of the referenced item (e.g., open, closed, merged).
+ [JsonPropertyName("state")]
+ public required string State { get; set; }
+
+ /// Title of the referenced item.
+ [JsonPropertyName("title")]
+ public required string Title { get; set; }
+
+ /// URL to the referenced item on GitHub.
+ [Url]
+ [StringSyntax(StringSyntaxAttribute.Uri)]
+ [JsonPropertyName("url")]
+ public required string Url { get; set; }
}
-/// Identifies the target session.
-internal sealed class SessionWorkspacesListFilesRequest
+/// Blob attachment with inline base64-encoded data.
+/// The blob variant of .
+public partial class SendAttachmentBlob : SendAttachment
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "blob";
+
+ /// Base64-encoded content.
+ [Base64String]
+ [JsonPropertyName("data")]
+ public required string Data { get; set; }
+
+ /// User-facing display name for the attachment.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("displayName")]
+ public string? DisplayName { get; set; }
+
+ /// MIME type of the inline data.
+ [JsonPropertyName("mimeType")]
+ public required string MimeType { get; set; }
+}
+
+/// Parameters for sending a user message to the session.
+internal sealed class SendRequest
{
+ /// The UI mode the agent was in when this message was sent. Defaults to the session's current mode.
+ [JsonPropertyName("agentMode")]
+ public SendAgentMode? AgentMode { get; set; }
+
+ /// Optional attachments (files, directories, selections, blobs, GitHub references) to include with the message.
+ [JsonPropertyName("attachments")]
+ public IList? Attachments { get; set; }
+
+ /// If false, this message will not trigger a Premium Request Unit charge. User messages default to billable.
+ [JsonPropertyName("billable")]
+ public bool? Billable { get; set; }
+
+ /// If provided, this is shown in the timeline instead of `prompt`.
+ [JsonPropertyName("displayPrompt")]
+ public string? DisplayPrompt { get; set; }
+
+ /// How to deliver the message. `enqueue` (default) appends to the message queue. `immediate` interjects during an in-progress turn.
+ [JsonPropertyName("mode")]
+ public SendMode? Mode { get; set; }
+
+ /// If true, adds the message to the front of the queue instead of the end.
+ [JsonPropertyName("prepend")]
+ public bool? Prepend { get; set; }
+
+ /// The user message text.
+ [JsonPropertyName("prompt")]
+ public string Prompt { get; set; } = string.Empty;
+
+ /// Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key.
+ [JsonPropertyName("requestHeaders")]
+ public IDictionary? RequestHeaders { get; set; }
+
+ /// If set, the request will fail if the named tool is not available when this message is among the user messages at the start of the current exchange.
+ [JsonPropertyName("requiredTool")]
+ public string? RequiredTool { get; set; }
+
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
+
+ /// Optional provenance tag copied to the resulting user.message event. Supported values are `system`, `command-*`, and `schedule-*`.
+ [JsonPropertyName("source")]
+ public object? Source { get; set; }
+
+ /// W3C Trace Context traceparent header for distributed tracing of this agent turn.
+ [JsonPropertyName("traceparent")]
+ public string? Traceparent { get; set; }
+
+ /// W3C Trace Context tracestate header for distributed tracing.
+ [JsonPropertyName("tracestate")]
+ public string? Tracestate { get; set; }
+
+ /// If true, await completion of the agentic loop for this message before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageId`; the caller can rely on the agent having processed the message before the call resolves.
+ [JsonPropertyName("wait")]
+ public bool? Wait { get; set; }
}
-/// Contents of the requested workspace file as a UTF-8 string.
-public sealed class WorkspacesReadFileResult
+/// Result of aborting the current turn.
+public sealed class AbortResult
{
- /// File content as a UTF-8 string.
- [JsonPropertyName("content")]
- public string Content { get; set; } = string.Empty;
+ /// Error message if the abort failed.
+ [JsonPropertyName("error")]
+ public string? Error { get; set; }
+
+ /// Whether the abort completed successfully.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
}
-/// Relative path of the workspace file to read.
-internal sealed class WorkspacesReadFileRequest
+/// Parameters for aborting the current turn.
+internal sealed class AbortRequest
{
- /// Relative path within the workspace files directory.
- [JsonPropertyName("path")]
- public string Path { get; set; } = string.Empty;
+ /// Finite reason code describing why the current turn was aborted.
+ [JsonPropertyName("reason")]
+ public AbortReason? Reason { get; set; }
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Relative path and UTF-8 content for the workspace file to create or overwrite.
-internal sealed class WorkspacesCreateFileRequest
+/// Parameters for shutting down the session.
+internal sealed class ShutdownRequest
{
- /// File content to write as a UTF-8 string.
- [JsonPropertyName("content")]
- public string Content { get; set; } = string.Empty;
-
- /// Relative path within the workspace files directory.
- [JsonPropertyName("path")]
- public string Path { get; set; } = string.Empty;
+ /// Optional human-readable reason. Typically the message of the error that triggered shutdown when type is 'error'.
+ [JsonPropertyName("reason")]
+ public string? Reason { get; set; }
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
+
+ /// Why the session is being shut down. Defaults to "routine" when omitted.
+ [JsonPropertyName("type")]
+ public ShutdownType? Type { get; set; }
}
-/// Schema for the `InstructionsSources` type.
-public sealed class InstructionsSources
+/// Identifier of the session event that was emitted for the log message.
+public sealed class LogResult
{
- /// Glob pattern from frontmatter — when set, this instruction applies only to matching files.
- [JsonPropertyName("applyTo")]
- public string? ApplyTo { get; set; }
+ /// The unique identifier of the emitted session event.
+ [JsonPropertyName("eventId")]
+ public Guid EventId { get; set; }
+}
- /// Raw content of the instruction file.
- [JsonPropertyName("content")]
- public string Content { get; set; } = string.Empty;
+/// Message text, optional severity level, persistence flag, optional follow-up URL, and optional tip.
+internal sealed class LogRequest
+{
+ /// When true, the message is transient and not persisted to the session event log on disk.
+ [JsonPropertyName("ephemeral")]
+ public bool? Ephemeral { get; set; }
- /// Short description (body after frontmatter) for use in instruction tables.
- [JsonPropertyName("description")]
- public string? Description { get; set; }
-
- /// Unique identifier for this source (used for toggling).
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
+ /// Log severity level. Determines how the message is displayed in the timeline. Defaults to "info".
+ [JsonPropertyName("level")]
+ public SessionLogLevel? Level { get; set; }
- /// Human-readable label.
- [JsonPropertyName("label")]
- public string Label { get; set; } = string.Empty;
+ /// Human-readable message.
+ [JsonPropertyName("message")]
+ public string Message { get; set; } = string.Empty;
- /// Where this source lives — used for UI grouping.
- [JsonPropertyName("location")]
- public InstructionsSourcesLocation Location { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
- /// File path relative to repo or absolute for home.
- [JsonPropertyName("sourcePath")]
- public string SourcePath { get; set; } = string.Empty;
+ /// Optional actionable tip displayed alongside the message. Only honored on `level: "info"`.
+ [JsonPropertyName("tip")]
+ public string? Tip { get; set; }
- /// Category of instruction source — used for merge logic.
+ /// Domain category for this log entry (e.g., "mcp", "subscription", "policy", "model"). Maps to `infoType`/`warningType`/`errorType` on the emitted event. Defaults to "notification".
[JsonPropertyName("type")]
- public InstructionsSourcesType Type { get; set; }
+ public string? Type { get; set; }
+
+ /// Optional URL the user can open in their browser for more details.
+ [Url]
+ [StringSyntax(StringSyntaxAttribute.Uri)]
+ [JsonPropertyName("url")]
+ public string? Url { get; set; }
}
-/// Instruction sources loaded for the session, in merge order.
-public sealed class InstructionsGetSourcesResult
+/// Authentication status and account metadata for the session.
+public sealed class SessionAuthStatus
{
- /// Instruction sources for the session.
- [JsonPropertyName("sources")]
- public IList Sources { get => field ??= []; set; }
+ /// Authentication type.
+ [JsonPropertyName("authType")]
+ public AuthInfoType? AuthType { get; set; }
+
+ /// Copilot plan tier (e.g., individual_pro, business).
+ [JsonPropertyName("copilotPlan")]
+ public string? CopilotPlan { get; set; }
+
+ /// Authentication host URL.
+ [Url]
+ [StringSyntax(StringSyntaxAttribute.Uri)]
+ [JsonPropertyName("host")]
+ public string? Host { get; set; }
+
+ /// Whether the session has resolved authentication.
+ [JsonPropertyName("isAuthenticated")]
+ public bool IsAuthenticated { get; set; }
+
+ /// Authenticated login/username, if available.
+ [JsonPropertyName("login")]
+ public string? Login { get; set; }
+
+ /// Human-readable authentication status description.
+ [JsonPropertyName("statusMessage")]
+ public string? StatusMessage { get; set; }
}
/// Identifies the target session.
-internal sealed class SessionInstructionsGetSourcesRequest
+internal sealed class SessionAuthGetStatusRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether fleet mode was successfully activated.
-[Experimental(Diagnostics.Experimental)]
-public sealed class FleetStartResult
+/// Indicates whether the credential update succeeded.
+public sealed class SessionSetCredentialsResult
{
- /// Whether fleet mode was successfully activated.
- [JsonPropertyName("started")]
- public bool Started { get; set; }
+ /// Whether the operation succeeded.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
}
-/// Optional user prompt to combine with the fleet orchestration instructions.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class FleetStartRequest
+/// The new auth credentials to install on the session. When omitted or `undefined`, the call is a no-op and the session's existing credentials are preserved. The runtime stores the value verbatim and uses it for outbound model/API requests; it does NOT re-validate or re-fetch the associated Copilot user response. Several variants carry secret material; treat this method's params as containing secrets at rest and in transit.
+/// Polymorphic base type discriminated by type.
+[JsonPolymorphic(
+ TypeDiscriminatorPropertyName = "type",
+ UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
+[JsonDerivedType(typeof(AuthInfoHmac), "hmac")]
+[JsonDerivedType(typeof(AuthInfoEnv), "env")]
+[JsonDerivedType(typeof(AuthInfoToken), "token")]
+[JsonDerivedType(typeof(AuthInfoCopilotApiToken), "copilot-api-token")]
+[JsonDerivedType(typeof(AuthInfoUser), "user")]
+[JsonDerivedType(typeof(AuthInfoGhCli), "gh-cli")]
+[JsonDerivedType(typeof(AuthInfoApiKey), "api-key")]
+public partial class AuthInfo
{
- /// Optional user prompt to combine with fleet instructions.
- [JsonPropertyName("prompt")]
- public string? Prompt { get; set; }
-
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// The type discriminator.
+ [JsonPropertyName("type")]
+ public virtual string Type { get; set; } = string.Empty;
}
-/// Schema for the `AgentInfo` type.
-[Experimental(Diagnostics.Experimental)]
-public sealed class AgentInfo
+
+/// Schema for the `CopilotUserResponseEndpoints` type.
+public sealed class CopilotUserResponseEndpoints
{
- /// Description of the agent's purpose.
- [JsonPropertyName("description")]
- public string Description { get; set; } = string.Empty;
+ /// Gets or sets the api value.
+ [JsonPropertyName("api")]
+ public string? Api { get; set; }
- /// Human-readable display name.
- [JsonPropertyName("displayName")]
- public string DisplayName { get; set; } = string.Empty;
+ /// Gets or sets the origin-tracker value.
+ [JsonPropertyName("origin-tracker")]
+ public string? OriginTracker { get; set; }
- /// Unique identifier of the custom agent.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ /// Gets or sets the proxy value.
+ [JsonPropertyName("proxy")]
+ public string? Proxy { get; set; }
- /// Absolute local file path of the agent definition. Only set for file-based agents loaded from disk; remote agents do not have a path.
- [JsonPropertyName("path")]
- public string? Path { get; set; }
+ /// Gets or sets the telemetry value.
+ [JsonPropertyName("telemetry")]
+ public string? Telemetry { get; set; }
}
-/// Custom agents available to the session.
-[Experimental(Diagnostics.Experimental)]
-public sealed class AgentList
+/// RPC data type for CopilotUserResponseOrganizationListItem operations.
+public sealed class CopilotUserResponseOrganizationListItem
{
- /// Available custom agents.
- [JsonPropertyName("agents")]
- public IList Agents { get => field ??= []; set; }
-}
+ /// Gets or sets the login value.
+ [JsonPropertyName("login")]
+ public string? Login { get; set; }
-/// Identifies the target session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionAgentListRequest
-{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Gets or sets the name value.
+ [JsonPropertyName("name")]
+ public string? Name { get; set; }
}
-/// The currently selected custom agent, or null when using the default agent.
-[Experimental(Diagnostics.Experimental)]
-public sealed class AgentGetCurrentResult
+/// Schema for the `CopilotUserResponseQuotaSnapshotsChat` type.
+public sealed class CopilotUserResponseQuotaSnapshotsChat
{
- /// Currently selected custom agent, or null if using the default agent.
- [JsonPropertyName("agent")]
- public AgentInfo? Agent { get; set; }
-}
+ /// Gets or sets the entitlement value.
+ [JsonPropertyName("entitlement")]
+ public double? Entitlement { get; set; }
-/// Identifies the target session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionAgentGetCurrentRequest
-{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-}
+ /// Gets or sets the has_quota value.
+ [JsonPropertyName("has_quota")]
+ public bool? HasQuota { get; set; }
-/// The newly selected custom agent.
-[Experimental(Diagnostics.Experimental)]
-public sealed class AgentSelectResult
-{
- /// The newly selected custom agent.
- [JsonPropertyName("agent")]
- public AgentInfo Agent { get => field ??= new(); set; }
-}
+ /// Gets or sets the overage_count value.
+ [JsonPropertyName("overage_count")]
+ public double? OverageCount { get; set; }
-/// Name of the custom agent to select for subsequent turns.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class AgentSelectRequest
-{
- /// Name of the custom agent to select.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ /// Gets or sets the overage_permitted value.
+ [JsonPropertyName("overage_permitted")]
+ public bool? OveragePermitted { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-}
+ /// Gets or sets the percent_remaining value.
+ [JsonPropertyName("percent_remaining")]
+ public double? PercentRemaining { get; set; }
-/// Identifies the target session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionAgentDeselectRequest
-{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-}
+ /// Gets or sets the quota_id value.
+ [JsonPropertyName("quota_id")]
+ public string? QuotaId { get; set; }
-/// Custom agents available to the session after reloading definitions from disk.
-[Experimental(Diagnostics.Experimental)]
-public sealed class AgentReloadResult
-{
- /// Reloaded custom agents.
- [JsonPropertyName("agents")]
- public IList Agents { get => field ??= []; set; }
-}
+ /// Gets or sets the quota_remaining value.
+ [JsonPropertyName("quota_remaining")]
+ public double? QuotaRemaining { get; set; }
-/// Identifies the target session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionAgentReloadRequest
-{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-}
+ /// Gets or sets the quota_reset_at value.
+ [JsonPropertyName("quota_reset_at")]
+ public double? QuotaResetAt { get; set; }
-/// Identifier assigned to the newly started background agent task.
-[Experimental(Diagnostics.Experimental)]
-public sealed class TasksStartAgentResult
-{
- /// Generated agent ID for the background task.
- [JsonPropertyName("agentId")]
- public string AgentId { get; set; } = string.Empty;
+ /// Gets or sets the remaining value.
+ [JsonPropertyName("remaining")]
+ public double? Remaining { get; set; }
+
+ /// Gets or sets the timestamp_utc value.
+ [JsonPropertyName("timestamp_utc")]
+ public string? TimestampUtc { get; set; }
+
+ /// Gets or sets the token_based_billing value.
+ [JsonPropertyName("token_based_billing")]
+ public bool? TokenBasedBilling { get; set; }
+
+ /// Gets or sets the unlimited value.
+ [JsonPropertyName("unlimited")]
+ public bool? Unlimited { get; set; }
}
-/// Agent type, prompt, name, and optional description and model override for the new task.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class TasksStartAgentRequest
+/// Schema for the `CopilotUserResponseQuotaSnapshotsCompletions` type.
+public sealed class CopilotUserResponseQuotaSnapshotsCompletions
{
- /// Type of agent to start (e.g., 'explore', 'task', 'general-purpose').
- [JsonPropertyName("agentType")]
- public string AgentType { get; set; } = string.Empty;
+ /// Gets or sets the entitlement value.
+ [JsonPropertyName("entitlement")]
+ public double? Entitlement { get; set; }
- /// Short description of the task.
- [JsonPropertyName("description")]
- public string? Description { get; set; }
+ /// Gets or sets the has_quota value.
+ [JsonPropertyName("has_quota")]
+ public bool? HasQuota { get; set; }
- /// Optional model override.
- [JsonPropertyName("model")]
- public string? Model { get; set; }
+ /// Gets or sets the overage_count value.
+ [JsonPropertyName("overage_count")]
+ public double? OverageCount { get; set; }
- /// Short name for the agent, used to generate a human-readable ID.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ /// Gets or sets the overage_permitted value.
+ [JsonPropertyName("overage_permitted")]
+ public bool? OveragePermitted { get; set; }
- /// Task prompt for the agent.
- [JsonPropertyName("prompt")]
- public string Prompt { get; set; } = string.Empty;
+ /// Gets or sets the percent_remaining value.
+ [JsonPropertyName("percent_remaining")]
+ public double? PercentRemaining { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Gets or sets the quota_id value.
+ [JsonPropertyName("quota_id")]
+ public string? QuotaId { get; set; }
+
+ /// Gets or sets the quota_remaining value.
+ [JsonPropertyName("quota_remaining")]
+ public double? QuotaRemaining { get; set; }
+
+ /// Gets or sets the quota_reset_at value.
+ [JsonPropertyName("quota_reset_at")]
+ public double? QuotaResetAt { get; set; }
+
+ /// Gets or sets the remaining value.
+ [JsonPropertyName("remaining")]
+ public double? Remaining { get; set; }
+
+ /// Gets or sets the timestamp_utc value.
+ [JsonPropertyName("timestamp_utc")]
+ public string? TimestampUtc { get; set; }
+
+ /// Gets or sets the token_based_billing value.
+ [JsonPropertyName("token_based_billing")]
+ public bool? TokenBasedBilling { get; set; }
+
+ /// Gets or sets the unlimited value.
+ [JsonPropertyName("unlimited")]
+ public bool? Unlimited { get; set; }
}
-/// Schema for the `TaskInfo` type.
-/// Polymorphic base type discriminated by type.
-[Experimental(Diagnostics.Experimental)]
-[JsonPolymorphic(
- TypeDiscriminatorPropertyName = "type",
- UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
-[JsonDerivedType(typeof(TaskInfoAgent), "agent")]
-[JsonDerivedType(typeof(TaskInfoShell), "shell")]
-public partial class TaskInfo
+/// Schema for the `CopilotUserResponseQuotaSnapshotsPremiumInteractions` type.
+public sealed class CopilotUserResponseQuotaSnapshotsPremiumInteractions
{
- /// The type discriminator.
- [JsonPropertyName("type")]
- public virtual string Type { get; set; } = string.Empty;
-}
+ /// Gets or sets the entitlement value.
+ [JsonPropertyName("entitlement")]
+ public double? Entitlement { get; set; }
+ /// Gets or sets the has_quota value.
+ [JsonPropertyName("has_quota")]
+ public bool? HasQuota { get; set; }
-/// Schema for the `TaskAgentInfo` type.
-/// The agent variant of .
-[Experimental(Diagnostics.Experimental)]
-public partial class TaskInfoAgent : TaskInfo
-{
- ///
- [JsonIgnore]
- public override string Type => "agent";
+ /// Gets or sets the overage_count value.
+ [JsonPropertyName("overage_count")]
+ public double? OverageCount { get; set; }
- /// ISO 8601 timestamp when the current active period began.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("activeStartedAt")]
- public DateTimeOffset? ActiveStartedAt { get; set; }
+ /// Gets or sets the overage_permitted value.
+ [JsonPropertyName("overage_permitted")]
+ public bool? OveragePermitted { get; set; }
- /// Accumulated active execution time in milliseconds.
- [JsonConverter(typeof(MillisecondsTimeSpanConverter))]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("activeTimeMs")]
- public TimeSpan? ActiveTime { get; set; }
+ /// Gets or sets the percent_remaining value.
+ [JsonPropertyName("percent_remaining")]
+ public double? PercentRemaining { get; set; }
- /// Type of agent running this task.
- [JsonPropertyName("agentType")]
- public required string AgentType { get; set; }
+ /// Gets or sets the quota_id value.
+ [JsonPropertyName("quota_id")]
+ public string? QuotaId { get; set; }
- /// Whether the task is currently in the original sync wait and can be moved to background mode. False once it is already backgrounded, idle, finished, or no longer has a promotable sync waiter.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("canPromoteToBackground")]
- public bool? CanPromoteToBackground { get; set; }
+ /// Gets or sets the quota_remaining value.
+ [JsonPropertyName("quota_remaining")]
+ public double? QuotaRemaining { get; set; }
- /// ISO 8601 timestamp when the task finished.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("completedAt")]
- public DateTimeOffset? CompletedAt { get; set; }
+ /// Gets or sets the quota_reset_at value.
+ [JsonPropertyName("quota_reset_at")]
+ public double? QuotaResetAt { get; set; }
- /// Short description of the task.
- [JsonPropertyName("description")]
- public required string Description { get; set; }
+ /// Gets or sets the remaining value.
+ [JsonPropertyName("remaining")]
+ public double? Remaining { get; set; }
- /// Error message when the task failed.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("error")]
- public string? Error { get; set; }
+ /// Gets or sets the timestamp_utc value.
+ [JsonPropertyName("timestamp_utc")]
+ public string? TimestampUtc { get; set; }
- /// Whether task execution is synchronously awaited or managed in the background.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("executionMode")]
- public TaskExecutionMode? ExecutionMode { get; set; }
+ /// Gets or sets the token_based_billing value.
+ [JsonPropertyName("token_based_billing")]
+ public bool? TokenBasedBilling { get; set; }
- /// Unique task identifier.
- [JsonPropertyName("id")]
- public required string Id { get; set; }
+ /// Gets or sets the unlimited value.
+ [JsonPropertyName("unlimited")]
+ public bool? Unlimited { get; set; }
+}
- /// ISO 8601 timestamp when the agent entered idle state.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("idleSince")]
- public DateTimeOffset? IdleSince { get; set; }
+/// Schema for the `CopilotUserResponseQuotaSnapshots` type.
+public sealed class CopilotUserResponseQuotaSnapshots
+{
+ /// Schema for the `CopilotUserResponseQuotaSnapshotsChat` type.
+ [JsonPropertyName("chat")]
+ public CopilotUserResponseQuotaSnapshotsChat? Chat { get; set; }
- /// Most recent response text from the agent.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("latestResponse")]
- public string? LatestResponse { get; set; }
+ /// Schema for the `CopilotUserResponseQuotaSnapshotsCompletions` type.
+ [JsonPropertyName("completions")]
+ public CopilotUserResponseQuotaSnapshotsCompletions? Completions { get; set; }
- /// Model used for the task when specified.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("model")]
- public string? Model { get; set; }
+ /// Schema for the `CopilotUserResponseQuotaSnapshotsPremiumInteractions` type.
+ [JsonPropertyName("premium_interactions")]
+ public CopilotUserResponseQuotaSnapshotsPremiumInteractions? PremiumInteractions { get; set; }
+}
- /// Prompt passed to the agent.
- [JsonPropertyName("prompt")]
- public required string Prompt { get; set; }
+/// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set.
+public sealed class CopilotUserResponse
+{
+ /// Gets or sets the access_type_sku value.
+ [JsonPropertyName("access_type_sku")]
+ public string? AccessTypeSku { get; set; }
- /// Result text from the task when available.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("result")]
- public string? Result { get; set; }
+ /// Gets or sets the analytics_tracking_id value.
+ [JsonPropertyName("analytics_tracking_id")]
+ public string? AnalyticsTrackingId { get; set; }
- /// ISO 8601 timestamp when the task was started.
- [JsonPropertyName("startedAt")]
- public required DateTimeOffset StartedAt { get; set; }
+ /// Gets or sets the assigned_date value.
+ [JsonPropertyName("assigned_date")]
+ public string? AssignedDate { get; set; }
- /// Current lifecycle status of the task.
- [JsonPropertyName("status")]
- public required TaskStatus Status { get; set; }
+ /// Gets or sets the can_signup_for_limited value.
+ [JsonPropertyName("can_signup_for_limited")]
+ public bool? CanSignupForLimited { get; set; }
- /// Tool call ID associated with this agent task.
- [JsonPropertyName("toolCallId")]
- public required string ToolCallId { get; set; }
+ /// Gets or sets the chat_enabled value.
+ [JsonPropertyName("chat_enabled")]
+ public bool? ChatEnabled { get; set; }
+
+ /// Gets or sets the cli_remote_control_enabled value.
+ [JsonPropertyName("cli_remote_control_enabled")]
+ public bool? CliRemoteControlEnabled { get; set; }
+
+ /// Gets or sets the cloud_session_storage_enabled value.
+ [JsonPropertyName("cloud_session_storage_enabled")]
+ public bool? CloudSessionStorageEnabled { get; set; }
+
+ /// Gets or sets the codex_agent_enabled value.
+ [JsonPropertyName("codex_agent_enabled")]
+ public bool? CodexAgentEnabled { get; set; }
+
+ /// Gets or sets the copilot_plan value.
+ [JsonPropertyName("copilot_plan")]
+ public string? CopilotPlan { get; set; }
+
+ /// Gets or sets the copilotignore_enabled value.
+ [JsonPropertyName("copilotignore_enabled")]
+ public bool? CopilotignoreEnabled { get; set; }
+
+ /// Schema for the `CopilotUserResponseEndpoints` type.
+ [JsonPropertyName("endpoints")]
+ public CopilotUserResponseEndpoints? Endpoints { get; set; }
+
+ /// Gets or sets the is_mcp_enabled value.
+ [JsonPropertyName("is_mcp_enabled")]
+ public bool? IsMcpEnabled { get; set; }
+
+ /// Gets or sets the limited_user_quotas value.
+ [JsonPropertyName("limited_user_quotas")]
+ public IDictionary? LimitedUserQuotas { get; set; }
+
+ /// Gets or sets the limited_user_reset_date value.
+ [JsonPropertyName("limited_user_reset_date")]
+ public string? LimitedUserResetDate { get; set; }
+
+ /// Gets or sets the login value.
+ [JsonPropertyName("login")]
+ public string? Login { get; set; }
+
+ /// Gets or sets the monthly_quotas value.
+ [JsonPropertyName("monthly_quotas")]
+ public IDictionary? MonthlyQuotas { get; set; }
+
+ /// Gets or sets the organization_list value.
+ [JsonPropertyName("organization_list")]
+ public IList? OrganizationList { get; set; }
+
+ /// Gets or sets the organization_login_list value.
+ [JsonPropertyName("organization_login_list")]
+ public IList? OrganizationLoginList { get; set; }
+
+ /// Gets or sets the quota_reset_date value.
+ [JsonPropertyName("quota_reset_date")]
+ public string? QuotaResetDate { get; set; }
+
+ /// Gets or sets the quota_reset_date_utc value.
+ [JsonPropertyName("quota_reset_date_utc")]
+ public string? QuotaResetDateUtc { get; set; }
+
+ /// Schema for the `CopilotUserResponseQuotaSnapshots` type.
+ [JsonPropertyName("quota_snapshots")]
+ public CopilotUserResponseQuotaSnapshots? QuotaSnapshots { get; set; }
+
+ /// Gets or sets the restricted_telemetry value.
+ [JsonPropertyName("restricted_telemetry")]
+ public bool? RestrictedTelemetry { get; set; }
+
+ /// Gets or sets the token_based_billing value.
+ [JsonPropertyName("token_based_billing")]
+ public bool? TokenBasedBilling { get; set; }
}
-/// Schema for the `TaskShellInfo` type.
-/// The shell variant of .
-[Experimental(Diagnostics.Experimental)]
-public partial class TaskInfoShell : TaskInfo
+/// Schema for the `HMACAuthInfo` type.
+/// The hmac variant of .
+public partial class AuthInfoHmac : AuthInfo
{
///
[JsonIgnore]
- public override string Type => "shell";
-
- /// Whether the shell runs inside a managed PTY session or as an independent background process.
- [JsonPropertyName("attachmentMode")]
- public required TaskShellInfoAttachmentMode AttachmentMode { get; set; }
+ public override string Type => "hmac";
- /// Whether this shell task can be promoted to background mode.
+ /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("canPromoteToBackground")]
- public bool? CanPromoteToBackground { get; set; }
+ [JsonPropertyName("copilotUser")]
+ public CopilotUserResponse? CopilotUser { get; set; }
- /// Command being executed.
- [JsonPropertyName("command")]
- public required string Command { get; set; }
+ /// HMAC secret used to sign requests.
+ [JsonPropertyName("hmac")]
+ public required string Hmac { get; set; }
- /// ISO 8601 timestamp when the task finished.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("completedAt")]
- public DateTimeOffset? CompletedAt { get; set; }
+ /// Authentication host. HMAC auth always targets the public GitHub host.
+ [JsonPropertyName("host")]
+ public required string Host { get; set; }
+}
- /// Short description of the task.
- [JsonPropertyName("description")]
- public required string Description { get; set; }
+/// Schema for the `EnvAuthInfo` type.
+/// The env variant of .
+public partial class AuthInfoEnv : AuthInfo
+{
+ ///
+ [JsonIgnore]
+ public override string Type => "env";
- /// Whether task execution is synchronously awaited or managed in the background.
+ /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("executionMode")]
- public TaskExecutionMode? ExecutionMode { get; set; }
+ [JsonPropertyName("copilotUser")]
+ public CopilotUserResponse? CopilotUser { get; set; }
- /// Unique task identifier.
- [JsonPropertyName("id")]
- public required string Id { get; set; }
+ /// Name of the environment variable the token was sourced from.
+ [JsonPropertyName("envVar")]
+ public required string EnvVar { get; set; }
- /// Path to the detached shell log, when available.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("logPath")]
- public string? LogPath { get; set; }
+ /// Authentication host (e.g. https://github.com or a GHES host).
+ [JsonPropertyName("host")]
+ public required string Host { get; set; }
- /// Process ID when available.
+ /// User login associated with the token. Undefined for server-to-server tokens (those starting with `ghs_`).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("pid")]
- public long? Pid { get; set; }
-
- /// ISO 8601 timestamp when the task was started.
- [JsonPropertyName("startedAt")]
- public required DateTimeOffset StartedAt { get; set; }
+ [JsonPropertyName("login")]
+ public string? Login { get; set; }
- /// Current lifecycle status of the task.
- [JsonPropertyName("status")]
- public required TaskStatus Status { get; set; }
+ /// The token value itself. Treat as a secret.
+ [JsonPropertyName("token")]
+ public required string Token { get; set; }
}
-/// Background tasks currently tracked by the session.
-[Experimental(Diagnostics.Experimental)]
-public sealed class TaskList
+/// Schema for the `TokenAuthInfo` type.
+/// The token variant of .
+public partial class AuthInfoToken : AuthInfo
{
- /// Currently tracked tasks.
- [JsonPropertyName("tasks")]
- public IList Tasks { get => field ??= []; set; }
-}
+ ///
+ [JsonIgnore]
+ public override string Type => "token";
-/// Identifies the target session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionTasksListRequest
-{
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-}
+ /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("copilotUser")]
+ public CopilotUserResponse? CopilotUser { get; set; }
-/// Indicates whether the task was successfully promoted to background mode.
-[Experimental(Diagnostics.Experimental)]
-public sealed class TasksPromoteToBackgroundResult
-{
- /// Whether the task was successfully promoted to background mode.
- [JsonPropertyName("promoted")]
- public bool Promoted { get; set; }
+ /// Authentication host.
+ [JsonPropertyName("host")]
+ public required string Host { get; set; }
+
+ /// The token value itself. Treat as a secret.
+ [JsonPropertyName("token")]
+ public required string Token { get; set; }
}
-/// Identifier of the task to promote to background mode.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class TasksPromoteToBackgroundRequest
+/// Schema for the `CopilotApiTokenAuthInfo` type.
+/// The copilot-api-token variant of .
+public partial class AuthInfoCopilotApiToken : AuthInfo
{
- /// Task identifier.
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
+ ///
+ [JsonIgnore]
+ public override string Type => "copilot-api-token";
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("copilotUser")]
+ public CopilotUserResponse? CopilotUser { get; set; }
+
+ /// Authentication host (always the public GitHub host).
+ [JsonPropertyName("host")]
+ public required string Host { get; set; }
}
-/// Indicates whether the background task was successfully cancelled.
-[Experimental(Diagnostics.Experimental)]
-public sealed class TasksCancelResult
+/// Schema for the `UserAuthInfo` type.
+/// The user variant of .
+public partial class AuthInfoUser : AuthInfo
{
- /// Whether the task was successfully cancelled.
- [JsonPropertyName("cancelled")]
- public bool Cancelled { get; set; }
+ ///
+ [JsonIgnore]
+ public override string Type => "user";
+
+ /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("copilotUser")]
+ public CopilotUserResponse? CopilotUser { get; set; }
+
+ /// Authentication host.
+ [JsonPropertyName("host")]
+ public required string Host { get; set; }
+
+ /// OAuth user login.
+ [JsonPropertyName("login")]
+ public required string Login { get; set; }
}
-/// Identifier of the background task to cancel.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class TasksCancelRequest
+/// Schema for the `GhCliAuthInfo` type.
+/// The gh-cli variant of .
+public partial class AuthInfoGhCli : AuthInfo
{
- /// Task identifier.
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
+ ///
+ [JsonIgnore]
+ public override string Type => "gh-cli";
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("copilotUser")]
+ public CopilotUserResponse? CopilotUser { get; set; }
+
+ /// Authentication host.
+ [JsonPropertyName("host")]
+ public required string Host { get; set; }
+
+ /// User login as reported by `gh auth status`.
+ [JsonPropertyName("login")]
+ public required string Login { get; set; }
+
+ /// The token returned by `gh auth token`. Treat as a secret.
+ [JsonPropertyName("token")]
+ public required string Token { get; set; }
}
-/// Indicates whether the task was removed. False when the task does not exist or is still running/idle.
-[Experimental(Diagnostics.Experimental)]
-public sealed class TasksRemoveResult
+/// Schema for the `ApiKeyAuthInfo` type.
+/// The api-key variant of .
+public partial class AuthInfoApiKey : AuthInfo
{
- /// Whether the task was removed. Returns false if the task does not exist or is still running/idle (cancel it first).
- [JsonPropertyName("removed")]
- public bool Removed { get; set; }
+ ///
+ [JsonIgnore]
+ public override string Type => "api-key";
+
+ /// The API key. Treat as a secret.
+ [JsonPropertyName("apiKey")]
+ public required string ApiKey { get; set; }
+
+ /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("copilotUser")]
+ public CopilotUserResponse? CopilotUser { get; set; }
+
+ /// Authentication host.
+ [JsonPropertyName("host")]
+ public required string Host { get; set; }
}
-/// Identifier of the completed or cancelled task to remove from tracking.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class TasksRemoveRequest
+/// New auth credentials to install on the session. Omit to leave credentials unchanged.
+internal sealed class SessionSetCredentialsParams
{
- /// Task identifier.
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
+ /// The new auth credentials to install on the session. When omitted or `undefined`, the call is a no-op and the session's existing credentials are preserved. The runtime stores the value verbatim and uses it for outbound model/API requests; it does NOT re-validate or re-fetch the associated Copilot user response. Several variants carry secret material; treat this method's params as containing secrets at rest and in transit.
+ [JsonPropertyName("credentials")]
+ public AuthInfo? Credentials { get; set; }
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the message was delivered, with an error message when delivery failed.
-[Experimental(Diagnostics.Experimental)]
-public sealed class TasksSendMessageResult
+/// The currently selected model and reasoning effort for the session.
+public sealed class CurrentModel
{
- /// Error message if delivery failed.
- [JsonPropertyName("error")]
- public string? Error { get; set; }
+ /// Currently active model identifier.
+ [JsonPropertyName("modelId")]
+ public string? ModelId { get; set; }
- /// Whether the message was successfully delivered or steered.
- [JsonPropertyName("sent")]
- public bool Sent { get; set; }
+ /// Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot.
+ [JsonPropertyName("reasoningEffort")]
+ public string? ReasoningEffort { get; set; }
}
-/// Identifier of the target agent task, message content, and optional sender agent ID.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class TasksSendMessageRequest
+/// Identifies the target session.
+internal sealed class SessionModelGetCurrentRequest
{
- /// Agent ID of the sender, if sent on behalf of another agent.
- [JsonPropertyName("fromAgentId")]
- public string? FromAgentId { get; set; }
-
- /// Agent task identifier.
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
-
- /// Message content to send to the agent.
- [JsonPropertyName("message")]
- public string Message { get; set; } = string.Empty;
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Schema for the `Skill` type.
-[Experimental(Diagnostics.Experimental)]
-public sealed class Skill
+/// The model identifier active on the session after the switch.
+public sealed class ModelSwitchToResult
{
- /// Description of what the skill does.
- [JsonPropertyName("description")]
- public string Description { get; set; } = string.Empty;
+ /// Currently active model identifier after the switch.
+ [JsonPropertyName("modelId")]
+ public string? ModelId { get; set; }
+}
- /// Whether the skill is currently enabled.
- [JsonPropertyName("enabled")]
- public bool Enabled { get; set; }
+/// Vision-specific limits.
+public sealed class ModelCapabilitiesOverrideLimitsVision
+{
+ /// Maximum image size in bytes.
+ [Range((double)0, (double)long.MaxValue)]
+ [JsonPropertyName("max_prompt_image_size")]
+ public long? MaxPromptImageSize { get; set; }
- /// Unique identifier for the skill.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ /// Maximum number of images per prompt.
+ [Range((double)1, (double)long.MaxValue)]
+ [JsonPropertyName("max_prompt_images")]
+ public long? MaxPromptImages { get; set; }
- /// Absolute path to the skill file.
- [JsonPropertyName("path")]
- public string? Path { get; set; }
+ /// MIME types the model accepts.
+ [JsonPropertyName("supported_media_types")]
+ public IList? SupportedMediaTypes { get; set; }
+}
- /// Source location type (e.g., project, personal-copilot, plugin, builtin).
- [JsonPropertyName("source")]
- public SkillSource Source { get; set; }
+/// Token limits for prompts, outputs, and context window.
+public sealed class ModelCapabilitiesOverrideLimits
+{
+ /// Maximum total context window size in tokens.
+ [Range((double)0, (double)long.MaxValue)]
+ [JsonPropertyName("max_context_window_tokens")]
+ public long? MaxContextWindowTokens { get; set; }
- /// Whether the skill can be invoked by the user as a slash command.
- [JsonPropertyName("userInvocable")]
- public bool UserInvocable { get; set; }
+ /// Maximum number of output/completion tokens.
+ [Range((double)0, (double)long.MaxValue)]
+ [JsonPropertyName("max_output_tokens")]
+ public long? MaxOutputTokens { get; set; }
+
+ /// Maximum number of prompt/input tokens.
+ [Range((double)0, (double)long.MaxValue)]
+ [JsonPropertyName("max_prompt_tokens")]
+ public long? MaxPromptTokens { get; set; }
+
+ /// Vision-specific limits.
+ [JsonPropertyName("vision")]
+ public ModelCapabilitiesOverrideLimitsVision? Vision { get; set; }
}
-/// Skills available to the session, with their enabled state.
-[Experimental(Diagnostics.Experimental)]
-public sealed class SkillList
+/// Feature flags indicating what the model supports.
+public sealed class ModelCapabilitiesOverrideSupports
{
- /// Available skills.
- [JsonPropertyName("skills")]
- public IList Skills { get => field ??= []; set; }
+ /// Whether this model supports reasoning effort configuration.
+ [JsonPropertyName("reasoningEffort")]
+ public bool? ReasoningEffort { get; set; }
+
+ /// Whether this model supports vision/image input.
+ [JsonPropertyName("vision")]
+ public bool? Vision { get; set; }
}
-/// Identifies the target session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionSkillsListRequest
+/// Override individual model capabilities resolved by the runtime.
+public sealed class ModelCapabilitiesOverride
+{
+ /// Token limits for prompts, outputs, and context window.
+ [JsonPropertyName("limits")]
+ public ModelCapabilitiesOverrideLimits? Limits { get; set; }
+
+ /// Feature flags indicating what the model supports.
+ [JsonPropertyName("supports")]
+ public ModelCapabilitiesOverrideSupports? Supports { get; set; }
+}
+
+/// Target model identifier and optional reasoning effort, summary, and capability overrides.
+internal sealed class ModelSwitchToRequest
{
+ /// Override individual model capabilities resolved by the runtime.
+ [JsonPropertyName("modelCapabilities")]
+ public ModelCapabilitiesOverride? ModelCapabilities { get; set; }
+
+ /// Model identifier to switch to.
+ [JsonPropertyName("modelId")]
+ public string ModelId { get; set; } = string.Empty;
+
+ /// Reasoning effort level to use for the model. "none" disables reasoning.
+ [JsonPropertyName("reasoningEffort")]
+ public string? ReasoningEffort { get; set; }
+
+ /// Reasoning summary mode to request for supported model clients.
+ [JsonPropertyName("reasoningSummary")]
+ public ReasoningSummary? ReasoningSummary { get; set; }
+
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Name of the skill to enable for the session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SkillsEnableRequest
+/// Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns.
+public sealed class ModelSetReasoningEffortResult
{
- /// Name of the skill to enable.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ /// Reasoning effort level recorded on the session after the update.
+ [JsonPropertyName("reasoningEffort")]
+ public string ReasoningEffort { get; set; } = string.Empty;
+}
+
+/// Reasoning effort level to apply to the currently selected model.
+internal sealed class ModelSetReasoningEffortRequest
+{
+ /// Reasoning effort level to apply to the currently selected model. The host is responsible for validating the value against the model's supported levels before calling.
+ [JsonPropertyName("reasoningEffort")]
+ public string ReasoningEffort { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Name of the skill to disable for the session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SkillsDisableRequest
+/// Identifies the target session.
+internal sealed class SessionModeGetRequest
{
- /// Name of the skill to disable.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Diagnostics from reloading skill definitions, with warnings and errors as separate lists.
-[Experimental(Diagnostics.Experimental)]
-public sealed class SkillsLoadDiagnostics
+/// Agent interaction mode to apply to the session.
+internal sealed class ModeSetRequest
{
- /// Errors emitted while loading skills (e.g. skills that failed to load entirely).
- [JsonPropertyName("errors")]
- public IList Errors { get => field ??= []; set; }
+ /// The session mode the agent is operating in.
+ [JsonPropertyName("mode")]
+ public SessionMode Mode { get; set; }
- /// Warnings emitted while loading skills (e.g. skills that loaded but had issues).
- [JsonPropertyName("warnings")]
- public IList Warnings { get => field ??= []; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
+
+/// The session's friendly name, or null when not yet set.
+public sealed class NameGetResult
+{
+ /// The session name (user-set or auto-generated), or null if not yet set.
+ [JsonPropertyName("name")]
+ public string? Name { get; set; }
}
/// Identifies the target session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionSkillsReloadRequest
+internal sealed class SessionNameGetRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Schema for the `McpServer` type.
-[Experimental(Diagnostics.Experimental)]
-public sealed class McpServer
+/// New friendly name to apply to the session.
+internal sealed class NameSetRequest
{
- /// Error message if the server failed to connect.
- [JsonPropertyName("error")]
- public string? Error { get; set; }
-
- /// Server name (config key).
- [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
+ /// New session name (1–100 characters, trimmed of leading/trailing whitespace).
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
[MinLength(1)]
+ [MaxLength(100)]
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
- /// Configuration source: user, workspace, plugin, or builtin.
- [JsonPropertyName("source")]
- public McpServerSource? Source { get; set; }
-
- /// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured.
- [JsonPropertyName("status")]
- public McpServerStatus Status { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// MCP servers configured for the session, with their connection status.
-[Experimental(Diagnostics.Experimental)]
-public sealed class McpServerList
+/// Indicates whether the auto-generated summary was applied as the session's name.
+public sealed class NameSetAutoResult
{
- /// Configured MCP servers.
- [JsonPropertyName("servers")]
- public IList Servers { get => field ??= []; set; }
+ /// Whether the auto-generated summary was persisted. False if the session already has a user-set name, the summary normalized to empty, or the session does not have a workspace.
+ [JsonPropertyName("applied")]
+ public bool Applied { get; set; }
}
-/// Identifies the target session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionMcpListRequest
+/// Auto-generated session summary to apply as the session's name when no user-set name exists.
+internal sealed class NameSetAutoRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
+
+ /// Auto-generated session summary. Empty/whitespace-only values are ignored; values are trimmed before persisting.
+ [JsonPropertyName("summary")]
+ public string Summary { get; set; } = string.Empty;
}
-/// Name of the MCP server to enable for the session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class McpEnableRequest
+/// Existence, contents, and resolved path of the session plan file.
+public sealed class PlanReadResult
{
- /// Name of the MCP server to enable.
- [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
- [JsonPropertyName("serverName")]
- public string ServerName { get; set; } = string.Empty;
+ /// The content of the plan file, or null if it does not exist.
+ [JsonPropertyName("content")]
+ public string? Content { get; set; }
+
+ /// Whether the plan file exists in the workspace.
+ [JsonPropertyName("exists")]
+ public bool Exists { get; set; }
+
+ /// Absolute file path of the plan file, or null if workspace is not enabled.
+ [JsonPropertyName("path")]
+ public string? Path { get; set; }
+}
+/// Identifies the target session.
+internal sealed class SessionPlanReadRequest
+{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Name of the MCP server to disable for the session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class McpDisableRequest
+/// Replacement contents to write to the session plan file.
+internal sealed class PlanUpdateRequest
{
- /// Name of the MCP server to disable.
- [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
- [JsonPropertyName("serverName")]
- public string ServerName { get; set; } = string.Empty;
+ /// The new content for the plan file.
+ [JsonPropertyName("content")]
+ public string Content { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
@@ -1738,1286 +2227,1087 @@ internal sealed class McpDisableRequest
}
/// Identifies the target session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionMcpReloadRequest
+internal sealed class SessionPlanDeleteRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server.
-[Experimental(Diagnostics.Experimental)]
-public sealed class McpOauthLoginResult
-{
- /// URL the caller should open in a browser to complete OAuth. Omitted when cached tokens were still valid and no browser interaction was needed — the server is already reconnected in that case. When present, the runtime starts the callback listener before returning and continues the flow in the background; completion is signaled via session.mcp_server_status_changed.
- [Url]
- [StringSyntax(StringSyntaxAttribute.Uri)]
- [JsonPropertyName("authorizationUrl")]
- public string? AuthorizationUrl { get; set; }
-}
-
-/// Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class McpOauthLoginRequest
+/// RPC data type for WorkspacesGetWorkspaceResultWorkspace operations.
+public sealed class WorkspacesGetWorkspaceResultWorkspace
{
- /// Optional override for the body text shown on the OAuth loopback callback success page. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass surface-specific copy telling the user where to return.
- [JsonPropertyName("callbackSuccessMessage")]
- public string? CallbackSuccessMessage { get; set; }
+ /// Gets or sets the branch value.
+ [JsonPropertyName("branch")]
+ public string? Branch { get; set; }
- /// Optional override for the OAuth client display name shown on the consent screen. Applies to newly registered dynamic clients only — existing registrations keep the name they were created with. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass their own surface-specific label so the consent screen matches the product the user sees.
- [JsonPropertyName("clientName")]
- public string? ClientName { get; set; }
+ /// Gets or sets the chronicle_sync_dismissed value.
+ [JsonPropertyName("chronicle_sync_dismissed")]
+ public bool? ChronicleSyncDismissed { get; set; }
- /// When true, clears any cached OAuth token for the server and runs a full new authorization. Use when the user explicitly wants to switch accounts or believes their session is stuck.
- [JsonPropertyName("forceReauth")]
- public bool? ForceReauth { get; set; }
+ /// Gets or sets the created_at value.
+ [JsonPropertyName("created_at")]
+ public DateTimeOffset? CreatedAt { get; set; }
- /// Name of the remote MCP server to authenticate.
- [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
- [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
- [MinLength(1)]
- [JsonPropertyName("serverName")]
- public string ServerName { get; set; } = string.Empty;
+ /// Gets or sets the cwd value.
+ [JsonPropertyName("cwd")]
+ public string? Cwd { get; set; }
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
-}
+ /// Gets or sets the git_root value.
+ [JsonPropertyName("git_root")]
+ public string? GitRoot { get; set; }
-/// Schema for the `Plugin` type.
-[Experimental(Diagnostics.Experimental)]
-public sealed class Plugin
-{
- /// Whether the plugin is currently enabled.
- [JsonPropertyName("enabled")]
- public bool Enabled { get; set; }
+ /// Gets or sets the host_type value.
+ [JsonPropertyName("host_type")]
+ public WorkspacesGetWorkspaceResultWorkspaceHostType? HostType { get; set; }
- /// Marketplace the plugin came from.
- [JsonPropertyName("marketplace")]
- public string Marketplace { get; set; } = string.Empty;
+ /// Gets or sets the id value.
+ [JsonPropertyName("id")]
+ public Guid Id { get; set; }
- /// Plugin name.
+ /// Gets or sets the mc_last_event_id value.
+ [JsonPropertyName("mc_last_event_id")]
+ public string? McLastEventId { get; set; }
+
+ /// Gets or sets the mc_session_id value.
+ [JsonPropertyName("mc_session_id")]
+ public string? McSessionId { get; set; }
+
+ /// Gets or sets the mc_task_id value.
+ [JsonPropertyName("mc_task_id")]
+ public string? McTaskId { get; set; }
+
+ /// Gets or sets the name value.
[JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ public string? Name { get; set; }
- /// Installed version.
- [JsonPropertyName("version")]
- public string? Version { get; set; }
+ /// Gets or sets the remote_steerable value.
+ [JsonPropertyName("remote_steerable")]
+ public bool? RemoteSteerable { get; set; }
+
+ /// Gets or sets the repository value.
+ [JsonPropertyName("repository")]
+ public string? Repository { get; set; }
+
+ /// Gets or sets the summary_count value.
+ [Range((double)0, (double)long.MaxValue)]
+ [JsonPropertyName("summary_count")]
+ public long? SummaryCount { get; set; }
+
+ /// Gets or sets the updated_at value.
+ [JsonPropertyName("updated_at")]
+ public DateTimeOffset? UpdatedAt { get; set; }
+
+ /// Gets or sets the user_named value.
+ [JsonPropertyName("user_named")]
+ public bool? UserNamed { get; set; }
}
-/// Plugins installed for the session, with their enabled state and version metadata.
-[Experimental(Diagnostics.Experimental)]
-public sealed class PluginList
+/// Current workspace metadata for the session, including its absolute filesystem path when available.
+public sealed class WorkspacesGetWorkspaceResult
{
- /// Installed plugins.
- [JsonPropertyName("plugins")]
- public IList Plugins { get => field ??= []; set; }
+ /// Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions).
+ [JsonPropertyName("path")]
+ public string? Path { get; set; }
+
+ /// Current workspace metadata, or null if not available.
+ [JsonPropertyName("workspace")]
+ public WorkspacesGetWorkspaceResultWorkspace? Workspace { get; set; }
}
/// Identifies the target session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionPluginsListRequest
+internal sealed class SessionWorkspacesGetWorkspaceRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Schema for the `Extension` type.
-[Experimental(Diagnostics.Experimental)]
-public sealed class Extension
-{
- /// Source-qualified ID (e.g., 'project:my-ext', 'user:auth-helper').
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
-
- /// Extension name (directory name).
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
-
- /// Process ID if the extension is running.
- [JsonPropertyName("pid")]
- public long? Pid { get; set; }
-
- /// Discovery source: project (.github/extensions/) or user (~/.copilot/extensions/).
- [JsonPropertyName("source")]
- public ExtensionSource Source { get; set; }
-
- /// Current status: running, disabled, failed, or starting.
- [JsonPropertyName("status")]
- public ExtensionStatus Status { get; set; }
-}
-
-/// Extensions discovered for the session, with their current status.
-[Experimental(Diagnostics.Experimental)]
-public sealed class ExtensionList
+/// Relative paths of files stored in the session workspace files directory.
+public sealed class WorkspacesListFilesResult
{
- /// Discovered extensions and their current status.
- [JsonPropertyName("extensions")]
- public IList Extensions { get => field ??= []; set; }
+ /// Relative file paths in the workspace files directory.
+ [JsonPropertyName("files")]
+ public IList Files { get => field ??= []; set; }
}
/// Identifies the target session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionExtensionsListRequest
+internal sealed class SessionWorkspacesListFilesRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Source-qualified extension identifier to enable for the session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class ExtensionsEnableRequest
+/// Contents of the requested workspace file as a UTF-8 string.
+public sealed class WorkspacesReadFileResult
{
- /// Source-qualified extension ID to enable.
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
+ /// File content as a UTF-8 string.
+ [JsonPropertyName("content")]
+ public string Content { get; set; } = string.Empty;
+}
+
+/// Relative path of the workspace file to read.
+internal sealed class WorkspacesReadFileRequest
+{
+ /// Relative path within the workspace files directory.
+ [JsonPropertyName("path")]
+ public string Path { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Source-qualified extension identifier to disable for the session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class ExtensionsDisableRequest
+/// Relative path and UTF-8 content for the workspace file to create or overwrite.
+internal sealed class WorkspacesCreateFileRequest
{
- /// Source-qualified extension ID to disable.
- [JsonPropertyName("id")]
- public string Id { get; set; } = string.Empty;
+ /// File content to write as a UTF-8 string.
+ [JsonPropertyName("content")]
+ public string Content { get; set; } = string.Empty;
+
+ /// Relative path within the workspace files directory.
+ [JsonPropertyName("path")]
+ public string Path { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
+/// Schema for the `WorkspacesCheckpoints` type.
+public sealed class WorkspacesCheckpoints
+{
+ /// Filename of the checkpoint within the workspace checkpoints directory.
+ [JsonPropertyName("filename")]
+ public string Filename { get; set; } = string.Empty;
+
+ /// Checkpoint number assigned by the workspace manager.
+ [Range((double)0, (double)long.MaxValue)]
+ [JsonPropertyName("number")]
+ public long Number { get; set; }
+
+ /// Human-readable checkpoint title.
+ [JsonPropertyName("title")]
+ public string Title { get; set; } = string.Empty;
+}
+
+/// Workspace checkpoints in chronological order; empty when the workspace is not enabled.
+public sealed class WorkspacesListCheckpointsResult
+{
+ /// Workspace checkpoints in chronological order. Empty when workspace is not enabled.
+ [JsonPropertyName("checkpoints")]
+ public IList Checkpoints { get => field ??= []; set; }
+}
+
/// Identifies the target session.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionExtensionsReloadRequest
+internal sealed class SessionWorkspacesListCheckpointsRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the external tool call result was handled successfully.
-public sealed class HandlePendingToolCallResult
+/// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing.
+public sealed class WorkspacesReadCheckpointResult
{
- /// Whether the tool call result was handled successfully.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
+ /// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing.
+ [JsonPropertyName("content")]
+ public string? Content { get; set; }
}
-/// Pending external tool call request ID, with the tool result or an error describing why it failed.
-internal sealed class HandlePendingToolCallRequest
+/// Checkpoint number to read.
+internal sealed class WorkspacesReadCheckpointRequest
{
- /// Error message if the tool call failed.
- [JsonPropertyName("error")]
- public string? Error { get; set; }
-
- /// Request ID of the pending tool call.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
-
- /// Tool call result (string or expanded result object).
- [JsonPropertyName("result")]
- public object? Result { get; set; }
+ /// Checkpoint number to read.
+ [Range((double)0, (double)long.MaxValue)]
+ [JsonPropertyName("number")]
+ public long Number { get; set; }
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Optional unstructured input hint.
-public sealed class SlashCommandInput
+/// RPC data type for WorkspacesSaveLargePasteResultSaved operations.
+public sealed class WorkspacesSaveLargePasteResultSaved
{
- /// Optional completion hint for the input (e.g. 'directory' for filesystem path completion).
- [JsonPropertyName("completion")]
- public SlashCommandInputCompletion? Completion { get; set; }
-
- /// Hint to display when command input has not been provided.
- [JsonPropertyName("hint")]
- public string Hint { get; set; } = string.Empty;
+ /// Filename within the workspace files directory.
+ [JsonPropertyName("filename")]
+ public string Filename { get; set; } = string.Empty;
- /// When true, clients should pass the full text after the command name as a single argument rather than splitting on whitespace.
- [JsonPropertyName("preserveMultilineInput")]
- public bool? PreserveMultilineInput { get; set; }
+ /// Absolute filesystem path to the saved paste file.
+ [JsonPropertyName("filePath")]
+ public string FilePath { get; set; } = string.Empty;
- /// When true, the command requires non-empty input; clients should render the input hint as required.
- [JsonPropertyName("required")]
- public bool? Required { get; set; }
+ /// Size of the saved file in bytes.
+ [Range((double)0, (double)long.MaxValue)]
+ [JsonPropertyName("sizeBytes")]
+ public long SizeBytes { get; set; }
}
-/// Schema for the `SlashCommandInfo` type.
-public sealed class SlashCommandInfo
+/// Descriptor for the saved paste file, or null when the workspace is unavailable.
+public sealed class WorkspacesSaveLargePasteResult
{
- /// Canonical aliases without leading slashes.
- [JsonPropertyName("aliases")]
- public IList? Aliases { get; set; }
+ /// Saved-paste descriptor, or null when the workspace is unavailable (e.g. CCA runtime, non-infinite sessions, remote sessions).
+ [JsonPropertyName("saved")]
+ public WorkspacesSaveLargePasteResultSaved? Saved { get; set; }
+}
- /// Whether the command may run while an agent turn is active.
- [JsonPropertyName("allowDuringAgentExecution")]
- public bool AllowDuringAgentExecution { get; set; }
+/// Pasted content to save as a UTF-8 file in the session workspace.
+internal sealed class WorkspacesSaveLargePasteRequest
+{
+ /// Pasted content to save as a UTF-8 file.
+ [JsonPropertyName("content")]
+ public string Content { get; set; } = string.Empty;
- /// Human-readable command description.
- [JsonPropertyName("description")]
- public string Description { get; set; } = string.Empty;
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// Whether the command is experimental.
- [JsonPropertyName("experimental")]
- public bool? Experimental { get; set; }
+/// Schema for the `InstructionsSources` type.
+public sealed class InstructionsSources
+{
+ /// Glob pattern(s) from frontmatter — when set, this instruction applies only to matching files.
+ [JsonPropertyName("applyTo")]
+ public IList? ApplyTo { get; set; }
- /// Optional unstructured input hint.
- [JsonPropertyName("input")]
- public SlashCommandInput? Input { get; set; }
+ /// Raw content of the instruction file.
+ [JsonPropertyName("content")]
+ public string Content { get; set; } = string.Empty;
- /// Coarse command category for grouping and behavior: runtime built-in, skill-backed command, or SDK/client-owned command.
- [JsonPropertyName("kind")]
- public SlashCommandKind Kind { get; set; }
+ /// When true, this source starts disabled and must be toggled on by the user.
+ [JsonPropertyName("defaultDisabled")]
+ public bool? DefaultDisabled { get; set; }
- /// Canonical command name without a leading slash.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
-}
+ /// Short description (body after frontmatter) for use in instruction tables.
+ [JsonPropertyName("description")]
+ public string? Description { get; set; }
-/// Slash commands available in the session, after applying any include/exclude filters.
-public sealed class CommandList
-{
- /// Commands available in this session.
- [JsonPropertyName("commands")]
- public IList Commands { get => field ??= []; set; }
-}
+ /// Unique identifier for this source (used for toggling).
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
-/// Optional filters controlling which command sources to include in the listing.
-public sealed class CommandsListRequest
-{
- /// Include runtime built-in commands.
- [JsonPropertyName("includeBuiltins")]
- public bool? IncludeBuiltins { get; set; }
+ /// Human-readable label.
+ [JsonPropertyName("label")]
+ public string Label { get; set; } = string.Empty;
- /// Include commands registered by protocol clients, including SDK clients and extensions.
- [JsonPropertyName("includeClientCommands")]
- public bool? IncludeClientCommands { get; set; }
+ /// Where this source lives — used for UI grouping.
+ [JsonPropertyName("location")]
+ public InstructionsSourcesLocation Location { get; set; }
- /// Include enabled user-invocable skills and commands.
- [JsonPropertyName("includeSkills")]
- public bool? IncludeSkills { get; set; }
+ /// File path relative to repo or absolute for home.
+ [JsonPropertyName("sourcePath")]
+ public string SourcePath { get; set; } = string.Empty;
+
+ /// Category of instruction source — used for merge logic.
+ [JsonPropertyName("type")]
+ public InstructionsSourcesType Type { get; set; }
}
-/// Optional filters controlling which command sources to include in the listing.
-internal sealed class CommandsListRequestWithSession
+/// Instruction sources loaded for the session, in merge order.
+public sealed class InstructionsGetSourcesResult
{
- /// Include runtime built-in commands.
- [JsonPropertyName("includeBuiltins")]
- public bool? IncludeBuiltins { get; set; }
-
- /// Include commands registered by protocol clients, including SDK clients and extensions.
- [JsonPropertyName("includeClientCommands")]
- public bool? IncludeClientCommands { get; set; }
-
- /// Include enabled user-invocable skills and commands.
- [JsonPropertyName("includeSkills")]
- public bool? IncludeSkills { get; set; }
+ /// Instruction sources for the session.
+ [JsonPropertyName("sources")]
+ public IList Sources { get => field ??= []; set; }
+}
+/// Identifies the target session.
+internal sealed class SessionInstructionsGetSourcesRequest
+{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Result of invoking the slash command (text output, prompt to send to the agent, or completion).
-/// Polymorphic base type discriminated by kind.
-[JsonPolymorphic(
- TypeDiscriminatorPropertyName = "kind",
- UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
-[JsonDerivedType(typeof(SlashCommandInvocationResultText), "text")]
-[JsonDerivedType(typeof(SlashCommandInvocationResultAgentPrompt), "agent-prompt")]
-[JsonDerivedType(typeof(SlashCommandInvocationResultCompleted), "completed")]
-public partial class SlashCommandInvocationResult
+/// Indicates whether fleet mode was successfully activated.
+[Experimental(Diagnostics.Experimental)]
+public sealed class FleetStartResult
{
- /// The type discriminator.
- [JsonPropertyName("kind")]
- public virtual string Kind { get; set; } = string.Empty;
+ /// Whether fleet mode was successfully activated.
+ [JsonPropertyName("started")]
+ public bool Started { get; set; }
}
-
-/// Schema for the `SlashCommandTextResult` type.
-/// The text variant of .
-public partial class SlashCommandInvocationResultText : SlashCommandInvocationResult
+/// Optional user prompt to combine with the fleet orchestration instructions.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class FleetStartRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "text";
+ /// Optional user prompt to combine with fleet instructions.
+ [JsonPropertyName("prompt")]
+ public string? Prompt { get; set; }
- /// Whether text contains Markdown.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("markdown")]
- public bool? Markdown { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// Whether ANSI sequences should be preserved.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("preserveAnsi")]
- public bool? PreserveAnsi { get; set; }
+/// Schema for the `AgentInfo` type.
+[Experimental(Diagnostics.Experimental)]
+public sealed class AgentInfo
+{
+ /// Description of the agent's purpose.
+ [JsonPropertyName("description")]
+ public string Description { get; set; } = string.Empty;
- /// True when the invocation mutated user runtime settings; consumers caching settings should refresh.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("runtimeSettingsChanged")]
- public bool? RuntimeSettingsChanged { get; set; }
+ /// Human-readable display name.
+ [JsonPropertyName("displayName")]
+ public string DisplayName { get; set; } = string.Empty;
- /// Text output for the client to render.
- [JsonPropertyName("text")]
- public required string Text { get; set; }
-}
+ /// Stable identifier for selection. For most agents this is the same as `name`; for plugin/builtin agents it may differ. Always populated; defaults to `name` when no distinct id was assigned.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
-/// Schema for the `SlashCommandAgentPromptResult` type.
-/// The agent-prompt variant of .
-public partial class SlashCommandInvocationResultAgentPrompt : SlashCommandInvocationResult
-{
- ///
- [JsonIgnore]
- public override string Kind => "agent-prompt";
+ /// MCP server configurations attached to this agent, keyed by server name. Server config shape mirrors the MCP `mcpServers` schema.
+ [JsonPropertyName("mcpServers")]
+ public IDictionary? McpServers { get; set; }
- /// Prompt text to display to the user.
- [JsonPropertyName("displayPrompt")]
- public required string DisplayPrompt { get; set; }
+ /// Preferred model id for this agent. When omitted, inherits the outer agent's model.
+ [JsonPropertyName("model")]
+ public string? Model { get; set; }
- /// Optional target session mode for the agent prompt.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("mode")]
- public SessionMode? Mode { get; set; }
+ /// Unique identifier of the custom agent.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
- /// Prompt to submit to the agent.
- [JsonPropertyName("prompt")]
- public required string Prompt { get; set; }
+ /// Absolute local file path of the agent definition. Only set for file-based agents loaded from disk; remote agents do not have a path.
+ [JsonPropertyName("path")]
+ public string? Path { get; set; }
- /// True when the invocation mutated user runtime settings; consumers caching settings should refresh.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("runtimeSettingsChanged")]
- public bool? RuntimeSettingsChanged { get; set; }
-}
+ /// Skill names preloaded into this agent's context. Omitted means none.
+ [JsonPropertyName("skills")]
+ public IList? Skills { get; set; }
-/// Schema for the `SlashCommandCompletedResult` type.
-/// The completed variant of .
-public partial class SlashCommandInvocationResultCompleted : SlashCommandInvocationResult
-{
- ///
- [JsonIgnore]
- public override string Kind => "completed";
+ /// Where the agent definition was loaded from.
+ [JsonPropertyName("source")]
+ public AgentInfoSource? Source { get; set; }
- /// Optional user-facing message describing the completed command.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("message")]
- public string? Message { get; set; }
+ /// Allowed tool names for this agent. Empty array means none; omitted means inherit defaults.
+ [JsonPropertyName("tools")]
+ public IList? Tools { get; set; }
- /// True when the invocation mutated user runtime settings; consumers caching settings should refresh.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("runtimeSettingsChanged")]
- public bool? RuntimeSettingsChanged { get; set; }
+ /// Whether the agent can be selected directly by the user. Agents marked `false` are subagent-only.
+ [JsonPropertyName("userInvocable")]
+ public bool? UserInvocable { get; set; }
}
-/// Slash command name and optional raw input string to invoke.
-internal sealed class CommandsInvokeRequest
+/// Custom agents available to the session.
+[Experimental(Diagnostics.Experimental)]
+public sealed class AgentList
{
- /// Raw input after the command name.
- [JsonPropertyName("input")]
- public string? Input { get; set; }
-
- /// Command name. Leading slashes are stripped and the name is matched case-insensitively.
- [JsonPropertyName("name")]
- public string Name { get; set; } = string.Empty;
+ /// Available custom agents.
+ [JsonPropertyName("agents")]
+ public IList Agents { get => field ??= []; set; }
+}
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionAgentListRequest
+{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the pending client-handled command was completed successfully.
-public sealed class CommandsHandlePendingCommandResult
+/// The currently selected custom agent, or null when using the default agent.
+[Experimental(Diagnostics.Experimental)]
+public sealed class AgentGetCurrentResult
{
- /// Whether the command was handled successfully.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
+ /// Currently selected custom agent, or null if using the default agent.
+ [JsonPropertyName("agent")]
+ public AgentInfo? Agent { get; set; }
}
-/// Pending command request ID and an optional error if the client handler failed.
-internal sealed class CommandsHandlePendingCommandRequest
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionAgentGetCurrentRequest
{
- /// Error message if the command handler failed.
- [JsonPropertyName("error")]
- public string? Error { get; set; }
-
- /// Request ID from the command invocation event.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the queued-command response was accepted by the session.
-public sealed class CommandsRespondToQueuedCommandResult
+/// The newly selected custom agent.
+[Experimental(Diagnostics.Experimental)]
+public sealed class AgentSelectResult
{
- /// Whether the response was accepted (false if the requestId was not found or already resolved).
- [JsonPropertyName("success")]
- public bool Success { get; set; }
+ /// The newly selected custom agent.
+ [JsonPropertyName("agent")]
+ public AgentInfo Agent { get => field ??= new(); set; }
}
-/// Result of the queued command execution.
-/// Data type discriminated by handled.
-public partial class QueuedCommandResult
+/// Name of the custom agent to select for subsequent turns.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class AgentSelectRequest
{
- /// The boolean discriminator.
- [JsonPropertyName("handled")]
- public bool Handled { get; set; }
+ /// Name of the custom agent to select.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
- /// If true, stop processing remaining queued items.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("stopProcessingQueue")]
- public bool? StopProcessingQueue { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Queued command request ID and the result indicating whether the client handled it.
-internal sealed class CommandsRespondToQueuedCommandRequest
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionAgentDeselectRequest
{
- /// Request ID from the queued command event.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
-
- /// Result of the queued command execution.
- [JsonPropertyName("result")]
- public QueuedCommandResult Result { get => field ??= new(); set; }
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// The elicitation response (accept with form values, decline, or cancel).
-public sealed class UIElicitationResponse
+/// Custom agents available to the session after reloading definitions from disk.
+[Experimental(Diagnostics.Experimental)]
+public sealed class AgentReloadResult
{
- /// The user's response: accept (submitted), decline (rejected), or cancel (dismissed).
- [JsonPropertyName("action")]
- public UIElicitationResponseAction Action { get; set; }
-
- /// The form values submitted by the user (present when action is 'accept').
- [JsonPropertyName("content")]
- public IDictionary? Content { get; set; }
-}
-
-/// JSON Schema describing the form fields to present to the user.
-public sealed class UIElicitationSchema
-{
- /// Form field definitions, keyed by field name.
- [JsonPropertyName("properties")]
- public IDictionary Properties { get => field ??= new Dictionary(); set; }
-
- /// List of required field names.
- [JsonPropertyName("required")]
- public IList? Required { get; set; }
-
- /// Schema type indicator (always 'object').
- [JsonPropertyName("type")]
- public string Type { get; set; } = string.Empty;
+ /// Reloaded custom agents.
+ [JsonPropertyName("agents")]
+ public IList Agents { get => field ??= []; set; }
}
-/// Prompt message and JSON schema describing the form fields to elicit from the user.
-internal sealed class UIElicitationRequest
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionAgentReloadRequest
{
- /// Message describing what information is needed from the user.
- [JsonPropertyName("message")]
- public string Message { get; set; } = string.Empty;
-
- /// JSON Schema describing the form fields to present to the user.
- [JsonPropertyName("requestedSchema")]
- public UIElicitationSchema RequestedSchema { get => field ??= new(); set; }
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the elicitation response was accepted; false if it was already resolved by another client.
-public sealed class UIElicitationResult
+/// Identifier assigned to the newly started background agent task.
+[Experimental(Diagnostics.Experimental)]
+public sealed class TasksStartAgentResult
{
- /// Whether the response was accepted. False if the request was already resolved by another client.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
+ /// Generated agent ID for the background task.
+ [JsonPropertyName("agentId")]
+ public string AgentId { get; set; } = string.Empty;
}
-/// Pending elicitation request ID and the user's response (accept/decline/cancel + form values).
-internal sealed class UIHandlePendingElicitationRequest
+/// Agent type, prompt, name, and optional description and model override for the new task.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class TasksStartAgentRequest
{
- /// The unique request ID from the elicitation.requested event.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
+ /// Type of agent to start (e.g., 'explore', 'task', 'general-purpose').
+ [JsonPropertyName("agentType")]
+ public string AgentType { get; set; } = string.Empty;
- /// The elicitation response (accept with form values, decline, or cancel).
- [JsonPropertyName("result")]
- public UIElicitationResponse Result { get => field ??= new(); set; }
+ /// Short description of the task.
+ [JsonPropertyName("description")]
+ public string? Description { get; set; }
+
+ /// Optional model override.
+ [JsonPropertyName("model")]
+ public string? Model { get; set; }
+
+ /// Short name for the agent, used to generate a human-readable ID.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
+
+ /// Task prompt for the agent.
+ [JsonPropertyName("prompt")]
+ public string Prompt { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the permission decision was applied; false when the request was already resolved.
-public sealed class PermissionRequestResult
-{
- /// Whether the permission request was handled successfully.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
-}
-
-/// Decision to apply to a pending permission request.
-/// Polymorphic base type discriminated by kind.
+/// Schema for the `TaskInfo` type.
+/// Polymorphic base type discriminated by type.
+[Experimental(Diagnostics.Experimental)]
[JsonPolymorphic(
- TypeDiscriminatorPropertyName = "kind",
+ TypeDiscriminatorPropertyName = "type",
UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
-[JsonDerivedType(typeof(PermissionDecisionApproveOnce), "approve-once")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSession), "approve-for-session")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocation), "approve-for-location")]
-[JsonDerivedType(typeof(PermissionDecisionApprovePermanently), "approve-permanently")]
-[JsonDerivedType(typeof(PermissionDecisionReject), "reject")]
-[JsonDerivedType(typeof(PermissionDecisionUserNotAvailable), "user-not-available")]
-public partial class PermissionDecision
+[JsonDerivedType(typeof(TaskInfoAgent), "agent")]
+[JsonDerivedType(typeof(TaskInfoShell), "shell")]
+public partial class TaskInfo
{
/// The type discriminator.
- [JsonPropertyName("kind")]
- public virtual string Kind { get; set; } = string.Empty;
+ [JsonPropertyName("type")]
+ public virtual string Type { get; set; } = string.Empty;
}
-/// Schema for the `PermissionDecisionApproveOnce` type.
-/// The approve-once variant of .
-public partial class PermissionDecisionApproveOnce : PermissionDecision
+/// Schema for the `TaskAgentInfo` type.
+/// The agent variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class TaskInfoAgent : TaskInfo
{
///
[JsonIgnore]
- public override string Kind => "approve-once";
-}
+ public override string Type => "agent";
-/// The approval to add as a session-scoped rule.
-/// Polymorphic base type discriminated by kind.
-[JsonPolymorphic(
- TypeDiscriminatorPropertyName = "kind",
- UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalCommands), "commands")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalRead), "read")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalWrite), "write")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalMcp), "mcp")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalMcpSampling), "mcp-sampling")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalMemory), "memory")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalCustomTool), "custom-tool")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalExtensionManagement), "extension-management")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess), "extension-permission-access")]
-public partial class PermissionDecisionApproveForSessionApproval
-{
- /// The type discriminator.
- [JsonPropertyName("kind")]
- public virtual string Kind { get; set; } = string.Empty;
-}
+ /// ISO 8601 timestamp when the current active period began.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("activeStartedAt")]
+ public DateTimeOffset? ActiveStartedAt { get; set; }
+ /// Accumulated active execution time in milliseconds.
+ [Range((double)0, (double)long.MaxValue)]
+ [JsonConverter(typeof(MillisecondsTimeSpanConverter))]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("activeTimeMs")]
+ public TimeSpan? ActiveTime { get; set; }
-/// Schema for the `PermissionDecisionApproveForSessionApprovalCommands` type.
-/// The commands variant of .
-public partial class PermissionDecisionApproveForSessionApprovalCommands : PermissionDecisionApproveForSessionApproval
-{
- ///
- [JsonIgnore]
- public override string Kind => "commands";
+ /// Type of agent running this task.
+ [JsonPropertyName("agentType")]
+ public required string AgentType { get; set; }
- /// Command identifiers covered by this approval.
- [JsonPropertyName("commandIdentifiers")]
- public required IList CommandIdentifiers { get; set; }
-}
+ /// Whether the task is currently in the original sync wait and can be moved to background mode. False once it is already backgrounded, idle, finished, or no longer has a promotable sync waiter.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("canPromoteToBackground")]
+ public bool? CanPromoteToBackground { get; set; }
-/// Schema for the `PermissionDecisionApproveForSessionApprovalRead` type.
-/// The read variant of .
-public partial class PermissionDecisionApproveForSessionApprovalRead : PermissionDecisionApproveForSessionApproval
-{
- ///
- [JsonIgnore]
- public override string Kind => "read";
-}
+ /// ISO 8601 timestamp when the task finished.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("completedAt")]
+ public DateTimeOffset? CompletedAt { get; set; }
-/// Schema for the `PermissionDecisionApproveForSessionApprovalWrite` type.
-/// The write variant of .
-public partial class PermissionDecisionApproveForSessionApprovalWrite : PermissionDecisionApproveForSessionApproval
-{
- ///
- [JsonIgnore]
- public override string Kind => "write";
-}
+ /// Short description of the task.
+ [JsonPropertyName("description")]
+ public required string Description { get; set; }
-/// Schema for the `PermissionDecisionApproveForSessionApprovalMcp` type.
-/// The mcp variant of .
-public partial class PermissionDecisionApproveForSessionApprovalMcp : PermissionDecisionApproveForSessionApproval
-{
- ///
- [JsonIgnore]
- public override string Kind => "mcp";
+ /// Error message when the task failed.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("error")]
+ public string? Error { get; set; }
- /// MCP server name.
- [JsonPropertyName("serverName")]
- public required string ServerName { get; set; }
+ /// Whether task execution is synchronously awaited or managed in the background.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("executionMode")]
+ public TaskExecutionMode? ExecutionMode { get; set; }
- /// MCP tool name, or null to cover every tool on the server.
- [JsonPropertyName("toolName")]
- public string? ToolName { get; set; }
+ /// Unique task identifier.
+ [JsonPropertyName("id")]
+ public required string Id { get; set; }
+
+ /// ISO 8601 timestamp when the agent entered idle state.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("idleSince")]
+ public DateTimeOffset? IdleSince { get; set; }
+
+ /// Most recent response text from the agent.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("latestResponse")]
+ public string? LatestResponse { get; set; }
+
+ /// Model used for the task when specified.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("model")]
+ public string? Model { get; set; }
+
+ /// Prompt passed to the agent.
+ [JsonPropertyName("prompt")]
+ public required string Prompt { get; set; }
+
+ /// Result text from the task when available.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("result")]
+ public string? Result { get; set; }
+
+ /// ISO 8601 timestamp when the task was started.
+ [JsonPropertyName("startedAt")]
+ public required DateTimeOffset StartedAt { get; set; }
+
+ /// Current lifecycle status of the task.
+ [JsonPropertyName("status")]
+ public required TaskStatus Status { get; set; }
+
+ /// Tool call ID associated with this agent task.
+ [JsonPropertyName("toolCallId")]
+ public required string ToolCallId { get; set; }
}
-/// Schema for the `PermissionDecisionApproveForSessionApprovalMcpSampling` type.
-/// The mcp-sampling variant of .
-public partial class PermissionDecisionApproveForSessionApprovalMcpSampling : PermissionDecisionApproveForSessionApproval
+/// Schema for the `TaskShellInfo` type.
+/// The shell variant of .
+[Experimental(Diagnostics.Experimental)]
+public partial class TaskInfoShell : TaskInfo
{
///
[JsonIgnore]
- public override string Kind => "mcp-sampling";
+ public override string Type => "shell";
- /// MCP server name.
- [JsonPropertyName("serverName")]
- public required string ServerName { get; set; }
-}
-
-/// Schema for the `PermissionDecisionApproveForSessionApprovalMemory` type.
-/// The memory variant of .
-public partial class PermissionDecisionApproveForSessionApprovalMemory : PermissionDecisionApproveForSessionApproval
-{
- ///
- [JsonIgnore]
- public override string Kind => "memory";
-}
-
-/// Schema for the `PermissionDecisionApproveForSessionApprovalCustomTool` type.
-/// The custom-tool variant of .
-public partial class PermissionDecisionApproveForSessionApprovalCustomTool : PermissionDecisionApproveForSessionApproval
-{
- ///
- [JsonIgnore]
- public override string Kind => "custom-tool";
+ /// Whether the shell runs inside a managed PTY session or as an independent background process.
+ [JsonPropertyName("attachmentMode")]
+ public required TaskShellInfoAttachmentMode AttachmentMode { get; set; }
- /// Custom tool name.
- [JsonPropertyName("toolName")]
- public required string ToolName { get; set; }
-}
+ /// Whether this shell task can be promoted to background mode.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("canPromoteToBackground")]
+ public bool? CanPromoteToBackground { get; set; }
-/// Schema for the `PermissionDecisionApproveForSessionApprovalExtensionManagement` type.
-/// The extension-management variant of .
-public partial class PermissionDecisionApproveForSessionApprovalExtensionManagement : PermissionDecisionApproveForSessionApproval
-{
- ///
- [JsonIgnore]
- public override string Kind => "extension-management";
+ /// Command being executed.
+ [JsonPropertyName("command")]
+ public required string Command { get; set; }
- /// Optional operation identifier; when omitted, the approval covers all extension management operations.
+ /// ISO 8601 timestamp when the task finished.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("operation")]
- public string? Operation { get; set; }
-}
+ [JsonPropertyName("completedAt")]
+ public DateTimeOffset? CompletedAt { get; set; }
-/// Schema for the `PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess` type.
-/// The extension-permission-access variant of .
-public partial class PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess : PermissionDecisionApproveForSessionApproval
-{
- ///
- [JsonIgnore]
- public override string Kind => "extension-permission-access";
+ /// Short description of the task.
+ [JsonPropertyName("description")]
+ public required string Description { get; set; }
- /// Extension name.
- [JsonPropertyName("extensionName")]
- public required string ExtensionName { get; set; }
-}
+ /// Whether task execution is synchronously awaited or managed in the background.
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonPropertyName("executionMode")]
+ public TaskExecutionMode? ExecutionMode { get; set; }
-/// Schema for the `PermissionDecisionApproveForSession` type.
-/// The approve-for-session variant of .
-public partial class PermissionDecisionApproveForSession : PermissionDecision
-{
- ///
- [JsonIgnore]
- public override string Kind => "approve-for-session";
+ /// Unique task identifier.
+ [JsonPropertyName("id")]
+ public required string Id { get; set; }
- /// The approval to add as a session-scoped rule.
+ /// Path to the detached shell log, when available.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("approval")]
- public PermissionDecisionApproveForSessionApproval? Approval { get; set; }
+ [JsonPropertyName("logPath")]
+ public string? LogPath { get; set; }
- /// The URL domain to approve for this session.
+ /// Process ID when available.
+ [Range((double)0, (double)4294967295, MinimumIsExclusive = true)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("domain")]
- public string? Domain { get; set; }
+ [JsonPropertyName("pid")]
+ public long? Pid { get; set; }
+
+ /// ISO 8601 timestamp when the task was started.
+ [JsonPropertyName("startedAt")]
+ public required DateTimeOffset StartedAt { get; set; }
+
+ /// Current lifecycle status of the task.
+ [JsonPropertyName("status")]
+ public required TaskStatus Status { get; set; }
}
-/// The approval to persist for this location.
-/// Polymorphic base type discriminated by kind.
-[JsonPolymorphic(
- TypeDiscriminatorPropertyName = "kind",
- UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalCommands), "commands")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalRead), "read")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalWrite), "write")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalMcp), "mcp")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalMcpSampling), "mcp-sampling")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalMemory), "memory")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalCustomTool), "custom-tool")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalExtensionManagement), "extension-management")]
-[JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess), "extension-permission-access")]
-public partial class PermissionDecisionApproveForLocationApproval
+/// Background tasks currently tracked by the session.
+[Experimental(Diagnostics.Experimental)]
+public sealed class TaskList
{
- /// The type discriminator.
- [JsonPropertyName("kind")]
- public virtual string Kind { get; set; } = string.Empty;
+ /// Currently tracked tasks.
+ [JsonPropertyName("tasks")]
+ public IList Tasks { get => field ??= []; set; }
}
-
-/// Schema for the `PermissionDecisionApproveForLocationApprovalCommands` type.
-/// The commands variant of .
-public partial class PermissionDecisionApproveForLocationApprovalCommands : PermissionDecisionApproveForLocationApproval
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionTasksListRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "commands";
-
- /// Command identifiers covered by this approval.
- [JsonPropertyName("commandIdentifiers")]
- public required IList CommandIdentifiers { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Schema for the `PermissionDecisionApproveForLocationApprovalRead` type.
-/// The read variant of .
-public partial class PermissionDecisionApproveForLocationApprovalRead : PermissionDecisionApproveForLocationApproval
+/// Refresh metadata for any detached background shells the runtime knows about. Use after a long pause to pick up exit/output state for shells running outside the agent loop.
+[Experimental(Diagnostics.Experimental)]
+public sealed class TasksRefreshResult
{
- ///
- [JsonIgnore]
- public override string Kind => "read";
}
-/// Schema for the `PermissionDecisionApproveForLocationApprovalWrite` type.
-/// The write variant of .
-public partial class PermissionDecisionApproveForLocationApprovalWrite : PermissionDecisionApproveForLocationApproval
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionTasksRefreshRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "write";
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Schema for the `PermissionDecisionApproveForLocationApprovalMcp` type.
-/// The mcp variant of .
-public partial class PermissionDecisionApproveForLocationApprovalMcp : PermissionDecisionApproveForLocationApproval
+/// Wait until all in-flight background tasks (agents + shells) and any follow-up turns scheduled by their completions have settled. Returns when the runtime is fully drained or after an internal timeout (default 10 minutes; configurable via COPILOT_TASK_WAIT_TIMEOUT_SECONDS).
+[Experimental(Diagnostics.Experimental)]
+public sealed class TasksWaitForPendingResult
{
- ///
- [JsonIgnore]
- public override string Kind => "mcp";
+}
- /// MCP server name.
- [JsonPropertyName("serverName")]
- public required string ServerName { get; set; }
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionTasksWaitForPendingRequest
+{
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// MCP tool name, or null to cover every tool on the server.
- [JsonPropertyName("toolName")]
- public string? ToolName { get; set; }
+/// Progress information for the task, or null when no task with that ID is tracked.
+[Experimental(Diagnostics.Experimental)]
+public sealed class TasksGetProgressResult
+{
+ /// Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked.
+ [JsonPropertyName("progress")]
+ public object? Progress { get; set; }
}
-/// Schema for the `PermissionDecisionApproveForLocationApprovalMcpSampling` type.
-/// The mcp-sampling variant of .
-public partial class PermissionDecisionApproveForLocationApprovalMcpSampling : PermissionDecisionApproveForLocationApproval
+/// Identifier of the background task to fetch progress for.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class TasksGetProgressRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "mcp-sampling";
+ /// Task identifier (agent ID or shell ID).
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
- /// MCP server name.
- [JsonPropertyName("serverName")]
- public required string ServerName { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Schema for the `PermissionDecisionApproveForLocationApprovalMemory` type.
-/// The memory variant of .
-public partial class PermissionDecisionApproveForLocationApprovalMemory : PermissionDecisionApproveForLocationApproval
+/// The first sync-waiting task that can currently be promoted to background mode.
+[Experimental(Diagnostics.Experimental)]
+public sealed class TasksGetCurrentPromotableResult
{
- ///
- [JsonIgnore]
- public override string Kind => "memory";
+ /// The first sync-waiting task (agent first, then shell) that can currently be promoted to background mode. Omitted if no such task exists. The returned task is guaranteed to have executionMode='sync' and canPromoteToBackground=true at the time of the call.
+ [JsonPropertyName("task")]
+ public TaskInfo? Task { get; set; }
}
-/// Schema for the `PermissionDecisionApproveForLocationApprovalCustomTool` type.
-/// The custom-tool variant of .
-public partial class PermissionDecisionApproveForLocationApprovalCustomTool : PermissionDecisionApproveForLocationApproval
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionTasksGetCurrentPromotableRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "custom-tool";
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
+}
- /// Custom tool name.
- [JsonPropertyName("toolName")]
- public required string ToolName { get; set; }
+/// Indicates whether the task was successfully promoted to background mode.
+[Experimental(Diagnostics.Experimental)]
+public sealed class TasksPromoteToBackgroundResult
+{
+ /// Whether the task was successfully promoted to background mode.
+ [JsonPropertyName("promoted")]
+ public bool Promoted { get; set; }
}
-/// Schema for the `PermissionDecisionApproveForLocationApprovalExtensionManagement` type.
-/// The extension-management variant of .
-public partial class PermissionDecisionApproveForLocationApprovalExtensionManagement : PermissionDecisionApproveForLocationApproval
+/// Identifier of the task to promote to background mode.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class TasksPromoteToBackgroundRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "extension-management";
+ /// Task identifier.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
- /// Optional operation identifier; when omitted, the approval covers all extension management operations.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("operation")]
- public string? Operation { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Schema for the `PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess` type.
-/// The extension-permission-access variant of .
-public partial class PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess : PermissionDecisionApproveForLocationApproval
+/// The promoted task as it now exists in background mode, omitted if no promotable task was waiting.
+[Experimental(Diagnostics.Experimental)]
+public sealed class TasksPromoteCurrentToBackgroundResult
{
- ///
- [JsonIgnore]
- public override string Kind => "extension-permission-access";
-
- /// Extension name.
- [JsonPropertyName("extensionName")]
- public required string ExtensionName { get; set; }
+ /// The promoted task as it now exists in background mode, omitted if no promotable task was waiting. Atomic operation: avoids the race window of getCurrentPromotable + promoteToBackground.
+ [JsonPropertyName("task")]
+ public TaskInfo? Task { get; set; }
}
-/// Schema for the `PermissionDecisionApproveForLocation` type.
-/// The approve-for-location variant of .
-public partial class PermissionDecisionApproveForLocation : PermissionDecision
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionTasksPromoteCurrentToBackgroundRequest
{
- ///
- [JsonIgnore]
- public override string Kind => "approve-for-location";
-
- /// The approval to persist for this location.
- [JsonPropertyName("approval")]
- public required PermissionDecisionApproveForLocationApproval Approval { get; set; }
-
- /// The location key (git root or cwd) to persist the approval to.
- [JsonPropertyName("locationKey")]
- public required string LocationKey { get; set; }
-}
-
-/// Schema for the `PermissionDecisionApprovePermanently` type.
-/// The approve-permanently variant of .
-public partial class PermissionDecisionApprovePermanently : PermissionDecision
-{
- ///
- [JsonIgnore]
- public override string Kind => "approve-permanently";
-
- /// The URL domain to approve permanently.
- [JsonPropertyName("domain")]
- public required string Domain { get; set; }
-}
-
-/// Schema for the `PermissionDecisionReject` type.
-/// The reject variant of .
-public partial class PermissionDecisionReject : PermissionDecision
-{
- ///
- [JsonIgnore]
- public override string Kind => "reject";
-
- /// Optional feedback from the user explaining the denial.
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- [JsonPropertyName("feedback")]
- public string? Feedback { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Schema for the `PermissionDecisionUserNotAvailable` type.
-/// The user-not-available variant of .
-public partial class PermissionDecisionUserNotAvailable : PermissionDecision
+/// Indicates whether the background task was successfully cancelled.
+[Experimental(Diagnostics.Experimental)]
+public sealed class TasksCancelResult
{
- ///
- [JsonIgnore]
- public override string Kind => "user-not-available";
+ /// Whether the task was successfully cancelled.
+ [JsonPropertyName("cancelled")]
+ public bool Cancelled { get; set; }
}
-/// Pending permission request ID and the decision to apply (approve/reject and scope).
-internal sealed class PermissionDecisionRequest
+/// Identifier of the background task to cancel.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class TasksCancelRequest
{
- /// Request ID of the pending permission request.
- [JsonPropertyName("requestId")]
- public string RequestId { get; set; } = string.Empty;
-
- /// Decision to apply to a pending permission request.
- [JsonPropertyName("result")]
- public PermissionDecision Result { get => field ??= new(); set; }
+ /// Task identifier.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the operation succeeded.
-public sealed class PermissionsSetApproveAllResult
+/// Indicates whether the task was removed. False when the task does not exist or is still running/idle.
+[Experimental(Diagnostics.Experimental)]
+public sealed class TasksRemoveResult
{
- /// Whether the operation succeeded.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
+ /// Whether the task was removed. Returns false if the task does not exist or is still running/idle (cancel it first).
+ [JsonPropertyName("removed")]
+ public bool Removed { get; set; }
}
-/// Whether to auto-approve all tool permission requests for the rest of the session.
-internal sealed class PermissionsSetApproveAllRequest
+/// Identifier of the completed or cancelled task to remove from tracking.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class TasksRemoveRequest
{
- /// Whether to auto-approve all tool permission requests.
- [JsonPropertyName("enabled")]
- public bool Enabled { get; set; }
+ /// Task identifier.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the operation succeeded.
-public sealed class PermissionsResetSessionApprovalsResult
+/// Indicates whether the message was delivered, with an error message when delivery failed.
+[Experimental(Diagnostics.Experimental)]
+public sealed class TasksSendMessageResult
{
- /// Whether the operation succeeded.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
+ /// Error message if delivery failed.
+ [JsonPropertyName("error")]
+ public string? Error { get; set; }
+
+ /// Whether the message was successfully delivered or steered.
+ [JsonPropertyName("sent")]
+ public bool Sent { get; set; }
}
-/// No parameters; clears all session-scoped tool permission approvals.
-internal sealed class PermissionsResetSessionApprovalsRequest
+/// Identifier of the target agent task, message content, and optional sender agent ID.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class TasksSendMessageRequest
{
+ /// Agent ID of the sender, if sent on behalf of another agent.
+ [JsonPropertyName("fromAgentId")]
+ public string? FromAgentId { get; set; }
+
+ /// Agent task identifier.
+ [JsonPropertyName("id")]
+ public string Id { get; set; } = string.Empty;
+
+ /// Message content to send to the agent.
+ [JsonPropertyName("message")]
+ public string Message { get; set; } = string.Empty;
+
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Identifier of the spawned process, used to correlate streamed output and exit notifications.
-public sealed class ShellExecResult
+/// Schema for the `Skill` type.
+[Experimental(Diagnostics.Experimental)]
+public sealed class Skill
{
- /// Unique identifier for tracking streamed output.
- [JsonPropertyName("processId")]
- public string ProcessId { get; set; } = string.Empty;
-}
+ /// Description of what the skill does.
+ [JsonPropertyName("description")]
+ public string Description { get; set; } = string.Empty;
-/// Shell command to run, with optional working directory and timeout in milliseconds.
-internal sealed class ShellExecRequest
-{
- /// Shell command to execute.
- [JsonPropertyName("command")]
- public string Command { get; set; } = string.Empty;
+ /// Whether the skill is currently enabled.
+ [JsonPropertyName("enabled")]
+ public bool Enabled { get; set; }
- /// Working directory (defaults to session working directory).
- [JsonPropertyName("cwd")]
- public string? Cwd { get; set; }
+ /// Unique identifier for the skill.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Absolute path to the skill file.
+ [JsonPropertyName("path")]
+ public string? Path { get; set; }
- /// Timeout in milliseconds (default: 30000).
- [Range((double)0, (double)long.MaxValue)]
- [JsonConverter(typeof(MillisecondsTimeSpanConverter))]
- [JsonPropertyName("timeout")]
- public TimeSpan? Timeout { get; set; }
+ /// Name of the plugin that provides the skill, when source is 'plugin'.
+ [JsonPropertyName("pluginName")]
+ public string? PluginName { get; set; }
+
+ /// Source location type (e.g., project, personal-copilot, plugin, builtin).
+ [JsonPropertyName("source")]
+ public SkillSource Source { get; set; }
+
+ /// Whether the skill can be invoked by the user as a slash command.
+ [JsonPropertyName("userInvocable")]
+ public bool UserInvocable { get; set; }
}
-/// Indicates whether the signal was delivered; false if the process was unknown or already exited.
-public sealed class ShellKillResult
+/// Skills available to the session, with their enabled state.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SkillList
{
- /// Whether the signal was sent successfully.
- [JsonPropertyName("killed")]
- public bool Killed { get; set; }
+ /// Available skills.
+ [JsonPropertyName("skills")]
+ public IList Skills { get => field ??= []; set; }
}
-/// Identifier of a process previously returned by "shell.exec" and the signal to send.
-internal sealed class ShellKillRequest
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionSkillsListRequest
{
- /// Process identifier returned by shell.exec.
- [JsonPropertyName("processId")]
- public string ProcessId { get; set; } = string.Empty;
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
-
- /// Signal to send (default: SIGTERM).
- [JsonPropertyName("signal")]
- public ShellKillSignal? Signal { get; set; }
}
-/// Post-compaction context window usage breakdown.
+/// Schema for the `SkillsInvokedSkill` type.
[Experimental(Diagnostics.Experimental)]
-public sealed class HistoryCompactContextWindow
+public sealed class SkillsInvokedSkill
{
- /// Token count from non-system messages (user, assistant, tool).
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("conversationTokens")]
- public long? ConversationTokens { get; set; }
-
- /// Current total tokens in the context window (system + conversation + tool definitions).
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("currentTokens")]
- public long CurrentTokens { get; set; }
+ /// Tools that should be auto-approved when this skill is active, captured at invocation time.
+ [JsonPropertyName("allowedTools")]
+ public IList? AllowedTools { get; set; }
- /// Current number of messages in the conversation.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("messagesLength")]
- public long MessagesLength { get; set; }
+ /// Full content of the skill file.
+ [JsonPropertyName("content")]
+ public string Content { get; set; } = string.Empty;
- /// Token count from system message(s).
+ /// Turn number when the skill was invoked.
[Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("systemTokens")]
- public long? SystemTokens { get; set; }
+ [JsonPropertyName("invokedAtTurn")]
+ public long InvokedAtTurn { get; set; }
- /// Maximum token count for the model's context window.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("tokenLimit")]
- public long TokenLimit { get; set; }
+ /// Unique identifier for the skill.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
- /// Token count from tool definitions.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("toolDefinitionsTokens")]
- public long? ToolDefinitionsTokens { get; set; }
+ /// Path to the SKILL.md file.
+ [JsonPropertyName("path")]
+ public string Path { get; set; } = string.Empty;
}
-/// Compaction outcome with the number of tokens and messages removed and the resulting context window breakdown.
+/// Skills invoked during this session, ordered by invocation time (most recent last).
[Experimental(Diagnostics.Experimental)]
-public sealed class HistoryCompactResult
+public sealed class SkillsGetInvokedResult
{
- /// Post-compaction context window usage breakdown.
- [JsonPropertyName("contextWindow")]
- public HistoryCompactContextWindow? ContextWindow { get; set; }
-
- /// Number of messages removed during compaction.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("messagesRemoved")]
- public long MessagesRemoved { get; set; }
-
- /// Whether compaction completed successfully.
- [JsonPropertyName("success")]
- public bool Success { get; set; }
-
- /// Number of tokens freed by compaction.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("tokensRemoved")]
- public long TokensRemoved { get; set; }
+ /// Skills invoked during this session, ordered by invocation time (most recent last).
+ [JsonPropertyName("skills")]
+ public IList Skills { get => field ??= []; set; }
}
/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionHistoryCompactRequest
+internal sealed class SessionSkillsGetInvokedRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Number of events that were removed by the truncation.
+/// Name of the skill to enable for the session.
[Experimental(Diagnostics.Experimental)]
-public sealed class HistoryTruncateResult
+internal sealed class SkillsEnableRequest
{
- /// Number of events that were removed.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("eventsRemoved")]
- public long EventsRemoved { get; set; }
-}
-
-/// Identifier of the event to truncate to; this event and all later events are removed.
-[Experimental(Diagnostics.Experimental)]
-internal sealed class HistoryTruncateRequest
-{
- /// Event ID to truncate to. This event and all events after it are removed from the session.
- [JsonPropertyName("eventId")]
- public string EventId { get; set; } = string.Empty;
+ /// Name of the skill to enable.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Aggregated code change metrics.
+/// Name of the skill to disable for the session.
[Experimental(Diagnostics.Experimental)]
-public sealed class UsageMetricsCodeChanges
+internal sealed class SkillsDisableRequest
{
- /// Number of distinct files modified.
- [JsonPropertyName("filesModifiedCount")]
- public long FilesModifiedCount { get; set; }
-
- /// Total lines of code added.
- [JsonPropertyName("linesAdded")]
- public long LinesAdded { get; set; }
+ /// Name of the skill to disable.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
- /// Total lines of code removed.
- [JsonPropertyName("linesRemoved")]
- public long LinesRemoved { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Request count and cost metrics for this model.
+/// Diagnostics from reloading skill definitions, with warnings and errors as separate lists.
[Experimental(Diagnostics.Experimental)]
-public sealed class UsageMetricsModelMetricRequests
+public sealed class SkillsLoadDiagnostics
{
- /// User-initiated premium request cost (with multiplier applied).
- [JsonPropertyName("cost")]
- public double Cost { get; set; }
+ /// Errors emitted while loading skills (e.g. skills that failed to load entirely).
+ [JsonPropertyName("errors")]
+ public IList Errors { get => field ??= []; set; }
- /// Number of API requests made with this model.
- [JsonPropertyName("count")]
- public long Count { get; set; }
+ /// Warnings emitted while loading skills (e.g. skills that loaded but had issues).
+ [JsonPropertyName("warnings")]
+ public IList Warnings { get => field ??= []; set; }
}
-/// Schema for the `UsageMetricsModelMetricTokenDetail` type.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-public sealed class UsageMetricsModelMetricTokenDetail
+internal sealed class SessionSkillsReloadRequest
{
- /// Accumulated token count for this token type.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("tokenCount")]
- public long TokenCount { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Token usage metrics for this model.
+/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-public sealed class UsageMetricsModelMetricUsage
+internal sealed class SessionSkillsEnsureLoadedRequest
{
- /// Total tokens read from prompt cache.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("cacheReadTokens")]
- public long CacheReadTokens { get; set; }
-
- /// Total tokens written to prompt cache.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("cacheWriteTokens")]
- public long CacheWriteTokens { get; set; }
-
- /// Total input tokens consumed.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("inputTokens")]
- public long InputTokens { get; set; }
-
- /// Total output tokens produced.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("outputTokens")]
- public long OutputTokens { get; set; }
-
- /// Total output tokens used for reasoning.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("reasoningTokens")]
- public long? ReasoningTokens { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Schema for the `UsageMetricsModelMetric` type.
+/// Schema for the `McpServer` type.
[Experimental(Diagnostics.Experimental)]
-public sealed class UsageMetricsModelMetric
+public sealed class McpServer
{
- /// Request count and cost metrics for this model.
- [JsonPropertyName("requests")]
- public UsageMetricsModelMetricRequests Requests { get => field ??= new(); set; }
-
- /// Token count details per type.
- [JsonPropertyName("tokenDetails")]
- public IDictionary? TokenDetails { get; set; }
+ /// Error message if the server failed to connect.
+ [JsonPropertyName("error")]
+ public string? Error { get; set; }
- /// Accumulated nano-AI units cost for this model.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("totalNanoAiu")]
- public long? TotalNanoAiu { get; set; }
+ /// Server name (config key).
+ [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
- /// Token usage metrics for this model.
- [JsonPropertyName("usage")]
- public UsageMetricsModelMetricUsage Usage { get => field ??= new(); set; }
-}
+ /// Configuration source: user, workspace, plugin, or builtin.
+ [JsonPropertyName("source")]
+ public McpServerSource? Source { get; set; }
-/// Schema for the `UsageMetricsTokenDetail` type.
-[Experimental(Diagnostics.Experimental)]
-public sealed class UsageMetricsTokenDetail
-{
- /// Accumulated token count for this token type.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("tokenCount")]
- public long TokenCount { get; set; }
+ /// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured.
+ [JsonPropertyName("status")]
+ public McpServerStatus Status { get; set; }
}
-/// Accumulated session usage metrics, including premium request cost, token counts, model breakdown, and code-change totals.
+/// MCP servers configured for the session, with their connection status.
[Experimental(Diagnostics.Experimental)]
-public sealed class UsageGetMetricsResult
+public sealed class McpServerList
{
- /// Aggregated code change metrics.
- [JsonPropertyName("codeChanges")]
- public UsageMetricsCodeChanges CodeChanges { get => field ??= new(); set; }
-
- /// Currently active model identifier.
- [JsonPropertyName("currentModel")]
- public string? CurrentModel { get; set; }
-
- /// Input tokens from the most recent main-agent API call.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("lastCallInputTokens")]
- public long LastCallInputTokens { get; set; }
-
- /// Output tokens from the most recent main-agent API call.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("lastCallOutputTokens")]
- public long LastCallOutputTokens { get; set; }
-
- /// Per-model token and request metrics, keyed by model identifier.
- [JsonPropertyName("modelMetrics")]
- public IDictionary ModelMetrics { get => field ??= new Dictionary(); set; }
-
- /// Session start timestamp (epoch milliseconds).
- [JsonPropertyName("sessionStartTime")]
- public long SessionStartTime { get; set; }
-
- /// Session-wide per-token-type accumulated token counts.
- [JsonPropertyName("tokenDetails")]
- public IDictionary? TokenDetails { get; set; }
-
- /// Total time spent in model API calls (milliseconds).
- [Range(0, double.MaxValue)]
- [JsonConverter(typeof(MillisecondsTimeSpanConverter))]
- [JsonPropertyName("totalApiDurationMs")]
- public TimeSpan TotalApiDuration { get; set; }
-
- /// Session-wide accumulated nano-AI units cost.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("totalNanoAiu")]
- public long? TotalNanoAiu { get; set; }
-
- /// Total user-initiated premium request cost across all models (may be fractional due to multipliers).
- [JsonPropertyName("totalPremiumRequestCost")]
- public double TotalPremiumRequestCost { get; set; }
-
- /// Raw count of user-initiated API requests.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("totalUserRequests")]
- public long TotalUserRequests { get; set; }
+ /// Configured MCP servers.
+ [JsonPropertyName("servers")]
+ public IList Servers { get => field ??= []; set; }
}
/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionUsageGetMetricsRequest
+internal sealed class SessionMcpListRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// GitHub URL for the session and a flag indicating whether remote steering is enabled.
+/// Name of the MCP server to enable for the session.
[Experimental(Diagnostics.Experimental)]
-public sealed class RemoteEnableResult
+internal sealed class McpEnableRequest
{
- /// Whether remote steering is enabled.
- [JsonPropertyName("remoteSteerable")]
- public bool RemoteSteerable { get; set; }
+ /// Name of the MCP server to enable.
+ [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("serverName")]
+ public string ServerName { get; set; } = string.Empty;
- /// GitHub frontend URL for this session.
- [Url]
- [StringSyntax(StringSyntaxAttribute.Uri)]
- [JsonPropertyName("url")]
- public string? Url { get; set; }
+ /// Target session identifier.
+ [JsonPropertyName("sessionId")]
+ public string SessionId { get; set; } = string.Empty;
}
-/// Optional remote session mode ("off", "export", or "on"); defaults to enabling both export and remote steering.
+/// Name of the MCP server to disable for the session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class RemoteEnableRequest
+internal sealed class McpDisableRequest
{
- /// Per-session remote mode. "off" disables remote, "export" exports session events to GitHub without enabling remote steering, "on" enables both export and remote steering.
- [JsonPropertyName("mode")]
- public RemoteSessionMode? Mode { get; set; }
+ /// Name of the MCP server to disable.
+ [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("serverName")]
+ public string ServerName { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
@@ -3026,3280 +3316,8591 @@ internal sealed class RemoteEnableRequest
/// Identifies the target session.
[Experimental(Diagnostics.Experimental)]
-internal sealed class SessionRemoteDisableRequest
+internal sealed class SessionMcpReloadRequest
{
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Describes a filesystem error.
-public sealed class SessionFsError
+/// MCP CreateMessageResult payload (with optional 'tools' extension), present when action='success'. Treated as opaque at the schema layer; consumers should construct/consume it per the MCP CreateMessageResult shape.
+[Experimental(Diagnostics.Experimental)]
+public sealed class McpExecuteSamplingResult
{
- /// Error classification.
- [JsonPropertyName("code")]
- public SessionFsErrorCode Code { get; set; }
-
- /// Free-form detail about the error, for logging/diagnostics.
- [JsonPropertyName("message")]
- public string? Message { get; set; }
}
-/// File content as a UTF-8 string, or a filesystem error if the read failed.
-public sealed class SessionFsReadFileResult
+/// Outcome of an MCP sampling execution: success result, failure error, or cancellation.
+[Experimental(Diagnostics.Experimental)]
+public sealed class McpSamplingExecutionResult
{
- /// File content as UTF-8 string.
- [JsonPropertyName("content")]
- public string Content { get; set; } = string.Empty;
+ /// Outcome of the sampling inference. 'success' produced a response; 'failure' encountered an error (including agent-side rejection by content filter or criteria); 'cancelled' the caller cancelled this execution via cancelSamplingExecution.
+ [JsonPropertyName("action")]
+ public McpSamplingExecutionAction Action { get; set; }
- /// Describes a filesystem error.
+ /// Error description, present when action='failure'.
[JsonPropertyName("error")]
- public SessionFsError? Error { get; set; }
+ public string? Error { get; set; }
+
+ /// MCP CreateMessageResult payload (with optional 'tools' extension), present when action='success'. Treated as opaque at the schema layer; consumers should construct/consume it per the MCP CreateMessageResult shape.
+ [JsonPropertyName("result")]
+ public McpExecuteSamplingResult? Result { get; set; }
}
-/// Path of the file to read from the client-provided session filesystem.
-public sealed class SessionFsReadFileRequest
+/// Raw MCP CreateMessageRequest params, as received in the `sampling.requested` event. Treated as opaque at the schema layer; the runtime converts the embedded MCP messages into the OpenAI chat-completion shape internally.
+[Experimental(Diagnostics.Experimental)]
+public sealed class McpExecuteSamplingRequest
{
- /// Path using SessionFs conventions.
- [JsonPropertyName("path")]
- public string Path { get; set; } = string.Empty;
+}
+
+/// Identifiers and raw MCP CreateMessageRequest params used to run a sampling inference.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class McpExecuteSamplingParams
+{
+ /// The original MCP JSON-RPC request ID (string or number). Used by the runtime to correlate the inference with the originating MCP request for telemetry; this is distinct from `requestId` (which is the schema-level cancellation handle).
+ [JsonPropertyName("mcpRequestId")]
+ public object McpRequestId { get; set; } = null!;
+
+ /// Raw MCP CreateMessageRequest params, as received in the `sampling.requested` event. Treated as opaque at the schema layer; the runtime converts the embedded MCP messages into the OpenAI chat-completion shape internally.
+ [JsonPropertyName("request")]
+ public McpExecuteSamplingRequest Request { get => field ??= new(); set; }
+
+ /// Caller-provided unique identifier for this sampling execution. Use this same ID with cancelSamplingExecution to cancel the in-flight call. Must be unique within the session for the lifetime of the call.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
+
+ /// Name of the MCP server that initiated the sampling request.
+ [JsonPropertyName("serverName")]
+ public string ServerName { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// File path, content to write, and optional mode for the client-provided session filesystem.
-public sealed class SessionFsWriteFileRequest
+/// Indicates whether an in-flight sampling execution with the given requestId was found and cancelled.
+[Experimental(Diagnostics.Experimental)]
+public sealed class McpCancelSamplingExecutionResult
{
- /// Content to write.
- [JsonPropertyName("content")]
- public string Content { get; set; } = string.Empty;
-
- /// Optional POSIX-style mode for newly created files.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("mode")]
- public long? Mode { get; set; }
+ /// True if an in-flight execution with the given requestId was found and signalled to cancel. False when no such execution is in flight (already completed, never started, or cancelled by another caller).
+ [JsonPropertyName("cancelled")]
+ public bool Cancelled { get; set; }
+}
- /// Path using SessionFs conventions.
- [JsonPropertyName("path")]
- public string Path { get; set; } = string.Empty;
+/// The requestId previously passed to executeSampling that should be cancelled.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class McpCancelSamplingExecutionParams
+{
+ /// The requestId previously passed to executeSampling that should be cancelled.
+ [JsonPropertyName("requestId")]
+ public string RequestId { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// File path, content to append, and optional mode for the client-provided session filesystem.
-public sealed class SessionFsAppendFileRequest
+/// Env-value mode recorded on the session after the update.
+[Experimental(Diagnostics.Experimental)]
+public sealed class McpSetEnvValueModeResult
{
- /// Content to append.
- [JsonPropertyName("content")]
- public string Content { get; set; } = string.Empty;
-
- /// Optional POSIX-style mode for newly created files.
- [Range((double)0, (double)long.MaxValue)]
+ /// Mode recorded on the session after the update.
[JsonPropertyName("mode")]
- public long? Mode { get; set; }
+ public McpSetEnvValueModeDetails Mode { get; set; }
+}
- /// Path using SessionFs conventions.
- [JsonPropertyName("path")]
- public string Path { get; set; } = string.Empty;
+/// Mode controlling how MCP server env values are resolved (`direct` or `indirect`).
+[Experimental(Diagnostics.Experimental)]
+internal sealed class McpSetEnvValueModeParams
+{
+ /// How environment-variable values supplied to MCP servers are resolved. "direct" passes literal string values; "indirect" treats values as references (e.g. names of environment variables on the host) that the runtime resolves before launch. Defaults to the runtime's startup mode; clients that intentionally launch MCP servers with literal values (e.g. CLI prompt mode and ACP) set this to "direct".
+ [JsonPropertyName("mode")]
+ public McpSetEnvValueModeDetails Mode { get; set; }
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Indicates whether the requested path exists in the client-provided session filesystem.
-public sealed class SessionFsExistsResult
+/// Indicates whether the auto-managed `github` MCP server was removed (false when nothing to remove).
+[Experimental(Diagnostics.Experimental)]
+public sealed class McpRemoveGitHubResult
{
- /// Whether the path exists.
- [JsonPropertyName("exists")]
- public bool Exists { get; set; }
+ /// True when the auto-managed `github` MCP server was removed; false when no removal happened (e.g. user has explicitly configured a `github` server, or the server was not registered).
+ [JsonPropertyName("removed")]
+ public bool Removed { get; set; }
}
-/// Path to test for existence in the client-provided session filesystem.
-public sealed class SessionFsExistsRequest
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionMcpRemoveGitHubRequest
{
- /// Path using SessionFs conventions.
- [JsonPropertyName("path")]
- public string Path { get; set; } = string.Empty;
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Filesystem metadata for the requested path, or a filesystem error if the stat failed.
-public sealed class SessionFsStatResult
+/// OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server.
+[Experimental(Diagnostics.Experimental)]
+public sealed class McpOauthLoginResult
{
- /// ISO 8601 timestamp of creation.
- [JsonPropertyName("birthtime")]
- public DateTimeOffset Birthtime { get; set; }
-
- /// Describes a filesystem error.
- [JsonPropertyName("error")]
- public SessionFsError? Error { get; set; }
-
- /// Whether the path is a directory.
- [JsonPropertyName("isDirectory")]
- public bool IsDirectory { get; set; }
+ /// URL the caller should open in a browser to complete OAuth. Omitted when cached tokens were still valid and no browser interaction was needed — the server is already reconnected in that case. When present, the runtime starts the callback listener before returning and continues the flow in the background; completion is signaled via session.mcp_server_status_changed.
+ [Url]
+ [StringSyntax(StringSyntaxAttribute.Uri)]
+ [JsonPropertyName("authorizationUrl")]
+ public string? AuthorizationUrl { get; set; }
+}
- /// Whether the path is a file.
- [JsonPropertyName("isFile")]
- public bool IsFile { get; set; }
+/// Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class McpOauthLoginRequest
+{
+ /// Optional override for the body text shown on the OAuth loopback callback success page. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass surface-specific copy telling the user where to return.
+ [JsonPropertyName("callbackSuccessMessage")]
+ public string? CallbackSuccessMessage { get; set; }
- /// ISO 8601 timestamp of last modification.
- [JsonPropertyName("mtime")]
- public DateTimeOffset Mtime { get; set; }
+ /// Optional override for the OAuth client display name shown on the consent screen. Applies to newly registered dynamic clients only — existing registrations keep the name they were created with. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass their own surface-specific label so the consent screen matches the product the user sees.
+ [JsonPropertyName("clientName")]
+ public string? ClientName { get; set; }
- /// File size in bytes.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("size")]
- public long Size { get; set; }
-}
+ /// When true, clears any cached OAuth token for the server and runs a full new authorization. Use when the user explicitly wants to switch accounts or believes their session is stuck.
+ [JsonPropertyName("forceReauth")]
+ public bool? ForceReauth { get; set; }
-/// Path whose metadata should be returned from the client-provided session filesystem.
-public sealed class SessionFsStatRequest
-{
- /// Path using SessionFs conventions.
- [JsonPropertyName("path")]
- public string Path { get; set; } = string.Empty;
+ /// Name of the remote MCP server to authenticate.
+ [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")]
+ [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
+ [MinLength(1)]
+ [JsonPropertyName("serverName")]
+ public string ServerName { get; set; } = string.Empty;
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Directory path to create in the client-provided session filesystem, with options for recursive creation and POSIX mode.
-public sealed class SessionFsMkdirRequest
+/// Schema for the `Plugin` type.
+[Experimental(Diagnostics.Experimental)]
+public sealed class Plugin
{
- /// Optional POSIX-style mode for newly created directories.
- [Range((double)0, (double)long.MaxValue)]
- [JsonPropertyName("mode")]
- public long? Mode { get; set; }
+ /// Whether the plugin is currently enabled.
+ [JsonPropertyName("enabled")]
+ public bool Enabled { get; set; }
- /// Path using SessionFs conventions.
- [JsonPropertyName("path")]
- public string Path { get; set; } = string.Empty;
+ /// Marketplace the plugin came from.
+ [JsonPropertyName("marketplace")]
+ public string Marketplace { get; set; } = string.Empty;
- /// Create parent directories as needed.
- [JsonPropertyName("recursive")]
- public bool? Recursive { get; set; }
+ /// Plugin name.
+ [JsonPropertyName("name")]
+ public string Name { get; set; } = string.Empty;
- /// Target session identifier.
- [JsonPropertyName("sessionId")]
- public string SessionId { get; set; } = string.Empty;
+ /// Installed version.
+ [JsonPropertyName("version")]
+ public string? Version { get; set; }
}
-/// Names of entries in the requested directory, or a filesystem error if the read failed.
-public sealed class SessionFsReaddirResult
+/// Plugins installed for the session, with their enabled state and version metadata.
+[Experimental(Diagnostics.Experimental)]
+public sealed class PluginList
{
- /// Entry names in the directory.
- [JsonPropertyName("entries")]
- public IList Entries { get => field ??= []; set; }
-
- /// Describes a filesystem error.
- [JsonPropertyName("error")]
- public SessionFsError? Error { get; set; }
+ /// Installed plugins.
+ [JsonPropertyName("plugins")]
+ public IList Plugins { get => field ??= []; set; }
}
-/// Directory path whose entries should be listed from the client-provided session filesystem.
-public sealed class SessionFsReaddirRequest
+/// Identifies the target session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionPluginsListRequest
{
- /// Path using SessionFs conventions.
- [JsonPropertyName("path")]
- public string Path { get; set; } = string.Empty;
-
/// Target session identifier.
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
-/// Schema for the `SessionFsReaddirWithTypesEntry` type.
-public sealed class SessionFsReaddirWithTypesEntry
+/// Indicates whether the session options patch was applied successfully.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionUpdateOptionsResult
{
- /// Entry name.
+ /// Whether the operation succeeded.
+ [JsonPropertyName("success")]
+ public bool Success { get; set; }
+}
+
+/// Schema for the `SessionInstalledPlugin` type.
+[Experimental(Diagnostics.Experimental)]
+public sealed class SessionInstalledPlugin
+{
+ /// Path where the plugin is cached locally.
+ [JsonPropertyName("cache_path")]
+ public string? CachePath { get; set; }
+
+ /// Whether the plugin is currently enabled.
+ [JsonPropertyName("enabled")]
+ public bool Enabled { get; set; }
+
+ /// Installation timestamp (ISO-8601).
+ [JsonPropertyName("installed_at")]
+ public string InstalledAt { get; set; } = string.Empty;
+
+ /// Marketplace the plugin came from (empty string for direct repo installs).
+ [JsonPropertyName("marketplace")]
+ public string Marketplace { get; set; } = string.Empty;
+
+ /// Plugin name.
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
- /// Entry type.
- [JsonPropertyName("type")]
- public SessionFsReaddirWithTypesEntryType Type { get; set; }
+ /// Source descriptor for direct repo installs (when marketplace is empty).
+ [JsonPropertyName("source")]
+ public object? Source { get; set; }
+
+ /// Installed version, if known.
+ [JsonPropertyName("version")]
+ public string? Version { get; set; }
}
-/// Entries in the requested directory paired with file/directory type information, or a filesystem error if the read failed.
-public sealed class SessionFsReaddirWithTypesResult
+/// Patch of mutable session options to apply to the running session.
+[Experimental(Diagnostics.Experimental)]
+internal sealed class SessionUpdateOptionsParams
{
- /// Directory entries with type information.
- [JsonPropertyName("entries")]
- public IList Entries { get => field ??= []; set; }
+ /// Additional content-exclusion policies to merge into the session's policy set. Opaque shape; see `ContentExclusionApiResponse` in the runtime.
+ [JsonPropertyName("additionalContentExclusionPolicies")]
+ public IList