From f0b503aae1ba151d29d117088de4238d1983e33e Mon Sep 17 00:00:00 2001 From: "copilot-cli-release-app[bot]" Date: Fri, 9 Oct 2026 16:11:00 +0000 Subject: [PATCH 1/6] Update SDK snapshot for Copilot CLI 1.0.95 --- .github/workflows/java-publish-snapshot.yml | 2 +- nodejs/package.json | 2 +- nodejs/src/cliVersion.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/java-publish-snapshot.yml b/.github/workflows/java-publish-snapshot.yml index 77d5287964..219dd43bf2 100644 --- a/.github/workflows/java-publish-snapshot.yml +++ b/.github/workflows/java-publish-snapshot.yml @@ -370,7 +370,7 @@ jobs: build-darwin-classifier: name: Build Darwin snapshot classifier needs: resolve-source - runs-on: macos-26 + runs-on: macos-26-agent-runtime permissions: contents: read outputs: diff --git a/nodejs/package.json b/nodejs/package.json index a65ffe4181..d33e05f5cf 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -5,7 +5,7 @@ "url": "https://github.com/github/copilot-sdk.git" }, "version": "0.0.0-dev", - "copilotCliVersion": "1.0.95-3", + "copilotCliVersion": "1.0.95", "description": "TypeScript SDK for programmatic control of GitHub Copilot CLI via JSON-RPC", "main": "./dist/cjs/index.js", "types": "./dist/index.d.ts", diff --git a/nodejs/src/cliVersion.ts b/nodejs/src/cliVersion.ts index 92ccdd2f0b..f55982b373 100644 --- a/nodejs/src/cliVersion.ts +++ b/nodejs/src/cliVersion.ts @@ -1,3 +1,3 @@ -export const COPILOT_CLI_VERSION = "1.0.95-3"; +export const COPILOT_CLI_VERSION = "1.0.95"; export const COPILOT_CLI_USE_NPM_PACKAGE = false; From 838e3e9f5cd6bd6dec17d03f383d8fd2d8593a05 Mon Sep 17 00:00:00 2001 From: C0deKing <16599358+C0deKing@users.noreply.github.com> Date: Sun, 11 Oct 2026 21:48:17 +0000 Subject: [PATCH 2/6] Add managed hosting contract and per-host Go credential callbacks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/runtime-supervised-host.md | 47 +++ dotnet/src/Generated/Rpc.cs | 145 +++++++++- go/github_token_provider.go | 11 +- go/host.go | 28 +- go/host_credentials_test.go | 114 ++++++++ go/rpc/zrpc.go | 45 ++- java/scripts/codegen/java.test.ts | 18 ++ java/scripts/codegen/java.ts | 26 +- .../rpc/GitHubTokenAcquireRequest.java | 2 +- .../rpc/GitHubTokenAcquireResultToken.java | 2 +- .../rpc/HostGitHubEnvironmentOptions.java | 23 +- nodejs/src/generated/rpc.ts | 36 ++- python/copilot/generated/rpc.py | 271 +++++++++++------- rust/src/ahp_host/tests.rs | 3 + rust/src/generated/api_types.rs | 60 +++- 15 files changed, 693 insertions(+), 138 deletions(-) create mode 100644 go/host_credentials_test.go diff --git a/docs/runtime-supervised-host.md b/docs/runtime-supervised-host.md index c0999bddbb..5a27d71706 100644 --- a/docs/runtime-supervised-host.md +++ b/docs/runtime-supervised-host.md @@ -146,6 +146,53 @@ These management operations are experimental and do not require a running host. Discovery returns safe metadata, not host-side relay credentials. GitHub-managed environments cannot be deleted through this API. +### Managed registration and refreshable credentials + +The experimental `githubEnvironment.kind` defaults to `user-local`. +`managed-sandbox` and `managed-cca` omit user-local managed settings from +registration. The authenticated control credential determines ownership; these +options cannot select or override a tenant. A controller adopting an existing +environment supplies its stable compute identity and a credential authorized +for that allocation. Namespaced compute identities retain their wire value and +use an encoded, isolated catalog directory. + +`runtimePrincipal: "github-app"` requires a `managed-sandbox` environment and a +separately built managed-hosting runtime. Ordinary artifacts reject that +principal. Managed artifacts retain the existing GitHub App attestation and +sandbox admission checks; the App principal is not an installation-level +identity boundary. The native build selects this capability with +`--define=managed_hosting=true` on the `//src/native/runtime:runtime` Bazel target. + +**Go** exposes `AhpHostOptions.GitHubTokenProvider` for refreshable control +credentials. Other integrations can supply an opaque +`credentialProviderRegistrationId` through the generated RPC contract and +handle `gitHubToken.getToken` on the same SDK connection. Hosting callbacks have +no session ID and must return a bearer valid for at least 120 seconds. The +runtime requests refreshes through the owning connection, rechecks authentication +and remote-control policy, and never substitutes ambient authentication after a +provider error. Go unregisters the callback on startup failure, host exit, or +connection loss. Persist a server-side mint policy, not callback bearer tokens. +Session-scoped token callbacks retain their existing greater-than-one-hour +validity requirement. + +`COPILOT_MC_BASE_URL` is an origin, not an API path. It accepts HTTPS or HTTP +loopback, and rejects credentials, paths, queries, and fragments without falling +back to the production default. Local validation must explicitly set its local +origin before starting the runtime. + +Installation credentials alone do not establish remote-control entitlement. +The existing server-to-server auth metadata lacks that entitlement outside the +established sandbox path. This prototype does not add a trusted installation +policy source or bypass that rejection. + +> [!WARNING] +> AHP workspace resources and watchers still use the host filesystem. SDK +> SessionFS providers do not automatically redirect these operations to remote +> workers. The native catalog and repository materialization also use local +> storage and Git; neither invokes a remote session callback. Preserve the supplied session +> creation/resume configuration and permission callbacks; replacing them is not +> a filesystem routing solution. + ## Application-owned sessions Application session factories optionally handle fresh AHP diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index 6ab5009adc..f6f3a1be89 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -385,6 +385,14 @@ public sealed class HostGitHubEnvironmentOptions [JsonPropertyName("computeId")] public string ComputeId { get; set; } = string.Empty; + /// Opaque SDK registration for a refreshable hosting credential. Tokens are requested only from the owning SDK connection through gitHubToken.getToken and must remain valid for at least 120 seconds. Omitting this uses the runtime's existing authentication. + [JsonPropertyName("credentialProviderRegistrationId")] + public string? CredentialProviderRegistrationId { get; set; } + + /// Registration kind. Defaults to user-local; managed kinds adopt the preallocated environment identified by the authenticated owner and computeId. + [JsonPropertyName("kind")] + public HostEnvironmentKind? Kind { get; set; } + /// Human-readable environment display name. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; @@ -392,6 +400,10 @@ public sealed class HostGitHubEnvironmentOptions /// Require sealed, connection-bound authentication (default true), independent of listener address. False permits unsealed direct credentials and unbound sealed relay credentials; use only when the caller fully controls and trusts the direct transport. Relay token encryption remains mandatory. [JsonPropertyName("requireConnectionBinding")] public bool? RequireConnectionBinding { get; set; } + + /// Runtime authentication principal, independent of Mission Control's routing owner. Defaults to user. github-app requires a separately built managed-hosting runtime and a managed-sandbox registration; ordinary runtime builds reject it. + [JsonPropertyName("runtimePrincipal")] + public HostRuntimePrincipal? RuntimePrincipal { get; set; } } /// Local WebSocket transport options. @@ -27685,7 +27697,7 @@ public partial class GitHubTokenAcquireResultToken : GitHubTokenAcquireResult [JsonPropertyName("accessToken")] public required string AccessToken { get; set; } - /// Remaining token lifetime in seconds when callback execution completes. It must exceed the one-hour preflight refresh threshold. + /// Remaining token lifetime in seconds when callback execution completes. Session providers require more than one hour; hosting providers require at least 120 seconds. [JsonPropertyName("expiresIn")] public required long ExpiresIn { get; set; } @@ -27720,7 +27732,7 @@ public sealed class GitHubTokenAcquireRequest [JsonPropertyName("registrationId")] public string RegistrationId { get; set; } = string.Empty; - /// Session receiving the token. Absent only before a cloud session has been assigned its id. + /// Session receiving the token. Absent for hosting credentials and before a cloud session has been assigned its id. [JsonPropertyName("sessionId")] public string? SessionId { get; set; } } @@ -28102,6 +28114,135 @@ public override void Write(Utf8JsonWriter writer, EnvironmentKind value, JsonSer } +/// Compute kinds supported by attached environment registration. +[Experimental(global::GitHub.Copilot.Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct HostEnvironmentKind : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public HostEnvironmentKind(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// An ordinary user-managed local host. + public static HostEnvironmentKind UserLocal { get; } = new("user-local"); + + /// A preallocated GitHub-managed sandbox. + public static HostEnvironmentKind ManagedSandbox { get; } = new("managed-sandbox"); + + /// A preallocated GitHub-managed cloud agent host. + public static HostEnvironmentKind ManagedCca { get; } = new("managed-cca"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(HostEnvironmentKind left, HostEnvironmentKind right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(HostEnvironmentKind left, HostEnvironmentKind right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is HostEnvironmentKind other && Equals(other); + + /// + public bool Equals(HostEnvironmentKind other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override HostEnvironmentKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, HostEnvironmentKind value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(HostEnvironmentKind)); + } + } +} + + +/// Authentication principal used by the attached AHP host. +[Experimental(global::GitHub.Copilot.Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct HostRuntimePrincipal : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public HostRuntimePrincipal(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Authenticate every connection as the host's single GitHub user. + public static HostRuntimePrincipal User { get; } = new("user"); + + /// Authenticate the provisioned GitHub App using the managed host's existing sandbox admission. + public static HostRuntimePrincipal GitHubApp { get; } = new("github-app"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(HostRuntimePrincipal left, HostRuntimePrincipal right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(HostRuntimePrincipal left, HostRuntimePrincipal right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is HostRuntimePrincipal other && Equals(other); + + /// + public bool Equals(HostRuntimePrincipal other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override HostRuntimePrincipal Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, HostRuntimePrincipal value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(HostRuntimePrincipal)); + } + } +} + + /// Hook event name. Discovery emits the file-configurable subset; SDK callbacks additionally support callback-only events. [Experimental(global::GitHub.Copilot.Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] diff --git a/go/github_token_provider.go b/go/github_token_provider.go index 8f1233b7cd..43e97a36d1 100644 --- a/go/github_token_provider.go +++ b/go/github_token_provider.go @@ -24,8 +24,8 @@ const ( type GitHubTokenProviderArgs struct { // Host is the effective GitHub host for which a token is needed. Host string - // SessionID identifies the session receiving the token. It is nil before a - // cloud session has been assigned an ID. + // SessionID identifies the session receiving the token. It is nil for + // hosting credentials and before a cloud session has been assigned an ID. SessionID *string // Reason indicates whether this is the initial token or a refresh. Reason GitHubTokenRequestReason @@ -76,9 +76,10 @@ func GitHubTokenCancelled() *GitHubTokenProviderResult { return &GitHubTokenProviderResult{Cancelled: true} } -// GitHubTokenProvider acquires session-scoped GitHub tokens on demand. Initial -// cancellation, errors, and invalid token responses reject session creation or -// resume instead of falling back to ambient authentication. +// GitHubTokenProvider acquires session- or host-scoped GitHub tokens on demand. +// Cancellation, errors, and invalid token responses never fall back to ambient +// authentication. Sessions require more than one hour of validity; hosting +// credentials require at least 120 seconds. // // Experimental: GitHubTokenProvider may change or be removed. type GitHubTokenProvider func(args GitHubTokenProviderArgs) (*GitHubTokenProviderResult, error) diff --git a/go/host.go b/go/host.go index 7a75d0d7fb..c6cf2ce479 100644 --- a/go/host.go +++ b/go/host.go @@ -48,10 +48,15 @@ type AhpHostOptions struct { LocalServer *rpc.HostLocalServerOptions // GitHubEnvironment registers the host with Mission Control; Name and ComputeID are required. GitHubEnvironment *rpc.HostGitHubEnvironmentOptions - CreateSession func(context.Context, AhpSessionCreateRequest) (*Session, error) - ResumeSession func(context.Context, AhpSessionResumeRequest) (*Session, error) - OnSessionReleased func(*Session) error - OnExit func(AhpHostExit) error + // GitHubTokenProvider supplies refreshable hosting credentials. It must return + // a bearer valid for at least 120 seconds; errors never fall back to ambient auth. + // The callback belongs to this host and receives no SessionID. + GitHubTokenProvider GitHubTokenProvider + CreateSession func(context.Context, AhpSessionCreateRequest) (*Session, error) + ResumeSession func(context.Context, AhpSessionResumeRequest) (*Session, error) + OnSessionReleased func(*Session) error + OnExit func(AhpHostExit) error + credentialProviderRegistrationID string } // AhpHost is an experimental listener owned by one SDK connection. @@ -114,6 +119,12 @@ func (c *Client) StartAhpHost(ctx context.Context, options *AhpHostOptions) (*Ah if options == nil || (options.LocalServer == nil && options.GitHubEnvironment == nil) { return nil, errors.New("AHP hosting requires localServer or githubEnvironment") } + if options.GitHubTokenProvider != nil && options.GitHubEnvironment == nil { + return nil, errors.New("hosting GitHubTokenProvider requires GitHubEnvironment") + } + if options.GitHubTokenProvider != nil && options.GitHubEnvironment.CredentialProviderRegistrationID != nil { + return nil, errors.New("hosting credential provider and registration ID cannot be combined") + } if err := c.ensureConnected(ctx); err != nil { return nil, err } @@ -129,6 +140,12 @@ func (c *Client) StartAhpHost(ctx context.Context, options *AhpHostOptions) (*Ah hostRPC := c.RPC.Host c.startStopMux.RUnlock() hostID := uuid.NewString() + if opts.GitHubTokenProvider != nil { + environment := *opts.GitHubEnvironment + opts.credentialProviderRegistrationID = c.registerGitHubTokenProvider(opts.GitHubTokenProvider) + environment.CredentialProviderRegistrationID = String(opts.credentialProviderRegistrationID) + opts.GitHubEnvironment = &environment + } c.ahp.mu.Lock() if c.ahp.hosts == nil { c.ahp.hosts = make(map[string]AhpHostOptions) @@ -188,6 +205,9 @@ func (c *Client) releaseAhpHost(hostID string) (AhpHostOptions, bool) { } } c.ahp.mu.Unlock() + if options.credentialProviderRegistrationID != "" { + c.unregisterGitHubTokenProvider(options.credentialProviderRegistrationID) + } for _, id := range handoffs { c.releaseAhpSession(&rpc.HostSessionReleasedNotification{HostID: hostID, HandoffID: id}) } diff --git a/go/host_credentials_test.go b/go/host_credentials_test.go new file mode 100644 index 0000000000..d370a6bbef --- /dev/null +++ b/go/host_credentials_test.go @@ -0,0 +1,114 @@ +package copilot + +import ( + "encoding/json" + "errors" + "fmt" + "testing" + + "github.com/github/copilot-sdk/go/internal/jsonrpc2" + "github.com/github/copilot-sdk/go/rpc" +) + +func TestAhpHostCredentialProvidersAreIsolatedAndReleased(t *testing.T) { + client, server, _ := ahpFixture(t) + var registrations []string + server.SetRequestHandler("host.start", jsonrpc2.RequestHandlerFor(func(params *rpc.HostStartRequest) (*rpc.HostStartResult, *jsonrpc2.Error) { + registrations = append(registrations, *params.GitHubEnvironment.CredentialProviderRegistrationID) + if params.GitHubEnvironment.ComputeID != "agent:4e7d462e-6072-4bc0-bf06-d9faf363a214" { + t.Error("compute identity changed") + } + return &rpc.HostStartResult{HostID: params.HostID}, nil + })) + var hosts []*AhpHost + for index := range 2 { + rotations := 0 + options := &AhpHostOptions{ + GitHubEnvironment: &rpc.HostGitHubEnvironmentOptions{ + Name: "managed host", ComputeID: "agent:4e7d462e-6072-4bc0-bf06-d9faf363a214", + }, + GitHubTokenProvider: func(args GitHubTokenProviderArgs) (*GitHubTokenProviderResult, error) { + if args.SessionID != nil || args.Host != "github.example.com" { + t.Errorf("unexpected host callback arguments: %+v", args) + } + rotations++ + return GitHubTokenResult(&GitHubToken{AccessToken: fmt.Sprintf("host-%d-token-%d", index, rotations), ExpiresIn: 3600}), nil + }, + } + host, err := client.StartAhpHost(t.Context(), options) + if err != nil { + t.Fatal(err) + } + if options.GitHubEnvironment.CredentialProviderRegistrationID != nil { + t.Fatal("StartAhpHost mutated caller options") + } + hosts = append(hosts, host) + } + if registrations[0] == registrations[1] { + t.Fatal("hosts share credential registrations") + } + for rotation := 1; rotation <= 2; rotation++ { + for index, registration := range registrations { + raw, err := server.Request(t.Context(), "gitHubToken.getToken", &rpc.GitHubTokenAcquireRequest{ + RegistrationID: registration, Host: "github.example.com", Reason: rpc.GitHubTokenAcquireReasonRefresh, + }) + if err != nil { + t.Fatal(err) + } + var token rpc.GitHubTokenAcquireResultToken + if err := json.Unmarshal(raw, &token); err != nil { + t.Fatal(err) + } + if token.AccessToken != fmt.Sprintf("host-%d-token-%d", index, rotation) { + t.Fatal("wrong host's credential returned") + } + } + } + client.handleAhpExit(&rpc.HostExitedNotification{HostID: hosts[0].HostID, Reason: "disposed"}) + adapter := &gitHubTokenAdapter{client: client} + if _, err := adapter.GetToken(&rpc.GitHubTokenAcquireRequest{RegistrationID: registrations[0]}); err == nil { + t.Fatal("exited host retained provider") + } + if _, err := adapter.GetToken(&rpc.GitHubTokenAcquireRequest{RegistrationID: registrations[1], Host: "github.example.com"}); err != nil { + t.Fatalf("one host's exit removed another provider: %v", err) + } + client.disconnectAhpHosts() + if len(client.gitHubTokenProviders) != 0 { + t.Fatal("disconnect retained hosting providers") + } +} + +func TestAhpHostCredentialProviderFailureAndStartupRollback(t *testing.T) { + client, server, _ := ahpFixture(t) + sentinel := errors.New("credential acquisition failed") + var registration string + server.SetRequestHandler("host.start", jsonrpc2.RequestHandlerFor(func(params *rpc.HostStartRequest) (*rpc.HostStartResult, *jsonrpc2.Error) { + registration = *params.GitHubEnvironment.CredentialProviderRegistrationID + adapter := &gitHubTokenAdapter{client: client} + if _, err := adapter.GetToken(&rpc.GitHubTokenAcquireRequest{RegistrationID: registration}); !errors.Is(err, sentinel) { + t.Errorf("provider error not preserved: %v", err) + } + return nil, &jsonrpc2.Error{Code: -32000, Message: "hosting preflight failed"} + })) + _, err := client.StartAhpHost(t.Context(), &AhpHostOptions{ + GitHubEnvironment: &rpc.HostGitHubEnvironmentOptions{Name: "managed", ComputeID: "compute"}, + GitHubTokenProvider: func(GitHubTokenProviderArgs) (*GitHubTokenProviderResult, error) { + return nil, sentinel + }, + }) + if err == nil || registration == "" || len(client.gitHubTokenProviders) != 0 { + t.Fatalf("startup rollback: error=%v, providers=%d", err, len(client.gitHubTokenProviders)) + } +} + +func TestAhpHostCredentialProviderRequiresUnambiguousEnvironment(t *testing.T) { + provider := func(GitHubTokenProviderArgs) (*GitHubTokenProviderResult, error) { return GitHubTokenCancelled(), nil } + for _, options := range []*AhpHostOptions{ + {LocalServer: &rpc.HostLocalServerOptions{}, GitHubTokenProvider: provider}, + {GitHubEnvironment: &rpc.HostGitHubEnvironmentOptions{CredentialProviderRegistrationID: String("other")}, GitHubTokenProvider: provider}, + } { + if _, err := NewClient(nil).StartAhpHost(t.Context(), options); err == nil { + t.Fatal("invalid provider configuration accepted") + } + } +} diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index 7f341d8b5f..9da5f0e308 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -5282,7 +5282,8 @@ type GitHubTokenAcquireRequest struct { Reason GitHubTokenAcquireReason `json:"reason"` // Opaque identifier generated by the SDK for this callback registration. RegistrationID string `json:"registrationId"` - // Session receiving the token. Absent only before a cloud session has been assigned its id. + // Session receiving the token. Absent for hosting credentials and before a cloud session + // has been assigned its id. SessionID *string `json:"sessionId,omitempty"` } @@ -5315,8 +5316,8 @@ func (GitHubTokenAcquireResultCancelled) Kind() GitHubTokenAcquireResultKind { type GitHubTokenAcquireResultToken struct { // GitHub access token acquired by the SDK host. AccessToken string `json:"accessToken"` - // Remaining token lifetime in seconds when callback execution completes. It must exceed the - // one-hour preflight refresh threshold. + // Remaining token lifetime in seconds when callback execution completes. Session providers + // require more than one hour; hosting providers require at least 120 seconds. ExpiresIn int64 `json:"expiresIn"` // OAuth token type. Defaults to bearer when omitted. TokenType *string `json:"tokenType,omitempty"` @@ -5903,6 +5904,13 @@ type HostGetEnvironmentCredentialsResult struct { type HostGitHubEnvironmentOptions struct { // Stable application installation identity, reused across host restarts. ComputeID string `json:"computeId"` + // Opaque SDK registration for a refreshable hosting credential. Tokens are requested only + // from the owning SDK connection through gitHubToken.getToken and must remain valid for at + // least 120 seconds. Omitting this uses the runtime's existing authentication. + CredentialProviderRegistrationID *string `json:"credentialProviderRegistrationId,omitempty"` + // Registration kind. Defaults to user-local; managed kinds adopt the preallocated + // environment identified by the authenticated owner and computeId. + Kind *HostEnvironmentKind `json:"kind,omitempty"` // Human-readable environment display name. Name string `json:"name"` // Require sealed, connection-bound authentication (default true), independent of listener @@ -5910,6 +5918,10 @@ type HostGitHubEnvironmentOptions struct { // use only when the caller fully controls and trusts the direct transport. Relay token // encryption remains mandatory. RequireConnectionBinding *bool `json:"requireConnectionBinding,omitempty"` + // Runtime authentication principal, independent of Mission Control's routing owner. + // Defaults to user. github-app requires a separately built managed-hosting runtime and a + // managed-sandbox registration; ordinary runtime builds reject it. + RuntimePrincipal *HostRuntimePrincipal `json:"runtimePrincipal,omitempty"` } // Reads a running host's catalog or the runtime's saved default catalog. @@ -24402,6 +24414,20 @@ const ( HookTypeUserPromptTransformed HookType = "userPromptTransformed" ) +// Compute kinds supported by attached environment registration. +// Experimental: HostEnvironmentKind is part of an experimental API and may change or be +// removed. +type HostEnvironmentKind string + +const ( + // A preallocated GitHub-managed cloud agent host. + HostEnvironmentKindManagedCca HostEnvironmentKind = "managed-cca" + // A preallocated GitHub-managed sandbox. + HostEnvironmentKindManagedSandbox HostEnvironmentKind = "managed-sandbox" + // An ordinary user-managed local host. + HostEnvironmentKindUserLocal HostEnvironmentKind = "user-local" +) + // Experimental: HostExitReason is part of an experimental API and may change or be removed. type HostExitReason string @@ -24417,6 +24443,19 @@ const ( HostExitReasonRuntimeShutdown HostExitReason = "runtimeShutdown" ) +// Authentication principal used by the attached AHP host. +// Experimental: HostRuntimePrincipal is part of an experimental API and may change or be +// removed. +type HostRuntimePrincipal string + +const ( + // Authenticate the provisioned GitHub App using the managed host's existing sandbox + // admission. + HostRuntimePrincipalGitHubApp HostRuntimePrincipal = "github-app" + // Authenticate every connection as the host's single GitHub user. + HostRuntimePrincipalUser HostRuntimePrincipal = "user" +) + // Live indexed-search state for this session activation, never inferred from persisted // history. // Experimental: IndexedSearchState is part of an experimental API and may change or be diff --git a/java/scripts/codegen/java.test.ts b/java/scripts/codegen/java.test.ts index ba931e7132..9fa47f4016 100644 --- a/java/scripts/codegen/java.test.ts +++ b/java/scripts/codegen/java.test.ts @@ -62,6 +62,24 @@ test("host environment options preserve the legacy two-argument constructor", () ); }); +test("managed host fields preserve both shipped environment constructors", () => { + const source = generateRpcClass("HostGitHubEnvironmentOptions", { + type: "object", + properties: { + name: { type: "string" }, + computeId: { type: "string" }, + kind: { type: "string" }, + credentialProviderRegistrationId: { type: "string" }, + runtimePrincipal: { type: "string" }, + requireConnectionBinding: { type: ["boolean", "null"] }, + }, + required: ["name", "computeId"], + }).code; + assert.match(source, /this\(name, computeId, null, null, null, null\);/); + assert.match(source, /public HostGitHubEnvironmentOptions\(\s*String name,\s*String computeId,\s*Boolean requireConnectionBinding\s*\)/s); + assert.match(source, /this\(name, computeId, null, null, null, requireConnectionBinding\);/); +}); + test("arbitrary handoff maps accept scalar and structured JSON values", () => { const result = schemaTypeToJava( { type: "object", additionalProperties: true }, diff --git a/java/scripts/codegen/java.ts b/java/scripts/codegen/java.ts index d327ec4409..a4e493589f 100644 --- a/java/scripts/codegen/java.ts +++ b/java/scripts/codegen/java.ts @@ -2444,30 +2444,38 @@ export function generateRpcClass( className === "McpOauthRequiredStaticClientConfig" ? { fieldNames: ["clientId", "clientSecret", "publicClient", "grantType"], - omittedField: "scope", + omittedFields: ["scope"], description: "Creates a static OAuth client configuration without an explicit scope.", } : className === "ManagedSettingsResolveParams" ? { fieldNames: ["selectionId", "gitHubToken", "clientName"], - omittedField: "workingDirectory", + omittedFields: ["workingDirectory"], description: "Creates managed-settings resolution parameters without a working directory.", } : className === "SessionFsSetProviderCapabilities" ? { fieldNames: ["sqlite"], - omittedField: "binary", + omittedFields: ["binary"], description: "Creates provider capabilities without binary reads.", } : className === "HostGitHubEnvironmentOptions" ? { fieldNames: ["name", "computeId"], - omittedField: "requireConnectionBinding", + omittedFields: ["kind", "credentialProviderRegistrationId", "runtimePrincipal", "requireConnectionBinding"], description: "Creates environment options using the default connection-binding policy.", } : undefined; - if (legacyConstructor) { - const legacyFieldNames = legacyConstructor.fieldNames; + const legacyConstructors = legacyConstructor ? [legacyConstructor] : []; + if (className === "HostGitHubEnvironmentOptions" && fields.length > 3) { + legacyConstructors.push({ + fieldNames: ["name", "computeId", "requireConnectionBinding"], + omittedFields: ["kind", "credentialProviderRegistrationId", "runtimePrincipal"], + description: "Creates user-local environment options with the selected connection-binding policy.", + }); + } + for (const constructor of legacyConstructors) { + const legacyFieldNames = constructor.fieldNames; const legacyFields = legacyFieldNames.map((fieldName) => { const field = fields.find((candidate) => candidate.javaName === fieldName); if (!field) { @@ -2476,13 +2484,13 @@ export function generateRpcClass( return field; }); const omittedFields = fields.filter((field) => !legacyFieldNames.includes(field.javaName)); - if (omittedFields.length !== 1 || omittedFields[0].javaName !== legacyConstructor.omittedField) { + if (omittedFields.length === 0 || omittedFields.some((field) => !constructor.omittedFields.includes(field.javaName))) { throw new Error(`Unexpected compatibility fields for ${className}`); } lines.push(``); lines.push(` /**`); - lines.push(` * ${legacyConstructor.description}`); + lines.push(` * ${constructor.description}`); lines.push(` *`); for (const field of legacyFields) { const description = (field.description || field.propName) @@ -2496,7 +2504,7 @@ export function generateRpcClass( lines.push(` ${field.javaType} ${field.javaName}${index < legacyFields.length - 1 ? "," : ""}`); }); lines.push(` ) {`); - lines.push(` this(${legacyFieldNames.join(", ")}, null);`); + lines.push(` this(${fields.map((field) => legacyFieldNames.includes(field.javaName) ? field.javaName : "null").join(", ")});`); lines.push(` }`); } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/GitHubTokenAcquireRequest.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/GitHubTokenAcquireRequest.java index 890af9a526..9232db0712 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/GitHubTokenAcquireRequest.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/GitHubTokenAcquireRequest.java @@ -29,7 +29,7 @@ public record GitHubTokenAcquireRequest( @JsonProperty("registrationId") String registrationId, /** Effective GitHub host for which the callback must return a token. */ @JsonProperty("host") String host, - /** Session receiving the token. Absent only before a cloud session has been assigned its id. */ + /** Session receiving the token. Absent for hosting credentials and before a cloud session has been assigned its id. */ @JsonProperty("sessionId") String sessionId, /** Why the runtime is requesting a GitHub credential. */ @JsonProperty("reason") GitHubTokenAcquireReason reason diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/GitHubTokenAcquireResultToken.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/GitHubTokenAcquireResultToken.java index cc250a54fd..d4e22673ff 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/GitHubTokenAcquireResultToken.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/GitHubTokenAcquireResultToken.java @@ -36,7 +36,7 @@ public final class GitHubTokenAcquireResultToken extends GitHubTokenAcquireResul @JsonProperty("tokenType") private String tokenType; - /** Remaining token lifetime in seconds when callback execution completes. It must exceed the one-hour preflight refresh threshold. */ + /** Remaining token lifetime in seconds when callback execution completes. Session providers require more than one hour; hosting providers require at least 120 seconds. */ @JsonProperty("expiresIn") private Long expiresIn; diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostGitHubEnvironmentOptions.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostGitHubEnvironmentOptions.java index 5a7f72d855..af7652d1f2 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostGitHubEnvironmentOptions.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostGitHubEnvironmentOptions.java @@ -29,6 +29,12 @@ public record HostGitHubEnvironmentOptions( @JsonProperty("name") String name, /** Stable application installation identity, reused across host restarts. */ @JsonProperty("computeId") String computeId, + /** Registration kind. Defaults to user-local; managed kinds adopt the preallocated environment identified by the authenticated owner and computeId. */ + @JsonProperty("kind") HostEnvironmentKind kind, + /** Opaque SDK registration for a refreshable hosting credential. Tokens are requested only from the owning SDK connection through gitHubToken.getToken and must remain valid for at least 120 seconds. Omitting this uses the runtime's existing authentication. */ + @JsonProperty("credentialProviderRegistrationId") String credentialProviderRegistrationId, + /** Runtime authentication principal, independent of Mission Control's routing owner. Defaults to user. github-app requires a separately built managed-hosting runtime and a managed-sandbox registration; ordinary runtime builds reject it. */ + @JsonProperty("runtimePrincipal") HostRuntimePrincipal runtimePrincipal, /** Require sealed, connection-bound authentication (default true), independent of listener address. False permits unsealed direct credentials and unbound sealed relay credentials; use only when the caller fully controls and trusts the direct transport. Relay token encryption remains mandatory. */ @JsonProperty("requireConnectionBinding") Boolean requireConnectionBinding ) { @@ -43,6 +49,21 @@ public HostGitHubEnvironmentOptions( String name, String computeId ) { - this(name, computeId, null); + this(name, computeId, null, null, null, null); + } + + /** + * Creates user-local environment options with the selected connection-binding policy. + * + * @param name Human-readable environment display name. + * @param computeId Stable application installation identity, reused across host restarts. + * @param requireConnectionBinding Require sealed, connection-bound authentication (default true), independent of listener address. False permits unsealed direct credentials and unbound sealed relay credentials; use only when the caller fully controls and trusts the direct transport. Relay token encryption remains mandatory. + */ + public HostGitHubEnvironmentOptions( + String name, + String computeId, + Boolean requireConnectionBinding + ) { + this(name, computeId, null, null, null, requireConnectionBinding); } } diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index bccd27643b..600dba59ad 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -2072,7 +2072,7 @@ export type GitHubTokenAcquireResult = */ tokenType?: string; /** - * Remaining token lifetime in seconds when callback execution completes. It must exceed the one-hour preflight refresh threshold. + * Remaining token lifetime in seconds when callback execution completes. Session providers require more than one hour; hosting providers require at least 120 seconds. */ expiresIn: number; /** @@ -2204,6 +2204,32 @@ export type HistoryRewindOutcome = | "checkpoint-cleanup-failed" /** Files and conversation were rewound, but obsolete file snapshots could not be removed; only conversation-and-files rewinds produce this. */ | "snapshot-prune-failed"; +/** + * Compute kinds supported by attached environment registration. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HostEnvironmentKind". + */ +/** @experimental */ +export type HostEnvironmentKind = + /** An ordinary user-managed local host. */ + | "user-local" + /** A preallocated GitHub-managed sandbox. */ + | "managed-sandbox" + /** A preallocated GitHub-managed cloud agent host. */ + | "managed-cca"; +/** + * Authentication principal used by the attached AHP host. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HostRuntimePrincipal". + */ +/** @experimental */ +export type HostRuntimePrincipal = + /** Authenticate every connection as the host's single GitHub user. */ + | "user" + /** Authenticate the provisioned GitHub App using the managed host's existing sandbox admission. */ + | "github-app"; /** @experimental */ export type HostExitReason = @@ -12393,7 +12419,7 @@ export interface GitHubTokenAcquireRequest { */ host: string; /** - * Session receiving the token. Absent only before a cloud session has been assigned its id. + * Session receiving the token. Absent for hosting credentials and before a cloud session has been assigned its id. */ sessionId?: string; reason: GitHubTokenAcquireReason; @@ -13203,6 +13229,12 @@ export interface HostGitHubEnvironmentOptions { * Stable application installation identity, reused across host restarts. */ computeId: string; + kind?: HostEnvironmentKind; + /** + * Opaque SDK registration for a refreshable hosting credential. Tokens are requested only from the owning SDK connection through gitHubToken.getToken and must remain valid for at least 120 seconds. Omitting this uses the runtime's existing authentication. + */ + credentialProviderRegistrationId?: string; + runtimePrincipal?: HostRuntimePrincipal; /** * Require sealed, connection-bound authentication (default true), independent of listener address. False permits unsealed direct credentials and unbound sealed relay credentials; use only when the caller fully controls and trusts the direct transport. Relay token encryption remains mandatory. */ diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index e496e3addf..ef16127e6f 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -5107,43 +5107,26 @@ def to_dict(self) -> dict: return result # Experimental: this type is part of an experimental API and may change or be removed. -@dataclass -class HostGitHubEnvironmentOptions: - """Requested GitHub Mission Control registration. +class HostEnvironmentKind(Enum): + """Registration kind. Defaults to user-local; managed kinds adopt the preallocated + environment identified by the authenticated owner and computeId. - GitHub Mission Control registration options. The compute ID is application-owned and - stable. - - Registers a GitHub Mission Control environment and enables its relay transport. + Compute kinds supported by attached environment registration. """ - compute_id: str - """Stable application installation identity, reused across host restarts.""" + MANAGED_CCA = "managed-cca" + MANAGED_SANDBOX = "managed-sandbox" + USER_LOCAL = "user-local" - name: str - """Human-readable environment display name.""" +# Experimental: this type is part of an experimental API and may change or be removed. +class HostRuntimePrincipal(Enum): + """Runtime authentication principal, independent of Mission Control's routing owner. + Defaults to user. github-app requires a separately built managed-hosting runtime and a + managed-sandbox registration; ordinary runtime builds reject it. - require_connection_binding: bool | None = None - """Require sealed, connection-bound authentication (default true), independent of listener - address. False permits unsealed direct credentials and unbound sealed relay credentials; - use only when the caller fully controls and trusts the direct transport. Relay token - encryption remains mandatory. + Authentication principal used by the attached AHP host. """ - - @staticmethod - def from_dict(obj: Any) -> 'HostGitHubEnvironmentOptions': - assert isinstance(obj, dict) - compute_id = from_str(obj.get("computeId")) - name = from_str(obj.get("name")) - require_connection_binding = from_union([from_bool, from_none], obj.get("requireConnectionBinding")) - return HostGitHubEnvironmentOptions(compute_id, name, require_connection_binding) - - def to_dict(self) -> dict: - result: dict = {} - result["computeId"] = from_str(self.compute_id) - result["name"] = from_str(self.name) - if self.require_connection_binding is not None: - result["requireConnectionBinding"] = from_union([from_bool, from_none], self.require_connection_binding) - return result + GITHUB_APP = "github-app" + USER = "user" # Experimental: this type is part of an experimental API and may change or be removed. @dataclass @@ -23367,7 +23350,9 @@ class GitHubTokenAcquireRequest: """Opaque identifier generated by the SDK for this callback registration.""" session_id: str | None = None - """Session receiving the token. Absent only before a cloud session has been assigned its id.""" + """Session receiving the token. Absent for hosting credentials and before a cloud session + has been assigned its id. + """ @staticmethod def from_dict(obj: Any) -> 'GitHubTokenAcquireRequest': @@ -23399,8 +23384,8 @@ class GitHubTokenAcquireResult: """GitHub access token acquired by the SDK host.""" expires_in: int | None = None - """Remaining token lifetime in seconds when callback execution completes. It must exceed the - one-hour preflight refresh threshold. + """Remaining token lifetime in seconds when callback execution completes. Session providers + require more than one hour; hosting providers require at least 120 seconds. """ token_type: str | None = None """OAuth token type. Defaults to bearer when omitted.""" @@ -23778,38 +23763,64 @@ def to_dict(self) -> dict: # Experimental: this type is part of an experimental API and may change or be removed. @dataclass -class HostConfiguration: - """Normalized listener settings delivered only to the supervised hosting participant.""" +class HostGitHubEnvironmentOptions: + """Requested GitHub Mission Control registration. - resume_factory: bool - """Whether app-owned durable sessions are resumed by the owning application.""" + GitHub Mission Control registration options. The compute ID is application-owned and + stable. - session_factory: bool - """Whether session materialization is delegated to the owning application.""" + Registers a GitHub Mission Control environment and enables its relay transport. + """ + compute_id: str + """Stable application installation identity, reused across host restarts.""" - github_environment: HostGitHubEnvironmentOptions | None = None - """Requested GitHub Mission Control registration.""" + name: str + """Human-readable environment display name.""" - local_server: HostLocalServerConfiguration | None = None - """Normalized local listener settings, absent for relay-only hosts.""" + credential_provider_registration_id: str | None = None + """Opaque SDK registration for a refreshable hosting credential. Tokens are requested only + from the owning SDK connection through gitHubToken.getToken and must remain valid for at + least 120 seconds. Omitting this uses the runtime's existing authentication. + """ + kind: HostEnvironmentKind | None = None + """Registration kind. Defaults to user-local; managed kinds adopt the preallocated + environment identified by the authenticated owner and computeId. + """ + require_connection_binding: bool | None = None + """Require sealed, connection-bound authentication (default true), independent of listener + address. False permits unsealed direct credentials and unbound sealed relay credentials; + use only when the caller fully controls and trusts the direct transport. Relay token + encryption remains mandatory. + """ + runtime_principal: HostRuntimePrincipal | None = None + """Runtime authentication principal, independent of Mission Control's routing owner. + Defaults to user. github-app requires a separately built managed-hosting runtime and a + managed-sandbox registration; ordinary runtime builds reject it. + """ @staticmethod - def from_dict(obj: Any) -> 'HostConfiguration': + def from_dict(obj: Any) -> 'HostGitHubEnvironmentOptions': assert isinstance(obj, dict) - resume_factory = from_bool(obj.get("resumeFactory")) - session_factory = from_bool(obj.get("sessionFactory")) - github_environment = from_union([HostGitHubEnvironmentOptions.from_dict, from_none], obj.get("githubEnvironment")) - local_server = from_union([HostLocalServerConfiguration.from_dict, from_none], obj.get("localServer")) - return HostConfiguration(resume_factory, session_factory, github_environment, local_server) + compute_id = from_str(obj.get("computeId")) + name = from_str(obj.get("name")) + credential_provider_registration_id = from_union([from_str, from_none], obj.get("credentialProviderRegistrationId")) + kind = from_union([HostEnvironmentKind, from_none], obj.get("kind")) + require_connection_binding = from_union([from_bool, from_none], obj.get("requireConnectionBinding")) + runtime_principal = from_union([HostRuntimePrincipal, from_none], obj.get("runtimePrincipal")) + return HostGitHubEnvironmentOptions(compute_id, name, credential_provider_registration_id, kind, require_connection_binding, runtime_principal) def to_dict(self) -> dict: result: dict = {} - result["resumeFactory"] = from_bool(self.resume_factory) - result["sessionFactory"] = from_bool(self.session_factory) - if self.github_environment is not None: - result["githubEnvironment"] = from_union([lambda x: to_class(HostGitHubEnvironmentOptions, x), from_none], self.github_environment) - if self.local_server is not None: - result["localServer"] = from_union([lambda x: to_class(HostLocalServerConfiguration, x), from_none], self.local_server) + result["computeId"] = from_str(self.compute_id) + result["name"] = from_str(self.name) + if self.credential_provider_registration_id is not None: + result["credentialProviderRegistrationId"] = from_union([from_str, from_none], self.credential_provider_registration_id) + if self.kind is not None: + result["kind"] = from_union([lambda x: to_enum(HostEnvironmentKind, x), from_none], self.kind) + if self.require_connection_binding is not None: + result["requireConnectionBinding"] = from_union([from_bool, from_none], self.require_connection_binding) + if self.runtime_principal is not None: + result["runtimePrincipal"] = from_union([lambda x: to_enum(HostRuntimePrincipal, x), from_none], self.runtime_principal) return result # Experimental: this type is part of an experimental API and may change or be removed. @@ -23867,56 +23878,6 @@ def to_dict(self) -> dict: result["sessions"] = from_list(lambda x: to_class(HostSessionSummary, x), self.sessions) return result -# Experimental: this type is part of an experimental API and may change or be removed. -@dataclass -class HostStartRequest: - """Starts a supervised AHP host with at least one explicitly selected transport.""" - - host_id: str - """Caller-generated UUID identifying this connection-owned listener.""" - - compute_id: str | None = field(default=None, kw_only=True) - """Stable application identity selecting its durable host catalog. Defaults to the persisted - runtime compute GUID; must agree with githubEnvironment.computeId when both are supplied. - """ - github_environment: HostGitHubEnvironmentOptions | None = None - """Registers a GitHub Mission Control environment and enables its relay transport.""" - - local_server: HostLocalServerOptions | None = None - """Enables a local WebSocket listener.""" - - resume_factory: bool | None = None - """Ask the owning application to resume its durable AHP sessions.""" - - session_factory: bool | None = None - """Ask the owning SDK application to materialize AHP sessions.""" - - @staticmethod - def from_dict(obj: Any) -> 'HostStartRequest': - assert isinstance(obj, dict) - host_id = from_str(obj.get("hostId")) - compute_id = from_union([from_str, from_none], obj.get("computeId")) - github_environment = from_union([HostGitHubEnvironmentOptions.from_dict, from_none], obj.get("githubEnvironment")) - local_server = from_union([HostLocalServerOptions.from_dict, from_none], obj.get("localServer")) - resume_factory = from_union([from_bool, from_none], obj.get("resumeFactory")) - session_factory = from_union([from_bool, from_none], obj.get("sessionFactory")) - return HostStartRequest(host_id, github_environment, local_server, resume_factory, session_factory, compute_id=compute_id) - - def to_dict(self) -> dict: - result: dict = {} - result["hostId"] = from_str(self.host_id) - if self.compute_id is not None: - result["computeId"] = from_union([from_str, from_none], self.compute_id) - if self.github_environment is not None: - result["githubEnvironment"] = from_union([lambda x: to_class(HostGitHubEnvironmentOptions, x), from_none], self.github_environment) - if self.local_server is not None: - result["localServer"] = from_union([lambda x: to_class(HostLocalServerOptions, x), from_none], self.local_server) - if self.resume_factory is not None: - result["resumeFactory"] = from_union([from_bool, from_none], self.resume_factory) - if self.session_factory is not None: - result["sessionFactory"] = from_union([from_bool, from_none], self.session_factory) - return result - # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class MCPAppsReadResourceRequest: @@ -35715,6 +35676,92 @@ def to_dict(self) -> dict: result["reason"] = from_union([lambda x: to_enum(HistoryRewindUnavailableReason, x), from_none], self.reason) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class HostConfiguration: + """Normalized listener settings delivered only to the supervised hosting participant.""" + + resume_factory: bool + """Whether app-owned durable sessions are resumed by the owning application.""" + + session_factory: bool + """Whether session materialization is delegated to the owning application.""" + + github_environment: HostGitHubEnvironmentOptions | None = None + """Requested GitHub Mission Control registration.""" + + local_server: HostLocalServerConfiguration | None = None + """Normalized local listener settings, absent for relay-only hosts.""" + + @staticmethod + def from_dict(obj: Any) -> 'HostConfiguration': + assert isinstance(obj, dict) + resume_factory = from_bool(obj.get("resumeFactory")) + session_factory = from_bool(obj.get("sessionFactory")) + github_environment = from_union([HostGitHubEnvironmentOptions.from_dict, from_none], obj.get("githubEnvironment")) + local_server = from_union([HostLocalServerConfiguration.from_dict, from_none], obj.get("localServer")) + return HostConfiguration(resume_factory, session_factory, github_environment, local_server) + + def to_dict(self) -> dict: + result: dict = {} + result["resumeFactory"] = from_bool(self.resume_factory) + result["sessionFactory"] = from_bool(self.session_factory) + if self.github_environment is not None: + result["githubEnvironment"] = from_union([lambda x: to_class(HostGitHubEnvironmentOptions, x), from_none], self.github_environment) + if self.local_server is not None: + result["localServer"] = from_union([lambda x: to_class(HostLocalServerConfiguration, x), from_none], self.local_server) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class HostStartRequest: + """Starts a supervised AHP host with at least one explicitly selected transport.""" + + host_id: str + """Caller-generated UUID identifying this connection-owned listener.""" + + compute_id: str | None = field(default=None, kw_only=True) + """Stable application identity selecting its durable host catalog. Defaults to the persisted + runtime compute GUID; must agree with githubEnvironment.computeId when both are supplied. + """ + github_environment: HostGitHubEnvironmentOptions | None = None + """Registers a GitHub Mission Control environment and enables its relay transport.""" + + local_server: HostLocalServerOptions | None = None + """Enables a local WebSocket listener.""" + + resume_factory: bool | None = None + """Ask the owning application to resume its durable AHP sessions.""" + + session_factory: bool | None = None + """Ask the owning SDK application to materialize AHP sessions.""" + + @staticmethod + def from_dict(obj: Any) -> 'HostStartRequest': + assert isinstance(obj, dict) + host_id = from_str(obj.get("hostId")) + compute_id = from_union([from_str, from_none], obj.get("computeId")) + github_environment = from_union([HostGitHubEnvironmentOptions.from_dict, from_none], obj.get("githubEnvironment")) + local_server = from_union([HostLocalServerOptions.from_dict, from_none], obj.get("localServer")) + resume_factory = from_union([from_bool, from_none], obj.get("resumeFactory")) + session_factory = from_union([from_bool, from_none], obj.get("sessionFactory")) + return HostStartRequest(host_id, github_environment, local_server, resume_factory, session_factory, compute_id=compute_id) + + def to_dict(self) -> dict: + result: dict = {} + result["hostId"] = from_str(self.host_id) + if self.compute_id is not None: + result["computeId"] = from_union([from_str, from_none], self.compute_id) + if self.github_environment is not None: + result["githubEnvironment"] = from_union([lambda x: to_class(HostGitHubEnvironmentOptions, x), from_none], self.github_environment) + if self.local_server is not None: + result["localServer"] = from_union([lambda x: to_class(HostLocalServerOptions, x), from_none], self.local_server) + if self.resume_factory is not None: + result["resumeFactory"] = from_union([from_bool, from_none], self.resume_factory) + if self.session_factory is not None: + result["sessionFactory"] = from_union([from_bool, from_none], self.session_factory) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class MCPAppsReadResourceResult: @@ -50186,6 +50233,7 @@ class RPC: host_dispose_request: HostDisposeRequest host_empty_result: HostEmptyResult host_environment_credentials: HostEnvironmentCredentials + host_environment_kind: HostEnvironmentKind host_exited_notification: HostExitedNotification host_exit_reason: HostExitReason host_git_hub_environment_options: HostGitHubEnvironmentOptions @@ -50197,6 +50245,7 @@ class RPC: host_publish_session_result: HostPublishSessionResult host_ready_request: HostReadyRequest host_register_session_request: HostRegisterSessionRequest + host_runtime_principal: HostRuntimePrincipal host_session_create_callback: HostSessionCreateCallback host_session_create_request: HostSessionCreateRequest host_session_create_result: HostSessionCreateResult @@ -51786,6 +51835,7 @@ def from_dict(obj: Any) -> 'RPC': host_dispose_request = HostDisposeRequest.from_dict(obj.get("HostDisposeRequest")) host_empty_result = HostEmptyResult.from_dict(obj.get("HostEmptyResult")) host_environment_credentials = HostEnvironmentCredentials.from_dict(obj.get("HostEnvironmentCredentials")) + host_environment_kind = HostEnvironmentKind(obj.get("HostEnvironmentKind")) host_exited_notification = HostExitedNotification.from_dict(obj.get("HostExitedNotification")) host_exit_reason = HostExitReason(obj.get("HostExitReason")) host_git_hub_environment_options = HostGitHubEnvironmentOptions.from_dict(obj.get("HostGitHubEnvironmentOptions")) @@ -51797,6 +51847,7 @@ def from_dict(obj: Any) -> 'RPC': host_publish_session_result = HostPublishSessionResult.from_dict(obj.get("HostPublishSessionResult")) host_ready_request = HostReadyRequest.from_dict(obj.get("HostReadyRequest")) host_register_session_request = HostRegisterSessionRequest.from_dict(obj.get("HostRegisterSessionRequest")) + host_runtime_principal = HostRuntimePrincipal(obj.get("HostRuntimePrincipal")) host_session_create_callback = HostSessionCreateCallback.from_dict(obj.get("HostSessionCreateCallback")) host_session_create_request = HostSessionCreateRequest.from_dict(obj.get("HostSessionCreateRequest")) host_session_create_result = HostSessionCreateResult.from_dict(obj.get("HostSessionCreateResult")) @@ -52956,7 +53007,7 @@ def from_dict(obj: Any) -> 'RPC': subagent_settings = from_union([SubagentSettings.from_dict, from_none], obj.get("SubagentSettings")) task_progress = from_union([TaskProgress.from_dict, from_none], obj.get("TaskProgress")) workspace_summary = from_union([WorkspaceSummary.from_dict, from_none], obj.get("WorkspaceSummary")) - return RPC(abort_request, abort_result, accepted_enqueue_command_result, account_all_users, account_auth_info, account_get_all_users_result, account_get_current_auth_result, account_get_quota_request, account_get_quota_result, account_kind, account_login_request, account_login_result, account_logout_request, account_logout_result, account_quota_snapshot, accounts_enumerate_request, accounts_get_request, accounts_set_request, account_status, adaptive_thinking_support, agent_discovery_path, agent_discovery_path_list, agent_discovery_path_scope, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_list_request, agent_registry_live_target_entry, agent_registry_live_target_entry_attention_kind, agent_registry_live_target_entry_kind, agent_registry_live_target_entry_last_terminal_event, agent_registry_live_target_entry_status, agent_registry_log_capture, agent_registry_log_capture_open_error_reason, agent_registry_spawn_error, agent_registry_spawn_permission_mode, agent_registry_spawn_registry_timeout, agent_registry_spawn_request, agent_registry_spawn_result, agent_registry_spawn_spawned, agent_registry_spawn_validation_error, agent_registry_spawn_validation_error_field, agent_registry_spawn_validation_error_reason, agent_reload_result, agents_custom_agent_initial_model_decision_params, agents_custom_agent_initial_model_decision_result, agents_discover_request, agent_select_request, agent_select_result, agent_set_prompt_request, agents_get_available_builtins_request, agents_get_available_builtins_result, agents_get_builtin_definition_request, agents_get_builtin_definition_result, agents_get_builtin_listing_definition_request, agents_get_builtin_listing_definition_result, agents_get_builtins_result, agents_get_discovery_paths_request, api_key_auth_info, auth_enumerate_query, auth_enumerate_value, auth_identity, auth_identity_metadata, auth_info, auth_info_type, auth_login_account, auth_login_advance_request, auth_login_begin_request, auth_login_begun, auth_login_cancel_request, auth_login_result_dto, auth_login_result_status, auth_login_step, auth_read_query, auth_read_value, auth_status_dto, auth_validation_error, auth_validation_errors, auth_write, auth_write_result, autopilot_objective_credit_limit, autopilot_objective_get_state_result, autopilot_objective_state, autopilot_objective_status, auto_tier_descriptor, auto_tier_metadata, auto_tier_status, builtin_agent_summary, built_in_model_catalog, built_in_model_catalog_entry, builtin_tool_descriptor, builtin_tool_format, builtin_tool_format_type, builtin_tool_input_schema, builtin_tool_input_schema_type, builtin_tool_safe_for_telemetry, builtin_tool_safe_telemetry_fields, cancel_user_requested_shell_command_result, canvas_action, canvas_action_invoke_request, canvas_action_invoke_result, canvas_close_request, canvas_host_context, canvas_host_context_capabilities, canvas_json_schema, canvas_list, canvas_list_open_result, canvas_open_request, canvas_provider_close_request, canvas_provider_invoke_action_request, canvas_provider_open_request, canvas_provider_open_result, canvas_provider_register_request, canvas_provider_unregister_request, canvas_session_context, capi_session_options, card_digest, card_digest_algorithm, card_digest_value, catalog_agent_plugin_candidate, catalog_agent_plugin_candidate_kind, catalog_agent_plugin_candidate_provenance, catalog_agent_plugin_compatibility_tag, catalog_agent_plugin_media_type, catalog_ai_skill_candidate, catalog_ai_skill_candidate_kind, catalog_ai_skill_candidate_provenance, catalog_ai_skill_installability, catalog_ai_skill_media_type, catalog_authentication_required_error, catalog_authentication_required_reason, catalog_candidate, catalog_candidate_kind, catalog_candidate_source, catalog_candidate_source_embedded, catalog_candidate_source_url, catalog_capability, catalog_capability_id, catalog_client_contract, catalog_contract_violation_error, catalog_contract_violation_reason, catalog_handle_rejected_error, catalog_handle_rejection_reason, catalog_handle_type, catalog_invalid_request_error, catalog_invalid_request_field, catalog_malformed_card_error, catalog_malformed_card_reason, catalog_mcp_server_candidate, catalog_mcp_server_candidate_kind, catalog_mcp_server_candidate_provenance, catalog_mcp_server_installability, catalog_media_type, catalog_negotiated_contract, catalog_negotiation_refused_error, catalog_negotiation_refused_reason, catalog_network_failure_error, catalog_network_failure_reason, catalog_not_installable_error, catalog_not_installable_reason, catalog_plugin_repository_source, catalog_policy_rejected_error, catalog_resource_identity, catalog_resource_version, catalog_search_page, catalog_search_pagination, catalog_search_request, catalog_search_result, catalog_search_succeeded, catalog_search_total_count_relation, catalog_selection_cancelled, catalog_selection_decision, catalog_selection_declined, catalog_selection_foreign, catalog_selection_invalid, catalog_selection_replayed, catalog_selection_request, catalog_selection_result, catalog_selection_selected, catalog_selection_stale, catalog_selection_timed_out, catalog_selection_wrong_kind, catalog_trust_eligibility, catalog_trust_provenance, catalog_trust_snapshot, catalog_trust_snapshot_absent, catalog_trust_snapshot_absent_status, catalog_trust_snapshot_current, catalog_trust_snapshot_current_status, catalog_trust_snapshot_downgraded, catalog_trust_snapshot_downgraded_status, catalog_trust_snapshot_malformed, catalog_trust_snapshot_malformed_status, catalog_trust_snapshot_revoked, catalog_trust_snapshot_revoked_status, catalog_trust_snapshot_schema_version, catalog_trust_snapshot_stale, catalog_trust_snapshot_stale_status, catalog_trust_snapshot_unsupported, catalog_trust_snapshot_unsupported_status, catalog_trust_source, catalog_trust_tier, catalog_unavailable_error, catalog_unavailable_reason, catalog_unavailable_transport_error, catalog_unavailable_transport_reason, catalog_unsafe_retrieval_error, catalog_unsafe_retrieval_reason, catalog_unsupported_kind_error, client_metadata, client_task_cancel_reason, client_task_cancel_request, client_task_cancel_result, command_list, commands_finalize_invocation_effect_request, commands_finalize_invocation_effect_result, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invocation_effect_outcome, commands_invocation_origin, commands_invoke_request, commands_list_request, commands_respond_to_queued_command_request, commands_respond_to_queued_command_result, completions_get_trigger_characters_result, completions_request_request, completions_request_result, configure_session_extensions_params, connect_client_info, connected_remote_session_metadata, connected_remote_session_metadata_kind, connected_remote_session_metadata_repository, connector_account_request, connector_authorization_requirement, connector_authorization_scope, connector_availability, connector_capabilities, connector_catalog_entry, connector_catalog_result, connector_catalog_status, connector_connect_request, connector_connect_result, connector_continue_request, connector_disconnect_result, connector_discovery_account, connector_discovery_account_list, connector_discovery_account_request, connector_discovery_auth_info, connector_discovery_availability, connector_discovery_capabilities, connector_discovery_catalog_entry, connector_discovery_catalog_result, connector_mcp_status, connector_reconcile_request, connector_runtime_status, connector_session_account, connector_status, connect_remote_session_params, connect_request, connect_result, content_exclusion_check_paths_request, content_exclusion_check_paths_result, content_exclusion_path_check, content_filter_mode, context_heaviest_message, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, customization_reload_outcome, customization_reload_status, customization_reload_subsystem, customizations_reload_result, debug_collect_logs_collected_entry, debug_collect_logs_destination, debug_collect_logs_entry, debug_collect_logs_entry_kind, debug_collect_logs_include, debug_collect_logs_redaction, debug_collect_logs_request, debug_collect_logs_result, debug_collect_logs_result_kind, debug_collect_logs_skipped_entry, debug_collect_logs_source, diagnostic_cursor_status, diagnostic_entry, diagnostic_log_level, diagnostics_configuration, diagnostics_configure_request, diagnostic_severity, diagnostic_source, diagnostic_sources_configuration, diagnostics_read_request, diagnostics_read_result, discovered_canvas, discovered_extension, discovered_extension_mode, discovered_extension_plugin, discovered_extensions, discovered_extensions_disable_request, discovered_extensions_enable_request, discovered_extension_source, discovered_hook, discovered_mcp_server, discovered_mcp_server_type, discovered_model, discovered_model_list, enqueue_command_params, enqueue_command_result, env_auth_info, environment_capabilities, environment_kind, environments_delete_request, environments_delete_result, environments_get_request, environments_get_result, environments_list_request, environments_list_result, event_log_read_request, event_log_release_interest_result, event_log_tail_result, event_log_types, events_agent_scope, events_cursor_status, events_read_direction, events_read_result, execute_command_params, execute_command_result, extension, extension_context_push_input, extension_launch_profile, extension_launch_provider_resolve_request, extension_launch_provider_resolve_result, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_shell_exit, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, filter_mapping, fleet_start_request, fleet_start_result, folder_trust_add_params, folder_trust_check_params, folder_trust_check_result, gh_cli_auth_info, git_current_branch_remote_result, git_cwd_request, git_hub_environment, git_hub_owner_option, git_hub_owners_cancel_request, git_hub_owners_cancel_result, git_hub_owners_list_request, git_hub_owners_list_result, git_hub_owners_request_id_result, git_hub_repository_at_path_request, git_hub_repository_at_path_result, git_hub_repository_identity, git_hub_telemetry_client_info, git_hub_telemetry_event, git_hub_telemetry_notification, git_hub_token_acquire_reason, git_hub_token_acquire_request, git_hub_token_acquire_result, git_remote_repository, git_repos_from_remotes_request, git_repos_from_remotes_result, global_state_load_for_config_dir_request, global_state_load_result, global_state_write_key_request, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_clear_context_request, history_clear_context_result, history_compact_context_window, history_compact_request, history_compact_result, history_file_restore_skip_reason, history_list_rewind_points_result, history_preview_rewind_request, history_preview_rewind_result, history_rewind_change_type, history_rewind_file_preview, history_rewind_mode, history_rewind_outcome, history_rewind_point, history_rewind_request, history_rewind_result, history_rewind_unavailable_reason, history_skipped_file_restore, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, hook_invoke_request, hook_invoke_response, hook_origin, hooks_discover_request, hooks_discover_result, hook_type, host_configuration, host_dispose_request, host_empty_result, host_environment_credentials, host_exited_notification, host_exit_reason, host_git_hub_environment_options, host_list_sessions_request, host_list_sessions_result, host_local_server_configuration, host_local_server_options, host_publish_session_request, host_publish_session_result, host_ready_request, host_register_session_request, host_session_create_callback, host_session_create_request, host_session_create_result, host_session_released_notification, host_session_release_request, host_session_summary, host_start_request, host_start_result, installation_catalogue_identity, installation_confirmation_request, installation_confirmation_response, installation_decision, installation_review, installed_plugin, installed_plugin_info, installed_plugin_source, installed_plugin_source_git_hub, installed_plugin_source_local, installed_plugin_source_url, instruction_discovery_path, instruction_discovery_path_kind, instruction_discovery_path_list, instruction_discovery_path_location, instructions_discover_request, instructions_get_discovery_paths_request, instructions_get_sources_result, instruction_source, instruction_source_location, instruction_source_type, interrupt_main_turn_request, interrupt_main_turn_result, json_schema_response_format, llm_inference_headers, llm_inference_http_request_chunk_request, llm_inference_http_request_chunk_result, llm_inference_http_request_start_request, llm_inference_http_request_start_result, llm_inference_http_request_start_transport, llm_inference_http_response_chunk_error, llm_inference_http_response_chunk_request, llm_inference_http_response_chunk_result, llm_inference_http_response_start_request, llm_inference_http_response_start_result, llm_inference_set_provider_result, local_session_metadata_value, logged_in_user, login_provider_kind, log_request, log_result, lsp_initialize_request, managed_mcp_server_config, managed_plugin_retry_entry, managed_plugin_retry_status, managed_setting_meta, managed_settings_channel, managed_settings_compose_layer, managed_settings_compose_request, managed_settings_compose_result, managed_settings_diagnostic, managed_settings_diagnostic_severity, managed_settings_layer, managed_settings_meta, managed_settings_read_result, managed_settings_resolved_data, managed_settings_resolve_request, managed_settings_resolve_result, managed_settings_schema_result, managed_settings_validate_request, managed_settings_validate_result, managed_settings_values, marketplace_add_result, marketplace_browse_result, marketplace_info, marketplace_list_result, marketplace_plugin_info, marketplace_refresh_entry, marketplace_refresh_result, marketplace_remove_result, mcp_allowed_server, mcp_apply_install_request, mcp_apply_uninstall_request, mcp_apps_call_tool_request, mcp_apps_diagnose_capability, mcp_apps_diagnose_request, mcp_apps_diagnose_result, mcp_apps_diagnose_server, mcp_apps_host_context, mcp_apps_host_context_details, mcp_apps_host_context_details_available_display_mode, mcp_apps_host_context_details_display_mode, mcp_apps_host_context_details_platform, mcp_apps_host_context_details_theme, mcp_apps_list_tools_request, mcp_apps_list_tools_result, mcp_apps_read_resource_request, mcp_apps_read_resource_result, mcp_apps_resource_content, mcp_apps_set_host_context_details, mcp_apps_set_host_context_details_available_display_mode, mcp_apps_set_host_context_details_display_mode, mcp_apps_set_host_context_details_platform, mcp_apps_set_host_context_details_theme, mcp_apps_set_host_context_request, mcp_cancel_sampling_execution_params, mcp_cancel_sampling_execution_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_configured_server, mcp_configured_server_list, mcp_configured_server_state, mcp_configure_git_hub_request, mcp_configure_git_hub_result, mcp_diagnostic_details, mcp_diagnostic_direction, mcp_diagnostic_kind, mcp_diagnostic_source_configuration, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_elicitation_form_mode, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_failed_server, mcp_filtered_server, mcp_headers_handle_pending_headers_refresh_request, mcp_headers_handle_pending_headers_refresh_request_request, mcp_headers_handle_pending_headers_refresh_request_result, mcp_host_state, mcp_installation_failure_reason, mcp_installation_input, mcp_installation_management_outcome, mcp_installation_management_result, mcp_installation_operation_request, mcp_installation_operation_status, mcp_installation_outcome, mcp_installation_remote_configuration, mcp_installation_result, mcp_installation_review, mcp_installation_secret, mcp_installation_secret_storage, mcp_installations_request, mcp_installation_state, mcp_installation_summary, mcp_install_plan, mcp_is_server_running_request, mcp_is_server_running_result, mcp_list_tools_request, mcp_list_tools_result, mcp_oauth_authentication_state_changed_request, mcp_oauth_cancel_login_request, mcp_oauth_cancel_login_result, mcp_oauth_complete_request, mcp_oauth_handle_pending_request, mcp_oauth_handle_pending_result, mcp_oauth_login_grant_type, mcp_oauth_login_request, mcp_oauth_login_result, mcp_oauth_pending_request_response, mcp_oauth_prepare_login_request, mcp_oauth_prepare_login_result, mcp_oauth_probe_needs_auth_reason, mcp_oauth_probe_request, mcp_oauth_probe_result, mcp_oauth_respond_request, mcp_oauth_respond_result, mcp_owned_oauth_login_status, mcp_plan_configuration_change, mcp_plan_configuration_operation, mcp_plan_enum_value_type, mcp_plan_install_planned, mcp_plan_install_request, mcp_plan_install_result, mcp_plan_install_source, mcp_plan_install_source_candidate, mcp_plan_install_source_candidate_kind, mcp_plan_install_source_card, mcp_plan_install_source_card_kind, mcp_plan_package_install_method, mcp_plan_package_transport, mcp_plan_policy_decision, mcp_plan_policy_result, mcp_plan_policy_source, mcp_plan_provenance, mcp_plan_remote_install_method, mcp_plan_remote_transport, mcp_plan_required_value, mcp_plan_required_value_enum, mcp_plan_required_value_enum_kind, mcp_plan_required_value_scalar, mcp_plan_required_value_scalar_kind, mcp_plan_resource_identity, mcp_plan_scalar_value_type, mcp_plan_scope, mcp_plan_secret_placeholder, mcp_plan_secret_reference, mcp_plan_target, mcp_plan_transport_choice, mcp_plan_transport_choice_package, mcp_plan_transport_choice_remote, mcp_plan_uninstall_request, mcp_plan_value_category, mcp_prepared_install, mcp_prepare_install_request, mcp_prompt, mcp_prompt_argument, mcp_prompt_icon, mcp_prompt_message, mcp_prompt_role, mcp_prompts_get_request, mcp_prompts_get_result, mcp_prompts_list_request, mcp_prompts_list_result, mcp_register_external_client_request, mcp_reload_config, mcp_reload_with_config_request, mcp_remove_git_hub_result, mcp_resource, mcp_resource_annotations, mcp_resource_content, mcp_resource_icon, mcp_resources_list_request, mcp_resources_list_result, mcp_resources_list_templates_request, mcp_resources_list_templates_result, mcp_resources_read_request, mcp_resources_read_result, mcp_resource_template, mcp_restart_server_request, mcp_safe_for_telemetry, mcp_safe_for_telemetry_fields, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_serializable_server_config, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_card_embedded, mcp_server_card_embedded_kind, mcp_server_card_media_type, mcp_server_card_reference, mcp_server_card_url, mcp_server_card_url_kind, mcp_server_config, mcp_server_config_defer_tools, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_memory, mcp_server_config_memory_type, mcp_server_config_stdio, mcp_server_config_stdio_type, mcp_server_failure_info, mcp_server_list, mcp_server_needs_auth_info, mcp_server_ownership, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, mcp_source_file, mcp_source_plugin, mcp_source_ref, mcp_start_server_request, mcp_start_servers_result, mcp_stop_server_request, mcp_task_metadata, mcp_tools, mcp_tool_ui, mcp_tool_ui_visibility, mcp_uninstall_plan, mcp_unregister_external_client_request, memory_configuration, metadata_context_attribution_result, metadata_context_heaviest_messages_request, metadata_context_heaviest_messages_result, metadata_context_info_request, metadata_context_info_result, metadata_is_processing_result, metadata_recompute_context_tokens_request, metadata_recompute_context_tokens_result, metadata_record_context_change_request, metadata_record_context_change_result, metadata_set_working_directory_request, metadata_set_working_directory_result, metadata_snapshot_current_mode, metadata_snapshot_remote_metadata, metadata_snapshot_remote_metadata_repository, metadata_snapshot_remote_metadata_task_type, metadata_update_client_metadata_request, model, model_apply_startup_overlay_request, model_artifact_details, model_billing, model_billing_promo, model_billing_token_prices, model_billing_token_prices_long_context, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_clear_startup_seed_request, model_clear_startup_seed_result, model_list, model_list_request, model_message, model_picker_category, model_picker_persistence_request, model_picker_price_category, model_picker_settings_context, model_policy, model_policy_state, model_provider_adapter_catalog, model_provider_adapter_descriptor, model_provider_adapter_operation_descriptor, model_provider_attribution, model_provider_automatic_discovery_mode, model_provider_automatic_discovery_policy, model_provider_configuration_disposition, model_provider_configuration_plan, model_provider_descriptor, model_provider_discover_request, model_provider_discover_result, model_provider_discovery_network_scope, model_provider_get_status_request, model_provider_instance, model_provider_instance_reference, model_provider_models_list_request, model_provider_operation_outcome, model_provider_operation_outcome_code, model_provider_prepare_configuration_request, model_provider_provenance, model_provider_provenance_source, model_provider_status, model_provider_warning, model_set_allowed_models_request, model_set_allowed_models_result, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_auto_tier_request, model_switch_auto_tier_result, model_switch_auto_tier_status, model_switch_confirmation, model_switch_to_request, model_switch_to_result, model_warning_text, mode_set_request, mode_set_result, move_mcp_loading_to_background_result, named_provider_config, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_additional_content_exclusion_policy, options_update_additional_content_exclusion_policy_rule, options_update_additional_content_exclusion_policy_rule_source, options_update_additional_content_exclusion_policy_scope, options_update_context_tier, options_update_env_value_mode, options_update_reasoning_summary, options_update_tool_filter_precedence, pending_external_tool_request, pending_external_tool_request_list, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_env_access, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_workflow, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_env_access, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_workflow, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_approve_read_only_for_session, permission_decision_cancelled, permission_decision_context, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_outcome, permission_decision_reject, permission_decision_request, permission_decision_surface, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_mode_source, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_response_capability, permission_rules_set, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_mode_request, permissions_get_mode_result, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_env_access, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_workflow, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_mode_request, permissions_set_mode_result, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_read_sql_todos_result, plan_read_sql_todos_with_dependencies_result, plan_sql_todo_dependency, plan_sql_todos_row, plan_update_request, plugin, plugin_install_result, plugin_install_staging_mode, plugin_list, plugin_list_result, plugins_builtin_set_request, plugins_disable_request, plugins_enable_request, plugins_install_request, plugins_marketplaces_add_request, plugins_marketplaces_browse_request, plugins_marketplaces_refresh_request, plugins_marketplaces_remove_request, plugins_reload_request, plugins_uninstall_request, plugins_update_request, plugin_update_all_entry, plugin_update_all_result, plugin_update_result, protocol_append_mode, protocol_customize_mode, protocol_external_tool_defer, protocol_external_tool_definition, protocol_marker_section_override, protocol_replace_mode, protocol_section_override, protocol_static_section_action, protocol_static_section_override, protocol_system_message_append_config, protocol_system_message_config, protocol_system_message_customize_config, protocol_system_message_replace_config, provider_add_request, provider_add_result, provider_config, provider_config_azure, provider_config_model_provider, provider_config_transport, provider_config_type, provider_config_wire_api, provider_descriptor, provider_endpoint, provider_endpoint_transport, provider_endpoint_type, provider_endpoint_wire_api, provider_get_endpoint_request, provider_model_config, provider_session_token, provider_sync_request, provider_sync_result, provider_token_acquire_request, provider_token_acquire_result, provider_withdraw_request, provider_withdraw_result, push_attachment, push_attachment_blob, push_attachment_directory, push_attachment_file, push_attachment_file_line_range, push_attachment_git_hub_actions_job, push_attachment_git_hub_commit, push_attachment_git_hub_file, push_attachment_git_hub_file_diff, push_attachment_git_hub_file_diff_side, push_attachment_git_hub_reference, push_attachment_git_hub_reference_type, push_attachment_git_hub_release, push_attachment_git_hub_repository, push_attachment_git_hub_snippet, push_attachment_git_hub_tree_comparison, push_attachment_git_hub_tree_comparison_side, push_attachment_git_hub_url, push_attachment_selection, push_attachment_selection_details, push_attachment_selection_details_end, push_attachment_selection_details_start, push_git_hub_repo_ref, queue_append_steering_request, queue_begin_deferred_idle_drain_request, queue_begin_deferred_idle_drain_result, queue_consume_system_notifications_request, queued_command_handled, queued_command_not_handled, queued_command_result, queue_defer_session_idle_request, queue_duplicate_at_request, queue_duplicate_at_result, queue_enqueue_resume_pending_result, queue_finish_deferred_idle_drain_request, queue_finish_deferred_idle_drain_result, queue_has_pending_result, queue_insert_at_request, queue_insert_at_result, queue_insert_message, queue_move_item_request, queue_move_item_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_at_request, queue_remove_at_result, queue_remove_most_recent_result, queue_send_now_request, queue_send_now_result, queue_set_drain_paused_request, queue_snapshot_result, queue_update_text_request, queue_update_text_result, queue_withdraw_message_request, queue_withdraw_message_result, quota_take_warnings_result, quota_warning_projection, register_event_interest_params, register_event_interest_result, release_event_interest_params, remote_control_config, remote_control_config_existing_mc_session, remote_control_status, remote_control_status_active, remote_control_status_connecting, remote_control_status_error, remote_control_status_off, remote_control_status_result, remote_control_stop_result, remote_control_transfer_result, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_host_status, remote_session_metadata_repository, remote_session_metadata_task_type, remote_session_metadata_value, remote_session_mode, remote_session_repository, response_format, sandbox_config, sandbox_config_auth, sandbox_config_source, sandbox_config_user_policy, sandbox_config_user_policy_experimental, sandbox_config_user_policy_experimental_seatbelt, sandbox_config_user_policy_filesystem, sandbox_config_user_policy_network, sandbox_config_user_policy_network_proxy, sandbox_config_user_policy_seatbelt, sandbox_credentials_config, sandbox_disable_for_session_request, sandbox_disable_for_session_result, sandbox_enforcement_status, sandbox_grant_path_for_request_request, sandbox_grant_path_for_request_result, sandbox_host_capability, sandbox_host_capability_name, sandbox_host_support, sandbox_masked_env_var, sandbox_proxy_ca_create_result, sandbox_proxy_ca_request, sandbox_proxy_ca_state, sandbox_proxy_ca_status, sandbox_session_change, schedule_add_at_request, schedule_add_cron_request, schedule_add_request, schedule_add_result, schedule_add_self_paced_request, schedule_entry, schedule_has_self_paced_result, schedule_list, schedule_rearm_self_paced_request, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachments_to_message_params, send_message_item, send_messages_request, send_messages_result, send_mode, send_request, send_result, send_system_notification_request, server_agent_list, server_instruction_source_list, server_skill, server_skill_list, session_activity, session_agent_list_request, session_auth_login_request, session_auth_logout_user_request, session_auth_status, session_auth_switch_request, session_bulk_delete_result, session_cancel_all_background_agents_result, session_capability, session_commands_list_request, session_completion_item, session_connected_ide_info, session_context, session_context_host_type, session_enrich_metadata_result, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_bytes_request, session_fs_read_file_bytes_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_capabilities, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_sqlite_exists_request, session_fs_sqlite_exists_result, session_fs_sqlite_query_request, session_fs_sqlite_query_result, session_fs_sqlite_query_type, session_fs_sqlite_transaction_error, session_fs_sqlite_transaction_error_class, session_fs_sqlite_transaction_request, session_fs_sqlite_transaction_result, session_fs_sqlite_transaction_statement, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_bytes_request, session_fs_write_file_request, session_git_hub_auth_get_all_auth_available_result, session_git_hub_auth_logout_result, session_git_hub_auth_logout_user_result, session_history_compact_request, session_installed_plugin, session_installed_plugin_source, session_installed_plugin_source_git_hub, session_installed_plugin_source_local, session_installed_plugin_source_url, session_limit_prediction_baseline_data, session_limit_prediction_client_type, session_limit_prediction_details, session_limit_prediction_predict_request, session_limit_prediction_request, session_limit_prediction_result, session_limit_prediction_source, session_limit_prediction_tier, session_limit_prediction_tier_option, session_limit_prediction_unavailable_reason, session_list, session_list_entry, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_managed_permissions, session_managed_settings, session_mcp_apps_call_tool_result, session_mcp_oauth_cancel_login_request, session_mcp_oauth_cancel_login_result, session_mcp_oauth_prepare_login_request, session_mcp_oauth_prepare_login_result, session_mcp_set_connected_ide_info_params, session_metadata_snapshot, session_mode, session_model_clear_startup_seed_request, session_model_clear_startup_seed_result, session_model_list, session_model_list_request, session_model_price_category, session_open_options, session_open_options_additional_content_exclusion_policy, session_open_options_additional_content_exclusion_policy_rule, session_open_options_additional_content_exclusion_policy_rule_source, session_open_options_additional_content_exclusion_policy_scope, session_open_options_env_value_mode, session_open_options_reasoning_summary, session_open_params, session_open_result, session_plugins_disable_request, session_plugins_enable_request, session_plugins_install_request, session_plugins_marketplaces_refresh_request, session_plugins_reload_request, session_plugins_retry_managed_request, session_plugins_retry_managed_result, session_provider_get_endpoint_request, session_prune_result, session_quota_delegate_warning, session_quota_get_result, session_quota_plan_tier, session_quota_projection, session_quota_refresh_result, session_quota_snapshot, session_quota_take_warnings_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_client_metadata_entry, sessions_close_request, sessions_close_result, sessions_create_workspace_request, sessions_create_workspace_result, sessions_delete_request, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, session_settings_built_in_tool_availability_snapshot, session_settings_evaluate_predicate_request, session_settings_evaluate_predicate_result, session_settings_job_snapshot, session_settings_model_snapshot, session_settings_online_evaluation_snapshot, session_settings_predicate_name, session_settings_repo_snapshot, session_settings_snapshot, session_settings_validation_snapshot, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_board_entry_count_request, sessions_get_board_entry_count_result, sessions_get_client_metadata_request, sessions_get_client_metadata_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_metadata_request, sessions_get_metadata_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_non_empty_session_ids_request, sessions_list_non_empty_session_ids_result, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_load_workspace_request, sessions_load_workspace_result, sessions_open_attach, sessions_open_cloud, sessions_open_create, sessions_open_handoff, sessions_open_handoff_task_type, sessions_open_progress, sessions_open_progress_status, sessions_open_progress_step, sessions_open_remote, sessions_open_resume, sessions_open_resume_last, sessions_open_status, session_source, sessions_prune_old_request, sessions_read_persisted_events_request, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, sessions_set_remote_control_steering_request, sessions_start_remote_control_request, sessions_stop_remote_control_request, sessions_transfer_remote_control_request, sessions_update_workspace_fields_request, sessions_update_workspace_fields_result, session_telemetry_engagement, session_update_options_params, session_update_options_result, session_usage_set_code_changes_request, session_visibility_status, session_workflow_pause_at_checkpoint_result, session_working_directory_context, session_working_directory_context_host_type, session_working_directory_context_with_client, settable_auth_info, settable_token_auth_info, shell_cancel_user_requested_request, shell_credentials, shell_exec_request, shell_exec_result, shell_execute_user_requested_request, shell_init_profile, shell_init_script, shell_init_script_shell, shell_kill_request, shell_kill_result, shell_kill_signal, shell_options, shutdown_request, skill, skill_apply_install_request, skill_apply_uninstall_request, skill_discovery_path, skill_discovery_path_list, skill_discovery_scope, skill_installation_failure_reason, skill_installation_file_review, skill_installation_location, skill_installation_management_outcome, skill_installation_management_result, skill_installation_operation_request, skill_installation_operation_status, skill_installation_outcome, skill_installation_ownership_state, skill_installation_result, skill_installation_review, skill_installation_scope, skill_installation_session_state, skill_installation_source, skill_installations_request, skill_installation_summary, skill_install_plan, skill_list, skill_plan_install_request, skill_plan_uninstall_request, skill_provider_descriptor, skill_provider_list_request, skill_provider_list_result, skill_provider_read_request, skill_provider_read_result, skills_config_set_disabled_skills_request, skills_config_set_skill_disabled_request, skills_disable_request, skills_discover_request, skills_enable_request, skill_set_enabled_request, skills_get_discovery_paths_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, skill_uninstall_plan, slash_command_add_timeline_entry_result, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_choice, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_model_picker_dialog, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_set_model_result, slash_command_set_plan_model_result, slash_command_show_dialog_result, slash_command_text_result, slash_command_timeline_entry, subagent_settings_entry, subagent_settings_entry_context_tier, system_message_block, task_agent_info, task_agent_progress, task_client_active_status, task_client_execution_mode, task_client_info, task_client_owner, task_client_owner_kind, task_client_owner_presence, task_client_progress, task_client_status, task_client_type, task_client_update, task_complete_data, task_completion_decision, task_execution_mode, task_info, task_kind, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_register_request, tasks_register_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_update_request, tasks_update_result, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, token_provider_auth_info, tool, tool_list, tool_result, tool_result_expanded, tool_result_new_message, tool_result_type, tools_execute_request, tools_get_builtin_descriptors_request, tools_get_builtin_descriptors_result, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_pending_requests_request, tools_list_request, tools_set_request, tools_set_result, tools_shell_descriptor_config, tools_task_complete_event_data_request, tools_update_subagent_settings_result, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_ephemeral_query_request, ui_ephemeral_query_result, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_session_limits_exhausted_request, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_session_limits_exhausted_response, ui_session_limits_exhausted_response_action, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, unsupported_enqueue_command_result, update_subagent_settings_request, usage_get_metrics_result, usage_set_code_changes_request, user_auth_info, user_requested_shell_command_result, user_setting_metadata, user_settings_get_result, user_settings_set_request, visibility_get_result, visibility_set_request, visibility_set_result, workflow_abort_request, workflow_ack_result, workflow_agent_options, workflow_agent_request, workflow_agent_result, workflow_agent_summary, workflow_cancel_request, workflow_current_phase, workflow_declared_limits, workflow_durable_operation, workflow_execute_request, workflow_execute_result, workflow_get_run_progress_request, workflow_get_run_request, workflow_journal_get_request, workflow_journal_get_result, workflow_journal_put_request, workflow_list_runs_request, workflow_list_runs_result, workflow_log_line, workflow_log_line_kind, workflow_log_request, workflow_pause_checkpoint_action, workflow_pause_checkpoint_request, workflow_pause_checkpoint_result, workflow_pause_info, workflow_pause_request, workflow_phase_observation, workflow_phase_status, workflow_progress_line, workflow_progress_page, workflow_resume_request, workflow_resume_result, workflow_run_consumed, workflow_run_detail, workflow_run_failure, workflow_run_failure_kind, workflow_run_limits, workflow_run_options, workflow_run_request, workflow_run_result, workflow_run_status, workflow_run_summary, workflow_run_terminal, workflow_tool_resume_request, workflow_tool_run_options, workflow_tool_run_request, workspace_diff_contents, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_add_summary_request, workspaces_add_summary_result, workspaces_autopilot_objective_exists_result, workspaces_checkpoints, workspaces_create_directory_request, workspaces_create_file_request, workspaces_delete_autopilot_objective_result, workspaces_diff_request, workspaces_ensure_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_autopilot_objective_result, workspaces_read_checkpoint_request, workspaces_read_checkpoint_result, workspaces_read_file_request, workspaces_read_file_result, workspaces_remove_path_request, workspaces_rename_path_request, workspaces_save_large_paste_request, workspaces_save_large_paste_result, workspaces_stat_file_request, workspaces_stat_file_result, workspaces_truncate_summaries_request, workspace_summary_host_type, workspaces_update_metadata_request, workspaces_workspace_details_host_type, workspaces_write_autopilot_objective_request, workspaces_write_autopilot_objective_result, connector_session_account_result, session_auth_info_result, session_context_attribution, session_context_info, subagent_settings, task_progress, workspace_summary) + return RPC(abort_request, abort_result, accepted_enqueue_command_result, account_all_users, account_auth_info, account_get_all_users_result, account_get_current_auth_result, account_get_quota_request, account_get_quota_result, account_kind, account_login_request, account_login_result, account_logout_request, account_logout_result, account_quota_snapshot, accounts_enumerate_request, accounts_get_request, accounts_set_request, account_status, adaptive_thinking_support, agent_discovery_path, agent_discovery_path_list, agent_discovery_path_scope, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_list_request, agent_registry_live_target_entry, agent_registry_live_target_entry_attention_kind, agent_registry_live_target_entry_kind, agent_registry_live_target_entry_last_terminal_event, agent_registry_live_target_entry_status, agent_registry_log_capture, agent_registry_log_capture_open_error_reason, agent_registry_spawn_error, agent_registry_spawn_permission_mode, agent_registry_spawn_registry_timeout, agent_registry_spawn_request, agent_registry_spawn_result, agent_registry_spawn_spawned, agent_registry_spawn_validation_error, agent_registry_spawn_validation_error_field, agent_registry_spawn_validation_error_reason, agent_reload_result, agents_custom_agent_initial_model_decision_params, agents_custom_agent_initial_model_decision_result, agents_discover_request, agent_select_request, agent_select_result, agent_set_prompt_request, agents_get_available_builtins_request, agents_get_available_builtins_result, agents_get_builtin_definition_request, agents_get_builtin_definition_result, agents_get_builtin_listing_definition_request, agents_get_builtin_listing_definition_result, agents_get_builtins_result, agents_get_discovery_paths_request, api_key_auth_info, auth_enumerate_query, auth_enumerate_value, auth_identity, auth_identity_metadata, auth_info, auth_info_type, auth_login_account, auth_login_advance_request, auth_login_begin_request, auth_login_begun, auth_login_cancel_request, auth_login_result_dto, auth_login_result_status, auth_login_step, auth_read_query, auth_read_value, auth_status_dto, auth_validation_error, auth_validation_errors, auth_write, auth_write_result, autopilot_objective_credit_limit, autopilot_objective_get_state_result, autopilot_objective_state, autopilot_objective_status, auto_tier_descriptor, auto_tier_metadata, auto_tier_status, builtin_agent_summary, built_in_model_catalog, built_in_model_catalog_entry, builtin_tool_descriptor, builtin_tool_format, builtin_tool_format_type, builtin_tool_input_schema, builtin_tool_input_schema_type, builtin_tool_safe_for_telemetry, builtin_tool_safe_telemetry_fields, cancel_user_requested_shell_command_result, canvas_action, canvas_action_invoke_request, canvas_action_invoke_result, canvas_close_request, canvas_host_context, canvas_host_context_capabilities, canvas_json_schema, canvas_list, canvas_list_open_result, canvas_open_request, canvas_provider_close_request, canvas_provider_invoke_action_request, canvas_provider_open_request, canvas_provider_open_result, canvas_provider_register_request, canvas_provider_unregister_request, canvas_session_context, capi_session_options, card_digest, card_digest_algorithm, card_digest_value, catalog_agent_plugin_candidate, catalog_agent_plugin_candidate_kind, catalog_agent_plugin_candidate_provenance, catalog_agent_plugin_compatibility_tag, catalog_agent_plugin_media_type, catalog_ai_skill_candidate, catalog_ai_skill_candidate_kind, catalog_ai_skill_candidate_provenance, catalog_ai_skill_installability, catalog_ai_skill_media_type, catalog_authentication_required_error, catalog_authentication_required_reason, catalog_candidate, catalog_candidate_kind, catalog_candidate_source, catalog_candidate_source_embedded, catalog_candidate_source_url, catalog_capability, catalog_capability_id, catalog_client_contract, catalog_contract_violation_error, catalog_contract_violation_reason, catalog_handle_rejected_error, catalog_handle_rejection_reason, catalog_handle_type, catalog_invalid_request_error, catalog_invalid_request_field, catalog_malformed_card_error, catalog_malformed_card_reason, catalog_mcp_server_candidate, catalog_mcp_server_candidate_kind, catalog_mcp_server_candidate_provenance, catalog_mcp_server_installability, catalog_media_type, catalog_negotiated_contract, catalog_negotiation_refused_error, catalog_negotiation_refused_reason, catalog_network_failure_error, catalog_network_failure_reason, catalog_not_installable_error, catalog_not_installable_reason, catalog_plugin_repository_source, catalog_policy_rejected_error, catalog_resource_identity, catalog_resource_version, catalog_search_page, catalog_search_pagination, catalog_search_request, catalog_search_result, catalog_search_succeeded, catalog_search_total_count_relation, catalog_selection_cancelled, catalog_selection_decision, catalog_selection_declined, catalog_selection_foreign, catalog_selection_invalid, catalog_selection_replayed, catalog_selection_request, catalog_selection_result, catalog_selection_selected, catalog_selection_stale, catalog_selection_timed_out, catalog_selection_wrong_kind, catalog_trust_eligibility, catalog_trust_provenance, catalog_trust_snapshot, catalog_trust_snapshot_absent, catalog_trust_snapshot_absent_status, catalog_trust_snapshot_current, catalog_trust_snapshot_current_status, catalog_trust_snapshot_downgraded, catalog_trust_snapshot_downgraded_status, catalog_trust_snapshot_malformed, catalog_trust_snapshot_malformed_status, catalog_trust_snapshot_revoked, catalog_trust_snapshot_revoked_status, catalog_trust_snapshot_schema_version, catalog_trust_snapshot_stale, catalog_trust_snapshot_stale_status, catalog_trust_snapshot_unsupported, catalog_trust_snapshot_unsupported_status, catalog_trust_source, catalog_trust_tier, catalog_unavailable_error, catalog_unavailable_reason, catalog_unavailable_transport_error, catalog_unavailable_transport_reason, catalog_unsafe_retrieval_error, catalog_unsafe_retrieval_reason, catalog_unsupported_kind_error, client_metadata, client_task_cancel_reason, client_task_cancel_request, client_task_cancel_result, command_list, commands_finalize_invocation_effect_request, commands_finalize_invocation_effect_result, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invocation_effect_outcome, commands_invocation_origin, commands_invoke_request, commands_list_request, commands_respond_to_queued_command_request, commands_respond_to_queued_command_result, completions_get_trigger_characters_result, completions_request_request, completions_request_result, configure_session_extensions_params, connect_client_info, connected_remote_session_metadata, connected_remote_session_metadata_kind, connected_remote_session_metadata_repository, connector_account_request, connector_authorization_requirement, connector_authorization_scope, connector_availability, connector_capabilities, connector_catalog_entry, connector_catalog_result, connector_catalog_status, connector_connect_request, connector_connect_result, connector_continue_request, connector_disconnect_result, connector_discovery_account, connector_discovery_account_list, connector_discovery_account_request, connector_discovery_auth_info, connector_discovery_availability, connector_discovery_capabilities, connector_discovery_catalog_entry, connector_discovery_catalog_result, connector_mcp_status, connector_reconcile_request, connector_runtime_status, connector_session_account, connector_status, connect_remote_session_params, connect_request, connect_result, content_exclusion_check_paths_request, content_exclusion_check_paths_result, content_exclusion_path_check, content_filter_mode, context_heaviest_message, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, customization_reload_outcome, customization_reload_status, customization_reload_subsystem, customizations_reload_result, debug_collect_logs_collected_entry, debug_collect_logs_destination, debug_collect_logs_entry, debug_collect_logs_entry_kind, debug_collect_logs_include, debug_collect_logs_redaction, debug_collect_logs_request, debug_collect_logs_result, debug_collect_logs_result_kind, debug_collect_logs_skipped_entry, debug_collect_logs_source, diagnostic_cursor_status, diagnostic_entry, diagnostic_log_level, diagnostics_configuration, diagnostics_configure_request, diagnostic_severity, diagnostic_source, diagnostic_sources_configuration, diagnostics_read_request, diagnostics_read_result, discovered_canvas, discovered_extension, discovered_extension_mode, discovered_extension_plugin, discovered_extensions, discovered_extensions_disable_request, discovered_extensions_enable_request, discovered_extension_source, discovered_hook, discovered_mcp_server, discovered_mcp_server_type, discovered_model, discovered_model_list, enqueue_command_params, enqueue_command_result, env_auth_info, environment_capabilities, environment_kind, environments_delete_request, environments_delete_result, environments_get_request, environments_get_result, environments_list_request, environments_list_result, event_log_read_request, event_log_release_interest_result, event_log_tail_result, event_log_types, events_agent_scope, events_cursor_status, events_read_direction, events_read_result, execute_command_params, execute_command_result, extension, extension_context_push_input, extension_launch_profile, extension_launch_provider_resolve_request, extension_launch_provider_resolve_result, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_shell_exit, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, filter_mapping, fleet_start_request, fleet_start_result, folder_trust_add_params, folder_trust_check_params, folder_trust_check_result, gh_cli_auth_info, git_current_branch_remote_result, git_cwd_request, git_hub_environment, git_hub_owner_option, git_hub_owners_cancel_request, git_hub_owners_cancel_result, git_hub_owners_list_request, git_hub_owners_list_result, git_hub_owners_request_id_result, git_hub_repository_at_path_request, git_hub_repository_at_path_result, git_hub_repository_identity, git_hub_telemetry_client_info, git_hub_telemetry_event, git_hub_telemetry_notification, git_hub_token_acquire_reason, git_hub_token_acquire_request, git_hub_token_acquire_result, git_remote_repository, git_repos_from_remotes_request, git_repos_from_remotes_result, global_state_load_for_config_dir_request, global_state_load_result, global_state_write_key_request, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_clear_context_request, history_clear_context_result, history_compact_context_window, history_compact_request, history_compact_result, history_file_restore_skip_reason, history_list_rewind_points_result, history_preview_rewind_request, history_preview_rewind_result, history_rewind_change_type, history_rewind_file_preview, history_rewind_mode, history_rewind_outcome, history_rewind_point, history_rewind_request, history_rewind_result, history_rewind_unavailable_reason, history_skipped_file_restore, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, hook_invoke_request, hook_invoke_response, hook_origin, hooks_discover_request, hooks_discover_result, hook_type, host_configuration, host_dispose_request, host_empty_result, host_environment_credentials, host_environment_kind, host_exited_notification, host_exit_reason, host_git_hub_environment_options, host_list_sessions_request, host_list_sessions_result, host_local_server_configuration, host_local_server_options, host_publish_session_request, host_publish_session_result, host_ready_request, host_register_session_request, host_runtime_principal, host_session_create_callback, host_session_create_request, host_session_create_result, host_session_released_notification, host_session_release_request, host_session_summary, host_start_request, host_start_result, installation_catalogue_identity, installation_confirmation_request, installation_confirmation_response, installation_decision, installation_review, installed_plugin, installed_plugin_info, installed_plugin_source, installed_plugin_source_git_hub, installed_plugin_source_local, installed_plugin_source_url, instruction_discovery_path, instruction_discovery_path_kind, instruction_discovery_path_list, instruction_discovery_path_location, instructions_discover_request, instructions_get_discovery_paths_request, instructions_get_sources_result, instruction_source, instruction_source_location, instruction_source_type, interrupt_main_turn_request, interrupt_main_turn_result, json_schema_response_format, llm_inference_headers, llm_inference_http_request_chunk_request, llm_inference_http_request_chunk_result, llm_inference_http_request_start_request, llm_inference_http_request_start_result, llm_inference_http_request_start_transport, llm_inference_http_response_chunk_error, llm_inference_http_response_chunk_request, llm_inference_http_response_chunk_result, llm_inference_http_response_start_request, llm_inference_http_response_start_result, llm_inference_set_provider_result, local_session_metadata_value, logged_in_user, login_provider_kind, log_request, log_result, lsp_initialize_request, managed_mcp_server_config, managed_plugin_retry_entry, managed_plugin_retry_status, managed_setting_meta, managed_settings_channel, managed_settings_compose_layer, managed_settings_compose_request, managed_settings_compose_result, managed_settings_diagnostic, managed_settings_diagnostic_severity, managed_settings_layer, managed_settings_meta, managed_settings_read_result, managed_settings_resolved_data, managed_settings_resolve_request, managed_settings_resolve_result, managed_settings_schema_result, managed_settings_validate_request, managed_settings_validate_result, managed_settings_values, marketplace_add_result, marketplace_browse_result, marketplace_info, marketplace_list_result, marketplace_plugin_info, marketplace_refresh_entry, marketplace_refresh_result, marketplace_remove_result, mcp_allowed_server, mcp_apply_install_request, mcp_apply_uninstall_request, mcp_apps_call_tool_request, mcp_apps_diagnose_capability, mcp_apps_diagnose_request, mcp_apps_diagnose_result, mcp_apps_diagnose_server, mcp_apps_host_context, mcp_apps_host_context_details, mcp_apps_host_context_details_available_display_mode, mcp_apps_host_context_details_display_mode, mcp_apps_host_context_details_platform, mcp_apps_host_context_details_theme, mcp_apps_list_tools_request, mcp_apps_list_tools_result, mcp_apps_read_resource_request, mcp_apps_read_resource_result, mcp_apps_resource_content, mcp_apps_set_host_context_details, mcp_apps_set_host_context_details_available_display_mode, mcp_apps_set_host_context_details_display_mode, mcp_apps_set_host_context_details_platform, mcp_apps_set_host_context_details_theme, mcp_apps_set_host_context_request, mcp_cancel_sampling_execution_params, mcp_cancel_sampling_execution_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_configured_server, mcp_configured_server_list, mcp_configured_server_state, mcp_configure_git_hub_request, mcp_configure_git_hub_result, mcp_diagnostic_details, mcp_diagnostic_direction, mcp_diagnostic_kind, mcp_diagnostic_source_configuration, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_elicitation_form_mode, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_failed_server, mcp_filtered_server, mcp_headers_handle_pending_headers_refresh_request, mcp_headers_handle_pending_headers_refresh_request_request, mcp_headers_handle_pending_headers_refresh_request_result, mcp_host_state, mcp_installation_failure_reason, mcp_installation_input, mcp_installation_management_outcome, mcp_installation_management_result, mcp_installation_operation_request, mcp_installation_operation_status, mcp_installation_outcome, mcp_installation_remote_configuration, mcp_installation_result, mcp_installation_review, mcp_installation_secret, mcp_installation_secret_storage, mcp_installations_request, mcp_installation_state, mcp_installation_summary, mcp_install_plan, mcp_is_server_running_request, mcp_is_server_running_result, mcp_list_tools_request, mcp_list_tools_result, mcp_oauth_authentication_state_changed_request, mcp_oauth_cancel_login_request, mcp_oauth_cancel_login_result, mcp_oauth_complete_request, mcp_oauth_handle_pending_request, mcp_oauth_handle_pending_result, mcp_oauth_login_grant_type, mcp_oauth_login_request, mcp_oauth_login_result, mcp_oauth_pending_request_response, mcp_oauth_prepare_login_request, mcp_oauth_prepare_login_result, mcp_oauth_probe_needs_auth_reason, mcp_oauth_probe_request, mcp_oauth_probe_result, mcp_oauth_respond_request, mcp_oauth_respond_result, mcp_owned_oauth_login_status, mcp_plan_configuration_change, mcp_plan_configuration_operation, mcp_plan_enum_value_type, mcp_plan_install_planned, mcp_plan_install_request, mcp_plan_install_result, mcp_plan_install_source, mcp_plan_install_source_candidate, mcp_plan_install_source_candidate_kind, mcp_plan_install_source_card, mcp_plan_install_source_card_kind, mcp_plan_package_install_method, mcp_plan_package_transport, mcp_plan_policy_decision, mcp_plan_policy_result, mcp_plan_policy_source, mcp_plan_provenance, mcp_plan_remote_install_method, mcp_plan_remote_transport, mcp_plan_required_value, mcp_plan_required_value_enum, mcp_plan_required_value_enum_kind, mcp_plan_required_value_scalar, mcp_plan_required_value_scalar_kind, mcp_plan_resource_identity, mcp_plan_scalar_value_type, mcp_plan_scope, mcp_plan_secret_placeholder, mcp_plan_secret_reference, mcp_plan_target, mcp_plan_transport_choice, mcp_plan_transport_choice_package, mcp_plan_transport_choice_remote, mcp_plan_uninstall_request, mcp_plan_value_category, mcp_prepared_install, mcp_prepare_install_request, mcp_prompt, mcp_prompt_argument, mcp_prompt_icon, mcp_prompt_message, mcp_prompt_role, mcp_prompts_get_request, mcp_prompts_get_result, mcp_prompts_list_request, mcp_prompts_list_result, mcp_register_external_client_request, mcp_reload_config, mcp_reload_with_config_request, mcp_remove_git_hub_result, mcp_resource, mcp_resource_annotations, mcp_resource_content, mcp_resource_icon, mcp_resources_list_request, mcp_resources_list_result, mcp_resources_list_templates_request, mcp_resources_list_templates_result, mcp_resources_read_request, mcp_resources_read_result, mcp_resource_template, mcp_restart_server_request, mcp_safe_for_telemetry, mcp_safe_for_telemetry_fields, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_serializable_server_config, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_card_embedded, mcp_server_card_embedded_kind, mcp_server_card_media_type, mcp_server_card_reference, mcp_server_card_url, mcp_server_card_url_kind, mcp_server_config, mcp_server_config_defer_tools, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_memory, mcp_server_config_memory_type, mcp_server_config_stdio, mcp_server_config_stdio_type, mcp_server_failure_info, mcp_server_list, mcp_server_needs_auth_info, mcp_server_ownership, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, mcp_source_file, mcp_source_plugin, mcp_source_ref, mcp_start_server_request, mcp_start_servers_result, mcp_stop_server_request, mcp_task_metadata, mcp_tools, mcp_tool_ui, mcp_tool_ui_visibility, mcp_uninstall_plan, mcp_unregister_external_client_request, memory_configuration, metadata_context_attribution_result, metadata_context_heaviest_messages_request, metadata_context_heaviest_messages_result, metadata_context_info_request, metadata_context_info_result, metadata_is_processing_result, metadata_recompute_context_tokens_request, metadata_recompute_context_tokens_result, metadata_record_context_change_request, metadata_record_context_change_result, metadata_set_working_directory_request, metadata_set_working_directory_result, metadata_snapshot_current_mode, metadata_snapshot_remote_metadata, metadata_snapshot_remote_metadata_repository, metadata_snapshot_remote_metadata_task_type, metadata_update_client_metadata_request, model, model_apply_startup_overlay_request, model_artifact_details, model_billing, model_billing_promo, model_billing_token_prices, model_billing_token_prices_long_context, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_clear_startup_seed_request, model_clear_startup_seed_result, model_list, model_list_request, model_message, model_picker_category, model_picker_persistence_request, model_picker_price_category, model_picker_settings_context, model_policy, model_policy_state, model_provider_adapter_catalog, model_provider_adapter_descriptor, model_provider_adapter_operation_descriptor, model_provider_attribution, model_provider_automatic_discovery_mode, model_provider_automatic_discovery_policy, model_provider_configuration_disposition, model_provider_configuration_plan, model_provider_descriptor, model_provider_discover_request, model_provider_discover_result, model_provider_discovery_network_scope, model_provider_get_status_request, model_provider_instance, model_provider_instance_reference, model_provider_models_list_request, model_provider_operation_outcome, model_provider_operation_outcome_code, model_provider_prepare_configuration_request, model_provider_provenance, model_provider_provenance_source, model_provider_status, model_provider_warning, model_set_allowed_models_request, model_set_allowed_models_result, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_auto_tier_request, model_switch_auto_tier_result, model_switch_auto_tier_status, model_switch_confirmation, model_switch_to_request, model_switch_to_result, model_warning_text, mode_set_request, mode_set_result, move_mcp_loading_to_background_result, named_provider_config, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_additional_content_exclusion_policy, options_update_additional_content_exclusion_policy_rule, options_update_additional_content_exclusion_policy_rule_source, options_update_additional_content_exclusion_policy_scope, options_update_context_tier, options_update_env_value_mode, options_update_reasoning_summary, options_update_tool_filter_precedence, pending_external_tool_request, pending_external_tool_request_list, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_env_access, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_workflow, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_env_access, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_workflow, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_approve_read_only_for_session, permission_decision_cancelled, permission_decision_context, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_outcome, permission_decision_reject, permission_decision_request, permission_decision_surface, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_mode_source, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_response_capability, permission_rules_set, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_mode_request, permissions_get_mode_result, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_env_access, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_workflow, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_mode_request, permissions_set_mode_result, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_read_sql_todos_result, plan_read_sql_todos_with_dependencies_result, plan_sql_todo_dependency, plan_sql_todos_row, plan_update_request, plugin, plugin_install_result, plugin_install_staging_mode, plugin_list, plugin_list_result, plugins_builtin_set_request, plugins_disable_request, plugins_enable_request, plugins_install_request, plugins_marketplaces_add_request, plugins_marketplaces_browse_request, plugins_marketplaces_refresh_request, plugins_marketplaces_remove_request, plugins_reload_request, plugins_uninstall_request, plugins_update_request, plugin_update_all_entry, plugin_update_all_result, plugin_update_result, protocol_append_mode, protocol_customize_mode, protocol_external_tool_defer, protocol_external_tool_definition, protocol_marker_section_override, protocol_replace_mode, protocol_section_override, protocol_static_section_action, protocol_static_section_override, protocol_system_message_append_config, protocol_system_message_config, protocol_system_message_customize_config, protocol_system_message_replace_config, provider_add_request, provider_add_result, provider_config, provider_config_azure, provider_config_model_provider, provider_config_transport, provider_config_type, provider_config_wire_api, provider_descriptor, provider_endpoint, provider_endpoint_transport, provider_endpoint_type, provider_endpoint_wire_api, provider_get_endpoint_request, provider_model_config, provider_session_token, provider_sync_request, provider_sync_result, provider_token_acquire_request, provider_token_acquire_result, provider_withdraw_request, provider_withdraw_result, push_attachment, push_attachment_blob, push_attachment_directory, push_attachment_file, push_attachment_file_line_range, push_attachment_git_hub_actions_job, push_attachment_git_hub_commit, push_attachment_git_hub_file, push_attachment_git_hub_file_diff, push_attachment_git_hub_file_diff_side, push_attachment_git_hub_reference, push_attachment_git_hub_reference_type, push_attachment_git_hub_release, push_attachment_git_hub_repository, push_attachment_git_hub_snippet, push_attachment_git_hub_tree_comparison, push_attachment_git_hub_tree_comparison_side, push_attachment_git_hub_url, push_attachment_selection, push_attachment_selection_details, push_attachment_selection_details_end, push_attachment_selection_details_start, push_git_hub_repo_ref, queue_append_steering_request, queue_begin_deferred_idle_drain_request, queue_begin_deferred_idle_drain_result, queue_consume_system_notifications_request, queued_command_handled, queued_command_not_handled, queued_command_result, queue_defer_session_idle_request, queue_duplicate_at_request, queue_duplicate_at_result, queue_enqueue_resume_pending_result, queue_finish_deferred_idle_drain_request, queue_finish_deferred_idle_drain_result, queue_has_pending_result, queue_insert_at_request, queue_insert_at_result, queue_insert_message, queue_move_item_request, queue_move_item_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_at_request, queue_remove_at_result, queue_remove_most_recent_result, queue_send_now_request, queue_send_now_result, queue_set_drain_paused_request, queue_snapshot_result, queue_update_text_request, queue_update_text_result, queue_withdraw_message_request, queue_withdraw_message_result, quota_take_warnings_result, quota_warning_projection, register_event_interest_params, register_event_interest_result, release_event_interest_params, remote_control_config, remote_control_config_existing_mc_session, remote_control_status, remote_control_status_active, remote_control_status_connecting, remote_control_status_error, remote_control_status_off, remote_control_status_result, remote_control_stop_result, remote_control_transfer_result, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_host_status, remote_session_metadata_repository, remote_session_metadata_task_type, remote_session_metadata_value, remote_session_mode, remote_session_repository, response_format, sandbox_config, sandbox_config_auth, sandbox_config_source, sandbox_config_user_policy, sandbox_config_user_policy_experimental, sandbox_config_user_policy_experimental_seatbelt, sandbox_config_user_policy_filesystem, sandbox_config_user_policy_network, sandbox_config_user_policy_network_proxy, sandbox_config_user_policy_seatbelt, sandbox_credentials_config, sandbox_disable_for_session_request, sandbox_disable_for_session_result, sandbox_enforcement_status, sandbox_grant_path_for_request_request, sandbox_grant_path_for_request_result, sandbox_host_capability, sandbox_host_capability_name, sandbox_host_support, sandbox_masked_env_var, sandbox_proxy_ca_create_result, sandbox_proxy_ca_request, sandbox_proxy_ca_state, sandbox_proxy_ca_status, sandbox_session_change, schedule_add_at_request, schedule_add_cron_request, schedule_add_request, schedule_add_result, schedule_add_self_paced_request, schedule_entry, schedule_has_self_paced_result, schedule_list, schedule_rearm_self_paced_request, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachments_to_message_params, send_message_item, send_messages_request, send_messages_result, send_mode, send_request, send_result, send_system_notification_request, server_agent_list, server_instruction_source_list, server_skill, server_skill_list, session_activity, session_agent_list_request, session_auth_login_request, session_auth_logout_user_request, session_auth_status, session_auth_switch_request, session_bulk_delete_result, session_cancel_all_background_agents_result, session_capability, session_commands_list_request, session_completion_item, session_connected_ide_info, session_context, session_context_host_type, session_enrich_metadata_result, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_bytes_request, session_fs_read_file_bytes_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_capabilities, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_sqlite_exists_request, session_fs_sqlite_exists_result, session_fs_sqlite_query_request, session_fs_sqlite_query_result, session_fs_sqlite_query_type, session_fs_sqlite_transaction_error, session_fs_sqlite_transaction_error_class, session_fs_sqlite_transaction_request, session_fs_sqlite_transaction_result, session_fs_sqlite_transaction_statement, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_bytes_request, session_fs_write_file_request, session_git_hub_auth_get_all_auth_available_result, session_git_hub_auth_logout_result, session_git_hub_auth_logout_user_result, session_history_compact_request, session_installed_plugin, session_installed_plugin_source, session_installed_plugin_source_git_hub, session_installed_plugin_source_local, session_installed_plugin_source_url, session_limit_prediction_baseline_data, session_limit_prediction_client_type, session_limit_prediction_details, session_limit_prediction_predict_request, session_limit_prediction_request, session_limit_prediction_result, session_limit_prediction_source, session_limit_prediction_tier, session_limit_prediction_tier_option, session_limit_prediction_unavailable_reason, session_list, session_list_entry, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_managed_permissions, session_managed_settings, session_mcp_apps_call_tool_result, session_mcp_oauth_cancel_login_request, session_mcp_oauth_cancel_login_result, session_mcp_oauth_prepare_login_request, session_mcp_oauth_prepare_login_result, session_mcp_set_connected_ide_info_params, session_metadata_snapshot, session_mode, session_model_clear_startup_seed_request, session_model_clear_startup_seed_result, session_model_list, session_model_list_request, session_model_price_category, session_open_options, session_open_options_additional_content_exclusion_policy, session_open_options_additional_content_exclusion_policy_rule, session_open_options_additional_content_exclusion_policy_rule_source, session_open_options_additional_content_exclusion_policy_scope, session_open_options_env_value_mode, session_open_options_reasoning_summary, session_open_params, session_open_result, session_plugins_disable_request, session_plugins_enable_request, session_plugins_install_request, session_plugins_marketplaces_refresh_request, session_plugins_reload_request, session_plugins_retry_managed_request, session_plugins_retry_managed_result, session_provider_get_endpoint_request, session_prune_result, session_quota_delegate_warning, session_quota_get_result, session_quota_plan_tier, session_quota_projection, session_quota_refresh_result, session_quota_snapshot, session_quota_take_warnings_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_client_metadata_entry, sessions_close_request, sessions_close_result, sessions_create_workspace_request, sessions_create_workspace_result, sessions_delete_request, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, session_settings_built_in_tool_availability_snapshot, session_settings_evaluate_predicate_request, session_settings_evaluate_predicate_result, session_settings_job_snapshot, session_settings_model_snapshot, session_settings_online_evaluation_snapshot, session_settings_predicate_name, session_settings_repo_snapshot, session_settings_snapshot, session_settings_validation_snapshot, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_board_entry_count_request, sessions_get_board_entry_count_result, sessions_get_client_metadata_request, sessions_get_client_metadata_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_metadata_request, sessions_get_metadata_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_non_empty_session_ids_request, sessions_list_non_empty_session_ids_result, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_load_workspace_request, sessions_load_workspace_result, sessions_open_attach, sessions_open_cloud, sessions_open_create, sessions_open_handoff, sessions_open_handoff_task_type, sessions_open_progress, sessions_open_progress_status, sessions_open_progress_step, sessions_open_remote, sessions_open_resume, sessions_open_resume_last, sessions_open_status, session_source, sessions_prune_old_request, sessions_read_persisted_events_request, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, sessions_set_remote_control_steering_request, sessions_start_remote_control_request, sessions_stop_remote_control_request, sessions_transfer_remote_control_request, sessions_update_workspace_fields_request, sessions_update_workspace_fields_result, session_telemetry_engagement, session_update_options_params, session_update_options_result, session_usage_set_code_changes_request, session_visibility_status, session_workflow_pause_at_checkpoint_result, session_working_directory_context, session_working_directory_context_host_type, session_working_directory_context_with_client, settable_auth_info, settable_token_auth_info, shell_cancel_user_requested_request, shell_credentials, shell_exec_request, shell_exec_result, shell_execute_user_requested_request, shell_init_profile, shell_init_script, shell_init_script_shell, shell_kill_request, shell_kill_result, shell_kill_signal, shell_options, shutdown_request, skill, skill_apply_install_request, skill_apply_uninstall_request, skill_discovery_path, skill_discovery_path_list, skill_discovery_scope, skill_installation_failure_reason, skill_installation_file_review, skill_installation_location, skill_installation_management_outcome, skill_installation_management_result, skill_installation_operation_request, skill_installation_operation_status, skill_installation_outcome, skill_installation_ownership_state, skill_installation_result, skill_installation_review, skill_installation_scope, skill_installation_session_state, skill_installation_source, skill_installations_request, skill_installation_summary, skill_install_plan, skill_list, skill_plan_install_request, skill_plan_uninstall_request, skill_provider_descriptor, skill_provider_list_request, skill_provider_list_result, skill_provider_read_request, skill_provider_read_result, skills_config_set_disabled_skills_request, skills_config_set_skill_disabled_request, skills_disable_request, skills_discover_request, skills_enable_request, skill_set_enabled_request, skills_get_discovery_paths_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, skill_uninstall_plan, slash_command_add_timeline_entry_result, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_choice, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_model_picker_dialog, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_set_model_result, slash_command_set_plan_model_result, slash_command_show_dialog_result, slash_command_text_result, slash_command_timeline_entry, subagent_settings_entry, subagent_settings_entry_context_tier, system_message_block, task_agent_info, task_agent_progress, task_client_active_status, task_client_execution_mode, task_client_info, task_client_owner, task_client_owner_kind, task_client_owner_presence, task_client_progress, task_client_status, task_client_type, task_client_update, task_complete_data, task_completion_decision, task_execution_mode, task_info, task_kind, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_register_request, tasks_register_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_update_request, tasks_update_result, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, token_provider_auth_info, tool, tool_list, tool_result, tool_result_expanded, tool_result_new_message, tool_result_type, tools_execute_request, tools_get_builtin_descriptors_request, tools_get_builtin_descriptors_result, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_pending_requests_request, tools_list_request, tools_set_request, tools_set_result, tools_shell_descriptor_config, tools_task_complete_event_data_request, tools_update_subagent_settings_result, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_ephemeral_query_request, ui_ephemeral_query_result, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_session_limits_exhausted_request, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_session_limits_exhausted_response, ui_session_limits_exhausted_response_action, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, unsupported_enqueue_command_result, update_subagent_settings_request, usage_get_metrics_result, usage_set_code_changes_request, user_auth_info, user_requested_shell_command_result, user_setting_metadata, user_settings_get_result, user_settings_set_request, visibility_get_result, visibility_set_request, visibility_set_result, workflow_abort_request, workflow_ack_result, workflow_agent_options, workflow_agent_request, workflow_agent_result, workflow_agent_summary, workflow_cancel_request, workflow_current_phase, workflow_declared_limits, workflow_durable_operation, workflow_execute_request, workflow_execute_result, workflow_get_run_progress_request, workflow_get_run_request, workflow_journal_get_request, workflow_journal_get_result, workflow_journal_put_request, workflow_list_runs_request, workflow_list_runs_result, workflow_log_line, workflow_log_line_kind, workflow_log_request, workflow_pause_checkpoint_action, workflow_pause_checkpoint_request, workflow_pause_checkpoint_result, workflow_pause_info, workflow_pause_request, workflow_phase_observation, workflow_phase_status, workflow_progress_line, workflow_progress_page, workflow_resume_request, workflow_resume_result, workflow_run_consumed, workflow_run_detail, workflow_run_failure, workflow_run_failure_kind, workflow_run_limits, workflow_run_options, workflow_run_request, workflow_run_result, workflow_run_status, workflow_run_summary, workflow_run_terminal, workflow_tool_resume_request, workflow_tool_run_options, workflow_tool_run_request, workspace_diff_contents, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_add_summary_request, workspaces_add_summary_result, workspaces_autopilot_objective_exists_result, workspaces_checkpoints, workspaces_create_directory_request, workspaces_create_file_request, workspaces_delete_autopilot_objective_result, workspaces_diff_request, workspaces_ensure_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_autopilot_objective_result, workspaces_read_checkpoint_request, workspaces_read_checkpoint_result, workspaces_read_file_request, workspaces_read_file_result, workspaces_remove_path_request, workspaces_rename_path_request, workspaces_save_large_paste_request, workspaces_save_large_paste_result, workspaces_stat_file_request, workspaces_stat_file_result, workspaces_truncate_summaries_request, workspace_summary_host_type, workspaces_update_metadata_request, workspaces_workspace_details_host_type, workspaces_write_autopilot_objective_request, workspaces_write_autopilot_objective_result, connector_session_account_result, session_auth_info_result, session_context_attribution, session_context_info, subagent_settings, task_progress, workspace_summary) def to_dict(self) -> dict: result: dict = {} @@ -53386,6 +53437,7 @@ def to_dict(self) -> dict: result["HostDisposeRequest"] = to_class(HostDisposeRequest, self.host_dispose_request) result["HostEmptyResult"] = to_class(HostEmptyResult, self.host_empty_result) result["HostEnvironmentCredentials"] = to_class(HostEnvironmentCredentials, self.host_environment_credentials) + result["HostEnvironmentKind"] = to_enum(HostEnvironmentKind, self.host_environment_kind) result["HostExitedNotification"] = to_class(HostExitedNotification, self.host_exited_notification) result["HostExitReason"] = to_enum(HostExitReason, self.host_exit_reason) result["HostGitHubEnvironmentOptions"] = to_class(HostGitHubEnvironmentOptions, self.host_git_hub_environment_options) @@ -53397,6 +53449,7 @@ def to_dict(self) -> dict: result["HostPublishSessionResult"] = to_class(HostPublishSessionResult, self.host_publish_session_result) result["HostReadyRequest"] = to_class(HostReadyRequest, self.host_ready_request) result["HostRegisterSessionRequest"] = to_class(HostRegisterSessionRequest, self.host_register_session_request) + result["HostRuntimePrincipal"] = to_enum(HostRuntimePrincipal, self.host_runtime_principal) result["HostSessionCreateCallback"] = to_class(HostSessionCreateCallback, self.host_session_create_callback) result["HostSessionCreateRequest"] = to_class(HostSessionCreateRequest, self.host_session_create_request) result["HostSessionCreateResult"] = to_class(HostSessionCreateResult, self.host_session_create_result) @@ -59398,6 +59451,7 @@ async def handle_installations_confirm(params: dict) -> dict | None: "HostDisposeRequest", "HostEmptyResult", "HostEnvironmentCredentials", + "HostEnvironmentKind", "HostExitReason", "HostExitedNotification", "HostGitHubEnvironmentOptions", @@ -59410,6 +59464,7 @@ async def handle_installations_confirm(params: dict) -> dict | None: "HostPublishSessionResult", "HostReadyRequest", "HostRegisterSessionRequest", + "HostRuntimePrincipal", "HostSessionCreateCallback", "HostSessionCreateRequest", "HostSessionCreateResult", diff --git a/rust/src/ahp_host/tests.rs b/rust/src/ahp_host/tests.rs index 90d5444fdd..502f7def57 100644 --- a/rust/src/ahp_host/tests.rs +++ b/rust/src/ahp_host/tests.rs @@ -133,6 +133,9 @@ async fn github_and_combined_transports_preserve_optional_results() { name: "SDK host".into(), compute_id: "compute".into(), require_connection_binding: Some(local), + kind: None, + credential_provider_registration_id: None, + runtime_principal: None, }); if local { options = options.with_local_server(Default::default()); diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index e6a4b6f6bc..c57ab5ed4d 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -8605,7 +8605,7 @@ pub struct GitHubTokenAcquireRequest { pub reason: GitHubTokenAcquireReason, /// Opaque identifier generated by the SDK for this callback registration. pub registration_id: String, - /// Session receiving the token. Absent only before a cloud session has been assigned its id. + /// Session receiving the token. Absent for hosting credentials and before a cloud session has been assigned its id. #[serde(skip_serializing_if = "Option::is_none")] pub session_id: Option, } @@ -8615,7 +8615,7 @@ pub struct GitHubTokenAcquireRequest { pub struct GitHubTokenAcquireResultToken { /// GitHub access token acquired by the SDK host. pub access_token: String, - /// Remaining token lifetime in seconds when callback execution completes. It must exceed the one-hour preflight refresh threshold. + /// Remaining token lifetime in seconds when callback execution completes. Session providers require more than one hour; hosting providers require at least 120 seconds. pub expires_in: i64, /// GitHub credential response variant discriminator. pub kind: GitHubTokenAcquireResultTokenKind, @@ -9313,11 +9313,20 @@ pub struct HooksDiscoverResult { pub struct HostGitHubEnvironmentOptions { /// Stable application installation identity, reused across host restarts. pub compute_id: String, + /// Opaque SDK registration for a refreshable hosting credential. Tokens are requested only from the owning SDK connection through gitHubToken.getToken and must remain valid for at least 120 seconds. Omitting this uses the runtime's existing authentication. + #[serde(skip_serializing_if = "Option::is_none")] + pub credential_provider_registration_id: Option, + /// Registration kind. Defaults to user-local; managed kinds adopt the preallocated environment identified by the authenticated owner and computeId. + #[serde(skip_serializing_if = "Option::is_none")] + pub kind: Option, /// Human-readable environment display name. pub name: String, /// Require sealed, connection-bound authentication (default true), independent of listener address. False permits unsealed direct credentials and unbound sealed relay credentials; use only when the caller fully controls and trusts the direct transport. Relay token encryption remains mandatory. #[serde(skip_serializing_if = "Option::is_none")] pub require_connection_binding: Option, + /// Runtime authentication principal, independent of Mission Control's routing owner. Defaults to user. github-app requires a separately built managed-hosting runtime and a managed-sandbox registration; ordinary runtime builds reject it. + #[serde(skip_serializing_if = "Option::is_none")] + pub runtime_principal: Option, } /// Normalized local WebSocket listener settings. @@ -41885,6 +41894,53 @@ pub enum HistoryRewindOutcome { Unknown, } +/// Compute kinds supported by attached environment registration. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum HostEnvironmentKind { + /// An ordinary user-managed local host. + #[serde(rename = "user-local")] + UserLocal, + /// A preallocated GitHub-managed sandbox. + #[serde(rename = "managed-sandbox")] + ManagedSandbox, + /// A preallocated GitHub-managed cloud agent host. + #[serde(rename = "managed-cca")] + ManagedCca, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Authentication principal used by the attached AHP host. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum HostRuntimePrincipal { + /// Authenticate every connection as the host's single GitHub user. + #[serde(rename = "user")] + User, + /// Authenticate the provisioned GitHub App using the managed host's existing sandbox admission. + #[serde(rename = "github-app")] + GitHubApp, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// ///
/// From 1c553e0c8d78ca4ddb45e8c7d0b55fab9206afdd Mon Sep 17 00:00:00 2001 From: C0deKing <16599358+C0deKing@users.noreply.github.com> Date: Sun, 11 Oct 2026 21:52:56 +0000 Subject: [PATCH 3/6] Include generated Java hosting enums Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../generated/rpc/HostEnvironmentKind.java | 41 +++++++++++++++++++ .../generated/rpc/HostRuntimePrincipal.java | 39 ++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostEnvironmentKind.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostRuntimePrincipal.java diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostEnvironmentKind.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostEnvironmentKind.java new file mode 100644 index 0000000000..33068ae7e5 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostEnvironmentKind.java @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Compute kinds supported by attached environment registration. + * + * @apiNote This type is experimental and may change in a future version. + * + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum HostEnvironmentKind { + /** The {@code user-local} variant. */ + USER_LOCAL("user-local"), + /** The {@code managed-sandbox} variant. */ + MANAGED_SANDBOX("managed-sandbox"), + /** The {@code managed-cca} variant. */ + MANAGED_CCA("managed-cca"); + + private final String value; + HostEnvironmentKind(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static HostEnvironmentKind fromValue(String value) { + for (HostEnvironmentKind v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown HostEnvironmentKind value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostRuntimePrincipal.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostRuntimePrincipal.java new file mode 100644 index 0000000000..2496263336 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostRuntimePrincipal.java @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Authentication principal used by the attached AHP host. + * + * @apiNote This type is experimental and may change in a future version. + * + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum HostRuntimePrincipal { + /** The {@code user} variant. */ + USER("user"), + /** The {@code github-app} variant. */ + GITHUB_APP("github-app"); + + private final String value; + HostRuntimePrincipal(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static HostRuntimePrincipal fromValue(String value) { + for (HostRuntimePrincipal v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown HostRuntimePrincipal value: " + value); + } +} From b69c6fc1e09d3a03a2790f907fd19927ef3b20a8 Mon Sep 17 00:00:00 2001 From: C0deKing <16599358+C0deKing@users.noreply.github.com> Date: Sun, 11 Oct 2026 23:05:59 +0000 Subject: [PATCH 4/6] Support explicit unknown-expiry hosting credentials Add a host-scoped Go result that omits lifetime metadata without inventing a TTL. Regenerate all six wire projections, preserve ordinary session requirements, and exercise scope, serialization, and native owner admission. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/runtime-supervised-host.md | 22 +++- dotnet/src/Generated/Rpc.cs | 5 +- go/client.go | 36 ++++-- go/github_token_provider.go | 30 ++++- go/host.go | 6 +- go/host_credentials_runtime_test.go | 109 ++++++++++++++++++ go/host_credentials_test.go | 81 +++++++++++++ go/installation_confirmation_test.go | 2 +- go/rpc/zrpc.go | 9 +- .../rpc/GitHubTokenAcquireResultToken.java | 2 +- nodejs/src/generated/rpc.ts | 4 +- python/copilot/generated/rpc.py | 7 +- rust/src/generated/api_types.rs | 5 +- rust/src/github_token.rs | 2 +- 14 files changed, 289 insertions(+), 31 deletions(-) create mode 100644 go/host_credentials_runtime_test.go diff --git a/docs/runtime-supervised-host.md b/docs/runtime-supervised-host.md index 5a27d71706..a9660c1a31 100644 --- a/docs/runtime-supervised-host.md +++ b/docs/runtime-supervised-host.md @@ -167,13 +167,29 @@ identity boundary. The native build selects this capability with credentials. Other integrations can supply an opaque `credentialProviderRegistrationId` through the generated RPC contract and handle `gitHubToken.getToken` on the same SDK connection. Hosting callbacks have -no session ID and must return a bearer valid for at least 120 seconds. The -runtime requests refreshes through the owning connection, rechecks authentication +no session ID. When the issuer supplies lifetime metadata, return a bearer +valid for at least 120 seconds using the existing `GitHubTokenResult`. +When a fresh bearer has no lifetime metadata, Go provides +`GitHubTokenUnknownExpiryResult(&GitHubTokenUnknownExpiry{AccessToken: token})`. +This host-only result omits `expiresIn`; it does not invent a lifetime. +An explicit zero, negative, fractional, null, or malformed expiry is rejected, +not treated as unknown. Do not discard a known expiry to select this result. +The runtime requests refreshes through the owning connection, rechecks authentication and remote-control policy, and never substitutes ambient authentication after a provider error. Go unregisters the callback on startup failure, host exit, or connection loss. Persist a server-side mint policy, not callback bearer tokens. Session-scoped token callbacks retain their existing greater-than-one-hour -validity requirement. +validity requirement and reject unknown lifetime, including before a cloud +session has an assigned ID. + +Both hosting result forms use the same 30-second refresh cadence and 15-second +callback timeout. Every initial credential still passes authentication and +remote-control admission before hosting starts, and every refresh revalidates +the bound owner and origin. Unknown lifetime is not a promise that the token +will remain valid until the next poll. Provider cancellation or an invalid +credential ends hosting; transient acquisition or revalidation failures pause +the Mission Control bearer rather than continuing with a cached credential. +The existing session credential update method does not update host credentials. `COPILOT_MC_BASE_URL` is an origin, not an API path. It accepts HTTPS or HTTP loopback, and rejects credentials, paths, queries, and fragments without falling diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index f6f3a1be89..521cf81977 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -27697,9 +27697,10 @@ public partial class GitHubTokenAcquireResultToken : GitHubTokenAcquireResult [JsonPropertyName("accessToken")] public required string AccessToken { get; set; } - /// Remaining token lifetime in seconds when callback execution completes. Session providers require more than one hour; hosting providers require at least 120 seconds. + /// Remaining token lifetime in seconds when callback execution completes. Required for session providers, with more than one hour remaining. Hosting providers may omit this field when lifetime is unknown; when supplied it must be at least 120 seconds. Hosting always refreshes periodically and revalidates credentials. Zero, null, and invalid lifetimes are rejected, not treated as unknown. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("expiresIn")] - public required long ExpiresIn { get; set; } + public long? ExpiresIn { get; set; } /// OAuth token type. Defaults to bearer when omitted. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] diff --git a/go/client.go b/go/client.go index aa8659fd4b..626abbb933 100644 --- a/go/client.go +++ b/go/client.go @@ -164,7 +164,7 @@ type Client struct { sessions map[string]*Session sessionsMux sync.Mutex ahp ahpHostState - gitHubTokenProviders map[string]GitHubTokenProvider + gitHubTokenProviders map[string]gitHubTokenProviderRegistration gitHubTokenProvidersMux sync.RWMutex requestAdapter *copilotRequestAdapter requestAdapterMux sync.Mutex @@ -242,7 +242,7 @@ func NewClient(options *ClientOptions) *Client { options: opts, state: stateDisconnected, sessions: make(map[string]*Session), - gitHubTokenProviders: make(map[string]GitHubTokenProvider), + gitHubTokenProviders: make(map[string]gitHubTokenProviderRegistration), actualHost: "localhost", isExternalServer: false, useStdio: true, @@ -2683,15 +2683,24 @@ func (c *Client) setupNotificationHandler() { } func (c *Client) registerGitHubTokenProvider(provider GitHubTokenProvider) string { + return c.registerScopedGitHubTokenProvider(provider, false) +} + +type gitHubTokenProviderRegistration struct { + provider GitHubTokenProvider + hosting bool +} + +func (c *Client) registerScopedGitHubTokenProvider(provider GitHubTokenProvider, hosting bool) string { if provider == nil { return "" } registrationID := uuid.NewString() c.gitHubTokenProvidersMux.Lock() if c.gitHubTokenProviders == nil { - c.gitHubTokenProviders = make(map[string]GitHubTokenProvider) + c.gitHubTokenProviders = make(map[string]gitHubTokenProviderRegistration) } - c.gitHubTokenProviders[registrationID] = provider + c.gitHubTokenProviders[registrationID] = gitHubTokenProviderRegistration{provider: provider, hosting: hosting} c.gitHubTokenProvidersMux.Unlock() return registrationID } @@ -2707,7 +2716,7 @@ func (c *Client) unregisterGitHubTokenProvider(registrationID string) { func (c *Client) clearGitHubTokenProviders() { c.gitHubTokenProvidersMux.Lock() - c.gitHubTokenProviders = make(map[string]GitHubTokenProvider) + c.gitHubTokenProviders = make(map[string]gitHubTokenProviderRegistration) c.gitHubTokenProvidersMux.Unlock() } @@ -2788,13 +2797,13 @@ func (a *gitHubTokenAdapter) GetToken(request *rpc.GitHubTokenAcquireRequest) (r return nil, fmt.Errorf("missing GitHub token acquire request") } a.client.gitHubTokenProvidersMux.RLock() - provider := a.client.gitHubTokenProviders[request.RegistrationID] + registration := a.client.gitHubTokenProviders[request.RegistrationID] a.client.gitHubTokenProvidersMux.RUnlock() - if provider == nil { + if registration.provider == nil { return nil, fmt.Errorf("unknown GitHub token provider registration ID %q", request.RegistrationID) } - result, err := provider(GitHubTokenProviderArgs{ + result, err := registration.provider(GitHubTokenProviderArgs{ Host: request.Host, SessionID: request.SessionID, Reason: request.Reason, @@ -2805,13 +2814,22 @@ func (a *gitHubTokenAdapter) GetToken(request *rpc.GitHubTokenAcquireRequest) (r if result != nil && result.Cancelled { return &rpc.GitHubTokenAcquireResultCancelled{}, nil } + if result != nil && result.TokenUnknownExpiry != nil { + if !registration.hosting || request.SessionID != nil || result.Token != nil { + return nil, fmt.Errorf("unknown token lifetime requires a hosting provider and no expiry-bearing token") + } + return &rpc.GitHubTokenAcquireResultToken{ + AccessToken: result.TokenUnknownExpiry.AccessToken, + TokenType: result.TokenUnknownExpiry.TokenType, + }, nil + } if result == nil || result.Token == nil { return nil, fmt.Errorf("GitHub token provider returned neither a token nor cancellation") } return &rpc.GitHubTokenAcquireResultToken{ AccessToken: result.Token.AccessToken, TokenType: result.Token.TokenType, - ExpiresIn: result.Token.ExpiresIn, + ExpiresIn: &result.Token.ExpiresIn, }, nil } diff --git a/go/github_token_provider.go b/go/github_token_provider.go index 43e97a36d1..bc51e51b36 100644 --- a/go/github_token_provider.go +++ b/go/github_token_provider.go @@ -44,6 +44,22 @@ type GitHubToken struct { ExpiresIn int64 } +// GitHubTokenUnknownExpiry is a freshly acquired hosting bearer whose issuer +// supplies no lifetime metadata. It is valid only for AhpHostOptions providers; +// normal session providers still require GitHubToken with a known lifetime. +type GitHubTokenUnknownExpiry struct { + AccessToken string + TokenType *string +} + +func (t GitHubTokenUnknownExpiry) String() string { + return "GitHubTokenUnknownExpiry{AccessToken:}" +} + +func (t GitHubTokenUnknownExpiry) GoString() string { + return t.String() +} + // String returns a redacted description that never includes the access token. func (t GitHubToken) String() string { tokenType := "" @@ -62,8 +78,9 @@ func (t GitHubToken) GoString() string { // // Experimental: GitHubTokenProviderResult may change or be removed. type GitHubTokenProviderResult struct { - Cancelled bool - Token *GitHubToken + Cancelled bool + Token *GitHubToken + TokenUnknownExpiry *GitHubTokenUnknownExpiry } // GitHubTokenResult returns a successful token-provider result. @@ -71,6 +88,12 @@ func GitHubTokenResult(token *GitHubToken) *GitHubTokenProviderResult { return &GitHubTokenProviderResult{Token: token} } +// GitHubTokenUnknownExpiryResult does not assign a synthetic expiry. Hosting +// continues periodic acquisition and authentication/owner revalidation. +func GitHubTokenUnknownExpiryResult(token *GitHubTokenUnknownExpiry) *GitHubTokenProviderResult { + return &GitHubTokenProviderResult{TokenUnknownExpiry: token} +} + // GitHubTokenCancelled returns a result indicating that token acquisition was cancelled. func GitHubTokenCancelled() *GitHubTokenProviderResult { return &GitHubTokenProviderResult{Cancelled: true} @@ -79,7 +102,8 @@ func GitHubTokenCancelled() *GitHubTokenProviderResult { // GitHubTokenProvider acquires session- or host-scoped GitHub tokens on demand. // Cancellation, errors, and invalid token responses never fall back to ambient // authentication. Sessions require more than one hour of validity; hosting -// credentials require at least 120 seconds. +// credentials require at least 120 seconds when their lifetime is known, or +// GitHubTokenUnknownExpiryResult when the issuer provides no lifetime metadata. // // Experimental: GitHubTokenProvider may change or be removed. type GitHubTokenProvider func(args GitHubTokenProviderArgs) (*GitHubTokenProviderResult, error) diff --git a/go/host.go b/go/host.go index c6cf2ce479..cc5ec4f3e0 100644 --- a/go/host.go +++ b/go/host.go @@ -49,7 +49,9 @@ type AhpHostOptions struct { // GitHubEnvironment registers the host with Mission Control; Name and ComputeID are required. GitHubEnvironment *rpc.HostGitHubEnvironmentOptions // GitHubTokenProvider supplies refreshable hosting credentials. It must return - // a bearer valid for at least 120 seconds; errors never fall back to ambient auth. + // a bearer with unknown lifetime or at least 120 seconds remaining; errors + // never fall back to ambient auth. Use GitHubTokenUnknownExpiryResult only + // when the issuer supplies no lifetime metadata, never for an expired token. // The callback belongs to this host and receives no SessionID. GitHubTokenProvider GitHubTokenProvider CreateSession func(context.Context, AhpSessionCreateRequest) (*Session, error) @@ -142,7 +144,7 @@ func (c *Client) StartAhpHost(ctx context.Context, options *AhpHostOptions) (*Ah hostID := uuid.NewString() if opts.GitHubTokenProvider != nil { environment := *opts.GitHubEnvironment - opts.credentialProviderRegistrationID = c.registerGitHubTokenProvider(opts.GitHubTokenProvider) + opts.credentialProviderRegistrationID = c.registerScopedGitHubTokenProvider(opts.GitHubTokenProvider, true) environment.CredentialProviderRegistrationID = String(opts.credentialProviderRegistrationID) opts.GitHubEnvironment = &environment } diff --git a/go/host_credentials_runtime_test.go b/go/host_credentials_runtime_test.go new file mode 100644 index 0000000000..2af28af43c --- /dev/null +++ b/go/host_credentials_runtime_test.go @@ -0,0 +1,109 @@ +package copilot_test + +import ( + "context" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "strings" + "sync/atomic" + "testing" + "time" + + copilot "github.com/github/copilot-sdk/go" + "github.com/github/copilot-sdk/go/rpc" +) + +func TestAhpHostRuntimeUnknownExpiryOwnerAdmission(t *testing.T) { + if os.Getenv("COPILOT_RUNTIME_HOST_E2E") != "1" { + t.Skip("requires an explicitly selected source-built native runtime") + } + runtimePath := os.Getenv("COPILOT_CLI_PATH") + if !filepath.IsAbs(runtimePath) { + t.Fatal("COPILOT_CLI_PATH must select an absolute native runtime executable") + } + const token = "ghs_unknown_expiry_synthetic" + var ownerLookups atomic.Int32 + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodGet || r.URL.Path != "/user" { + t.Errorf("unexpected request: %s %s", r.Method, r.URL.Path) + } + if r.Header.Get("Authorization") != "Bearer "+token { + t.Error("owner validation did not use the supplied credential") + } + ownerLookups.Add(1) + w.WriteHeader(http.StatusForbidden) + })) + defer server.Close() + home := t.TempDir() + client := copilot.NewClient(&copilot.ClientOptions{ + Connection: copilot.StdioConnection{Path: runtimePath}, + BaseDirectory: home, + WorkingDirectory: home, + UseLoggedInUser: copilot.Bool(false), + Env: []string{ + "PATH=" + os.Getenv("PATH"), + "HOME=" + home, + "TMPDIR=" + home, + "COPILOT_MC_BASE_URL=" + server.URL, + "COPILOT_DEBUG_GITHUB_API_URL=" + server.URL, + "COPILOT_AUTO_UPDATE=false", + }, + }) + ctx, cancel := context.WithTimeout(t.Context(), 30*time.Second) + defer cancel() + if err := client.Start(ctx); err != nil { + t.Fatal(err) + } + defer func() { + if err := client.Stop(); err != nil { + t.Errorf("stop native runtime: %v", err) + } + }() + // A loopback identity denial exercises native owner validation without + // manufacturing admission or contacting a real control plane. + for _, test := range []struct { + name string + result *copilot.GitHubTokenProviderResult + error string + callbacks int32 + ownerLookups int32 + }{ + {"unknown", copilot.GitHubTokenUnknownExpiryResult(&copilot.GitHubTokenUnknownExpiry{AccessToken: token}), "environment-owner credential could not be validated", 2, 1}, + {"known", copilot.GitHubTokenResult(&copilot.GitHubToken{AccessToken: token, ExpiresIn: 120}), "environment-owner credential could not be validated", 2, 1}, + {"zero", copilot.GitHubTokenResult(&copilot.GitHubToken{AccessToken: token}), "hosting credential provider must return a bearer", 1, 0}, + {"cancelled", copilot.GitHubTokenCancelled(), "hosting credential provider must return a bearer", 1, 0}, + } { + t.Run(test.name, func(t *testing.T) { + var callbacks atomic.Int32 + beforeLookups := ownerLookups.Load() + kind := rpc.HostEnvironmentKindManagedSandbox + _, err := client.StartAhpHost(ctx, &copilot.AhpHostOptions{ + GitHubEnvironment: &rpc.HostGitHubEnvironmentOptions{ + Name: "credential-policy-test", ComputeID: "agent:00000000-0000-4000-8000-000000000001", Kind: &kind, + }, + GitHubTokenProvider: func(args copilot.GitHubTokenProviderArgs) (*copilot.GitHubTokenProviderResult, error) { + call := callbacks.Add(1) + reason := copilot.GitHubTokenRequestReasonInitial + if call > 1 { + reason = copilot.GitHubTokenRequestReasonRefresh + } + if args.SessionID != nil || args.Reason != reason { + t.Error("unexpected hosting credential callback context") + } + return test.result, nil + }, + }) + if err == nil || !strings.Contains(err.Error(), test.error) { + t.Fatalf("expected %q, got %v", test.error, err) + } + if callbacks.Load() != test.callbacks { + t.Errorf("expected %d credential callbacks, got %d", test.callbacks, callbacks.Load()) + } + if lookups := ownerLookups.Load() - beforeLookups; lookups != test.ownerLookups { + t.Errorf("expected %d owner lookups, got %d", test.ownerLookups, lookups) + } + }) + } +} diff --git a/go/host_credentials_test.go b/go/host_credentials_test.go index d370a6bbef..799f7c03bc 100644 --- a/go/host_credentials_test.go +++ b/go/host_credentials_test.go @@ -112,3 +112,84 @@ func TestAhpHostCredentialProviderRequiresUnambiguousEnvironment(t *testing.T) { } } } + +func TestAhpHostUnknownExpiryIsExplicitAndHostScoped(t *testing.T) { + unknown := GitHubTokenUnknownExpiryResult(&GitHubTokenUnknownExpiry{AccessToken: "synthetic-bearer"}) + knownLifetime, zeroLifetime := int64(120), int64(0) + for _, test := range []struct { + name string + hosting bool + sessionID *string + result *GitHubTokenProviderResult + expiry *int64 + wantError bool + }{ + {name: "unknown hosting lifetime", hosting: true, result: unknown}, + {name: "known hosting lifetime", hosting: true, result: GitHubTokenResult(&GitHubToken{AccessToken: "synthetic-bearer", ExpiresIn: 120}), expiry: &knownLifetime}, + {name: "zero remains explicit for native rejection", hosting: true, result: GitHubTokenResult(&GitHubToken{AccessToken: "synthetic-bearer"}), expiry: &zeroLifetime}, + {name: "session without assigned ID", result: unknown, wantError: true}, + {name: "session with assigned ID", result: unknown, sessionID: String("session"), wantError: true}, + {name: "host registration cannot issue a session token", hosting: true, result: unknown, sessionID: String("session"), wantError: true}, + {name: "ambiguous lifetime", hosting: true, result: &GitHubTokenProviderResult{Token: &GitHubToken{ExpiresIn: 120}, TokenUnknownExpiry: unknown.TokenUnknownExpiry}, wantError: true}, + } { + t.Run(test.name, func(t *testing.T) { + client, server, _ := ahpFixture(t) + var registration string + provider := func(GitHubTokenProviderArgs) (*GitHubTokenProviderResult, error) { return test.result, nil } + if test.hosting { + server.SetRequestHandler("host.start", jsonrpc2.RequestHandlerFor(func(params *rpc.HostStartRequest) (*rpc.HostStartResult, *jsonrpc2.Error) { + registration = *params.GitHubEnvironment.CredentialProviderRegistrationID + return &rpc.HostStartResult{HostID: params.HostID}, nil + })) + if _, err := client.StartAhpHost(t.Context(), &AhpHostOptions{ + GitHubEnvironment: &rpc.HostGitHubEnvironmentOptions{Name: "managed", ComputeID: "allocation"}, + GitHubTokenProvider: provider, + }); err != nil { + t.Fatal(err) + } + } else { + registration = client.registerGitHubTokenProvider(provider) + } + adapter := &gitHubTokenAdapter{client: client} + result, err := adapter.GetToken(&rpc.GitHubTokenAcquireRequest{ + RegistrationID: registration, SessionID: test.sessionID, + }) + if test.wantError { + if err == nil { + t.Fatal("accepted an unknown lifetime outside its hosting contract") + } + return + } + if err != nil { + t.Fatal(err) + } + data, err := json.Marshal(result) + if err != nil { + t.Fatal(err) + } + var wire map[string]json.RawMessage + if err := json.Unmarshal(data, &wire); err != nil { + t.Fatal(err) + } + expiry, present := wire["expiresIn"] + if test.expiry == nil { + if present { + t.Fatal("unknown lifetime was serialized as a fabricated expiry or null") + } + } else { + if !present || string(expiry) != fmt.Sprint(*test.expiry) { + t.Fatalf("expected explicit lifetime %d, got %s", *test.expiry, expiry) + } + } + }) + } +} + +func TestAhpHostUnknownExpiryFormattingRedactsCredentials(t *testing.T) { + token := GitHubTokenUnknownExpiry{AccessToken: "synthetic-secret"} + for _, formatted := range []string{fmt.Sprint(token), fmt.Sprintf("%#v", token)} { + if formatted != "GitHubTokenUnknownExpiry{AccessToken:}" { + t.Fatal("unknown-expiry token formatting did not redact credentials") + } + } +} diff --git a/go/installation_confirmation_test.go b/go/installation_confirmation_test.go index a12be5ac0b..7b77c9a2cf 100644 --- a/go/installation_confirmation_test.go +++ b/go/installation_confirmation_test.go @@ -155,7 +155,7 @@ func newInstallationConfirmationHarness(t *testing.T, handler InstallationConfir InstallationConfirmationHandler: handler, }, sessions: make(map[string]*Session), - gitHubTokenProviders: make(map[string]GitHubTokenProvider), + gitHubTokenProviders: make(map[string]gitHubTokenProviderRegistration), state: stateConnected, } client.setupNotificationHandler() diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index 9da5f0e308..5a566e231d 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -5316,9 +5316,12 @@ func (GitHubTokenAcquireResultCancelled) Kind() GitHubTokenAcquireResultKind { type GitHubTokenAcquireResultToken struct { // GitHub access token acquired by the SDK host. AccessToken string `json:"accessToken"` - // Remaining token lifetime in seconds when callback execution completes. Session providers - // require more than one hour; hosting providers require at least 120 seconds. - ExpiresIn int64 `json:"expiresIn"` + // Remaining token lifetime in seconds when callback execution completes. Required for + // session providers, with more than one hour remaining. Hosting providers may omit this + // field when lifetime is unknown; when supplied it must be at least 120 seconds. Hosting + // always refreshes periodically and revalidates credentials. Zero, null, and invalid + // lifetimes are rejected, not treated as unknown. + ExpiresIn *int64 `json:"expiresIn,omitempty"` // OAuth token type. Defaults to bearer when omitted. TokenType *string `json:"tokenType,omitempty"` } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/GitHubTokenAcquireResultToken.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/GitHubTokenAcquireResultToken.java index d4e22673ff..5fec506645 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/GitHubTokenAcquireResultToken.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/GitHubTokenAcquireResultToken.java @@ -36,7 +36,7 @@ public final class GitHubTokenAcquireResultToken extends GitHubTokenAcquireResul @JsonProperty("tokenType") private String tokenType; - /** Remaining token lifetime in seconds when callback execution completes. Session providers require more than one hour; hosting providers require at least 120 seconds. */ + /** Remaining token lifetime in seconds when callback execution completes. Required for session providers, with more than one hour remaining. Hosting providers may omit this field when lifetime is unknown; when supplied it must be at least 120 seconds. Hosting always refreshes periodically and revalidates credentials. Zero, null, and invalid lifetimes are rejected, not treated as unknown. */ @JsonProperty("expiresIn") private Long expiresIn; diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index 600dba59ad..a59667df36 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -2072,9 +2072,9 @@ export type GitHubTokenAcquireResult = */ tokenType?: string; /** - * Remaining token lifetime in seconds when callback execution completes. Session providers require more than one hour; hosting providers require at least 120 seconds. + * Remaining token lifetime in seconds when callback execution completes. Required for session providers, with more than one hour remaining. Hosting providers may omit this field when lifetime is unknown; when supplied it must be at least 120 seconds. Hosting always refreshes periodically and revalidates credentials. Zero, null, and invalid lifetimes are rejected, not treated as unknown. */ - expiresIn: number; + expiresIn?: number; /** * GitHub credential response variant discriminator. */ diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index ef16127e6f..525e9b6eb5 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -23384,8 +23384,11 @@ class GitHubTokenAcquireResult: """GitHub access token acquired by the SDK host.""" expires_in: int | None = None - """Remaining token lifetime in seconds when callback execution completes. Session providers - require more than one hour; hosting providers require at least 120 seconds. + """Remaining token lifetime in seconds when callback execution completes. Required for + session providers, with more than one hour remaining. Hosting providers may omit this + field when lifetime is unknown; when supplied it must be at least 120 seconds. Hosting + always refreshes periodically and revalidates credentials. Zero, null, and invalid + lifetimes are rejected, not treated as unknown. """ token_type: str | None = None """OAuth token type. Defaults to bearer when omitted.""" diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index c57ab5ed4d..1e8f2fbb1a 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -8615,8 +8615,9 @@ pub struct GitHubTokenAcquireRequest { pub struct GitHubTokenAcquireResultToken { /// GitHub access token acquired by the SDK host. pub access_token: String, - /// Remaining token lifetime in seconds when callback execution completes. Session providers require more than one hour; hosting providers require at least 120 seconds. - pub expires_in: i64, + /// Remaining token lifetime in seconds when callback execution completes. Required for session providers, with more than one hour remaining. Hosting providers may omit this field when lifetime is unknown; when supplied it must be at least 120 seconds. Hosting always refreshes periodically and revalidates credentials. Zero, null, and invalid lifetimes are rejected, not treated as unknown. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_in: Option, /// GitHub credential response variant discriminator. pub kind: GitHubTokenAcquireResultTokenKind, /// OAuth token type. Defaults to bearer when omitted. diff --git a/rust/src/github_token.rs b/rust/src/github_token.rs index db77cce96c..0ddf020dae 100644 --- a/rust/src/github_token.rs +++ b/rust/src/github_token.rs @@ -67,7 +67,7 @@ impl GitHubToken { fn into_wire(self) -> GitHubTokenAcquireResultToken { GitHubTokenAcquireResultToken { access_token: self.access_token, - expires_in: self.expires_in_seconds, + expires_in: Some(self.expires_in_seconds), kind: Default::default(), token_type: self.token_type, } From c569827d7b4aa86819e66d6c9746a205eaf55614 Mon Sep 17 00:00:00 2001 From: C0deKing <16599358+C0deKing@users.noreply.github.com> Date: Mon, 12 Oct 2026 01:37:28 +0000 Subject: [PATCH 5/6] Add opt-in host-scoped remote workspace callbacks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/runtime-supervised-host.md | 104 +++++- dotnet/src/Generated/Rpc.cs | 274 +++++++++++++- go/client.go | 1 + go/github_token_provider.go | 4 +- go/host.go | 23 ++ go/host_workspace.go | 343 ++++++++++++++++++ go/host_workspace_test.go | 165 +++++++++ go/rpc/zrpc.go | 180 ++++++++- .../generated/rpc/HostConfiguration.java | 4 +- .../rpc/HostGitHubEnvironmentOptions.java | 2 +- .../generated/rpc/HostStartRequest.java | 24 ++ .../generated/rpc/HostWorkspaceErrorCode.java | 49 +++ .../rpc/HostWorkspaceExecuteRequest.java | 37 ++ .../rpc/HostWorkspaceExecuteResult.java | 33 ++ .../generated/rpc/HostWorkspaceOperation.java | 57 +++ .../generated/rpc/HostWorkspaceParams.java | 32 ++ .../copilot/generated/rpc/ServerHostApi.java | 11 + nodejs/src/generated/rpc.ts | 172 ++++++++- nodejs/test/shared-codegen.test.ts | 9 +- python/copilot/generated/rpc.py | 261 +++++++++++-- rust/src/generated/api_types.rs | 179 ++++++++- rust/src/generated/rpc.rs | 31 ++ scripts/codegen/utils.ts | 5 +- 23 files changed, 1938 insertions(+), 62 deletions(-) create mode 100644 go/host_workspace.go create mode 100644 go/host_workspace_test.go create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceErrorCode.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceExecuteRequest.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceExecuteResult.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceOperation.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceParams.java diff --git a/docs/runtime-supervised-host.md b/docs/runtime-supervised-host.md index a9660c1a31..cdd5545057 100644 --- a/docs/runtime-supervised-host.md +++ b/docs/runtime-supervised-host.md @@ -71,8 +71,10 @@ await client.stop(); `requireConnectionToken`. The hostname defaults to `127.0.0.1`; explicit non-loopback addresses are allowed. An omitted or zero port selects an available port; other values must be integers from 1 through 65535. The returned URL contains -the actual bound address, including IPv6 brackets where needed. The host always -uses the runtime's configured working directory, with no per-host override. +the actual bound address, including IPv6 brackets where needed. The transport +uses the runtime's local working directory. An explicit remote workspace provider +can supply a separate per-host workspace namespace without changing that process +directory. Connection-token authentication defaults on: supply a nonempty token or let the listener generate one. `requireConnectionToken: false` disables only that @@ -174,6 +176,93 @@ When a fresh bearer has no lifetime metadata, Go provides This host-only result omits `expiresIn`; it does not invent a lifetime. An explicit zero, negative, fractional, null, or malformed expiry is rejected, not treated as unknown. Do not discard a known expiry to select this result. + +For hosting, `GitHubTokenProviderArgs.Host` is copied verbatim from the runtime's +`auth_manager_config.github_host`, defaulting to `https://github.com`. The SDK does +not normalize it to a hostname. Validate a received hostname or HTTPS origin +against the configured GitHub origin before minting; do not accept arbitrary +paths, ports, userinfo, or a different host. This is independent of the Mission +Control API origin. + +Hosting refresh does **not** refresh session/model authentication. Ordinary +session token providers still require a known lifetime greater than one hour. +A bearer-only control provider does not resolve that separate requirement. + +### Host-scoped remote workspace + +`AhpHostOptions.WorkspaceProvider` is an explicit, experimental Go provider for +the normal AHP workspace surface. It requires matching native runtime support, +plus both `CreateSession` and `ResumeSession` factories. Default/local hosts remain +unchanged. An older runtime must reject the option; never retry startup without +it as a compatibility fallback. + +Keep the SDK runtime's process directory local. Durable `SessionFS` belongs to +the brain's session-state namespace and may use application-owned storage; +do not redirect it to the hands workspace. `WorkspaceProvider` describes and +accesses that separate remote workspace. Materialize the repository on hands +before startup. +The factory must preserve the native request's working directories, session ID, +permissions, authentication, and other session configuration. + +The typed `AhpWorkspaceProvider` callbacks are: + +* `Describe`: return canonical absolute `file://` roots and exclusions in the + hands namespace. Roots remain fixed for the host lifetime. +* `Resolve`: return one result per requested path, in the same order. Enforce + `existing`, `create`, `mkdir`, subtree, and read/write-access resolution modes. + Enforce the supplied immutable `Roots` and `Excluded` boundaries during + resolution, before project discovery or following links outside the workspace. + When `DiscoverProject` is set, obtain repository identity from authorized + remote facts. Do not invent an empty identity to bypass repository policy. +* `Read`, `Write`, `Stat`, `List`, `Copy`, `Move`, `Delete`, `Mkdir`, and `Access`: + implement the corresponding ordinary AHP resource operation. Every request + carries its original typed parameters, channel and metadata, together with a + native `AhpWorkspaceGuard`. + +The native host checks resolved containment, exclusions, directory identity and +subtree boundaries before forwarding IO. The provider must repeat those checks +on hands at execution time: a prior resolution is not a lease on a pathname. +Writes must use the actual opened handle to check hard links and preconditions, +honor atomic create-only behavior, compare opaque etags, and preserve truncate, +append, insert and offset semantics. Do not silently replace these operations +with an unguarded write or shell interpolation. A provider may strengthen +concurrency protection; it must not claim protection against unrelated processes +that it does not actually enforce. + +`AhpWorkspaceCall` carries the owning `HostID` and a per-invocation `RequestID`. +The provider is installed before `host.start`, so discovery works without a +session. Calls have a 25-second SDK deadline, at most eight concurrent SDK +invocations per host, and cancellation tied to both the request and host +lifetime. Providers must honor cancellation. The native boundary also enforces +30-second waits. Cancellation does not roll back a mutation; never automatically +retry an ambiguous failure. + +Use `AhpWorkspaceError` to return an allowlisted error code. Arbitrary provider +diagnostics are not sent to AHP clients. Missing IO callbacks return +`NotImplemented`. Provider failures and disconnects never select the brain's +local filesystem. + +Remote roots and project discovery feed the ordinary host catalog. Publication +resolves remote directories before entering ordered catalog/dispatch sections; +it does not await workspace RPC while holding those locks. Native session IDs, +factory callbacks and connection binding remain authoritative. + +Watchers, local terminals, worktree/Git-truth operations and project mutations +other than discovery/addition are not supported by this provider. It does not +redirect native model tools or automatically load remote repository instructions: +applications must keep those operations on hands rather than enabling local +tools. Unattended organization-principal admission remains unsupported, and +hosting credentials do not solve session inference credential refresh. + +Native session construction is a separate integration boundary: explicitly +supplied `allowedModels` still intersects repository policy through native local +filesystem discovery, and `trustWorkingDirectory` is rejected with RPC +`SessionFS`. This host provider does not replace those paths. Remote repository +policy/context discovery therefore remains an integration blocker; do not drop +requested policy or trust configuration to bypass it. + +### Hosting credential lifecycle + The runtime requests refreshes through the owning connection, rechecks authentication and remote-control policy, and never substitutes ambient authentication after a provider error. Go unregisters the callback on startup failure, host exit, or @@ -202,12 +291,11 @@ established sandbox path. This prototype does not add a trusted installation policy source or bypass that rejection. > [!WARNING] -> AHP workspace resources and watchers still use the host filesystem. SDK -> SessionFS providers do not automatically redirect these operations to remote -> workers. The native catalog and repository materialization also use local -> storage and Git; neither invokes a remote session callback. Preserve the supplied session -> creation/resume configuration and permission callbacks; replacing them is not -> a filesystem routing solution. +> Without an explicit compatible `WorkspaceProvider`, AHP workspace resources +> use the host filesystem. `SessionFS` alone never routes them to remote workers. +> A remote provider does not materialize repositories, replace session/model +> tools, or supply remote instruction discovery. Preserve the supplied session +> creation/resume configuration and permission callbacks. ## Application-owned sessions diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index 521cf81977..2af225acd8 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -385,7 +385,7 @@ public sealed class HostGitHubEnvironmentOptions [JsonPropertyName("computeId")] public string ComputeId { get; set; } = string.Empty; - /// Opaque SDK registration for a refreshable hosting credential. Tokens are requested only from the owning SDK connection through gitHubToken.getToken and must remain valid for at least 120 seconds. Omitting this uses the runtime's existing authentication. + /// Opaque SDK registration for a refreshable hosting credential. Tokens are requested only from the owning SDK connection through gitHubToken.getToken. A supplied lifetime must be at least 120 seconds; omission explicitly means unknown lifetime with bounded periodic refresh. Omitting this registration uses the runtime's existing authentication. [JsonPropertyName("credentialProviderRegistrationId")] public string? CredentialProviderRegistrationId { get; set; } @@ -454,6 +454,10 @@ public sealed class HostStartRequest /// Ask the owning SDK application to materialize AHP sessions. [JsonPropertyName("sessionFactory")] public bool? SessionFactory { get; set; } + + /// Opt in to the owning application's remote workspace. Requires both session factories; durable session state remains independent. + [JsonPropertyName("workspaceProvider")] + public bool? WorkspaceProvider { get; set; } } /// Empty acknowledgement for a completed host lifecycle operation. @@ -532,6 +536,36 @@ internal sealed class HostGetConfigurationResult /// Whether session materialization is delegated to the owning application. [JsonPropertyName("sessionFactory")] public bool SessionFactory { get; set; } + + /// Workspace callbacks are confined to the owning SDK connection and never replace durable session-state IO. + [JsonPropertyName("workspaceProvider")] + public bool? WorkspaceProvider { get; set; } +} + +/// Successful payloads use the corresponding workspace/AHP result shape. An error carries no usable result. +[Experimental(global::GitHub.Copilot.Diagnostics.Experimental)] +internal sealed class HostWorkspaceResult +{ + /// Safe allowlisted failure classification; omission indicates a successful payload. + [JsonPropertyName("error")] + public HostWorkspaceErrorCode? Error { get; set; } + + /// Serialized operation result; ignored when an error is present. + [JsonPropertyName("payload")] + public string Payload { get; set; } = string.Empty; +} + +/// A supervised child's request. The runtime supplies host identity rather than accepting it from the child. +[Experimental(global::GitHub.Copilot.Diagnostics.Experimental)] +internal sealed class HostWorkspaceRequest +{ + /// Selects the workspace/AHP parameter and result shapes carried by the serialized payload. + [JsonPropertyName("operation")] + public HostWorkspaceOperation Operation { get; set; } + + /// Serialized operation parameters preserve AHP integer offsets and opaque etags without an untyped numeric projection. + [JsonPropertyName("payload")] + public string Payload { get; set; } = string.Empty; } /// Empty acknowledgement for a completed host lifecycle operation. @@ -27738,6 +27772,40 @@ public sealed class GitHubTokenAcquireRequest public string? SessionId { get; set; } } +/// Successful payloads use the corresponding workspace/AHP result shape. An error carries no usable result. +[Experimental(global::GitHub.Copilot.Diagnostics.Experimental)] +public sealed class HostWorkspaceExecuteResult +{ + /// Safe allowlisted failure classification; omission indicates a successful payload. + [JsonPropertyName("error")] + public HostWorkspaceErrorCode? Error { get; set; } + + /// Serialized operation result; ignored when an error is present. + [JsonPropertyName("payload")] + public string Payload { get; set; } = string.Empty; +} + +/// A bounded callback to the SDK connection that owns this host, including before any session exists. +[Experimental(global::GitHub.Copilot.Diagnostics.Experimental)] +public sealed class HostWorkspaceExecuteRequest +{ + /// Runtime-assigned host identity bound to this SDK connection; never supplied by a workspace client. + [JsonPropertyName("hostId")] + public string HostId { get; set; } = string.Empty; + + /// Selects the workspace/AHP parameter and result shapes carried by the serialized payload. + [JsonPropertyName("operation")] + public HostWorkspaceOperation Operation { get; set; } + + /// Serialized parameters and physical path guards, preserving integer offsets and opaque metadata. + [JsonPropertyName("payload")] + public string Payload { get; set; } = string.Empty; + + /// Unique callback invocation identity; original AHP metadata remains inside the payload. + [JsonPropertyName("requestId")] + public string RequestId { get; set; } = string.Empty; +} + /// A response is meaningful only on the connection and request that issued its challenge. public sealed class InstallationsConfirmResult { @@ -28244,6 +28312,174 @@ public override void Write(Utf8JsonWriter writer, HostRuntimePrincipal value, Js } +/// Only these errors cross the workspace callback boundary; arbitrary provider diagnostics are not exposed. +[Experimental(global::GitHub.Copilot.Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct HostWorkspaceErrorCode : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public HostWorkspaceErrorCode(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The operation parameters do not satisfy the workspace contract. + public static HostWorkspaceErrorCode InvalidParams { get; } = new("invalidParams"); + + /// The physical guard or authorization rejected access. + public static HostWorkspaceErrorCode PermissionDenied { get; } = new("permissionDenied"); + + /// The requested remote entry does not exist. + public static HostWorkspaceErrorCode NotFound { get; } = new("notFound"); + + /// An entry already exists where exclusive creation was requested. + public static HostWorkspaceErrorCode AlreadyExists { get; } = new("alreadyExists"); + + /// An etag or concurrent-state precondition failed. + public static HostWorkspaceErrorCode Conflict { get; } = new("conflict"); + + /// This provider does not support the requested operation. + public static HostWorkspaceErrorCode NotImplemented { get; } = new("notImplemented"); + + /// The provider failed without exposing private diagnostic details. + public static HostWorkspaceErrorCode Internal { get; } = new("internal"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(HostWorkspaceErrorCode left, HostWorkspaceErrorCode right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(HostWorkspaceErrorCode left, HostWorkspaceErrorCode right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is HostWorkspaceErrorCode other && Equals(other); + + /// + public bool Equals(HostWorkspaceErrorCode other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override HostWorkspaceErrorCode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, HostWorkspaceErrorCode value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(HostWorkspaceErrorCode)); + } + } +} + + +/// The closed operation set for host-scoped remote workspace IO. Watchers and process/Git execution are intentionally absent. +[Experimental(global::GitHub.Copilot.Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct HostWorkspaceOperation : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public HostWorkspaceOperation(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Declare immutable canonical remote roots and exclusions before host admission. + public static HostWorkspaceOperation Describe { get; } = new("describe"); + + /// Resolve paths and optionally discover project identity within the declared boundaries. + public static HostWorkspaceOperation Resolve { get; } = new("resolve"); + + /// Read remote file content with the requested encoding. + public static HostWorkspaceOperation Read { get; } = new("read"); + + /// Write through a physical guard while preserving offsets, modes, etags and create-only behavior. + public static HostWorkspaceOperation Write { get; } = new("write"); + + /// Inspect remote entry metadata and optional etag. + public static HostWorkspaceOperation Stat { get; } = new("stat"); + + /// List entries in an authorized remote directory. + public static HostWorkspaceOperation List { get; } = new("list"); + + /// Copy a file while checking both source and destination guards. + public static HostWorkspaceOperation Copy { get; } = new("copy"); + + /// Move an entry while enforcing subtree exclusions at both paths. + public static HostWorkspaceOperation Move { get; } = new("move"); + + /// Delete an authorized entry without crossing excluded subtrees. + public static HostWorkspaceOperation Delete { get; } = new("delete"); + + /// Create the authorized directory and missing parent directories. + public static HostWorkspaceOperation Mkdir { get; } = new("mkdir"); + + /// Check requested remote read and write access independently. + public static HostWorkspaceOperation Access { get; } = new("access"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(HostWorkspaceOperation left, HostWorkspaceOperation right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(HostWorkspaceOperation left, HostWorkspaceOperation right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is HostWorkspaceOperation other && Equals(other); + + /// + public bool Equals(HostWorkspaceOperation other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override HostWorkspaceOperation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, HostWorkspaceOperation value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(HostWorkspaceOperation)); + } + } +} + + /// Hook event name. Discovery emits the file-configurable subset; SDK callbacks additionally support callback-only events. [Experimental(global::GitHub.Copilot.Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -43944,6 +44180,19 @@ internal async Task GetConfigurationAsync(Cancellati return await CopilotClient.InvokeRpcAsync(_rpc, "host.getConfiguration", [], cancellationToken); } + /// Routes a remote workspace operation only from its supervised child to its owning SDK connection. + /// Selects the workspace/AHP parameter and result shapes carried by the serialized payload. + /// Serialized operation parameters preserve AHP integer offsets and opaque etags without an untyped numeric projection. + /// The to monitor for cancellation requests. The default is . + /// Successful payloads use the corresponding workspace/AHP result shape. An error carries no usable result. + internal async Task WorkspaceAsync(HostWorkspaceOperation operation, string payload, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(payload); + + var request = new HostWorkspaceRequest { Operation = operation, Payload = payload }; + return await CopilotClient.InvokeRpcAsync(_rpc, "host.workspace", [request], cancellationToken); + } + /// Reports a supervised hosting participant's bound AHP endpoint after its SDK handshake. /// Actual bound WebSocket URL. /// Configured secret token, absent when authentication is disabled. @@ -52089,6 +52338,17 @@ public interface IGitHubTokenHandler Task GetTokenAsync(GitHubTokenAcquireRequest request, CancellationToken cancellationToken = default); } +/// Handles `hostWorkspace` client global API methods. +[Experimental(global::GitHub.Copilot.Diagnostics.Experimental)] +public interface IHostWorkspaceHandler +{ + /// Executes one bounded operation for an explicitly remote workspace on its owning SDK connection. No local filesystem fallback is permitted. The provider must enforce the native canonical-path guard and physical IO preconditions on hands. + /// A bounded callback to the SDK connection that owns this host, including before any session exists. + /// The to monitor for cancellation requests. The default is . + /// Successful payloads use the corresponding workspace/AHP result shape. An error carries no usable result. + Task ExecuteAsync(HostWorkspaceExecuteRequest request, CancellationToken cancellationToken = default); +} + /// Handles `installations` client global API methods. [Experimental(global::GitHub.Copilot.Diagnostics.Experimental)] public interface IInstallationsHandler @@ -52118,6 +52378,9 @@ public sealed class ClientGlobalApiHandlers /// Optional handler for GitHubToken client global API methods. public IGitHubTokenHandler? GitHubToken { get; set; } + /// Optional handler for HostWorkspace client global API methods. + public IHostWorkspaceHandler? HostWorkspace { get; set; } + /// Optional handler for Installations client global API methods. public IInstallationsHandler? Installations { get; set; } } @@ -52163,6 +52426,11 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH var handler = handlers.GitHubToken ?? throw new InvalidOperationException("No gitHubToken client-global handler registered"); return await handler.GetTokenAsync(request, cancellationToken); }), singleObjectParam: true); + rpc.SetLocalRpcMethod("hostWorkspace.execute", (Func>)(async (request, cancellationToken) => + { + var handler = handlers.HostWorkspace ?? throw new InvalidOperationException("No hostWorkspace client-global handler registered"); + return await handler.ExecuteAsync(request, cancellationToken); + }), singleObjectParam: true); rpc.SetLocalRpcMethod("installations.confirm", (Func>)(async (request, cancellationToken) => { var handler = handlers.Installations ?? throw new InvalidOperationException("No installations client-global handler registered"); @@ -52959,6 +53227,10 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(HostSessionSummary))] [JsonSerializable(typeof(HostStartRequest))] [JsonSerializable(typeof(HostStartResult))] +[JsonSerializable(typeof(HostWorkspaceExecuteRequest))] +[JsonSerializable(typeof(HostWorkspaceExecuteResult))] +[JsonSerializable(typeof(HostWorkspaceRequest))] +[JsonSerializable(typeof(HostWorkspaceResult))] [JsonSerializable(typeof(IDictionary))] [JsonSerializable(typeof(IDictionary))] [JsonSerializable(typeof(IList))] diff --git a/go/client.go b/go/client.go index 626abbb933..1c664fb7e0 100644 --- a/go/client.go +++ b/go/client.go @@ -2666,6 +2666,7 @@ func (c *Client) setupNotificationHandler() { handlers.GitHubTelemetry = &gitHubTelemetryAdapter{callback: c.options.OnGitHubTelemetry} } rpc.RegisterClientGlobalAPIHandlers(c.client, handlers) + c.client.SetRequestContextHandler("hostWorkspace.execute", c.handleHostWorkspaceExecute) if c.options.InstallationConfirmationHandler != nil { adapter := newInstallationConfirmationAdapter(c.options.InstallationConfirmationHandler, c.client.ConnectionClosed()) c.installationConfirmationAdapterMux.Lock() diff --git a/go/github_token_provider.go b/go/github_token_provider.go index bc51e51b36..3527ad0e71 100644 --- a/go/github_token_provider.go +++ b/go/github_token_provider.go @@ -22,7 +22,9 @@ const ( // // Experimental: GitHubTokenProviderArgs may change or be removed. type GitHubTokenProviderArgs struct { - // Host is the effective GitHub host for which a token is needed. + // Host is copied from the runtime without SDK normalization. Hosting uses + // auth_manager_config.github_host, defaulting to https://github.com. + // Validate it against the configured GitHub origin before minting. Host string // SessionID identifies the session receiving the token. It is nil for // hosting credentials and before a cloud session has been assigned an ID. diff --git a/go/host.go b/go/host.go index cc5ec4f3e0..4faa60f9a0 100644 --- a/go/host.go +++ b/go/host.go @@ -54,11 +54,15 @@ type AhpHostOptions struct { // when the issuer supplies no lifetime metadata, never for an expired token. // The callback belongs to this host and receives no SessionID. GitHubTokenProvider GitHubTokenProvider + WorkspaceProvider *AhpWorkspaceProvider CreateSession func(context.Context, AhpSessionCreateRequest) (*Session, error) ResumeSession func(context.Context, AhpSessionResumeRequest) (*Session, error) OnSessionReleased func(*Session) error OnExit func(AhpHostExit) error credentialProviderRegistrationID string + workspaceContext context.Context + workspaceCancel context.CancelFunc + workspaceSlots chan struct{} } // AhpHost is an experimental listener owned by one SDK connection. @@ -124,6 +128,10 @@ func (c *Client) StartAhpHost(ctx context.Context, options *AhpHostOptions) (*Ah if options.GitHubTokenProvider != nil && options.GitHubEnvironment == nil { return nil, errors.New("hosting GitHubTokenProvider requires GitHubEnvironment") } + if options.WorkspaceProvider != nil && (options.CreateSession == nil || options.ResumeSession == nil || + options.WorkspaceProvider.Describe == nil || options.WorkspaceProvider.Resolve == nil) { + return nil, errors.New("remote workspace requires Describe, Resolve, CreateSession and ResumeSession") + } if options.GitHubTokenProvider != nil && options.GitHubEnvironment.CredentialProviderRegistrationID != nil { return nil, errors.New("hosting credential provider and registration ID cannot be combined") } @@ -142,6 +150,12 @@ func (c *Client) StartAhpHost(ctx context.Context, options *AhpHostOptions) (*Ah hostRPC := c.RPC.Host c.startStopMux.RUnlock() hostID := uuid.NewString() + if opts.WorkspaceProvider != nil { + provider := *opts.WorkspaceProvider + opts.WorkspaceProvider = &provider + opts.workspaceContext, opts.workspaceCancel = context.WithCancel(context.WithoutCancel(ctx)) + opts.workspaceSlots = make(chan struct{}, 8) + } if opts.GitHubTokenProvider != nil { environment := *opts.GitHubEnvironment opts.credentialProviderRegistrationID = c.registerScopedGitHubTokenProvider(opts.GitHubTokenProvider, true) @@ -165,6 +179,9 @@ func (c *Client) StartAhpHost(ctx context.Context, options *AhpHostOptions) (*Ah if opts.ResumeSession != nil { params.ResumeFactory = Bool(true) } + if opts.WorkspaceProvider != nil { + params.WorkspaceProvider = Bool(true) + } type startResult struct { info *rpc.HostStartResult err error @@ -183,6 +200,9 @@ func (c *Client) StartAhpHost(ctx context.Context, options *AhpHostOptions) (*Ah info := result.info return &AhpHost{HostID: info.HostID, URL: info.URL, Token: info.Token, PID: info.Pid, EnvironmentID: info.EnvironmentID, rpc: hostRPC}, nil case <-ctx.Done(): + if opts.workspaceCancel != nil { + opts.workspaceCancel() + } // Wait for registration before disposing: an early dispose can miss the listener. go func() { defer c.releaseAhpHost(hostID) @@ -207,6 +227,9 @@ func (c *Client) releaseAhpHost(hostID string) (AhpHostOptions, bool) { } } c.ahp.mu.Unlock() + if options.workspaceCancel != nil { + options.workspaceCancel() + } if options.credentialProviderRegistrationID != "" { c.unregisterGitHubTokenProvider(options.credentialProviderRegistrationID) } diff --git a/go/host_workspace.go b/go/host_workspace.go new file mode 100644 index 0000000000..56d259af2d --- /dev/null +++ b/go/host_workspace.go @@ -0,0 +1,343 @@ +package copilot + +import ( + "context" + "encoding/json" + "errors" + "time" + + "github.com/github/copilot-sdk/go/internal/jsonrpc2" + "github.com/github/copilot-sdk/go/rpc" +) + +// AhpWorkspaceProvider serves one explicitly remote host, before sessions exist. +// It must never access the brain's workspace filesystem. Describe and Resolve +// are required; an omitted IO callback returns NotImplemented, never local IO. +// Calls may run concurrently. Repository materialization must precede Describe. +type AhpWorkspaceProvider struct { + Describe func(context.Context, AhpWorkspaceCall) (*AhpWorkspaceDescription, error) + Resolve func(context.Context, AhpWorkspaceResolveRequest) (*AhpWorkspaceResolveResult, error) + Read func(context.Context, AhpWorkspaceResourceRequest[AhpWorkspaceReadParams]) (*AhpWorkspaceReadResult, error) + Write func(context.Context, AhpWorkspaceResourceRequest[AhpWorkspaceWriteParams]) error + Stat func(context.Context, AhpWorkspaceResourceRequest[AhpWorkspaceStatParams]) (*AhpWorkspaceStatResult, error) + List func(context.Context, AhpWorkspaceResourceRequest[AhpWorkspaceURIParams]) (*AhpWorkspaceListResult, error) + Copy func(context.Context, AhpWorkspaceResourceRequest[AhpWorkspaceCopyParams]) error + Move func(context.Context, AhpWorkspaceResourceRequest[AhpWorkspaceMoveParams]) error + Delete func(context.Context, AhpWorkspaceResourceRequest[AhpWorkspaceDeleteParams]) error + Mkdir func(context.Context, AhpWorkspaceResourceRequest[AhpWorkspaceURIParams]) error + Access func(context.Context, AhpWorkspaceResourceRequest[AhpWorkspaceAccessParams]) error +} + +// RequestID identifies this invocation, not a session or permission grant. +// Never automatically retry a mutation after cancellation or an ambiguous error. +type AhpWorkspaceCall struct { + HostID string `json:"-"` + RequestID string `json:"-"` +} + +func (c *AhpWorkspaceCall) setWorkspaceCall(call AhpWorkspaceCall) { *c = call } + +// Roots and exclusions are canonical absolute file URIs in the hands namespace. +// They remain fixed for this host's lifetime and do not describe durable SDK state. +type AhpWorkspaceDescription struct { + Roots []string `json:"roots"` + Excluded []string `json:"excluded,omitempty"` +} + +type AhpWorkspacePathMode string + +const ( + AhpWorkspaceExisting AhpWorkspacePathMode = "existing" + AhpWorkspaceCreate AhpWorkspacePathMode = "create" + AhpWorkspaceMkdir AhpWorkspacePathMode = "mkdir" + AhpWorkspaceExistingSubtree AhpWorkspacePathMode = "existingSubtree" + AhpWorkspaceCreateSubtree AhpWorkspacePathMode = "createSubtree" + AhpWorkspaceReadAccess AhpWorkspacePathMode = "readAccess" + AhpWorkspaceWriteAccess AhpWorkspacePathMode = "writeAccess" +) + +type AhpWorkspacePathRequest struct { + URI string `json:"uri"` + Mode AhpWorkspacePathMode `json:"mode"` +} + +type AhpWorkspaceResolveRequest struct { + AhpWorkspaceCall + Paths []AhpWorkspacePathRequest `json:"paths"` + DiscoverProject bool `json:"discoverProject"` + Roots []string `json:"roots"` + Excluded []string `json:"excluded"` +} + +// Project identity must come from the authorized remote repository, not an +// untrusted request. Native repository policy evaluates these facts. +type AhpWorkspaceProject struct { + URI string `json:"uri"` + DisplayName string `json:"displayName"` +} + +type AhpWorkspaceResolvedPath struct { + URI string `json:"uri"` + IsDirectory bool `json:"isDirectory"` + IsSymlink bool `json:"isSymlink"` + Project *AhpWorkspaceProject `json:"project,omitempty"` +} + +type AhpWorkspaceResolveResult struct { + Paths []AhpWorkspaceResolvedPath `json:"paths"` +} + +type AhpWorkspaceGuardPath struct { + RequestedURI string `json:"requestedUri"` + CanonicalURI string `json:"canonicalUri"` + Mode AhpWorkspacePathMode `json:"mode"` +} + +// Recheck these boundaries on hands at execution time. Resolution alone is not +// authorization to follow a replaced symlink. Writes must check hard links and +// etags against the actual opened handle before mutation and honor create-only +// atomically. Subtree operations must not consume an ancestor of an exclusion. +type AhpWorkspaceGuard struct { + Roots []string `json:"roots"` + Excluded []string `json:"excluded"` + Paths []AhpWorkspaceGuardPath `json:"paths"` +} + +type AhpWorkspaceResourceRequest[P any] struct { + AhpWorkspaceCall + Params P `json:"params"` + Guard AhpWorkspaceGuard `json:"guard"` +} + +type AhpWorkspaceResourceMetadata struct { + Channel string `json:"channel"` + Meta json.RawMessage `json:"_meta,omitempty"` +} + +type AhpWorkspaceURIParams struct { + AhpWorkspaceResourceMetadata + URI string `json:"uri"` +} + +type AhpWorkspaceEncoding string + +const ( + AhpWorkspaceUTF8 AhpWorkspaceEncoding = "utf-8" + AhpWorkspaceBase64 AhpWorkspaceEncoding = "base64" +) + +type AhpWorkspaceReadParams struct { + AhpWorkspaceURIParams + Encoding *AhpWorkspaceEncoding `json:"encoding,omitempty"` +} + +type AhpWorkspaceReadResult struct { + Data string `json:"data"` + Encoding AhpWorkspaceEncoding `json:"encoding"` + ContentType *string `json:"contentType,omitempty"` +} + +type AhpWorkspaceWriteMode string + +const ( + AhpWorkspaceTruncate AhpWorkspaceWriteMode = "truncate" + AhpWorkspaceAppend AhpWorkspaceWriteMode = "append" + AhpWorkspaceInsert AhpWorkspaceWriteMode = "insert" +) + +type AhpWorkspaceWriteParams struct { + AhpWorkspaceURIParams + Data string `json:"data"` + Encoding AhpWorkspaceEncoding `json:"encoding"` + CreateOnly *bool `json:"createOnly,omitempty"` + Mode *AhpWorkspaceWriteMode `json:"mode,omitempty"` + Position *int64 `json:"position,omitempty"` + IfMatch *string `json:"ifMatch,omitempty"` +} + +type AhpWorkspaceStatParams struct { + AhpWorkspaceURIParams + FollowSymlinks *bool `json:"followSymlinks,omitempty"` +} + +type AhpWorkspaceResourceType string + +const ( + AhpWorkspaceFile AhpWorkspaceResourceType = "file" + AhpWorkspaceDirectory AhpWorkspaceResourceType = "directory" + AhpWorkspaceSymlink AhpWorkspaceResourceType = "symlink" +) + +type AhpWorkspaceStatResult struct { + URI string `json:"uri"` + Type AhpWorkspaceResourceType `json:"type"` + Size *int64 `json:"size,omitempty"` + Mtime *string `json:"mtime,omitempty"` + Ctime *string `json:"ctime,omitempty"` + ContentType *string `json:"contentType,omitempty"` + Etag *string `json:"etag,omitempty"` +} + +type AhpWorkspaceDirectoryEntry struct { + Name string `json:"name"` + Type AhpWorkspaceResourceType `json:"type"` +} + +type AhpWorkspaceListResult struct { + Entries []AhpWorkspaceDirectoryEntry `json:"entries"` +} + +type AhpWorkspaceMoveParams struct { + AhpWorkspaceResourceMetadata + Source string `json:"source"` + Destination string `json:"destination"` +} + +type AhpWorkspaceCopyParams struct { + AhpWorkspaceMoveParams + FailIfExists *bool `json:"failIfExists,omitempty"` +} + +type AhpWorkspaceDeleteParams struct { + AhpWorkspaceURIParams + Recursive *bool `json:"recursive,omitempty"` +} + +type AhpWorkspaceAccessParams struct { + AhpWorkspaceURIParams + Read *bool `json:"read,omitempty"` + Write *bool `json:"write,omitempty"` +} + +// Only Code crosses the runtime boundary; provider diagnostics may contain +// credentials or file contents and are deliberately not included. +type AhpWorkspaceError struct { + Code rpc.HostWorkspaceErrorCode +} + +func (e *AhpWorkspaceError) Error() string { return "remote workspace: " + string(e.Code) } + +func workspaceFailure(code string) *rpc.HostWorkspaceExecuteResult { + value := rpc.HostWorkspaceErrorCode(code) + return &rpc.HostWorkspaceExecuteResult{Payload: "{}", Error: &value} +} + +func invokeWorkspace[P, R any](ctx context.Context, call AhpWorkspaceCall, payload string, callback func(context.Context, P) (R, error)) (any, error) { + if callback == nil { + return nil, &AhpWorkspaceError{Code: "notImplemented"} + } + var params P + if err := json.Unmarshal([]byte(payload), ¶ms); err != nil { + return nil, &AhpWorkspaceError{Code: "invalidParams"} + } + if target, ok := any(¶ms).(interface{ setWorkspaceCall(AhpWorkspaceCall) }); ok { + target.setWorkspaceCall(call) + } + return callback(ctx, params) +} + +func invokeWorkspaceMutation[P any](ctx context.Context, call AhpWorkspaceCall, payload string, callback func(context.Context, P) error) (any, error) { + if callback == nil { + return nil, &AhpWorkspaceError{Code: "notImplemented"} + } + return invokeWorkspace(ctx, call, payload, func(ctx context.Context, params P) (struct{}, error) { + return struct{}{}, callback(ctx, params) + }) +} + +func (c *Client) handleHostWorkspaceExecute(ctx context.Context, raw json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { + result, err := c.executeHostWorkspace(ctx, raw) + if err != nil { + return nil, &jsonrpc2.Error{Code: -32603, Message: "workspace provider failed"} + } + encoded, err := json.Marshal(result) + if err != nil { + return nil, &jsonrpc2.Error{Code: -32603, Message: "workspace result encoding failed"} + } + return encoded, nil +} + +func (c *Client) executeHostWorkspace(requestCtx context.Context, raw json.RawMessage) (result any, rpcErr error) { + defer func() { + if recover() != nil { + result, rpcErr = workspaceFailure("internal"), nil + } + }() + var request rpc.HostWorkspaceExecuteRequest + if err := json.Unmarshal(raw, &request); err != nil { + return workspaceFailure("invalidParams"), nil + } + c.ahp.mu.Lock() + options, exists := c.ahp.hosts[request.HostID] + c.ahp.mu.Unlock() + if !exists || options.WorkspaceProvider == nil || options.workspaceContext == nil { + return workspaceFailure("permissionDenied"), nil + } + ctx, cancel := context.WithTimeout(requestCtx, 25*time.Second) + defer cancel() + stop := context.AfterFunc(options.workspaceContext, cancel) + defer stop() + if options.workspaceContext.Err() != nil { + cancel() + } + select { + case options.workspaceSlots <- struct{}{}: + defer func() { <-options.workspaceSlots }() + case <-ctx.Done(): + return workspaceFailure("internal"), nil + } + if ctx.Err() != nil { + return workspaceFailure("internal"), nil + } + call := AhpWorkspaceCall{HostID: request.HostID, RequestID: request.RequestID} + provider := options.WorkspaceProvider + var value any + var err error + switch request.Operation { + case "describe": + if provider.Describe == nil { + return workspaceFailure("notImplemented"), nil + } + value, err = provider.Describe(ctx, call) + case "resolve": + value, err = invokeWorkspace(ctx, call, request.Payload, provider.Resolve) + case "read": + value, err = invokeWorkspace(ctx, call, request.Payload, provider.Read) + case "write": + value, err = invokeWorkspaceMutation(ctx, call, request.Payload, provider.Write) + case "stat": + value, err = invokeWorkspace(ctx, call, request.Payload, provider.Stat) + case "list": + value, err = invokeWorkspace(ctx, call, request.Payload, provider.List) + case "copy": + value, err = invokeWorkspaceMutation(ctx, call, request.Payload, provider.Copy) + case "move": + value, err = invokeWorkspaceMutation(ctx, call, request.Payload, provider.Move) + case "delete": + value, err = invokeWorkspaceMutation(ctx, call, request.Payload, provider.Delete) + case "mkdir": + value, err = invokeWorkspaceMutation(ctx, call, request.Payload, provider.Mkdir) + case "access": + value, err = invokeWorkspaceMutation(ctx, call, request.Payload, provider.Access) + default: + return workspaceFailure("notImplemented"), nil + } + if ctx.Err() != nil { + return workspaceFailure("internal"), nil + } + if err != nil { + var failure *AhpWorkspaceError + if errors.As(err, &failure) { + switch failure.Code { + case "invalidParams", "permissionDenied", "notFound", "alreadyExists", "conflict", "notImplemented", "internal": + return workspaceFailure(string(failure.Code)), nil + } + } + return workspaceFailure("internal"), nil + } + encoded, err := json.Marshal(value) + if err != nil || string(encoded) == "null" { + return workspaceFailure("internal"), nil + } + return &rpc.HostWorkspaceExecuteResult{Payload: string(encoded)}, nil +} diff --git a/go/host_workspace_test.go b/go/host_workspace_test.go new file mode 100644 index 0000000000..37c7a68648 --- /dev/null +++ b/go/host_workspace_test.go @@ -0,0 +1,165 @@ +package copilot + +import ( + "context" + "encoding/json" + "errors" + "testing" + "time" + + "github.com/github/copilot-sdk/go/rpc" +) + +func workspaceTestClient(t *testing.T, provider *AhpWorkspaceProvider) *Client { + t.Helper() + ctx, cancel := context.WithCancel(context.Background()) + t.Cleanup(cancel) + return &Client{ahp: ahpHostState{ + hosts: map[string]AhpHostOptions{"host": { + WorkspaceProvider: provider, workspaceContext: ctx, + workspaceCancel: cancel, workspaceSlots: make(chan struct{}, 8), + }}, + handoffs: make(map[string]*ahpHandoff), + }} +} + +func workspaceTestRequest(t *testing.T, host, operation, payload string) json.RawMessage { + t.Helper() + raw, err := json.Marshal(rpc.HostWorkspaceExecuteRequest{ + HostID: host, RequestID: "original-request", + Operation: rpc.HostWorkspaceOperation(operation), Payload: payload, + }) + if err != nil { + t.Fatal(err) + } + return raw +} + +func workspaceTestExecute(t *testing.T, client *Client, host, operation, payload string) *rpc.HostWorkspaceExecuteResult { + t.Helper() + raw, rpcErr := client.handleHostWorkspaceExecute(context.Background(), workspaceTestRequest(t, host, operation, payload)) + if rpcErr != nil { + t.Fatal(rpcErr) + } + var result rpc.HostWorkspaceExecuteResult + if err := json.Unmarshal(raw, &result); err != nil { + t.Fatal(err) + } + return &result +} + +func TestAhpWorkspaceDescriptionExistsBeforeSessions(t *testing.T) { + client := workspaceTestClient(t, &AhpWorkspaceProvider{ + Describe: func(ctx context.Context, call AhpWorkspaceCall) (*AhpWorkspaceDescription, error) { + if call.HostID != "host" || call.RequestID != "original-request" { + t.Fatalf("wrong callback ownership: %+v", call) + } + deadline, ok := ctx.Deadline() + if !ok || time.Until(deadline) > 25*time.Second { + t.Fatal("workspace callback has no bounded deadline") + } + return &AhpWorkspaceDescription{Roots: []string{"file:///hands/repo"}}, nil + }, + }) + result := workspaceTestExecute(t, client, "host", "describe", "{}") + if result.Error != nil || result.Payload != `{"roots":["file:///hands/repo"]}` { + t.Fatalf("unexpected description: %+v", result) + } +} + +func TestAhpWorkspaceWritePreservesGuardAndExactOffsets(t *testing.T) { + called := false + client := workspaceTestClient(t, &AhpWorkspaceProvider{ + Write: func(_ context.Context, request AhpWorkspaceResourceRequest[AhpWorkspaceWriteParams]) error { + called = true + if request.HostID != "host" || request.RequestID != "original-request" { + t.Fatalf("lost callback identity: %+v", request.AhpWorkspaceCall) + } + if request.Params.Position == nil || *request.Params.Position != 9007199254740993 { + t.Fatalf("offset was rounded: %+v", request.Params.Position) + } + if request.Params.IfMatch == nil || *request.Params.IfMatch != "opaque-etag" || + request.Params.CreateOnly == nil || *request.Params.CreateOnly || + request.Params.Mode == nil || *request.Params.Mode != AhpWorkspaceInsert { + t.Fatalf("lost write preconditions: %+v", request.Params) + } + if request.Params.Channel != "ahp-session:/canonical" || string(request.Params.Meta) != `{"trace":"original"}` || + len(request.Guard.Paths) != 1 || request.Guard.Paths[0].CanonicalURI != "file:///hands/repo/file" { + t.Fatalf("lost AHP metadata or guard: %+v", request) + } + return nil + }, + }) + result := workspaceTestExecute(t, client, "host", "write", `{ + "params":{"channel":"ahp-session:/canonical","_meta":{"trace":"original"}, + "uri":"file:///hands/repo/file","data":"text","encoding":"utf-8", + "mode":"insert","position":9007199254740993,"ifMatch":"opaque-etag","createOnly":false}, + "guard":{"roots":["file:///hands/repo"],"excluded":[], + "paths":[{"requestedUri":"file:///hands/repo/file","canonicalUri":"file:///hands/repo/file","mode":"create"}]}}`) + if !called || result.Error != nil || result.Payload != "{}" { + t.Fatalf("unexpected write result: %+v", result) + } +} + +func TestAhpWorkspaceFailuresDoNotExposeProviderDiagnostics(t *testing.T) { + for _, test := range []struct { + name string + err error + code string + }{ + {"opaque", errors.New("private credential and filesystem diagnostic"), "internal"}, + {"conflict", &AhpWorkspaceError{Code: "conflict"}, "conflict"}, + {"invalid code", &AhpWorkspaceError{Code: "unknown"}, "internal"}, + } { + t.Run(test.name, func(t *testing.T) { + client := workspaceTestClient(t, &AhpWorkspaceProvider{ + Read: func(context.Context, AhpWorkspaceResourceRequest[AhpWorkspaceReadParams]) (*AhpWorkspaceReadResult, error) { + return nil, test.err + }, + }) + result := workspaceTestExecute(t, client, "host", "read", `{"params":{"uri":"file:///hands/repo/file"},"guard":{}}`) + if result.Error == nil || string(*result.Error) != test.code || result.Payload != "{}" { + t.Fatalf("unexpected error result: %+v", result) + } + }) + } +} + +func TestAhpWorkspaceMissingProviderAndUnknownHostFailClosed(t *testing.T) { + client := workspaceTestClient(t, &AhpWorkspaceProvider{}) + for _, test := range []struct{ host, code string }{ + {"host", "notImplemented"}, {"other-host", "permissionDenied"}, + } { + result := workspaceTestExecute(t, client, test.host, "read", "{}") + if result.Error == nil || string(*result.Error) != test.code { + t.Fatalf("unexpected scope result: %+v", result) + } + } +} + +func TestAhpWorkspaceHostReleaseCancelsAnInflightProvider(t *testing.T) { + started := make(chan struct{}) + stopped := make(chan struct{}) + client := workspaceTestClient(t, &AhpWorkspaceProvider{ + Read: func(ctx context.Context, _ AhpWorkspaceResourceRequest[AhpWorkspaceReadParams]) (*AhpWorkspaceReadResult, error) { + close(started) + <-ctx.Done() + close(stopped) + return nil, ctx.Err() + }, + }) + done := make(chan struct{}) + request := workspaceTestRequest(t, "host", "read", "{}") + go func() { + defer close(done) + _, _ = client.handleHostWorkspaceExecute(context.Background(), request) + }() + <-started + client.releaseAhpHost("host") + select { + case <-stopped: + case <-time.After(time.Second): + t.Fatal("host release did not cancel workspace IO") + } + <-done +} diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index 5a566e231d..112fa4efc1 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -5810,6 +5810,9 @@ type HostConfiguration struct { ResumeFactory bool `json:"resumeFactory"` // Whether session materialization is delegated to the owning application. SessionFactory bool `json:"sessionFactory"` + // Workspace callbacks are confined to the owning SDK connection and never replace durable + // session-state IO. + WorkspaceProvider *bool `json:"workspaceProvider,omitempty"` } // The resident session the application has materialized on its own connection. @@ -5884,6 +5887,9 @@ type HostGetConfigurationResult struct { ResumeFactory bool `json:"resumeFactory"` // Whether session materialization is delegated to the owning application. SessionFactory bool `json:"sessionFactory"` + // Workspace callbacks are confined to the owning SDK connection and never replace durable + // session-state IO. + WorkspaceProvider *bool `json:"workspaceProvider,omitempty"` } // Private credentials delivered only to a runtime-owned Mission Control hosting participant. @@ -5908,8 +5914,9 @@ type HostGitHubEnvironmentOptions struct { // Stable application installation identity, reused across host restarts. ComputeID string `json:"computeId"` // Opaque SDK registration for a refreshable hosting credential. Tokens are requested only - // from the owning SDK connection through gitHubToken.getToken and must remain valid for at - // least 120 seconds. Omitting this uses the runtime's existing authentication. + // from the owning SDK connection through gitHubToken.getToken. A supplied lifetime must be + // at least 120 seconds; omission explicitly means unknown lifetime with bounded periodic + // refresh. Omitting this registration uses the runtime's existing authentication. CredentialProviderRegistrationID *string `json:"credentialProviderRegistrationId,omitempty"` // Registration kind. Defaults to user-local; managed kinds adopt the preallocated // environment identified by the authenticated owner and computeId. @@ -6153,6 +6160,9 @@ type HostStartRequest struct { ResumeFactory *bool `json:"resumeFactory,omitempty"` // Ask the owning SDK application to materialize AHP sessions. SessionFactory *bool `json:"sessionFactory,omitempty"` + // Opt in to the owning application's remote workspace. Requires both session factories; + // durable session state remains independent. + WorkspaceProvider *bool `json:"workspaceProvider,omitempty"` } // Listener readiness, returned only after binding and the supervised participant's SDK @@ -6172,6 +6182,57 @@ type HostStartResult struct { URL *string `json:"url,omitempty"` } +// A supervised child's request. The runtime supplies host identity rather than accepting it +// from the child. +// Experimental: HostWorkspaceCallRequest is part of an experimental API and may change or +// be removed. +type HostWorkspaceCallRequest struct { + // Selects the workspace/AHP parameter and result shapes carried by the serialized payload. + Operation HostWorkspaceOperation `json:"operation"` + // Serialized operation parameters preserve AHP integer offsets and opaque etags without an + // untyped numeric projection. + Payload string `json:"payload"` +} + +// A bounded callback to the SDK connection that owns this host, including before any +// session exists. +// Experimental: HostWorkspaceExecuteRequest is part of an experimental API and may change +// or be removed. +type HostWorkspaceExecuteRequest struct { + // Runtime-assigned host identity bound to this SDK connection; never supplied by a + // workspace client. + HostID string `json:"hostId"` + // Selects the workspace/AHP parameter and result shapes carried by the serialized payload. + Operation HostWorkspaceOperation `json:"operation"` + // Serialized parameters and physical path guards, preserving integer offsets and opaque + // metadata. + Payload string `json:"payload"` + // Unique callback invocation identity; original AHP metadata remains inside the payload. + RequestID string `json:"requestId"` +} + +// Successful payloads use the corresponding workspace/AHP result shape. An error carries no +// usable result. +// Experimental: HostWorkspaceExecuteResult is part of an experimental API and may change or +// be removed. +type HostWorkspaceExecuteResult struct { + // Safe allowlisted failure classification; omission indicates a successful payload. + Error *HostWorkspaceErrorCode `json:"error,omitempty"` + // Serialized operation result; ignored when an error is present. + Payload string `json:"payload"` +} + +// Successful payloads use the corresponding workspace/AHP result shape. An error carries no +// usable result. +// Experimental: HostWorkspaceResult is part of an experimental API and may change or be +// removed. +type HostWorkspaceResult struct { + // Safe allowlisted failure classification; omission indicates a successful payload. + Error *HostWorkspaceErrorCode `json:"error,omitempty"` + // Serialized operation result; ignored when an error is present. + Payload string `json:"payload"` +} + // Catalogue identity retained from a bound candidate or plan at installation time. // Experimental: InstallationCatalogueIdentity is part of an experimental API and may change // or be removed. @@ -24459,6 +24520,61 @@ const ( HostRuntimePrincipalUser HostRuntimePrincipal = "user" ) +// Only these errors cross the workspace callback boundary; arbitrary provider diagnostics +// are not exposed. +// Experimental: HostWorkspaceErrorCode is part of an experimental API and may change or be +// removed. +type HostWorkspaceErrorCode string + +const ( + // An entry already exists where exclusive creation was requested. + HostWorkspaceErrorCodeAlreadyExists HostWorkspaceErrorCode = "alreadyExists" + // An etag or concurrent-state precondition failed. + HostWorkspaceErrorCodeConflict HostWorkspaceErrorCode = "conflict" + // The provider failed without exposing private diagnostic details. + HostWorkspaceErrorCodeInternal HostWorkspaceErrorCode = "internal" + // The operation parameters do not satisfy the workspace contract. + HostWorkspaceErrorCodeInvalidParams HostWorkspaceErrorCode = "invalidParams" + // The requested remote entry does not exist. + HostWorkspaceErrorCodeNotFound HostWorkspaceErrorCode = "notFound" + // This provider does not support the requested operation. + HostWorkspaceErrorCodeNotImplemented HostWorkspaceErrorCode = "notImplemented" + // The physical guard or authorization rejected access. + HostWorkspaceErrorCodePermissionDenied HostWorkspaceErrorCode = "permissionDenied" +) + +// The closed operation set for host-scoped remote workspace IO. Watchers and process/Git +// execution are intentionally absent. +// Experimental: HostWorkspaceOperation is part of an experimental API and may change or be +// removed. +type HostWorkspaceOperation string + +const ( + // Check requested remote read and write access independently. + HostWorkspaceOperationAccess HostWorkspaceOperation = "access" + // Copy a file while checking both source and destination guards. + HostWorkspaceOperationCopy HostWorkspaceOperation = "copy" + // Delete an authorized entry without crossing excluded subtrees. + HostWorkspaceOperationDelete HostWorkspaceOperation = "delete" + // Declare immutable canonical remote roots and exclusions before host admission. + HostWorkspaceOperationDescribe HostWorkspaceOperation = "describe" + // List entries in an authorized remote directory. + HostWorkspaceOperationList HostWorkspaceOperation = "list" + // Create the authorized directory and missing parent directories. + HostWorkspaceOperationMkdir HostWorkspaceOperation = "mkdir" + // Move an entry while enforcing subtree exclusions at both paths. + HostWorkspaceOperationMove HostWorkspaceOperation = "move" + // Read remote file content with the requested encoding. + HostWorkspaceOperationRead HostWorkspaceOperation = "read" + // Resolve paths and optionally discover project identity within the declared boundaries. + HostWorkspaceOperationResolve HostWorkspaceOperation = "resolve" + // Inspect remote entry metadata and optional etag. + HostWorkspaceOperationStat HostWorkspaceOperation = "stat" + // Write through a physical guard while preserving offsets, modes, etags and create-only + // behavior. + HostWorkspaceOperationWrite HostWorkspaceOperation = "write" +) + // Live indexed-search state for this session activation, never inferred from persisted // history. // Experimental: IndexedSearchState is part of an experimental API and may change or be @@ -31247,6 +31363,30 @@ func (a *InternalServerHostAPI) ReleaseSession(ctx context.Context, params *Host return &result, nil } +// Workspace routes a remote workspace operation only from its supervised child to its +// owning SDK connection. +// +// RPC method: host.workspace. +// +// Parameters: A supervised child's request. The runtime supplies host identity rather than +// accepting it from the child. +// +// Returns: Successful payloads use the corresponding workspace/AHP result shape. An error +// carries no usable result. +// Internal: Workspace is part of the SDK's internal handshake/plumbing; external callers +// should not use it. +func (a *InternalServerHostAPI) Workspace(ctx context.Context, params *HostWorkspaceCallRequest) (*HostWorkspaceExecuteResult, error) { + raw, err := a.client.Request(ctx, "host.workspace", params) + if err != nil { + return nil, err + } + var result HostWorkspaceExecuteResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // Experimental: InternalServerSessionsAPI contains experimental APIs that may change or be // removed. type InternalServerSessionsAPI internalServerAPI @@ -41468,6 +41608,23 @@ type HostHandler interface { Shutdown(request *HostEmptyResult) (*HostShutdownResult, error) } +// Experimental: HostWorkspaceHandler contains experimental APIs that may change or be +// removed. +type HostWorkspaceHandler interface { + // Executes one bounded operation for an explicitly remote workspace on its owning SDK + // connection. No local filesystem fallback is permitted. The provider must enforce the + // native canonical-path guard and physical IO preconditions on hands. + // + // RPC method: hostWorkspace.execute. + // + // Parameters: A bounded callback to the SDK connection that owns this host, including + // before any session exists. + // + // Returns: Successful payloads use the corresponding workspace/AHP result shape. An error + // carries no usable result. + Execute(request *HostWorkspaceExecuteRequest) (*HostWorkspaceExecuteResult, error) +} + // Experimental: InstallationsHandler contains experimental APIs that may change or be // removed. type InstallationsHandler interface { @@ -41527,6 +41684,7 @@ type ClientGlobalAPIHandlers struct { GitHubToken GitHubTokenHandler Hooks HooksHandler Host HostHandler + HostWorkspace HostWorkspaceHandler Installations InstallationsHandler LlmInference LlmInferenceHandler } @@ -41692,6 +41850,24 @@ func RegisterClientGlobalAPIHandlers(client *jsonrpc2.Client, handlers *ClientGl } return raw, nil }) + client.SetRequestHandler("hostWorkspace.execute", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { + var request HostWorkspaceExecuteRequest + if err := json.Unmarshal(params, &request); err != nil { + return nil, &jsonrpc2.Error{Code: -32602, Message: fmt.Sprintf("Invalid params: %v", err)} + } + if handlers == nil || handlers.HostWorkspace == nil { + return nil, &jsonrpc2.Error{Code: -32603, Message: "No hostWorkspace client-global handler registered"} + } + result, err := handlers.HostWorkspace.Execute(&request) + if err != nil { + return nil, clientGlobalHandlerError(err) + } + raw, err := json.Marshal(result) + if err != nil { + return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("Failed to marshal response: %v", err)} + } + return raw, nil + }) client.SetRequestHandler("installations.confirm", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { var request InstallationConfirmationRequest if err := json.Unmarshal(params, &request); err != nil { diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostConfiguration.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostConfiguration.java index 15187b8763..59b53fd4f5 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostConfiguration.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostConfiguration.java @@ -32,6 +32,8 @@ record HostConfiguration( /** Whether session materialization is delegated to the owning application. */ @JsonProperty("sessionFactory") Boolean sessionFactory, /** Whether app-owned durable sessions are resumed by the owning application. */ - @JsonProperty("resumeFactory") Boolean resumeFactory + @JsonProperty("resumeFactory") Boolean resumeFactory, + /** Workspace callbacks are confined to the owning SDK connection and never replace durable session-state IO. */ + @JsonProperty("workspaceProvider") Boolean workspaceProvider ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostGitHubEnvironmentOptions.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostGitHubEnvironmentOptions.java index af7652d1f2..d06c6868b3 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostGitHubEnvironmentOptions.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostGitHubEnvironmentOptions.java @@ -31,7 +31,7 @@ public record HostGitHubEnvironmentOptions( @JsonProperty("computeId") String computeId, /** Registration kind. Defaults to user-local; managed kinds adopt the preallocated environment identified by the authenticated owner and computeId. */ @JsonProperty("kind") HostEnvironmentKind kind, - /** Opaque SDK registration for a refreshable hosting credential. Tokens are requested only from the owning SDK connection through gitHubToken.getToken and must remain valid for at least 120 seconds. Omitting this uses the runtime's existing authentication. */ + /** Opaque SDK registration for a refreshable hosting credential. Tokens are requested only from the owning SDK connection through gitHubToken.getToken. A supplied lifetime must be at least 120 seconds; omission explicitly means unknown lifetime with bounded periodic refresh. Omitting this registration uses the runtime's existing authentication. */ @JsonProperty("credentialProviderRegistrationId") String credentialProviderRegistrationId, /** Runtime authentication principal, independent of Mission Control's routing owner. Defaults to user. github-app requires a separately built managed-hosting runtime and a managed-sandbox registration; ordinary runtime builds reject it. */ @JsonProperty("runtimePrincipal") HostRuntimePrincipal runtimePrincipal, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostStartRequest.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostStartRequest.java index b6d4fc3b98..726478438b 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostStartRequest.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostStartRequest.java @@ -50,6 +50,10 @@ public final class HostStartRequest { @JsonProperty("computeId") private String computeId; + /** Opt in to the owning application's remote workspace. Requires both session factories; durable session state remains independent. */ + @JsonProperty("workspaceProvider") + private Boolean workspaceProvider; + /** * Creates a request with its required inputs. * @@ -113,6 +117,15 @@ public String getComputeId() { return computeId; } + /** + * Returns the {@code workspaceProvider} property. + * + * @return Opt in to the owning application's remote workspace. Requires both session factories; durable session state remains independent. + */ + public Boolean getWorkspaceProvider() { + return workspaceProvider; + } + /** * Sets the {@code localServer} property. * @@ -167,4 +180,15 @@ public HostStartRequest setComputeId(String value) { this.computeId = value; return this; } + + /** + * Sets the {@code workspaceProvider} property. + * + * @param value Opt in to the owning application's remote workspace. Requires both session factories; durable session state remains independent. + * @return this request + */ + public HostStartRequest setWorkspaceProvider(Boolean value) { + this.workspaceProvider = value; + return this; + } } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceErrorCode.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceErrorCode.java new file mode 100644 index 0000000000..02dde125be --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceErrorCode.java @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Only these errors cross the workspace callback boundary; arbitrary provider diagnostics are not exposed. + * + * @apiNote This type is experimental and may change in a future version. + * + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum HostWorkspaceErrorCode { + /** The {@code invalidParams} variant. */ + INVALIDPARAMS("invalidParams"), + /** The {@code permissionDenied} variant. */ + PERMISSIONDENIED("permissionDenied"), + /** The {@code notFound} variant. */ + NOTFOUND("notFound"), + /** The {@code alreadyExists} variant. */ + ALREADYEXISTS("alreadyExists"), + /** The {@code conflict} variant. */ + CONFLICT("conflict"), + /** The {@code notImplemented} variant. */ + NOTIMPLEMENTED("notImplemented"), + /** The {@code internal} variant. */ + INTERNAL("internal"); + + private final String value; + HostWorkspaceErrorCode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static HostWorkspaceErrorCode fromValue(String value) { + for (HostWorkspaceErrorCode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown HostWorkspaceErrorCode value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceExecuteRequest.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceExecuteRequest.java new file mode 100644 index 0000000000..0d1fa299c7 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceExecuteRequest.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * A bounded callback to the SDK connection that owns this host, including before any session exists. + * + * @apiNote This type is experimental and may change in a future version. + * + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record HostWorkspaceExecuteRequest( + /** Runtime-assigned host identity bound to this SDK connection; never supplied by a workspace client. */ + @JsonProperty("hostId") String hostId, + /** Unique callback invocation identity; original AHP metadata remains inside the payload. */ + @JsonProperty("requestId") String requestId, + /** Selects the workspace/AHP parameter and result shapes carried by the serialized payload. */ + @JsonProperty("operation") HostWorkspaceOperation operation, + /** Serialized parameters and physical path guards, preserving integer offsets and opaque metadata. */ + @JsonProperty("payload") String payload +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceExecuteResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceExecuteResult.java new file mode 100644 index 0000000000..3ec16053dd --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceExecuteResult.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Successful payloads use the corresponding workspace/AHP result shape. An error carries no usable result. + * + * @apiNote This type is experimental and may change in a future version. + * + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record HostWorkspaceExecuteResult( + /** Serialized operation result; ignored when an error is present. */ + @JsonProperty("payload") String payload, + /** Safe allowlisted failure classification; omission indicates a successful payload. */ + @JsonProperty("error") HostWorkspaceErrorCode error +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceOperation.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceOperation.java new file mode 100644 index 0000000000..e0af35a259 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceOperation.java @@ -0,0 +1,57 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * The closed operation set for host-scoped remote workspace IO. Watchers and process/Git execution are intentionally absent. + * + * @apiNote This type is experimental and may change in a future version. + * + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum HostWorkspaceOperation { + /** The {@code describe} variant. */ + DESCRIBE("describe"), + /** The {@code resolve} variant. */ + RESOLVE("resolve"), + /** The {@code read} variant. */ + READ("read"), + /** The {@code write} variant. */ + WRITE("write"), + /** The {@code stat} variant. */ + STAT("stat"), + /** The {@code list} variant. */ + LIST("list"), + /** The {@code copy} variant. */ + COPY("copy"), + /** The {@code move} variant. */ + MOVE("move"), + /** The {@code delete} variant. */ + DELETE("delete"), + /** The {@code mkdir} variant. */ + MKDIR("mkdir"), + /** The {@code access} variant. */ + ACCESS("access"); + + private final String value; + HostWorkspaceOperation(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static HostWorkspaceOperation fromValue(String value) { + for (HostWorkspaceOperation v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown HostWorkspaceOperation value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceParams.java new file mode 100644 index 0000000000..bb9f50ccb9 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/HostWorkspaceParams.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * A supervised child's request. The runtime supplies host identity rather than accepting it from the child. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +record HostWorkspaceParams( + /** Selects the workspace/AHP parameter and result shapes carried by the serialized payload. */ + @JsonProperty("operation") HostWorkspaceOperation operation, + /** Serialized operation parameters preserve AHP integer offsets and opaque etags without an untyped numeric projection. */ + @JsonProperty("payload") String payload +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerHostApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerHostApi.java index 613fc1a318..a572dc18f3 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerHostApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerHostApi.java @@ -128,6 +128,17 @@ CompletableFuture getConfiguration() { return caller.invoke("host.getConfiguration", java.util.Map.of(), HostConfiguration.class); } + /** + * Routes a remote workspace operation only from its supervised child to its owning SDK connection. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + CompletableFuture workspace(HostWorkspaceParams params) { + return caller.invoke("host.workspace", params, HostWorkspaceExecuteResult.class); + } + /** * Reports a supervised hosting participant's bound AHP endpoint after its SDK handshake. * diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index a59667df36..761b33e248 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -2241,6 +2241,58 @@ export type HostExitReason = | "ownerDisconnected" /** The runtime is shutting down. */ | "runtimeShutdown"; +/** + * The closed operation set for host-scoped remote workspace IO. Watchers and process/Git execution are intentionally absent. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HostWorkspaceOperation". + */ +/** @experimental */ +export type HostWorkspaceOperation = + /** Declare immutable canonical remote roots and exclusions before host admission. */ + | "describe" + /** Resolve paths and optionally discover project identity within the declared boundaries. */ + | "resolve" + /** Read remote file content with the requested encoding. */ + | "read" + /** Write through a physical guard while preserving offsets, modes, etags and create-only behavior. */ + | "write" + /** Inspect remote entry metadata and optional etag. */ + | "stat" + /** List entries in an authorized remote directory. */ + | "list" + /** Copy a file while checking both source and destination guards. */ + | "copy" + /** Move an entry while enforcing subtree exclusions at both paths. */ + | "move" + /** Delete an authorized entry without crossing excluded subtrees. */ + | "delete" + /** Create the authorized directory and missing parent directories. */ + | "mkdir" + /** Check requested remote read and write access independently. */ + | "access"; +/** + * Only these errors cross the workspace callback boundary; arbitrary provider diagnostics are not exposed. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HostWorkspaceErrorCode". + */ +/** @experimental */ +export type HostWorkspaceErrorCode = + /** The operation parameters do not satisfy the workspace contract. */ + | "invalidParams" + /** The physical guard or authorization rejected access. */ + | "permissionDenied" + /** The requested remote entry does not exist. */ + | "notFound" + /** An entry already exists where exclusive creation was requested. */ + | "alreadyExists" + /** An etag or concurrent-state precondition failed. */ + | "conflict" + /** This provider does not support the requested operation. */ + | "notImplemented" + /** The provider failed without exposing private diagnostic details. */ + | "internal"; /** * Only resource kinds with an implemented installation engine have a review variant. * @@ -13187,6 +13239,10 @@ export interface HostConfiguration { * Whether app-owned durable sessions are resumed by the owning application. */ resumeFactory: boolean; + /** + * Workspace callbacks are confined to the owning SDK connection and never replace durable session-state IO. + */ + workspaceProvider?: boolean; } /** * Normalized local WebSocket listener settings. @@ -13231,7 +13287,7 @@ export interface HostGitHubEnvironmentOptions { computeId: string; kind?: HostEnvironmentKind; /** - * Opaque SDK registration for a refreshable hosting credential. Tokens are requested only from the owning SDK connection through gitHubToken.getToken and must remain valid for at least 120 seconds. Omitting this uses the runtime's existing authentication. + * Opaque SDK registration for a refreshable hosting credential. Tokens are requested only from the owning SDK connection through gitHubToken.getToken. A supplied lifetime must be at least 120 seconds; omission explicitly means unknown lifetime with bounded periodic refresh. Omitting this registration uses the runtime's existing authentication. */ credentialProviderRegistrationId?: string; runtimePrincipal?: HostRuntimePrincipal; @@ -13605,6 +13661,10 @@ export interface HostStartRequest { * Ask the owning application to resume its durable AHP sessions. */ resumeFactory?: boolean; + /** + * Opt in to the owning application's remote workspace. Requires both session factories; durable session state remains independent. + */ + workspaceProvider?: boolean; } /** * Listener readiness, returned only after binding and the supervised participant's SDK handshake. @@ -13635,6 +13695,56 @@ export interface HostStartResult { */ pid?: number; } +/** + * A supervised child's request. The runtime supplies host identity rather than accepting it from the child. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HostWorkspaceCallRequest". + */ +/** @experimental */ +export interface HostWorkspaceCallRequest { + operation: HostWorkspaceOperation; + /** + * Serialized operation parameters preserve AHP integer offsets and opaque etags without an untyped numeric projection. + */ + payload: string; +} +/** + * A bounded callback to the SDK connection that owns this host, including before any session exists. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HostWorkspaceExecuteRequest". + */ +/** @experimental */ +export interface HostWorkspaceExecuteRequest { + /** + * Runtime-assigned host identity bound to this SDK connection; never supplied by a workspace client. + */ + hostId: string; + /** + * Unique callback invocation identity; original AHP metadata remains inside the payload. + */ + requestId: string; + operation: HostWorkspaceOperation; + /** + * Serialized parameters and physical path guards, preserving integer offsets and opaque metadata. + */ + payload: string; +} +/** + * Successful payloads use the corresponding workspace/AHP result shape. An error carries no usable result. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HostWorkspaceExecuteResult". + */ +/** @experimental */ +export interface HostWorkspaceExecuteResult { + /** + * Serialized operation result; ignored when an error is present. + */ + payload: string; + error?: HostWorkspaceErrorCode; +} /** * Catalogue identity retained from a bound candidate or plan at installation time. * @@ -31485,6 +31595,38 @@ export interface HostGetConfigurationResult { * Whether app-owned durable sessions are resumed by the owning application. */ resumeFactory: boolean; + /** + * Workspace callbacks are confined to the owning SDK connection and never replace durable session-state IO. + */ + workspaceProvider?: boolean; +} +/** + * Successful payloads use the corresponding workspace/AHP result shape. An error carries no usable result. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HostWorkspaceResult". + */ +/** @experimental */ +export interface HostWorkspaceResult { + /** + * Serialized operation result; ignored when an error is present. + */ + payload: string; + error?: HostWorkspaceErrorCode; +} +/** + * A supervised child's request. The runtime supplies host identity rather than accepting it from the child. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "HostWorkspaceRequest". + */ +/** @experimental */ +export interface HostWorkspaceRequest { + operation: HostWorkspaceOperation; + /** + * Serialized operation parameters preserve AHP integer offsets and opaque etags without an untyped numeric projection. + */ + payload: string; } /** * Empty acknowledgement for a completed host lifecycle operation. @@ -33172,6 +33314,15 @@ export function createInternalServerRpc(connection: MessageConnection) { */ getConfiguration: async (): Promise => connection.sendRequest("host.getConfiguration", {}), + /** + * Routes a remote workspace operation only from its supervised child to its owning SDK connection. + * + * @param params A supervised child's request. The runtime supplies host identity rather than accepting it from the child. + * + * @returns Successful payloads use the corresponding workspace/AHP result shape. An error carries no usable result. + */ + workspace: async (params: HostWorkspaceRequest): Promise => + connection.sendRequest("host.workspace", params), /** * Reports a supervised hosting participant's bound AHP endpoint after its SDK handshake. * @@ -36750,6 +36901,19 @@ export interface GitHubTokenHandler { getToken(params: GitHubTokenAcquireRequest): Promise; } +/** Handler for `hostWorkspace` client global API methods. */ +/** @experimental */ +export interface HostWorkspaceHandler { + /** + * Executes one bounded operation for an explicitly remote workspace on its owning SDK connection. No local filesystem fallback is permitted. The provider must enforce the native canonical-path guard and physical IO preconditions on hands. + * + * @param params A bounded callback to the SDK connection that owns this host, including before any session exists. + * + * @returns Successful payloads use the corresponding workspace/AHP result shape. An error carries no usable result. + */ + execute(params: HostWorkspaceExecuteRequest): Promise; +} + /** Handler for `installations` client global API methods. */ /** @experimental */ export interface InstallationsHandler { @@ -36770,6 +36934,7 @@ export interface ClientGlobalApiHandlers { llmInference?: LlmInferenceHandler; gitHubTelemetry?: GitHubTelemetryHandler; gitHubToken?: GitHubTokenHandler; + hostWorkspace?: HostWorkspaceHandler; installations?: InstallationsHandler; } @@ -36814,6 +36979,11 @@ export function registerClientGlobalApiHandlers( if (!handler) throw new Error("No gitHubToken client-global handler registered"); return handler.getToken(params); }); + connection.onRequest("hostWorkspace.execute", async (params: HostWorkspaceExecuteRequest) => { + const handler = handlers.hostWorkspace; + if (!handler) throw new Error("No hostWorkspace client-global handler registered"); + return handler.execute(params); + }); connection.onRequest("installations.confirm", async (params: InstallationsConfirmRequest) => { const handler = handlers.installations; if (!handler) throw new Error("No installations client-global handler registered"); diff --git a/nodejs/test/shared-codegen.test.ts b/nodejs/test/shared-codegen.test.ts index a4698ac549..c065241b34 100644 --- a/nodejs/test/shared-codegen.test.ts +++ b/nodejs/test/shared-codegen.test.ts @@ -4,7 +4,7 @@ import { mkdtemp, mkdir, rm, symlink, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { fileURLToPath } from "node:url"; -import { describe, expect, it, onTestFinished } from "vitest"; +import { describe, expect, it, onTestFinished, vi } from "vitest"; import { collectDefinitionCollections, @@ -20,6 +20,10 @@ import { } from "../../scripts/codegen/utils.ts"; import { postProcessSchema } from "../../scripts/codegen/utils.ts"; +vi.mock("../scripts/releaseArtifacts.js", () => { + throw new Error("Release acquisition must not load for checkout or injected schema sources"); +}); + describe("codegen entrypoints", () => { it("recognizes Windows entrypoint paths case-insensitively", () => { expect( @@ -175,9 +179,6 @@ describe("shared schema definition codegen utilities", () => { ]); const paths = await resolveCopilotSchemaPaths({ - acquirePackage: async () => { - throw new Error("published acquisition must not run"); - }, runtimeSource: "checkout", schemaDirectory, }); diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index 525e9b6eb5..f8c8dd4b0e 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -5583,6 +5583,40 @@ def to_dict(self) -> dict: result["url"] = from_union([from_str, from_none], self.url) return result +# Experimental: this type is part of an experimental API and may change or be removed. +class HostWorkspaceOperation(Enum): + """Selects the workspace/AHP parameter and result shapes carried by the serialized payload. + + The closed operation set for host-scoped remote workspace IO. Watchers and process/Git + execution are intentionally absent. + """ + ACCESS = "access" + COPY = "copy" + DELETE = "delete" + DESCRIBE = "describe" + LIST = "list" + MKDIR = "mkdir" + MOVE = "move" + READ = "read" + RESOLVE = "resolve" + STAT = "stat" + WRITE = "write" + +# Experimental: this type is part of an experimental API and may change or be removed. +class HostWorkspaceErrorCode(Enum): + """Only these errors cross the workspace callback boundary; arbitrary provider diagnostics + are not exposed. + + Safe allowlisted failure classification; omission indicates a successful payload. + """ + ALREADY_EXISTS = "alreadyExists" + CONFLICT = "conflict" + INTERNAL = "internal" + INVALID_PARAMS = "invalidParams" + NOT_FOUND = "notFound" + NOT_IMPLEMENTED = "notImplemented" + PERMISSION_DENIED = "permissionDenied" + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class InstallationCatalogueIdentity: @@ -23782,8 +23816,9 @@ class HostGitHubEnvironmentOptions: credential_provider_registration_id: str | None = None """Opaque SDK registration for a refreshable hosting credential. Tokens are requested only - from the owning SDK connection through gitHubToken.getToken and must remain valid for at - least 120 seconds. Omitting this uses the runtime's existing authentication. + from the owning SDK connection through gitHubToken.getToken. A supplied lifetime must be + at least 120 seconds; omission explicitly means unknown lifetime with bounded periodic + refresh. Omitting this registration uses the runtime's existing authentication. """ kind: HostEnvironmentKind | None = None """Registration kind. Defaults to user-local; managed kinds adopt the preallocated @@ -23881,6 +23916,96 @@ def to_dict(self) -> dict: result["sessions"] = from_list(lambda x: to_class(HostSessionSummary, x), self.sessions) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class HostWorkspaceCallRequest: + """A supervised child's request. The runtime supplies host identity rather than accepting it + from the child. + """ + operation: HostWorkspaceOperation + """Selects the workspace/AHP parameter and result shapes carried by the serialized payload.""" + + payload: str + """Serialized operation parameters preserve AHP integer offsets and opaque etags without an + untyped numeric projection. + """ + + @staticmethod + def from_dict(obj: Any) -> 'HostWorkspaceCallRequest': + assert isinstance(obj, dict) + operation = HostWorkspaceOperation(obj.get("operation")) + payload = from_str(obj.get("payload")) + return HostWorkspaceCallRequest(operation, payload) + + def to_dict(self) -> dict: + result: dict = {} + result["operation"] = to_enum(HostWorkspaceOperation, self.operation) + result["payload"] = from_str(self.payload) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class HostWorkspaceExecuteRequest: + """A bounded callback to the SDK connection that owns this host, including before any + session exists. + """ + host_id: str + """Runtime-assigned host identity bound to this SDK connection; never supplied by a + workspace client. + """ + operation: HostWorkspaceOperation + """Selects the workspace/AHP parameter and result shapes carried by the serialized payload.""" + + payload: str + """Serialized parameters and physical path guards, preserving integer offsets and opaque + metadata. + """ + request_id: str + """Unique callback invocation identity; original AHP metadata remains inside the payload.""" + + @staticmethod + def from_dict(obj: Any) -> 'HostWorkspaceExecuteRequest': + assert isinstance(obj, dict) + host_id = from_str(obj.get("hostId")) + operation = HostWorkspaceOperation(obj.get("operation")) + payload = from_str(obj.get("payload")) + request_id = from_str(obj.get("requestId")) + return HostWorkspaceExecuteRequest(host_id, operation, payload, request_id) + + def to_dict(self) -> dict: + result: dict = {} + result["hostId"] = from_str(self.host_id) + result["operation"] = to_enum(HostWorkspaceOperation, self.operation) + result["payload"] = from_str(self.payload) + result["requestId"] = from_str(self.request_id) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class HostWorkspaceExecuteResult: + """Successful payloads use the corresponding workspace/AHP result shape. An error carries no + usable result. + """ + payload: str + """Serialized operation result; ignored when an error is present.""" + + error: HostWorkspaceErrorCode | None = None + """Safe allowlisted failure classification; omission indicates a successful payload.""" + + @staticmethod + def from_dict(obj: Any) -> 'HostWorkspaceExecuteResult': + assert isinstance(obj, dict) + payload = from_str(obj.get("payload")) + error = from_union([HostWorkspaceErrorCode, from_none], obj.get("error")) + return HostWorkspaceExecuteResult(payload, error) + + def to_dict(self) -> dict: + result: dict = {} + result["payload"] = from_str(self.payload) + if self.error is not None: + result["error"] = from_union([lambda x: to_enum(HostWorkspaceErrorCode, x), from_none], self.error) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class MCPAppsReadResourceRequest: @@ -35679,42 +35804,6 @@ def to_dict(self) -> dict: result["reason"] = from_union([lambda x: to_enum(HistoryRewindUnavailableReason, x), from_none], self.reason) return result -# Experimental: this type is part of an experimental API and may change or be removed. -@dataclass -class HostConfiguration: - """Normalized listener settings delivered only to the supervised hosting participant.""" - - resume_factory: bool - """Whether app-owned durable sessions are resumed by the owning application.""" - - session_factory: bool - """Whether session materialization is delegated to the owning application.""" - - github_environment: HostGitHubEnvironmentOptions | None = None - """Requested GitHub Mission Control registration.""" - - local_server: HostLocalServerConfiguration | None = None - """Normalized local listener settings, absent for relay-only hosts.""" - - @staticmethod - def from_dict(obj: Any) -> 'HostConfiguration': - assert isinstance(obj, dict) - resume_factory = from_bool(obj.get("resumeFactory")) - session_factory = from_bool(obj.get("sessionFactory")) - github_environment = from_union([HostGitHubEnvironmentOptions.from_dict, from_none], obj.get("githubEnvironment")) - local_server = from_union([HostLocalServerConfiguration.from_dict, from_none], obj.get("localServer")) - return HostConfiguration(resume_factory, session_factory, github_environment, local_server) - - def to_dict(self) -> dict: - result: dict = {} - result["resumeFactory"] = from_bool(self.resume_factory) - result["sessionFactory"] = from_bool(self.session_factory) - if self.github_environment is not None: - result["githubEnvironment"] = from_union([lambda x: to_class(HostGitHubEnvironmentOptions, x), from_none], self.github_environment) - if self.local_server is not None: - result["localServer"] = from_union([lambda x: to_class(HostLocalServerConfiguration, x), from_none], self.local_server) - return result - # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class HostStartRequest: @@ -35739,6 +35828,11 @@ class HostStartRequest: session_factory: bool | None = None """Ask the owning SDK application to materialize AHP sessions.""" + workspace_provider: bool | None = field(default=None, kw_only=True) + """Opt in to the owning application's remote workspace. Requires both session factories; + durable session state remains independent. + """ + @staticmethod def from_dict(obj: Any) -> 'HostStartRequest': assert isinstance(obj, dict) @@ -35748,7 +35842,8 @@ def from_dict(obj: Any) -> 'HostStartRequest': local_server = from_union([HostLocalServerOptions.from_dict, from_none], obj.get("localServer")) resume_factory = from_union([from_bool, from_none], obj.get("resumeFactory")) session_factory = from_union([from_bool, from_none], obj.get("sessionFactory")) - return HostStartRequest(host_id, github_environment, local_server, resume_factory, session_factory, compute_id=compute_id) + workspace_provider = from_union([from_bool, from_none], obj.get("workspaceProvider")) + return HostStartRequest(host_id, github_environment, local_server, resume_factory, session_factory, compute_id=compute_id, workspace_provider=workspace_provider) def to_dict(self) -> dict: result: dict = {} @@ -35763,6 +35858,8 @@ def to_dict(self) -> dict: result["resumeFactory"] = from_union([from_bool, from_none], self.resume_factory) if self.session_factory is not None: result["sessionFactory"] = from_union([from_bool, from_none], self.session_factory) + if self.workspace_provider is not None: + result["workspaceProvider"] = from_union([from_bool, from_none], self.workspace_provider) return result # Experimental: this type is part of an experimental API and may change or be removed. @@ -36150,6 +36247,50 @@ def to_dict(self) -> dict: result["context"] = to_class(SessionWorkingDirectoryContext, self.context) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class HostConfiguration: + """Normalized listener settings delivered only to the supervised hosting participant.""" + + resume_factory: bool + """Whether app-owned durable sessions are resumed by the owning application.""" + + session_factory: bool + """Whether session materialization is delegated to the owning application.""" + + github_environment: HostGitHubEnvironmentOptions | None = None + """Requested GitHub Mission Control registration.""" + + local_server: HostLocalServerConfiguration | None = None + """Normalized local listener settings, absent for relay-only hosts.""" + + workspace_provider: bool | None = None + """Workspace callbacks are confined to the owning SDK connection and never replace durable + session-state IO. + """ + + @staticmethod + def from_dict(obj: Any) -> 'HostConfiguration': + assert isinstance(obj, dict) + resume_factory = from_bool(obj.get("resumeFactory")) + session_factory = from_bool(obj.get("sessionFactory")) + github_environment = from_union([HostGitHubEnvironmentOptions.from_dict, from_none], obj.get("githubEnvironment")) + local_server = from_union([HostLocalServerConfiguration.from_dict, from_none], obj.get("localServer")) + workspace_provider = from_union([from_bool, from_none], obj.get("workspaceProvider")) + return HostConfiguration(resume_factory, session_factory, github_environment, local_server, workspace_provider) + + def to_dict(self) -> dict: + result: dict = {} + result["resumeFactory"] = from_bool(self.resume_factory) + result["sessionFactory"] = from_bool(self.session_factory) + if self.github_environment is not None: + result["githubEnvironment"] = from_union([lambda x: to_class(HostGitHubEnvironmentOptions, x), from_none], self.github_environment) + if self.local_server is not None: + result["localServer"] = from_union([lambda x: to_class(HostLocalServerConfiguration, x), from_none], self.local_server) + if self.workspace_provider is not None: + result["workspaceProvider"] = from_union([from_bool, from_none], self.workspace_provider) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class PermissionPathsConfig: @@ -50257,6 +50398,11 @@ class RPC: host_session_summary: HostSessionSummary host_start_request: HostStartRequest host_start_result: HostStartResult + host_workspace_call_request: HostWorkspaceCallRequest + host_workspace_error_code: HostWorkspaceErrorCode + host_workspace_execute_request: HostWorkspaceExecuteRequest + host_workspace_execute_result: HostWorkspaceExecuteResult + host_workspace_operation: HostWorkspaceOperation installation_catalogue_identity: InstallationCatalogueIdentity installation_confirmation_request: InstallationConfirmationRequest installation_confirmation_response: InstallationConfirmationResponse @@ -51859,6 +52005,11 @@ def from_dict(obj: Any) -> 'RPC': host_session_summary = HostSessionSummary.from_dict(obj.get("HostSessionSummary")) host_start_request = HostStartRequest.from_dict(obj.get("HostStartRequest")) host_start_result = HostStartResult.from_dict(obj.get("HostStartResult")) + host_workspace_call_request = HostWorkspaceCallRequest.from_dict(obj.get("HostWorkspaceCallRequest")) + host_workspace_error_code = HostWorkspaceErrorCode(obj.get("HostWorkspaceErrorCode")) + host_workspace_execute_request = HostWorkspaceExecuteRequest.from_dict(obj.get("HostWorkspaceExecuteRequest")) + host_workspace_execute_result = HostWorkspaceExecuteResult.from_dict(obj.get("HostWorkspaceExecuteResult")) + host_workspace_operation = HostWorkspaceOperation(obj.get("HostWorkspaceOperation")) installation_catalogue_identity = InstallationCatalogueIdentity.from_dict(obj.get("InstallationCatalogueIdentity")) installation_confirmation_request = InstallationConfirmationRequest.from_dict(obj.get("InstallationConfirmationRequest")) installation_confirmation_response = InstallationConfirmationResponse.from_dict(obj.get("InstallationConfirmationResponse")) @@ -53010,7 +53161,7 @@ def from_dict(obj: Any) -> 'RPC': subagent_settings = from_union([SubagentSettings.from_dict, from_none], obj.get("SubagentSettings")) task_progress = from_union([TaskProgress.from_dict, from_none], obj.get("TaskProgress")) workspace_summary = from_union([WorkspaceSummary.from_dict, from_none], obj.get("WorkspaceSummary")) - return RPC(abort_request, abort_result, accepted_enqueue_command_result, account_all_users, account_auth_info, account_get_all_users_result, account_get_current_auth_result, account_get_quota_request, account_get_quota_result, account_kind, account_login_request, account_login_result, account_logout_request, account_logout_result, account_quota_snapshot, accounts_enumerate_request, accounts_get_request, accounts_set_request, account_status, adaptive_thinking_support, agent_discovery_path, agent_discovery_path_list, agent_discovery_path_scope, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_list_request, agent_registry_live_target_entry, agent_registry_live_target_entry_attention_kind, agent_registry_live_target_entry_kind, agent_registry_live_target_entry_last_terminal_event, agent_registry_live_target_entry_status, agent_registry_log_capture, agent_registry_log_capture_open_error_reason, agent_registry_spawn_error, agent_registry_spawn_permission_mode, agent_registry_spawn_registry_timeout, agent_registry_spawn_request, agent_registry_spawn_result, agent_registry_spawn_spawned, agent_registry_spawn_validation_error, agent_registry_spawn_validation_error_field, agent_registry_spawn_validation_error_reason, agent_reload_result, agents_custom_agent_initial_model_decision_params, agents_custom_agent_initial_model_decision_result, agents_discover_request, agent_select_request, agent_select_result, agent_set_prompt_request, agents_get_available_builtins_request, agents_get_available_builtins_result, agents_get_builtin_definition_request, agents_get_builtin_definition_result, agents_get_builtin_listing_definition_request, agents_get_builtin_listing_definition_result, agents_get_builtins_result, agents_get_discovery_paths_request, api_key_auth_info, auth_enumerate_query, auth_enumerate_value, auth_identity, auth_identity_metadata, auth_info, auth_info_type, auth_login_account, auth_login_advance_request, auth_login_begin_request, auth_login_begun, auth_login_cancel_request, auth_login_result_dto, auth_login_result_status, auth_login_step, auth_read_query, auth_read_value, auth_status_dto, auth_validation_error, auth_validation_errors, auth_write, auth_write_result, autopilot_objective_credit_limit, autopilot_objective_get_state_result, autopilot_objective_state, autopilot_objective_status, auto_tier_descriptor, auto_tier_metadata, auto_tier_status, builtin_agent_summary, built_in_model_catalog, built_in_model_catalog_entry, builtin_tool_descriptor, builtin_tool_format, builtin_tool_format_type, builtin_tool_input_schema, builtin_tool_input_schema_type, builtin_tool_safe_for_telemetry, builtin_tool_safe_telemetry_fields, cancel_user_requested_shell_command_result, canvas_action, canvas_action_invoke_request, canvas_action_invoke_result, canvas_close_request, canvas_host_context, canvas_host_context_capabilities, canvas_json_schema, canvas_list, canvas_list_open_result, canvas_open_request, canvas_provider_close_request, canvas_provider_invoke_action_request, canvas_provider_open_request, canvas_provider_open_result, canvas_provider_register_request, canvas_provider_unregister_request, canvas_session_context, capi_session_options, card_digest, card_digest_algorithm, card_digest_value, catalog_agent_plugin_candidate, catalog_agent_plugin_candidate_kind, catalog_agent_plugin_candidate_provenance, catalog_agent_plugin_compatibility_tag, catalog_agent_plugin_media_type, catalog_ai_skill_candidate, catalog_ai_skill_candidate_kind, catalog_ai_skill_candidate_provenance, catalog_ai_skill_installability, catalog_ai_skill_media_type, catalog_authentication_required_error, catalog_authentication_required_reason, catalog_candidate, catalog_candidate_kind, catalog_candidate_source, catalog_candidate_source_embedded, catalog_candidate_source_url, catalog_capability, catalog_capability_id, catalog_client_contract, catalog_contract_violation_error, catalog_contract_violation_reason, catalog_handle_rejected_error, catalog_handle_rejection_reason, catalog_handle_type, catalog_invalid_request_error, catalog_invalid_request_field, catalog_malformed_card_error, catalog_malformed_card_reason, catalog_mcp_server_candidate, catalog_mcp_server_candidate_kind, catalog_mcp_server_candidate_provenance, catalog_mcp_server_installability, catalog_media_type, catalog_negotiated_contract, catalog_negotiation_refused_error, catalog_negotiation_refused_reason, catalog_network_failure_error, catalog_network_failure_reason, catalog_not_installable_error, catalog_not_installable_reason, catalog_plugin_repository_source, catalog_policy_rejected_error, catalog_resource_identity, catalog_resource_version, catalog_search_page, catalog_search_pagination, catalog_search_request, catalog_search_result, catalog_search_succeeded, catalog_search_total_count_relation, catalog_selection_cancelled, catalog_selection_decision, catalog_selection_declined, catalog_selection_foreign, catalog_selection_invalid, catalog_selection_replayed, catalog_selection_request, catalog_selection_result, catalog_selection_selected, catalog_selection_stale, catalog_selection_timed_out, catalog_selection_wrong_kind, catalog_trust_eligibility, catalog_trust_provenance, catalog_trust_snapshot, catalog_trust_snapshot_absent, catalog_trust_snapshot_absent_status, catalog_trust_snapshot_current, catalog_trust_snapshot_current_status, catalog_trust_snapshot_downgraded, catalog_trust_snapshot_downgraded_status, catalog_trust_snapshot_malformed, catalog_trust_snapshot_malformed_status, catalog_trust_snapshot_revoked, catalog_trust_snapshot_revoked_status, catalog_trust_snapshot_schema_version, catalog_trust_snapshot_stale, catalog_trust_snapshot_stale_status, catalog_trust_snapshot_unsupported, catalog_trust_snapshot_unsupported_status, catalog_trust_source, catalog_trust_tier, catalog_unavailable_error, catalog_unavailable_reason, catalog_unavailable_transport_error, catalog_unavailable_transport_reason, catalog_unsafe_retrieval_error, catalog_unsafe_retrieval_reason, catalog_unsupported_kind_error, client_metadata, client_task_cancel_reason, client_task_cancel_request, client_task_cancel_result, command_list, commands_finalize_invocation_effect_request, commands_finalize_invocation_effect_result, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invocation_effect_outcome, commands_invocation_origin, commands_invoke_request, commands_list_request, commands_respond_to_queued_command_request, commands_respond_to_queued_command_result, completions_get_trigger_characters_result, completions_request_request, completions_request_result, configure_session_extensions_params, connect_client_info, connected_remote_session_metadata, connected_remote_session_metadata_kind, connected_remote_session_metadata_repository, connector_account_request, connector_authorization_requirement, connector_authorization_scope, connector_availability, connector_capabilities, connector_catalog_entry, connector_catalog_result, connector_catalog_status, connector_connect_request, connector_connect_result, connector_continue_request, connector_disconnect_result, connector_discovery_account, connector_discovery_account_list, connector_discovery_account_request, connector_discovery_auth_info, connector_discovery_availability, connector_discovery_capabilities, connector_discovery_catalog_entry, connector_discovery_catalog_result, connector_mcp_status, connector_reconcile_request, connector_runtime_status, connector_session_account, connector_status, connect_remote_session_params, connect_request, connect_result, content_exclusion_check_paths_request, content_exclusion_check_paths_result, content_exclusion_path_check, content_filter_mode, context_heaviest_message, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, customization_reload_outcome, customization_reload_status, customization_reload_subsystem, customizations_reload_result, debug_collect_logs_collected_entry, debug_collect_logs_destination, debug_collect_logs_entry, debug_collect_logs_entry_kind, debug_collect_logs_include, debug_collect_logs_redaction, debug_collect_logs_request, debug_collect_logs_result, debug_collect_logs_result_kind, debug_collect_logs_skipped_entry, debug_collect_logs_source, diagnostic_cursor_status, diagnostic_entry, diagnostic_log_level, diagnostics_configuration, diagnostics_configure_request, diagnostic_severity, diagnostic_source, diagnostic_sources_configuration, diagnostics_read_request, diagnostics_read_result, discovered_canvas, discovered_extension, discovered_extension_mode, discovered_extension_plugin, discovered_extensions, discovered_extensions_disable_request, discovered_extensions_enable_request, discovered_extension_source, discovered_hook, discovered_mcp_server, discovered_mcp_server_type, discovered_model, discovered_model_list, enqueue_command_params, enqueue_command_result, env_auth_info, environment_capabilities, environment_kind, environments_delete_request, environments_delete_result, environments_get_request, environments_get_result, environments_list_request, environments_list_result, event_log_read_request, event_log_release_interest_result, event_log_tail_result, event_log_types, events_agent_scope, events_cursor_status, events_read_direction, events_read_result, execute_command_params, execute_command_result, extension, extension_context_push_input, extension_launch_profile, extension_launch_provider_resolve_request, extension_launch_provider_resolve_result, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_shell_exit, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, filter_mapping, fleet_start_request, fleet_start_result, folder_trust_add_params, folder_trust_check_params, folder_trust_check_result, gh_cli_auth_info, git_current_branch_remote_result, git_cwd_request, git_hub_environment, git_hub_owner_option, git_hub_owners_cancel_request, git_hub_owners_cancel_result, git_hub_owners_list_request, git_hub_owners_list_result, git_hub_owners_request_id_result, git_hub_repository_at_path_request, git_hub_repository_at_path_result, git_hub_repository_identity, git_hub_telemetry_client_info, git_hub_telemetry_event, git_hub_telemetry_notification, git_hub_token_acquire_reason, git_hub_token_acquire_request, git_hub_token_acquire_result, git_remote_repository, git_repos_from_remotes_request, git_repos_from_remotes_result, global_state_load_for_config_dir_request, global_state_load_result, global_state_write_key_request, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_clear_context_request, history_clear_context_result, history_compact_context_window, history_compact_request, history_compact_result, history_file_restore_skip_reason, history_list_rewind_points_result, history_preview_rewind_request, history_preview_rewind_result, history_rewind_change_type, history_rewind_file_preview, history_rewind_mode, history_rewind_outcome, history_rewind_point, history_rewind_request, history_rewind_result, history_rewind_unavailable_reason, history_skipped_file_restore, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, hook_invoke_request, hook_invoke_response, hook_origin, hooks_discover_request, hooks_discover_result, hook_type, host_configuration, host_dispose_request, host_empty_result, host_environment_credentials, host_environment_kind, host_exited_notification, host_exit_reason, host_git_hub_environment_options, host_list_sessions_request, host_list_sessions_result, host_local_server_configuration, host_local_server_options, host_publish_session_request, host_publish_session_result, host_ready_request, host_register_session_request, host_runtime_principal, host_session_create_callback, host_session_create_request, host_session_create_result, host_session_released_notification, host_session_release_request, host_session_summary, host_start_request, host_start_result, installation_catalogue_identity, installation_confirmation_request, installation_confirmation_response, installation_decision, installation_review, installed_plugin, installed_plugin_info, installed_plugin_source, installed_plugin_source_git_hub, installed_plugin_source_local, installed_plugin_source_url, instruction_discovery_path, instruction_discovery_path_kind, instruction_discovery_path_list, instruction_discovery_path_location, instructions_discover_request, instructions_get_discovery_paths_request, instructions_get_sources_result, instruction_source, instruction_source_location, instruction_source_type, interrupt_main_turn_request, interrupt_main_turn_result, json_schema_response_format, llm_inference_headers, llm_inference_http_request_chunk_request, llm_inference_http_request_chunk_result, llm_inference_http_request_start_request, llm_inference_http_request_start_result, llm_inference_http_request_start_transport, llm_inference_http_response_chunk_error, llm_inference_http_response_chunk_request, llm_inference_http_response_chunk_result, llm_inference_http_response_start_request, llm_inference_http_response_start_result, llm_inference_set_provider_result, local_session_metadata_value, logged_in_user, login_provider_kind, log_request, log_result, lsp_initialize_request, managed_mcp_server_config, managed_plugin_retry_entry, managed_plugin_retry_status, managed_setting_meta, managed_settings_channel, managed_settings_compose_layer, managed_settings_compose_request, managed_settings_compose_result, managed_settings_diagnostic, managed_settings_diagnostic_severity, managed_settings_layer, managed_settings_meta, managed_settings_read_result, managed_settings_resolved_data, managed_settings_resolve_request, managed_settings_resolve_result, managed_settings_schema_result, managed_settings_validate_request, managed_settings_validate_result, managed_settings_values, marketplace_add_result, marketplace_browse_result, marketplace_info, marketplace_list_result, marketplace_plugin_info, marketplace_refresh_entry, marketplace_refresh_result, marketplace_remove_result, mcp_allowed_server, mcp_apply_install_request, mcp_apply_uninstall_request, mcp_apps_call_tool_request, mcp_apps_diagnose_capability, mcp_apps_diagnose_request, mcp_apps_diagnose_result, mcp_apps_diagnose_server, mcp_apps_host_context, mcp_apps_host_context_details, mcp_apps_host_context_details_available_display_mode, mcp_apps_host_context_details_display_mode, mcp_apps_host_context_details_platform, mcp_apps_host_context_details_theme, mcp_apps_list_tools_request, mcp_apps_list_tools_result, mcp_apps_read_resource_request, mcp_apps_read_resource_result, mcp_apps_resource_content, mcp_apps_set_host_context_details, mcp_apps_set_host_context_details_available_display_mode, mcp_apps_set_host_context_details_display_mode, mcp_apps_set_host_context_details_platform, mcp_apps_set_host_context_details_theme, mcp_apps_set_host_context_request, mcp_cancel_sampling_execution_params, mcp_cancel_sampling_execution_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_configured_server, mcp_configured_server_list, mcp_configured_server_state, mcp_configure_git_hub_request, mcp_configure_git_hub_result, mcp_diagnostic_details, mcp_diagnostic_direction, mcp_diagnostic_kind, mcp_diagnostic_source_configuration, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_elicitation_form_mode, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_failed_server, mcp_filtered_server, mcp_headers_handle_pending_headers_refresh_request, mcp_headers_handle_pending_headers_refresh_request_request, mcp_headers_handle_pending_headers_refresh_request_result, mcp_host_state, mcp_installation_failure_reason, mcp_installation_input, mcp_installation_management_outcome, mcp_installation_management_result, mcp_installation_operation_request, mcp_installation_operation_status, mcp_installation_outcome, mcp_installation_remote_configuration, mcp_installation_result, mcp_installation_review, mcp_installation_secret, mcp_installation_secret_storage, mcp_installations_request, mcp_installation_state, mcp_installation_summary, mcp_install_plan, mcp_is_server_running_request, mcp_is_server_running_result, mcp_list_tools_request, mcp_list_tools_result, mcp_oauth_authentication_state_changed_request, mcp_oauth_cancel_login_request, mcp_oauth_cancel_login_result, mcp_oauth_complete_request, mcp_oauth_handle_pending_request, mcp_oauth_handle_pending_result, mcp_oauth_login_grant_type, mcp_oauth_login_request, mcp_oauth_login_result, mcp_oauth_pending_request_response, mcp_oauth_prepare_login_request, mcp_oauth_prepare_login_result, mcp_oauth_probe_needs_auth_reason, mcp_oauth_probe_request, mcp_oauth_probe_result, mcp_oauth_respond_request, mcp_oauth_respond_result, mcp_owned_oauth_login_status, mcp_plan_configuration_change, mcp_plan_configuration_operation, mcp_plan_enum_value_type, mcp_plan_install_planned, mcp_plan_install_request, mcp_plan_install_result, mcp_plan_install_source, mcp_plan_install_source_candidate, mcp_plan_install_source_candidate_kind, mcp_plan_install_source_card, mcp_plan_install_source_card_kind, mcp_plan_package_install_method, mcp_plan_package_transport, mcp_plan_policy_decision, mcp_plan_policy_result, mcp_plan_policy_source, mcp_plan_provenance, mcp_plan_remote_install_method, mcp_plan_remote_transport, mcp_plan_required_value, mcp_plan_required_value_enum, mcp_plan_required_value_enum_kind, mcp_plan_required_value_scalar, mcp_plan_required_value_scalar_kind, mcp_plan_resource_identity, mcp_plan_scalar_value_type, mcp_plan_scope, mcp_plan_secret_placeholder, mcp_plan_secret_reference, mcp_plan_target, mcp_plan_transport_choice, mcp_plan_transport_choice_package, mcp_plan_transport_choice_remote, mcp_plan_uninstall_request, mcp_plan_value_category, mcp_prepared_install, mcp_prepare_install_request, mcp_prompt, mcp_prompt_argument, mcp_prompt_icon, mcp_prompt_message, mcp_prompt_role, mcp_prompts_get_request, mcp_prompts_get_result, mcp_prompts_list_request, mcp_prompts_list_result, mcp_register_external_client_request, mcp_reload_config, mcp_reload_with_config_request, mcp_remove_git_hub_result, mcp_resource, mcp_resource_annotations, mcp_resource_content, mcp_resource_icon, mcp_resources_list_request, mcp_resources_list_result, mcp_resources_list_templates_request, mcp_resources_list_templates_result, mcp_resources_read_request, mcp_resources_read_result, mcp_resource_template, mcp_restart_server_request, mcp_safe_for_telemetry, mcp_safe_for_telemetry_fields, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_serializable_server_config, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_card_embedded, mcp_server_card_embedded_kind, mcp_server_card_media_type, mcp_server_card_reference, mcp_server_card_url, mcp_server_card_url_kind, mcp_server_config, mcp_server_config_defer_tools, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_memory, mcp_server_config_memory_type, mcp_server_config_stdio, mcp_server_config_stdio_type, mcp_server_failure_info, mcp_server_list, mcp_server_needs_auth_info, mcp_server_ownership, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, mcp_source_file, mcp_source_plugin, mcp_source_ref, mcp_start_server_request, mcp_start_servers_result, mcp_stop_server_request, mcp_task_metadata, mcp_tools, mcp_tool_ui, mcp_tool_ui_visibility, mcp_uninstall_plan, mcp_unregister_external_client_request, memory_configuration, metadata_context_attribution_result, metadata_context_heaviest_messages_request, metadata_context_heaviest_messages_result, metadata_context_info_request, metadata_context_info_result, metadata_is_processing_result, metadata_recompute_context_tokens_request, metadata_recompute_context_tokens_result, metadata_record_context_change_request, metadata_record_context_change_result, metadata_set_working_directory_request, metadata_set_working_directory_result, metadata_snapshot_current_mode, metadata_snapshot_remote_metadata, metadata_snapshot_remote_metadata_repository, metadata_snapshot_remote_metadata_task_type, metadata_update_client_metadata_request, model, model_apply_startup_overlay_request, model_artifact_details, model_billing, model_billing_promo, model_billing_token_prices, model_billing_token_prices_long_context, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_clear_startup_seed_request, model_clear_startup_seed_result, model_list, model_list_request, model_message, model_picker_category, model_picker_persistence_request, model_picker_price_category, model_picker_settings_context, model_policy, model_policy_state, model_provider_adapter_catalog, model_provider_adapter_descriptor, model_provider_adapter_operation_descriptor, model_provider_attribution, model_provider_automatic_discovery_mode, model_provider_automatic_discovery_policy, model_provider_configuration_disposition, model_provider_configuration_plan, model_provider_descriptor, model_provider_discover_request, model_provider_discover_result, model_provider_discovery_network_scope, model_provider_get_status_request, model_provider_instance, model_provider_instance_reference, model_provider_models_list_request, model_provider_operation_outcome, model_provider_operation_outcome_code, model_provider_prepare_configuration_request, model_provider_provenance, model_provider_provenance_source, model_provider_status, model_provider_warning, model_set_allowed_models_request, model_set_allowed_models_result, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_auto_tier_request, model_switch_auto_tier_result, model_switch_auto_tier_status, model_switch_confirmation, model_switch_to_request, model_switch_to_result, model_warning_text, mode_set_request, mode_set_result, move_mcp_loading_to_background_result, named_provider_config, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_additional_content_exclusion_policy, options_update_additional_content_exclusion_policy_rule, options_update_additional_content_exclusion_policy_rule_source, options_update_additional_content_exclusion_policy_scope, options_update_context_tier, options_update_env_value_mode, options_update_reasoning_summary, options_update_tool_filter_precedence, pending_external_tool_request, pending_external_tool_request_list, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_env_access, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_workflow, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_env_access, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_workflow, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_approve_read_only_for_session, permission_decision_cancelled, permission_decision_context, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_outcome, permission_decision_reject, permission_decision_request, permission_decision_surface, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_mode_source, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_response_capability, permission_rules_set, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_mode_request, permissions_get_mode_result, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_env_access, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_workflow, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_mode_request, permissions_set_mode_result, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_read_sql_todos_result, plan_read_sql_todos_with_dependencies_result, plan_sql_todo_dependency, plan_sql_todos_row, plan_update_request, plugin, plugin_install_result, plugin_install_staging_mode, plugin_list, plugin_list_result, plugins_builtin_set_request, plugins_disable_request, plugins_enable_request, plugins_install_request, plugins_marketplaces_add_request, plugins_marketplaces_browse_request, plugins_marketplaces_refresh_request, plugins_marketplaces_remove_request, plugins_reload_request, plugins_uninstall_request, plugins_update_request, plugin_update_all_entry, plugin_update_all_result, plugin_update_result, protocol_append_mode, protocol_customize_mode, protocol_external_tool_defer, protocol_external_tool_definition, protocol_marker_section_override, protocol_replace_mode, protocol_section_override, protocol_static_section_action, protocol_static_section_override, protocol_system_message_append_config, protocol_system_message_config, protocol_system_message_customize_config, protocol_system_message_replace_config, provider_add_request, provider_add_result, provider_config, provider_config_azure, provider_config_model_provider, provider_config_transport, provider_config_type, provider_config_wire_api, provider_descriptor, provider_endpoint, provider_endpoint_transport, provider_endpoint_type, provider_endpoint_wire_api, provider_get_endpoint_request, provider_model_config, provider_session_token, provider_sync_request, provider_sync_result, provider_token_acquire_request, provider_token_acquire_result, provider_withdraw_request, provider_withdraw_result, push_attachment, push_attachment_blob, push_attachment_directory, push_attachment_file, push_attachment_file_line_range, push_attachment_git_hub_actions_job, push_attachment_git_hub_commit, push_attachment_git_hub_file, push_attachment_git_hub_file_diff, push_attachment_git_hub_file_diff_side, push_attachment_git_hub_reference, push_attachment_git_hub_reference_type, push_attachment_git_hub_release, push_attachment_git_hub_repository, push_attachment_git_hub_snippet, push_attachment_git_hub_tree_comparison, push_attachment_git_hub_tree_comparison_side, push_attachment_git_hub_url, push_attachment_selection, push_attachment_selection_details, push_attachment_selection_details_end, push_attachment_selection_details_start, push_git_hub_repo_ref, queue_append_steering_request, queue_begin_deferred_idle_drain_request, queue_begin_deferred_idle_drain_result, queue_consume_system_notifications_request, queued_command_handled, queued_command_not_handled, queued_command_result, queue_defer_session_idle_request, queue_duplicate_at_request, queue_duplicate_at_result, queue_enqueue_resume_pending_result, queue_finish_deferred_idle_drain_request, queue_finish_deferred_idle_drain_result, queue_has_pending_result, queue_insert_at_request, queue_insert_at_result, queue_insert_message, queue_move_item_request, queue_move_item_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_at_request, queue_remove_at_result, queue_remove_most_recent_result, queue_send_now_request, queue_send_now_result, queue_set_drain_paused_request, queue_snapshot_result, queue_update_text_request, queue_update_text_result, queue_withdraw_message_request, queue_withdraw_message_result, quota_take_warnings_result, quota_warning_projection, register_event_interest_params, register_event_interest_result, release_event_interest_params, remote_control_config, remote_control_config_existing_mc_session, remote_control_status, remote_control_status_active, remote_control_status_connecting, remote_control_status_error, remote_control_status_off, remote_control_status_result, remote_control_stop_result, remote_control_transfer_result, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_host_status, remote_session_metadata_repository, remote_session_metadata_task_type, remote_session_metadata_value, remote_session_mode, remote_session_repository, response_format, sandbox_config, sandbox_config_auth, sandbox_config_source, sandbox_config_user_policy, sandbox_config_user_policy_experimental, sandbox_config_user_policy_experimental_seatbelt, sandbox_config_user_policy_filesystem, sandbox_config_user_policy_network, sandbox_config_user_policy_network_proxy, sandbox_config_user_policy_seatbelt, sandbox_credentials_config, sandbox_disable_for_session_request, sandbox_disable_for_session_result, sandbox_enforcement_status, sandbox_grant_path_for_request_request, sandbox_grant_path_for_request_result, sandbox_host_capability, sandbox_host_capability_name, sandbox_host_support, sandbox_masked_env_var, sandbox_proxy_ca_create_result, sandbox_proxy_ca_request, sandbox_proxy_ca_state, sandbox_proxy_ca_status, sandbox_session_change, schedule_add_at_request, schedule_add_cron_request, schedule_add_request, schedule_add_result, schedule_add_self_paced_request, schedule_entry, schedule_has_self_paced_result, schedule_list, schedule_rearm_self_paced_request, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachments_to_message_params, send_message_item, send_messages_request, send_messages_result, send_mode, send_request, send_result, send_system_notification_request, server_agent_list, server_instruction_source_list, server_skill, server_skill_list, session_activity, session_agent_list_request, session_auth_login_request, session_auth_logout_user_request, session_auth_status, session_auth_switch_request, session_bulk_delete_result, session_cancel_all_background_agents_result, session_capability, session_commands_list_request, session_completion_item, session_connected_ide_info, session_context, session_context_host_type, session_enrich_metadata_result, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_bytes_request, session_fs_read_file_bytes_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_capabilities, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_sqlite_exists_request, session_fs_sqlite_exists_result, session_fs_sqlite_query_request, session_fs_sqlite_query_result, session_fs_sqlite_query_type, session_fs_sqlite_transaction_error, session_fs_sqlite_transaction_error_class, session_fs_sqlite_transaction_request, session_fs_sqlite_transaction_result, session_fs_sqlite_transaction_statement, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_bytes_request, session_fs_write_file_request, session_git_hub_auth_get_all_auth_available_result, session_git_hub_auth_logout_result, session_git_hub_auth_logout_user_result, session_history_compact_request, session_installed_plugin, session_installed_plugin_source, session_installed_plugin_source_git_hub, session_installed_plugin_source_local, session_installed_plugin_source_url, session_limit_prediction_baseline_data, session_limit_prediction_client_type, session_limit_prediction_details, session_limit_prediction_predict_request, session_limit_prediction_request, session_limit_prediction_result, session_limit_prediction_source, session_limit_prediction_tier, session_limit_prediction_tier_option, session_limit_prediction_unavailable_reason, session_list, session_list_entry, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_managed_permissions, session_managed_settings, session_mcp_apps_call_tool_result, session_mcp_oauth_cancel_login_request, session_mcp_oauth_cancel_login_result, session_mcp_oauth_prepare_login_request, session_mcp_oauth_prepare_login_result, session_mcp_set_connected_ide_info_params, session_metadata_snapshot, session_mode, session_model_clear_startup_seed_request, session_model_clear_startup_seed_result, session_model_list, session_model_list_request, session_model_price_category, session_open_options, session_open_options_additional_content_exclusion_policy, session_open_options_additional_content_exclusion_policy_rule, session_open_options_additional_content_exclusion_policy_rule_source, session_open_options_additional_content_exclusion_policy_scope, session_open_options_env_value_mode, session_open_options_reasoning_summary, session_open_params, session_open_result, session_plugins_disable_request, session_plugins_enable_request, session_plugins_install_request, session_plugins_marketplaces_refresh_request, session_plugins_reload_request, session_plugins_retry_managed_request, session_plugins_retry_managed_result, session_provider_get_endpoint_request, session_prune_result, session_quota_delegate_warning, session_quota_get_result, session_quota_plan_tier, session_quota_projection, session_quota_refresh_result, session_quota_snapshot, session_quota_take_warnings_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_client_metadata_entry, sessions_close_request, sessions_close_result, sessions_create_workspace_request, sessions_create_workspace_result, sessions_delete_request, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, session_settings_built_in_tool_availability_snapshot, session_settings_evaluate_predicate_request, session_settings_evaluate_predicate_result, session_settings_job_snapshot, session_settings_model_snapshot, session_settings_online_evaluation_snapshot, session_settings_predicate_name, session_settings_repo_snapshot, session_settings_snapshot, session_settings_validation_snapshot, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_board_entry_count_request, sessions_get_board_entry_count_result, sessions_get_client_metadata_request, sessions_get_client_metadata_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_metadata_request, sessions_get_metadata_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_non_empty_session_ids_request, sessions_list_non_empty_session_ids_result, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_load_workspace_request, sessions_load_workspace_result, sessions_open_attach, sessions_open_cloud, sessions_open_create, sessions_open_handoff, sessions_open_handoff_task_type, sessions_open_progress, sessions_open_progress_status, sessions_open_progress_step, sessions_open_remote, sessions_open_resume, sessions_open_resume_last, sessions_open_status, session_source, sessions_prune_old_request, sessions_read_persisted_events_request, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, sessions_set_remote_control_steering_request, sessions_start_remote_control_request, sessions_stop_remote_control_request, sessions_transfer_remote_control_request, sessions_update_workspace_fields_request, sessions_update_workspace_fields_result, session_telemetry_engagement, session_update_options_params, session_update_options_result, session_usage_set_code_changes_request, session_visibility_status, session_workflow_pause_at_checkpoint_result, session_working_directory_context, session_working_directory_context_host_type, session_working_directory_context_with_client, settable_auth_info, settable_token_auth_info, shell_cancel_user_requested_request, shell_credentials, shell_exec_request, shell_exec_result, shell_execute_user_requested_request, shell_init_profile, shell_init_script, shell_init_script_shell, shell_kill_request, shell_kill_result, shell_kill_signal, shell_options, shutdown_request, skill, skill_apply_install_request, skill_apply_uninstall_request, skill_discovery_path, skill_discovery_path_list, skill_discovery_scope, skill_installation_failure_reason, skill_installation_file_review, skill_installation_location, skill_installation_management_outcome, skill_installation_management_result, skill_installation_operation_request, skill_installation_operation_status, skill_installation_outcome, skill_installation_ownership_state, skill_installation_result, skill_installation_review, skill_installation_scope, skill_installation_session_state, skill_installation_source, skill_installations_request, skill_installation_summary, skill_install_plan, skill_list, skill_plan_install_request, skill_plan_uninstall_request, skill_provider_descriptor, skill_provider_list_request, skill_provider_list_result, skill_provider_read_request, skill_provider_read_result, skills_config_set_disabled_skills_request, skills_config_set_skill_disabled_request, skills_disable_request, skills_discover_request, skills_enable_request, skill_set_enabled_request, skills_get_discovery_paths_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, skill_uninstall_plan, slash_command_add_timeline_entry_result, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_choice, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_model_picker_dialog, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_set_model_result, slash_command_set_plan_model_result, slash_command_show_dialog_result, slash_command_text_result, slash_command_timeline_entry, subagent_settings_entry, subagent_settings_entry_context_tier, system_message_block, task_agent_info, task_agent_progress, task_client_active_status, task_client_execution_mode, task_client_info, task_client_owner, task_client_owner_kind, task_client_owner_presence, task_client_progress, task_client_status, task_client_type, task_client_update, task_complete_data, task_completion_decision, task_execution_mode, task_info, task_kind, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_register_request, tasks_register_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_update_request, tasks_update_result, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, token_provider_auth_info, tool, tool_list, tool_result, tool_result_expanded, tool_result_new_message, tool_result_type, tools_execute_request, tools_get_builtin_descriptors_request, tools_get_builtin_descriptors_result, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_pending_requests_request, tools_list_request, tools_set_request, tools_set_result, tools_shell_descriptor_config, tools_task_complete_event_data_request, tools_update_subagent_settings_result, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_ephemeral_query_request, ui_ephemeral_query_result, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_session_limits_exhausted_request, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_session_limits_exhausted_response, ui_session_limits_exhausted_response_action, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, unsupported_enqueue_command_result, update_subagent_settings_request, usage_get_metrics_result, usage_set_code_changes_request, user_auth_info, user_requested_shell_command_result, user_setting_metadata, user_settings_get_result, user_settings_set_request, visibility_get_result, visibility_set_request, visibility_set_result, workflow_abort_request, workflow_ack_result, workflow_agent_options, workflow_agent_request, workflow_agent_result, workflow_agent_summary, workflow_cancel_request, workflow_current_phase, workflow_declared_limits, workflow_durable_operation, workflow_execute_request, workflow_execute_result, workflow_get_run_progress_request, workflow_get_run_request, workflow_journal_get_request, workflow_journal_get_result, workflow_journal_put_request, workflow_list_runs_request, workflow_list_runs_result, workflow_log_line, workflow_log_line_kind, workflow_log_request, workflow_pause_checkpoint_action, workflow_pause_checkpoint_request, workflow_pause_checkpoint_result, workflow_pause_info, workflow_pause_request, workflow_phase_observation, workflow_phase_status, workflow_progress_line, workflow_progress_page, workflow_resume_request, workflow_resume_result, workflow_run_consumed, workflow_run_detail, workflow_run_failure, workflow_run_failure_kind, workflow_run_limits, workflow_run_options, workflow_run_request, workflow_run_result, workflow_run_status, workflow_run_summary, workflow_run_terminal, workflow_tool_resume_request, workflow_tool_run_options, workflow_tool_run_request, workspace_diff_contents, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_add_summary_request, workspaces_add_summary_result, workspaces_autopilot_objective_exists_result, workspaces_checkpoints, workspaces_create_directory_request, workspaces_create_file_request, workspaces_delete_autopilot_objective_result, workspaces_diff_request, workspaces_ensure_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_autopilot_objective_result, workspaces_read_checkpoint_request, workspaces_read_checkpoint_result, workspaces_read_file_request, workspaces_read_file_result, workspaces_remove_path_request, workspaces_rename_path_request, workspaces_save_large_paste_request, workspaces_save_large_paste_result, workspaces_stat_file_request, workspaces_stat_file_result, workspaces_truncate_summaries_request, workspace_summary_host_type, workspaces_update_metadata_request, workspaces_workspace_details_host_type, workspaces_write_autopilot_objective_request, workspaces_write_autopilot_objective_result, connector_session_account_result, session_auth_info_result, session_context_attribution, session_context_info, subagent_settings, task_progress, workspace_summary) + return RPC(abort_request, abort_result, accepted_enqueue_command_result, account_all_users, account_auth_info, account_get_all_users_result, account_get_current_auth_result, account_get_quota_request, account_get_quota_result, account_kind, account_login_request, account_login_result, account_logout_request, account_logout_result, account_quota_snapshot, accounts_enumerate_request, accounts_get_request, accounts_set_request, account_status, adaptive_thinking_support, agent_discovery_path, agent_discovery_path_list, agent_discovery_path_scope, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_list_request, agent_registry_live_target_entry, agent_registry_live_target_entry_attention_kind, agent_registry_live_target_entry_kind, agent_registry_live_target_entry_last_terminal_event, agent_registry_live_target_entry_status, agent_registry_log_capture, agent_registry_log_capture_open_error_reason, agent_registry_spawn_error, agent_registry_spawn_permission_mode, agent_registry_spawn_registry_timeout, agent_registry_spawn_request, agent_registry_spawn_result, agent_registry_spawn_spawned, agent_registry_spawn_validation_error, agent_registry_spawn_validation_error_field, agent_registry_spawn_validation_error_reason, agent_reload_result, agents_custom_agent_initial_model_decision_params, agents_custom_agent_initial_model_decision_result, agents_discover_request, agent_select_request, agent_select_result, agent_set_prompt_request, agents_get_available_builtins_request, agents_get_available_builtins_result, agents_get_builtin_definition_request, agents_get_builtin_definition_result, agents_get_builtin_listing_definition_request, agents_get_builtin_listing_definition_result, agents_get_builtins_result, agents_get_discovery_paths_request, api_key_auth_info, auth_enumerate_query, auth_enumerate_value, auth_identity, auth_identity_metadata, auth_info, auth_info_type, auth_login_account, auth_login_advance_request, auth_login_begin_request, auth_login_begun, auth_login_cancel_request, auth_login_result_dto, auth_login_result_status, auth_login_step, auth_read_query, auth_read_value, auth_status_dto, auth_validation_error, auth_validation_errors, auth_write, auth_write_result, autopilot_objective_credit_limit, autopilot_objective_get_state_result, autopilot_objective_state, autopilot_objective_status, auto_tier_descriptor, auto_tier_metadata, auto_tier_status, builtin_agent_summary, built_in_model_catalog, built_in_model_catalog_entry, builtin_tool_descriptor, builtin_tool_format, builtin_tool_format_type, builtin_tool_input_schema, builtin_tool_input_schema_type, builtin_tool_safe_for_telemetry, builtin_tool_safe_telemetry_fields, cancel_user_requested_shell_command_result, canvas_action, canvas_action_invoke_request, canvas_action_invoke_result, canvas_close_request, canvas_host_context, canvas_host_context_capabilities, canvas_json_schema, canvas_list, canvas_list_open_result, canvas_open_request, canvas_provider_close_request, canvas_provider_invoke_action_request, canvas_provider_open_request, canvas_provider_open_result, canvas_provider_register_request, canvas_provider_unregister_request, canvas_session_context, capi_session_options, card_digest, card_digest_algorithm, card_digest_value, catalog_agent_plugin_candidate, catalog_agent_plugin_candidate_kind, catalog_agent_plugin_candidate_provenance, catalog_agent_plugin_compatibility_tag, catalog_agent_plugin_media_type, catalog_ai_skill_candidate, catalog_ai_skill_candidate_kind, catalog_ai_skill_candidate_provenance, catalog_ai_skill_installability, catalog_ai_skill_media_type, catalog_authentication_required_error, catalog_authentication_required_reason, catalog_candidate, catalog_candidate_kind, catalog_candidate_source, catalog_candidate_source_embedded, catalog_candidate_source_url, catalog_capability, catalog_capability_id, catalog_client_contract, catalog_contract_violation_error, catalog_contract_violation_reason, catalog_handle_rejected_error, catalog_handle_rejection_reason, catalog_handle_type, catalog_invalid_request_error, catalog_invalid_request_field, catalog_malformed_card_error, catalog_malformed_card_reason, catalog_mcp_server_candidate, catalog_mcp_server_candidate_kind, catalog_mcp_server_candidate_provenance, catalog_mcp_server_installability, catalog_media_type, catalog_negotiated_contract, catalog_negotiation_refused_error, catalog_negotiation_refused_reason, catalog_network_failure_error, catalog_network_failure_reason, catalog_not_installable_error, catalog_not_installable_reason, catalog_plugin_repository_source, catalog_policy_rejected_error, catalog_resource_identity, catalog_resource_version, catalog_search_page, catalog_search_pagination, catalog_search_request, catalog_search_result, catalog_search_succeeded, catalog_search_total_count_relation, catalog_selection_cancelled, catalog_selection_decision, catalog_selection_declined, catalog_selection_foreign, catalog_selection_invalid, catalog_selection_replayed, catalog_selection_request, catalog_selection_result, catalog_selection_selected, catalog_selection_stale, catalog_selection_timed_out, catalog_selection_wrong_kind, catalog_trust_eligibility, catalog_trust_provenance, catalog_trust_snapshot, catalog_trust_snapshot_absent, catalog_trust_snapshot_absent_status, catalog_trust_snapshot_current, catalog_trust_snapshot_current_status, catalog_trust_snapshot_downgraded, catalog_trust_snapshot_downgraded_status, catalog_trust_snapshot_malformed, catalog_trust_snapshot_malformed_status, catalog_trust_snapshot_revoked, catalog_trust_snapshot_revoked_status, catalog_trust_snapshot_schema_version, catalog_trust_snapshot_stale, catalog_trust_snapshot_stale_status, catalog_trust_snapshot_unsupported, catalog_trust_snapshot_unsupported_status, catalog_trust_source, catalog_trust_tier, catalog_unavailable_error, catalog_unavailable_reason, catalog_unavailable_transport_error, catalog_unavailable_transport_reason, catalog_unsafe_retrieval_error, catalog_unsafe_retrieval_reason, catalog_unsupported_kind_error, client_metadata, client_task_cancel_reason, client_task_cancel_request, client_task_cancel_result, command_list, commands_finalize_invocation_effect_request, commands_finalize_invocation_effect_result, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invocation_effect_outcome, commands_invocation_origin, commands_invoke_request, commands_list_request, commands_respond_to_queued_command_request, commands_respond_to_queued_command_result, completions_get_trigger_characters_result, completions_request_request, completions_request_result, configure_session_extensions_params, connect_client_info, connected_remote_session_metadata, connected_remote_session_metadata_kind, connected_remote_session_metadata_repository, connector_account_request, connector_authorization_requirement, connector_authorization_scope, connector_availability, connector_capabilities, connector_catalog_entry, connector_catalog_result, connector_catalog_status, connector_connect_request, connector_connect_result, connector_continue_request, connector_disconnect_result, connector_discovery_account, connector_discovery_account_list, connector_discovery_account_request, connector_discovery_auth_info, connector_discovery_availability, connector_discovery_capabilities, connector_discovery_catalog_entry, connector_discovery_catalog_result, connector_mcp_status, connector_reconcile_request, connector_runtime_status, connector_session_account, connector_status, connect_remote_session_params, connect_request, connect_result, content_exclusion_check_paths_request, content_exclusion_check_paths_result, content_exclusion_path_check, content_filter_mode, context_heaviest_message, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, customization_reload_outcome, customization_reload_status, customization_reload_subsystem, customizations_reload_result, debug_collect_logs_collected_entry, debug_collect_logs_destination, debug_collect_logs_entry, debug_collect_logs_entry_kind, debug_collect_logs_include, debug_collect_logs_redaction, debug_collect_logs_request, debug_collect_logs_result, debug_collect_logs_result_kind, debug_collect_logs_skipped_entry, debug_collect_logs_source, diagnostic_cursor_status, diagnostic_entry, diagnostic_log_level, diagnostics_configuration, diagnostics_configure_request, diagnostic_severity, diagnostic_source, diagnostic_sources_configuration, diagnostics_read_request, diagnostics_read_result, discovered_canvas, discovered_extension, discovered_extension_mode, discovered_extension_plugin, discovered_extensions, discovered_extensions_disable_request, discovered_extensions_enable_request, discovered_extension_source, discovered_hook, discovered_mcp_server, discovered_mcp_server_type, discovered_model, discovered_model_list, enqueue_command_params, enqueue_command_result, env_auth_info, environment_capabilities, environment_kind, environments_delete_request, environments_delete_result, environments_get_request, environments_get_result, environments_list_request, environments_list_result, event_log_read_request, event_log_release_interest_result, event_log_tail_result, event_log_types, events_agent_scope, events_cursor_status, events_read_direction, events_read_result, execute_command_params, execute_command_result, extension, extension_context_push_input, extension_launch_profile, extension_launch_provider_resolve_request, extension_launch_provider_resolve_result, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_shell_exit, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, filter_mapping, fleet_start_request, fleet_start_result, folder_trust_add_params, folder_trust_check_params, folder_trust_check_result, gh_cli_auth_info, git_current_branch_remote_result, git_cwd_request, git_hub_environment, git_hub_owner_option, git_hub_owners_cancel_request, git_hub_owners_cancel_result, git_hub_owners_list_request, git_hub_owners_list_result, git_hub_owners_request_id_result, git_hub_repository_at_path_request, git_hub_repository_at_path_result, git_hub_repository_identity, git_hub_telemetry_client_info, git_hub_telemetry_event, git_hub_telemetry_notification, git_hub_token_acquire_reason, git_hub_token_acquire_request, git_hub_token_acquire_result, git_remote_repository, git_repos_from_remotes_request, git_repos_from_remotes_result, global_state_load_for_config_dir_request, global_state_load_result, global_state_write_key_request, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_clear_context_request, history_clear_context_result, history_compact_context_window, history_compact_request, history_compact_result, history_file_restore_skip_reason, history_list_rewind_points_result, history_preview_rewind_request, history_preview_rewind_result, history_rewind_change_type, history_rewind_file_preview, history_rewind_mode, history_rewind_outcome, history_rewind_point, history_rewind_request, history_rewind_result, history_rewind_unavailable_reason, history_skipped_file_restore, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, hook_invoke_request, hook_invoke_response, hook_origin, hooks_discover_request, hooks_discover_result, hook_type, host_configuration, host_dispose_request, host_empty_result, host_environment_credentials, host_environment_kind, host_exited_notification, host_exit_reason, host_git_hub_environment_options, host_list_sessions_request, host_list_sessions_result, host_local_server_configuration, host_local_server_options, host_publish_session_request, host_publish_session_result, host_ready_request, host_register_session_request, host_runtime_principal, host_session_create_callback, host_session_create_request, host_session_create_result, host_session_released_notification, host_session_release_request, host_session_summary, host_start_request, host_start_result, host_workspace_call_request, host_workspace_error_code, host_workspace_execute_request, host_workspace_execute_result, host_workspace_operation, installation_catalogue_identity, installation_confirmation_request, installation_confirmation_response, installation_decision, installation_review, installed_plugin, installed_plugin_info, installed_plugin_source, installed_plugin_source_git_hub, installed_plugin_source_local, installed_plugin_source_url, instruction_discovery_path, instruction_discovery_path_kind, instruction_discovery_path_list, instruction_discovery_path_location, instructions_discover_request, instructions_get_discovery_paths_request, instructions_get_sources_result, instruction_source, instruction_source_location, instruction_source_type, interrupt_main_turn_request, interrupt_main_turn_result, json_schema_response_format, llm_inference_headers, llm_inference_http_request_chunk_request, llm_inference_http_request_chunk_result, llm_inference_http_request_start_request, llm_inference_http_request_start_result, llm_inference_http_request_start_transport, llm_inference_http_response_chunk_error, llm_inference_http_response_chunk_request, llm_inference_http_response_chunk_result, llm_inference_http_response_start_request, llm_inference_http_response_start_result, llm_inference_set_provider_result, local_session_metadata_value, logged_in_user, login_provider_kind, log_request, log_result, lsp_initialize_request, managed_mcp_server_config, managed_plugin_retry_entry, managed_plugin_retry_status, managed_setting_meta, managed_settings_channel, managed_settings_compose_layer, managed_settings_compose_request, managed_settings_compose_result, managed_settings_diagnostic, managed_settings_diagnostic_severity, managed_settings_layer, managed_settings_meta, managed_settings_read_result, managed_settings_resolved_data, managed_settings_resolve_request, managed_settings_resolve_result, managed_settings_schema_result, managed_settings_validate_request, managed_settings_validate_result, managed_settings_values, marketplace_add_result, marketplace_browse_result, marketplace_info, marketplace_list_result, marketplace_plugin_info, marketplace_refresh_entry, marketplace_refresh_result, marketplace_remove_result, mcp_allowed_server, mcp_apply_install_request, mcp_apply_uninstall_request, mcp_apps_call_tool_request, mcp_apps_diagnose_capability, mcp_apps_diagnose_request, mcp_apps_diagnose_result, mcp_apps_diagnose_server, mcp_apps_host_context, mcp_apps_host_context_details, mcp_apps_host_context_details_available_display_mode, mcp_apps_host_context_details_display_mode, mcp_apps_host_context_details_platform, mcp_apps_host_context_details_theme, mcp_apps_list_tools_request, mcp_apps_list_tools_result, mcp_apps_read_resource_request, mcp_apps_read_resource_result, mcp_apps_resource_content, mcp_apps_set_host_context_details, mcp_apps_set_host_context_details_available_display_mode, mcp_apps_set_host_context_details_display_mode, mcp_apps_set_host_context_details_platform, mcp_apps_set_host_context_details_theme, mcp_apps_set_host_context_request, mcp_cancel_sampling_execution_params, mcp_cancel_sampling_execution_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_configured_server, mcp_configured_server_list, mcp_configured_server_state, mcp_configure_git_hub_request, mcp_configure_git_hub_result, mcp_diagnostic_details, mcp_diagnostic_direction, mcp_diagnostic_kind, mcp_diagnostic_source_configuration, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_elicitation_form_mode, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_failed_server, mcp_filtered_server, mcp_headers_handle_pending_headers_refresh_request, mcp_headers_handle_pending_headers_refresh_request_request, mcp_headers_handle_pending_headers_refresh_request_result, mcp_host_state, mcp_installation_failure_reason, mcp_installation_input, mcp_installation_management_outcome, mcp_installation_management_result, mcp_installation_operation_request, mcp_installation_operation_status, mcp_installation_outcome, mcp_installation_remote_configuration, mcp_installation_result, mcp_installation_review, mcp_installation_secret, mcp_installation_secret_storage, mcp_installations_request, mcp_installation_state, mcp_installation_summary, mcp_install_plan, mcp_is_server_running_request, mcp_is_server_running_result, mcp_list_tools_request, mcp_list_tools_result, mcp_oauth_authentication_state_changed_request, mcp_oauth_cancel_login_request, mcp_oauth_cancel_login_result, mcp_oauth_complete_request, mcp_oauth_handle_pending_request, mcp_oauth_handle_pending_result, mcp_oauth_login_grant_type, mcp_oauth_login_request, mcp_oauth_login_result, mcp_oauth_pending_request_response, mcp_oauth_prepare_login_request, mcp_oauth_prepare_login_result, mcp_oauth_probe_needs_auth_reason, mcp_oauth_probe_request, mcp_oauth_probe_result, mcp_oauth_respond_request, mcp_oauth_respond_result, mcp_owned_oauth_login_status, mcp_plan_configuration_change, mcp_plan_configuration_operation, mcp_plan_enum_value_type, mcp_plan_install_planned, mcp_plan_install_request, mcp_plan_install_result, mcp_plan_install_source, mcp_plan_install_source_candidate, mcp_plan_install_source_candidate_kind, mcp_plan_install_source_card, mcp_plan_install_source_card_kind, mcp_plan_package_install_method, mcp_plan_package_transport, mcp_plan_policy_decision, mcp_plan_policy_result, mcp_plan_policy_source, mcp_plan_provenance, mcp_plan_remote_install_method, mcp_plan_remote_transport, mcp_plan_required_value, mcp_plan_required_value_enum, mcp_plan_required_value_enum_kind, mcp_plan_required_value_scalar, mcp_plan_required_value_scalar_kind, mcp_plan_resource_identity, mcp_plan_scalar_value_type, mcp_plan_scope, mcp_plan_secret_placeholder, mcp_plan_secret_reference, mcp_plan_target, mcp_plan_transport_choice, mcp_plan_transport_choice_package, mcp_plan_transport_choice_remote, mcp_plan_uninstall_request, mcp_plan_value_category, mcp_prepared_install, mcp_prepare_install_request, mcp_prompt, mcp_prompt_argument, mcp_prompt_icon, mcp_prompt_message, mcp_prompt_role, mcp_prompts_get_request, mcp_prompts_get_result, mcp_prompts_list_request, mcp_prompts_list_result, mcp_register_external_client_request, mcp_reload_config, mcp_reload_with_config_request, mcp_remove_git_hub_result, mcp_resource, mcp_resource_annotations, mcp_resource_content, mcp_resource_icon, mcp_resources_list_request, mcp_resources_list_result, mcp_resources_list_templates_request, mcp_resources_list_templates_result, mcp_resources_read_request, mcp_resources_read_result, mcp_resource_template, mcp_restart_server_request, mcp_safe_for_telemetry, mcp_safe_for_telemetry_fields, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_serializable_server_config, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_card_embedded, mcp_server_card_embedded_kind, mcp_server_card_media_type, mcp_server_card_reference, mcp_server_card_url, mcp_server_card_url_kind, mcp_server_config, mcp_server_config_defer_tools, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_memory, mcp_server_config_memory_type, mcp_server_config_stdio, mcp_server_config_stdio_type, mcp_server_failure_info, mcp_server_list, mcp_server_needs_auth_info, mcp_server_ownership, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, mcp_source_file, mcp_source_plugin, mcp_source_ref, mcp_start_server_request, mcp_start_servers_result, mcp_stop_server_request, mcp_task_metadata, mcp_tools, mcp_tool_ui, mcp_tool_ui_visibility, mcp_uninstall_plan, mcp_unregister_external_client_request, memory_configuration, metadata_context_attribution_result, metadata_context_heaviest_messages_request, metadata_context_heaviest_messages_result, metadata_context_info_request, metadata_context_info_result, metadata_is_processing_result, metadata_recompute_context_tokens_request, metadata_recompute_context_tokens_result, metadata_record_context_change_request, metadata_record_context_change_result, metadata_set_working_directory_request, metadata_set_working_directory_result, metadata_snapshot_current_mode, metadata_snapshot_remote_metadata, metadata_snapshot_remote_metadata_repository, metadata_snapshot_remote_metadata_task_type, metadata_update_client_metadata_request, model, model_apply_startup_overlay_request, model_artifact_details, model_billing, model_billing_promo, model_billing_token_prices, model_billing_token_prices_long_context, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_clear_startup_seed_request, model_clear_startup_seed_result, model_list, model_list_request, model_message, model_picker_category, model_picker_persistence_request, model_picker_price_category, model_picker_settings_context, model_policy, model_policy_state, model_provider_adapter_catalog, model_provider_adapter_descriptor, model_provider_adapter_operation_descriptor, model_provider_attribution, model_provider_automatic_discovery_mode, model_provider_automatic_discovery_policy, model_provider_configuration_disposition, model_provider_configuration_plan, model_provider_descriptor, model_provider_discover_request, model_provider_discover_result, model_provider_discovery_network_scope, model_provider_get_status_request, model_provider_instance, model_provider_instance_reference, model_provider_models_list_request, model_provider_operation_outcome, model_provider_operation_outcome_code, model_provider_prepare_configuration_request, model_provider_provenance, model_provider_provenance_source, model_provider_status, model_provider_warning, model_set_allowed_models_request, model_set_allowed_models_result, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_auto_tier_request, model_switch_auto_tier_result, model_switch_auto_tier_status, model_switch_confirmation, model_switch_to_request, model_switch_to_result, model_warning_text, mode_set_request, mode_set_result, move_mcp_loading_to_background_result, named_provider_config, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_additional_content_exclusion_policy, options_update_additional_content_exclusion_policy_rule, options_update_additional_content_exclusion_policy_rule_source, options_update_additional_content_exclusion_policy_scope, options_update_context_tier, options_update_env_value_mode, options_update_reasoning_summary, options_update_tool_filter_precedence, pending_external_tool_request, pending_external_tool_request_list, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_env_access, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_workflow, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_env_access, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_workflow, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_approve_read_only_for_session, permission_decision_cancelled, permission_decision_context, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_outcome, permission_decision_reject, permission_decision_request, permission_decision_surface, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_mode_source, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_response_capability, permission_rules_set, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_mode_request, permissions_get_mode_result, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_env_access, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_workflow, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_mode_request, permissions_set_mode_result, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_read_sql_todos_result, plan_read_sql_todos_with_dependencies_result, plan_sql_todo_dependency, plan_sql_todos_row, plan_update_request, plugin, plugin_install_result, plugin_install_staging_mode, plugin_list, plugin_list_result, plugins_builtin_set_request, plugins_disable_request, plugins_enable_request, plugins_install_request, plugins_marketplaces_add_request, plugins_marketplaces_browse_request, plugins_marketplaces_refresh_request, plugins_marketplaces_remove_request, plugins_reload_request, plugins_uninstall_request, plugins_update_request, plugin_update_all_entry, plugin_update_all_result, plugin_update_result, protocol_append_mode, protocol_customize_mode, protocol_external_tool_defer, protocol_external_tool_definition, protocol_marker_section_override, protocol_replace_mode, protocol_section_override, protocol_static_section_action, protocol_static_section_override, protocol_system_message_append_config, protocol_system_message_config, protocol_system_message_customize_config, protocol_system_message_replace_config, provider_add_request, provider_add_result, provider_config, provider_config_azure, provider_config_model_provider, provider_config_transport, provider_config_type, provider_config_wire_api, provider_descriptor, provider_endpoint, provider_endpoint_transport, provider_endpoint_type, provider_endpoint_wire_api, provider_get_endpoint_request, provider_model_config, provider_session_token, provider_sync_request, provider_sync_result, provider_token_acquire_request, provider_token_acquire_result, provider_withdraw_request, provider_withdraw_result, push_attachment, push_attachment_blob, push_attachment_directory, push_attachment_file, push_attachment_file_line_range, push_attachment_git_hub_actions_job, push_attachment_git_hub_commit, push_attachment_git_hub_file, push_attachment_git_hub_file_diff, push_attachment_git_hub_file_diff_side, push_attachment_git_hub_reference, push_attachment_git_hub_reference_type, push_attachment_git_hub_release, push_attachment_git_hub_repository, push_attachment_git_hub_snippet, push_attachment_git_hub_tree_comparison, push_attachment_git_hub_tree_comparison_side, push_attachment_git_hub_url, push_attachment_selection, push_attachment_selection_details, push_attachment_selection_details_end, push_attachment_selection_details_start, push_git_hub_repo_ref, queue_append_steering_request, queue_begin_deferred_idle_drain_request, queue_begin_deferred_idle_drain_result, queue_consume_system_notifications_request, queued_command_handled, queued_command_not_handled, queued_command_result, queue_defer_session_idle_request, queue_duplicate_at_request, queue_duplicate_at_result, queue_enqueue_resume_pending_result, queue_finish_deferred_idle_drain_request, queue_finish_deferred_idle_drain_result, queue_has_pending_result, queue_insert_at_request, queue_insert_at_result, queue_insert_message, queue_move_item_request, queue_move_item_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_at_request, queue_remove_at_result, queue_remove_most_recent_result, queue_send_now_request, queue_send_now_result, queue_set_drain_paused_request, queue_snapshot_result, queue_update_text_request, queue_update_text_result, queue_withdraw_message_request, queue_withdraw_message_result, quota_take_warnings_result, quota_warning_projection, register_event_interest_params, register_event_interest_result, release_event_interest_params, remote_control_config, remote_control_config_existing_mc_session, remote_control_status, remote_control_status_active, remote_control_status_connecting, remote_control_status_error, remote_control_status_off, remote_control_status_result, remote_control_stop_result, remote_control_transfer_result, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_host_status, remote_session_metadata_repository, remote_session_metadata_task_type, remote_session_metadata_value, remote_session_mode, remote_session_repository, response_format, sandbox_config, sandbox_config_auth, sandbox_config_source, sandbox_config_user_policy, sandbox_config_user_policy_experimental, sandbox_config_user_policy_experimental_seatbelt, sandbox_config_user_policy_filesystem, sandbox_config_user_policy_network, sandbox_config_user_policy_network_proxy, sandbox_config_user_policy_seatbelt, sandbox_credentials_config, sandbox_disable_for_session_request, sandbox_disable_for_session_result, sandbox_enforcement_status, sandbox_grant_path_for_request_request, sandbox_grant_path_for_request_result, sandbox_host_capability, sandbox_host_capability_name, sandbox_host_support, sandbox_masked_env_var, sandbox_proxy_ca_create_result, sandbox_proxy_ca_request, sandbox_proxy_ca_state, sandbox_proxy_ca_status, sandbox_session_change, schedule_add_at_request, schedule_add_cron_request, schedule_add_request, schedule_add_result, schedule_add_self_paced_request, schedule_entry, schedule_has_self_paced_result, schedule_list, schedule_rearm_self_paced_request, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachments_to_message_params, send_message_item, send_messages_request, send_messages_result, send_mode, send_request, send_result, send_system_notification_request, server_agent_list, server_instruction_source_list, server_skill, server_skill_list, session_activity, session_agent_list_request, session_auth_login_request, session_auth_logout_user_request, session_auth_status, session_auth_switch_request, session_bulk_delete_result, session_cancel_all_background_agents_result, session_capability, session_commands_list_request, session_completion_item, session_connected_ide_info, session_context, session_context_host_type, session_enrich_metadata_result, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_bytes_request, session_fs_read_file_bytes_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_capabilities, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_sqlite_exists_request, session_fs_sqlite_exists_result, session_fs_sqlite_query_request, session_fs_sqlite_query_result, session_fs_sqlite_query_type, session_fs_sqlite_transaction_error, session_fs_sqlite_transaction_error_class, session_fs_sqlite_transaction_request, session_fs_sqlite_transaction_result, session_fs_sqlite_transaction_statement, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_bytes_request, session_fs_write_file_request, session_git_hub_auth_get_all_auth_available_result, session_git_hub_auth_logout_result, session_git_hub_auth_logout_user_result, session_history_compact_request, session_installed_plugin, session_installed_plugin_source, session_installed_plugin_source_git_hub, session_installed_plugin_source_local, session_installed_plugin_source_url, session_limit_prediction_baseline_data, session_limit_prediction_client_type, session_limit_prediction_details, session_limit_prediction_predict_request, session_limit_prediction_request, session_limit_prediction_result, session_limit_prediction_source, session_limit_prediction_tier, session_limit_prediction_tier_option, session_limit_prediction_unavailable_reason, session_list, session_list_entry, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_managed_permissions, session_managed_settings, session_mcp_apps_call_tool_result, session_mcp_oauth_cancel_login_request, session_mcp_oauth_cancel_login_result, session_mcp_oauth_prepare_login_request, session_mcp_oauth_prepare_login_result, session_mcp_set_connected_ide_info_params, session_metadata_snapshot, session_mode, session_model_clear_startup_seed_request, session_model_clear_startup_seed_result, session_model_list, session_model_list_request, session_model_price_category, session_open_options, session_open_options_additional_content_exclusion_policy, session_open_options_additional_content_exclusion_policy_rule, session_open_options_additional_content_exclusion_policy_rule_source, session_open_options_additional_content_exclusion_policy_scope, session_open_options_env_value_mode, session_open_options_reasoning_summary, session_open_params, session_open_result, session_plugins_disable_request, session_plugins_enable_request, session_plugins_install_request, session_plugins_marketplaces_refresh_request, session_plugins_reload_request, session_plugins_retry_managed_request, session_plugins_retry_managed_result, session_provider_get_endpoint_request, session_prune_result, session_quota_delegate_warning, session_quota_get_result, session_quota_plan_tier, session_quota_projection, session_quota_refresh_result, session_quota_snapshot, session_quota_take_warnings_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_client_metadata_entry, sessions_close_request, sessions_close_result, sessions_create_workspace_request, sessions_create_workspace_result, sessions_delete_request, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, session_settings_built_in_tool_availability_snapshot, session_settings_evaluate_predicate_request, session_settings_evaluate_predicate_result, session_settings_job_snapshot, session_settings_model_snapshot, session_settings_online_evaluation_snapshot, session_settings_predicate_name, session_settings_repo_snapshot, session_settings_snapshot, session_settings_validation_snapshot, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_board_entry_count_request, sessions_get_board_entry_count_result, sessions_get_client_metadata_request, sessions_get_client_metadata_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_metadata_request, sessions_get_metadata_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_non_empty_session_ids_request, sessions_list_non_empty_session_ids_result, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_load_workspace_request, sessions_load_workspace_result, sessions_open_attach, sessions_open_cloud, sessions_open_create, sessions_open_handoff, sessions_open_handoff_task_type, sessions_open_progress, sessions_open_progress_status, sessions_open_progress_step, sessions_open_remote, sessions_open_resume, sessions_open_resume_last, sessions_open_status, session_source, sessions_prune_old_request, sessions_read_persisted_events_request, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, sessions_set_remote_control_steering_request, sessions_start_remote_control_request, sessions_stop_remote_control_request, sessions_transfer_remote_control_request, sessions_update_workspace_fields_request, sessions_update_workspace_fields_result, session_telemetry_engagement, session_update_options_params, session_update_options_result, session_usage_set_code_changes_request, session_visibility_status, session_workflow_pause_at_checkpoint_result, session_working_directory_context, session_working_directory_context_host_type, session_working_directory_context_with_client, settable_auth_info, settable_token_auth_info, shell_cancel_user_requested_request, shell_credentials, shell_exec_request, shell_exec_result, shell_execute_user_requested_request, shell_init_profile, shell_init_script, shell_init_script_shell, shell_kill_request, shell_kill_result, shell_kill_signal, shell_options, shutdown_request, skill, skill_apply_install_request, skill_apply_uninstall_request, skill_discovery_path, skill_discovery_path_list, skill_discovery_scope, skill_installation_failure_reason, skill_installation_file_review, skill_installation_location, skill_installation_management_outcome, skill_installation_management_result, skill_installation_operation_request, skill_installation_operation_status, skill_installation_outcome, skill_installation_ownership_state, skill_installation_result, skill_installation_review, skill_installation_scope, skill_installation_session_state, skill_installation_source, skill_installations_request, skill_installation_summary, skill_install_plan, skill_list, skill_plan_install_request, skill_plan_uninstall_request, skill_provider_descriptor, skill_provider_list_request, skill_provider_list_result, skill_provider_read_request, skill_provider_read_result, skills_config_set_disabled_skills_request, skills_config_set_skill_disabled_request, skills_disable_request, skills_discover_request, skills_enable_request, skill_set_enabled_request, skills_get_discovery_paths_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, skill_uninstall_plan, slash_command_add_timeline_entry_result, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_choice, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_model_picker_dialog, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_set_model_result, slash_command_set_plan_model_result, slash_command_show_dialog_result, slash_command_text_result, slash_command_timeline_entry, subagent_settings_entry, subagent_settings_entry_context_tier, system_message_block, task_agent_info, task_agent_progress, task_client_active_status, task_client_execution_mode, task_client_info, task_client_owner, task_client_owner_kind, task_client_owner_presence, task_client_progress, task_client_status, task_client_type, task_client_update, task_complete_data, task_completion_decision, task_execution_mode, task_info, task_kind, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_register_request, tasks_register_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_update_request, tasks_update_result, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, token_provider_auth_info, tool, tool_list, tool_result, tool_result_expanded, tool_result_new_message, tool_result_type, tools_execute_request, tools_get_builtin_descriptors_request, tools_get_builtin_descriptors_result, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_pending_requests_request, tools_list_request, tools_set_request, tools_set_result, tools_shell_descriptor_config, tools_task_complete_event_data_request, tools_update_subagent_settings_result, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_ephemeral_query_request, ui_ephemeral_query_result, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_session_limits_exhausted_request, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_session_limits_exhausted_response, ui_session_limits_exhausted_response_action, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, unsupported_enqueue_command_result, update_subagent_settings_request, usage_get_metrics_result, usage_set_code_changes_request, user_auth_info, user_requested_shell_command_result, user_setting_metadata, user_settings_get_result, user_settings_set_request, visibility_get_result, visibility_set_request, visibility_set_result, workflow_abort_request, workflow_ack_result, workflow_agent_options, workflow_agent_request, workflow_agent_result, workflow_agent_summary, workflow_cancel_request, workflow_current_phase, workflow_declared_limits, workflow_durable_operation, workflow_execute_request, workflow_execute_result, workflow_get_run_progress_request, workflow_get_run_request, workflow_journal_get_request, workflow_journal_get_result, workflow_journal_put_request, workflow_list_runs_request, workflow_list_runs_result, workflow_log_line, workflow_log_line_kind, workflow_log_request, workflow_pause_checkpoint_action, workflow_pause_checkpoint_request, workflow_pause_checkpoint_result, workflow_pause_info, workflow_pause_request, workflow_phase_observation, workflow_phase_status, workflow_progress_line, workflow_progress_page, workflow_resume_request, workflow_resume_result, workflow_run_consumed, workflow_run_detail, workflow_run_failure, workflow_run_failure_kind, workflow_run_limits, workflow_run_options, workflow_run_request, workflow_run_result, workflow_run_status, workflow_run_summary, workflow_run_terminal, workflow_tool_resume_request, workflow_tool_run_options, workflow_tool_run_request, workspace_diff_contents, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_add_summary_request, workspaces_add_summary_result, workspaces_autopilot_objective_exists_result, workspaces_checkpoints, workspaces_create_directory_request, workspaces_create_file_request, workspaces_delete_autopilot_objective_result, workspaces_diff_request, workspaces_ensure_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_autopilot_objective_result, workspaces_read_checkpoint_request, workspaces_read_checkpoint_result, workspaces_read_file_request, workspaces_read_file_result, workspaces_remove_path_request, workspaces_rename_path_request, workspaces_save_large_paste_request, workspaces_save_large_paste_result, workspaces_stat_file_request, workspaces_stat_file_result, workspaces_truncate_summaries_request, workspace_summary_host_type, workspaces_update_metadata_request, workspaces_workspace_details_host_type, workspaces_write_autopilot_objective_request, workspaces_write_autopilot_objective_result, connector_session_account_result, session_auth_info_result, session_context_attribution, session_context_info, subagent_settings, task_progress, workspace_summary) def to_dict(self) -> dict: result: dict = {} @@ -53461,6 +53612,11 @@ def to_dict(self) -> dict: result["HostSessionSummary"] = to_class(HostSessionSummary, self.host_session_summary) result["HostStartRequest"] = to_class(HostStartRequest, self.host_start_request) result["HostStartResult"] = to_class(HostStartResult, self.host_start_result) + result["HostWorkspaceCallRequest"] = to_class(HostWorkspaceCallRequest, self.host_workspace_call_request) + result["HostWorkspaceErrorCode"] = to_enum(HostWorkspaceErrorCode, self.host_workspace_error_code) + result["HostWorkspaceExecuteRequest"] = to_class(HostWorkspaceExecuteRequest, self.host_workspace_execute_request) + result["HostWorkspaceExecuteResult"] = to_class(HostWorkspaceExecuteResult, self.host_workspace_execute_result) + result["HostWorkspaceOperation"] = to_enum(HostWorkspaceOperation, self.host_workspace_operation) result["InstallationCatalogueIdentity"] = to_class(InstallationCatalogueIdentity, self.installation_catalogue_identity) result["InstallationConfirmationRequest"] = to_class(InstallationConfirmationRequest, self.installation_confirmation_request) result["InstallationConfirmationResponse"] = to_class(InstallationConfirmationResponse, self.installation_confirmation_response) @@ -55977,6 +56133,11 @@ async def _get_configuration(self, *, timeout: float | None = None) -> HostConfi "Returns listener settings only to the supervised hosting participant over its SDK connection.\n\nReturns:\n Normalized listener settings delivered only to the supervised hosting participant.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." return HostConfiguration.from_dict(await self._client.request("host.getConfiguration", {}, **_timeout_kwargs(timeout))) + async def _workspace(self, params: HostWorkspaceCallRequest, *, timeout: float | None = None) -> HostWorkspaceExecuteResult: + "Routes a remote workspace operation only from its supervised child to its owning SDK connection.\n\nArgs:\n params: A supervised child's request. The runtime supplies host identity rather than accepting it from the child.\n\nReturns:\n Successful payloads use the corresponding workspace/AHP result shape. An error carries no usable result.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." + params_dict = {k: v for k, v in params.to_dict().items() if v is not None} + return HostWorkspaceExecuteResult.from_dict(await self._client.request("host.workspace", params_dict, **_timeout_kwargs(timeout))) + async def _ready(self, params: HostReadyRequest, *, timeout: float | None = None) -> HostEmptyResult: "Reports a supervised hosting participant's bound AHP endpoint after its SDK handshake.\n\nArgs:\n params: Readiness reported by the supervised hosting participant on its own SDK connection.\n\nReturns:\n Empty acknowledgement for a completed host lifecycle operation.\n\n:meta private:\n\nInternal SDK API; not part of the public surface." params_dict = {k: v for k, v in params.to_dict().items() if v is not None} @@ -58848,6 +59009,12 @@ async def get_token(self, params: GitHubTokenAcquireRequest) -> GitHubTokenAcqui "Asks the SDK client to mint a GitHub access token for a session whose configuration supplied a GitHub token provider. The runtime acquires the initial token during bootstrap and refreshes it during expiry preflight when one hour or less remains.\n\nArgs:\n params: Asks the SDK client to acquire a GitHub access token from an opaque callback registration.\n\nReturns:\n SDK host response to a GitHub credential request." pass +# Experimental: this API group is experimental and may change or be removed. +class HostWorkspaceHandler(Protocol): + async def execute(self, params: HostWorkspaceExecuteRequest) -> HostWorkspaceExecuteResult: + "Executes one bounded operation for an explicitly remote workspace on its owning SDK connection. No local filesystem fallback is permitted. The provider must enforce the native canonical-path guard and physical IO preconditions on hands.\n\nArgs:\n params: A bounded callback to the SDK connection that owns this host, including before any session exists.\n\nReturns:\n Successful payloads use the corresponding workspace/AHP result shape. An error carries no usable result." + pass + # Experimental: this API group is experimental and may change or be removed. class InstallationsHandler(Protocol): async def confirm(self, params: InstallationConfirmationRequest) -> InstallationConfirmationResponse: @@ -58862,6 +59029,7 @@ class ClientGlobalApiHandlers: llm_inference: LlmInferenceHandler | None = None git_hub_telemetry: GitHubTelemetryHandler | None = None git_hub_token: GitHubTokenHandler | None = None + host_workspace: HostWorkspaceHandler | None = None installations: InstallationsHandler | None = None def register_client_global_api_handlers( @@ -58951,6 +59119,13 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: result = await handler.get_token(request) return result.value if hasattr(result, 'value') else result client.set_request_handler("gitHubToken.getToken", handle_git_hub_token_get_token) + async def handle_host_workspace_execute(params: dict) -> dict | None: + request = HostWorkspaceExecuteRequest.from_dict(params) + handler = handlers.host_workspace + if handler is None: raise RuntimeError("No host_workspace client-global handler registered") + result = await handler.execute(request) + return result.to_dict() + client.set_request_handler("hostWorkspace.execute", handle_host_workspace_execute) async def handle_installations_confirm(params: dict) -> dict | None: request = InstallationConfirmationRequest.from_dict(params) handler = handlers.installations @@ -59477,6 +59652,12 @@ async def handle_installations_confirm(params: dict) -> dict | None: "HostStartRequest", "HostStartResult", "HostType", + "HostWorkspaceCallRequest", + "HostWorkspaceErrorCode", + "HostWorkspaceExecuteRequest", + "HostWorkspaceExecuteResult", + "HostWorkspaceHandler", + "HostWorkspaceOperation", "InstallMethod", "InstallationCatalogueIdentity", "InstallationConfirmationRequest", diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index 1e8f2fbb1a..3e81af8725 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -44,6 +44,8 @@ pub mod rpc_methods { pub const HOST_GETENVIRONMENTCREDENTIALS: &str = "host.getEnvironmentCredentials"; /// `host.getConfiguration` pub const HOST_GETCONFIGURATION: &str = "host.getConfiguration"; + /// `host.workspace` + pub const HOST_WORKSPACE: &str = "host.workspace"; /// `host.ready` pub const HOST_READY: &str = "host.ready"; /// `ping` @@ -9314,7 +9316,7 @@ pub struct HooksDiscoverResult { pub struct HostGitHubEnvironmentOptions { /// Stable application installation identity, reused across host restarts. pub compute_id: String, - /// Opaque SDK registration for a refreshable hosting credential. Tokens are requested only from the owning SDK connection through gitHubToken.getToken and must remain valid for at least 120 seconds. Omitting this uses the runtime's existing authentication. + /// Opaque SDK registration for a refreshable hosting credential. Tokens are requested only from the owning SDK connection through gitHubToken.getToken. A supplied lifetime must be at least 120 seconds; omission explicitly means unknown lifetime with bounded periodic refresh. Omitting this registration uses the runtime's existing authentication. #[serde(skip_serializing_if = "Option::is_none")] pub credential_provider_registration_id: Option, /// Registration kind. Defaults to user-local; managed kinds adopt the preallocated environment identified by the authenticated owner and computeId. @@ -9373,6 +9375,9 @@ pub struct HostConfiguration { pub resume_factory: bool, /// Whether session materialization is delegated to the owning application. pub session_factory: bool, + /// Workspace callbacks are confined to the owning SDK connection and never replace durable session-state IO. + #[serde(skip_serializing_if = "Option::is_none")] + pub workspace_provider: Option, } /// Stops a connection-owned listener and joins its teardown. @@ -9752,6 +9757,8 @@ pub struct HostStartOptions { legacy: HostStartRequest, #[serde(skip_serializing_if = "Option::is_none")] compute_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + workspace_provider: Option, } impl HostStartOptions { @@ -9766,6 +9773,7 @@ impl HostStartOptions { resume_factory: None, }, compute_id: None, + workspace_provider: None, } } @@ -9798,6 +9806,12 @@ impl HostStartOptions { self.compute_id = Some(value.into()); self } + + /// Opt in to the owning application's remote workspace. Requires both session factories; durable session state remains independent. + pub fn workspace_provider(mut self, value: bool) -> Self { + self.workspace_provider = Some(value); + self + } } /// Listener readiness, returned only after binding and the supervised participant's SDK handshake. @@ -9827,6 +9841,62 @@ pub struct HostStartResult { pub url: Option, } +/// A supervised child's request. The runtime supplies host identity rather than accepting it from the child. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HostWorkspaceCallRequest { + /// Selects the workspace/AHP parameter and result shapes carried by the serialized payload. + pub operation: HostWorkspaceOperation, + /// Serialized operation parameters preserve AHP integer offsets and opaque etags without an untyped numeric projection. + pub payload: String, +} + +/// A bounded callback to the SDK connection that owns this host, including before any session exists. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HostWorkspaceExecuteRequest { + /// Runtime-assigned host identity bound to this SDK connection; never supplied by a workspace client. + pub host_id: String, + /// Selects the workspace/AHP parameter and result shapes carried by the serialized payload. + pub operation: HostWorkspaceOperation, + /// Serialized parameters and physical path guards, preserving integer offsets and opaque metadata. + pub payload: String, + /// Unique callback invocation identity; original AHP metadata remains inside the payload. + pub request_id: RequestId, +} + +/// Successful payloads use the corresponding workspace/AHP result shape. An error carries no usable result. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HostWorkspaceExecuteResult { + /// Safe allowlisted failure classification; omission indicates a successful payload. + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, + /// Serialized operation result; ignored when an error is present. + pub payload: String, +} + /// Catalogue identity retained from a bound candidate or plan at installation time. /// ///
@@ -30342,6 +30412,27 @@ pub struct HostGetConfigurationResult { pub resume_factory: bool, /// Whether session materialization is delegated to the owning application. pub session_factory: bool, + /// Workspace callbacks are confined to the owning SDK connection and never replace durable session-state IO. + #[serde(skip_serializing_if = "Option::is_none")] + pub workspace_provider: Option, +} + +/// Successful payloads use the corresponding workspace/AHP result shape. An error carries no usable result. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HostWorkspaceResult { + /// Safe allowlisted failure classification; omission indicates a successful payload. + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, + /// Serialized operation result; ignored when an error is present. + pub payload: String, } /// Empty acknowledgement for a completed host lifecycle operation. @@ -41969,6 +42060,92 @@ pub enum HostExitReason { Unknown, } +/// The closed operation set for host-scoped remote workspace IO. Watchers and process/Git execution are intentionally absent. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum HostWorkspaceOperation { + /// Declare immutable canonical remote roots and exclusions before host admission. + #[serde(rename = "describe")] + Describe, + /// Resolve paths and optionally discover project identity within the declared boundaries. + #[serde(rename = "resolve")] + Resolve, + /// Read remote file content with the requested encoding. + #[serde(rename = "read")] + Read, + /// Write through a physical guard while preserving offsets, modes, etags and create-only behavior. + #[serde(rename = "write")] + Write, + /// Inspect remote entry metadata and optional etag. + #[serde(rename = "stat")] + Stat, + /// List entries in an authorized remote directory. + #[serde(rename = "list")] + List, + /// Copy a file while checking both source and destination guards. + #[serde(rename = "copy")] + Copy, + /// Move an entry while enforcing subtree exclusions at both paths. + #[serde(rename = "move")] + Move, + /// Delete an authorized entry without crossing excluded subtrees. + #[serde(rename = "delete")] + Delete, + /// Create the authorized directory and missing parent directories. + #[serde(rename = "mkdir")] + Mkdir, + /// Check requested remote read and write access independently. + #[serde(rename = "access")] + Access, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Only these errors cross the workspace callback boundary; arbitrary provider diagnostics are not exposed. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum HostWorkspaceErrorCode { + /// The operation parameters do not satisfy the workspace contract. + #[serde(rename = "invalidParams")] + InvalidParams, + /// The physical guard or authorization rejected access. + #[serde(rename = "permissionDenied")] + PermissionDenied, + /// The requested remote entry does not exist. + #[serde(rename = "notFound")] + NotFound, + /// An entry already exists where exclusive creation was requested. + #[serde(rename = "alreadyExists")] + AlreadyExists, + /// An etag or concurrent-state precondition failed. + #[serde(rename = "conflict")] + Conflict, + /// This provider does not support the requested operation. + #[serde(rename = "notImplemented")] + NotImplemented, + /// The provider failed without exposing private diagnostic details. + #[serde(rename = "internal")] + Internal, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Reviewed resource discriminator. #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum InstallationReviewMcpResource { diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index 518b3d0208..bcc90857f6 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -1789,6 +1789,37 @@ impl<'a> ClientRpcHost<'a> { Ok(serde_json::from_value(_value)?) } + /// Routes a remote workspace operation only from its supervised child to its owning SDK connection. + /// + /// Wire method: `host.workspace`. + /// + /// # Parameters + /// + /// * `params` - A supervised child's request. The runtime supplies host identity rather than accepting it from the child. + /// + /// # Returns + /// + /// Successful payloads use the corresponding workspace/AHP result shape. An error carries no usable result. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub(crate) async fn workspace( + &self, + params: HostWorkspaceCallRequest, + ) -> Result { + let wire_params = serde_json::to_value(params)?; + let _value = self + .client + .call(rpc_methods::HOST_WORKSPACE, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + /// Reports a supervised hosting participant's bound AHP endpoint after its SDK handshake. /// /// Wire method: `host.ready`. diff --git a/scripts/codegen/utils.ts b/scripts/codegen/utils.ts index eca2a34182..da5f52d4d3 100644 --- a/scripts/codegen/utils.ts +++ b/scripts/codegen/utils.ts @@ -14,7 +14,6 @@ import path from "path"; import { fileURLToPath } from "url"; import { promisify } from "util"; import { COPILOT_CLI_VERSION } from "../../nodejs/src/cliVersion.js"; -import { ensureCopilotPackage } from "../../nodejs/scripts/releaseArtifacts.js"; import { findRuntimeRoot } from "../runtime-layout.mjs"; import { extensibleEnumValues } from "./extensible-enums.js"; @@ -115,7 +114,9 @@ export async function resolveCopilotSchemaPaths( "COPILOT_CLI_SCHEMA_DIR is required when COPILOT_RUNTIME_SOURCE=checkout; generate the runtime schemas and select their directory explicitly.", ); } else { - const acquirePackage = options.acquirePackage ?? ensureCopilotPackage; + const acquirePackage = + options.acquirePackage ?? + (await import("../../nodejs/scripts/releaseArtifacts.js")).ensureCopilotPackage; schemaDirectory = path.join(await acquirePackage(COPILOT_CLI_VERSION), "schemas"); } From 91cdf52ec658a22200de6037eea1368137041660 Mon Sep 17 00:00:00 2001 From: C0deKing <16599358+C0deKing@users.noreply.github.com> Date: Mon, 12 Oct 2026 01:53:51 +0000 Subject: [PATCH 6/6] Preserve remote move destination preconditions Keep copy and move conditions typed and document exact byte-offset behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/runtime-supervised-host.md | 10 ++++++++ go/host_workspace.go | 10 +++----- go/host_workspace_test.go | 44 +++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 6 deletions(-) diff --git a/docs/runtime-supervised-host.md b/docs/runtime-supervised-host.md index cdd5545057..39981f17c9 100644 --- a/docs/runtime-supervised-host.md +++ b/docs/runtime-supervised-host.md @@ -229,6 +229,16 @@ with an unguarded write or shell interpolation. A provider may strengthen concurrency protection; it must not claim protection against unrelated processes that it does not actually enforce. +Offsets count bytes, not characters. With the default `truncate` mode, preserve +the prefix before `Position` and replace the remainder with `Data`. `insert` +splices data at that offset and shifts the tail. `append` counts `Position` +backward from EOF: zero uses append semantics; a positive value inserts before +that many trailing bytes. Reject negative offsets and offsets beyond the file. +`CreateOnly` is only valid with `truncate` and cannot be combined with `IfMatch`. +Both copy and move preserve `FailIfExists`; copy accepts files, not directories. +`Stat` implements AHP `resourceResolve`. Its `FollowSymlinks=false` path mirrors +the native conservative create-style resolver, which rejects a final symlink. + `AhpWorkspaceCall` carries the owning `HostID` and a per-invocation `RequestID`. The provider is installed before `host.start`, so discovery works without a session. Calls have a 25-second SDK deadline, at most eight concurrent SDK diff --git a/go/host_workspace.go b/go/host_workspace.go index 56d259af2d..f835e1b8fd 100644 --- a/go/host_workspace.go +++ b/go/host_workspace.go @@ -189,14 +189,12 @@ type AhpWorkspaceListResult struct { type AhpWorkspaceMoveParams struct { AhpWorkspaceResourceMetadata - Source string `json:"source"` - Destination string `json:"destination"` + Source string `json:"source"` + Destination string `json:"destination"` + FailIfExists *bool `json:"failIfExists,omitempty"` } -type AhpWorkspaceCopyParams struct { - AhpWorkspaceMoveParams - FailIfExists *bool `json:"failIfExists,omitempty"` -} +type AhpWorkspaceCopyParams = AhpWorkspaceMoveParams type AhpWorkspaceDeleteParams struct { AhpWorkspaceURIParams diff --git a/go/host_workspace_test.go b/go/host_workspace_test.go index 37c7a68648..6fa5a3d9db 100644 --- a/go/host_workspace_test.go +++ b/go/host_workspace_test.go @@ -101,6 +101,50 @@ func TestAhpWorkspaceWritePreservesGuardAndExactOffsets(t *testing.T) { } } +func TestAhpWorkspaceCopyAndMovePreserveDestinationPreconditions(t *testing.T) { + fail, overwrite := true, false + for _, operation := range []string{"copy", "move"} { + for _, test := range []struct { + name string + flag *bool + }{{"omitted", nil}, {"refuse replacement", &fail}, {"allow replacement", &overwrite}} { + t.Run(operation+"/"+test.name, func(t *testing.T) { + called := false + mutate := func(_ context.Context, request AhpWorkspaceResourceRequest[AhpWorkspaceMoveParams]) error { + called = true + flag := request.Params.FailIfExists + if (flag == nil) != (test.flag == nil) || (test.flag != nil && *flag != *test.flag) { + t.Fatalf("lost destination precondition: %+v", request.Params) + } + if request.Params.Source != "file:///hands/repo/source" || + request.Params.Destination != "file:///hands/repo/destination" || + request.Params.Channel != "ahp-session:/canonical" { + t.Fatalf("lost move/copy parameters: %+v", request.Params) + } + return nil + } + client := workspaceTestClient(t, &AhpWorkspaceProvider{Copy: mutate, Move: mutate}) + params := map[string]any{ + "channel": "ahp-session:/canonical", + "source": "file:///hands/repo/source", + "destination": "file:///hands/repo/destination", + } + if test.flag != nil { + params["failIfExists"] = *test.flag + } + payload, err := json.Marshal(map[string]any{"params": params, "guard": map[string]any{}}) + if err != nil { + t.Fatal(err) + } + result := workspaceTestExecute(t, client, "host", operation, string(payload)) + if !called || result.Error != nil || result.Payload != "{}" { + t.Fatalf("unexpected mutation result: %+v", result) + } + }) + } + } +} + func TestAhpWorkspaceFailuresDoNotExposeProviderDiagnostics(t *testing.T) { for _, test := range []struct { name string